tokentracker-cli 0.83.2 → 0.83.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dashboard/dist/assets/{AchievementBadge-BrSr5pjk.js → AchievementBadge-Cj42BYfJ.js} +1 -1
  2. package/dashboard/dist/assets/{AchievementsPage-za-wqAO2.js → AchievementsPage-B41jhL7x.js} +2 -2
  3. package/dashboard/dist/assets/{AchievementsSection-CGRVm1uS.js → AchievementsSection-Lp1iynwg.js} +1 -1
  4. package/dashboard/dist/assets/{BadgeDetailModal-D1XDT2dG.js → BadgeDetailModal-DuaMzaGW.js} +1 -1
  5. package/dashboard/dist/assets/{Card-DX2Wwm9U.js → Card-CBJAS2Mp.js} +1 -1
  6. package/dashboard/dist/assets/{ClawdAnimated-D6JzFu8y.js → ClawdAnimated-C-Hry4YB.js} +1 -1
  7. package/dashboard/dist/assets/{CommandPalette-NWiETwtS.js → CommandPalette-CTJBaWpw.js} +1 -1
  8. package/dashboard/dist/assets/{CommunityStatsModal-D4FdxAWd.js → CommunityStatsModal-qSclg4Bj.js} +1 -1
  9. package/dashboard/dist/assets/{ConfirmModal-SAheZUAv.js → ConfirmModal-Dh3VzEaA.js} +1 -1
  10. package/dashboard/dist/assets/DashboardPage-BYnPMlX8.js +1 -0
  11. package/dashboard/dist/assets/{DevicePage-Cf-PHRlL.js → DevicePage-BrH5YYqa.js} +1 -1
  12. package/dashboard/dist/assets/{DialogClose-pg5pVOeD.js → DialogClose-CH61tv1C.js} +1 -1
  13. package/dashboard/dist/assets/DialogDescription-DqSqTcXg.js +1 -0
  14. package/dashboard/dist/assets/{DialogTitle-Im7ESzoS.js → DialogTitle-D945fBHg.js} +1 -1
  15. package/dashboard/dist/assets/{FadeIn-CGGFraHR.js → FadeIn-PByY-20e.js} +1 -1
  16. package/dashboard/dist/assets/{HeaderGithubStar-DRTZXRsx.js → HeaderGithubStar-JqnF9WrS.js} +1 -1
  17. package/dashboard/dist/assets/{IpCheckPage-Dn62HUZu.js → IpCheckPage-BL8s0rdr.js} +1 -1
  18. package/dashboard/dist/assets/{LandingPage-CLsljoir.js → LandingPage-Dq0YMelT.js} +2 -2
  19. package/dashboard/dist/assets/{LeaderboardAvatar-DktI_89h.js → LeaderboardAvatar-BV85AG35.js} +1 -1
  20. package/dashboard/dist/assets/{LeaderboardPage-t87ElnDI.js → LeaderboardPage-CW9nMYRr.js} +2 -2
  21. package/dashboard/dist/assets/{LeaderboardProfileModal-DN7HurS3.js → LeaderboardProfileModal-DF5nu051.js} +3 -3
  22. package/dashboard/dist/assets/{LeaderboardProfilePage-CprOXLXX.js → LeaderboardProfilePage-Cid2lIXh.js} +1 -1
  23. package/dashboard/dist/assets/{LimitsPage-DRX3XMYx.js → LimitsPage-D_SjLBQb.js} +1 -1
  24. package/dashboard/dist/assets/{LocalOnlyNotice-B8BtIdAA.js → LocalOnlyNotice-BgjVuk6t.js} +1 -1
  25. package/dashboard/dist/assets/{LoginCard-OoduGJmK.js → LoginCard-DcOOJ7F4.js} +1 -1
  26. package/dashboard/dist/assets/{LoginModal-DoDoCpr6.js → LoginModal-BmbXCQpU.js} +1 -1
  27. package/dashboard/dist/assets/{LoginPage-Dn2KMisI.js → LoginPage-BReX-hIM.js} +1 -1
  28. package/dashboard/dist/assets/{PetPage-CVaG5H3O.js → PetPage-cKhD5kRw.js} +1 -1
  29. package/dashboard/dist/assets/{PopoverPopup-B2HqJNaq.js → PopoverPopup-BL8WWGQD.js} +1 -1
  30. package/dashboard/dist/assets/{ProviderIcon-BYl1Yyf3.js → ProviderIcon-Dv8LjXBc.js} +1 -1
  31. package/dashboard/dist/assets/{ResetPasswordPage-DWfgvuvR.js → ResetPasswordPage-BggDvUTE.js} +1 -1
  32. package/dashboard/dist/assets/{Select-ClnnGJY1.js → Select-DFLOEvtQ.js} +1 -1
  33. package/dashboard/dist/assets/{SelectItemText-iaFWq7GD.js → SelectItemText-l_IytZ1x.js} +1 -1
  34. package/dashboard/dist/assets/{SettingsPage-zwAOWRur.js → SettingsPage-DD6EiVg7.js} +1 -1
  35. package/dashboard/dist/assets/{SkillsPage-BB96nB2i.js → SkillsPage-DJeX_hFu.js} +1 -1
  36. package/dashboard/dist/assets/{TokenGalaxy-9_VJKdPr.js → TokenGalaxy-CvtOZNXz.js} +1 -1
  37. package/dashboard/dist/assets/TrendMonitor-CbFaoSZx.js +19 -0
  38. package/dashboard/dist/assets/{WidgetsPage-CjAT6p0C.js → WidgetsPage-Dj37UajB.js} +1 -1
  39. package/dashboard/dist/assets/{WrappedPage-ba6teG1N.js → WrappedPage-BbRezT_v.js} +1 -1
  40. package/dashboard/dist/assets/{__vite-browser-external-DWKjPxnU.js → __vite-browser-external-BRzJpYc1.js} +2 -2
  41. package/dashboard/dist/assets/__vite-browser-external-C44tPAD-.css +1 -0
  42. package/dashboard/dist/assets/{agent-logos-HCzl7U8i.js → agent-logos-C2WjBjZi.js} +1 -1
  43. package/dashboard/dist/assets/{arrow-up-right-TvEj8NTT.js → arrow-up-right-_bkVN_-t.js} +1 -1
  44. package/dashboard/dist/assets/{check-Cz3lYRiR.js → check-QQtC-jGr.js} +1 -1
  45. package/dashboard/dist/assets/{copy-CTtF84H9.js → copy-tnrXJIlX.js} +1 -1
  46. package/dashboard/dist/assets/{download-B5WAY6Nh.js → download-DJgEaI-n.js} +1 -1
  47. package/dashboard/dist/assets/{flame-Cja4F8Mj.js → flame-D7el_0f3.js} +1 -1
  48. package/dashboard/dist/assets/{format-tokens-UavRPN4W.js → format-tokens-CmFsnNFY.js} +1 -1
  49. package/dashboard/dist/assets/{icons-BW2vjmu_.js → icons-D__mI241.js} +1 -1
  50. package/dashboard/dist/assets/{index-0w19KMWl.js → index-1pzviHs-.js} +1 -1
  51. package/dashboard/dist/assets/{index-Bfxr6erc.js → index-CKS8Swvi.js} +1 -1
  52. package/dashboard/dist/assets/{index-BnzrUY9J.js → index-DG0NZ_W7.js} +1 -1
  53. package/dashboard/dist/assets/{info-F-75j15K.js → info-7xyGxNal.js} +1 -1
  54. package/dashboard/dist/assets/{limits-providers-8NsMiLNP.js → limits-providers-D8LfR6Om.js} +1 -1
  55. package/dashboard/dist/assets/{link-2-C_eJlLvb.js → link-2-DRYdgDC2.js} +1 -1
  56. package/dashboard/dist/assets/{loader-circle-BjzQhjhO.js → loader-circle-CX24zxqF.js} +1 -1
  57. package/dashboard/dist/assets/{provider-display-D1zp03ID.js → provider-display-DPIFKw3O.js} +1 -1
  58. package/dashboard/dist/assets/{react-Nv3-bJyw.js → react-D9H9IC9r.js} +1 -1
  59. package/dashboard/dist/assets/{skills-api-DazKXxME.js → skills-api-BVQc9owa.js} +1 -1
  60. package/dashboard/dist/assets/{terminal-DBXjwlTm.js → terminal-4058d4_A.js} +1 -1
  61. package/dashboard/dist/assets/{trash-2-DLG8hKJm.js → trash-2-D3cJG7LG.js} +1 -1
  62. package/dashboard/dist/assets/{use-community-stats-BQB72xAN.js → use-community-stats-MKJhkjxa.js} +1 -1
  63. package/dashboard/dist/assets/{use-limits-display-prefs-CH8MmjYf.js → use-limits-display-prefs-FXO2f5fy.js} +1 -1
  64. package/dashboard/dist/assets/{use-native-settings-__RhxrW5.js → use-native-settings-BeED1BpH.js} +1 -1
  65. package/dashboard/dist/assets/{use-ordered-list-AhnqpdnT.js → use-ordered-list-D1Ts8ut3.js} +1 -1
  66. package/dashboard/dist/assets/use-reduced-motion-8J-IDPSQ.js +1 -0
  67. package/dashboard/dist/assets/{use-session-efficiency-pref-CCYtJ_cN.js → use-session-efficiency-pref-CtzlSied.js} +1 -1
  68. package/dashboard/dist/assets/{use-transform-BhcppNI4.js → use-transform-CO582voD.js} +1 -1
  69. package/dashboard/dist/assets/{use-usage-limits-CbA095lv.js → use-usage-limits-Ca15KPkK.js} +1 -1
  70. package/dashboard/dist/assets/{useCurrency-Dt2GqkDm.js → useCurrency-CKFbWGkT.js} +1 -1
  71. package/dashboard/dist/assets/{useScrollLock-C5d53j7C.js → useScrollLock-DNdxd1UW.js} +1 -1
  72. package/dashboard/dist/assets/{useTokenFormat-dnqZK7Z-.js → useTokenFormat-DTK4cojM.js} +1 -1
  73. package/dashboard/dist/assets/{zap-Bw5OO91s.js → zap-DDCrktFO.js} +1 -1
  74. package/dashboard/dist/index.html +2 -2
  75. package/dashboard/dist/share.html +2 -2
  76. package/package.json +1 -1
  77. package/src/lib/pricing/seed-snapshot.json +1 -1
  78. package/dashboard/dist/assets/DashboardPage-CjnBsm3Q.js +0 -1
  79. package/dashboard/dist/assets/DialogDescription-CVuGFYFU.js +0 -1
  80. package/dashboard/dist/assets/TrendMonitor-D9RHcQgH.js +0 -19
  81. package/dashboard/dist/assets/__vite-browser-external-D_0JUhT7.css +0 -1
  82. package/dashboard/dist/assets/use-reduced-motion-CA2IXeeO.js +0 -1
