@ipv9/tokentracker-cli 0.39.37 → 0.39.39

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 (79) hide show
  1. package/README.md +41 -9
  2. package/dashboard/dist/assets/{Card-DKmo-v8a.js → Card-BbRYRVXf.js} +1 -1
  3. package/dashboard/dist/assets/DashboardPage-DYKHv0m3.js +60 -0
  4. package/dashboard/dist/assets/{FadeIn-Cf30rPTW.js → FadeIn-CjAacJ5t.js} +1 -1
  5. package/dashboard/dist/assets/{IpCheckPage-D3CL8XP0.js → IpCheckPage-BGALK8Vy.js} +1 -1
  6. package/dashboard/dist/assets/{LimitsPage-BqST7DxD.js → LimitsPage-LkZGPYvg.js} +2 -2
  7. package/dashboard/dist/assets/{LocalOnlyNotice-CqHzPooT.js → LocalOnlyNotice-Dxo2vFMQ.js} +1 -1
  8. package/dashboard/dist/assets/PopoverPopup-DP9fwdtl.js +1 -0
  9. package/dashboard/dist/assets/Select-DPE53NmM.js +1 -0
  10. package/dashboard/dist/assets/SelectItemText-D69v77is.js +12 -0
  11. package/dashboard/dist/assets/SettingsPage-Dxzqpi02.js +1 -0
  12. package/dashboard/dist/assets/SkillsPage-Bo7e39AB.js +1 -0
  13. package/dashboard/dist/assets/WidgetsPage-HHcIr_Eq.js +1 -0
  14. package/dashboard/dist/assets/WrappedPage-C-_jLXXU.js +1 -0
  15. package/dashboard/dist/assets/{arrow-up-right-BJzUcPig.js → arrow-up-right-BJvJHUGj.js} +1 -1
  16. package/dashboard/dist/assets/{download-CsXweDLj.js → download-CnzY_EgN.js} +1 -1
  17. package/dashboard/dist/assets/format-1w-q5n2f.js +1 -0
  18. package/dashboard/dist/assets/main-1kxAVM3m.css +1 -0
  19. package/dashboard/dist/assets/main-3gBEI6Jl.js +694 -0
  20. package/dashboard/dist/assets/mock-data-CJOMGcL9.js +1 -0
  21. package/dashboard/dist/assets/use-limits-display-prefs-D1nT9-mr.js +1 -0
  22. package/dashboard/dist/assets/use-native-settings-Dh6NzqjY.js +1 -0
  23. package/dashboard/dist/assets/use-usage-limits-BXR6lzGf.js +1 -0
  24. package/dashboard/dist/assets/useCurrency-Hhs5jbWw.js +1 -0
  25. package/dashboard/dist/index.html +16 -28
  26. package/dashboard/dist/llms.txt +0 -2
  27. package/dashboard/dist/sitemap.xml +0 -12
  28. package/package.json +7 -4
  29. package/src/cli.js +4 -13
  30. package/src/commands/doctor.js +1 -3
  31. package/src/commands/init.js +63 -53
  32. package/src/commands/serve.js +2 -50
  33. package/src/commands/status.js +1 -55
  34. package/src/commands/sync.js +134 -227
  35. package/src/lib/{browser-auth.js → browser-open.js} +3 -149
  36. package/src/lib/claude-categorizer.js +204 -32
  37. package/src/lib/codex-context-breakdown.js +83 -7
  38. package/src/lib/codex-rollout-parser.js +52 -10
  39. package/src/lib/diagnostics.js +1 -49
  40. package/src/lib/doctor.js +12 -87
  41. package/src/lib/file-identity.js +69 -0
  42. package/src/lib/init-flow.js +6 -3
  43. package/src/lib/local-api.js +6 -364
  44. package/src/lib/pricing/curated-overrides.json +1 -1
  45. package/src/lib/pricing/seed-snapshot.json +1 -1
  46. package/src/lib/rollout.js +392 -144
  47. package/src/lib/runtime-config.js +0 -32
  48. package/src/lib/sqlite-reader.js +83 -8
  49. package/dashboard/dist/assets/ActivityHeatmap-DPZ_Aj6E.js +0 -42
  50. package/dashboard/dist/assets/DashboardPage-C9Q5HCDh.js +0 -19
  51. package/dashboard/dist/assets/DevicePage-DhQFtROo.js +0 -1
  52. package/dashboard/dist/assets/DialogTitle-DduJCLiL.js +0 -1
  53. package/dashboard/dist/assets/InsforgeUserHeaderControls-CDqYVWBQ.js +0 -1
  54. package/dashboard/dist/assets/LandingPage-9345o0vr.js +0 -4356
  55. package/dashboard/dist/assets/LeaderboardAvatar-DNORVh3n.js +0 -1
  56. package/dashboard/dist/assets/LeaderboardPage-DBsdCCzY.js +0 -6
  57. package/dashboard/dist/assets/LeaderboardProfileModal-BuYdBVh_.js +0 -72
  58. package/dashboard/dist/assets/LeaderboardProfilePage-D4Fe1LOk.js +0 -1
  59. package/dashboard/dist/assets/LoginPage-BmcybmeK.js +0 -1
  60. package/dashboard/dist/assets/PopoverPopup-CDL7kqy5.js +0 -1
  61. package/dashboard/dist/assets/Select-BkzhG41t.js +0 -1
  62. package/dashboard/dist/assets/SelectItemText-BmRzs9ud.js +0 -1
  63. package/dashboard/dist/assets/SettingsPage-gXQl_o6s.js +0 -1
  64. package/dashboard/dist/assets/SkillsPage-BRXYEsKm.js +0 -1
  65. package/dashboard/dist/assets/WidgetsPage-CLHLz2UW.js +0 -1
  66. package/dashboard/dist/assets/WrappedPage-p4ZFwQjO.js +0 -1
  67. package/dashboard/dist/assets/index-BeoRn2gJ.js +0 -2
  68. package/dashboard/dist/assets/info-CuLr7ZIa.js +0 -1
  69. package/dashboard/dist/assets/main-CPGI-smk.js +0 -1004
  70. package/dashboard/dist/assets/main-DAcSUW2t.css +0 -1
  71. package/dashboard/dist/assets/use-limits-display-prefs-DOB09__q.js +0 -1
  72. package/dashboard/dist/assets/use-native-settings-JSylS2xS.js +0 -1
  73. package/dashboard/dist/assets/use-spring-qjUEvMQX.js +0 -1
  74. package/dashboard/dist/assets/use-usage-limits-B0bzPxNR.js +0 -1
  75. package/dashboard/dist/assets/useCurrency-BRorShq7.js +0 -1
  76. package/dashboard/dist/assets/useOpenInteractionType-DPP-6ZsL.js +0 -12
  77. package/dashboard/dist/share.html +0 -140
  78. package/src/commands/device-login.js +0 -161
  79. package/src/lib/upload-throttle.js +0 -148
@@ -1 +1 @@
1
- import{e as d,j as n,m as a}from"./main-CPGI-smk.js";function v({children:i,delay:t=0,duration:o=.35,y:e=12,className:s="",once:r=!0}){return d()?n.jsx("div",{className:s,children:i}):n.jsx(a.div,{initial:{opacity:0,y:e},animate:{opacity:1,y:0},transition:{duration:o,delay:t,ease:[.16,1,.3,1]},className:s,children:i})}function x({children:i,staggerDelay:t=.1,initialDelay:o=0,className:e=""}){return d()?n.jsx("div",{className:e,children:i}):n.jsx(a.div,{initial:"hidden",animate:"visible",variants:{hidden:{},visible:{transition:{staggerChildren:t,delayChildren:o}}},className:e,children:i})}function h({children:i,className:t="",y:o=12}){return d()?n.jsx("div",{className:t,children:i}):n.jsx(a.div,{variants:{hidden:{opacity:0,y:o},visible:{opacity:1,y:0,transition:{duration:.35,ease:[.16,1,.3,1]}}},className:t,children:i})}export{v as F,x as S,h as a};
1
+ import{n as d,j as n,o as a}from"./main-3gBEI6Jl.js";function v({children:i,delay:t=0,duration:o=.35,y:e=12,className:s="",once:r=!0}){return d()?n.jsx("div",{className:s,children:i}):n.jsx(a.div,{initial:{opacity:0,y:e},animate:{opacity:1,y:0},transition:{duration:o,delay:t,ease:[.16,1,.3,1]},className:s,children:i})}function x({children:i,staggerDelay:t=.1,initialDelay:o=0,className:e=""}){return d()?n.jsx("div",{className:e,children:i}):n.jsx(a.div,{initial:"hidden",animate:"visible",variants:{hidden:{},visible:{transition:{staggerChildren:t,delayChildren:o}}},className:e,children:i})}function h({children:i,className:t="",y:o=12}){return d()?n.jsx("div",{className:t,children:i}):n.jsx(a.div,{variants:{hidden:{opacity:0,y:o},visible:{opacity:1,y:0,transition:{duration:.35,ease:[.16,1,.3,1]}}},className:t,children:i})}export{v as F,x as S,h as a};
@@ -1,4 +1,4 @@
1
- import{r as ce,A as t,j as n}from"./main-CPGI-smk.js";const Ge=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),$=Ge?"/proxy/ipcheck":"https://ip.net.coffee",le="claude_ip_history",be=6,Ue=["CN","HK","MO","RU","KP","IR","SY","CU","BY","VE"],ze={CN:"Asia/Shanghai",TW:"Asia/Taipei",HK:"Asia/Hong_Kong",MO:"Asia/Macau",JP:"Asia/Tokyo",KR:"Asia/Seoul",SG:"Asia/Singapore",MY:"Asia/Kuala_Lumpur",TH:"Asia/Bangkok",VN:"Asia/Ho_Chi_Minh",ID:"Asia/Jakarta",PH:"Asia/Manila",IN:"Asia/Kolkata",PK:"Asia/Karachi",BD:"Asia/Dhaka",IR:"Asia/Tehran",IL:"Asia/Jerusalem",AE:"Asia/Dubai",SA:"Asia/Riyadh",TR:"Europe/Istanbul",RU:"Europe/Moscow",UA:"Europe/Kyiv",GB:"Europe/London",IE:"Europe/Dublin",FR:"Europe/Paris",DE:"Europe/Berlin",IT:"Europe/Rome",ES:"Europe/Madrid",PT:"Europe/Lisbon",NL:"Europe/Amsterdam",BE:"Europe/Brussels",CH:"Europe/Zurich",AT:"Europe/Vienna",SE:"Europe/Stockholm",NO:"Europe/Oslo",DK:"Europe/Copenhagen",FI:"Europe/Helsinki",PL:"Europe/Warsaw",CZ:"Europe/Prague",GR:"Europe/Athens",RO:"Europe/Bucharest",US:"America/Los_Angeles",CA:"America/Toronto",MX:"America/Mexico_City",BR:"America/Sao_Paulo",AR:"America/Argentina/Buenos_Aires",CL:"America/Santiago",AU:"Australia/Sydney",NZ:"Pacific/Auckland",ZA:"Africa/Johannesburg",EG:"Africa/Cairo",NG:"Africa/Lagos",KE:"Africa/Nairobi"},We={CN:["zh"],TW:["zh"],HK:["zh","en"],MO:["zh","en"],JP:["ja"],KR:["ko"],TH:["th"],VN:["vi"],SG:["en","zh","ms","ta"],MY:["ms","en","zh","ta"],ID:["id","en"],PH:["en","tl","fil"],IN:["en","hi"],PK:["ur","en"],BD:["bn","en"],LK:["si","ta","en"],NP:["ne","en"],US:["en"],GB:["en"],IE:["en","ga"],AU:["en"],NZ:["en","mi"],CA:["en","fr"],DE:["de"],AT:["de"],CH:["de","fr","it","rm"],BE:["nl","fr","de"],FR:["fr"],IT:["it"],ES:["es","ca","gl","eu"],PT:["pt"],NL:["nl","fy"],LU:["lb","fr","de"],SE:["sv"],NO:["no","nb","nn"],DK:["da"],FI:["fi","sv"],IS:["is","en"],PL:["pl"],CZ:["cs"],SK:["sk"],HU:["hu"],RO:["ro"],BG:["bg"],GR:["el"],RU:["ru"],UA:["uk","ru"],BY:["be","ru"],TR:["tr"],IL:["he","ar","en"],SA:["ar"],AE:["ar","en"],EG:["ar"],IR:["fa"],IQ:["ar","ku"],ZA:["en","af","zu","xh"],KE:["en","sw"],NG:["en"],ET:["am","en"],BR:["pt"],AR:["es"],MX:["es"],CL:["es"],CO:["es"],PE:["es"],VE:["es"]},Be={jp:"Japan",tw:"Taiwan",hk:"Hong Kong",sg:"Singapore",us:"United States",de:"Germany",kr:"South Korea",fr:"France",nl:"Netherlands",gb:"United Kingdom",au:"Australia",ca:"Canada",br:"Brazil",in:"India"};function Z(d){return!!d&&d.includes(":")}function Ke(d){return!Z(d)||d.length<=20?d:d.substring(0,18)+"..."}function v(d){return d==null?"":String(d).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function W(d){if(!d||!/^[a-zA-Z]{2}$/.test(d))return"";const k=d.toLowerCase();return`<img src="${k==="cn"?`${$}/favicons/cn.png`:k==="tw"?`${$}/favicons/flags/tw.png`:`${$}/favicons/flags/${k}.png`}" alt="${k}" class="inline-block h-4 w-auto rounded-sm align-[-2px]" onerror="this.onerror=null;this.style.display='none'">`}function Fe(d){if(!d)return"";const k=String(d).trim();if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(k)){const _=k.split(".");return _[0]+"."+_[1]+".*.*"}if(k.includes("…")){const _=k.lastIndexOf("…");return k.substring(0,_+1)+"*"}if(k.includes(":")){const _=k.split(":");if(_.length>=2)return _[0]+":"+_[1]+":*"}return k}function Ve(d){if(!d)return null;try{const _=new Intl.DateTimeFormat("en-US",{timeZone:d,timeZoneName:"longOffset"}).formatToParts(new Date).find(J=>J.type==="timeZoneName");if(!_)return null;if(_.value==="GMT"||_.value==="UTC")return 0;const N=_.value.match(/GMT([+-])(\d{1,2}):?(\d{0,2})/);return N?(N[1]==="+"?1:-1)*(parseInt(N[2],10)*60+parseInt(N[3]||"0",10)):null}catch{return null}}function Ye(d){if(d==null)return"";const k=d>=0?"+":"-",_=Math.abs(d),N=Math.floor(_/60),O=_%60;return"UTC"+k+N+(O?":"+String(O).padStart(2,"0"):"")}const we={safe:"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300",warn:"bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300",danger:"bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300",info:"bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-300",neutral:"bg-oai-gray-100 text-oai-gray-600 dark:bg-oai-gray-800 dark:text-oai-gray-400"};function qe(){const d=ce.useRef(null),[k,_]=ce.useState(!1);ce.useEffect(()=>{const L=d.current;if(!L)return;const b=a=>L.querySelector(`#${a}`);let ae=!1;const e={unknown:t("ipcheck.common.unknown"),failed:t("ipcheck.ip.failed"),regionAccessible:t("ipcheck.trust.region.accessible"),regionWarnTitle:a=>t("ipcheck.trust.region_warn.title",{region:a}),regionWarnBody:t("ipcheck.trust.region_warn.body"),regionRestrictedText:t("ipcheck.trust.text.restricted"),noData:t("ipcheck.trust.no_data"),noIp:t("ipcheck.trust.no_ip"),noScore:t("ipcheck.trust.no_score"),score:{pristine:t("ipcheck.trust.label.pristine"),clean:t("ipcheck.trust.label.clean"),good:t("ipcheck.trust.label.good"),neutral:t("ipcheck.trust.label.neutral"),suspicious:t("ipcheck.trust.label.suspicious"),unreachable:t("ipcheck.trust.label.unreachable")},scoreText:{excellent:t("ipcheck.trust.text.excellent"),great:t("ipcheck.trust.text.great"),minor:t("ipcheck.trust.text.minor"),moderate:t("ipcheck.trust.text.moderate"),severe:t("ipcheck.trust.text.severe")},propsRegion:t("ipcheck.props.region"),propsCity:t("ipcheck.props.city"),propsType:t("ipcheck.props.type"),propsAsn:t("ipcheck.props.asn"),propsOrg:t("ipcheck.props.org"),propsResidential:t("ipcheck.props.residential"),propsDatacenter:t("ipcheck.props.datacenter"),secVpn:t("ipcheck.security.vpn"),secProxy:t("ipcheck.security.proxy"),secTor:t("ipcheck.security.tor"),secCrawler:t("ipcheck.security.crawler"),secAbuser:t("ipcheck.security.abuser"),secProxyFlag:t("ipcheck.security.proxy_flag"),secCrawlerYes:t("ipcheck.security.crawler_yes"),secCrawlerNo:t("ipcheck.security.crawler_no"),secAbuserYes:t("ipcheck.security.abuser_yes"),secAbuserNo:t("ipcheck.security.abuser_no"),secClean:t("ipcheck.security.clean"),availSvc:t("ipcheck.avail.svc_row"),availLat:{normal:t("ipcheck.avail.latency.normal"),good:t("ipcheck.avail.latency.good"),slow:t("ipcheck.avail.latency.slow"),unreachable:t("ipcheck.avail.latency.unreachable")},availSvcStatus:{none:t("ipcheck.avail.svc.none"),minor:t("ipcheck.avail.svc.minor"),major:t("ipcheck.avail.svc.major"),critical:t("ipcheck.avail.svc.critical"),maintenance:t("ipcheck.avail.svc.maintenance"),other:t("ipcheck.avail.svc.other")},dnsStatus:t("ipcheck.dns.status"),dnsOutlet:t("ipcheck.dns.outlet"),dnsOutletIp:t("ipcheck.dns.outlet_ip"),dnsIsp:t("ipcheck.dns.isp"),dnsLeaked:t("ipcheck.dns.leaked"),dnsNoLeak:t("ipcheck.dns.no_leak"),dnsEncrypted:t("ipcheck.dns.encrypted"),dnsCnTag:t("ipcheck.dns.cn_tag"),udpStatus:t("ipcheck.udp.status"),udpOutlet:t("ipcheck.udp.outlet"),udpOutletIp:t("ipcheck.udp.outlet_ip"),udpOrigin:t("ipcheck.udp.origin"),udpDisabled:t("ipcheck.udp.disabled"),udpNoLeak:t("ipcheck.udp.no_leak"),udpLeaked:t("ipcheck.udp.leaked"),udpAnomaly:t("ipcheck.udp.anomaly"),devTz:t("ipcheck.device.tz"),devLang:t("ipcheck.device.lang"),devOs:t("ipcheck.device.os"),devTouch:t("ipcheck.device.touch"),devNet:t("ipcheck.device.net"),devDnt:t("ipcheck.device.dnt"),devWebglRender:t("ipcheck.device.webgl_render"),devCanvasFp:t("ipcheck.device.canvas_fp"),devWebglFp:t("ipcheck.device.webgl_fp"),devMatch:t("ipcheck.device.match"),devMismatch:t("ipcheck.device.mismatch"),devLocal:t("ipcheck.device.local"),devEstSuffix:t("ipcheck.device.estimate_suffix"),devDiffEqual:t("ipcheck.device.diff_equal"),devDiffAhead:a=>t("ipcheck.device.diff_ahead",{h:a}),devDiffBehind:a=>t("ipcheck.device.diff_behind",{h:a}),devLangExpected:t("ipcheck.device.lang_expected"),devTouchYes:t("ipcheck.device.touch_yes"),devTouchNo:t("ipcheck.device.touch_no"),devDntOn:t("ipcheck.device.dnt_on"),devDntOff:t("ipcheck.device.dnt_off"),devDntUnset:t("ipcheck.device.dnt_unset"),devNetUnsupported:t("ipcheck.device.net_unsupported"),devUnsupported:t("ipcheck.device.unsupported"),histEmpty:t("ipcheck.history.empty"),histCurrent:t("ipcheck.history.current"),histLoading:t("ipcheck.ip.loading")};function g(a,i="neutral"){return`<span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${we[i]||we.neutral}">${a}</span>`}function q(a,i,r){return a===!0?g(i,"danger"):a===!1?g(r,"safe"):g(e.unknown,"neutral")}function ue(a){if(!a)return`<span class="text-oai-gray-400 dark:text-oai-gray-500">${v(e.failed)}</span>`;const i=v(a);return Z(a)?`<span class="ip-mask-target truncate" title="${i}">${v(Ke(a))}</span>`:`<span class="ip-mask-target">${i}</span>`}function B(a){return a?`<span class="ip-link">${ue(a)}</span>`:`<span class="text-oai-gray-400 dark:text-oai-gray-500">${v(e.failed)}</span>`}function f(a,i){return`<div class="flex items-center justify-between py-3 gap-3">
1
+ import{r as ce,p as t,j as n}from"./main-3gBEI6Jl.js";const Ge=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),$=Ge?"/proxy/ipcheck":"https://ip.net.coffee",le="claude_ip_history",be=6,Ue=["CN","HK","MO","RU","KP","IR","SY","CU","BY","VE"],ze={CN:"Asia/Shanghai",TW:"Asia/Taipei",HK:"Asia/Hong_Kong",MO:"Asia/Macau",JP:"Asia/Tokyo",KR:"Asia/Seoul",SG:"Asia/Singapore",MY:"Asia/Kuala_Lumpur",TH:"Asia/Bangkok",VN:"Asia/Ho_Chi_Minh",ID:"Asia/Jakarta",PH:"Asia/Manila",IN:"Asia/Kolkata",PK:"Asia/Karachi",BD:"Asia/Dhaka",IR:"Asia/Tehran",IL:"Asia/Jerusalem",AE:"Asia/Dubai",SA:"Asia/Riyadh",TR:"Europe/Istanbul",RU:"Europe/Moscow",UA:"Europe/Kyiv",GB:"Europe/London",IE:"Europe/Dublin",FR:"Europe/Paris",DE:"Europe/Berlin",IT:"Europe/Rome",ES:"Europe/Madrid",PT:"Europe/Lisbon",NL:"Europe/Amsterdam",BE:"Europe/Brussels",CH:"Europe/Zurich",AT:"Europe/Vienna",SE:"Europe/Stockholm",NO:"Europe/Oslo",DK:"Europe/Copenhagen",FI:"Europe/Helsinki",PL:"Europe/Warsaw",CZ:"Europe/Prague",GR:"Europe/Athens",RO:"Europe/Bucharest",US:"America/Los_Angeles",CA:"America/Toronto",MX:"America/Mexico_City",BR:"America/Sao_Paulo",AR:"America/Argentina/Buenos_Aires",CL:"America/Santiago",AU:"Australia/Sydney",NZ:"Pacific/Auckland",ZA:"Africa/Johannesburg",EG:"Africa/Cairo",NG:"Africa/Lagos",KE:"Africa/Nairobi"},We={CN:["zh"],TW:["zh"],HK:["zh","en"],MO:["zh","en"],JP:["ja"],KR:["ko"],TH:["th"],VN:["vi"],SG:["en","zh","ms","ta"],MY:["ms","en","zh","ta"],ID:["id","en"],PH:["en","tl","fil"],IN:["en","hi"],PK:["ur","en"],BD:["bn","en"],LK:["si","ta","en"],NP:["ne","en"],US:["en"],GB:["en"],IE:["en","ga"],AU:["en"],NZ:["en","mi"],CA:["en","fr"],DE:["de"],AT:["de"],CH:["de","fr","it","rm"],BE:["nl","fr","de"],FR:["fr"],IT:["it"],ES:["es","ca","gl","eu"],PT:["pt"],NL:["nl","fy"],LU:["lb","fr","de"],SE:["sv"],NO:["no","nb","nn"],DK:["da"],FI:["fi","sv"],IS:["is","en"],PL:["pl"],CZ:["cs"],SK:["sk"],HU:["hu"],RO:["ro"],BG:["bg"],GR:["el"],RU:["ru"],UA:["uk","ru"],BY:["be","ru"],TR:["tr"],IL:["he","ar","en"],SA:["ar"],AE:["ar","en"],EG:["ar"],IR:["fa"],IQ:["ar","ku"],ZA:["en","af","zu","xh"],KE:["en","sw"],NG:["en"],ET:["am","en"],BR:["pt"],AR:["es"],MX:["es"],CL:["es"],CO:["es"],PE:["es"],VE:["es"]},Be={jp:"Japan",tw:"Taiwan",hk:"Hong Kong",sg:"Singapore",us:"United States",de:"Germany",kr:"South Korea",fr:"France",nl:"Netherlands",gb:"United Kingdom",au:"Australia",ca:"Canada",br:"Brazil",in:"India"};function Z(d){return!!d&&d.includes(":")}function Ke(d){return!Z(d)||d.length<=20?d:d.substring(0,18)+"..."}function v(d){return d==null?"":String(d).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function W(d){if(!d||!/^[a-zA-Z]{2}$/.test(d))return"";const k=d.toLowerCase();return`<img src="${k==="cn"?`${$}/favicons/cn.png`:k==="tw"?`${$}/favicons/flags/tw.png`:`${$}/favicons/flags/${k}.png`}" alt="${k}" class="inline-block h-4 w-auto rounded-sm align-[-2px]" onerror="this.onerror=null;this.style.display='none'">`}function Fe(d){if(!d)return"";const k=String(d).trim();if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(k)){const _=k.split(".");return _[0]+"."+_[1]+".*.*"}if(k.includes("…")){const _=k.lastIndexOf("…");return k.substring(0,_+1)+"*"}if(k.includes(":")){const _=k.split(":");if(_.length>=2)return _[0]+":"+_[1]+":*"}return k}function Ve(d){if(!d)return null;try{const _=new Intl.DateTimeFormat("en-US",{timeZone:d,timeZoneName:"longOffset"}).formatToParts(new Date).find(J=>J.type==="timeZoneName");if(!_)return null;if(_.value==="GMT"||_.value==="UTC")return 0;const N=_.value.match(/GMT([+-])(\d{1,2}):?(\d{0,2})/);return N?(N[1]==="+"?1:-1)*(parseInt(N[2],10)*60+parseInt(N[3]||"0",10)):null}catch{return null}}function Ye(d){if(d==null)return"";const k=d>=0?"+":"-",_=Math.abs(d),N=Math.floor(_/60),O=_%60;return"UTC"+k+N+(O?":"+String(O).padStart(2,"0"):"")}const we={safe:"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300",warn:"bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300",danger:"bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300",info:"bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-300",neutral:"bg-oai-gray-100 text-oai-gray-600 dark:bg-oai-gray-800 dark:text-oai-gray-400"};function qe(){const d=ce.useRef(null),[k,_]=ce.useState(!1);ce.useEffect(()=>{const L=d.current;if(!L)return;const b=a=>L.querySelector(`#${a}`);let ae=!1;const e={unknown:t("ipcheck.common.unknown"),failed:t("ipcheck.ip.failed"),regionAccessible:t("ipcheck.trust.region.accessible"),regionWarnTitle:a=>t("ipcheck.trust.region_warn.title",{region:a}),regionWarnBody:t("ipcheck.trust.region_warn.body"),regionRestrictedText:t("ipcheck.trust.text.restricted"),noData:t("ipcheck.trust.no_data"),noIp:t("ipcheck.trust.no_ip"),noScore:t("ipcheck.trust.no_score"),score:{pristine:t("ipcheck.trust.label.pristine"),clean:t("ipcheck.trust.label.clean"),good:t("ipcheck.trust.label.good"),neutral:t("ipcheck.trust.label.neutral"),suspicious:t("ipcheck.trust.label.suspicious"),unreachable:t("ipcheck.trust.label.unreachable")},scoreText:{excellent:t("ipcheck.trust.text.excellent"),great:t("ipcheck.trust.text.great"),minor:t("ipcheck.trust.text.minor"),moderate:t("ipcheck.trust.text.moderate"),severe:t("ipcheck.trust.text.severe")},propsRegion:t("ipcheck.props.region"),propsCity:t("ipcheck.props.city"),propsType:t("ipcheck.props.type"),propsAsn:t("ipcheck.props.asn"),propsOrg:t("ipcheck.props.org"),propsResidential:t("ipcheck.props.residential"),propsDatacenter:t("ipcheck.props.datacenter"),secVpn:t("ipcheck.security.vpn"),secProxy:t("ipcheck.security.proxy"),secTor:t("ipcheck.security.tor"),secCrawler:t("ipcheck.security.crawler"),secAbuser:t("ipcheck.security.abuser"),secProxyFlag:t("ipcheck.security.proxy_flag"),secCrawlerYes:t("ipcheck.security.crawler_yes"),secCrawlerNo:t("ipcheck.security.crawler_no"),secAbuserYes:t("ipcheck.security.abuser_yes"),secAbuserNo:t("ipcheck.security.abuser_no"),secClean:t("ipcheck.security.clean"),availSvc:t("ipcheck.avail.svc_row"),availLat:{normal:t("ipcheck.avail.latency.normal"),good:t("ipcheck.avail.latency.good"),slow:t("ipcheck.avail.latency.slow"),unreachable:t("ipcheck.avail.latency.unreachable")},availSvcStatus:{none:t("ipcheck.avail.svc.none"),minor:t("ipcheck.avail.svc.minor"),major:t("ipcheck.avail.svc.major"),critical:t("ipcheck.avail.svc.critical"),maintenance:t("ipcheck.avail.svc.maintenance"),other:t("ipcheck.avail.svc.other")},dnsStatus:t("ipcheck.dns.status"),dnsOutlet:t("ipcheck.dns.outlet"),dnsOutletIp:t("ipcheck.dns.outlet_ip"),dnsIsp:t("ipcheck.dns.isp"),dnsLeaked:t("ipcheck.dns.leaked"),dnsNoLeak:t("ipcheck.dns.no_leak"),dnsEncrypted:t("ipcheck.dns.encrypted"),dnsCnTag:t("ipcheck.dns.cn_tag"),udpStatus:t("ipcheck.udp.status"),udpOutlet:t("ipcheck.udp.outlet"),udpOutletIp:t("ipcheck.udp.outlet_ip"),udpOrigin:t("ipcheck.udp.origin"),udpDisabled:t("ipcheck.udp.disabled"),udpNoLeak:t("ipcheck.udp.no_leak"),udpLeaked:t("ipcheck.udp.leaked"),udpAnomaly:t("ipcheck.udp.anomaly"),devTz:t("ipcheck.device.tz"),devLang:t("ipcheck.device.lang"),devOs:t("ipcheck.device.os"),devTouch:t("ipcheck.device.touch"),devNet:t("ipcheck.device.net"),devDnt:t("ipcheck.device.dnt"),devWebglRender:t("ipcheck.device.webgl_render"),devCanvasFp:t("ipcheck.device.canvas_fp"),devWebglFp:t("ipcheck.device.webgl_fp"),devMatch:t("ipcheck.device.match"),devMismatch:t("ipcheck.device.mismatch"),devLocal:t("ipcheck.device.local"),devEstSuffix:t("ipcheck.device.estimate_suffix"),devDiffEqual:t("ipcheck.device.diff_equal"),devDiffAhead:a=>t("ipcheck.device.diff_ahead",{h:a}),devDiffBehind:a=>t("ipcheck.device.diff_behind",{h:a}),devLangExpected:t("ipcheck.device.lang_expected"),devTouchYes:t("ipcheck.device.touch_yes"),devTouchNo:t("ipcheck.device.touch_no"),devDntOn:t("ipcheck.device.dnt_on"),devDntOff:t("ipcheck.device.dnt_off"),devDntUnset:t("ipcheck.device.dnt_unset"),devNetUnsupported:t("ipcheck.device.net_unsupported"),devUnsupported:t("ipcheck.device.unsupported"),histEmpty:t("ipcheck.history.empty"),histCurrent:t("ipcheck.history.current"),histLoading:t("ipcheck.ip.loading")};function g(a,i="neutral"){return`<span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${we[i]||we.neutral}">${a}</span>`}function q(a,i,r){return a===!0?g(i,"danger"):a===!1?g(r,"safe"):g(e.unknown,"neutral")}function ue(a){if(!a)return`<span class="text-oai-gray-400 dark:text-oai-gray-500">${v(e.failed)}</span>`;const i=v(a);return Z(a)?`<span class="ip-mask-target truncate" title="${i}">${v(Ke(a))}</span>`:`<span class="ip-mask-target">${i}</span>`}function B(a){return a?`<span class="ip-link">${ue(a)}</span>`:`<span class="text-oai-gray-400 dark:text-oai-gray-500">${v(e.failed)}</span>`}function f(a,i){return`<div class="flex items-center justify-between py-3 gap-3">
2
2
  <span class="text-sm text-oai-gray-500 dark:text-oai-gray-400 shrink-0">${a}</span>
3
3
  <span class="text-sm font-medium text-oai-black dark:text-white text-right min-w-0">${i===void 0?'<span class="block h-3 w-20 rounded bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse"></span>':i}</span>
4
4
  </div>`}function Y(a){return a.map(i=>f(i,void 0)).join("")}function ne(){return'<div class="h-7 w-44 rounded bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse"></div>'}function ie(){return'<div class="h-3 w-52 mt-2 rounded bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse"></div>'}function _e(a){return a>=95?{text:e.score.pristine,variant:"safe"}:a>=80?{text:e.score.clean,variant:"safe"}:a>=50?{text:e.score.good,variant:"info"}:a>=25?{text:e.score.neutral,variant:"warn"}:{text:e.score.suspicious,variant:"danger"}}const w={ip:null,ippure:null,ipapis:null,claudeGeo:null,claudeRisk:null,cfGeo:""};function pe(){const a=(w.claudeRisk?.countryCode||"").toUpperCase();return!a||!Ue.includes(a)?null:t(`ipcheck.region.${a}`)}function se(){const a=b("ipv6Warn");a&&a.classList.remove("hidden")}function Q(a,i){const r=b(a);r&&(r.textContent=i||"",r.classList.remove("animate-pulse","bg-oai-gray-200","dark:bg-oai-gray-800","w-52","h-3","mt-2","rounded"))}const Te={ipAddrCN:ne(),ipGeoCN:ie(),ipAddr:ne(),ipGeo:ie(),ipAddrClaude:ne(),ipGeoClaude:ie(),propsContent:Y([e.propsRegion,e.propsCity,e.propsType,e.propsAsn,e.propsOrg]),securityContent:Y([e.secVpn,e.secProxy,e.secTor,e.secCrawler,e.secAbuser]),claudeAvailContent:Y(["claude.ai","anthropic.com"]),dnsLeakContent:Y([e.dnsStatus,e.dnsOutletIp]),udpLeakContent:Y([e.udpStatus,e.udpOutletIp]),deviceContent:Y([e.devTz,e.devLang,e.devOs,e.devTouch,e.devNet,e.devDnt,e.devWebglRender,e.devCanvasFp]),ipHistoryContent:`<span class="text-sm text-oai-gray-400 dark:text-oai-gray-500">${e.histLoading}</span>`};Object.entries(Te).forEach(([a,i])=>{const r=b(a);r&&(r.innerHTML=i)});let ge=!1;function Se(a){if(!a)return;a.dataset.realText||(a.dataset.realText=(a.textContent||"").trim());const i=a.dataset.realText,r=ge?Fe(i):i;a.textContent!==r&&(a.textContent=r)}function fe(){L.querySelectorAll(".ip-link, .ip-mask-target").forEach(Se)}const he=new MutationObserver(()=>requestAnimationFrame(fe));["ipHeroCN","ipHero","ipHeroClaude","ipHistoryContent","dnsLeakContent","udpLeakContent"].forEach(a=>{const i=b(a);i&&he.observe(i,{childList:!0,subtree:!0})}),L.__setMaskOn=a=>{ge=!!a,fe()};async function Le(){try{const r=(await(await fetch("https://1.1.1.1/cdn-cgi/trace",{signal:AbortSignal.timeout(5e3)})).text()).match(/ip=([^\n]+)/);r&&(w.ip=r[1].trim())}catch{}}async function Ae(){try{const i=await(await fetch("https://claude.ai/cdn-cgi/trace",{cache:"no-store",signal:AbortSignal.timeout(8e3)})).text(),r=Object.fromEntries(i.trim().split(`
@@ -1,2 +1,2 @@
1
- import{j as i,O as j,A as s,r as I,az as P,i as O,L as R,aA as C}from"./main-CPGI-smk.js";import{u as M}from"./use-usage-limits-B0bzPxNR.js";import{L as u,u as T}from"./use-limits-display-prefs-DOB09__q.js";import{C as v}from"./Card-DKmo-v8a.js";import{F as A}from"./FadeIn-Cf30rPTW.js";import{L as S}from"./LocalOnlyNotice-CqHzPooT.js";import"./arrow-up-right-BJzUcPig.js";import"./download-CsXweDLj.js";const z=[3,2,3,3,2,2,3];function x({className:n}){return i.jsx("div",{className:j("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",n)})}function D(){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(x,{className:"h-3 w-12 shrink-0"}),i.jsx(x,{className:"flex-1 h-1.5 rounded-full min-w-0"}),i.jsx(x,{className:"h-3 w-[30px] shrink-0"}),i.jsx(x,{className:"h-3 w-6 shrink-0"})]})}function $({bars:n,index:e}){const r=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(x,{className:"h-[14px] w-[14px] rounded shrink-0"}),i.jsx(x,{className:j("h-4",r)})]}),Array.from({length:n},(t,l)=>i.jsx(D,{},l))]})}function G(){return i.jsx(v,{children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx(x,{className:"h-3.5 w-28"}),z.map((n,e)=>i.jsx($,{bars:n,index:e},e))]})})}function o(n){if(!n)return null;const e=typeof n=="number"?n*1e3:Date.parse(n);if(!Number.isFinite(e))return null;const r=e-Date.now();if(r<=0)return s("shared.time.now");const t=Math.floor(r/6e4);if(t<60)return`${t}m`;const l=Math.floor(t/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function H(n,e){const r=e===u.REMAINING?100-n:n;return r>=90?"bg-red-500":r>=70?"bg-amber-500":"bg-emerald-500"}function a({label:n,pct:e,reset:r,mode:t=u.USED}){const l=Math.max(0,Math.min(100,Number(e)||0)),d=t===u.REMAINING?100-l:l,w=Math.round(d),_=d>0&&w===0?Math.max(d,.35):d,y=d>0&&w===0?"<1":String(w);return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:n}),i.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:i.jsx("div",{className:`${H(d,t)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${_}%`,minWidth:d>0?"3px":0}})}),i.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-9 text-right shrink-0 whitespace-nowrap",children:[y,"%"]}),r?i.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:r}):null]})}function m({name:n,icon:e,children:r}){const l=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"||e==="/brand-logos/kimi.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[e?i.jsx("img",{src:e,alt:"",className:l}):null,i.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:n})]}),r]})}const F=["claude","codex","cursor","gemini","kimi","zai","kiro","copilot","antigravity"],B={claude:{name:"Claude",icon:"/brand-logos/claude-code.svg"},codex:{name:"Codex",icon:"/brand-logos/codex.svg"},cursor:{name:"Cursor",icon:"/brand-logos/cursor.svg"},gemini:{name:"Gemini",icon:"/brand-logos/gemini.svg"},kimi:{name:"Kimi",icon:"/brand-logos/kimi.svg"},zai:{name:"Z.AI",icon:null},kiro:{name:"Kiro",icon:"/brand-logos/kiro.svg"},copilot:{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg"},antigravity:{name:"Antigravity",icon:"/brand-logos/antigravity.svg"}};function c({children:n,tone:e="neutral"}){const r=e==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return i.jsx("div",{className:`text-[11px] leading-snug ${r}`,children:n})}function U(n,e,r){const t=B[n];if(!t)return null;if(!e?.configured)return i.jsx(m,{name:t.name,icon:t.icon,children:i.jsx(c,{children:s("limits.status.not_connected")})},n);if(e.error)return i.jsx(m,{name:t.name,icon:t.icon,children:i.jsx(c,{tone:"error",children:s("shared.error.prefix",{error:e.error})})},n);const l=e.plan_label?`${t.name} ${e.plan_label}`:t.name;switch(n){case"claude":return i.jsxs(m,{name:l,icon:t.icon,children:[e.five_hour?i.jsx(a,{label:"5h",pct:e.five_hour.utilization,reset:o(e.five_hour.resets_at),mode:r}):null,e.seven_day?i.jsx(a,{label:"7d",pct:e.seven_day.utilization,reset:o(e.seven_day.resets_at),mode:r}):null,e.seven_day_opus?i.jsx(a,{label:"Opus",pct:e.seven_day_opus.utilization,reset:o(e.seven_day_opus.resets_at),mode:r}):null,e.cached?i.jsx(c,{children:s("limits.status.cached")}):null,!e.five_hour&&!e.seven_day&&!e.seven_day_opus?i.jsx(c,{children:s("limits.status.no_data")}):null]},"claude");case"codex":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"5h",pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"7d",pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"codex");case"cursor":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"cursor");case"gemini":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"Pro",pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"Flash",pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:"Lite",pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"gemini");case"kimi":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.kimi_weekly"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.kimi_5h"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.kimi_total"),pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,e.parallel_limit?i.jsx(c,{children:s("limits.label.kimi_parallel",{count:e.parallel_limit})}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"kimi");case"zai":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.zai_5h"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.zai_weekly"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.zai_mcp"),pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"zai");case"kiro":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"kiro");case"antigravity":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"Claude",pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"G Pro",pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:"Flash",pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"antigravity");case"copilot":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null,e.otel_has_files||e.otel_enabled?null:i.jsx(Y,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function Y({defaultDir:n}){const[e,r]=I.useState(!1),l=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${n||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
2
- `),d=async()=>{try{await navigator.clipboard.writeText(l),r(!0),setTimeout(()=>r(!1),1600)}catch{}};return i.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[i.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:s("limits.copilot.otelHint.title")}),i.jsx("div",{className:"mt-0.5 leading-snug",children:s("limits.copilot.otelHint.body")}),i.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:l}),i.jsx("button",{type:"button",onClick:d,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?s("limits.copilot.otelHint.copied"):s("limits.copilot.otelHint.copy")})]})}function K({claude:n,codex:e,cursor:r,gemini:t,kimi:l,zai:d,kiro:w,antigravity:_,copilot:y,order:h,visibility:g,displayMode:k}){const N={claude:n,codex:e,cursor:r,gemini:t,kimi:l,zai:d,kiro:w,antigravity:_,copilot:y},L=Array.isArray(h)&&h.length>0?h:F,b=k===u.REMAINING?u.REMAINING:u.USED,E=b===u.REMAINING?s("limits.settings.display_mode_remaining"):s("limits.settings.display_mode_used"),f=L.filter(p=>!g||g[p]!==!1).map(p=>U(p,N[p],b)).filter(Boolean);return i.jsx(A,{delay:.15,children:i.jsx(v,{children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:[s("limits.panel.title"),s("limits.panel.mode_separator"),E]}),f.length>0?f:i.jsx(c,{children:s("limits.status.all_hidden")})]})})})}const V=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function re(){const n=P(),{data:e,error:r,isLoading:t}=M(n?{initialRefresh:!0,initialState:n,publishToPreloadCache:!0}:{initialRefresh:!0,publishToPreloadCache:!0}),l=T();return!V&&!O()?i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx(S,{})}):i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:i.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[i.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:s("nav.limits")}),i.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:s("limits.page.subtitle")})]}),i.jsx(R,{to:"/settings","aria-label":s("limits.page.openSettings"),title:s("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:i.jsx(C,{className:"h-4 w-4","aria-hidden":!0})})]}),t?i.jsx(G,{}):i.jsxs(i.Fragment,{children:[r?i.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:s("shared.error.prefix",{error:r})}):null,i.jsx(K,{claude:e?.claude,codex:e?.codex,cursor:e?.cursor,gemini:e?.gemini,kimi:e?.kimi,zai:e?.zai,kiro:e?.kiro,antigravity:e?.antigravity,copilot:e?.copilot,order:l.order,visibility:l.visibility,displayMode:l.displayMode})]})]})})})}export{re as LimitsPage};
1
+ import{j as i,x as j,p as s,r as I,G as P,L as R,S as C}from"./main-3gBEI6Jl.js";import{u as M}from"./use-usage-limits-BXR6lzGf.js";import{L as u,u as O}from"./use-limits-display-prefs-D1nT9-mr.js";import{C as v}from"./Card-BbRYRVXf.js";import{F as T}from"./FadeIn-CjAacJ5t.js";import{L as S}from"./LocalOnlyNotice-Dxo2vFMQ.js";import{i as A}from"./mock-data-CJOMGcL9.js";import"./arrow-up-right-BJvJHUGj.js";import"./download-CnzY_EgN.js";import"./format-1w-q5n2f.js";const D=[3,2,3,3,2,2,3];function x({className:n}){return i.jsx("div",{className:j("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",n)})}function z(){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(x,{className:"h-3 w-12 shrink-0"}),i.jsx(x,{className:"flex-1 h-1.5 rounded-full min-w-0"}),i.jsx(x,{className:"h-3 w-[30px] shrink-0"}),i.jsx(x,{className:"h-3 w-6 shrink-0"})]})}function G({bars:n,index:e}){const r=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(x,{className:"h-[14px] w-[14px] rounded shrink-0"}),i.jsx(x,{className:j("h-4",r)})]}),Array.from({length:n},(t,l)=>i.jsx(z,{},l))]})}function $(){return i.jsx(v,{children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx(x,{className:"h-3.5 w-28"}),D.map((n,e)=>i.jsx(G,{bars:n,index:e},e))]})})}function o(n){if(!n)return null;const e=typeof n=="number"?n*1e3:Date.parse(n);if(!Number.isFinite(e))return null;const r=e-Date.now();if(r<=0)return s("shared.time.now");const t=Math.floor(r/6e4);if(t<60)return`${t}m`;const l=Math.floor(t/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function H(n,e){const r=e===u.REMAINING?100-n:n;return r>=90?"bg-red-500":r>=70?"bg-amber-500":"bg-emerald-500"}function a({label:n,pct:e,reset:r,mode:t=u.USED}){const l=Math.max(0,Math.min(100,Number(e)||0)),d=t===u.REMAINING?100-l:l,w=Math.round(d),_=d>0&&w===0?Math.max(d,.35):d,y=d>0&&w===0?"<1":String(w);return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:n}),i.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:i.jsx("div",{className:`${H(d,t)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${_}%`,minWidth:d>0?"3px":0}})}),i.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-9 text-right shrink-0 whitespace-nowrap",children:[y,"%"]}),r?i.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:r}):null]})}function m({name:n,icon:e,children:r}){const l=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"||e==="/brand-logos/kimi.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[e?i.jsx("img",{src:e,alt:"",className:l}):null,i.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:n})]}),r]})}const F=["claude","codex","cursor","gemini","kimi","zai","kiro","copilot","antigravity"],B={claude:{name:"Claude",icon:"/brand-logos/claude-code.svg"},codex:{name:"Codex",icon:"/brand-logos/codex.svg"},cursor:{name:"Cursor",icon:"/brand-logos/cursor.svg"},gemini:{name:"Gemini",icon:"/brand-logos/gemini.svg"},kimi:{name:"Kimi",icon:"/brand-logos/kimi.svg"},zai:{name:"Z.AI",icon:null},kiro:{name:"Kiro",icon:"/brand-logos/kiro.svg"},copilot:{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg"},antigravity:{name:"Antigravity",icon:"/brand-logos/antigravity.svg"}};function c({children:n,tone:e="neutral"}){const r=e==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return i.jsx("div",{className:`text-[11px] leading-snug ${r}`,children:n})}function U(n,e,r){const t=B[n];if(!t)return null;if(!e?.configured)return i.jsx(m,{name:t.name,icon:t.icon,children:i.jsx(c,{children:s("limits.status.not_connected")})},n);if(e.error)return i.jsx(m,{name:t.name,icon:t.icon,children:i.jsx(c,{tone:"error",children:s("shared.error.prefix",{error:e.error})})},n);const l=e.plan_label?`${t.name} ${e.plan_label}`:t.name;switch(n){case"claude":return i.jsxs(m,{name:l,icon:t.icon,children:[e.five_hour?i.jsx(a,{label:"5h",pct:e.five_hour.utilization,reset:o(e.five_hour.resets_at),mode:r}):null,e.seven_day?i.jsx(a,{label:"7d",pct:e.seven_day.utilization,reset:o(e.seven_day.resets_at),mode:r}):null,e.seven_day_opus?i.jsx(a,{label:"Opus",pct:e.seven_day_opus.utilization,reset:o(e.seven_day_opus.resets_at),mode:r}):null,e.cached?i.jsx(c,{children:s("limits.status.cached")}):null,!e.five_hour&&!e.seven_day&&!e.seven_day_opus?i.jsx(c,{children:s("limits.status.no_data")}):null]},"claude");case"codex":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"5h",pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"7d",pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"codex");case"cursor":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"cursor");case"gemini":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"Pro",pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"Flash",pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:"Lite",pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"gemini");case"kimi":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.kimi_weekly"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.kimi_5h"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.kimi_total"),pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,e.parallel_limit?i.jsx(c,{children:s("limits.label.kimi_parallel",{count:e.parallel_limit})}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"kimi");case"zai":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.zai_5h"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.zai_weekly"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.zai_mcp"),pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"zai");case"kiro":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"kiro");case"antigravity":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"Claude",pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"G Pro",pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:"Flash",pct:e.tertiary_window.used_percent,reset:o(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"antigravity");case"copilot":return i.jsxs(m,{name:l,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:o(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:o(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null,e.otel_has_files||e.otel_enabled?null:i.jsx(Y,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function Y({defaultDir:n}){const[e,r]=I.useState(!1),l=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${n||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
2
+ `),d=async()=>{try{await navigator.clipboard.writeText(l),r(!0),setTimeout(()=>r(!1),1600)}catch{}};return i.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[i.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:s("limits.copilot.otelHint.title")}),i.jsx("div",{className:"mt-0.5 leading-snug",children:s("limits.copilot.otelHint.body")}),i.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:l}),i.jsx("button",{type:"button",onClick:d,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?s("limits.copilot.otelHint.copied"):s("limits.copilot.otelHint.copy")})]})}function K({claude:n,codex:e,cursor:r,gemini:t,kimi:l,zai:d,kiro:w,antigravity:_,copilot:y,order:h,visibility:g,displayMode:k}){const N={claude:n,codex:e,cursor:r,gemini:t,kimi:l,zai:d,kiro:w,antigravity:_,copilot:y},L=Array.isArray(h)&&h.length>0?h:F,b=k===u.REMAINING?u.REMAINING:u.USED,E=b===u.REMAINING?s("limits.settings.display_mode_remaining"):s("limits.settings.display_mode_used"),f=L.filter(p=>!g||g[p]!==!1).map(p=>U(p,N[p],b)).filter(Boolean);return i.jsx(T,{delay:.15,children:i.jsx(v,{children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:[s("limits.panel.title"),s("limits.panel.mode_separator"),E]}),f.length>0?f:i.jsx(c,{children:s("limits.status.all_hidden")})]})})})}const V=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function ne(){const n=P(),{data:e,error:r,isLoading:t}=M(n?{initialRefresh:!0,initialState:n,publishToPreloadCache:!0}:{initialRefresh:!0,publishToPreloadCache:!0}),l=O();return!V&&!A()?i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx(S,{})}):i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:i.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[i.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:s("nav.limits")}),i.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:s("limits.page.subtitle")})]}),i.jsx(R,{to:"/settings","aria-label":s("limits.page.openSettings"),title:s("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:i.jsx(C,{className:"h-4 w-4","aria-hidden":!0})})]}),t?i.jsx($,{}):i.jsxs(i.Fragment,{children:[r?i.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:s("shared.error.prefix",{error:r})}):null,i.jsx(K,{claude:e?.claude,codex:e?.codex,cursor:e?.cursor,gemini:e?.gemini,kimi:e?.kimi,zai:e?.zai,kiro:e?.kiro,antigravity:e?.antigravity,copilot:e?.copilot,order:l.order,visibility:l.visibility,displayMode:l.displayMode})]})]})})})}export{ne as LimitsPage};
@@ -1 +1 @@
1
- import{j as e,A as t}from"./main-CPGI-smk.js";import{A as r}from"./arrow-up-right-BJzUcPig.js";import{D as o}from"./download-CsXweDLj.js";const i="https://github.com/mm7894215/TokenTracker/releases/latest";function c(){const a=()=>{try{window.location.href="tokentracker://open"}catch{}};return e.jsx("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-20 text-center",children:e.jsxs("div",{className:"max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-oai-black dark:text-white",children:t("local_only.title")}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:t("local_only.body")}),e.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:[e.jsxs("button",{type:"button",onClick:a,className:"inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-sm font-medium bg-oai-gray-900 text-white hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 transition-colors",children:[e.jsx("span",{children:t("local_only.open_app")}),e.jsx(r,{size:14,strokeWidth:2,"aria-hidden":!0})]}),e.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-sm font-medium ring-1 ring-oai-gray-200 dark:ring-oai-gray-800 text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900 transition-colors",children:[e.jsx(o,{size:14,strokeWidth:2,"aria-hidden":!0}),e.jsx("span",{children:t("local_only.download")})]})]})]})})}export{c as L};
1
+ import{j as e,p as t}from"./main-3gBEI6Jl.js";import{A as r}from"./arrow-up-right-BJvJHUGj.js";import{D as o}from"./download-CnzY_EgN.js";const i="https://github.com/mm7894215/TokenTracker/releases/latest";function c(){const a=()=>{try{window.location.href="tokentracker://open"}catch{}};return e.jsx("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-20 text-center",children:e.jsxs("div",{className:"max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-oai-black dark:text-white",children:t("local_only.title")}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:t("local_only.body")}),e.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:[e.jsxs("button",{type:"button",onClick:a,className:"inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-sm font-medium bg-oai-gray-900 text-white hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 transition-colors",children:[e.jsx("span",{children:t("local_only.open_app")}),e.jsx(r,{size:14,strokeWidth:2,"aria-hidden":!0})]}),e.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-sm font-medium ring-1 ring-oai-gray-200 dark:ring-oai-gray-800 text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900 transition-colors",children:[e.jsx(o,{size:14,strokeWidth:2,"aria-hidden":!0}),e.jsx("span",{children:t("local_only.download")})]})]})]})})}export{c as L};
@@ -0,0 +1 @@
1
+ import{c as it,a4 as $,a5 as ne,ad as Ce,r,a9 as ae,aw as Fe,ax as Te,ay as de,az as ye,aA as at,aB as ct,k as W,aC as z,aD as ce,aE as Se,aF as q,s as le,aG as lt,aH as we,a3 as oe,h as ee,ae as fe,j as G,aI as Le,aJ as De,aK as Be,aL as Ee,aM as ut,aN as dt,aO as Re,aP as ft,g as pt,aQ as gt,aR as Ie,aS as mt,aT as ht,aU as Et,aV as Rt,aW as vt,aX as Ct,aY as Tt}from"./main-3gBEI6Jl.js";import{w as ue,j as St,F as Ne,P as be,x as y,y as pe,z as je,A as ge,B as bt,D as se,E as Z,G as He,H as Ae,I as Ue,J as _e,K as Ye,L as Ge,M as Pe,R as Ke,u as Ve,N as Pt,O as Ot,Q as yt,t as It,T as xt,U as Mt,V as Xe,W as kt,X as Ft,Y as wt}from"./SelectItemText-D69v77is.js";const Lt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],dn=it("loader-circle",Lt);function me(e,t,n){if(n&&!ue(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const i=e();return typeof i=="number"?i:i?.[t]}return e?.[t]}function Dt(e,t){const n=r.useRef(null),i=r.useRef(null);return r.useCallback(c=>{if(e!==void 0){if(n.current!==null){const l=n.current,d=i.current,f=t.context.triggerElements.getById(l);d&&f===d&&t.context.triggerElements.delete(l),n.current=null,i.current=null}c!==null&&(n.current=e,i.current=c,t.context.triggerElements.add(e,c))}},[t,e])}function Bt(e,t,n,i){const c=n.useState("isMountedByTrigger",e),l=Dt(e,n),d=$(f=>{if(l(f),!f||!n.select("open"))return;const o=n.select("activeTriggerId");if(o===e){n.update({activeTriggerElement:f,...i});return}o==null&&n.update({activeTriggerId:e,activeTriggerElement:f,...i})});return ne(()=>{c&&n.update({activeTriggerElement:t.current,...i})},[c,n,t,...Object.values(i)]),{registerTrigger:d,isMountedByThisTrigger:c}}function $e(e){const t=e.useState("open");ne(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[i,c]=n.value;e.update({activeTriggerId:i,activeTriggerElement:c})}}},[t,e])}function We(e,t,n){const{mounted:i,setMounted:c,transitionStatus:l}=St(e);t.useSyncedValues({mounted:i,transitionStatus:l});const d=$(()=>{c(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return Ce({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:l}}function Nt(){return new Ne({open:!1,floatingElement:null,referenceElement:null,triggerElements:new be,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function ze(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Nt(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:ae,inactiveTriggerProps:ae,popupProps:ae}}const Je={open:y(e=>e.open),mounted:y(e=>e.mounted),transitionStatus:y(e=>e.transitionStatus),floatingRootContext:y(e=>e.floatingRootContext),preventUnmountingOnClose:y(e=>e.preventUnmountingOnClose),payload:y(e=>e.payload),activeTriggerId:y(e=>e.activeTriggerId),activeTriggerElement:y(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:y((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:y((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:y((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:y((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:y(e=>e.popupProps),popupElement:y(e=>e.popupElement),positionerElement:y(e=>e.positionerElement)};function qe(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:i=!1,onOpenChange:c}=e,l=Fe(),d=pe()!=null,f=t.useState("open"),o=t.useState("activeTriggerElement"),m=t.useState(i?"popupElement":"positionerElement"),u=t.context.triggerElements,a=Te(()=>new Ne({open:f,referenceElement:o,floatingElement:m,triggerElements:u,onOpenChange:c,floatingId:l,nested:d,noEmit:n})).current;return ne(()=>{const g={open:f,floatingId:l,referenceElement:o,floatingElement:m};de(o)&&(g.domReferenceElement=o),a.state.positionReference===a.state.referenceElement&&(g.positionReference=o),a.update(g)},[f,l,o,m,a]),a.context.onOpenChange=c,a.context.nested=d,a.context.noEmit=n,a}const ve=at("safe-polygon"),jt=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${ct}`;function Ht(e){return e?!!e.closest(jt):!1}function Qe(e){const t=r.useRef(void 0),n=r.useRef(!1),i=r.useRef(void 0),c=r.useRef(!0),l=r.useRef(!1),d=r.useRef(()=>{}),f=r.useRef(!1),o=ye(),m=ye(),u=r.useRef(void 0);return r.useMemo(()=>{const a=e.context.dataRef.current;return a.hoverInteractionState||(a.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:i,blockMouseMoveRef:c,performedPointerEventsMutationRef:l,unbindMouseMoveRef:d,restTimeoutPendingRef:f,openChangeTimeout:o,restTimeout:m,handleCloseOptionsRef:u}),a.hoverInteractionState},[e,t,n,i,c,l,d,f,o,m,u])}const At=new Set(["click","mousedown"]);function Ut(e,t={}){const n="rootStore"in e?e.rootStore:e,i=n.useState("open"),c=n.useState("floatingElement"),l=n.useState("domReferenceElement"),{dataRef:d}=n.context,{enabled:f=!0,closeDelay:o=0,externalTree:m}=t,{pointerTypeRef:u,interactedInsideRef:a,handlerRef:g,performedPointerEventsMutationRef:b,unbindMouseMoveRef:E,restTimeoutPendingRef:p,openChangeTimeout:C,handleCloseOptionsRef:k}=Qe(n),R=je(m),F=pe(),O=$(()=>a.current?!0:d.current.openEvent?At.has(d.current.openEvent.type):!1),I=$(()=>{const v=d.current.openEvent?.type;return v?.includes("mouse")&&v!=="mousedown"}),w=r.useCallback((v,P=!0)=>{const h=_t(o,u.current);h&&!g.current?C.start(h,()=>n.setOpen(!1,W(z,v))):P&&(C.clear(),n.setOpen(!1,W(z,v)))},[o,g,n,u,C]),x=$(()=>{E.current(),g.current=void 0}),A=$(()=>{if(b.current){const v=ce(c).body;v.style.pointerEvents="",v.removeAttribute(ve),b.current=!1}}),H=$(v=>{const P=Se(v);if(!Ht(P)){a.current=!1;return}a.current=!0});ne(()=>{i||(u.current=void 0,p.current=!1,a.current=!1,x(),A())},[i,u,p,a,x,A]),r.useEffect(()=>()=>{x()},[x]),r.useEffect(()=>A,[A]),ne(()=>{if(f&&i&&k.current?.blockPointerEvents&&I()&&de(l)&&c){b.current=!0;const v=ce(c).body;v.setAttribute(ve,"");const P=l,h=c,s=R?.nodesRef.current.find(j=>j.id===F)?.context?.elements.floating;return s&&(s.style.pointerEvents=""),v.style.pointerEvents="none",P.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{v.style.pointerEvents="",P.style.pointerEvents="",h.style.pointerEvents=""}}},[f,i,l,c,k,I,R,F,b]),r.useEffect(()=>{if(!f)return;function v(j){if(O()||!d.current.floatingContext||!n.select("open"))return;const N=n.context.triggerElements;j.relatedTarget&&N.hasElement(j.relatedTarget)||(A(),x(),O()||w(j))}function P(j){C.clear(),A(),g.current?.(j),x()}function h(j){O()||w(j,!1)}const s=c;return s&&(s.addEventListener("mouseleave",v),s.addEventListener("mouseenter",P),s.addEventListener("mouseleave",h),s.addEventListener("pointerdown",H,!0)),()=>{s&&(s.removeEventListener("mouseleave",v),s.removeEventListener("mouseenter",P),s.removeEventListener("mouseleave",h),s.removeEventListener("pointerdown",H,!0))}})}function _t(e,t){return t&&!ue(t)?0:typeof e=="function"?e():e}function he(e){return typeof e=="function"?e():e}const Yt={current:null};function Gt(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:i,events:c}=n.context,{enabled:l=!0,delay:d=0,handleClose:f=null,mouseOnly:o=!1,restMs:m=0,move:u=!0,triggerElementRef:a=Yt,externalTree:g,isActiveTrigger:b=!0}=t,E=je(g),{pointerTypeRef:p,interactedInsideRef:C,handlerRef:k,blockMouseMoveRef:R,performedPointerEventsMutationRef:F,unbindMouseMoveRef:O,restTimeoutPendingRef:I,openChangeTimeout:w,restTimeout:x,handleCloseOptionsRef:A}=Qe(n),H=ge(f),v=ge(d),P=ge(m);b&&(A.current=H.current?.__options);const h=$(()=>C.current?!0:i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1),s=r.useCallback((T,S=!0)=>{const D=me(v.current,"close",p.current);D&&!k.current?w.start(D,()=>n.setOpen(!1,W(z,T))):S&&(w.clear(),n.setOpen(!1,W(z,T)))},[v,k,n,p,w]),j=$(()=>{O.current(),k.current=void 0}),N=$(()=>{if(F.current){const T=ce(n.select("domReferenceElement")).body;T.style.pointerEvents="",T.removeAttribute(ve),F.current=!1}});r.useEffect(()=>{if(!l)return;function T(S){S.open||(w.clear(),x.clear(),R.current=!0,I.current=!1)}return c.on("openchange",T),()=>{c.off("openchange",T)}},[l,c,w,x,R,I]);const K=$(T=>{if(h()||!i.current.floatingContext)return;const S=n.context.triggerElements;if(T.relatedTarget&&S.hasElement(T.relatedTarget))return;const D=a.current;H.current?.({...i.current.floatingContext,tree:E,x:T.clientX,y:T.clientY,onClose(){N(),j(),!h()&&D===n.select("domReferenceElement")&&s(T)}})(T)});return r.useEffect(()=>{if(!l)return;const T=a.current??(b?n.select("domReferenceElement"):null);if(!de(T))return;function S(B){if(w.clear(),R.current=!1,o&&!ue(p.current)||he(P.current)>0&&!me(v.current,"open"))return;const U=me(v.current,"open",p.current),Y=n.select("domReferenceElement"),L=n.context.triggerElements,X=(L.hasElement(B.target)||L.hasMatchingElement(Q=>q(Q,B.target)))&&(!Y||!q(Y,B.target)),M=B.currentTarget??null,_=n.select("open"),J=!_||X;X&&_?n.setOpen(!0,W(z,B,M)):U?w.start(U,()=>{J&&n.setOpen(!0,W(z,B,M))}):J&&n.setOpen(!0,W(z,B,M))}function D(B){if(h()){N();return}O.current();const U=n.select("domReferenceElement"),Y=ce(U);x.clear(),I.current=!1;const L=n.context.triggerElements;if(B.relatedTarget&&L.hasElement(B.relatedTarget))return;if(H.current&&i.current.floatingContext){n.select("open")||w.clear();const M=a.current;k.current=H.current({...i.current.floatingContext,tree:E,x:B.clientX,y:B.clientY,onClose(){N(),j(),!h()&&M===n.select("domReferenceElement")&&s(B,!0)}});const _=k.current;_(B),Y.addEventListener("mousemove",_),O.current=()=>{Y.removeEventListener("mousemove",_)};return}(p.current!=="touch"||!q(n.select("floatingElement"),B.relatedTarget))&&s(B)}function V(B){K(B)}return n.select("open")&&T.addEventListener("mouseleave",V),u&&T.addEventListener("mousemove",S,{once:!0}),T.addEventListener("mouseenter",S),T.addEventListener("mouseleave",D),()=>{T.removeEventListener("mouseleave",V),u&&T.removeEventListener("mousemove",S),T.removeEventListener("mouseenter",S),T.removeEventListener("mouseleave",D)}},[j,N,R,i,v,s,n,l,H,K,b,h,o,u,p,P,x,I,w,a,E,O,k]),r.useMemo(()=>{function T(S){p.current=S.pointerType}return{onPointerDown:T,onPointerEnter:T,onMouseMove(S){const{nativeEvent:D}=S,V=S.currentTarget,B=n.select("domReferenceElement"),U=n.context.triggerElements,Y=n.select("open"),L=(U.hasElement(S.target)||U.hasMatchingElement(M=>q(M,S.target)))&&(!B||!q(B,S.target));if(o&&!ue(p.current)||Y&&!L||he(P.current)===0||!L&&I.current&&S.movementX**2+S.movementY**2<2)return;x.clear();function X(){if(I.current=!1,h())return;const M=n.select("open");!R.current&&(!M||L)&&n.setOpen(!0,W(z,D,V))}p.current==="touch"?le.flushSync(()=>{X()}):L&&Y?X():(I.current=!0,x.start(he(P.current),X))}}},[R,h,o,n,p,P,x,I])}const Kt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ze(e,t={}){const n="rootStore"in e?e.rootStore:e,i=n.useState("open"),c=n.useState("floatingId"),l=n.useState("domReferenceElement"),d=n.useState("floatingElement"),{enabled:f=!0,role:o="dialog"}=t,m=Fe(),u=l?.id||m,a=r.useMemo(()=>lt(d)?.id||c,[d,c]),g=Kt.get(o)??o,E=pe()!=null,p=r.useMemo(()=>g==="tooltip"||o==="label"?ae:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&E&&{role:"menuitem"},...o==="select"&&{"aria-autocomplete":"none"},...o==="combobox"&&{"aria-autocomplete":"list"}},[g,E,o]),C=r.useMemo(()=>g==="tooltip"||o==="label"?{[`aria-${o==="label"?"labelledby":"describedby"}`]:i?a:void 0}:{...p,"aria-expanded":i?"true":"false","aria-controls":i?a:void 0,...g==="menu"&&{id:u}},[g,a,i,u,o,p]),k=r.useMemo(()=>{const F={id:a,...g&&{role:g}};return g==="tooltip"||o==="label"?F:{...F,...g==="menu"&&{"aria-labelledby":u}}},[g,a,u,o]),R=r.useCallback(({active:F,selected:O})=>{const I={role:"option",...F&&{id:`${a}-fui-option`}};switch(o){case"select":case"combobox":return{...I,"aria-selected":O}}return{}},[a,o]);return r.useMemo(()=>f?{reference:C,floating:k,item:R,trigger:p}:{},[f,C,k,p,R])}function xe(e,t){const[n,i]=e;let c=!1;const l=t.length;for(let d=0,f=l-1;d<l;f=d++){const[o,m]=t[d]||[0,0],[u,a]=t[f]||[0,0];m>=i!=a>=i&&n<=(u-o)*(i-m)/(a-m)+o&&(c=!c)}return c}function Vt(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Xt(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:i=!0}=e,c=new we;let l=!1,d=null,f=null,o=typeof performance<"u"?performance.now():0;function m(a,g){const b=performance.now(),E=b-o;if(d===null||f===null||E===0)return d=a,f=g,o=b,null;const p=a-d,C=g-f,R=Math.sqrt(p*p+C*C)/E;return d=a,f=g,o=b,R}const u=({x:a,y:g,placement:b,elements:E,onClose:p,nodeId:C,tree:k})=>function(F){function O(){c.clear(),p()}if(c.clear(),!E.domReference||!E.floating||b==null||a==null||g==null)return;const{clientX:I,clientY:w}=F,x=[I,w],A=Se(F),H=F.type==="mouseleave",v=q(E.floating,A),P=q(E.domReference,A),h=E.domReference.getBoundingClientRect(),s=E.floating.getBoundingClientRect(),j=b.split("-")[0],N=a>s.right-s.width/2,K=g>s.bottom-s.height/2,T=Vt(x,h),S=s.width>h.width,D=s.height>h.height,V=(S?h:s).left,B=(S?h:s).right,U=(D?h:s).top,Y=(D?h:s).bottom;if(v&&(l=!0,!H))return;if(P&&(l=!1),P&&!H){l=!0;return}if(H&&de(F.relatedTarget)&&q(E.floating,F.relatedTarget)||k&&bt(k.nodesRef.current,C).some(({context:M})=>M?.open))return;if(j==="top"&&g>=h.bottom-1||j==="bottom"&&g<=h.top+1||j==="left"&&a>=h.right-1||j==="right"&&a<=h.left+1)return O();let L=[];switch(j){case"top":L=[[V,h.top+1],[V,s.bottom-1],[B,s.bottom-1],[B,h.top+1]];break;case"bottom":L=[[V,s.top+1],[V,h.bottom-1],[B,h.bottom-1],[B,s.top+1]];break;case"left":L=[[s.right-1,Y],[s.right-1,U],[h.left+1,U],[h.left+1,Y]];break;case"right":L=[[h.right-1,Y],[h.right-1,U],[s.left+1,U],[s.left+1,Y]];break}function X([M,_]){switch(j){case"top":{const J=[S?M+t/2:N?M+t*4:M-t*4,_+t+1],Q=[S?M-t/2:N?M+t*4:M-t*4,_+t+1],te=[[s.left,N||S?s.bottom-t:s.top],[s.right,N?S?s.bottom-t:s.top:s.bottom-t]];return[J,Q,...te]}case"bottom":{const J=[S?M+t/2:N?M+t*4:M-t*4,_-t],Q=[S?M-t/2:N?M+t*4:M-t*4,_-t],te=[[s.left,N||S?s.top+t:s.bottom],[s.right,N?S?s.top+t:s.bottom:s.top+t]];return[J,Q,...te]}case"left":{const J=[M+t+1,D?_+t/2:K?_+t*4:_-t*4],Q=[M+t+1,D?_-t/2:K?_+t*4:_-t*4];return[...[[K||D?s.right-t:s.left,s.top],[K?D?s.right-t:s.left:s.right-t,s.bottom]],J,Q]}case"right":{const J=[M-t,D?_+t/2:K?_+t*4:_-t*4],Q=[M-t,D?_-t/2:K?_+t*4:_-t*4],te=[[K||D?s.left+t:s.right,s.top],[K?D?s.left+t:s.right:s.left+t,s.bottom]];return[J,Q,...te]}default:return[]}}if(!xe([I,w],L)){if(l&&!T)return O();if(!H&&i){const M=m(F.clientX,F.clientY);if(M!==null&&M<.1)return O()}xe([I,w],X([a,g]))?!l&&i&&c.start(40,O):O()}};return u.__options={blockPointerEvents:n},u}const et=r.createContext(void 0);function re(e){const t=r.useContext(et);if(e===!1&&t===void 0)throw new Error(oe(27));return t}const $t={...se,...fe},fn=r.forwardRef(function(t,n){const{render:i,className:c,forceRender:l=!1,...d}=t,{store:f}=re(),o=f.useState("open"),m=f.useState("nested"),u=f.useState("mounted"),a=f.useState("transitionStatus"),g=r.useMemo(()=>({open:o,transitionStatus:a}),[o,a]);return ee("div",t,{state:g,ref:[f.context.backdropRef,n],stateAttributesMapping:$t,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:l||!m})});let Wt=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),zt=(function(e){return e[e.open=Z.open]="open",e[e.closed=Z.closed]="closed",e[e.startingStyle=Z.startingStyle]="startingStyle",e[e.endingStyle=Z.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const tt=r.createContext(void 0);function nt(){const e=r.useContext(tt);if(e===void 0)throw new Error(oe(26));return e}const Jt={...se,...fe,nestedDialogOpen(e){return e?{[zt.nestedDialogOpen]:""}:null}},pn=r.forwardRef(function(t,n){const{className:i,finalFocus:c,initialFocus:l,render:d,...f}=t,{store:o}=re(),m=o.useState("descriptionElementId"),u=o.useState("disablePointerDismissal"),a=o.useState("floatingRootContext"),g=o.useState("popupProps"),b=o.useState("modal"),E=o.useState("mounted"),p=o.useState("nested"),C=o.useState("nestedOpenDialogCount"),k=o.useState("open"),R=o.useState("openMethod"),F=o.useState("titleElementId"),O=o.useState("transitionStatus"),I=o.useState("role");nt(),Ce({open:k,ref:o.context.popupRef,onComplete(){k&&o.context.onOpenChangeComplete?.(!0)}});function w(P){return P==="touch"?o.context.popupRef.current:!0}const x=l===void 0?w:l,A=C>0,H=r.useMemo(()=>({open:k,nested:p,transitionStatus:O,nestedDialogOpen:A}),[k,p,O,A]),v=ee("div",t,{state:H,props:[g,{"aria-labelledby":F??void 0,"aria-describedby":m??void 0,role:I,tabIndex:-1,hidden:!E,onKeyDown(P){He.has(P.key)&&P.stopPropagation()},style:{[Wt.nestedDialogs]:C}},f],ref:[n,o.context.popupRef,o.useStateSetter("popupElement")],stateAttributesMapping:Jt});return G.jsx(Ae,{context:a,openInteractionType:R,disabled:!E,closeOnFocusOut:!u,initialFocus:x,returnFocus:c,modal:b!==!1,restoreFocus:"popup",children:v})}),gn=r.forwardRef(function(t,n){const{keepMounted:i=!1,...c}=t,{store:l}=re(),d=l.useState("mounted"),f=l.useState("modal"),o=l.useState("open");return d||i?G.jsx(tt.Provider,{value:i,children:G.jsxs(Le,{ref:n,...c,children:[d&&f===!0&&G.jsx(Ue,{ref:l.context.internalBackdropRef,inert:De(!o)}),t.children]})}):null});function qt(e){const{store:t,parentContext:n,actionsRef:i}=e,c=t.useState("open"),l=t.useState("disablePointerDismissal"),d=t.useState("modal"),f=t.useState("popupElement"),{openMethod:o,triggerProps:m,reset:u}=_e(c);$e(t);const{forceUnmount:a}=We(c,t,()=>{u()}),g=$(v=>{const P=W(v);return P.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},P}),b=r.useCallback(()=>{t.setOpen(!1,g(Be))},[t,g]);r.useImperativeHandle(i,()=>({unmount:a,close:b}),[a,b]);const E=qe({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[p,C]=r.useState(0),k=p===0,R=Ze(E),F=Ye(E,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:d==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(v){if("button"in v&&v.button!==0||"touches"in v&&v.touches.length!==1)return!1;const P=Se(v);if(k&&!l){const h=P;return d&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===h||t.context.backdropRef.current===h||q(h,f)&&!h?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:k});Ge(c&&d===!0,f);const{getReferenceProps:O,getFloatingProps:I,getTriggerProps:w}=Pe([R,F]);t.useContextCallback("onNestedDialogOpen",v=>{C(v+1)}),t.useContextCallback("onNestedDialogClose",()=>{C(0)}),r.useEffect(()=>(n?.onNestedDialogOpen&&c&&n.onNestedDialogOpen(p),n?.onNestedDialogClose&&!c&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&c&&n.onNestedDialogClose()}),[c,n,p]);const x=r.useMemo(()=>O(m),[O,m]),A=r.useMemo(()=>w(m),[w,m]),H=r.useMemo(()=>I(),[I]);t.useSyncedValues({openMethod:o,activeTriggerProps:x,inactiveTriggerProps:A,popupProps:H,floatingRootContext:E,nestedOpenDialogCount:p})}const Qt={...Je,modal:y(e=>e.modal),nested:y(e=>e.nested),nestedOpenDialogCount:y(e=>e.nestedOpenDialogCount),disablePointerDismissal:y(e=>e.disablePointerDismissal),openMethod:y(e=>e.openMethod),descriptionElementId:y(e=>e.descriptionElementId),titleElementId:y(e=>e.titleElementId),viewportElement:y(e=>e.viewportElement),role:y(e=>e.role)};class Zt extends Ke{constructor(t){super(en(t),{popupRef:r.createRef(),backdropRef:r.createRef(),internalBackdropRef:r.createRef(),triggerElements:new be,onOpenChange:void 0,onOpenChangeComplete:void 0},Qt)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",i);const c={open:t},l=n.trigger?.id??null;(l||t)&&(c.activeTriggerId=l,c.activeTriggerElement=n.trigger??null),this.update(c)}}function en(e={}){return{...ze(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function mn(e){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:c,onOpenChangeComplete:l,disablePointerDismissal:d=!1,modal:f=!0,actionsRef:o,handle:m,triggerId:u,defaultTriggerId:a=null}=e,g=re(!0),b=!!g,E=Te(()=>m?.store??new Zt({open:n??i,activeTriggerId:u!==void 0?u:a,modal:f,disablePointerDismissal:d,nested:b})).current;E.useControlledProp("open",n,i),E.useControlledProp("activeTriggerId",u,a),E.useSyncedValues({disablePointerDismissal:d,nested:b,modal:f}),E.useContextCallback("onOpenChange",c),E.useContextCallback("onOpenChangeComplete",l);const p=E.useState("payload");qt({store:E,actionsRef:o,parentContext:g?.store.context});const C=r.useMemo(()=>({store:E}),[E]);return G.jsx(et.Provider,{value:C,children:typeof t=="function"?t({payload:p}):t})}let Me=(function(e){return e[e.open=Z.open]="open",e[e.closed=Z.closed]="closed",e[e.startingStyle=Z.startingStyle]="startingStyle",e[e.endingStyle=Z.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const tn={...se,...fe,nested(e){return e?{[Me.nested]:""}:null},nestedDialogOpen(e){return e?{[Me.nestedDialogOpen]:""}:null}},hn=r.forwardRef(function(t,n){const{className:i,render:c,children:l,...d}=t,f=nt(),{store:o}=re(),m=o.useState("open"),u=o.useState("nested"),a=o.useState("transitionStatus"),g=o.useState("nestedOpenDialogCount"),b=o.useState("mounted"),E=g>0,p=r.useMemo(()=>({open:m,nested:u,transitionStatus:a,nestedDialogOpen:E}),[m,u,a,E]);return ee("div",t,{enabled:f||b,state:p,ref:[n,o.useStateSetter("viewportElement")],stateAttributesMapping:tn,props:[{role:"presentation",hidden:!b,children:l},d]})}),En=r.forwardRef(function(t,n){const{render:i,className:c,id:l,...d}=t,{store:f}=re(),o=Ve(l);return f.useSyncedValueWithCleanup("titleElementId",o),ee("h2",t,{ref:n,props:[{id:o},d]})}),ot=r.createContext(void 0);function ie(e){const t=r.useContext(ot);if(t===void 0&&!e)throw new Error(oe(47));return t}function nn(){return{...ze(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const on={...Je,disabled:y(e=>e.disabled),instantType:y(e=>e.instantType),openMethod:y(e=>e.openMethod),openChangeReason:y(e=>e.openChangeReason),modal:y(e=>e.modal),stickIfOpen:y(e=>e.stickIfOpen),titleElementId:y(e=>e.titleElementId),descriptionElementId:y(e=>e.descriptionElementId),openOnHover:y(e=>e.openOnHover),closeDelay:y(e=>e.closeDelay),hasViewport:y(e=>e.hasViewport)};class Oe extends Ke{constructor(t){const n={...nn(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:r.createRef(),backdropRef:r.createRef(),internalBackdropRef:r.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:r.createRef(),beforeContentFocusGuardRef:r.createRef(),stickIfOpenTimeout:new we,triggerElements:new be},on)}setOpen=(t,n)=>{const i=n.reason===z,c=n.reason===Ee&&n.event.detail===0,l=!t&&(n.reason===ut||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const d={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",d);const o=()=>{const m={open:t,openChangeReason:n.reason},u=n.trigger?.id??null;(u||t)&&(m.activeTriggerId=u,m.activeTriggerElement=n.trigger??null),this.update(m)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(dt,()=>{this.set("stickIfOpen",!1)}),le.flushSync(o)):o(),c||l?this.set("instantType",c?"click":"dismiss"):n.reason===Re?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const i=Te(()=>new Oe(n)).current,c=t??i;return ft(i.disposeEffect),c}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function ke({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:c,onOpenChangeComplete:l,modal:d=!1,handle:f,triggerId:o,defaultTriggerId:m=null}=e,u=Oe.useStore(f?.store,{open:n??i,modal:d,activeTriggerId:o!==void 0?o:m});u.useControlledProp("open",n,i),u.useControlledProp("activeTriggerId",o,m);const a=u.useState("open"),g=u.useState("positionerElement"),b=u.useState("payload"),E=u.useState("openChangeReason");u.useContextCallback("onOpenChange",c),u.useContextCallback("onOpenChangeComplete",l);const{openMethod:p,triggerProps:C,reset:k}=_e(a);$e(u);const{forceUnmount:R}=We(a,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),k()});Ge(a&&d===!0&&E!==z&&p!=="touch",g),r.useEffect(()=>{a||u.context.stickIfOpenTimeout.clear()},[u,a]);const F=r.useCallback(N=>{const K=W(N);return K.preventUnmountOnClose=()=>{u.set("preventUnmountingOnClose",!0)},K},[u]),O=r.useCallback(()=>{u.setOpen(!1,F(Be))},[u,F]);r.useImperativeHandle(e.actionsRef,()=>({unmount:R,close:O}),[R,O]);const I=qe({popupStore:u,onOpenChange:u.setOpen}),w=Ye(I,{outsidePressEvent:{mouse:d==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),x=Ze(I),{getReferenceProps:A,getFloatingProps:H,getTriggerProps:v}=Pe([w,x]),P=r.useMemo(()=>A(C),[A,C]),h=r.useMemo(()=>v(C),[v,C]),s=r.useMemo(()=>H(),[H]);u.useSyncedValues({modal:d,openMethod:p,activeTriggerProps:P,inactiveTriggerProps:h,popupProps:s,floatingRootContext:I,nested:pe()!=null});const j=r.useMemo(()=>({store:u}),[u]);return G.jsx(ot.Provider,{value:j,children:typeof t=="function"?t({payload:b}):t})}function Rn(e){return ie(!0)?G.jsx(ke,{props:e}):G.jsx(Pt,{children:G.jsx(ke,{props:e})})}const rn=300,vn=r.forwardRef(function(t,n){const{render:i,className:c,disabled:l=!1,nativeButton:d=!0,handle:f,payload:o,openOnHover:m=!1,delay:u=rn,closeDelay:a=0,id:g,...b}=t,E=ie(!0),p=f?.store??E?.store;if(!p)throw new Error(oe(74));const C=Ve(g),k=p.useState("isTriggerActive",C),R=p.useState("floatingRootContext"),F=p.useState("isOpenedByTrigger",C),O=r.useRef(null),{registerTrigger:I,isMountedByThisTrigger:w}=Bt(C,O,p,{payload:o,disabled:l,openOnHover:m,closeDelay:a}),x=p.useState("openChangeReason"),A=p.useState("stickIfOpen"),H=p.useState("openMethod"),v=Gt(R,{enabled:R!=null&&m&&(H!=="touch"||x!==Ee),mouseOnly:!0,move:!1,handleClose:Xt(),restMs:u,delay:{close:a},triggerElementRef:O,isActiveTrigger:k}),P=Ot(R,{enabled:R!=null,stickIfOpen:A}),h=Pe([P]),s=p.useState("triggerProps",w),j=r.useMemo(()=>({disabled:l,open:F}),[l,F]),{getButtonProps:N,buttonRef:K}=pt({disabled:l,native:d}),T=r.useMemo(()=>({open(U){return U&&x===Ee?yt.open(U):It.open(U)}}),[x]),S=ee("button",t,{state:j,ref:[K,n,I,O],props:[h.getReferenceProps(),v,s,{[gt]:"",id:C},b,N],stateAttributesMapping:T}),D=r.useRef(null),V=$(U=>{le.flushSync(()=>{p.setOpen(!1,W(Re,U.nativeEvent,U.currentTarget))}),mt(D.current)?.focus()}),B=$(U=>{const Y=p.select("positionerElement");if(Y&&ht(U,Y))p.context.beforeContentFocusGuardRef.current?.focus();else{le.flushSync(()=>{p.setOpen(!1,W(Re,U.nativeEvent,U.currentTarget))});let L=Et(p.context.triggerFocusTargetRef.current||O.current);for(;L!==null&&q(Y,L);){const X=L;if(L=Rt(L),L===X)break}L?.focus()}});return k?G.jsxs(r.Fragment,{children:[G.jsx(Ie,{ref:D,onFocus:V}),G.jsx(r.Fragment,{children:S},C),G.jsx(Ie,{ref:p.context.triggerFocusTargetRef,onFocus:B})]}):G.jsx(r.Fragment,{children:S},C)}),rt=r.createContext(void 0);function sn(){const e=r.useContext(rt);if(e===void 0)throw new Error(oe(45));return e}const Cn=r.forwardRef(function(t,n){const{keepMounted:i=!1,...c}=t,{store:l}=ie();return l.useState("mounted")||i?G.jsx(rt.Provider,{value:i,children:G.jsx(Le,{ref:n,...c,renderGuards:!1})}):null}),st=r.createContext(void 0);function an(){const e=r.useContext(st);if(!e)throw new Error(oe(46));return e}const Tn=r.forwardRef(function(t,n){const{render:i,className:c,anchor:l,positionMethod:d="absolute",side:f="bottom",align:o="center",sideOffset:m=0,alignOffset:u=0,collisionBoundary:a="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:E=!1,disableAnchorTracking:p=!1,collisionAvoidance:C=vt,...k}=t,{store:R}=ie(),F=sn(),O=xt(),I=R.useState("floatingRootContext"),w=R.useState("mounted"),x=R.useState("open"),A=R.useState("openChangeReason"),H=R.useState("activeTriggerElement"),v=R.useState("modal"),P=R.useState("positionerElement"),h=R.useState("instantType"),s=R.useState("transitionStatus"),j=R.useState("hasViewport"),N=r.useRef(null),K=Ct(P,!1,!1),T=Mt({anchor:l,floatingRootContext:I,positionMethod:d,mounted:w,side:f,sideOffset:m,align:o,alignOffset:u,arrowPadding:b,collisionBoundary:a,collisionPadding:g,sticky:E,disableAnchorTracking:p,keepMounted:F,nodeId:O,collisionAvoidance:C,adaptiveOrigin:j?Ft:void 0}),S=r.useMemo(()=>{const L={};return x||(L.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...T.positionerStyles,...L}}},[x,w,T.positionerStyles]),D=r.useMemo(()=>({props:S,...T}),[S,T]),V=I?.select("domReferenceElement");ne(()=>{const L=V,X=N.current;if(L&&(N.current=L),X&&L&&L!==X){R.set("instantType",void 0);const M=new AbortController;return K(()=>{R.set("instantType","trigger-change")},M.signal),()=>{M.abort()}}},[V,K,R]);const B=r.useMemo(()=>({open:x,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:h}),[x,D.side,D.align,D.anchorHidden,h]),U=r.useCallback(L=>{R.set("positionerElement",L)},[R]),Y=ee("div",t,{state:B,props:[D.props,Xe(s),k],ref:[n,U],stateAttributesMapping:se});return G.jsxs(st.Provider,{value:D,children:[w&&v===!0&&A!==z&&G.jsx(Ue,{ref:R.context.internalBackdropRef,inert:De(!x),cutout:H}),G.jsx(kt,{id:O,children:Y})]})}),cn={...se,...fe},Sn=r.forwardRef(function(t,n){const{className:i,render:c,initialFocus:l,finalFocus:d,...f}=t,{store:o}=ie(),m=an(),u=wt()!=null,a=o.useState("open"),g=o.useState("openMethod"),b=o.useState("instantType"),E=o.useState("transitionStatus"),p=o.useState("popupProps"),C=o.useState("titleElementId"),k=o.useState("descriptionElementId"),R=o.useState("modal"),F=o.useState("mounted"),O=o.useState("openChangeReason"),I=o.useState("activeTriggerElement"),w=o.useState("floatingRootContext");Ce({open:a,ref:o.context.popupRef,onComplete(){a&&o.context.onOpenChangeComplete?.(!0)}});const x=o.useState("disabled"),A=o.useState("openOnHover"),H=o.useState("closeDelay");Ut(w,{enabled:A&&!x,closeDelay:H});function v(N){return N==="touch"?o.context.popupRef.current:!0}const P=l===void 0?v:l,h=r.useMemo(()=>({open:a,side:m.side,align:m.align,instant:b,transitionStatus:E}),[a,m.side,m.align,b,E]),s=r.useCallback(N=>{o.set("popupElement",N)},[o]),j=ee("div",t,{state:h,ref:[n,o.context.popupRef,s],props:[p,{"aria-labelledby":C,"aria-describedby":k,onKeyDown(N){u&&He.has(N.key)&&N.stopPropagation()}},Xe(E),f],stateAttributesMapping:cn});return G.jsx(Ae,{context:w,openInteractionType:g,modal:R==="trap-focus",disabled:!F||O===z,initialFocus:P,returnFocus:d,restoreFocus:"popup",previousFocusableElement:Tt(I)?I:void 0,nextFocusableElement:o.context.triggerFocusTargetRef,beforeContentFocusGuardRef:o.context.beforeContentFocusGuardRef,children:j})});export{mn as D,dn as L,Rn as P,gn as a,fn as b,hn as c,pn as d,En as e,vn as f,Cn as g,Tn as h,Sn as i,re as u};
@@ -0,0 +1 @@
1
+ import{r as v,a4 as S,h as w,j as e,x as y}from"./main-3gBEI6Jl.js";import{a as k,Z as j,b as l,s as i,_ as N,$ as C,S as E,k as I,l as R,m as T,n as A,o as L,p as P,q as _,v as D,C as G,r as M}from"./SelectItemText-D69v77is.js";const O=v.forwardRef(function(s,o){const{className:n,render:f,...t}=s,{store:r,scrollHandlerRef:c}=k(),{alignItemWithTriggerActive:d}=j(),g=l(r,i.hasScrollArrows),h=l(r,i.openMethod),u=l(r,i.multiple),m={id:`${l(r,i.id)}-list`,role:"listbox","aria-multiselectable":u||void 0,onScroll(b){c.current?.(b.currentTarget)},...d&&{style:N},className:g&&h!=="touch"?C.className:void 0},x=S(b=>{r.set("listElement",b)});return w("div",s,{ref:[o,x],props:[m,t]})}),V="relative inline-flex items-center justify-between gap-2 rounded-lg border border-oai-gray-200 bg-white text-oai-black transition-colors hover:border-oai-gray-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:border-oai-gray-700";function z({value:p,onValueChange:s,options:o=[],ariaLabel:n,id:f,disabled:t=!1,leadingIcon:r=null,className:c="",popupClassName:d="",align:g="start",matchTriggerWidth:h=!1}){const u=o.map(a=>({value:a.value,label:a.label}));return e.jsxs(E,{value:p,items:u,disabled:t,onValueChange:a=>{!t&&a!=null&&s?.(a)},children:[e.jsxs(I,{id:f,"aria-label":n,className:y(V,t&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800",c),children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r,e.jsx(R,{className:"truncate"})]}),e.jsx(T,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]}),e.jsx(A,{children:e.jsx(L,{align:g,side:"bottom",sideOffset:4,className:"z-50",children:e.jsx(P,{className:y("max-h-[min(18rem,var(--available-height))] origin-[var(--transform-origin)] overflow-y-auto","rounded-xl border border-oai-gray-200 bg-white p-1 shadow-lg ring-1 ring-black/[0.04]","dark:border-oai-gray-700 dark:bg-oai-gray-900 dark:ring-white/[0.05]","transition-[opacity,transform] duration-150 ease-out","data-[starting-style]:scale-95 data-[starting-style]:opacity-0","data-[ending-style]:scale-95 data-[ending-style]:opacity-0",h&&"min-w-[var(--anchor-width)]",d),children:e.jsx(O,{role:"listbox","aria-label":n,children:o.map(a=>e.jsxs(_,{value:a.value,disabled:a.disabled,className:({selected:m,disabled:x})=>y("flex w-full cursor-pointer items-center gap-1.5 whitespace-nowrap rounded-lg py-1.5 pl-1.5 pr-6","text-left text-xs outline-none transition-colors",m?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-600 hover:bg-oai-gray-50 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800/60",x&&"cursor-not-allowed opacity-50 hover:bg-transparent dark:hover:bg-transparent"),children:[e.jsx("span",{className:"flex w-3.5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-300",children:e.jsx(D,{children:e.jsx(G,{className:"h-3 w-3","aria-hidden":!0})})}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.jsx(M,{children:a.label})})]},String(a.value)))})})})})]})}export{z as S};
@@ -0,0 +1,12 @@
1
+ import{c as Br,b2 as Tn,b3 as jo,b4 as Fn,b5 as Ht,b6 as at,b7 as ut,ax as Ot,a5 as J,j as Ce,aw as Nn,r as u,aD as qe,b8 as Wt,a4 as re,b9 as On,ba as zo,a7 as Zt,az as Ge,bb as Hn,aG as en,bc as _r,bd as Wn,aY as Ne,aA as Mn,be as ct,bf as ht,aF as Re,ab as $r,aC as Yo,bg as Bn,aR as tr,aT as nr,aV as Ko,bh as qo,aE as Qe,k as Se,aO as _n,bi as Ur,bj as We,aQ as Go,bk as Xo,bl as Ze,aL as Dt,bm as Jo,a9 as Nt,bn as vt,ay as Ee,bo as it,bp as rr,bq as $n,br as Un,bs as Mt,bt as mt,bu as Qo,bv as jr,bw as Zo,bx as Bt,by as ln,s as jn,bz as es,bA as Je,aH as An,aM as ts,ac as an,a3 as Pt,bB as zr,bC as ns,a6 as Ye,bD as pt,bE as rs,bF as Yr,bG as Kr,bH as pn,bI as In,bJ as nt,bK as or,bL as qr,bM as Gr,ad as zn,a8 as Xr,aa as os,g as Jr,h as yt,bN as ss,aI as is,bO as cs,aJ as ls,bP as as,bQ as us,ae as Qr,bR as hn}from"./main-3gBEI6Jl.js";const fs=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vl=Br("check",fs);const ds=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],El=Br("chevron-down",ds);function Et(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...Et(e,o.id,n)])}function sr(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function ke(e){e.preventDefault(),e.stopPropagation()}function ps(e){return"nativeEvent"in e}function Zr(e){return e.mozInputSource===0&&e.isTrusted?!0:Tn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function eo(e){return jo?!1:!Tn&&e.width===0&&e.height===0||Tn&&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 ir(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function to(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const hs=["top","right","bottom","left"],At=Math.min,ze=Math.max,tn=Math.round,Rt=Math.floor,tt=e=>({x:e,y:e}),ms={left:"right",right:"left",bottom:"top",top:"bottom"};function Pn(e,t,n){return ze(e,At(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function Be(e){return e.split("-")[0]}function ft(e){return e.split("-")[1]}function Yn(e){return e==="x"?"y":"x"}function Kn(e){return e==="y"?"height":"width"}function Xe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qn(e){return Yn(Xe(e))}function gs(e,t,n){n===void 0&&(n=!1);const r=ft(e),o=qn(e),s=Kn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=nn(i)),[i,nn(i)]}function ys(e){const t=nn(e);return[kn(e),t,kn(t)]}function kn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const cr=["left","right"],lr=["right","left"],bs=["top","bottom"],xs=["bottom","top"];function ws(e,t,n){switch(e){case"top":case"bottom":return n?t?lr:cr:t?cr:lr;case"left":case"right":return t?bs:xs;default:return[]}}function Rs(e,t,n,r){const o=ft(e);let s=ws(Be(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(kn)))),s}function nn(e){const t=Be(e);return ms[t]+e.slice(t.length)}function vs(e){return{top:0,right:0,bottom:0,left:0,...e}}function no(e){return typeof e!="number"?vs(e):{top:e,right:e,bottom:e,left:e}}function rn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function $t(e,t,n){return Math.floor(e/t)!==n}function Vt(e,t){return t<0||t>=e.current.length}function mn(e,t){return Pe(e,{disabledIndices:t})}function ar(e,t){return Pe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Pe(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.current.length-1&&Ft(e,s,r));return s}function Es(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:s,disabledIndices:i,minIndex:c,maxIndex:d,prevIndex:l,stopEvent:a=!1}){let f=l;const g=[],p={};let m=!1;{let h=null,x=-1;e.current.forEach((y,v)=>{if(y==null)return;const S=y.closest('[role="row"]');S&&(m=!0),(S!==h||x===-1)&&(h=S,x+=1,g[x]=[]),g[x].push(v),p[v]=x})}const b=m&&g.length>0&&g.some(h=>h.length!==s);function R(h){if(!b||l===-1)return;const x=p[l];if(x==null)return;const y=g[x].indexOf(l);let v=h==="up"?x-1:x+1;r&&(v<0?v=g.length-1:v>=g.length&&(v=0));const S=new Set;for(;v>=0&&v<g.length&&!S.has(v);){S.add(v);const O=g[v];if(O.length===0){v=h==="up"?v-1:v+1;continue}const M=Math.min(y,O.length-1);for(let A=M;A>=0;A-=1){const z=O[A];if(!Ft(e,z,i))return z}v=h==="up"?v-1:v+1,r&&(v<0?v=g.length-1:v>=g.length&&(v=0))}}if(t.key===Fn){const h=R("up");if(h!==void 0)a&&ke(t),f=h;else{if(a&&ke(t),l===-1)f=d;else if(f=Pe(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:i}),r&&(l-s<c||f<0)){const x=l%s,y=d%s,v=d-(y-x);y===x?f=d:f=y>x?v:v-s}Vt(e,f)&&(f=l)}}if(t.key===Ht){const h=R("down");h!==void 0?(a&&ke(t),f=h):(a&&ke(t),l===-1?f=c:(f=Pe(e,{startingIndex:l,amount:s,disabledIndices:i}),r&&l+s>d&&(f=Pe(e,{startingIndex:l%s-s,amount:s,disabledIndices:i}))),Vt(e,f)&&(f=l))}if(n==="both"){const h=Rt(l/s);t.key===(o?at:ut)&&(a&&ke(t),l%s!==s-1?(f=Pe(e,{startingIndex:l,disabledIndices:i}),r&&$t(f,s,h)&&(f=Pe(e,{startingIndex:l-l%s-1,disabledIndices:i}))):r&&(f=Pe(e,{startingIndex:l-l%s-1,disabledIndices:i})),$t(f,s,h)&&(f=l)),t.key===(o?ut:at)&&(a&&ke(t),l%s!==0?(f=Pe(e,{startingIndex:l,decrement:!0,disabledIndices:i}),r&&$t(f,s,h)&&(f=Pe(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i}))):r&&(f=Pe(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i})),$t(f,s,h)&&(f=l));const x=Rt(d/s)===h;Vt(e,f)&&(r&&x?f=t.key===(o?ut:at)?d:Pe(e,{startingIndex:l-l%s-1,disabledIndices:i}):f=l)}return f}function Ss(e,t,n){const r=[];let o=0;return e.forEach(({width:s,height:i},c)=>{let d=!1;for(n&&(o=0);!d;){const l=[];for(let a=0;a<s;a+=1)for(let f=0;f<i;f+=1)l.push(o+a+f*t);o%t+s<=t&&l.every(a=>r[a]==null)?(l.forEach(a=>{r[a]=c}),d=!0):o+=1}}),[...r]}function Cs(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function Ts(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Ft(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}function Le(e){const t=Ot(Os,e).current;return t.next=e,J(t.effect),t}function Os(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ro(){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 Ms{nodesRef={current:[]};events=ro();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 oo=u.createContext(null),so=u.createContext(null),un=()=>u.useContext(oo)?.id||null,_t=e=>{const t=u.useContext(so);return e??t};function Sl(e){const t=Nn(),n=_t(e),r=un();return J(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Cl(e){const{children:t,id:n}=e,r=un();return Ce.jsx(oo.Provider,{value:u.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Tl(e){const{children:t,externalTree:n}=e,r=Ot(()=>n??new Ms).current;return Ce.jsx(so.Provider,{value:r,children:t})}let ur=0;function Xt(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ur);const s=()=>e?.focus({preventScroll:n});o?s():ur=requestAnimationFrame(s)}const St={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function fr(e){return e==="inert"?St.inert:e==="aria-hidden"?St["aria-hidden"]:St.none}let Ut=new WeakSet,jt={},gn=0;const io=e=>e&&(e.host||io(e.parentNode)),As=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=io(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Is(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,i=As(t,e),c=new Set,d=new Set(i),l=[];jt[o]||(jt[o]=new WeakMap);const a=jt[o];i.forEach(f),g(t),c.clear();function f(p){!p||c.has(p)||(c.add(p),p.parentNode&&f(p.parentNode))}function g(p){!p||d.has(p)||[].forEach.call(p.children,m=>{if(Wt(m)!=="script")if(c.has(m))g(m);else{const b=s?m.getAttribute(s):null,R=b!==null&&b!=="false",h=fr(s),x=(h.get(m)||0)+1,y=(a.get(m)||0)+1;h.set(m,x),a.set(m,y),l.push(m),x===1&&R&&Ut.add(m),y===1&&m.setAttribute(o,""),!R&&s&&m.setAttribute(s,s==="inert"?"":"true")}})}return gn+=1,()=>{l.forEach(p=>{const m=fr(s),R=(m.get(p)||0)-1,h=(a.get(p)||0)-1;m.set(p,R),a.set(p,h),R||(!Ut.has(p)&&s&&p.removeAttribute(s),Ut.delete(p)),h||p.removeAttribute(o)}),gn-=1,gn||(St.inert=new WeakMap,St["aria-hidden"]=new WeakMap,St.none=new WeakMap,Ut=new WeakSet,jt={})}}function Ps(e,t=!1,n=!1){const r=qe(e[0]).body;return Is(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}function ks(e,t){const n=We(e.target);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 dr=20;let lt=[];function Gn(){lt=lt.filter(e=>e.isConnected)}function Ls(e){Gn(),e&&Wt(e)!=="body"&&(lt.push(e),lt.length>dr&&(lt=lt.slice(-dr)))}function yn(){return Gn(),lt[lt.length-1]}function Ds(e){if(!e)return null;const t=Wn();return Ur(e,t)?e:_r(e,t)[0]||e}function Vs(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ze(e).display!=="none"}function pr(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Wn(),o=Xo(e,n).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return Ur(i,n)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Fs(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:c=!1,modal:d=!0,closeOnFocusOut:l=!0,openInteractionType:a="",getInsideElements:f=()=>[],nextFocusableElement:g,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:b}=e,R="rootStore"in t?t.rootStore:t,h=R.useState("open"),x=R.useState("domReferenceElement"),y=R.useState("floatingElement"),{events:v,dataRef:S}=R.context,O=re(()=>S.current.floatingContext?.nodeId),M=re(f),A=s===!1,z=On(x)&&A,Z=Le(o),G=Le(s),Q=Le(i),U=Le(a),X=_t(b),P=zo(),F=u.useRef(null),te=u.useRef(null),E=u.useRef(!1),V=u.useRef(!1),I=u.useRef(!1),B=u.useRef(-1),ye=u.useRef(""),_=u.useRef(""),me=u.useRef(null),se=u.useRef(null),q=Zt(me,m,P?.beforeInsideRef),ne=Zt(se,P?.afterInsideRef),ge=Ge(),ve=Ge(),ee=Hn(),pe=P!=null,w=en(y),N=re((T=w)=>T?_r(T,Wn()):[]),D=re(T=>{const k=N(T);return Z.current.map(()=>k).filter(Boolean).flat()});u.useEffect(()=>{if(r||!d)return;function T(Y){Y.key==="Tab"&&Re(w,ht(qe(w)))&&N().length===0&&!z&&ke(Y)}const k=qe(w);return k.addEventListener("keydown",T),()=>{k.removeEventListener("keydown",T)}},[r,x,w,d,Z,z,N,D]),u.useEffect(()=>{if(r||!y)return;function T(k){const Y=Qe(k),K=N().indexOf(Y);K!==-1&&(B.current=K)}return y.addEventListener("focusin",T),()=>{y.removeEventListener("focusin",T)}},[r,y,N]),u.useEffect(()=>{if(r||!h)return;const T=qe(w);function k(){I.current=!1}function Y(K){const $=Qe(K),H=Re(y,$)||Re(x,$)||Re(P?.portalNode,$);I.current=!H,_.current=K.pointerType||"keyboard"}function j(){_.current="keyboard"}return T.addEventListener("pointerdown",Y,!0),T.addEventListener("pointerup",k,!0),T.addEventListener("pointercancel",k,!0),T.addEventListener("keydown",j,!0),()=>{T.removeEventListener("pointerdown",Y,!0),T.removeEventListener("pointerup",k,!0),T.removeEventListener("pointercancel",k,!0),T.removeEventListener("keydown",j,!0)}},[r,y,x,w,h,P]),u.useEffect(()=>{if(r||!l)return;function T(){V.current=!0,ve.start(0,()=>{V.current=!1})}function k($){const H=$.relatedTarget,C=$.currentTarget,W=Qe($);queueMicrotask(()=>{const L=O(),ae=R.context.triggerElements,ue=H?.hasAttribute(Mn("focus-guard"))&&[me.current,se.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,ct(p),ct(g)].includes(H),he=!(Re(x,H)||Re(y,H)||Re(H,y)||Re(P?.portalNode,H)||H!=null&&ae.hasElement(H)||ae.hasMatchingElement(de=>Re(de,H))||ue||X&&(Et(X.nodesRef.current,L).find(de=>Re(de.context?.elements.floating,H)||Re(de.context?.elements.domReference,H))||sr(X.nodesRef.current,L).find(de=>[de.context?.elements.floating,en(de.context?.elements.floating)].includes(H)||de.context?.elements.domReference===H)));if(C===x&&w&&pr(w,Z),c&&C!==x&&!Vs(W)&&ht(qe(w))===qe(w).body){if(Ne(w)&&(w.focus(),c==="popup")){ee.request(()=>{w.focus()});return}const de=B.current,be=N(),Oe=be[de]||be[be.length-1]||w;Ne(Oe)&&Oe.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(z||!d)&&H&&he&&!V.current&&(z||H!==yn())&&(E.current=!0,R.setOpen(!1,Se(_n,$)))})}function Y(){I.current||(S.current.insideReactTree=!0,ge.start(0,()=>{S.current.insideReactTree=!1}))}const j=Ne(x)?x:null,K=[];if(!(!y&&!j))return j&&(j.addEventListener("focusout",k),j.addEventListener("pointerdown",T),K.push(()=>{j.removeEventListener("focusout",k),j.removeEventListener("pointerdown",T)})),y&&(y.addEventListener("focusout",k),P&&(y.addEventListener("focusout",Y,!0),K.push(()=>{y.removeEventListener("focusout",Y,!0)})),K.push(()=>{y.removeEventListener("focusout",k)})),()=>{K.forEach($=>{$()})}},[r,x,y,w,d,X,P,R,l,c,N,z,O,Z,S,ge,ve,ee,g,p]),u.useEffect(()=>{if(r||!y||!h)return;const T=Array.from(P?.portalNode?.querySelectorAll(`[${Mn("portal")}]`)||[]),Y=(X?sr(X.nodesRef.current,O()):[]).find($=>On($.context?.elements.domReference||null))?.context?.elements.domReference,j=[y,Y,...T,...M(),F.current,te.current,me.current,se.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,ct(p),ct(g),z?x:null].filter($=>$!=null),K=Ps(j,d||z);return()=>{K()}},[h,r,x,y,d,Z,P,z,X,O,M,g,p]),J(()=>{if(!h||r||!Ne(w))return;const T=qe(w),k=ht(T);queueMicrotask(()=>{const Y=D(w),j=G.current,K=typeof j=="function"?j(U.current||""):j;if(K===void 0||K===!1)return;let $;K===!0||K===null?$=Y[0]||w:$=ct(K),$=$||Y[0]||w,!Re(w,k)&&Xt($,{preventScroll:$===w})})},[r,h,w,A,D,G,U]),J(()=>{if(r||!w)return;const T=qe(w),k=ht(T);Ls(k);function Y($){if($.open||(ye.current=ks($.nativeEvent,_.current)),$.reason===Yo&&$.nativeEvent.type==="mouseleave"&&(E.current=!0),$.reason===Bn)if($.nested)E.current=!1;else if(Zr($.nativeEvent)||eo($.nativeEvent))E.current=!1;else{let H=!1;document.createElement("div").focus({get preventScroll(){return H=!0,!1}}),H?E.current=!1:E.current=!0}}v.on("openchange",Y);const j=T.createElement("span");j.setAttribute("tabindex","-1"),j.setAttribute("aria-hidden","true"),Object.assign(j.style,$r),pe&&x&&x.insertAdjacentElement("afterend",j);function K(){const $=Q.current;let H=typeof $=="function"?$(ye.current):$;if(H===void 0||H===!1)return null;if(H===null&&(H=!0),typeof H=="boolean"){const W=x||yn();return W&&W.isConnected?W:j}const C=x||yn()||j;return ct(H)||C}return()=>{v.off("openchange",Y);const $=ht(T),H=Re(y,$)||X&&Et(X.nodesRef.current,O(),!1).some(W=>Re(W.context?.elements.floating,$)),C=K();queueMicrotask(()=>{const W=Ds(C),L=typeof Q.current!="boolean";Q.current&&!E.current&&Ne(W)&&(!(!L&&W!==$&&$!==T.body)||H)&&W.focus({preventScroll:!0}),j.remove()})}},[r,y,w,Q,S,v,X,pe,x,O]),u.useEffect(()=>{queueMicrotask(()=>{E.current=!1})},[r]),u.useEffect(()=>{if(r||!h)return;function T(Y){Qe(Y)?.closest(`[${Go}]`)&&(V.current=!0)}const k=qe(w);return k.addEventListener("pointerdown",T,!0),()=>{k.removeEventListener("pointerdown",T,!0)}},[r,h,w]),J(()=>{if(!r&&P)return P.setFocusManagerState({modal:d,closeOnFocusOut:l,open:h,onOpenChange:R.setOpen,domReference:x}),()=>{P.setFocusManagerState(null)}},[r,P,d,h,R,l,x]),J(()=>{if(!(r||!w))return pr(w,Z),()=>{queueMicrotask(Gn)}},[r,w,Z]);const le=!r&&(d?!z:!0)&&(pe||d);return Ce.jsxs(u.Fragment,{children:[le&&Ce.jsx(tr,{"data-type":"inside",ref:q,onFocus:T=>{if(d){const k=D();Xt(k[k.length-1])}else P?.portalNode&&(E.current=!1,nr(T,P.portalNode)?Ko(x)?.focus():ct(p??P.beforeOutsideRef)?.focus())}}),n,le&&Ce.jsx(tr,{"data-type":"inside",ref:ne,onFocus:T=>{d?Xt(D()[0]):P?.portalNode&&(l&&(E.current=!0),nr(T,P.portalNode)?qo(x)?.focus():ct(g??P.afterOutsideRef)?.focus())}})]})}function Ns(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:d=!0,touchOpenDelay:l=0}=t,a=u.useRef(void 0),f=Hn(),g=Ge(),p=u.useMemo(()=>({onPointerDown(m){a.current=m.pointerType},onMouseDown(m){const b=a.current,R=m.nativeEvent,h=n.select("open");if(m.button!==0||s==="click"||ir(b,!0)&&c)return;const x=r.current.openEvent,y=x?.type,v=n.select("domReferenceElement")!==m.currentTarget,S=h&&v||!(h&&i&&(!(x&&d)||y==="click"||y==="mousedown"));if(Jo(R.target)){const M=Se(Dt,R,R.target);S&&b==="touch"&&l>0?g.start(l,()=>{n.setOpen(!0,M)}):n.setOpen(S,M);return}const O=m.currentTarget;f.request(()=>{const M=Se(Dt,R,O);S&&b==="touch"&&l>0?g.start(l,()=>{n.setOpen(!0,M)}):n.setOpen(S,M)})},onClick(m){if(s==="mousedown-only")return;const b=a.current;if(s==="mousedown"&&b){a.current=void 0;return}if(ir(b,!0)&&c)return;const R=n.select("open"),h=r.current.openEvent,x=n.select("domReferenceElement")!==m.currentTarget,y=R&&x||!(R&&i&&(!(h&&d)||to(h))),v=Se(Dt,m.nativeEvent,m.currentTarget);y&&b==="touch"&&l>0?g.start(l,()=>{n.setOpen(!0,v)}):n.setOpen(y,v)},onKeyDown(){a.current=void 0}}),[r,s,c,n,d,i,f,g,l]);return u.useMemo(()=>o?{reference:p}:Nt,[o,p])}function hr(e,t,n){let{reference:r,floating:o}=e;const s=Xe(t),i=qn(t),c=Kn(i),d=Be(t),l=s==="y",a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,g=r[c]/2-o[c]/2;let p;switch(d){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ft(t)){case"start":p[i]-=g*(n&&l?-1:1);break;case"end":p[i]+=g*(n&&l?-1:1);break}return p}async function Hs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:d}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=st(t,e),m=no(p),R=c[g?f==="floating"?"reference":"floating":f],h=rn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:a,strategy:d})),x=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},S=rn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:d}):x);return{top:(h.top-S.top+m.top)/v.y,bottom:(S.bottom-h.bottom+m.bottom)/v.y,left:(h.left-S.left+m.left)/v.x,right:(S.right-h.right+m.right)/v.x}}const Ws=50,Bs=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Hs},d=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=hr(l,r,d),g=r,p=0;const m={};for(let b=0;b<s.length;b++){const R=s[b];if(!R)continue;const{name:h,fn:x}=R,{x:y,y:v,data:S,reset:O}=await x({x:a,y:f,initialPlacement:r,placement:g,strategy:o,middlewareData:m,rects:l,platform:c,elements:{reference:e,floating:t}});a=y??a,f=v??f,m[h]={...m[h],...S},O&&p<Ws&&(p++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(l=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:a,y:f}=hr(l,g,d)),b=-1)}return{x:a,y:f,placement:g,strategy:o,middlewareData:m}},_s=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:d,elements:l}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...R}=st(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const h=Be(o),x=Xe(c),y=Be(c)===c,v=await(d.isRTL==null?void 0:d.isRTL(l.floating)),S=g||(y||!b?[nn(c)]:ys(c)),O=m!=="none";!g&&O&&S.push(...Rs(c,b,m,v));const M=[c,...S],A=await d.detectOverflow(t,R),z=[];let Z=((r=s.flip)==null?void 0:r.overflows)||[];if(a&&z.push(A[h]),f){const X=gs(o,i,v);z.push(A[X[0]],A[X[1]])}if(Z=[...Z,{placement:o,overflows:z}],!z.every(X=>X<=0)){var G,Q;const X=(((G=s.flip)==null?void 0:G.index)||0)+1,P=M[X];if(P&&(!(f==="alignment"?x!==Xe(P):!1)||Z.every(E=>Xe(E.placement)===x?E.overflows[0]>0:!0)))return{data:{index:X,overflows:Z},reset:{placement:P}};let F=(Q=Z.filter(te=>te.overflows[0]<=0).sort((te,E)=>te.overflows[1]-E.overflows[1])[0])==null?void 0:Q.placement;if(!F)switch(p){case"bestFit":{var U;const te=(U=Z.filter(E=>{if(O){const V=Xe(E.placement);return V===x||V==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(V=>V>0).reduce((V,I)=>V+I,0)]).sort((E,V)=>E[1]-V[1])[0])==null?void 0:U[0];te&&(F=te);break}case"initialPlacement":F=c;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function mr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gr(e){return hs.some(t=>e[t]>=0)}const $s=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=st(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=mr(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:gr(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),c=mr(i,n.floating);return{data:{escapedOffsets:c,escaped:gr(c)}}}default:return{}}}}},co=new Set(["left","top"]);async function Us(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Be(n),c=ft(n),d=Xe(n)==="y",l=co.has(i)?-1:1,a=s&&d?-1:1,f=st(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),d?{x:p*a,y:g*l}:{x:g*l,y:p*a}}const js=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,d=await Us(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:s+d.y,data:{...d,placement:i}}}}},zs=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:d={fn:h=>{let{x,y}=h;return{x,y}}},...l}=st(e,t),a={x:n,y:r},f=await s.detectOverflow(t,l),g=Xe(Be(o)),p=Yn(g);let m=a[p],b=a[g];if(i){const h=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=m+f[h],v=m-f[x];m=Pn(y,m,v)}if(c){const h=g==="y"?"top":"left",x=g==="y"?"bottom":"right",y=b+f[h],v=b-f[x];b=Pn(y,b,v)}const R=d.fn({...t,[p]:m,[g]:b});return{...R,data:{x:R.x-n,y:R.y-r,enabled:{[p]:i,[g]:c}}}}}},Ys=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:d=!0,crossAxis:l=!0}=st(e,t),a={x:n,y:r},f=Xe(o),g=Yn(f);let p=a[g],m=a[f];const b=st(c,t),R=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const y=g==="y"?"height":"width",v=s.reference[g]-s.floating[y]+R.mainAxis,S=s.reference[g]+s.reference[y]-R.mainAxis;p<v?p=v:p>S&&(p=S)}if(l){var h,x;const y=g==="y"?"width":"height",v=co.has(Be(o)),S=s.reference[f]-s.floating[y]+(v&&((h=i.offset)==null?void 0:h[f])||0)+(v?0:R.crossAxis),O=s.reference[f]+s.reference[y]+(v?0:((x=i.offset)==null?void 0:x[f])||0)-(v?R.crossAxis:0);m<S?m=S:m>O&&(m=O)}return{[g]:p,[f]:m}}}},Ks=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:d=()=>{},...l}=st(e,t),a=await i.detectOverflow(t,l),f=Be(o),g=ft(o),p=Xe(o)==="y",{width:m,height:b}=s.floating;let R,h;f==="top"||f==="bottom"?(R=f,h=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(h=f,R=g==="end"?"top":"bottom");const x=b-a.top-a.bottom,y=m-a.left-a.right,v=At(b-a[R],x),S=At(m-a[h],y),O=!t.middlewareData.shift;let M=v,A=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=x),O&&!g){const Z=ze(a.left,0),G=ze(a.right,0),Q=ze(a.top,0),U=ze(a.bottom,0);p?A=m-2*(Z!==0||G!==0?Z+G:ze(a.left,a.right)):M=b-2*(Q!==0||U!==0?Q+U:ze(a.top,a.bottom))}await d({...t,availableWidth:A,availableHeight:M});const z=await i.getDimensions(c.floating);return m!==z.width||b!==z.height?{reset:{rects:!0}}:{}}}};function lo(e){const t=Ze(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ne(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=tn(n)!==s||tn(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Xn(e){return Ee(e)?e:e.contextElement}function Ct(e){const t=Xn(e);if(!Ne(t))return tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=lo(t);let i=(s?tn(n.width):n.width)/r,c=(s?tn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const qs=tt(0);function ao(e){const t=We(e);return!$n()||!t.visualViewport?qs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==We(e)?!1:t}function gt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Xn(e);let i=tt(1);t&&(r?Ee(r)&&(i=Ct(r)):i=Ct(e));const c=Gs(s,n,r)?ao(s):tt(0);let d=(o.left+c.x)/i.x,l=(o.top+c.y)/i.y,a=o.width/i.x,f=o.height/i.y;if(s){const g=We(s),p=r&&Ee(r)?We(r):r;let m=g,b=rr(m);for(;b&&r&&p!==m;){const R=Ct(b),h=b.getBoundingClientRect(),x=Ze(b),y=h.left+(b.clientLeft+parseFloat(x.paddingLeft))*R.x,v=h.top+(b.clientTop+parseFloat(x.paddingTop))*R.y;d*=R.x,l*=R.y,a*=R.x,f*=R.y,d+=y,l+=v,m=We(b),b=rr(m)}}return rn({width:a,height:f,x:d,y:l})}function fn(e,t){const n=ln(e).scrollLeft;return t?t.left+n:gt(it(e)).left+n}function uo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-fn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Xs(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=it(r),c=t?Un(t.floating):!1;if(r===i||c&&s)return n;let d={scrollLeft:0,scrollTop:0},l=tt(1);const a=tt(0),f=Ne(r);if((f||!f&&!s)&&((Wt(r)!=="body"||Bt(i))&&(d=ln(r)),f)){const p=gt(r);l=Ct(r),a.x=p.x+r.clientLeft,a.y=p.y+r.clientTop}const g=i&&!f&&!s?uo(i,d):tt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-d.scrollLeft*l.x+a.x+g.x,y:n.y*l.y-d.scrollTop*l.y+a.y+g.y}}function Js(e){return Array.from(e.getClientRects())}function Qs(e){const t=it(e),n=ln(e),r=e.ownerDocument.body,o=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+fn(e);const c=-n.scrollTop;return Ze(r).direction==="rtl"&&(i+=ze(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const yr=25;function Zs(e,t){const n=We(e),r=it(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,d=0;if(o){s=o.width,i=o.height;const a=$n();(!a||a&&t==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}const l=fn(r);if(l<=0){const a=r.ownerDocument,f=a.body,g=getComputedStyle(f),p=a.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-p);m<=yr&&(s-=m)}else l<=yr&&(s+=l);return{width:s,height:i,x:c,y:d}}function ei(e,t){const n=gt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ne(e)?Ct(e):tt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,d=o*s.x,l=r*s.y;return{width:i,height:c,x:d,y:l}}function br(e,t,n){let r;if(t==="viewport")r=Zs(e,n);else if(t==="document")r=Qs(it(e));else if(Ee(t))r=ei(t,n);else{const o=ao(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return rn(r)}function fo(e,t){const n=Mt(e);return n===t||!Ee(n)||mt(n)?!1:Ze(n).position==="fixed"||fo(n,t)}function ti(e,t){const n=t.get(e);if(n)return n;let r=vt(e,[],!1).filter(c=>Ee(c)&&Wt(c)!=="body"),o=null;const s=Ze(e).position==="fixed";let i=s?Mt(e):e;for(;Ee(i)&&!mt(i);){const c=Ze(i),d=jr(i);!d&&c.position==="fixed"&&(o=null),(s?!d&&!o:!d&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Bt(i)&&!d&&fo(e,i))?r=r.filter(a=>a!==i):o=c,i=Mt(i)}return t.set(e,r),r}function ni(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Un(t)?[]:ti(t,this._c):[].concat(n),r],c=br(t,i[0],o);let d=c.top,l=c.right,a=c.bottom,f=c.left;for(let g=1;g<i.length;g++){const p=br(t,i[g],o);d=ze(p.top,d),l=At(p.right,l),a=At(p.bottom,a),f=ze(p.left,f)}return{width:l-f,height:a-d,x:f,y:d}}function ri(e){const{width:t,height:n}=lo(e);return{width:t,height:n}}function oi(e,t,n){const r=Ne(t),o=it(t),s=n==="fixed",i=gt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const d=tt(0);function l(){d.x=fn(o)}if(r||!r&&!s)if((Wt(t)!=="body"||Bt(o))&&(c=ln(t)),r){const p=gt(t,!0,s,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else o&&l();s&&!r&&o&&l();const a=o&&!r&&!s?uo(o,c):tt(0),f=i.left+c.scrollLeft-d.x-a.x,g=i.top+c.scrollTop-d.y-a.y;return{x:f,y:g,width:i.width,height:i.height}}function bn(e){return Ze(e).position==="static"}function xr(e,t){if(!Ne(e)||Ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return it(e)===n&&(n=n.ownerDocument.body),n}function po(e,t){const n=We(e);if(Un(e))return n;if(!Ne(e)){let o=Mt(e);for(;o&&!mt(o);){if(Ee(o)&&!bn(o))return o;o=Mt(o)}return n}let r=xr(e,t);for(;r&&Qo(r)&&bn(r);)r=xr(r,t);return r&&mt(r)&&bn(r)&&!jr(r)?n:r||Zo(e)||n}const si=async function(e){const t=this.getOffsetParent||po,n=this.getDimensions,r=await n(e.floating);return{reference:oi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ii(e){return Ze(e).direction==="rtl"}const ci={convertOffsetParentRelativeRectToViewportRelativeRect:Xs,getDocumentElement:it,getClippingRect:ni,getOffsetParent:po,getElementRects:si,getClientRects:Js,getDimensions:ri,getScale:Ct,isElement:Ee,isRTL:ii};function ho(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function li(e,t){let n=null,r;const o=it(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const l=e.getBoundingClientRect(),{left:a,top:f,width:g,height:p}=l;if(c||t(),!g||!p)return;const m=Rt(f),b=Rt(o.clientWidth-(a+g)),R=Rt(o.clientHeight-(f+p)),h=Rt(a),y={rootMargin:-m+"px "+-b+"px "+-R+"px "+-h+"px",threshold:ze(0,At(1,d))||1};let v=!0;function S(O){const M=O[0].intersectionRatio;if(M!==d){if(!v)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!ho(l,e.getBoundingClientRect())&&i(),v=!1}try{n=new IntersectionObserver(S,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(e)}return i(!0),s}function wr(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,l=Xn(e),a=o||s?[...l?vt(l):[],...t?vt(t):[]]:[];a.forEach(h=>{o&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const f=l&&c?li(l,n):null;let g=-1,p=null;i&&(p=new ResizeObserver(h=>{let[x]=h;x&&x.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),l&&!d&&p.observe(l),t&&p.observe(t));let m,b=d?gt(e):null;d&&R();function R(){const h=gt(e);b&&!ho(b,h)&&n(),b=h,m=requestAnimationFrame(R)}return n(),()=>{var h;a.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f?.(),(h=p)==null||h.disconnect(),p=null,d&&cancelAnimationFrame(m)}}const ai=js,ui=zs,fi=_s,di=Ks,pi=$s,hi=Ys,mi=(e,t,n)=>{const r=new Map,o={platform:ci,...n},s={...o.platform,_c:r};return Bs(e,t,{...o,platform:s})};var gi=typeof document<"u",yi=function(){},Jt=gi?u.useLayoutEffect:yi;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!on(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!on(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function mo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rr(e,t){const n=mo(e);return Math.round(t*n)/n}function xn(e){const t=u.useRef(e);return Jt(()=>{t.current=e}),t}function bi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:d,open:l}=e,[a,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=u.useState(r);on(g,r)||p(r);const[m,b]=u.useState(null),[R,h]=u.useState(null),x=u.useCallback(E=>{E!==O.current&&(O.current=E,b(E))},[]),y=u.useCallback(E=>{E!==M.current&&(M.current=E,h(E))},[]),v=s||m,S=i||R,O=u.useRef(null),M=u.useRef(null),A=u.useRef(a),z=d!=null,Z=xn(d),G=xn(o),Q=xn(l),U=u.useCallback(()=>{if(!O.current||!M.current)return;const E={placement:t,strategy:n,middleware:g};G.current&&(E.platform=G.current),mi(O.current,M.current,E).then(V=>{const I={...V,isPositioned:Q.current!==!1};X.current&&!on(A.current,I)&&(A.current=I,jn.flushSync(()=>{f(I)}))})},[g,t,n,G,Q]);Jt(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(E=>({...E,isPositioned:!1})))},[l]);const X=u.useRef(!1);Jt(()=>(X.current=!0,()=>{X.current=!1}),[]),Jt(()=>{if(v&&(O.current=v),S&&(M.current=S),v&&S){if(Z.current)return Z.current(v,S,U);U()}},[v,S,U,Z,z]);const P=u.useMemo(()=>({reference:O,floating:M,setReference:x,setFloating:y}),[x,y]),F=u.useMemo(()=>({reference:v,floating:S}),[v,S]),te=u.useMemo(()=>{const E={position:n,left:0,top:0};if(!F.floating)return E;const V=Rr(F.floating,a.x),I=Rr(F.floating,a.y);return c?{...E,transform:"translate("+V+"px, "+I+"px)",...mo(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:I}},[n,c,F.floating,a.x,a.y]);return u.useMemo(()=>({...a,update:U,refs:P,elements:F,floatingStyles:te}),[a,U,P,F,te])}const xi=(e,t)=>{const n=ai(e);return{name:n.name,fn:n.fn,options:[e,t]}},wi=(e,t)=>{const n=ui(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ri=(e,t)=>({fn:hi(e).fn,options:[e,t]}),vi=(e,t)=>{const n=fi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ei=(e,t)=>{const n=di(e);return{name:n.name,fn:n.fn,options:[e,t]}},Si=(e,t)=>{const n=pi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ci={intentional:"onClick",sloppy:"onPointerDown"};function Ti(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Oi(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:d}=n.context,{enabled:l=!0,escapeKey:a=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:p=!1,referencePressEvent:m="sloppy",ancestorScroll:b=!1,bubbles:R,externalTree:h}=t,x=_t(h),y=re(typeof f=="function"?f:()=>!1),v=typeof f=="function"?y:f,S=u.useRef(!1),{escapeKey:O,outsidePress:M}=Ti(R),A=u.useRef(null),z=Ge(),Z=Ge(),G=re(()=>{Z.clear(),d.current.insideReactTree=!1}),Q=u.useRef(!1),U=u.useRef(""),X=re(w=>{U.current=w.pointerType}),P=re(()=>{const w=U.current,N=w==="pen"||!w?"mouse":w,D=typeof g=="function"?g():g;return typeof D=="string"?D:D[N]}),F=re(w=>{if(!r||!l||!a||w.key!=="Escape"||Q.current)return;const N=d.current.floatingContext?.nodeId,D=x?Et(x.nodesRef.current,N):[];if(!O&&D.length>0){let k=!0;if(D.forEach(Y=>{Y.context?.open&&!Y.context.dataRef.current.__escapeKeyBubbles&&(k=!1)}),!k)return}const le=ps(w)?w.nativeEvent:w,T=Se(ts,le);n.setOpen(!1,T),!O&&!T.isPropagationAllowed&&w.stopPropagation()}),te=re(w=>{const N=P();return N==="intentional"&&w.type!=="click"||N==="sloppy"&&w.type==="click"}),E=re(()=>{d.current.insideReactTree=!0,Z.start(0,G)}),V=re((w,N=!1)=>{if(te(w)){G();return}if(d.current.insideReactTree){G();return}if(P()==="intentional"&&N||typeof v=="function"&&!v(w))return;const D=Qe(w),le=`[${Mn("inert")}]`,T=qe(n.select("floatingElement")).querySelectorAll(le),k=n.context.triggerElements;if(D&&(k.hasElement(D)||k.hasMatchingElement(H=>Re(H,D))))return;let Y=Ee(D)?D:null;for(;Y&&!mt(Y);){const H=Mt(Y);if(mt(H)||!Ee(H))break;Y=H}if(T.length&&Ee(D)&&!es(D)&&!Re(D,n.select("floatingElement"))&&Array.from(T).every(H=>!Re(Y,H)))return;if(Ne(D)&&!("touches"in w)){const H=mt(D),C=Ze(D),W=/auto|scroll/,L=H||W.test(C.overflowX),ae=H||W.test(C.overflowY),ue=L&&D.clientWidth>0&&D.scrollWidth>D.clientWidth,he=ae&&D.clientHeight>0&&D.scrollHeight>D.clientHeight,de=C.direction==="rtl",be=he&&(de?w.offsetX<=D.offsetWidth-D.clientWidth:w.offsetX>D.clientWidth),Oe=ue&&w.offsetY>D.clientHeight;if(be||Oe)return}const j=d.current.floatingContext?.nodeId,K=x&&Et(x.nodesRef.current,j).some(H=>Je(w,H.context?.elements.floating));if(Je(w,n.select("floatingElement"))||Je(w,n.select("domReferenceElement"))||K)return;const $=x?Et(x.nodesRef.current,j):[];if($.length>0){let H=!0;if($.forEach(C=>{C.context?.open&&!C.context.dataRef.current.__outsidePressBubbles&&(H=!1)}),!H)return}n.setOpen(!1,Se(Bn,w)),G()}),I=re(w=>{P()!=="sloppy"||w.pointerType==="touch"||!n.select("open")||!l||Je(w,n.select("floatingElement"))||Je(w,n.select("domReferenceElement"))||V(w)}),B=re(w=>{if(P()!=="sloppy"||!n.select("open")||!l||Je(w,n.select("floatingElement"))||Je(w,n.select("domReferenceElement")))return;const N=w.touches[0];N&&(A.current={startTime:Date.now(),startX:N.clientX,startY:N.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}),ye=re(w=>{const N=Qe(w);function D(){B(w),N?.removeEventListener(w.type,D)}N?.addEventListener(w.type,D)}),_=re(w=>{const N=S.current;if(S.current=!1,z.clear(),w.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const D=Qe(w);function le(){w.type==="pointerdown"?I(w):V(w,N),D?.removeEventListener(w.type,le)}D?.addEventListener(w.type,le)}),me=re(w=>{if(P()!=="sloppy"||!A.current||Je(w,n.select("floatingElement"))||Je(w,n.select("domReferenceElement")))return;const N=w.touches[0];if(!N)return;const D=Math.abs(N.clientX-A.current.startX),le=Math.abs(N.clientY-A.current.startY),T=Math.sqrt(D*D+le*le);T>5&&(A.current.dismissOnTouchEnd=!0),T>10&&(V(w),z.clear(),A.current=null)}),se=re(w=>{const N=Qe(w);function D(){me(w),N?.removeEventListener(w.type,D)}N?.addEventListener(w.type,D)}),q=re(w=>{P()!=="sloppy"||!A.current||Je(w,n.select("floatingElement"))||Je(w,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&V(w),z.clear(),A.current=null)}),ne=re(w=>{const N=Qe(w);function D(){q(w),N?.removeEventListener(w.type,D)}N?.addEventListener(w.type,D)});u.useEffect(()=>{if(!r||!l)return;d.current.__escapeKeyBubbles=O,d.current.__outsidePressBubbles=M;const w=new An;function N(Y){n.setOpen(!1,Se(an,Y))}function D(){w.clear(),Q.current=!0}function le(){w.start($n()?5:0,()=>{Q.current=!1})}const T=qe(o);T.addEventListener("pointerdown",X,!0),a&&(T.addEventListener("keydown",F),T.addEventListener("compositionstart",D),T.addEventListener("compositionend",le)),v&&(T.addEventListener("click",_,!0),T.addEventListener("pointerdown",_,!0),T.addEventListener("touchstart",ye,!0),T.addEventListener("touchmove",se,!0),T.addEventListener("touchend",ne,!0),T.addEventListener("mousedown",_,!0));let k=[];return b&&(Ee(i)&&(k=vt(i)),Ee(o)&&(k=k.concat(vt(o))),!Ee(s)&&s&&s.contextElement&&(k=k.concat(vt(s.contextElement)))),k=k.filter(Y=>Y!==T.defaultView?.visualViewport),k.forEach(Y=>{Y.addEventListener("scroll",N,{passive:!0})}),()=>{T.removeEventListener("pointerdown",X,!0),a&&(T.removeEventListener("keydown",F),T.removeEventListener("compositionstart",D),T.removeEventListener("compositionend",le)),v&&(T.removeEventListener("click",_,!0),T.removeEventListener("pointerdown",_,!0),T.removeEventListener("touchstart",ye,!0),T.removeEventListener("touchmove",se,!0),T.removeEventListener("touchend",ne,!0),T.removeEventListener("mousedown",_,!0)),k.forEach(Y=>{Y.removeEventListener("scroll",N)}),w.clear(),S.current=!1}},[d,o,s,i,a,v,r,c,b,l,O,M,F,V,_,I,ye,se,ne,X,n]),u.useEffect(G,[v,G]);const ge=u.useMemo(()=>({onKeyDown:F,...p&&{[Ci[m]]:w=>{n.setOpen(!1,Se(Dt,w.nativeEvent))},...m!=="intentional"&&{onClick(w){n.setOpen(!1,Se(Dt,w.nativeEvent))}}}}),[F,n,p,m]),ve=re(w=>{const N=Qe(w.nativeEvent);!Re(n.select("floatingElement"),N)||w.button!==0||(S.current=!0)}),ee=re(w=>{!r||!l||w.button!==0||(S.current=!0)}),pe=u.useMemo(()=>({onKeyDown:F,onPointerDown:ve,onMouseDown:ve,onMouseUp:ve,onClickCapture:E,onMouseDownCapture(w){E(),ee(w)},onPointerDownCapture(w){E(),ee(w)},onMouseUpCapture:E,onTouchEndCapture:E,onTouchMoveCapture:E}),[F,ve,E,ee]);return u.useMemo(()=>l?{reference:ge,floating:pe,trigger:ge}:{},[l,ge,pe])}var sn=Symbol("NOT_FOUND");function Mi(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ai(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ii(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var vr=e=>Array.isArray(e)?e:[e];function Pi(e){const t=Array.isArray(e[0])?e[0]:e;return Ii(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ki(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function Li(e){let t;return{get(n){return t&&e(t.key,n)?t.value:sn},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Di(e,t){let n=[];function r(c){const d=n.findIndex(l=>t(c,l.key));if(d>-1){const l=n[d];return d>0&&(n.splice(d,1),n.unshift(l)),l.value}return sn}function o(c,d){r(c)===sn&&(n.unshift({key:c,value:d}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var Vi=(e,t)=>e===t;function Fi(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function Ni(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Vi,maxSize:o=1,resultEqualityCheck:s}=n,i=Fi(r);let c=0;const d=o<=1?Li(i):Di(o,i);function l(){let a=d.get(arguments);if(a===sn){if(a=e.apply(null,arguments),c++,s){const g=d.getEntries().find(p=>s(p.value,a));g&&(a=g.value,c!==0&&c--)}d.put(arguments,a)}return a}return l.clearCache=()=>{d.clear(),l.resetResultsCount()},l.resultsCount=()=>c,l.resetResultsCount=()=>{c=0},l}var Hi=class{constructor(e){this.value=e}deref(){return this.value}},Wi=typeof WeakRef<"u"?WeakRef:Hi,Bi=0,Er=1;function zt(){return{s:Bi,v:void 0,o:null,p:null}}function go(e,t={}){let n=zt();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let c=n;const{length:d}=arguments;for(let f=0,g=d;f<g;f++){const p=arguments[f];if(typeof p=="function"||typeof p=="object"&&p!==null){let m=c.o;m===null&&(c.o=m=new WeakMap);const b=m.get(p);b===void 0?(c=zt(),m.set(p,c)):c=b}else{let m=c.p;m===null&&(c.p=m=new Map);const b=m.get(p);b===void 0?(c=zt(),m.set(p,c)):c=b}}const l=c;let a;if(c.s===Er)a=c.v;else if(a=e.apply(null,arguments),s++,r){const f=o?.deref?.()??o;f!=null&&r(f,a)&&(a=f,s!==0&&s--),o=typeof a=="object"&&a!==null||typeof a=="function"?new Wi(a):a}return l.s=Er,l.v=a,a}return i.clearCache=()=>{n=zt(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function yo(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,c,d={},l=o.pop();typeof l=="object"&&(d=l,l=o.pop()),Mi(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const a={...n,...d},{memoize:f,memoizeOptions:g=[],argsMemoize:p=go,argsMemoizeOptions:m=[]}=a,b=vr(g),R=vr(m),h=Pi(o),x=f(function(){return s++,l.apply(null,arguments)},...b),y=p(function(){i++;const S=ki(h,arguments);return c=x.apply(null,S),c},...R);return Object.assign(y,{resultFunc:l,memoizedResultFunc:x,dependencies:h,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var _i=yo(go),$i=Object.assign((e,t=_i)=>{Ai(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,c,d)=>(i[n[d]]=c,i),{}))},{withTypes:()=>$i});yo({memoize:Ni,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const fe=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(Pt(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var wn={exports:{}},Rn={};var Sr;function Ui(){if(Sr)return Rn;Sr=1;var e=zr();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(f,g){var p=g(),m=r({inst:{value:p,getSnapshot:g}}),b=m[0].inst,R=m[1];return s(function(){b.value=p,b.getSnapshot=g,d(b)&&R({inst:b})},[f,p,g]),o(function(){return d(b)&&R({inst:b}),f(function(){d(b)&&R({inst:b})})},[f]),i(p),p}function d(f){var g=f.getSnapshot;f=f.value;try{var p=g();return!n(f,p)}catch{return!0}}function l(f,g){return g()}var a=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return Rn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:a,Rn}var Cr;function bo(){return Cr||(Cr=1,wn.exports=Ui()),wn.exports}var ji=bo(),vn={exports:{}},En={};var Tr;function zi(){if(Tr)return En;Tr=1;var e=zr(),t=bo();function n(l,a){return l===a&&(l!==0||1/l===1/a)||l!==l&&a!==a}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,c=e.useMemo,d=e.useDebugValue;return En.useSyncExternalStoreWithSelector=function(l,a,f,g,p){var m=s(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=c(function(){function h(O){if(!x){if(x=!0,y=O,O=g(O),p!==void 0&&b.hasValue){var M=b.value;if(p(M,O))return v=M}return v=O}if(M=v,r(y,O))return M;var A=g(O);return p!==void 0&&p(M,A)?(y=O,M):(y=O,v=A)}var x=!1,y,v,S=f===void 0?null:f;return[function(){return h(a())},S===null?void 0:function(){return h(S())}]},[a,f,g,p]);var R=o(l,m[0],m[1]);return i(function(){b.hasValue=!0,b.value=R},[R]),d(R),R},En}var Or;function Yi(){return Or||(Or=1,vn.exports=zi()),vn.exports}var Ki=Yi();const qi=ns(19),Gi=qi?Xi:Ji;function ce(e,t,n,r,o){return Gi(e,t,n,r,o)}function Xi(e,t,n,r,o){const s=u.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return ji.useSyncExternalStore(e.subscribe,s,s)}function Ji(e,t,n,r,o){return Ki.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class Tt{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Tt.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Tt.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Tt.prototype.setState.call(this,t)}}class Qi extends Tt{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}controlledValues=new Map;useSyncedValue(t,n){u.useDebugValue(t),J(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;J(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);J(()=>{n.update(t)},[n,...r])}useControlledProp(t,n,r){u.useDebugValue(t);const o=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})),J(()=>{s&&!Object.is(o.state[t],n)&&super.setState({...o.state,[t]:n})},[o,t,n,r,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.update(n)}setState(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.setState({...this.state,...n})}select=(t,n,r,o)=>{const s=this.selectors[t];return s(this.state,n,r,o)};useState=(t,n,r,o)=>{u.useDebugValue(t);const s=this.selectors[t];return ce(this,s,n,r,o)};useContextCallback(t,n){u.useDebugValue(t);const r=re(n??Ye);this.context[t]=r}useStateSetter(t){const n=u.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const c=o;o=i,n(i,c,this)}})}}const Zi={open:fe(e=>e.open),domReferenceElement:fe(e=>e.domReferenceElement),referenceElement:fe(e=>e.positionReference??e.referenceElement),floatingElement:fe(e=>e.floatingElement),floatingId:fe(e=>e.floatingId)};class ec extends Qi{constructor(t){const{nested:n,noEmit:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:ro(),nested:n,noEmit:r,triggerElements:s},Zi)}setOpen=(t,n)=>{if((!t||!this.state.open||to(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function xo(e,t=!1,n=!1){const[r,o]=u.useState(e&&t?"idle":void 0),[s,i]=u.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),J(()=>{if(!e&&s&&r!=="ending"&&n){const c=pt.request(()=>{o("ending")});return()=>{pt.cancel(c)}}},[e,s,r,n]),J(()=>{if(!e||t)return;const c=pt.request(()=>{o(void 0)});return()=>{pt.cancel(c)}},[t,e]),J(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=pt.request(()=>{o("idle")});return()=>{pt.cancel(c)}},[t,e,s,o,r]),u.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:r}),[s,r])}class tc{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function wo(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Nn(),s=un()!=null,i=Ot(()=>new ec({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new tc,floatingId:o,nested:s,noEmit:e.noEmit||!1})).current;return J(()=>{const c={open:t,floatingId:o};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=Ee(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),i.update(c)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function nc(e={}){const{nodeId:t,externalTree:n}=e,r=wo(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,c]=u.useState(null),d=u.useRef(null),l=_t(n);J(()=>{s.domReference&&(d.current=s.domReference)},[s.domReference]);const a=bi({...e,elements:{...s,...i&&{reference:i}}}),f=u.useCallback(M=>{const A=Ee(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;c(A),a.refs.setReference(A)},[a.refs]),[g,p]=u.useState(null),[m,b]=u.useState(null);o.useSyncedValue("referenceElement",g),o.useSyncedValue("domReferenceElement",Ee(g)?g:null),o.useSyncedValue("floatingElement",m);const R=u.useCallback(M=>{(Ee(M)||M===null)&&(d.current=M,p(M)),(Ee(a.refs.reference.current)||a.refs.reference.current===null||M!==null&&!Ee(M))&&a.refs.setReference(M)},[a.refs,p]),h=u.useCallback(M=>{b(M),a.refs.setFloating(M)},[a.refs]),x=u.useMemo(()=>({...a.refs,setReference:R,setFloating:h,setPositionReference:f,domReference:d}),[a.refs,R,h,f]),y=u.useMemo(()=>({...a.elements,domReference:s.domReference}),[a.elements,s.domReference]),v=o.useState("open"),S=o.useState("floatingId"),O=u.useMemo(()=>({...a,dataRef:o.context.dataRef,open:v,onOpenChange:o.setOpen,events:o.context.events,floatingId:S,refs:x,elements:y,nodeId:t,rootStore:o}),[a,x,y,t,o,v,S]);return J(()=>{o.context.dataRef.current.floatingContext=O;const M=l?.nodesRef.current.find(A=>A.id===t);M&&(M.context=O)}),u.useMemo(()=>({...a,context:O,refs:x,elements:y,rootStore:o}),[a,x,y,O,o])}function rc(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=e.map(l=>l?.trigger),s=u.useCallback(l=>Yt(l,e,"reference"),t),i=u.useCallback(l=>Yt(l,e,"floating"),n),c=u.useCallback(l=>Yt(l,e,"item"),r),d=u.useCallback(l=>Yt(l,e,"trigger"),o);return u.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:d}),[s,i,c,d])}function Yt(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[rs]="");for(const i in e)o&&e&&(i===Yr||i===Kr)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let c;const d=t[i]?.[n];typeof d=="function"?c=e?d(e):null:c=d,c&&Mr(s,c,o,r)}return Mr(s,e,o,r),s}function Mr(e,t,n,r){for(const o in t){const s=t[o];n&&(o===Yr||o===Kr)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(c=>c(...i)).find(c=>c!==void 0))):e[o]=s)}}const oc="Escape";function dn(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Kt(e,t){return dn(t,e===Fn||e===Ht,e===at||e===ut)}function Sn(e,t,n){return dn(t,e===Ht,n?e===at:e===ut)||e==="Enter"||e===" "||e===""}function sc(e,t,n){return dn(t,n?e===at:e===ut,e===Ht)}function ic(e,t,n,r){const o=n?e===ut:e===at,s=e===Fn;return t==="both"||t==="horizontal"&&r&&r>1?e===oc:dn(t,o,s)}function cc(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:c,activeIndex:d,onNavigate:l=()=>{},enabled:a=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:p=!1,nested:m=!1,rtl:b=!1,virtual:R=!1,focusItemOnOpen:h="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:y=!0,disabledIndices:v=void 0,orientation:S="vertical",parentOrientation:O,cols:M=1,scrollItemIntoView:A=!0,itemSizes:z,dense:Z=!1,id:G,resetOnPointerLeave:Q=!0,externalTree:U}=t,X=en(o),P=Le(X),F=un(),te=_t(U);J(()=>{i.current.orientation=S},[i,S]);const E=On(s),V=u.useRef(h),I=u.useRef(f??-1),B=u.useRef(null),ye=u.useRef(!0),_=re(C=>{l(I.current===-1?null:I.current,C)}),me=u.useRef(_),se=u.useRef(!!o),q=u.useRef(r),ne=u.useRef(!1),ge=u.useRef(!1),ve=Le(v),ee=Le(r),pe=Le(A),w=Le(f),N=Le(Q),D=re(()=>{function C(ue){R?te?.events.emit("virtualfocus",ue):Xt(ue,{sync:ne.current,preventScroll:!0})}const W=c.current[I.current],L=ge.current;W&&C(W),(ne.current?ue=>ue():requestAnimationFrame)(()=>{const ue=c.current[I.current]||W;if(!ue)return;W||C(ue);const he=pe.current;he&&T&&(L||!ye.current)&&ue.scrollIntoView?.(typeof he=="boolean"?{block:"nearest",inline:"nearest"}:he)})});J(()=>{a&&(r&&o?(I.current=f??-1,V.current&&f!=null&&(ge.current=!0,_())):se.current&&(I.current=-1,me.current()))},[a,r,o,f,_]),J(()=>{if(a){if(!r){ne.current=!1;return}if(o)if(d==null){if(ne.current=!1,w.current!=null)return;if(se.current&&(I.current=-1,D()),(!q.current||!se.current)&&V.current&&(B.current!=null||V.current===!0&&B.current==null)){let C=0;const W=()=>{c.current[0]==null?(C<2&&(C?requestAnimationFrame:queueMicrotask)(W),C+=1):(I.current=B.current==null||Sn(B.current,S,b)||m?mn(c):ar(c),B.current=null,_())};W()}}else Vt(c,d)||(I.current=d,D(),ge.current=!1)}},[a,r,o,d,w,m,c,S,b,_,D,ve]),J(()=>{if(!a||o||!te||R||!se.current)return;const C=te.nodesRef.current,W=C.find(ue=>ue.id===F)?.context?.elements.floating,L=ht(qe(o)),ae=C.some(ue=>ue.context&&Re(ue.context.elements.floating,L));W&&!ae&&ye.current&&W.focus({preventScroll:!0})},[a,o,te,F,R]),J(()=>{me.current=_,q.current=r,se.current=!!o}),J(()=>{r||(B.current=null,V.current=h)},[r,h]);const le=d!=null,T=u.useMemo(()=>{function C(L){if(!ee.current)return;const ae=c.current.indexOf(L.currentTarget);ae!==-1&&I.current!==ae&&(I.current=ae,_(L))}return{onFocus(L){ne.current=!0,C(L)},onClick:({currentTarget:L})=>L.focus({preventScroll:!0}),onMouseMove(L){ne.current=!0,ge.current=!1,x&&C(L)},onPointerLeave(L){if(!ee.current||!ye.current||L.pointerType==="touch")return;ne.current=!0;const ae=L.relatedTarget;!x||c.current.includes(ae)||N.current&&(I.current=-1,_(L),R||P.current?.focus({preventScroll:!0}))}}},[ee,P,x,c,_,N,R]),k=u.useCallback(()=>O??te?.nodesRef.current.find(C=>C.id===F)?.context?.dataRef?.current.orientation,[F,te,O]),Y=re(C=>{if(ye.current=!1,ne.current=!0,C.which===229||!ee.current&&C.currentTarget===P.current)return;if(m&&ic(C.key,S,b,M)){Kt(C.key,k())||ke(C),n.setOpen(!1,Se(pn,C.nativeEvent)),Ne(s)&&(R?te?.events.emit("virtualfocus",s):s.focus());return}const W=I.current,L=mn(c,v),ae=ar(c,v);if(E||(C.key==="Home"&&(ke(C),I.current=L,_(C)),C.key==="End"&&(ke(C),I.current=ae,_(C))),M>1){const ue=z||Array.from({length:c.current.length},()=>({width:1,height:1})),he=Ss(ue,M,Z),de=he.findIndex(Ae=>Ae!=null&&!Ft(c,Ae,v)),be=he.reduce((Ae,De,Ke)=>De!=null&&!Ft(c,De,v)?Ke:Ae,-1),Oe=he[Es({current:he.map(Ae=>Ae!=null?c.current[Ae]:null)},{event:C,orientation:S,loopFocus:p,rtl:b,cols:M,disabledIndices:Ts([...(typeof v!="function"?v:null)||c.current.map((Ae,De)=>Ft(c,De,v)?De:void 0),void 0],he),minIndex:de,maxIndex:be,prevIndex:Cs(I.current>ae?L:I.current,ue,he,M,C.key===Ht?"bl":C.key===(b?at:ut)?"tr":"tl"),stopEvent:!0})];if(Oe!=null&&(I.current=Oe,_(C)),S==="both")return}if(Kt(C.key,S)){if(ke(C),r&&!R&&ht(C.currentTarget.ownerDocument)===C.currentTarget){I.current=Sn(C.key,S,b)?L:ae,_(C);return}Sn(C.key,S,b)?p?W>=ae?g&&W!==c.current.length?I.current=-1:(ne.current=!1,I.current=L):I.current=Pe(c,{startingIndex:W,disabledIndices:v}):I.current=Math.min(ae,Pe(c,{startingIndex:W,disabledIndices:v})):p?W<=L?g&&W!==-1?I.current=c.current.length:(ne.current=!1,I.current=ae):I.current=Pe(c,{startingIndex:W,decrement:!0,disabledIndices:v}):I.current=Math.max(L,Pe(c,{startingIndex:W,decrement:!0,disabledIndices:v})),Vt(c,I.current)&&(I.current=-1),_(C)}}),j=u.useMemo(()=>R&&r&&le&&{"aria-activedescendant":`${G}-${d}`},[R,r,le,G,d]),K=u.useMemo(()=>({"aria-orientation":S==="both"?void 0:S,...E?{}:j,onKeyDown(C){if(C.key==="Tab"&&C.shiftKey&&r&&!R){const W=Qe(C.nativeEvent);if(W&&!Re(P.current,W))return;ke(C),n.setOpen(!1,Se(_n,C.nativeEvent)),Ne(s)&&s.focus();return}Y(C)},onPointerMove(){ye.current=!0}}),[j,Y,P,S,E,n,r,R,s]),$=u.useMemo(()=>{function C(L){h==="auto"&&Zr(L.nativeEvent)&&(V.current=!R)}function W(L){V.current=h,h==="auto"&&eo(L.nativeEvent)&&(V.current=!0)}return{onKeyDown(L){const ae=n.select("open");ye.current=!1;const ue=L.key.startsWith("Arrow"),he=sc(L.key,k(),b),de=Kt(L.key,S),be=(m?he:de)||L.key==="Enter"||L.key.trim()==="";if(R&&ae)return Y(L);if(!(!ae&&!y&&ue)){if(be){const Oe=Kt(L.key,k());B.current=m&&Oe?null:L.key}if(m){he&&(ke(L),ae?(I.current=mn(c,ve.current),_(L)):n.setOpen(!0,Se(pn,L.nativeEvent,L.currentTarget)));return}de&&(w.current!=null&&(I.current=w.current),ke(L),!ae&&y?n.setOpen(!0,Se(pn,L.nativeEvent,L.currentTarget)):Y(L),ae&&_(L))}},onFocus(L){n.select("open")&&!R&&(I.current=-1,_(L))},onPointerDown:W,onPointerEnter:W,onMouseDown:C,onClick:C}},[Y,ve,h,c,m,_,n,y,S,k,b,w,R]),H=u.useMemo(()=>({...j,...$}),[j,$]);return u.useMemo(()=>a?{reference:H,floating:K,item:T,trigger:$}:{},[a,H,K,$,T])}function lc(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.context.dataRef,{listRef:s,activeIndex:i,onMatch:c,onTypingChange:d,enabled:l=!0,findMatch:a=null,resetMs:f=750,ignoreKeys:g=In,selectedIndex:p=null}=t,m=Ge(),b=u.useRef(""),R=u.useRef(p??i??-1),h=u.useRef(null);J(()=>{r&&(m.clear(),h.current=null,b.current="")},[r,m]),J(()=>{r&&b.current===""&&(R.current=p??i??-1)},[r,p,i]);const x=re(O=>{O?o.current.typing||(o.current.typing=O,d?.(O)):o.current.typing&&(o.current.typing=O,d?.(O))}),y=re(O=>{function M(Q,U,X){const P=a?a(U,X):U.find(F=>F?.toLocaleLowerCase().indexOf(X.toLocaleLowerCase())===0);return P?Q.indexOf(P):-1}const A=s.current;if(b.current.length>0&&b.current[0]!==" "&&(M(A,A,b.current)===-1?x(!1):O.key===" "&&ke(O)),A==null||g.includes(O.key)||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;r&&O.key!==" "&&(ke(O),x(!0)),A.every(Q=>Q?Q[0]?.toLocaleLowerCase()!==Q[1]?.toLocaleLowerCase():!0)&&b.current===O.key&&(b.current="",R.current=h.current),b.current+=O.key,m.start(f,()=>{b.current="",R.current=h.current,x(!1)});const Z=R.current,G=M(A,[...A.slice((Z||0)+1),...A.slice(0,(Z||0)+1)],b.current);G!==-1?(c?.(G),h.current=G):O.key!==" "&&(b.current="",x(!1))}),v=u.useMemo(()=>({onKeyDown:y}),[y]),S=u.useMemo(()=>({onKeyDown:y,onKeyUp(O){O.key===" "&&x(!1)}}),[y,x]);return u.useMemo(()=>l?{reference:v,floating:S}:{},[l,v,S])}const ac=u.createContext(void 0);function uc(){return u.useContext(ac)?.direction??"ltr"}const fc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:d}=t,{element:l,padding:a=0,offsetParent:f="real"}=st(e,t)||{};if(l==null)return{};const g=no(a),p={x:n,y:r},m=qn(o),b=Kn(m),R=await i.getDimensions(l),h=m==="y",x=h?"top":"left",y=h?"bottom":"right",v=h?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[m]-p[m]-s.floating[b],O=p[m]-s.reference[m],M=f==="real"?await i.getOffsetParent?.(l):c.floating;let A=c.floating[v]||s.floating[b];(!A||!await i.isElement?.(M))&&(A=c.floating[v]||s.floating[b]);const z=S/2-O/2,Z=A/2-R[b]/2-1,G=Math.min(g[x],Z),Q=Math.min(g[y],Z),U=G,X=A-R[b]-Q,P=A/2-R[b]/2+z,F=Pn(U,P,X),te=!d.arrow&&ft(o)!=null&&P!==F&&s.reference[b]/2-(P<U?G:Q)-R[b]/2<0,E=te?P<U?P-U:P-X:0;return{[m]:p[m]+E,data:{[m]:F,centerOffset:P-F-E,...te&&{alignmentOffset:E}},reset:te}}}),dc=(e,t)=>({...fc(e),options:[e,t]}),pc={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await Si().fn(e)).data?.referenceHidden||s}}}},Qt={sideX:"left",sideY:"top"},Ol={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:c}=e,d=We(o),l=d.getComputedStyle(o);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Qt};const f=await s.getOffsetParent?.(o);let g={width:0,height:0};if(i==="fixed"&&d?.visualViewport)g={width:d.visualViewport.width,height:d.visualViewport.height};else if(f===d){const x=nt(o);g={width:x.documentElement.clientWidth,height:x.documentElement.clientHeight}}else await s.isElement?.(f)&&(g=await s.getDimensions(f));const p=Be(c);let m=t,b=n;p==="left"&&(m=g.width-(t+r.width)),p==="top"&&(b=g.height-(n+r.height));const R=p==="left"?"right":Qt.sideX,h=p==="top"?"bottom":Qt.sideY;return{x:m,y:b,data:{sideX:R,sideY:h}}}};function Ro(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Ar(e,t,n){const{rects:r,placement:o}=e;return{side:Ro(t,Be(o),n),align:ft(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function hc(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:d=5,sticky:l=!1,arrowPadding:a=5,disableAnchorTracking:f=!1,keepMounted:g=!1,floatingRootContext:p,mounted:m,collisionAvoidance:b,shiftCrossAxis:R=!1,nodeId:h,adaptiveOrigin:x,lazyFlip:y=!1,externalTree:v}=e,[S,O]=u.useState(null);!m&&S!==null&&O(null);const M=b.side||"flip",A=b.align||"flip",z=b.fallbackAxisSide||"end",Z=typeof t=="function"?t:void 0,G=re(Z),Q=Z?G:t,U=Le(t),P=uc()==="rtl",F=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[r],te=s==="center"?F:`${F}-${s}`;let E=d;const V=1,I=r==="bottom"?V:0,B=r==="top"?V:0,ye=r==="right"?V:0,_=r==="left"?V:0;typeof E=="number"?E={top:E+I,right:E+_,bottom:E+B,left:E+ye}:E&&(E={top:(E.top||0)+I,right:(E.right||0)+_,bottom:(E.bottom||0)+B,left:(E.left||0)+ye});const me={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:E},se=u.useRef(null),q=Le(o),ne=Le(i),ee=[xi(we=>{const Me=Ar(we,r,P),Te=typeof q.current=="function"?q.current(Me):q.current,Ie=typeof ne.current=="function"?ne.current(Me):ne.current;return{mainAxis:Te,crossAxis:Ie,alignmentAxis:Ie}},[typeof o!="function"?o:0,typeof i!="function"?i:0,P,r])],pe=A==="none"&&M!=="shift",w=!pe&&(l||R||M==="shift"),N=M==="none"?null:vi({...me,padding:{top:E.top+V,right:E.right+V,bottom:E.bottom+V,left:E.left+V},mainAxis:!R&&M==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),D=pe?null:wi(we=>{const Me=nt(we.elements.floating).documentElement;return{...me,rootBoundary:R?{x:0,y:0,width:Me.clientWidth,height:Me.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:w,limiter:l||R?void 0:Ri(Te=>{if(!se.current)return{};const{width:Ie,height:Ue}=se.current.getBoundingClientRect(),je=Xe(Be(Te.placement)),rt=je==="y"?Ie:Ue,ot=je==="y"?E.left+E.right:E.top+E.bottom;return{offset:rt/2+ot/2}})}},[me,l,R,E,A]);M==="shift"||A==="shift"||s==="center"?ee.push(D,N):ee.push(N,D),ee.push(Ei({...me,apply({elements:{floating:we},rects:{reference:Me},availableWidth:Te,availableHeight:Ie}){Object.entries({"--available-width":`${Te}px`,"--available-height":`${Ie}px`,"--anchor-width":`${Me.width}px`,"--anchor-height":`${Me.height}px`}).forEach(([Ue,je])=>{we.style.setProperty(Ue,je)})}}),dc(()=>({element:se.current||document.createElement("div"),padding:a,offsetParent:"floating"}),[a]),{name:"transformOrigin",fn(we){const{elements:Me,middlewareData:Te,placement:Ie,rects:Ue,y:je}=we,rt=Be(Ie),ot=Xe(rt),dt=se.current,xt=Te.arrow?.x||0,kt=Te.arrow?.y||0,Lt=dt?.clientWidth||0,ie=dt?.clientHeight||0,xe=xt+Lt/2,Ve=kt+ie/2,He=Math.abs(Te.shift?.y||0),Fe=Ue.reference.height/2,et=typeof o=="function"?o(Ar(we,r,P)):o,er=He>et,$o={top:`${xe}px calc(100% + ${et}px)`,bottom:`${xe}px ${-et}px`,left:`calc(100% + ${et}px) ${Ve}px`,right:`${-et}px ${Ve}px`}[rt],Uo=`${xe}px ${Ue.reference.y+Fe-je}px`;return Me.floating.style.setProperty("--transform-origin",w&&ot==="y"&&er?Uo:$o),{}}},pc,x),J(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);const le=u.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:T,elements:k,x:Y,y:j,middlewareData:K,update:$,placement:H,context:C,isPositioned:W,floatingStyles:L}=nc({rootContext:p,placement:te,middleware:ee,strategy:n,whileElementsMounted:g?void 0:(...we)=>wr(...we,le),nodeId:h,externalTree:v}),{sideX:ae,sideY:ue}=K.adaptiveOrigin||Qt,he=W?n:"fixed",de=u.useMemo(()=>x?{position:he,[ae]:Y,[ue]:j}:{position:he,...L},[x,he,ae,Y,ue,j,L]),be=u.useRef(null);J(()=>{if(!m)return;const we=U.current,Me=typeof we=="function"?we():we,Ie=(Ir(Me)?Me.current:Me)||null||null;Ie!==be.current&&(T.setPositionReference(Ie),be.current=Ie)},[m,T,Q,U]),u.useEffect(()=>{if(!m)return;const we=U.current;typeof we!="function"&&Ir(we)&&we.current!==be.current&&(T.setPositionReference(we.current),be.current=we.current)},[m,T,Q,U]),u.useEffect(()=>{if(g&&m&&k.domReference&&k.floating)return wr(k.domReference,k.floating,$,le)},[g,m,k,$,le]);const Oe=Be(H),Ae=Ro(r,Oe,P),De=ft(H)||"center",Ke=!!K.hide?.referenceHidden;J(()=>{y&&m&&W&&O(Oe)},[y,m,W,Oe]);const _e=u.useMemo(()=>({position:"absolute",top:K.arrow?.y,left:K.arrow?.x}),[K.arrow]),$e=K.arrow?.centerOffset!==0;return u.useMemo(()=>({positionerStyles:de,arrowStyles:_e,arrowRef:se,arrowUncentered:$e,side:Ae,align:De,physicalSide:Oe,anchorHidden:Ke,refs:T,context:C,isPositioned:W,update:$}),[de,_e,se,$e,Ae,De,Oe,Ke,T,C,W,$])}function Ir(e){return e!=null&&"current"in e}let Jn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=or.startingStyle]="startingStyle",e[e.endingStyle=or.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Ln=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const mc={[Ln.popupOpen]:""},gc={[Ln.popupOpen]:"",[Ln.pressed]:""},yc={[Jn.open]:""},bc={[Jn.closed]:""},xc={[Jn.anchorHidden]:""},Ml={open(e){return e?mc:null}},wc={open(e){return e?gc:null}},vo={open(e){return e?yc:bc},anchorHidden(e){return e?xc:null}};function Rc(e){return Nn(e,"base-ui")}const Eo="ArrowUp",So="ArrowDown",Co="ArrowLeft",To="ArrowRight",Oo="Home",Mo="End",vc=new Set([Co,To]),Ec=new Set([Eo,So]),Sc=new Set([...vc,...Ec]);[...Sc];const Cc=new Set([Eo,So,Co,To,Oo,Mo]),Tc=u.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r?.getBoundingClientRect();s=`polygon(
2
+ 0% 0%,
3
+ 100% 0%,
4
+ 100% 100%,
5
+ 0% 100%,
6
+ 0% 0%,
7
+ ${i.left}px ${i.top}px,
8
+ ${i.left}px ${i.bottom}px,
9
+ ${i.right}px ${i.bottom}px,
10
+ ${i.right}px ${i.top}px,
11
+ ${i.left}px ${i.top}px
12
+ )`}return Ce.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let Pr={},kr={},Lr="";function Oc(e){if(typeof document>"u")return!1;const t=nt(e);return We(t).innerWidth-t.documentElement.clientWidth>0}function Mc(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=nt(e).documentElement,o={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY};r.style.scrollbarGutter="stable",r.style.overflowY="scroll";const s=r.offsetWidth;r.style.overflowY="hidden";const i=r.offsetWidth;return Object.assign(r.style,o),s===i}function Ac(e){const t=nt(e),n=t.documentElement,r=t.body,o=Bt(n)?n:r,s=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=s}}function Ic(e){const t=nt(e),n=t.documentElement,r=t.body,o=We(n);let s=0,i=0,c=!1;const d=pt.create();if(Gr&&(o.visualViewport?.scale??1)!==1)return()=>{};function l(){const g=o.getComputedStyle(n),p=o.getComputedStyle(r),R=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Pr={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Lr=n.style.scrollBehavior,kr={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 h=n.scrollHeight>n.clientHeight,x=n.scrollWidth>n.clientWidth,y=g.overflowY==="scroll"||p.overflowY==="scroll",v=g.overflowX==="scroll"||p.overflowX==="scroll",S=Math.max(0,o.innerWidth-r.clientWidth),O=Math.max(0,o.innerHeight-r.clientHeight),M=parseFloat(p.marginTop)+parseFloat(p.marginBottom),A=parseFloat(p.marginLeft)+parseFloat(p.marginRight),z=Bt(n)?n:r;if(c=Mc(e),c){n.style.scrollbarGutter=R,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(h||y)&&(n.style.overflowY="scroll"),(x||v)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:M||O?`calc(100dvh - ${M+O}px)`:"100dvh",width:A||S?`calc(100vw - ${A+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function a(){Object.assign(n.style,Pr),Object.assign(r.style,kr),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Lr)}function f(){a(),d.request(l)}return l(),o.addEventListener("resize",f),()=>{d.cancel(),a(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class Pc{lockCount=0;restore=null;timeoutLock=An.create();timeoutUnlock=An.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=nt(t).documentElement,o=We(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Ye;return}const s=qr||!Oc(t);this.restore=s?Ac(t):Ic(t)}}const kc=new Pc;function Lc(e=!0,t=null){J(()=>{if(e)return kc.acquire(t)},[e,t])}function Dc(e){const t=u.useRef(""),n=u.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:u.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Vc(e){const[t,n]=u.useState(null),r=re((c,d)=>{e||n(d||(qr?"touch":""))}),o=u.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=Dc(r);return u.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:s,onPointerDown:i}}),[t,o,s,i])}function Fc(e){const t=u.useRef(!0);t.current&&(t.current=!1,e())}function Dr({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=u.useRef(e!==void 0),[s,i]=u.useState(t),c=o?e:s,d=u.useCallback(l=>{o||i(l)},[]);return[c,d]}const Ao=u.createContext(null),Io=u.createContext(null);function bt(){const e=u.useContext(Ao);if(e===null)throw new Error(Pt(60));return e}function Po(){const e=u.useContext(Io);if(e===null)throw new Error(Pt(61));return e}let Vr=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Nc={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Hc={valid(e){return e===null?null:e?{[Vr.valid]:""}:{[Vr.invalid]:""}}},Wc=u.createContext({invalid:void 0,name:void 0,validityData:{state:Nc,errors:[],error:"",value:"",initialValue:null},setValidityData:Ye,disabled:void 0,touched:!1,setTouched:Ye,dirty:!1,setDirty:Ye,filled:!1,setFilled:Ye,focused:!1,setFocused:Ye,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Nt)=>e,getInputValidationProps:(e=Nt)=>e,inputRef:{current:null},commit:async()=>{}}});function Qn(e=!0){const t=u.useContext(Wc);if(t.setValidityData===Ye&&!e)throw new Error(Pt(28));return t}const Bc=u.createContext({controlId:void 0,setControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:e=>e});function ko(){return u.useContext(Bc)}function Lo(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,setControlId:s}=ko(),i=Rc(t);return J(()=>{if(!(!n&&!t||s===Ye)){if(n){const c=r?.current;Ee(c)&&c.closest("label")!=null?s(t??null):s(o??i)}else t&&s(t);return()=>{t&&s(void 0)}}},[t,r,o,s,n,i]),o??i}const _c=(e,t)=>Object.is(e,t);function It(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Cn(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:It(r,t,n))}function Dn(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:It(r,t,n))}function $c(e,t,n){return e.filter(r=>!It(r,t,n))}function Vn(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Do(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Uc(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Do(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function jc(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Vn(e)}function wt(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Vn(e.value):Vn(e)}function Vo(e,t,n){function r(){return jc(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=Do(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=o.find(i=>i.value===e);return s&&s.label!=null?s.label:r()}if("value"in e){const s=o.find(i=>i&&i.value===e.value);if(s&&s.label!=null)return s.label}}return r()}function zc(e,t,n){return e.reduce((r,o,s)=>(s>0&&r.push(", "),r.push(Ce.jsx(u.Fragment,{children:Vo(o,t,n)},s)),r),[])}const oe={id:fe(e=>e.id),modal:fe(e=>e.modal),multiple:fe(e=>e.multiple),items:fe(e=>e.items),itemToStringLabel:fe(e=>e.itemToStringLabel),itemToStringValue:fe(e=>e.itemToStringValue),isItemEqualToValue:fe(e=>e.isItemEqualToValue),value:fe(e=>e.value),hasSelectedValue:fe(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:wt(t,r)!==""}),hasNullItemLabel:fe((e,t)=>t?Uc(e.items):!1),open:fe(e=>e.open),mounted:fe(e=>e.mounted),forceMount:fe(e=>e.forceMount),transitionStatus:fe(e=>e.transitionStatus),openMethod:fe(e=>e.openMethod),activeIndex:fe(e=>e.activeIndex),selectedIndex:fe(e=>e.selectedIndex),isActive:fe((e,t)=>e.activeIndex===t),isSelected:fe((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(s=>It(s,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:It(o,n,r)}),isSelectedByFocus:fe((e,t)=>e.selectedIndex===t),popupProps:fe(e=>e.popupProps),triggerProps:fe(e=>e.triggerProps),triggerElement:fe(e=>e.triggerElement),positionerElement:fe(e=>e.positionerElement),listElement:fe(e=>e.listElement),scrollUpArrowVisible:fe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:fe(e=>e.scrollDownArrowVisible),hasScrollArrows:fe(e=>e.hasScrollArrows)},Yc=u.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Fo(){return u.useContext(Yc)}function Kc(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function qc(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:s,commit:i}=e,{formRef:c}=Fo(),{invalid:d,markedDirtyRef:l,validityData:a,setValidityData:f}=Qn(),g=re(e.getValue);J(()=>{if(!t)return;let p=n;p===void 0&&(p=g()),a.initialValue===null&&p!==null&&f(m=>({...m,initialValue:p}))},[t,f,n,a.initialValue,g]),J(()=>{!t||!r||c.current.fields.set(r,{getValue:g,name:o,controlRef:s,validityData:Kc(a,d),validate(p=!0){let m=n;m===void 0&&(m=g()),l.current=!0,p?jn.flushSync(()=>i(m)):i(m)}})},[i,s,t,c,g,r,d,l,o,a,n]),J(()=>{const p=c.current.fields;return()=>{r&&p.delete(r)}},[c,r])}function Gc(e,t){const n=u.useRef(e),r=re(t);J(()=>{n.current!==e&&r(n.current)},[e,r]),J(()=>{n.current=e},[e])}function Al(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:c,name:d,disabled:l=!1,readOnly:a=!1,required:f=!1,modal:g=!0,actionsRef:p,inputRef:m,onOpenChangeComplete:b,items:R,multiple:h=!1,itemToStringLabel:x,itemToStringValue:y,isItemEqualToValue:v=_c,highlightItemOnHover:S=!0,children:O}=e,{clearErrors:M}=Fo(),{setDirty:A,setTouched:z,setFocused:Z,shouldValidateOnChange:G,validityData:Q,setFilled:U,name:X,disabled:P,validation:F,validationMode:te}=Qn(),E=Lo({id:t}),V=P||l,I=X??d,[B,ye]=Dr({controlled:n,default:h?r??In:r,name:"Select",state:"value"}),[_,me]=Dr({controlled:s,default:i,name:"Select",state:"open"}),se=u.useRef([]),q=u.useRef([]),ne=u.useRef(null),ge=u.useRef(null),ve=u.useRef(0),ee=u.useRef(null),pe=u.useRef([]),w=u.useRef(!1),N=u.useRef(!1),D=u.useRef(null),le=u.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),T=u.useRef(!1),{mounted:k,setMounted:Y,transitionStatus:j}=xo(_),{openMethod:K,triggerProps:$,reset:H}=Vc(_),C=Ot(()=>new Tt({id:E,modal:g,multiple:h,itemToStringLabel:x,itemToStringValue:y,isItemEqualToValue:v,value:B,open:_,mounted:k,transitionStatus:j,items:R,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,W=ce(C,oe.activeIndex),L=ce(C,oe.selectedIndex),ae=ce(C,oe.triggerElement),ue=ce(C,oe.positionerElement),he=u.useMemo(()=>h&&Array.isArray(B)&&B.length===0?"":wt(B,y),[h,B,y]),de=u.useMemo(()=>h&&Array.isArray(B)?B.map(ie=>wt(ie,y)):wt(B,y),[h,B,y]),be=Le(C.state.triggerElement);qc({id:E,commit:F.commit,value:B,controlRef:be,name:I,getValue:()=>de});const Oe=u.useRef(B);J(()=>{B!==Oe.current&&C.set("forceMount",!0)},[C,B]),J(()=>{U(h?Array.isArray(B)&&B.length>0:B!=null)},[h,B,U]),J(function(){if(_)return;const xe=pe.current;if(h){const He=Array.isArray(B)?B:[];if(He.length===0){C.set("selectedIndex",null);return}const Fe=He[He.length-1],et=Dn(xe,Fe,v);C.set("selectedIndex",et===-1?null:et);return}const Ve=Dn(xe,B,v);C.set("selectedIndex",Ve===-1?null:Ve)},[h,_,B,pe,v,C]),Gc(B,()=>{M(I),A(B!==Q.initialValue),G()?F.commit(B):F.commit(B,!0)});const Ae=re((ie,xe)=>{if(c?.(ie,xe),!xe.isCanceled&&(me(ie),!ie&&(xe.reason===_n||xe.reason===Bn)&&(z(!0),Z(!1),te==="onBlur"&&F.commit(B)),!ie&&C.state.activeIndex!==null)){const Ve=se.current[C.state.activeIndex];queueMicrotask(()=>{Ve?.setAttribute("tabindex","-1")})}}),De=re(()=>{Y(!1),C.set("activeIndex",null),H(),b?.(!1)});zn({enabled:!p,open:_,ref:ne,onComplete(){_||De()}}),u.useImperativeHandle(p,()=>({unmount:De}),[De]);const Ke=re((ie,xe)=>{o?.(ie,xe),!xe.isCanceled&&ye(ie)}),_e=re(()=>{const ie=C.state.listElement||ne.current;if(!ie)return;const xe=ie.scrollTop,Ve=ie.scrollTop+ie.clientHeight,He=xe>1,Fe=Ve<ie.scrollHeight-1;C.state.scrollUpArrowVisible!==He&&C.set("scrollUpArrowVisible",He),C.state.scrollDownArrowVisible!==Fe&&C.set("scrollDownArrowVisible",Fe)}),$e=wo({open:_,onOpenChange:Ae,elements:{reference:ae,floating:ue}}),we=Ns($e,{enabled:!a&&!V,event:"mousedown"}),Me=Oi($e,{bubbles:!1}),Te=cc($e,{enabled:!a&&!V,listRef:se,activeIndex:W,selectedIndex:L,disabledIndices:In,onNavigate(ie){ie===null&&!_||C.set("activeIndex",ie)},focusItemOnHover:!1}),Ie=lc($e,{enabled:!a&&!V&&(_||!h),listRef:q,activeIndex:W,selectedIndex:L,onMatch(ie){_?C.set("activeIndex",ie):Ke(pe.current[ie],Se("none"))},onTypingChange(ie){w.current=ie}}),{getReferenceProps:Ue,getFloatingProps:je,getItemProps:rt}=rc([we,Me,Te,Ie]),ot=u.useMemo(()=>Xr(Ue(),$,E?{id:E}:Nt),[Ue,$,E]);Fc(()=>{C.update({popupProps:je(),triggerProps:ot})}),J(()=>{C.update({id:E,modal:g,multiple:h,value:B,open:_,mounted:k,transitionStatus:j,popupProps:je(),triggerProps:ot,items:R,itemToStringLabel:x,itemToStringValue:y,isItemEqualToValue:v,openMethod:K})},[C,E,g,h,B,_,k,j,je,ot,R,x,y,v,K]);const dt=u.useMemo(()=>({store:C,name:I,required:f,disabled:V,readOnly:a,multiple:h,itemToStringLabel:x,itemToStringValue:y,highlightItemOnHover:S,setValue:Ke,setOpen:Ae,listRef:se,popupRef:ne,scrollHandlerRef:ge,handleScrollArrowVisibility:_e,scrollArrowsMountedCountRef:ve,getItemProps:rt,events:$e.context.events,valueRef:ee,valuesRef:pe,labelsRef:q,typingRef:w,selectionRef:le,selectedItemTextRef:D,validation:F,onOpenChangeComplete:b,keyboardActiveRef:N,alignItemWithTriggerActiveRef:T,initialValueRef:Oe}),[C,I,f,V,a,h,x,y,S,Ke,Ae,rt,$e.context.events,F,b,_e]),xt=Zt(m,F.inputRef),kt=h&&Array.isArray(B)&&B.length>0,Lt=u.useMemo(()=>!h||!Array.isArray(B)||!I?null:B.map(ie=>{const xe=wt(ie,y);return Ce.jsx("input",{type:"hidden",name:I,value:xe},xe)}),[h,B,I,y]);return Ce.jsx(Ao.Provider,{value:dt,children:Ce.jsxs(Io.Provider,{value:$e,children:[O,Ce.jsx("input",{...F.getInputValidationProps({onFocus(){C.state.triggerElement?.focus({focusVisible:!0})},onChange(ie){if(ie.nativeEvent.defaultPrevented)return;const xe=ie.target.value,Ve=Se(an,ie.nativeEvent);function He(){if(h)return;const Fe=pe.current.find(et=>wt(et,y).toLowerCase()===xe.toLowerCase());Fe!=null&&(A(Fe!==Q.initialValue),Ke(Fe,Ve),G()&&F.commit(Fe))}C.set("forceMount",!0),queueMicrotask(He)}}),name:h?void 0:I,value:he,disabled:V,required:f&&!kt,readOnly:a,ref:xt,style:I?os:$r,tabIndex:-1,"aria-hidden":!0}),Lt]})})}function Xc(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(r.width)||0,d=parseFloat(r.height)||0,l=Math.max(t.width,s,c),a=Math.max(t.height,i,d),f=l-t.width,g=a-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-g/2,bottom:t.bottom+g/2}}const qt=2,Jc=400,Fr=200,Qc={...wc,...Hc,value:()=>null},Il=u.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:c=!0,...d}=t,{setTouched:l,setFocused:a,validationMode:f,state:g,disabled:p}=Qn(),{labelId:m}=ko(),{store:b,setOpen:R,selectionRef:h,validation:x,readOnly:y,required:v,alignItemWithTriggerActiveRef:S,disabled:O,keyboardActiveRef:M}=bt(),A=p||O||i,z=ce(b,oe.open),Z=ce(b,oe.value),G=ce(b,oe.triggerProps),Q=ce(b,oe.positionerElement),U=ce(b,oe.listElement),X=ce(b,oe.id),P=ce(b,oe.hasSelectedValue),F=!P&&z,te=ce(b,oe.hasNullItemLabel,F),E=s??X;Lo({id:E});const V=Le(Q),I=u.useRef(null),{getButtonProps:B,buttonRef:ye}=Jr({disabled:A,native:c}),_=re(w=>{b.set("triggerElement",w)}),me=Zt(n,I,ye,_),se=Ge(),q=Ge(),ne=Ge(),ge=Ge();u.useEffect(()=>{if(z)return!(P||te)?ne.start(Jc,()=>{h.current.allowUnselectedMouseUp=!0,h.current.allowSelectedMouseUp=!0}):ge.start(Fr,()=>{h.current.allowUnselectedMouseUp=!0,ne.start(Fr,()=>{h.current.allowSelectedMouseUp=!0})}),()=>{ne.clear(),ge.clear()};h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},q.clear()},[z,P,te,h,q,ne,ge]);const ve=u.useMemo(()=>U?.id??en(Q)?.id,[U,Q]),ee=Xr(G,{id:E,role:"combobox","aria-expanded":z?"true":"false","aria-haspopup":"listbox","aria-controls":z?ve:void 0,"aria-labelledby":m,"aria-readonly":y||void 0,"aria-required":v||void 0,tabIndex:A?-1:0,ref:me,onFocus(w){a(!0),z&&S.current&&R(!1,Se(an,w.nativeEvent)),se.start(0,()=>{b.set("forceMount",!0)})},onBlur(w){Re(Q,w.relatedTarget)||(l(!0),a(!1),f==="onBlur"&&x.commit(Z))},onPointerMove(){M.current=!1},onKeyDown(){M.current=!0},onMouseDown(w){if(z)return;const N=nt(w.currentTarget);function D(le){if(!I.current)return;const T=le.target;if(Re(I.current,T)||Re(V.current,T)||T===I.current)return;const k=Xc(I.current);le.clientX>=k.left-qt&&le.clientX<=k.right+qt&&le.clientY>=k.top-qt&&le.clientY<=k.bottom+qt||R(!1,Se(ss,le))}q.start(0,()=>{N.addEventListener("mouseup",D,{once:!0})})}},x.getValidationProps,d,B);ee.role="combobox";const pe=u.useMemo(()=>({...g,open:z,disabled:A,value:Z,readOnly:y,placeholder:!P}),[g,z,A,Z,y,P]);return yt("button",t,{ref:[n,I],state:pe,stateAttributesMapping:Qc,props:ee})}),Zc={value:()=>null},Pl=u.forwardRef(function(t,n){const{className:r,render:o,children:s,placeholder:i,...c}=t,{store:d,valueRef:l}=bt(),a=ce(d,oe.value),f=ce(d,oe.items),g=ce(d,oe.itemToStringLabel),p=ce(d,oe.hasSelectedValue),m=!p&&i!=null&&s==null,b=ce(d,oe.hasNullItemLabel,m),R=u.useMemo(()=>({value:a,placeholder:!p}),[a,p]);let h=null;return typeof s=="function"?h=s(a):s!=null?h=s:!p&&i!=null&&!b?h=i:Array.isArray(a)?h=zc(a,f,g):h=Vo(a,f,g),yt("span",t,{state:R,ref:[n,l],props:[{children:h},c],stateAttributesMapping:Zc})}),el=u.createContext(void 0),kl=u.forwardRef(function(t,n){const{store:r}=bt(),o=ce(r,oe.mounted),s=ce(r,oe.forceMount);return o||s?Ce.jsx(el.Provider,{value:!0,children:Ce.jsx(is,{ref:n,...t})}):null}),No=u.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function tl(){return u.useContext(No)}function nl(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=re(o),i=u.useRef(0),c=Ot(ol).current,d=Ot(rl).current,[l,a]=u.useState(0),f=u.useRef(l),g=re((h,x)=>{d.set(h,x??null),f.current+=1,a(f.current)}),p=re(h=>{d.delete(h),f.current+=1,a(f.current)}),m=u.useMemo(()=>{const h=new Map;return Array.from(d.keys()).filter(y=>y.isConnected).sort(sl).forEach((y,v)=>{const S=d.get(y)??{};h.set(y,{...S,index:v})}),h},[d,l]);J(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const h=new MutationObserver(x=>{const y=new Set,v=S=>y.has(S)?y.delete(S):y.add(S);x.forEach(S=>{S.removedNodes.forEach(v),S.addedNodes.forEach(v)}),y.size===0&&(f.current+=1,a(f.current))});return m.forEach((x,y)=>{y.parentElement&&h.observe(y.parentElement,{childList:!0})}),()=>{h.disconnect()}},[m]),J(()=>{f.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),i.current=m.size),s(m)},[s,m,n,r,l]),J(()=>()=>{n.current=[]},[n]),J(()=>()=>{r&&(r.current=[])},[r]);const b=re(h=>(c.add(h),()=>{c.delete(h)}));J(()=>{c.forEach(h=>h(m))},[c,m]);const R=u.useMemo(()=>({register:g,unregister:p,subscribeMapChange:b,elementsRef:n,labelsRef:r,nextIndexRef:i}),[g,p,b,n,r,i]);return Ce.jsx(No.Provider,{value:R,children:t})}function rl(){return new Map}function ol(){return new Set}function sl(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ho=u.createContext(void 0);function il(){const e=u.useContext(Ho);if(!e)throw new Error(Pt(59));return e}function cn(e,t){e&&Object.assign(e.style,t)}const cl={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},ll={position:"fixed"},Ll=u.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:c="bottom",align:d="center",sideOffset:l=0,alignOffset:a=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:b,alignItemWithTrigger:R=!0,collisionAvoidance:h=cs,...x}=t,{store:y,listRef:v,labelsRef:S,alignItemWithTriggerActiveRef:O,selectedItemTextRef:M,valuesRef:A,initialValueRef:z,popupRef:Z,setValue:G}=bt(),Q=Po(),U=ce(y,oe.open),X=ce(y,oe.mounted),P=ce(y,oe.modal),F=ce(y,oe.value),te=ce(y,oe.openMethod),E=ce(y,oe.positionerElement),V=ce(y,oe.triggerElement),I=ce(y,oe.isItemEqualToValue),B=u.useRef(null),ye=u.useRef(null),[_,me]=u.useState(R),se=X&&_&&te!=="touch";!X&&_!==R&&me(R),J(()=>{X||(oe.scrollUpArrowVisible(y.state)&&y.set("scrollUpArrowVisible",!1),oe.scrollDownArrowVisible(y.state)&&y.set("scrollDownArrowVisible",!1))},[y,X]),u.useImperativeHandle(O,()=>se),Lc((se||P)&&U&&te!=="touch",V);const q=hc({anchor:r,floatingRootContext:Q,positionMethod:o,mounted:X,side:c,sideOffset:l,align:d,alignOffset:a,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:m,disableAnchorTracking:b??se,collisionAvoidance:h,keepMounted:!0}),ne=se?"none":q.side,ge=se?ll:q.positionerStyles,ve=u.useMemo(()=>{const T={};return U||(T.pointerEvents="none"),{role:"presentation",hidden:!X,style:{...ge,...T}}},[U,X,ge]),ee=u.useMemo(()=>({open:U,side:ne,align:q.align,anchorHidden:q.anchorHidden}),[U,ne,q.align,q.anchorHidden]),pe=re(T=>{y.set("positionerElement",T)}),w=yt("div",t,{ref:[n,pe],state:ee,stateAttributesMapping:vo,props:[ve,x]}),N=u.useRef(0),D=re(T=>{if(T.size===0&&N.current===0||A.current.length===0)return;const k=N.current;if(N.current=T.size,T.size===k)return;const Y=Se(an);if(k!==0&&!y.state.multiple&&F!==null&&Dn(A.current,F,I)===-1){const K=z.current,H=K!=null&&Cn(A.current,K,I)?K:null;G(H,Y),H===null&&(y.set("selectedIndex",null),M.current=null)}if(k!==0&&y.state.multiple&&Array.isArray(F)){const j=F.filter(K=>Cn(A.current,K,I));(j.length!==F.length||j.some(K=>!Cn(F,K,I)))&&(G(j,Y),j.length===0&&(y.set("selectedIndex",null),M.current=null))}if(U&&se){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const j={height:""};cn(E,j),cn(Z.current,j)}}),le=u.useMemo(()=>({...q,side:ne,alignItemWithTriggerActive:se,setControlledAlignItemWithTrigger:me,scrollUpArrowRef:B,scrollDownArrowRef:ye}),[q,ne,se,me]);return Ce.jsx(nl,{elementsRef:v,labelsRef:S,onMapChange:D,children:Ce.jsxs(Ho.Provider,{value:le,children:[X&&P&&Ce.jsx(Tc,{inert:ls(!U),cutout:V}),w]})})});function Wo(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Gt="base-ui-disable-scrollbar",Nr={className:Gt,getElement(e){return Ce.jsx("style",{nonce:e,href:Gt,precedence:"base-ui:low",children:`.${Gt}{scrollbar-width:none}.${Gt}::-webkit-scrollbar{display:none}`})}},al=u.createContext(void 0);function ul(e){return u.useContext(al)}function fl(e){return e==="starting"?as:Nt}function dl(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const pl=u.createContext(void 0),hl={disableStyleElements:!1};function ml(){return u.useContext(pl)??hl}const gl={...vo,...Qr},Dl=u.forwardRef(function(t,n){const{render:r,className:o,...s}=t,{store:i,popupRef:c,onOpenChangeComplete:d,setOpen:l,valueRef:a,selectedItemTextRef:f,keyboardActiveRef:g,multiple:p,handleScrollArrowVisibility:m,scrollHandlerRef:b,highlightItemOnHover:R}=bt(),{side:h,align:x,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:v,scrollDownArrowRef:S,scrollUpArrowRef:O}=il(),M=ul()!=null,A=Po(),{nonce:z,disableStyleElements:Z}=ml(),G=Ge(),Q=ce(i,oe.id),U=ce(i,oe.open),X=ce(i,oe.mounted),P=ce(i,oe.popupProps),F=ce(i,oe.transitionStatus),te=ce(i,oe.triggerElement),E=ce(i,oe.positionerElement),V=ce(i,oe.listElement),I=u.useRef(0),B=u.useRef(!1),ye=u.useRef(0),_=u.useRef(!1),me=u.useRef({}),se=Hn(),q=re(ee=>{if(!E||!c.current||!_.current)return;if(B.current||!y){m();return}const pe=E.style.top==="0px",w=E.style.bottom==="0px",N=E.getBoundingClientRect().height,D=nt(E),le=getComputedStyle(E),T=parseFloat(le.marginTop),k=parseFloat(le.marginBottom),Y=Hr(getComputedStyle(c.current)),j=D.documentElement.clientHeight-T-k,K=ee.scrollTop,$=ee.scrollHeight,H=ee.clientHeight,C=$-H;let W=0,L=null,ae=!1;if(pe){const ue=C-K,he=N+ue,de=Math.min(he,j);W=de,de!==j?L=C:ae=!0}else if(w){const ue=K-0,he=N+ue,de=Math.min(he,j),be=he-j;W=de,de!==j?L=0:(ae=!0,K<C&&(L=K-(ue-be)))}W!==0&&(E.style.height=`${W}px`),L!=null&&(ee.scrollTop=L),(ae||W>=Y)&&(B.current=!0),m()});u.useImperativeHandle(b,()=>q,[q]),zn({open:U,ref:c,onComplete(){U&&d?.(!0)}});const ne=u.useMemo(()=>({open:U,transitionStatus:F,side:h,align:x}),[U,F,h,x]);J(()=>{!E||!c.current||Object.keys(me.current).length||(me.current={top:E.style.top||"0",left:E.style.left||"0",right:E.style.right,height:E.style.height,bottom:E.style.bottom,minHeight:E.style.minHeight,maxHeight:E.style.maxHeight,marginTop:E.style.marginTop,marginBottom:E.style.marginBottom})},[c,E]),J(()=>{U||y||(_.current=!1,B.current=!1,I.current=0,ye.current=0,cn(E,me.current))},[U,y,E,c]),J(()=>{const ee=c.current;if(!(!U||!te||!E||!ee||i.state.transitionStatus==="ending")){if(!y){_.current=!0,se.request(m),ee.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const pe=bl(ee);ee.style.removeProperty("--transform-origin");try{const w=getComputedStyle(E),N=getComputedStyle(ee),D=nt(te),le=We(E),T=te.getBoundingClientRect(),k=E.getBoundingClientRect(),Y=T.left,j=T.height,K=V||ee,$=K.scrollHeight,H=parseFloat(N.borderBottomWidth),C=parseFloat(w.marginTop)||10,W=parseFloat(w.marginBottom)||10,L=parseFloat(w.minHeight)||100,ae=Hr(N),ue=5,he=5,de=20,be=D.documentElement.clientHeight-C-W,Oe=D.documentElement.clientWidth,Ae=be-T.bottom+j,De=f.current,Ke=a.current;let _e,$e=0,we=0;if(De&&Ke){const ie=Ke.getBoundingClientRect();_e=De.getBoundingClientRect();const xe=ie.left-Y,Ve=_e.left-k.left,He=ie.top-T.top+ie.height/2,Fe=_e.top-k.top+_e.height/2;$e=xe-Ve,we=Fe-He}const Me=Ae+we+W+H;let Te=Math.min(be,Me);const Ie=be-C-W,Ue=Me-Te,je=Math.max(ue,Y+$e),rt=Oe-he,ot=Math.max(0,je+k.width-rt);E.style.left=`${je-ot}px`,E.style.height=`${Te}px`,E.style.maxHeight="auto",E.style.marginTop=`${C}px`,E.style.marginBottom=`${W}px`,ee.style.height="100%";const dt=K.scrollHeight-K.clientHeight,xt=Ue>=dt;xt&&(Te=Math.min(be,k.height)-(Ue-dt));const kt=T.top<de||T.bottom>be-de||Te<Math.min($,L),Lt=(le.visualViewport?.scale??1)!==1&&Gr;if(kt||Lt){_.current=!0,cn(E,me.current),jn.flushSync(()=>v(!1));return}if(xt){const ie=Math.max(0,be-Me);E.style.top=k.height>=Ie?"0":`${ie}px`,E.style.height=`${Te}px`,K.scrollTop=K.scrollHeight-K.clientHeight,I.current=Math.max(L,Te)}else E.style.bottom="0",I.current=Math.max(L,Te),K.scrollTop=Ue;if(_e){const ie=k.top,xe=k.height,Ve=_e.top+_e.height/2,He=xe>0?(Ve-ie)/xe*100:50,Fe=dl(He,0,100);ee.style.setProperty("--transform-origin",`50% ${Fe}%`)}(I.current===be||Te>=ae)&&(B.current=!0),m(),setTimeout(()=>{_.current=!0})}finally{pe()}})}},[i,U,E,te,a,f,c,m,y,v,se,S,O,V]),u.useEffect(()=>{if(!y||!E||!U)return;const ee=We(E);function pe(w){l(!1,Se(us,w))}return ee.addEventListener("resize",pe),()=>{ee.removeEventListener("resize",pe)}},[l,y,E,U]);const ge={...V?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":p||void 0,id:`${Q}-list`},onKeyDown(ee){g.current=!0,M&&Cc.has(ee.key)&&ee.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(ee){if(!R||Wo(ee)||ee.pointerType==="touch")return;const pe=ee.currentTarget;G.start(0,()=>{i.set("activeIndex",null),pe.focus({preventScroll:!0})})},onScroll(ee){V||b.current?.(ee.currentTarget)},...y&&{style:V?{height:"100%"}:cl}},ve=yt("div",t,{ref:[n,c],state:ne,stateAttributesMapping:gl,props:[P,ge,fl(F),{className:!V&&y?Nr.className:void 0},s]});return Ce.jsxs(u.Fragment,{children:[!Z&&Nr.getElement(z),Ce.jsx(Fs,{context:A,modal:!1,disabled:!X,restoreFocus:!0,children:ve})]})});function Hr(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}const Wr={transform:"none",scale:"1",translate:"0 0"};function yl(e,t,n){n?e.setProperty(t,n):e.removeProperty(t)}function bl(e){const{style:t}=e,n={},r=Object.keys(Wr);for(const o of r)n[o]=t.getPropertyValue(o),t.setProperty(o,Wr[o]);return()=>{for(const o of r)yl(t,o,n[o])}}let Bo=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function xl(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:c,subscribeMapChange:d,elementsRef:l,labelsRef:a,nextIndexRef:f}=tl(),g=u.useRef(-1),[p,m]=u.useState(s??(o===Bo.GuessFromOrder?()=>{if(g.current===-1){const h=f.current;f.current+=1,g.current=h}return g.current}:-1)),b=u.useRef(null),R=u.useCallback(h=>{if(b.current=h,p!==-1&&h!==null&&(l.current[p]=h,a)){const x=t!==void 0;a.current[p]=x?t:r?.current?.textContent??h.textContent}},[p,l,a,t,r]);return J(()=>{if(s!=null)return;const h=b.current;if(h)return i(h,n),()=>{c(h)}},[s,i,c,n]),J(()=>{if(s==null)return d(h=>{const x=b.current?h.get(b.current)?.index:null;x!=null&&m(x)})},[s,d,m]),u.useMemo(()=>({ref:R,index:p}),[p,R])}const _o=u.createContext(void 0);function Zn(){const e=u.useContext(_o);if(!e)throw new Error(Pt(57));return e}const Vl=u.memo(u.forwardRef(function(t,n){const{render:r,className:o,value:s=null,label:i,disabled:c=!1,nativeButton:d=!1,...l}=t,a=u.useRef(null),f=xl({label:i,textRef:a,indexGuessBehavior:Bo.GuessFromOrder}),{store:g,getItemProps:p,setOpen:m,setValue:b,selectionRef:R,typingRef:h,valuesRef:x,keyboardActiveRef:y,multiple:v,highlightItemOnHover:S}=bt(),O=Ge(),M=ce(g,oe.isActive,f.index),A=ce(g,oe.isSelected,f.index,s),z=ce(g,oe.isSelectedByFocus,f.index),Z=ce(g,oe.isItemEqualToValue),G=f.index,Q=G!==-1,U=u.useRef(null),X=Le(G);J(()=>{if(!Q)return;const q=x.current;return q[G]=s,()=>{delete q[G]}},[Q,G,s,x]),J(()=>{if(!Q)return;const q=g.state.value;let ne=q;v&&Array.isArray(q)&&q.length>0&&(ne=q[q.length-1]),ne!==void 0&&It(ne,s,Z)&&g.set("selectedIndex",G)},[Q,G,v,Z,g,s]);const P=u.useMemo(()=>({disabled:c,selected:A,highlighted:M}),[c,A,M]),F=p({active:M,selected:A});F.onFocus=void 0,F.id=void 0;const te=u.useRef(null),E=u.useRef("mouse"),V=u.useRef(!1),{getButtonProps:I,buttonRef:B}=Jr({disabled:c,focusableWhenDisabled:!0,native:d});function ye(q){const ne=g.state.value;if(v){const ge=Array.isArray(ne)?ne:[],ve=A?$c(ge,s,Z):[...ge,s];b(ve,Se(hn,q))}else b(s,Se(hn,q)),m(!1,Se(hn,q))}const _={role:"option","aria-selected":A,tabIndex:M?0:-1,onFocus(){g.set("activeIndex",G)},onMouseEnter(){!y.current&&g.state.selectedIndex===null&&g.set("activeIndex",G)},onMouseMove(){S&&g.set("activeIndex",G)},onMouseLeave(q){!S||y.current||Wo(q)||O.start(0,()=>{g.state.activeIndex===G&&g.set("activeIndex",null)})},onTouchStart(){R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(q){te.current=q.key,g.set("activeIndex",G)},onClick(q){V.current=!1,!(q.type==="keydown"&&te.current===null)&&(c||te.current===" "&&h.current||E.current!=="touch"&&!M||(te.current=null,ye(q.nativeEvent)))},onPointerEnter(q){E.current=q.pointerType},onPointerDown(q){E.current=q.pointerType,V.current=!0},onMouseUp(q){if(c)return;if(V.current){V.current=!1;return}const ne=!R.current.allowSelectedMouseUp&&A,ge=!R.current.allowUnselectedMouseUp&&!A;ne||ge||E.current!=="touch"&&!M||ye(q.nativeEvent)}},me=yt("div",t,{ref:[B,n,f.ref,U],state:P,props:[F,_,l,I]}),se=u.useMemo(()=>({selected:A,indexRef:X,textRef:a,selectedByFocus:z,hasRegistered:Q}),[A,X,a,z,Q]);return Ce.jsx(_o.Provider,{value:se,children:me})})),Fl=u.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=Zn();return r||o?Ce.jsx(wl,{...t,ref:n}):null}),wl=u.memo(u.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...s}=e,{selected:i}=Zn(),c=u.useRef(null),{transitionStatus:d,setMounted:l}=xo(i),a=u.useMemo(()=>({selected:i,transitionStatus:d}),[i,d]),f=yt("span",e,{ref:[t,c],state:a,props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:Qr});return zn({open:i,ref:c,onComplete(){i||l(!1)}}),f})),Nl=u.memo(u.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:s,hasRegistered:i}=Zn(),{selectedItemTextRef:c}=bt(),{className:d,render:l,...a}=t,f=u.useCallback(p=>{if(!p||!i)return;const m=c.current===null||!c.current.isConnected;(s||m&&r.current===0)&&(c.current=p)},[c,r,s,i]);return yt("div",t,{ref:[f,n,o],props:a})}));export{Nr as $,Le as A,Et as B,vl as C,vo as D,Jn as E,ec as F,Cc as G,Fs as H,Tc as I,Vc as J,Oi as K,Lc as L,rc as M,Tl as N,Ns as O,tc as P,wc as Q,Qi as R,Al as S,Sl as T,hc as U,fl as V,Cl as W,Ol as X,ul as Y,il as Z,cl as _,bt as a,ce as b,Fo as c,Qn as d,ko as e,Hc as f,Dr as g,qc as h,Gc as i,xo as j,Il as k,Pl as l,El as m,kl as n,Ll as o,Dl as p,Vl as q,Nl as r,oe as s,Ml as t,Rc as u,Fl as v,ir as w,fe as x,un as y,_t as z};
@@ -0,0 +1 @@
1
+ import{c as N,r as c,b as E,f as M,I as f,j as e,o as O,x as h,p as n,q as R,D as T,K as G,N as U,O as P,Q as F,C as $,T as B,U as V,Z as H,V as W,W as Y,Y as K,_ as Z}from"./main-3gBEI6Jl.js";import{a as z,b as v,u as q,L as j}from"./use-limits-display-prefs-D1nT9-mr.js";import{u as J,I as Q}from"./useCurrency-Hhs5jbWw.js";import{S as L}from"./Select-DPE53NmM.js";import{S as y,a as x,b as w,u as C,T as X}from"./use-native-settings-Dh6NzqjY.js";import{D as ee}from"./download-CnzY_EgN.js";import"./SelectItemText-D69v77is.js";import"./Card-BbRYRVXf.js";const te=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],ae=N("grip-vertical",te);const ne=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],se=N("languages",ne),re=t=>!t.isLayoutDirty&&t.willUpdate(!1);function k(){const t=new Set,a=new WeakMap,r=()=>t.forEach(re);return{add:s=>{t.add(s),a.set(s,s.addEventListener("willUpdate",r))},remove:s=>{t.delete(s);const i=a.get(s);i&&(i(),a.delete(s)),r()},dirty:r}}const oe=c.createContext(null);function ie(){const t=c.useRef(!1);return E(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function le(){const t=ie(),[a,r]=c.useState(0),s=c.useCallback(()=>{t.current&&r(a+1)},[a]);return[c.useCallback(()=>M.postRender(s),[s]),a]}const S=t=>t===!0,ce=t=>S(t===!0)||t==="id",ue=({children:t,id:a,inherit:r=!0})=>{const s=c.useContext(f),i=c.useContext(oe),[u,d]=le(),g=c.useRef(null),l=s.id||i;g.current===null&&(ce(r)&&l&&(a=a?l+"-"+a:l),g.current={id:a,group:S(r)&&s.group||k()});const m=c.useMemo(()=>({...g.current,forceRender:u}),[d]);return e.jsx(f.Provider,{value:m,children:t})},de=new Set(["cursor","kiro","copilot","kimi"]);function ge({checked:t,onChange:a,ariaLabel:r}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":r,onClick:a,className:h("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:e.jsx("span",{className:h("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",t?"translate-x-[18px]":"translate-x-[3px]")})})}function pe({prefs:t}){const{order:a,visibility:r,toggle:s,moveToward:i}=t,[u,d]=c.useState(null),[g,l]=c.useState(null),m=o=>p=>{d(o),p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",o)},D=o=>p=>{p.preventDefault(),p.dataTransfer.dropEffect="move",u&&u!==o&&g!==o&&(l(o),i(u,o))},I=()=>{d(null),l(null)},_=o=>{o.preventDefault(),d(null),l(null)};return e.jsx(ue,{children:e.jsx("div",{className:"flex flex-col",children:a.map(o=>{const p=r[o]!==!1,b=u===o;return e.jsxs(O.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},draggable:!0,onDragStart:m(o),onDragOver:D(o),onDragEnd:I,onDrop:_,className:h("flex items-center gap-3 py-2 rounded-md","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60",b&&"opacity-40"),style:{cursor:b?"grabbing":"grab"},children:[e.jsx(ae,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),e.jsx("img",{src:z[o],alt:"",width:18,height:18,className:h("h-[18px] w-[18px] shrink-0 pointer-events-none",de.has(o)&&"dark:invert"),draggable:!1}),e.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200 select-none",children:v[o]}),e.jsx("div",{onMouseDown:A=>A.stopPropagation(),draggable:!1,children:e.jsx(ge,{checked:p,onChange:()=>s(o),ariaLabel:`${n("limits.settings.toggle_visible")}: ${v[o]}`})})]},o)})})})}function xe(){return[{value:"light",label:n("settings.appearance.theme.light"),Icon:G},{value:"dark",label:n("settings.appearance.theme.dark"),Icon:U},{value:"system",label:n("settings.appearance.theme.system"),Icon:P}]}function he(){return[{value:B,label:n("settings.appearance.language.system")},{value:V,label:n("settings.appearance.language.english")},{value:H,label:n("settings.appearance.language.chinese")},{value:W,label:n("settings.appearance.language.traditional_chinese")},{value:Y,label:n("settings.appearance.language.japanese")},{value:K,label:n("settings.appearance.language.korean")}]}function me(t){if(!t)return null;try{const a=new Date(t);return Number.isNaN(a.getTime())?null:a.toLocaleString()}catch{return null}}function ye(t,a){const r=n(`settings.appearance.currency.rate_source.${t}`),s=me(a),i=s?n("settings.appearance.currency.rate_updated",{when:s}):n("settings.appearance.currency.rate_never");return`${r} · ${i}`}function be({locale:t,setLocale:a}){const r=he();return e.jsx(L,{value:t,onValueChange:a,options:r,ariaLabel:n("settings.appearance.language.label"),className:"px-2.5 py-1.5 text-xs font-medium",leadingIcon:e.jsx(se,{className:"h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})})}function fe({currency:t,setCurrency:a}){const r=F().map(s=>({value:s.code,label:n(s.labelKey)}));return e.jsx(L,{value:t,onValueChange:a,options:r,ariaLabel:n("settings.appearance.currency.label"),className:"px-3 py-1.5 text-xs font-medium"})}function ve({currency:t,rate:a,rateSource:r,rateFetchedAt:s}){if(t===$)return e.jsx(e.Fragment,{children:n("settings.appearance.currency.hint")});const i=ye(r,s);return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:`1 USD = ${a.toFixed(4)} ${t}`}),e.jsx("span",{role:"img","aria-label":i,title:i,className:"inline-flex h-4 w-4 cursor-help items-center justify-center text-oai-gray-400 hover:text-oai-gray-600 dark:text-oai-gray-500 dark:hover:text-oai-gray-300",children:e.jsx(Q,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function je(){const{theme:t,setTheme:a}=R(),{locale:r,setLocale:s}=T(),{currency:i,rate:u,rateSource:d,rateFetchedAt:g,setCurrency:l}=J();return e.jsxs(y,{title:n("settings.section.appearance"),children:[e.jsx(x,{label:n("settings.appearance.theme.label"),hint:n("settings.appearance.theme.hint"),control:e.jsx(w,{options:xe(),value:t,onChange:a})}),e.jsx(x,{label:n("settings.appearance.language.label"),hint:n("settings.appearance.language.hint"),control:e.jsx(be,{locale:r,setLocale:s})}),e.jsx(x,{label:n("settings.appearance.currency.label"),hint:e.jsx(ve,{currency:i,rate:u,rateSource:d,rateFetchedAt:g}),control:e.jsx(fe,{currency:i,setCurrency:l})})]})}function ke(){const{available:t,settings:a,setSetting:r,runAction:s}=C();if(!t)return null;const i=!!a?.launchAtLogin,u=a?.launchAtLoginSupported!==!1,d=a?.updateStatus||null,g=!!a?.updateBusy,l=!!a?.isSyncing;return e.jsxs(y,{title:n("settings.section.menubar"),children:[u?e.jsx(x,{label:n("settings.menubar.launchAtLogin"),hint:n("settings.menubar.launchAtLoginHint"),control:e.jsx(X,{checked:i,onChange:()=>r("launchAtLogin",!i),ariaLabel:n("settings.menubar.launchAtLogin")})}):null,e.jsx(x,{label:n("settings.menubar.syncNow"),hint:n("settings.menubar.syncNowHint"),control:e.jsxs("button",{type:"button",onClick:()=>s("syncNow"),disabled:l,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[e.jsx(Z,{className:h("h-3.5 w-3.5",l&&"animate-spin"),"aria-hidden":!0}),l?n("settings.menubar.syncing"):n("settings.menubar.syncNow")]})}),e.jsx(x,{label:n("settings.menubar.updates"),hint:d||void 0,control:e.jsxs("button",{type:"button",onClick:()=>s("checkForUpdates"),disabled:g,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[e.jsx(ee,{className:"h-3.5 w-3.5","aria-hidden":!0}),n("settings.menubar.checkUpdates")]})})]})}function Ne(){const{available:t,settings:a,runAction:r}=C();return t&&a?.version?e.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-2 text-xs text-oai-gray-500 dark:text-oai-gray-500",children:[e.jsxs("span",{children:["TokenTrackerBar v",a.version]}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("button",{type:"button",onClick:()=>r("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"})]}):null}function Le({prefs:t}){return e.jsx(w,{options:[{value:j.USED,label:n("limits.settings.display_mode_used")},{value:j.REMAINING,label:n("limits.settings.display_mode_remaining")}],value:t.displayMode,onChange:t.setDisplayMode})}function Me(){const t=q();return e.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:e.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:e.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:n("settings.page.title")}),e.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:n("settings.page.subtitle")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(je,{}),e.jsx(ke,{}),e.jsx(y,{title:n("settings.section.limits"),action:e.jsx(Le,{prefs:t}),children:e.jsx(pe,{prefs:t})})]}),e.jsx(Ne,{})]})})})}export{Me as SettingsPage};