tokentracker-cli 0.24.7 → 0.25.0

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 (48) hide show
  1. package/dashboard/dist/assets/ActivityHeatmap-CiilYEqW.js +42 -0
  2. package/dashboard/dist/assets/{Card-Cy2qG2yw.js → Card-BkDHn179.js} +1 -1
  3. package/dashboard/dist/assets/DashboardPage-BwTkSsim.js +1 -0
  4. package/dashboard/dist/assets/{DevicePage-B1I6_Kxp.js → DevicePage-DX8aCjtt.js} +1 -1
  5. package/dashboard/dist/assets/DialogTitle-DH5VFL8l.js +12 -0
  6. package/dashboard/dist/assets/{FadeIn-xb0lBDdT.js → FadeIn-CcubhRKW.js} +1 -1
  7. package/dashboard/dist/assets/{IpCheckPage-CCysfQ-C.js → IpCheckPage-BcHkEcE7.js} +1 -1
  8. package/dashboard/dist/assets/{LandingPage-D7x7fS1R.js → LandingPage-Bnqs_k3p.js} +165 -165
  9. package/dashboard/dist/assets/LeaderboardPage-DV6K7KSV.js +6 -0
  10. package/dashboard/dist/assets/LeaderboardProfileModal-CnbpLjG_.js +1 -0
  11. package/dashboard/dist/assets/LimitsPage-DO53157-.js +2 -0
  12. package/dashboard/dist/assets/LoginPage-1M5RskQE.js +1 -0
  13. package/dashboard/dist/assets/PopoverPopup-BzS6tVnf.js +1 -0
  14. package/dashboard/dist/assets/{ProviderIcon-BRpynAI7.js → ProviderIcon-C8nYnvzP.js} +1 -1
  15. package/dashboard/dist/assets/SettingsPage-DjoUqFA-.js +1 -0
  16. package/dashboard/dist/assets/SkillsPage-CvOf-_li.js +1 -0
  17. package/dashboard/dist/assets/WidgetsPage-Cc5PRPDd.js +1 -0
  18. package/dashboard/dist/assets/{WrappedPage-CUWY3_0R.js → WrappedPage-BxuVlF3C.js} +1 -1
  19. package/dashboard/dist/assets/check-r6BrjxcR.js +1 -0
  20. package/dashboard/dist/assets/{chevron-down-C8arMd0V.js → chevron-down-BS2aEE_V.js} +1 -1
  21. package/dashboard/dist/assets/{download-CoTKvd8q.js → download-DtsgF1HV.js} +1 -1
  22. package/dashboard/dist/assets/{info-tb06m6pM.js → info-TG4KyASc.js} +1 -1
  23. package/dashboard/dist/assets/{main-DDbFansE.js → main-CR7sCH5H.js} +40 -16
  24. package/dashboard/dist/assets/main-aCzF4R9D.css +1 -0
  25. package/dashboard/dist/assets/{use-limits-display-prefs-IJ650iD0.js → use-limits-display-prefs-DgRoQmhK.js} +1 -1
  26. package/dashboard/dist/assets/use-native-settings-BVWj6xAN.js +1 -0
  27. package/dashboard/dist/assets/{use-reduced-motion-DnF5Mq2H.js → use-reduced-motion-BsyM6Mgz.js} +1 -1
  28. package/dashboard/dist/assets/{use-usage-limits-Ig-0cZyA.js → use-usage-limits-KGue9hvK.js} +1 -1
  29. package/dashboard/dist/assets/{useCurrency-kbOycXmD.js → useCurrency-BLJima5w.js} +1 -1
  30. package/dashboard/dist/index.html +2 -2
  31. package/dashboard/dist/share.html +2 -2
  32. package/package.json +1 -1
  33. package/src/lib/local-api.js +125 -1
  34. package/src/lib/pricing/seed-snapshot.json +1 -1
  35. package/dashboard/dist/assets/DashboardPage-CsG_Mq6k.js +0 -42
  36. package/dashboard/dist/assets/HeaderGithubStar-BNxToTPs.js +0 -1
  37. package/dashboard/dist/assets/LeaderboardPage-DpT-Wb4Y.js +0 -5
  38. package/dashboard/dist/assets/LeaderboardProfilePage-BFx3cfEn.js +0 -1
  39. package/dashboard/dist/assets/LimitsPage-CSXwXe-W.js +0 -2
  40. package/dashboard/dist/assets/LoginPage-BJckej8m.js +0 -1
  41. package/dashboard/dist/assets/PopoverPopup-BKcg8Ouw.js +0 -12
  42. package/dashboard/dist/assets/SettingsPage-tXhwdSnC.js +0 -1
  43. package/dashboard/dist/assets/SkillsPage-CSybau5n.js +0 -1
  44. package/dashboard/dist/assets/WidgetsPage-DZS8HDJi.js +0 -1
  45. package/dashboard/dist/assets/check-qNB7C4Ej.js +0 -1
  46. package/dashboard/dist/assets/leaderboard-columns-45nSY60u.js +0 -1
  47. package/dashboard/dist/assets/main-C8k06i2w.css +0 -1
  48. package/dashboard/dist/assets/use-native-settings-B0Civ1m0.js +0 -1