@@ -1 +1 @@
1
- import{k as l,J as u}from"./__vite-browser-external-DWKjPxnU.js";const f=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],k=l("search",f),c="tokentracker-skills";async function r(e){const t=new URL(`/functions/${c}`,window.location.origin);if(e)for(const[i,s]of Object.entries(e))s!=null&&s!==""&&t.searchParams.set(i,String(s));const o=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await o.json().catch(()=>null);if(!o.ok)throw new Error(a?.error||`Request failed with HTTP ${o.status}`);return a}async function n(e){const t=await u(),o=await fetch(`/functions/${c}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),a=await o.json().catch(()=>null);if(!o.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${o.status}`);return a}function p(){return r({mode:"installed"})}function h(e={}){return r({mode:"discover",...e.force?{force:1}:{}})}function S(e,t=0,o=20){return r({mode:"search",q:e,offset:t,limit:o})}function m(){return r({mode:"repos"})}function g(e,t){return n({action:"install",skill:e,targets:t})}function w(e){return n({action:"uninstall",id:e})}function y(e){return n({action:"restore",id:e})}function j(e,t){return n({action:"set_targets",id:e,targets:t})}function _(e,t){return n({action:"import_local",directory:e,targets:t})}function T(e,t){return n({action:"delete_local",directory:e,targets:t||[]})}function L(e){return n({action:"add_repo",repo:e})}function R(e,t){return n({action:"remove_repo",owner:e,name:t})}function v(e={}){return r({mode:"popular",...e.force?{force:1}:{}})}function P(e={}){return r({mode:"updates",...e.force?{force:1}:{}})}function A(e={}){return r({mode:"skill_usage",...e.force?{force:1}:{}})}export{k as S,m as a,v as b,P as c,h as d,A as e,T as f,p as g,j as h,g as i,_ as j,R as k,L as l,y as r,S as s,w as u};
1
+ import{k as l,J as u}from"./__vite-browser-external-BRzJpYc1.js";const f=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],k=l("search",f),c="tokentracker-skills";async function r(e){const t=new URL(`/functions/${c}`,window.location.origin);if(e)for(const[i,s]of Object.entries(e))s!=null&&s!==""&&t.searchParams.set(i,String(s));const o=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await o.json().catch(()=>null);if(!o.ok)throw new Error(a?.error||`Request failed with HTTP ${o.status}`);return a}async function n(e){const t=await u(),o=await fetch(`/functions/${c}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),a=await o.json().catch(()=>null);if(!o.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${o.status}`);return a}function p(){return r({mode:"installed"})}function h(e={}){return r({mode:"discover",...e.force?{force:1}:{}})}function S(e,t=0,o=20){return r({mode:"search",q:e,offset:t,limit:o})}function m(){return r({mode:"repos"})}function g(e,t){return n({action:"install",skill:e,targets:t})}function w(e){return n({action:"uninstall",id:e})}function y(e){return n({action:"restore",id:e})}function j(e,t){return n({action:"set_targets",id:e,targets:t})}function _(e,t){return n({action:"import_local",directory:e,targets:t})}function T(e,t){return n({action:"delete_local",directory:e,targets:t||[]})}function L(e){return n({action:"add_repo",repo:e})}function R(e,t){return n({action:"remove_repo",owner:e,name:t})}function v(e={}){return r({mode:"popular",...e.force?{force:1}:{}})}function P(e={}){return r({mode:"updates",...e.force?{force:1}:{}})}function A(e={}){return r({mode:"skill_usage",...e.force?{force:1}:{}})}export{k as S,m as a,v as b,P as c,h as d,A as e,T as f,p as g,j as h,g as i,_ as j,R as k,L as l,y as r,S as s,w as u};
@@ -1 +1 @@
1
- import{k as t}from"./__vite-browser-external-DWKjPxnU.js";const a=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],i=t("maximize-2",a);const e=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],m=t("terminal",e);export{i as M,m as T};
1
+ import{k as t}from"./__vite-browser-external-BRzJpYc1.js";const a=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],i=t("maximize-2",a);const e=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],m=t("terminal",e);export{i as M,m as T};
@@ -1 +1 @@
1
- import{k as a}from"./__vite-browser-external-DWKjPxnU.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
1
+ import{k as a}from"./__vite-browser-external-BRzJpYc1.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
@@ -1 +1 @@
1
- import{r as p,g as N,b as M}from"./__vite-browser-external-DWKjPxnU.js";const D=6e3,S=2500,E=100;function h(t,r){let o;const n=new Promise((a,i)=>{o=setTimeout(()=>i(new Error("landing stats timeout")),r)});return Promise.race([t,n]).finally(()=>{o!=null&&clearTimeout(o)})}const A=5*6e4,P=1440*6e4,k="tokentracker:community-stats:v2";let s=null;function C(t){const r=Number(t?.tokenFloor)||0,o=Number(t?.totalEntries)||0;return!(r>0)||!(o>0)?null:{tokenFloor:r,totalEntries:o,top:Array.isArray(t?.top)?t.top:[],topModels:Array.isArray(t?.topModels)?t.topModels:[],providers:Array.isArray(t?.providers)?t.providers:[],dailyGrowth:Array.isArray(t?.dailyGrowth)?t.dailyGrowth:[],tokenMix:Array.isArray(t?.tokenMix)?t.tokenMix:[],userDistribution:Array.isArray(t?.userDistribution)?t.userDistribution:[],platforms:Array.isArray(t?.platforms)?t.platforms:[],activeDevelopersTotal:Number(t?.activeDevelopersTotal)||0,activeDevelopers30d:Number(t?.activeDevelopers30d)||0,tokens30d:Number(t?.tokens30d)||0,tokenGrowthPct:t?.tokenGrowthPct!=null&&Number.isFinite(Number(t.tokenGrowthPct))?Number(t.tokenGrowthPct):null,developerGrowthPct:t?.developerGrowthPct!=null&&Number.isFinite(Number(t.developerGrowthPct))?Number(t.developerGrowthPct):null,generatedAt:typeof t?.generatedAt=="string"?t.generatedAt:null}}function G(){if(typeof window>"u"||!window.localStorage)return null;try{const t=JSON.parse(window.localStorage.getItem(k)||"null"),r=Number(t?.cachedAt)||0,o=C(t?.data),n=Date.now()-r;return!o||n<0||n>P?null:{data:o,isFresh:n<A}}catch{return null}}function I(t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(k,JSON.stringify({cachedAt:Date.now(),data:t}))}catch{}}function F(){if(s&&Date.now()-s.at<A)return s.promise;const t=Promise.all([h(N({period:"total",limit:E,offset:0}),D),h(M(),S).catch(()=>null)]);return s={at:Date.now(),promise:t},t.catch(()=>{s?.promise===t&&(s=null)}),t}function O({enabled:t=!0}={}){const[r]=p.useState(()=>G()),[o,n]=p.useState(()=>r?{status:"ready",...r.data}:{status:"loading",tokenFloor:null,totalEntries:null,top:[]});return p.useEffect(()=>{if(!t||r?.isFresh)return;let a=!1,i=null,u=null;const y=async()=>{try{const[l,e]=await F();if(a)return;const c=Array.isArray(l?.entries)?l.entries:[],b=c.reduce((m,T)=>m+(Number(T?.total_tokens)||0),0),d=Number(e?.total_tokens)||0;d>0||(s=null);const w=Number(r?.data?.tokenFloor)||0,f=d>0?d:w>0?w:b;if(!c.length||!(f>0)){n(m=>({...m,status:"error"}));return}const g=Array.isArray(e?.top_models)?e.top_models:r?.data?.topModels||[],_={tokenFloor:f,totalEntries:Number(l?.total_entries)||c.length,top:c.slice(0,3),topModels:g,providers:Array.isArray(e?.providers)?e.providers:[],dailyGrowth:Array.isArray(e?.daily_growth)?e.daily_growth:[],tokenMix:Array.isArray(e?.token_mix)?e.token_mix:[],userDistribution:Array.isArray(e?.user_distribution)?e.user_distribution:[],platforms:Array.isArray(e?.platforms)?e.platforms:[],activeDevelopersTotal:Number(e?.active_developers_total)||0,activeDevelopers30d:Number(e?.active_developers_30d)||0,tokens30d:Number(e?.tokens_30d)||0,tokenGrowthPct:e?.token_growth_pct==null?null:Number(e.token_growth_pct),developerGrowthPct:e?.developer_growth_pct==null?null:Number(e.developer_growth_pct),generatedAt:typeof e?.generated_at=="string"?e.generated_at:null};n({status:"ready",..._}),d>0&&I(_)}catch{a||n(e=>e.status==="ready"?e:{...e,status:"error"})}};return typeof window<"u"&&"requestIdleCallback"in window?i=window.requestIdleCallback(y,{timeout:1500}):u=setTimeout(y,400),()=>{a=!0,i!=null&&typeof window.cancelIdleCallback=="function"&&window.cancelIdleCallback(i),u!=null&&clearTimeout(u)}},[t,r]),o}export{O as u};
1
+ import{r as p,g as N,b as M}from"./__vite-browser-external-BRzJpYc1.js";const D=6e3,S=2500,E=100;function h(t,r){let o;const n=new Promise((a,i)=>{o=setTimeout(()=>i(new Error("landing stats timeout")),r)});return Promise.race([t,n]).finally(()=>{o!=null&&clearTimeout(o)})}const A=5*6e4,P=1440*6e4,k="tokentracker:community-stats:v2";let s=null;function C(t){const r=Number(t?.tokenFloor)||0,o=Number(t?.totalEntries)||0;return!(r>0)||!(o>0)?null:{tokenFloor:r,totalEntries:o,top:Array.isArray(t?.top)?t.top:[],topModels:Array.isArray(t?.topModels)?t.topModels:[],providers:Array.isArray(t?.providers)?t.providers:[],dailyGrowth:Array.isArray(t?.dailyGrowth)?t.dailyGrowth:[],tokenMix:Array.isArray(t?.tokenMix)?t.tokenMix:[],userDistribution:Array.isArray(t?.userDistribution)?t.userDistribution:[],platforms:Array.isArray(t?.platforms)?t.platforms:[],activeDevelopersTotal:Number(t?.activeDevelopersTotal)||0,activeDevelopers30d:Number(t?.activeDevelopers30d)||0,tokens30d:Number(t?.tokens30d)||0,tokenGrowthPct:t?.tokenGrowthPct!=null&&Number.isFinite(Number(t.tokenGrowthPct))?Number(t.tokenGrowthPct):null,developerGrowthPct:t?.developerGrowthPct!=null&&Number.isFinite(Number(t.developerGrowthPct))?Number(t.developerGrowthPct):null,generatedAt:typeof t?.generatedAt=="string"?t.generatedAt:null}}function G(){if(typeof window>"u"||!window.localStorage)return null;try{const t=JSON.parse(window.localStorage.getItem(k)||"null"),r=Number(t?.cachedAt)||0,o=C(t?.data),n=Date.now()-r;return!o||n<0||n>P?null:{data:o,isFresh:n<A}}catch{return null}}function I(t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(k,JSON.stringify({cachedAt:Date.now(),data:t}))}catch{}}function F(){if(s&&Date.now()-s.at<A)return s.promise;const t=Promise.all([h(N({period:"total",limit:E,offset:0}),D),h(M(),S).catch(()=>null)]);return s={at:Date.now(),promise:t},t.catch(()=>{s?.promise===t&&(s=null)}),t}function O({enabled:t=!0}={}){const[r]=p.useState(()=>G()),[o,n]=p.useState(()=>r?{status:"ready",...r.data}:{status:"loading",tokenFloor:null,totalEntries:null,top:[]});return p.useEffect(()=>{if(!t||r?.isFresh)return;let a=!1,i=null,u=null;const y=async()=>{try{const[l,e]=await F();if(a)return;const c=Array.isArray(l?.entries)?l.entries:[],b=c.reduce((m,T)=>m+(Number(T?.total_tokens)||0),0),d=Number(e?.total_tokens)||0;d>0||(s=null);const w=Number(r?.data?.tokenFloor)||0,f=d>0?d:w>0?w:b;if(!c.length||!(f>0)){n(m=>({...m,status:"error"}));return}const g=Array.isArray(e?.top_models)?e.top_models:r?.data?.topModels||[],_={tokenFloor:f,totalEntries:Number(l?.total_entries)||c.length,top:c.slice(0,3),topModels:g,providers:Array.isArray(e?.providers)?e.providers:[],dailyGrowth:Array.isArray(e?.daily_growth)?e.daily_growth:[],tokenMix:Array.isArray(e?.token_mix)?e.token_mix:[],userDistribution:Array.isArray(e?.user_distribution)?e.user_distribution:[],platforms:Array.isArray(e?.platforms)?e.platforms:[],activeDevelopersTotal:Number(e?.active_developers_total)||0,activeDevelopers30d:Number(e?.active_developers_30d)||0,tokens30d:Number(e?.tokens_30d)||0,tokenGrowthPct:e?.token_growth_pct==null?null:Number(e.token_growth_pct),developerGrowthPct:e?.developer_growth_pct==null?null:Number(e.developer_growth_pct),generatedAt:typeof e?.generated_at=="string"?e.generated_at:null};n({status:"ready",..._}),d>0&&I(_)}catch{a||n(e=>e.status==="ready"?e:{...e,status:"error"})}};return typeof window<"u"&&"requestIdleCallback"in window?i=window.requestIdleCallback(y,{timeout:1500}):u=setTimeout(y,400),()=>{a=!0,i!=null&&typeof window.cancelIdleCallback=="function"&&window.cancelIdleCallback(i),u!=null&&clearTimeout(u)}},[t,r]),o}export{O as u};
@@ -1 +1 @@
1
- import{r as a,o as D,p as K,q as j,t as J}from"./__vite-browser-external-DWKjPxnU.js";import{L as q}from"./limits-providers-8NsMiLNP.js";const p=q,g="tt.limits.providerOrder",E="tt.limits.providerVisibility",h="tt.limits.displayMode",O="tt.limits.updatedAt",M="limitsPreferences",B="limitsDisplayMode",w=Object.freeze({USED:"used",REMAINING:"remaining"}),v=new Set(Object.values(w)),L=new Set([g,E,h,O]);function A(){return[...p]}function b(){return Object.fromEntries(p.map(e=>[e,!0]))}function _(e){const t=[];if(Array.isArray(e))for(const n of e)p.includes(n)&&!t.includes(n)&&t.push(n);for(const n of p)t.includes(n)||t.push(n);return t}function N(e){const t=b();if(!e||typeof e!="object"||Array.isArray(e))return t;for(const n of p)typeof e[n]=="boolean"&&(t[n]=e[n]);return t}function G(e){return v.has(e)?e:w.USED}function y(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const t=e.trim();if(t==="")return;const n=Number(t);return Number.isSafeInteger(n)?n:void 0}}}function m(e={}){const t=e&&typeof e=="object"?e:{};return{displayMode:G(t.displayMode),providerOrder:_(t.providerOrder),providerVisibility:N(t.providerVisibility),updatedAt:y(t.updatedAt)}}function F(){if(typeof window>"u")return A();try{const e=window.localStorage.getItem(g);return _(e?JSON.parse(e):void 0)}catch{return A()}}function H(){if(typeof window>"u")return b();try{const e=window.localStorage.getItem(E);return N(e?JSON.parse(e):void 0)}catch{return b()}}function Q(){if(typeof window>"u")return w.USED;try{const e=window.localStorage.getItem(h);return v.has(e)?e:w.USED}catch{return w.USED}}function W(){if(!(typeof window>"u"))try{return y(window.localStorage.getItem(O))}catch{return}}function X(){if(typeof window>"u")return!1;try{for(const e of L)if(window.localStorage.getItem(e)!==null)return!0}catch{return!1}return!1}function S(){return m({displayMode:Q(),providerOrder:F(),providerVisibility:H(),updatedAt:W()})}function Z(e){if(typeof window>"u")return;const t=m(e);try{window.localStorage.setItem(g,JSON.stringify(t.providerOrder)),window.localStorage.setItem(E,JSON.stringify(t.providerVisibility)),window.localStorage.setItem(h,t.displayMode),t.updatedAt===void 0?window.localStorage.removeItem(O):window.localStorage.setItem(O,String(t.updatedAt))}catch(n){console.warn("[tokentracker] limits preferences localStorage write failed:",n)}}function $(e){const t=m(e);return{displayMode:t.displayMode,providerOrder:[...t.providerOrder],providerVisibility:{...t.providerVisibility},updatedAt:t.updatedAt??null}}function ee(...e){let t;for(const s of e){const c=y(s);c!==void 0&&(t=t===void 0?c:Math.max(t,c))}const n=Date.now();return t!==void 0&&n<=t?t+1:n}function te(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}function re(e,t){return p.every(n=>e[n]===t[n])}function k(e,t){return e.displayMode===t.displayMode&&te(e.providerOrder,t.providerOrder)&&re(e.providerVisibility,t.providerVisibility)}function ie(e,t){return k(e,t)&&y(e.updatedAt)===y(t.updatedAt)}function V(e,t){const n=y(e.updatedAt),s=y(t.updatedAt);return n!==void 0&&(s===void 0||n>s)}function de(){const[e,t]=a.useState(S),n=a.useRef(e),s=a.useCallback((o,r={})=>{const i=m(o);return n.current=i,t(i),r.writeLocal&&Z(i),i},[]),c=a.useCallback(o=>{D()&&K(M,$(o))},[]),u=a.useCallback(o=>{const r=S(),i=V(r,n.current)?s(r):n.current,d=m(o(i));if(k(i,d))return;const f=ee(r.updatedAt,i.updatedAt),l=s({...d,updatedAt:f},{writeLocal:!0});c(l)},[s,c]),P=a.useCallback(o=>{v.has(o)&&u(r=>({...r,displayMode:o}))},[u]),I=a.useCallback(o=>{if(!v.has(o))return;const r=S();if(r.updatedAt!==void 0){s(r);return}s({...r,displayMode:o,updatedAt:void 0},{writeLocal:!0})},[s]);a.useEffect(()=>{if(!D())return;const o=j(r=>{const i=r?.[M];if(i&&typeof i=="object"){const d=m(i);if(!X()){s(d,{writeLocal:!0});return}const f=S();if(V(d,f))s(d,{writeLocal:!0});else{const l=s(f);ie(d,f)||c(l)}return}I(r?.[B])});return J(),o},[I,s,c]),a.useEffect(()=>{if(typeof window>"u")return;const o=r=>{(r.key===null||L.has(r.key))&&s(S())};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)},[s]);const U=a.useCallback(o=>{p.includes(o)&&u(r=>({...r,providerVisibility:{...r.providerVisibility,[o]:!r.providerVisibility[o]}}))},[u]),x=a.useCallback(o=>{u(r=>{const i=r.providerOrder.indexOf(o);if(i<=0)return r;const d=[...r.providerOrder];return[d[i-1],d[i]]=[d[i],d[i-1]],{...r,providerOrder:d}})},[u]),C=a.useCallback(o=>{u(r=>{const i=r.providerOrder.indexOf(o);if(i<0||i>=r.providerOrder.length-1)return r;const d=[...r.providerOrder];return[d[i],d[i+1]]=[d[i+1],d[i]],{...r,providerOrder:d}})},[u]),R=a.useCallback((o,r)=>{o!==r&&u(i=>{const d=i.providerOrder.indexOf(o),f=i.providerOrder.indexOf(r);if(d<0||f<0)return i;const l=[...i.providerOrder],[z]=l.splice(d,1);return l.splice(f,0,z),{...i,providerOrder:l}})},[u]),Y=a.useCallback(()=>{u(()=>({displayMode:w.USED,providerOrder:A(),providerVisibility:b()}))},[u]),T=a.useMemo(()=>e.providerOrder.filter(o=>e.providerVisibility[o]!==!1),[e.providerOrder,e.providerVisibility]);return{order:e.providerOrder,visibility:e.providerVisibility,displayMode:e.displayMode,setDisplayMode:P,visibleOrdered:T,toggle:U,moveUp:x,moveDown:C,moveToward:R,reset:Y}}export{w as L,de as u};
1
+ import{r as a,o as D,p as K,q as j,t as J}from"./__vite-browser-external-BRzJpYc1.js";import{L as q}from"./limits-providers-D8LfR6Om.js";const p=q,g="tt.limits.providerOrder",E="tt.limits.providerVisibility",h="tt.limits.displayMode",O="tt.limits.updatedAt",M="limitsPreferences",B="limitsDisplayMode",w=Object.freeze({USED:"used",REMAINING:"remaining"}),v=new Set(Object.values(w)),L=new Set([g,E,h,O]);function A(){return[...p]}function b(){return Object.fromEntries(p.map(e=>[e,!0]))}function _(e){const t=[];if(Array.isArray(e))for(const n of e)p.includes(n)&&!t.includes(n)&&t.push(n);for(const n of p)t.includes(n)||t.push(n);return t}function N(e){const t=b();if(!e||typeof e!="object"||Array.isArray(e))return t;for(const n of p)typeof e[n]=="boolean"&&(t[n]=e[n]);return t}function G(e){return v.has(e)?e:w.USED}function y(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const t=e.trim();if(t==="")return;const n=Number(t);return Number.isSafeInteger(n)?n:void 0}}}function m(e={}){const t=e&&typeof e=="object"?e:{};return{displayMode:G(t.displayMode),providerOrder:_(t.providerOrder),providerVisibility:N(t.providerVisibility),updatedAt:y(t.updatedAt)}}function F(){if(typeof window>"u")return A();try{const e=window.localStorage.getItem(g);return _(e?JSON.parse(e):void 0)}catch{return A()}}function H(){if(typeof window>"u")return b();try{const e=window.localStorage.getItem(E);return N(e?JSON.parse(e):void 0)}catch{return b()}}function Q(){if(typeof window>"u")return w.USED;try{const e=window.localStorage.getItem(h);return v.has(e)?e:w.USED}catch{return w.USED}}function W(){if(!(typeof window>"u"))try{return y(window.localStorage.getItem(O))}catch{return}}function X(){if(typeof window>"u")return!1;try{for(const e of L)if(window.localStorage.getItem(e)!==null)return!0}catch{return!1}return!1}function S(){return m({displayMode:Q(),providerOrder:F(),providerVisibility:H(),updatedAt:W()})}function Z(e){if(typeof window>"u")return;const t=m(e);try{window.localStorage.setItem(g,JSON.stringify(t.providerOrder)),window.localStorage.setItem(E,JSON.stringify(t.providerVisibility)),window.localStorage.setItem(h,t.displayMode),t.updatedAt===void 0?window.localStorage.removeItem(O):window.localStorage.setItem(O,String(t.updatedAt))}catch(n){console.warn("[tokentracker] limits preferences localStorage write failed:",n)}}function $(e){const t=m(e);return{displayMode:t.displayMode,providerOrder:[...t.providerOrder],providerVisibility:{...t.providerVisibility},updatedAt:t.updatedAt??null}}function ee(...e){let t;for(const s of e){const c=y(s);c!==void 0&&(t=t===void 0?c:Math.max(t,c))}const n=Date.now();return t!==void 0&&n<=t?t+1:n}function te(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}function re(e,t){return p.every(n=>e[n]===t[n])}function k(e,t){return e.displayMode===t.displayMode&&te(e.providerOrder,t.providerOrder)&&re(e.providerVisibility,t.providerVisibility)}function ie(e,t){return k(e,t)&&y(e.updatedAt)===y(t.updatedAt)}function V(e,t){const n=y(e.updatedAt),s=y(t.updatedAt);return n!==void 0&&(s===void 0||n>s)}function de(){const[e,t]=a.useState(S),n=a.useRef(e),s=a.useCallback((o,r={})=>{const i=m(o);return n.current=i,t(i),r.writeLocal&&Z(i),i},[]),c=a.useCallback(o=>{D()&&K(M,$(o))},[]),u=a.useCallback(o=>{const r=S(),i=V(r,n.current)?s(r):n.current,d=m(o(i));if(k(i,d))return;const f=ee(r.updatedAt,i.updatedAt),l=s({...d,updatedAt:f},{writeLocal:!0});c(l)},[s,c]),P=a.useCallback(o=>{v.has(o)&&u(r=>({...r,displayMode:o}))},[u]),I=a.useCallback(o=>{if(!v.has(o))return;const r=S();if(r.updatedAt!==void 0){s(r);return}s({...r,displayMode:o,updatedAt:void 0},{writeLocal:!0})},[s]);a.useEffect(()=>{if(!D())return;const o=j(r=>{const i=r?.[M];if(i&&typeof i=="object"){const d=m(i);if(!X()){s(d,{writeLocal:!0});return}const f=S();if(V(d,f))s(d,{writeLocal:!0});else{const l=s(f);ie(d,f)||c(l)}return}I(r?.[B])});return J(),o},[I,s,c]),a.useEffect(()=>{if(typeof window>"u")return;const o=r=>{(r.key===null||L.has(r.key))&&s(S())};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)},[s]);const U=a.useCallback(o=>{p.includes(o)&&u(r=>({...r,providerVisibility:{...r.providerVisibility,[o]:!r.providerVisibility[o]}}))},[u]),x=a.useCallback(o=>{u(r=>{const i=r.providerOrder.indexOf(o);if(i<=0)return r;const d=[...r.providerOrder];return[d[i-1],d[i]]=[d[i],d[i-1]],{...r,providerOrder:d}})},[u]),C=a.useCallback(o=>{u(r=>{const i=r.providerOrder.indexOf(o);if(i<0||i>=r.providerOrder.length-1)return r;const d=[...r.providerOrder];return[d[i],d[i+1]]=[d[i+1],d[i]],{...r,providerOrder:d}})},[u]),R=a.useCallback((o,r)=>{o!==r&&u(i=>{const d=i.providerOrder.indexOf(o),f=i.providerOrder.indexOf(r);if(d<0||f<0)return i;const l=[...i.providerOrder],[z]=l.splice(d,1);return l.splice(f,0,z),{...i,providerOrder:l}})},[u]),Y=a.useCallback(()=>{u(()=>({displayMode:w.USED,providerOrder:A(),providerVisibility:b()}))},[u]),T=a.useMemo(()=>e.providerOrder.filter(o=>e.providerVisibility[o]!==!1),[e.providerOrder,e.providerVisibility]);return{order:e.providerOrder,visibility:e.providerVisibility,displayMode:e.displayMode,setDisplayMode:P,visibleOrdered:T,toggle:U,moveUp:x,moveDown:C,moveToward:R,reset:Y}}export{w as L,de as u};
@@ -1 +1 @@
1
- import{j as a,d as x,r as o,P as g,Q as m,q as b,t as u,p as f,K as h}from"./__vite-browser-external-DWKjPxnU.js";import{C as y}from"./Card-DX2Wwm9U.js";function j({checked:s,onChange:t,disabled:e,ariaLabel:r}){return a.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":r,onClick:t,disabled:e,className:x("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:opacity-50 disabled:cursor-not-allowed",s?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:a.jsx("span",{className:x("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",s?"translate-x-[18px]":"translate-x-[3px]")})})}function k({label:s,hint:t,control:e}){return a.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:s}),t?a.jsx("div",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t}):null]}),a.jsx("div",{className:"shrink-0",children:e})]})}function N({title:s,subtitle:t,action:e,children:r}){return a.jsxs(y,{children:[a.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h2",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:s}),t?a.jsx("p",{className:"mt-1 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t}):null]}),e?a.jsx("div",{className:"shrink-0",children:e}):null]}),a.jsx("div",{className:"-mb-3 divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:r})]})}function w({options:s,value:t,onChange:e,disabled:r=!1}){return a.jsx("div",{className:"inline-flex items-center rounded-lg border border-oai-gray-200 bg-oai-gray-50 p-0.5 dark:border-oai-gray-800 dark:bg-oai-gray-900",children:s.map(({value:l,label:d,Icon:i})=>{const n=t===l;return a.jsxs("button",{type:"button",onClick:()=>e(l),"aria-pressed":n,disabled:r,className:x("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",n?"bg-white text-oai-black shadow-sm dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:[i?a.jsx(i,{className:"h-3.5 w-3.5","aria-hidden":!0}):null,a.jsx("span",{children:d})]},l)})})}function S(){const[s,t]=o.useState(null),e=g()&&m();o.useEffect(()=>{if(!e)return;const i=b(n=>t(n));return u(),i},[e]);const r=o.useCallback((i,n)=>{e&&(t(c=>c&&{...c,[i]:n}),f(i,n))},[e]),l=o.useCallback(i=>{e&&h(i)},[e]),d=o.useCallback(()=>{e&&u()},[e]);return{available:e,settings:s,setSetting:r,runAction:l,refresh:d}}export{w as S,j as T,N as a,k as b,S as u};
1
+ import{j as a,d as x,r as o,P as g,Q as m,q as b,t as u,p as f,K as h}from"./__vite-browser-external-BRzJpYc1.js";import{C as y}from"./Card-CBJAS2Mp.js";function j({checked:s,onChange:t,disabled:e,ariaLabel:r}){return a.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":r,onClick:t,disabled:e,className:x("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:opacity-50 disabled:cursor-not-allowed",s?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:a.jsx("span",{className:x("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",s?"translate-x-[18px]":"translate-x-[3px]")})})}function k({label:s,hint:t,control:e}){return a.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:s}),t?a.jsx("div",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t}):null]}),a.jsx("div",{className:"shrink-0",children:e})]})}function N({title:s,subtitle:t,action:e,children:r}){return a.jsxs(y,{children:[a.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h2",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:s}),t?a.jsx("p",{className:"mt-1 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t}):null]}),e?a.jsx("div",{className:"shrink-0",children:e}):null]}),a.jsx("div",{className:"-mb-3 divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:r})]})}function w({options:s,value:t,onChange:e,disabled:r=!1}){return a.jsx("div",{className:"inline-flex items-center rounded-lg border border-oai-gray-200 bg-oai-gray-50 p-0.5 dark:border-oai-gray-800 dark:bg-oai-gray-900",children:s.map(({value:l,label:d,Icon:i})=>{const n=t===l;return a.jsxs("button",{type:"button",onClick:()=>e(l),"aria-pressed":n,disabled:r,className:x("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",n?"bg-white text-oai-black shadow-sm dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:[i?a.jsx(i,{className:"h-3.5 w-3.5","aria-hidden":!0}):null,a.jsx("span",{children:d})]},l)})})}function S(){const[s,t]=o.useState(null),e=g()&&m();o.useEffect(()=>{if(!e)return;const i=b(n=>t(n));return u(),i},[e]);const r=o.useCallback((i,n)=>{e&&(t(c=>c&&{...c,[i]:n}),f(i,n))},[e]),l=o.useCallback(i=>{e&&h(i)},[e]),d=o.useCallback(()=>{e&&u()},[e]);return{available:e,settings:s,setSetting:r,runAction:l,refresh:d}}export{w as S,j as T,N as a,k as b,S as u};
@@ -1,4 +1,4 @@
1
- import{r as c,R as P,Z as Oe}from"./__vite-browser-external-DWKjPxnU.js";function In(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function wt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:wt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Vt(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:wt(e)?mt(e)?e:Be(e)||Vt(e)?e.ownerDocument:document:document:document}const Q=tt?c.useLayoutEffect:c.useEffect;function yt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.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 Mn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ke(e){const t=yt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ht(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function qt(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((i,a)=>{const s=Object.entries(a);for(const[l,u]of s){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=qt(1),ze=qt(-1);function An(e){return"clientX"in e&&"clientY"in e}function xt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function On(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function gt(e){if(On(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 An(e)?{x:e.clientX,y:e.clientY}:null}const _e=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[_e.Translate.toString(e),_e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Nt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Tn(e){return e.matches(Nt)?e:e.querySelector(Nt)}const Nn={display:"none"};function Ln(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:Nn},n)}function kn(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 P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function zn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Gt=c.createContext(null);function Pn(e){const t=c.useContext(Gt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Bn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(a=>{var s;return(s=a[o])==null?void 0:s.call(a,i)})},[e]),t]}const Fn={draggable:`
1
+ import{r as c,R as P,Z as Oe}from"./__vite-browser-external-BRzJpYc1.js";function In(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function wt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:wt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Vt(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:wt(e)?mt(e)?e:Be(e)||Vt(e)?e.ownerDocument:document:document:document}const Q=tt?c.useLayoutEffect:c.useEffect;function yt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.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 Mn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ke(e){const t=yt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ht(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function qt(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((i,a)=>{const s=Object.entries(a);for(const[l,u]of s){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=qt(1),ze=qt(-1);function An(e){return"clientX"in e&&"clientY"in e}function xt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function On(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function gt(e){if(On(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 An(e)?{x:e.clientX,y:e.clientY}:null}const _e=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[_e.Translate.toString(e),_e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Nt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Tn(e){return e.matches(Nt)?e:e.querySelector(Nt)}const Nn={display:"none"};function Ln(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:Nn},n)}function kn(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 P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function zn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Gt=c.createContext(null);function Pn(e){const t=c.useContext(Gt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Bn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(a=>{var s;return(s=a[o])==null?void 0:s.call(a,i)})},[e]),t]}const Fn={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.
@@ -0,0 +1 @@
1
+ import{r as o}from"./__vite-browser-external-BRzJpYc1.js";import{h as r,i as t,p as s}from"./react-D9H9IC9r.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};
@@ -1 +1 @@
1
- import{k as u,r as n}from"./__vite-browser-external-DWKjPxnU.js";const f=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],E=u("pencil",f),i="tt.qualityPerDollar.enabled";function l(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(i)==="1"}catch{return!1}}function y(){const[r,o]=n.useState(l);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===i)&&o(l())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(i,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!l()),[a]);return{enabled:r,setEnabled:a,toggle:s}}const d="tt.sessionEfficiency.enabled";function c(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(d)==="1"}catch{return!1}}function g(){const[r,o]=n.useState(c);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===d)&&o(c())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(d,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!c()),[a]);return{enabled:r,setEnabled:a,toggle:s}}export{E as P,g as a,y as u};
1
+ import{k as u,r as n}from"./__vite-browser-external-BRzJpYc1.js";const f=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],E=u("pencil",f),i="tt.qualityPerDollar.enabled";function l(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(i)==="1"}catch{return!1}}function y(){const[r,o]=n.useState(l);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===i)&&o(l())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(i,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!l()),[a]);return{enabled:r,setEnabled:a,toggle:s}}const d="tt.sessionEfficiency.enabled";function c(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(d)==="1"}catch{return!1}}function g(){const[r,o]=n.useState(c);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===d)&&o(c())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(d,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!c()),[a]);return{enabled:r,setEnabled:a,toggle:s}}export{E as P,g as a,y as u};
@@ -1 +1 @@
1
- import{d as y,u as l,e as A,M as p,b as h,f as C,g as V,j as u}from"./react-Nv3-bJyw.js";import{r as f}from"./__vite-browser-external-DWKjPxnU.js";function x(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],s=t[1+n],c=t[2+n],r=t[3+n],a=y(s,c,r);return e?a(o):a}function E(t){const e=l(()=>A(t)),{isStatic:n}=f.useContext(p);if(n){const[,o]=f.useState(t);f.useEffect(()=>e.on("change",o),[])}return e}function m(t,e){const n=E(e()),o=()=>n.set(e());return o(),h(()=>{const s=()=>V.preRender(o,!1,!0),c=t.map(r=>r.on("change",s));return()=>{c.forEach(r=>r()),C(o)}}),n}function L(t){u.current=[],t();const e=m(u.current,t);return u.current=void 0,e}function g(t,e,n,o){if(typeof t=="function")return L(t);const c=typeof e=="function"?e:x(e,n,o),r=Array.isArray(t)?i(t,c):i([t],([d])=>c(d)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&o?.clamp!==!1&&(r.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),r}function i(t,e){const n=l(()=>[]);return m(t,()=>{n.length=0;const o=t.length;for(let s=0;s<o;s++)n[s]=t[s].get();return e(n)})}export{g as a,E as u};
1
+ import{d as y,u as l,e as A,M as p,b as h,f as C,g as V,j as u}from"./react-D9H9IC9r.js";import{r as f}from"./__vite-browser-external-BRzJpYc1.js";function x(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],s=t[1+n],c=t[2+n],r=t[3+n],a=y(s,c,r);return e?a(o):a}function E(t){const e=l(()=>A(t)),{isStatic:n}=f.useContext(p);if(n){const[,o]=f.useState(t);f.useEffect(()=>e.on("change",o),[])}return e}function m(t,e){const n=E(e()),o=()=>n.set(e());return o(),h(()=>{const s=()=>V.preRender(o,!1,!0),c=t.map(r=>r.on("change",s));return()=>{c.forEach(r=>r()),C(o)}}),n}function L(t){u.current=[],t();const e=m(u.current,t);return u.current=void 0,e}function g(t,e,n,o){if(typeof t=="function")return L(t);const c=typeof e=="function"?e:x(e,n,o),r=Array.isArray(t)?i(t,c):i([t],([d])=>c(d)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&o?.clamp!==!1&&(r.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),r}function i(t,e){const n=l(()=>[]);return m(t,()=>{n.length=0;const o=t.length;for(let s=0;s<o;s++)n[s]=t[s].get();return e(n)})}export{g as a,E as u};
@@ -1 +1 @@
1
- import{o as _,aa as K,r as w,c as g,ab as F,ac as M,ad as b}from"./__vite-browser-external-DWKjPxnU.js";import{l as x}from"./limits-providers-8NsMiLNP.js";const S="native:notificationPermission";let E=null;function N(){return typeof window<"u"&&!!window.chrome?.webview}function v(){return _()?E||"unknown":N()?"granted":typeof Notification>"u"?"unsupported":Notification.permission}function L(e){if(typeof window>"u")return()=>{};const i=t=>{const a=t?.detail?.status;typeof a=="string"&&(E=a),e(v())};return window.addEventListener(S,i),e(v()),_()&&K({type:"getNotificationStatus"}),()=>window.removeEventListener(S,i)}async function I(){if(_()){K({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function O(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function U(){const[e,i]=w.useState(O),[t,a]=w.useState("unknown");w.useEffect(()=>L(a),[]);const y=w.useCallback(async n=>{const l=!!n;l&&await I();try{window.localStorage.setItem(p,l?"1":"0")}catch{}i(l)},[]);return{enabled:e,setEnabled:y,permissionBlocked:t==="denied"}}function A(e,i){if(!(e>0))return null;const t=(e-i)/e;return Number.isFinite(t)?Math.min(Math.max(t,0),1):null}function z(e,i,t=.03){return e>i+t}function D(e){const i=Math.max(0,Math.floor(e)),t=Math.floor(i/3600);return t>24?`${Math.floor(t/24)}d`:t>0?`${t}h`:`${Math.floor(i/60)}m`}function j(e,i){if(typeof e.windowSeconds=="number")return e.windowSeconds;if(e.windowSecondsField&&i){const t=i[e.windowSecondsField];return typeof t=="number"&&t>0?t:null}return null}function R(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function C({usedPercent:e,windowSeconds:i,resetMs:t,mode:a,now:y=Date.now()}){const n=Math.min(Math.max(Number(e)||0,0),100)/100,l={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(t))return l;const r=Math.max(0,(t-y)/1e3),s=A(i,r);if(s==null)return l;if(l.expectedPercent=Math.round(s*100),l.paceOver=z(n,s),n>=.05){const u=a==="remaining"?1-s:s;l.pacePercent=u*100}if(s>.02&&n>0){const u=i*s,c=n/u,m=n/s;m>=1&&c>0?l.runsOutEta=D((1-n)/c):l.projectedEnd=Math.round(Math.min(m,1)*100)}return l}const T={claude:{windows(e){const i=Array.isArray(e.weekly_scoped)?e.weekly_scoped.map(t=>({key:`scoped-${t.label}`,label:t.label,window:t,pctField:"utilization",resetField:"resets_at",windowSeconds:604800})):[];return[{key:"5h",labelKey:"limits.label.claude_5h",window:e.five_hour,pctField:"utilization",resetField:"resets_at",windowSeconds:5*3600},{key:"7d",labelKey:"limits.label.claude_7d",window:e.seven_day,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},{key:"opus",labelKey:"limits.label.claude_opus",window:e.seven_day_opus,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},...i]}},codex:{extra:"codex_meta",windows(e){return[{key:"5h",labelKey:"limits.label.codex_5h",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"7d",labelKey:"limits.label.codex_7d",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"credits",labelKey:"limits.label.codex_credits",window:e.credit_window},{key:"spark-5h",labelKey:"limits.label.codex_spark_5h",window:e.spark_primary_window,windowSecondsField:"limit_window_seconds"},{key:"spark-7d",labelKey:"limits.label.codex_spark_7d",window:e.spark_secondary_window,windowSecondsField:"limit_window_seconds"}]}},cursor:{windows(e){return[{key:"plan",labelKey:"limits.label.cursor_plan",window:e.primary_window},{key:"auto",labelKey:"limits.label.cursor_auto",window:e.secondary_window},{key:"api",labelKey:"limits.label.cursor_api",window:e.tertiary_window}]}},gemini:{windows(e){return[{key:"pro",labelKey:"limits.label.gemini_pro",window:e.primary_window},{key:"flash",labelKey:"limits.label.gemini_flash",window:e.secondary_window},{key:"lite",labelKey:"limits.label.gemini_lite",window:e.tertiary_window}]}},kimi:{extra:"kimi_parallel",windows(e){return[{key:"weekly",labelKey:"limits.label.kimi_weekly",window:e.primary_window,windowSeconds:7*86400},{key:"5h",labelKey:"limits.label.kimi_5h",window:e.secondary_window,windowSeconds:5*3600},{key:"total",labelKey:"limits.label.kimi_total",window:e.tertiary_window}]}},kiro:{windows(e){return[{key:"month",labelKey:"limits.label.kiro_month",window:e.primary_window},{key:"bonus",labelKey:"limits.label.kiro_bonus",window:e.secondary_window}]}},grok:{windows(e){const i=typeof e.period_type=="string"?e.period_type:null,t=i==="weekly"?"limits.label.grok_week":i==="daily"?"limits.label.grok_day":"limits.label.grok_month",a=i==="weekly"?7*86400:i==="daily"?86400:void 0;return[{key:i==="weekly"?"week":i==="daily"?"day":"month",labelKey:t,window:e.primary_window,windowSeconds:a},{key:"ondemand",labelKey:"limits.label.grok_ondemand",window:e.secondary_window}]}},antigravity:{windows(e){return[{key:"claude-weekly",labelKey:"limits.label.antigravity_claude_weekly",window:e.primary_window},{key:"claude-5h",labelKey:"limits.label.antigravity_claude_5h",window:e.secondary_window},{key:"gemini-weekly",labelKey:"limits.label.antigravity_gemini_weekly",window:e.tertiary_window},{key:"gemini-5h",labelKey:"limits.label.antigravity_gemini_5h",window:e.quaternary_window}]}},copilot:{extra:"copilot_otel",windows(e){return[{key:"premium",labelKey:"limits.label.copilot_premium",window:e.primary_window},{key:"chat",labelKey:"limits.label.copilot_chat",window:e.secondary_window}]}},zcode:{windows(e){return e.plan_kind==="coding-plan"?[{key:"5h",labelKey:"limits.label.zcode_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.zcode_weekly",window:e.secondary_window},{key:"tools",labelKey:"limits.label.zcode_tools",window:e.tertiary_window}]:[{key:"glm52",labelKey:"limits.label.zcode_glm52",window:e.primary_window},{key:"glm5t",labelKey:"limits.label.zcode_glm5t",window:e.secondary_window}]}},opencodeGo:{windows(e){return[{key:"5h",labelKey:"limits.label.opencode_go_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.opencode_go_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.opencode_go_monthly",window:e.tertiary_window}]}}},P="tt.limitAlerts.cycles.v1";function $(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function B(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function V(e,{now:i=Date.now()}={}){const t=[],a=T;for(const[y,n]of Object.entries(e||{})){const l=a[y];if(!(!n?.configured||n.error||!l))for(const r of l.windows(n)){if(!r.window)continue;const s=Number(r.pctField==="utilization"?r.window.utilization:r.window.used_percent),u=r.resetField==="resets_at"?r.window.resets_at:r.window.reset_at,c=R(u),m=C({usedPercent:s,windowSeconds:j(r,r.window),resetMs:c,mode:"used",now:i});!m.runsOutEta||!m.paceOver||s<20||!(c>i)||t.push({id:`${y}:${r.key}:${c}`,providerId:y,windowKey:r.key,resetMs:c,usedPercent:s,runsOutEta:m.runsOutEta})}}return t}function q(e){const i=$(),t=V(e);for(const n of t){if(i[n.id])continue;const l=x(n.providerId),r=g("limits.alert.title",{provider:l}),s=g("limits.alert.body",{eta:n.runsOutEta,percent:Math.round(n.usedPercent)});let u=F({title:r,body:s,id:n.id});!u&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(r,{body:s,tag:n.id}),u=!0),u&&(i[n.id]=Date.now())}const a=Date.now()-864e5,y=Object.fromEntries(Object.entries(i).filter(([n,l])=>{const r=Number(n.split(":").at(-1));return Number.isFinite(r)?r>=a:Number(l)>=a}).slice(-100));return B(y),t.length}function W(e){const i=!!e?.initialState,[t,a]=w.useState(()=>i?e?.initialState?.data??null:null),[y,n]=w.useState(()=>i?e?.initialState?.error??null:null),[l,r]=w.useState(!i),s=!!e?.initialRefresh,u=!!e?.publishToPreloadCache;w.useEffect(()=>{if(!(!t||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&q(t)}catch{}},[t]);const c=w.useCallback((o,d)=>{!u||!o||typeof o!="object"||M(o,{source:d})},[u]),m=w.useCallback(async()=>{try{const o=await b({refresh:!0}),d=o&&typeof o=="object"?o:null;a(d),n(null),c(d,"manual-refresh")}catch(o){n(o?.message||String(o))}},[c]),k=w.useCallback(async()=>{try{const o=await b(),d=o&&typeof o=="object"?o:null;a(d),n(null),c(d,"page-load")}catch(o){n(o?.message||String(o))}},[c]);return w.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const o=15e3;let d=Date.now();const f=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-d<o||(d=h,k())};return window.addEventListener("focus",f),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("focus",f),document.removeEventListener("visibilitychange",f)}},[k]),w.useEffect(()=>{if(i&&!s)return;let o=!1;return(async()=>{try{const d=await b();if(o)return;const f=d&&typeof d=="object"?d:null;a(f),n(null),c(f,"page-load")}catch(d){if(o)return;n(d?.message||String(d))}finally{o||r(!1)}})(),()=>{o=!0}},[i,s,c]),{data:t,error:y,isLoading:l,refresh:m}}export{T as P,j as a,U as b,C as c,R as r,q as s,W as u};
1
+ import{o as _,aa as K,r as w,c as g,ab as F,ac as M,ad as b}from"./__vite-browser-external-BRzJpYc1.js";import{l as x}from"./limits-providers-D8LfR6Om.js";const S="native:notificationPermission";let E=null;function N(){return typeof window<"u"&&!!window.chrome?.webview}function v(){return _()?E||"unknown":N()?"granted":typeof Notification>"u"?"unsupported":Notification.permission}function L(e){if(typeof window>"u")return()=>{};const i=t=>{const a=t?.detail?.status;typeof a=="string"&&(E=a),e(v())};return window.addEventListener(S,i),e(v()),_()&&K({type:"getNotificationStatus"}),()=>window.removeEventListener(S,i)}async function I(){if(_()){K({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function O(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function U(){const[e,i]=w.useState(O),[t,a]=w.useState("unknown");w.useEffect(()=>L(a),[]);const y=w.useCallback(async n=>{const l=!!n;l&&await I();try{window.localStorage.setItem(p,l?"1":"0")}catch{}i(l)},[]);return{enabled:e,setEnabled:y,permissionBlocked:t==="denied"}}function A(e,i){if(!(e>0))return null;const t=(e-i)/e;return Number.isFinite(t)?Math.min(Math.max(t,0),1):null}function z(e,i,t=.03){return e>i+t}function D(e){const i=Math.max(0,Math.floor(e)),t=Math.floor(i/3600);return t>24?`${Math.floor(t/24)}d`:t>0?`${t}h`:`${Math.floor(i/60)}m`}function j(e,i){if(typeof e.windowSeconds=="number")return e.windowSeconds;if(e.windowSecondsField&&i){const t=i[e.windowSecondsField];return typeof t=="number"&&t>0?t:null}return null}function R(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function C({usedPercent:e,windowSeconds:i,resetMs:t,mode:a,now:y=Date.now()}){const n=Math.min(Math.max(Number(e)||0,0),100)/100,l={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(t))return l;const r=Math.max(0,(t-y)/1e3),s=A(i,r);if(s==null)return l;if(l.expectedPercent=Math.round(s*100),l.paceOver=z(n,s),n>=.05){const u=a==="remaining"?1-s:s;l.pacePercent=u*100}if(s>.02&&n>0){const u=i*s,c=n/u,m=n/s;m>=1&&c>0?l.runsOutEta=D((1-n)/c):l.projectedEnd=Math.round(Math.min(m,1)*100)}return l}const T={claude:{windows(e){const i=Array.isArray(e.weekly_scoped)?e.weekly_scoped.map(t=>({key:`scoped-${t.label}`,label:t.label,window:t,pctField:"utilization",resetField:"resets_at",windowSeconds:604800})):[];return[{key:"5h",labelKey:"limits.label.claude_5h",window:e.five_hour,pctField:"utilization",resetField:"resets_at",windowSeconds:5*3600},{key:"7d",labelKey:"limits.label.claude_7d",window:e.seven_day,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},{key:"opus",labelKey:"limits.label.claude_opus",window:e.seven_day_opus,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},...i]}},codex:{extra:"codex_meta",windows(e){return[{key:"5h",labelKey:"limits.label.codex_5h",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"7d",labelKey:"limits.label.codex_7d",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"credits",labelKey:"limits.label.codex_credits",window:e.credit_window},{key:"spark-5h",labelKey:"limits.label.codex_spark_5h",window:e.spark_primary_window,windowSecondsField:"limit_window_seconds"},{key:"spark-7d",labelKey:"limits.label.codex_spark_7d",window:e.spark_secondary_window,windowSecondsField:"limit_window_seconds"}]}},cursor:{windows(e){return[{key:"plan",labelKey:"limits.label.cursor_plan",window:e.primary_window},{key:"auto",labelKey:"limits.label.cursor_auto",window:e.secondary_window},{key:"api",labelKey:"limits.label.cursor_api",window:e.tertiary_window}]}},gemini:{windows(e){return[{key:"pro",labelKey:"limits.label.gemini_pro",window:e.primary_window},{key:"flash",labelKey:"limits.label.gemini_flash",window:e.secondary_window},{key:"lite",labelKey:"limits.label.gemini_lite",window:e.tertiary_window}]}},kimi:{extra:"kimi_parallel",windows(e){return[{key:"weekly",labelKey:"limits.label.kimi_weekly",window:e.primary_window,windowSeconds:7*86400},{key:"5h",labelKey:"limits.label.kimi_5h",window:e.secondary_window,windowSeconds:5*3600},{key:"total",labelKey:"limits.label.kimi_total",window:e.tertiary_window}]}},kiro:{windows(e){return[{key:"month",labelKey:"limits.label.kiro_month",window:e.primary_window},{key:"bonus",labelKey:"limits.label.kiro_bonus",window:e.secondary_window}]}},grok:{windows(e){const i=typeof e.period_type=="string"?e.period_type:null,t=i==="weekly"?"limits.label.grok_week":i==="daily"?"limits.label.grok_day":"limits.label.grok_month",a=i==="weekly"?7*86400:i==="daily"?86400:void 0;return[{key:i==="weekly"?"week":i==="daily"?"day":"month",labelKey:t,window:e.primary_window,windowSeconds:a},{key:"ondemand",labelKey:"limits.label.grok_ondemand",window:e.secondary_window}]}},antigravity:{windows(e){return[{key:"claude-weekly",labelKey:"limits.label.antigravity_claude_weekly",window:e.primary_window},{key:"claude-5h",labelKey:"limits.label.antigravity_claude_5h",window:e.secondary_window},{key:"gemini-weekly",labelKey:"limits.label.antigravity_gemini_weekly",window:e.tertiary_window},{key:"gemini-5h",labelKey:"limits.label.antigravity_gemini_5h",window:e.quaternary_window}]}},copilot:{extra:"copilot_otel",windows(e){return[{key:"premium",labelKey:"limits.label.copilot_premium",window:e.primary_window},{key:"chat",labelKey:"limits.label.copilot_chat",window:e.secondary_window}]}},zcode:{windows(e){return e.plan_kind==="coding-plan"?[{key:"5h",labelKey:"limits.label.zcode_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.zcode_weekly",window:e.secondary_window},{key:"tools",labelKey:"limits.label.zcode_tools",window:e.tertiary_window}]:[{key:"glm52",labelKey:"limits.label.zcode_glm52",window:e.primary_window},{key:"glm5t",labelKey:"limits.label.zcode_glm5t",window:e.secondary_window}]}},opencodeGo:{windows(e){return[{key:"5h",labelKey:"limits.label.opencode_go_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.opencode_go_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.opencode_go_monthly",window:e.tertiary_window}]}}},P="tt.limitAlerts.cycles.v1";function $(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function B(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function V(e,{now:i=Date.now()}={}){const t=[],a=T;for(const[y,n]of Object.entries(e||{})){const l=a[y];if(!(!n?.configured||n.error||!l))for(const r of l.windows(n)){if(!r.window)continue;const s=Number(r.pctField==="utilization"?r.window.utilization:r.window.used_percent),u=r.resetField==="resets_at"?r.window.resets_at:r.window.reset_at,c=R(u),m=C({usedPercent:s,windowSeconds:j(r,r.window),resetMs:c,mode:"used",now:i});!m.runsOutEta||!m.paceOver||s<20||!(c>i)||t.push({id:`${y}:${r.key}:${c}`,providerId:y,windowKey:r.key,resetMs:c,usedPercent:s,runsOutEta:m.runsOutEta})}}return t}function q(e){const i=$(),t=V(e);for(const n of t){if(i[n.id])continue;const l=x(n.providerId),r=g("limits.alert.title",{provider:l}),s=g("limits.alert.body",{eta:n.runsOutEta,percent:Math.round(n.usedPercent)});let u=F({title:r,body:s,id:n.id});!u&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(r,{body:s,tag:n.id}),u=!0),u&&(i[n.id]=Date.now())}const a=Date.now()-864e5,y=Object.fromEntries(Object.entries(i).filter(([n,l])=>{const r=Number(n.split(":").at(-1));return Number.isFinite(r)?r>=a:Number(l)>=a}).slice(-100));return B(y),t.length}function W(e){const i=!!e?.initialState,[t,a]=w.useState(()=>i?e?.initialState?.data??null:null),[y,n]=w.useState(()=>i?e?.initialState?.error??null:null),[l,r]=w.useState(!i),s=!!e?.initialRefresh,u=!!e?.publishToPreloadCache;w.useEffect(()=>{if(!(!t||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&q(t)}catch{}},[t]);const c=w.useCallback((o,d)=>{!u||!o||typeof o!="object"||M(o,{source:d})},[u]),m=w.useCallback(async()=>{try{const o=await b({refresh:!0}),d=o&&typeof o=="object"?o:null;a(d),n(null),c(d,"manual-refresh")}catch(o){n(o?.message||String(o))}},[c]),k=w.useCallback(async()=>{try{const o=await b(),d=o&&typeof o=="object"?o:null;a(d),n(null),c(d,"page-load")}catch(o){n(o?.message||String(o))}},[c]);return w.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const o=15e3;let d=Date.now();const f=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-d<o||(d=h,k())};return window.addEventListener("focus",f),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("focus",f),document.removeEventListener("visibilitychange",f)}},[k]),w.useEffect(()=>{if(i&&!s)return;let o=!1;return(async()=>{try{const d=await b();if(o)return;const f=d&&typeof d=="object"?d:null;a(f),n(null),c(f,"page-load")}catch(d){if(o)return;n(d?.message||String(d))}finally{o||r(!1)}})(),()=>{o=!0}},[i,s,c]),{data:t,error:y,isLoading:l,refresh:m}}export{T as P,j as a,U as b,C as c,R as r,q as s,W as u};
@@ -1 +1 @@
1
- import{r as e,C as t,D as r,v as c}from"./__vite-browser-external-DWKjPxnU.js";const s=Object.freeze({currency:c,rate:1,symbol:"$",rates:{...r},rateSource:"default",rateFetchedAt:null,setCurrency:()=>{}});function a(){return e.useContext(t)??s}export{a as u};
1
+ import{r as e,C as t,D as r,v as c}from"./__vite-browser-external-BRzJpYc1.js";const s=Object.freeze({currency:c,rate:1,symbol:"$",rates:{...r},rateSource:"default",rateFetchedAt:null,setCurrency:()=>{}});function a(){return e.useContext(t)??s}export{a as u};
@@ -1 +1 @@
1
- import{bq as Xe,br as _t,aG as Ot,aF as Y,aH as wt,b6 as U,bs as Ct,bt as je,j as Se,bu as ze,r as g,O as V,bv as ot,bw as Dt,aI as it,b4 as Le,bx as Gt,by as ct,bz as xt,b8 as x,b7 as ke,bo as he,bA as Ve,bB as le,bC as ae,aD as C,bb as Kt,bD as It,bE as Je,bF as Ut,bl as ut,bg as lt,bi as Xt,bG as Vt,aC as be,bk as qt,bH as $t,y as Pe,bf as jt,bI as Qe,aK as Be,bJ as zt,bK as Ye,bc as Jt,b3 as We,bd as Qt,b5 as Ie,bL as _e,bM as Zt,bN as en,bO as tn,aE as nn,au as Te,bP as me,bQ as rn,aN as sn,ay as on,av as De,bR as at,bS as cn,bT as Ze}from"./__vite-browser-external-DWKjPxnU.js";function Fe(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Fe(e,s.id,n)])}function ft(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function un(e){e.preventDefault(),e.stopPropagation()}function ln(e){return"nativeEvent"in e}function an(e){return e.pointerType===""&&e.isTrusted?!0:Xe&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function fn(e){return _t?!1:!Xe&&e.width===0&&e.height===0||Xe&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function $n(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function dn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ae(e){const t=Ot(pn,e).current;return t.next=e,Y(t.effect),t}function pn(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let Ne=0;function Ge(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(Ne);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),wt;const i=requestAnimationFrame(o);return Ne=i,()=>{Ne===i&&(cancelAnimationFrame(i),Ne=0)}}const Ke={inert:new WeakMap,"aria-hidden":new WeakMap},dt="data-base-ui-inert",qe={inert:new WeakSet,"aria-hidden":new WeakSet};let xe=new WeakMap,Ue=0;function gn(e){return qe[e]}function kt(e){return e?Ct(e)?e.host:kt(e.parentNode):null}const pt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kt(n);return e.contains(r)?r:null}).filter(n=>n!=null),gt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},ht=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{je(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function hn(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const h=pt(t,e),f=s?ht(t,gt(h),new Set(h)):[],k=[],W=[];if(o){const b=Ke[o],T=gn(o);u=T,i=b;const A=pt(t,Array.from(t.querySelectorAll("[aria-live]"))),P=h.concat(A);ht(t,gt(P),new Set(P)).forEach(y=>{const E=y.getAttribute(o),Q=E!==null&&E!=="false",H=(b.get(y)||0)+1;b.set(y,H),k.push(y),H===1&&Q&&T.add(y),Q||y.setAttribute(o,o==="inert"?"":"true")})}return s&&f.forEach(b=>{const T=(xe.get(b)||0)+1;xe.set(b,T),W.push(b),T===1&&b.setAttribute(dt,"")}),Ue+=1,()=>{i&&k.forEach(b=>{const A=(i.get(b)||0)-1;i.set(b,A),A||(!u?.has(b)&&o&&b.removeAttribute(o),u?.delete(b))}),s&&W.forEach(b=>{const T=(xe.get(b)||0)-1;xe.set(b,T),T||b.removeAttribute(dt)}),Ue-=1,Ue||(Ke.inert=new WeakMap,Ke["aria-hidden"]=new WeakMap,qe.inert=new WeakSet,qe["aria-hidden"]=new WeakSet,xe=new WeakMap)}}function mt(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=U(e[0]).body;return hn(e,o,n,r,{mark:s})}function Pt(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class mn{nodesRef={current:[]};events=Pt();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Ft=g.createContext(null),Mt=g.createContext(null),et=()=>g.useContext(Ft)?.id||null,tt=e=>{const t=g.useContext(Mt);return e??t};function jn(e){const t=ze(),n=tt(e),r=et();return Y(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function zn(e){const{children:t,id:n}=e,r=et();return Se.jsx(Ft.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Jn(e){const{children:t,externalTree:n}=e,r=Ot(()=>n??new mn).current;return Se.jsx(Mt.Provider,{value:r,children:t})}function bn(e,t){const n=Be(be(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const bt=20;let fe=[];function nt(){fe=fe.filter(e=>e.deref()?.isConnected)}function Et(e){nt(),e&&je(e)!=="body"&&(fe.push(new WeakRef(e)),fe.length>bt&&(fe=fe.slice(-bt)))}function yt(){return nt(),fe[fe.length-1]?.deref()}function En(e){return e?Qe(e)?e:xt(e)[0]||e:null}function Rt(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Qe(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Qn(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:h=!0,openInteractionType:f="",nextFocusableElement:k,previousFocusableElement:W,beforeContentFocusGuardRef:b,externalTree:T,getInsideElements:A}=e,P="rootStore"in t?t.rootStore:t,_=P.useState("open"),y=P.useState("domReferenceElement"),E=P.useState("floatingElement"),{events:Q,dataRef:H}=P.context,q=V(()=>H.current.floatingContext?.nodeId),J=s===!1,D=ot(y)&&J,se=Ae(s),F=Ae(o),$=Ae(f),ve=Ae(_),N=tt(T),R=Dt(),B=g.useRef(!1),oe=g.useRef(!1),ee=g.useRef(!1),te=g.useRef(null),Ee=g.useRef(""),de=g.useRef(""),pe=g.useRef(null),ye=g.useRef(null),S=it(pe,b,R?.beforeInsideRef),j=it(ye,R?.afterInsideRef),ie=Le(),ce=Le(),Oe=Gt(),Me=R!=null,p=ct(E),ne=V((m=p)=>m?xt(m):[]),Z=V(()=>A?.().filter(m=>m!=null)??[]);g.useEffect(()=>{if(r||!u)return;function m(L){L.key==="Tab"&&C(p,ae(U(p)))&&ne().length===0&&!D&&un(L)}const I=U(p);return x(I,"keydown",m)},[r,p,u,D,ne]),g.useEffect(()=>{if(r||!_)return;const m=U(p);function I(){ee.current=!1}function L(z){const a=be(z),O=Z(),d=C(E,a)||C(y,a)||C(R?.portalNode,a)||O.some(M=>M===a||C(M,a));ee.current=!d,de.current=z.pointerType||"keyboard",a?.closest(`[${qt}]`)&&(oe.current=!0,ce.start(0,()=>{oe.current=!1}))}function G(){de.current="keyboard"}return ke(x(m,"pointerdown",L,!0),x(m,"pointerup",I,!0),x(m,"pointercancel",I,!0),x(m,"keydown",G,!0),I)},[r,E,y,p,_,R,ce,Z]),g.useEffect(()=>{if(r||!h)return;const m=U(p);function I(){oe.current=!0,ce.start(0,()=>{oe.current=!1})}function L(O){const d=be(O);Qe(d)&&(te.current=d)}function G(O){const d=O.relatedTarget,M=O.currentTarget,K=be(O);u&&d==null&&K!=null&&C(E,K)&&Et(K),queueMicrotask(()=>{const w=q(),Re=P.context.triggerElements,c=Z(),l=d?.hasAttribute(Ve("focus-guard"))&&[pe.current,ye.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,le(W),le(k)].includes(d),X=!(C(y,d)||C(E,d)||C(d,E)||C(R?.portalNode,d)||c.some(v=>v===d||C(v,d))||d!=null&&Re.hasElement(d)||Re.hasMatchingElement(v=>C(v,d))||l||N&&(Fe(N.nodesRef.current,w).find(v=>C(v.context?.elements.floating,d)||C(v.context?.elements.domReference,d))||ft(N.nodesRef.current,w).find(v=>[v.context?.elements.floating,ct(v.context?.elements.floating)].includes(d)||v.context?.elements.domReference===d)));if(M===y&&p&&Rt(p),i&&M!==y&&!$t(K)&&ae(m)===m.body){if(he(p)&&(p.focus(),i==="popup")){Oe.request(()=>{p.focus()});return}const v=ne(),ue=te.current,we=(ue&&v.includes(ue)?ue:null)||v[v.length-1]||p;he(we)&&we.focus()}if(H.current.insideReactTree){H.current.insideReactTree=!1;return}(D||!u)&&d&&X&&!oe.current&&(D||d!==yt())&&(B.current=!0,P.setOpen(!1,Pe(jt,O)))})}function z(){ee.current||(H.current.insideReactTree=!0,ie.start(0,()=>{H.current.insideReactTree=!1}))}const a=he(y)?y:null;if(!(!E&&!a))return ke(a&&x(a,"focusout",G),a&&x(a,"pointerdown",I),E&&x(E,"focusin",L),E&&x(E,"focusout",G),E&&R&&x(E,"focusout",z,!0))},[r,y,E,p,u,N,R,P,h,i,ne,D,q,H,ie,ce,Oe,k,W,Z]),g.useEffect(()=>{if(r||!E||!_)return;const m=Array.from(R?.portalNode?.querySelectorAll(`[${Ve("portal")}]`)||[]),L=(N?ft(N.nodesRef.current,q()):[]).find(M=>ot(M.context?.elements.domReference||null))?.context?.elements.domReference,z=[...[E,...m,pe.current,ye.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...Z()],L,le(W),le(k),D?y:null].filter(M=>M!=null),a=mt(z,{ariaHidden:u||D,mark:!1}),O=[E,...m].filter(M=>M!=null),d=mt(O);return()=>{d(),a()}},[_,r,y,E,u,R,D,N,q,k,W,Z]),Y(()=>{if(!_||r||!he(p))return;const m=U(p),I=ae(m);queueMicrotask(()=>{const L=se.current,G=typeof L=="function"?L($.current||""):L;if(G===void 0||G===!1||C(p,I))return;let a=null;const O=()=>(a==null&&(a=ne(p)),a[0]||p);let d;G===!0||G===null?d=O():d=le(G),d=d||O();const M=C(p,ae(m));Ge(d,{preventScroll:d===p,shouldFocus(){if(!ve.current)return!1;if(M)return!0;const K=ae(m);return!(K!==d&&C(p,K))}})})},[r,_,p,ne,se,$,ve]),Y(()=>{if(r||!p)return;const m=U(p),I=ae(m),L=$.current==null;Et(I);function G(a){if(a.open||(Ee.current=bn(a.nativeEvent,de.current)),a.reason===Kt&&a.nativeEvent.type==="mouseleave"&&(B.current=!0),a.reason===It)if(a.nested)B.current=!1;else if(an(a.nativeEvent)||fn(a.nativeEvent))B.current=!1;else{let O=!1;U(p).createElement("div").focus({get preventScroll(){return O=!0,!1}}),O?B.current=!1:B.current=!0}}Q.on("openchange",G);function z(){const a=F.current;let O=typeof a=="function"?a(Ee.current):a;if(O===void 0||O===!1)return null;O===null&&(O=!0);const d=y?.isConnected?y:null,M=I?.isConnected&&je(I)!=="body"?I:null;let K=L?M||d:d||M;return K||(K=yt()||null),typeof O=="boolean"?K:le(O)||K||null}return()=>{Q.off("openchange",G);const a=ae(m),O=Z(),d=C(E,a)||O.some(w=>w===a||C(w,a))||N&&Fe(N.nodesRef.current,q(),!1).some(w=>C(w.context?.elements.floating,a)),M=F.current,K=z();queueMicrotask(()=>{const w=En(K),Re=typeof M!="boolean";M&&!B.current&&he(w)&&(!(!Re&&w!==a&&a!==m.body)||d)&&w.focus({preventScroll:!0}),B.current=!1})}},[r,E,p,F,$,Q,N,y,q,Z]),Y(()=>{if(!Je||_||!E)return;const m=ae(U(E));!he(m)||!Ut(m)||C(E,m)&&m.blur()},[_,E]),Y(()=>{if(!(r||!R))return R.setFocusManagerState({modal:u,closeOnFocusOut:h,open:_,onOpenChange:P.setOpen,domReference:y}),()=>{R.setFocusManagerState(null)}},[r,R,u,_,P,h,y]),Y(()=>{if(!(r||!p))return Rt(p),()=>{queueMicrotask(nt)}},[r,p]);const ge=!r&&(u?!D:!0)&&(Me||u);return Se.jsxs(g.Fragment,{children:[ge&&Se.jsx(ut,{"data-type":"inside",ref:S,onFocus:m=>{if(u){const I=ne();Ge(I[I.length-1])}else R?.portalNode&&(B.current=!1,lt(m,R.portalNode)?Xt(y)?.focus():le(W??R.beforeOutsideRef)?.focus())}}),n,ge&&Se.jsx(ut,{"data-type":"inside",ref:j,onFocus:m=>{u?Ge(ne()[0]):R?.portalNode&&(h&&(B.current=!0),lt(m,R.portalNode)?Vt(y)?.focus():le(k??R.afterOutsideRef)?.focus())}})]})}function yn(){return!1}function Rn(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Zn(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=yn,bubbles:u,externalTree:h}=t,f="rootStore"in e?e.rootStore:e,k=f.useState("open"),W=f.useState("floatingElement"),{dataRef:b}=f.context,T=tt(h),A=V(typeof s=="function"?s:()=>!1),P=typeof s=="function"?A:s,_=P!==!1,y=V(()=>o),{escapeKey:E,outsidePress:Q}=Rn(u),H=g.useRef(!1),q=g.useRef(!1),J=g.useRef(!1),D=g.useRef(!1),se=g.useRef(""),F=g.useRef(null),$=Le(),ve=Le(),N=V(()=>{ve.clear(),b.current.insideReactTree=!1}),R=V(S=>{const j=b.current.floatingContext?.nodeId;return(T?Fe(T.nodesRef.current,j):[]).some(ce=>ce.context?.open&&!ce.context.dataRef.current[S])}),B=V(S=>Ye(S,f.select("floatingElement"))||Ye(S,f.select("domReferenceElement"))),oe=V(S=>{i()&&f.setOpen(!1,Pe(Jt,S.nativeEvent))}),ee=V(S=>{if(!k||!n||!r||S.key!=="Escape"||D.current||!E&&R("__escapeKeyBubbles"))return;const j=ln(S)?S.nativeEvent:S,ie=Pe(Qt,j);f.setOpen(!1,ie),ie.isCanceled||S.preventDefault(),!E&&!ie.isPropagationAllowed&&S.stopPropagation()}),te=V(()=>{b.current.insideReactTree=!0,ve.start(0,N)}),Ee=V(S=>{if(!k||!n||S.button!==0)return;const j=be(S.nativeEvent);C(f.select("floatingElement"),j)&&(H.current||(H.current=!0,q.current=!1))}),de=V(S=>{!k||!n||(S.defaultPrevented||S.nativeEvent.defaultPrevented)&&H.current&&(q.current=!0)});g.useEffect(()=>{if(!k||!n)return;b.current.__escapeKeyBubbles=E,b.current.__outsidePressBubbles=Q;const S=new We,j=new We;function ie(){S.clear(),D.current=!0}function ce(){S.start(Je?5:0,()=>{D.current=!1})}function Oe(){J.current=!0,j.start(0,()=>{J.current=!1})}function Me(){H.current=!1,q.current=!1}function p(){const c=se.current,l=c==="pen"||!c?"mouse":c,X=y(),v=typeof X=="function"?X():X;return typeof v=="string"?v:v[l]}function ne(c){const l=p();return l==="intentional"&&c.type!=="click"||l==="sloppy"&&c.type==="click"}function Z(c){const l=b.current.floatingContext?.nodeId,X=T&&Fe(T.nodesRef.current,l).some(v=>Ye(c,v.context?.elements.floating));return B(c)||X}function ge(c){if(ne(c)){c.type!=="click"&&!B(c)&&(j.clear(),J.current=!1),N();return}if(b.current.insideReactTree){N();return}const l=be(c),X=`[${Ve("inert")}]`,v=Ie(l)?l.getRootNode():null,ue=Array.from((Ct(v)?v:U(f.select("floatingElement"))).querySelectorAll(X)),we=f.context.triggerElements;if(l&&(we.hasElement(l)||we.hasMatchingElement(re=>C(re,l))))return;let Ce=Ie(l)?l:null;for(;Ce&&!_e(Ce);){const re=Zt(Ce);if(_e(re)||!Ie(re))break;Ce=re}if(!(ue.length&&Ie(l)&&!en(l)&&!C(l,f.select("floatingElement"))&&ue.every(re=>!C(Ce,re)))){if(he(l)&&!("touches"in c)){const re=_e(l),He=tn(l),st=/auto|scroll/,At=re||st.test(He.overflowX),Nt=re||st.test(He.overflowY),Lt=At&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,Wt=Nt&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,Bt=He.direction==="rtl",Ht=Wt&&(Bt?c.offsetX<=l.offsetWidth-l.clientWidth:c.offsetX>l.clientWidth),Yt=Lt&&c.offsetY>l.clientHeight;if(Ht||Yt)return}if(!Z(c)){if(p()==="intentional"&&J.current){j.clear(),J.current=!1;return}typeof P=="function"&&!P(c)||R("__outsidePressBubbles")||(f.setOpen(!1,Pe(It,c)),N())}}}function m(c){p()!=="sloppy"||c.pointerType==="touch"||!f.select("open")||!n||B(c)||ge(c)}function I(c){if(p()!=="sloppy"||!f.select("open")||!n||B(c))return;const l=c.touches[0];l&&(F.current={startTime:Date.now(),startX:l.clientX,startY:l.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}function L(c,l){const X=be(c);if(!X)return;const v=x(X,c.type,()=>{l(c),v()})}function G(c){se.current="touch",L(c,I)}function z(c){$.clear(),c.type==="pointerdown"&&(se.current=c.pointerType),!(c.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)&&L(c,l=>{l.type==="pointerdown"?m(l):ge(l)})}function a(c){if(!H.current)return;const l=q.current;if(Me(),p()==="intentional"){if(c.type==="pointercancel"){l&&Oe();return}if(!Z(c)){if(l){Oe();return}typeof P=="function"&&!P(c)||(j.clear(),J.current=!0,N())}}}function O(c){if(p()!=="sloppy"||!F.current||B(c))return;const l=c.touches[0];if(!l)return;const X=Math.abs(l.clientX-F.current.startX),v=Math.abs(l.clientY-F.current.startY),ue=Math.sqrt(X*X+v*v);ue>5&&(F.current.dismissOnTouchEnd=!0),ue>10&&(ge(c),$.clear(),F.current=null)}function d(c){L(c,O)}function M(c){p()!=="sloppy"||!F.current||B(c)||(F.current.dismissOnTouchEnd&&ge(c),$.clear(),F.current=null)}function K(c){L(c,M)}const w=U(W),Re=ke(r&&ke(x(w,"keydown",ee),x(w,"compositionstart",ie),x(w,"compositionend",ce)),_&&ke(x(w,"click",z,!0),x(w,"pointerdown",z,!0),x(w,"pointerup",a,!0),x(w,"pointercancel",a,!0),x(w,"mousedown",z,!0),x(w,"mouseup",a,!0),x(w,"touchstart",G,!0),x(w,"touchmove",d,!0),x(w,"touchend",K,!0)));return()=>{Re(),S.clear(),j.clear(),Me(),J.current=!1}},[b,W,r,_,P,k,n,E,Q,ee,N,y,R,B,T,f,$]),g.useEffect(N,[P,N]);const pe=g.useMemo(()=>({onKeyDown:ee,onPointerDown:oe,onClick:oe}),[ee,oe]),ye=g.useMemo(()=>({onKeyDown:ee,onPointerDown:de,onMouseDown:de,onClickCapture:te,onMouseDownCapture(S){te(),Ee(S)},onPointerDownCapture(S){te(),Ee(S)},onMouseUpCapture:te,onTouchEndCapture:te,onTouchMoveCapture:te}),[ee,te,Ee,de]);return g.useMemo(()=>n?{reference:pe,floating:ye,trigger:pe}:{},[n,pe,ye])}function Tn(e){const t=g.useRef(!0);t.current&&(t.current=!1,e())}const Sn={open:Te(e=>e.open),transitionStatus:Te(e=>e.transitionStatus),domReferenceElement:Te(e=>e.domReferenceElement),referenceElement:Te(e=>e.positionReference??e.referenceElement),floatingElement:Te(e=>e.floatingElement),floatingId:Te(e=>e.floatingId)};class vn extends nn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:Pt(),nested:r,triggerElements:o},Sn),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&dn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function On(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),h=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),k=t.context.triggerElements,W=i,b=g.useRef(null);r===void 0&&b.current===null&&(b.current=new vn({open:u,transitionStatus:void 0,referenceElement:h,floatingElement:f,triggerElements:k,onOpenChange:W,floatingId:s,syncOnly:!0,nested:o}));const T=r??b.current;return t.useSyncedValue("floatingId",s),Y(()=>{const A={open:u,floatingId:s,referenceElement:h,floatingElement:f};Ie(h)&&(A.domReferenceElement=h),T.state.positionReference===T.state.referenceElement&&(A.positionReference=h),T.update(A)},[u,s,h,f,T]),T.context.onOpenChange=W,T.context.nested=o,T}function wn(e,t=!1,n=!1){const[r,s]=g.useState(e&&t?"idle":void 0),[o,i]=g.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),Y(()=>{if(!e&&o&&r!=="ending"&&n){const u=me.request(()=>{s("ending")});return()=>{me.cancel(u)}}},[e,o,r,n]),Y(()=>{if(!e||t)return;const u=me.request(()=>{s(void 0)});return()=>{me.cancel(u)}},[t,e]),Y(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const u=me.request(()=>{s("idle")});return()=>{me.cancel(u)}},[t,e,o,r]),{mounted:o,setMounted:i,transitionStatus:r}}const er={tabIndex:-1,[rn]:""};function tr(e){return t=>t==="touch"?e.current:!0}function nr(e,t,n=!1){const r=ze(),s=et()!=null,o=g.useRef(null);e===void 0&&o.current===null&&(o.current=t(r,s));const i=e??o.current;return On({popupStore:i,treatPopupAsFloatingElement:n,floatingRootContext:i.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:i.setOpen}),{store:i,internalStore:o.current}}function Cn(e,t){const n=g.useRef(null),r=g.useRef(null);return g.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,h=t.context.triggerElements.getById(i);u&&h===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function rr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function sr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function or(e,t,n,r){Tn(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function ir(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Cn(e,n),i=V(u=>{if(o(u),!u)return;const h=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:u,...h?r:null});return}f==null&&h&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})});return Y(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:s}}function cr(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");Y(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const o=e.context.triggerElements.size,i={};e.state.triggerCount!==o&&(i.triggerCount=o);const u=e.select("activeTriggerId");let h=null;if(u){const f=e.context.triggerElements.getById(u);f?f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f):h=u}if(!h&&!u&&o===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[k,W]=f.value;i.activeTriggerId=k,i.activeTriggerElement=W}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),h&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const f=Pe(sn);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function ur(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=wn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const h=V(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return on({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:o}}function lr(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:De,inactiveTriggerProps:De,popupProps:De})},[e])}function ar(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class fr{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}let rt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=at.startingStyle]="startingStyle",e[e.endingStyle=at.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),$e=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const xn={[$e.popupOpen]:""},In={[$e.popupOpen]:"",[$e.pressed]:""},kn={[rt.open]:""},Pn={[rt.closed]:""},Fn={[rt.anchorHidden]:""},dr={open(e){return e?xn:null}},pr={open(e){return e?In:null}},gr={open(e){return e?kn:Pn},anchorHidden(e){return e?Fn:null}};function hr(e){return ze(e,"base-ui")}const Mn="ArrowUp",An="ArrowDown",Nn="ArrowLeft",Ln="ArrowRight",Wn="Home",Bn="End",Hn=new Set([Nn,Ln]),Yn=new Set([Mn,An]),_n=new Set([...Hn,...Yn]),mr=new Set([..._n,Wn,Bn]),br=g.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return Se.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Tt={},St={},vt="";function Dn(e){if(typeof document>"u")return!1;const t=U(e);return Be(t).innerWidth-t.documentElement.clientWidth>0}function Gn(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=U(e),r=n.documentElement,s=n.body,o=Ze(r)?r:s,i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const h=o.offsetWidth;o.style.overflowY="hidden";const f=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,h===f}function Kn(e){const t=U(e),n=t.documentElement,r=t.body,s=Ze(n)?n:r,o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Un(e){const t=U(e),n=t.documentElement,r=t.body,s=Be(n);let o=0,i=0,u=!1;const h=me.create();if(Je&&(s.visualViewport?.scale??1)!==1)return()=>{};function f(){const T=s.getComputedStyle(n),A=s.getComputedStyle(r),y=(T.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Tt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vt=n.style.scrollBehavior,St={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,Q=n.scrollWidth>n.clientWidth,H=T.overflowY==="scroll"||A.overflowY==="scroll",q=T.overflowX==="scroll"||A.overflowX==="scroll",J=Math.max(0,s.innerWidth-r.clientWidth),D=Math.max(0,s.innerHeight-r.clientHeight),se=parseFloat(A.marginTop)+parseFloat(A.marginBottom),F=parseFloat(A.marginLeft)+parseFloat(A.marginRight),$=Ze(n)?n:r;if(u=Gn(e),u){n.style.scrollbarGutter=y,$.style.overflowY="hidden",$.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(E||H)&&(n.style.overflowY="scroll"),(Q||q)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:se||D?`calc(100dvh - ${se+D}px)`:"100dvh",width:F||J?`calc(100vw - ${F+J}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function k(){Object.assign(n.style,Tt),Object.assign(r.style,St),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=vt)}function W(){k(),h.request(f)}f();const b=x(s,"resize",W);return()=>{h.cancel(),k(),typeof s.removeEventListener=="function"&&b()}}class Xn{lockCount=0;restore=null;timeoutLock=We.create();timeoutUnlock=We.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=U(t).documentElement,s=Be(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=wt;return}const o=cn||!Dn(t);this.restore=o?Kn(t):Un(t)}}const Vn=new Xn;function Er(e=!0,t=null){Y(()=>{if(e)return Vn.acquire(t)},[e,t])}export{pr as A,jn as B,rt as C,zn as D,Ge as E,vn as F,un as G,an as H,br as I,fn as J,fr as P,er as a,mr as b,tr as c,Qn as d,ar as e,cr as f,ur as g,Zn as h,Er as i,lr as j,nr as k,Tn as l,wn as m,$n as n,tt as o,gr as p,et as q,Fe as r,rr as s,dr as t,hr as u,Ae as v,sr as w,Jn as x,or as y,ir as z};
1
+ import{bq as Xe,br as _t,aG as Ot,aF as Y,aH as wt,b6 as U,bs as Ct,bt as je,j as Se,bu as ze,r as g,O as V,bv as ot,bw as Dt,aI as it,b4 as Le,bx as Gt,by as ct,bz as xt,b8 as x,b7 as ke,bo as he,bA as Ve,bB as le,bC as ae,aD as C,bb as Kt,bD as It,bE as Je,bF as Ut,bl as ut,bg as lt,bi as Xt,bG as Vt,aC as be,bk as qt,bH as $t,y as Pe,bf as jt,bI as Qe,aK as Be,bJ as zt,bK as Ye,bc as Jt,b3 as We,bd as Qt,b5 as Ie,bL as _e,bM as Zt,bN as en,bO as tn,aE as nn,au as Te,bP as me,bQ as rn,aN as sn,ay as on,av as De,bR as at,bS as cn,bT as Ze}from"./__vite-browser-external-BRzJpYc1.js";function Fe(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Fe(e,s.id,n)])}function ft(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function un(e){e.preventDefault(),e.stopPropagation()}function ln(e){return"nativeEvent"in e}function an(e){return e.pointerType===""&&e.isTrusted?!0:Xe&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function fn(e){return _t?!1:!Xe&&e.width===0&&e.height===0||Xe&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function $n(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function dn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ae(e){const t=Ot(pn,e).current;return t.next=e,Y(t.effect),t}function pn(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let Ne=0;function Ge(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(Ne);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),wt;const i=requestAnimationFrame(o);return Ne=i,()=>{Ne===i&&(cancelAnimationFrame(i),Ne=0)}}const Ke={inert:new WeakMap,"aria-hidden":new WeakMap},dt="data-base-ui-inert",qe={inert:new WeakSet,"aria-hidden":new WeakSet};let xe=new WeakMap,Ue=0;function gn(e){return qe[e]}function kt(e){return e?Ct(e)?e.host:kt(e.parentNode):null}const pt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kt(n);return e.contains(r)?r:null}).filter(n=>n!=null),gt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},ht=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{je(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function hn(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const h=pt(t,e),f=s?ht(t,gt(h),new Set(h)):[],k=[],W=[];if(o){const b=Ke[o],T=gn(o);u=T,i=b;const A=pt(t,Array.from(t.querySelectorAll("[aria-live]"))),P=h.concat(A);ht(t,gt(P),new Set(P)).forEach(y=>{const E=y.getAttribute(o),Q=E!==null&&E!=="false",H=(b.get(y)||0)+1;b.set(y,H),k.push(y),H===1&&Q&&T.add(y),Q||y.setAttribute(o,o==="inert"?"":"true")})}return s&&f.forEach(b=>{const T=(xe.get(b)||0)+1;xe.set(b,T),W.push(b),T===1&&b.setAttribute(dt,"")}),Ue+=1,()=>{i&&k.forEach(b=>{const A=(i.get(b)||0)-1;i.set(b,A),A||(!u?.has(b)&&o&&b.removeAttribute(o),u?.delete(b))}),s&&W.forEach(b=>{const T=(xe.get(b)||0)-1;xe.set(b,T),T||b.removeAttribute(dt)}),Ue-=1,Ue||(Ke.inert=new WeakMap,Ke["aria-hidden"]=new WeakMap,qe.inert=new WeakSet,qe["aria-hidden"]=new WeakSet,xe=new WeakMap)}}function mt(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=U(e[0]).body;return hn(e,o,n,r,{mark:s})}function Pt(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class mn{nodesRef={current:[]};events=Pt();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Ft=g.createContext(null),Mt=g.createContext(null),et=()=>g.useContext(Ft)?.id||null,tt=e=>{const t=g.useContext(Mt);return e??t};function jn(e){const t=ze(),n=tt(e),r=et();return Y(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function zn(e){const{children:t,id:n}=e,r=et();return Se.jsx(Ft.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Jn(e){const{children:t,externalTree:n}=e,r=Ot(()=>n??new mn).current;return Se.jsx(Mt.Provider,{value:r,children:t})}function bn(e,t){const n=Be(be(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const bt=20;let fe=[];function nt(){fe=fe.filter(e=>e.deref()?.isConnected)}function Et(e){nt(),e&&je(e)!=="body"&&(fe.push(new WeakRef(e)),fe.length>bt&&(fe=fe.slice(-bt)))}function yt(){return nt(),fe[fe.length-1]?.deref()}function En(e){return e?Qe(e)?e:xt(e)[0]||e:null}function Rt(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Qe(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Qn(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:h=!0,openInteractionType:f="",nextFocusableElement:k,previousFocusableElement:W,beforeContentFocusGuardRef:b,externalTree:T,getInsideElements:A}=e,P="rootStore"in t?t.rootStore:t,_=P.useState("open"),y=P.useState("domReferenceElement"),E=P.useState("floatingElement"),{events:Q,dataRef:H}=P.context,q=V(()=>H.current.floatingContext?.nodeId),J=s===!1,D=ot(y)&&J,se=Ae(s),F=Ae(o),$=Ae(f),ve=Ae(_),N=tt(T),R=Dt(),B=g.useRef(!1),oe=g.useRef(!1),ee=g.useRef(!1),te=g.useRef(null),Ee=g.useRef(""),de=g.useRef(""),pe=g.useRef(null),ye=g.useRef(null),S=it(pe,b,R?.beforeInsideRef),j=it(ye,R?.afterInsideRef),ie=Le(),ce=Le(),Oe=Gt(),Me=R!=null,p=ct(E),ne=V((m=p)=>m?xt(m):[]),Z=V(()=>A?.().filter(m=>m!=null)??[]);g.useEffect(()=>{if(r||!u)return;function m(L){L.key==="Tab"&&C(p,ae(U(p)))&&ne().length===0&&!D&&un(L)}const I=U(p);return x(I,"keydown",m)},[r,p,u,D,ne]),g.useEffect(()=>{if(r||!_)return;const m=U(p);function I(){ee.current=!1}function L(z){const a=be(z),O=Z(),d=C(E,a)||C(y,a)||C(R?.portalNode,a)||O.some(M=>M===a||C(M,a));ee.current=!d,de.current=z.pointerType||"keyboard",a?.closest(`[${qt}]`)&&(oe.current=!0,ce.start(0,()=>{oe.current=!1}))}function G(){de.current="keyboard"}return ke(x(m,"pointerdown",L,!0),x(m,"pointerup",I,!0),x(m,"pointercancel",I,!0),x(m,"keydown",G,!0),I)},[r,E,y,p,_,R,ce,Z]),g.useEffect(()=>{if(r||!h)return;const m=U(p);function I(){oe.current=!0,ce.start(0,()=>{oe.current=!1})}function L(O){const d=be(O);Qe(d)&&(te.current=d)}function G(O){const d=O.relatedTarget,M=O.currentTarget,K=be(O);u&&d==null&&K!=null&&C(E,K)&&Et(K),queueMicrotask(()=>{const w=q(),Re=P.context.triggerElements,c=Z(),l=d?.hasAttribute(Ve("focus-guard"))&&[pe.current,ye.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,le(W),le(k)].includes(d),X=!(C(y,d)||C(E,d)||C(d,E)||C(R?.portalNode,d)||c.some(v=>v===d||C(v,d))||d!=null&&Re.hasElement(d)||Re.hasMatchingElement(v=>C(v,d))||l||N&&(Fe(N.nodesRef.current,w).find(v=>C(v.context?.elements.floating,d)||C(v.context?.elements.domReference,d))||ft(N.nodesRef.current,w).find(v=>[v.context?.elements.floating,ct(v.context?.elements.floating)].includes(d)||v.context?.elements.domReference===d)));if(M===y&&p&&Rt(p),i&&M!==y&&!$t(K)&&ae(m)===m.body){if(he(p)&&(p.focus(),i==="popup")){Oe.request(()=>{p.focus()});return}const v=ne(),ue=te.current,we=(ue&&v.includes(ue)?ue:null)||v[v.length-1]||p;he(we)&&we.focus()}if(H.current.insideReactTree){H.current.insideReactTree=!1;return}(D||!u)&&d&&X&&!oe.current&&(D||d!==yt())&&(B.current=!0,P.setOpen(!1,Pe(jt,O)))})}function z(){ee.current||(H.current.insideReactTree=!0,ie.start(0,()=>{H.current.insideReactTree=!1}))}const a=he(y)?y:null;if(!(!E&&!a))return ke(a&&x(a,"focusout",G),a&&x(a,"pointerdown",I),E&&x(E,"focusin",L),E&&x(E,"focusout",G),E&&R&&x(E,"focusout",z,!0))},[r,y,E,p,u,N,R,P,h,i,ne,D,q,H,ie,ce,Oe,k,W,Z]),g.useEffect(()=>{if(r||!E||!_)return;const m=Array.from(R?.portalNode?.querySelectorAll(`[${Ve("portal")}]`)||[]),L=(N?ft(N.nodesRef.current,q()):[]).find(M=>ot(M.context?.elements.domReference||null))?.context?.elements.domReference,z=[...[E,...m,pe.current,ye.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...Z()],L,le(W),le(k),D?y:null].filter(M=>M!=null),a=mt(z,{ariaHidden:u||D,mark:!1}),O=[E,...m].filter(M=>M!=null),d=mt(O);return()=>{d(),a()}},[_,r,y,E,u,R,D,N,q,k,W,Z]),Y(()=>{if(!_||r||!he(p))return;const m=U(p),I=ae(m);queueMicrotask(()=>{const L=se.current,G=typeof L=="function"?L($.current||""):L;if(G===void 0||G===!1||C(p,I))return;let a=null;const O=()=>(a==null&&(a=ne(p)),a[0]||p);let d;G===!0||G===null?d=O():d=le(G),d=d||O();const M=C(p,ae(m));Ge(d,{preventScroll:d===p,shouldFocus(){if(!ve.current)return!1;if(M)return!0;const K=ae(m);return!(K!==d&&C(p,K))}})})},[r,_,p,ne,se,$,ve]),Y(()=>{if(r||!p)return;const m=U(p),I=ae(m),L=$.current==null;Et(I);function G(a){if(a.open||(Ee.current=bn(a.nativeEvent,de.current)),a.reason===Kt&&a.nativeEvent.type==="mouseleave"&&(B.current=!0),a.reason===It)if(a.nested)B.current=!1;else if(an(a.nativeEvent)||fn(a.nativeEvent))B.current=!1;else{let O=!1;U(p).createElement("div").focus({get preventScroll(){return O=!0,!1}}),O?B.current=!1:B.current=!0}}Q.on("openchange",G);function z(){const a=F.current;let O=typeof a=="function"?a(Ee.current):a;if(O===void 0||O===!1)return null;O===null&&(O=!0);const d=y?.isConnected?y:null,M=I?.isConnected&&je(I)!=="body"?I:null;let K=L?M||d:d||M;return K||(K=yt()||null),typeof O=="boolean"?K:le(O)||K||null}return()=>{Q.off("openchange",G);const a=ae(m),O=Z(),d=C(E,a)||O.some(w=>w===a||C(w,a))||N&&Fe(N.nodesRef.current,q(),!1).some(w=>C(w.context?.elements.floating,a)),M=F.current,K=z();queueMicrotask(()=>{const w=En(K),Re=typeof M!="boolean";M&&!B.current&&he(w)&&(!(!Re&&w!==a&&a!==m.body)||d)&&w.focus({preventScroll:!0}),B.current=!1})}},[r,E,p,F,$,Q,N,y,q,Z]),Y(()=>{if(!Je||_||!E)return;const m=ae(U(E));!he(m)||!Ut(m)||C(E,m)&&m.blur()},[_,E]),Y(()=>{if(!(r||!R))return R.setFocusManagerState({modal:u,closeOnFocusOut:h,open:_,onOpenChange:P.setOpen,domReference:y}),()=>{R.setFocusManagerState(null)}},[r,R,u,_,P,h,y]),Y(()=>{if(!(r||!p))return Rt(p),()=>{queueMicrotask(nt)}},[r,p]);const ge=!r&&(u?!D:!0)&&(Me||u);return Se.jsxs(g.Fragment,{children:[ge&&Se.jsx(ut,{"data-type":"inside",ref:S,onFocus:m=>{if(u){const I=ne();Ge(I[I.length-1])}else R?.portalNode&&(B.current=!1,lt(m,R.portalNode)?Xt(y)?.focus():le(W??R.beforeOutsideRef)?.focus())}}),n,ge&&Se.jsx(ut,{"data-type":"inside",ref:j,onFocus:m=>{u?Ge(ne()[0]):R?.portalNode&&(h&&(B.current=!0),lt(m,R.portalNode)?Vt(y)?.focus():le(k??R.afterOutsideRef)?.focus())}})]})}function yn(){return!1}function Rn(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Zn(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=yn,bubbles:u,externalTree:h}=t,f="rootStore"in e?e.rootStore:e,k=f.useState("open"),W=f.useState("floatingElement"),{dataRef:b}=f.context,T=tt(h),A=V(typeof s=="function"?s:()=>!1),P=typeof s=="function"?A:s,_=P!==!1,y=V(()=>o),{escapeKey:E,outsidePress:Q}=Rn(u),H=g.useRef(!1),q=g.useRef(!1),J=g.useRef(!1),D=g.useRef(!1),se=g.useRef(""),F=g.useRef(null),$=Le(),ve=Le(),N=V(()=>{ve.clear(),b.current.insideReactTree=!1}),R=V(S=>{const j=b.current.floatingContext?.nodeId;return(T?Fe(T.nodesRef.current,j):[]).some(ce=>ce.context?.open&&!ce.context.dataRef.current[S])}),B=V(S=>Ye(S,f.select("floatingElement"))||Ye(S,f.select("domReferenceElement"))),oe=V(S=>{i()&&f.setOpen(!1,Pe(Jt,S.nativeEvent))}),ee=V(S=>{if(!k||!n||!r||S.key!=="Escape"||D.current||!E&&R("__escapeKeyBubbles"))return;const j=ln(S)?S.nativeEvent:S,ie=Pe(Qt,j);f.setOpen(!1,ie),ie.isCanceled||S.preventDefault(),!E&&!ie.isPropagationAllowed&&S.stopPropagation()}),te=V(()=>{b.current.insideReactTree=!0,ve.start(0,N)}),Ee=V(S=>{if(!k||!n||S.button!==0)return;const j=be(S.nativeEvent);C(f.select("floatingElement"),j)&&(H.current||(H.current=!0,q.current=!1))}),de=V(S=>{!k||!n||(S.defaultPrevented||S.nativeEvent.defaultPrevented)&&H.current&&(q.current=!0)});g.useEffect(()=>{if(!k||!n)return;b.current.__escapeKeyBubbles=E,b.current.__outsidePressBubbles=Q;const S=new We,j=new We;function ie(){S.clear(),D.current=!0}function ce(){S.start(Je?5:0,()=>{D.current=!1})}function Oe(){J.current=!0,j.start(0,()=>{J.current=!1})}function Me(){H.current=!1,q.current=!1}function p(){const c=se.current,l=c==="pen"||!c?"mouse":c,X=y(),v=typeof X=="function"?X():X;return typeof v=="string"?v:v[l]}function ne(c){const l=p();return l==="intentional"&&c.type!=="click"||l==="sloppy"&&c.type==="click"}function Z(c){const l=b.current.floatingContext?.nodeId,X=T&&Fe(T.nodesRef.current,l).some(v=>Ye(c,v.context?.elements.floating));return B(c)||X}function ge(c){if(ne(c)){c.type!=="click"&&!B(c)&&(j.clear(),J.current=!1),N();return}if(b.current.insideReactTree){N();return}const l=be(c),X=`[${Ve("inert")}]`,v=Ie(l)?l.getRootNode():null,ue=Array.from((Ct(v)?v:U(f.select("floatingElement"))).querySelectorAll(X)),we=f.context.triggerElements;if(l&&(we.hasElement(l)||we.hasMatchingElement(re=>C(re,l))))return;let Ce=Ie(l)?l:null;for(;Ce&&!_e(Ce);){const re=Zt(Ce);if(_e(re)||!Ie(re))break;Ce=re}if(!(ue.length&&Ie(l)&&!en(l)&&!C(l,f.select("floatingElement"))&&ue.every(re=>!C(Ce,re)))){if(he(l)&&!("touches"in c)){const re=_e(l),He=tn(l),st=/auto|scroll/,At=re||st.test(He.overflowX),Nt=re||st.test(He.overflowY),Lt=At&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,Wt=Nt&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,Bt=He.direction==="rtl",Ht=Wt&&(Bt?c.offsetX<=l.offsetWidth-l.clientWidth:c.offsetX>l.clientWidth),Yt=Lt&&c.offsetY>l.clientHeight;if(Ht||Yt)return}if(!Z(c)){if(p()==="intentional"&&J.current){j.clear(),J.current=!1;return}typeof P=="function"&&!P(c)||R("__outsidePressBubbles")||(f.setOpen(!1,Pe(It,c)),N())}}}function m(c){p()!=="sloppy"||c.pointerType==="touch"||!f.select("open")||!n||B(c)||ge(c)}function I(c){if(p()!=="sloppy"||!f.select("open")||!n||B(c))return;const l=c.touches[0];l&&(F.current={startTime:Date.now(),startX:l.clientX,startY:l.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}function L(c,l){const X=be(c);if(!X)return;const v=x(X,c.type,()=>{l(c),v()})}function G(c){se.current="touch",L(c,I)}function z(c){$.clear(),c.type==="pointerdown"&&(se.current=c.pointerType),!(c.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)&&L(c,l=>{l.type==="pointerdown"?m(l):ge(l)})}function a(c){if(!H.current)return;const l=q.current;if(Me(),p()==="intentional"){if(c.type==="pointercancel"){l&&Oe();return}if(!Z(c)){if(l){Oe();return}typeof P=="function"&&!P(c)||(j.clear(),J.current=!0,N())}}}function O(c){if(p()!=="sloppy"||!F.current||B(c))return;const l=c.touches[0];if(!l)return;const X=Math.abs(l.clientX-F.current.startX),v=Math.abs(l.clientY-F.current.startY),ue=Math.sqrt(X*X+v*v);ue>5&&(F.current.dismissOnTouchEnd=!0),ue>10&&(ge(c),$.clear(),F.current=null)}function d(c){L(c,O)}function M(c){p()!=="sloppy"||!F.current||B(c)||(F.current.dismissOnTouchEnd&&ge(c),$.clear(),F.current=null)}function K(c){L(c,M)}const w=U(W),Re=ke(r&&ke(x(w,"keydown",ee),x(w,"compositionstart",ie),x(w,"compositionend",ce)),_&&ke(x(w,"click",z,!0),x(w,"pointerdown",z,!0),x(w,"pointerup",a,!0),x(w,"pointercancel",a,!0),x(w,"mousedown",z,!0),x(w,"mouseup",a,!0),x(w,"touchstart",G,!0),x(w,"touchmove",d,!0),x(w,"touchend",K,!0)));return()=>{Re(),S.clear(),j.clear(),Me(),J.current=!1}},[b,W,r,_,P,k,n,E,Q,ee,N,y,R,B,T,f,$]),g.useEffect(N,[P,N]);const pe=g.useMemo(()=>({onKeyDown:ee,onPointerDown:oe,onClick:oe}),[ee,oe]),ye=g.useMemo(()=>({onKeyDown:ee,onPointerDown:de,onMouseDown:de,onClickCapture:te,onMouseDownCapture(S){te(),Ee(S)},onPointerDownCapture(S){te(),Ee(S)},onMouseUpCapture:te,onTouchEndCapture:te,onTouchMoveCapture:te}),[ee,te,Ee,de]);return g.useMemo(()=>n?{reference:pe,floating:ye,trigger:pe}:{},[n,pe,ye])}function Tn(e){const t=g.useRef(!0);t.current&&(t.current=!1,e())}const Sn={open:Te(e=>e.open),transitionStatus:Te(e=>e.transitionStatus),domReferenceElement:Te(e=>e.domReferenceElement),referenceElement:Te(e=>e.positionReference??e.referenceElement),floatingElement:Te(e=>e.floatingElement),floatingId:Te(e=>e.floatingId)};class vn extends nn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:Pt(),nested:r,triggerElements:o},Sn),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&dn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function On(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),h=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),k=t.context.triggerElements,W=i,b=g.useRef(null);r===void 0&&b.current===null&&(b.current=new vn({open:u,transitionStatus:void 0,referenceElement:h,floatingElement:f,triggerElements:k,onOpenChange:W,floatingId:s,syncOnly:!0,nested:o}));const T=r??b.current;return t.useSyncedValue("floatingId",s),Y(()=>{const A={open:u,floatingId:s,referenceElement:h,floatingElement:f};Ie(h)&&(A.domReferenceElement=h),T.state.positionReference===T.state.referenceElement&&(A.positionReference=h),T.update(A)},[u,s,h,f,T]),T.context.onOpenChange=W,T.context.nested=o,T}function wn(e,t=!1,n=!1){const[r,s]=g.useState(e&&t?"idle":void 0),[o,i]=g.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),Y(()=>{if(!e&&o&&r!=="ending"&&n){const u=me.request(()=>{s("ending")});return()=>{me.cancel(u)}}},[e,o,r,n]),Y(()=>{if(!e||t)return;const u=me.request(()=>{s(void 0)});return()=>{me.cancel(u)}},[t,e]),Y(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const u=me.request(()=>{s("idle")});return()=>{me.cancel(u)}},[t,e,o,r]),{mounted:o,setMounted:i,transitionStatus:r}}const er={tabIndex:-1,[rn]:""};function tr(e){return t=>t==="touch"?e.current:!0}function nr(e,t,n=!1){const r=ze(),s=et()!=null,o=g.useRef(null);e===void 0&&o.current===null&&(o.current=t(r,s));const i=e??o.current;return On({popupStore:i,treatPopupAsFloatingElement:n,floatingRootContext:i.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:i.setOpen}),{store:i,internalStore:o.current}}function Cn(e,t){const n=g.useRef(null),r=g.useRef(null);return g.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,h=t.context.triggerElements.getById(i);u&&h===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function rr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function sr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function or(e,t,n,r){Tn(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function ir(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Cn(e,n),i=V(u=>{if(o(u),!u)return;const h=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:u,...h?r:null});return}f==null&&h&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})});return Y(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:s}}function cr(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");Y(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const o=e.context.triggerElements.size,i={};e.state.triggerCount!==o&&(i.triggerCount=o);const u=e.select("activeTriggerId");let h=null;if(u){const f=e.context.triggerElements.getById(u);f?f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f):h=u}if(!h&&!u&&o===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[k,W]=f.value;i.activeTriggerId=k,i.activeTriggerElement=W}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),h&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const f=Pe(sn);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function ur(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=wn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const h=V(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return on({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:o}}function lr(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:De,inactiveTriggerProps:De,popupProps:De})},[e])}function ar(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class fr{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}let rt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=at.startingStyle]="startingStyle",e[e.endingStyle=at.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),$e=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const xn={[$e.popupOpen]:""},In={[$e.popupOpen]:"",[$e.pressed]:""},kn={[rt.open]:""},Pn={[rt.closed]:""},Fn={[rt.anchorHidden]:""},dr={open(e){return e?xn:null}},pr={open(e){return e?In:null}},gr={open(e){return e?kn:Pn},anchorHidden(e){return e?Fn:null}};function hr(e){return ze(e,"base-ui")}const Mn="ArrowUp",An="ArrowDown",Nn="ArrowLeft",Ln="ArrowRight",Wn="Home",Bn="End",Hn=new Set([Nn,Ln]),Yn=new Set([Mn,An]),_n=new Set([...Hn,...Yn]),mr=new Set([..._n,Wn,Bn]),br=g.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return Se.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Tt={},St={},vt="";function Dn(e){if(typeof document>"u")return!1;const t=U(e);return Be(t).innerWidth-t.documentElement.clientWidth>0}function Gn(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=U(e),r=n.documentElement,s=n.body,o=Ze(r)?r:s,i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const h=o.offsetWidth;o.style.overflowY="hidden";const f=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,h===f}function Kn(e){const t=U(e),n=t.documentElement,r=t.body,s=Ze(n)?n:r,o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Un(e){const t=U(e),n=t.documentElement,r=t.body,s=Be(n);let o=0,i=0,u=!1;const h=me.create();if(Je&&(s.visualViewport?.scale??1)!==1)return()=>{};function f(){const T=s.getComputedStyle(n),A=s.getComputedStyle(r),y=(T.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Tt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vt=n.style.scrollBehavior,St={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,Q=n.scrollWidth>n.clientWidth,H=T.overflowY==="scroll"||A.overflowY==="scroll",q=T.overflowX==="scroll"||A.overflowX==="scroll",J=Math.max(0,s.innerWidth-r.clientWidth),D=Math.max(0,s.innerHeight-r.clientHeight),se=parseFloat(A.marginTop)+parseFloat(A.marginBottom),F=parseFloat(A.marginLeft)+parseFloat(A.marginRight),$=Ze(n)?n:r;if(u=Gn(e),u){n.style.scrollbarGutter=y,$.style.overflowY="hidden",$.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(E||H)&&(n.style.overflowY="scroll"),(Q||q)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:se||D?`calc(100dvh - ${se+D}px)`:"100dvh",width:F||J?`calc(100vw - ${F+J}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function k(){Object.assign(n.style,Tt),Object.assign(r.style,St),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=vt)}function W(){k(),h.request(f)}f();const b=x(s,"resize",W);return()=>{h.cancel(),k(),typeof s.removeEventListener=="function"&&b()}}class Xn{lockCount=0;restore=null;timeoutLock=We.create();timeoutUnlock=We.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=U(t).documentElement,s=Be(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=wt;return}const o=cn||!Dn(t);this.restore=o?Kn(t):Un(t)}}const Vn=new Xn;function Er(e=!0,t=null){Y(()=>{if(e)return Vn.acquire(t)},[e,t])}export{pr as A,jn as B,rt as C,zn as D,Ge as E,vn as F,un as G,an as H,br as I,fn as J,fr as P,er as a,mr as b,tr as c,Qn as d,ar as e,cr as f,ur as g,Zn as h,Er as i,lr as j,nr as k,Tn as l,wn as m,$n as n,tt as o,gr as p,et as q,Fe as r,rr as s,dr as t,hr as u,Ae as v,sr as w,Jn as x,or as y,ir as z};
@@ -1 +1 @@
1
- import{r as e,T as r,l as n,m as a,n as s}from"./__vite-browser-external-DWKjPxnU.js";const T=Object.freeze({mode:n.COMPACT,setMode:()=>{},formatTokens:(o,t={})=>s(o,t),formatTokensTooltip:(o,t={})=>a(o,t)});function f(){return e.useContext(r)??T}export{f as u};
1
+ import{r as e,T as r,l as n,m as a,n as s}from"./__vite-browser-external-BRzJpYc1.js";const T=Object.freeze({mode:n.COMPACT,setMode:()=>{},formatTokens:(o,t={})=>s(o,t),formatTokensTooltip:(o,t={})=>a(o,t)});function f(){return e.useContext(r)??T}export{f as u};
@@ -1 +1 @@
1
- import{k as a}from"./__vite-browser-external-DWKjPxnU.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
1
+ import{k as a}from"./__vite-browser-external-BRzJpYc1.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
@@ -249,8 +249,8 @@
249
249
  ]
250
250
  }
251
251
  </script>
252
- <script type="module" crossorigin src="/assets/__vite-browser-external-DWKjPxnU.js"></script>
253
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-D_0JUhT7.css">
252
+ <script type="module" crossorigin src="/assets/__vite-browser-external-BRzJpYc1.js"></script>
253
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-C44tPAD-.css">
254
254
  </head>
255
255
  <body>
256
256
  <main class="aeo-seed-content" aria-label="Token Tracker AI-readable summary">
@@ -75,8 +75,8 @@
75
75
  "description": "Shareable Token Tracker dashboard snapshot."
76
76
  }
77
77
  </script>
78
- <script type="module" crossorigin src="/assets/__vite-browser-external-DWKjPxnU.js"></script>
79
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-D_0JUhT7.css">
78
+ <script type="module" crossorigin src="/assets/__vite-browser-external-BRzJpYc1.js"></script>
79
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-C44tPAD-.css">
80
80
  </head>
81
81
  <body>
82
82
  <main class="aeo-seed-content" aria-label="Token Tracker share page summary">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokentracker-cli",
3
- "version": "0.83.2",
3
+ "version": "0.83.4",
4
4
  "description": "Local-first AI coding token usage and cost tracker for 27 tools, with a dashboard, desktop pet, widgets, achievements, and native macOS/Windows apps.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {