tokentracker-cli 0.26.7 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/{ActivityHeatmap-DCtix3Fg.js → ActivityHeatmap-BYuQI0bm.js} +1 -1
- package/dashboard/dist/assets/{Card-rmGtcsWP.js → Card-BTDfcH7p.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-CE6rXaDb.js → DashboardPage-Ds_V-g3A.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-C20ToZWK.js → DevicePage-B96d8GXq.js} +1 -1
- package/dashboard/dist/assets/{DialogTitle-DGydnL9k.js → DialogTitle-BDKufE4F.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-C37UQkCL.js → FadeIn-DBRLeqAL.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-91HwEGxF.js → HeaderGithubStar-CzfK6MUa.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-w_9rNG-h.js → IpCheckPage-CxlT_7w0.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-DgoBKDAF.js → LandingPage-Dh5rY91u.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-Dt6vB6xL.js → LeaderboardAvatar-CNK1X15U.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-7NZW_w9s.js → LeaderboardPage-Dy4R_tMf.js} +3 -3
- package/dashboard/dist/assets/LeaderboardProfileModal-BHAB1FTh.js +72 -0
- package/dashboard/dist/assets/{LeaderboardProfilePage-CPRBCIpv.js → LeaderboardProfilePage-DN0EkC7D.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-Owevo_3t.js → LimitsPage-dzZm6bWv.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-BucYk8jA.js → LocalOnlyNotice-DwHLwzQT.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-WfWomtGZ.js → LoginPage-Cn8u_hDg.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-BY_zkZxd.js → PopoverPopup-DDLlFwOU.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-DL1MI9yC.js → ProviderIcon-_gMDikn4.js} +1 -1
- package/dashboard/dist/assets/SettingsPage-CNXxY_vZ.js +1 -0
- package/dashboard/dist/assets/{SkillsPage-JcjtKJsW.js → SkillsPage-CisIA7Ae.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-De3IzSrW.js → WidgetsPage-Cht3wZ1K.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-N2OH7zP0.js → WrappedPage-CHdJ4WAz.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-BpkaVOUi.js → arrow-up-right-Ca6UkH9-.js} +1 -1
- package/dashboard/dist/assets/check-RuSQWKRD.js +1 -0
- package/dashboard/dist/assets/{chevron-down-CliOiFa9.js → chevron-down-B8adPDrY.js} +1 -1
- package/dashboard/dist/assets/{download-CNrfR68J.js → download-BRpX0naV.js} +1 -1
- package/dashboard/dist/assets/{info-Ca5iFYxD.js → info-D4jwUaj6.js} +1 -1
- package/dashboard/dist/assets/main-BN6SnbhW.css +1 -0
- package/dashboard/dist/assets/main-BxEGiBWd.js +850 -0
- package/dashboard/dist/assets/{use-limits-display-prefs-BZeGceRd.js → use-limits-display-prefs-CURfR0MZ.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-DII_ai46.js → use-native-settings-DGrotRHu.js} +1 -1
- package/dashboard/dist/assets/{use-reduced-motion-DpLyEiXC.js → use-reduced-motion-BAp2kV5y.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-C6DfageK.js → use-usage-limits-wJqPFTx6.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-LcLMm64X.js → useCurrency-D8u07QhU.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/LeaderboardProfileModal-Ch0SIvQ9.js +0 -32
- package/dashboard/dist/assets/SettingsPage-C2uIIIOc.js +0 -1
- package/dashboard/dist/assets/check-D-bd9C0B.js +0 -1
- package/dashboard/dist/assets/main-CmW2A4J4.css +0 -1
- package/dashboard/dist/assets/main-DI2Gl9e0.js +0 -845
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C as r,S as h,B as n,r as j,h as v,L as k,al as N}from"./main-
|
|
1
|
+
import{C as r,S as h,B as n,r as j,h as v,L as k,al as N}from"./main-BxEGiBWd.js";import{u as L}from"./use-usage-limits-wJqPFTx6.js";import{u as E}from"./use-limits-display-prefs-CURfR0MZ.js";import{C as g}from"./Card-BTDfcH7p.js";import{F as O}from"./FadeIn-DBRLeqAL.js";import{L as C}from"./LocalOnlyNotice-DwHLwzQT.js";import"./use-reduced-motion-BAp2kV5y.js";import"./arrow-up-right-Ca6UkH9-.js";import"./download-BRpX0naV.js";const P=[3,2,3,3,2,2,3];function m({className:s}){return r.jsx("div",{className:h("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",s)})}function T(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(m,{className:"h-3 w-12 shrink-0"}),r.jsx(m,{className:"flex-1 h-1.5 rounded-full min-w-0"}),r.jsx(m,{className:"h-3 w-[30px] shrink-0"}),r.jsx(m,{className:"h-3 w-6 shrink-0"})]})}function R({bars:s,index:e}){const i=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(m,{className:"h-[14px] w-[14px] rounded shrink-0"}),r.jsx(m,{className:h("h-4",i)})]}),Array.from({length:s},(l,a)=>r.jsx(T,{},a))]})}function S(){return r.jsx(g,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(m,{className:"h-3.5 w-28"}),P.map((s,e)=>r.jsx(R,{bars:s,index:e},e))]})})}function t(s){if(!s)return null;const e=typeof s=="number"?s*1e3:Date.parse(s);if(!Number.isFinite(e))return null;const i=e-Date.now();if(i<=0)return n("shared.time.now");const l=Math.floor(i/6e4);if(l<60)return`${l}m`;const a=Math.floor(l/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function I(s){return s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500"}function o({label:s,pct:e,reset:i}){const l=Math.max(0,Math.min(100,Number(e)||0)),a=Math.round(l),x=l>0&&a===0?Math.max(l,.35):l,u=l>0&&a===0?"<1":String(a);return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:s}),r.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:r.jsx("div",{className:`${I(a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${x}%`,minWidth:l>0?"3px":0}})}),r.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-[30px] text-right shrink-0",children:[u,"%"]}),i?r.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:i}):null]})}function d({name:s,icon:e,children:i}){const a=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"||e==="/brand-logos/kimi.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[e?r.jsx("img",{src:e,alt:"",className:a}):null,r.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:s})]}),i]})}const A=["claude","codex","cursor","gemini","kimi","kiro","copilot","antigravity"],M={claude:{name:"Claude",icon:"/brand-logos/claude-code.svg"},codex:{name:"Codex",icon:"/brand-logos/codex.svg"},cursor:{name:"Cursor",icon:"/brand-logos/cursor.svg"},gemini:{name:"Gemini",icon:"/brand-logos/gemini.svg"},kimi:{name:"Kimi",icon:"/brand-logos/kimi.svg"},kiro:{name:"Kiro",icon:"/brand-logos/kiro.svg"},copilot:{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg"},antigravity:{name:"Antigravity",icon:"/brand-logos/antigravity.svg"}};function c({children:s,tone:e="neutral"}){const i=e==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return r.jsx("div",{className:`text-[11px] leading-snug ${i}`,children:s})}function D(s,e){const i=M[s];if(!i)return null;if(!e?.configured)return r.jsx(d,{name:i.name,icon:i.icon,children:r.jsx(c,{children:n("limits.status.not_connected")})},s);if(e.error)return r.jsx(d,{name:i.name,icon:i.icon,children:r.jsx(c,{tone:"error",children:n("shared.error.prefix",{error:e.error})})},s);switch(s){case"claude":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.five_hour?r.jsx(o,{label:"5h",pct:e.five_hour.utilization,reset:t(e.five_hour.resets_at)}):null,e.seven_day?r.jsx(o,{label:"7d",pct:e.seven_day.utilization,reset:t(e.seven_day.resets_at)}):null,e.seven_day_opus?r.jsx(o,{label:"Opus",pct:e.seven_day_opus.utilization,reset:t(e.seven_day_opus.resets_at)}):null,!e.five_hour&&!e.seven_day&&!e.seven_day_opus?r.jsx(c,{children:n("limits.status.no_data")}):null]},"claude");case"codex":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"5h",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"7d",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"codex");case"cursor":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:n("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"cursor");case"gemini":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"Pro",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"Flash",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:"Lite",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"gemini");case"kimi":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.kimi_weekly"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.kimi_5h"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:n("limits.label.kimi_total"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,e.parallel_limit?r.jsx(c,{children:n("limits.label.kimi_parallel",{count:e.parallel_limit})}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"kimi");case"kiro":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"kiro");case"antigravity":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:"Claude",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:"G Pro",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(o,{label:"Flash",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?r.jsx(c,{children:n("limits.status.no_data")}):null]},"antigravity");case"copilot":return r.jsxs(d,{name:i.name,icon:i.icon,children:[e.primary_window?r.jsx(o,{label:n("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(o,{label:n("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,!e.primary_window&&!e.secondary_window?r.jsx(c,{children:n("limits.status.no_data")}):null,e.otel_has_files||e.otel_enabled?null:r.jsx(H,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function H({defaultDir:s}){const[e,i]=j.useState(!1),a=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${s||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
|
|
2
2
|
`),x=async()=>{try{await navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),1600)}catch{}};return r.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[r.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n("limits.copilot.otelHint.title")}),r.jsx("div",{className:"mt-0.5 leading-snug",children:n("limits.copilot.otelHint.body")}),r.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:a}),r.jsx("button",{type:"button",onClick:x,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?n("limits.copilot.otelHint.copied"):n("limits.copilot.otelHint.copy")})]})}function $({claude:s,codex:e,cursor:i,gemini:l,kimi:a,kiro:x,antigravity:u,copilot:b,order:p,visibility:_}){const f={claude:s,codex:e,cursor:i,gemini:l,kimi:a,kiro:x,antigravity:u,copilot:b},y=(Array.isArray(p)&&p.length>0?p:A).filter(w=>!_||_[w]!==!1).map(w=>D(w,f[w])).filter(Boolean);return r.jsx(O,{delay:.15,children:r.jsx(g,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:n("limits.panel.title")}),y.length>0?y:r.jsx(c,{children:n("limits.status.all_hidden")})]})})})}const B=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function J(){const{data:s,error:e,isLoading:i}=L({initialRefresh:!0}),l=E();return!B&&!v()?r.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:r.jsx(C,{})}):r.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:r.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:r.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[r.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:n("nav.limits")}),r.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:n("limits.page.subtitle")})]}),r.jsx(k,{to:"/settings","aria-label":n("limits.page.openSettings"),title:n("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:r.jsx(N,{className:"h-4 w-4","aria-hidden":!0})})]}),i?r.jsx(S,{}):r.jsxs(r.Fragment,{children:[e?r.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:n("shared.error.prefix",{error:e})}):null,r.jsx($,{claude:s?.claude,codex:s?.codex,cursor:s?.cursor,gemini:s?.gemini,kimi:s?.kimi,kiro:s?.kiro,antigravity:s?.antigravity,copilot:s?.copilot,order:l.order,visibility:l.visibility})]})]})})})}export{J as LimitsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,B as t}from"./main-
|
|
1
|
+
import{C as e,B as t}from"./main-BxEGiBWd.js";import{A as r}from"./arrow-up-right-Ca6UkH9-.js";import{D as o}from"./download-BRpX0naV.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 +1 @@
|
|
|
1
|
-
import{ac as Y,an as Z,U as ee,r,B as s,C as e,L as G,S as v}from"./main-
|
|
1
|
+
import{ac as Y,an as Z,U as ee,r,B as s,C as e,L as G,S as v}from"./main-BxEGiBWd.js";function te(n){const a=new URLSearchParams(n).get("next");return typeof a!="string"||a.length===0||!a.startsWith("/")||a.startsWith("//")?"/dashboard":a}const V={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function $(n){const a=String(n||"").trim();return V[a]?V[a]:a.replace(/-/g," ")}function ie(){const n=Y(),[a,C]=Z(),{enabled:o,loading:g,signedIn:f,refreshUser:A,signInWithPassword:E,signUp:M,signInWithOAuth:I,getPublicAuthConfig:F}=ee(),m=r.useMemo(()=>te(a.toString()),[a]),[l,j]=r.useState("signin"),[x,H]=r.useState(""),[h,Q]=r.useState(""),[N,X]=r.useState(""),[k,p]=r.useState(!1),[O,c]=r.useState(null),[U,b]=r.useState(null),[S,B]=r.useState(!0),[_,R]=r.useState([]),[P,T]=r.useState([]),[W,z]=r.useState(8);r.useEffect(()=>{const t=a.get("insforge_status"),i=a.get("insforge_type"),u=a.get("insforge_error");t==="success"&&i==="verify_email"?b(s("login.verify_email_success")):t==="error"&&i==="verify_email"&&u&&b(s("shared.error.prefix",{error:u}))},[a]),r.useEffect(()=>{if(!o){B(!1);return}let t=!0;return(async()=>{const{data:i,error:u}=await F();t&&(u||!i?(R(["google","github"]),T([])):(R(Array.isArray(i.oAuthProviders)?i.oAuthProviders:[]),T(Array.isArray(i.customOAuthProviders)?i.customOAuthProviders:[]),typeof i.passwordMinLength=="number"&&i.passwordMinLength>0&&z(i.passwordMinLength)),B(!1))})(),()=>{t=!1}},[o,F]);const d=r.useMemo(()=>a.get("native")==="1",[a]),y=r.useMemo(()=>a.get("provider")||null,[a]);r.useEffect(()=>{if(!(!o||g)&&f){if(d){window.location.href="/auth/native-callback";return}n(m,{replace:!0})}},[o,g,f,n,m,d]),r.useEffect(()=>{o&&A()},[o,A]);const q=r.useMemo(()=>typeof window>"u"||d?"":`${window.location.origin}/`,[d]),D=r.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),J=r.useCallback(async t=>{t.preventDefault(),c(null),p(!0);try{if(l==="signup"){const{data:u,error:L}=await M({email:x.trim(),password:h,name:N.trim()||void 0,redirectTo:D});if(L){c(L.message||String(L));return}if(u?.requireEmailVerification){b(s("login.verify_email_pending")),j("signin");return}n(m,{replace:!0});return}const{error:i}=await E({email:x.trim(),password:h});if(i){c(i.message||String(i));return}n(m,{replace:!0})}finally{p(!1)}},[l,x,h,N,M,E,n,m,D]),w=r.useCallback(async t=>{c(null),p(!0);try{const{error:i}=await I(t,q);i&&c(i.message||String(i))}finally{p(!1)}},[I,q]);r.useEffect(()=>{if(d&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[d]),r.useEffect(()=>{if(!o||g||f||S||!d||!y)return;[..._,...P].includes(y)&&w(y)},[o,g,f,S,d,y,_,P,w]);const K=r.useCallback(()=>{C(t=>{const i=new URLSearchParams(t);return i.delete("insforge_status"),i.delete("insforge_type"),i.delete("insforge_error"),i},{replace:!0}),b(null)},[C]);return o?e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:e.jsx(G,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:e.jsxs("div",{className:"w-full max-w-md space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:s("login.title")}),e.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:s("login.subtitle")})]}),U?e.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[e.jsx("span",{children:U}),e.jsx("button",{type:"button",onClick:K,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:s("login.dismiss")})]}):null,O?e.jsx("p",{className:"text-sm text-red-400",role:"alert",children:s("shared.error.prefix",{error:O})}):null,e.jsx("div",{className:"space-y-3",children:S?e.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):e.jsxs(e.Fragment,{children:[_.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t)),P.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t))]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:e.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:e.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:s("login.divider")})})]}),e.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signin"),c(null)},children:s("login.tab.sign_in")}),e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signup"),c(null)},children:s("login.tab.sign_up")})]}),e.jsxs("form",{onSubmit:J,className:"space-y-4",children:[l==="signup"?e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.name")}),e.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:N,onChange:t=>X(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:s("login.field.name_placeholder")})]}):null,e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.email")}),e.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:x,onChange:t=>H(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.password")}),e.jsx("input",{id:"login-password",type:"password",autoComplete:l==="signup"?"new-password":"current-password",required:!0,minLength:l==="signup"?W:void 0,value:h,onChange:t=>Q(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),l==="signup"?e.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:s("login.password_hint",{min:String(W)})}):null]}),e.jsx("button",{type:"submit",disabled:k||g,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:l==="signup"?s("login.submit.sign_up"):s("login.submit.sign_in")})]})]})})]}):e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:e.jsx(G,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:e.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:s("login.cloud_only")})})]})}export{ie as LoginPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as tn,r as x,aa as Me,C as X}from"./main-DI2Gl9e0.js";import{ai as Ce,aa as Hn,G as nt,aj as $n,c as G,ak as be,al as Vn,J as nn,am as ot,L as U,an as de,ab as pe,ao as $t,ap as fe,z as ge,aq as on,ar as at,as as Ie,at as We,au as Wn,av as sn,aw as _n,ax as lt,ay as ft,az as Ue,aA as Nn,n as ut,Q as rn,aB as jn,aC as cn,p as ce,o as dt,aD as Yn,aE as zn,r as q,aF as ee,w as _e,B as an,m as we,x as le,aG as ln,aH as Un,I as ke,V as Xn,aI as Vt,a1 as fn,aJ as Kn,aK as Gn,aL as qn,aM as Jn,aN as Qn,C as st,aO as Zn,aP as eo,M as se,aQ as to,P as no,aR as oo,aS as so,a6 as ro,aT as io,aU as co,T as ao,aV as lo,U as un,K as fo,aW as uo,a0 as go,a3 as po,a as gt,aX as mo,aY as Wt,aZ as ho,a_ as xo,a$ as yo,b0 as Ro,a4 as vo,b1 as bo,b2 as wo,b3 as Eo,a7 as Co,a8 as Oo,b4 as To,a9 as dn,S as So,ad as Po,af as Ao,ag as Mo}from"./DialogTitle-DGydnL9k.js";const Io=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],lr=tn("chevron-right",Io);const ko=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fr=tn("loader-circle",ko),Do=["top","right","bottom","left"],Oe=Math.min,Q=Math.max,Ne=Math.round,He=Math.floor,ae=e=>({x:e,y:e}),Lo={left:"right",right:"left",bottom:"top",top:"bottom"};function rt(e,t,n){return Q(e,Oe(t,n))}function ue(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function me(e){return e.split("-")[1]}function pt(e){return e==="x"?"y":"x"}function mt(e){return e==="y"?"height":"width"}function te(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ht(e){return pt(te(e))}function Fo(e,t,n){n===void 0&&(n=!1);const o=me(e),s=ht(e),r=mt(s);let i=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=je(i)),[i,je(i)]}function Bo(e){const t=je(e);return[it(e),t,it(t)]}function it(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _t=["left","right"],Nt=["right","left"],Ho=["top","bottom"],$o=["bottom","top"];function Vo(e,t,n){switch(e){case"top":case"bottom":return n?t?Nt:_t:t?_t:Nt;case"left":case"right":return t?Ho:$o;default:return[]}}function Wo(e,t,n,o){const s=me(e);let r=Vo(J(e),n==="start",o);return s&&(r=r.map(i=>i+"-"+s),t&&(r=r.concat(r.map(it)))),r}function je(e){const t=J(e);return Lo[t]+e.slice(t.length)}function _o(e){return{top:0,right:0,bottom:0,left:0,...e}}function gn(e){return typeof e!="number"?_o(e):{top:e,right:e,bottom:e,left:e}}function Ye(e){const{x:t,y:n,width:o,height:s}=e;return{width:o,height:s,top:n,left:t,right:t+o,bottom:n+s,x:t,y:n}}function Qe(e,t,n){if(n&&!Ce(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function No(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:s=!0,event:r="click",toggle:i=!0,ignoreMouse:l=!1,stickIfOpen:a=!0,touchOpenDelay:u=0}=t,c=x.useRef(void 0),f=Hn(),d=nt(),p=x.useMemo(()=>({onPointerDown(g){c.current=g.pointerType},onMouseDown(g){const m=c.current,b=g.nativeEvent,E=n.select("open");if(g.button!==0||r==="click"||Ce(m,!0)&&l)return;const R=o.current.openEvent,C=R?.type,h=n.select("domReferenceElement")!==g.currentTarget,O=E&&h||!(E&&i&&(!(R&&a)||C==="click"||C==="mousedown"));if(Vn(b.target)){const w=G(be,b,b.target);O&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,w)}):n.setOpen(O,w);return}const T=g.currentTarget;f.request(()=>{const w=G(be,b,T);O&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,w)}):n.setOpen(O,w)})},onClick(g){if(r==="mousedown-only")return;const m=c.current;if(r==="mousedown"&&m){c.current=void 0;return}if(Ce(m,!0)&&l)return;const b=n.select("open"),E=o.current.openEvent,R=n.select("domReferenceElement")!==g.currentTarget,C=b&&R||!(b&&i&&(!(E&&a)||$n(E))),h=G(be,g.nativeEvent,g.currentTarget);C&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,h)}):n.setOpen(C,h)},onKeyDown(){c.current=void 0}}),[o,r,l,n,a,i,f,d,u]);return x.useMemo(()=>s?{reference:p}:nn,[s,p])}function jt(e,t,n){let{reference:o,floating:s}=e;const r=te(t),i=ht(t),l=mt(i),a=J(t),u=r==="y",c=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,d=o[l]/2-s[l]/2;let p;switch(a){case"top":p={x:c,y:o.y-s.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-s.width,y:f};break;default:p={x:o.x,y:o.y}}switch(me(t)){case"start":p[i]-=d*(n&&u?-1:1);break;case"end":p[i]+=d*(n&&u?-1:1);break}return p}async function jo(e,t){var n;t===void 0&&(t={});const{x:o,y:s,platform:r,rects:i,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ue(t,e),g=gn(p),b=l[d?f==="floating"?"reference":"floating":f],E=Ye(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),R=f==="floating"?{x:o,y:s,width:i.floating.width,height:i.floating.height}:i.reference,C=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),h=await(r.isElement==null?void 0:r.isElement(C))?await(r.getScale==null?void 0:r.getScale(C))||{x:1,y:1}:{x:1,y:1},O=Ye(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:R,offsetParent:C,strategy:a}):R);return{top:(E.top-O.top+g.top)/h.y,bottom:(O.bottom-E.bottom+g.bottom)/h.y,left:(E.left-O.left+g.left)/h.x,right:(O.right-E.right+g.right)/h.x}}const Yo=50,zo=async(e,t,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:r=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:jo},a=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:f}=jt(u,o,a),d=o,p=0;const g={};for(let m=0;m<r.length;m++){const b=r[m];if(!b)continue;const{name:E,fn:R}=b,{x:C,y:h,data:O,reset:T}=await R({x:c,y:f,initialPlacement:o,placement:d,strategy:s,middlewareData:g,rects:u,platform:l,elements:{reference:e,floating:t}});c=C??c,f=h??f,g[E]={...g[E],...O},T&&p<Yo&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(u=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:c,y:f}=jt(u,d,a)),m=-1)}return{x:c,y:f,placement:d,strategy:s,middlewareData:g}},Uo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:s,middlewareData:r,rects:i,initialPlacement:l,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=ue(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const E=J(s),R=te(l),C=J(l)===l,h=await(a.isRTL==null?void 0:a.isRTL(u.floating)),O=d||(C||!m?[je(l)]:Bo(l)),T=g!=="none";!d&&T&&O.push(...Wo(l,m,g,h));const w=[l,...O],k=await a.detectOverflow(t,b),$=[];let A=((o=r.flip)==null?void 0:o.overflows)||[];if(c&&$.push(k[E]),f){const D=Fo(s,i,h);$.push(k[D[0]],k[D[1]])}if(A=[...A,{placement:s,overflows:$}],!$.every(D=>D<=0)){var L,S;const D=(((L=r.flip)==null?void 0:L.index)||0)+1,I=w[D];if(I&&(!(f==="alignment"?R!==te(I):!1)||A.every(v=>te(v.placement)===R?v.overflows[0]>0:!0)))return{data:{index:D,overflows:A},reset:{placement:I}};let F=(S=A.filter(M=>M.overflows[0]<=0).sort((M,v)=>M.overflows[1]-v.overflows[1])[0])==null?void 0:S.placement;if(!F)switch(p){case"bestFit":{var y;const M=(y=A.filter(v=>{if(T){const P=te(v.placement);return P===R||P==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(P=>P>0).reduce((P,N)=>P+N,0)]).sort((v,P)=>v[1]-P[1])[0])==null?void 0:y[0];M&&(F=M);break}case"initialPlacement":F=l;break}if(s!==F)return{reset:{placement:F}}}return{}}}};function Yt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return Do.some(t=>e[t]>=0)}const Xo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:s="referenceHidden",...r}=ue(e,t);switch(s){case"referenceHidden":{const i=await o.detectOverflow(t,{...r,elementContext:"reference"}),l=Yt(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:zt(l)}}}case"escaped":{const i=await o.detectOverflow(t,{...r,altBoundary:!0}),l=Yt(i,n.floating);return{data:{escapedOffsets:l,escaped:zt(l)}}}default:return{}}}}},pn=new Set(["left","top"]);async function Ko(e,t){const{placement:n,platform:o,elements:s}=e,r=await(o.isRTL==null?void 0:o.isRTL(s.floating)),i=J(n),l=me(n),a=te(n)==="y",u=pn.has(i)?-1:1,c=r&&a?-1:1,f=ue(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),a?{x:p*c,y:d*u}:{x:d*u,y:p*c}}const Go=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:s,y:r,placement:i,middlewareData:l}=t,a=await Ko(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:s+a.x,y:r+a.y,data:{...a,placement:i}}}}},qo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:s,platform:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:E=>{let{x:R,y:C}=E;return{x:R,y:C}}},...u}=ue(e,t),c={x:n,y:o},f=await r.detectOverflow(t,u),d=te(J(s)),p=pt(d);let g=c[p],m=c[d];if(i){const E=p==="y"?"top":"left",R=p==="y"?"bottom":"right",C=g+f[E],h=g-f[R];g=rt(C,g,h)}if(l){const E=d==="y"?"top":"left",R=d==="y"?"bottom":"right",C=m+f[E],h=m-f[R];m=rt(C,m,h)}const b=a.fn({...t,[p]:g,[d]:m});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[p]:i,[d]:l}}}}}},Jo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:s,rects:r,middlewareData:i}=t,{offset:l=0,mainAxis:a=!0,crossAxis:u=!0}=ue(e,t),c={x:n,y:o},f=te(s),d=pt(f);let p=c[d],g=c[f];const m=ue(l,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const C=d==="y"?"height":"width",h=r.reference[d]-r.floating[C]+b.mainAxis,O=r.reference[d]+r.reference[C]-b.mainAxis;p<h?p=h:p>O&&(p=O)}if(u){var E,R;const C=d==="y"?"width":"height",h=pn.has(J(s)),O=r.reference[f]-r.floating[C]+(h&&((E=i.offset)==null?void 0:E[f])||0)+(h?0:b.crossAxis),T=r.reference[f]+r.reference[C]+(h?0:((R=i.offset)==null?void 0:R[f])||0)-(h?b.crossAxis:0);g<O?g=O:g>T&&(g=T)}return{[d]:p,[f]:g}}}},Qo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:s,rects:r,platform:i,elements:l}=t,{apply:a=()=>{},...u}=ue(e,t),c=await i.detectOverflow(t,u),f=J(s),d=me(s),p=te(s)==="y",{width:g,height:m}=r.floating;let b,E;f==="top"||f==="bottom"?(b=f,E=d===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(E=f,b=d==="end"?"top":"bottom");const R=m-c.top-c.bottom,C=g-c.left-c.right,h=Oe(m-c[b],R),O=Oe(g-c[E],C),T=!t.middlewareData.shift;let w=h,k=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(w=R),T&&!d){const A=Q(c.left,0),L=Q(c.right,0),S=Q(c.top,0),y=Q(c.bottom,0);p?k=g-2*(A!==0||L!==0?A+L:Q(c.left,c.right)):w=m-2*(S!==0||y!==0?S+y:Q(c.top,c.bottom))}await a({...t,availableWidth:k,availableHeight:w});const $=await i.getDimensions(l.floating);return g!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}};function mn(e){const t=fe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const s=ge(e),r=s?e.offsetWidth:n,i=s?e.offsetHeight:o,l=Ne(n)!==r||Ne(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function xt(e){return U(e)?e:e.contextElement}function Ee(e){const t=xt(e);if(!ge(t))return ae(1);const n=t.getBoundingClientRect(),{width:o,height:s,$:r}=mn(t);let i=(r?Ne(n.width):n.width)/o,l=(r?Ne(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Zo=ae(0);function hn(e){const t=pe(e);return!on()||!t.visualViewport?Zo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function es(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pe(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),r=xt(e);let i=ae(1);t&&(o?U(o)&&(i=Ee(o)):i=Ee(e));const l=es(r,n,o)?hn(r):ae(0);let a=(s.left+l.x)/i.x,u=(s.top+l.y)/i.y,c=s.width/i.x,f=s.height/i.y;if(r){const d=pe(r),p=o&&U(o)?pe(o):o;let g=d,m=$t(g);for(;m&&o&&p!==g;){const b=Ee(m),E=m.getBoundingClientRect(),R=fe(m),C=E.left+(m.clientLeft+parseFloat(R.paddingLeft))*b.x,h=E.top+(m.clientTop+parseFloat(R.paddingTop))*b.y;a*=b.x,u*=b.y,c*=b.x,f*=b.y,a+=C,u+=h,g=pe(m),m=$t(g)}}return Ye({width:c,height:f,x:a,y:u})}function Xe(e,t){const n=Ue(e).scrollLeft;return t?t.left+n:he(de(e)).left+n}function xn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Xe(e,n),s=n.top+t.scrollTop;return{x:o,y:s}}function ts(e){let{elements:t,rect:n,offsetParent:o,strategy:s}=e;const r=s==="fixed",i=de(o),l=t?at(t.floating):!1;if(o===i||l&&r)return n;let a={scrollLeft:0,scrollTop:0},u=ae(1);const c=ae(0),f=ge(o);if((f||!f&&!r)&&((lt(o)!=="body"||ft(i))&&(a=Ue(o)),f)){const p=he(o);u=Ee(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop}const d=i&&!f&&!r?xn(i,a):ae(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-a.scrollTop*u.y+c.y+d.y}}function ns(e){return Array.from(e.getClientRects())}function os(e){const t=de(e),n=Ue(e),o=e.ownerDocument.body,s=Q(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Q(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Xe(e);const l=-n.scrollTop;return fe(o).direction==="rtl"&&(i+=Q(t.clientWidth,o.clientWidth)-s),{width:s,height:r,x:i,y:l}}const Ut=25;function ss(e,t){const n=pe(e),o=de(e),s=n.visualViewport;let r=o.clientWidth,i=o.clientHeight,l=0,a=0;if(s){r=s.width,i=s.height;const c=on();(!c||c&&t==="fixed")&&(l=s.offsetLeft,a=s.offsetTop)}const u=Xe(o);if(u<=0){const c=o.ownerDocument,f=c.body,d=getComputedStyle(f),p=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-p);g<=Ut&&(r-=g)}else u<=Ut&&(r+=u);return{width:r,height:i,x:l,y:a}}function rs(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,s=n.left+e.clientLeft,r=ge(e)?Ee(e):ae(1),i=e.clientWidth*r.x,l=e.clientHeight*r.y,a=s*r.x,u=o*r.y;return{width:i,height:l,x:a,y:u}}function Xt(e,t,n){let o;if(t==="viewport")o=ss(e,n);else if(t==="document")o=os(de(e));else if(U(t))o=rs(t,n);else{const s=hn(e);o={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ye(o)}function yn(e,t){const n=Ie(e);return n===t||!U(n)||We(n)?!1:fe(n).position==="fixed"||yn(n,t)}function is(e,t){const n=t.get(e);if(n)return n;let o=ot(e,[],!1).filter(l=>U(l)&<(l)!=="body"),s=null;const r=fe(e).position==="fixed";let i=r?Ie(e):e;for(;U(i)&&!We(i);){const l=fe(i),a=sn(i);!a&&l.position==="fixed"&&(s=null),(r?!a&&!s:!a&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||ft(i)&&!a&&yn(e,i))?o=o.filter(c=>c!==i):s=l,i=Ie(i)}return t.set(e,o),o}function cs(e){let{element:t,boundary:n,rootBoundary:o,strategy:s}=e;const i=[...n==="clippingAncestors"?at(t)?[]:is(t,this._c):[].concat(n),o],l=Xt(t,i[0],s);let a=l.top,u=l.right,c=l.bottom,f=l.left;for(let d=1;d<i.length;d++){const p=Xt(t,i[d],s);a=Q(p.top,a),u=Oe(p.right,u),c=Oe(p.bottom,c),f=Q(p.left,f)}return{width:u-f,height:c-a,x:f,y:a}}function as(e){const{width:t,height:n}=mn(e);return{width:t,height:n}}function ls(e,t,n){const o=ge(t),s=de(t),r=n==="fixed",i=he(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const a=ae(0);function u(){a.x=Xe(s)}if(o||!o&&!r)if((lt(t)!=="body"||ft(s))&&(l=Ue(t)),o){const p=he(t,!0,r,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else s&&u();r&&!o&&s&&u();const c=s&&!o&&!r?xn(s,l):ae(0),f=i.left+l.scrollLeft-a.x-c.x,d=i.top+l.scrollTop-a.y-c.y;return{x:f,y:d,width:i.width,height:i.height}}function Ze(e){return fe(e).position==="static"}function Kt(e,t){if(!ge(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return de(e)===n&&(n=n.ownerDocument.body),n}function Rn(e,t){const n=pe(e);if(at(e))return n;if(!ge(e)){let s=Ie(e);for(;s&&!We(s);){if(U(s)&&!Ze(s))return s;s=Ie(s)}return n}let o=Kt(e,t);for(;o&&Wn(o)&&Ze(o);)o=Kt(o,t);return o&&We(o)&&Ze(o)&&!sn(o)?n:o||_n(e)||n}const fs=async function(e){const t=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(e.floating);return{reference:ls(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function us(e){return fe(e).direction==="rtl"}const ds={convertOffsetParentRelativeRectToViewportRelativeRect:ts,getDocumentElement:de,getClippingRect:cs,getOffsetParent:Rn,getElementRects:fs,getClientRects:ns,getDimensions:as,getScale:Ee,isElement:U,isRTL:us};function vn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gs(e,t){let n=null,o;const s=de(e);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();const u=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=u;if(l||t(),!d||!p)return;const g=He(f),m=He(s.clientWidth-(c+d)),b=He(s.clientHeight-(f+p)),E=He(c),C={rootMargin:-g+"px "+-m+"px "+-b+"px "+-E+"px",threshold:Q(0,Oe(1,a))||1};let h=!0;function O(T){const w=T[0].intersectionRatio;if(w!==a){if(!h)return i();w?i(!1,w):o=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!vn(u,e.getBoundingClientRect())&&i(),h=!1}try{n=new IntersectionObserver(O,{...C,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,C)}n.observe(e)}return i(!0),r}function Gt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,u=xt(e),c=s||r?[...u?ot(u):[],...t?ot(t):[]]:[];c.forEach(E=>{s&&E.addEventListener("scroll",n,{passive:!0}),r&&E.addEventListener("resize",n)});const f=u&&l?gs(u,n):null;let d=-1,p=null;i&&(p=new ResizeObserver(E=>{let[R]=E;R&&R.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),u&&!a&&p.observe(u),t&&p.observe(t));let g,m=a?he(e):null;a&&b();function b(){const E=he(e);m&&!vn(m,E)&&n(),m=E,g=requestAnimationFrame(b)}return n(),()=>{var E;c.forEach(R=>{s&&R.removeEventListener("scroll",n),r&&R.removeEventListener("resize",n)}),f?.(),(E=p)==null||E.disconnect(),p=null,a&&cancelAnimationFrame(g)}}const ps=Go,ms=qo,hs=Uo,xs=Qo,ys=Xo,Rs=Jo,vs=(e,t,n)=>{const o=new Map,s={platform:ds,...n},r={...s.platform,_c:o};return zo(e,t,{...s,platform:r})};var bs=typeof document<"u",ws=function(){},$e=bs?x.useLayoutEffect:ws;function ze(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!ze(e[o],t[o]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,s[o]))return!1;for(o=n;o--!==0;){const r=s[o];if(!(r==="_owner"&&e.$$typeof)&&!ze(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function bn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qt(e,t){const n=bn(e);return Math.round(t*n)/n}function et(e){const t=x.useRef(e);return $e(()=>{t.current=e}),t}function Es(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:s,elements:{reference:r,floating:i}={},transform:l=!0,whileElementsMounted:a,open:u}=e,[c,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=x.useState(o);ze(d,o)||p(o);const[g,m]=x.useState(null),[b,E]=x.useState(null),R=x.useCallback(v=>{v!==T.current&&(T.current=v,m(v))},[]),C=x.useCallback(v=>{v!==w.current&&(w.current=v,E(v))},[]),h=r||g,O=i||b,T=x.useRef(null),w=x.useRef(null),k=x.useRef(c),$=a!=null,A=et(a),L=et(s),S=et(u),y=x.useCallback(()=>{if(!T.current||!w.current)return;const v={placement:t,strategy:n,middleware:d};L.current&&(v.platform=L.current),vs(T.current,w.current,v).then(P=>{const N={...P,isPositioned:S.current!==!1};D.current&&!ze(k.current,N)&&(k.current=N,Me.flushSync(()=>{f(N)}))})},[d,t,n,L,S]);$e(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(v=>({...v,isPositioned:!1})))},[u]);const D=x.useRef(!1);$e(()=>(D.current=!0,()=>{D.current=!1}),[]),$e(()=>{if(h&&(T.current=h),O&&(w.current=O),h&&O){if(A.current)return A.current(h,O,y);y()}},[h,O,y,A,$]);const I=x.useMemo(()=>({reference:T,floating:w,setReference:R,setFloating:C}),[R,C]),F=x.useMemo(()=>({reference:h,floating:O}),[h,O]),M=x.useMemo(()=>{const v={position:n,left:0,top:0};if(!F.floating)return v;const P=qt(F.floating,c.x),N=qt(F.floating,c.y);return l?{...v,transform:"translate("+P+"px, "+N+"px)",...bn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:N}},[n,l,F.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:y,refs:I,elements:F,floatingStyles:M}),[c,y,I,F,M])}const Cs=(e,t)=>{const n=ps(e);return{name:n.name,fn:n.fn,options:[e,t]}},Os=(e,t)=>{const n=ms(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ts=(e,t)=>({fn:Rs(e).fn,options:[e,t]}),Ss=(e,t)=>{const n=hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ps=(e,t)=>{const n=xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},As=(e,t)=>{const n=ys(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ms(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,s=Nn(),r=ut()!=null,i=rn(()=>new jn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new cn,floatingId:s,nested:r,noEmit:e.noEmit||!1})).current;return ce(()=>{const l={open:t,floatingId:s};o.reference!==void 0&&(l.referenceElement=o.reference,l.domReferenceElement=U(o.reference)?o.reference:null),o.floating!==void 0&&(l.floatingElement=o.floating),i.update(l)},[t,s,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=r,i.context.noEmit=e.noEmit||!1,i}function Is(e={}){const{nodeId:t,externalTree:n}=e,o=Ms(e),s=e.rootContext||o,r={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[i,l]=x.useState(null),a=x.useRef(null),u=dt(n);ce(()=>{r.domReference&&(a.current=r.domReference)},[r.domReference]);const c=Es({...e,elements:{...r,...i&&{reference:i}}}),f=x.useCallback(w=>{const k=U(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(k),c.refs.setReference(k)},[c.refs]),[d,p]=x.useState(null),[g,m]=x.useState(null);s.useSyncedValue("referenceElement",d),s.useSyncedValue("domReferenceElement",U(d)?d:null),s.useSyncedValue("floatingElement",g);const b=x.useCallback(w=>{(U(w)||w===null)&&(a.current=w,p(w)),(U(c.refs.reference.current)||c.refs.reference.current===null||w!==null&&!U(w))&&c.refs.setReference(w)},[c.refs,p]),E=x.useCallback(w=>{m(w),c.refs.setFloating(w)},[c.refs]),R=x.useMemo(()=>({...c.refs,setReference:b,setFloating:E,setPositionReference:f,domReference:a}),[c.refs,b,E,f]),C=x.useMemo(()=>({...c.elements,domReference:r.domReference}),[c.elements,r.domReference]),h=s.useState("open"),O=s.useState("floatingId"),T=x.useMemo(()=>({...c,dataRef:s.context.dataRef,open:h,onOpenChange:s.setOpen,events:s.context.events,floatingId:O,refs:R,elements:C,nodeId:t,rootStore:s}),[c,R,C,t,s,h,O]);return ce(()=>{s.context.dataRef.current.floatingContext=T;const w=u?.nodesRef.current.find(k=>k.id===t);w&&(w.context=T)}),x.useMemo(()=>({...c,context:T,refs:R,elements:C,rootStore:s}),[c,R,C,T,s])}const ct=Yn("safe-polygon"),ks=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zn}`;function Ds(e){return e?!!e.closest(ks):!1}function wn(e){const t=x.useRef(void 0),n=x.useRef(!1),o=x.useRef(void 0),s=x.useRef(!0),r=x.useRef(!1),i=x.useRef(()=>{}),l=x.useRef(!1),a=nt(),u=nt(),c=x.useRef(void 0);return x.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:s,performedPointerEventsMutationRef:r,unbindMouseMoveRef:i,restTimeoutPendingRef:l,openChangeTimeout:a,restTimeout:u,handleCloseOptionsRef:c}),f.hoverInteractionState},[e,t,n,o,s,r,i,l,a,u,c])}const Ls=new Set(["click","mousedown"]);function Fs(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),s=n.useState("floatingElement"),r=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:l=!0,closeDelay:a=0,externalTree:u}=t,{pointerTypeRef:c,interactedInsideRef:f,handlerRef:d,performedPointerEventsMutationRef:p,unbindMouseMoveRef:g,restTimeoutPendingRef:m,openChangeTimeout:b,handleCloseOptionsRef:E}=wn(n),R=dt(u),C=ut(),h=q(()=>f.current?!0:i.current.openEvent?Ls.has(i.current.openEvent.type):!1),O=q(()=>{const A=i.current.openEvent?.type;return A?.includes("mouse")&&A!=="mousedown"}),T=x.useCallback((A,L=!0)=>{const S=Bs(a,c.current);S&&!d.current?b.start(S,()=>n.setOpen(!1,G(ee,A))):L&&(b.clear(),n.setOpen(!1,G(ee,A)))},[a,d,n,c,b]),w=q(()=>{g.current(),d.current=void 0}),k=q(()=>{if(p.current){const A=_e(s).body;A.style.pointerEvents="",A.removeAttribute(ct),p.current=!1}}),$=q(A=>{const L=an(A);if(!Ds(L)){f.current=!1;return}f.current=!0});ce(()=>{o||(c.current=void 0,m.current=!1,f.current=!1,w(),k())},[o,c,m,f,w,k]),x.useEffect(()=>()=>{w()},[w]),x.useEffect(()=>k,[k]),ce(()=>{if(l&&o&&E.current?.blockPointerEvents&&O()&&U(r)&&s){p.current=!0;const A=_e(s).body;A.setAttribute(ct,"");const L=r,S=s,y=R?.nodesRef.current.find(D=>D.id===C)?.context?.elements.floating;return y&&(y.style.pointerEvents=""),A.style.pointerEvents="none",L.style.pointerEvents="auto",S.style.pointerEvents="auto",()=>{A.style.pointerEvents="",L.style.pointerEvents="",S.style.pointerEvents=""}}},[l,o,r,s,E,O,R,C,p]),x.useEffect(()=>{if(!l)return;function A(D){if(h()||!i.current.floatingContext||!n.select("open"))return;const I=n.context.triggerElements;D.relatedTarget&&I.hasElement(D.relatedTarget)||(k(),w(),h()||T(D))}function L(D){b.clear(),k(),d.current?.(D),w()}function S(D){h()||T(D,!1)}const y=s;return y&&(y.addEventListener("mouseleave",A),y.addEventListener("mouseenter",L),y.addEventListener("mouseleave",S),y.addEventListener("pointerdown",$,!0)),()=>{y&&(y.removeEventListener("mouseleave",A),y.removeEventListener("mouseenter",L),y.removeEventListener("mouseleave",S),y.removeEventListener("pointerdown",$,!0))}})}function Bs(e,t){return t&&!Ce(t)?0:typeof e=="function"?e():e}function tt(e){return typeof e=="function"?e():e}const Hs={current:null};function $s(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:s}=n.context,{enabled:r=!0,delay:i=0,handleClose:l=null,mouseOnly:a=!1,restMs:u=0,move:c=!0,triggerElementRef:f=Hs,externalTree:d,isActiveTrigger:p=!0}=t,g=dt(d),{pointerTypeRef:m,interactedInsideRef:b,handlerRef:E,blockMouseMoveRef:R,performedPointerEventsMutationRef:C,unbindMouseMoveRef:h,restTimeoutPendingRef:O,openChangeTimeout:T,restTimeout:w,handleCloseOptionsRef:k}=wn(n),$=we(l),A=we(i),L=we(u);p&&(k.current=$.current?.__options);const S=q(()=>b.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),y=x.useCallback((M,v=!0)=>{const P=Qe(A.current,"close",m.current);P&&!E.current?T.start(P,()=>n.setOpen(!1,G(ee,M))):v&&(T.clear(),n.setOpen(!1,G(ee,M)))},[A,E,n,m,T]),D=q(()=>{h.current(),E.current=void 0}),I=q(()=>{if(C.current){const M=_e(n.select("domReferenceElement")).body;M.style.pointerEvents="",M.removeAttribute(ct),C.current=!1}});x.useEffect(()=>{if(!r)return;function M(v){v.open||(T.clear(),w.clear(),R.current=!0,O.current=!1)}return s.on("openchange",M),()=>{s.off("openchange",M)}},[r,s,T,w,R,O]);const F=q(M=>{if(S()||!o.current.floatingContext)return;const v=n.context.triggerElements;if(M.relatedTarget&&v.hasElement(M.relatedTarget))return;const P=f.current;$.current?.({...o.current.floatingContext,tree:g,x:M.clientX,y:M.clientY,onClose(){I(),D(),!S()&&P===n.select("domReferenceElement")&&y(M)}})(M)});return x.useEffect(()=>{if(!r)return;const M=f.current??(p?n.select("domReferenceElement"):null);if(!U(M))return;function v(V){if(T.clear(),R.current=!1,a&&!Ce(m.current)||tt(L.current)>0&&!Qe(A.current,"open"))return;const W=Qe(A.current,"open",m.current),j=n.select("domReferenceElement"),B=n.context.triggerElements,Y=(B.hasElement(V.target)||B.hasMatchingElement(re=>le(re,V.target)))&&(!j||!le(j,V.target)),H=V.currentTarget??null,_=n.select("open"),ne=!_||Y;Y&&_?n.setOpen(!0,G(ee,V,H)):W?T.start(W,()=>{ne&&n.setOpen(!0,G(ee,V,H))}):ne&&n.setOpen(!0,G(ee,V,H))}function P(V){if(S()){I();return}h.current();const W=n.select("domReferenceElement"),j=_e(W);w.clear(),O.current=!1;const B=n.context.triggerElements;if(V.relatedTarget&&B.hasElement(V.relatedTarget))return;if($.current&&o.current.floatingContext){n.select("open")||T.clear();const H=f.current;E.current=$.current({...o.current.floatingContext,tree:g,x:V.clientX,y:V.clientY,onClose(){I(),D(),!S()&&H===n.select("domReferenceElement")&&y(V,!0)}});const _=E.current;_(V),j.addEventListener("mousemove",_),h.current=()=>{j.removeEventListener("mousemove",_)};return}(m.current!=="touch"||!le(n.select("floatingElement"),V.relatedTarget))&&y(V)}function N(V){F(V)}return n.select("open")&&M.addEventListener("mouseleave",N),c&&M.addEventListener("mousemove",v,{once:!0}),M.addEventListener("mouseenter",v),M.addEventListener("mouseleave",P),()=>{M.removeEventListener("mouseleave",N),c&&M.removeEventListener("mousemove",v),M.removeEventListener("mouseenter",v),M.removeEventListener("mouseleave",P)}},[D,I,R,o,A,y,n,r,$,F,p,S,a,c,m,L,w,O,T,f,g,h,E]),x.useMemo(()=>{function M(v){m.current=v.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(v){const{nativeEvent:P}=v,N=v.currentTarget,V=n.select("domReferenceElement"),W=n.context.triggerElements,j=n.select("open"),B=(W.hasElement(v.target)||W.hasMatchingElement(H=>le(H,v.target)))&&(!V||!le(V,v.target));if(a&&!Ce(m.current)||j&&!B||tt(L.current)===0||!B&&O.current&&v.movementX**2+v.movementY**2<2)return;w.clear();function Y(){if(O.current=!1,S())return;const H=n.select("open");!R.current&&(!H||B)&&n.setOpen(!0,G(ee,P,N))}m.current==="touch"?Me.flushSync(()=>{Y()}):B&&j?Y():(O.current=!0,w.start(tt(L.current),Y))}}},[R,S,a,n,m,L,w,O])}function Jt(e,t){const[n,o]=e;let s=!1;const r=t.length;for(let i=0,l=r-1;i<r;l=i++){const[a,u]=t[i]||[0,0],[c,f]=t[l]||[0,0];u>=o!=f>=o&&n<=(c-a)*(o-u)/(f-u)+a&&(s=!s)}return s}function Vs(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ws(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,s=new ln;let r=!1,i=null,l=null,a=typeof performance<"u"?performance.now():0;function u(f,d){const p=performance.now(),g=p-a;if(i===null||l===null||g===0)return i=f,l=d,a=p,null;const m=f-i,b=d-l,R=Math.sqrt(m*m+b*b)/g;return i=f,l=d,a=p,R}const c=({x:f,y:d,placement:p,elements:g,onClose:m,nodeId:b,tree:E})=>function(C){function h(){s.clear(),m()}if(s.clear(),!g.domReference||!g.floating||p==null||f==null||d==null)return;const{clientX:O,clientY:T}=C,w=[O,T],k=an(C),$=C.type==="mouseleave",A=le(g.floating,k),L=le(g.domReference,k),S=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),D=p.split("-")[0],I=f>y.right-y.width/2,F=d>y.bottom-y.height/2,M=Vs(w,S),v=y.width>S.width,P=y.height>S.height,N=(v?S:y).left,V=(v?S:y).right,W=(P?S:y).top,j=(P?S:y).bottom;if(A&&(r=!0,!$))return;if(L&&(r=!1),L&&!$){r=!0;return}if($&&U(C.relatedTarget)&&le(g.floating,C.relatedTarget)||E&&Un(E.nodesRef.current,b).some(({context:H})=>H?.open))return;if(D==="top"&&d>=S.bottom-1||D==="bottom"&&d<=S.top+1||D==="left"&&f>=S.right-1||D==="right"&&f<=S.left+1)return h();let B=[];switch(D){case"top":B=[[N,S.top+1],[N,y.bottom-1],[V,y.bottom-1],[V,S.top+1]];break;case"bottom":B=[[N,y.top+1],[N,S.bottom-1],[V,S.bottom-1],[V,y.top+1]];break;case"left":B=[[y.right-1,j],[y.right-1,W],[S.left+1,W],[S.left+1,j]];break;case"right":B=[[S.right-1,j],[S.right-1,W],[y.left+1,W],[y.left+1,j]];break}function Y([H,_]){switch(D){case"top":{const ne=[v?H+t/2:I?H+t*4:H-t*4,_+t+1],re=[v?H-t/2:I?H+t*4:H-t*4,_+t+1],oe=[[y.left,I||v?y.bottom-t:y.top],[y.right,I?v?y.bottom-t:y.top:y.bottom-t]];return[ne,re,...oe]}case"bottom":{const ne=[v?H+t/2:I?H+t*4:H-t*4,_-t],re=[v?H-t/2:I?H+t*4:H-t*4,_-t],oe=[[y.left,I||v?y.top+t:y.bottom],[y.right,I?v?y.top+t:y.bottom:y.top+t]];return[ne,re,...oe]}case"left":{const ne=[H+t+1,P?_+t/2:F?_+t*4:_-t*4],re=[H+t+1,P?_-t/2:F?_+t*4:_-t*4];return[...[[F||P?y.right-t:y.left,y.top],[F?P?y.right-t:y.left:y.right-t,y.bottom]],ne,re]}case"right":{const ne=[H-t,P?_+t/2:F?_+t*4:_-t*4],re=[H-t,P?_-t/2:F?_+t*4:_-t*4],oe=[[F||P?y.left+t:y.right,y.top],[F?P?y.left+t:y.right:y.left+t,y.bottom]];return[ne,re,...oe]}default:return[]}}if(!Jt([O,T],B)){if(r&&!M)return h();if(!$&&o){const H=u(C.clientX,C.clientY);if(H!==null&&H<.1)return h()}Jt([O,T],Y([f,d]))?!r&&o&&s.start(40,h):h()}};return c.__options={blockPointerEvents:n},c}const _s=x.createContext(void 0);function Ns(e=!1){const t=x.useContext(_s);if(t===void 0&&!e)throw new Error(ke(16));return t}function js(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:s=0,isNativeButton:r}=e,i=o&&t!==!1,l=o&&t===!1;return{props:x.useMemo(()=>{const u={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return o||(u.tabIndex=s,!r&&n&&(u.tabIndex=t?s:-1)),(r&&(t||i)||!r&&n)&&(u["aria-disabled"]=n),r&&(!t||l)&&(u.disabled=n),u},[o,n,t,i,l,r,s])}}function Ys(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:s=!0}=e,r=x.useRef(null),i=Ns(!0)!==void 0,l=q(()=>{const d=r.current;return!!(d?.tagName==="A"&&d?.href)}),{props:a}=js({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:s}),u=x.useCallback(()=>{const d=r.current;zs(d)&&i&&t&&a.disabled===void 0&&d.disabled&&(d.disabled=!1)},[t,a.disabled,i]);ce(u,[u]);const c=x.useCallback((d={})=>{const{onClick:p,onMouseDown:g,onKeyUp:m,onKeyDown:b,onPointerDown:E,...R}=d;return Xn({type:s?"button":void 0,onClick(h){if(t){h.preventDefault();return}p?.(h)},onMouseDown(h){t||g?.(h)},onKeyDown(h){if(t||(Vt(h),b?.(h)),h.baseUIHandlerPrevented)return;const O=h.target===h.currentTarget&&!s&&!l()&&!t,T=h.key==="Enter",w=h.key===" ";O&&((w||T)&&h.preventDefault(),T&&p?.(h))},onKeyUp(h){t||(Vt(h),m?.(h)),!h.baseUIHandlerPrevented&&h.target===h.currentTarget&&!s&&!t&&h.key===" "&&p?.(h)},onPointerDown(h){if(t){h.preventDefault();return}E?.(h)}},s?void 0:{role:"button"},a,R)},[t,a,s,l]),f=q(d=>{r.current=d,u()});return{getButtonProps:c,buttonRef:f}}function zs(e){return ge(e)&&e.tagName==="BUTTON"}const Us=x.createContext(void 0);function Xs(){return x.useContext(Us)?.direction??"ltr"}const Ks=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:s,rects:r,platform:i,elements:l,middlewareData:a}=t,{element:u,padding:c=0,offsetParent:f="real"}=ue(e,t)||{};if(u==null)return{};const d=gn(c),p={x:n,y:o},g=ht(s),m=mt(g),b=await i.getDimensions(u),E=g==="y",R=E?"top":"left",C=E?"bottom":"right",h=E?"clientHeight":"clientWidth",O=r.reference[m]+r.reference[g]-p[g]-r.floating[m],T=p[g]-r.reference[g],w=f==="real"?await i.getOffsetParent?.(u):l.floating;let k=l.floating[h]||r.floating[m];(!k||!await i.isElement?.(w))&&(k=l.floating[h]||r.floating[m]);const $=O/2-T/2,A=k/2-b[m]/2-1,L=Math.min(d[R],A),S=Math.min(d[C],A),y=L,D=k-b[m]-S,I=k/2-b[m]/2+$,F=rt(y,I,D),M=!a.arrow&&me(s)!=null&&I!==F&&r.reference[m]/2-(I<y?L:S)-b[m]/2<0,v=M?I<y?I-y:I-D:0;return{[g]:p[g]+v,data:{[g]:F,centerOffset:I-F-v,...M&&{alignmentOffset:v}},reset:M}}}),Gs=(e,t)=>({...Ks(e),options:[e,t]}),qs={name:"hide",async fn(e){const{width:t,height:n,x:o,y:s}=e.rects.reference,r=t===0&&n===0&&o===0&&s===0;return{data:{referenceHidden:(await As().fn(e)).data?.referenceHidden||r}}}},Ve={sideX:"left",sideY:"top"},Js={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:s},platform:r,strategy:i,placement:l}=e,a=pe(s),u=a.getComputedStyle(s);if(!(u.transitionDuration!=="0s"&&u.transitionDuration!==""))return{x:t,y:n,data:Ve};const f=await r.getOffsetParent?.(s);let d={width:0,height:0};if(i==="fixed"&&a?.visualViewport)d={width:a.visualViewport.width,height:a.visualViewport.height};else if(f===a){const R=fn(s);d={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await r.isElement?.(f)&&(d=await r.getDimensions(f));const p=J(l);let g=t,m=n;p==="left"&&(g=d.width-(t+o.width)),p==="top"&&(m=d.height-(n+o.height));const b=p==="left"?"right":Ve.sideX,E=p==="top"?"bottom":Ve.sideY;return{x:g,y:m,data:{sideX:b,sideY:E}}}};function En(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Qt(e,t,n){const{rects:o,placement:s}=e;return{side:En(t,J(s),n),align:me(s)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Qs(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:s=0,align:r="center",alignOffset:i=0,collisionBoundary:l,collisionPadding:a=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:f=!1,keepMounted:d=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:b=!1,nodeId:E,adaptiveOrigin:R,lazyFlip:C=!1,externalTree:h}=e,[O,T]=x.useState(null);!g&&O!==null&&T(null);const w=m.side||"flip",k=m.align||"flip",$=m.fallbackAxisSide||"end",A=typeof t=="function"?t:void 0,L=q(A),S=A?L:t,y=we(t),I=Xs()==="rtl",F=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[o],M=r==="center"?F:`${F}-${r}`;let v=a;const P=1,N=o==="bottom"?P:0,V=o==="top"?P:0,W=o==="right"?P:0,j=o==="left"?P:0;typeof v=="number"?v={top:v+N,right:v+j,bottom:v+V,left:v+W}:v&&(v={top:(v.top||0)+N,right:(v.right||0)+j,bottom:(v.bottom||0)+V,left:(v.left||0)+W});const B={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:v},Y=x.useRef(null),H=we(s),_=we(i),oe=[Cs(z=>{const K=Qt(z,o,I),ie=typeof H.current=="function"?H.current(K):H.current,Z=typeof _.current=="function"?_.current(K):_.current;return{mainAxis:ie,crossAxis:Z,alignmentAxis:Z}},[typeof s!="function"?s:0,typeof i!="function"?i:0,I,o])],Rt=k==="none"&&w!=="shift",vt=!Rt&&(u||b||w==="shift"),bt=w==="none"?null:Ss({...B,padding:{top:v.top+P,right:v.right+P,bottom:v.bottom+P,left:v.left+P},mainAxis:!b&&w==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:$}),wt=Rt?null:Os(z=>{const K=fn(z.elements.floating).documentElement;return{...B,rootBoundary:b?{x:0,y:0,width:K.clientWidth,height:K.clientHeight}:void 0,mainAxis:k!=="none",crossAxis:vt,limiter:u||b?void 0:Ts(ie=>{if(!Y.current)return{};const{width:Z,height:Re}=Y.current.getBoundingClientRect(),ve=te(J(ie.placement)),Be=ve==="y"?Z:Re,qe=ve==="y"?v.left+v.right:v.top+v.bottom;return{offset:Be/2+qe/2}})}},[B,u,b,v,k]);w==="shift"||k==="shift"||r==="center"?oe.push(wt,bt):oe.push(bt,wt),oe.push(Ps({...B,apply({elements:{floating:z},rects:{reference:K},availableWidth:ie,availableHeight:Z}){Object.entries({"--available-width":`${ie}px`,"--available-height":`${Z}px`,"--anchor-width":`${K.width}px`,"--anchor-height":`${K.height}px`}).forEach(([Re,ve])=>{z.style.setProperty(Re,ve)})}}),Gs(()=>({element:Y.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(z){const{elements:K,middlewareData:ie,placement:Z,rects:Re,y:ve}=z,Be=J(Z),qe=te(Be),Bt=Y.current,Pn=ie.arrow?.x||0,An=ie.arrow?.y||0,Mn=Bt?.clientWidth||0,In=Bt?.clientHeight||0,Je=Pn+Mn/2,Ht=An+In/2,kn=Math.abs(ie.shift?.y||0),Dn=Re.reference.height/2,Ae=typeof s=="function"?s(Qt(z,o,I)):s,Ln=kn>Ae,Fn={top:`${Je}px calc(100% + ${Ae}px)`,bottom:`${Je}px ${-Ae}px`,left:`calc(100% + ${Ae}px) ${Ht}px`,right:`${-Ae}px ${Ht}px`}[Be],Bn=`${Je}px ${Re.reference.y+Dn-ve}px`;return K.floating.style.setProperty("--transform-origin",vt&&qe==="y"&&Ln?Bn:Fn),{}}},qs,R),ce(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const Ke=x.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:xe,elements:Te,x:Et,y:Ct,middlewareData:ye,update:Le,placement:Ot,context:Tt,isPositioned:Se,floatingStyles:St}=Is({rootContext:p,placement:M,middleware:oe,strategy:n,whileElementsMounted:d?void 0:(...z)=>Gt(...z,Ke),nodeId:E,externalTree:h}),{sideX:Pt,sideY:At}=ye.adaptiveOrigin||Ve,Ge=Se?n:"fixed",Mt=x.useMemo(()=>R?{position:Ge,[Pt]:Et,[At]:Ct}:{position:Ge,...St},[R,Ge,Pt,Et,At,Ct,St]),Fe=x.useRef(null);ce(()=>{if(!g)return;const z=y.current,K=typeof z=="function"?z():z,Z=(Zt(K)?K.current:K)||null||null;Z!==Fe.current&&(xe.setPositionReference(Z),Fe.current=Z)},[g,xe,S,y]),x.useEffect(()=>{if(!g)return;const z=y.current;typeof z!="function"&&Zt(z)&&z.current!==Fe.current&&(xe.setPositionReference(z.current),Fe.current=z.current)},[g,xe,S,y]),x.useEffect(()=>{if(d&&g&&Te.domReference&&Te.floating)return Gt(Te.domReference,Te.floating,Le,Ke)},[d,g,Te,Le,Ke]);const Pe=J(Ot),It=En(o,Pe,I),kt=me(Ot)||"center",Dt=!!ye.hide?.referenceHidden;ce(()=>{C&&g&&Se&&T(Pe)},[C,g,Se,Pe]);const Lt=x.useMemo(()=>({position:"absolute",top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Ft=ye.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Mt,arrowStyles:Lt,arrowRef:Y,arrowUncentered:Ft,side:It,align:kt,physicalSide:Pe,anchorHidden:Dt,refs:xe,context:Tt,isPositioned:Se,update:Le}),[Mt,Lt,Y,Ft,It,kt,Pe,Dt,xe,Tt,Se,Le])}function Zt(e){return e!=null&&"current"in e}const Zs=x.createContext(void 0);function er(e){return x.useContext(Zs)}function Cn(e){return e==="starting"?Kn:nn}const On=x.createContext(void 0);function De(e){const t=x.useContext(On);if(t===void 0&&!e)throw new Error(ke(47));return t}function tr(){return{...eo(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const nr={...qn,disabled:se(e=>e.disabled),instantType:se(e=>e.instantType),openMethod:se(e=>e.openMethod),openChangeReason:se(e=>e.openChangeReason),modal:se(e=>e.modal),stickIfOpen:se(e=>e.stickIfOpen),titleElementId:se(e=>e.titleElementId),descriptionElementId:se(e=>e.descriptionElementId),openOnHover:se(e=>e.openOnHover),closeDelay:se(e=>e.closeDelay),hasViewport:se(e=>e.hasViewport)};class yt extends Gn{constructor(t){const n={...tr(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),stickIfOpenTimeout:new ln,triggerElements:new cn},nr)}setOpen=(t,n)=>{const o=n.reason===ee,s=n.reason===be&&n.event.detail===0,r=!t&&(n.reason===Jn||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const a=()=>{const u={open:t,openChangeReason:n.reason},c=n.trigger?.id??null;(c||t)&&(u.activeTriggerId=c,u.activeTriggerElement=n.trigger??null),this.update(u)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Qn,()=>{this.set("stickIfOpen",!1)}),Me.flushSync(a)):a(),s||r?this.set("instantType",s?"click":"dismiss"):n.reason===st?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const o=rn(()=>new yt(n)).current,s=t??o;return Zn(o.disposeEffect),s}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function en({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:r,modal:i=!1,handle:l,triggerId:a,defaultTriggerId:u=null}=e,c=yt.useStore(l?.store,{open:n??o,modal:i,activeTriggerId:a!==void 0?a:u});c.useControlledProp("open",n,o),c.useControlledProp("activeTriggerId",a,u);const f=c.useState("open"),d=c.useState("positionerElement"),p=c.useState("payload"),g=c.useState("openChangeReason");c.useContextCallback("onOpenChange",s),c.useContextCallback("onOpenChangeComplete",r);const{openMethod:m,triggerProps:b,reset:E}=no(f);oo(c);const{forceUnmount:R}=so(f,c,()=>{c.update({stickIfOpen:!0,openChangeReason:null}),E()});ro(f&&i===!0&&g!==ee&&m!=="touch",d),x.useEffect(()=>{f||c.context.stickIfOpenTimeout.clear()},[c,f]);const C=x.useCallback(I=>{const F=G(I);return F.preventUnmountOnClose=()=>{c.set("preventUnmountingOnClose",!0)},F},[c]),h=x.useCallback(()=>{c.setOpen(!1,C(io))},[c,C]);x.useImperativeHandle(e.actionsRef,()=>({unmount:R,close:h}),[R,h]);const O=co({popupStore:c,onOpenChange:c.setOpen}),T=ao(O,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),w=lo(O),{getReferenceProps:k,getFloatingProps:$,getTriggerProps:A}=un([T,w]),L=x.useMemo(()=>k(b),[k,b]),S=x.useMemo(()=>A(b),[A,b]),y=x.useMemo(()=>$(),[$]);c.useSyncedValues({modal:i,openMethod:m,activeTriggerProps:L,inactiveTriggerProps:S,popupProps:y,floatingRootContext:O,nested:ut()!=null});const D=x.useMemo(()=>({store:c}),[c]);return X.jsx(On.Provider,{value:D,children:typeof t=="function"?t({payload:p}):t})}function ur(e){return De(!0)?X.jsx(en,{props:e}):X.jsx(to,{children:X.jsx(en,{props:e})})}const or=300,dr=x.forwardRef(function(t,n){const{render:o,className:s,disabled:r=!1,nativeButton:i=!0,handle:l,payload:a,openOnHover:u=!1,delay:c=or,closeDelay:f=0,id:d,...p}=t,g=De(!0),m=l?.store??g?.store;if(!m)throw new Error(ke(74));const b=fo(d),E=m.useState("isTriggerActive",b),R=m.useState("floatingRootContext"),C=m.useState("isOpenedByTrigger",b),h=x.useRef(null),{registerTrigger:O,isMountedByThisTrigger:T}=uo(b,h,m,{payload:a,disabled:r,openOnHover:u,closeDelay:f}),w=m.useState("openChangeReason"),k=m.useState("stickIfOpen"),$=m.useState("openMethod"),A=$s(R,{enabled:R!=null&&u&&($!=="touch"||w!==be),mouseOnly:!0,move:!1,handleClose:Ws(),restMs:c,delay:{close:f},triggerElementRef:h,isActiveTrigger:E}),L=No(R,{enabled:R!=null,stickIfOpen:k}),S=un([L]),y=m.useState("triggerProps",T),D=x.useMemo(()=>({disabled:r,open:C}),[r,C]),{getButtonProps:I,buttonRef:F}=Ys({disabled:r,native:i}),M=x.useMemo(()=>({open(W){return W&&w===be?go.open(W):po.open(W)}}),[w]),v=gt("button",t,{state:D,ref:[F,n,O,h],props:[S.getReferenceProps(),A,y,{[mo]:"",id:b},p,I],stateAttributesMapping:M}),P=x.useRef(null),N=q(W=>{Me.flushSync(()=>{m.setOpen(!1,G(st,W.nativeEvent,W.currentTarget))}),ho(P.current)?.focus()}),V=q(W=>{const j=m.select("positionerElement");if(j&&xo(W,j))m.context.beforeContentFocusGuardRef.current?.focus();else{Me.flushSync(()=>{m.setOpen(!1,G(st,W.nativeEvent,W.currentTarget))});let B=yo(m.context.triggerFocusTargetRef.current||h.current);for(;B!==null&&le(j,B);){const Y=B;if(B=Ro(B),B===Y)break}B?.focus()}});return E?X.jsxs(x.Fragment,{children:[X.jsx(Wt,{ref:P,onFocus:N}),X.jsx(x.Fragment,{children:v},b),X.jsx(Wt,{ref:m.context.triggerFocusTargetRef,onFocus:V})]}):X.jsx(x.Fragment,{children:v},b)}),Tn=x.createContext(void 0);function sr(){const e=x.useContext(Tn);if(e===void 0)throw new Error(ke(45));return e}const gr=x.forwardRef(function(t,n){const{keepMounted:o=!1,...s}=t,{store:r}=De();return r.useState("mounted")||o?X.jsx(Tn.Provider,{value:o,children:X.jsx(vo,{ref:n,...s,renderGuards:!1})}):null}),Sn=x.createContext(void 0);function rr(){const e=x.useContext(Sn);if(!e)throw new Error(ke(46));return e}const pr=x.forwardRef(function(t,n){const{render:o,className:s,anchor:r,positionMethod:i="absolute",side:l="bottom",align:a="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:b=bo,...E}=t,{store:R}=De(),C=sr(),h=wo(),O=R.useState("floatingRootContext"),T=R.useState("mounted"),w=R.useState("open"),k=R.useState("openChangeReason"),$=R.useState("activeTriggerElement"),A=R.useState("modal"),L=R.useState("positionerElement"),S=R.useState("instantType"),y=R.useState("transitionStatus"),D=R.useState("hasViewport"),I=x.useRef(null),F=Eo(L,!1,!1),M=Qs({anchor:r,floatingRootContext:O,positionMethod:i,mounted:T,side:l,sideOffset:u,align:a,alignOffset:c,arrowPadding:p,collisionBoundary:f,collisionPadding:d,sticky:g,disableAnchorTracking:m,keepMounted:C,nodeId:h,collisionAvoidance:b,adaptiveOrigin:D?Js:void 0}),v=x.useMemo(()=>{const B={};return w||(B.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...M.positionerStyles,...B}}},[w,T,M.positionerStyles]),P=x.useMemo(()=>({props:v,...M}),[v,M]),N=O?.select("domReferenceElement");ce(()=>{const B=N,Y=I.current;if(B&&(I.current=B),Y&&B&&B!==Y){R.set("instantType",void 0);const H=new AbortController;return F(()=>{R.set("instantType","trigger-change")},H.signal),()=>{H.abort()}}},[N,F,R]);const V=x.useMemo(()=>({open:w,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:S}),[w,P.side,P.align,P.anchorHidden,S]),W=x.useCallback(B=>{R.set("positionerElement",B)},[R]),j=gt("div",t,{state:V,props:[P.props,Cn(y),E],ref:[n,W],stateAttributesMapping:dn});return X.jsxs(Sn.Provider,{value:P,children:[T&&A===!0&&k!==ee&&X.jsx(Co,{ref:R.context.internalBackdropRef,inert:Oo(!w),cutout:$}),X.jsx(To,{id:h,children:j})]})}),ir={...dn,...Ao},mr=x.forwardRef(function(t,n){const{className:o,render:s,initialFocus:r,finalFocus:i,...l}=t,{store:a}=De(),u=rr(),c=er()!=null,f=a.useState("open"),d=a.useState("openMethod"),p=a.useState("instantType"),g=a.useState("transitionStatus"),m=a.useState("popupProps"),b=a.useState("titleElementId"),E=a.useState("descriptionElementId"),R=a.useState("modal"),C=a.useState("mounted"),h=a.useState("openChangeReason"),O=a.useState("activeTriggerElement"),T=a.useState("floatingRootContext");So({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}});const w=a.useState("disabled"),k=a.useState("openOnHover"),$=a.useState("closeDelay");Fs(T,{enabled:k&&!w,closeDelay:$});function A(I){return I==="touch"?a.context.popupRef.current:!0}const L=r===void 0?A:r,S=x.useMemo(()=>({open:f,side:u.side,align:u.align,instant:p,transitionStatus:g}),[f,u.side,u.align,p,g]),y=x.useCallback(I=>{a.set("popupElement",I)},[a]),D=gt("div",t,{state:S,ref:[n,a.context.popupRef,y],props:[m,{"aria-labelledby":b,"aria-describedby":E,onKeyDown(I){c&&Mo.has(I.key)&&I.stopPropagation()}},Cn(g),l],stateAttributesMapping:ir});return X.jsx(Po,{context:T,openInteractionType:d,modal:R==="trap-focus",disabled:!C||h===ee,initialFocus:L,returnFocus:i,restoreFocus:"popup",previousFocusableElement:ge(O)?O:void 0,nextFocusableElement:a.context.triggerFocusTargetRef,beforeContentFocusGuardRef:a.context.beforeContentFocusGuardRef,children:D})});export{lr as C,fr as L,ur as P,dr as a,gr as b,pr as c,mr as d,Ms as e,He as f,No as g,Qs as h,er as i,Cn as j,Ys as u};
|
|
1
|
+
import{c as tn,r as x,aa as Me,C as X}from"./main-BxEGiBWd.js";import{ai as Ce,aa as Hn,G as nt,aj as $n,c as G,ak as be,al as Vn,J as nn,am as ot,L as U,an as de,ab as pe,ao as $t,ap as fe,z as ge,aq as on,ar as at,as as Ie,at as We,au as Wn,av as sn,aw as _n,ax as lt,ay as ft,az as Ue,aA as Nn,n as ut,Q as rn,aB as jn,aC as cn,p as ce,o as dt,aD as Yn,aE as zn,r as q,aF as ee,w as _e,B as an,m as we,x as le,aG as ln,aH as Un,I as ke,V as Xn,aI as Vt,a1 as fn,aJ as Kn,aK as Gn,aL as qn,aM as Jn,aN as Qn,C as st,aO as Zn,aP as eo,M as se,aQ as to,P as no,aR as oo,aS as so,a6 as ro,aT as io,aU as co,T as ao,aV as lo,U as un,K as fo,aW as uo,a0 as go,a3 as po,a as gt,aX as mo,aY as Wt,aZ as ho,a_ as xo,a$ as yo,b0 as Ro,a4 as vo,b1 as bo,b2 as wo,b3 as Eo,a7 as Co,a8 as Oo,b4 as To,a9 as dn,S as So,ad as Po,af as Ao,ag as Mo}from"./DialogTitle-BDKufE4F.js";const Io=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],lr=tn("chevron-right",Io);const ko=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fr=tn("loader-circle",ko),Do=["top","right","bottom","left"],Oe=Math.min,Q=Math.max,Ne=Math.round,He=Math.floor,ae=e=>({x:e,y:e}),Lo={left:"right",right:"left",bottom:"top",top:"bottom"};function rt(e,t,n){return Q(e,Oe(t,n))}function ue(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function me(e){return e.split("-")[1]}function pt(e){return e==="x"?"y":"x"}function mt(e){return e==="y"?"height":"width"}function te(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ht(e){return pt(te(e))}function Fo(e,t,n){n===void 0&&(n=!1);const o=me(e),s=ht(e),r=mt(s);let i=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=je(i)),[i,je(i)]}function Bo(e){const t=je(e);return[it(e),t,it(t)]}function it(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _t=["left","right"],Nt=["right","left"],Ho=["top","bottom"],$o=["bottom","top"];function Vo(e,t,n){switch(e){case"top":case"bottom":return n?t?Nt:_t:t?_t:Nt;case"left":case"right":return t?Ho:$o;default:return[]}}function Wo(e,t,n,o){const s=me(e);let r=Vo(J(e),n==="start",o);return s&&(r=r.map(i=>i+"-"+s),t&&(r=r.concat(r.map(it)))),r}function je(e){const t=J(e);return Lo[t]+e.slice(t.length)}function _o(e){return{top:0,right:0,bottom:0,left:0,...e}}function gn(e){return typeof e!="number"?_o(e):{top:e,right:e,bottom:e,left:e}}function Ye(e){const{x:t,y:n,width:o,height:s}=e;return{width:o,height:s,top:n,left:t,right:t+o,bottom:n+s,x:t,y:n}}function Qe(e,t,n){if(n&&!Ce(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function No(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:s=!0,event:r="click",toggle:i=!0,ignoreMouse:l=!1,stickIfOpen:a=!0,touchOpenDelay:u=0}=t,c=x.useRef(void 0),f=Hn(),d=nt(),p=x.useMemo(()=>({onPointerDown(g){c.current=g.pointerType},onMouseDown(g){const m=c.current,b=g.nativeEvent,E=n.select("open");if(g.button!==0||r==="click"||Ce(m,!0)&&l)return;const R=o.current.openEvent,C=R?.type,h=n.select("domReferenceElement")!==g.currentTarget,O=E&&h||!(E&&i&&(!(R&&a)||C==="click"||C==="mousedown"));if(Vn(b.target)){const w=G(be,b,b.target);O&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,w)}):n.setOpen(O,w);return}const T=g.currentTarget;f.request(()=>{const w=G(be,b,T);O&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,w)}):n.setOpen(O,w)})},onClick(g){if(r==="mousedown-only")return;const m=c.current;if(r==="mousedown"&&m){c.current=void 0;return}if(Ce(m,!0)&&l)return;const b=n.select("open"),E=o.current.openEvent,R=n.select("domReferenceElement")!==g.currentTarget,C=b&&R||!(b&&i&&(!(E&&a)||$n(E))),h=G(be,g.nativeEvent,g.currentTarget);C&&m==="touch"&&u>0?d.start(u,()=>{n.setOpen(!0,h)}):n.setOpen(C,h)},onKeyDown(){c.current=void 0}}),[o,r,l,n,a,i,f,d,u]);return x.useMemo(()=>s?{reference:p}:nn,[s,p])}function jt(e,t,n){let{reference:o,floating:s}=e;const r=te(t),i=ht(t),l=mt(i),a=J(t),u=r==="y",c=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,d=o[l]/2-s[l]/2;let p;switch(a){case"top":p={x:c,y:o.y-s.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-s.width,y:f};break;default:p={x:o.x,y:o.y}}switch(me(t)){case"start":p[i]-=d*(n&&u?-1:1);break;case"end":p[i]+=d*(n&&u?-1:1);break}return p}async function jo(e,t){var n;t===void 0&&(t={});const{x:o,y:s,platform:r,rects:i,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ue(t,e),g=gn(p),b=l[d?f==="floating"?"reference":"floating":f],E=Ye(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(b)))==null||n?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),R=f==="floating"?{x:o,y:s,width:i.floating.width,height:i.floating.height}:i.reference,C=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),h=await(r.isElement==null?void 0:r.isElement(C))?await(r.getScale==null?void 0:r.getScale(C))||{x:1,y:1}:{x:1,y:1},O=Ye(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:R,offsetParent:C,strategy:a}):R);return{top:(E.top-O.top+g.top)/h.y,bottom:(O.bottom-E.bottom+g.bottom)/h.y,left:(E.left-O.left+g.left)/h.x,right:(O.right-E.right+g.right)/h.x}}const Yo=50,zo=async(e,t,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:r=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:jo},a=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:f}=jt(u,o,a),d=o,p=0;const g={};for(let m=0;m<r.length;m++){const b=r[m];if(!b)continue;const{name:E,fn:R}=b,{x:C,y:h,data:O,reset:T}=await R({x:c,y:f,initialPlacement:o,placement:d,strategy:s,middlewareData:g,rects:u,platform:l,elements:{reference:e,floating:t}});c=C??c,f=h??f,g[E]={...g[E],...O},T&&p<Yo&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(u=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:c,y:f}=jt(u,d,a)),m=-1)}return{x:c,y:f,placement:d,strategy:s,middlewareData:g}},Uo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:s,middlewareData:r,rects:i,initialPlacement:l,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=ue(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const E=J(s),R=te(l),C=J(l)===l,h=await(a.isRTL==null?void 0:a.isRTL(u.floating)),O=d||(C||!m?[je(l)]:Bo(l)),T=g!=="none";!d&&T&&O.push(...Wo(l,m,g,h));const w=[l,...O],k=await a.detectOverflow(t,b),$=[];let A=((o=r.flip)==null?void 0:o.overflows)||[];if(c&&$.push(k[E]),f){const D=Fo(s,i,h);$.push(k[D[0]],k[D[1]])}if(A=[...A,{placement:s,overflows:$}],!$.every(D=>D<=0)){var L,S;const D=(((L=r.flip)==null?void 0:L.index)||0)+1,I=w[D];if(I&&(!(f==="alignment"?R!==te(I):!1)||A.every(v=>te(v.placement)===R?v.overflows[0]>0:!0)))return{data:{index:D,overflows:A},reset:{placement:I}};let F=(S=A.filter(M=>M.overflows[0]<=0).sort((M,v)=>M.overflows[1]-v.overflows[1])[0])==null?void 0:S.placement;if(!F)switch(p){case"bestFit":{var y;const M=(y=A.filter(v=>{if(T){const P=te(v.placement);return P===R||P==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(P=>P>0).reduce((P,N)=>P+N,0)]).sort((v,P)=>v[1]-P[1])[0])==null?void 0:y[0];M&&(F=M);break}case"initialPlacement":F=l;break}if(s!==F)return{reset:{placement:F}}}return{}}}};function Yt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zt(e){return Do.some(t=>e[t]>=0)}const Xo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:s="referenceHidden",...r}=ue(e,t);switch(s){case"referenceHidden":{const i=await o.detectOverflow(t,{...r,elementContext:"reference"}),l=Yt(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:zt(l)}}}case"escaped":{const i=await o.detectOverflow(t,{...r,altBoundary:!0}),l=Yt(i,n.floating);return{data:{escapedOffsets:l,escaped:zt(l)}}}default:return{}}}}},pn=new Set(["left","top"]);async function Ko(e,t){const{placement:n,platform:o,elements:s}=e,r=await(o.isRTL==null?void 0:o.isRTL(s.floating)),i=J(n),l=me(n),a=te(n)==="y",u=pn.has(i)?-1:1,c=r&&a?-1:1,f=ue(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),a?{x:p*c,y:d*u}:{x:d*u,y:p*c}}const Go=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:s,y:r,placement:i,middlewareData:l}=t,a=await Ko(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:s+a.x,y:r+a.y,data:{...a,placement:i}}}}},qo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:s,platform:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:E=>{let{x:R,y:C}=E;return{x:R,y:C}}},...u}=ue(e,t),c={x:n,y:o},f=await r.detectOverflow(t,u),d=te(J(s)),p=pt(d);let g=c[p],m=c[d];if(i){const E=p==="y"?"top":"left",R=p==="y"?"bottom":"right",C=g+f[E],h=g-f[R];g=rt(C,g,h)}if(l){const E=d==="y"?"top":"left",R=d==="y"?"bottom":"right",C=m+f[E],h=m-f[R];m=rt(C,m,h)}const b=a.fn({...t,[p]:g,[d]:m});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[p]:i,[d]:l}}}}}},Jo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:s,rects:r,middlewareData:i}=t,{offset:l=0,mainAxis:a=!0,crossAxis:u=!0}=ue(e,t),c={x:n,y:o},f=te(s),d=pt(f);let p=c[d],g=c[f];const m=ue(l,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const C=d==="y"?"height":"width",h=r.reference[d]-r.floating[C]+b.mainAxis,O=r.reference[d]+r.reference[C]-b.mainAxis;p<h?p=h:p>O&&(p=O)}if(u){var E,R;const C=d==="y"?"width":"height",h=pn.has(J(s)),O=r.reference[f]-r.floating[C]+(h&&((E=i.offset)==null?void 0:E[f])||0)+(h?0:b.crossAxis),T=r.reference[f]+r.reference[C]+(h?0:((R=i.offset)==null?void 0:R[f])||0)-(h?b.crossAxis:0);g<O?g=O:g>T&&(g=T)}return{[d]:p,[f]:g}}}},Qo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:s,rects:r,platform:i,elements:l}=t,{apply:a=()=>{},...u}=ue(e,t),c=await i.detectOverflow(t,u),f=J(s),d=me(s),p=te(s)==="y",{width:g,height:m}=r.floating;let b,E;f==="top"||f==="bottom"?(b=f,E=d===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(E=f,b=d==="end"?"top":"bottom");const R=m-c.top-c.bottom,C=g-c.left-c.right,h=Oe(m-c[b],R),O=Oe(g-c[E],C),T=!t.middlewareData.shift;let w=h,k=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(w=R),T&&!d){const A=Q(c.left,0),L=Q(c.right,0),S=Q(c.top,0),y=Q(c.bottom,0);p?k=g-2*(A!==0||L!==0?A+L:Q(c.left,c.right)):w=m-2*(S!==0||y!==0?S+y:Q(c.top,c.bottom))}await a({...t,availableWidth:k,availableHeight:w});const $=await i.getDimensions(l.floating);return g!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}};function mn(e){const t=fe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const s=ge(e),r=s?e.offsetWidth:n,i=s?e.offsetHeight:o,l=Ne(n)!==r||Ne(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function xt(e){return U(e)?e:e.contextElement}function Ee(e){const t=xt(e);if(!ge(t))return ae(1);const n=t.getBoundingClientRect(),{width:o,height:s,$:r}=mn(t);let i=(r?Ne(n.width):n.width)/o,l=(r?Ne(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Zo=ae(0);function hn(e){const t=pe(e);return!on()||!t.visualViewport?Zo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function es(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pe(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),r=xt(e);let i=ae(1);t&&(o?U(o)&&(i=Ee(o)):i=Ee(e));const l=es(r,n,o)?hn(r):ae(0);let a=(s.left+l.x)/i.x,u=(s.top+l.y)/i.y,c=s.width/i.x,f=s.height/i.y;if(r){const d=pe(r),p=o&&U(o)?pe(o):o;let g=d,m=$t(g);for(;m&&o&&p!==g;){const b=Ee(m),E=m.getBoundingClientRect(),R=fe(m),C=E.left+(m.clientLeft+parseFloat(R.paddingLeft))*b.x,h=E.top+(m.clientTop+parseFloat(R.paddingTop))*b.y;a*=b.x,u*=b.y,c*=b.x,f*=b.y,a+=C,u+=h,g=pe(m),m=$t(g)}}return Ye({width:c,height:f,x:a,y:u})}function Xe(e,t){const n=Ue(e).scrollLeft;return t?t.left+n:he(de(e)).left+n}function xn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Xe(e,n),s=n.top+t.scrollTop;return{x:o,y:s}}function ts(e){let{elements:t,rect:n,offsetParent:o,strategy:s}=e;const r=s==="fixed",i=de(o),l=t?at(t.floating):!1;if(o===i||l&&r)return n;let a={scrollLeft:0,scrollTop:0},u=ae(1);const c=ae(0),f=ge(o);if((f||!f&&!r)&&((lt(o)!=="body"||ft(i))&&(a=Ue(o)),f)){const p=he(o);u=Ee(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop}const d=i&&!f&&!r?xn(i,a):ae(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-a.scrollTop*u.y+c.y+d.y}}function ns(e){return Array.from(e.getClientRects())}function os(e){const t=de(e),n=Ue(e),o=e.ownerDocument.body,s=Q(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Q(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Xe(e);const l=-n.scrollTop;return fe(o).direction==="rtl"&&(i+=Q(t.clientWidth,o.clientWidth)-s),{width:s,height:r,x:i,y:l}}const Ut=25;function ss(e,t){const n=pe(e),o=de(e),s=n.visualViewport;let r=o.clientWidth,i=o.clientHeight,l=0,a=0;if(s){r=s.width,i=s.height;const c=on();(!c||c&&t==="fixed")&&(l=s.offsetLeft,a=s.offsetTop)}const u=Xe(o);if(u<=0){const c=o.ownerDocument,f=c.body,d=getComputedStyle(f),p=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-p);g<=Ut&&(r-=g)}else u<=Ut&&(r+=u);return{width:r,height:i,x:l,y:a}}function rs(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,s=n.left+e.clientLeft,r=ge(e)?Ee(e):ae(1),i=e.clientWidth*r.x,l=e.clientHeight*r.y,a=s*r.x,u=o*r.y;return{width:i,height:l,x:a,y:u}}function Xt(e,t,n){let o;if(t==="viewport")o=ss(e,n);else if(t==="document")o=os(de(e));else if(U(t))o=rs(t,n);else{const s=hn(e);o={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ye(o)}function yn(e,t){const n=Ie(e);return n===t||!U(n)||We(n)?!1:fe(n).position==="fixed"||yn(n,t)}function is(e,t){const n=t.get(e);if(n)return n;let o=ot(e,[],!1).filter(l=>U(l)&<(l)!=="body"),s=null;const r=fe(e).position==="fixed";let i=r?Ie(e):e;for(;U(i)&&!We(i);){const l=fe(i),a=sn(i);!a&&l.position==="fixed"&&(s=null),(r?!a&&!s:!a&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||ft(i)&&!a&&yn(e,i))?o=o.filter(c=>c!==i):s=l,i=Ie(i)}return t.set(e,o),o}function cs(e){let{element:t,boundary:n,rootBoundary:o,strategy:s}=e;const i=[...n==="clippingAncestors"?at(t)?[]:is(t,this._c):[].concat(n),o],l=Xt(t,i[0],s);let a=l.top,u=l.right,c=l.bottom,f=l.left;for(let d=1;d<i.length;d++){const p=Xt(t,i[d],s);a=Q(p.top,a),u=Oe(p.right,u),c=Oe(p.bottom,c),f=Q(p.left,f)}return{width:u-f,height:c-a,x:f,y:a}}function as(e){const{width:t,height:n}=mn(e);return{width:t,height:n}}function ls(e,t,n){const o=ge(t),s=de(t),r=n==="fixed",i=he(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const a=ae(0);function u(){a.x=Xe(s)}if(o||!o&&!r)if((lt(t)!=="body"||ft(s))&&(l=Ue(t)),o){const p=he(t,!0,r,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else s&&u();r&&!o&&s&&u();const c=s&&!o&&!r?xn(s,l):ae(0),f=i.left+l.scrollLeft-a.x-c.x,d=i.top+l.scrollTop-a.y-c.y;return{x:f,y:d,width:i.width,height:i.height}}function Ze(e){return fe(e).position==="static"}function Kt(e,t){if(!ge(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return de(e)===n&&(n=n.ownerDocument.body),n}function Rn(e,t){const n=pe(e);if(at(e))return n;if(!ge(e)){let s=Ie(e);for(;s&&!We(s);){if(U(s)&&!Ze(s))return s;s=Ie(s)}return n}let o=Kt(e,t);for(;o&&Wn(o)&&Ze(o);)o=Kt(o,t);return o&&We(o)&&Ze(o)&&!sn(o)?n:o||_n(e)||n}const fs=async function(e){const t=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(e.floating);return{reference:ls(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function us(e){return fe(e).direction==="rtl"}const ds={convertOffsetParentRelativeRectToViewportRelativeRect:ts,getDocumentElement:de,getClippingRect:cs,getOffsetParent:Rn,getElementRects:fs,getClientRects:ns,getDimensions:as,getScale:Ee,isElement:U,isRTL:us};function vn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gs(e,t){let n=null,o;const s=de(e);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();const u=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=u;if(l||t(),!d||!p)return;const g=He(f),m=He(s.clientWidth-(c+d)),b=He(s.clientHeight-(f+p)),E=He(c),C={rootMargin:-g+"px "+-m+"px "+-b+"px "+-E+"px",threshold:Q(0,Oe(1,a))||1};let h=!0;function O(T){const w=T[0].intersectionRatio;if(w!==a){if(!h)return i();w?i(!1,w):o=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!vn(u,e.getBoundingClientRect())&&i(),h=!1}try{n=new IntersectionObserver(O,{...C,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,C)}n.observe(e)}return i(!0),r}function Gt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,u=xt(e),c=s||r?[...u?ot(u):[],...t?ot(t):[]]:[];c.forEach(E=>{s&&E.addEventListener("scroll",n,{passive:!0}),r&&E.addEventListener("resize",n)});const f=u&&l?gs(u,n):null;let d=-1,p=null;i&&(p=new ResizeObserver(E=>{let[R]=E;R&&R.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),u&&!a&&p.observe(u),t&&p.observe(t));let g,m=a?he(e):null;a&&b();function b(){const E=he(e);m&&!vn(m,E)&&n(),m=E,g=requestAnimationFrame(b)}return n(),()=>{var E;c.forEach(R=>{s&&R.removeEventListener("scroll",n),r&&R.removeEventListener("resize",n)}),f?.(),(E=p)==null||E.disconnect(),p=null,a&&cancelAnimationFrame(g)}}const ps=Go,ms=qo,hs=Uo,xs=Qo,ys=Xo,Rs=Jo,vs=(e,t,n)=>{const o=new Map,s={platform:ds,...n},r={...s.platform,_c:o};return zo(e,t,{...s,platform:r})};var bs=typeof document<"u",ws=function(){},$e=bs?x.useLayoutEffect:ws;function ze(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!ze(e[o],t[o]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,s[o]))return!1;for(o=n;o--!==0;){const r=s[o];if(!(r==="_owner"&&e.$$typeof)&&!ze(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function bn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qt(e,t){const n=bn(e);return Math.round(t*n)/n}function et(e){const t=x.useRef(e);return $e(()=>{t.current=e}),t}function Es(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:s,elements:{reference:r,floating:i}={},transform:l=!0,whileElementsMounted:a,open:u}=e,[c,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=x.useState(o);ze(d,o)||p(o);const[g,m]=x.useState(null),[b,E]=x.useState(null),R=x.useCallback(v=>{v!==T.current&&(T.current=v,m(v))},[]),C=x.useCallback(v=>{v!==w.current&&(w.current=v,E(v))},[]),h=r||g,O=i||b,T=x.useRef(null),w=x.useRef(null),k=x.useRef(c),$=a!=null,A=et(a),L=et(s),S=et(u),y=x.useCallback(()=>{if(!T.current||!w.current)return;const v={placement:t,strategy:n,middleware:d};L.current&&(v.platform=L.current),vs(T.current,w.current,v).then(P=>{const N={...P,isPositioned:S.current!==!1};D.current&&!ze(k.current,N)&&(k.current=N,Me.flushSync(()=>{f(N)}))})},[d,t,n,L,S]);$e(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(v=>({...v,isPositioned:!1})))},[u]);const D=x.useRef(!1);$e(()=>(D.current=!0,()=>{D.current=!1}),[]),$e(()=>{if(h&&(T.current=h),O&&(w.current=O),h&&O){if(A.current)return A.current(h,O,y);y()}},[h,O,y,A,$]);const I=x.useMemo(()=>({reference:T,floating:w,setReference:R,setFloating:C}),[R,C]),F=x.useMemo(()=>({reference:h,floating:O}),[h,O]),M=x.useMemo(()=>{const v={position:n,left:0,top:0};if(!F.floating)return v;const P=qt(F.floating,c.x),N=qt(F.floating,c.y);return l?{...v,transform:"translate("+P+"px, "+N+"px)",...bn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:N}},[n,l,F.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:y,refs:I,elements:F,floatingStyles:M}),[c,y,I,F,M])}const Cs=(e,t)=>{const n=ps(e);return{name:n.name,fn:n.fn,options:[e,t]}},Os=(e,t)=>{const n=ms(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ts=(e,t)=>({fn:Rs(e).fn,options:[e,t]}),Ss=(e,t)=>{const n=hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ps=(e,t)=>{const n=xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},As=(e,t)=>{const n=ys(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ms(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,s=Nn(),r=ut()!=null,i=rn(()=>new jn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new cn,floatingId:s,nested:r,noEmit:e.noEmit||!1})).current;return ce(()=>{const l={open:t,floatingId:s};o.reference!==void 0&&(l.referenceElement=o.reference,l.domReferenceElement=U(o.reference)?o.reference:null),o.floating!==void 0&&(l.floatingElement=o.floating),i.update(l)},[t,s,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=r,i.context.noEmit=e.noEmit||!1,i}function Is(e={}){const{nodeId:t,externalTree:n}=e,o=Ms(e),s=e.rootContext||o,r={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[i,l]=x.useState(null),a=x.useRef(null),u=dt(n);ce(()=>{r.domReference&&(a.current=r.domReference)},[r.domReference]);const c=Es({...e,elements:{...r,...i&&{reference:i}}}),f=x.useCallback(w=>{const k=U(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(k),c.refs.setReference(k)},[c.refs]),[d,p]=x.useState(null),[g,m]=x.useState(null);s.useSyncedValue("referenceElement",d),s.useSyncedValue("domReferenceElement",U(d)?d:null),s.useSyncedValue("floatingElement",g);const b=x.useCallback(w=>{(U(w)||w===null)&&(a.current=w,p(w)),(U(c.refs.reference.current)||c.refs.reference.current===null||w!==null&&!U(w))&&c.refs.setReference(w)},[c.refs,p]),E=x.useCallback(w=>{m(w),c.refs.setFloating(w)},[c.refs]),R=x.useMemo(()=>({...c.refs,setReference:b,setFloating:E,setPositionReference:f,domReference:a}),[c.refs,b,E,f]),C=x.useMemo(()=>({...c.elements,domReference:r.domReference}),[c.elements,r.domReference]),h=s.useState("open"),O=s.useState("floatingId"),T=x.useMemo(()=>({...c,dataRef:s.context.dataRef,open:h,onOpenChange:s.setOpen,events:s.context.events,floatingId:O,refs:R,elements:C,nodeId:t,rootStore:s}),[c,R,C,t,s,h,O]);return ce(()=>{s.context.dataRef.current.floatingContext=T;const w=u?.nodesRef.current.find(k=>k.id===t);w&&(w.context=T)}),x.useMemo(()=>({...c,context:T,refs:R,elements:C,rootStore:s}),[c,R,C,T,s])}const ct=Yn("safe-polygon"),ks=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zn}`;function Ds(e){return e?!!e.closest(ks):!1}function wn(e){const t=x.useRef(void 0),n=x.useRef(!1),o=x.useRef(void 0),s=x.useRef(!0),r=x.useRef(!1),i=x.useRef(()=>{}),l=x.useRef(!1),a=nt(),u=nt(),c=x.useRef(void 0);return x.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:s,performedPointerEventsMutationRef:r,unbindMouseMoveRef:i,restTimeoutPendingRef:l,openChangeTimeout:a,restTimeout:u,handleCloseOptionsRef:c}),f.hoverInteractionState},[e,t,n,o,s,r,i,l,a,u,c])}const Ls=new Set(["click","mousedown"]);function Fs(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),s=n.useState("floatingElement"),r=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:l=!0,closeDelay:a=0,externalTree:u}=t,{pointerTypeRef:c,interactedInsideRef:f,handlerRef:d,performedPointerEventsMutationRef:p,unbindMouseMoveRef:g,restTimeoutPendingRef:m,openChangeTimeout:b,handleCloseOptionsRef:E}=wn(n),R=dt(u),C=ut(),h=q(()=>f.current?!0:i.current.openEvent?Ls.has(i.current.openEvent.type):!1),O=q(()=>{const A=i.current.openEvent?.type;return A?.includes("mouse")&&A!=="mousedown"}),T=x.useCallback((A,L=!0)=>{const S=Bs(a,c.current);S&&!d.current?b.start(S,()=>n.setOpen(!1,G(ee,A))):L&&(b.clear(),n.setOpen(!1,G(ee,A)))},[a,d,n,c,b]),w=q(()=>{g.current(),d.current=void 0}),k=q(()=>{if(p.current){const A=_e(s).body;A.style.pointerEvents="",A.removeAttribute(ct),p.current=!1}}),$=q(A=>{const L=an(A);if(!Ds(L)){f.current=!1;return}f.current=!0});ce(()=>{o||(c.current=void 0,m.current=!1,f.current=!1,w(),k())},[o,c,m,f,w,k]),x.useEffect(()=>()=>{w()},[w]),x.useEffect(()=>k,[k]),ce(()=>{if(l&&o&&E.current?.blockPointerEvents&&O()&&U(r)&&s){p.current=!0;const A=_e(s).body;A.setAttribute(ct,"");const L=r,S=s,y=R?.nodesRef.current.find(D=>D.id===C)?.context?.elements.floating;return y&&(y.style.pointerEvents=""),A.style.pointerEvents="none",L.style.pointerEvents="auto",S.style.pointerEvents="auto",()=>{A.style.pointerEvents="",L.style.pointerEvents="",S.style.pointerEvents=""}}},[l,o,r,s,E,O,R,C,p]),x.useEffect(()=>{if(!l)return;function A(D){if(h()||!i.current.floatingContext||!n.select("open"))return;const I=n.context.triggerElements;D.relatedTarget&&I.hasElement(D.relatedTarget)||(k(),w(),h()||T(D))}function L(D){b.clear(),k(),d.current?.(D),w()}function S(D){h()||T(D,!1)}const y=s;return y&&(y.addEventListener("mouseleave",A),y.addEventListener("mouseenter",L),y.addEventListener("mouseleave",S),y.addEventListener("pointerdown",$,!0)),()=>{y&&(y.removeEventListener("mouseleave",A),y.removeEventListener("mouseenter",L),y.removeEventListener("mouseleave",S),y.removeEventListener("pointerdown",$,!0))}})}function Bs(e,t){return t&&!Ce(t)?0:typeof e=="function"?e():e}function tt(e){return typeof e=="function"?e():e}const Hs={current:null};function $s(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:s}=n.context,{enabled:r=!0,delay:i=0,handleClose:l=null,mouseOnly:a=!1,restMs:u=0,move:c=!0,triggerElementRef:f=Hs,externalTree:d,isActiveTrigger:p=!0}=t,g=dt(d),{pointerTypeRef:m,interactedInsideRef:b,handlerRef:E,blockMouseMoveRef:R,performedPointerEventsMutationRef:C,unbindMouseMoveRef:h,restTimeoutPendingRef:O,openChangeTimeout:T,restTimeout:w,handleCloseOptionsRef:k}=wn(n),$=we(l),A=we(i),L=we(u);p&&(k.current=$.current?.__options);const S=q(()=>b.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),y=x.useCallback((M,v=!0)=>{const P=Qe(A.current,"close",m.current);P&&!E.current?T.start(P,()=>n.setOpen(!1,G(ee,M))):v&&(T.clear(),n.setOpen(!1,G(ee,M)))},[A,E,n,m,T]),D=q(()=>{h.current(),E.current=void 0}),I=q(()=>{if(C.current){const M=_e(n.select("domReferenceElement")).body;M.style.pointerEvents="",M.removeAttribute(ct),C.current=!1}});x.useEffect(()=>{if(!r)return;function M(v){v.open||(T.clear(),w.clear(),R.current=!0,O.current=!1)}return s.on("openchange",M),()=>{s.off("openchange",M)}},[r,s,T,w,R,O]);const F=q(M=>{if(S()||!o.current.floatingContext)return;const v=n.context.triggerElements;if(M.relatedTarget&&v.hasElement(M.relatedTarget))return;const P=f.current;$.current?.({...o.current.floatingContext,tree:g,x:M.clientX,y:M.clientY,onClose(){I(),D(),!S()&&P===n.select("domReferenceElement")&&y(M)}})(M)});return x.useEffect(()=>{if(!r)return;const M=f.current??(p?n.select("domReferenceElement"):null);if(!U(M))return;function v(V){if(T.clear(),R.current=!1,a&&!Ce(m.current)||tt(L.current)>0&&!Qe(A.current,"open"))return;const W=Qe(A.current,"open",m.current),j=n.select("domReferenceElement"),B=n.context.triggerElements,Y=(B.hasElement(V.target)||B.hasMatchingElement(re=>le(re,V.target)))&&(!j||!le(j,V.target)),H=V.currentTarget??null,_=n.select("open"),ne=!_||Y;Y&&_?n.setOpen(!0,G(ee,V,H)):W?T.start(W,()=>{ne&&n.setOpen(!0,G(ee,V,H))}):ne&&n.setOpen(!0,G(ee,V,H))}function P(V){if(S()){I();return}h.current();const W=n.select("domReferenceElement"),j=_e(W);w.clear(),O.current=!1;const B=n.context.triggerElements;if(V.relatedTarget&&B.hasElement(V.relatedTarget))return;if($.current&&o.current.floatingContext){n.select("open")||T.clear();const H=f.current;E.current=$.current({...o.current.floatingContext,tree:g,x:V.clientX,y:V.clientY,onClose(){I(),D(),!S()&&H===n.select("domReferenceElement")&&y(V,!0)}});const _=E.current;_(V),j.addEventListener("mousemove",_),h.current=()=>{j.removeEventListener("mousemove",_)};return}(m.current!=="touch"||!le(n.select("floatingElement"),V.relatedTarget))&&y(V)}function N(V){F(V)}return n.select("open")&&M.addEventListener("mouseleave",N),c&&M.addEventListener("mousemove",v,{once:!0}),M.addEventListener("mouseenter",v),M.addEventListener("mouseleave",P),()=>{M.removeEventListener("mouseleave",N),c&&M.removeEventListener("mousemove",v),M.removeEventListener("mouseenter",v),M.removeEventListener("mouseleave",P)}},[D,I,R,o,A,y,n,r,$,F,p,S,a,c,m,L,w,O,T,f,g,h,E]),x.useMemo(()=>{function M(v){m.current=v.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(v){const{nativeEvent:P}=v,N=v.currentTarget,V=n.select("domReferenceElement"),W=n.context.triggerElements,j=n.select("open"),B=(W.hasElement(v.target)||W.hasMatchingElement(H=>le(H,v.target)))&&(!V||!le(V,v.target));if(a&&!Ce(m.current)||j&&!B||tt(L.current)===0||!B&&O.current&&v.movementX**2+v.movementY**2<2)return;w.clear();function Y(){if(O.current=!1,S())return;const H=n.select("open");!R.current&&(!H||B)&&n.setOpen(!0,G(ee,P,N))}m.current==="touch"?Me.flushSync(()=>{Y()}):B&&j?Y():(O.current=!0,w.start(tt(L.current),Y))}}},[R,S,a,n,m,L,w,O])}function Jt(e,t){const[n,o]=e;let s=!1;const r=t.length;for(let i=0,l=r-1;i<r;l=i++){const[a,u]=t[i]||[0,0],[c,f]=t[l]||[0,0];u>=o!=f>=o&&n<=(c-a)*(o-u)/(f-u)+a&&(s=!s)}return s}function Vs(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ws(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,s=new ln;let r=!1,i=null,l=null,a=typeof performance<"u"?performance.now():0;function u(f,d){const p=performance.now(),g=p-a;if(i===null||l===null||g===0)return i=f,l=d,a=p,null;const m=f-i,b=d-l,R=Math.sqrt(m*m+b*b)/g;return i=f,l=d,a=p,R}const c=({x:f,y:d,placement:p,elements:g,onClose:m,nodeId:b,tree:E})=>function(C){function h(){s.clear(),m()}if(s.clear(),!g.domReference||!g.floating||p==null||f==null||d==null)return;const{clientX:O,clientY:T}=C,w=[O,T],k=an(C),$=C.type==="mouseleave",A=le(g.floating,k),L=le(g.domReference,k),S=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),D=p.split("-")[0],I=f>y.right-y.width/2,F=d>y.bottom-y.height/2,M=Vs(w,S),v=y.width>S.width,P=y.height>S.height,N=(v?S:y).left,V=(v?S:y).right,W=(P?S:y).top,j=(P?S:y).bottom;if(A&&(r=!0,!$))return;if(L&&(r=!1),L&&!$){r=!0;return}if($&&U(C.relatedTarget)&&le(g.floating,C.relatedTarget)||E&&Un(E.nodesRef.current,b).some(({context:H})=>H?.open))return;if(D==="top"&&d>=S.bottom-1||D==="bottom"&&d<=S.top+1||D==="left"&&f>=S.right-1||D==="right"&&f<=S.left+1)return h();let B=[];switch(D){case"top":B=[[N,S.top+1],[N,y.bottom-1],[V,y.bottom-1],[V,S.top+1]];break;case"bottom":B=[[N,y.top+1],[N,S.bottom-1],[V,S.bottom-1],[V,y.top+1]];break;case"left":B=[[y.right-1,j],[y.right-1,W],[S.left+1,W],[S.left+1,j]];break;case"right":B=[[S.right-1,j],[S.right-1,W],[y.left+1,W],[y.left+1,j]];break}function Y([H,_]){switch(D){case"top":{const ne=[v?H+t/2:I?H+t*4:H-t*4,_+t+1],re=[v?H-t/2:I?H+t*4:H-t*4,_+t+1],oe=[[y.left,I||v?y.bottom-t:y.top],[y.right,I?v?y.bottom-t:y.top:y.bottom-t]];return[ne,re,...oe]}case"bottom":{const ne=[v?H+t/2:I?H+t*4:H-t*4,_-t],re=[v?H-t/2:I?H+t*4:H-t*4,_-t],oe=[[y.left,I||v?y.top+t:y.bottom],[y.right,I?v?y.top+t:y.bottom:y.top+t]];return[ne,re,...oe]}case"left":{const ne=[H+t+1,P?_+t/2:F?_+t*4:_-t*4],re=[H+t+1,P?_-t/2:F?_+t*4:_-t*4];return[...[[F||P?y.right-t:y.left,y.top],[F?P?y.right-t:y.left:y.right-t,y.bottom]],ne,re]}case"right":{const ne=[H-t,P?_+t/2:F?_+t*4:_-t*4],re=[H-t,P?_-t/2:F?_+t*4:_-t*4],oe=[[F||P?y.left+t:y.right,y.top],[F?P?y.left+t:y.right:y.left+t,y.bottom]];return[ne,re,...oe]}default:return[]}}if(!Jt([O,T],B)){if(r&&!M)return h();if(!$&&o){const H=u(C.clientX,C.clientY);if(H!==null&&H<.1)return h()}Jt([O,T],Y([f,d]))?!r&&o&&s.start(40,h):h()}};return c.__options={blockPointerEvents:n},c}const _s=x.createContext(void 0);function Ns(e=!1){const t=x.useContext(_s);if(t===void 0&&!e)throw new Error(ke(16));return t}function js(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:s=0,isNativeButton:r}=e,i=o&&t!==!1,l=o&&t===!1;return{props:x.useMemo(()=>{const u={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return o||(u.tabIndex=s,!r&&n&&(u.tabIndex=t?s:-1)),(r&&(t||i)||!r&&n)&&(u["aria-disabled"]=n),r&&(!t||l)&&(u.disabled=n),u},[o,n,t,i,l,r,s])}}function Ys(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:s=!0}=e,r=x.useRef(null),i=Ns(!0)!==void 0,l=q(()=>{const d=r.current;return!!(d?.tagName==="A"&&d?.href)}),{props:a}=js({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:s}),u=x.useCallback(()=>{const d=r.current;zs(d)&&i&&t&&a.disabled===void 0&&d.disabled&&(d.disabled=!1)},[t,a.disabled,i]);ce(u,[u]);const c=x.useCallback((d={})=>{const{onClick:p,onMouseDown:g,onKeyUp:m,onKeyDown:b,onPointerDown:E,...R}=d;return Xn({type:s?"button":void 0,onClick(h){if(t){h.preventDefault();return}p?.(h)},onMouseDown(h){t||g?.(h)},onKeyDown(h){if(t||(Vt(h),b?.(h)),h.baseUIHandlerPrevented)return;const O=h.target===h.currentTarget&&!s&&!l()&&!t,T=h.key==="Enter",w=h.key===" ";O&&((w||T)&&h.preventDefault(),T&&p?.(h))},onKeyUp(h){t||(Vt(h),m?.(h)),!h.baseUIHandlerPrevented&&h.target===h.currentTarget&&!s&&!t&&h.key===" "&&p?.(h)},onPointerDown(h){if(t){h.preventDefault();return}E?.(h)}},s?void 0:{role:"button"},a,R)},[t,a,s,l]),f=q(d=>{r.current=d,u()});return{getButtonProps:c,buttonRef:f}}function zs(e){return ge(e)&&e.tagName==="BUTTON"}const Us=x.createContext(void 0);function Xs(){return x.useContext(Us)?.direction??"ltr"}const Ks=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:s,rects:r,platform:i,elements:l,middlewareData:a}=t,{element:u,padding:c=0,offsetParent:f="real"}=ue(e,t)||{};if(u==null)return{};const d=gn(c),p={x:n,y:o},g=ht(s),m=mt(g),b=await i.getDimensions(u),E=g==="y",R=E?"top":"left",C=E?"bottom":"right",h=E?"clientHeight":"clientWidth",O=r.reference[m]+r.reference[g]-p[g]-r.floating[m],T=p[g]-r.reference[g],w=f==="real"?await i.getOffsetParent?.(u):l.floating;let k=l.floating[h]||r.floating[m];(!k||!await i.isElement?.(w))&&(k=l.floating[h]||r.floating[m]);const $=O/2-T/2,A=k/2-b[m]/2-1,L=Math.min(d[R],A),S=Math.min(d[C],A),y=L,D=k-b[m]-S,I=k/2-b[m]/2+$,F=rt(y,I,D),M=!a.arrow&&me(s)!=null&&I!==F&&r.reference[m]/2-(I<y?L:S)-b[m]/2<0,v=M?I<y?I-y:I-D:0;return{[g]:p[g]+v,data:{[g]:F,centerOffset:I-F-v,...M&&{alignmentOffset:v}},reset:M}}}),Gs=(e,t)=>({...Ks(e),options:[e,t]}),qs={name:"hide",async fn(e){const{width:t,height:n,x:o,y:s}=e.rects.reference,r=t===0&&n===0&&o===0&&s===0;return{data:{referenceHidden:(await As().fn(e)).data?.referenceHidden||r}}}},Ve={sideX:"left",sideY:"top"},Js={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:s},platform:r,strategy:i,placement:l}=e,a=pe(s),u=a.getComputedStyle(s);if(!(u.transitionDuration!=="0s"&&u.transitionDuration!==""))return{x:t,y:n,data:Ve};const f=await r.getOffsetParent?.(s);let d={width:0,height:0};if(i==="fixed"&&a?.visualViewport)d={width:a.visualViewport.width,height:a.visualViewport.height};else if(f===a){const R=fn(s);d={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await r.isElement?.(f)&&(d=await r.getDimensions(f));const p=J(l);let g=t,m=n;p==="left"&&(g=d.width-(t+o.width)),p==="top"&&(m=d.height-(n+o.height));const b=p==="left"?"right":Ve.sideX,E=p==="top"?"bottom":Ve.sideY;return{x:g,y:m,data:{sideX:b,sideY:E}}}};function En(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Qt(e,t,n){const{rects:o,placement:s}=e;return{side:En(t,J(s),n),align:me(s)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Qs(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:s=0,align:r="center",alignOffset:i=0,collisionBoundary:l,collisionPadding:a=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:f=!1,keepMounted:d=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:b=!1,nodeId:E,adaptiveOrigin:R,lazyFlip:C=!1,externalTree:h}=e,[O,T]=x.useState(null);!g&&O!==null&&T(null);const w=m.side||"flip",k=m.align||"flip",$=m.fallbackAxisSide||"end",A=typeof t=="function"?t:void 0,L=q(A),S=A?L:t,y=we(t),I=Xs()==="rtl",F=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[o],M=r==="center"?F:`${F}-${r}`;let v=a;const P=1,N=o==="bottom"?P:0,V=o==="top"?P:0,W=o==="right"?P:0,j=o==="left"?P:0;typeof v=="number"?v={top:v+N,right:v+j,bottom:v+V,left:v+W}:v&&(v={top:(v.top||0)+N,right:(v.right||0)+j,bottom:(v.bottom||0)+V,left:(v.left||0)+W});const B={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:v},Y=x.useRef(null),H=we(s),_=we(i),oe=[Cs(z=>{const K=Qt(z,o,I),ie=typeof H.current=="function"?H.current(K):H.current,Z=typeof _.current=="function"?_.current(K):_.current;return{mainAxis:ie,crossAxis:Z,alignmentAxis:Z}},[typeof s!="function"?s:0,typeof i!="function"?i:0,I,o])],Rt=k==="none"&&w!=="shift",vt=!Rt&&(u||b||w==="shift"),bt=w==="none"?null:Ss({...B,padding:{top:v.top+P,right:v.right+P,bottom:v.bottom+P,left:v.left+P},mainAxis:!b&&w==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:$}),wt=Rt?null:Os(z=>{const K=fn(z.elements.floating).documentElement;return{...B,rootBoundary:b?{x:0,y:0,width:K.clientWidth,height:K.clientHeight}:void 0,mainAxis:k!=="none",crossAxis:vt,limiter:u||b?void 0:Ts(ie=>{if(!Y.current)return{};const{width:Z,height:Re}=Y.current.getBoundingClientRect(),ve=te(J(ie.placement)),Be=ve==="y"?Z:Re,qe=ve==="y"?v.left+v.right:v.top+v.bottom;return{offset:Be/2+qe/2}})}},[B,u,b,v,k]);w==="shift"||k==="shift"||r==="center"?oe.push(wt,bt):oe.push(bt,wt),oe.push(Ps({...B,apply({elements:{floating:z},rects:{reference:K},availableWidth:ie,availableHeight:Z}){Object.entries({"--available-width":`${ie}px`,"--available-height":`${Z}px`,"--anchor-width":`${K.width}px`,"--anchor-height":`${K.height}px`}).forEach(([Re,ve])=>{z.style.setProperty(Re,ve)})}}),Gs(()=>({element:Y.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(z){const{elements:K,middlewareData:ie,placement:Z,rects:Re,y:ve}=z,Be=J(Z),qe=te(Be),Bt=Y.current,Pn=ie.arrow?.x||0,An=ie.arrow?.y||0,Mn=Bt?.clientWidth||0,In=Bt?.clientHeight||0,Je=Pn+Mn/2,Ht=An+In/2,kn=Math.abs(ie.shift?.y||0),Dn=Re.reference.height/2,Ae=typeof s=="function"?s(Qt(z,o,I)):s,Ln=kn>Ae,Fn={top:`${Je}px calc(100% + ${Ae}px)`,bottom:`${Je}px ${-Ae}px`,left:`calc(100% + ${Ae}px) ${Ht}px`,right:`${-Ae}px ${Ht}px`}[Be],Bn=`${Je}px ${Re.reference.y+Dn-ve}px`;return K.floating.style.setProperty("--transform-origin",vt&&qe==="y"&&Ln?Bn:Fn),{}}},qs,R),ce(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const Ke=x.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:xe,elements:Te,x:Et,y:Ct,middlewareData:ye,update:Le,placement:Ot,context:Tt,isPositioned:Se,floatingStyles:St}=Is({rootContext:p,placement:M,middleware:oe,strategy:n,whileElementsMounted:d?void 0:(...z)=>Gt(...z,Ke),nodeId:E,externalTree:h}),{sideX:Pt,sideY:At}=ye.adaptiveOrigin||Ve,Ge=Se?n:"fixed",Mt=x.useMemo(()=>R?{position:Ge,[Pt]:Et,[At]:Ct}:{position:Ge,...St},[R,Ge,Pt,Et,At,Ct,St]),Fe=x.useRef(null);ce(()=>{if(!g)return;const z=y.current,K=typeof z=="function"?z():z,Z=(Zt(K)?K.current:K)||null||null;Z!==Fe.current&&(xe.setPositionReference(Z),Fe.current=Z)},[g,xe,S,y]),x.useEffect(()=>{if(!g)return;const z=y.current;typeof z!="function"&&Zt(z)&&z.current!==Fe.current&&(xe.setPositionReference(z.current),Fe.current=z.current)},[g,xe,S,y]),x.useEffect(()=>{if(d&&g&&Te.domReference&&Te.floating)return Gt(Te.domReference,Te.floating,Le,Ke)},[d,g,Te,Le,Ke]);const Pe=J(Ot),It=En(o,Pe,I),kt=me(Ot)||"center",Dt=!!ye.hide?.referenceHidden;ce(()=>{C&&g&&Se&&T(Pe)},[C,g,Se,Pe]);const Lt=x.useMemo(()=>({position:"absolute",top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Ft=ye.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Mt,arrowStyles:Lt,arrowRef:Y,arrowUncentered:Ft,side:It,align:kt,physicalSide:Pe,anchorHidden:Dt,refs:xe,context:Tt,isPositioned:Se,update:Le}),[Mt,Lt,Y,Ft,It,kt,Pe,Dt,xe,Tt,Se,Le])}function Zt(e){return e!=null&&"current"in e}const Zs=x.createContext(void 0);function er(e){return x.useContext(Zs)}function Cn(e){return e==="starting"?Kn:nn}const On=x.createContext(void 0);function De(e){const t=x.useContext(On);if(t===void 0&&!e)throw new Error(ke(47));return t}function tr(){return{...eo(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const nr={...qn,disabled:se(e=>e.disabled),instantType:se(e=>e.instantType),openMethod:se(e=>e.openMethod),openChangeReason:se(e=>e.openChangeReason),modal:se(e=>e.modal),stickIfOpen:se(e=>e.stickIfOpen),titleElementId:se(e=>e.titleElementId),descriptionElementId:se(e=>e.descriptionElementId),openOnHover:se(e=>e.openOnHover),closeDelay:se(e=>e.closeDelay),hasViewport:se(e=>e.hasViewport)};class yt extends Gn{constructor(t){const n={...tr(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),stickIfOpenTimeout:new ln,triggerElements:new cn},nr)}setOpen=(t,n)=>{const o=n.reason===ee,s=n.reason===be&&n.event.detail===0,r=!t&&(n.reason===Jn||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const a=()=>{const u={open:t,openChangeReason:n.reason},c=n.trigger?.id??null;(c||t)&&(u.activeTriggerId=c,u.activeTriggerElement=n.trigger??null),this.update(u)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Qn,()=>{this.set("stickIfOpen",!1)}),Me.flushSync(a)):a(),s||r?this.set("instantType",s?"click":"dismiss"):n.reason===st?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const o=rn(()=>new yt(n)).current,s=t??o;return Zn(o.disposeEffect),s}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function en({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:r,modal:i=!1,handle:l,triggerId:a,defaultTriggerId:u=null}=e,c=yt.useStore(l?.store,{open:n??o,modal:i,activeTriggerId:a!==void 0?a:u});c.useControlledProp("open",n,o),c.useControlledProp("activeTriggerId",a,u);const f=c.useState("open"),d=c.useState("positionerElement"),p=c.useState("payload"),g=c.useState("openChangeReason");c.useContextCallback("onOpenChange",s),c.useContextCallback("onOpenChangeComplete",r);const{openMethod:m,triggerProps:b,reset:E}=no(f);oo(c);const{forceUnmount:R}=so(f,c,()=>{c.update({stickIfOpen:!0,openChangeReason:null}),E()});ro(f&&i===!0&&g!==ee&&m!=="touch",d),x.useEffect(()=>{f||c.context.stickIfOpenTimeout.clear()},[c,f]);const C=x.useCallback(I=>{const F=G(I);return F.preventUnmountOnClose=()=>{c.set("preventUnmountingOnClose",!0)},F},[c]),h=x.useCallback(()=>{c.setOpen(!1,C(io))},[c,C]);x.useImperativeHandle(e.actionsRef,()=>({unmount:R,close:h}),[R,h]);const O=co({popupStore:c,onOpenChange:c.setOpen}),T=ao(O,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),w=lo(O),{getReferenceProps:k,getFloatingProps:$,getTriggerProps:A}=un([T,w]),L=x.useMemo(()=>k(b),[k,b]),S=x.useMemo(()=>A(b),[A,b]),y=x.useMemo(()=>$(),[$]);c.useSyncedValues({modal:i,openMethod:m,activeTriggerProps:L,inactiveTriggerProps:S,popupProps:y,floatingRootContext:O,nested:ut()!=null});const D=x.useMemo(()=>({store:c}),[c]);return X.jsx(On.Provider,{value:D,children:typeof t=="function"?t({payload:p}):t})}function ur(e){return De(!0)?X.jsx(en,{props:e}):X.jsx(to,{children:X.jsx(en,{props:e})})}const or=300,dr=x.forwardRef(function(t,n){const{render:o,className:s,disabled:r=!1,nativeButton:i=!0,handle:l,payload:a,openOnHover:u=!1,delay:c=or,closeDelay:f=0,id:d,...p}=t,g=De(!0),m=l?.store??g?.store;if(!m)throw new Error(ke(74));const b=fo(d),E=m.useState("isTriggerActive",b),R=m.useState("floatingRootContext"),C=m.useState("isOpenedByTrigger",b),h=x.useRef(null),{registerTrigger:O,isMountedByThisTrigger:T}=uo(b,h,m,{payload:a,disabled:r,openOnHover:u,closeDelay:f}),w=m.useState("openChangeReason"),k=m.useState("stickIfOpen"),$=m.useState("openMethod"),A=$s(R,{enabled:R!=null&&u&&($!=="touch"||w!==be),mouseOnly:!0,move:!1,handleClose:Ws(),restMs:c,delay:{close:f},triggerElementRef:h,isActiveTrigger:E}),L=No(R,{enabled:R!=null,stickIfOpen:k}),S=un([L]),y=m.useState("triggerProps",T),D=x.useMemo(()=>({disabled:r,open:C}),[r,C]),{getButtonProps:I,buttonRef:F}=Ys({disabled:r,native:i}),M=x.useMemo(()=>({open(W){return W&&w===be?go.open(W):po.open(W)}}),[w]),v=gt("button",t,{state:D,ref:[F,n,O,h],props:[S.getReferenceProps(),A,y,{[mo]:"",id:b},p,I],stateAttributesMapping:M}),P=x.useRef(null),N=q(W=>{Me.flushSync(()=>{m.setOpen(!1,G(st,W.nativeEvent,W.currentTarget))}),ho(P.current)?.focus()}),V=q(W=>{const j=m.select("positionerElement");if(j&&xo(W,j))m.context.beforeContentFocusGuardRef.current?.focus();else{Me.flushSync(()=>{m.setOpen(!1,G(st,W.nativeEvent,W.currentTarget))});let B=yo(m.context.triggerFocusTargetRef.current||h.current);for(;B!==null&&le(j,B);){const Y=B;if(B=Ro(B),B===Y)break}B?.focus()}});return E?X.jsxs(x.Fragment,{children:[X.jsx(Wt,{ref:P,onFocus:N}),X.jsx(x.Fragment,{children:v},b),X.jsx(Wt,{ref:m.context.triggerFocusTargetRef,onFocus:V})]}):X.jsx(x.Fragment,{children:v},b)}),Tn=x.createContext(void 0);function sr(){const e=x.useContext(Tn);if(e===void 0)throw new Error(ke(45));return e}const gr=x.forwardRef(function(t,n){const{keepMounted:o=!1,...s}=t,{store:r}=De();return r.useState("mounted")||o?X.jsx(Tn.Provider,{value:o,children:X.jsx(vo,{ref:n,...s,renderGuards:!1})}):null}),Sn=x.createContext(void 0);function rr(){const e=x.useContext(Sn);if(!e)throw new Error(ke(46));return e}const pr=x.forwardRef(function(t,n){const{render:o,className:s,anchor:r,positionMethod:i="absolute",side:l="bottom",align:a="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:b=bo,...E}=t,{store:R}=De(),C=sr(),h=wo(),O=R.useState("floatingRootContext"),T=R.useState("mounted"),w=R.useState("open"),k=R.useState("openChangeReason"),$=R.useState("activeTriggerElement"),A=R.useState("modal"),L=R.useState("positionerElement"),S=R.useState("instantType"),y=R.useState("transitionStatus"),D=R.useState("hasViewport"),I=x.useRef(null),F=Eo(L,!1,!1),M=Qs({anchor:r,floatingRootContext:O,positionMethod:i,mounted:T,side:l,sideOffset:u,align:a,alignOffset:c,arrowPadding:p,collisionBoundary:f,collisionPadding:d,sticky:g,disableAnchorTracking:m,keepMounted:C,nodeId:h,collisionAvoidance:b,adaptiveOrigin:D?Js:void 0}),v=x.useMemo(()=>{const B={};return w||(B.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...M.positionerStyles,...B}}},[w,T,M.positionerStyles]),P=x.useMemo(()=>({props:v,...M}),[v,M]),N=O?.select("domReferenceElement");ce(()=>{const B=N,Y=I.current;if(B&&(I.current=B),Y&&B&&B!==Y){R.set("instantType",void 0);const H=new AbortController;return F(()=>{R.set("instantType","trigger-change")},H.signal),()=>{H.abort()}}},[N,F,R]);const V=x.useMemo(()=>({open:w,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:S}),[w,P.side,P.align,P.anchorHidden,S]),W=x.useCallback(B=>{R.set("positionerElement",B)},[R]),j=gt("div",t,{state:V,props:[P.props,Cn(y),E],ref:[n,W],stateAttributesMapping:dn});return X.jsxs(Sn.Provider,{value:P,children:[T&&A===!0&&k!==ee&&X.jsx(Co,{ref:R.context.internalBackdropRef,inert:Oo(!w),cutout:$}),X.jsx(To,{id:h,children:j})]})}),ir={...dn,...Ao},mr=x.forwardRef(function(t,n){const{className:o,render:s,initialFocus:r,finalFocus:i,...l}=t,{store:a}=De(),u=rr(),c=er()!=null,f=a.useState("open"),d=a.useState("openMethod"),p=a.useState("instantType"),g=a.useState("transitionStatus"),m=a.useState("popupProps"),b=a.useState("titleElementId"),E=a.useState("descriptionElementId"),R=a.useState("modal"),C=a.useState("mounted"),h=a.useState("openChangeReason"),O=a.useState("activeTriggerElement"),T=a.useState("floatingRootContext");So({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}});const w=a.useState("disabled"),k=a.useState("openOnHover"),$=a.useState("closeDelay");Fs(T,{enabled:k&&!w,closeDelay:$});function A(I){return I==="touch"?a.context.popupRef.current:!0}const L=r===void 0?A:r,S=x.useMemo(()=>({open:f,side:u.side,align:u.align,instant:p,transitionStatus:g}),[f,u.side,u.align,p,g]),y=x.useCallback(I=>{a.set("popupElement",I)},[a]),D=gt("div",t,{state:S,ref:[n,a.context.popupRef,y],props:[m,{"aria-labelledby":b,"aria-describedby":E,onKeyDown(I){c&&Mo.has(I.key)&&I.stopPropagation()}},Cn(g),l],stateAttributesMapping:ir});return X.jsx(Po,{context:T,openInteractionType:d,modal:R==="trap-focus",disabled:!C||h===ee,initialFocus:L,returnFocus:i,restoreFocus:"popup",previousFocusableElement:ge(O)?O:void 0,nextFocusableElement:a.context.triggerFocusTargetRef,beforeContentFocusGuardRef:a.context.beforeContentFocusGuardRef,children:D})});export{lr as C,fr as L,ur as P,dr as a,gr as b,pr as c,mr as d,Ms as e,He as f,No as g,Qs as h,er as i,Cn as j,Ys as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as r}from"./main-DI2Gl9e0.js";function i({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function h({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function d({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function x({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function s({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function a({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function C({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function u({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:[r.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),r.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function v({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function g({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 64 60",fill:"none",className:e,"aria-hidden":"true",children:[r.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),r.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:r.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),r.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:r.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function f({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function j({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",className:e,children:r.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function w({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",children:r.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:r.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function L({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),r.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),r.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),r.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function I({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function p({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[r.jsx("path",{d:"M9 3v2"}),r.jsx("path",{d:"M15 3v2"}),r.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),r.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("path",{d:"M9 16h6"})]})}const M={CLAUDE:i,CODEBUDDY:g,CODEX:h,COPILOT:v,CRAFT:w,CURSOR:d,DROID:p,GEMINI:x,GITHUB:j,GROK:s,HERMES:f,KIMI:u,KIRO:a,OPENCODE:C,OMP:L,PI:I},R={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function m({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:r.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function B({provider:t,size:e=16,color:O,className:o=""}){const n=t?.toUpperCase?.()||"",l=R[n];if(l)return r.jsx("img",{src:l,alt:"",width:e,height:e,className:o,style:{width:e,height:e,objectFit:"contain"},"aria-hidden":!0});const c=M[n];return c?r.jsx(c,{size:e,className:o}):r.jsx(m,{size:e,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${o}`})}export{B as P};
|
|
1
|
+
import{C as r}from"./main-BxEGiBWd.js";function i({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function h({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function d({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function x({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function s({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function a({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function C({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function u({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:[r.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),r.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function v({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:e,children:r.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function g({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 64 60",fill:"none",className:e,"aria-hidden":"true",children:[r.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),r.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:r.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),r.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:r.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function f({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:e,children:r.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function j({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor",className:e,children:r.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function w({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",children:r.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:r.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function L({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),r.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),r.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),r.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function I({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 120 90",fill:"currentColor",className:e,children:[r.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),r.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),r.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function p({size:t=16,className:e=""}){return r.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[r.jsx("path",{d:"M9 3v2"}),r.jsx("path",{d:"M15 3v2"}),r.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),r.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),r.jsx("path",{d:"M9 16h6"})]})}const M={CLAUDE:i,CODEBUDDY:g,CODEX:h,COPILOT:v,CRAFT:w,CURSOR:d,DROID:p,GEMINI:x,GITHUB:j,GROK:s,HERMES:f,KIMI:u,KIRO:a,OPENCODE:C,OMP:L,PI:I},R={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function m({size:t=16,className:e=""}){return r.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:r.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function B({provider:t,size:e=16,color:O,className:o=""}){const n=t?.toUpperCase?.()||"",l=R[n];if(l)return r.jsx("img",{src:l,alt:"",width:e,height:e,className:o,style:{width:e,height:e,objectFit:"contain"},"aria-hidden":!0});const c=M[n];return c?r.jsx(c,{size:e,className:o}):r.jsx(m,{size:e,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${o}`})}export{B as P};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as v,r as l,b as Y,f as q,ap as L,C as t,D as A,S as x,B as s,U as J,ae as Q,aq as X,af as ee,ag as te,ah as O,ar as ne,as as ae,T as ie,R as se,P as oe,Q as re,Y as le,at as ce,au as ue,av as de,aw as ge,H as he,ax as pe,ay as be,az as me,aA as fe,aB as xe,aC as ye,aD as ve,a9 as ke}from"./main-BxEGiBWd.js";import{L as je,a as G,u as Ne}from"./use-limits-display-prefs-CURfR0MZ.js";import{S as k,T as j,a as m,b as Se,u as I}from"./use-native-settings-DGrotRHu.js";import{C as we}from"./check-RuSQWKRD.js";import{u as Ce}from"./useCurrency-D8u07QhU.js";import{C as P}from"./chevron-down-B8adPDrY.js";import{I as Le}from"./info-D4jwUaj6.js";import{D as Ge}from"./download-BRpX0naV.js";import"./Card-BTDfcH7p.js";const Ee=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ae=v("activity",Ee);const Oe=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ie=v("copy",Oe);const Pe=[["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"}]],_e=v("grip-vertical",Pe);const De=[["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"}]],Te=v("languages",De);const Ue=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Me=v("log-out",Ue);const Re=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Fe=v("pencil",Re),He=e=>!e.isLayoutDirty&&e.willUpdate(!1);function E(){const e=new Set,n=new WeakMap,i=()=>e.forEach(He);return{add:a=>{e.add(a),n.set(a,a.addEventListener("willUpdate",i))},remove:a=>{e.delete(a);const o=n.get(a);o&&(o(),n.delete(a)),i()},dirty:i}}const $e=l.createContext(null);function Be(){const e=l.useRef(!1);return Y(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ze(){const e=Be(),[n,i]=l.useState(0),a=l.useCallback(()=>{e.current&&i(n+1)},[n]);return[l.useCallback(()=>q.postRender(a),[a]),n]}const _=e=>e===!0,Ve=e=>_(e===!0)||e==="id",Ze=({children:e,id:n,inherit:i=!0})=>{const a=l.useContext(L),o=l.useContext($e),[r,c]=ze(),u=l.useRef(null),g=a.id||o;u.current===null&&(Ve(i)&&g&&(n=n?g+"-"+n:g),u.current={id:n,group:_(i)&&a.group||E()});const h=l.useMemo(()=>({...u.current,forceRender:r}),[c]);return t.jsx(L.Provider,{value:h,children:e})},We=new Set(["cursor","kiro","copilot","kimi"]);function Ke({checked:e,onChange:n,ariaLabel:i}){return t.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,onClick:n,className:x("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:t.jsx("span",{className:x("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}function Ye({prefs:e}){const{order:n,visibility:i,toggle:a,moveToward:o}=e,[r,c]=l.useState(null),[u,g]=l.useState(null),h=d=>p=>{c(d),p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",d)},b=d=>p=>{p.preventDefault(),p.dataTransfer.dropEffect="move",r&&r!==d&&u!==d&&(g(d),o(r,d))},f=()=>{c(null),g(null)},y=d=>{d.preventDefault(),c(null),g(null)};return t.jsx(Ze,{children:t.jsx("div",{className:"flex flex-col",children:n.map(d=>{const p=i[d]!==!1,N=r===d;return t.jsxs(A.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},draggable:!0,onDragStart:h(d),onDragOver:b(d),onDragEnd:f,onDrop:y,className:x("flex items-center gap-3 py-2 rounded-md","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60",N&&"opacity-40"),style:{cursor:N?"grabbing":"grab"},children:[t.jsx(_e,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),t.jsx("img",{src:je[d],alt:"",width:18,height:18,className:x("h-[18px] w-[18px] shrink-0 pointer-events-none",We.has(d)&&"dark:invert"),draggable:!1}),t.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200 select-none",children:G[d]}),t.jsx("div",{onMouseDown:S=>S.stopPropagation(),draggable:!1,children:t.jsx(Ke,{checked:p,onChange:()=>a(d),ariaLabel:`${s("limits.settings.toggle_visible")}: ${G[d]}`})})]},d)})})})}function qe(e){if(!e||typeof e!="object")return"";const n=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},i=e.profile&&typeof e.profile=="object"?e.profile:{},a=n.full_name||n.name||i.name||n.user_name||n.preferred_username;return typeof a=="string"&&a.trim()?a.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function Je(e){return!e||typeof e!="object"?"":typeof e.email=="string"?e.email.trim():""}function Qe(e){const n=typeof e=="string"?e.trim():"";if(!n)return null;const i=n.match(/^@?([A-Za-z0-9][A-Za-z0-9-]{0,38})$/),a=n.match(/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})\/?$/i),o=i?.[1]||a?.[1];return o?`https://github.com/${o}`:null}function w(e,n){console.warn(`[tokentracker] settings ${e}:`,n)}function Xe(e,n,i){const[a,o]=l.useState(()=>Q()),r=n&&i&&X(),c=l.useCallback(async()=>{const u=!a;if(ee(u),o(u),!!u)try{await te(()=>e())}catch(g){w("cloud sync",g)}},[a,e]);return{cloudSyncOn:a,handleCloudSyncToggle:c,showLocalCloudSync:r}}function et(e){const[n,i]=l.useState(!1),[a,o]=l.useState(!1),[r,c]=l.useState(!1),[u,g]=l.useState(!1),[h,b]=l.useState(null),[f,y]=l.useState(!1),[d,p]=l.useState(""),[N,S]=l.useState(!1),[M,C]=l.useState(""),[R,F]=l.useState(""),[H,$]=l.useState(!1),[B,z]=l.useState(null),V=l.useMemo(()=>qe(e),[e]),Z=l.useMemo(()=>Je(e),[e]),W=l.useMemo(()=>typeof e?.id=="string"?e.id.trim():"",[e]),K=l.useMemo(()=>({setAnonymousOn:o,setCustomDisplayName:b,setGithubUrl:C,setProfileLoading:c,setPublicProfileOn:i,setShowGithubOn:S}),[]);return{anonymousOn:a,customDisplayName:h,displayName:V,editingGithub:H,editingName:f,email:Z,githubError:B,githubInput:R,githubUrl:M,loadSetters:K,nameInput:d,profileLoading:r,profileSaving:u,publicProfileOn:n,setAnonymousOn:o,setCustomDisplayName:b,setEditingGithub:$,setEditingName:y,setGithubError:z,setGithubInput:F,setGithubUrl:C,setNameInput:p,setProfileLoading:c,setProfileSaving:g,setPublicProfileOn:i,setShowGithubOn:S,showGithubOn:N,userId:W}}function tt(e,n,i){l.useEffect(()=>{if(!n)return;let a=!0;return i.setProfileLoading(!0),(async()=>{try{const o=await O({getAccessToken:e});if(!a||!o)return;const r=await ne({accessToken:o});if(!a)return;i.setPublicProfileOn(!!r?.enabled),i.setAnonymousOn(!!r?.anonymous),r?.display_name&&i.setCustomDisplayName(r.display_name),i.setShowGithubOn(!!r?.show_github_url),i.setGithubUrl(r?.github_url||"")}catch(o){w("load public profile",o)}finally{a&&i.setProfileLoading(!1)}})(),()=>{a=!1}},[e,n,i])}function nt(e,n){return l.useCallback(async(i,{label:a,onError:o,onSuccess:r}={})=>{if(n.profileSaving)return!1;n.setProfileSaving(!0);try{const c=await O({getAccessToken:e});if(!c)return!1;const u=await ae({accessToken:c,...i});return r?.(u),!0}catch(c){return o?o(c):w(a||"mutate profile",c),!1}finally{n.setProfileSaving(!1)}},[e,n])}function at(e,n){return{anonymousOn:e.anonymousOn,customDisplayName:e.customDisplayName,displayName:e.displayName,editingName:e.editingName,handleAnonymousToggle:n.handleAnonymousToggle,handleSaveName:n.handleSaveName,nameInput:e.nameInput,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingName:e.setEditingName,setNameInput:e.setNameInput,startEditingName:n.startEditingName}}function it(e,n){return{editingGithub:e.editingGithub,githubError:e.githubError,githubInput:e.githubInput,githubUrl:e.githubUrl,handleSaveGithub:n.handleSaveGithub,handleShowGithubToggle:n.handleShowGithubToggle,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingGithub:e.setEditingGithub,setGithubError:e.setGithubError,setGithubInput:e.setGithubInput,showGithubOn:e.showGithubOn,startEditingGithub:n.startEditingGithub}}function st(e,n){const i=l.useCallback(async()=>{const o=!e.publicProfileOn;await n({enabled:o},{label:"toggle public profile",onSuccess:()=>e.setPublicProfileOn(o)})},[n,e]);return{handleAnonymousToggle:l.useCallback(async()=>{const o=!e.anonymousOn;await n({anonymous:o},{label:"toggle anonymous",onSuccess:()=>e.setAnonymousOn(o)})},[n,e]),handlePublicProfileToggle:i}}function ot(e,n){const i=l.useCallback(async()=>{const o=e.nameInput.trim().slice(0,50);o&&await n({display_name:o},{label:"save display name",onSuccess:()=>{e.setCustomDisplayName(o),e.setEditingName(!1)}})},[n,e]),a=l.useCallback(()=>{e.setNameInput(e.customDisplayName||e.displayName),e.setEditingName(!0)},[e]);return{handleSaveName:i,startEditingName:a}}function rt(e,n){const i=l.useCallback(async()=>{if(!e.showGithubOn&&!e.githubUrl){e.setEditingGithub(!0),e.setGithubInput(""),e.setGithubError(null);return}const r=!e.showGithubOn;await n({show_github_url:r},{label:"toggle GitHub profile",onSuccess:()=>e.setShowGithubOn(r)})},[n,e]),a=l.useCallback(async()=>{const r=Qe(e.githubInput);if(e.githubInput.trim()&&!r){e.setGithubError(s("settings.account.githubUrlInvalid"));return}e.setGithubError(null),await n({github_url:r,show_github_url:!!r},{label:"save GitHub profile",onError:c=>e.setGithubError(c?.message||s("settings.account.githubUrlInvalid")),onSuccess:c=>{e.setGithubUrl(c?.github_url||r||""),e.setShowGithubOn(!!r),e.setEditingGithub(!1)}})},[n,e]),o=l.useCallback(()=>{e.setGithubInput(e.githubUrl),e.setGithubError(null),e.setEditingGithub(!0)},[e]);return{handleSaveGithub:a,handleShowGithubToggle:i,startEditingGithub:o}}function lt(){const e=J(),n=et(e.user),i=Xe(e.getAccessToken,e.enabled,e.signedIn);tt(e.getAccessToken,e.signedIn,n.loadSetters);const a=nt(e.getAccessToken,n),o=st(n,a),r=ot(n,a),c=rt(n,a);return{...e,...i,email:n.email,handlePublicProfileToggle:o.handlePublicProfileToggle,userId:n.userId,name:at(n,{...o,...r}),github:it(n,c),profileLoading:n.profileLoading,profileSaving:n.profileSaving,publicProfileOn:n.publicProfileOn}}function D({disabled:e,onCancel:n,onSave:i,saveLabel:a=s("settings.account.save")}){return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:i,disabled:e,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:a}),t.jsx("button",{type:"button",onClick:n,className:"rounded-md px-2 py-1.5 text-xs text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:s("settings.account.cancel")})]})}function ct({nameInput:e,setEditingName:n,setNameInput:i,profileSaving:a,handleSaveName:o}){return t.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[t.jsx("input",{type:"text",value:e,onChange:r=>i(r.target.value),onKeyDown:r=>{r.key==="Enter"&&o(),r.key==="Escape"&&n(!1)},maxLength:50,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.displayName")}),t.jsx(D,{disabled:a||!e.trim(),onCancel:()=>n(!1),onSave:o,saveLabel:a?s("settings.account.saving"):void 0})]})}function ut({githubError:e,githubInput:n,handleSaveGithub:i,profileSaving:a,setEditingGithub:o,setGithubError:r,setGithubInput:c}){return t.jsxs("div",{className:"mt-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"text",value:n,onChange:u=>{c(u.target.value),e&&r(null)},onKeyDown:u=>{u.key==="Enter"&&i(),u.key==="Escape"&&(o(!1),r(null))},maxLength:100,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.githubUrlPlaceholder")}),t.jsx(D,{disabled:a,onCancel:()=>{o(!1),r(null)},onSave:i,saveLabel:a?s("settings.account.saving"):void 0})]}),e?t.jsx("div",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:e}):null]})}function T({disabled:e=!1,label:n,onClick:i,title:a}){return t.jsxs("button",{type:"button",onClick:i,disabled:e,title:a,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-40 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[t.jsx(Fe,{className:"h-3.5 w-3.5","aria-hidden":!0}),n]})}function U({actions:e,editing:n,editor:i,hint:a,label:o}){return t.jsx("div",{className:"py-3",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:o}),n?i:t.jsx("div",{className:"mt-0.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a})]}),n?null:e]})})}function dt({name:e}){const n=e.anonymousOn?s("settings.account.displayNameDisabledWhileAnon"):void 0;return t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsx(T,{disabled:e.anonymousOn,label:s("settings.account.edit"),onClick:e.startEditingName,title:n}),t.jsx(j,{checked:!e.anonymousOn,onChange:e.handleAnonymousToggle,disabled:e.profileLoading||e.profileSaving,ariaLabel:s("settings.account.displayName")})]})}function gt({name:e}){const{anonymousOn:n,customDisplayName:i,displayName:a,editingName:o,handleAnonymousToggle:r,handleSaveName:c,nameInput:u,profileLoading:g,profileSaving:h,setEditingName:b,setNameInput:f,startEditingName:y}=e,d=n?s("settings.account.displayNameAnonymousHint"):i||a;return t.jsx(U,{label:s("settings.account.displayName"),editing:o,hint:d,editor:t.jsx(ct,{nameInput:u,setEditingName:b,setNameInput:f,profileSaving:h,handleSaveName:c}),actions:t.jsx(dt,{name:e})})}function ht({github:e}){const{editingGithub:n,githubError:i,githubInput:a,githubUrl:o,handleSaveGithub:r,handleShowGithubToggle:c,profileLoading:u,profileSaving:g,setEditingGithub:h,setGithubError:b,setGithubInput:f,showGithubOn:y,startEditingGithub:d}=e;return t.jsx(U,{label:s("settings.account.githubUrl"),editing:n,hint:o||s("settings.account.githubUrlHint"),editor:t.jsx(ut,{githubError:i,githubInput:a,handleSaveGithub:r,profileSaving:g,setEditingGithub:h,setGithubError:b,setGithubInput:f}),actions:t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsx(T,{label:s("settings.account.edit"),onClick:d}),t.jsx(j,{checked:y,onChange:c,disabled:u||g,ariaLabel:s("settings.account.githubUrl")})]})})}function pt(){const{openLoginModal:e}=ie();return t.jsx(k,{title:s("settings.section.account"),children:t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[t.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.account.signedOutHint")}),t.jsx("button",{type:"button",onClick:e,className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md bg-oai-gray-900 px-4 text-xs font-medium text-white transition-colors hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100",children:s("settings.account.signIn")})]})})}function bt({name:e,github:n}){return t.jsxs(t.Fragment,{children:[t.jsx(gt,{name:e}),t.jsx(ht,{github:n})]})}function mt(){const e=lt();return e.enabled?e.signedIn?t.jsxs(k,{title:s("settings.section.account"),subtitle:e.email||e.name.customDisplayName||e.name.displayName,action:t.jsx(xt,{onSignOut:e.signOut}),children:[t.jsx(ft,{userId:e.userId}),t.jsx(yt,{settings:e}),t.jsx(vt,{checked:e.publicProfileOn,disabled:e.profileLoading||e.profileSaving,onChange:e.handlePublicProfileToggle}),t.jsx(kt,{visible:e.publicProfileOn,name:e.name,github:e.github})]}):t.jsx(pt,{}):null}function ft({userId:e}){const[n,i]=se.useState(!1);if(!e)return null;const a=async()=>{try{if(typeof navigator>"u"||!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(e),i(!0),globalThis.setTimeout(()=>i(!1),1200)}catch{i(!1)}};return t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:s("settings.account.userId")}),t.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e})]}),t.jsxs("button",{type:"button",onClick:a,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800","aria-label":s("settings.account.copyUserId"),children:[n?t.jsx(we,{className:"h-3.5 w-3.5","aria-hidden":!0}):t.jsx(Ie,{className:"h-3.5 w-3.5","aria-hidden":!0}),n?s("settings.account.copied"):s("settings.account.copy")]})]})}function xt({onSignOut:e}){return t.jsxs("button",{type:"button",onClick:()=>e(),className:"inline-flex h-7 items-center gap-1.5 text-xs font-medium text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:[t.jsx(Me,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.account.signOut")]})}function yt({settings:e}){return e.showLocalCloudSync?t.jsx(m,{label:s("settings.account.cloudSync"),hint:s("settings.account.cloudSyncHint"),control:t.jsx(j,{checked:e.cloudSyncOn,onChange:e.handleCloudSyncToggle,ariaLabel:s("settings.account.cloudSync")})}):null}function vt({checked:e,disabled:n,onChange:i}){return t.jsx(m,{label:s("settings.account.publicProfile"),hint:s("settings.account.publicProfileHint"),control:t.jsx(j,{checked:e,onChange:i,disabled:n,ariaLabel:s("settings.account.publicProfile")})})}function kt({visible:e,name:n,github:i}){return t.jsx(oe,{initial:!1,children:e?t.jsx(A.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.28,ease:[.22,1,.36,1]},opacity:{duration:.2,ease:[.22,1,.36,1]}},style:{overflow:"hidden"},className:"divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:t.jsx(bt,{name:n,github:i})},"public-profile-fields"):null})}function jt(){return[{value:"light",label:s("settings.appearance.theme.light"),Icon:ce},{value:"dark",label:s("settings.appearance.theme.dark"),Icon:ue},{value:"system",label:s("settings.appearance.theme.system"),Icon:de}]}function Nt(){return[{value:pe,label:s("settings.appearance.language.system")},{value:be,label:s("settings.appearance.language.english")},{value:me,label:s("settings.appearance.language.chinese")},{value:fe,label:s("settings.appearance.language.traditional_chinese")},{value:xe,label:s("settings.appearance.language.japanese")},{value:ye,label:s("settings.appearance.language.korean")}]}function St(e){if(!e)return null;try{const n=new Date(e);return Number.isNaN(n.getTime())?null:n.toLocaleString()}catch{return null}}function wt(e,n){const i=s(`settings.appearance.currency.rate_source.${e}`),a=St(n),o=a?s("settings.appearance.currency.rate_updated",{when:a}):s("settings.appearance.currency.rate_never");return`${i} · ${o}`}function Ct({locale:e,setLocale:n}){const i=Nt();return t.jsxs("div",{className:"relative inline-flex",children:[t.jsx(Te,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0}),t.jsx("select",{value:e,onChange:a=>n(a.target.value),"aria-label":s("settings.appearance.language.label"),className:x("appearance-none rounded-lg border border-oai-gray-200 bg-white py-1.5 pl-8 pr-8 text-xs font-medium text-oai-black","transition-colors hover:bg-oai-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500","dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:bg-oai-gray-800"),children:i.map(a=>t.jsx("option",{value:a.value,children:a.label},a.value))}),t.jsx(P,{className:"pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]})}function Lt({currency:e,setCurrency:n}){const i=ge();return t.jsxs("div",{className:"relative inline-flex",children:[t.jsx("select",{value:e,onChange:a=>n(a.target.value),"aria-label":s("settings.appearance.currency.label"),className:x("appearance-none rounded-lg border border-oai-gray-200 bg-white py-1.5 pl-3 pr-8 text-xs font-medium text-oai-black","transition-colors hover:bg-oai-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500","dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:bg-oai-gray-800"),children:i.map(a=>t.jsx("option",{value:a.code,children:s(a.labelKey)},a.code))}),t.jsx(P,{className:"pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]})}function Gt({currency:e,rate:n,rateSource:i,rateFetchedAt:a}){if(e===he)return t.jsx(t.Fragment,{children:s("settings.appearance.currency.hint")});const o=wt(i,a);return t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx("span",{children:`1 USD = ${n.toFixed(4)} ${e}`}),t.jsx("span",{role:"img","aria-label":o,title:o,className:"inline-flex h-4 w-4 cursor-help items-center justify-center text-oai-gray-400 hover:text-oai-gray-600 dark:text-oai-gray-500 dark:hover:text-oai-gray-300",children:t.jsx(Le,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function Et(){const{theme:e,setTheme:n}=re(),{locale:i,setLocale:a}=le(),{currency:o,rate:r,rateSource:c,rateFetchedAt:u,setCurrency:g}=Ce();return t.jsxs(k,{title:s("settings.section.appearance"),children:[t.jsx(m,{label:s("settings.appearance.theme.label"),hint:s("settings.appearance.theme.hint"),control:t.jsx(Se,{options:jt(),value:e,onChange:n})}),t.jsx(m,{label:s("settings.appearance.language.label"),hint:s("settings.appearance.language.hint"),control:t.jsx(Ct,{locale:i,setLocale:a})}),t.jsx(m,{label:s("settings.appearance.currency.label"),hint:t.jsx(Gt,{currency:o,rate:r,rateSource:c,rateFetchedAt:u}),control:t.jsx(Lt,{currency:o,setCurrency:g})})]})}function At(){const{available:e,settings:n,setSetting:i,runAction:a}=I();if(!e)return null;const o=!!n?.launchAtLogin,r=n?.launchAtLoginSupported!==!1,c=n?.updateStatus||null,u=!!n?.updateBusy,g=!!n?.isSyncing;return t.jsxs(k,{title:s("settings.section.menubar"),children:[r?t.jsx(m,{label:s("settings.menubar.launchAtLogin"),hint:s("settings.menubar.launchAtLoginHint"),control:t.jsx(j,{checked:o,onChange:()=>i("launchAtLogin",!o),ariaLabel:s("settings.menubar.launchAtLogin")})}):null,t.jsx(m,{label:s("settings.menubar.syncNow"),hint:s("settings.menubar.syncNowHint"),control:t.jsxs("button",{type:"button",onClick:()=>a("syncNow"),disabled:g,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[t.jsx(ve,{className:x("h-3.5 w-3.5",g&&"animate-spin"),"aria-hidden":!0}),g?s("settings.menubar.syncing"):s("settings.menubar.syncNow")]})}),t.jsx(m,{label:s("settings.menubar.updates"),hint:c||void 0,control:t.jsxs("button",{type:"button",onClick:()=>a("checkForUpdates"),disabled:u,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[t.jsx(Ge,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.menubar.checkUpdates")]})})]})}function Ot(){const{available:e,settings:n,runAction:i}=I(),a=e&&n?.version;return t.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:[a?t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:["TokenTrackerBar v",n.version]}),t.jsx("span",{"aria-hidden":!0,children:"·"}),t.jsx("button",{type:"button",onClick:()=>i("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"}),t.jsx("span",{"aria-hidden":!0,children:"·"})]}):null,t.jsxs("a",{href:ke,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:[t.jsx(Ae,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.footer.statusPage")]})]})}function Ht(){const e=Ne();return t.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:t.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:t.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:s("settings.page.title")}),t.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.page.subtitle")})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(Et,{}),t.jsx(At,{}),t.jsx(mt,{}),t.jsx(k,{title:s("settings.section.limits"),children:t.jsx(Ye,{prefs:e})})]}),t.jsx(Ot,{})]})})})}export{Ht as SettingsPage};
|