@@ -0,0 +1,6 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LeaderboardProfileModal-CnbpLjG_.js","assets/main-CR7sCH5H.js","assets/main-aCzF4R9D.css","assets/useCurrency-BLJima5w.js","assets/ProviderIcon-C8nYnvzP.js","assets/ActivityHeatmap-CiilYEqW.js","assets/info-TG4KyASc.js","assets/DialogTitle-DH5VFL8l.js","assets/chevron-down-BS2aEE_V.js"])))=>i.map(i=>d[i]);
2
+ import{c as Zr,r as s,R as H,aa as rt,C as c,S as I,B as y,ab as Qr,ac as en,T as tn,U as rn,ad as nn,h as on,j as an,ae as sn,W as ln,a6 as Tt,D as cn,L as dn,E as un,af as fn,ag as gn,ah as Qt,ai as hn,_ as bn,H as pn}from"./main-CR7sCH5H.js";import{P as mn}from"./ProviderIcon-C8nYnvzP.js";import{u as xn}from"./useCurrency-BLJima5w.js";import{C as vn}from"./chevron-down-BS2aEE_V.js";const yn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],wn=Zr("arrow-right",yn);function kn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const kt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ye(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Wt(e){return"nodeType"in e}function J(e){var t,r;return e?Ye(e)?e:Wt(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Xt(e){const{Document:t}=J(e);return e instanceof t}function ut(e){return Ye(e)?!1:e instanceof J(e).HTMLElement}function kr(e){return e instanceof J(e).SVGElement}function We(e){return e?Ye(e)?e.document:Wt(e)?Xt(e)?e:ut(e)||kr(e)?e.ownerDocument:document:document:document}const pe=kt?s.useLayoutEffect:s.useEffect;function Ht(e){const t=s.useRef(e);return pe(()=>{t.current=e}),s.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function Sn(){const e=s.useRef(null),t=s.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function it(e,t){t===void 0&&(t=[e]);const r=s.useRef(e);return pe(()=>{r.current!==e&&(r.current=e)},t),r}function ft(e,t){const r=s.useRef();return s.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function mt(e){const t=Ht(e),r=s.useRef(null),n=s.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function Lt(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let Et={};function gt(e,t){return s.useMemo(()=>{if(t)return t;const r=Et[e]==null?0:Et[e]+1;return Et[e]=r,e+"-"+r},[e,t])}function Sr(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,i)=>{const l=Object.entries(i);for(const[d,u]of l){const g=a[d];g!=null&&(a[d]=g+e*u)}return a},{...t})}}const Ke=Sr(1),st=Sr(-1);function Cn(e){return"clientX"in e&&"clientY"in e}function Gt(e){if(!e)return!1;const{KeyboardEvent:t}=J(e.target);return t&&e instanceof t}function Nn(e){if(!e)return!1;const{TouchEvent:t}=J(e.target);return t&&e instanceof t}function Ot(e){if(Nn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Cn(e)?{x:e.clientX,y:e.clientY}:null}const lt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[lt.Translate.toString(e),lt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),er="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Rn(e){return e.matches(er)?e:e.querySelector(er)}const Dn={display:"none"};function jn(e){let{id:t,value:r}=e;return H.createElement("div",{id:t,style:Dn},r)}function En(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return H.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function _n(){const[e,t]=s.useState("");return{announce:s.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Cr=s.createContext(null);function An(e){const t=s.useContext(Cr);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Mn(){const[e]=s.useState(()=>new Set),t=s.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[s.useCallback(n=>{let{type:o,event:a}=n;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,a)})},[e]),t]}const In={draggable:`
3
+ To pick up a draggable item, press the space bar.
4
+ While dragging, use the arrow keys to move the item.
5
+ Press space again to drop the item in its new position, or press escape to cancel.
6
+ `},Tn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Ln(e){let{announcements:t=Tn,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=In}=e;const{announce:a,announcement:i}=_n(),l=gt("DndLiveRegion"),[d,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),An(s.useMemo(()=>({onDragStart(f){let{active:p}=f;a(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:b}=f;t.onDragMove&&a(t.onDragMove({active:p,over:b}))},onDragOver(f){let{active:p,over:b}=f;a(t.onDragOver({active:p,over:b}))},onDragEnd(f){let{active:p,over:b}=f;a(t.onDragEnd({active:p,over:b}))},onDragCancel(f){let{active:p,over:b}=f;a(t.onDragCancel({active:p,over:b}))}}),[a,t])),!d)return null;const g=H.createElement(H.Fragment,null,H.createElement(jn,{id:n,value:o.draggable}),H.createElement(En,{id:l,announcement:i}));return r?rt.createPortal(g,r):g}var z;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(z||(z={}));function xt(){}function tr(e,t){return s.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function On(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const ue=Object.freeze({x:0,y:0});function Nr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Rr(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Pn(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function rr(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function Dr(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function nr(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const zn=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=nr(t,t.left,t.top),a=[];for(const i of n){const{id:l}=i,d=r.get(l);if(d){const u=Nr(nr(d),o);a.push({id:l,data:{droppableContainer:i,value:u}})}}return a.sort(Rr)},Bn=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=rr(t),a=[];for(const i of n){const{id:l}=i,d=r.get(l);if(d){const u=rr(d),g=o.reduce((p,b,j)=>p+Nr(u[j],b),0),f=Number((g/4).toFixed(4));a.push({id:l,data:{droppableContainer:i,value:f}})}}return a.sort(Rr)};function $n(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-n,l=a-r;if(n<o&&r<a){const d=t.width*t.height,u=e.width*e.height,g=i*l,f=g/(d+u-g);return Number(f.toFixed(4))}return 0}const Fn=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:i}=a,l=r.get(i);if(l){const d=$n(l,t);d>0&&o.push({id:i,data:{droppableContainer:a,value:d}})}}return o.sort(Pn)};function Un(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function jr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ue}function Kn(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...r})}}const Yn=Kn(1);function Wn(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Xn(e,t,r){const n=Wn(t);if(!n)return e;const{scaleX:o,scaleY:a,x:i,y:l}=n,d=e.left-i-(1-o)*parseFloat(r),u=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),g=o?e.width/o:e.width,f=a?e.height/a:e.height;return{width:g,height:f,top:u,right:d+g,bottom:u+f,left:d}}const Hn={ignoreTransform:!1};function Xe(e,t){t===void 0&&(t=Hn);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:g}=J(e).getComputedStyle(e);u&&(r=Xn(r,u,g))}const{top:n,left:o,width:a,height:i,bottom:l,right:d}=r;return{top:n,left:o,width:a,height:i,bottom:l,right:d}}function or(e){return Xe(e,{ignoreTransform:!0})}function Gn(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Vn(e,t){return t===void 0&&(t=J(e).getComputedStyle(e)),t.position==="fixed"}function qn(e,t){t===void 0&&(t=J(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function St(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(Xt(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!ut(o)||kr(o)||r.includes(o))return r;const a=J(e).getComputedStyle(o);return o!==e&&qn(o,a)&&r.push(o),Vn(o,a)?r:n(o.parentNode)}return e?n(e):r}function Er(e){const[t]=St(e,1);return t??null}function _t(e){return!kt||!e?null:Ye(e)?e:Wt(e)?Xt(e)||e===We(e).scrollingElement?window:ut(e)?e:null:null}function _r(e){return Ye(e)?e.scrollX:e.scrollLeft}function Ar(e){return Ye(e)?e.scrollY:e.scrollTop}function Pt(e){return{x:_r(e),y:Ar(e)}}var F;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(F||(F={}));function Mr(e){return!kt||!e?!1:e===document.scrollingElement}function Ir(e){const t={x:0,y:0},r=Mr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,l=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:i,isRight:l,maxScroll:n,minScroll:t}}const Jn={x:.2,y:.2};function Zn(e,t,r,n,o){let{top:a,left:i,right:l,bottom:d}=r;n===void 0&&(n=10),o===void 0&&(o=Jn);const{isTop:u,isBottom:g,isLeft:f,isRight:p}=Ir(e),b={x:0,y:0},j={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!u&&a<=t.top+m.height?(b.y=F.Backward,j.y=n*Math.abs((t.top+m.height-a)/m.height)):!g&&d>=t.bottom-m.height&&(b.y=F.Forward,j.y=n*Math.abs((t.bottom-m.height-d)/m.height)),!p&&l>=t.right-m.width?(b.x=F.Forward,j.x=n*Math.abs((t.right-m.width-l)/m.width)):!f&&i<=t.left+m.width&&(b.x=F.Backward,j.x=n*Math.abs((t.left+m.width-i)/m.width)),{direction:b,speed:j}}function Qn(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:i}=window;return{top:0,left:0,right:a,bottom:i,width:a,height:i}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Tr(e){return e.reduce((t,r)=>Ke(t,Pt(r)),ue)}function eo(e){return e.reduce((t,r)=>t+_r(r),0)}function to(e){return e.reduce((t,r)=>t+Ar(r),0)}function ro(e,t){if(t===void 0&&(t=Xe),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);Er(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const no=[["x",["left","right"],eo],["y",["top","bottom"],to]];class Vt{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=St(r),o=Tr(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,i,l]of no)for(const d of i)Object.defineProperty(this,d,{get:()=>{const u=l(n),g=o[a]-u;return this.rect[d]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class nt{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function oo(e){const{EventTarget:t}=J(e);return e instanceof t?e:We(e)}function At(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var oe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(oe||(oe={}));function ar(e){e.preventDefault()}function ao(e){e.stopPropagation()}var D;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(D||(D={}));const Lr={start:[D.Space,D.Enter],cancel:[D.Esc],end:[D.Space,D.Enter,D.Tab]},io=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case D.Right:return{...r,x:r.x+25};case D.Left:return{...r,x:r.x-25};case D.Down:return{...r,y:r.y+25};case D.Up:return{...r,y:r.y-25}}};class qt{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new nt(We(r)),this.windowListeners=new nt(J(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&ro(n),r(ue)}handleKeyDown(t){if(Gt(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=Lr,coordinateGetter:i=io,scrollBehavior:l="smooth"}=o,{code:d}=t;if(a.end.includes(d)){this.handleEnd(t);return}if(a.cancel.includes(d)){this.handleCancel(t);return}const{collisionRect:u}=n.current,g=u?{x:u.left,y:u.top}:ue;this.referenceCoordinates||(this.referenceCoordinates=g);const f=i(t,{active:r,context:n.current,currentCoordinates:g});if(f){const p=st(f,g),b={x:0,y:0},{scrollableAncestors:j}=n.current;for(const m of j){const x=t.code,{isTop:w,isRight:k,isLeft:v,isBottom:C,maxScroll:E,minScroll:N}=Ir(m),S=Qn(m),R={x:Math.min(x===D.Right?S.right-S.width/2:S.right,Math.max(x===D.Right?S.left:S.left+S.width/2,f.x)),y:Math.min(x===D.Down?S.bottom-S.height/2:S.bottom,Math.max(x===D.Down?S.top:S.top+S.height/2,f.y))},L=x===D.Right&&!k||x===D.Left&&!v,T=x===D.Down&&!C||x===D.Up&&!w;if(L&&R.x!==f.x){const _=m.scrollLeft+p.x,Z=x===D.Right&&_<=E.x||x===D.Left&&_>=N.x;if(Z&&!p.y){m.scrollTo({left:_,behavior:l});return}Z?b.x=m.scrollLeft-_:b.x=x===D.Right?m.scrollLeft-E.x:m.scrollLeft-N.x,b.x&&m.scrollBy({left:-b.x,behavior:l});break}else if(T&&R.y!==f.y){const _=m.scrollTop+p.y,Z=x===D.Down&&_<=E.y||x===D.Up&&_>=N.y;if(Z&&!p.x){m.scrollTo({top:_,behavior:l});return}Z?b.y=m.scrollTop-_:b.y=x===D.Down?m.scrollTop-E.y:m.scrollTop-N.y,b.y&&m.scrollBy({top:-b.y,behavior:l});break}}this.handleMove(t,Ke(st(f,this.referenceCoordinates),b))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}qt.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Lr,onActivation:o}=t,{active:a}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function ir(e){return!!(e&&"distance"in e)}function sr(e){return!!(e&&"delay"in e)}class Jt{constructor(t,r,n){var o;n===void 0&&(n=oo(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:i}=a;this.props=t,this.events=r,this.document=We(i),this.documentListeners=new nt(this.document),this.listeners=new nt(n),this.windowListeners=new nt(J(i)),this.initialCoordinates=(o=Ot(a))!=null?o:ue,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,ar),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,ar),this.documentListeners.add(oe.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(sr(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(ir(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(oe.Click,ao,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:i,options:{activationConstraint:l}}=a;if(!o)return;const d=(r=Ot(t))!=null?r:ue,u=st(o,d);if(!n&&l){if(ir(l)){if(l.tolerance!=null&&At(u,l.tolerance))return this.handleCancel();if(At(u,l.distance))return this.handleStart()}if(sr(l)&&At(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),i(d)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===D.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const so={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zt extends Jt{constructor(t){const{event:r}=t,n=We(r.target);super(t,so,n)}}Zt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const lo={move:{name:"mousemove"},end:{name:"mouseup"}};var zt;(function(e){e[e.RightClick=2]="RightClick"})(zt||(zt={}));class co extends Jt{constructor(t){super(t,lo,We(t.event.target))}}co.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===zt.RightClick?!1:(n?.({event:r}),!0)}}];const Mt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class uo extends Jt{constructor(t){super(t,Mt)}static setup(){return window.addEventListener(Mt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Mt.move.name,t)};function t(){}}}uo.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n?.({event:r}),!0)}}];var ot;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ot||(ot={}));var vt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(vt||(vt={}));function fo(e){let{acceleration:t,activator:r=ot.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:i=5,order:l=vt.TreeOrder,pointerCoordinates:d,scrollableAncestors:u,scrollableAncestorRects:g,delta:f,threshold:p}=e;const b=ho({delta:f,disabled:!a}),[j,m]=Sn(),x=s.useRef({x:0,y:0}),w=s.useRef({x:0,y:0}),k=s.useMemo(()=>{switch(r){case ot.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case ot.DraggableRect:return o}},[r,o,d]),v=s.useRef(null),C=s.useCallback(()=>{const N=v.current;if(!N)return;const S=x.current.x*w.current.x,R=x.current.y*w.current.y;N.scrollBy(S,R)},[]),E=s.useMemo(()=>l===vt.TreeOrder?[...u].reverse():u,[l,u]);s.useEffect(()=>{if(!a||!u.length||!k){m();return}for(const N of E){if(n?.(N)===!1)continue;const S=u.indexOf(N),R=g[S];if(!R)continue;const{direction:L,speed:T}=Zn(N,R,k,t,p);for(const _ of["x","y"])b[_][L[_]]||(T[_]=0,L[_]=0);if(T.x>0||T.y>0){m(),v.current=N,j(C,i),x.current=T,w.current=L;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,C,n,m,a,i,JSON.stringify(k),JSON.stringify(b),j,u,E,g,JSON.stringify(p)])}const go={x:{[F.Backward]:!1,[F.Forward]:!1},y:{[F.Backward]:!1,[F.Forward]:!1}};function ho(e){let{delta:t,disabled:r}=e;const n=Lt(t);return ft(o=>{if(r||!n||!o)return go;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[F.Backward]:o.x[F.Backward]||a.x===-1,[F.Forward]:o.x[F.Forward]||a.x===1},y:{[F.Backward]:o.y[F.Backward]||a.y===-1,[F.Forward]:o.y[F.Forward]||a.y===1}}},[r,t,n])}function bo(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return ft(o=>{var a;return t==null?null:(a=n??o)!=null?a:null},[n,t])}function po(e,t){return s.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...a]},[]),[e,t])}var ct;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ct||(ct={}));var Bt;(function(e){e.Optimized="optimized"})(Bt||(Bt={}));const lr=new Map;function mo(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,i]=s.useState(null),{frequency:l,measure:d,strategy:u}=o,g=s.useRef(e),f=x(),p=it(f),b=s.useCallback(function(w){w===void 0&&(w=[]),!p.current&&i(k=>k===null?w:k.concat(w.filter(v=>!k.includes(v))))},[p]),j=s.useRef(null),m=ft(w=>{if(f&&!r)return lr;if(!w||w===lr||g.current!==e||a!=null){const k=new Map;for(let v of e){if(!v)continue;if(a&&a.length>0&&!a.includes(v.id)&&v.rect.current){k.set(v.id,v.rect.current);continue}const C=v.node.current,E=C?new Vt(d(C),C):null;v.rect.current=E,E&&k.set(v.id,E)}return k}return w},[e,a,r,f,d]);return s.useEffect(()=>{g.current=e},[e]),s.useEffect(()=>{f||b()},[r,f]),s.useEffect(()=>{a&&a.length>0&&i(null)},[JSON.stringify(a)]),s.useEffect(()=>{f||typeof l!="number"||j.current!==null||(j.current=setTimeout(()=>{b(),j.current=null},l))},[l,f,b,...n]),{droppableRects:m,measureDroppableContainers:b,measuringScheduled:a!=null};function x(){switch(u){case ct.Always:return!1;case ct.BeforeDragging:return r;default:return!r}}}function Or(e,t){return ft(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function xo(e,t){return Or(e,t)}function vo(e){let{callback:t,disabled:r}=e;const n=Ht(t),o=s.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function Ct(e){let{callback:t,disabled:r}=e;const n=Ht(t),o=s.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function yo(e){return new Vt(Xe(e),e)}function cr(e,t,r){t===void 0&&(t=yo);const[n,o]=s.useState(null);function a(){o(d=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=d??r)!=null?u:null}const g=t(e);return JSON.stringify(d)===JSON.stringify(g)?d:g})}const i=vo({callback(d){if(e)for(const u of d){const{type:g,target:f}=u;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),l=Ct({callback:a});return pe(()=>{a(),e?(l?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),i?.disconnect())},[e]),n}function wo(e){const t=Or(e);return jr(e,t)}const dr=[];function ko(e){const t=s.useRef(e),r=ft(n=>e?n&&n!==dr&&e&&t.current&&e.parentNode===t.current.parentNode?n:St(e):dr,[e]);return s.useEffect(()=>{t.current=e},[e]),r}function So(e){const[t,r]=s.useState(null),n=s.useRef(e),o=s.useCallback(a=>{const i=_t(a.target);i&&r(l=>l?(l.set(i,Pt(i)),new Map(l)):null)},[]);return s.useEffect(()=>{const a=n.current;if(e!==a){i(a);const l=e.map(d=>{const u=_t(d);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,Pt(u)]):null}).filter(d=>d!=null);r(l.length?new Map(l):null),n.current=e}return()=>{i(e),i(a)};function i(l){l.forEach(d=>{const u=_t(d);u?.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,i)=>Ke(a,i),ue):Tr(e):ue,[e,t])}function ur(e,t){t===void 0&&(t=[]);const r=s.useRef(null);return s.useEffect(()=>{r.current=null},t),s.useEffect(()=>{const n=e!==ue;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?st(e,r.current):ue}function Co(e){s.useEffect(()=>{if(!kt)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function No(e,t){return s.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=i=>{a(i,t)},r},{}),[e,t])}function Pr(e){return s.useMemo(()=>e?Gn(e):null,[e])}const fr=[];function Ro(e,t){t===void 0&&(t=Xe);const[r]=e,n=Pr(r?J(r):null),[o,a]=s.useState(fr);function i(){a(()=>e.length?e.map(d=>Mr(d)?n:new Vt(t(d),d)):fr)}const l=Ct({callback:i});return pe(()=>{l?.disconnect(),i(),e.forEach(d=>l?.observe(d))},[e]),o}function Do(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ut(t)?t:e}function jo(e){let{measure:t}=e;const[r,n]=s.useState(null),o=s.useCallback(u=>{for(const{target:g}of u)if(ut(g)){n(f=>{const p=t(g);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),a=Ct({callback:o}),i=s.useCallback(u=>{const g=Do(u);a?.disconnect(),g&&a?.observe(g),n(g?t(g):null)},[t,a]),[l,d]=mt(i);return s.useMemo(()=>({nodeRef:l,rect:r,setRef:d}),[r,l,d])}const Eo=[{sensor:Zt,options:{}},{sensor:qt,options:{}}],_o={current:{}},pt={draggable:{measure:or},droppable:{measure:or,strategy:ct.WhileDragging,frequency:Bt.Optimized},dragOverlay:{measure:Xe}};class at extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Ao={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new at,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:xt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pt,measureDroppableContainers:xt,windowRect:null,measuringScheduled:!1},Mo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:xt,draggableNodes:new Map,over:null,measureDroppableContainers:xt},Nt=s.createContext(Mo),zr=s.createContext(Ao);function Io(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new at}}}function To(e,t){switch(t.type){case z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case z.DragEnd:case z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case z.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new at(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case z.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const i=new at(e.droppable.containers);return i.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case z.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new at(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Lo(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=s.useContext(Nt),a=Lt(n),i=Lt(r?.id);return s.useEffect(()=>{if(!t&&!n&&a&&i!=null){if(!Gt(a)||document.activeElement===a.target)return;const l=o.get(i);if(!l)return;const{activatorNode:d,node:u}=l;if(!d.current&&!u.current)return;requestAnimationFrame(()=>{for(const g of[d.current,u.current]){if(!g)continue;const f=Rn(g);if(f){f.focus();break}}})}},[n,t,o,i,a]),null}function Oo(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function Po(e){return s.useMemo(()=>({draggable:{...pt.draggable,...e?.draggable},droppable:{...pt.droppable,...e?.droppable},dragOverlay:{...pt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function zo(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=s.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;pe(()=>{if(!i&&!l||!t){a.current=!1;return}if(a.current||!n)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const g=r(u),f=jr(g,n);if(i||(f.x=0),l||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=Er(u);p&&p.scrollBy({top:f.y,left:f.x})}},[t,i,l,n,r])}const Br=s.createContext({...ue,scaleX:1,scaleY:1});var Me;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Me||(Me={}));const Bo=s.memo(function(t){var r,n,o,a;let{id:i,accessibility:l,autoScroll:d=!0,children:u,sensors:g=Eo,collisionDetection:f=Fn,measuring:p,modifiers:b,...j}=t;const m=s.useReducer(To,void 0,Io),[x,w]=m,[k,v]=Mn(),[C,E]=s.useState(Me.Uninitialized),N=C===Me.Initialized,{draggable:{active:S,nodes:R,translate:L},droppable:{containers:T}}=x,_=S!=null?R.get(S):null,Z=s.useRef({initial:null,translated:null}),V=s.useMemo(()=>{var K;return S!=null?{id:S,data:(K=_?.data)!=null?K:_o,rect:Z}:null},[S,_]),Q=s.useRef(null),[ye,ze]=s.useState(null),[G,Be]=s.useState(null),ae=it(j,Object.values(j)),B=gt("DndDescribedBy",i),we=s.useMemo(()=>T.getEnabled(),[T]),W=Po(p),{droppableRects:ie,measureDroppableContainers:fe,measuringScheduled:ke}=mo(we,{dragging:N,dependencies:[L.x,L.y],config:W.droppable}),O=bo(R,S),$e=s.useMemo(()=>G?Ot(G):null,[G]),se=Pe(),P=xo(O,W.draggable.measure);zo({activeNode:S!=null?R.get(S):null,config:se.layoutShiftCompensation,initialRect:P,measure:W.draggable.measure});const A=cr(O,W.draggable.measure,P),Ie=cr(O?O.parentElement:null),U=s.useRef({activatorEvent:null,active:null,activeNode:O,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Se=T.getNodeFor((r=U.current.over)==null?void 0:r.id),te=jo({measure:W.dragOverlay.measure}),me=(n=te.nodeRef.current)!=null?n:O,xe=N?(o=te.rect)!=null?o:A:null,Ce=!!(te.nodeRef.current&&te.rect),Te=wo(Ce?null:A),He=Pr(me?J(me):null),le=ko(N?Se??O:null),Le=Ro(le),Oe=Oo(b,{transform:{x:L.x-Te.x,y:L.y-Te.y,scaleX:1,scaleY:1},activatorEvent:G,active:V,activeNodeRect:A,containerNodeRect:Ie,draggingNodeRect:xe,over:U.current.over,overlayNodeRect:te.rect,scrollableAncestors:le,scrollableAncestorRects:Le,windowRect:He}),Ge=$e?Ke($e,L):null,Fe=So(le),Ne=ur(Fe),Rt=ur(Fe,[A]),Re=Ke(Oe,Ne),De=xe?Yn(xe,Oe):null,je=V&&De?f({active:V,collisionRect:De,droppableRects:ie,droppableContainers:we,pointerCoordinates:Ge}):null,Ve=Dr(je,"id"),[ge,Ee]=s.useState(null),qe=Ce?Oe:Ke(Oe,Rt),h=Un(qe,(a=ge?.rect)!=null?a:null,A),M=s.useRef(null),re=s.useCallback((K,q)=>{let{sensor:X,options:$}=q;if(Q.current==null)return;const ne=R.get(Q.current);if(!ne)return;const ee=K.nativeEvent,he=new X({active:Q.current,activeNode:ne,event:ee,options:$,context:U,onAbort(Y){if(!R.get(Y))return;const{onDragAbort:be}=ae.current,ve={id:Y};be?.(ve),k({type:"onDragAbort",event:ve})},onPending(Y,_e,be,ve){if(!R.get(Y))return;const{onDragPending:et}=ae.current,Ae={id:Y,constraint:_e,initialCoordinates:be,offset:ve};et?.(Ae),k({type:"onDragPending",event:Ae})},onStart(Y){const _e=Q.current;if(_e==null)return;const be=R.get(_e);if(!be)return;const{onDragStart:ve}=ae.current,Qe={activatorEvent:ee,active:{id:_e,data:be.data,rect:Z}};rt.unstable_batchedUpdates(()=>{ve?.(Qe),E(Me.Initializing),w({type:z.DragStart,initialCoordinates:Y,active:_e}),k({type:"onDragStart",event:Qe}),ze(M.current),Be(ee)})},onMove(Y){w({type:z.DragMove,coordinates:Y})},onEnd:Ue(z.DragEnd),onCancel:Ue(z.DragCancel)});M.current=he;function Ue(Y){return async function(){const{active:be,collisions:ve,over:Qe,scrollAdjustedTranslate:et}=U.current;let Ae=null;if(be&&et){const{cancelDrop:tt}=ae.current;Ae={activatorEvent:ee,active:be,collisions:ve,delta:et,over:Qe},Y===z.DragEnd&&typeof tt=="function"&&await Promise.resolve(tt(Ae))&&(Y=z.DragCancel)}Q.current=null,rt.unstable_batchedUpdates(()=>{w({type:Y}),E(Me.Uninitialized),Ee(null),ze(null),Be(null),M.current=null;const tt=Y===z.DragEnd?"onDragEnd":"onDragCancel";if(Ae){const jt=ae.current[tt];jt?.(Ae),k({type:tt,event:Ae})}})}}},[R]),Je=s.useCallback((K,q)=>(X,$)=>{const ne=X.nativeEvent,ee=R.get($);if(Q.current!==null||!ee||ne.dndKit||ne.defaultPrevented)return;const he={active:ee};K(X,q.options,he)===!0&&(ne.dndKit={capturedBy:q.sensor},Q.current=$,re(X,q))},[R,re]),Ze=po(g,Je);Co(g),pe(()=>{A&&C===Me.Initializing&&E(Me.Initialized)},[A,C]),s.useEffect(()=>{const{onDragMove:K}=ae.current,{active:q,activatorEvent:X,collisions:$,over:ne}=U.current;if(!q||!X)return;const ee={active:q,activatorEvent:X,collisions:$,delta:{x:Re.x,y:Re.y},over:ne};rt.unstable_batchedUpdates(()=>{K?.(ee),k({type:"onDragMove",event:ee})})},[Re.x,Re.y]),s.useEffect(()=>{const{active:K,activatorEvent:q,collisions:X,droppableContainers:$,scrollAdjustedTranslate:ne}=U.current;if(!K||Q.current==null||!q||!ne)return;const{onDragOver:ee}=ae.current,he=$.get(Ve),Ue=he&&he.rect.current?{id:he.id,rect:he.rect.current,data:he.data,disabled:he.disabled}:null,Y={active:K,activatorEvent:q,collisions:X,delta:{x:ne.x,y:ne.y},over:Ue};rt.unstable_batchedUpdates(()=>{Ee(Ue),ee?.(Y),k({type:"onDragOver",event:Y})})},[Ve]),pe(()=>{U.current={activatorEvent:G,active:V,activeNode:O,collisionRect:De,collisions:je,droppableRects:ie,draggableNodes:R,draggingNode:me,draggingNodeRect:xe,droppableContainers:T,over:ge,scrollableAncestors:le,scrollAdjustedTranslate:Re},Z.current={initial:xe,translated:De}},[V,O,je,De,R,me,xe,ie,T,ge,le,Re]),fo({...se,delta:L,draggingRect:De,pointerCoordinates:Ge,scrollableAncestors:le,scrollableAncestorRects:Le});const Dt=s.useMemo(()=>({active:V,activeNode:O,activeNodeRect:A,activatorEvent:G,collisions:je,containerNodeRect:Ie,dragOverlay:te,draggableNodes:R,droppableContainers:T,droppableRects:ie,over:ge,measureDroppableContainers:fe,scrollableAncestors:le,scrollableAncestorRects:Le,measuringConfiguration:W,measuringScheduled:ke,windowRect:He}),[V,O,A,G,je,Ie,te,R,T,ie,ge,fe,le,Le,W,ke,He]),ce=s.useMemo(()=>({activatorEvent:G,activators:Ze,active:V,activeNodeRect:A,ariaDescribedById:{draggable:B},dispatch:w,draggableNodes:R,over:ge,measureDroppableContainers:fe}),[G,Ze,V,A,w,B,R,ge,fe]);return H.createElement(Cr.Provider,{value:v},H.createElement(Nt.Provider,{value:ce},H.createElement(zr.Provider,{value:Dt},H.createElement(Br.Provider,{value:h},u)),H.createElement(Lo,{disabled:l?.restoreFocus===!1})),H.createElement(Ln,{...l,hiddenTextDescribedById:B}));function Pe(){const K=ye?.autoScrollEnabled===!1,q=typeof d=="object"?d.enabled===!1:d===!1,X=N&&!K&&!q;return typeof d=="object"?{...d,enabled:X}:{enabled:X}}}),$o=s.createContext(null),gr="button",Fo="Draggable";function Uo(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=gt(Fo),{activators:i,activatorEvent:l,active:d,activeNodeRect:u,ariaDescribedById:g,draggableNodes:f,over:p}=s.useContext(Nt),{role:b=gr,roleDescription:j="draggable",tabIndex:m=0}=o??{},x=d?.id===t,w=s.useContext(x?Br:$o),[k,v]=mt(),[C,E]=mt(),N=No(i,t),S=it(r);pe(()=>(f.set(t,{id:t,key:a,node:k,activatorNode:C,data:S}),()=>{const L=f.get(t);L&&L.key===a&&f.delete(t)}),[f,t]);const R=s.useMemo(()=>({role:b,tabIndex:m,"aria-disabled":n,"aria-pressed":x&&b===gr?!0:void 0,"aria-roledescription":j,"aria-describedby":g.draggable}),[n,b,m,x,j,g.draggable]);return{active:d,activatorEvent:l,activeNodeRect:u,attributes:R,isDragging:x,listeners:n?void 0:N,node:k,over:p,setNodeRef:v,setActivatorNodeRef:E,transform:w}}function Ko(){return s.useContext(zr)}const Yo="Droppable",Wo={timeout:25};function Xo(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=gt(Yo),{active:i,dispatch:l,over:d,measureDroppableContainers:u}=s.useContext(Nt),g=s.useRef({disabled:r}),f=s.useRef(!1),p=s.useRef(null),b=s.useRef(null),{disabled:j,updateMeasurementsFor:m,timeout:x}={...Wo,...o},w=it(m??n),k=s.useCallback(()=>{if(!f.current){f.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),b.current=null},x)},[x]),v=Ct({callback:k,disabled:j||!i}),C=s.useCallback((R,L)=>{v&&(L&&(v.unobserve(L),f.current=!1),R&&v.observe(R))},[v]),[E,N]=mt(C),S=it(t);return s.useEffect(()=>{!v||!E.current||(v.disconnect(),f.current=!1,v.observe(E.current))},[E,v]),s.useEffect(()=>(l({type:z.RegisterDroppable,element:{id:n,key:a,disabled:r,node:E,rect:p,data:S}}),()=>l({type:z.UnregisterDroppable,key:a,id:n})),[n]),s.useEffect(()=>{r!==g.current.disabled&&(l({type:z.SetDroppableDisabled,id:n,key:a,disabled:r}),g.current.disabled=r)},[n,a,r,l]),{active:i,rect:p,isOver:d?.id===n,node:E,over:d,setNodeRef:N}}const Ho=e=>{let{transform:t}=e;return{...t,y:0}};function $r(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Go(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function ht(e){return e!==null&&e>=0}function Vo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function qo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const bt={scaleX:1,scaleY:1},Jo=e=>{var t;let{rects:r,activeNodeRect:n,activeIndex:o,overIndex:a,index:i}=e;const l=(t=r[o])!=null?t:n;if(!l)return null;const d=Zo(r,i,o);if(i===o){const u=r[a];return u?{x:o<a?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...bt}:null}return i>o&&i<=a?{x:-l.width-d,y:0,...bt}:i<o&&i>=a?{x:l.width+d,y:0,...bt}:{x:0,y:0,...bt}};function Zo(e,t,r){const n=e[t],o=e[t-1],a=e[t+1];return!n||!o&&!a?0:r<t?o?n.left-(o.left+o.width):a.left-(n.left+n.width):a?a.left-(n.left+n.width):n.left-(o.left+o.width)}const Fr=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=$r(t,n,r),i=t[o],l=a[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},Ur="Sortable",Kr=H.createContext({activeIndex:-1,containerId:Ur,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Fr,disabled:{draggable:!1,droppable:!1}});function Qo(e){let{children:t,id:r,items:n,strategy:o=Fr,disabled:a=!1}=e;const{active:i,dragOverlay:l,droppableRects:d,over:u,measureDroppableContainers:g}=Ko(),f=gt(Ur,r),p=l.rect!==null,b=s.useMemo(()=>n.map(N=>typeof N=="object"&&"id"in N?N.id:N),[n]),j=i!=null,m=i?b.indexOf(i.id):-1,x=u?b.indexOf(u.id):-1,w=s.useRef(b),k=!Vo(b,w.current),v=x!==-1&&m===-1||k,C=qo(a);pe(()=>{k&&j&&g(b)},[k,b,j,g]),s.useEffect(()=>{w.current=b},[b]);const E=s.useMemo(()=>({activeIndex:m,containerId:f,disabled:C,disableTransforms:v,items:b,overIndex:x,useDragOverlay:p,sortedRects:Go(b,d),strategy:o}),[m,f,C.draggable,C.droppable,v,b,x,d,p,o]);return H.createElement(Kr.Provider,{value:E},t)}const ea=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return $r(r,n,o).indexOf(t)},ta=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:d,transition:u}=e;return!u||!n||l!==a&&o===i?!1:r?!0:i!==o&&t===d},ra={duration:200,easing:"ease"},Yr="transform",na=lt.Transition.toString({property:Yr,duration:0,easing:"linear"}),oa={roleDescription:"sortable"};function aa(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,i]=s.useState(null),l=s.useRef(r);return pe(()=>{if(!t&&r!==l.current&&n.current){const d=o.current;if(d){const u=Xe(n.current,{ignoreTransform:!0}),g={x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height};(g.x||g.y)&&i(g)}}r!==l.current&&(l.current=r)},[t,r,n,o]),s.useEffect(()=>{a&&i(null)},[a]),a}function ia(e){let{animateLayoutChanges:t=ta,attributes:r,disabled:n,data:o,getNewIndex:a=ea,id:i,strategy:l,resizeObserverConfig:d,transition:u=ra}=e;const{items:g,containerId:f,activeIndex:p,disabled:b,disableTransforms:j,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:k}=s.useContext(Kr),v=sa(n,b),C=g.indexOf(i),E=s.useMemo(()=>({sortable:{containerId:f,index:C,items:g},...o}),[f,o,C,g]),N=s.useMemo(()=>g.slice(g.indexOf(i)),[g,i]),{rect:S,node:R,isOver:L,setNodeRef:T}=Xo({id:i,data:E,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...d}}),{active:_,activatorEvent:Z,activeNodeRect:V,attributes:Q,setNodeRef:ye,listeners:ze,isDragging:G,over:Be,setActivatorNodeRef:ae,transform:B}=Uo({id:i,data:E,attributes:{...oa,...r},disabled:v.draggable}),we=kn(T,ye),W=!!_,ie=W&&!j&&ht(p)&&ht(x),fe=!w&&G,ke=fe&&ie?B:null,$e=ie?ke??(l??k)({rects:m,activeNodeRect:V,activeIndex:p,overIndex:x,index:C}):null,se=ht(p)&&ht(x)?a({id:i,items:g,activeIndex:p,overIndex:x}):C,P=_?.id,A=s.useRef({activeId:P,items:g,newIndex:se,containerId:f}),Ie=g!==A.current.items,U=t({active:_,containerId:f,isDragging:G,isSorting:W,id:i,index:C,items:g,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),Se=aa({disabled:!U,index:C,node:R,rect:S});return s.useEffect(()=>{W&&A.current.newIndex!==se&&(A.current.newIndex=se),f!==A.current.containerId&&(A.current.containerId=f),g!==A.current.items&&(A.current.items=g)},[W,se,f,g]),s.useEffect(()=>{if(P===A.current.activeId)return;if(P&&!A.current.activeId){A.current.activeId=P;return}const me=setTimeout(()=>{A.current.activeId=P},50);return()=>clearTimeout(me)},[P]),{active:_,activeIndex:p,attributes:Q,data:E,rect:S,index:C,newIndex:se,items:g,isOver:L,isSorting:W,isDragging:G,listeners:ze,node:R,overIndex:x,over:Be,setNodeRef:we,setActivatorNodeRef:ae,setDroppableNodeRef:T,setDraggableNodeRef:ye,transform:Se??$e,transition:te()};function te(){if(Se||Ie&&A.current.newIndex===C)return na;if(!(fe&&!Gt(Z)||!u)&&(W||U))return lt.Transition.toString({...u,property:Yr})}}function sa(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(n=e?.droppable)!=null?n:t.droppable}}function yt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const la=[D.Down,D.Right,D.Up,D.Left],ca=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:l}}=t;if(la.includes(e.code)){if(e.preventDefault(),!r||!n)return;const d=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=o.get(f.id);if(p)switch(e.code){case D.Down:n.top<p.top&&d.push(f);break;case D.Up:n.top>p.top&&d.push(f);break;case D.Left:n.left>p.left&&d.push(f);break;case D.Right:n.left<p.left&&d.push(f);break}});const u=Bn({collisionRect:n,droppableRects:o,droppableContainers:d});let g=Dr(u,"id");if(g===i?.id&&u.length>1&&(g=u[1].id),g!=null){const f=a.get(r.id),p=a.get(g),b=p?o.get(p.id):null,j=p?.node.current;if(j&&b&&f&&p){const x=St(j).some((N,S)=>l[S]!==N),w=Wr(f,p),k=da(f,p),v=x||!w?{x:0,y:0}:{x:k?n.width-b.width:0,y:k?n.height-b.height:0},C={x:b.left,y:b.top};return v.x&&v.y?C:st(C,v)}}}};function Wr(e,t){return!yt(e)||!yt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function da(e,t){return!yt(e)||!yt(t)||!Wr(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function dt(e,{min:t,max:r,fallback:n}){const o=Number(e);if(!Number.isFinite(o))return n;const a=Math.floor(o);return a<t?t:a>r?r:a}function ua(e,t){const r=dt(t,{min:0,max:1e6,fallback:0}),n=dt(e,{min:1,max:Math.max(1,r||1),fallback:1});if(r<=1)return[1];const o=new Set([1,r,n-2,n-1,n,n+1,n+2]),a=Array.from(o).filter(d=>Number.isInteger(d)&&d>=1&&d<=r).sort((d,u)=>d-u),i=[];let l=null;for(const d of a)l!=null&&d-l>1&&i.push(null),i.push(d),l=d;return i}function fa({page:e,totalPages:t}){const r=typeof t=="number"&&Number.isFinite(t)&&t>=0,n=r?dt(t,{min:0,max:1e6,fallback:0}):null,o=dt(e,{min:1,max:r?Math.max(1,n||1):1e6,fallback:1}),a=o>1,i=r?o<n:!0;return{canPrev:a,canNext:i,safePage:o,safeTotal:n}}function ga({entries:e,me:t,meLabel:r}){const n=Array.isArray(e)?e:[],o=t&&typeof t.rank=="number"?t.rank:null;return!o||n.some(i=>!!i?.is_me)?n:[{rank:o,is_me:!0,is_pinned:!0,user_id:t?.user_id??null,display_name:r,avatar_url:t?.avatar_url??null,github_url:null,is_public:!1,gpt_tokens:t?.gpt_tokens??"0",claude_tokens:t?.claude_tokens??"0",gemini_tokens:t?.gemini_tokens??"0",cursor_tokens:t?.cursor_tokens??"0",opencode_tokens:t?.opencode_tokens??"0",openclaw_tokens:t?.openclaw_tokens??"0",hermes_tokens:t?.hermes_tokens??"0",kiro_tokens:t?.kiro_tokens??"0",copilot_tokens:t?.copilot_tokens??"0",kimi_tokens:t?.kimi_tokens??"0",other_tokens:t?.other_tokens??"0",total_tokens:t?.total_tokens??"0",estimated_cost_usd:t?.estimated_cost_usd??null},...n]}function ha(e,t){const r=Number(e),n=Number(t);return!Number.isFinite(r)||r<1||!Number.isFinite(n)||n<1?null:Math.ceil(r/n)}function ba(e){let t=0;const r=String(e??"");for(let n=0;n<r.length;n+=1)t=Math.imul(31,t)+r.charCodeAt(n)|0;return Math.abs(t)%360}function pa(e){const t=String(e??"").trim();if(!t)return"?";const r=t.split(/\s+/).filter(Boolean);if(r.length>=2){const n=r[0][0]||"",o=r[1][0]||"";return`${n}${o}`.toUpperCase()}return t.slice(0,2).toUpperCase()}const hr={sm:"h-7 w-7 min-h-7 min-w-7 text-[10px]",md:"h-8 w-8 min-h-8 min-w-8 text-[11px]",lg:"h-14 w-14 min-h-14 min-w-14 text-base"};function $t({avatarUrl:e,displayName:t,seed:r,size:n="md",className:o}){const a=hr[n]||hr.md,i=ba(r??t??""),l=typeof e=="string"?e.trim():"",[d,u]=H.useState(!1);return H.useEffect(()=>{u(!1)},[l]),l&&!d?c.jsx("img",{src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>u(!0),className:I("rounded-full object-cover ring-1 ring-white/10",a,o)}):c.jsx("div",{className:I("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",a,o),style:{backgroundColor:`hsl(${i} 42% 34%)`},"aria-hidden":!0,children:pa(t)})}const ma=new Set(["/brand-logos/cursor.svg","/brand-logos/kimi.svg","/brand-logos/kiro.svg","/brand-logos/copilot.svg"]);function xa({iconSrc:e,label:t}){return c.jsxs("span",{className:"inline-flex items-center gap-3",children:[e?c.jsx("img",{src:e,alt:"",width:16,height:16,className:`h-4 w-4 shrink-0 object-contain opacity-90 ${ma.has(e)?"dark:invert":""}`}):null,c.jsx("span",{className:"whitespace-nowrap",children:t})]})}const wt=[{key:"gpt_tokens",copyKey:"leaderboard.column.codex",icon:"/brand-logos/codex.svg"},{key:"claude_tokens",copyKey:"leaderboard.column.claude",icon:"/brand-logos/claude-code.svg"},{key:"gemini_tokens",copyKey:"leaderboard.column.gemini",icon:"/brand-logos/gemini.svg"},{key:"cursor_tokens",copyKey:"leaderboard.column.cursor",icon:"/brand-logos/cursor.svg"},{key:"kiro_tokens",copyKey:"leaderboard.column.kiro",icon:"/brand-logos/kiro.svg"},{key:"copilot_tokens",copyKey:"leaderboard.column.copilot",icon:"/brand-logos/copilot.svg"},{key:"kimi_tokens",copyKey:"leaderboard.column.kimi",icon:"/brand-logos/kimi.svg"},{key:"opencode_tokens",copyKey:"leaderboard.column.opencode",icon:"/brand-logos/opencode.svg"},{key:"openclaw_tokens",copyKey:"leaderboard.column.openclaw",icon:"/brand-logos/openclaw.svg"},{key:"hermes_tokens",copyKey:"leaderboard.column.hermes",icon:"/brand-logos/hermes.svg"},{key:"other_tokens",copyKey:"leaderboard.column.supplemental",icon:null}],Xr="sticky left-0 z-40 w-[72px] min-w-[72px] max-w-[72px] bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle",Hr="sticky left-[71px] z-40 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-4 py-4 align-middle";function Ft(e){return I("sticky left-0 z-30 w-[72px] min-w-[72px] max-w-[72px] px-4 py-4 whitespace-nowrap",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function Ut(e){return I("sticky left-[71px] z-30 hover:z-50 min-w-[200px] max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-4 py-4 min-w-0",e?"bg-oai-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function de({className:e}){return c.jsx("div",{className:I("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",e)})}function va({index:e}){const t=e<3?"w-24":e<8?"w-20":"w-16",r=e<3?"w-16":"w-12",n=e<5?"w-14":"w-10";return c.jsxs("tr",{className:"group",children:[c.jsx("td",{className:I(Ft(!1),"!group-hover:bg-transparent"),children:c.jsx(de,{className:"h-4 w-6"})}),c.jsx("td",{className:I(Ut(!1),"!group-hover:bg-transparent"),children:c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(de,{className:"h-8 w-8 min-w-8 rounded-full"}),c.jsx(de,{className:I("h-4",t)})]})}),c.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:c.jsx(de,{className:I("h-4",r)})}),c.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:c.jsx(de,{className:"h-4 w-12"})}),wt.map(o=>c.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:c.jsx(de,{className:I("h-4",n)})},o.key))]})}function ya({rows:e=10}){return c.jsx("div",{className:"w-full overflow-x-auto",children:c.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[c.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:c.jsxs("tr",{children:[c.jsx("th",{className:I(Xr,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:c.jsx(de,{className:"h-3.5 w-6"})}),c.jsx("th",{className:I(Hr,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:c.jsx(de,{className:"h-3.5 w-12"})}),c.jsx("th",{className:"px-4 py-4",children:c.jsx(de,{className:"h-3.5 w-10"})}),c.jsx("th",{className:"px-4 py-4",children:c.jsx(de,{className:"h-3.5 w-14"})}),wt.map(t=>c.jsx("th",{className:"px-4 py-4",children:c.jsx(de,{className:"h-3.5 w-12"})},t.key))]})}),c.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Array.from({length:e},(t,r)=>c.jsx(va,{index:r},r))})]})})}function wa({id:e,thClassName:t,children:r}){const{attributes:n,listeners:o,setNodeRef:a,transform:i,transition:l,isDragging:d}=ia({id:e}),u=lt.Transform.toString(i)||"";s.useLayoutEffect(()=>{const f=document.querySelectorAll(`td[data-column-key="${e}"]`),p="0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)";return f.forEach(b=>{b.style.transform=u,b.style.transition=l||"",b.style.zIndex=d?"20":"",b.style.position=u?"relative":"",b.style.boxShadow=d?p:""}),()=>{f.forEach(b=>{b.style.transform="",b.style.transition="",b.style.zIndex="",b.style.position="",b.style.boxShadow=""})}},[e,u,l,d]);const g={transform:u,transition:l,position:u?"relative":void 0,zIndex:d?20:void 0,boxShadow:d?"0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)":void 0};return c.jsx("th",{ref:a,style:g,className:I(t,"group/col select-none cursor-grab active:cursor-grabbing touch-none"),...n,...o,children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx("span",{"aria-hidden":"true",className:I("-mr-1 inline-flex h-4 w-3 shrink-0 items-center justify-center text-oai-gray-400 dark:text-oai-gray-600","opacity-0 transition-opacity duration-150 group-hover/col:opacity-100",d&&"opacity-100"),children:c.jsxs("svg",{viewBox:"0 0 8 14",width:"8",height:"14",fill:"currentColor","aria-hidden":"true",children:[c.jsx("circle",{cx:"2",cy:"2",r:"1"}),c.jsx("circle",{cx:"6",cy:"2",r:"1"}),c.jsx("circle",{cx:"2",cy:"7",r:"1"}),c.jsx("circle",{cx:"6",cy:"7",r:"1"}),c.jsx("circle",{cx:"2",cy:"12",r:"1"}),c.jsx("circle",{cx:"6",cy:"12",r:"1"})]})}),r]})})}const Gr="tokentracker.leaderboard.columnOrder.v1";function ka(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Gr);if(!e)return null;const t=JSON.parse(e);return Array.isArray(t)?t.filter(r=>typeof r=="string"):null}catch{return null}}function It(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Gr,JSON.stringify(e))}catch{}}function br(e,t){if(!e)return t;const r=new Set(t),n=e.filter(a=>r.has(a)),o=t.filter(a=>!n.includes(a));return[...n,...o]}function Sa(e){const t=s.useMemo(()=>e.join("|"),[e]),[r,n]=s.useState(()=>br(ka(),e));s.useEffect(()=>{n(i=>{const l=br(i,e);return l.length===i.length&&l.every((u,g)=>u===i[g])?i:(It(l),l)})},[t,e]);const o=s.useCallback((i,l)=>{!i||!l||i===l||n(d=>{const u=d.indexOf(i),g=d.indexOf(l);if(u===-1||g===-1)return d;const f=d.slice(),[p]=f.splice(u,1);return f.splice(g,0,p),It(f),f})},[]),a=s.useCallback(()=>{It(e),n(e)},[e]);return{order:r,reorder:o,reset:a}}function Ca(e,t){const r=Number(e),n=Number(t);return!Number.isFinite(r)||r<1||!Number.isFinite(n)||n<1?null:Math.min(100,Math.max(1,Math.ceil(r/n*100)))}function Vr(e){return typeof e=="string"?e.trim():""}function Na(e){const t=Vr(e);return t?t.toLowerCase()==="anonymous":!0}function Ra({me:e,totalEntries:t,meLabel:r,onJumpToMe:n,canJump:o}){const a=e&&typeof e.rank=="number"?e.rank:null;if(!a)return null;const i=Number(t)||0,l=Ca(a,i),d=Vr(e?.display_name),u=!d||Na(d)?r||"You":d,g=e?.user_id||u,f=!!o&&typeof n=="function",p=f?"button":"div",b=f?{type:"button",onClick:n,"aria-label":y("leaderboard.summary.jump_to_me")}:{};return c.jsxs(p,{...b,className:I("group inline-flex h-9 items-center gap-2.5 rounded-full border pl-1 pr-3.5 transition-all duration-300 select-none shadow-[0_1px_2px_rgba(0,0,0,0.03)]",f?"border-oai-gray-200 hover:border-oai-brand-400 dark:border-oai-gray-800 dark:hover:border-oai-brand-500/80 bg-oai-gray-50/50 dark:bg-white/[0.02] backdrop-blur-md hover:bg-oai-brand-50/40 dark:hover:bg-oai-brand-950/20 active:scale-[0.97] hover:shadow-[0_4px_12px_rgba(0,0,0,0.05)] dark:hover:shadow-[0_4px_20px_rgba(0,0,0,0.25)] dark:ring-1 dark:ring-white/[0.04] dark:hover:ring-white/[0.08]":"border-oai-gray-100 dark:border-oai-gray-800/60 bg-oai-gray-50/20 dark:bg-white/[0.01] backdrop-blur-sm dark:ring-1 dark:ring-white/[0.02]"),children:[c.jsx($t,{size:"sm",avatarUrl:e?.avatar_url,displayName:u,seed:g}),c.jsx("span",{className:"max-w-[120px] truncate text-xs font-semibold text-oai-black dark:text-oai-gray-200 group-hover:text-oai-brand-600 dark:group-hover:text-oai-brand-400 transition-colors",children:u}),c.jsxs("span",{className:"text-xs font-bold tabular-nums text-oai-gray-800 dark:text-white",children:["#",a.toLocaleString()]}),l!=null&&c.jsx("span",{className:I("inline-flex items-center rounded-full px-2 py-0.5 text-[9px] font-extrabold tracking-wider tabular-nums uppercase transition-colors duration-300 ring-1",l<=10?"bg-amber-500/10 text-amber-600 dark:bg-amber-500/15 dark:text-amber-400 ring-amber-500/20":"bg-oai-brand-100/50 text-oai-brand-700 dark:bg-oai-brand-500/10 dark:text-oai-brand-400 ring-oai-brand-500/10"),children:y("leaderboard.summary.percentile",{p:String(l)})}),f?c.jsx(wn,{"aria-hidden":!0,className:"size-3 text-oai-gray-400 transition-all duration-300 group-hover:text-oai-brand-500 dark:text-oai-gray-500 group-hover:translate-x-0.5 group-hover:scale-110"}):c.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0 items-center justify-center ml-1",title:"You are here",children:[c.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75 duration-1000"}),c.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-500"})]})]})}const Da=s.lazy(()=>bn(()=>import("./LeaderboardProfileModal-CnbpLjG_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(e=>({default:e.LeaderboardProfileModal}))),Kt=[10,20,50,100],Yt=20,qr="tokentracker:leaderboard:pageSize";function ja(){if(typeof window>"u")return Yt;try{const e=window.localStorage.getItem(qr),t=Number(e);if(Kt.includes(t))return t}catch{}return Yt}function pr(e,t,r){const n=Number(e);if(!Number.isFinite(n)||n<=0)return"-";const o=un(t),a=t===pn?n:n*r;return a>=1e3?`${o}${Math.round(a).toLocaleString()}`:a>=10?`${o}${Math.round(a)}`:`${o}${a.toFixed(2)}`}function mr(e,t,r){const n=t?"text-oai-gray-700 dark:text-oai-gray-300":"text-oai-gray-500 dark:text-oai-gray-400",o=t?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60";return r.map(a=>c.jsx("td",{"data-column-key":a.key,className:I("px-4 py-4 whitespace-nowrap text-right tabular-nums",n,o),children:Tt(e?.[a.key])},a.key))}const Ea={1:{text:"text-amber-600 dark:text-amber-400",badge:"bg-amber-50 dark:bg-amber-900/20"},2:{text:"text-gray-500 dark:text-gray-300",badge:"bg-gray-50 dark:bg-gray-800/40"},3:{text:"text-orange-700 dark:text-orange-400",badge:"bg-orange-50 dark:bg-orange-900/20"}};function xr({rank:e,placeholder:t}){const r=Ea[e];return r?c.jsx("span",{className:I("inline-flex items-center justify-center h-7 w-7 rounded-full text-xs font-bold",r.text,r.badge),children:e}):c.jsx("span",{className:"inline-flex items-center justify-center h-7 w-7 text-sm",children:e??t})}function vr(e){if(typeof e!="string")return null;const t=e.trim().toLowerCase();return t==="week"||t==="month"||t==="total"?t:null}function _a(e){if(!e)return y("shared.error.prefix",{error:y("leaderboard.error.unknown")});const t=e?.message||String(e),r=String(t||"").trim()||y("leaderboard.error.unknown");return y("shared.error.prefix",{error:r})}function Jr(e){return typeof e!="string"?"":e.trim()}function Aa(e){const t=Jr(e);return t?t.toLowerCase()==="anonymous":!0}function yr(e,t){const r=typeof e?.user_id=="string"?e.user_id.trim():"";return r||`${e?.rank??""}:${t}`}function wr({githubUrl:e}){return c.jsxs("span",{className:"relative inline-flex items-center group/gh shrink-0",children:[c.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>t.stopPropagation(),"aria-label":y("leaderboard.github.aria"),className:"text-oai-black hover:text-oai-gray-500 dark:text-white dark:hover:text-oai-gray-400 transition-colors",children:c.jsx(mn,{provider:"GITHUB",size:16})}),c.jsxs("span",{role:"tooltip",className:"invisible opacity-0 group-hover/gh:visible group-hover/gh:opacity-100 absolute right-0 bottom-full mb-2 whitespace-nowrap rounded-md bg-oai-black dark:bg-oai-gray-700 px-2.5 py-1.5 text-[11px] leading-relaxed text-white shadow-lg transition-opacity duration-150 z-50 before:content-[''] before:absolute before:inset-x-0 before:top-full before:h-2.5",children:[c.jsx("span",{className:"block",children:y("leaderboard.github.tooltipAction")}),c.jsxs("span",{className:"block text-oai-gray-300 dark:text-oai-gray-400",children:[y("leaderboard.github.tooltipPrefix")," ",c.jsx(dn,{to:"/settings",onClick:t=>t.stopPropagation(),className:"text-white underline underline-offset-2 decoration-oai-gray-400 hover:text-oai-brand-300 hover:decoration-oai-brand-300",children:y("leaderboard.github.tooltipSettingsLink")}),y("leaderboard.github.tooltipSuffix")]})]})]})}function Ma({auth:e,signedIn:t,sessionSoftExpired:r}){const n=Qr(),o=en(),{openLoginModal:a}=tn(),{signedIn:i,loading:l,user:d}=rn(),{currency:u,rate:g}=xn(),f=s.useMemo(()=>nn(),[]),p=on(),b=t&&!r,j=s.useMemo(()=>b&&(typeof e=="function"||typeof e=="string"||e&&typeof e=="object")?e:null,[e,b]),m=b?j:null,x=b&&an(m),w=y("shared.placeholder.short"),k=s.useMemo(()=>wt.map(h=>h.key),[]),{order:v,reorder:C}=Sa(k),E=s.useMemo(()=>{const h=new Map;for(const M of wt)h.set(M.key,M);return h},[]),N=s.useMemo(()=>v.map(h=>E.get(h)).filter(Boolean),[v,E]),S=On(tr(Zt,{activationConstraint:{distance:6}}),tr(qt,{coordinateGetter:ca})),R=s.useCallback(h=>{const{active:M,over:re}=h;!re||M.id===re.id||C(String(M.id),String(re.id))},[C]),[L,T]=s.useState(1),[_,Z]=s.useState(ja),[V,Q]=s.useState(null),ye=s.useCallback(h=>{typeof h=="string"&&h.trim()&&Q(h.trim())},[]),ze=s.useCallback(()=>Q(null),[]),G=s.useCallback(h=>{const M=Kt.includes(h)?h:Yt;Z(M),T(1);try{window.localStorage.setItem(qr,String(M))}catch{}},[]),[Be,ae]=s.useState(0),[B,we]=s.useState(()=>({loading:!1,error:null,data:null})),[W,ie]=s.useState(()=>sn()),[fe,ke]=s.useState(!1),O=s.useMemo(()=>{const h=new URLSearchParams(n?.search||"");return vr(h.get("period"))||"total"},[n?.search]),$e=h=>{const M=vr(h);if(!M||M===O)return;const re=new URLSearchParams(n?.search||"");re.set("period",M),T(1),o(`${n?.pathname||"/leaderboard"}?${re.toString()}`,{replace:!0})};s.useEffect(()=>{l||p||i||a()},[i,l,p,a]),s.useEffect(()=>{T(1)},[O]);const se=s.useMemo(()=>(dt(L,{min:1,max:1e6,fallback:1})-1)*_,[L,_]);s.useEffect(()=>{if(!f&&!p)return;let h=!0;return we(M=>({...M,loading:!0,error:null})),(async()=>{const M=await ln({userId:d?.id||null,period:O,limit:_,offset:se});h&&we({loading:!1,error:null,data:M})})().catch(M=>{h&&we({loading:!1,error:_a(M),data:null})}),()=>{h=!1}},[f,d?.id,se,Be,p,O,_]);const P=B.data,A=P?.total_pages??null,Ie=P?.total_entries??0,U=P?.page??L,Se=s.useMemo(()=>ua(U,A),[U,A]),te=P?.from||null,me=P?.to||null,xe=P?.generated_at||null,Ce=P?.me||null,Te=y("leaderboard.me_label"),He=y("leaderboard.anon_label"),le=y("leaderboard.period.week"),Le=y("leaderboard.period.month"),Oe=y("leaderboard.period.total"),Ge=O==="month"?Le:O==="total"?Oe:le,Fe=s.useMemo(()=>{const h=Array.isArray(P?.entries)?P.entries:[];return ga({entries:h,me:Ce,meLabel:Te})},[P?.entries,Ce,Te]),Ne=s.useMemo(()=>ha(Ce?.rank,_),[Ce?.rank,_]),Rt=Ne!=null&&Ne===U,Re=s.useCallback(()=>{Ne!=null&&T(Ne)},[Ne]),De=async()=>{ke(!0);try{fn(!0),ie(!0),await gn(()=>Qt(m));const h=await Qt(m);h&&await hn({accessToken:h,period:O,source:"leaderboard-enable-sync"}),ae(M=>M+1)}catch(h){console.warn("[tokentracker] sync:",h)}finally{ke(!1)}},{canPrev:je,canNext:Ve}=fa({page:U,totalPages:A}),ge=Array.isArray(Fe)&&Fe.length!==0;let Ee=null;B.loading?Ee=c.jsx(ya,{rows:_}):B.error?Ee=c.jsx("div",{className:"px-6 py-12 text-center",children:c.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:B.error})}):ge?Ee=c.jsx(Bo,{sensors:S,collisionDetection:zn,modifiers:[Ho],onDragEnd:R,children:c.jsx("div",{className:"w-full overflow-x-auto",children:c.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[c.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:c.jsxs("tr",{children:[c.jsx("th",{className:I(Xr,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:y("leaderboard.column.rank")}),c.jsx("th",{className:I(Hr,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:y("leaderboard.column.user")}),c.jsx("th",{className:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",children:y("leaderboard.column.total")}),c.jsx("th",{className:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",title:"Based on estimated API pricing, not actual billing",children:y("leaderboard.column.est_cost")}),c.jsx(Qo,{items:v,strategy:Jo,children:N.map(h=>c.jsx(wa,{id:h.key,thClassName:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap align-middle",children:c.jsx(xa,{iconSrc:h.icon,label:y(h.copyKey)})},h.key))})]})}),c.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Fe.map((h,M)=>{if(h?.is_ellipsis){const $=4+N.length;return c.jsx("tr",{"aria-hidden":"true",children:c.jsx("td",{colSpan:$,className:"px-4 py-2 text-center text-oai-gray-400 dark:text-oai-gray-600 bg-white dark:bg-oai-gray-950 select-none tracking-[0.4em] text-xs",children:"···"})},`ellipsis-${M}`)}const re=!!h?.is_me,Je=typeof h?.user_id=="string"?h.user_id:null,Ze=Jr(h?.display_name),Dt=Aa(Ze)?He:Ze,ce=re?Te:Dt,Pe=!!Je,X=Pe?{role:"button",tabIndex:0,onClick:Pe?()=>ye(Je):void 0,onKeyDown:Pe?$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),ye(Je))}:void 0,"aria-label":y("leaderboard.profile_modal.row_aria",{name:ce})}:{};if(re){const $=!!h?.is_pinned;return c.jsxs("tr",{...X,className:I("bg-oai-brand-50 dark:bg-oai-brand-900/10 transition-colors",$?"border-t border-b border-oai-brand-300/40 dark:border-oai-brand-500/20":"border-y border-oai-brand-300/40 dark:border-oai-brand-500/30",Pe&&"cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500/60"),children:[c.jsx("td",{className:I(Ft(!0),"relative font-semibold text-oai-brand-600 dark:text-oai-brand-400",$&&"before:absolute before:left-0 before:top-[15%] before:h-[70%] before:w-[3px] before:rounded-r before:bg-oai-brand-500 dark:before:bg-oai-brand-400"),children:c.jsx(xr,{rank:h?.rank,placeholder:w})}),c.jsx("td",{className:Ut(!0),children:c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx($t,{avatarUrl:h?.avatar_url,displayName:ce,seed:yr(h,ce)}),c.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:ce}),h?.github_url&&c.jsx(wr,{githubUrl:h.github_url})]})}),c.jsx("td",{className:"px-4 py-4 font-medium text-oai-black dark:text-oai-white whitespace-nowrap text-right tabular-nums bg-oai-brand-50 dark:bg-oai-brand-900/10",children:Tt(h?.total_tokens)}),c.jsx("td",{className:"px-4 py-4 font-medium text-oai-brand-600 dark:text-oai-brand-400 whitespace-nowrap text-right tabular-nums bg-oai-brand-50 dark:bg-oai-brand-900/10",title:"Based on estimated API pricing, not actual billing",children:pr(h?.estimated_cost_usd,u,g)}),mr(h,!0,N)]},`row-${h?.rank}-${ce}${$?"-pin":""}`)}return c.jsxs("tr",{...X,className:I("group transition-colors",Pe&&"cursor-pointer hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500/60"),children:[c.jsx("td",{className:I(Ft(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:c.jsx(xr,{rank:h?.rank,placeholder:w})}),c.jsx("td",{className:Ut(!1),children:c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx($t,{avatarUrl:h?.avatar_url,displayName:ce,seed:yr(h,ce)}),c.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:ce}),h?.github_url&&c.jsx(wr,{githubUrl:h.github_url})]})}),c.jsx("td",{className:"px-4 py-4 font-semibold text-oai-gray-800 dark:text-oai-gray-200 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",children:Tt(h?.total_tokens)}),c.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",title:"Based on estimated API pricing, not actual billing",children:pr(h?.estimated_cost_usd,u,g)}),mr(h,!1,N)]},`row-${h?.rank}-${ce}`)})})]})})}):Ee=c.jsx("div",{className:"px-6 py-12 text-center",children:c.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.empty")})});let qe=null;return typeof A=="number"?qe=Se.map((h,M)=>h==null?c.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:y("leaderboard.pagination.ellipsis")},`ellipsis-${M}`):c.jsx("button",{className:I("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",h===U?"bg-oai-gray-200 dark:bg-oai-gray-800 text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white"),onClick:()=>T(h),disabled:B.loading,children:String(h)},`page-${h}`)):qe=c.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.pagination.page_unknown",{page:String(U)})}),c.jsxs("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:[c.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:c.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[c.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:y("leaderboard.title")}),c.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[O==="total"?y("leaderboard.range.total"):te&&me?y("leaderboard.range",{period:Ge,from:te,to:me}):y("leaderboard.range_loading",{period:Ge}),xe&&c.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:y("leaderboard.generated_at",{ts:xe})})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx(Ra,{me:Ce,totalEntries:Ie,meLabel:Te,onJumpToMe:Re,canJump:Ne!=null&&!Rt&&!B.loading}),c.jsx("div",{className:"inline-flex h-9 p-1 border border-oai-gray-200 dark:border-oai-gray-800 rounded-full items-center relative",children:["week","month","total"].map(h=>{const M=O===h;return c.jsxs("button",{onClick:()=>$e(h),disabled:B.loading,className:I("px-4 h-7 text-sm font-medium rounded-full flex items-center justify-center transition-colors relative",M?"text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-800 dark:hover:text-oai-gray-200"),children:[c.jsx("span",{className:"relative z-10",children:h==="week"?le:h==="month"?Le:Oe}),M&&c.jsx(cn.div,{layoutId:"leaderboard-period-active-bg",className:"absolute inset-0 bg-oai-gray-200 dark:bg-oai-gray-800 rounded-full z-0",transition:{type:"spring",stiffness:380,damping:30}})]},h)})})]})]}),!t&&c.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[c.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.signin_prompt")}),c.jsx("button",{onClick:a,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 transition-colors",children:y("leaderboard.signin_button")})]}),b&&x&&!W&&c.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[c.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:y("leaderboard.sync_prompt")}),c.jsx("button",{onClick:De,disabled:fe,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 disabled:opacity-50 transition-colors",children:fe?y("leaderboard.sync_button.busy"):y("leaderboard.sync_button.idle")})]}),c.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:[Ee,c.jsxs("div",{className:"px-6 py-3 border-t border-oai-gray-200 dark:border-oai-gray-800 flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:[c.jsx("label",{htmlFor:"leaderboard-page-size",className:"whitespace-nowrap",children:y("leaderboard.pagination.page_size_label")}),c.jsxs("div",{className:"relative",children:[c.jsx("select",{id:"leaderboard-page-size",value:_,onChange:h=>G(Number(h.target.value)),disabled:B.loading,className:"appearance-none pl-3 pr-8 py-1 rounded-md bg-white dark:bg-oai-gray-950 border border-oai-gray-300 dark:border-oai-gray-700 text-oai-gray-700 dark:text-oai-gray-300 hover:border-oai-gray-400 dark:hover:border-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500 disabled:opacity-50 transition-colors",children:Kt.map(h=>c.jsx("option",{value:h,children:h},h))}),c.jsx(vn,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:2,"aria-hidden":"true"})]})]}),c.jsx("div",{className:"h-5 w-px bg-oai-gray-200 dark:bg-oai-gray-800","aria-hidden":"true"}),c.jsx("button",{className:I("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",je&&!B.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>T(h=>Math.max(1,h-1)),disabled:!je||B.loading,children:y("leaderboard.pagination.prev")}),c.jsx("div",{className:"flex flex-wrap items-center gap-1",children:qe}),c.jsx("button",{className:I("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",Ve&&!B.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>T(h=>h+1),disabled:!Ve||B.loading,children:y("leaderboard.pagination.next")})]})]})]})}),c.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:c.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[c.jsx("p",{children:y("landing.v2.footer.line")}),c.jsx("a",{href:"https://github.com/mm7894215/TokenTracker",className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:y("landing.v2.nav.github")})]})}),c.jsx(s.Suspense,{fallback:null,children:c.jsx(Da,{isOpen:!!V,userId:V,period:O,accessToken:m,onClose:ze})})]})}const Pa=Object.freeze(Object.defineProperty({__proto__:null,LeaderboardPage:Ma},Symbol.toStringTag,{value:"Module"}));export{$t as L,Pa as a};
@@ -0,0 +1 @@
1
+ import{r as u,ah as A,aM as D,C as a,B as i,S as o,n as S,X as F,G as _,F as C}from"./main-CR7sCH5H.js";import{u as P}from"./useCurrency-BLJima5w.js";import{L as z}from"./LeaderboardPage-DV6K7KSV.js";import{P as w}from"./ProviderIcon-C8nYnvzP.js";import{A as L}from"./ActivityHeatmap-CiilYEqW.js";import{D as M,d as U,e as H,f as $,g as R,h as B}from"./DialogTitle-DH5VFL8l.js";import"./chevron-down-BS2aEE_V.js";import"./info-TG4KyASc.js";function E(e,r,s){const t=Number(e);return!Number.isFinite(t)||t<0?"—":t>0&&t<.01?`<${r==="USD"?"$":""}0.01`:C(t,{decimals:2,currency:r,rate:s})}function N(e,r,s){const t=Number(e);if(!Number.isFinite(t)||t<0)return"—";if(t<1e3)return E(t,r,s);const d=r==="USD"?t:t*(s||1);return`${r==="USD"?"$":""}${_(d,{decimals:1})}`}function b(e){const r=Number(e);return!Number.isFinite(r)||r<=0?"0":_(r,{decimals:1})}function G(e){const r=Array.isArray(e)?e:[];if(r.length===0)return null;const s=r.map(d=>({day:d.date,total_tokens:d.total_tokens,models:d.models||null})),t=r[r.length-1]?.date;return S({dailyRows:s,weeks:52,to:t})}function T(){const e="rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/60";return a.jsxs("div",{className:"animate-pulse",children:[a.jsxs("div",{className:"flex items-start gap-4 px-6 pt-6 pb-5 border-b border-oai-gray-200/80 dark:border-oai-gray-800/60",children:[a.jsx("div",{className:"h-14 w-14 rounded-full bg-oai-gray-200/70 dark:bg-oai-gray-800/60 shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-2 pt-1",children:[a.jsx("div",{className:o(e,"h-4 w-40")}),a.jsx("div",{className:o(e,"h-3 w-56")})]}),a.jsx("div",{className:o(e,"h-4 w-4 shrink-0 mt-1")})]}),a.jsxs("div",{className:"px-6 py-5 space-y-6",children:[a.jsx("div",{className:"grid grid-cols-4 gap-x-6 gap-y-4",children:Array.from({length:4}).map((r,s)=>a.jsxs("div",{children:[a.jsx("div",{className:o(e,"h-6 w-20")}),a.jsx("div",{className:o(e,"mt-2 h-3 w-14")})]},s))}),a.jsx("div",{className:"space-y-3 border-t border-oai-gray-200/70 dark:border-oai-gray-800/60 pt-5",children:Array.from({length:3}).map((r,s)=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:o(e,"h-3 w-24")}),a.jsx("div",{className:o(e,"h-3 w-44")})]},s))}),a.jsxs("div",{className:"border-t border-oai-gray-200/70 dark:border-oai-gray-800/60 pt-5",children:[a.jsx("div",{className:o(e,"h-3 w-44 mb-4")}),a.jsx("div",{className:"grid grid-cols-[repeat(52,1fr)] gap-[2px]",children:Array.from({length:364}).map((r,s)=>a.jsx("div",{className:"aspect-square rounded-[2px] bg-oai-gray-200/60 dark:bg-oai-gray-800/50"},s))})]}),a.jsxs("div",{className:"border-t border-oai-gray-200/70 dark:border-oai-gray-800/60 pt-5",children:[a.jsx("div",{className:o(e,"h-3 w-28 mb-3")}),a.jsx("div",{className:"space-y-2.5",children:Array.from({length:5}).map((r,s)=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:o(e,"h-4 w-4")}),a.jsx("div",{className:o(e,"h-3 w-16")}),a.jsx("div",{className:o(e,"h-[3px] flex-1")}),a.jsx("div",{className:o(e,"h-3 w-12")})]},s))})]})]})]})}function W(e){if(!e)return null;const r=String(e).match(/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})/i);return r?r[1]:null}function k({children:e}){return a.jsx("h3",{className:"text-[11px] uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400 mb-3",children:e})}function p({value:e,label:r}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-semibold tabular-nums tracking-tight leading-none text-oai-black dark:text-white",children:e}),a.jsx("div",{className:"mt-1.5 text-[11px] text-oai-gray-500 dark:text-oai-gray-400",children:r})]})}function h({label:e,children:r}){return a.jsxs("div",{className:"flex items-baseline gap-3 text-sm",children:[a.jsx("dt",{className:"shrink-0 w-28 whitespace-nowrap text-oai-gray-500 dark:text-oai-gray-400",children:e}),a.jsx("dd",{className:"min-w-0 flex-1 text-oai-gray-900 dark:text-oai-gray-100 tabular-nums truncate",children:r})]})}function Z({user:e,onClose:r}){const s=W(e?.github_url);return a.jsxs("div",{className:"flex items-start gap-4 px-6 pt-6 pb-5 border-b border-oai-gray-200/80 dark:border-oai-gray-800/60",children:[a.jsx(z,{avatarUrl:e?.avatar_url,displayName:e?.display_name||"",seed:e?.user_id||e?.display_name,size:"lg",className:"shrink-0 ring-1 ring-oai-gray-200 dark:ring-oai-gray-800"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"truncate text-base font-semibold text-oai-black dark:text-white",children:e?.display_name||"—"}),e?.rank?a.jsx("span",{className:"shrink-0 text-xs font-medium tabular-nums text-oai-gray-500 dark:text-oai-gray-400",children:i("leaderboard.profile_modal.rank",{rank:e.rank})}):null]}),s&&a.jsxs("a",{href:e.github_url,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-[12px] text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-800 dark:hover:text-oai-gray-200 transition-colors",children:[a.jsx(w,{provider:"GITHUB",size:11}),a.jsxs("span",{children:["@",s]})]})]}),a.jsx("button",{type:"button",onClick:r,className:"shrink-0 -mr-1 -mt-1 flex h-8 w-8 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-900 dark:hover:text-white hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand/50 transition-colors","aria-label":i("leaderboard.profile_modal.close"),children:a.jsx(F,{size:16,strokeWidth:2,"aria-hidden":!0})})]})}function q({data:e}){const r=Array.isArray(e)?e:[];return r.length===0?a.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i("leaderboard.profile_modal.providers.none")}):a.jsx("ul",{className:"space-y-2",children:r.map(s=>{const t=Math.max(0,Math.min(1,Number(s?.percent)||0));return a.jsxs("li",{className:"flex items-center gap-3 text-xs",children:[a.jsx("span",{className:"shrink-0 inline-flex items-center justify-center w-4 h-4",children:a.jsx(w,{provider:String(s.source).toUpperCase(),size:14})}),a.jsx("span",{className:"shrink-0 capitalize w-16 text-oai-gray-700 dark:text-oai-gray-300",children:s.source}),a.jsx("span",{className:"flex-1 h-[3px] rounded-full bg-oai-gray-200/60 dark:bg-oai-gray-800/80 overflow-hidden",children:a.jsx("span",{className:"block h-full bg-oai-brand-500 dark:bg-oai-brand-400",style:{width:`${(t*100).toFixed(1)}%`}})}),a.jsx("span",{className:"shrink-0 w-14 text-right tabular-nums text-oai-gray-700 dark:text-oai-gray-300",children:b(s.total_tokens)}),a.jsxs("span",{className:"shrink-0 w-10 text-right tabular-nums text-oai-gray-500 dark:text-oai-gray-400",children:[(t*100).toFixed(0),"%"]})]},s.source)})})}function V({data:e,currency:r,rate:s,onClose:t}){const{user:d,totals:m,streak:g,best_day:l,models:x,by_provider:n,heatmap:c,period:y}=e,f=u.useMemo(()=>G(c),[c]),j=x?.favorite?.model_name,v=Number(x?.count)||0;return a.jsxs(a.Fragment,{children:[a.jsx(Z,{user:d,onClose:t}),a.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto oai-scrollbar px-6 py-5 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-4 gap-x-6 gap-y-4",children:[a.jsx(p,{value:b(m?.total_tokens),label:i("leaderboard.profile_modal.stat.total_tokens")}),a.jsx(p,{value:N(m?.estimated_cost_usd,r,s),label:i("leaderboard.profile_modal.stat.total_cost")}),a.jsx(p,{value:String(m?.active_days??0),label:i("leaderboard.profile_modal.stat.active_days")}),a.jsx(p,{value:N(m?.avg_per_day_usd,r,s),label:i("leaderboard.profile_modal.stat.avg_per_day")})]}),a.jsxs("dl",{className:"space-y-2 border-t border-oai-gray-200/70 dark:border-oai-gray-800/60 pt-5",children:[a.jsxs(h,{label:i("leaderboard.profile_modal.streak.current"),children:[a.jsx("span",{children:i("leaderboard.profile_modal.streak.days",{count:g?.current_days??0})}),a.jsxs("span",{className:"ml-2 text-oai-gray-500 dark:text-oai-gray-400",children:["(max ",g?.longest_days??0,")"]})]}),a.jsx(h,{label:i("leaderboard.profile_modal.best_day.title"),children:l?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:l.date}),a.jsx("span",{className:"ml-2 text-oai-gray-500 dark:text-oai-gray-400",children:b(l.total_tokens)})]}):a.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:i("leaderboard.profile_modal.best_day.none")})}),a.jsx(h,{label:i("leaderboard.profile_modal.models.favorite"),children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"truncate",children:j}),v>1&&a.jsx("span",{className:"ml-2 text-oai-gray-500 dark:text-oai-gray-400",children:i("leaderboard.profile_modal.models.count",{count:v})})]}):a.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:i("leaderboard.profile_modal.models.none")})})]}),f&&a.jsxs("section",{className:"border-t border-oai-gray-200/70 dark:border-oai-gray-800/60 pt-5",children:[a.jsx(k,{children:i("leaderboard.profile_modal.heatmap.title")}),a.jsx("div",{className:"overflow-x-auto oai-scrollbar -mx-1 px-1",children:a.jsx(L,{heatmap:f,hideLegend:!0,embedded:!0})})]}),a.jsxs("section",{className:"border-t border-oai-gray-200/70 dark:border-oai-gray-800/60 pt-5",children:[a.jsx(k,{children:i("leaderboard.profile_modal.providers.title")}),a.jsx(q,{data:n})]})]})]})}function ea({isOpen:e,onClose:r,userId:s,period:t,accessToken:d}){const{currency:m,rate:g}=P(),[l,x]=u.useState({loading:!1,error:null,data:null});return u.useEffect(()=>{if(!e||!s)return;let n=!0;return x({loading:!0,error:null,data:null}),(async()=>{try{const c=d?await A(d):null;if(!n)return;const y=await D({accessToken:c,userId:s,period:t||"week"});if(!n)return;x({loading:!1,error:null,data:y})}catch(c){if(!n)return;c?.status===404?x({loading:!1,error:null,data:null}):x({loading:!1,error:c?.message||String(c),data:null})}})(),()=>{n=!1}},[e,s,t,d]),a.jsx(M,{open:e,onOpenChange:n=>{n||r?.()},children:a.jsxs(U,{children:[a.jsx(H,{className:"cost-modal-backdrop"}),a.jsx($,{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:a.jsxs(R,{className:o("cost-modal-popup","relative w-full max-w-[540px] max-h-[calc(100vh-2rem)] flex flex-col","rounded-2xl bg-white dark:bg-oai-gray-950","shadow-[0_20px_60px_-20px_rgba(0,0,0,0.25)] dark:shadow-[0_20px_60px_-10px_rgba(0,0,0,0.65)]","ring-1 ring-oai-gray-200 dark:ring-oai-gray-800 overflow-hidden"),children:[a.jsx(B,{render:a.jsx("h2",{className:"sr-only"}),children:l.data?.user?.display_name||i("leaderboard.profile_modal.loading")}),l.loading&&a.jsx(T,{}),!l.loading&&l.error&&a.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[280px]",children:a.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:i("leaderboard.profile_modal.error")})}),!l.loading&&!l.error&&!l.data&&a.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[280px]",children:a.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:i("leaderboard.profile_modal.empty")})}),!l.loading&&!l.error&&l.data&&a.jsx(V,{data:l.data,currency:m,rate:g,onClose:r})]})})]})})}export{ea as LeaderboardProfileModal};
@@ -0,0 +1,2 @@
1
+ import{C as r,S as g,B as n,r as j,L as v,aj as k}from"./main-CR7sCH5H.js";import{u as N}from"./use-usage-limits-KGue9hvK.js";import{u as L}from"./use-limits-display-prefs-DgRoQmhK.js";import{C as h}from"./Card-BkDHn179.js";import{F as E}from"./FadeIn-CcubhRKW.js";import"./use-reduced-motion-BsyM6Mgz.js";const P=[3,2,3,3,2,2,3];function m({className:s}){return r.jsx("div",{className:g("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",s)})}function C(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(m,{className:"h-3 w-12 shrink-0"}),r.jsx(m,{className:"flex-1 h-1.5 rounded-full min-w-0"}),r.jsx(m,{className:"h-3 w-[30px] shrink-0"}),r.jsx(m,{className:"h-3 w-6 shrink-0"})]})}function O({bars:s,index:e}){const i=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(m,{className:"h-[14px] w-[14px] rounded shrink-0"}),r.jsx(m,{className:g("h-4",i)})]}),Array.from({length:s},(l,a)=>r.jsx(C,{},a))]})}function T(){return r.jsx(h,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(m,{className:"h-3.5 w-28"}),P.map((s,e)=>r.jsx(O,{bars:s,index:e},e))]})})}function t(s){if(!s)return null;const e=typeof s=="number"?s*1e3:Date.parse(s);if(!Number.isFinite(e))return null;const i=e-Date.now();if(i<=0)return n("shared.time.now");const l=Math.floor(i/6e4);if(l<60)return`${l}m`;const a=Math.floor(l/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function R(s){return s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500"}function o({label:s,pct:e,reset:i}){const l=Math.max(0,Math.min(100,Number(e)||0)),a=Math.round(l),u=l>0&&a===0?Math.max(l,.35):l,x=l>0&&a===0?"<1":String(a);return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:s}),r.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:r.jsx("div",{className:`${R(a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${u}%`,minWidth:l>0?"3px":0}})}),r.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-[30px] text-right shrink-0",children:[x,"%"]}),i?r.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:i}):null]})}function d({name:s,icon:e,children:i}){const a=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"||e==="/brand-logos/kimi.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[e?r.jsx("img",{src:e,alt:"",className:a}):null,r.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:s})]}),i]})}const S=["claude","codex","cursor","gemini","kimi","kiro","copilot","antigravity"],I={claude:{name:"Claude",icon:"/brand-logos/claude-code.svg"},codex:{name:"Codex",icon:"/brand-logos/codex.svg"},cursor:{name:"Cursor",icon:"/brand-logos/cursor.svg"},gemini:{name:"Gemini",icon:"/brand-logos/gemini.svg"},kimi:{name:"Kimi",icon:"/brand-logos/kimi.svg"},kiro:{name:"Kiro",icon:"/brand-logos/kiro.svg"},copilot:{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg"},antigravity:{name:"Antigravity",icon:"/brand-logos/antigravity.svg"}};function c({children:s,tone:e="neutral"}){const i=e==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return r.jsx("div",{className:`text-[11px] leading-snug ${i}`,children:s})}function A(s,e){const i=I[s];if(!i)return null;if(!e?.configured)return r.jsx(d,{name:i.name,icon:i.icon,children:r.jsx(c,{children:n("limits.status.not_connected")})},s);if(e.error)return r.jsx(d,{name:i.name,icon:i.icon,children:r.jsx(c,{tone:"error",children:n("shared.error.prefix",{error:e.error})})},s);switch(s){case"claude":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.five_hour?r.jsx(o,{label:"5h",pct:e.five_hour.utilization,reset:t(e.five_hour.resets_at)}):null,e.seven_day?r.jsx(o,{label:"7d",pct:e.seven_day.utilization,reset:t(e.seven_day.resets_at)}):null,e.seven_day_opus?r.jsx(o,{label:"Opus",pct:e.seven_day_opus.utilization,reset:t(e.seven_day_opus.resets_at)}):null,!e.five_hour&&!e.seven_day&&!e.seven_day_opus?r.jsx(c,{children:n("limits.status.no_data")}):null]},"claude");case"codex":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"5h",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"7d",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"codex");case"cursor":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:n("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"cursor");case"gemini":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"Pro",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"Flash",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:"Lite",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"gemini");case"kimi":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.kimi_weekly"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.kimi_5h"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:n("limits.label.kimi_total"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,e.parallel_limit?r.jsx(c,{children:n("limits.label.kimi_parallel",{count:e.parallel_limit})}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"kimi");case"kiro":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"kiro");case"antigravity":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"Claude",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"G Pro",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:"Flash",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"antigravity");case"copilot":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null,e.otel_has_files||e.otel_enabled?null:r.jsx(D,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function D({defaultDir:s}){const[e,i]=j.useState(!1),a=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${s||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
2
+ `),u=async()=>{try{await navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),1600)}catch{}};return r.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[r.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n("limits.copilot.otelHint.title")}),r.jsx("div",{className:"mt-0.5 leading-snug",children:n("limits.copilot.otelHint.body")}),r.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:a}),r.jsx("button",{type:"button",onClick:u,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?n("limits.copilot.otelHint.copied"):n("limits.copilot.otelHint.copy")})]})}function M({claude:s,codex:e,cursor:i,gemini:l,kimi:a,kiro:u,antigravity:x,copilot:b,order:w,visibility:_}){const f={claude:s,codex:e,cursor:i,gemini:l,kimi:a,kiro:u,antigravity:x,copilot:b},y=(Array.isArray(w)&&w.length>0?w:S).filter(p=>!_||_[p]!==!1).map(p=>A(p,f[p])).filter(Boolean);return r.jsx(E,{delay:.15,children:r.jsx(h,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:n("limits.panel.title")}),y.length>0?y:r.jsx(c,{children:n("limits.status.all_hidden")})]})})})}function V(){const{data:s,error:e,isLoading:i}=N({initialRefresh:!0}),l=L();return r.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:r.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:r.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[r.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:n("nav.limits")}),r.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:n("limits.page.subtitle")})]}),r.jsx(v,{to:"/settings","aria-label":n("limits.page.openSettings"),title:n("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:r.jsx(k,{className:"h-4 w-4","aria-hidden":!0})})]}),i?r.jsx(T,{}):r.jsxs(r.Fragment,{children:[e?r.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:n("shared.error.prefix",{error:e})}):null,r.jsx(M,{claude:s?.claude,codex:s?.codex,cursor:s?.cursor,gemini:s?.gemini,kimi:s?.kimi,kiro:s?.kiro,antigravity:s?.antigravity,copilot:s?.copilot,order:l.order,visibility:l.visibility})]})]})})})}export{V as LimitsPage};
@@ -0,0 +1 @@
1
+ import{ac as Y,al as Z,U as ee,r,B as s,C as e,L as G,S as v}from"./main-CR7sCH5H.js";function te(n){const a=new URLSearchParams(n).get("next");return typeof a!="string"||a.length===0||!a.startsWith("/")||a.startsWith("//")?"/dashboard":a}const V={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function $(n){const a=String(n||"").trim();return V[a]?V[a]:a.replace(/-/g," ")}function ie(){const n=Y(),[a,C]=Z(),{enabled:o,loading:g,signedIn:f,refreshUser:A,signInWithPassword:E,signUp:M,signInWithOAuth:I,getPublicAuthConfig:F}=ee(),m=r.useMemo(()=>te(a.toString()),[a]),[l,j]=r.useState("signin"),[x,H]=r.useState(""),[h,Q]=r.useState(""),[N,X]=r.useState(""),[k,p]=r.useState(!1),[O,c]=r.useState(null),[U,b]=r.useState(null),[S,B]=r.useState(!0),[_,R]=r.useState([]),[P,T]=r.useState([]),[W,z]=r.useState(8);r.useEffect(()=>{const t=a.get("insforge_status"),i=a.get("insforge_type"),u=a.get("insforge_error");t==="success"&&i==="verify_email"?b(s("login.verify_email_success")):t==="error"&&i==="verify_email"&&u&&b(s("shared.error.prefix",{error:u}))},[a]),r.useEffect(()=>{if(!o){B(!1);return}let t=!0;return(async()=>{const{data:i,error:u}=await F();t&&(u||!i?(R(["google","github"]),T([])):(R(Array.isArray(i.oAuthProviders)?i.oAuthProviders:[]),T(Array.isArray(i.customOAuthProviders)?i.customOAuthProviders:[]),typeof i.passwordMinLength=="number"&&i.passwordMinLength>0&&z(i.passwordMinLength)),B(!1))})(),()=>{t=!1}},[o,F]);const d=r.useMemo(()=>a.get("native")==="1",[a]),y=r.useMemo(()=>a.get("provider")||null,[a]);r.useEffect(()=>{if(!(!o||g)&&f){if(d){window.location.href="/auth/native-callback";return}n(m,{replace:!0})}},[o,g,f,n,m,d]),r.useEffect(()=>{o&&A()},[o,A]);const q=r.useMemo(()=>typeof window>"u"||d?"":`${window.location.origin}/`,[d]),D=r.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),J=r.useCallback(async t=>{t.preventDefault(),c(null),p(!0);try{if(l==="signup"){const{data:u,error:L}=await M({email:x.trim(),password:h,name:N.trim()||void 0,redirectTo:D});if(L){c(L.message||String(L));return}if(u?.requireEmailVerification){b(s("login.verify_email_pending")),j("signin");return}n(m,{replace:!0});return}const{error:i}=await E({email:x.trim(),password:h});if(i){c(i.message||String(i));return}n(m,{replace:!0})}finally{p(!1)}},[l,x,h,N,M,E,n,m,D]),w=r.useCallback(async t=>{c(null),p(!0);try{const{error:i}=await I(t,q);i&&c(i.message||String(i))}finally{p(!1)}},[I,q]);r.useEffect(()=>{if(d&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[d]),r.useEffect(()=>{if(!o||g||f||S||!d||!y)return;[..._,...P].includes(y)&&w(y)},[o,g,f,S,d,y,_,P,w]);const K=r.useCallback(()=>{C(t=>{const i=new URLSearchParams(t);return i.delete("insforge_status"),i.delete("insforge_type"),i.delete("insforge_error"),i},{replace:!0}),b(null)},[C]);return o?e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:e.jsx(G,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:e.jsxs("div",{className:"w-full max-w-md space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:s("login.title")}),e.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:s("login.subtitle")})]}),U?e.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[e.jsx("span",{children:U}),e.jsx("button",{type:"button",onClick:K,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:s("login.dismiss")})]}):null,O?e.jsx("p",{className:"text-sm text-red-400",role:"alert",children:s("shared.error.prefix",{error:O})}):null,e.jsx("div",{className:"space-y-3",children:S?e.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):e.jsxs(e.Fragment,{children:[_.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t)),P.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t))]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:e.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:e.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:s("login.divider")})})]}),e.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signin"),c(null)},children:s("login.tab.sign_in")}),e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signup"),c(null)},children:s("login.tab.sign_up")})]}),e.jsxs("form",{onSubmit:J,className:"space-y-4",children:[l==="signup"?e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.name")}),e.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:N,onChange:t=>X(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:s("login.field.name_placeholder")})]}):null,e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.email")}),e.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:x,onChange:t=>H(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.password")}),e.jsx("input",{id:"login-password",type:"password",autoComplete:l==="signup"?"new-password":"current-password",required:!0,minLength:l==="signup"?W:void 0,value:h,onChange:t=>Q(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),l==="signup"?e.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:s("login.password_hint",{min:String(W)})}):null]}),e.jsx("button",{type:"submit",disabled:k||g,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:l==="signup"?s("login.submit.sign_up"):s("login.submit.sign_in")})]})]})})]}):e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:e.jsx(G,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:e.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:s("login.cloud_only")})})]})}export{ie as LoginPage};
@@ -0,0 +1 @@
1
+ import{c as tn,r as x,aa as Me,C as X}from"./main-CR7sCH5H.js";import{ai as Ce,aa as Hn,G as nt,aj as $n,c as G,ak as be,al as Vn,J as nn,am as ot,L as U,an as de,ab as pe,ao as $t,ap as fe,z as ge,aq as on,ar as at,as as Ie,at as We,au as Wn,av as sn,aw as _n,ax as lt,ay as ft,az as Ue,aA as Nn,n as ut,Q as rn,aB as jn,aC as cn,p as ce,o as dt,aD as Yn,aE as zn,r as q,aF as ee,w as _e,B as an,m as we,x as le,aG as ln,aH as Un,I as ke,V as Xn,aI as Vt,a1 as fn,aJ as Kn,aK as Gn,aL as qn,aM as Jn,aN as Qn,C as st,aO as Zn,aP as eo,M as se,aQ as to,P as no,aR as oo,aS as so,a6 as ro,aT as io,aU as co,T as ao,aV as lo,U as un,K as fo,aW as uo,a0 as go,a3 as po,a as gt,aX as mo,aY as Wt,aZ as ho,a_ as xo,a$ as yo,b0 as Ro,a4 as vo,b1 as bo,b2 as wo,b3 as Eo,a7 as Co,a8 as Oo,b4 as To,a9 as dn,S as So,ad as Po,af as Ao,ag as Mo}from"./DialogTitle-DH5VFL8l.js";const Io=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],lr=tn("chevron-right",Io);const ko=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fr=tn("loader-circle",ko),Do=["top","right","bottom","left"],Oe=Math.min,Q=Math.max,Ne=Math.round,He=Math.floor,ae=e=>({x:e,y:e}),Lo={left:"right",right:"left",bottom:"top",top:"bottom"};function rt(e,t,n){return Q(e,Oe(t,n))}function ue(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function me(e){return e.split("-")[1]}function pt(e){return e==="x"?"y":"x"}function mt(e){return e==="y"?"height":"width"}function te(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ht(e){return pt(te(e))}function Fo(e,t,n){n===void 0&&(n=!1);const o=me(e),s=ht(e),r=mt(s);let i=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=je(i)),[i,je(i)]}function Bo(e){const t=je(e);return[it(e),t,it(t)]}function it(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _t=["left","right"],Nt=["right","left"],Ho=["top","bottom"],$o=["bottom","top"];function Vo(e,t,n){switch(e){case"top":case"bottom":return n?t?Nt:_t:t?_t:Nt;case"left":case"right":return t?Ho:$o;default:return[]}}function Wo(e,t,n,o){const s=me(e);let r=Vo(J(e),n==="start",o);return s&&(r=r.map(i=>i+"-"+s),t&&(r=r.concat(r.map(it)))),r}function je(e){const t=J(e);return Lo[t]+e.slice(t.length)}function _o(e){return{top:0,right:0,bottom:0,left:0,...e}}function gn(e){return typeof e!="number"?_o(e):{top:e,right:e,bottom:e,left:e}}function Ye(e){const{x:t,y:n,width:o,height:s}=e;return{width:o,height:s,top:n,left:t,right:t+o,bottom:n+s,x:t,y:n}}function Qe(e,t,n){if(n&&!Ce(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function No(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:s=!0,event:r="click",toggle:i=!0,ignoreMouse:l=!1,stickIfOpen:a=!0,touchOpenDelay:u=0}=t,c=x.useRef(void 0),f=Hn(),d=nt(),p=x.useMemo(()=>({onPointerDown(g){c.current=g.pointerType},onMouseDown(g){const m=c.current,b=g.nativeEvent,E=n.select("open");if(g.button!==0||r==="click"||Ce(m,!0)&&l)return;const R=o.current.openEvent,C=R?.type,h=n.select("domReferenceElement")!==g.currentTarget,O=E&&h||!(E&&i&&(!(R&&a)||C==="click"||C==="mousedown"));if(Vn(b.target)){const w=G(be,b,b.target);O&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,w)}):n.setOpen(O,w);return}const T=g.currentTarget;f.request(()=>{const w=G(be,b,T);O&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,w)}):n.setOpen(O,w)})},onClick(g){if(r==="mousedown-only")return;const m=c.current;if(r==="mousedown"&&m){c.current=void 0;return}if(Ce(m,!0)&&l)return;const b=n.select("open"),E=o.current.openEvent,R=n.select("domReferenceElement")!==g.currentTarget,C=b&&R||!(b&&i&&(!(E&&a)||$n(E))),h=G(be,g.nativeEvent,g.currentTarget);C&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,h)}):n.setOpen(C,h)},onKeyDown(){c.current=void 0}}),[o,r,l,n,a,i,f,d,u]);return x.useMemo(()=>s?{reference:p}:nn,[s,p])}function jt(e,t,n){let{reference:o,floating:s}=e;const r=te(t),i=ht(t),l=mt(i),a=J(t),u=r==="y",c=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,d=o[l]/2-s[l]/2;let p;switch(a){case"top":p={x:c,y:o.y-s.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-s.width,y:f};break;default:p={x:o.x,y:o.y}}switch(me(t)){case"start":p[i]-=d*(n&&u?-1:1);break;case"end":p[i]+=d*(n&&u?-1:1);break}return p}async function jo(e,t){var n;t===void 0&&(t={});const{x:o,y:s,platform:r,rects:i,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ue(t,e),g=gn(p),b=l[d?f==="floating"?"reference":"floating":f],E=Ye(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),R=f==="floating"?{x:o,y:s,width:i.floating.width,height:i.floating.height}:i.reference,C=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),h=await(r.isElement==null?void 0:r.isElement(C))?await(r.getScale==null?void 0:r.getScale(C))||{x:1,y:1}:{x:1,y:1},O=Ye(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:R,offsetParent:C,strategy:a}):R);return{top:(E.top-O.top+g.top)/h.y,bottom:(O.bottom-E.bottom+g.bottom)/h.y,left:(E.left-O.left+g.left)/h.x,right:(O.right-E.right+g.right)/h.x}}const Yo=50,zo=async(e,t,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:r=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:jo},a=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:f}=jt(u,o,a),d=o,p=0;const g={};for(let m=0;m<r.length;m++){const b=r[m];if(!b)continue;const{name:E,fn:R}=b,{x:C,y:h,data:O,reset:T}=await R({x:c,y:f,initialPlacement:o,placement:d,strategy:s,middlewareData:g,rects:u,platform:l,elements:{reference:e,floating:t}});c=C??c,f=h??f,g[E]={...g[E],...O},T&&p<Yo&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(u=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:c,y:f}=jt(u,d,a)),m=-1)}return{x:c,y:f,placement:d,strategy:s,middlewareData:g}},Uo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:s,middlewareData:r,rects:i,initialPlacement:l,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=ue(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const E=J(s),R=te(l),C=J(l)===l,h=await(a.isRTL==null?void 0:a.isRTL(u.floating)),O=d||(C||!m?[je(l)]:Bo(l)),T=g!=="none";!d&&T&&O.push(...Wo(l,m,g,h));const w=[l,...O],k=await a.detectOverflow(t,b),$=[];let A=((o=r.flip)==null?void 0:o.overflows)||[];if(c&&$.push(k[E]),f){const D=Fo(s,i,h);$.push(k[D[0]],k[D[1]])}if(A=[...A,{placement:s,overflows:$}],!$.every(D=>D<=0)){var L,S;const D=(((L=r.flip)==null?void 0:L.index)||0)+1,I=w[D];if(I&&(!(f==="alignment"?R!==te(I):!1)||A.every(v=>te(v.placement)===R?v.overflows[0]>0:!0)))return{data:{index:D,overflows:A},reset:{placement:I}};let F=(S=A.filter(M=>M.overflows[0]<=0).sort((M,v)=>M.overflows[1]-v.overflows[1])[0])==null?void 0:S.placement;if(!F)switch(p){case"bestFit":{var y;const M=(y=A.filter(v=>{if(T){const P=te(v.placement);return P===R||P==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(P=>P>0).reduce((P,N)=>P+N,0)]).sort((v,P)=>v[1]-P[1])[0])==null?void 0:y[0];M&&(F=M);break}case"initialPlacement":F=l;break}if(s!==F)return{reset:{placement:F}}}return{}}}};function Yt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return Do.some(t=>e[t]>=0)}const Xo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:s="referenceHidden",...r}=ue(e,t);switch(s){case"referenceHidden":{const i=await o.detectOverflow(t,{...r,elementContext:"reference"}),l=Yt(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:zt(l)}}}case"escaped":{const i=await o.detectOverflow(t,{...r,altBoundary:!0}),l=Yt(i,n.floating);return{data:{escapedOffsets:l,escaped:zt(l)}}}default:return{}}}}},pn=new Set(["left","top"]);async function Ko(e,t){const{placement:n,platform:o,elements:s}=e,r=await(o.isRTL==null?void 0:o.isRTL(s.floating)),i=J(n),l=me(n),a=te(n)==="y",u=pn.has(i)?-1:1,c=r&&a?-1:1,f=ue(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),a?{x:p*c,y:d*u}:{x:d*u,y:p*c}}const Go=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:s,y:r,placement:i,middlewareData:l}=t,a=await Ko(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:s+a.x,y:r+a.y,data:{...a,placement:i}}}}},qo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:s,platform:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:E=>{let{x:R,y:C}=E;return{x:R,y:C}}},...u}=ue(e,t),c={x:n,y:o},f=await r.detectOverflow(t,u),d=te(J(s)),p=pt(d);let g=c[p],m=c[d];if(i){const E=p==="y"?"top":"left",R=p==="y"?"bottom":"right",C=g+f[E],h=g-f[R];g=rt(C,g,h)}if(l){const E=d==="y"?"top":"left",R=d==="y"?"bottom":"right",C=m+f[E],h=m-f[R];m=rt(C,m,h)}const b=a.fn({...t,[p]:g,[d]:m});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[p]:i,[d]:l}}}}}},Jo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:s,rects:r,middlewareData:i}=t,{offset:l=0,mainAxis:a=!0,crossAxis:u=!0}=ue(e,t),c={x:n,y:o},f=te(s),d=pt(f);let p=c[d],g=c[f];const m=ue(l,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const C=d==="y"?"height":"width",h=r.reference[d]-r.floating[C]+b.mainAxis,O=r.reference[d]+r.reference[C]-b.mainAxis;p<h?p=h:p>O&&(p=O)}if(u){var E,R;const C=d==="y"?"width":"height",h=pn.has(J(s)),O=r.reference[f]-r.floating[C]+(h&&((E=i.offset)==null?void 0:E[f])||0)+(h?0:b.crossAxis),T=r.reference[f]+r.reference[C]+(h?0:((R=i.offset)==null?void 0:R[f])||0)-(h?b.crossAxis:0);g<O?g=O:g>T&&(g=T)}return{[d]:p,[f]:g}}}},Qo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:s,rects:r,platform:i,elements:l}=t,{apply:a=()=>{},...u}=ue(e,t),c=await i.detectOverflow(t,u),f=J(s),d=me(s),p=te(s)==="y",{width:g,height:m}=r.floating;let b,E;f==="top"||f==="bottom"?(b=f,E=d===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(E=f,b=d==="end"?"top":"bottom");const R=m-c.top-c.bottom,C=g-c.left-c.right,h=Oe(m-c[b],R),O=Oe(g-c[E],C),T=!t.middlewareData.shift;let w=h,k=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(w=R),T&&!d){const A=Q(c.left,0),L=Q(c.right,0),S=Q(c.top,0),y=Q(c.bottom,0);p?k=g-2*(A!==0||L!==0?A+L:Q(c.left,c.right)):w=m-2*(S!==0||y!==0?S+y:Q(c.top,c.bottom))}await a({...t,availableWidth:k,availableHeight:w});const $=await i.getDimensions(l.floating);return g!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}};function mn(e){const t=fe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const s=ge(e),r=s?e.offsetWidth:n,i=s?e.offsetHeight:o,l=Ne(n)!==r||Ne(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function xt(e){return U(e)?e:e.contextElement}function Ee(e){const t=xt(e);if(!ge(t))return ae(1);const n=t.getBoundingClientRect(),{width:o,height:s,$:r}=mn(t);let i=(r?Ne(n.width):n.width)/o,l=(r?Ne(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Zo=ae(0);function hn(e){const t=pe(e);return!on()||!t.visualViewport?Zo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function es(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pe(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),r=xt(e);let i=ae(1);t&&(o?U(o)&&(i=Ee(o)):i=Ee(e));const l=es(r,n,o)?hn(r):ae(0);let a=(s.left+l.x)/i.x,u=(s.top+l.y)/i.y,c=s.width/i.x,f=s.height/i.y;if(r){const d=pe(r),p=o&&U(o)?pe(o):o;let g=d,m=$t(g);for(;m&&o&&p!==g;){const b=Ee(m),E=m.getBoundingClientRect(),R=fe(m),C=E.left+(m.clientLeft+parseFloat(R.paddingLeft))*b.x,h=E.top+(m.clientTop+parseFloat(R.paddingTop))*b.y;a*=b.x,u*=b.y,c*=b.x,f*=b.y,a+=C,u+=h,g=pe(m),m=$t(g)}}return Ye({width:c,height:f,x:a,y:u})}function Xe(e,t){const n=Ue(e).scrollLeft;return t?t.left+n:he(de(e)).left+n}function xn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Xe(e,n),s=n.top+t.scrollTop;return{x:o,y:s}}function ts(e){let{elements:t,rect:n,offsetParent:o,strategy:s}=e;const r=s==="fixed",i=de(o),l=t?at(t.floating):!1;if(o===i||l&&r)return n;let a={scrollLeft:0,scrollTop:0},u=ae(1);const c=ae(0),f=ge(o);if((f||!f&&!r)&&((lt(o)!=="body"||ft(i))&&(a=Ue(o)),f)){const p=he(o);u=Ee(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop}const d=i&&!f&&!r?xn(i,a):ae(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-a.scrollTop*u.y+c.y+d.y}}function ns(e){return Array.from(e.getClientRects())}function os(e){const t=de(e),n=Ue(e),o=e.ownerDocument.body,s=Q(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Q(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Xe(e);const l=-n.scrollTop;return fe(o).direction==="rtl"&&(i+=Q(t.clientWidth,o.clientWidth)-s),{width:s,height:r,x:i,y:l}}const Ut=25;function ss(e,t){const n=pe(e),o=de(e),s=n.visualViewport;let r=o.clientWidth,i=o.clientHeight,l=0,a=0;if(s){r=s.width,i=s.height;const c=on();(!c||c&&t==="fixed")&&(l=s.offsetLeft,a=s.offsetTop)}const u=Xe(o);if(u<=0){const c=o.ownerDocument,f=c.body,d=getComputedStyle(f),p=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-p);g<=Ut&&(r-=g)}else u<=Ut&&(r+=u);return{width:r,height:i,x:l,y:a}}function rs(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,s=n.left+e.clientLeft,r=ge(e)?Ee(e):ae(1),i=e.clientWidth*r.x,l=e.clientHeight*r.y,a=s*r.x,u=o*r.y;return{width:i,height:l,x:a,y:u}}function Xt(e,t,n){let o;if(t==="viewport")o=ss(e,n);else if(t==="document")o=os(de(e));else if(U(t))o=rs(t,n);else{const s=hn(e);o={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ye(o)}function yn(e,t){const n=Ie(e);return n===t||!U(n)||We(n)?!1:fe(n).position==="fixed"||yn(n,t)}function is(e,t){const n=t.get(e);if(n)return n;let o=ot(e,[],!1).filter(l=>U(l)&&lt(l)!=="body"),s=null;const r=fe(e).position==="fixed";let i=r?Ie(e):e;for(;U(i)&&!We(i);){const l=fe(i),a=sn(i);!a&&l.position==="fixed"&&(s=null),(r?!a&&!s:!a&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||ft(i)&&!a&&yn(e,i))?o=o.filter(c=>c!==i):s=l,i=Ie(i)}return t.set(e,o),o}function cs(e){let{element:t,boundary:n,rootBoundary:o,strategy:s}=e;const i=[...n==="clippingAncestors"?at(t)?[]:is(t,this._c):[].concat(n),o],l=Xt(t,i[0],s);let a=l.top,u=l.right,c=l.bottom,f=l.left;for(let d=1;d<i.length;d++){const p=Xt(t,i[d],s);a=Q(p.top,a),u=Oe(p.right,u),c=Oe(p.bottom,c),f=Q(p.left,f)}return{width:u-f,height:c-a,x:f,y:a}}function as(e){const{width:t,height:n}=mn(e);return{width:t,height:n}}function ls(e,t,n){const o=ge(t),s=de(t),r=n==="fixed",i=he(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const a=ae(0);function u(){a.x=Xe(s)}if(o||!o&&!r)if((lt(t)!=="body"||ft(s))&&(l=Ue(t)),o){const p=he(t,!0,r,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else s&&u();r&&!o&&s&&u();const c=s&&!o&&!r?xn(s,l):ae(0),f=i.left+l.scrollLeft-a.x-c.x,d=i.top+l.scrollTop-a.y-c.y;return{x:f,y:d,width:i.width,height:i.height}}function Ze(e){return fe(e).position==="static"}function Kt(e,t){if(!ge(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return de(e)===n&&(n=n.ownerDocument.body),n}function Rn(e,t){const n=pe(e);if(at(e))return n;if(!ge(e)){let s=Ie(e);for(;s&&!We(s);){if(U(s)&&!Ze(s))return s;s=Ie(s)}return n}let o=Kt(e,t);for(;o&&Wn(o)&&Ze(o);)o=Kt(o,t);return o&&We(o)&&Ze(o)&&!sn(o)?n:o||_n(e)||n}const fs=async function(e){const t=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(e.floating);return{reference:ls(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function us(e){return fe(e).direction==="rtl"}const ds={convertOffsetParentRelativeRectToViewportRelativeRect:ts,getDocumentElement:de,getClippingRect:cs,getOffsetParent:Rn,getElementRects:fs,getClientRects:ns,getDimensions:as,getScale:Ee,isElement:U,isRTL:us};function vn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gs(e,t){let n=null,o;const s=de(e);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();const u=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=u;if(l||t(),!d||!p)return;const g=He(f),m=He(s.clientWidth-(c+d)),b=He(s.clientHeight-(f+p)),E=He(c),C={rootMargin:-g+"px "+-m+"px "+-b+"px "+-E+"px",threshold:Q(0,Oe(1,a))||1};let h=!0;function O(T){const w=T[0].intersectionRatio;if(w!==a){if(!h)return i();w?i(!1,w):o=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!vn(u,e.getBoundingClientRect())&&i(),h=!1}try{n=new IntersectionObserver(O,{...C,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,C)}n.observe(e)}return i(!0),r}function Gt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,u=xt(e),c=s||r?[...u?ot(u):[],...t?ot(t):[]]:[];c.forEach(E=>{s&&E.addEventListener("scroll",n,{passive:!0}),r&&E.addEventListener("resize",n)});const f=u&&l?gs(u,n):null;let d=-1,p=null;i&&(p=new ResizeObserver(E=>{let[R]=E;R&&R.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),u&&!a&&p.observe(u),t&&p.observe(t));let g,m=a?he(e):null;a&&b();function b(){const E=he(e);m&&!vn(m,E)&&n(),m=E,g=requestAnimationFrame(b)}return n(),()=>{var E;c.forEach(R=>{s&&R.removeEventListener("scroll",n),r&&R.removeEventListener("resize",n)}),f?.(),(E=p)==null||E.disconnect(),p=null,a&&cancelAnimationFrame(g)}}const ps=Go,ms=qo,hs=Uo,xs=Qo,ys=Xo,Rs=Jo,vs=(e,t,n)=>{const o=new Map,s={platform:ds,...n},r={...s.platform,_c:o};return zo(e,t,{...s,platform:r})};var bs=typeof document<"u",ws=function(){},$e=bs?x.useLayoutEffect:ws;function ze(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,s;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(!ze(e[o],t[o]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,s[o]))return!1;for(o=n;o--!==0;){const r=s[o];if(!(r==="_owner"&&e.$$typeof)&&!ze(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function bn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qt(e,t){const n=bn(e);return Math.round(t*n)/n}function et(e){const t=x.useRef(e);return $e(()=>{t.current=e}),t}function Es(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:s,elements:{reference:r,floating:i}={},transform:l=!0,whileElementsMounted:a,open:u}=e,[c,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=x.useState(o);ze(d,o)||p(o);const[g,m]=x.useState(null),[b,E]=x.useState(null),R=x.useCallback(v=>{v!==T.current&&(T.current=v,m(v))},[]),C=x.useCallback(v=>{v!==w.current&&(w.current=v,E(v))},[]),h=r||g,O=i||b,T=x.useRef(null),w=x.useRef(null),k=x.useRef(c),$=a!=null,A=et(a),L=et(s),S=et(u),y=x.useCallback(()=>{if(!T.current||!w.current)return;const v={placement:t,strategy:n,middleware:d};L.current&&(v.platform=L.current),vs(T.current,w.current,v).then(P=>{const N={...P,isPositioned:S.current!==!1};D.current&&!ze(k.current,N)&&(k.current=N,Me.flushSync(()=>{f(N)}))})},[d,t,n,L,S]);$e(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(v=>({...v,isPositioned:!1})))},[u]);const D=x.useRef(!1);$e(()=>(D.current=!0,()=>{D.current=!1}),[]),$e(()=>{if(h&&(T.current=h),O&&(w.current=O),h&&O){if(A.current)return A.current(h,O,y);y()}},[h,O,y,A,$]);const I=x.useMemo(()=>({reference:T,floating:w,setReference:R,setFloating:C}),[R,C]),F=x.useMemo(()=>({reference:h,floating:O}),[h,O]),M=x.useMemo(()=>{const v={position:n,left:0,top:0};if(!F.floating)return v;const P=qt(F.floating,c.x),N=qt(F.floating,c.y);return l?{...v,transform:"translate("+P+"px, "+N+"px)",...bn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:N}},[n,l,F.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:y,refs:I,elements:F,floatingStyles:M}),[c,y,I,F,M])}const Cs=(e,t)=>{const n=ps(e);return{name:n.name,fn:n.fn,options:[e,t]}},Os=(e,t)=>{const n=ms(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ts=(e,t)=>({fn:Rs(e).fn,options:[e,t]}),Ss=(e,t)=>{const n=hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ps=(e,t)=>{const n=xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},As=(e,t)=>{const n=ys(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ms(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,s=Nn(),r=ut()!=null,i=rn(()=>new jn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new cn,floatingId:s,nested:r,noEmit:e.noEmit||!1})).current;return ce(()=>{const l={open:t,floatingId:s};o.reference!==void 0&&(l.referenceElement=o.reference,l.domReferenceElement=U(o.reference)?o.reference:null),o.floating!==void 0&&(l.floatingElement=o.floating),i.update(l)},[t,s,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=r,i.context.noEmit=e.noEmit||!1,i}function Is(e={}){const{nodeId:t,externalTree:n}=e,o=Ms(e),s=e.rootContext||o,r={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[i,l]=x.useState(null),a=x.useRef(null),u=dt(n);ce(()=>{r.domReference&&(a.current=r.domReference)},[r.domReference]);const c=Es({...e,elements:{...r,...i&&{reference:i}}}),f=x.useCallback(w=>{const k=U(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(k),c.refs.setReference(k)},[c.refs]),[d,p]=x.useState(null),[g,m]=x.useState(null);s.useSyncedValue("referenceElement",d),s.useSyncedValue("domReferenceElement",U(d)?d:null),s.useSyncedValue("floatingElement",g);const b=x.useCallback(w=>{(U(w)||w===null)&&(a.current=w,p(w)),(U(c.refs.reference.current)||c.refs.reference.current===null||w!==null&&!U(w))&&c.refs.setReference(w)},[c.refs,p]),E=x.useCallback(w=>{m(w),c.refs.setFloating(w)},[c.refs]),R=x.useMemo(()=>({...c.refs,setReference:b,setFloating:E,setPositionReference:f,domReference:a}),[c.refs,b,E,f]),C=x.useMemo(()=>({...c.elements,domReference:r.domReference}),[c.elements,r.domReference]),h=s.useState("open"),O=s.useState("floatingId"),T=x.useMemo(()=>({...c,dataRef:s.context.dataRef,open:h,onOpenChange:s.setOpen,events:s.context.events,floatingId:O,refs:R,elements:C,nodeId:t,rootStore:s}),[c,R,C,t,s,h,O]);return ce(()=>{s.context.dataRef.current.floatingContext=T;const w=u?.nodesRef.current.find(k=>k.id===t);w&&(w.context=T)}),x.useMemo(()=>({...c,context:T,refs:R,elements:C,rootStore:s}),[c,R,C,T,s])}const ct=Yn("safe-polygon"),ks=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zn}`;function Ds(e){return e?!!e.closest(ks):!1}function wn(e){const t=x.useRef(void 0),n=x.useRef(!1),o=x.useRef(void 0),s=x.useRef(!0),r=x.useRef(!1),i=x.useRef(()=>{}),l=x.useRef(!1),a=nt(),u=nt(),c=x.useRef(void 0);return x.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:s,performedPointerEventsMutationRef:r,unbindMouseMoveRef:i,restTimeoutPendingRef:l,openChangeTimeout:a,restTimeout:u,handleCloseOptionsRef:c}),f.hoverInteractionState},[e,t,n,o,s,r,i,l,a,u,c])}const Ls=new Set(["click","mousedown"]);function Fs(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),s=n.useState("floatingElement"),r=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:l=!0,closeDelay:a=0,externalTree:u}=t,{pointerTypeRef:c,interactedInsideRef:f,handlerRef:d,performedPointerEventsMutationRef:p,unbindMouseMoveRef:g,restTimeoutPendingRef:m,openChangeTimeout:b,handleCloseOptionsRef:E}=wn(n),R=dt(u),C=ut(),h=q(()=>f.current?!0:i.current.openEvent?Ls.has(i.current.openEvent.type):!1),O=q(()=>{const A=i.current.openEvent?.type;return A?.includes("mouse")&&A!=="mousedown"}),T=x.useCallback((A,L=!0)=>{const S=Bs(a,c.current);S&&!d.current?b.start(S,()=>n.setOpen(!1,G(ee,A))):L&&(b.clear(),n.setOpen(!1,G(ee,A)))},[a,d,n,c,b]),w=q(()=>{g.current(),d.current=void 0}),k=q(()=>{if(p.current){const A=_e(s).body;A.style.pointerEvents="",A.removeAttribute(ct),p.current=!1}}),$=q(A=>{const L=an(A);if(!Ds(L)){f.current=!1;return}f.current=!0});ce(()=>{o||(c.current=void 0,m.current=!1,f.current=!1,w(),k())},[o,c,m,f,w,k]),x.useEffect(()=>()=>{w()},[w]),x.useEffect(()=>k,[k]),ce(()=>{if(l&&o&&E.current?.blockPointerEvents&&O()&&U(r)&&s){p.current=!0;const A=_e(s).body;A.setAttribute(ct,"");const L=r,S=s,y=R?.nodesRef.current.find(D=>D.id===C)?.context?.elements.floating;return y&&(y.style.pointerEvents=""),A.style.pointerEvents="none",L.style.pointerEvents="auto",S.style.pointerEvents="auto",()=>{A.style.pointerEvents="",L.style.pointerEvents="",S.style.pointerEvents=""}}},[l,o,r,s,E,O,R,C,p]),x.useEffect(()=>{if(!l)return;function A(D){if(h()||!i.current.floatingContext||!n.select("open"))return;const I=n.context.triggerElements;D.relatedTarget&&I.hasElement(D.relatedTarget)||(k(),w(),h()||T(D))}function L(D){b.clear(),k(),d.current?.(D),w()}function S(D){h()||T(D,!1)}const y=s;return y&&(y.addEventListener("mouseleave",A),y.addEventListener("mouseenter",L),y.addEventListener("mouseleave",S),y.addEventListener("pointerdown",$,!0)),()=>{y&&(y.removeEventListener("mouseleave",A),y.removeEventListener("mouseenter",L),y.removeEventListener("mouseleave",S),y.removeEventListener("pointerdown",$,!0))}})}function Bs(e,t){return t&&!Ce(t)?0:typeof e=="function"?e():e}function tt(e){return typeof e=="function"?e():e}const Hs={current:null};function $s(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:s}=n.context,{enabled:r=!0,delay:i=0,handleClose:l=null,mouseOnly:a=!1,restMs:u=0,move:c=!0,triggerElementRef:f=Hs,externalTree:d,isActiveTrigger:p=!0}=t,g=dt(d),{pointerTypeRef:m,interactedInsideRef:b,handlerRef:E,blockMouseMoveRef:R,performedPointerEventsMutationRef:C,unbindMouseMoveRef:h,restTimeoutPendingRef:O,openChangeTimeout:T,restTimeout:w,handleCloseOptionsRef:k}=wn(n),$=we(l),A=we(i),L=we(u);p&&(k.current=$.current?.__options);const S=q(()=>b.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),y=x.useCallback((M,v=!0)=>{const P=Qe(A.current,"close",m.current);P&&!E.current?T.start(P,()=>n.setOpen(!1,G(ee,M))):v&&(T.clear(),n.setOpen(!1,G(ee,M)))},[A,E,n,m,T]),D=q(()=>{h.current(),E.current=void 0}),I=q(()=>{if(C.current){const M=_e(n.select("domReferenceElement")).body;M.style.pointerEvents="",M.removeAttribute(ct),C.current=!1}});x.useEffect(()=>{if(!r)return;function M(v){v.open||(T.clear(),w.clear(),R.current=!0,O.current=!1)}return s.on("openchange",M),()=>{s.off("openchange",M)}},[r,s,T,w,R,O]);const F=q(M=>{if(S()||!o.current.floatingContext)return;const v=n.context.triggerElements;if(M.relatedTarget&&v.hasElement(M.relatedTarget))return;const P=f.current;$.current?.({...o.current.floatingContext,tree:g,x:M.clientX,y:M.clientY,onClose(){I(),D(),!S()&&P===n.select("domReferenceElement")&&y(M)}})(M)});return x.useEffect(()=>{if(!r)return;const M=f.current??(p?n.select("domReferenceElement"):null);if(!U(M))return;function v(V){if(T.clear(),R.current=!1,a&&!Ce(m.current)||tt(L.current)>0&&!Qe(A.current,"open"))return;const W=Qe(A.current,"open",m.current),j=n.select("domReferenceElement"),B=n.context.triggerElements,Y=(B.hasElement(V.target)||B.hasMatchingElement(re=>le(re,V.target)))&&(!j||!le(j,V.target)),H=V.currentTarget??null,_=n.select("open"),ne=!_||Y;Y&&_?n.setOpen(!0,G(ee,V,H)):W?T.start(W,()=>{ne&&n.setOpen(!0,G(ee,V,H))}):ne&&n.setOpen(!0,G(ee,V,H))}function P(V){if(S()){I();return}h.current();const W=n.select("domReferenceElement"),j=_e(W);w.clear(),O.current=!1;const B=n.context.triggerElements;if(V.relatedTarget&&B.hasElement(V.relatedTarget))return;if($.current&&o.current.floatingContext){n.select("open")||T.clear();const H=f.current;E.current=$.current({...o.current.floatingContext,tree:g,x:V.clientX,y:V.clientY,onClose(){I(),D(),!S()&&H===n.select("domReferenceElement")&&y(V,!0)}});const _=E.current;_(V),j.addEventListener("mousemove",_),h.current=()=>{j.removeEventListener("mousemove",_)};return}(m.current!=="touch"||!le(n.select("floatingElement"),V.relatedTarget))&&y(V)}function N(V){F(V)}return n.select("open")&&M.addEventListener("mouseleave",N),c&&M.addEventListener("mousemove",v,{once:!0}),M.addEventListener("mouseenter",v),M.addEventListener("mouseleave",P),()=>{M.removeEventListener("mouseleave",N),c&&M.removeEventListener("mousemove",v),M.removeEventListener("mouseenter",v),M.removeEventListener("mouseleave",P)}},[D,I,R,o,A,y,n,r,$,F,p,S,a,c,m,L,w,O,T,f,g,h,E]),x.useMemo(()=>{function M(v){m.current=v.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(v){const{nativeEvent:P}=v,N=v.currentTarget,V=n.select("domReferenceElement"),W=n.context.triggerElements,j=n.select("open"),B=(W.hasElement(v.target)||W.hasMatchingElement(H=>le(H,v.target)))&&(!V||!le(V,v.target));if(a&&!Ce(m.current)||j&&!B||tt(L.current)===0||!B&&O.current&&v.movementX**2+v.movementY**2<2)return;w.clear();function Y(){if(O.current=!1,S())return;const H=n.select("open");!R.current&&(!H||B)&&n.setOpen(!0,G(ee,P,N))}m.current==="touch"?Me.flushSync(()=>{Y()}):B&&j?Y():(O.current=!0,w.start(tt(L.current),Y))}}},[R,S,a,n,m,L,w,O])}function Jt(e,t){const[n,o]=e;let s=!1;const r=t.length;for(let i=0,l=r-1;i<r;l=i++){const[a,u]=t[i]||[0,0],[c,f]=t[l]||[0,0];u>=o!=f>=o&&n<=(c-a)*(o-u)/(f-u)+a&&(s=!s)}return s}function Vs(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ws(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,s=new ln;let r=!1,i=null,l=null,a=typeof performance<"u"?performance.now():0;function u(f,d){const p=performance.now(),g=p-a;if(i===null||l===null||g===0)return i=f,l=d,a=p,null;const m=f-i,b=d-l,R=Math.sqrt(m*m+b*b)/g;return i=f,l=d,a=p,R}const c=({x:f,y:d,placement:p,elements:g,onClose:m,nodeId:b,tree:E})=>function(C){function h(){s.clear(),m()}if(s.clear(),!g.domReference||!g.floating||p==null||f==null||d==null)return;const{clientX:O,clientY:T}=C,w=[O,T],k=an(C),$=C.type==="mouseleave",A=le(g.floating,k),L=le(g.domReference,k),S=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),D=p.split("-")[0],I=f>y.right-y.width/2,F=d>y.bottom-y.height/2,M=Vs(w,S),v=y.width>S.width,P=y.height>S.height,N=(v?S:y).left,V=(v?S:y).right,W=(P?S:y).top,j=(P?S:y).bottom;if(A&&(r=!0,!$))return;if(L&&(r=!1),L&&!$){r=!0;return}if($&&U(C.relatedTarget)&&le(g.floating,C.relatedTarget)||E&&Un(E.nodesRef.current,b).some(({context:H})=>H?.open))return;if(D==="top"&&d>=S.bottom-1||D==="bottom"&&d<=S.top+1||D==="left"&&f>=S.right-1||D==="right"&&f<=S.left+1)return h();let B=[];switch(D){case"top":B=[[N,S.top+1],[N,y.bottom-1],[V,y.bottom-1],[V,S.top+1]];break;case"bottom":B=[[N,y.top+1],[N,S.bottom-1],[V,S.bottom-1],[V,y.top+1]];break;case"left":B=[[y.right-1,j],[y.right-1,W],[S.left+1,W],[S.left+1,j]];break;case"right":B=[[S.right-1,j],[S.right-1,W],[y.left+1,W],[y.left+1,j]];break}function Y([H,_]){switch(D){case"top":{const ne=[v?H+t/2:I?H+t*4:H-t*4,_+t+1],re=[v?H-t/2:I?H+t*4:H-t*4,_+t+1],oe=[[y.left,I||v?y.bottom-t:y.top],[y.right,I?v?y.bottom-t:y.top:y.bottom-t]];return[ne,re,...oe]}case"bottom":{const ne=[v?H+t/2:I?H+t*4:H-t*4,_-t],re=[v?H-t/2:I?H+t*4:H-t*4,_-t],oe=[[y.left,I||v?y.top+t:y.bottom],[y.right,I?v?y.top+t:y.bottom:y.top+t]];return[ne,re,...oe]}case"left":{const ne=[H+t+1,P?_+t/2:F?_+t*4:_-t*4],re=[H+t+1,P?_-t/2:F?_+t*4:_-t*4];return[...[[F||P?y.right-t:y.left,y.top],[F?P?y.right-t:y.left:y.right-t,y.bottom]],ne,re]}case"right":{const ne=[H-t,P?_+t/2:F?_+t*4:_-t*4],re=[H-t,P?_-t/2:F?_+t*4:_-t*4],oe=[[F||P?y.left+t:y.right,y.top],[F?P?y.left+t:y.right:y.left+t,y.bottom]];return[ne,re,...oe]}default:return[]}}if(!Jt([O,T],B)){if(r&&!M)return h();if(!$&&o){const H=u(C.clientX,C.clientY);if(H!==null&&H<.1)return h()}Jt([O,T],Y([f,d]))?!r&&o&&s.start(40,h):h()}};return c.__options={blockPointerEvents:n},c}const _s=x.createContext(void 0);function Ns(e=!1){const t=x.useContext(_s);if(t===void 0&&!e)throw new Error(ke(16));return t}function js(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:s=0,isNativeButton:r}=e,i=o&&t!==!1,l=o&&t===!1;return{props:x.useMemo(()=>{const u={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return o||(u.tabIndex=s,!r&&n&&(u.tabIndex=t?s:-1)),(r&&(t||i)||!r&&n)&&(u["aria-disabled"]=n),r&&(!t||l)&&(u.disabled=n),u},[o,n,t,i,l,r,s])}}function Ys(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:s=!0}=e,r=x.useRef(null),i=Ns(!0)!==void 0,l=q(()=>{const d=r.current;return!!(d?.tagName==="A"&&d?.href)}),{props:a}=js({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:s}),u=x.useCallback(()=>{const d=r.current;zs(d)&&i&&t&&a.disabled===void 0&&d.disabled&&(d.disabled=!1)},[t,a.disabled,i]);ce(u,[u]);const c=x.useCallback((d={})=>{const{onClick:p,onMouseDown:g,onKeyUp:m,onKeyDown:b,onPointerDown:E,...R}=d;return Xn({type:s?"button":void 0,onClick(h){if(t){h.preventDefault();return}p?.(h)},onMouseDown(h){t||g?.(h)},onKeyDown(h){if(t||(Vt(h),b?.(h)),h.baseUIHandlerPrevented)return;const O=h.target===h.currentTarget&&!s&&!l()&&!t,T=h.key==="Enter",w=h.key===" ";O&&((w||T)&&h.preventDefault(),T&&p?.(h))},onKeyUp(h){t||(Vt(h),m?.(h)),!h.baseUIHandlerPrevented&&h.target===h.currentTarget&&!s&&!t&&h.key===" "&&p?.(h)},onPointerDown(h){if(t){h.preventDefault();return}E?.(h)}},s?void 0:{role:"button"},a,R)},[t,a,s,l]),f=q(d=>{r.current=d,u()});return{getButtonProps:c,buttonRef:f}}function zs(e){return ge(e)&&e.tagName==="BUTTON"}const Us=x.createContext(void 0);function Xs(){return x.useContext(Us)?.direction??"ltr"}const Ks=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:s,rects:r,platform:i,elements:l,middlewareData:a}=t,{element:u,padding:c=0,offsetParent:f="real"}=ue(e,t)||{};if(u==null)return{};const d=gn(c),p={x:n,y:o},g=ht(s),m=mt(g),b=await i.getDimensions(u),E=g==="y",R=E?"top":"left",C=E?"bottom":"right",h=E?"clientHeight":"clientWidth",O=r.reference[m]+r.reference[g]-p[g]-r.floating[m],T=p[g]-r.reference[g],w=f==="real"?await i.getOffsetParent?.(u):l.floating;let k=l.floating[h]||r.floating[m];(!k||!await i.isElement?.(w))&&(k=l.floating[h]||r.floating[m]);const $=O/2-T/2,A=k/2-b[m]/2-1,L=Math.min(d[R],A),S=Math.min(d[C],A),y=L,D=k-b[m]-S,I=k/2-b[m]/2+$,F=rt(y,I,D),M=!a.arrow&&me(s)!=null&&I!==F&&r.reference[m]/2-(I<y?L:S)-b[m]/2<0,v=M?I<y?I-y:I-D:0;return{[g]:p[g]+v,data:{[g]:F,centerOffset:I-F-v,...M&&{alignmentOffset:v}},reset:M}}}),Gs=(e,t)=>({...Ks(e),options:[e,t]}),qs={name:"hide",async fn(e){const{width:t,height:n,x:o,y:s}=e.rects.reference,r=t===0&&n===0&&o===0&&s===0;return{data:{referenceHidden:(await As().fn(e)).data?.referenceHidden||r}}}},Ve={sideX:"left",sideY:"top"},Js={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:s},platform:r,strategy:i,placement:l}=e,a=pe(s),u=a.getComputedStyle(s);if(!(u.transitionDuration!=="0s"&&u.transitionDuration!==""))return{x:t,y:n,data:Ve};const f=await r.getOffsetParent?.(s);let d={width:0,height:0};if(i==="fixed"&&a?.visualViewport)d={width:a.visualViewport.width,height:a.visualViewport.height};else if(f===a){const R=fn(s);d={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await r.isElement?.(f)&&(d=await r.getDimensions(f));const p=J(l);let g=t,m=n;p==="left"&&(g=d.width-(t+o.width)),p==="top"&&(m=d.height-(n+o.height));const b=p==="left"?"right":Ve.sideX,E=p==="top"?"bottom":Ve.sideY;return{x:g,y:m,data:{sideX:b,sideY:E}}}};function En(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 Qt(e,t,n){const{rects:o,placement:s}=e;return{side:En(t,J(s),n),align:me(s)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Qs(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:s=0,align:r="center",alignOffset:i=0,collisionBoundary:l,collisionPadding:a=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:f=!1,keepMounted:d=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:b=!1,nodeId:E,adaptiveOrigin:R,lazyFlip:C=!1,externalTree:h}=e,[O,T]=x.useState(null);!g&&O!==null&&T(null);const w=m.side||"flip",k=m.align||"flip",$=m.fallbackAxisSide||"end",A=typeof t=="function"?t:void 0,L=q(A),S=A?L:t,y=we(t),I=Xs()==="rtl",F=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[o],M=r==="center"?F:`${F}-${r}`;let v=a;const P=1,N=o==="bottom"?P:0,V=o==="top"?P:0,W=o==="right"?P:0,j=o==="left"?P:0;typeof v=="number"?v={top:v+N,right:v+j,bottom:v+V,left:v+W}:v&&(v={top:(v.top||0)+N,right:(v.right||0)+j,bottom:(v.bottom||0)+V,left:(v.left||0)+W});const B={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:v},Y=x.useRef(null),H=we(s),_=we(i),oe=[Cs(z=>{const K=Qt(z,o,I),ie=typeof H.current=="function"?H.current(K):H.current,Z=typeof _.current=="function"?_.current(K):_.current;return{mainAxis:ie,crossAxis:Z,alignmentAxis:Z}},[typeof s!="function"?s:0,typeof i!="function"?i:0,I,o])],Rt=k==="none"&&w!=="shift",vt=!Rt&&(u||b||w==="shift"),bt=w==="none"?null:Ss({...B,padding:{top:v.top+P,right:v.right+P,bottom:v.bottom+P,left:v.left+P},mainAxis:!b&&w==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:$}),wt=Rt?null:Os(z=>{const K=fn(z.elements.floating).documentElement;return{...B,rootBoundary:b?{x:0,y:0,width:K.clientWidth,height:K.clientHeight}:void 0,mainAxis:k!=="none",crossAxis:vt,limiter:u||b?void 0:Ts(ie=>{if(!Y.current)return{};const{width:Z,height:Re}=Y.current.getBoundingClientRect(),ve=te(J(ie.placement)),Be=ve==="y"?Z:Re,qe=ve==="y"?v.left+v.right:v.top+v.bottom;return{offset:Be/2+qe/2}})}},[B,u,b,v,k]);w==="shift"||k==="shift"||r==="center"?oe.push(wt,bt):oe.push(bt,wt),oe.push(Ps({...B,apply({elements:{floating:z},rects:{reference:K},availableWidth:ie,availableHeight:Z}){Object.entries({"--available-width":`${ie}px`,"--available-height":`${Z}px`,"--anchor-width":`${K.width}px`,"--anchor-height":`${K.height}px`}).forEach(([Re,ve])=>{z.style.setProperty(Re,ve)})}}),Gs(()=>({element:Y.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(z){const{elements:K,middlewareData:ie,placement:Z,rects:Re,y:ve}=z,Be=J(Z),qe=te(Be),Bt=Y.current,Pn=ie.arrow?.x||0,An=ie.arrow?.y||0,Mn=Bt?.clientWidth||0,In=Bt?.clientHeight||0,Je=Pn+Mn/2,Ht=An+In/2,kn=Math.abs(ie.shift?.y||0),Dn=Re.reference.height/2,Ae=typeof s=="function"?s(Qt(z,o,I)):s,Ln=kn>Ae,Fn={top:`${Je}px calc(100% + ${Ae}px)`,bottom:`${Je}px ${-Ae}px`,left:`calc(100% + ${Ae}px) ${Ht}px`,right:`${-Ae}px ${Ht}px`}[Be],Bn=`${Je}px ${Re.reference.y+Dn-ve}px`;return K.floating.style.setProperty("--transform-origin",vt&&qe==="y"&&Ln?Bn:Fn),{}}},qs,R),ce(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const Ke=x.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:xe,elements:Te,x:Et,y:Ct,middlewareData:ye,update:Le,placement:Ot,context:Tt,isPositioned:Se,floatingStyles:St}=Is({rootContext:p,placement:M,middleware:oe,strategy:n,whileElementsMounted:d?void 0:(...z)=>Gt(...z,Ke),nodeId:E,externalTree:h}),{sideX:Pt,sideY:At}=ye.adaptiveOrigin||Ve,Ge=Se?n:"fixed",Mt=x.useMemo(()=>R?{position:Ge,[Pt]:Et,[At]:Ct}:{position:Ge,...St},[R,Ge,Pt,Et,At,Ct,St]),Fe=x.useRef(null);ce(()=>{if(!g)return;const z=y.current,K=typeof z=="function"?z():z,Z=(Zt(K)?K.current:K)||null||null;Z!==Fe.current&&(xe.setPositionReference(Z),Fe.current=Z)},[g,xe,S,y]),x.useEffect(()=>{if(!g)return;const z=y.current;typeof z!="function"&&Zt(z)&&z.current!==Fe.current&&(xe.setPositionReference(z.current),Fe.current=z.current)},[g,xe,S,y]),x.useEffect(()=>{if(d&&g&&Te.domReference&&Te.floating)return Gt(Te.domReference,Te.floating,Le,Ke)},[d,g,Te,Le,Ke]);const Pe=J(Ot),It=En(o,Pe,I),kt=me(Ot)||"center",Dt=!!ye.hide?.referenceHidden;ce(()=>{C&&g&&Se&&T(Pe)},[C,g,Se,Pe]);const Lt=x.useMemo(()=>({position:"absolute",top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Ft=ye.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Mt,arrowStyles:Lt,arrowRef:Y,arrowUncentered:Ft,side:It,align:kt,physicalSide:Pe,anchorHidden:Dt,refs:xe,context:Tt,isPositioned:Se,update:Le}),[Mt,Lt,Y,Ft,It,kt,Pe,Dt,xe,Tt,Se,Le])}function Zt(e){return e!=null&&"current"in e}const Zs=x.createContext(void 0);function er(e){return x.useContext(Zs)}function Cn(e){return e==="starting"?Kn:nn}const On=x.createContext(void 0);function De(e){const t=x.useContext(On);if(t===void 0&&!e)throw new Error(ke(47));return t}function tr(){return{...eo(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const nr={...qn,disabled:se(e=>e.disabled),instantType:se(e=>e.instantType),openMethod:se(e=>e.openMethod),openChangeReason:se(e=>e.openChangeReason),modal:se(e=>e.modal),stickIfOpen:se(e=>e.stickIfOpen),titleElementId:se(e=>e.titleElementId),descriptionElementId:se(e=>e.descriptionElementId),openOnHover:se(e=>e.openOnHover),closeDelay:se(e=>e.closeDelay),hasViewport:se(e=>e.hasViewport)};class yt extends Gn{constructor(t){const n={...tr(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),stickIfOpenTimeout:new ln,triggerElements:new cn},nr)}setOpen=(t,n)=>{const o=n.reason===ee,s=n.reason===be&&n.event.detail===0,r=!t&&(n.reason===Jn||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const a=()=>{const u={open:t,openChangeReason:n.reason},c=n.trigger?.id??null;(c||t)&&(u.activeTriggerId=c,u.activeTriggerElement=n.trigger??null),this.update(u)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Qn,()=>{this.set("stickIfOpen",!1)}),Me.flushSync(a)):a(),s||r?this.set("instantType",s?"click":"dismiss"):n.reason===st?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const o=rn(()=>new yt(n)).current,s=t??o;return Zn(o.disposeEffect),s}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function en({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:r,modal:i=!1,handle:l,triggerId:a,defaultTriggerId:u=null}=e,c=yt.useStore(l?.store,{open:n??o,modal:i,activeTriggerId:a!==void 0?a:u});c.useControlledProp("open",n,o),c.useControlledProp("activeTriggerId",a,u);const f=c.useState("open"),d=c.useState("positionerElement"),p=c.useState("payload"),g=c.useState("openChangeReason");c.useContextCallback("onOpenChange",s),c.useContextCallback("onOpenChangeComplete",r);const{openMethod:m,triggerProps:b,reset:E}=no(f);oo(c);const{forceUnmount:R}=so(f,c,()=>{c.update({stickIfOpen:!0,openChangeReason:null}),E()});ro(f&&i===!0&&g!==ee&&m!=="touch",d),x.useEffect(()=>{f||c.context.stickIfOpenTimeout.clear()},[c,f]);const C=x.useCallback(I=>{const F=G(I);return F.preventUnmountOnClose=()=>{c.set("preventUnmountingOnClose",!0)},F},[c]),h=x.useCallback(()=>{c.setOpen(!1,C(io))},[c,C]);x.useImperativeHandle(e.actionsRef,()=>({unmount:R,close:h}),[R,h]);const O=co({popupStore:c,onOpenChange:c.setOpen}),T=ao(O,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),w=lo(O),{getReferenceProps:k,getFloatingProps:$,getTriggerProps:A}=un([T,w]),L=x.useMemo(()=>k(b),[k,b]),S=x.useMemo(()=>A(b),[A,b]),y=x.useMemo(()=>$(),[$]);c.useSyncedValues({modal:i,openMethod:m,activeTriggerProps:L,inactiveTriggerProps:S,popupProps:y,floatingRootContext:O,nested:ut()!=null});const D=x.useMemo(()=>({store:c}),[c]);return X.jsx(On.Provider,{value:D,children:typeof t=="function"?t({payload:p}):t})}function ur(e){return De(!0)?X.jsx(en,{props:e}):X.jsx(to,{children:X.jsx(en,{props:e})})}const or=300,dr=x.forwardRef(function(t,n){const{render:o,className:s,disabled:r=!1,nativeButton:i=!0,handle:l,payload:a,openOnHover:u=!1,delay:c=or,closeDelay:f=0,id:d,...p}=t,g=De(!0),m=l?.store??g?.store;if(!m)throw new Error(ke(74));const b=fo(d),E=m.useState("isTriggerActive",b),R=m.useState("floatingRootContext"),C=m.useState("isOpenedByTrigger",b),h=x.useRef(null),{registerTrigger:O,isMountedByThisTrigger:T}=uo(b,h,m,{payload:a,disabled:r,openOnHover:u,closeDelay:f}),w=m.useState("openChangeReason"),k=m.useState("stickIfOpen"),$=m.useState("openMethod"),A=$s(R,{enabled:R!=null&&u&&($!=="touch"||w!==be),mouseOnly:!0,move:!1,handleClose:Ws(),restMs:c,delay:{close:f},triggerElementRef:h,isActiveTrigger:E}),L=No(R,{enabled:R!=null,stickIfOpen:k}),S=un([L]),y=m.useState("triggerProps",T),D=x.useMemo(()=>({disabled:r,open:C}),[r,C]),{getButtonProps:I,buttonRef:F}=Ys({disabled:r,native:i}),M=x.useMemo(()=>({open(W){return W&&w===be?go.open(W):po.open(W)}}),[w]),v=gt("button",t,{state:D,ref:[F,n,O,h],props:[S.getReferenceProps(),A,y,{[mo]:"",id:b},p,I],stateAttributesMapping:M}),P=x.useRef(null),N=q(W=>{Me.flushSync(()=>{m.setOpen(!1,G(st,W.nativeEvent,W.currentTarget))}),ho(P.current)?.focus()}),V=q(W=>{const j=m.select("positionerElement");if(j&&xo(W,j))m.context.beforeContentFocusGuardRef.current?.focus();else{Me.flushSync(()=>{m.setOpen(!1,G(st,W.nativeEvent,W.currentTarget))});let B=yo(m.context.triggerFocusTargetRef.current||h.current);for(;B!==null&&le(j,B);){const Y=B;if(B=Ro(B),B===Y)break}B?.focus()}});return E?X.jsxs(x.Fragment,{children:[X.jsx(Wt,{ref:P,onFocus:N}),X.jsx(x.Fragment,{children:v},b),X.jsx(Wt,{ref:m.context.triggerFocusTargetRef,onFocus:V})]}):X.jsx(x.Fragment,{children:v},b)}),Tn=x.createContext(void 0);function sr(){const e=x.useContext(Tn);if(e===void 0)throw new Error(ke(45));return e}const gr=x.forwardRef(function(t,n){const{keepMounted:o=!1,...s}=t,{store:r}=De();return r.useState("mounted")||o?X.jsx(Tn.Provider,{value:o,children:X.jsx(vo,{ref:n,...s,renderGuards:!1})}):null}),Sn=x.createContext(void 0);function rr(){const e=x.useContext(Sn);if(!e)throw new Error(ke(46));return e}const pr=x.forwardRef(function(t,n){const{render:o,className:s,anchor:r,positionMethod:i="absolute",side:l="bottom",align:a="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:b=bo,...E}=t,{store:R}=De(),C=sr(),h=wo(),O=R.useState("floatingRootContext"),T=R.useState("mounted"),w=R.useState("open"),k=R.useState("openChangeReason"),$=R.useState("activeTriggerElement"),A=R.useState("modal"),L=R.useState("positionerElement"),S=R.useState("instantType"),y=R.useState("transitionStatus"),D=R.useState("hasViewport"),I=x.useRef(null),F=Eo(L,!1,!1),M=Qs({anchor:r,floatingRootContext:O,positionMethod:i,mounted:T,side:l,sideOffset:u,align:a,alignOffset:c,arrowPadding:p,collisionBoundary:f,collisionPadding:d,sticky:g,disableAnchorTracking:m,keepMounted:C,nodeId:h,collisionAvoidance:b,adaptiveOrigin:D?Js:void 0}),v=x.useMemo(()=>{const B={};return w||(B.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...M.positionerStyles,...B}}},[w,T,M.positionerStyles]),P=x.useMemo(()=>({props:v,...M}),[v,M]),N=O?.select("domReferenceElement");ce(()=>{const B=N,Y=I.current;if(B&&(I.current=B),Y&&B&&B!==Y){R.set("instantType",void 0);const H=new AbortController;return F(()=>{R.set("instantType","trigger-change")},H.signal),()=>{H.abort()}}},[N,F,R]);const V=x.useMemo(()=>({open:w,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:S}),[w,P.side,P.align,P.anchorHidden,S]),W=x.useCallback(B=>{R.set("positionerElement",B)},[R]),j=gt("div",t,{state:V,props:[P.props,Cn(y),E],ref:[n,W],stateAttributesMapping:dn});return X.jsxs(Sn.Provider,{value:P,children:[T&&A===!0&&k!==ee&&X.jsx(Co,{ref:R.context.internalBackdropRef,inert:Oo(!w),cutout:$}),X.jsx(To,{id:h,children:j})]})}),ir={...dn,...Ao},mr=x.forwardRef(function(t,n){const{className:o,render:s,initialFocus:r,finalFocus:i,...l}=t,{store:a}=De(),u=rr(),c=er()!=null,f=a.useState("open"),d=a.useState("openMethod"),p=a.useState("instantType"),g=a.useState("transitionStatus"),m=a.useState("popupProps"),b=a.useState("titleElementId"),E=a.useState("descriptionElementId"),R=a.useState("modal"),C=a.useState("mounted"),h=a.useState("openChangeReason"),O=a.useState("activeTriggerElement"),T=a.useState("floatingRootContext");So({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}});const w=a.useState("disabled"),k=a.useState("openOnHover"),$=a.useState("closeDelay");Fs(T,{enabled:k&&!w,closeDelay:$});function A(I){return I==="touch"?a.context.popupRef.current:!0}const L=r===void 0?A:r,S=x.useMemo(()=>({open:f,side:u.side,align:u.align,instant:p,transitionStatus:g}),[f,u.side,u.align,p,g]),y=x.useCallback(I=>{a.set("popupElement",I)},[a]),D=gt("div",t,{state:S,ref:[n,a.context.popupRef,y],props:[m,{"aria-labelledby":b,"aria-describedby":E,onKeyDown(I){c&&Mo.has(I.key)&&I.stopPropagation()}},Cn(g),l],stateAttributesMapping:ir});return X.jsx(Po,{context:T,openInteractionType:d,modal:R==="trap-focus",disabled:!C||h===ee,initialFocus:L,returnFocus:i,restoreFocus:"popup",previousFocusableElement:ge(O)?O:void 0,nextFocusableElement:a.context.triggerFocusTargetRef,beforeContentFocusGuardRef:a.context.beforeContentFocusGuardRef,children:D})});export{lr as C,fr as L,ur as P,dr as a,gr as b,pr as c,mr as d,Ms as e,He as f,No as g,Qs as h,er as i,Cn as j,Ys as u};
@@ -1 +1 @@
1
- import{C as r}from"./main-DDbFansE.js";function h({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function d({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function x({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function s({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function a({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function C({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function u({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function v({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:[r.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),r.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function g({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function f({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 64 60",fill:"none",className:e,"aria-hidden":"true",children:[r.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),r.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:r.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),r.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:r.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function j({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function w({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",className:e,children:r.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function L({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",children:r.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:r.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function I({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),r.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),r.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),r.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function p({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function M({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[r.jsx("path",{d:"M9 3v2"}),r.jsx("path",{d:"M15 3v2"}),r.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),r.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("path",{d:"M9 16h6"})]})}const R={CLAUDE:h,CODEBUDDY:f,CODEX:d,COPILOT:g,CRAFT:L,CURSOR:x,DROID:M,GEMINI:s,GITHUB:w,GROK:a,HERMES:j,KIMI:v,KIRO:C,OPENCODE:u,OMP:I,PI:p},m={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function E({provider:t,size:e=16,color:i,className:l=""}){const o=t?.toUpperCase?.()||"",n=m[o];if(n)return r.jsx("img",{src:n,alt:"",width:e,height:e,className:l,style:{width:e,height:e,objectFit:"contain"},"aria-hidden":!0});const c=R[o];return c?r.jsx(c,{size:e,className:l}):r.jsx("div",{className:"rounded-full shrink-0",style:{width:e*.5,height:e*.5,backgroundColor:i}})}export{E as P};
1
+ import{C as r}from"./main-CR7sCH5H.js";function h({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function d({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function x({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function s({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function a({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function C({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function u({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function v({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:[r.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),r.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function g({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function f({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 64 60",fill:"none",className:e,"aria-hidden":"true",children:[r.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),r.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:r.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),r.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:r.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function j({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function w({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",className:e,children:r.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function L({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",children:r.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:r.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function I({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),r.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),r.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),r.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function p({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function M({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[r.jsx("path",{d:"M9 3v2"}),r.jsx("path",{d:"M15 3v2"}),r.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),r.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("path",{d:"M9 16h6"})]})}const R={CLAUDE:h,CODEBUDDY:f,CODEX:d,COPILOT:g,CRAFT:L,CURSOR:x,DROID:M,GEMINI:s,GITHUB:w,GROK:a,HERMES:j,KIMI:v,KIRO:C,OPENCODE:u,OMP:I,PI:p},m={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function E({provider:t,size:e=16,color:i,className:l=""}){const o=t?.toUpperCase?.()||"",n=m[o];if(n)return r.jsx("img",{src:n,alt:"",width:e,height:e,className:l,style:{width:e,height:e,objectFit:"contain"},"aria-hidden":!0});const c=R[o];return c?r.jsx(c,{size:e,className:l}):r.jsx("div",{className:"rounded-full shrink-0",style:{width:e*.5,height:e*.5,backgroundColor:i}})}export{E as P};
@@ -0,0 +1 @@
1
+ import{c as v,r as l,b as Q,f as J,an as L,C as n,D as A,S as x,B as s,U as X,ae as ee,ao as te,af as ne,ag as ae,ah as P,ap as ie,aq as se,T as oe,R as re,P as le,Q as ce,Y as ue,ar as de,as as ge,at as D,au as he,av as pe,aw as me,ax as be,H as fe,ay as ye}from"./main-CR7sCH5H.js";import{L as xe,a as G,u as ve}from"./use-limits-display-prefs-DgRoQmhK.js";import{S as k,T as j,a as b,b as I,u as _}from"./use-native-settings-BVWj6xAN.js";import{C as ke}from"./check-r6BrjxcR.js";import{u as je}from"./useCurrency-BLJima5w.js";import{C as Ne}from"./chevron-down-BS2aEE_V.js";import{I as Se}from"./info-TG4KyASc.js";import{D as we}from"./download-DtsgF1HV.js";import"./Card-BkDHn179.js";const Ce=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Le=v("copy",Ce);const Ge=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ie=v("grip-vertical",Ge);const Ee=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],E=v("languages",Ee);const Oe=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ae=v("log-out",Oe);const Pe=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],De=v("pencil",Pe),_e=e=>!e.isLayoutDirty&&e.willUpdate(!1);function O(){const e=new Set,t=new WeakMap,i=()=>e.forEach(_e);return{add:a=>{e.add(a),t.set(a,a.addEventListener("willUpdate",i))},remove:a=>{e.delete(a);const o=t.get(a);o&&(o(),t.delete(a)),i()},dirty:i}}const Te=l.createContext(null);function Me(){const e=l.useRef(!1);return Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ue(){const e=Me(),[t,i]=l.useState(0),a=l.useCallback(()=>{e.current&&i(t+1)},[t]);return[l.useCallback(()=>J.postRender(a),[a]),t]}const T=e=>e===!0,Re=e=>T(e===!0)||e==="id",Fe=({children:e,id:t,inherit:i=!0})=>{const a=l.useContext(L),o=l.useContext(Te),[r,c]=Ue(),u=l.useRef(null),g=a.id||o;u.current===null&&(Re(i)&&g&&(t=t?g+"-"+t:g),u.current={id:t,group:T(i)&&a.group||O()});const h=l.useMemo(()=>({...u.current,forceRender:r}),[c]);return n.jsx(L.Provider,{value:h,children:e})},He=new Set(["cursor","kiro","copilot","kimi"]);function $e({checked:e,onChange:t,ariaLabel:i}){return n.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,onClick:t,className:x("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:n.jsx("span",{className:x("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}function Be({prefs:e}){const{order:t,visibility:i,toggle:a,moveToward:o}=e,[r,c]=l.useState(null),[u,g]=l.useState(null),h=d=>p=>{c(d),p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",d)},m=d=>p=>{p.preventDefault(),p.dataTransfer.dropEffect="move",r&&r!==d&&u!==d&&(g(d),o(r,d))},f=()=>{c(null),g(null)},y=d=>{d.preventDefault(),c(null),g(null)};return n.jsx(Fe,{children:n.jsx("div",{className:"flex flex-col",children:t.map(d=>{const p=i[d]!==!1,N=r===d;return n.jsxs(A.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},draggable:!0,onDragStart:h(d),onDragOver:m(d),onDragEnd:f,onDrop:y,className:x("flex items-center gap-3 py-2 rounded-md","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60",N&&"opacity-40"),style:{cursor:N?"grabbing":"grab"},children:[n.jsx(Ie,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),n.jsx("img",{src:xe[d],alt:"",width:18,height:18,className:x("h-[18px] w-[18px] shrink-0 pointer-events-none",He.has(d)&&"dark:invert"),draggable:!1}),n.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200 select-none",children:G[d]}),n.jsx("div",{onMouseDown:S=>S.stopPropagation(),draggable:!1,children:n.jsx($e,{checked:p,onChange:()=>a(d),ariaLabel:`${s("limits.settings.toggle_visible")}: ${G[d]}`})})]},d)})})})}function ze(e){if(!e||typeof e!="object")return"";const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},i=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.full_name||t.name||i.name||t.user_name||t.preferred_username;return typeof a=="string"&&a.trim()?a.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function Ve(e){return!e||typeof e!="object"?"":typeof e.email=="string"?e.email.trim():""}function Ze(e){const t=typeof e=="string"?e.trim():"";if(!t)return null;const i=t.match(/^@?([A-Za-z0-9][A-Za-z0-9-]{0,38})$/),a=t.match(/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})\/?$/i),o=i?.[1]||a?.[1];return o?`https://github.com/${o}`:null}function w(e,t){console.warn(`[tokentracker] settings ${e}:`,t)}function We(e,t,i){const[a,o]=l.useState(()=>ee()),r=t&&i&&te(),c=l.useCallback(async()=>{const u=!a;if(ne(u),o(u),!!u)try{await ae(()=>e())}catch(g){w("cloud sync",g)}},[a,e]);return{cloudSyncOn:a,handleCloudSyncToggle:c,showLocalCloudSync:r}}function Ke(e){const[t,i]=l.useState(!1),[a,o]=l.useState(!1),[r,c]=l.useState(!1),[u,g]=l.useState(!1),[h,m]=l.useState(null),[f,y]=l.useState(!1),[d,p]=l.useState(""),[N,S]=l.useState(!1),[F,C]=l.useState(""),[H,$]=l.useState(""),[B,z]=l.useState(!1),[V,Z]=l.useState(null),W=l.useMemo(()=>ze(e),[e]),K=l.useMemo(()=>Ve(e),[e]),Y=l.useMemo(()=>typeof e?.id=="string"?e.id.trim():"",[e]),q=l.useMemo(()=>({setAnonymousOn:o,setCustomDisplayName:m,setGithubUrl:C,setProfileLoading:c,setPublicProfileOn:i,setShowGithubOn:S}),[]);return{anonymousOn:a,customDisplayName:h,displayName:W,editingGithub:B,editingName:f,email:K,githubError:V,githubInput:H,githubUrl:F,loadSetters:q,nameInput:d,profileLoading:r,profileSaving:u,publicProfileOn:t,setAnonymousOn:o,setCustomDisplayName:m,setEditingGithub:z,setEditingName:y,setGithubError:Z,setGithubInput:$,setGithubUrl:C,setNameInput:p,setProfileLoading:c,setProfileSaving:g,setPublicProfileOn:i,setShowGithubOn:S,showGithubOn:N,userId:Y}}function Ye(e,t,i){l.useEffect(()=>{if(!t)return;let a=!0;return i.setProfileLoading(!0),(async()=>{try{const o=await P({getAccessToken:e});if(!a||!o)return;const r=await ie({accessToken:o});if(!a)return;i.setPublicProfileOn(!!r?.enabled),i.setAnonymousOn(!!r?.anonymous),r?.display_name&&i.setCustomDisplayName(r.display_name),i.setShowGithubOn(!!r?.show_github_url),i.setGithubUrl(r?.github_url||"")}catch(o){w("load public profile",o)}finally{a&&i.setProfileLoading(!1)}})(),()=>{a=!1}},[e,t,i])}function qe(e,t){return l.useCallback(async(i,{label:a,onError:o,onSuccess:r}={})=>{if(t.profileSaving)return!1;t.setProfileSaving(!0);try{const c=await P({getAccessToken:e});if(!c)return!1;const u=await se({accessToken:c,...i});return r?.(u),!0}catch(c){return o?o(c):w(a||"mutate profile",c),!1}finally{t.setProfileSaving(!1)}},[e,t])}function Qe(e,t){return{anonymousOn:e.anonymousOn,customDisplayName:e.customDisplayName,displayName:e.displayName,editingName:e.editingName,handleAnonymousToggle:t.handleAnonymousToggle,handleSaveName:t.handleSaveName,nameInput:e.nameInput,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingName:e.setEditingName,setNameInput:e.setNameInput,startEditingName:t.startEditingName}}function Je(e,t){return{editingGithub:e.editingGithub,githubError:e.githubError,githubInput:e.githubInput,githubUrl:e.githubUrl,handleSaveGithub:t.handleSaveGithub,handleShowGithubToggle:t.handleShowGithubToggle,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingGithub:e.setEditingGithub,setGithubError:e.setGithubError,setGithubInput:e.setGithubInput,showGithubOn:e.showGithubOn,startEditingGithub:t.startEditingGithub}}function Xe(e,t){const i=l.useCallback(async()=>{const o=!e.publicProfileOn;await t({enabled:o},{label:"toggle public profile",onSuccess:()=>e.setPublicProfileOn(o)})},[t,e]);return{handleAnonymousToggle:l.useCallback(async()=>{const o=!e.anonymousOn;await t({anonymous:o},{label:"toggle anonymous",onSuccess:()=>e.setAnonymousOn(o)})},[t,e]),handlePublicProfileToggle:i}}function et(e,t){const i=l.useCallback(async()=>{const o=e.nameInput.trim().slice(0,50);o&&await t({display_name:o},{label:"save display name",onSuccess:()=>{e.setCustomDisplayName(o),e.setEditingName(!1)}})},[t,e]),a=l.useCallback(()=>{e.setNameInput(e.customDisplayName||e.displayName),e.setEditingName(!0)},[e]);return{handleSaveName:i,startEditingName:a}}function tt(e,t){const i=l.useCallback(async()=>{if(!e.showGithubOn&&!e.githubUrl){e.setEditingGithub(!0),e.setGithubInput(""),e.setGithubError(null);return}const r=!e.showGithubOn;await t({show_github_url:r},{label:"toggle GitHub profile",onSuccess:()=>e.setShowGithubOn(r)})},[t,e]),a=l.useCallback(async()=>{const r=Ze(e.githubInput);if(e.githubInput.trim()&&!r){e.setGithubError(s("settings.account.githubUrlInvalid"));return}e.setGithubError(null),await t({github_url:r,show_github_url:!!r},{label:"save GitHub profile",onError:c=>e.setGithubError(c?.message||s("settings.account.githubUrlInvalid")),onSuccess:c=>{e.setGithubUrl(c?.github_url||r||""),e.setShowGithubOn(!!r),e.setEditingGithub(!1)}})},[t,e]),o=l.useCallback(()=>{e.setGithubInput(e.githubUrl),e.setGithubError(null),e.setEditingGithub(!0)},[e]);return{handleSaveGithub:a,handleShowGithubToggle:i,startEditingGithub:o}}function nt(){const e=X(),t=Ke(e.user),i=We(e.getAccessToken,e.enabled,e.signedIn);Ye(e.getAccessToken,e.signedIn,t.loadSetters);const a=qe(e.getAccessToken,t),o=Xe(t,a),r=et(t,a),c=tt(t,a);return{...e,...i,email:t.email,handlePublicProfileToggle:o.handlePublicProfileToggle,userId:t.userId,name:Qe(t,{...o,...r}),github:Je(t,c),profileLoading:t.profileLoading,profileSaving:t.profileSaving,publicProfileOn:t.publicProfileOn}}function M({disabled:e,onCancel:t,onSave:i,saveLabel:a=s("settings.account.save")}){return n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:i,disabled:e,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:a}),n.jsx("button",{type:"button",onClick:t,className:"rounded-md px-2 py-1.5 text-xs text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:s("settings.account.cancel")})]})}function at({nameInput:e,setEditingName:t,setNameInput:i,profileSaving:a,handleSaveName:o}){return n.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[n.jsx("input",{type:"text",value:e,onChange:r=>i(r.target.value),onKeyDown:r=>{r.key==="Enter"&&o(),r.key==="Escape"&&t(!1)},maxLength:50,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.displayName")}),n.jsx(M,{disabled:a||!e.trim(),onCancel:()=>t(!1),onSave:o,saveLabel:a?s("settings.account.saving"):void 0})]})}function it({githubError:e,githubInput:t,handleSaveGithub:i,profileSaving:a,setEditingGithub:o,setGithubError:r,setGithubInput:c}){return n.jsxs("div",{className:"mt-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"text",value:t,onChange:u=>{c(u.target.value),e&&r(null)},onKeyDown:u=>{u.key==="Enter"&&i(),u.key==="Escape"&&(o(!1),r(null))},maxLength:100,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.githubUrlPlaceholder")}),n.jsx(M,{disabled:a,onCancel:()=>{o(!1),r(null)},onSave:i,saveLabel:a?s("settings.account.saving"):void 0})]}),e?n.jsx("div",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:e}):null]})}function U({disabled:e=!1,label:t,onClick:i,title:a}){return n.jsxs("button",{type:"button",onClick:i,disabled:e,title:a,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-40 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(De,{className:"h-3.5 w-3.5","aria-hidden":!0}),t]})}function R({actions:e,editing:t,editor:i,hint:a,label:o}){return n.jsx("div",{className:"py-3",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:o}),t?i:n.jsx("div",{className:"mt-0.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a})]}),t?null:e]})})}function st({name:e}){const t=e.anonymousOn?s("settings.account.displayNameDisabledWhileAnon"):void 0;return n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx(U,{disabled:e.anonymousOn,label:s("settings.account.edit"),onClick:e.startEditingName,title:t}),n.jsx(j,{checked:!e.anonymousOn,onChange:e.handleAnonymousToggle,disabled:e.profileLoading||e.profileSaving,ariaLabel:s("settings.account.displayName")})]})}function ot({name:e}){const{anonymousOn:t,customDisplayName:i,displayName:a,editingName:o,handleAnonymousToggle:r,handleSaveName:c,nameInput:u,profileLoading:g,profileSaving:h,setEditingName:m,setNameInput:f,startEditingName:y}=e,d=t?s("settings.account.displayNameAnonymousHint"):i||a;return n.jsx(R,{label:s("settings.account.displayName"),editing:o,hint:d,editor:n.jsx(at,{nameInput:u,setEditingName:m,setNameInput:f,profileSaving:h,handleSaveName:c}),actions:n.jsx(st,{name:e})})}function rt({github:e}){const{editingGithub:t,githubError:i,githubInput:a,githubUrl:o,handleSaveGithub:r,handleShowGithubToggle:c,profileLoading:u,profileSaving:g,setEditingGithub:h,setGithubError:m,setGithubInput:f,showGithubOn:y,startEditingGithub:d}=e;return n.jsx(R,{label:s("settings.account.githubUrl"),editing:t,hint:o||s("settings.account.githubUrlHint"),editor:n.jsx(it,{githubError:i,githubInput:a,handleSaveGithub:r,profileSaving:g,setEditingGithub:h,setGithubError:m,setGithubInput:f}),actions:n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx(U,{label:s("settings.account.edit"),onClick:d}),n.jsx(j,{checked:y,onChange:c,disabled:u||g,ariaLabel:s("settings.account.githubUrl")})]})})}function lt(){const{openLoginModal:e}=oe();return n.jsx(k,{title:s("settings.section.account"),children:n.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[n.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.account.signedOutHint")}),n.jsx("button",{type:"button",onClick:e,className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md bg-oai-gray-900 px-4 text-xs font-medium text-white transition-colors hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100",children:s("settings.account.signIn")})]})})}function ct({name:e,github:t}){return n.jsxs(n.Fragment,{children:[n.jsx(ot,{name:e}),n.jsx(rt,{github:t})]})}function ut(){const e=nt();return e.enabled?e.signedIn?n.jsxs(k,{title:s("settings.section.account"),subtitle:e.email||e.name.customDisplayName||e.name.displayName,action:n.jsx(gt,{onSignOut:e.signOut}),children:[n.jsx(dt,{userId:e.userId}),n.jsx(ht,{settings:e}),n.jsx(pt,{checked:e.publicProfileOn,disabled:e.profileLoading||e.profileSaving,onChange:e.handlePublicProfileToggle}),n.jsx(mt,{visible:e.publicProfileOn,name:e.name,github:e.github})]}):n.jsx(lt,{}):null}function dt({userId:e}){const[t,i]=re.useState(!1);if(!e)return null;const a=async()=>{try{if(typeof navigator>"u"||!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(e),i(!0),globalThis.setTimeout(()=>i(!1),1200)}catch{i(!1)}};return n.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:s("settings.account.userId")}),n.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e})]}),n.jsxs("button",{type:"button",onClick:a,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800","aria-label":s("settings.account.copyUserId"),children:[t?n.jsx(ke,{className:"h-3.5 w-3.5","aria-hidden":!0}):n.jsx(Le,{className:"h-3.5 w-3.5","aria-hidden":!0}),t?s("settings.account.copied"):s("settings.account.copy")]})]})}function gt({onSignOut:e}){return n.jsxs("button",{type:"button",onClick:()=>e(),className:"inline-flex h-7 items-center gap-1.5 text-xs font-medium text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:[n.jsx(Ae,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.account.signOut")]})}function ht({settings:e}){return e.showLocalCloudSync?n.jsx(b,{label:s("settings.account.cloudSync"),hint:s("settings.account.cloudSyncHint"),control:n.jsx(j,{checked:e.cloudSyncOn,onChange:e.handleCloudSyncToggle,ariaLabel:s("settings.account.cloudSync")})}):null}function pt({checked:e,disabled:t,onChange:i}){return n.jsx(b,{label:s("settings.account.publicProfile"),hint:s("settings.account.publicProfileHint"),control:n.jsx(j,{checked:e,onChange:i,disabled:t,ariaLabel:s("settings.account.publicProfile")})})}function mt({visible:e,name:t,github:i}){return n.jsx(le,{initial:!1,children:e?n.jsx(A.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.28,ease:[.22,1,.36,1]},opacity:{duration:.2,ease:[.22,1,.36,1]}},style:{overflow:"hidden"},className:"divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:n.jsx(ct,{name:t,github:i})},"public-profile-fields"):null})}function bt(){return[{value:"light",label:s("settings.appearance.theme.light"),Icon:de},{value:"dark",label:s("settings.appearance.theme.dark"),Icon:ge},{value:"system",label:s("settings.appearance.theme.system"),Icon:D}]}function ft(){return[{value:he,label:s("settings.appearance.language.system"),Icon:D},{value:pe,label:s("settings.appearance.language.english"),Icon:E},{value:me,label:s("settings.appearance.language.chinese"),Icon:E}]}function yt(e){if(!e)return null;try{const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}catch{return null}}function xt(e,t){const i=s(`settings.appearance.currency.rate_source.${e}`),a=yt(t),o=a?s("settings.appearance.currency.rate_updated",{when:a}):s("settings.appearance.currency.rate_never");return`${i} · ${o}`}function vt({currency:e,setCurrency:t}){const i=be();return n.jsxs("div",{className:"relative inline-flex",children:[n.jsx("select",{value:e,onChange:a=>t(a.target.value),"aria-label":s("settings.appearance.currency.label"),className:x("appearance-none rounded-lg border border-oai-gray-200 bg-white py-1.5 pl-3 pr-8 text-xs font-medium text-oai-black","transition-colors hover:bg-oai-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500","dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:bg-oai-gray-800"),children:i.map(a=>n.jsx("option",{value:a.code,children:s(a.labelKey)},a.code))}),n.jsx(Ne,{className:"pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]})}function kt({currency:e,rate:t,rateSource:i,rateFetchedAt:a}){if(e===fe)return n.jsx(n.Fragment,{children:s("settings.appearance.currency.hint")});const o=xt(i,a);return n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx("span",{children:`1 USD = ${t.toFixed(4)} ${e}`}),n.jsx("span",{role:"img","aria-label":o,title:o,className:"inline-flex h-4 w-4 cursor-help items-center justify-center text-oai-gray-400 hover:text-oai-gray-600 dark:text-oai-gray-500 dark:hover:text-oai-gray-300",children:n.jsx(Se,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function jt(){const{theme:e,setTheme:t}=ce(),{locale:i,setLocale:a}=ue(),{currency:o,rate:r,rateSource:c,rateFetchedAt:u,setCurrency:g}=je();return n.jsxs(k,{title:s("settings.section.appearance"),children:[n.jsx(b,{label:s("settings.appearance.theme.label"),hint:s("settings.appearance.theme.hint"),control:n.jsx(I,{options:bt(),value:e,onChange:t})}),n.jsx(b,{label:s("settings.appearance.language.label"),hint:s("settings.appearance.language.hint"),control:n.jsx(I,{options:ft(),value:i,onChange:a})}),n.jsx(b,{label:s("settings.appearance.currency.label"),hint:n.jsx(kt,{currency:o,rate:r,rateSource:c,rateFetchedAt:u}),control:n.jsx(vt,{currency:o,setCurrency:g})})]})}function Nt(){const{available:e,settings:t,setSetting:i,runAction:a}=_();if(!e)return null;const o=!!t?.launchAtLogin,r=t?.launchAtLoginSupported!==!1,c=t?.updateStatus||null,u=!!t?.updateBusy,g=!!t?.isSyncing;return n.jsxs(k,{title:s("settings.section.menubar"),children:[r?n.jsx(b,{label:s("settings.menubar.launchAtLogin"),hint:s("settings.menubar.launchAtLoginHint"),control:n.jsx(j,{checked:o,onChange:()=>i("launchAtLogin",!o),ariaLabel:s("settings.menubar.launchAtLogin")})}):null,n.jsx(b,{label:s("settings.menubar.syncNow"),hint:s("settings.menubar.syncNowHint"),control:n.jsxs("button",{type:"button",onClick:()=>a("syncNow"),disabled:g,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(ye,{className:x("h-3.5 w-3.5",g&&"animate-spin"),"aria-hidden":!0}),g?s("settings.menubar.syncing"):s("settings.menubar.syncNow")]})}),n.jsx(b,{label:s("settings.menubar.updates"),hint:c||void 0,control:n.jsxs("button",{type:"button",onClick:()=>a("checkForUpdates"),disabled:u,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(we,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.menubar.checkUpdates")]})})]})}function St(){const{available:e,settings:t,runAction:i}=_();return!e||!t?.version?null:n.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 text-[11px] text-oai-gray-500 dark:text-oai-gray-500",children:[n.jsxs("span",{children:["TokenTrackerBar v",t.version]}),n.jsx("span",{"aria-hidden":!0,children:"·"}),n.jsx("button",{type:"button",onClick:()=>i("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"})]})}function Dt(){const e=ve();return n.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:n.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:n.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[n.jsxs("div",{className:"mb-8",children:[n.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:s("settings.page.title")}),n.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.page.subtitle")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(jt,{}),n.jsx(Nt,{}),n.jsx(ut,{}),n.jsx(k,{title:s("settings.section.limits"),children:n.jsx(Be,{prefs:e})})]}),n.jsx(St,{})]})})})}export{Dt as SettingsPage};