tokentracker-cli 0.5.84 → 0.5.86
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.
- package/README.md +2 -0
- package/README.zh-CN.md +401 -0
- package/dashboard/dist/assets/{Card-D9qs5F6a.js → Card-D4LPt5pl.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-B-2PxAXT.js +12 -0
- package/dashboard/dist/assets/{FadeIn-58ii1scI.js → FadeIn-Bw7pQont.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-D_oSEAJv.js → IpCheckPage-BN6f0ZOs.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-y-xpxCOw.js → LeaderboardPage-DazS-BOp.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfilePage-D2Pg7C2E.js → LeaderboardProfilePage-DQMr9vjY.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-BGqjHAiJ.js → LimitsPage-BKaitxPe.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-DZe_sc0f.js → ProviderIcon-CTwz2lc9.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-CKqGPzGp.js → SettingsPage-CYpMYSR7.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-BKlifAwP.js → WidgetsPage-C-VjXvcB.js} +1 -1
- package/dashboard/dist/assets/{download-CIOju6TK.js → download-B8q-pUg6.js} +1 -1
- package/dashboard/dist/assets/{leaderboard-columns-C2HnsCRa.js → leaderboard-columns-BUl7-rVO.js} +1 -1
- package/dashboard/dist/assets/{main-v7jzPCYG.css → main-BP_tVIcC.css} +1 -1
- package/dashboard/dist/assets/{main-CT6BPeer.js → main-Ry0vayW2.js} +210 -189
- package/dashboard/dist/assets/{use-limits-display-prefs-BCGcgZmr.js → use-limits-display-prefs-mlXe4VuM.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-DosliezS.js → use-usage-limits-CxmDpqkS.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/dashboard/dist/assets/DashboardPage-D6rRASfb.js +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aa as s,D as n,ab as d}from"./main-
|
|
1
|
+
import{aa as s,D as n,ab as d}from"./main-Ry0vayW2.js";function v({children:i,delay:t=0,duration:o=.4,y:e=20,className:a="",once:r=!0}){return s()?n.jsx("div",{className:a,children:i}):n.jsx(d.div,{initial:{opacity:0,y:e},animate:{opacity:1,y:0},transition:{duration:o,delay:t,ease:[.25,.1,.25,1]},className:a,children:i})}function x({children:i,staggerDelay:t=.1,initialDelay:o=0,className:e=""}){return s()?n.jsx("div",{className:e,children:i}):n.jsx(d.div,{initial:"hidden",animate:"visible",variants:{hidden:{},visible:{transition:{staggerChildren:t,delayChildren:o}}},className:e,children:i})}function h({children:i,className:t="",y:o=20}){return s()?n.jsx("div",{className:t,children:i}):n.jsx(d.div,{variants:{hidden:{opacity:0,y:o},visible:{opacity:1,y:0,transition:{duration:.4,ease:[.25,.1,.25,1]}}},className:t,children:i})}export{v as F,x as S,h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,D as a}from"./main-
|
|
1
|
+
import{r as i,D as a}from"./main-Ry0vayW2.js";function o(){const[s,d]=i.useState(!1);return a.jsxs("div",{className:"h-full relative dark:bg-[#050505]",children:[!s&&a.jsxs("div",{className:"absolute inset-0 p-6 space-y-5 animate-pulse",children:[a.jsx("div",{className:"flex gap-4 justify-center",children:Array.from({length:6}).map((e,r)=>a.jsx("div",{className:"h-4 w-20 rounded bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsxs("div",{className:"space-y-2 pt-2",children:[a.jsx("div",{className:"h-7 w-72 rounded bg-oai-gray-200 dark:bg-oai-gray-800"}),a.jsx("div",{className:"h-4 w-96 rounded bg-oai-gray-200 dark:bg-oai-gray-800"})]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-24 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-40 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-32 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))})]}),a.jsx("iframe",{src:"https://ip.net.coffee/claude/",title:"Cloud AI IP Check",className:`w-full h-full dark:invert dark:hue-rotate-180 transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,style:{border:"none"},onLoad:()=>d(!0)})]})}export{o as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{r as i,ad as G,S as He,D as d,aA as _,aB as Vn,aC as qn,ah as Jn,ai as Qn,aD as Zn,h as er,j as tr,B as
|
|
1
|
+
import{r as i,ad as G,S as He,D as d,aA as _,aB as Vn,aC as qn,ah as Jn,ai as Qn,aD as Zn,h as er,j as tr,B as C,aE as nr,am as rr,ay as Dt,a9 as or,aF as ar,aG as sr,aH as Ht,aI as ir}from"./main-Ry0vayW2.js";import{P as lr}from"./ProviderIcon-CTwz2lc9.js";import{L as bn,a as pn,b as lt,l as Rt,c as Nt,d as cr,e as Kt}from"./leaderboard-columns-BUl7-rVO.js";function dr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const gt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _e(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Lt(e){return"nodeType"in e}function V(e){var t,n;return e?_e(e)?e:Lt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ot(e){const{Document:t}=V(e);return e instanceof t}function et(e){return _e(e)?!1:e instanceof V(e).HTMLElement}function mn(e){return e instanceof V(e).SVGElement}function Pe(e){return e?_e(e)?e.document:Lt(e)?Ot(e)?e:et(e)||mn(e)?e.ownerDocument:document:document:document}const he=gt?i.useLayoutEffect:i.useEffect;function _t(e){const t=i.useRef(e);return he(()=>{t.current=e}),i.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function ur(){const e=i.useRef(null),t=i.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=i.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function qe(e,t){t===void 0&&(t=[e]);const n=i.useRef(e);return he(()=>{n.current!==e&&(n.current=e)},t),n}function tt(e,t){const n=i.useRef();return i.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ct(e){const t=_t(e),n=i.useRef(null),r=i.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Et(e){const t=i.useRef();return i.useEffect(()=>{t.current=e},[e]),t.current}let yt={};function nt(e,t){return i.useMemo(()=>{if(t)return t;const n=yt[e]==null?0:yt[e]+1;return yt[e]=n,e+"-"+n},[e,t])}function xn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((a,s)=>{const l=Object.entries(s);for(const[c,u]of l){const g=a[c];g!=null&&(a[c]=g+e*u)}return a},{...t})}}const Le=xn(1),Je=xn(-1);function fr(e){return"clientX"in e&&"clientY"in e}function Pt(e){if(!e)return!1;const{KeyboardEvent:t}=V(e.target);return t&&e instanceof t}function gr(e){if(!e)return!1;const{TouchEvent:t}=V(e.target);return t&&e instanceof t}function jt(e){if(gr(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return fr(e)?{x:e.clientX,y:e.clientY}:null}const Qe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Qe.Translate.toString(e),Qe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Gt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hr(e){return e.matches(Gt)?e:e.querySelector(Gt)}const br={display:"none"};function pr(e){let{id:t,value:n}=e;return G.createElement("div",{id:t,style:br},n)}function mr(e){let{id:t,announcement:n,ariaLiveType:r="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 G.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function xr(){const[e,t]=i.useState("");return{announce:i.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const vn=i.createContext(null);function vr(e){const t=i.useContext(vn);i.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function yr(){const[e]=i.useState(()=>new Set),t=i.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[i.useCallback(r=>{let{type:o,event:a}=r;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const wr={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},kr={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Sr(e){let{announcements:t=kr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=wr}=e;const{announce:a,announcement:s}=xr(),l=nt("DndLiveRegion"),[c,u]=i.useState(!1);if(i.useEffect(()=>{u(!0)},[]),vr(i.useMemo(()=>({onDragStart(f){let{active:b}=f;a(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:h}=f;t.onDragMove&&a(t.onDragMove({active:b,over:h}))},onDragOver(f){let{active:b,over:h}=f;a(t.onDragOver({active:b,over:h}))},onDragEnd(f){let{active:b,over:h}=f;a(t.onDragEnd({active:b,over:h}))},onDragCancel(f){let{active:b,over:h}=f;a(t.onDragCancel({active:b,over:h}))}}),[a,t])),!c)return null;const g=G.createElement(G.Fragment,null,G.createElement(br,{id:r,value:o.draggable}),G.createElement(mr,{id:l,announcement:s}));return n?He.createPortal(g,n):g}var B;(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"})(B||(B={}));function dt(){}function Vt(e,t){return i.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Cr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const de=Object.freeze({x:0,y:0});function yn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function wn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Dr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function qt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function kn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Jt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Rr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Jt(t,t.left,t.top),a=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const u=yn(Jt(c),o);a.push({id:l,data:{droppableContainer:s,value:u}})}}return a.sort(wn)},Nr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=qt(t),a=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const u=qt(c),g=o.reduce((b,h,C)=>b+yn(u[C],h),0),f=Number((g/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:f}})}}return a.sort(wn)};function Er(e,t){const n=Math.max(t.top,e.top),r=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),s=o-r,l=a-n;if(r<o&&n<a){const c=t.width*t.height,u=e.width*e.height,g=s*l,f=g/(c+u-g);return Number(f.toFixed(4))}return 0}const jr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const a of r){const{id:s}=a,l=n.get(s);if(l){const c=Er(l,t);c>0&&o.push({id:s,data:{droppableContainer:a,value:c}})}}return o.sort(Dr)};function Ar(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Sn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:de}function Ir(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...n})}}const Mr=Ir(1);function Tr(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 Lr(e,t,n){const r=Tr(t);if(!r)return e;const{scaleX:o,scaleY:a,x:s,y:l}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=a?e.height/a:e.height;return{width:g,height:f,top:u,right:c+g,bottom:u+f,left:c}}const Or={ignoreTransform:!1};function Be(e,t){t===void 0&&(t=Or);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:g}=V(e).getComputedStyle(e);u&&(n=Lr(n,u,g))}const{top:r,left:o,width:a,height:s,bottom:l,right:c}=n;return{top:r,left:o,width:a,height:s,bottom:l,right:c}}function Qt(e){return Be(e,{ignoreTransform:!0})}function _r(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Pr(e,t){return t===void 0&&(t=V(e).getComputedStyle(e)),t.position==="fixed"}function Br(e,t){t===void 0&&(t=V(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?n.test(a):!1})}function ht(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Ot(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!et(o)||mn(o)||n.includes(o))return n;const a=V(e).getComputedStyle(o);return o!==e&&Br(o,a)&&n.push(o),Pr(o,a)?n:r(o.parentNode)}return e?r(e):n}function Cn(e){const[t]=ht(e,1);return t??null}function wt(e){return!gt||!e?null:_e(e)?e:Lt(e)?Ot(e)||e===Pe(e).scrollingElement?window:et(e)?e:null:null}function Dn(e){return _e(e)?e.scrollX:e.scrollLeft}function Rn(e){return _e(e)?e.scrollY:e.scrollTop}function At(e){return{x:Dn(e),y:Rn(e)}}var z;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(z||(z={}));function Nn(e){return!gt||!e?!1:e===document.scrollingElement}function En(e){const t={x:0,y:0},n=Nn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:r,minScroll:t}}const zr={x:.2,y:.2};function $r(e,t,n,r,o){let{top:a,left:s,right:l,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=zr);const{isTop:u,isBottom:g,isLeft:f,isRight:b}=En(e),h={x:0,y:0},C={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!u&&a<=t.top+m.height?(h.y=z.Backward,C.y=r*Math.abs((t.top+m.height-a)/m.height)):!g&&c>=t.bottom-m.height&&(h.y=z.Forward,C.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!b&&l>=t.right-m.width?(h.x=z.Forward,C.x=r*Math.abs((t.right-m.width-l)/m.width)):!f&&s<=t.left+m.width&&(h.x=z.Backward,C.x=r*Math.abs((t.left+m.width-s)/m.width)),{direction:h,speed:C}}function Fr(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function jn(e){return e.reduce((t,n)=>Le(t,At(n)),de)}function Ur(e){return e.reduce((t,n)=>t+Dn(n),0)}function Xr(e){return e.reduce((t,n)=>t+Rn(n),0)}function Yr(e,t){if(t===void 0&&(t=Be),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);Cn(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Wr=[["x",["left","right"],Ur],["y",["top","bottom"],Xr]];class Bt{constructor(t,n){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 r=ht(n),o=jn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of Wr)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=l(r),g=o[a]-u;return this.rect[c]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ke{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Hr(e){const{EventTarget:t}=V(e);return e instanceof t?e:Pe(e)}function kt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Zt(e){e.preventDefault()}function Kr(e){e.stopPropagation()}var N;(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"})(N||(N={}));const An={start:[N.Space,N.Enter],cancel:[N.Esc],end:[N.Space,N.Enter,N.Tab]},Gr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case N.Right:return{...n,x:n.x+25};case N.Left:return{...n,x:n.x-25};case N.Down:return{...n,y:n.y+25};case N.Up:return{...n,y:n.y-25}}};class zt{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:n}}=t;this.props=t,this.listeners=new Ke(Pe(n)),this.windowListeners=new Ke(V(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Yr(r),n(de)}handleKeyDown(t){if(Pt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:a=An,coordinateGetter:s=Gr,scrollBehavior:l="smooth"}=o,{code:c}=t;if(a.end.includes(c)){this.handleEnd(t);return}if(a.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,g=u?{x:u.left,y:u.top}:de;this.referenceCoordinates||(this.referenceCoordinates=g);const f=s(t,{active:n,context:r.current,currentCoordinates:g});if(f){const b=Je(f,g),h={x:0,y:0},{scrollableAncestors:C}=r.current;for(const m of C){const x=t.code,{isTop:w,isRight:S,isLeft:v,isBottom:D,maxScroll:E,minScroll:j}=En(m),k=Fr(m),y={x:Math.min(x===N.Right?k.right-k.width/2:k.right,Math.max(x===N.Right?k.left:k.left+k.width/2,f.x)),y:Math.min(x===N.Down?k.bottom-k.height/2:k.bottom,Math.max(x===N.Down?k.top:k.top+k.height/2,f.y))},L=x===N.Right&&!S||x===N.Left&&!v,O=x===N.Down&&!D||x===N.Up&&!w;if(L&&y.x!==f.x){const R=m.scrollLeft+b.x,X=x===N.Right&&R<=E.x||x===N.Left&&R>=j.x;if(X&&!b.y){m.scrollTo({left:R,behavior:l});return}X?h.x=m.scrollLeft-R:h.x=x===N.Right?m.scrollLeft-E.x:m.scrollLeft-j.x,h.x&&m.scrollBy({left:-h.x,behavior:l});break}else if(O&&y.y!==f.y){const R=m.scrollTop+b.y,X=x===N.Down&&R<=E.y||x===N.Up&&R>=j.y;if(X&&!b.x){m.scrollTo({top:R,behavior:l});return}X?h.y=m.scrollTop-R:h.y=x===N.Down?m.scrollTop-E.y:m.scrollTop-j.y,h.y&&m.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(t,Le(Je(f,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}zt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=An,onActivation:o}=t,{active:a}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function en(e){return!!(e&&"distance"in e)}function tn(e){return!!(e&&"delay"in e)}class $t{constructor(t,n,r){var o;r===void 0&&(r=Hr(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=n;const{event:a}=t,{target:s}=a;this.props=t,this.events=n,this.document=Pe(s),this.documentListeners=new Ke(this.document),this.listeners=new Ke(r),this.windowListeners=new Ke(V(s)),this.initialCoordinates=(o=jt(a))!=null?o:de,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:n,bypassActivationConstraint:r}}}=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(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Zt),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Zt),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(en(n)){this.handlePending(n);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,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(se.Click,Kr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const c=(n=jt(t))!=null?n:de,u=Je(o,c);if(!r&&l){if(en(l)){if(l.tolerance!=null&&kt(u,l.tolerance))return this.handleCancel();if(kt(u,l.distance))return this.handleStart()}if(tn(l)&&kt(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===N.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Vr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ft extends $t{constructor(t){const{event:n}=t,r=Pe(n.target);super(t,Vr,r)}}Ft.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const qr={move:{name:"mousemove"},end:{name:"mouseup"}};var It;(function(e){e[e.RightClick=2]="RightClick"})(It||(It={}));class Jr extends $t{constructor(t){super(t,qr,Pe(t.event.target))}}Jr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===It.RightClick?!1:(r?.({event:n}),!0)}}];const St={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qr extends $t{constructor(t){super(t,St)}static setup(){return window.addEventListener(St.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(St.move.name,t)};function t(){}}}Qr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Ge;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ge||(Ge={}));var ut;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ut||(ut={}));function Zr(e){let{acceleration:t,activator:n=Ge.Pointer,canScroll:r,draggingRect:o,enabled:a,interval:s=5,order:l=ut.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:g,delta:f,threshold:b}=e;const h=to({delta:f,disabled:!a}),[C,m]=ur(),x=i.useRef({x:0,y:0}),w=i.useRef({x:0,y:0}),S=i.useMemo(()=>{switch(n){case Ge.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ge.DraggableRect:return o}},[n,o,c]),v=i.useRef(null),D=i.useCallback(()=>{const j=v.current;if(!j)return;const k=x.current.x*w.current.x,y=x.current.y*w.current.y;j.scrollBy(k,y)},[]),E=i.useMemo(()=>l===ut.TreeOrder?[...u].reverse():u,[l,u]);i.useEffect(()=>{if(!a||!u.length||!S){m();return}for(const j of E){if(r?.(j)===!1)continue;const k=u.indexOf(j),y=g[k];if(!y)continue;const{direction:L,speed:O}=$r(j,y,S,t,b);for(const R of["x","y"])h[R][L[R]]||(O[R]=0,L[R]=0);if(O.x>0||O.y>0){m(),v.current=j,C(D,s),x.current=O,w.current=L;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,D,r,m,a,s,JSON.stringify(S),JSON.stringify(h),C,u,E,g,JSON.stringify(b)])}const eo={x:{[z.Backward]:!1,[z.Forward]:!1},y:{[z.Backward]:!1,[z.Forward]:!1}};function to(e){let{delta:t,disabled:n}=e;const r=Et(t);return tt(o=>{if(n||!r||!o)return eo;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[z.Backward]:o.x[z.Backward]||a.x===-1,[z.Forward]:o.x[z.Forward]||a.x===1},y:{[z.Backward]:o.y[z.Backward]||a.y===-1,[z.Forward]:o.y[z.Forward]||a.y===1}}},[n,t,r])}function no(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return tt(o=>{var a;return t==null?null:(a=r??o)!=null?a:null},[r,t])}function ro(e,t){return i.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...a]},[]),[e,t])}var Ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ze||(Ze={}));var Mt;(function(e){e.Optimized="optimized"})(Mt||(Mt={}));const nn=new Map;function oo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[a,s]=i.useState(null),{frequency:l,measure:c,strategy:u}=o,g=i.useRef(e),f=x(),b=qe(f),h=i.useCallback(function(w){w===void 0&&(w=[]),!b.current&&s(S=>S===null?w:S.concat(w.filter(v=>!S.includes(v))))},[b]),C=i.useRef(null),m=tt(w=>{if(f&&!n)return nn;if(!w||w===nn||g.current!==e||a!=null){const S=new Map;for(let v of e){if(!v)continue;if(a&&a.length>0&&!a.includes(v.id)&&v.rect.current){S.set(v.id,v.rect.current);continue}const D=v.node.current,E=D?new Bt(c(D),D):null;v.rect.current=E,E&&S.set(v.id,E)}return S}return w},[e,a,n,f,c]);return i.useEffect(()=>{g.current=e},[e]),i.useEffect(()=>{f||h()},[n,f]),i.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),i.useEffect(()=>{f||typeof l!="number"||C.current!==null||(C.current=setTimeout(()=>{h(),C.current=null},l))},[l,f,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:a!=null};function x(){switch(u){case Ze.Always:return!1;case Ze.BeforeDragging:return n;default:return!n}}}function In(e,t){return tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ao(e,t){return In(e,t)}function so(e){let{callback:t,disabled:n}=e;const r=_t(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return i.useEffect(()=>()=>o?.disconnect(),[o]),o}function pt(e){let{callback:t,disabled:n}=e;const r=_t(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return i.useEffect(()=>()=>o?.disconnect(),[o]),o}function io(e){return new Bt(Be(e),e)}function rn(e,t,n){t===void 0&&(t=io);const[r,o]=i.useState(null);function a(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const g=t(e);return JSON.stringify(c)===JSON.stringify(g)?c:g})}const s=so({callback(c){if(e)for(const u of c){const{type:g,target:f}=u;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),l=pt({callback:a});return he(()=>{a(),e?(l?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),s?.disconnect())},[e]),r}function lo(e){const t=In(e);return Sn(e,t)}const on=[];function co(e){const t=i.useRef(e),n=tt(r=>e?r&&r!==on&&e&&t.current&&e.parentNode===t.current.parentNode?r:ht(e):on,[e]);return i.useEffect(()=>{t.current=e},[e]),n}function uo(e){const[t,n]=i.useState(null),r=i.useRef(e),o=i.useCallback(a=>{const s=wt(a.target);s&&n(l=>l?(l.set(s,At(s)),new Map(l)):null)},[]);return i.useEffect(()=>{const a=r.current;if(e!==a){s(a);const l=e.map(c=>{const u=wt(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,At(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(c=>{const u=wt(c);u?.removeEventListener("scroll",o)})}},[o,e]),i.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Le(a,s),de):jn(e):de,[e,t])}function an(e,t){t===void 0&&(t=[]);const n=i.useRef(null);return i.useEffect(()=>{n.current=null},t),i.useEffect(()=>{const r=e!==de;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Je(e,n.current):de}function fo(e){i.useEffect(()=>{if(!gt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function go(e,t){return i.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:a}=r;return n[o]=s=>{a(s,t)},n},{}),[e,t])}function Mn(e){return i.useMemo(()=>e?_r(e):null,[e])}const sn=[];function ho(e,t){t===void 0&&(t=Be);const[n]=e,r=Mn(n?V(n):null),[o,a]=i.useState(sn);function s(){a(()=>e.length?e.map(c=>Nn(c)?r:new Bt(t(c),c)):sn)}const l=pt({callback:s});return he(()=>{l?.disconnect(),s(),e.forEach(c=>l?.observe(c))},[e]),o}function po(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return et(t)?t:e}function bo(e){let{measure:t}=e;const[n,r]=i.useState(null),o=i.useCallback(u=>{for(const{target:g}of u)if(et(g)){r(f=>{const b=t(g);return f?{...f,width:b.width,height:b.height}:b});break}},[t]),a=pt({callback:o}),s=i.useCallback(u=>{const g=po(u);a?.disconnect(),g&&a?.observe(g),r(g?t(g):null)},[t,a]),[l,c]=ct(s);return i.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const mo=[{sensor:Ft,options:{}},{sensor:zt,options:{}}],xo={current:{}},it={draggable:{measure:Qt},droppable:{measure:Qt,strategy:Ze.WhileDragging,frequency:Mt.Optimized},dragOverlay:{measure:Be}};class Ve extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const vo={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ve,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:dt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:it,measureDroppableContainers:dt,windowRect:null,measuringScheduled:!1},yo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:dt,draggableNodes:new Map,over:null,measureDroppableContainers:dt},bt=i.createContext(yo),Tn=i.createContext(vo);function wo(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ve}}}function ko(e,t){switch(t.type){case B.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case B.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 B.DragEnd:case B.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case B.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ve(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case B.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const s=new Ve(e.droppable.containers);return s.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case B.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Ve(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function So(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=i.useContext(bt),a=Et(r),s=Et(n?.id);return i.useEffect(()=>{if(!t&&!r&&a&&s!=null){if(!Pt(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const g of[c.current,u.current]){if(!g)continue;const f=hr(g);if(f){f.focus();break}}})}},[r,t,o,s,a]),null}function Co(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...r}),n):n}function Do(e){return i.useMemo(()=>({draggable:{...it.draggable,...e?.draggable},droppable:{...it.droppable,...e?.droppable},dragOverlay:{...it.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ro(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const a=i.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;he(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const g=n(u),f=Sn(g,r);if(s||(f.x=0),l||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=Cn(u);b&&b.scrollBy({top:f.y,left:f.x})}},[t,s,l,r,n])}const Ln=i.createContext({...de,scaleX:1,scaleY:1});var Ee;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ee||(Ee={}));const No=i.memo(function(t){var n,r,o,a;let{id:s,accessibility:l,autoScroll:c=!0,children:u,sensors:g=mo,collisionDetection:f=jr,measuring:b,modifiers:h,...C}=t;const m=i.useReducer(ko,void 0,wo),[x,w]=m,[S,v]=yr(),[D,E]=i.useState(Ee.Uninitialized),j=D===Ee.Initialized,{draggable:{active:k,nodes:y,translate:L},droppable:{containers:O}}=x,R=k!=null?y.get(k):null,X=i.useRef({initial:null,translated:null}),q=i.useMemo(()=>{var U;return k!=null?{id:k,data:(U=R?.data)!=null?U:xo,rect:X}:null},[k,R]),ne=i.useRef(null),[xe,je]=i.useState(null),[T,Me]=i.useState(null),ie=qe(C,Object.values(C)),ve=nt("DndDescribedBy",s),H=i.useMemo(()=>O.getEnabled(),[O]),P=Do(b),{droppableRects:$,measureDroppableContainers:pe,measuringScheduled:ye}=oo(H,{dragging:j,dependencies:[L.x,L.y],config:P.droppable}),Y=no(y,k),Ae=i.useMemo(()=>T?jt(T):null,[T]),le=Gn(),J=ao(Y,P.draggable.measure);Ro({activeNode:k!=null?y.get(k):null,config:le.layoutShiftCompensation,initialRect:J,measure:P.draggable.measure});const A=rn(Y,P.draggable.measure,J),we=rn(Y?Y.parentElement:null),Q=i.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),be=O.getNodeFor((n=Q.current.over)==null?void 0:n.id),re=bo({measure:P.dragOverlay.measure}),ue=(r=re.nodeRef.current)!=null?r:Y,ke=j?(o=re.rect)!=null?o:A:null,ze=!!(re.nodeRef.current&&re.rect),$e=lo(ze?null:A),Fe=Mn(ue?V(ue):null),K=co(j?be??Y:null),Se=ho(K),p=Co(h,{transform:{x:L.x-$e.x,y:L.y-$e.y,scaleX:1,scaleY:1},activatorEvent:T,active:q,activeNodeRect:A,containerNodeRect:we,draggingNodeRect:ke,over:Q.current.over,overlayNodeRect:re.rect,scrollableAncestors:K,scrollableAncestorRects:Se,windowRect:Fe}),M=Ae?Le(Ae,L):null,oe=uo(K),rt=an(oe),mt=an(oe,[A]),W=Le(p,rt),Ie=ke?Mr(ke,p):null,Ue=q&&Ie?f({active:q,collisionRect:Ie,droppableRects:$,droppableContainers:H,pointerCoordinates:M}):null,Ut=kn(Ue,"id"),[Ce,Xt]=i.useState(null),Xn=ze?p:Le(p,mt),Yn=Ar(Xn,(a=Ce?.rect)!=null?a:null,A),xt=i.useRef(null),Yt=i.useCallback((U,Z)=>{let{sensor:ee,options:De}=Z;if(ne.current==null)return;const ae=y.get(ne.current);if(!ae)return;const te=U.nativeEvent,fe=new ee({active:ne.current,activeNode:ae,event:te,options:De,context:Q,onAbort(F){if(!y.get(F))return;const{onDragAbort:ge}=ie.current,me={id:F};ge?.(me),S({type:"onDragAbort",event:me})},onPending(F,Re,ge,me){if(!y.get(F))return;const{onDragPending:Ye}=ie.current,Ne={id:F,constraint:Re,initialCoordinates:ge,offset:me};Ye?.(Ne),S({type:"onDragPending",event:Ne})},onStart(F){const Re=ne.current;if(Re==null)return;const ge=y.get(Re);if(!ge)return;const{onDragStart:me}=ie.current,Xe={activatorEvent:te,active:{id:Re,data:ge.data,rect:X}};He.unstable_batchedUpdates(()=>{me?.(Xe),E(Ee.Initializing),w({type:B.DragStart,initialCoordinates:F,active:Re}),S({type:"onDragStart",event:Xe}),je(xt.current),Me(te)})},onMove(F){w({type:B.DragMove,coordinates:F})},onEnd:Te(B.DragEnd),onCancel:Te(B.DragCancel)});xt.current=fe;function Te(F){return async function(){const{active:ge,collisions:me,over:Xe,scrollAdjustedTranslate:Ye}=Q.current;let Ne=null;if(ge&&Ye){const{cancelDrop:We}=ie.current;Ne={activatorEvent:te,active:ge,collisions:me,delta:Ye,over:Xe},F===B.DragEnd&&typeof We=="function"&&await Promise.resolve(We(Ne))&&(F=B.DragCancel)}ne.current=null,He.unstable_batchedUpdates(()=>{w({type:F}),E(Ee.Uninitialized),Xt(null),je(null),Me(null),xt.current=null;const We=F===B.DragEnd?"onDragEnd":"onDragCancel";if(Ne){const vt=ie.current[We];vt?.(Ne),S({type:We,event:Ne})}})}}},[y]),Wn=i.useCallback((U,Z)=>(ee,De)=>{const ae=ee.nativeEvent,te=y.get(De);if(ne.current!==null||!te||ae.dndKit||ae.defaultPrevented)return;const fe={active:te};U(ee,Z.options,fe)===!0&&(ae.dndKit={capturedBy:Z.sensor},ne.current=De,Yt(ee,Z))},[y,Yt]),Wt=ro(g,Wn);fo(g),he(()=>{A&&D===Ee.Initializing&&E(Ee.Initialized)},[A,D]),i.useEffect(()=>{const{onDragMove:U}=ie.current,{active:Z,activatorEvent:ee,collisions:De,over:ae}=Q.current;if(!Z||!ee)return;const te={active:Z,activatorEvent:ee,collisions:De,delta:{x:W.x,y:W.y},over:ae};He.unstable_batchedUpdates(()=>{U?.(te),S({type:"onDragMove",event:te})})},[W.x,W.y]),i.useEffect(()=>{const{active:U,activatorEvent:Z,collisions:ee,droppableContainers:De,scrollAdjustedTranslate:ae}=Q.current;if(!U||ne.current==null||!Z||!ae)return;const{onDragOver:te}=ie.current,fe=De.get(Ut),Te=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,F={active:U,activatorEvent:Z,collisions:ee,delta:{x:ae.x,y:ae.y},over:Te};He.unstable_batchedUpdates(()=>{Xt(Te),te?.(F),S({type:"onDragOver",event:F})})},[Ut]),he(()=>{Q.current={activatorEvent:T,active:q,activeNode:Y,collisionRect:Ie,collisions:Ue,droppableRects:$,draggableNodes:y,draggingNode:ue,draggingNodeRect:ke,droppableContainers:O,over:Ce,scrollableAncestors:K,scrollAdjustedTranslate:W},X.current={initial:ke,translated:Ie}},[q,Y,Ue,Ie,y,ue,ke,$,O,Ce,K,W]),Zr({...le,delta:L,draggingRect:Ie,pointerCoordinates:M,scrollableAncestors:K,scrollableAncestorRects:Se});const Hn=i.useMemo(()=>({active:q,activeNode:Y,activeNodeRect:A,activatorEvent:T,collisions:Ue,containerNodeRect:we,dragOverlay:re,draggableNodes:y,droppableContainers:O,droppableRects:$,over:Ce,measureDroppableContainers:pe,scrollableAncestors:K,scrollableAncestorRects:Se,measuringConfiguration:P,measuringScheduled:ye,windowRect:Fe}),[q,Y,A,T,Ue,we,re,y,O,$,Ce,pe,K,Se,P,ye,Fe]),Kn=i.useMemo(()=>({activatorEvent:T,activators:Wt,active:q,activeNodeRect:A,ariaDescribedById:{draggable:ve},dispatch:w,draggableNodes:y,over:Ce,measureDroppableContainers:pe}),[T,Wt,q,A,w,ve,y,Ce,pe]);return G.createElement(vn.Provider,{value:v},G.createElement(bt.Provider,{value:Kn},G.createElement(Tn.Provider,{value:Hn},G.createElement(Ln.Provider,{value:Yn},u)),G.createElement(So,{disabled:l?.restoreFocus===!1})),G.createElement(Sr,{...l,hiddenTextDescribedById:ve}));function Gn(){const U=xe?.autoScrollEnabled===!1,Z=typeof c=="object"?c.enabled===!1:c===!1,ee=j&&!U&&!Z;return typeof c=="object"?{...c,enabled:ee}:{enabled:ee}}}),Eo=i.createContext(null),ln="button",jo="Draggable";function Ao(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const a=nt(jo),{activators:s,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:g,draggableNodes:f,over:b}=i.useContext(bt),{role:h=ln,roleDescription:C="draggable",tabIndex:m=0}=o??{},x=c?.id===t,w=i.useContext(x?Ln:Eo),[S,v]=ct(),[D,E]=ct(),j=go(s,t),k=qe(n);he(()=>(f.set(t,{id:t,key:a,node:S,activatorNode:D,data:k}),()=>{const L=f.get(t);L&&L.key===a&&f.delete(t)}),[f,t]);const y=i.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&h===ln?!0:void 0,"aria-roledescription":C,"aria-describedby":g.draggable}),[r,h,m,x,C,g.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:y,isDragging:x,listeners:r?void 0:j,node:S,over:b,setNodeRef:v,setActivatorNodeRef:E,transform:w}}function Io(){return i.useContext(Tn)}const Mo="Droppable",To={timeout:25};function Lo(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const a=nt(Mo),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=i.useContext(bt),g=i.useRef({disabled:n}),f=i.useRef(!1),b=i.useRef(null),h=i.useRef(null),{disabled:C,updateMeasurementsFor:m,timeout:x}={...To,...o},w=qe(m??r),S=i.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),h.current=null},x)},[x]),v=pt({callback:S,disabled:C||!s}),D=i.useCallback((y,L)=>{v&&(L&&(v.unobserve(L),f.current=!1),y&&v.observe(y))},[v]),[E,j]=ct(D),k=qe(t);return i.useEffect(()=>{!v||!E.current||(v.disconnect(),f.current=!1,v.observe(E.current))},[E,v]),i.useEffect(()=>(l({type:B.RegisterDroppable,element:{id:r,key:a,disabled:n,node:E,rect:b,data:k}}),()=>l({type:B.UnregisterDroppable,key:a,id:r})),[r]),i.useEffect(()=>{n!==g.current.disabled&&(l({type:B.SetDroppableDisabled,id:r,key:a,disabled:n}),g.current.disabled=n)},[r,a,n,l]),{active:s,rect:b,isOver:c?.id===r,node:E,over:c,setNodeRef:j}}const Oo=e=>{let{transform:t}=e;return{...t,y:0}};function On(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function _o(e,t){return e.reduce((n,r,o)=>{const a=t.get(r);return a&&(n[o]=a),n},Array(e.length))}function ot(e){return e!==null&&e>=0}function Po(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Bo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const at={scaleX:1,scaleY:1},zo=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:a,index:s}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const c=$o(n,s,o);if(s===o){const u=n[a];return u?{x:o<a?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...at}:null}return s>o&&s<=a?{x:-l.width-c,y:0,...at}:s<o&&s>=a?{x:l.width+c,y:0,...at}:{x:0,y:0,...at}};function $o(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];return!r||!o&&!a?0:n<t?o?r.left-(o.left+o.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(o.left+o.width)}const _n=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=On(t,r,n),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},Pn="Sortable",Bn=G.createContext({activeIndex:-1,containerId:Pn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_n,disabled:{draggable:!1,droppable:!1}});function Fo(e){let{children:t,id:n,items:r,strategy:o=_n,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:g}=Io(),f=nt(Pn,n),b=l.rect!==null,h=i.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),C=s!=null,m=s?h.indexOf(s.id):-1,x=u?h.indexOf(u.id):-1,w=i.useRef(h),S=!Po(h,w.current),v=x!==-1&&m===-1||S,D=Bo(a);he(()=>{S&&C&&g(h)},[S,h,C,g]),i.useEffect(()=>{w.current=h},[h]);const E=i.useMemo(()=>({activeIndex:m,containerId:f,disabled:D,disableTransforms:v,items:h,overIndex:x,useDragOverlay:b,sortedRects:_o(h,c),strategy:o}),[m,f,D.draggable,D.droppable,v,h,x,c,b,o]);return G.createElement(Bn.Provider,{value:E},t)}const Uo=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return On(n,r,o).indexOf(t)},Xo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==a&&o===s?!1:n?!0:s!==o&&t===c},Yo={duration:200,easing:"ease"},zn="transform",Wo=Qe.Transition.toString({property:zn,duration:0,easing:"linear"}),Ho={roleDescription:"sortable"};function Ko(e){let{disabled:t,index:n,node:r,rect:o}=e;const[a,s]=i.useState(null),l=i.useRef(n);return he(()=>{if(!t&&n!==l.current&&r.current){const c=o.current;if(c){const u=Be(r.current,{ignoreTransform:!0}),g={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(g.x||g.y)&&s(g)}}n!==l.current&&(l.current=n)},[t,n,r,o]),i.useEffect(()=>{a&&s(null)},[a]),a}function Go(e){let{animateLayoutChanges:t=Xo,attributes:n,disabled:r,data:o,getNewIndex:a=Uo,id:s,strategy:l,resizeObserverConfig:c,transition:u=Yo}=e;const{items:g,containerId:f,activeIndex:b,disabled:h,disableTransforms:C,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:S}=i.useContext(Bn),v=Vo(r,h),D=g.indexOf(s),E=i.useMemo(()=>({sortable:{containerId:f,index:D,items:g},...o}),[f,o,D,g]),j=i.useMemo(()=>g.slice(g.indexOf(s)),[g,s]),{rect:k,node:y,isOver:L,setNodeRef:O}=Lo({id:s,data:E,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...c}}),{active:R,activatorEvent:X,activeNodeRect:q,attributes:ne,setNodeRef:xe,listeners:je,isDragging:T,over:Me,setActivatorNodeRef:ie,transform:ve}=Ao({id:s,data:E,attributes:{...Ho,...n},disabled:v.draggable}),H=dr(O,xe),P=!!R,$=P&&!C&&ot(b)&&ot(x),pe=!w&&T,ye=pe&&$?ve:null,Ae=$?ye??(l??S)({rects:m,activeNodeRect:q,activeIndex:b,overIndex:x,index:D}):null,le=ot(b)&&ot(x)?a({id:s,items:g,activeIndex:b,overIndex:x}):D,J=R?.id,A=i.useRef({activeId:J,items:g,newIndex:le,containerId:f}),we=g!==A.current.items,Q=t({active:R,containerId:f,isDragging:T,isSorting:P,id:s,index:D,items:g,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),be=Ko({disabled:!Q,index:D,node:y,rect:k});return i.useEffect(()=>{P&&A.current.newIndex!==le&&(A.current.newIndex=le),f!==A.current.containerId&&(A.current.containerId=f),g!==A.current.items&&(A.current.items=g)},[P,le,f,g]),i.useEffect(()=>{if(J===A.current.activeId)return;if(J&&!A.current.activeId){A.current.activeId=J;return}const ue=setTimeout(()=>{A.current.activeId=J},50);return()=>clearTimeout(ue)},[J]),{active:R,activeIndex:b,attributes:ne,data:E,rect:k,index:D,newIndex:le,items:g,isOver:L,isSorting:P,isDragging:T,listeners:je,node:y,overIndex:x,over:Me,setNodeRef:H,setActivatorNodeRef:ie,setDroppableNodeRef:O,setDraggableNodeRef:xe,transform:be??Ae,transition:re()};function re(){if(be||we&&A.current.newIndex===D)return Wo;if(!(pe&&!Pt(X)||!u)&&(P||Q))return Qe.Transition.toString({...u,property:zn})}}function Vo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function ft(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 qo=[N.Down,N.Right,N.Up,N.Left],Jo=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(qo.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const b=o.get(f.id);if(b)switch(e.code){case N.Down:r.top<b.top&&c.push(f);break;case N.Up:r.top>b.top&&c.push(f);break;case N.Left:r.left>b.left&&c.push(f);break;case N.Right:r.left<b.left&&c.push(f);break}});const u=Nr({collisionRect:r,droppableRects:o,droppableContainers:c});let g=kn(u,"id");if(g===s?.id&&u.length>1&&(g=u[1].id),g!=null){const f=a.get(n.id),b=a.get(g),h=b?o.get(b.id):null,C=b?.node.current;if(C&&h&&f&&b){const x=ht(C).some((j,k)=>l[k]!==j),w=$n(f,b),S=Qo(f,b),v=x||!w?{x:0,y:0}:{x:S?r.width-h.width:0,y:S?r.height-h.height:0},D={x:h.left,y:h.top};return v.x&&v.y?D:Je(D,v)}}}};function $n(e,t){return!ft(e)||!ft(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Qo(e,t){return!ft(e)||!ft(t)||!$n(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Oe(e,{min:t,max:n,fallback:r}){const o=Number(e);if(!Number.isFinite(o))return r;const a=Math.floor(o);return a<t?t:a>n?n:a}function Zo(e,t){const n=Oe(t,{min:0,max:1e6,fallback:0}),r=Oe(e,{min:1,max:Math.max(1,n||1),fallback:1});if(n<=1)return[1];const o=new Set([1,n,r-2,r-1,r,r+1,r+2]),a=Array.from(o).filter(c=>Number.isInteger(c)&&c>=1&&c<=n).sort((c,u)=>c-u),s=[];let l=null;for(const c of a)l!=null&&c-l>1&&s.push(null),s.push(c),l=c;return s}function ea({page:e,totalPages:t}){const n=typeof t=="number"&&Number.isFinite(t)&&t>=0,r=n?Oe(t,{min:0,max:1e6,fallback:0}):null,o=Oe(e,{min:1,max:n?Math.max(1,r||1):1e6,fallback:1}),a=o>1,s=n?o<r:!0;return{canPrev:a,canNext:s,safePage:o,safeTotal:r}}function ta({entries:e,me:t,meLabel:n,limit:r}){const o=Oe(r,{min:1,max:1e3,fallback:20}),a=Array.isArray(e)?e.slice(0,o):[],s=t&&typeof t.rank=="number"?t.rank:null,l=a.some(h=>!!h?.is_me);if(!s||l)return a;const c={rank:s,is_me:!0,display_name:n,avatar_url:null,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"},u=3,g=4,b=a.filter(h=>!h?.is_me).filter((h,C)=>C!==u).slice();return b.splice(Math.min(g,b.length),0,c),b.slice(0,o)}function ce({className:e}){return d.jsx("div",{className:_("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",e)})}function na({index:e}){const t=e<3?"w-24":e<8?"w-20":"w-16",n=e<3?"w-16":"w-12",r=e<5?"w-14":"w-10";return d.jsxs("tr",{className:"group",children:[d.jsx("td",{className:_(Rt(!1),"!group-hover:bg-transparent"),children:d.jsx(ce,{className:"h-4 w-6"})}),d.jsx("td",{className:_(Nt(!1),"!group-hover:bg-transparent"),children:d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx(ce,{className:"h-8 w-8 min-w-8 rounded-full"}),d.jsx(ce,{className:_("h-4",t)})]})}),d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(ce,{className:_("h-4",n)})}),d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(ce,{className:"h-4 w-12"})}),lt.map(o=>d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(ce,{className:_("h-4",r)})},o.key))]})}function ra({rows:e=10}){return d.jsx("div",{className:"w-full overflow-x-auto",children:d.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[d.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:d.jsxs("tr",{children:[d.jsx("th",{className:_(pn,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(ce,{className:"h-3.5 w-6"})}),d.jsx("th",{className:_(bn,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(ce,{className:"h-3.5 w-12"})}),d.jsx("th",{className:"px-4 py-4",children:d.jsx(ce,{className:"h-3.5 w-10"})}),d.jsx("th",{className:"px-4 py-4",children:d.jsx(ce,{className:"h-3.5 w-14"})}),lt.map(t=>d.jsx("th",{className:"px-4 py-4",children:d.jsx(ce,{className:"h-3.5 w-12"})},t.key))]})}),d.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Array.from({length:e},(t,n)=>d.jsx(na,{index:n},n))})]})})}function oa({id:e,thClassName:t,children:n}){const{attributes:r,listeners:o,setNodeRef:a,transform:s,transition:l,isDragging:c}=Go({id:e}),u=Qe.Transform.toString(s)||"";i.useLayoutEffect(()=>{const f=document.querySelectorAll(`td[data-column-key="${e}"]`),b="0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)";return f.forEach(h=>{h.style.transform=u,h.style.transition=l||"",h.style.zIndex=c?"20":"",h.style.position=u?"relative":"",h.style.boxShadow=c?b:""}),()=>{f.forEach(h=>{h.style.transform="",h.style.transition="",h.style.zIndex="",h.style.position="",h.style.boxShadow=""})}},[e,u,l,c]);const g={transform:u,transition:l,position:u?"relative":void 0,zIndex:c?20:void 0,boxShadow:c?"0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)":void 0};return d.jsx("th",{ref:a,style:g,className:_(t,"group/col select-none cursor-grab active:cursor-grabbing touch-none"),...r,...o,children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx("span",{"aria-hidden":"true",className:_("-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",c&&"opacity-100"),children:d.jsxs("svg",{viewBox:"0 0 8 14",width:"8",height:"14",fill:"currentColor","aria-hidden":"true",children:[d.jsx("circle",{cx:"2",cy:"2",r:"1"}),d.jsx("circle",{cx:"6",cy:"2",r:"1"}),d.jsx("circle",{cx:"2",cy:"7",r:"1"}),d.jsx("circle",{cx:"6",cy:"7",r:"1"}),d.jsx("circle",{cx:"2",cy:"12",r:"1"}),d.jsx("circle",{cx:"6",cy:"12",r:"1"})]})}),n]})})}const Fn="tokentracker.leaderboard.columnOrder.v1";function aa(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Fn);if(!e)return null;const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):null}catch{return null}}function Ct(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Fn,JSON.stringify(e))}catch{}}function cn(e,t){if(!e)return t;const n=new Set(t),r=e.filter(a=>n.has(a)),o=t.filter(a=>!r.includes(a));return[...r,...o]}function sa(e){const t=i.useMemo(()=>e.join("|"),[e]),[n,r]=i.useState(()=>cn(aa(),e));i.useEffect(()=>{r(s=>{const l=cn(s,e);return l.length===s.length&&l.every((u,g)=>u===s[g])?s:(Ct(l),l)})},[t,e]);const o=i.useCallback((s,l)=>{!s||!l||s===l||r(c=>{const u=c.indexOf(s),g=c.indexOf(l);if(u===-1||g===-1)return c;const f=c.slice(),[b]=f.splice(u,1);return f.splice(g,0,b),Ct(f),f})},[]),a=i.useCallback(()=>{Ct(e),r(e)},[e]);return{order:n,reorder:o,reset:a}}const st=20;function dn(e){const t=Number(e);return!Number.isFinite(t)||t<=0?"-":t>=1e3?`$${Math.round(t).toLocaleString()}`:t>=10?`$${Math.round(t)}`:`$${t.toFixed(2)}`}function un(e,t,n){const r=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 n.map(a=>d.jsx("td",{"data-column-key":a.key,className:_("px-4 py-4 whitespace-nowrap text-right tabular-nums",r,o),children:Dt(e?.[a.key])},a.key))}const ia={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 fn({rank:e,placeholder:t}){const n=ia[e];return n?d.jsx("span",{className:_("inline-flex items-center justify-center h-7 w-7 rounded-full text-xs font-bold",n.text,n.badge),children:e}):d.jsx("span",{className:"inline-flex items-center justify-center h-7 w-7 text-sm",children:e??t})}function Tt(e){if(typeof e!="string")return null;const t=e.trim().toLowerCase();return t==="week"||t==="month"||t==="total"?t:null}function la(e){if(!e)return I("shared.error.prefix",{error:I("leaderboard.error.unknown")});const t=e?.message||String(e),n=String(t||"").trim()||I("leaderboard.error.unknown");return I("shared.error.prefix",{error:n})}function Un(e){return typeof e!="string"?"":e.trim()}function ca(e){const t=Un(e);return t?t.toLowerCase()==="anonymous":!0}function da(e,t=""){if(typeof e!="string")return null;const n=e.trim().toLowerCase();if(!n)return null;const r=new URLSearchParams(typeof t=="string"?t:""),o=Tt(r.get("period")),a=o?`?period=${o}`:"";return`/share/pv1-${n}${a}`}function gn(e,t){const n=typeof e?.user_id=="string"?e.user_id.trim():"";return n||`${e?.rank??""}:${t}`}function hn({githubUrl:e}){return d.jsxs("span",{className:"relative inline-flex items-center group/gh shrink-0",children:[d.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>t.stopPropagation(),"aria-label":I("leaderboard.github.aria"),className:"text-oai-black hover:text-oai-gray-500 dark:text-white dark:hover:text-oai-gray-400 transition-colors",children:d.jsx(lr,{provider:"GITHUB",size:16})}),d.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] 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:[I("leaderboard.github.tooltipPrefix")," ",d.jsx(or,{to:"/settings",onClick:t=>t.stopPropagation(),className:"underline underline-offset-2 decoration-oai-gray-400 hover:text-oai-brand-300 hover:decoration-oai-brand-300",children:I("leaderboard.github.tooltipSettingsLink")})]})]})}function ha({auth:e,signedIn:t,sessionSoftExpired:n}){const r=Vn(),o=qn(),{openLoginModal:a}=Jn(),{signedIn:s,loading:l,user:c}=Qn(),u=i.useMemo(()=>Zn(),[]),g=er(),f=t&&!n,b=i.useMemo(()=>f&&(typeof e=="function"||typeof e=="string"||e&&typeof e=="object")?e:null,[e,f]),h=f?b:null,C=f&&tr(h),m=I("shared.placeholder.short"),x=i.useMemo(()=>lt.map(p=>p.key),[]),{order:w,reorder:S}=sa(x),v=i.useMemo(()=>{const p=new Map;for(const M of lt)p.set(M.key,M);return p},[]),D=i.useMemo(()=>w.map(p=>v.get(p)).filter(Boolean),[w,v]),E=Cr(Vt(Ft,{activationConstraint:{distance:6}}),Vt(zt,{coordinateGetter:Jo})),j=i.useCallback(p=>{const{active:M,over:oe}=p;!oe||M.id===oe.id||S(String(M.id),String(oe.id))},[S]),[k,y]=i.useState(1),[L,O]=i.useState(0),[R,X]=i.useState(()=>({loading:!1,error:null,data:null})),[q,ne]=i.useState(()=>nr()),[xe,je]=i.useState(!1),T=i.useMemo(()=>{const p=new URLSearchParams(r?.search||"");return Tt(p.get("period"))||"total"},[r?.search]),Me=r?.search||"",ie=p=>{const M=Tt(p);if(!M||M===T)return;const oe=new URLSearchParams(r?.search||"");oe.set("period",M),y(1),o(`${r?.pathname||"/leaderboard"}?${oe.toString()}`,{replace:!0})};i.useEffect(()=>{l||g||s||a()},[s,l,g,a]),i.useEffect(()=>{y(1)},[T]);const ve=i.useMemo(()=>(Oe(k,{min:1,max:1e6,fallback:1})-1)*st,[k]);i.useEffect(()=>{if(!u&&!g)return;let p=!0;return X(M=>({...M,loading:!0,error:null})),(async()=>{const M=await rr({userId:c?.id||null,period:T,limit:st,offset:ve});p&&X({loading:!1,error:null,data:M})})().catch(M=>{p&&X({loading:!1,error:la(M),data:null})}),()=>{p=!1}},[u,c?.id,ve,L,g,T]);const H=R.data,P=H?.total_pages??null,$=H?.page??k,pe=i.useMemo(()=>Zo($,P),[$,P]),ye=H?.from||null,Y=H?.to||null,Ae=H?.generated_at||null,le=H?.me||null,J=I("leaderboard.me_label"),A=I("leaderboard.anon_label"),we=I("leaderboard.period.week"),Q=I("leaderboard.period.month"),be=I("leaderboard.period.total"),re=T==="month"?Q:T==="total"?be:we,ue=i.useMemo(()=>{const p=Array.isArray(H?.entries)?H.entries:[];return $!==1?p:ta({entries:p,me:le,meLabel:J,limit:st})},[$,H?.entries,le,J]),ke=async()=>{je(!0);try{ar(!0),ne(!0),await sr(()=>Ht(h));const p=await Ht(h);p&&await ir({accessToken:p,period:T,source:"leaderboard-enable-sync"}),O(M=>M+1)}catch(p){console.warn("[tokentracker] sync:",p)}finally{je(!1)}},{canPrev:ze,canNext:$e}=ea({page:$,totalPages:P}),Fe=Array.isArray(ue)&&ue.length!==0;let K=null;R.loading?K=d.jsx(ra,{rows:st}):R.error?K=d.jsx("div",{className:"px-6 py-12 text-center",children:d.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:R.error})}):Fe?K=d.jsx(No,{sensors:E,collisionDetection:Rr,modifiers:[Oo],onDragEnd:j,children:d.jsx("div",{className:"w-full overflow-x-auto",children:d.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[d.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:d.jsxs("tr",{children:[d.jsx("th",{className:_(pn,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:I("leaderboard.column.rank")}),d.jsx("th",{className:_(bn,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:I("leaderboard.column.user")}),d.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:I("leaderboard.column.total")}),d.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:"Est. Cost"}),d.jsx(Fo,{items:w,strategy:zo,children:D.map(p=>d.jsx(oa,{id:p.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:d.jsx(cr,{iconSrc:p.icon,label:I(p.copyKey)})},p.key))})]})}),d.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:ue.map(p=>{const M=!!p?.is_me,oe=typeof p?.user_id=="string"?p.user_id:null,rt=Un(p?.display_name),mt=ca(rt)?A:rt,W=M?J:mt;return!!oe&&!M&&!!p?.is_public&&da(oe,Me),M?d.jsxs("tr",{className:"border-y border-oai-brand-300/40 dark:border-oai-brand-500/30 bg-oai-brand-50 dark:bg-oai-brand-900/10 transition-colors",children:[d.jsx("td",{className:_(Rt(!0),"font-semibold text-oai-brand-600 dark:text-oai-brand-400"),children:d.jsx(fn,{rank:p?.rank,placeholder:m})}),d.jsx("td",{className:Nt(!0),children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(Kt,{avatarUrl:p?.avatar_url,displayName:W,seed:gn(p,W)}),d.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:W}),p?.github_url&&d.jsx(hn,{githubUrl:p.github_url})]})}),d.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:Dt(p?.total_tokens)}),d.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:dn(p?.estimated_cost_usd)}),un(p,!0,D)]},`row-${p?.rank}-${W}`):d.jsxs("tr",{className:"group transition-colors",children:[d.jsx("td",{className:_(Rt(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(fn,{rank:p?.rank,placeholder:m})}),d.jsx("td",{className:Nt(!1),children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(Kt,{avatarUrl:p?.avatar_url,displayName:W,seed:gn(p,W)}),d.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:W}),p?.github_url&&d.jsx(hn,{githubUrl:p.github_url})]})}),d.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:Dt(p?.total_tokens)}),d.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:dn(p?.estimated_cost_usd)}),un(p,!1,D)]},`row-${p?.rank}-${W}`)})})]})})}):K=d.jsx("div",{className:"px-6 py-12 text-center",children:d.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:I("leaderboard.empty")})});let Se=null;return typeof P=="number"?Se=pe.map((p,M)=>p==null?d.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:I("leaderboard.pagination.ellipsis")},`ellipsis-${M}`):d.jsx("button",{className:_("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",p===$?"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:()=>y(p),disabled:R.loading,children:String(p)},`page-${p}`)):Se=d.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:I("leaderboard.pagination.page_unknown",{page:String($)})}),d.jsxs("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:[d.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:d.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[d.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-8",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:I("leaderboard.title")}),d.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[T==="total"?I("leaderboard.range.total"):ye&&Y?I("leaderboard.range",{period:re,from:ye,to:Y}):I("leaderboard.range_loading",{period:re}),Ae&&d.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:I("leaderboard.generated_at",{ts:Ae})})]})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("div",{className:"inline-flex p-1 border border-oai-gray-200 dark:border-oai-gray-800 rounded-lg",children:["week","month","total"].map(p=>d.jsx("button",{onClick:()=>ie(p),disabled:R.loading,className:_("px-4 py-1.5 text-sm font-medium rounded-md transition-colors",T===p?"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:text-oai-gray-800 dark:hover:text-oai-gray-200"),children:p==="week"?we:p==="month"?Q:be},p))})})]}),!t&&d.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[d.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:"Sign in to join the leaderboard"}),d.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:"Sign In"})]}),f&&C&&!q&&d.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[d.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:"Enable Cloud Sync to appear in rankings"}),d.jsx("button",{onClick:ke,disabled:xe,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:xe?"Syncing...":"Enable & Sync"})]}),d.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:[K,d.jsxs("div",{className:"px-6 py-3 border-t border-oai-gray-200 dark:border-oai-gray-800 flex flex-wrap items-center justify-between gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{className:_("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",ze&&!R.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:()=>y(p=>Math.max(1,p-1)),disabled:!ze||R.loading,children:I("leaderboard.pagination.prev")}),d.jsx("button",{className:_("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",$e&&!R.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:()=>y(p=>p+1),disabled:!$e||R.loading,children:I("leaderboard.pagination.next")})]}),d.jsx("div",{className:"flex flex-wrap items-center gap-1",children:Se})]})]})]})}),d.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:d.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:[d.jsx("p",{children:I("landing.v2.footer.line")}),d.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:I("landing.v2.nav.github")})]})})]})}export{ha as LeaderboardPage};
|
|
5
|
+
`},kr={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Sr(e){let{announcements:t=kr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=wr}=e;const{announce:a,announcement:s}=xr(),l=nt("DndLiveRegion"),[c,u]=i.useState(!1);if(i.useEffect(()=>{u(!0)},[]),vr(i.useMemo(()=>({onDragStart(f){let{active:p}=f;a(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;t.onDragMove&&a(t.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;a(t.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;a(t.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;a(t.onDragCancel({active:p,over:h}))}}),[a,t])),!c)return null;const g=G.createElement(G.Fragment,null,G.createElement(pr,{id:r,value:o.draggable}),G.createElement(mr,{id:l,announcement:s}));return n?He.createPortal(g,n):g}var B;(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"})(B||(B={}));function dt(){}function Vt(e,t){return i.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Cr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const de=Object.freeze({x:0,y:0});function yn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function wn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Dr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function qt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function kn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Jt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Rr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Jt(t,t.left,t.top),a=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const u=yn(Jt(c),o);a.push({id:l,data:{droppableContainer:s,value:u}})}}return a.sort(wn)},Nr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=qt(t),a=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const u=qt(c),g=o.reduce((p,h,D)=>p+yn(u[D],h),0),f=Number((g/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:f}})}}return a.sort(wn)};function Er(e,t){const n=Math.max(t.top,e.top),r=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),s=o-r,l=a-n;if(r<o&&n<a){const c=t.width*t.height,u=e.width*e.height,g=s*l,f=g/(c+u-g);return Number(f.toFixed(4))}return 0}const jr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const a of r){const{id:s}=a,l=n.get(s);if(l){const c=Er(l,t);c>0&&o.push({id:s,data:{droppableContainer:a,value:c}})}}return o.sort(Dr)};function Ar(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Sn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:de}function Mr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...n})}}const Ir=Mr(1);function Tr(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 Lr(e,t,n){const r=Tr(t);if(!r)return e;const{scaleX:o,scaleY:a,x:s,y:l}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=a?e.height/a:e.height;return{width:g,height:f,top:u,right:c+g,bottom:u+f,left:c}}const Or={ignoreTransform:!1};function Be(e,t){t===void 0&&(t=Or);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:g}=V(e).getComputedStyle(e);u&&(n=Lr(n,u,g))}const{top:r,left:o,width:a,height:s,bottom:l,right:c}=n;return{top:r,left:o,width:a,height:s,bottom:l,right:c}}function Qt(e){return Be(e,{ignoreTransform:!0})}function _r(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Pr(e,t){return t===void 0&&(t=V(e).getComputedStyle(e)),t.position==="fixed"}function Br(e,t){t===void 0&&(t=V(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?n.test(a):!1})}function ht(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Ot(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!et(o)||mn(o)||n.includes(o))return n;const a=V(e).getComputedStyle(o);return o!==e&&Br(o,a)&&n.push(o),Pr(o,a)?n:r(o.parentNode)}return e?r(e):n}function Cn(e){const[t]=ht(e,1);return t??null}function wt(e){return!gt||!e?null:_e(e)?e:Lt(e)?Ot(e)||e===Pe(e).scrollingElement?window:et(e)?e:null:null}function Dn(e){return _e(e)?e.scrollX:e.scrollLeft}function Rn(e){return _e(e)?e.scrollY:e.scrollTop}function At(e){return{x:Dn(e),y:Rn(e)}}var z;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(z||(z={}));function Nn(e){return!gt||!e?!1:e===document.scrollingElement}function En(e){const t={x:0,y:0},n=Nn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:r,minScroll:t}}const zr={x:.2,y:.2};function $r(e,t,n,r,o){let{top:a,left:s,right:l,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=zr);const{isTop:u,isBottom:g,isLeft:f,isRight:p}=En(e),h={x:0,y:0},D={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!u&&a<=t.top+m.height?(h.y=z.Backward,D.y=r*Math.abs((t.top+m.height-a)/m.height)):!g&&c>=t.bottom-m.height&&(h.y=z.Forward,D.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!p&&l>=t.right-m.width?(h.x=z.Forward,D.x=r*Math.abs((t.right-m.width-l)/m.width)):!f&&s<=t.left+m.width&&(h.x=z.Backward,D.x=r*Math.abs((t.left+m.width-s)/m.width)),{direction:h,speed:D}}function Fr(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function jn(e){return e.reduce((t,n)=>Le(t,At(n)),de)}function Ur(e){return e.reduce((t,n)=>t+Dn(n),0)}function Xr(e){return e.reduce((t,n)=>t+Rn(n),0)}function Yr(e,t){if(t===void 0&&(t=Be),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);Cn(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Wr=[["x",["left","right"],Ur],["y",["top","bottom"],Xr]];class Bt{constructor(t,n){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 r=ht(n),o=jn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of Wr)for(const c of s)Object.defineProperty(this,c,{get:()=>{const u=l(r),g=o[a]-u;return this.rect[c]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ke{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Hr(e){const{EventTarget:t}=V(e);return e instanceof t?e:Pe(e)}function kt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Zt(e){e.preventDefault()}function Kr(e){e.stopPropagation()}var E;(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"})(E||(E={}));const An={start:[E.Space,E.Enter],cancel:[E.Esc],end:[E.Space,E.Enter,E.Tab]},Gr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case E.Right:return{...n,x:n.x+25};case E.Left:return{...n,x:n.x-25};case E.Down:return{...n,y:n.y+25};case E.Up:return{...n,y:n.y-25}}};class zt{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:n}}=t;this.props=t,this.listeners=new Ke(Pe(n)),this.windowListeners=new Ke(V(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Yr(r),n(de)}handleKeyDown(t){if(Pt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:a=An,coordinateGetter:s=Gr,scrollBehavior:l="smooth"}=o,{code:c}=t;if(a.end.includes(c)){this.handleEnd(t);return}if(a.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,g=u?{x:u.left,y:u.top}:de;this.referenceCoordinates||(this.referenceCoordinates=g);const f=s(t,{active:n,context:r.current,currentCoordinates:g});if(f){const p=Je(f,g),h={x:0,y:0},{scrollableAncestors:D}=r.current;for(const m of D){const x=t.code,{isTop:w,isRight:S,isLeft:v,isBottom:R,maxScroll:j,minScroll:A}=En(m),k=Fr(m),y={x:Math.min(x===E.Right?k.right-k.width/2:k.right,Math.max(x===E.Right?k.left:k.left+k.width/2,f.x)),y:Math.min(x===E.Down?k.bottom-k.height/2:k.bottom,Math.max(x===E.Down?k.top:k.top+k.height/2,f.y))},L=x===E.Right&&!S||x===E.Left&&!v,O=x===E.Down&&!R||x===E.Up&&!w;if(L&&y.x!==f.x){const N=m.scrollLeft+p.x,X=x===E.Right&&N<=j.x||x===E.Left&&N>=A.x;if(X&&!p.y){m.scrollTo({left:N,behavior:l});return}X?h.x=m.scrollLeft-N:h.x=x===E.Right?m.scrollLeft-j.x:m.scrollLeft-A.x,h.x&&m.scrollBy({left:-h.x,behavior:l});break}else if(O&&y.y!==f.y){const N=m.scrollTop+p.y,X=x===E.Down&&N<=j.y||x===E.Up&&N>=A.y;if(X&&!p.x){m.scrollTo({top:N,behavior:l});return}X?h.y=m.scrollTop-N:h.y=x===E.Down?m.scrollTop-j.y:m.scrollTop-A.y,h.y&&m.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(t,Le(Je(f,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}zt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=An,onActivation:o}=t,{active:a}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function en(e){return!!(e&&"distance"in e)}function tn(e){return!!(e&&"delay"in e)}class $t{constructor(t,n,r){var o;r===void 0&&(r=Hr(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=n;const{event:a}=t,{target:s}=a;this.props=t,this.events=n,this.document=Pe(s),this.documentListeners=new Ke(this.document),this.listeners=new Ke(r),this.windowListeners=new Ke(V(s)),this.initialCoordinates=(o=jt(a))!=null?o:de,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:n,bypassActivationConstraint:r}}}=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(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Zt),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Zt),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(en(n)){this.handlePending(n);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,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(se.Click,Kr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const c=(n=jt(t))!=null?n:de,u=Je(o,c);if(!r&&l){if(en(l)){if(l.tolerance!=null&&kt(u,l.tolerance))return this.handleCancel();if(kt(u,l.distance))return this.handleStart()}if(tn(l)&&kt(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===E.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Vr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ft extends $t{constructor(t){const{event:n}=t,r=Pe(n.target);super(t,Vr,r)}}Ft.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const qr={move:{name:"mousemove"},end:{name:"mouseup"}};var Mt;(function(e){e[e.RightClick=2]="RightClick"})(Mt||(Mt={}));class Jr extends $t{constructor(t){super(t,qr,Pe(t.event.target))}}Jr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Mt.RightClick?!1:(r?.({event:n}),!0)}}];const St={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qr extends $t{constructor(t){super(t,St)}static setup(){return window.addEventListener(St.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(St.move.name,t)};function t(){}}}Qr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Ge;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ge||(Ge={}));var ut;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ut||(ut={}));function Zr(e){let{acceleration:t,activator:n=Ge.Pointer,canScroll:r,draggingRect:o,enabled:a,interval:s=5,order:l=ut.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:g,delta:f,threshold:p}=e;const h=to({delta:f,disabled:!a}),[D,m]=ur(),x=i.useRef({x:0,y:0}),w=i.useRef({x:0,y:0}),S=i.useMemo(()=>{switch(n){case Ge.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ge.DraggableRect:return o}},[n,o,c]),v=i.useRef(null),R=i.useCallback(()=>{const A=v.current;if(!A)return;const k=x.current.x*w.current.x,y=x.current.y*w.current.y;A.scrollBy(k,y)},[]),j=i.useMemo(()=>l===ut.TreeOrder?[...u].reverse():u,[l,u]);i.useEffect(()=>{if(!a||!u.length||!S){m();return}for(const A of j){if(r?.(A)===!1)continue;const k=u.indexOf(A),y=g[k];if(!y)continue;const{direction:L,speed:O}=$r(A,y,S,t,p);for(const N of["x","y"])h[N][L[N]]||(O[N]=0,L[N]=0);if(O.x>0||O.y>0){m(),v.current=A,D(R,s),x.current=O,w.current=L;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,R,r,m,a,s,JSON.stringify(S),JSON.stringify(h),D,u,j,g,JSON.stringify(p)])}const eo={x:{[z.Backward]:!1,[z.Forward]:!1},y:{[z.Backward]:!1,[z.Forward]:!1}};function to(e){let{delta:t,disabled:n}=e;const r=Et(t);return tt(o=>{if(n||!r||!o)return eo;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[z.Backward]:o.x[z.Backward]||a.x===-1,[z.Forward]:o.x[z.Forward]||a.x===1},y:{[z.Backward]:o.y[z.Backward]||a.y===-1,[z.Forward]:o.y[z.Forward]||a.y===1}}},[n,t,r])}function no(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return tt(o=>{var a;return t==null?null:(a=r??o)!=null?a:null},[r,t])}function ro(e,t){return i.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...a]},[]),[e,t])}var Ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ze||(Ze={}));var It;(function(e){e.Optimized="optimized"})(It||(It={}));const nn=new Map;function oo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[a,s]=i.useState(null),{frequency:l,measure:c,strategy:u}=o,g=i.useRef(e),f=x(),p=qe(f),h=i.useCallback(function(w){w===void 0&&(w=[]),!p.current&&s(S=>S===null?w:S.concat(w.filter(v=>!S.includes(v))))},[p]),D=i.useRef(null),m=tt(w=>{if(f&&!n)return nn;if(!w||w===nn||g.current!==e||a!=null){const S=new Map;for(let v of e){if(!v)continue;if(a&&a.length>0&&!a.includes(v.id)&&v.rect.current){S.set(v.id,v.rect.current);continue}const R=v.node.current,j=R?new Bt(c(R),R):null;v.rect.current=j,j&&S.set(v.id,j)}return S}return w},[e,a,n,f,c]);return i.useEffect(()=>{g.current=e},[e]),i.useEffect(()=>{f||h()},[n,f]),i.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),i.useEffect(()=>{f||typeof l!="number"||D.current!==null||(D.current=setTimeout(()=>{h(),D.current=null},l))},[l,f,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:a!=null};function x(){switch(u){case Ze.Always:return!1;case Ze.BeforeDragging:return n;default:return!n}}}function Mn(e,t){return tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ao(e,t){return Mn(e,t)}function so(e){let{callback:t,disabled:n}=e;const r=_t(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return i.useEffect(()=>()=>o?.disconnect(),[o]),o}function bt(e){let{callback:t,disabled:n}=e;const r=_t(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return i.useEffect(()=>()=>o?.disconnect(),[o]),o}function io(e){return new Bt(Be(e),e)}function rn(e,t,n){t===void 0&&(t=io);const[r,o]=i.useState(null);function a(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const g=t(e);return JSON.stringify(c)===JSON.stringify(g)?c:g})}const s=so({callback(c){if(e)for(const u of c){const{type:g,target:f}=u;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),l=bt({callback:a});return he(()=>{a(),e?(l?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),s?.disconnect())},[e]),r}function lo(e){const t=Mn(e);return Sn(e,t)}const on=[];function co(e){const t=i.useRef(e),n=tt(r=>e?r&&r!==on&&e&&t.current&&e.parentNode===t.current.parentNode?r:ht(e):on,[e]);return i.useEffect(()=>{t.current=e},[e]),n}function uo(e){const[t,n]=i.useState(null),r=i.useRef(e),o=i.useCallback(a=>{const s=wt(a.target);s&&n(l=>l?(l.set(s,At(s)),new Map(l)):null)},[]);return i.useEffect(()=>{const a=r.current;if(e!==a){s(a);const l=e.map(c=>{const u=wt(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,At(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(c=>{const u=wt(c);u?.removeEventListener("scroll",o)})}},[o,e]),i.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Le(a,s),de):jn(e):de,[e,t])}function an(e,t){t===void 0&&(t=[]);const n=i.useRef(null);return i.useEffect(()=>{n.current=null},t),i.useEffect(()=>{const r=e!==de;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Je(e,n.current):de}function fo(e){i.useEffect(()=>{if(!gt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function go(e,t){return i.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:a}=r;return n[o]=s=>{a(s,t)},n},{}),[e,t])}function In(e){return i.useMemo(()=>e?_r(e):null,[e])}const sn=[];function ho(e,t){t===void 0&&(t=Be);const[n]=e,r=In(n?V(n):null),[o,a]=i.useState(sn);function s(){a(()=>e.length?e.map(c=>Nn(c)?r:new Bt(t(c),c)):sn)}const l=bt({callback:s});return he(()=>{l?.disconnect(),s(),e.forEach(c=>l?.observe(c))},[e]),o}function bo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return et(t)?t:e}function po(e){let{measure:t}=e;const[n,r]=i.useState(null),o=i.useCallback(u=>{for(const{target:g}of u)if(et(g)){r(f=>{const p=t(g);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),a=bt({callback:o}),s=i.useCallback(u=>{const g=bo(u);a?.disconnect(),g&&a?.observe(g),r(g?t(g):null)},[t,a]),[l,c]=ct(s);return i.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const mo=[{sensor:Ft,options:{}},{sensor:zt,options:{}}],xo={current:{}},it={draggable:{measure:Qt},droppable:{measure:Qt,strategy:Ze.WhileDragging,frequency:It.Optimized},dragOverlay:{measure:Be}};class Ve extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const vo={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ve,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:dt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:it,measureDroppableContainers:dt,windowRect:null,measuringScheduled:!1},yo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:dt,draggableNodes:new Map,over:null,measureDroppableContainers:dt},pt=i.createContext(yo),Tn=i.createContext(vo);function wo(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ve}}}function ko(e,t){switch(t.type){case B.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case B.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 B.DragEnd:case B.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case B.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ve(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case B.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const s=new Ve(e.droppable.containers);return s.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case B.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Ve(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function So(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=i.useContext(pt),a=Et(r),s=Et(n?.id);return i.useEffect(()=>{if(!t&&!r&&a&&s!=null){if(!Pt(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const g of[c.current,u.current]){if(!g)continue;const f=hr(g);if(f){f.focus();break}}})}},[r,t,o,s,a]),null}function Co(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...r}),n):n}function Do(e){return i.useMemo(()=>({draggable:{...it.draggable,...e?.draggable},droppable:{...it.droppable,...e?.droppable},dragOverlay:{...it.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ro(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const a=i.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;he(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const g=n(u),f=Sn(g,r);if(s||(f.x=0),l||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=Cn(u);p&&p.scrollBy({top:f.y,left:f.x})}},[t,s,l,r,n])}const Ln=i.createContext({...de,scaleX:1,scaleY:1});var Ee;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ee||(Ee={}));const No=i.memo(function(t){var n,r,o,a;let{id:s,accessibility:l,autoScroll:c=!0,children:u,sensors:g=mo,collisionDetection:f=jr,measuring:p,modifiers:h,...D}=t;const m=i.useReducer(ko,void 0,wo),[x,w]=m,[S,v]=yr(),[R,j]=i.useState(Ee.Uninitialized),A=R===Ee.Initialized,{draggable:{active:k,nodes:y,translate:L},droppable:{containers:O}}=x,N=k!=null?y.get(k):null,X=i.useRef({initial:null,translated:null}),q=i.useMemo(()=>{var U;return k!=null?{id:k,data:(U=N?.data)!=null?U:xo,rect:X}:null},[k,N]),ne=i.useRef(null),[xe,je]=i.useState(null),[T,Ie]=i.useState(null),ie=qe(D,Object.values(D)),ve=nt("DndDescribedBy",s),H=i.useMemo(()=>O.getEnabled(),[O]),P=Do(p),{droppableRects:$,measureDroppableContainers:be,measuringScheduled:ye}=oo(H,{dragging:A,dependencies:[L.x,L.y],config:P.droppable}),Y=no(y,k),Ae=i.useMemo(()=>T?jt(T):null,[T]),le=Gn(),J=ao(Y,P.draggable.measure);Ro({activeNode:k!=null?y.get(k):null,config:le.layoutShiftCompensation,initialRect:J,measure:P.draggable.measure});const M=rn(Y,P.draggable.measure,J),we=rn(Y?Y.parentElement:null),Q=i.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=O.getNodeFor((n=Q.current.over)==null?void 0:n.id),re=po({measure:P.dragOverlay.measure}),ue=(r=re.nodeRef.current)!=null?r:Y,ke=A?(o=re.rect)!=null?o:M:null,ze=!!(re.nodeRef.current&&re.rect),$e=lo(ze?null:M),Fe=In(ue?V(ue):null),K=co(A?pe??Y:null),Se=ho(K),b=Co(h,{transform:{x:L.x-$e.x,y:L.y-$e.y,scaleX:1,scaleY:1},activatorEvent:T,active:q,activeNodeRect:M,containerNodeRect:we,draggingNodeRect:ke,over:Q.current.over,overlayNodeRect:re.rect,scrollableAncestors:K,scrollableAncestorRects:Se,windowRect:Fe}),I=Ae?Le(Ae,L):null,oe=uo(K),rt=an(oe),mt=an(oe,[M]),W=Le(b,rt),Me=ke?Ir(ke,b):null,Ue=q&&Me?f({active:q,collisionRect:Me,droppableRects:$,droppableContainers:H,pointerCoordinates:I}):null,Ut=kn(Ue,"id"),[Ce,Xt]=i.useState(null),Xn=ze?b:Le(b,mt),Yn=Ar(Xn,(a=Ce?.rect)!=null?a:null,M),xt=i.useRef(null),Yt=i.useCallback((U,Z)=>{let{sensor:ee,options:De}=Z;if(ne.current==null)return;const ae=y.get(ne.current);if(!ae)return;const te=U.nativeEvent,fe=new ee({active:ne.current,activeNode:ae,event:te,options:De,context:Q,onAbort(F){if(!y.get(F))return;const{onDragAbort:ge}=ie.current,me={id:F};ge?.(me),S({type:"onDragAbort",event:me})},onPending(F,Re,ge,me){if(!y.get(F))return;const{onDragPending:Ye}=ie.current,Ne={id:F,constraint:Re,initialCoordinates:ge,offset:me};Ye?.(Ne),S({type:"onDragPending",event:Ne})},onStart(F){const Re=ne.current;if(Re==null)return;const ge=y.get(Re);if(!ge)return;const{onDragStart:me}=ie.current,Xe={activatorEvent:te,active:{id:Re,data:ge.data,rect:X}};He.unstable_batchedUpdates(()=>{me?.(Xe),j(Ee.Initializing),w({type:B.DragStart,initialCoordinates:F,active:Re}),S({type:"onDragStart",event:Xe}),je(xt.current),Ie(te)})},onMove(F){w({type:B.DragMove,coordinates:F})},onEnd:Te(B.DragEnd),onCancel:Te(B.DragCancel)});xt.current=fe;function Te(F){return async function(){const{active:ge,collisions:me,over:Xe,scrollAdjustedTranslate:Ye}=Q.current;let Ne=null;if(ge&&Ye){const{cancelDrop:We}=ie.current;Ne={activatorEvent:te,active:ge,collisions:me,delta:Ye,over:Xe},F===B.DragEnd&&typeof We=="function"&&await Promise.resolve(We(Ne))&&(F=B.DragCancel)}ne.current=null,He.unstable_batchedUpdates(()=>{w({type:F}),j(Ee.Uninitialized),Xt(null),je(null),Ie(null),xt.current=null;const We=F===B.DragEnd?"onDragEnd":"onDragCancel";if(Ne){const vt=ie.current[We];vt?.(Ne),S({type:We,event:Ne})}})}}},[y]),Wn=i.useCallback((U,Z)=>(ee,De)=>{const ae=ee.nativeEvent,te=y.get(De);if(ne.current!==null||!te||ae.dndKit||ae.defaultPrevented)return;const fe={active:te};U(ee,Z.options,fe)===!0&&(ae.dndKit={capturedBy:Z.sensor},ne.current=De,Yt(ee,Z))},[y,Yt]),Wt=ro(g,Wn);fo(g),he(()=>{M&&R===Ee.Initializing&&j(Ee.Initialized)},[M,R]),i.useEffect(()=>{const{onDragMove:U}=ie.current,{active:Z,activatorEvent:ee,collisions:De,over:ae}=Q.current;if(!Z||!ee)return;const te={active:Z,activatorEvent:ee,collisions:De,delta:{x:W.x,y:W.y},over:ae};He.unstable_batchedUpdates(()=>{U?.(te),S({type:"onDragMove",event:te})})},[W.x,W.y]),i.useEffect(()=>{const{active:U,activatorEvent:Z,collisions:ee,droppableContainers:De,scrollAdjustedTranslate:ae}=Q.current;if(!U||ne.current==null||!Z||!ae)return;const{onDragOver:te}=ie.current,fe=De.get(Ut),Te=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,F={active:U,activatorEvent:Z,collisions:ee,delta:{x:ae.x,y:ae.y},over:Te};He.unstable_batchedUpdates(()=>{Xt(Te),te?.(F),S({type:"onDragOver",event:F})})},[Ut]),he(()=>{Q.current={activatorEvent:T,active:q,activeNode:Y,collisionRect:Me,collisions:Ue,droppableRects:$,draggableNodes:y,draggingNode:ue,draggingNodeRect:ke,droppableContainers:O,over:Ce,scrollableAncestors:K,scrollAdjustedTranslate:W},X.current={initial:ke,translated:Me}},[q,Y,Ue,Me,y,ue,ke,$,O,Ce,K,W]),Zr({...le,delta:L,draggingRect:Me,pointerCoordinates:I,scrollableAncestors:K,scrollableAncestorRects:Se});const Hn=i.useMemo(()=>({active:q,activeNode:Y,activeNodeRect:M,activatorEvent:T,collisions:Ue,containerNodeRect:we,dragOverlay:re,draggableNodes:y,droppableContainers:O,droppableRects:$,over:Ce,measureDroppableContainers:be,scrollableAncestors:K,scrollableAncestorRects:Se,measuringConfiguration:P,measuringScheduled:ye,windowRect:Fe}),[q,Y,M,T,Ue,we,re,y,O,$,Ce,be,K,Se,P,ye,Fe]),Kn=i.useMemo(()=>({activatorEvent:T,activators:Wt,active:q,activeNodeRect:M,ariaDescribedById:{draggable:ve},dispatch:w,draggableNodes:y,over:Ce,measureDroppableContainers:be}),[T,Wt,q,M,w,ve,y,Ce,be]);return G.createElement(vn.Provider,{value:v},G.createElement(pt.Provider,{value:Kn},G.createElement(Tn.Provider,{value:Hn},G.createElement(Ln.Provider,{value:Yn},u)),G.createElement(So,{disabled:l?.restoreFocus===!1})),G.createElement(Sr,{...l,hiddenTextDescribedById:ve}));function Gn(){const U=xe?.autoScrollEnabled===!1,Z=typeof c=="object"?c.enabled===!1:c===!1,ee=A&&!U&&!Z;return typeof c=="object"?{...c,enabled:ee}:{enabled:ee}}}),Eo=i.createContext(null),ln="button",jo="Draggable";function Ao(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const a=nt(jo),{activators:s,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:g,draggableNodes:f,over:p}=i.useContext(pt),{role:h=ln,roleDescription:D="draggable",tabIndex:m=0}=o??{},x=c?.id===t,w=i.useContext(x?Ln:Eo),[S,v]=ct(),[R,j]=ct(),A=go(s,t),k=qe(n);he(()=>(f.set(t,{id:t,key:a,node:S,activatorNode:R,data:k}),()=>{const L=f.get(t);L&&L.key===a&&f.delete(t)}),[f,t]);const y=i.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&h===ln?!0:void 0,"aria-roledescription":D,"aria-describedby":g.draggable}),[r,h,m,x,D,g.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:y,isDragging:x,listeners:r?void 0:A,node:S,over:p,setNodeRef:v,setActivatorNodeRef:j,transform:w}}function Mo(){return i.useContext(Tn)}const Io="Droppable",To={timeout:25};function Lo(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const a=nt(Io),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=i.useContext(pt),g=i.useRef({disabled:n}),f=i.useRef(!1),p=i.useRef(null),h=i.useRef(null),{disabled:D,updateMeasurementsFor:m,timeout:x}={...To,...o},w=qe(m??r),S=i.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),h.current=null},x)},[x]),v=bt({callback:S,disabled:D||!s}),R=i.useCallback((y,L)=>{v&&(L&&(v.unobserve(L),f.current=!1),y&&v.observe(y))},[v]),[j,A]=ct(R),k=qe(t);return i.useEffect(()=>{!v||!j.current||(v.disconnect(),f.current=!1,v.observe(j.current))},[j,v]),i.useEffect(()=>(l({type:B.RegisterDroppable,element:{id:r,key:a,disabled:n,node:j,rect:p,data:k}}),()=>l({type:B.UnregisterDroppable,key:a,id:r})),[r]),i.useEffect(()=>{n!==g.current.disabled&&(l({type:B.SetDroppableDisabled,id:r,key:a,disabled:n}),g.current.disabled=n)},[r,a,n,l]),{active:s,rect:p,isOver:c?.id===r,node:j,over:c,setNodeRef:A}}const Oo=e=>{let{transform:t}=e;return{...t,y:0}};function On(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function _o(e,t){return e.reduce((n,r,o)=>{const a=t.get(r);return a&&(n[o]=a),n},Array(e.length))}function ot(e){return e!==null&&e>=0}function Po(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Bo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const at={scaleX:1,scaleY:1},zo=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:a,index:s}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const c=$o(n,s,o);if(s===o){const u=n[a];return u?{x:o<a?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...at}:null}return s>o&&s<=a?{x:-l.width-c,y:0,...at}:s<o&&s>=a?{x:l.width+c,y:0,...at}:{x:0,y:0,...at}};function $o(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];return!r||!o&&!a?0:n<t?o?r.left-(o.left+o.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(o.left+o.width)}const _n=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=On(t,r,n),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},Pn="Sortable",Bn=G.createContext({activeIndex:-1,containerId:Pn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_n,disabled:{draggable:!1,droppable:!1}});function Fo(e){let{children:t,id:n,items:r,strategy:o=_n,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:g}=Mo(),f=nt(Pn,n),p=l.rect!==null,h=i.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),D=s!=null,m=s?h.indexOf(s.id):-1,x=u?h.indexOf(u.id):-1,w=i.useRef(h),S=!Po(h,w.current),v=x!==-1&&m===-1||S,R=Bo(a);he(()=>{S&&D&&g(h)},[S,h,D,g]),i.useEffect(()=>{w.current=h},[h]);const j=i.useMemo(()=>({activeIndex:m,containerId:f,disabled:R,disableTransforms:v,items:h,overIndex:x,useDragOverlay:p,sortedRects:_o(h,c),strategy:o}),[m,f,R.draggable,R.droppable,v,h,x,c,p,o]);return G.createElement(Bn.Provider,{value:j},t)}const Uo=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return On(n,r,o).indexOf(t)},Xo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==a&&o===s?!1:n?!0:s!==o&&t===c},Yo={duration:200,easing:"ease"},zn="transform",Wo=Qe.Transition.toString({property:zn,duration:0,easing:"linear"}),Ho={roleDescription:"sortable"};function Ko(e){let{disabled:t,index:n,node:r,rect:o}=e;const[a,s]=i.useState(null),l=i.useRef(n);return he(()=>{if(!t&&n!==l.current&&r.current){const c=o.current;if(c){const u=Be(r.current,{ignoreTransform:!0}),g={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(g.x||g.y)&&s(g)}}n!==l.current&&(l.current=n)},[t,n,r,o]),i.useEffect(()=>{a&&s(null)},[a]),a}function Go(e){let{animateLayoutChanges:t=Xo,attributes:n,disabled:r,data:o,getNewIndex:a=Uo,id:s,strategy:l,resizeObserverConfig:c,transition:u=Yo}=e;const{items:g,containerId:f,activeIndex:p,disabled:h,disableTransforms:D,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:S}=i.useContext(Bn),v=Vo(r,h),R=g.indexOf(s),j=i.useMemo(()=>({sortable:{containerId:f,index:R,items:g},...o}),[f,o,R,g]),A=i.useMemo(()=>g.slice(g.indexOf(s)),[g,s]),{rect:k,node:y,isOver:L,setNodeRef:O}=Lo({id:s,data:j,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...c}}),{active:N,activatorEvent:X,activeNodeRect:q,attributes:ne,setNodeRef:xe,listeners:je,isDragging:T,over:Ie,setActivatorNodeRef:ie,transform:ve}=Ao({id:s,data:j,attributes:{...Ho,...n},disabled:v.draggable}),H=dr(O,xe),P=!!N,$=P&&!D&&ot(p)&&ot(x),be=!w&&T,ye=be&&$?ve:null,Ae=$?ye??(l??S)({rects:m,activeNodeRect:q,activeIndex:p,overIndex:x,index:R}):null,le=ot(p)&&ot(x)?a({id:s,items:g,activeIndex:p,overIndex:x}):R,J=N?.id,M=i.useRef({activeId:J,items:g,newIndex:le,containerId:f}),we=g!==M.current.items,Q=t({active:N,containerId:f,isDragging:T,isSorting:P,id:s,index:R,items:g,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),pe=Ko({disabled:!Q,index:R,node:y,rect:k});return i.useEffect(()=>{P&&M.current.newIndex!==le&&(M.current.newIndex=le),f!==M.current.containerId&&(M.current.containerId=f),g!==M.current.items&&(M.current.items=g)},[P,le,f,g]),i.useEffect(()=>{if(J===M.current.activeId)return;if(J&&!M.current.activeId){M.current.activeId=J;return}const ue=setTimeout(()=>{M.current.activeId=J},50);return()=>clearTimeout(ue)},[J]),{active:N,activeIndex:p,attributes:ne,data:j,rect:k,index:R,newIndex:le,items:g,isOver:L,isSorting:P,isDragging:T,listeners:je,node:y,overIndex:x,over:Ie,setNodeRef:H,setActivatorNodeRef:ie,setDroppableNodeRef:O,setDraggableNodeRef:xe,transform:pe??Ae,transition:re()};function re(){if(pe||we&&M.current.newIndex===R)return Wo;if(!(be&&!Pt(X)||!u)&&(P||Q))return Qe.Transition.toString({...u,property:zn})}}function Vo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function ft(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 qo=[E.Down,E.Right,E.Up,E.Left],Jo=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(qo.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=o.get(f.id);if(p)switch(e.code){case E.Down:r.top<p.top&&c.push(f);break;case E.Up:r.top>p.top&&c.push(f);break;case E.Left:r.left>p.left&&c.push(f);break;case E.Right:r.left<p.left&&c.push(f);break}});const u=Nr({collisionRect:r,droppableRects:o,droppableContainers:c});let g=kn(u,"id");if(g===s?.id&&u.length>1&&(g=u[1].id),g!=null){const f=a.get(n.id),p=a.get(g),h=p?o.get(p.id):null,D=p?.node.current;if(D&&h&&f&&p){const x=ht(D).some((A,k)=>l[k]!==A),w=$n(f,p),S=Qo(f,p),v=x||!w?{x:0,y:0}:{x:S?r.width-h.width:0,y:S?r.height-h.height:0},R={x:h.left,y:h.top};return v.x&&v.y?R:Je(R,v)}}}};function $n(e,t){return!ft(e)||!ft(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Qo(e,t){return!ft(e)||!ft(t)||!$n(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Oe(e,{min:t,max:n,fallback:r}){const o=Number(e);if(!Number.isFinite(o))return r;const a=Math.floor(o);return a<t?t:a>n?n:a}function Zo(e,t){const n=Oe(t,{min:0,max:1e6,fallback:0}),r=Oe(e,{min:1,max:Math.max(1,n||1),fallback:1});if(n<=1)return[1];const o=new Set([1,n,r-2,r-1,r,r+1,r+2]),a=Array.from(o).filter(c=>Number.isInteger(c)&&c>=1&&c<=n).sort((c,u)=>c-u),s=[];let l=null;for(const c of a)l!=null&&c-l>1&&s.push(null),s.push(c),l=c;return s}function ea({page:e,totalPages:t}){const n=typeof t=="number"&&Number.isFinite(t)&&t>=0,r=n?Oe(t,{min:0,max:1e6,fallback:0}):null,o=Oe(e,{min:1,max:n?Math.max(1,r||1):1e6,fallback:1}),a=o>1,s=n?o<r:!0;return{canPrev:a,canNext:s,safePage:o,safeTotal:r}}function ta({entries:e,me:t,meLabel:n,limit:r}){const o=Oe(r,{min:1,max:1e3,fallback:20}),a=Array.isArray(e)?e.slice(0,o):[],s=t&&typeof t.rank=="number"?t.rank:null,l=a.some(h=>!!h?.is_me);if(!s||l)return a;const c={rank:s,is_me:!0,display_name:n,avatar_url:null,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"},u=3,g=4,p=a.filter(h=>!h?.is_me).filter((h,D)=>D!==u).slice();return p.splice(Math.min(g,p.length),0,c),p.slice(0,o)}function ce({className:e}){return d.jsx("div",{className:_("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",e)})}function na({index:e}){const t=e<3?"w-24":e<8?"w-20":"w-16",n=e<3?"w-16":"w-12",r=e<5?"w-14":"w-10";return d.jsxs("tr",{className:"group",children:[d.jsx("td",{className:_(Rt(!1),"!group-hover:bg-transparent"),children:d.jsx(ce,{className:"h-4 w-6"})}),d.jsx("td",{className:_(Nt(!1),"!group-hover:bg-transparent"),children:d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx(ce,{className:"h-8 w-8 min-w-8 rounded-full"}),d.jsx(ce,{className:_("h-4",t)})]})}),d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(ce,{className:_("h-4",n)})}),d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(ce,{className:"h-4 w-12"})}),lt.map(o=>d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(ce,{className:_("h-4",r)})},o.key))]})}function ra({rows:e=10}){return d.jsx("div",{className:"w-full overflow-x-auto",children:d.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[d.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:d.jsxs("tr",{children:[d.jsx("th",{className:_(bn,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(ce,{className:"h-3.5 w-6"})}),d.jsx("th",{className:_(pn,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(ce,{className:"h-3.5 w-12"})}),d.jsx("th",{className:"px-4 py-4",children:d.jsx(ce,{className:"h-3.5 w-10"})}),d.jsx("th",{className:"px-4 py-4",children:d.jsx(ce,{className:"h-3.5 w-14"})}),lt.map(t=>d.jsx("th",{className:"px-4 py-4",children:d.jsx(ce,{className:"h-3.5 w-12"})},t.key))]})}),d.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Array.from({length:e},(t,n)=>d.jsx(na,{index:n},n))})]})})}function oa({id:e,thClassName:t,children:n}){const{attributes:r,listeners:o,setNodeRef:a,transform:s,transition:l,isDragging:c}=Go({id:e}),u=Qe.Transform.toString(s)||"";i.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(h=>{h.style.transform=u,h.style.transition=l||"",h.style.zIndex=c?"20":"",h.style.position=u?"relative":"",h.style.boxShadow=c?p:""}),()=>{f.forEach(h=>{h.style.transform="",h.style.transition="",h.style.zIndex="",h.style.position="",h.style.boxShadow=""})}},[e,u,l,c]);const g={transform:u,transition:l,position:u?"relative":void 0,zIndex:c?20:void 0,boxShadow:c?"0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)":void 0};return d.jsx("th",{ref:a,style:g,className:_(t,"group/col select-none cursor-grab active:cursor-grabbing touch-none"),...r,...o,children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx("span",{"aria-hidden":"true",className:_("-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",c&&"opacity-100"),children:d.jsxs("svg",{viewBox:"0 0 8 14",width:"8",height:"14",fill:"currentColor","aria-hidden":"true",children:[d.jsx("circle",{cx:"2",cy:"2",r:"1"}),d.jsx("circle",{cx:"6",cy:"2",r:"1"}),d.jsx("circle",{cx:"2",cy:"7",r:"1"}),d.jsx("circle",{cx:"6",cy:"7",r:"1"}),d.jsx("circle",{cx:"2",cy:"12",r:"1"}),d.jsx("circle",{cx:"6",cy:"12",r:"1"})]})}),n]})})}const Fn="tokentracker.leaderboard.columnOrder.v1";function aa(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Fn);if(!e)return null;const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):null}catch{return null}}function Ct(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Fn,JSON.stringify(e))}catch{}}function cn(e,t){if(!e)return t;const n=new Set(t),r=e.filter(a=>n.has(a)),o=t.filter(a=>!r.includes(a));return[...r,...o]}function sa(e){const t=i.useMemo(()=>e.join("|"),[e]),[n,r]=i.useState(()=>cn(aa(),e));i.useEffect(()=>{r(s=>{const l=cn(s,e);return l.length===s.length&&l.every((u,g)=>u===s[g])?s:(Ct(l),l)})},[t,e]);const o=i.useCallback((s,l)=>{!s||!l||s===l||r(c=>{const u=c.indexOf(s),g=c.indexOf(l);if(u===-1||g===-1)return c;const f=c.slice(),[p]=f.splice(u,1);return f.splice(g,0,p),Ct(f),f})},[]),a=i.useCallback(()=>{Ct(e),r(e)},[e]);return{order:n,reorder:o,reset:a}}const st=20;function dn(e){const t=Number(e);return!Number.isFinite(t)||t<=0?"-":t>=1e3?`$${Math.round(t).toLocaleString()}`:t>=10?`$${Math.round(t)}`:`$${t.toFixed(2)}`}function un(e,t,n){const r=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 n.map(a=>d.jsx("td",{"data-column-key":a.key,className:_("px-4 py-4 whitespace-nowrap text-right tabular-nums",r,o),children:Dt(e?.[a.key])},a.key))}const ia={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 fn({rank:e,placeholder:t}){const n=ia[e];return n?d.jsx("span",{className:_("inline-flex items-center justify-center h-7 w-7 rounded-full text-xs font-bold",n.text,n.badge),children:e}):d.jsx("span",{className:"inline-flex items-center justify-center h-7 w-7 text-sm",children:e??t})}function Tt(e){if(typeof e!="string")return null;const t=e.trim().toLowerCase();return t==="week"||t==="month"||t==="total"?t:null}function la(e){if(!e)return C("shared.error.prefix",{error:C("leaderboard.error.unknown")});const t=e?.message||String(e),n=String(t||"").trim()||C("leaderboard.error.unknown");return C("shared.error.prefix",{error:n})}function Un(e){return typeof e!="string"?"":e.trim()}function ca(e){const t=Un(e);return t?t.toLowerCase()==="anonymous":!0}function da(e,t=""){if(typeof e!="string")return null;const n=e.trim().toLowerCase();if(!n)return null;const r=new URLSearchParams(typeof t=="string"?t:""),o=Tt(r.get("period")),a=o?`?period=${o}`:"";return`/share/pv1-${n}${a}`}function gn(e,t){const n=typeof e?.user_id=="string"?e.user_id.trim():"";return n||`${e?.rank??""}:${t}`}function hn({githubUrl:e}){return d.jsxs("span",{className:"relative inline-flex items-center group/gh shrink-0",children:[d.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>t.stopPropagation(),"aria-label":C("leaderboard.github.aria"),className:"text-oai-black hover:text-oai-gray-500 dark:text-white dark:hover:text-oai-gray-400 transition-colors",children:d.jsx(lr,{provider:"GITHUB",size:16})}),d.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:[d.jsx("span",{className:"block",children:C("leaderboard.github.tooltipAction")}),d.jsxs("span",{className:"block text-oai-gray-300 dark:text-oai-gray-400",children:[C("leaderboard.github.tooltipPrefix")," ",d.jsx(or,{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:C("leaderboard.github.tooltipSettingsLink")}),C("leaderboard.github.tooltipSuffix")]})]})]})}function ha({auth:e,signedIn:t,sessionSoftExpired:n}){const r=Vn(),o=qn(),{openLoginModal:a}=Jn(),{signedIn:s,loading:l,user:c}=Qn(),u=i.useMemo(()=>Zn(),[]),g=er(),f=t&&!n,p=i.useMemo(()=>f&&(typeof e=="function"||typeof e=="string"||e&&typeof e=="object")?e:null,[e,f]),h=f?p:null,D=f&&tr(h),m=C("shared.placeholder.short"),x=i.useMemo(()=>lt.map(b=>b.key),[]),{order:w,reorder:S}=sa(x),v=i.useMemo(()=>{const b=new Map;for(const I of lt)b.set(I.key,I);return b},[]),R=i.useMemo(()=>w.map(b=>v.get(b)).filter(Boolean),[w,v]),j=Cr(Vt(Ft,{activationConstraint:{distance:6}}),Vt(zt,{coordinateGetter:Jo})),A=i.useCallback(b=>{const{active:I,over:oe}=b;!oe||I.id===oe.id||S(String(I.id),String(oe.id))},[S]),[k,y]=i.useState(1),[L,O]=i.useState(0),[N,X]=i.useState(()=>({loading:!1,error:null,data:null})),[q,ne]=i.useState(()=>nr()),[xe,je]=i.useState(!1),T=i.useMemo(()=>{const b=new URLSearchParams(r?.search||"");return Tt(b.get("period"))||"total"},[r?.search]),Ie=r?.search||"",ie=b=>{const I=Tt(b);if(!I||I===T)return;const oe=new URLSearchParams(r?.search||"");oe.set("period",I),y(1),o(`${r?.pathname||"/leaderboard"}?${oe.toString()}`,{replace:!0})};i.useEffect(()=>{l||g||s||a()},[s,l,g,a]),i.useEffect(()=>{y(1)},[T]);const ve=i.useMemo(()=>(Oe(k,{min:1,max:1e6,fallback:1})-1)*st,[k]);i.useEffect(()=>{if(!u&&!g)return;let b=!0;return X(I=>({...I,loading:!0,error:null})),(async()=>{const I=await rr({userId:c?.id||null,period:T,limit:st,offset:ve});b&&X({loading:!1,error:null,data:I})})().catch(I=>{b&&X({loading:!1,error:la(I),data:null})}),()=>{b=!1}},[u,c?.id,ve,L,g,T]);const H=N.data,P=H?.total_pages??null,$=H?.page??k,be=i.useMemo(()=>Zo($,P),[$,P]),ye=H?.from||null,Y=H?.to||null,Ae=H?.generated_at||null,le=H?.me||null,J=C("leaderboard.me_label"),M=C("leaderboard.anon_label"),we=C("leaderboard.period.week"),Q=C("leaderboard.period.month"),pe=C("leaderboard.period.total"),re=T==="month"?Q:T==="total"?pe:we,ue=i.useMemo(()=>{const b=Array.isArray(H?.entries)?H.entries:[];return $!==1?b:ta({entries:b,me:le,meLabel:J,limit:st})},[$,H?.entries,le,J]),ke=async()=>{je(!0);try{ar(!0),ne(!0),await sr(()=>Ht(h));const b=await Ht(h);b&&await ir({accessToken:b,period:T,source:"leaderboard-enable-sync"}),O(I=>I+1)}catch(b){console.warn("[tokentracker] sync:",b)}finally{je(!1)}},{canPrev:ze,canNext:$e}=ea({page:$,totalPages:P}),Fe=Array.isArray(ue)&&ue.length!==0;let K=null;N.loading?K=d.jsx(ra,{rows:st}):N.error?K=d.jsx("div",{className:"px-6 py-12 text-center",children:d.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:N.error})}):Fe?K=d.jsx(No,{sensors:j,collisionDetection:Rr,modifiers:[Oo],onDragEnd:A,children:d.jsx("div",{className:"w-full overflow-x-auto",children:d.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[d.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:d.jsxs("tr",{children:[d.jsx("th",{className:_(bn,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:C("leaderboard.column.rank")}),d.jsx("th",{className:_(pn,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:C("leaderboard.column.user")}),d.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:C("leaderboard.column.total")}),d.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:C("leaderboard.column.est_cost")}),d.jsx(Fo,{items:w,strategy:zo,children:R.map(b=>d.jsx(oa,{id:b.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:d.jsx(cr,{iconSrc:b.icon,label:C(b.copyKey)})},b.key))})]})}),d.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:ue.map(b=>{const I=!!b?.is_me,oe=typeof b?.user_id=="string"?b.user_id:null,rt=Un(b?.display_name),mt=ca(rt)?M:rt,W=I?J:mt;return!!oe&&!I&&!!b?.is_public&&da(oe,Ie),I?d.jsxs("tr",{className:"border-y border-oai-brand-300/40 dark:border-oai-brand-500/30 bg-oai-brand-50 dark:bg-oai-brand-900/10 transition-colors",children:[d.jsx("td",{className:_(Rt(!0),"font-semibold text-oai-brand-600 dark:text-oai-brand-400"),children:d.jsx(fn,{rank:b?.rank,placeholder:m})}),d.jsx("td",{className:Nt(!0),children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(Kt,{avatarUrl:b?.avatar_url,displayName:W,seed:gn(b,W)}),d.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:W}),b?.github_url&&d.jsx(hn,{githubUrl:b.github_url})]})}),d.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:Dt(b?.total_tokens)}),d.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:dn(b?.estimated_cost_usd)}),un(b,!0,R)]},`row-${b?.rank}-${W}`):d.jsxs("tr",{className:"group transition-colors",children:[d.jsx("td",{className:_(Rt(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(fn,{rank:b?.rank,placeholder:m})}),d.jsx("td",{className:Nt(!1),children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(Kt,{avatarUrl:b?.avatar_url,displayName:W,seed:gn(b,W)}),d.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:W}),b?.github_url&&d.jsx(hn,{githubUrl:b.github_url})]})}),d.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:Dt(b?.total_tokens)}),d.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:dn(b?.estimated_cost_usd)}),un(b,!1,R)]},`row-${b?.rank}-${W}`)})})]})})}):K=d.jsx("div",{className:"px-6 py-12 text-center",children:d.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.empty")})});let Se=null;return typeof P=="number"?Se=be.map((b,I)=>b==null?d.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:C("leaderboard.pagination.ellipsis")},`ellipsis-${I}`):d.jsx("button",{className:_("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",b===$?"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:()=>y(b),disabled:N.loading,children:String(b)},`page-${b}`)):Se=d.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.pagination.page_unknown",{page:String($)})}),d.jsxs("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:[d.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:d.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[d.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-8",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:C("leaderboard.title")}),d.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[T==="total"?C("leaderboard.range.total"):ye&&Y?C("leaderboard.range",{period:re,from:ye,to:Y}):C("leaderboard.range_loading",{period:re}),Ae&&d.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:C("leaderboard.generated_at",{ts:Ae})})]})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("div",{className:"inline-flex p-1 border border-oai-gray-200 dark:border-oai-gray-800 rounded-lg",children:["week","month","total"].map(b=>d.jsx("button",{onClick:()=>ie(b),disabled:N.loading,className:_("px-4 py-1.5 text-sm font-medium rounded-md transition-colors",T===b?"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:text-oai-gray-800 dark:hover:text-oai-gray-200"),children:b==="week"?we:b==="month"?Q:pe},b))})})]}),!t&&d.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[d.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.signin_prompt")}),d.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:C("leaderboard.signin_button")})]}),f&&D&&!q&&d.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[d.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.sync_prompt")}),d.jsx("button",{onClick:ke,disabled:xe,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:xe?C("leaderboard.sync_button.busy"):C("leaderboard.sync_button.idle")})]}),d.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:[K,d.jsxs("div",{className:"px-6 py-3 border-t border-oai-gray-200 dark:border-oai-gray-800 flex flex-wrap items-center justify-between gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{className:_("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",ze&&!N.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:()=>y(b=>Math.max(1,b-1)),disabled:!ze||N.loading,children:C("leaderboard.pagination.prev")}),d.jsx("button",{className:_("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",$e&&!N.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:()=>y(b=>b+1),disabled:!$e||N.loading,children:C("leaderboard.pagination.next")})]}),d.jsx("div",{className:"flex flex-wrap items-center gap-1",children:Se})]})]})]})}),d.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:d.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:[d.jsx("p",{children:C("landing.v2.footer.line")}),d.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:C("landing.v2.nav.github")})]})})]})}export{ha as LeaderboardPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,D as e,aB as U,C as $,aD as W,h as Y,j as Z,aH as G,aJ as J,B as a,aA as L,ay as R,a9 as E,aK as q,aL as F}from"./main-
|
|
1
|
+
import{r as n,D as e,aB as U,C as $,aD as W,h as Y,j as Z,aH as G,aJ as J,B as a,aA as L,ay as R,a9 as E,aK as q,aL as F}from"./main-Ry0vayW2.js";import{b as I,d as Q,l as V,f as X,e as ee,L as re,g as ae}from"./leaderboard-columns-BUl7-rVO.js";const y=18;function O(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2"}),e.jsx("path",{d:"M12 20v2"}),e.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),e.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),e.jsx("path",{d:"M2 12h2"}),e.jsx("path",{d:"M20 12h2"}),e.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),e.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function P(){return e.jsx("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function te(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8"}),e.jsx("path",{d:"M12 17v4"})]})}const oe=[{value:"light",label:"Light",Icon:O},{value:"dark",label:"Dark",Icon:P},{value:"system",label:"System",Icon:te}];function se(r){return r==="dark"?P:O}function ne({theme:r,resolvedTheme:s,onSetTheme:b,className:d="",direction:p="down",align:T="right"}){const[c,k]=n.useState(!1),h=n.useRef(null),x=n.useCallback(()=>k(!1),[]);n.useEffect(()=>{if(!c)return;const t=l=>{h.current&&!h.current.contains(l.target)&&x()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[c,x]),n.useEffect(()=>{if(!c)return;const t=l=>{l.key==="Escape"&&x()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[c,x]);const i=se(s);return e.jsxs("div",{ref:h,className:`relative ${d}`,children:[e.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":c,onClick:()=>k(t=>!t),className:"flex items-center justify-center w-9 h-9 rounded-lg 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",children:e.jsx(i,{})}),c&&e.jsx("div",{className:`absolute z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg ${p==="up"?"bottom-full mb-1":"top-full mt-1"} ${T==="left"?"left-0":"right-0"}`,children:oe.map(({value:t,label:l,Icon:j})=>{const m=r===t;return e.jsxs("button",{type:"button",onClick:()=>{b(t),x()},className:`flex w-full items-center gap-2.5 px-3 py-2 text-sm transition-colors ${m?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"}`,children:[e.jsx(j,{}),e.jsx("span",{children:l})]},t)})})]})}function ie(r){if(!r)return a("shared.error.prefix",{error:a("leaderboard.error.unknown")});const s=r?.message||String(r),b=String(s||"").trim()||a("leaderboard.error.unknown");return a("shared.error.prefix",{error:b})}function le(r){return typeof r!="string"?"":r.trim()}function de(r){if(typeof r!="string")return null;const s=r.trim().toLowerCase();return s==="week"||s==="month"||s==="total"?s:null}function me({auth:r,signedIn:s,sessionSoftExpired:b,userId:d}){const p=U(),{theme:T,resolvedTheme:c,setTheme:k}=$(),h=n.useMemo(()=>W(),[]),x=Y(),i=s&&!b,t=n.useMemo(()=>i&&(typeof r=="function"||typeof r=="string"||r&&typeof r=="object")?r:null,[r,i]),l=i?t:null,j=i&&Z(l),m=n.useMemo(()=>{const o=new URLSearchParams(p?.search||"");return de(o.get("period"))||"week"},[p?.search]),_=p?.search||"",[v,w]=n.useState(()=>({loading:!1,error:null,data:null}));n.useEffect(()=>{if(!h&&!x||!d||i&&!j)return;let o=!0;return w(f=>({...f,loading:!0,error:null})),(async()=>{const f=i?await G(l):null;if(!o)return;const K=await J({accessToken:f,userId:d,period:m});o&&w({loading:!1,error:null,data:K})})().catch(f=>{if(o){if(f?.status===404){w({loading:!1,error:null,data:null});return}w({loading:!1,error:ie(f),data:null})}}),()=>{o=!1}},[i,j,h,l,x,m,d]);const N=v.data,A=N?.from||null,C=N?.to||null,M=N?.generated_at||null,g=N?.entry||null,S=le(g?.display_name)||a("leaderboard.anon_label"),z=a("leaderboard.period.week"),D=a("leaderboard.period.month"),H=a("leaderboard.period.total"),B=m==="month"?D:m==="total"?H:z;let u=null;return d?v.loading?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.loading")})}):v.error?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:v.error})}):g?u=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:L(re,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a("leaderboard.column.rank")}),e.jsx("th",{className:L(ae,"font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap"),children:a("leaderboard.column.total")}),I.map(o=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(Q,{iconSrc:o.icon,label:a(o.copyKey)})},o.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:e.jsxs("tr",{className:"transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("td",{className:L(V(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:g?.rank??a("shared.placeholder.short")}),e.jsx("td",{className:L(X(),"text-oai-gray-700 dark:text-oai-gray-300"),children:R(g?.total_tokens)}),I.map(o=>e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:R(g?.[o.key])},o.key))]})})]})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(E,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(q,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(E,{to:`/leaderboard${_}`,className:"no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors",children:a("leaderboard.profile.nav.back")}),e.jsx(ne,{theme:T,resolvedTheme:c,onSetTheme:k}),e.jsx(F,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 mb-10",children:[e.jsx(ee,{avatarUrl:g?.avatar_url,displayName:S,seed:typeof d=="string"?d:S,size:"lg",className:"shrink-0 ring-2 ring-oai-gray-200 dark:ring-oai-gray-800"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:S}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[m==="total"?a("leaderboard.range.total"):A&&C?a("leaderboard.range",{period:B,from:A,to:C}):a("leaderboard.range_loading",{period:B}),M&&e.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:a("leaderboard.generated_at",{ts:M})})]})]})]}),e.jsx("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:u})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.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:[e.jsx("p",{children:a("landing.v2.footer.line")}),e.jsx(E,{to:`/leaderboard${_}`,className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:a("leaderboard.profile.nav.back")})]})})]})}export{me as LeaderboardProfilePage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as r,aA as _,B as o,r as b,a9 as f,aM as j}from"./main-
|
|
1
|
+
import{D as r,aA as _,B as o,r as b,a9 as f,aM as j}from"./main-Ry0vayW2.js";import{u as v}from"./use-usage-limits-CxmDpqkS.js";import{u as k}from"./use-limits-display-prefs-mlXe4VuM.js";import{C as y}from"./Card-D4LPt5pl.js";import{F as N}from"./FadeIn-Bw7pQont.js";const L=[3,2,3,3,2,2,3];function d({className:s}){return r.jsx("div",{className:_("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",s)})}function P(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(d,{className:"h-3 w-12 shrink-0"}),r.jsx(d,{className:"flex-1 h-1.5 rounded-full min-w-0"}),r.jsx(d,{className:"h-3 w-[30px] shrink-0"}),r.jsx(d,{className:"h-3 w-6 shrink-0"})]})}function C({bars:s,index:e}){const l=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(d,{className:"h-[14px] w-[14px] rounded shrink-0"}),r.jsx(d,{className:_("h-4",l)})]}),Array.from({length:s},(i,a)=>r.jsx(P,{},a))]})}function E(){return r.jsx(y,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(d,{className:"h-3.5 w-28"}),L.map((s,e)=>r.jsx(C,{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 l=e-Date.now();if(l<=0)return o("shared.time.now");const i=Math.floor(l/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function O(s){return s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500"}function n({label:s,pct:e,reset:l}){const i=Math.max(0,Math.min(100,Number(e)||0)),a=Math.round(i),x=i>0&&a===0?Math.max(i,.35):i,u=i>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:`${O(a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${x}%`,minWidth:i>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:[u,"%"]}),l?r.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:l}):null]})}function c({name:s,icon:e,children:l}){const a=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.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})]}),l]})}const T=["claude","codex","cursor","gemini","kiro","copilot","antigravity"];function R(s,e){if(!(i=>i?.configured&&!i.error)(e))return null;switch(s){case"claude":return r.jsxs(c,{name:"Claude",icon:"/brand-logos/claude-code.svg",children:[e.five_hour?r.jsx(n,{label:"5h",pct:e.five_hour.utilization,reset:t(e.five_hour.resets_at)}):null,e.seven_day?r.jsx(n,{label:"7d",pct:e.seven_day.utilization,reset:t(e.seven_day.resets_at)}):null,e.seven_day_opus?r.jsx(n,{label:"Opus",pct:e.seven_day_opus.utilization,reset:t(e.seven_day_opus.resets_at)}):null]},"claude");case"codex":return r.jsxs(c,{name:"Codex",icon:"/brand-logos/codex.svg",children:[e.primary_window?r.jsx(n,{label:"5h",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"7d",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"codex");case"cursor":return r.jsxs(c,{name:"Cursor",icon:"/brand-logos/cursor.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:o("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"cursor");case"gemini":return r.jsxs(c,{name:"Gemini",icon:"/brand-logos/gemini.svg",children:[e.primary_window?r.jsx(n,{label:"Pro",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"Flash",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Lite",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"gemini");case"kiro":return r.jsxs(c,{name:"Kiro",icon:"/brand-logos/kiro.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"kiro");case"antigravity":return r.jsxs(c,{name:"Antigravity",icon:"/brand-logos/antigravity.svg",children:[e.primary_window?r.jsx(n,{label:"Claude",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"G Pro",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Flash",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"antigravity");case"copilot":return r.jsxs(c,{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.otel_has_files||e.otel_enabled?null:r.jsx(A,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function A({defaultDir:s}){const[e,l]=b.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
2
|
`),x=async()=>{try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!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:o("limits.copilot.otelHint.title")}),r.jsx("div",{className:"mt-0.5 leading-snug",children:o("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:x,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?o("limits.copilot.otelHint.copied"):o("limits.copilot.otelHint.copy")})]})}function D({claude:s,codex:e,cursor:l,gemini:i,kiro:a,antigravity:x,copilot:u,order:p,visibility:w}){const h={claude:s,codex:e,cursor:l,gemini:i,kiro:a,antigravity:x,copilot:u},g=(Array.isArray(p)&&p.length>0?p:T).filter(m=>!w||w[m]!==!1).map(m=>R(m,h[m])).filter(Boolean);return g.length===0?null:r.jsx(N,{delay:.15,children:r.jsx(y,{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:o("limits.panel.title")}),g]})})})}function $(){const{data:s,error:e,isLoading:l}=v({initialRefresh:!0}),i=k();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:o("nav.limits")}),r.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:o("limits.page.subtitle")})]}),r.jsx(f,{to:"/settings","aria-label":o("limits.page.openSettings"),title:o("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(j,{className:"h-4 w-4","aria-hidden":!0})})]}),l?r.jsx(E,{}):r.jsxs(r.Fragment,{children:[e?r.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:o("shared.error.prefix",{error:e})}):null,r.jsx(D,{claude:s?.claude,codex:s?.codex,cursor:s?.cursor,gemini:s?.gemini,kiro:s?.kiro,antigravity:s?.antigravity,copilot:s?.copilot,order:i.order,visibility:i.visibility})]})]})})})}export{$ as LimitsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as c}from"./main-
|
|
1
|
+
import{D as c}from"./main-Ry0vayW2.js";function i({size:l=16,className:n=""}){return c.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:n,children:c.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 h({size:l=16,className:n=""}){return c.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:n,children:c.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 d({size:l=16,className:n=""}){return c.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:n,children:c.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 a({size:l=16,className:n=""}){return c.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:n,children:c.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 u({size:l=16,className:n=""}){return c.jsx("svg",{width:l,height:l,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:n,children:c.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 v({size:l=16,className:n=""}){return c.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:n,children:c.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function s({size:l=16,className:n=""}){return c.jsxs("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:n,children:[c.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"}),c.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 x({size:l=16,className:n=""}){return c.jsx("svg",{width:l,height:l,viewBox:"0 0 16 16",fill:"currentColor",className:n,children:c.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"})})}const f={CLAUDE:i,CODEX:h,CURSOR:d,GEMINI:a,GITHUB:x,KIMI:s,KIRO:u,OPENCODE:v};function j({provider:l,size:n=16,color:o,className:r=""}){const t=l?.toUpperCase?.()||"",e=f[t];return e?c.jsx(e,{size:n,className:r}):c.jsx("div",{className:"rounded-full shrink-0",style:{width:n*.5,height:n*.5,backgroundColor:o}})}export{j as P};
|