tokentracker-cli 1.0.0 → 1.0.1

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 (99) hide show
  1. package/dashboard/dist/assets/{AchievementBadge-Dpf3VBcS.js → AchievementBadge-pib0F8p8.js} +1 -1
  2. package/dashboard/dist/assets/{AchievementsPage-BSGbLI5V.js → AchievementsPage-BMnub6CL.js} +2 -2
  3. package/dashboard/dist/assets/{AchievementsSection-C10HXoq1.js → AchievementsSection-DG_-yxAt.js} +1 -1
  4. package/dashboard/dist/assets/{BadgeDetailModal-DajrEc3e.js → BadgeDetailModal-Sk2dHIkJ.js} +1 -1
  5. package/dashboard/dist/assets/{BotAnimated-BpbTCJML.js → BotAnimated-VwwvOniA.js} +1 -1
  6. package/dashboard/dist/assets/{Card-CDCj927L.js → Card-COfjRX96.js} +1 -1
  7. package/dashboard/dist/assets/{ClawdAnimated-CiTkm04x.js → ClawdAnimated-C3sF5c29.js} +2 -2
  8. package/dashboard/dist/assets/{CommandPalette-CYHUUX7M.js → CommandPalette-DvJFPsR2.js} +1 -1
  9. package/dashboard/dist/assets/{CommunityStatsModal-BHZehk5P.js → CommunityStatsModal-DfYHIeKr.js} +1 -1
  10. package/dashboard/dist/assets/{ConfirmModal-DZlT_xe_.js → ConfirmModal-DtoHm0RD.js} +1 -1
  11. package/dashboard/dist/assets/{Controls-Bcijikco.js → Controls-DHHn10dy.js} +1 -1
  12. package/dashboard/dist/assets/{DashboardPage-yREqx-tx.js → DashboardPage-DJ_nDPjA.js} +1 -1
  13. package/dashboard/dist/assets/{DevicePage-DzisRlts.js → DevicePage-DlXWUpau.js} +1 -1
  14. package/dashboard/dist/assets/{DialogClose-CQ9hFUNv.js → DialogClose-BLegTe7F.js} +1 -1
  15. package/dashboard/dist/assets/DialogDescription-Dl_wqXjc.js +1 -0
  16. package/dashboard/dist/assets/{DialogTitle--bItxq3K.js → DialogTitle-BZb-SEg0.js} +1 -1
  17. package/dashboard/dist/assets/{FadeIn-v5sAHZBu.js → FadeIn-Dsk0V4DK.js} +1 -1
  18. package/dashboard/dist/assets/{HeaderGithubStar-Bg8R51fN.js → HeaderGithubStar-B20nLMWQ.js} +1 -1
  19. package/dashboard/dist/assets/{HoverTooltip-DToNFKkJ.js → HoverTooltip-tGFmzZiJ.js} +1 -1
  20. package/dashboard/dist/assets/{IpCheckPage-BmFXYXZm.js → IpCheckPage-BK7XI_aT.js} +1 -1
  21. package/dashboard/dist/assets/{LandingPage-COpRacX0.js → LandingPage-BYX6NXbl.js} +2 -2
  22. package/dashboard/dist/assets/{LeaderboardAvatar-D0l8_L_d.js → LeaderboardAvatar-CIDqKSNn.js} +1 -1
  23. package/dashboard/dist/assets/{LeaderboardPage-BJHS44Fq.js → LeaderboardPage-BxIpRUwn.js} +2 -2
  24. package/dashboard/dist/assets/{LeaderboardProfileModal-C1K9rSGn.js → LeaderboardProfileModal-DJlNN9YG.js} +3 -3
  25. package/dashboard/dist/assets/{LeaderboardProfilePage-CvR48D_y.js → LeaderboardProfilePage-D4HSgrjG.js} +1 -1
  26. package/dashboard/dist/assets/{LimitsPage-BN79yMkb.js → LimitsPage-BKTMBbKS.js} +1 -1
  27. package/dashboard/dist/assets/{LocalOnlyNotice-BwTJpkDW.js → LocalOnlyNotice-DpZiPX4A.js} +1 -1
  28. package/dashboard/dist/assets/{LoginCard-BMXAg1rZ.js → LoginCard-Cd03cg54.js} +1 -1
  29. package/dashboard/dist/assets/{LoginModal-Bf0F_UPK.js → LoginModal-yPZi5JsE.js} +1 -1
  30. package/dashboard/dist/assets/{LoginPage-BylH2waa.js → LoginPage-BTL9oeVV.js} +1 -1
  31. package/dashboard/dist/assets/{PetPage-X4v_J-Uj.js → PetPage-BWMSKd_3.js} +1 -1
  32. package/dashboard/dist/assets/{PopoverPopup-yEQVU5C_.js → PopoverPopup-Dba9PYte.js} +1 -1
  33. package/dashboard/dist/assets/{ProviderIcon-KRXIghW0.js → ProviderIcon-DXI7Ztov.js} +1 -1
  34. package/dashboard/dist/assets/{ResetPasswordPage-DQQF2rsl.js → ResetPasswordPage-wKDU07tl.js} +1 -1
  35. package/dashboard/dist/assets/{SegmentedControl-VkVwcoXk.js → SegmentedControl-DZh5rJHn.js} +1 -1
  36. package/dashboard/dist/assets/{Select-CxW2C8OG.js → Select-CiJIsDf1.js} +1 -1
  37. package/dashboard/dist/assets/{SelectItemText-D6vhaI0Q.js → SelectItemText-B8YkLJtE.js} +1 -1
  38. package/dashboard/dist/assets/{ServiceStatusPage-CCKqUZhI.js → ServiceStatusPage-CF_bMZMz.js} +1 -1
  39. package/dashboard/dist/assets/{SessionsPage-Huqt77Qt.js → SessionsPage-B0PnK1TY.js} +1 -1
  40. package/dashboard/dist/assets/{SettingsPage-CpX8GYce.js → SettingsPage-onYZIk-h.js} +2 -2
  41. package/dashboard/dist/assets/{SkillsPage-S1dtu_Cd.js → SkillsPage-CSyoblke.js} +1 -1
  42. package/dashboard/dist/assets/{TokenGalaxy-BayM0FOG.js → TokenGalaxy-kK6wMGuy.js} +1 -1
  43. package/dashboard/dist/assets/{ToolbarRootContext-B1KG8B5q.js → ToolbarRootContext-CnffyHPW.js} +1 -1
  44. package/dashboard/dist/assets/{TrendMonitor-DYqz9nLw.js → TrendMonitor-CpxDm5q_.js} +1 -1
  45. package/dashboard/dist/assets/{WidgetsPage-WuzVeCBG.js → WidgetsPage-vBedlR_d.js} +1 -1
  46. package/dashboard/dist/assets/{WrappedPage-Bpn9GYHz.js → WrappedPage-D25YzXGY.js} +1 -1
  47. package/dashboard/dist/assets/{__vite-browser-external-B1XxVtUQ.js → __vite-browser-external-OxXsgcds.js} +2 -2
  48. package/dashboard/dist/assets/{agent-logos-DVE956SY.js → agent-logos-frktji23.js} +1 -1
  49. package/dashboard/dist/assets/{arrow-up-right-B7aZy0wJ.js → arrow-up-right-BtBcf39e.js} +1 -1
  50. package/dashboard/dist/assets/{check-55YI8PGo.js → check-PVwhLtMf.js} +1 -1
  51. package/dashboard/dist/assets/{composite--O2XKSlW.js → composite-BxlyIOoF.js} +1 -1
  52. package/dashboard/dist/assets/{copy-DDVFmqF5.js → copy-s5UqKoXC.js} +1 -1
  53. package/dashboard/dist/assets/{download-DmIFrL1S.js → download-Ns8TNfey.js} +1 -1
  54. package/dashboard/dist/assets/{external-link-DwG_AAOo.js → external-link-zpvfw1sA.js} +1 -1
  55. package/dashboard/dist/assets/{flame-ANwvantJ.js → flame-DhPzeD5Z.js} +1 -1
  56. package/dashboard/dist/assets/{format-tokens-BzZ_DfX2.js → format-tokens-C4eAHkPw.js} +1 -1
  57. package/dashboard/dist/assets/{icons-CdyVgzlu.js → icons-CNeKwVFm.js} +1 -1
  58. package/dashboard/dist/assets/{index-B-1uJU_R.js → index-9qLVgAvh.js} +1 -1
  59. package/dashboard/dist/assets/{index-D8g1p_Ee.js → index-B5UHZH4-.js} +1 -1
  60. package/dashboard/dist/assets/{index-D0VhCSlC.js → index-D8ciCYQM.js} +1 -1
  61. package/dashboard/dist/assets/{info-n2XpcOlm.js → info-p2pKHzPt.js} +1 -1
  62. package/dashboard/dist/assets/{link-2-Bq9GUX22.js → link-2-BQhZyxUQ.js} +1 -1
  63. package/dashboard/dist/assets/{loader-circle-fkYFxXuJ.js → loader-circle-BnFE5J64.js} +1 -1
  64. package/dashboard/dist/assets/{maximize-2-C5v08iPD.js → maximize-2-Zt1L2xuV.js} +1 -1
  65. package/dashboard/dist/assets/{modifiers.esm-AG_bzlWZ.js → modifiers.esm-Sbhv1CrS.js} +1 -1
  66. package/dashboard/dist/assets/{monitor-smartphone-BEjlJhuw.js → monitor-smartphone-Pmy9ktPf.js} +1 -1
  67. package/dashboard/dist/assets/{plus-BfdtMxnD.js → plus-FPP4P4tW.js} +1 -1
  68. package/dashboard/dist/assets/{provider-display-BvjuoQty.js → provider-display-zpzUqFZ8.js} +1 -1
  69. package/dashboard/dist/assets/{react-f77D-LSn.js → react-C_5Bvle-.js} +1 -1
  70. package/dashboard/dist/assets/{search-Dmczow8i.js → search-7f0zYUoC.js} +1 -1
  71. package/dashboard/dist/assets/{skills-api-BuqPQei_.js → skills-api-CdEcHyY0.js} +1 -1
  72. package/dashboard/dist/assets/{sortable.esm-CDAVQaFQ.js → sortable.esm-DwOWVPK8.js} +1 -1
  73. package/dashboard/dist/assets/{store-C2inKcM-.js → store-D3n2aJ7w.js} +1 -1
  74. package/dashboard/dist/assets/{terminal-C1O422UZ.js → terminal-C6zDcArO.js} +1 -1
  75. package/dashboard/dist/assets/{trash-CXOKPZfQ.js → trash-C_bcv-F0.js} +1 -1
  76. package/dashboard/dist/assets/{use-community-stats-CKfyxLvl.js → use-community-stats-fCkrn5Kd.js} +1 -1
  77. package/dashboard/dist/assets/{use-latest-request-guard-C3rQR4BN.js → use-latest-request-guard-DD2Nt1qS.js} +1 -1
  78. package/dashboard/dist/assets/{use-limits-display-prefs-Ic4GUPRY.js → use-limits-display-prefs-a9HtQcOE.js} +1 -1
  79. package/dashboard/dist/assets/{use-ordered-list-Cvbz_wcj.js → use-ordered-list-B6-Nb6rL.js} +1 -1
  80. package/dashboard/dist/assets/use-reduced-motion-DyXrwS-h.js +1 -0
  81. package/dashboard/dist/assets/{use-session-efficiency-pref-u_qW99gD.js → use-session-efficiency-pref-gD9i2h4k.js} +1 -1
  82. package/dashboard/dist/assets/{use-transform-CVGiBxJK.js → use-transform-DP6mCHUn.js} +1 -1
  83. package/dashboard/dist/assets/{use-usage-limits-MPu696v0.js → use-usage-limits-TdwK-gf2.js} +1 -1
  84. package/dashboard/dist/assets/{useCurrency-BOBz18If.js → useCurrency-Bbxwhe-A.js} +1 -1
  85. package/dashboard/dist/assets/{useTokenFormat-BooCzJJZ.js → useTokenFormat-CzeTrne_.js} +1 -1
  86. package/dashboard/dist/assets/{zap-M_x9dAwo.js → zap-CucEQWyU.js} +1 -1
  87. package/dashboard/dist/index.html +1 -1
  88. package/dashboard/dist/ip-check.html +1 -1
  89. package/dashboard/dist/leaderboard.html +1 -1
  90. package/dashboard/dist/share.html +1 -1
  91. package/package.json +1 -1
  92. package/src/commands/status.js +3 -0
  93. package/src/commands/sync.js +10 -1
  94. package/src/lib/codex-rollout-parser.js +86 -8
  95. package/src/lib/codex-usage-record.js +195 -0
  96. package/src/lib/pricing/seed-snapshot.json +1 -1
  97. package/src/lib/rollout.js +154 -1
  98. package/dashboard/dist/assets/DialogDescription-CLXWH3lG.js +0 -1
  99. package/dashboard/dist/assets/use-reduced-motion-DewlF5tk.js +0 -1
@@ -1 +1 @@
1
- import{m as Zt,bn as en,r as y,bB as tn,be as nn,aN as on,bC as sn,E as Pt,w as rn,bg as z,bD as oe,bA as me,bE as te,aC as q,bF as Ye,bG as Te,bH as Ne,bI as cn,bJ as Tt,bK as ln,bL as qe,bM as Mt,bN as Fe,bO as Xe,bP as pt,bQ as Dt,a2 as an,ax as se,bf as Ue,bh as Lt,bR as fn,v as un,bS as dn}from"./__vite-browser-external-B1XxVtUQ.js";import{o as He,D as gn,q as mn,v as Se,b as hn,g as pn}from"./composite--O2XKSlW.js";const kt={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};kt.node;const ko=Zt(kt),ge=Math.min,U=Math.max,Me=Math.round,Ee=Math.floor,K=e=>({x:e,y:e}),xn={left:"right",right:"left",bottom:"top",top:"bottom"};function Ft(e,t,n){return U(e,ge(t,n))}function ne(e,t){return typeof e=="function"?e(t):e}function j(e){return e.split("-")[0]}function G(e){return e.split("-")[1]}function Ke(e){return e==="x"?"y":"x"}function Ge(e){return e==="y"?"height":"width"}function X(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Je(e){return Ke(X(e))}function wn(e,t,n){n===void 0&&(n=!1);const o=G(e),i=Je(e),s=Ge(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=De(r)),[r,De(r)]}function yn(e){const t=De(e);return[je(e),t,je(t)]}function je(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xt=["left","right"],wt=["right","left"],bn=["top","bottom"],Rn=["bottom","top"];function vn(e,t,n){switch(e){case"top":case"bottom":return n?t?wt:xt:t?xt:wt;case"left":case"right":return t?bn:Rn;default:return[]}}function An(e,t,n,o){const i=G(e);let s=vn(j(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(je)))),s}function De(e){const t=j(e);return xn[t]+e.slice(t.length)}function On(e){var t,n,o,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(i=e.left)!=null?i:0}}function Wt(e){return typeof e!="number"?On(e):{top:e,right:e,bottom:e,left:e}}function Le(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Fo(e,t={}){const{enabled:n=!0,event:o="click",toggle:i=!0,ignoreMouse:s=!1,stickIfOpen:r=!0,touchOpenDelay:c=0,reason:l=en}=t,a="rootStore"in e?e.rootStore:e,u=a.context.dataRef,d=y.useRef(void 0),m=tn(),f=nn(),h=y.useMemo(()=>{function x(g,p,v,b){const R=rn(l,p,v);g&&b==="touch"&&c>0?f.start(c,()=>{a.setOpen(!0,R)}):a.setOpen(g,R)}function w(g,p,v){const b=u.current.openEvent,R=a.select("domReferenceElement")!==p;return g&&R||!g||!i?!0:b&&r?!v(b.type):!1}return{onPointerDown(g){d.current=He(g.pointerType,!0)&&gn(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){const p=d.current,v=g.nativeEvent,b=a.select("open");if(g.button!==0||o==="click"||He(p,!0)&&s)return;const R=w(b,g.currentTarget,O=>O==="click"||O==="mousedown"),A=on(v);if(sn(A)){x(R,v,A,p);return}const S=g.currentTarget;m.request(()=>{x(R,v,S,p)})},onClick(g){if(o==="mousedown-only")return;const p=d.current;if(o==="mousedown"&&p){d.current=void 0;return}if(He(p,!0)&&s)return;const v=a.select("open"),b=w(v,g.currentTarget,R=>R==="click"||R==="mousedown"||R==="keydown"||R==="keyup");x(b,g.nativeEvent,g.currentTarget,p)},onKeyDown(){d.current=void 0}}},[u,o,s,l,a,r,i,m,f,c]);return y.useMemo(()=>n?{reference:h}:Pt,[n,h])}function yt(e,t,n){let{reference:o,floating:i}=e;const s=X(t),r=Je(t),c=Ge(r),l=j(t),a=s==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let f;switch(l){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}const h=G(t);return h&&(f[r]+=m*(h==="end"?1:-1)*(n&&a?-1:1)),f}async function Cn(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=ne(t,e),h=Wt(f),w=c[m?d==="floating"?"reference":"floating":d],g=Le(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:u,strategy:l})),p=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.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},R=Le(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:p,offsetParent:v,strategy:l}):p);return{top:(g.top-R.top+h.top)/b.y,bottom:(R.bottom-g.bottom+h.bottom)/b.y,left:(g.left-R.left+h.left)/b.x,right:(R.right-g.right+h.right)/b.x}}const Sn=50,En=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Cn},l=await(r.isRTL==null?void 0:r.isRTL(t));let a=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=yt(a,o,l),m=o,f=0;const h={};for(let x=0;x<s.length;x++){const w=s[x];if(!w)continue;const{name:g,fn:p}=w,{x:v,y:b,data:R,reset:A}=await p({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:a,platform:c,elements:{reference:e,floating:t}});u=v??u,d=b??d,h[g]={...h[g],...R},A&&f<Sn&&(f++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(a=A.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:u,y:d}=yt(a,m,l)),x=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},Pn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:x=!0,...w}=ne(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=j(i),p=X(c),v=j(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),R=m||(v||!x?[De(c)]:yn(c)),A=h!=="none";!m&&A&&R.push(...An(c,x,h,b));const S=[c,...R],O=await l.detectOverflow(t,w),M=[];let T=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&M.push(O[g]),d){const W=wn(i,r,b);M.push(O[W[0]],O[W[1]])}if(T=[...T,{placement:i,overflows:M}],!M.every(W=>W<=0)){var E,F;const W=(((E=s.flip)==null?void 0:E.index)||0)+1,I=S[W];if(I&&(!(d==="alignment"?p!==X(I):!1)||T.every(C=>X(C.placement)===p?C.overflows[0]>0:!0)))return{data:{index:W,overflows:T},reset:{placement:I}};let L=(F=T.filter(k=>k.overflows[0]<=0).sort((k,C)=>k.overflows[1]-C.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(f){case"bestFit":{var $;const k=($=T.filter(C=>{if(A){const _=X(C.placement);return _===p||_==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(_=>_>0).reduce((_,V)=>_+V,0)]).sort((C,_)=>C[1]-_[1])[0])==null?void 0:$[0];k&&(L=k);break}case"initialPlacement":L=c;break}if(i!==L)return{reset:{placement:L}}}return{}}}},$t=new Set(["left","top"]);async function Tn(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=j(n),c=G(n),l=X(n)==="y",a=$t.has(r)?-1:1,u=s&&l?-1:1,d=ne(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof h=="number"&&(f=c==="end"?h*-1:h),l?{x:f*u,y:m*a}:{x:m*a,y:f*u}}const Mn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=t,l=await Tn(t,e);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},Dn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i,platform:s}=t,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...a}=ne(e,t),u={x:n,y:o},d=await s.detectOverflow(t,a),m=X(i),f=Ke(m);let h=u[f],x=u[m];const w=(p,v)=>Ft(v+d[p==="y"?"top":"left"],v,v-d[p==="y"?"bottom":"right"]);r&&(h=w(f,h)),c&&(x=w(m,x));const g=l.fn({...t,[f]:h,[m]:x});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[f]:r,[m]:c}}}}}},Ln=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:i,y:s,placement:r,rects:c,middlewareData:l}=t,{offset:a=0,mainAxis:u=!0,crossAxis:d=!0}=ne(e,t),m={x:i,y:s},f=X(r),h=Ke(f);let x=m[h],w=m[f];const g=ne(a,t),p=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(u){const R=h==="y"?"height":"width",A=c.reference[h]-c.floating[R]+p.mainAxis,S=c.reference[h]+c.reference[R]-p.mainAxis;x<A?x=A:x>S&&(x=S)}if(d){var v,b;const R=h==="y"?"width":"height",A=$t.has(j(r)),S=c.reference[f]-c.floating[R]+(A&&((v=l.offset)==null?void 0:v[f])||0)+(A?0:p.crossAxis),O=c.reference[f]+c.reference[R]+(A?0:((b=l.offset)==null?void 0:b[f])||0)-(A?p.crossAxis:0);w<S?w=S:w>O&&(w=O)}return{[h]:x,[f]:w}}}},kn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:i,elements:s}=t,{apply:r=()=>{},...c}=ne(e,t),l=await i.detectOverflow(t,c),a=j(n),u=G(n),d=X(n)==="y",{width:m,height:f}=o.floating;let h,x;a==="top"||a==="bottom"?(h=a,x=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(x=a,h=u==="end"?"top":"bottom");const w=f-l.top-l.bottom,g=m-l.left-l.right,p=ge(f-l[h],w),v=ge(m-l[x],g),b=t.middlewareData.shift,R=!b;let A=p,S=v;b!=null&&b.enabled.x&&(S=g),b!=null&&b.enabled.y&&(A=w),R&&!u&&(d?S=m-2*U(l.left,l.right):A=f-2*U(l.top,l.bottom)),await r({...t,availableWidth:S,availableHeight:A});const O=await i.getDimensions(s.floating);return m!==O.width||f!==O.height?{reset:{rects:!0}}:{}}}};function It(e){const t=te(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=me(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,c=Me(n)!==s||Me(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function Qe(e){return z(e)?e:e.contextElement}function de(e){const t=Qe(e);if(!me(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=It(t);let r=(s?Me(n.width):n.width)/o,c=(s?Me(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Fn=K(0);function Vt(e){const t=q(e);return!Dt()||!t.visualViewport?Fn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===q(e)}function re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Qe(e);let r=K(1);t&&(o?z(o)&&(r=de(o)):r=de(e));const c=Wn(s,n,o)?Vt(s):K(0);let l=(i.left+c.x)/r.x,a=(i.top+c.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(s&&o){const m=q(s),f=z(o)?q(o):o;let h=m,x=pt(h);for(;x&&f!==h;){const w=de(x),g=x.getBoundingClientRect(),p=te(x),v=g.left+(x.clientLeft+parseFloat(p.paddingLeft))*w.x,b=g.top+(x.clientTop+parseFloat(p.paddingTop))*w.y;l*=w.x,a*=w.y,u*=w.x,d*=w.y,l+=v,a+=b,h=q(x),x=pt(h)}}return Le({width:u,height:d,x:l,y:a})}function We(e,t){const n=Fe(e).scrollLeft;return t?t.left+n:re(oe(e)).left+n}function _t(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-We(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function $n(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=oe(o),c=t?Ye(t.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=K(1);const u=K(0),d=me(o);if((d||!s)&&((qe(o)!=="body"||Mt(r))&&(l=Fe(o)),d)){const f=re(o);a=de(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!s?_t(r,l):K(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+u.x+m.x,y:n.y*a.y-l.scrollTop*a.y+u.y+m.y}}function In(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Vn(e){const t=Fe(e),n=e.ownerDocument.body,o=U(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=U(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+We(e);const r=-t.scrollTop;return te(n).direction==="rtl"&&(s+=U(e.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const _n=25;function Hn(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=q(e),s=oe(e),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,u=0;if(r){const m=!Dt()||t==="fixed";o?m||(a=-r.offsetLeft,u=-r.offsetTop):(c=r.width,l=r.height,m&&(a=r.offsetLeft,u=r.offsetTop))}if(We(s)<=0){const m=s.ownerDocument,f=m.body,h=getComputedStyle(f),x=m.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(s.clientWidth-f.clientWidth-x),g=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;g<=_n&&(c-=g)}return{width:c,height:l,x:a,y:u}}function Bn(e,t){const n=re(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=de(e),r=e.clientWidth*s.x,c=e.clientHeight*s.y,l=i*s.x,a=o*s.y;return{width:r,height:c,x:l,y:a}}function bt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Hn(e,n,t);else if(t==="document")o=Vn(oe(e));else if(z(t))o=Bn(t,n);else{const i=Vt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Le(o)}function zn(e,t){const n=t.get(e);if(n)return n;let o=Xe(e,[],!1).filter(c=>z(c)&&qe(c)!=="body"),i=null;const s=te(e).position==="fixed";let r=s?Te(e):e;for(;z(r)&&!Ne(r);){const c=te(r),l=Tt(r),a=i?i.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(d=>d!==r):i=c,r=Te(r)}return t.set(e,o),o}function Nn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?Ye(t)?[]:zn(t,this._c):[].concat(n),o],c=bt(t,r[0],i);let l=c.top,a=c.right,u=c.bottom,d=c.left;for(let m=1;m<r.length;m++){const f=bt(t,r[m],i);l=U(f.top,l),a=ge(f.right,a),u=ge(f.bottom,u),d=U(f.left,d)}return{width:a-d,height:u-l,x:d,y:l}}function Xn(e){const{width:t,height:n}=It(e);return{width:t,height:n}}function jn(e,t,n){const o=me(t),i=oe(t),s=n==="fixed",r=re(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=K(0);if((o||!s)&&((qe(t)!=="body"||Mt(i))&&(c=Fe(t)),o)){const m=re(t,!0,s,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}!o&&i&&(l.x=We(i));const a=i&&!o&&!s?_t(i,c):K(0),u=r.left+c.scrollLeft-l.x-a.x,d=r.top+c.scrollTop-l.y-a.y;return{x:u,y:d,width:r.width,height:r.height}}function Be(e){return te(e).position==="static"}function Rt(e,t){if(!me(e)||te(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return oe(e)===n&&(n=n.ownerDocument.body),n}function Ht(e,t){const n=q(e);if(Ye(e))return n;if(!me(e)){let i=Te(e);for(;i&&!Ne(i);){if(z(i)&&!Be(i))return i;i=Te(i)}return n}let o=Rt(e,t);for(;o&&cn(o)&&Be(o);)o=Rt(o,t);return o&&Ne(o)&&Be(o)&&!Tt(o)?n:o||ln(e)||n}const Yn=async function(e){const t=this.getOffsetParent||Ht,n=this.getDimensions,o=await n(e.floating);return{reference:jn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function qn(e){return te(e).direction==="rtl"}const Un={convertOffsetParentRelativeRectToViewportRelativeRect:$n,getDocumentElement:oe,getClippingRect:Nn,getOffsetParent:Ht,getElementRects:Yn,getClientRects:In,getDimensions:Xn,getScale:de,isElement:z,isRTL:qn};function Bt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kn(e,t,n){let o=null,i;const s=oe(e);function r(){var u;clearTimeout(i),(u=o)==null||u.disconnect(),o=null}function c(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),r();const m=e.getBoundingClientRect(),{left:f,top:h,width:x,height:w}=m;if(u||t(),!x||!w)return;const g=Ee(h),p=Ee(s.clientWidth-(f+x)),v=Ee(s.clientHeight-(h+w)),b=Ee(f),A={rootMargin:-g+"px "+-p+"px "+-v+"px "+-b+"px",threshold:U(0,ge(1,d))||1};let S=!0;function O(M){const T=M[0].intersectionRatio;if(!Bt(m,e.getBoundingClientRect()))return c();if(T!==d){if(!S)return c();T?c(!1,T):i=setTimeout(()=>{c(!1,1e-7)},1e3)}S=!1}try{o=new IntersectionObserver(O,{...A,root:s.ownerDocument})}catch{o=new IntersectionObserver(O,A)}o.observe(e)}const l=q(e),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),r()}}function vt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Qe(e),u=i||s?[...a?Xe(a):[],...t?Xe(t):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n),s&&g.addEventListener("resize",n)});const d=a&&c?Kn(a,n,s):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[p]=g;p&&p.target===a&&f&&t&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),n()}),a&&!l&&f.observe(a),t&&f.observe(t));let h,x=l?re(e):null;l&&w();function w(){const g=re(e);x&&!Bt(x,g)&&n(),x=g,h=requestAnimationFrame(w)}return n(),()=>{var g;u.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const Gn=Mn,Jn=Dn,Qn=Pn,Zn=kn,eo=Ln,to=(e,t,n)=>{const o=new Map,i=n??{},s={...Un,...i.platform,_c:o};return En(e,t,{...i,platform:s})};var no=typeof document<"u",oo=function(){},Pe=no?y.useLayoutEffect:oo;function ke(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,i;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(!ke(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!ke(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function zt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function At(e,t){const n=zt(e);return Math.round(t*n)/n}function ze(e){const t=y.useRef(e);return Pe(()=>{t.current=e}),t}function io(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:r}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=y.useState(o);ke(m,o)||f(o);const[h,x]=y.useState(null),[w,g]=y.useState(null),p=y.useCallback(C=>{C!==A.current&&(A.current=C,x(C))},[]),v=y.useCallback(C=>{C!==S.current&&(S.current=C,g(C))},[]),b=s||h,R=r||w,A=y.useRef(null),S=y.useRef(null),O=y.useRef(u),M=l!=null,T=ze(l),E=ze(i),F=ze(a),$=y.useCallback(()=>{if(!A.current||!S.current)return;const C={placement:t,strategy:n,middleware:m};E.current&&(C.platform=E.current),to(A.current,S.current,C).then(_=>{const V={..._,isPositioned:F.current!==!1};W.current&&!ke(O.current,V)&&(O.current=V,an.flushSync(()=>{d(V)}))})},[m,t,n,E,F]);Pe(()=>{a===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(C=>({...C,isPositioned:!1})))},[a]);const W=y.useRef(!1);Pe(()=>(W.current=!0,()=>{W.current=!1}),[]),Pe(()=>{if(b&&(A.current=b),R&&(S.current=R),b&&R){if(T.current)return T.current(b,R,$);$()}},[b,R,$,T,M]);const I=y.useMemo(()=>({reference:A,floating:S,setReference:p,setFloating:v}),[p,v]),L=y.useMemo(()=>({reference:b,floating:R}),[b,R]),k=y.useMemo(()=>{const C={position:n,left:0,top:0};if(!L.floating)return C;const _=At(L.floating,u.x),V=At(L.floating,u.y);return c?{...C,transform:"translate("+_+"px, "+V+"px)",...zt(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:V}},[n,c,L.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:$,refs:I,elements:L,floatingStyles:k}),[u,$,I,L,k])}const so=(e,t)=>{const n=Gn(e);return{name:n.name,fn:n.fn,options:[e,t]}},ro=(e,t)=>{const n=Jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},co=(e,t)=>({fn:eo(e).fn,options:[e,t]}),lo=(e,t)=>{const n=Qn(e);return{name:n.name,fn:n.fn,options:[e,t]}},ao=(e,t)=>{const n=Zn(e);return{name:n.name,fn:n.fn,options:[e,t]}};function fo(e){return uo(e,e.rootContext)}function uo(e,t){const{nodeId:n,externalTree:o}=e,i=t.useState("referenceElement"),s=t.useState("floatingElement"),r=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[a,u]=y.useState(null),[d,m]=y.useState(void 0),[f,h]=y.useState(void 0),x=y.useRef(null),w=mn(o),g=y.useMemo(()=>({reference:i,floating:s,domReference:r}),[i,s,r]),p=io({...e,elements:{...g,...a&&{reference:a}}}),v=z(d)?d:null,b=f===void 0?t.state.floatingElement:f;t.useSyncedValue("referenceElement",d??null),t.useSyncedValue("domReferenceElement",d===void 0?r:v),t.useSyncedValue("floatingElement",b);const R=y.useCallback(E=>{const F=z(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;u(F),p.refs.setReference(F)},[p.refs]),A=y.useCallback(E=>{(z(E)||E===null)&&(x.current=E,m(E)),(z(p.refs.reference.current)||p.refs.reference.current===null||E!==null&&!z(E))&&p.refs.setReference(E)},[p.refs,m]),S=y.useCallback(E=>{h(E),p.refs.setFloating(E)},[p.refs]),O=y.useMemo(()=>({...p.refs,setReference:A,setFloating:S,setPositionReference:R,domReference:x}),[p.refs,A,S,R]),M=y.useMemo(()=>({...p.elements,domReference:r}),[p.elements,r]),T=y.useMemo(()=>({...p,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:O,elements:M,nodeId:n,rootStore:t}),[p,O,M,n,t,c,l]);return se(()=>{r&&(x.current=r)},[r]),se(()=>{t.context.dataRef.current.floatingContext=T;const E=w?.nodesRef.current.find(F=>F.id===n);E&&(E.context=T)}),y.useMemo(()=>({...p,context:T,refs:O,elements:M,rootStore:t}),[p,O,M,T,t])}const go=y.createContext(void 0);function mo(){return y.useContext(go)?.direction??"ltr"}const ho=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:c,middlewareData:l}=t,{element:a,padding:u=0,offsetParent:d="real"}=ne(e,t)||{};if(a==null)return{};const m=Wt(u),f={x:n,y:o},h=Je(i),x=Ge(h),w=await r.getDimensions(a),g=h==="y",p=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",R=s.reference[x]+s.reference[h]-f[h]-s.floating[x],A=f[h]-s.reference[h],S=d==="real"?await r.getOffsetParent?.(a):c.floating;let O=c.floating[b]||s.floating[x];(!O||!await r.isElement?.(S))&&(O=c.floating[b]||s.floating[x]);const M=R/2-A/2,T=O/2-w[x]/2-1,E=Math.min(m[p],T),F=Math.min(m[v],T),$=E,W=O-w[x]-F,I=O/2-w[x]/2+M,L=Ft($,I,W),k=!l.arrow&&G(i)!=null&&I!==L&&s.reference[x]/2-(I<$?E:F)-w[x]/2<0,C=k?I<$?I-$:I-W:0;return{[h]:f[h]+C,data:{[h]:L,centerOffset:I-L-C,...k&&{alignmentOffset:C}},reset:k}}}),po=(e,t)=>{const{name:n,fn:o}=ho(e);return{name:n,fn:o,options:[e,t]}},xo={name:"hide",async fn(e){const{width:t,height:n,x:o,y:i}=e.rects.reference,s=t===0&&n===0&&o===0&&i===0,r=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:r.top-n>=0||r.right-t>=0||r.bottom-n>=0||r.left-t>=0||s}}}},wo={sideX:"left",sideY:"top"},yo="--available-width",bo="--available-height",Ro="--anchor-width",vo="--anchor-height",Ao="--transform-origin",Ot=yo,Ct=bo;function Nt(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function St(e,t,n){const{rects:o,placement:i}=e;return{side:Nt(t,j(i),n),align:G(i)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Wo(e){return Oo(e,fo)}function Oo(e,t){const{anchor:n,positionMethod:o="absolute",side:i="bottom",sideOffset:s=0,align:r="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:a=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:m=!1,inline:f,keepMounted:h=!1,floatingRootContext:x,mounted:w,collisionAvoidance:g,shift:p,nodeId:v,adaptiveOrigin:b,lazyFlip:R=!1,externalTree:A}=e,[S,O]=y.useState(null);!w&&S!==null&&O(null);const M=g.side||"flip",T=g.align||"flip",E=g.fallbackAxisSide||"end",F=p?.crossAxis??!1,$=p?.rootBoundary,W=typeof n=="function"?n:void 0,I=Ue(W),L=W?I:n,k=Se(n),C=Se(w),V=mo()==="rtl",we=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":V?"left":"right","inline-start":V?"right":"left"}[i],Xt=r==="center"?we:`${we}-${r}`;let D=a;typeof D=="number"?D={top:D,right:D,bottom:D,left:D}:D&&(D={top:D.top||0,right:D.right||0,bottom:D.bottom||0,left:D.left||0});const J=1,jt=i==="bottom"?J:0,Yt=i==="top"?J:0,qt=i==="right"?J:0,Ut=i==="left"?J:0,ye={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:D},ie=y.useRef(null),$e=Se(s),Ie=Se(c),Kt=typeof s!="function"?s:0,Gt=typeof c!="function"?c:0,ce=[];f&&ce.push(f),ce.push(so(P=>{const B=St(P,i,V),N=typeof $e.current=="function"?$e.current(B):$e.current,H=typeof Ie.current=="function"?Ie.current(B):Ie.current;return{mainAxis:N,crossAxis:H,alignmentAxis:H}},[Kt,Gt,V,i]));const Ze=T==="none"&&M!=="shift",et=!Ze&&(u||F||M==="shift"),tt=M==="none"?null:lo({...ye,padding:{top:D.top+J+jt,right:D.right+J+Ut,bottom:D.bottom+J+Yt,left:D.left+J+qt},mainAxis:!F&&M==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:E}),nt=Ze?null:ro({...ye,rootBoundary:$,mainAxis:T!=="none",crossAxis:et,limiter:u||F?void 0:co(P=>{if(!ie.current)return{};const{width:B,height:N}=ie.current.getBoundingClientRect(),H=X(j(P.placement)),Z=H==="y"?B:N,Y=H==="y"?D.left+D.right:D.top+D.bottom;return{offset:Z/2+Y/2}})},[ye,u,F,$,D,T]);M==="shift"||T==="shift"||r==="center"?ce.push(nt,tt):ce.push(tt,nt),ce.push(ao({...ye,apply({elements:{floating:P},availableWidth:B,availableHeight:N,rects:H}){if(!C.current)return;const Z=P.style;Z.setProperty(Ot,`${B}px`),Z.setProperty(Ct,`${N}px`);const Y=q(P).devicePixelRatio||1,{x:Ae,y:ue,width:Oe,height:ee}=H.reference,pe=(Math.round((Ae+Oe)*Y)-Math.round(Ae*Y))/Y,xe=(Math.round((ue+ee)*Y)-Math.round(ue*Y))/Y;Z.setProperty(Ro,`${pe}px`),Z.setProperty(vo,`${xe}px`)}}),po(P=>({element:ie.current||Lt(P.elements.floating).createElement("div"),padding:ie.current?d:0,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(P){const{elements:{floating:B},middlewareData:N,placement:H,platform:Z,rects:Y,y:Ae}=P,ue=j(H),Oe=G(H),ee=X(ue)==="y",pe=ie.current,xe=typeof s=="function"?s(St(P,i,V)):s;let Ce;if(!pe&&Oe&&Math.abs(ee?N.shift?.x||0:N.shift?.y||0)<=1)Ce=Oe==="start"===(ee&&Z.isRTL?.(B)===!0)?"100%":"0%";else{const Jt=ee?N.arrow?.x||0:N.arrow?.y||0,Qt=ee?pe?.clientWidth||0:pe?.clientHeight||0;Ce=`${Jt+Qt/2}px`}let _e=ue==="top"||ue==="left"?`calc(100% + ${xe}px)`:`${-xe}px`;return et&&ee&&Math.abs(N.shift?.y||0)>xe&&(_e=`${Y.reference.y+Y.reference.height/2-Ae}px`),B.style.setProperty(Ao,ee?`${Ce} ${_e}`:`${_e} ${Ce}`),{}}},xo,b),se(()=>{!w&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,x]);const Ve=y.useMemo(()=>({ancestorScroll:!m,elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:le,elements:he,x:ot,y:it,middlewareData:ae,update:be,placement:st,context:rt,isPositioned:Q,floatingStyles:ct}=t({rootContext:x,open:h?w:void 0,placement:Xt,middleware:ce,strategy:o,whileElementsMounted:h?void 0:(...P)=>vt(...P,Ve),nodeId:v,externalTree:A}),{sideX:lt,sideY:at}=ae.adaptiveOrigin||wo,Re=Q?o:"fixed",ft=y.useMemo(()=>{let P;return Q?b?P={position:Re,[lt]:ot,[at]:it}:P={...ct,position:Re}:P={position:Re,top:0,left:0},P[Ot]="100vw",P[Ct]="100vh",Q||(P.opacity=0),P},[b,Re,lt,ot,at,it,ct,Q]),ve=y.useRef(null);se(()=>{if(!w)return;const P=k.current,B=typeof P=="function"?P():P,H=(Et(B)?B.current:B)||null||null;H!==ve.current&&(le.setPositionReference(H),ve.current=H)},[w,le,L,k]),y.useEffect(()=>{if(!w)return;const P=k.current;typeof P!="function"&&Et(P)&&P.current!==ve.current&&(le.setPositionReference(P.current),ve.current=P.current)},[w,le,L,k]),y.useEffect(()=>{if(h&&w&&he.reference&&he.floating)return vt(he.reference,he.floating,be,Ve)},[h,w,he,be,Ve]);const fe=j(st),ut=Nt(i,fe,V),dt=G(st)||"center",gt=!!ae.hide?.referenceHidden;se(()=>{R&&w&&Q&&fe!==we&&O(fe)},[R,w,Q,fe,we]);const mt=y.useMemo(()=>({position:"absolute",top:ae.arrow?.y,left:ae.arrow?.x}),[ae.arrow]),ht=ae.arrow?.centerOffset!==0;return y.useMemo(()=>({positionerStyles:ft,arrowStyles:mt,arrowRef:ie,arrowUncentered:ht,side:ut,align:dt,physicalSide:fe,anchorHidden:gt,refs:le,context:rt,isPositioned:Q,update:be}),[ft,mt,ie,ht,ut,dt,fe,gt,le,rt,Q,be])}function Et(e){return e!=null&&"current"in e}function Co(e){return e==="starting"?fn:Pt}function $o(e,t,{styles:n,transitionStatus:o,props:i,refs:s,hidden:r,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),un("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:r,style:l},Co(o),i],stateAttributesMapping:hn})}function So(e){const t=y.useRef(""),n=y.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:y.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function Eo(e,t){const n=y.useRef(e),o=Ue(t);se(()=>{n.current!==e&&o(n.current),n.current=e},[e,o])}function Po(e,t){const n=Ue((s,r)=>{(typeof e=="function"?e():e)||t(r||(dn?"touch":""))}),{onClick:o,onPointerDown:i}=So(n);return y.useMemo(()=>({onClick:o,onPointerDown:i}),[o,i])}function Io(e){const[t,n]=y.useState(null),o=Po(e,n);return Eo(e,i=>{i&&!e&&n(null)}),y.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const To=20;function Vo(e,t,n,o){const[i,s]=y.useState(!1);se(()=>{if(!e||!t||n==null){s(!1);return}const r=Lt(n).documentElement.clientWidth,c=n.offsetWidth;s(r>0&&c>0&&c>=r-To)},[e,t,n]),pn(e&&(!t||i),o)}const Mo=y.createContext(void 0);function _o(e){return y.useContext(Mo)}export{ko as C,Fo as a,Po as b,Wo as c,Vo as d,$o as e,_o as f,Co as g,Io as h,mo as i,Un as p,Le as r,Eo as u};
1
+ import{m as Zt,bn as en,r as y,bB as tn,be as nn,aN as on,bC as sn,E as Pt,w as rn,bg as z,bD as oe,bA as me,bE as te,aC as q,bF as Ye,bG as Te,bH as Ne,bI as cn,bJ as Tt,bK as ln,bL as qe,bM as Mt,bN as Fe,bO as Xe,bP as pt,bQ as Dt,a2 as an,ax as se,bf as Ue,bh as Lt,bR as fn,v as un,bS as dn}from"./__vite-browser-external-OxXsgcds.js";import{o as He,D as gn,q as mn,v as Se,b as hn,g as pn}from"./composite-BxlyIOoF.js";const kt={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};kt.node;const ko=Zt(kt),ge=Math.min,U=Math.max,Me=Math.round,Ee=Math.floor,K=e=>({x:e,y:e}),xn={left:"right",right:"left",bottom:"top",top:"bottom"};function Ft(e,t,n){return U(e,ge(t,n))}function ne(e,t){return typeof e=="function"?e(t):e}function j(e){return e.split("-")[0]}function G(e){return e.split("-")[1]}function Ke(e){return e==="x"?"y":"x"}function Ge(e){return e==="y"?"height":"width"}function X(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Je(e){return Ke(X(e))}function wn(e,t,n){n===void 0&&(n=!1);const o=G(e),i=Je(e),s=Ge(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=De(r)),[r,De(r)]}function yn(e){const t=De(e);return[je(e),t,je(t)]}function je(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xt=["left","right"],wt=["right","left"],bn=["top","bottom"],Rn=["bottom","top"];function vn(e,t,n){switch(e){case"top":case"bottom":return n?t?wt:xt:t?xt:wt;case"left":case"right":return t?bn:Rn;default:return[]}}function An(e,t,n,o){const i=G(e);let s=vn(j(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(je)))),s}function De(e){const t=j(e);return xn[t]+e.slice(t.length)}function On(e){var t,n,o,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(i=e.left)!=null?i:0}}function Wt(e){return typeof e!="number"?On(e):{top:e,right:e,bottom:e,left:e}}function Le(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Fo(e,t={}){const{enabled:n=!0,event:o="click",toggle:i=!0,ignoreMouse:s=!1,stickIfOpen:r=!0,touchOpenDelay:c=0,reason:l=en}=t,a="rootStore"in e?e.rootStore:e,u=a.context.dataRef,d=y.useRef(void 0),m=tn(),f=nn(),h=y.useMemo(()=>{function x(g,p,v,b){const R=rn(l,p,v);g&&b==="touch"&&c>0?f.start(c,()=>{a.setOpen(!0,R)}):a.setOpen(g,R)}function w(g,p,v){const b=u.current.openEvent,R=a.select("domReferenceElement")!==p;return g&&R||!g||!i?!0:b&&r?!v(b.type):!1}return{onPointerDown(g){d.current=He(g.pointerType,!0)&&gn(g.nativeEvent)?"virtual":g.pointerType},onMouseDown(g){const p=d.current,v=g.nativeEvent,b=a.select("open");if(g.button!==0||o==="click"||He(p,!0)&&s)return;const R=w(b,g.currentTarget,O=>O==="click"||O==="mousedown"),A=on(v);if(sn(A)){x(R,v,A,p);return}const S=g.currentTarget;m.request(()=>{x(R,v,S,p)})},onClick(g){if(o==="mousedown-only")return;const p=d.current;if(o==="mousedown"&&p){d.current=void 0;return}if(He(p,!0)&&s)return;const v=a.select("open"),b=w(v,g.currentTarget,R=>R==="click"||R==="mousedown"||R==="keydown"||R==="keyup");x(b,g.nativeEvent,g.currentTarget,p)},onKeyDown(){d.current=void 0}}},[u,o,s,l,a,r,i,m,f,c]);return y.useMemo(()=>n?{reference:h}:Pt,[n,h])}function yt(e,t,n){let{reference:o,floating:i}=e;const s=X(t),r=Je(t),c=Ge(r),l=j(t),a=s==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let f;switch(l){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}const h=G(t);return h&&(f[r]+=m*(h==="end"?1:-1)*(n&&a?-1:1)),f}async function Cn(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=ne(t,e),h=Wt(f),w=c[m?d==="floating"?"reference":"floating":d],g=Le(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:u,strategy:l})),p=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.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},R=Le(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:p,offsetParent:v,strategy:l}):p);return{top:(g.top-R.top+h.top)/b.y,bottom:(R.bottom-g.bottom+h.bottom)/b.y,left:(g.left-R.left+h.left)/b.x,right:(R.right-g.right+h.right)/b.x}}const Sn=50,En=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Cn},l=await(r.isRTL==null?void 0:r.isRTL(t));let a=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=yt(a,o,l),m=o,f=0;const h={};for(let x=0;x<s.length;x++){const w=s[x];if(!w)continue;const{name:g,fn:p}=w,{x:v,y:b,data:R,reset:A}=await p({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:a,platform:c,elements:{reference:e,floating:t}});u=v??u,d=b??d,h[g]={...h[g],...R},A&&f<Sn&&(f++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(a=A.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:u,y:d}=yt(a,m,l)),x=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},Pn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:x=!0,...w}=ne(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=j(i),p=X(c),v=j(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),R=m||(v||!x?[De(c)]:yn(c)),A=h!=="none";!m&&A&&R.push(...An(c,x,h,b));const S=[c,...R],O=await l.detectOverflow(t,w),M=[];let T=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&M.push(O[g]),d){const W=wn(i,r,b);M.push(O[W[0]],O[W[1]])}if(T=[...T,{placement:i,overflows:M}],!M.every(W=>W<=0)){var E,F;const W=(((E=s.flip)==null?void 0:E.index)||0)+1,I=S[W];if(I&&(!(d==="alignment"?p!==X(I):!1)||T.every(C=>X(C.placement)===p?C.overflows[0]>0:!0)))return{data:{index:W,overflows:T},reset:{placement:I}};let L=(F=T.filter(k=>k.overflows[0]<=0).sort((k,C)=>k.overflows[1]-C.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(f){case"bestFit":{var $;const k=($=T.filter(C=>{if(A){const _=X(C.placement);return _===p||_==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(_=>_>0).reduce((_,V)=>_+V,0)]).sort((C,_)=>C[1]-_[1])[0])==null?void 0:$[0];k&&(L=k);break}case"initialPlacement":L=c;break}if(i!==L)return{reset:{placement:L}}}return{}}}},$t=new Set(["left","top"]);async function Tn(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=j(n),c=G(n),l=X(n)==="y",a=$t.has(r)?-1:1,u=s&&l?-1:1,d=ne(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof h=="number"&&(f=c==="end"?h*-1:h),l?{x:f*u,y:m*a}:{x:m*a,y:f*u}}const Mn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=t,l=await Tn(t,e);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},Dn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i,platform:s}=t,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...a}=ne(e,t),u={x:n,y:o},d=await s.detectOverflow(t,a),m=X(i),f=Ke(m);let h=u[f],x=u[m];const w=(p,v)=>Ft(v+d[p==="y"?"top":"left"],v,v-d[p==="y"?"bottom":"right"]);r&&(h=w(f,h)),c&&(x=w(m,x));const g=l.fn({...t,[f]:h,[m]:x});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[f]:r,[m]:c}}}}}},Ln=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:i,y:s,placement:r,rects:c,middlewareData:l}=t,{offset:a=0,mainAxis:u=!0,crossAxis:d=!0}=ne(e,t),m={x:i,y:s},f=X(r),h=Ke(f);let x=m[h],w=m[f];const g=ne(a,t),p=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(u){const R=h==="y"?"height":"width",A=c.reference[h]-c.floating[R]+p.mainAxis,S=c.reference[h]+c.reference[R]-p.mainAxis;x<A?x=A:x>S&&(x=S)}if(d){var v,b;const R=h==="y"?"width":"height",A=$t.has(j(r)),S=c.reference[f]-c.floating[R]+(A&&((v=l.offset)==null?void 0:v[f])||0)+(A?0:p.crossAxis),O=c.reference[f]+c.reference[R]+(A?0:((b=l.offset)==null?void 0:b[f])||0)-(A?p.crossAxis:0);w<S?w=S:w>O&&(w=O)}return{[h]:x,[f]:w}}}},kn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:i,elements:s}=t,{apply:r=()=>{},...c}=ne(e,t),l=await i.detectOverflow(t,c),a=j(n),u=G(n),d=X(n)==="y",{width:m,height:f}=o.floating;let h,x;a==="top"||a==="bottom"?(h=a,x=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(x=a,h=u==="end"?"top":"bottom");const w=f-l.top-l.bottom,g=m-l.left-l.right,p=ge(f-l[h],w),v=ge(m-l[x],g),b=t.middlewareData.shift,R=!b;let A=p,S=v;b!=null&&b.enabled.x&&(S=g),b!=null&&b.enabled.y&&(A=w),R&&!u&&(d?S=m-2*U(l.left,l.right):A=f-2*U(l.top,l.bottom)),await r({...t,availableWidth:S,availableHeight:A});const O=await i.getDimensions(s.floating);return m!==O.width||f!==O.height?{reset:{rects:!0}}:{}}}};function It(e){const t=te(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=me(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,c=Me(n)!==s||Me(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function Qe(e){return z(e)?e:e.contextElement}function de(e){const t=Qe(e);if(!me(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=It(t);let r=(s?Me(n.width):n.width)/o,c=(s?Me(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Fn=K(0);function Vt(e){const t=q(e);return!Dt()||!t.visualViewport?Fn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===q(e)}function re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Qe(e);let r=K(1);t&&(o?z(o)&&(r=de(o)):r=de(e));const c=Wn(s,n,o)?Vt(s):K(0);let l=(i.left+c.x)/r.x,a=(i.top+c.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(s&&o){const m=q(s),f=z(o)?q(o):o;let h=m,x=pt(h);for(;x&&f!==h;){const w=de(x),g=x.getBoundingClientRect(),p=te(x),v=g.left+(x.clientLeft+parseFloat(p.paddingLeft))*w.x,b=g.top+(x.clientTop+parseFloat(p.paddingTop))*w.y;l*=w.x,a*=w.y,u*=w.x,d*=w.y,l+=v,a+=b,h=q(x),x=pt(h)}}return Le({width:u,height:d,x:l,y:a})}function We(e,t){const n=Fe(e).scrollLeft;return t?t.left+n:re(oe(e)).left+n}function _t(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-We(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function $n(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=oe(o),c=t?Ye(t.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=K(1);const u=K(0),d=me(o);if((d||!s)&&((qe(o)!=="body"||Mt(r))&&(l=Fe(o)),d)){const f=re(o);a=de(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!s?_t(r,l):K(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+u.x+m.x,y:n.y*a.y-l.scrollTop*a.y+u.y+m.y}}function In(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Vn(e){const t=Fe(e),n=e.ownerDocument.body,o=U(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=U(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+We(e);const r=-t.scrollTop;return te(n).direction==="rtl"&&(s+=U(e.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const _n=25;function Hn(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=q(e),s=oe(e),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,u=0;if(r){const m=!Dt()||t==="fixed";o?m||(a=-r.offsetLeft,u=-r.offsetTop):(c=r.width,l=r.height,m&&(a=r.offsetLeft,u=r.offsetTop))}if(We(s)<=0){const m=s.ownerDocument,f=m.body,h=getComputedStyle(f),x=m.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(s.clientWidth-f.clientWidth-x),g=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;g<=_n&&(c-=g)}return{width:c,height:l,x:a,y:u}}function Bn(e,t){const n=re(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=de(e),r=e.clientWidth*s.x,c=e.clientHeight*s.y,l=i*s.x,a=o*s.y;return{width:r,height:c,x:l,y:a}}function bt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Hn(e,n,t);else if(t==="document")o=Vn(oe(e));else if(z(t))o=Bn(t,n);else{const i=Vt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Le(o)}function zn(e,t){const n=t.get(e);if(n)return n;let o=Xe(e,[],!1).filter(c=>z(c)&&qe(c)!=="body"),i=null;const s=te(e).position==="fixed";let r=s?Te(e):e;for(;z(r)&&!Ne(r);){const c=te(r),l=Tt(r),a=i?i.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(d=>d!==r):i=c,r=Te(r)}return t.set(e,o),o}function Nn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?Ye(t)?[]:zn(t,this._c):[].concat(n),o],c=bt(t,r[0],i);let l=c.top,a=c.right,u=c.bottom,d=c.left;for(let m=1;m<r.length;m++){const f=bt(t,r[m],i);l=U(f.top,l),a=ge(f.right,a),u=ge(f.bottom,u),d=U(f.left,d)}return{width:a-d,height:u-l,x:d,y:l}}function Xn(e){const{width:t,height:n}=It(e);return{width:t,height:n}}function jn(e,t,n){const o=me(t),i=oe(t),s=n==="fixed",r=re(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=K(0);if((o||!s)&&((qe(t)!=="body"||Mt(i))&&(c=Fe(t)),o)){const m=re(t,!0,s,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}!o&&i&&(l.x=We(i));const a=i&&!o&&!s?_t(i,c):K(0),u=r.left+c.scrollLeft-l.x-a.x,d=r.top+c.scrollTop-l.y-a.y;return{x:u,y:d,width:r.width,height:r.height}}function Be(e){return te(e).position==="static"}function Rt(e,t){if(!me(e)||te(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return oe(e)===n&&(n=n.ownerDocument.body),n}function Ht(e,t){const n=q(e);if(Ye(e))return n;if(!me(e)){let i=Te(e);for(;i&&!Ne(i);){if(z(i)&&!Be(i))return i;i=Te(i)}return n}let o=Rt(e,t);for(;o&&cn(o)&&Be(o);)o=Rt(o,t);return o&&Ne(o)&&Be(o)&&!Tt(o)?n:o||ln(e)||n}const Yn=async function(e){const t=this.getOffsetParent||Ht,n=this.getDimensions,o=await n(e.floating);return{reference:jn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function qn(e){return te(e).direction==="rtl"}const Un={convertOffsetParentRelativeRectToViewportRelativeRect:$n,getDocumentElement:oe,getClippingRect:Nn,getOffsetParent:Ht,getElementRects:Yn,getClientRects:In,getDimensions:Xn,getScale:de,isElement:z,isRTL:qn};function Bt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kn(e,t,n){let o=null,i;const s=oe(e);function r(){var u;clearTimeout(i),(u=o)==null||u.disconnect(),o=null}function c(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),r();const m=e.getBoundingClientRect(),{left:f,top:h,width:x,height:w}=m;if(u||t(),!x||!w)return;const g=Ee(h),p=Ee(s.clientWidth-(f+x)),v=Ee(s.clientHeight-(h+w)),b=Ee(f),A={rootMargin:-g+"px "+-p+"px "+-v+"px "+-b+"px",threshold:U(0,ge(1,d))||1};let S=!0;function O(M){const T=M[0].intersectionRatio;if(!Bt(m,e.getBoundingClientRect()))return c();if(T!==d){if(!S)return c();T?c(!1,T):i=setTimeout(()=>{c(!1,1e-7)},1e3)}S=!1}try{o=new IntersectionObserver(O,{...A,root:s.ownerDocument})}catch{o=new IntersectionObserver(O,A)}o.observe(e)}const l=q(e),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),r()}}function vt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Qe(e),u=i||s?[...a?Xe(a):[],...t?Xe(t):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n),s&&g.addEventListener("resize",n)});const d=a&&c?Kn(a,n,s):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[p]=g;p&&p.target===a&&f&&t&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),n()}),a&&!l&&f.observe(a),t&&f.observe(t));let h,x=l?re(e):null;l&&w();function w(){const g=re(e);x&&!Bt(x,g)&&n(),x=g,h=requestAnimationFrame(w)}return n(),()=>{var g;u.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const Gn=Mn,Jn=Dn,Qn=Pn,Zn=kn,eo=Ln,to=(e,t,n)=>{const o=new Map,i=n??{},s={...Un,...i.platform,_c:o};return En(e,t,{...i,platform:s})};var no=typeof document<"u",oo=function(){},Pe=no?y.useLayoutEffect:oo;function ke(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,i;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(!ke(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!ke(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function zt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function At(e,t){const n=zt(e);return Math.round(t*n)/n}function ze(e){const t=y.useRef(e);return Pe(()=>{t.current=e}),t}function io(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:r}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=y.useState(o);ke(m,o)||f(o);const[h,x]=y.useState(null),[w,g]=y.useState(null),p=y.useCallback(C=>{C!==A.current&&(A.current=C,x(C))},[]),v=y.useCallback(C=>{C!==S.current&&(S.current=C,g(C))},[]),b=s||h,R=r||w,A=y.useRef(null),S=y.useRef(null),O=y.useRef(u),M=l!=null,T=ze(l),E=ze(i),F=ze(a),$=y.useCallback(()=>{if(!A.current||!S.current)return;const C={placement:t,strategy:n,middleware:m};E.current&&(C.platform=E.current),to(A.current,S.current,C).then(_=>{const V={..._,isPositioned:F.current!==!1};W.current&&!ke(O.current,V)&&(O.current=V,an.flushSync(()=>{d(V)}))})},[m,t,n,E,F]);Pe(()=>{a===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(C=>({...C,isPositioned:!1})))},[a]);const W=y.useRef(!1);Pe(()=>(W.current=!0,()=>{W.current=!1}),[]),Pe(()=>{if(b&&(A.current=b),R&&(S.current=R),b&&R){if(T.current)return T.current(b,R,$);$()}},[b,R,$,T,M]);const I=y.useMemo(()=>({reference:A,floating:S,setReference:p,setFloating:v}),[p,v]),L=y.useMemo(()=>({reference:b,floating:R}),[b,R]),k=y.useMemo(()=>{const C={position:n,left:0,top:0};if(!L.floating)return C;const _=At(L.floating,u.x),V=At(L.floating,u.y);return c?{...C,transform:"translate("+_+"px, "+V+"px)",...zt(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:V}},[n,c,L.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:$,refs:I,elements:L,floatingStyles:k}),[u,$,I,L,k])}const so=(e,t)=>{const n=Gn(e);return{name:n.name,fn:n.fn,options:[e,t]}},ro=(e,t)=>{const n=Jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},co=(e,t)=>({fn:eo(e).fn,options:[e,t]}),lo=(e,t)=>{const n=Qn(e);return{name:n.name,fn:n.fn,options:[e,t]}},ao=(e,t)=>{const n=Zn(e);return{name:n.name,fn:n.fn,options:[e,t]}};function fo(e){return uo(e,e.rootContext)}function uo(e,t){const{nodeId:n,externalTree:o}=e,i=t.useState("referenceElement"),s=t.useState("floatingElement"),r=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[a,u]=y.useState(null),[d,m]=y.useState(void 0),[f,h]=y.useState(void 0),x=y.useRef(null),w=mn(o),g=y.useMemo(()=>({reference:i,floating:s,domReference:r}),[i,s,r]),p=io({...e,elements:{...g,...a&&{reference:a}}}),v=z(d)?d:null,b=f===void 0?t.state.floatingElement:f;t.useSyncedValue("referenceElement",d??null),t.useSyncedValue("domReferenceElement",d===void 0?r:v),t.useSyncedValue("floatingElement",b);const R=y.useCallback(E=>{const F=z(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;u(F),p.refs.setReference(F)},[p.refs]),A=y.useCallback(E=>{(z(E)||E===null)&&(x.current=E,m(E)),(z(p.refs.reference.current)||p.refs.reference.current===null||E!==null&&!z(E))&&p.refs.setReference(E)},[p.refs,m]),S=y.useCallback(E=>{h(E),p.refs.setFloating(E)},[p.refs]),O=y.useMemo(()=>({...p.refs,setReference:A,setFloating:S,setPositionReference:R,domReference:x}),[p.refs,A,S,R]),M=y.useMemo(()=>({...p.elements,domReference:r}),[p.elements,r]),T=y.useMemo(()=>({...p,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:O,elements:M,nodeId:n,rootStore:t}),[p,O,M,n,t,c,l]);return se(()=>{r&&(x.current=r)},[r]),se(()=>{t.context.dataRef.current.floatingContext=T;const E=w?.nodesRef.current.find(F=>F.id===n);E&&(E.context=T)}),y.useMemo(()=>({...p,context:T,refs:O,elements:M,rootStore:t}),[p,O,M,T,t])}const go=y.createContext(void 0);function mo(){return y.useContext(go)?.direction??"ltr"}const ho=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:c,middlewareData:l}=t,{element:a,padding:u=0,offsetParent:d="real"}=ne(e,t)||{};if(a==null)return{};const m=Wt(u),f={x:n,y:o},h=Je(i),x=Ge(h),w=await r.getDimensions(a),g=h==="y",p=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",R=s.reference[x]+s.reference[h]-f[h]-s.floating[x],A=f[h]-s.reference[h],S=d==="real"?await r.getOffsetParent?.(a):c.floating;let O=c.floating[b]||s.floating[x];(!O||!await r.isElement?.(S))&&(O=c.floating[b]||s.floating[x]);const M=R/2-A/2,T=O/2-w[x]/2-1,E=Math.min(m[p],T),F=Math.min(m[v],T),$=E,W=O-w[x]-F,I=O/2-w[x]/2+M,L=Ft($,I,W),k=!l.arrow&&G(i)!=null&&I!==L&&s.reference[x]/2-(I<$?E:F)-w[x]/2<0,C=k?I<$?I-$:I-W:0;return{[h]:f[h]+C,data:{[h]:L,centerOffset:I-L-C,...k&&{alignmentOffset:C}},reset:k}}}),po=(e,t)=>{const{name:n,fn:o}=ho(e);return{name:n,fn:o,options:[e,t]}},xo={name:"hide",async fn(e){const{width:t,height:n,x:o,y:i}=e.rects.reference,s=t===0&&n===0&&o===0&&i===0,r=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:r.top-n>=0||r.right-t>=0||r.bottom-n>=0||r.left-t>=0||s}}}},wo={sideX:"left",sideY:"top"},yo="--available-width",bo="--available-height",Ro="--anchor-width",vo="--anchor-height",Ao="--transform-origin",Ot=yo,Ct=bo;function Nt(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function St(e,t,n){const{rects:o,placement:i}=e;return{side:Nt(t,j(i),n),align:G(i)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Wo(e){return Oo(e,fo)}function Oo(e,t){const{anchor:n,positionMethod:o="absolute",side:i="bottom",sideOffset:s=0,align:r="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:a=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:m=!1,inline:f,keepMounted:h=!1,floatingRootContext:x,mounted:w,collisionAvoidance:g,shift:p,nodeId:v,adaptiveOrigin:b,lazyFlip:R=!1,externalTree:A}=e,[S,O]=y.useState(null);!w&&S!==null&&O(null);const M=g.side||"flip",T=g.align||"flip",E=g.fallbackAxisSide||"end",F=p?.crossAxis??!1,$=p?.rootBoundary,W=typeof n=="function"?n:void 0,I=Ue(W),L=W?I:n,k=Se(n),C=Se(w),V=mo()==="rtl",we=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":V?"left":"right","inline-start":V?"right":"left"}[i],Xt=r==="center"?we:`${we}-${r}`;let D=a;typeof D=="number"?D={top:D,right:D,bottom:D,left:D}:D&&(D={top:D.top||0,right:D.right||0,bottom:D.bottom||0,left:D.left||0});const J=1,jt=i==="bottom"?J:0,Yt=i==="top"?J:0,qt=i==="right"?J:0,Ut=i==="left"?J:0,ye={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:D},ie=y.useRef(null),$e=Se(s),Ie=Se(c),Kt=typeof s!="function"?s:0,Gt=typeof c!="function"?c:0,ce=[];f&&ce.push(f),ce.push(so(P=>{const B=St(P,i,V),N=typeof $e.current=="function"?$e.current(B):$e.current,H=typeof Ie.current=="function"?Ie.current(B):Ie.current;return{mainAxis:N,crossAxis:H,alignmentAxis:H}},[Kt,Gt,V,i]));const Ze=T==="none"&&M!=="shift",et=!Ze&&(u||F||M==="shift"),tt=M==="none"?null:lo({...ye,padding:{top:D.top+J+jt,right:D.right+J+Ut,bottom:D.bottom+J+Yt,left:D.left+J+qt},mainAxis:!F&&M==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:E}),nt=Ze?null:ro({...ye,rootBoundary:$,mainAxis:T!=="none",crossAxis:et,limiter:u||F?void 0:co(P=>{if(!ie.current)return{};const{width:B,height:N}=ie.current.getBoundingClientRect(),H=X(j(P.placement)),Z=H==="y"?B:N,Y=H==="y"?D.left+D.right:D.top+D.bottom;return{offset:Z/2+Y/2}})},[ye,u,F,$,D,T]);M==="shift"||T==="shift"||r==="center"?ce.push(nt,tt):ce.push(tt,nt),ce.push(ao({...ye,apply({elements:{floating:P},availableWidth:B,availableHeight:N,rects:H}){if(!C.current)return;const Z=P.style;Z.setProperty(Ot,`${B}px`),Z.setProperty(Ct,`${N}px`);const Y=q(P).devicePixelRatio||1,{x:Ae,y:ue,width:Oe,height:ee}=H.reference,pe=(Math.round((Ae+Oe)*Y)-Math.round(Ae*Y))/Y,xe=(Math.round((ue+ee)*Y)-Math.round(ue*Y))/Y;Z.setProperty(Ro,`${pe}px`),Z.setProperty(vo,`${xe}px`)}}),po(P=>({element:ie.current||Lt(P.elements.floating).createElement("div"),padding:ie.current?d:0,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(P){const{elements:{floating:B},middlewareData:N,placement:H,platform:Z,rects:Y,y:Ae}=P,ue=j(H),Oe=G(H),ee=X(ue)==="y",pe=ie.current,xe=typeof s=="function"?s(St(P,i,V)):s;let Ce;if(!pe&&Oe&&Math.abs(ee?N.shift?.x||0:N.shift?.y||0)<=1)Ce=Oe==="start"===(ee&&Z.isRTL?.(B)===!0)?"100%":"0%";else{const Jt=ee?N.arrow?.x||0:N.arrow?.y||0,Qt=ee?pe?.clientWidth||0:pe?.clientHeight||0;Ce=`${Jt+Qt/2}px`}let _e=ue==="top"||ue==="left"?`calc(100% + ${xe}px)`:`${-xe}px`;return et&&ee&&Math.abs(N.shift?.y||0)>xe&&(_e=`${Y.reference.y+Y.reference.height/2-Ae}px`),B.style.setProperty(Ao,ee?`${Ce} ${_e}`:`${_e} ${Ce}`),{}}},xo,b),se(()=>{!w&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,x]);const Ve=y.useMemo(()=>({ancestorScroll:!m,elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:le,elements:he,x:ot,y:it,middlewareData:ae,update:be,placement:st,context:rt,isPositioned:Q,floatingStyles:ct}=t({rootContext:x,open:h?w:void 0,placement:Xt,middleware:ce,strategy:o,whileElementsMounted:h?void 0:(...P)=>vt(...P,Ve),nodeId:v,externalTree:A}),{sideX:lt,sideY:at}=ae.adaptiveOrigin||wo,Re=Q?o:"fixed",ft=y.useMemo(()=>{let P;return Q?b?P={position:Re,[lt]:ot,[at]:it}:P={...ct,position:Re}:P={position:Re,top:0,left:0},P[Ot]="100vw",P[Ct]="100vh",Q||(P.opacity=0),P},[b,Re,lt,ot,at,it,ct,Q]),ve=y.useRef(null);se(()=>{if(!w)return;const P=k.current,B=typeof P=="function"?P():P,H=(Et(B)?B.current:B)||null||null;H!==ve.current&&(le.setPositionReference(H),ve.current=H)},[w,le,L,k]),y.useEffect(()=>{if(!w)return;const P=k.current;typeof P!="function"&&Et(P)&&P.current!==ve.current&&(le.setPositionReference(P.current),ve.current=P.current)},[w,le,L,k]),y.useEffect(()=>{if(h&&w&&he.reference&&he.floating)return vt(he.reference,he.floating,be,Ve)},[h,w,he,be,Ve]);const fe=j(st),ut=Nt(i,fe,V),dt=G(st)||"center",gt=!!ae.hide?.referenceHidden;se(()=>{R&&w&&Q&&fe!==we&&O(fe)},[R,w,Q,fe,we]);const mt=y.useMemo(()=>({position:"absolute",top:ae.arrow?.y,left:ae.arrow?.x}),[ae.arrow]),ht=ae.arrow?.centerOffset!==0;return y.useMemo(()=>({positionerStyles:ft,arrowStyles:mt,arrowRef:ie,arrowUncentered:ht,side:ut,align:dt,physicalSide:fe,anchorHidden:gt,refs:le,context:rt,isPositioned:Q,update:be}),[ft,mt,ie,ht,ut,dt,fe,gt,le,rt,Q,be])}function Et(e){return e!=null&&"current"in e}function Co(e){return e==="starting"?fn:Pt}function $o(e,t,{styles:n,transitionStatus:o,props:i,refs:s,hidden:r,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),un("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:r,style:l},Co(o),i],stateAttributesMapping:hn})}function So(e){const t=y.useRef(""),n=y.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:y.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function Eo(e,t){const n=y.useRef(e),o=Ue(t);se(()=>{n.current!==e&&o(n.current),n.current=e},[e,o])}function Po(e,t){const n=Ue((s,r)=>{(typeof e=="function"?e():e)||t(r||(dn?"touch":""))}),{onClick:o,onPointerDown:i}=So(n);return y.useMemo(()=>({onClick:o,onPointerDown:i}),[o,i])}function Io(e){const[t,n]=y.useState(null),o=Po(e,n);return Eo(e,i=>{i&&!e&&n(null)}),y.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const To=20;function Vo(e,t,n,o){const[i,s]=y.useState(!1);se(()=>{if(!e||!t||n==null){s(!1);return}const r=Lt(n).documentElement.clientWidth,c=n.offsetWidth;s(r>0&&c>0&&c>=r-To)},[e,t,n]),pn(e&&(!t||i),o)}const Mo=y.createContext(void 0);function _o(e){return y.useContext(Mo)}export{ko as C,Fo as a,Po as b,Wo as c,Vo as d,$o as e,_o as f,Co as g,Io as h,mo as i,Un as p,Le as r,Eo as u};