cartethyia 2.7.6 → 2.7.7
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/.env.example +4 -2
- package/README.md +25 -1
- package/dist/dashboard/assets/{BannedPage-B1N603cM.js → BannedPage-B05aF8Dg.js} +1 -1
- package/dist/dashboard/assets/BannedPage-B05aF8Dg.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolDetailPage-9q4_4NoK.js → CliToolDetailPage-CLUhmjUy.js} +2 -2
- package/dist/dashboard/assets/CliToolDetailPage-CLUhmjUy.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-DwshGtK-.js → CliToolsPage-CQmrqqrk.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-CQmrqqrk.js.gz +0 -0
- package/dist/dashboard/assets/{CombosPage-D762MIkp.js → CombosPage-CHG_1Wr3.js} +1 -1
- package/dist/dashboard/assets/CombosPage-CHG_1Wr3.js.gz +0 -0
- package/dist/dashboard/assets/{ConsoleLogPage-KRYjHZsX.js → ConsoleLogPage-DPgbklad.js} +1 -1
- package/dist/dashboard/assets/ConsoleLogPage-DPgbklad.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-pnfAqr_-.js +1 -0
- package/dist/dashboard/assets/CustomizationPage-pnfAqr_-.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-DGJuU2A6.js +1 -0
- package/dist/dashboard/assets/HealthEventsModal-DGJuU2A6.js.gz +0 -0
- package/dist/dashboard/assets/{InjectSystemPromptPanel-d5v3K_Yc.js → InjectSystemPromptPanel-C-e2AMz6.js} +2 -2
- package/dist/dashboard/assets/InjectSystemPromptPanel-C-e2AMz6.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-Ccv4tjNS.js → LoginPage-J8wPbmfT.js} +1 -1
- package/dist/dashboard/assets/LoginPage-J8wPbmfT.js.gz +0 -0
- package/dist/dashboard/assets/{OverviewPage-DN9fYNWA.js → OverviewPage-BSQnF2Lp.js} +1 -1
- package/dist/dashboard/assets/OverviewPage-BSQnF2Lp.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-DK_e0FJz.js +7 -0
- package/dist/dashboard/assets/ProviderDetailPage-DK_e0FJz.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-D_a3r6Gc.js +1 -0
- package/dist/dashboard/assets/ProvidersPage-D_a3r6Gc.js.gz +0 -0
- package/dist/dashboard/assets/{ProxyPage-DxjvUzSD.js → ProxyPage-BBTRBAQ3.js} +1 -1
- package/dist/dashboard/assets/ProxyPage-BBTRBAQ3.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-B2WqMSG1.js +1 -0
- package/dist/dashboard/assets/QuotaPage-B2WqMSG1.js.gz +0 -0
- package/dist/dashboard/assets/{SettingsPage-BW4AKj2H.js → SettingsPage-D7xp5Ij_.js} +1 -1
- package/dist/dashboard/assets/SettingsPage-D7xp5Ij_.js.gz +0 -0
- package/dist/dashboard/assets/{SetupPage-44BZrxFC.js → SetupPage-LND6_Ss7.js} +1 -1
- package/dist/dashboard/assets/SetupPage-LND6_Ss7.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-DRPavCdU.js → StudioPage-BzNnm6Bi.js} +2 -2
- package/dist/dashboard/assets/StudioPage-BzNnm6Bi.js.gz +0 -0
- package/dist/dashboard/assets/{UsagePage-B7M7LvMM.js → UsagePage-C1TbL24N.js} +2 -2
- package/dist/dashboard/assets/UsagePage-C1TbL24N.js.gz +0 -0
- package/dist/dashboard/assets/{entry-D6WvojeD.js → entry-vqGb8yVz.js} +3 -3
- package/dist/dashboard/assets/entry-vqGb8yVz.js.gz +0 -0
- package/dist/dashboard/assets/formatters-DP-5E01-.js +1 -0
- package/dist/dashboard/assets/formatters-DP-5E01-.js.gz +0 -0
- package/dist/dashboard/assets/{index-Ko4dLRnV.js → index-D36vCZht.js} +2 -2
- package/dist/dashboard/assets/index-D36vCZht.js.gz +0 -0
- package/dist/dashboard/assets/{select-BHqpd-bg.js → select-C9Ssle9b.js} +1 -1
- package/dist/dashboard/assets/select-C9Ssle9b.js.gz +0 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/dashboard/index.html.gz +0 -0
- package/dist/dashboard/precompressed-assets.json +22 -22
- package/migrations/full-postgres/0043_add_provider_custom_user_agent.sql +14 -0
- package/migrations/lite-sqlite3/0043_add_provider_custom_user_agent.sql +10 -0
- package/package.json +3 -1
- package/src/config/security.ts +1 -1
- package/src/config/spec.ts +13 -6
- package/src/console/cli-tools/cartethyia-websearch-plugin.ts +186 -0
- package/src/console/cli-tools/injectors/opencode.ts +42 -14
- package/src/console/providers/catalog/contracts.ts +4 -0
- package/src/console/providers/catalog/routes.ts +1 -0
- package/src/console/providers/detail/routes.ts +8 -0
- package/src/console/providers/detail/store.ts +4 -0
- package/src/console/quota/account-quota-tenant.ts +74 -0
- package/src/observability/telemetry-buffer.ts +2 -1
- package/src/persistence/boot.ts +13 -4
- package/src/persistence/schema.ts +7 -1
- package/src/protocol/canonical-model.ts +7 -0
- package/src/protocol/request/gemini.ts +20 -1
- package/src/protocol/tool-identity.ts +15 -1
- package/src/providers/default-registry.ts +8 -2
- package/src/providers/discovery/discovery-types.ts +18 -0
- package/src/providers/discovery/probe-phases.ts +45 -0
- package/src/providers/discovery/probing-service.ts +41 -6
- package/src/providers/integrations/antigravity/antigravity-protocol.ts +20 -2
- package/src/providers/integrations/antigravity/antigravity.ts +24 -0
- package/src/providers/integrations/codex/codex.ts +28 -1
- package/src/providers/integrations/qoder/chat-proto.ts +328 -0
- package/src/providers/integrations/qoder/claim-qoder-credits.ts +258 -0
- package/src/providers/integrations/qoder/qoder-adapter.ts +275 -0
- package/src/providers/integrations/qoder/qoder-auth.ts +201 -0
- package/src/providers/integrations/qoder/qoder-body.ts +78 -0
- package/src/providers/integrations/qoder/qoder-catalog.ts +5 -1
- package/src/providers/integrations/qoder/qoder-chat.ts +514 -0
- package/src/providers/integrations/qoder/qoder-cosy.ts +162 -0
- package/src/providers/integrations/qoder/qoder-grpc.ts +667 -0
- package/src/providers/integrations/qoder/qoder-ide.ts +584 -0
- package/src/providers/integrations/qoder/qoder-oauth.ts +4 -4
- package/src/providers/integrations/qoder/qoder-quota.ts +1 -1
- package/src/providers/integrations/qoder/qoder-realm.ts +40 -4
- package/src/providers/integrations/qoder/qoder-types.ts +51 -0
- package/src/providers/integrations/qoder/qoder-umid.ts +123 -8
- package/src/providers/integrations/qoder/qoder.ts +147 -1889
- package/src/providers/provider-contracts.ts +7 -0
- package/src/providers/provider-usage.ts +9 -6
- package/src/security/abuse.ts +5 -5
- package/src/transport/dispatch/upstream.ts +4 -2
- package/src/transport/routing/route-catalog.ts +8 -0
- package/src/transport/routing/route-model.ts +4 -0
- package/src/transport/routing/router.ts +8 -117
- package/dist/dashboard/assets/BannedPage-B1N603cM.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-9q4_4NoK.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-DwshGtK-.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-D762MIkp.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-KRYjHZsX.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-DXsxk5uM.js +0 -1
- package/dist/dashboard/assets/CustomizationPage-DXsxk5uM.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-BEjAjD4F.js +0 -1
- package/dist/dashboard/assets/HealthEventsModal-BEjAjD4F.js.gz +0 -0
- package/dist/dashboard/assets/InjectSystemPromptPanel-d5v3K_Yc.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-Ccv4tjNS.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-DN9fYNWA.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-BY0ieUgz.js +0 -5
- package/dist/dashboard/assets/ProviderDetailPage-BY0ieUgz.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-DNsbfea2.js +0 -1
- package/dist/dashboard/assets/ProvidersPage-DNsbfea2.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-DxjvUzSD.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-OaHScjpX.js +0 -1
- package/dist/dashboard/assets/QuotaPage-OaHScjpX.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-BW4AKj2H.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-44BZrxFC.js.gz +0 -0
- package/dist/dashboard/assets/StudioPage-DRPavCdU.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-B7M7LvMM.js.gz +0 -0
- package/dist/dashboard/assets/entry-D6WvojeD.js.gz +0 -0
- package/dist/dashboard/assets/formatters-u7JPB5BX.js +0 -1
- package/dist/dashboard/assets/formatters-u7JPB5BX.js.gz +0 -0
- package/dist/dashboard/assets/index-Ko4dLRnV.js.gz +0 -0
- package/dist/dashboard/assets/select-BHqpd-bg.js.gz +0 -0
- package/src/providers/integrations/qoder/qoder-text-tools.ts +0 -277
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./jsx-runtime-CXUMngI_.js";import{i as n,n as r,r as i}from"./numbers-CoqpaDMx.js";import{S as a}from"./assert-CidQVoNo.js";import{a as o,t as s,u as c}from"./tokens-COzario9.js";import{t as l}from"./select-C9Ssle9b.js";var u=e(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),d=e(`coins`,[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]),f=[`1h`,`6h`,`12h`,`24h`,`7d`,`30d`,`all`],p=t(),m={"1h":`Last 1 Hour`,"6h":`Last 6 Hours`,"12h":`Last 12 Hours`,"24h":`Last 24 Hours`,"7d":`Last 7 Days`,"30d":`Last 30 Days`,all:`All retained`},h=f.map(e=>({value:e,label:m[e]??e}));function g(e){return m[e]??e}function _({value:e,onChange:t}){return(0,p.jsx)(l,{"aria-label":`Period`,value:e,size:`sm`,className:`w-auto min-w-46 shrink-0 grow-0 basis-auto`,onValueChange:t,options:h.map(e=>({value:e.value,label:e.label}))})}function v(e,t,r){let a=g(e);if(t||r===void 0)return a;let o=r.inputTokens+r.outputTokens;return`${a} · ${n(r.requests)} calls · ${c(o)} tokens · avg ${i(r.avgDurationMs)}`}function y(e){return e!==null&&f.includes(e)?e:`24h`}function b(e){return e===`tokens`||e===`cached`?e:`requests`}function x(e){if(e===null)return s;if(e===`auto`)return-1;let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=o?t:s}function S(e){return e!==null&&a.includes(e)?e:`model`}function C(e){return e==null||!Number.isFinite(e)?`—`:e===0?`$0.00`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function w(e){return e==null||!Number.isFinite(e)?`—`:`${r(e)} CR`}function T(e){return e==null||!Number.isFinite(e)||e<=0?`—`:`${(e>=100?Math.round(e):Math.round(e*10)/10).toLocaleString(`en-US`)} tok/s`}function E(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function D(e){switch(e){case`chat`:return`OpenAI Completions`;case`messages`:return`Anthropic Messages`;case`responses`:return`OpenAI Responses`;case`completion`:return`OpenAI Completions`;default:return e||`—`}}function O(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=Math.max(0,t-n),i=6e4,a=60*i,o=24*a,s=7*o;if(r<a){let e=Math.max(0,Math.floor(r/i));return e<=1?`just now`:`${e}m ago`}if(r<o){let e=Math.floor(r/a);return e<=1?`1h ago`:`${e}h ago`}if(r<s){let e=Math.floor(r/o);return e<=1?`1d ago`:`${e}d ago`}let c=Math.floor(r/s);return c<=1?`1w ago`:`${c}w ago`}export{O as a,E as c,v as d,_ as f,u as h,x as i,C as l,d as m,b as n,w as o,g as p,y as r,T as s,S as t,D as u};
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entry-
|
|
2
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e){return e===`/share`||e.startsWith(`/share/`)?`share`:e===`/console`||e.startsWith(`/console/`)?`console`:`landing`}var t=`modulepreload`,n=function(e){return`/`+e},r={},i=function(e,i,a){let o=Promise.resolve();if(i&&i.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}o=l(i.map(i=>{if(i=n(i,a),i=u(i),i in r)return;r[i]=!0;let o=i.endsWith(`.css`);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.href===i&&(!o||n.rel===`stylesheet`))return}let s=document.createElement(`link`);if(s.rel=o?`stylesheet`:t,o||(s.as=`script`),s.crossOrigin=``,s.href=i,c&&s.setAttribute(`nonce`,c),document.head.appendChild(s),o)return new Promise((e,t)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${i}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},a=document.getElementById(`root`);if(a===null)throw Error(`Dashboard root element is missing`);var o=e(window.location.pathname);o===`console`?i(async()=>{let{mountConsole:e}=await import(`./entry-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entry-vqGb8yVz.js","assets/jsx-runtime-CXUMngI_.js","assets/app-DRnQLhsc.js","assets/app-mweRcsKp.css","assets/terminal-0_IjPWTk.js","assets/numbers-CoqpaDMx.js","assets/use-modal-focus-By7oJoGd.js","assets/dialog-BK-NRr5u.js","assets/assert-CidQVoNo.js","assets/query-keys-YSoQOUh6.js","assets/mutation-GU7XdEjz.js","assets/useMutation-CbCP4w1o.js","assets/dialog-actions-B1axpEg7.js","assets/entry-BMlYJVFj.js","assets/brain-Cwed_72z.js","assets/chevron-right-BXIy5l3h.js","assets/circle-check-BU3v_mFW.js","assets/eye-C_hawfH4.js","assets/house-h9AZlJuT.js","assets/state-DHmEnLa2.js","assets/key-round-UkavsGxp.js","assets/clipboard-button-DfS1ntiq.js","assets/use-clipboard-B0Sy03fE.js","assets/scaling-nWE4Cx8f.js","assets/wrench-B6E1oEuY.js","assets/card-CxDw0lK6.js","assets/download-dRFo5_Wu.js","assets/tokens-COzario9.js","assets/switch-DmZcyTIC.js","assets/entry-Dmx7gBiN.js","assets/arrow-right-Dl5yKnp8.js","assets/log-in-BmRjy60c.js","assets/message-circle-CCxGwRvv.js","assets/shield-check-DVS0Foqh.js","assets/use-reduced-motion-C4B0R6Sz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e){return e===`/share`||e.startsWith(`/share/`)?`share`:e===`/console`||e.startsWith(`/console/`)?`console`:`landing`}var t=`modulepreload`,n=function(e){return`/`+e},r={},i=function(e,i,a){let o=Promise.resolve();if(i&&i.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}o=l(i.map(i=>{if(i=n(i,a),i=u(i),i in r)return;r[i]=!0;let o=i.endsWith(`.css`);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.href===i&&(!o||n.rel===`stylesheet`))return}let s=document.createElement(`link`);if(s.rel=o?`stylesheet`:t,o||(s.as=`script`),s.crossOrigin=``,s.href=i,c&&s.setAttribute(`nonce`,c),document.head.appendChild(s),o)return new Promise((e,t)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${i}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},a=document.getElementById(`root`);if(a===null)throw Error(`Dashboard root element is missing`);var o=e(window.location.pathname);o===`console`?i(async()=>{let{mountConsole:e}=await import(`./entry-vqGb8yVz.js`);return{mountConsole:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({mountConsole:e})=>e(a)):o===`share`?i(()=>import(`./entry-BMlYJVFj.js`).then(()=>void 0),__vite__mapDeps([13,1,2,3,14,5,15,16,17,18,19,20,21,22,23,24,25,26,27,28])):i(async()=>{let{mountLanding:e}=await import(`./entry-Dmx7gBiN.js`);return{mountLanding:e}},__vite__mapDeps([29,1,2,3,4,30,18,31,32,33,34])).then(({mountLanding:e})=>e(a));export{i as t};
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,r as t,t as n}from"./jsx-runtime-CXUMngI_.js";import{f as r}from"./app-DRnQLhsc.js";import{k as i,m as a}from"./numbers-CoqpaDMx.js";import{pt as o}from"./entry-D6WvojeD.js";var s=e(t(),1),c=e(r(),1),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0});function d(e,[t,n]){return Math.min(n,Math.max(t,e))}u(d,`clamp`);var f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=!!(typeof window<`u`&&window.document&&window.document.createElement);function h(e,t,{checkForDefaultPrevented:n=!0}={}){return p(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}p(h,`composeEventHandlers`);function g(e){if(!m)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}p(g,`getOwnerWindow`);function _(e){if(!m)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}p(_,`getOwnerDocument`);function v(e,t=!1){let{activeElement:n}=_(e);if(!n?.nodeName)return null;if(y(n)&&n.contentDocument)return v(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=_(n).getElementById(e);if(t)return t}}return n}p(v,`getActiveElement`);function y(e){return e.tagName===`IFRAME`}p(y,`isFrame`);var b=n(),x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0});function C(e,t){let n=s.createContext(t);n.displayName=e+`Context`;let r=S(e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,b.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=s.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return S(i,`useContext`),[r,i]}S(C,`createContext`);function w(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=S(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,b.jsx)(c.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function c(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return S(c,`useContext`),[o,c]}S(r,`createContext`);let i=S(()=>{let t=n.map(e=>s.createContext(e));return S(function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,T(i,...t)]}S(w,`createContextScope`);function T(...e){let t=e[0];if(e.length===1)return t;let n=S(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return S(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}S(T,`composeContextScopes`);var E=Object.defineProperty,D=(e,t)=>E(e,`name`,{value:t,configurable:!0});function O(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}D(O,`setRef`);function k(...e){return t=>{let n=!1,r=e.map(e=>{let r=O(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():O(e[t],null)}}}}D(k,`composeRefs`);function A(...e){return s.useCallback(k(...e),e)}D(A,`useComposedRefs`);var j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0});function N(e){let t=s.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];te(r)&&typeof ae==`function`&&(r=ae(r._payload)),s.Children.forEach(r,e=>{if(z(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;te(n)&&typeof ae==`function`&&(n=ae(n._payload)),a=I(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=s.cloneElement(a,void 0,c):!o&&s.Children.count(r)===1&&s.isValidElement(r)&&(a=r);let l=a?R(a):void 0,u=A(n,l);if(!a){if(r||r===0)throw Error(o?ie(e):re(e));return r}let d=L(i,a.props??{});return a.type!==s.Fragment&&(d.ref=n?u:l),s.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}M(N,`createSlot`);var P=Symbol.for(`radix.slottable`);function F(e){let t=M(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=P,t}M(F,`createSlottable`);var I=M((e,t)=>{if(`child`in e.props){let t=e.props.child;return s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null}return s.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function L(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}M(L,`mergeProps`);function R(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}M(R,`getElementRef`);function z(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===P}M(z,`isSlottable`);var ee=Symbol.for(`react.lazy`);function te(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ee&&`_payload`in e&&ne(e._payload)}M(te,`isLazyComponent`);function ne(e){return typeof e==`object`&&!!e&&`then`in e}M(ne,`isPromiseLike`);var re=M(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ie=M(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ae=s.use,oe=Object.defineProperty,B=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function se(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=B(e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,b.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let c=e+`CollectionSlot`,l=N(c),u=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(c,n).collectionRef);return(0,b.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=N(d),m=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),c=A(t,o),l=a(d,n);return s.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,b.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return B(h,`useCollection`),[{Provider:o,Slot:u,ItemSlot:m},h,r]}B(se,`createCollection`);var ce=new WeakMap,le=class e extends Map{static{B(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ce.set(this,!0)}set(e,t){return ce.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=fe(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ue(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ue(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ue(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ue(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=de(e,t);return n===-1?void 0:e[n]}B(ue,`at`);function de(e,t){let n=e.length,r=fe(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}B(de,`toSafeIndex`);function fe(e){return e!==e||e===0?0:Math.trunc(e)}B(fe,`toSafeInteger`);function pe(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new le,setItemMap:B(()=>void 0,`setItemMap`)}),o=B(({state:e,...t})=>e?(0,b.jsx)(l,{...t,state:e}):(0,b.jsx)(c,{...t}),`CollectionProvider`);o.displayName=t;let c=B(e=>{let t=g();return(0,b.jsx)(l,{...e,state:t})},`CollectionInit`);c.displayName=t+`Init`;let l=B(e=>{let{scope:t,children:n,state:r}=e,a=s.useRef(null),[o,c]=s.useState(null),l=A(a,c),[u,d]=r;return s.useEffect(()=>{if(!o)return;let e=_e(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,b.jsx)(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);l.displayName=t+`Impl`;let u=e+`CollectionSlot`,d=N(u),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(u,n).collectionRef);return(0,b.jsx)(d,{ref:i,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=N(p),h=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),[c,l]=s.useState(null),u=A(t,o,l),{setItemMap:d}=a(p,n),f=s.useRef(i);me(f.current,i)||(f.current=i);let h=f.current;return s.useEffect(()=>{let e=h;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(ge):(t.set(c,{...e,element:c}),t.toSorted(ge)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new le(e)))}},[c,h,d]),(0,b.jsx)(m,{"data-radix-collection-item":``,ref:u,children:r})});h.displayName=p;function g(){return s.useState(new le)}B(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return B(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}B(pe,`createCollection`);function me(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}B(me,`shallowEqual`);function he(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}B(he,`isElementPreceding`);function ge(e,t){return!e[1].element||!t[1].element?0:he(e[1].element,t[1].element)?-1:1}B(ge,`sortByDocumentPosition`);function _e(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}B(_e,`getChildListObserver`);var ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=s.createContext(void 0);function xe(e){let t=s.useContext(be);return e||t||`ltr`}ye(xe,`useDirection`);var Se=Object.defineProperty,Ce=(e,t)=>Se(e,`name`,{value:t,configurable:!0}),V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=N(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,b.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function we(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))}Ce(we,`dispatchDiscreteCustomEvent`);var Te=Object.defineProperty,Ee=(e,t)=>Te(e,`name`,{value:t,configurable:!0});function H(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ee(H,`useCallbackRef`);var De=Object.defineProperty,U=(e,t)=>De(e,`name`,{value:t,configurable:!0}),Oe=`dismissableLayer.update`,ke=`dismissableLayer.pointerDownOutside`,Ae=`dismissableLayer.focusOutside`,je,Me=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ne=s.forwardRef(U(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=e,d=s.useContext(Me),[f,p]=s.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=s.useState({}),_=A(t,p),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y?v.indexOf(y):-1,S=f?v.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=s.useRef(!1),E=Ie(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=Le(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},m),O=f?S===v.length-1:!1,k=H(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return s.useEffect(()=>{if(O)return m.addEventListener(`keydown`,k,{capture:!0}),()=>m.removeEventListener(`keydown`,k,{capture:!0})},[m,O,k]),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(je=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Re(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=je))}},[f,m,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Re())},[f,d]),s.useEffect(()=>{let e=U(()=>g({}),`handleUpdate`);return document.addEventListener(Oe,e),()=>document.removeEventListener(Oe,e)},[]),(0,b.jsx)(V.div,{...u,ref:_,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:h(e.onFocusCapture,D.onFocusCapture),onBlurCapture:h(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:h(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Pe(){let e=s.useContext(Me),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}U(Pe,`useDismissableLayerSurface`);var Fe=U(()=>!0,`IS_TRUE`);function Ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Fe}=t,c=H(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}U(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}U(t,`isOutsideInteractionIntercepted`);function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}U(s,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}U(p,`handleInteractionBubble`);let m=U(a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ze(ke,c,p,{discrete:!0})};if(U(s,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:U(()=>l.current=!0,`onPointerDownCapture`)}}U(Ie,`usePointerDownOutside`);function Le(e,t=globalThis?.document){let n=H(e),r=s.useRef(!1);return s.useEffect(()=>{let e=U(e=>{e.target&&!r.current&&ze(Ae,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:U(()=>r.current=!0,`onFocusCapture`),onBlurCapture:U(()=>r.current=!1,`onBlurCapture`)}}U(Le,`useFocusOutside`);function Re(){let e=new CustomEvent(Oe);document.dispatchEvent(e)}U(Re,`dispatchUpdate`);function ze(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?we(i,a):i.dispatchEvent(a)}U(ze,`handleAndDispatchCustomEvent`);var Be=Object.defineProperty,Ve=(e,t)=>Be(e,`name`,{value:t,configurable:!0}),He=0,Ue=null;function We(e){return Ge(),e.children}Ve(We,`FocusGuards`);function Ge(){s.useEffect(()=>{Ue||={start:Ke(),end:Ke()};let{start:e,end:t}=Ue;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),He++,()=>{He===1&&(Ue?.start.remove(),Ue?.end.remove(),Ue=null),He=Math.max(0,He-1)}},[])}Ve(Ge,`useFocusGuards`);function Ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ve(Ke,`createFocusGuard`);var qe=Object.defineProperty,W=(e,t)=>qe(e,`name`,{value:t,configurable:!0}),Je=`focusScope.autoFocusOnMount`,Ye=`focusScope.autoFocusOnUnmount`,Xe={bubbles:!1,cancelable:!0},Ze=s.forwardRef(W(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),u=H(i),d=H(a),f=s.useRef(null),p=A(t,l),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:G(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||G(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&G(c)};W(e,`handleFocusIn`),W(t,`handleFocusOut`),W(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),s.useEffect(()=>{if(c){it.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Je,Xe);c.addEventListener(Je,u),c.dispatchEvent(t),t.defaultPrevented||(Qe(st(et(c)),{select:!0}),document.activeElement===e&&G(c))}return()=>{c.removeEventListener(Je,u),setTimeout(()=>{let t=new CustomEvent(Ye,Xe);c.addEventListener(Ye,d),c.dispatchEvent(t),t.defaultPrevented||G(e??document.body,{select:!0}),c.removeEventListener(Ye,d),it.remove(m)},0)}}},[c,u,d,m]);let h=s.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=$e(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&G(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&G(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,b.jsx)(V.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Qe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(G(r,{select:t}),document.activeElement!==n)return}W(Qe,`focusFirst`);function $e(e){let t=et(e);return[tt(t,e),tt(t.reverse(),e)]}W($e,`getTabbableEdges`);function et(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:W(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}W(et,`getTabbableCandidates`);function tt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):nt(r,{upTo:t})))return r}W(tt,`findVisible`);function nt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}W(nt,`isHidden`);function rt(e){return e instanceof HTMLInputElement&&`select`in e}W(rt,`isSelectableInput`);function G(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rt(e)&&t&&e.select()}}W(G,`focus`);var it=at();function at(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ot(e,t),e.unshift(t)},remove(t){e=ot(e,t),e[0]?.resume()}}}W(at,`createFocusScopesStack`);function ot(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}W(ot,`arrayRemove`);function st(e){return e.filter(e=>e.tagName!==`A`)}W(st,`removeLinks`);var K=globalThis?.document?s.useLayoutEffect:()=>{},ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=s.useId||(()=>void 0),dt=0;function ft(e){let[t,n]=s.useState(ut());return K(()=>{e||n(e=>e??String(dt++))},[e]),e||(t?`radix-${t}`:``)}lt(ft,`useId`);var pt=[`top`,`right`,`bottom`,`left`],mt=Math.min,ht=Math.max,gt=Math.round,_t=Math.floor,vt=e=>({x:e,y:e}),yt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bt(e,t,n){return ht(e,mt(t,n))}function xt(e,t){return typeof e==`function`?e(t):e}function St(e){return e.split(`-`)[0]}function Ct(e){return e.split(`-`)[1]}function wt(e){return e===`x`?`y`:`x`}function Tt(e){return e===`y`?`height`:`width`}function q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Et(e){return wt(q(e))}function Dt(e,t,n){n===void 0&&(n=!1);let r=Ct(e),i=Et(e),a=Tt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=It(o)),[o,It(o)]}function Ot(e){let t=It(e);return[kt(e),t,kt(t)]}function kt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var At=[`left`,`right`],jt=[`right`,`left`],Mt=[`top`,`bottom`],Nt=[`bottom`,`top`];function Pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jt:At:t?At:jt;case`left`:case`right`:return t?Mt:Nt;default:return[]}}function Ft(e,t,n,r){let i=Ct(e),a=Pt(St(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kt)))),a}function It(e){let t=St(e);return yt[t]+e.slice(t.length)}function Lt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Rt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Lt(e)}function zt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bt(e,t,n){let{reference:r,floating:i}=e,a=q(t),o=Et(t),s=Tt(o),c=St(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ct(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xt(t,e),p=Rt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=zt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=zt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ht=50,Ut=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ht&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xt(e,t)||{};if(l==null)return{};let d=Rt(u),f={x:n,y:r},p=Et(i),m=Tt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mt(d[_],T),D=mt(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=bt(E,k,O),j=!c.arrow&&Ct(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Gt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=St(r),_=q(o),v=St(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[It(o)]:Ot(o)),x=p!==`none`;!d&&x&&b.push(...Ft(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Dt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===q(t)||T.every(e=>q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return pt.some(t=>e[t]>=0)}var Jt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xt(e,t);switch(i){case`referenceHidden`:{let e=Kt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qt(e)}}}case`escaped`:{let e=Kt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qt(e)}}}default:return{}}}}},Yt=new Set([`left`,`top`]);async function Xt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=St(n),s=Ct(n),c=q(n)===`y`,l=Yt.has(o)?-1:1,u=a&&c?-1:1,d=xt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Zt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=q(i),p=wt(f),m=u[p],h=u[f],g=(e,t)=>bt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},$t=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xt(e,t),u={x:n,y:r},d=q(i),f=wt(d),p=u[f],m=u[d],h=xt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Yt.has(St(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},en=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=xt(e,t),c=await i.detectOverflow(t,s),l=St(n),u=Ct(n),d=q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=mt(p-c[m],g),y=mt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ht(c.left,c.right):S=p-2*ht(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function tn(){return typeof window<`u`}function nn(e){return an(e)?(e.nodeName||``).toLowerCase():`#document`}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rn(e){return((an(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function an(e){return tn()?e instanceof Node||e instanceof J(e).Node:!1}function Y(e){return tn()?e instanceof Element||e instanceof J(e).Element:!1}function on(e){return tn()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function sn(e){return!tn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function cn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ln(e){return/^(table|td|th)$/.test(nn(e))}function un(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var dn=/transform|translate|scale|rotate|perspective|filter/,fn=/paint|layout|strict|content/,pn=e=>!!e&&e!==`none`,mn;function hn(e){let t=Y(e)?X(e):e;return pn(t.transform)||pn(t.translate)||pn(t.scale)||pn(t.rotate)||pn(t.perspective)||!_n()&&(pn(t.backdropFilter)||pn(t.filter))||dn.test(t.willChange||``)||fn.test(t.contain||``)}function gn(e){let t=bn(e);for(;on(t)&&!vn(t);){if(hn(t))return t;if(un(t))return null;t=bn(t)}return null}function _n(){return mn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),mn}function vn(e){return/^(html|body|#document)$/.test(nn(e))}function X(e){return J(e).getComputedStyle(e)}function yn(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(nn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||sn(e)&&e.host||rn(e);return sn(t)?t.host:t}function xn(e){let t=bn(e);return vn(t)?(e.ownerDocument||e).body:on(t)&&cn(t)?t:xn(t)}function Sn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xn(e),i=r===e.ownerDocument?.body,a=J(r);if(i){let e=Cn(a);return t.concat(a,a.visualViewport||[],cn(r)?r:[],e&&n?Sn(e):[])}return t.concat(r,Sn(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wn(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=on(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gt(n)!==a||gt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Tn(e){return Y(e)?e:e.contextElement}function En(e){let t=Tn(e);if(!on(t))return vt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wn(t),o=(a?gt(n.width):n.width)/r,s=(a?gt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dn=vt(0);function On(e){let t=J(e);return!_n()||!t.visualViewport?Dn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===J(e)}function An(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Tn(e),o=vt(1);t&&(r?Y(r)&&(o=En(r)):o=En(e));let s=kn(a,n,r)?On(a):vt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=J(a),t=Y(r)?J(r):r,n=e,i=Cn(n);for(;i&&t!==n;){let e=En(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=J(i),i=Cn(n)}}return zt({width:u,height:d,x:c,y:l})}function jn(e,t){let n=yn(e).scrollLeft;return t?t.left+n:An(rn(e)).left+n}function Mn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jn(e,n),y:n.top+t.scrollTop}}function Nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=rn(r),s=t?un(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1),u=vt(0),d=on(r);if((d||!a)&&((nn(r)!==`body`||cn(o))&&(c=yn(r)),d)){let e=An(r);l=En(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mn(o,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Pn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fn(e){let t=yn(e),n=e.ownerDocument.body,r=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jn(e),o=-t.scrollTop;return X(n).direction===`rtl`&&(a+=ht(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var In=25;function Ln(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=J(e),a=rn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!_n()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=In&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Rn(e,t){let n=An(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=En(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ln(e,n,t);else if(t===`document`)r=Fn(rn(e));else if(Y(t))r=Rn(t,n);else{let n=On(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zt(r)}function Bn(e,t){let n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>Y(e)&&nn(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?bn(e):e;for(;Y(o)&&!vn(o);){let e=X(o),t=hn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bn(o)}return t.set(e,r),r}function Vn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?un(t)?[]:Bn(t,this._c):[].concat(n),r],o=zn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=zn(t,a[e],i);s=ht(n.top,s),c=mt(n.right,c),l=mt(n.bottom,l),u=ht(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hn(e){let{width:t,height:n}=wn(e);return{width:t,height:n}}function Un(e,t,n){let r=on(t),i=rn(t),a=n===`fixed`,o=An(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vt(0);if((r||!a)&&((nn(t)!==`body`||cn(i))&&(s=yn(t)),r)){let e=An(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jn(i));let l=i&&!r&&!a?Mn(i,s):vt(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Wn(e){return X(e).position===`static`}function Gn(e,t){if(!on(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return rn(e)===n&&(n=n.ownerDocument.body),n}function Kn(e,t){let n=J(e);if(un(e))return n;if(!on(e)){let t=bn(e);for(;t&&!vn(t);){if(Y(t)&&!Wn(t))return t;t=bn(t)}return n}let r=Gn(e,t);for(;r&&ln(r)&&Wn(r);)r=Gn(r,t);return r&&vn(r)&&Wn(r)&&!hn(r)?n:r||gn(e)||n}var qn=async function(e){let t=this.getOffsetParent||Kn,n=this.getDimensions,r=await n(e.floating);return{reference:Un(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jn(e){return X(e).direction===`rtl`}var Yn={convertOffsetParentRelativeRectToViewportRelativeRect:Nn,getDocumentElement:rn,getClippingRect:Vn,getOffsetParent:Kn,getElementRects:qn,getClientRects:Pn,getDimensions:Hn,getScale:En,isElement:Y,isRTL:Jn};function Xn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zn(e,t,n){let r=null,i,a=rn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=_t(d),h=_t(a.clientWidth-(u+f)),g=_t(a.clientHeight-(d+p)),_=_t(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ht(0,mt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=J(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Tn(e),u=i||a?[...l?Sn(l):[],...t?Sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?An(e):null;c&&g();function g(){let t=An(e);h&&!Xn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $n=Zt,er=Qt,tr=Gt,nr=en,rr=Jt,ir=Wt,ar=$t,or=(e,t,n)=>{let r=new Map,i=n??{},a={...Yn,...i.platform,_c:r};return Ut(e,t,{...i,platform:a})},sr=typeof document<`u`?s.useLayoutEffect:function(){};function cr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!cr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function lr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ur(e,t){let n=lr(e);return Math.round(t*n)/n}function dr(e){let t=s.useRef(e);return sr(()=>{t.current=e}),t}function fr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=s.useState(r);cr(m,r)||h(r);let[g,_]=s.useState(null),[v,y]=s.useState(null),b=s.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=s.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=s.useRef(null),T=s.useRef(null),E=s.useRef(f),D=u!=null,O=dr(u),k=dr(i),A=dr(d),j=s.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),or(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!cr(E.current,t)&&(E.current=t,c.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);sr(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=s.useRef(!1);sr(()=>(M.current=!0,()=>{M.current=!1}),[]),sr(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=s.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=s.useMemo(()=>({reference:S,floating:C}),[S,C]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ur(P.floating,f.x),r=ur(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...lr(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return s.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var pr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ir({element:r.current,padding:i}).fn(n):r?ir({element:r,padding:i}).fn(n):{}}}},mr=(e,t)=>{let n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},hr=(e,t)=>{let n=er(e);return{name:n.name,fn:n.fn,options:[e,t]}},gr=(e,t)=>({fn:ar(e).fn,options:[e,t]}),_r=(e,t)=>{let n=tr(e);return{name:n.name,fn:n.fn,options:[e,t]}},vr=(e,t)=>{let n=nr(e);return{name:n.name,fn:n.fn,options:[e,t]}},yr=(e,t)=>{let n=rr(e);return{name:n.name,fn:n.fn,options:[e,t]}},br=(e,t)=>{let n=pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0});function Cr(e){let[t,n]=s.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Sr(Cr,`useSize`);var wr=Object.defineProperty,Tr=(e,t)=>wr(e,`name`,{value:t,configurable:!0}),Er=`Popper`,[Dr,Or]=w(Er),[kr,Ar]=Dr(Er),jr=Tr(e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null),[a,o]=s.useState(void 0);return(0,b.jsx)(kr,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Mr=`PopperAnchor`,Nr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ar(Mr,n),o=s.useRef(null),c=a.onAnchorChange,l=A(t,s.useCallback(e=>{o.current=e,e&&c(e)},[c])),u=s.useRef(null);s.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&Br(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,b.jsx)(V.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Pr=`PopperContent`,[Fr,Ir]=Dr(Pr),Lr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=Ar(Pr,n),[v,y]=s.useState(null),x=A(t,y),[S,C]=s.useState(null),w=Cr(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(u)?u:[u],j=k.length>0,M={padding:O,boundary:k.filter(Rr),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=fr({strategy:`fixed`,placement:D,whileElementsMounted:Tr((...e)=>Qn(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[mr({mainAxis:i+E,alignmentAxis:o}),l&&hr({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?gr():void 0,...M}),l&&_r({...M}),vr({...M,apply:Tr(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&br({element:S,padding:c}),zr({arrowWidth:T,arrowHeight:E}),p&&yr({strategy:`referenceHidden`,...M,boundary:j?M.boundary:void 0})]}),R=_.setPlacementState;K(()=>(R(F),()=>{R(void 0)}),[F,R]);let[z,ee]=Br(F),te=H(h);K(()=>{I&&te?.()},[I,te]);let ne=L.arrow?.x,re=L.arrow?.y,ie=L.arrow?.centerOffset!==0,[ae,oe]=s.useState();return K(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,b.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,b.jsx)(Fr,{scope:n,placedSide:z,placedAlign:ee,onArrowChange:C,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,b.jsx)(V.div,{"data-side":z,"data-align":ee,...g,ref:x,style:{...g.style,animation:I?g.style?.animation:`none`}})})})},`PopperContent`));function Rr(e){return e!==null}Tr(Rr,`isNotNull`);var zr=Tr(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Br(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Tr(Br,`getSideAndAlignFromPlacement`);var Vr=jr,Hr=Nr,Ur=Lr,Wr=Object.defineProperty,Gr=s.forwardRef(((e,t)=>Wr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=s.useState(!1);K(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?c.createPortal((0,b.jsx)(V.div,{...r,ref:t}),o):null},`Portal`)),Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0});function Jr(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}qr(Jr,`useStateMachine`);var Yr=qr(e=>{let{present:t,children:n}=e,r=Xr(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Qr(r.ref,ei(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null},`Presence`);function Xr(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Jr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??$r(r.current),o.current=void 0):a.current=`none`},[c]),K(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=$r(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),K(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=qr(a=>{let o=$r(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=qr(e=>{e.target===t&&(a.current=$r(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=$r(t)}else r.current=null;n(e)},[])}}qr(Xr,`usePresence`);function Zr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qr(Zr,`setRef`);function Qr(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Zr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Zr(n[e],null)}}},[])}qr(Qr,`useStableComposedRefs`);function $r(e){return e?.animationName||`none`}qr($r,`getAnimationName`);function ei(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qr(ei,`getElementRef`);var ti=Object.defineProperty,ni=(e,t)=>ti(e,`name`,{value:t,configurable:!0}),ri=s.useEffectEvent,ii=s.useInsertionEffect;function ai(e){if(typeof ri==`function`)return ri(e);let t=s.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ii==`function`?ii(()=>{t.current=e}):K(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}ni(ai,`useEffectEvent`);var oi=Object.defineProperty,si=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),ci=s.useInsertionEffect||K;function li({prop:e,defaultProp:t,onChange:n=si(()=>{},`onChange`),caller:r}){let[i,a,o]=ui({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,s.useCallback(t=>{if(c){let n=di(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}si(li,`useControllableState`);function ui({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return ci(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}si(ui,`useUncontrolledState`);function di(e){return typeof e==`function`}si(di,`isFunction`);var fi=Symbol(`RADIX:SYNC_STATE`);function pi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,l=i!==void 0,u=ai(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=s.useReducer((t,n)=>{if(n.type===fi)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=s.useRef(m);s.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=s.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return s.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:fi,state:i})},[i,f.state,l]),[g,p]}si(pi,`useControllableStateReducer`);var mi=Object.defineProperty,hi=(e,t)=>mi(e,`name`,{value:t,configurable:!0});function gi(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}hi(gi,`usePrevious`);var _i=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},yi=new WeakMap,bi=new WeakMap,xi={},Si=0,Ci=function(e){return e&&(e.host||Ci(e.parentNode))},wi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ci(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ti=function(e,t,n,r){var i=wi(t,Array.isArray(e)?e:[e]);xi[n]||(xi[n]=new WeakMap);var a=xi[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(yi.get(e)||0)+1,l=(a.get(e)||0)+1;yi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&bi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Si++,function(){o.forEach(function(e){var t=yi.get(e)-1,i=a.get(e)-1;yi.set(e,t),a.set(e,i),t||(bi.has(e)||e.removeAttribute(r),bi.delete(e)),i||e.removeAttribute(n)}),Si--,Si||(yi=new WeakMap,yi=new WeakMap,bi=new WeakMap,xi={})}},Ei=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||vi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ti(r,i,n,`aria-hidden`)):function(){return null}},Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Di(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Oi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ki=`right-scroll-bar-position`,Ai=`width-before-scroll-bar`,ji=`with-scroll-bars-hidden`,Mi=`--removed-body-scroll-bar-size`;function Ni(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pi(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fi=typeof window<`u`?s.useLayoutEffect:s.useEffect,Ii=new WeakMap;function Li(e,t){var n=Pi(t||null,function(t){return e.forEach(function(e){return Ni(e,t)})});return Fi(function(){var t=Ii.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ni(e,null)}),i.forEach(function(e){r.has(e)||Ni(e,a)})}Ii.set(n,e)},[e]),n}function Ri(e){return e}function zi(e,t){t===void 0&&(t=Ri);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Bi(e){e===void 0&&(e={});var t=zi(null);return t.options=Z({async:!0,ssr:!1},e),t}var Vi=function(e){var t=e.sideCar,n=Di(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,Z({},n))};Vi.isSideCarExport=!0;function Hi(e,t){return e.useMedium(t),Vi}var Ui=Bi(),Wi=function(){},Gi=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Wi,onWheelCapture:Wi,onTouchMoveCapture:Wi}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Di(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Li([n,t]),w=Z(Z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ui,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),Z(Z({},w),{ref:C})):s.createElement(y,Z({},w,{className:l,ref:C}),c))});Gi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gi.classNames={fullWidth:Ai,zeroRight:ki};var Ki=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ki();return t&&e.setAttribute(`nonce`,t),e}function Ji(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qi())&&(Ji(t,n),Yi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zi=function(){var e=Xi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qi=function(){var e=Zi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$i={left:0,top:0,right:0,gap:0},ea=function(e){return parseInt(e||``,10)||0},ta=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ea(n),ea(r),ea(i)]},na=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $i;var t=ta(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ra=Qi(),ia=`data-scroll-locked`,aa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
1
|
+
import{o as e,r as t,t as n}from"./jsx-runtime-CXUMngI_.js";import{f as r}from"./app-DRnQLhsc.js";import{k as i,m as a}from"./numbers-CoqpaDMx.js";import{ft as o}from"./entry-vqGb8yVz.js";var s=e(t(),1),c=e(r(),1),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0});function d(e,[t,n]){return Math.min(n,Math.max(t,e))}u(d,`clamp`);var f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=!!(typeof window<`u`&&window.document&&window.document.createElement);function h(e,t,{checkForDefaultPrevented:n=!0}={}){return p(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}p(h,`composeEventHandlers`);function g(e){if(!m)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}p(g,`getOwnerWindow`);function _(e){if(!m)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}p(_,`getOwnerDocument`);function v(e,t=!1){let{activeElement:n}=_(e);if(!n?.nodeName)return null;if(y(n)&&n.contentDocument)return v(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=_(n).getElementById(e);if(t)return t}}return n}p(v,`getActiveElement`);function y(e){return e.tagName===`IFRAME`}p(y,`isFrame`);var b=n(),x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0});function C(e,t){let n=s.createContext(t);n.displayName=e+`Context`;let r=S(e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,b.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=s.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return S(i,`useContext`),[r,i]}S(C,`createContext`);function w(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=S(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,b.jsx)(c.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function c(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return S(c,`useContext`),[o,c]}S(r,`createContext`);let i=S(()=>{let t=n.map(e=>s.createContext(e));return S(function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,T(i,...t)]}S(w,`createContextScope`);function T(...e){let t=e[0];if(e.length===1)return t;let n=S(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return S(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}S(T,`composeContextScopes`);var E=Object.defineProperty,D=(e,t)=>E(e,`name`,{value:t,configurable:!0});function O(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}D(O,`setRef`);function k(...e){return t=>{let n=!1,r=e.map(e=>{let r=O(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():O(e[t],null)}}}}D(k,`composeRefs`);function A(...e){return s.useCallback(k(...e),e)}D(A,`useComposedRefs`);var j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0});function N(e){let t=s.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];te(r)&&typeof ae==`function`&&(r=ae(r._payload)),s.Children.forEach(r,e=>{if(z(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;te(n)&&typeof ae==`function`&&(n=ae(n._payload)),a=I(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=s.cloneElement(a,void 0,c):!o&&s.Children.count(r)===1&&s.isValidElement(r)&&(a=r);let l=a?R(a):void 0,u=A(n,l);if(!a){if(r||r===0)throw Error(o?ie(e):re(e));return r}let d=L(i,a.props??{});return a.type!==s.Fragment&&(d.ref=n?u:l),s.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}M(N,`createSlot`);var P=Symbol.for(`radix.slottable`);function F(e){let t=M(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=P,t}M(F,`createSlottable`);var I=M((e,t)=>{if(`child`in e.props){let t=e.props.child;return s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null}return s.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function L(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}M(L,`mergeProps`);function R(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}M(R,`getElementRef`);function z(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===P}M(z,`isSlottable`);var ee=Symbol.for(`react.lazy`);function te(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ee&&`_payload`in e&&ne(e._payload)}M(te,`isLazyComponent`);function ne(e){return typeof e==`object`&&!!e&&`then`in e}M(ne,`isPromiseLike`);var re=M(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ie=M(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ae=s.use,oe=Object.defineProperty,B=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function se(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=B(e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,b.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let c=e+`CollectionSlot`,l=N(c),u=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(c,n).collectionRef);return(0,b.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=N(d),m=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),c=A(t,o),l=a(d,n);return s.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,b.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return B(h,`useCollection`),[{Provider:o,Slot:u,ItemSlot:m},h,r]}B(se,`createCollection`);var ce=new WeakMap,le=class e extends Map{static{B(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ce.set(this,!0)}set(e,t){return ce.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=fe(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ue(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ue(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ue(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ue(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=de(e,t);return n===-1?void 0:e[n]}B(ue,`at`);function de(e,t){let n=e.length,r=fe(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}B(de,`toSafeIndex`);function fe(e){return e!==e||e===0?0:Math.trunc(e)}B(fe,`toSafeInteger`);function pe(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new le,setItemMap:B(()=>void 0,`setItemMap`)}),o=B(({state:e,...t})=>e?(0,b.jsx)(l,{...t,state:e}):(0,b.jsx)(c,{...t}),`CollectionProvider`);o.displayName=t;let c=B(e=>{let t=g();return(0,b.jsx)(l,{...e,state:t})},`CollectionInit`);c.displayName=t+`Init`;let l=B(e=>{let{scope:t,children:n,state:r}=e,a=s.useRef(null),[o,c]=s.useState(null),l=A(a,c),[u,d]=r;return s.useEffect(()=>{if(!o)return;let e=_e(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,b.jsx)(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);l.displayName=t+`Impl`;let u=e+`CollectionSlot`,d=N(u),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(u,n).collectionRef);return(0,b.jsx)(d,{ref:i,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=N(p),h=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),[c,l]=s.useState(null),u=A(t,o,l),{setItemMap:d}=a(p,n),f=s.useRef(i);me(f.current,i)||(f.current=i);let h=f.current;return s.useEffect(()=>{let e=h;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(ge):(t.set(c,{...e,element:c}),t.toSorted(ge)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new le(e)))}},[c,h,d]),(0,b.jsx)(m,{"data-radix-collection-item":``,ref:u,children:r})});h.displayName=p;function g(){return s.useState(new le)}B(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return B(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}B(pe,`createCollection`);function me(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}B(me,`shallowEqual`);function he(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}B(he,`isElementPreceding`);function ge(e,t){return!e[1].element||!t[1].element?0:he(e[1].element,t[1].element)?-1:1}B(ge,`sortByDocumentPosition`);function _e(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}B(_e,`getChildListObserver`);var ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=s.createContext(void 0);function xe(e){let t=s.useContext(be);return e||t||`ltr`}ye(xe,`useDirection`);var Se=Object.defineProperty,Ce=(e,t)=>Se(e,`name`,{value:t,configurable:!0}),V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=N(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,b.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function we(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))}Ce(we,`dispatchDiscreteCustomEvent`);var Te=Object.defineProperty,Ee=(e,t)=>Te(e,`name`,{value:t,configurable:!0});function H(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ee(H,`useCallbackRef`);var De=Object.defineProperty,U=(e,t)=>De(e,`name`,{value:t,configurable:!0}),Oe=`dismissableLayer.update`,ke=`dismissableLayer.pointerDownOutside`,Ae=`dismissableLayer.focusOutside`,je,Me=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ne=s.forwardRef(U(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=e,d=s.useContext(Me),[f,p]=s.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=s.useState({}),_=A(t,p),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y?v.indexOf(y):-1,S=f?v.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=s.useRef(!1),E=Ie(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=Le(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},m),O=f?S===v.length-1:!1,k=H(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return s.useEffect(()=>{if(O)return m.addEventListener(`keydown`,k,{capture:!0}),()=>m.removeEventListener(`keydown`,k,{capture:!0})},[m,O,k]),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(je=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Re(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=je))}},[f,m,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Re())},[f,d]),s.useEffect(()=>{let e=U(()=>g({}),`handleUpdate`);return document.addEventListener(Oe,e),()=>document.removeEventListener(Oe,e)},[]),(0,b.jsx)(V.div,{...u,ref:_,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:h(e.onFocusCapture,D.onFocusCapture),onBlurCapture:h(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:h(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Pe(){let e=s.useContext(Me),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}U(Pe,`useDismissableLayerSurface`);var Fe=U(()=>!0,`IS_TRUE`);function Ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Fe}=t,c=H(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}U(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}U(t,`isOutsideInteractionIntercepted`);function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}U(s,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}U(p,`handleInteractionBubble`);let m=U(a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ze(ke,c,p,{discrete:!0})};if(U(s,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:U(()=>l.current=!0,`onPointerDownCapture`)}}U(Ie,`usePointerDownOutside`);function Le(e,t=globalThis?.document){let n=H(e),r=s.useRef(!1);return s.useEffect(()=>{let e=U(e=>{e.target&&!r.current&&ze(Ae,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:U(()=>r.current=!0,`onFocusCapture`),onBlurCapture:U(()=>r.current=!1,`onBlurCapture`)}}U(Le,`useFocusOutside`);function Re(){let e=new CustomEvent(Oe);document.dispatchEvent(e)}U(Re,`dispatchUpdate`);function ze(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?we(i,a):i.dispatchEvent(a)}U(ze,`handleAndDispatchCustomEvent`);var Be=Object.defineProperty,Ve=(e,t)=>Be(e,`name`,{value:t,configurable:!0}),He=0,Ue=null;function We(e){return Ge(),e.children}Ve(We,`FocusGuards`);function Ge(){s.useEffect(()=>{Ue||={start:Ke(),end:Ke()};let{start:e,end:t}=Ue;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),He++,()=>{He===1&&(Ue?.start.remove(),Ue?.end.remove(),Ue=null),He=Math.max(0,He-1)}},[])}Ve(Ge,`useFocusGuards`);function Ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ve(Ke,`createFocusGuard`);var qe=Object.defineProperty,W=(e,t)=>qe(e,`name`,{value:t,configurable:!0}),Je=`focusScope.autoFocusOnMount`,Ye=`focusScope.autoFocusOnUnmount`,Xe={bubbles:!1,cancelable:!0},Ze=s.forwardRef(W(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),u=H(i),d=H(a),f=s.useRef(null),p=A(t,l),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:G(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||G(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&G(c)};W(e,`handleFocusIn`),W(t,`handleFocusOut`),W(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),s.useEffect(()=>{if(c){it.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Je,Xe);c.addEventListener(Je,u),c.dispatchEvent(t),t.defaultPrevented||(Qe(st(et(c)),{select:!0}),document.activeElement===e&&G(c))}return()=>{c.removeEventListener(Je,u),setTimeout(()=>{let t=new CustomEvent(Ye,Xe);c.addEventListener(Ye,d),c.dispatchEvent(t),t.defaultPrevented||G(e??document.body,{select:!0}),c.removeEventListener(Ye,d),it.remove(m)},0)}}},[c,u,d,m]);let h=s.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=$e(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&G(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&G(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,b.jsx)(V.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Qe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(G(r,{select:t}),document.activeElement!==n)return}W(Qe,`focusFirst`);function $e(e){let t=et(e);return[tt(t,e),tt(t.reverse(),e)]}W($e,`getTabbableEdges`);function et(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:W(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}W(et,`getTabbableCandidates`);function tt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):nt(r,{upTo:t})))return r}W(tt,`findVisible`);function nt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}W(nt,`isHidden`);function rt(e){return e instanceof HTMLInputElement&&`select`in e}W(rt,`isSelectableInput`);function G(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rt(e)&&t&&e.select()}}W(G,`focus`);var it=at();function at(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ot(e,t),e.unshift(t)},remove(t){e=ot(e,t),e[0]?.resume()}}}W(at,`createFocusScopesStack`);function ot(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}W(ot,`arrayRemove`);function st(e){return e.filter(e=>e.tagName!==`A`)}W(st,`removeLinks`);var K=globalThis?.document?s.useLayoutEffect:()=>{},ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=s.useId||(()=>void 0),dt=0;function ft(e){let[t,n]=s.useState(ut());return K(()=>{e||n(e=>e??String(dt++))},[e]),e||(t?`radix-${t}`:``)}lt(ft,`useId`);var pt=[`top`,`right`,`bottom`,`left`],mt=Math.min,ht=Math.max,gt=Math.round,_t=Math.floor,vt=e=>({x:e,y:e}),yt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bt(e,t,n){return ht(e,mt(t,n))}function xt(e,t){return typeof e==`function`?e(t):e}function St(e){return e.split(`-`)[0]}function Ct(e){return e.split(`-`)[1]}function wt(e){return e===`x`?`y`:`x`}function Tt(e){return e===`y`?`height`:`width`}function q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Et(e){return wt(q(e))}function Dt(e,t,n){n===void 0&&(n=!1);let r=Ct(e),i=Et(e),a=Tt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=It(o)),[o,It(o)]}function Ot(e){let t=It(e);return[kt(e),t,kt(t)]}function kt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var At=[`left`,`right`],jt=[`right`,`left`],Mt=[`top`,`bottom`],Nt=[`bottom`,`top`];function Pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jt:At:t?At:jt;case`left`:case`right`:return t?Mt:Nt;default:return[]}}function Ft(e,t,n,r){let i=Ct(e),a=Pt(St(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kt)))),a}function It(e){let t=St(e);return yt[t]+e.slice(t.length)}function Lt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Rt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Lt(e)}function zt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bt(e,t,n){let{reference:r,floating:i}=e,a=q(t),o=Et(t),s=Tt(o),c=St(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ct(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xt(t,e),p=Rt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=zt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=zt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ht=50,Ut=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ht&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xt(e,t)||{};if(l==null)return{};let d=Rt(u),f={x:n,y:r},p=Et(i),m=Tt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mt(d[_],T),D=mt(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=bt(E,k,O),j=!c.arrow&&Ct(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Gt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=St(r),_=q(o),v=St(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[It(o)]:Ot(o)),x=p!==`none`;!d&&x&&b.push(...Ft(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Dt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===q(t)||T.every(e=>q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return pt.some(t=>e[t]>=0)}var Jt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xt(e,t);switch(i){case`referenceHidden`:{let e=Kt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qt(e)}}}case`escaped`:{let e=Kt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qt(e)}}}default:return{}}}}},Yt=new Set([`left`,`top`]);async function Xt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=St(n),s=Ct(n),c=q(n)===`y`,l=Yt.has(o)?-1:1,u=a&&c?-1:1,d=xt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Zt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=q(i),p=wt(f),m=u[p],h=u[f],g=(e,t)=>bt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},$t=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xt(e,t),u={x:n,y:r},d=q(i),f=wt(d),p=u[f],m=u[d],h=xt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Yt.has(St(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},en=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=xt(e,t),c=await i.detectOverflow(t,s),l=St(n),u=Ct(n),d=q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=mt(p-c[m],g),y=mt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ht(c.left,c.right):S=p-2*ht(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function tn(){return typeof window<`u`}function nn(e){return an(e)?(e.nodeName||``).toLowerCase():`#document`}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rn(e){return((an(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function an(e){return tn()?e instanceof Node||e instanceof J(e).Node:!1}function Y(e){return tn()?e instanceof Element||e instanceof J(e).Element:!1}function on(e){return tn()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function sn(e){return!tn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function cn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ln(e){return/^(table|td|th)$/.test(nn(e))}function un(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var dn=/transform|translate|scale|rotate|perspective|filter/,fn=/paint|layout|strict|content/,pn=e=>!!e&&e!==`none`,mn;function hn(e){let t=Y(e)?X(e):e;return pn(t.transform)||pn(t.translate)||pn(t.scale)||pn(t.rotate)||pn(t.perspective)||!_n()&&(pn(t.backdropFilter)||pn(t.filter))||dn.test(t.willChange||``)||fn.test(t.contain||``)}function gn(e){let t=bn(e);for(;on(t)&&!vn(t);){if(hn(t))return t;if(un(t))return null;t=bn(t)}return null}function _n(){return mn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),mn}function vn(e){return/^(html|body|#document)$/.test(nn(e))}function X(e){return J(e).getComputedStyle(e)}function yn(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(nn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||sn(e)&&e.host||rn(e);return sn(t)?t.host:t}function xn(e){let t=bn(e);return vn(t)?(e.ownerDocument||e).body:on(t)&&cn(t)?t:xn(t)}function Sn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xn(e),i=r===e.ownerDocument?.body,a=J(r);if(i){let e=Cn(a);return t.concat(a,a.visualViewport||[],cn(r)?r:[],e&&n?Sn(e):[])}return t.concat(r,Sn(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wn(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=on(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gt(n)!==a||gt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Tn(e){return Y(e)?e:e.contextElement}function En(e){let t=Tn(e);if(!on(t))return vt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wn(t),o=(a?gt(n.width):n.width)/r,s=(a?gt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dn=vt(0);function On(e){let t=J(e);return!_n()||!t.visualViewport?Dn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===J(e)}function An(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Tn(e),o=vt(1);t&&(r?Y(r)&&(o=En(r)):o=En(e));let s=kn(a,n,r)?On(a):vt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=J(a),t=Y(r)?J(r):r,n=e,i=Cn(n);for(;i&&t!==n;){let e=En(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=J(i),i=Cn(n)}}return zt({width:u,height:d,x:c,y:l})}function jn(e,t){let n=yn(e).scrollLeft;return t?t.left+n:An(rn(e)).left+n}function Mn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jn(e,n),y:n.top+t.scrollTop}}function Nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=rn(r),s=t?un(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1),u=vt(0),d=on(r);if((d||!a)&&((nn(r)!==`body`||cn(o))&&(c=yn(r)),d)){let e=An(r);l=En(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mn(o,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Pn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fn(e){let t=yn(e),n=e.ownerDocument.body,r=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jn(e),o=-t.scrollTop;return X(n).direction===`rtl`&&(a+=ht(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var In=25;function Ln(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=J(e),a=rn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!_n()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=In&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Rn(e,t){let n=An(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=En(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ln(e,n,t);else if(t===`document`)r=Fn(rn(e));else if(Y(t))r=Rn(t,n);else{let n=On(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zt(r)}function Bn(e,t){let n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>Y(e)&&nn(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?bn(e):e;for(;Y(o)&&!vn(o);){let e=X(o),t=hn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bn(o)}return t.set(e,r),r}function Vn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?un(t)?[]:Bn(t,this._c):[].concat(n),r],o=zn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=zn(t,a[e],i);s=ht(n.top,s),c=mt(n.right,c),l=mt(n.bottom,l),u=ht(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hn(e){let{width:t,height:n}=wn(e);return{width:t,height:n}}function Un(e,t,n){let r=on(t),i=rn(t),a=n===`fixed`,o=An(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vt(0);if((r||!a)&&((nn(t)!==`body`||cn(i))&&(s=yn(t)),r)){let e=An(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jn(i));let l=i&&!r&&!a?Mn(i,s):vt(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Wn(e){return X(e).position===`static`}function Gn(e,t){if(!on(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return rn(e)===n&&(n=n.ownerDocument.body),n}function Kn(e,t){let n=J(e);if(un(e))return n;if(!on(e)){let t=bn(e);for(;t&&!vn(t);){if(Y(t)&&!Wn(t))return t;t=bn(t)}return n}let r=Gn(e,t);for(;r&&ln(r)&&Wn(r);)r=Gn(r,t);return r&&vn(r)&&Wn(r)&&!hn(r)?n:r||gn(e)||n}var qn=async function(e){let t=this.getOffsetParent||Kn,n=this.getDimensions,r=await n(e.floating);return{reference:Un(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jn(e){return X(e).direction===`rtl`}var Yn={convertOffsetParentRelativeRectToViewportRelativeRect:Nn,getDocumentElement:rn,getClippingRect:Vn,getOffsetParent:Kn,getElementRects:qn,getClientRects:Pn,getDimensions:Hn,getScale:En,isElement:Y,isRTL:Jn};function Xn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zn(e,t,n){let r=null,i,a=rn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=_t(d),h=_t(a.clientWidth-(u+f)),g=_t(a.clientHeight-(d+p)),_=_t(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ht(0,mt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=J(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Tn(e),u=i||a?[...l?Sn(l):[],...t?Sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?An(e):null;c&&g();function g(){let t=An(e);h&&!Xn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $n=Zt,er=Qt,tr=Gt,nr=en,rr=Jt,ir=Wt,ar=$t,or=(e,t,n)=>{let r=new Map,i=n??{},a={...Yn,...i.platform,_c:r};return Ut(e,t,{...i,platform:a})},sr=typeof document<`u`?s.useLayoutEffect:function(){};function cr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!cr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function lr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ur(e,t){let n=lr(e);return Math.round(t*n)/n}function dr(e){let t=s.useRef(e);return sr(()=>{t.current=e}),t}function fr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=s.useState(r);cr(m,r)||h(r);let[g,_]=s.useState(null),[v,y]=s.useState(null),b=s.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=s.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=s.useRef(null),T=s.useRef(null),E=s.useRef(f),D=u!=null,O=dr(u),k=dr(i),A=dr(d),j=s.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),or(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!cr(E.current,t)&&(E.current=t,c.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);sr(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=s.useRef(!1);sr(()=>(M.current=!0,()=>{M.current=!1}),[]),sr(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=s.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=s.useMemo(()=>({reference:S,floating:C}),[S,C]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ur(P.floating,f.x),r=ur(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...lr(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return s.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var pr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ir({element:r.current,padding:i}).fn(n):r?ir({element:r,padding:i}).fn(n):{}}}},mr=(e,t)=>{let n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},hr=(e,t)=>{let n=er(e);return{name:n.name,fn:n.fn,options:[e,t]}},gr=(e,t)=>({fn:ar(e).fn,options:[e,t]}),_r=(e,t)=>{let n=tr(e);return{name:n.name,fn:n.fn,options:[e,t]}},vr=(e,t)=>{let n=nr(e);return{name:n.name,fn:n.fn,options:[e,t]}},yr=(e,t)=>{let n=rr(e);return{name:n.name,fn:n.fn,options:[e,t]}},br=(e,t)=>{let n=pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0});function Cr(e){let[t,n]=s.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Sr(Cr,`useSize`);var wr=Object.defineProperty,Tr=(e,t)=>wr(e,`name`,{value:t,configurable:!0}),Er=`Popper`,[Dr,Or]=w(Er),[kr,Ar]=Dr(Er),jr=Tr(e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null),[a,o]=s.useState(void 0);return(0,b.jsx)(kr,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Mr=`PopperAnchor`,Nr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ar(Mr,n),o=s.useRef(null),c=a.onAnchorChange,l=A(t,s.useCallback(e=>{o.current=e,e&&c(e)},[c])),u=s.useRef(null);s.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&Br(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,b.jsx)(V.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Pr=`PopperContent`,[Fr,Ir]=Dr(Pr),Lr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=Ar(Pr,n),[v,y]=s.useState(null),x=A(t,y),[S,C]=s.useState(null),w=Cr(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(u)?u:[u],j=k.length>0,M={padding:O,boundary:k.filter(Rr),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=fr({strategy:`fixed`,placement:D,whileElementsMounted:Tr((...e)=>Qn(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[mr({mainAxis:i+E,alignmentAxis:o}),l&&hr({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?gr():void 0,...M}),l&&_r({...M}),vr({...M,apply:Tr(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&br({element:S,padding:c}),zr({arrowWidth:T,arrowHeight:E}),p&&yr({strategy:`referenceHidden`,...M,boundary:j?M.boundary:void 0})]}),R=_.setPlacementState;K(()=>(R(F),()=>{R(void 0)}),[F,R]);let[z,ee]=Br(F),te=H(h);K(()=>{I&&te?.()},[I,te]);let ne=L.arrow?.x,re=L.arrow?.y,ie=L.arrow?.centerOffset!==0,[ae,oe]=s.useState();return K(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,b.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,b.jsx)(Fr,{scope:n,placedSide:z,placedAlign:ee,onArrowChange:C,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,b.jsx)(V.div,{"data-side":z,"data-align":ee,...g,ref:x,style:{...g.style,animation:I?g.style?.animation:`none`}})})})},`PopperContent`));function Rr(e){return e!==null}Tr(Rr,`isNotNull`);var zr=Tr(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Br(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Tr(Br,`getSideAndAlignFromPlacement`);var Vr=jr,Hr=Nr,Ur=Lr,Wr=Object.defineProperty,Gr=s.forwardRef(((e,t)=>Wr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=s.useState(!1);K(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?c.createPortal((0,b.jsx)(V.div,{...r,ref:t}),o):null},`Portal`)),Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0});function Jr(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}qr(Jr,`useStateMachine`);var Yr=qr(e=>{let{present:t,children:n}=e,r=Xr(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Qr(r.ref,ei(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null},`Presence`);function Xr(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Jr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??$r(r.current),o.current=void 0):a.current=`none`},[c]),K(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=$r(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),K(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=qr(a=>{let o=$r(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=qr(e=>{e.target===t&&(a.current=$r(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=$r(t)}else r.current=null;n(e)},[])}}qr(Xr,`usePresence`);function Zr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qr(Zr,`setRef`);function Qr(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Zr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Zr(n[e],null)}}},[])}qr(Qr,`useStableComposedRefs`);function $r(e){return e?.animationName||`none`}qr($r,`getAnimationName`);function ei(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qr(ei,`getElementRef`);var ti=Object.defineProperty,ni=(e,t)=>ti(e,`name`,{value:t,configurable:!0}),ri=s.useEffectEvent,ii=s.useInsertionEffect;function ai(e){if(typeof ri==`function`)return ri(e);let t=s.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ii==`function`?ii(()=>{t.current=e}):K(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}ni(ai,`useEffectEvent`);var oi=Object.defineProperty,si=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),ci=s.useInsertionEffect||K;function li({prop:e,defaultProp:t,onChange:n=si(()=>{},`onChange`),caller:r}){let[i,a,o]=ui({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,s.useCallback(t=>{if(c){let n=di(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}si(li,`useControllableState`);function ui({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return ci(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}si(ui,`useUncontrolledState`);function di(e){return typeof e==`function`}si(di,`isFunction`);var fi=Symbol(`RADIX:SYNC_STATE`);function pi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,l=i!==void 0,u=ai(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=s.useReducer((t,n)=>{if(n.type===fi)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=s.useRef(m);s.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=s.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return s.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:fi,state:i})},[i,f.state,l]),[g,p]}si(pi,`useControllableStateReducer`);var mi=Object.defineProperty,hi=(e,t)=>mi(e,`name`,{value:t,configurable:!0});function gi(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}hi(gi,`usePrevious`);var _i=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},yi=new WeakMap,bi=new WeakMap,xi={},Si=0,Ci=function(e){return e&&(e.host||Ci(e.parentNode))},wi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ci(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ti=function(e,t,n,r){var i=wi(t,Array.isArray(e)?e:[e]);xi[n]||(xi[n]=new WeakMap);var a=xi[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(yi.get(e)||0)+1,l=(a.get(e)||0)+1;yi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&bi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Si++,function(){o.forEach(function(e){var t=yi.get(e)-1,i=a.get(e)-1;yi.set(e,t),a.set(e,i),t||(bi.has(e)||e.removeAttribute(r),bi.delete(e)),i||e.removeAttribute(n)}),Si--,Si||(yi=new WeakMap,yi=new WeakMap,bi=new WeakMap,xi={})}},Ei=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||vi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ti(r,i,n,`aria-hidden`)):function(){return null}},Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Di(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Oi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ki=`right-scroll-bar-position`,Ai=`width-before-scroll-bar`,ji=`with-scroll-bars-hidden`,Mi=`--removed-body-scroll-bar-size`;function Ni(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pi(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fi=typeof window<`u`?s.useLayoutEffect:s.useEffect,Ii=new WeakMap;function Li(e,t){var n=Pi(t||null,function(t){return e.forEach(function(e){return Ni(e,t)})});return Fi(function(){var t=Ii.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ni(e,null)}),i.forEach(function(e){r.has(e)||Ni(e,a)})}Ii.set(n,e)},[e]),n}function Ri(e){return e}function zi(e,t){t===void 0&&(t=Ri);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Bi(e){e===void 0&&(e={});var t=zi(null);return t.options=Z({async:!0,ssr:!1},e),t}var Vi=function(e){var t=e.sideCar,n=Di(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,Z({},n))};Vi.isSideCarExport=!0;function Hi(e,t){return e.useMedium(t),Vi}var Ui=Bi(),Wi=function(){},Gi=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Wi,onWheelCapture:Wi,onTouchMoveCapture:Wi}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Di(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Li([n,t]),w=Z(Z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ui,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),Z(Z({},w),{ref:C})):s.createElement(y,Z({},w,{className:l,ref:C}),c))});Gi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gi.classNames={fullWidth:Ai,zeroRight:ki};var Ki=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ki();return t&&e.setAttribute(`nonce`,t),e}function Ji(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qi())&&(Ji(t,n),Yi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zi=function(){var e=Xi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qi=function(){var e=Zi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$i={left:0,top:0,right:0,gap:0},ea=function(e){return parseInt(e||``,10)||0},ta=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ea(n),ea(r),ea(i)]},na=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $i;var t=ta(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ra=Qi(),ia=`data-scroll-locked`,aa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${ji} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
Binary file
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
})();
|
|
93
93
|
</script>
|
|
94
94
|
<title>Cartethyia</title>
|
|
95
|
-
<script type="module" crossorigin src="/assets/index-
|
|
96
|
-
<meta name="cartethyia-dashboard-build" content="
|
|
95
|
+
<script type="module" crossorigin src="/assets/index-D36vCZht.js"></script>
|
|
96
|
+
<meta name="cartethyia-dashboard-build" content="33d25dc06e2d828c" />
|
|
97
97
|
</head>
|
|
98
98
|
<body>
|
|
99
99
|
<div id="root"></div>
|
|
Binary file
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"count": 119,
|
|
3
3
|
"assets": [
|
|
4
|
-
"assets/BannedPage-
|
|
5
|
-
"assets/CliToolDetailPage-
|
|
6
|
-
"assets/CliToolsPage-
|
|
7
|
-
"assets/CombosPage-
|
|
8
|
-
"assets/ConsoleLogPage-
|
|
9
|
-
"assets/CustomizationPage-
|
|
10
|
-
"assets/HealthEventsModal-
|
|
11
|
-
"assets/InjectSystemPromptPanel-
|
|
12
|
-
"assets/LoginPage-
|
|
4
|
+
"assets/BannedPage-B05aF8Dg.js",
|
|
5
|
+
"assets/CliToolDetailPage-CLUhmjUy.js",
|
|
6
|
+
"assets/CliToolsPage-CQmrqqrk.js",
|
|
7
|
+
"assets/CombosPage-CHG_1Wr3.js",
|
|
8
|
+
"assets/ConsoleLogPage-DPgbklad.js",
|
|
9
|
+
"assets/CustomizationPage-pnfAqr_-.js",
|
|
10
|
+
"assets/HealthEventsModal-DGJuU2A6.js",
|
|
11
|
+
"assets/InjectSystemPromptPanel-C-e2AMz6.js",
|
|
12
|
+
"assets/LoginPage-J8wPbmfT.js",
|
|
13
13
|
"assets/ModelPicker-C6WlpU5E.js",
|
|
14
|
-
"assets/OverviewPage-
|
|
15
|
-
"assets/ProviderDetailPage-
|
|
14
|
+
"assets/OverviewPage-BSQnF2Lp.js",
|
|
15
|
+
"assets/ProviderDetailPage-DK_e0FJz.js",
|
|
16
16
|
"assets/ProviderIcon-jjqXJDA3.js",
|
|
17
|
-
"assets/ProvidersPage-
|
|
18
|
-
"assets/ProxyPage-
|
|
19
|
-
"assets/QuotaPage-
|
|
20
|
-
"assets/SettingsPage-
|
|
21
|
-
"assets/SetupPage-
|
|
22
|
-
"assets/StudioPage-
|
|
17
|
+
"assets/ProvidersPage-D_a3r6Gc.js",
|
|
18
|
+
"assets/ProxyPage-BBTRBAQ3.js",
|
|
19
|
+
"assets/QuotaPage-B2WqMSG1.js",
|
|
20
|
+
"assets/SettingsPage-D7xp5Ij_.js",
|
|
21
|
+
"assets/SetupPage-LND6_Ss7.js",
|
|
22
|
+
"assets/StudioPage-BzNnm6Bi.js",
|
|
23
23
|
"assets/ToolIcon-CfeLA-Z_.js",
|
|
24
|
-
"assets/UsagePage-
|
|
24
|
+
"assets/UsagePage-C1TbL24N.js",
|
|
25
25
|
"assets/api-keys-KvX83mRe.js",
|
|
26
26
|
"assets/app-DRnQLhsc.js",
|
|
27
27
|
"assets/app-mweRcsKp.css",
|
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
"assets/download-dRFo5_Wu.js",
|
|
48
48
|
"assets/drawer-QqPul6sC.js",
|
|
49
49
|
"assets/entry-BMlYJVFj.js",
|
|
50
|
-
"assets/entry-D6WvojeD.js",
|
|
51
50
|
"assets/entry-Dmx7gBiN.js",
|
|
51
|
+
"assets/entry-vqGb8yVz.js",
|
|
52
52
|
"assets/eye-C_hawfH4.js",
|
|
53
53
|
"assets/eye-off-Bk5g2luF.js",
|
|
54
54
|
"assets/fingerprint-pattern-BWuHtbW4.js",
|
|
55
|
-
"assets/formatters-
|
|
55
|
+
"assets/formatters-DP-5E01-.js",
|
|
56
56
|
"assets/gauge-BbIMy7MB.js",
|
|
57
57
|
"assets/house-h9AZlJuT.js",
|
|
58
58
|
"assets/image-BPaouViG.js",
|
|
59
|
-
"assets/index-
|
|
59
|
+
"assets/index-D36vCZht.js",
|
|
60
60
|
"assets/inline-CHJQwxLa.js",
|
|
61
61
|
"assets/input-BlmlizVV.js",
|
|
62
62
|
"assets/jsx-runtime-CXUMngI_.js",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"assets/routing-fnCsxgNO.js",
|
|
102
102
|
"assets/scaling-nWE4Cx8f.js",
|
|
103
103
|
"assets/search-JOKus9rb.js",
|
|
104
|
-
"assets/select-
|
|
104
|
+
"assets/select-C9Ssle9b.js",
|
|
105
105
|
"assets/settings-2-Ds9DQp0t.js",
|
|
106
106
|
"assets/settings-BxslsErn.js",
|
|
107
107
|
"assets/shield-BMQNxORh.js",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- Adds `provider_routing_settings.custom_user_agent` (text, nullable) — an
|
|
2
|
+
-- operator-set custom User-Agent that is stored separately from the provider's
|
|
3
|
+
-- native client identity (`user_agent`). This is the column the dashboard's
|
|
4
|
+
-- custom User-Agent control writes to.
|
|
5
|
+
--
|
|
6
|
+
-- NULL (default) means no custom override: dispatch uses the provider's native
|
|
7
|
+
-- identity. A non-NULL value is an explicit override and is applied at the
|
|
8
|
+
-- request edge (it replaces the User-Agent header even when the provider would
|
|
9
|
+
-- otherwise stamp its own).
|
|
10
|
+
--
|
|
11
|
+
-- Idempotency comes from the migration ledger plus `ADD COLUMN IF NOT EXISTS`:
|
|
12
|
+
-- a database built from a newer baseline that already carries the column must
|
|
13
|
+
-- not fail startup.
|
|
14
|
+
ALTER TABLE "provider_routing_settings" ADD COLUMN IF NOT EXISTS "custom_user_agent" text;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Adds `provider_routing_settings.custom_user_agent` (text, nullable) — an
|
|
2
|
+
-- operator-set custom User-Agent stored separately from the provider's native
|
|
3
|
+
-- client identity (`user_agent`). SQLite stores text as-is; NULL = no custom
|
|
4
|
+
-- override (native identity is used).
|
|
5
|
+
--
|
|
6
|
+
-- Idempotency comes from the migration ledger, not from the statement: the
|
|
7
|
+
-- runner records the file inside the same transaction, so a file that has
|
|
8
|
+
-- already run is never re-executed. The baseline is generated from
|
|
9
|
+
-- `0000_baseline.sql` alone and does not carry this column.
|
|
10
|
+
ALTER TABLE "provider_routing_settings" ADD COLUMN "custom_user_agent" text;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cartethyia",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.7",
|
|
4
4
|
"description": "A powerful, self-hosted reverse proxy for OpenAI- and Anthropic-compatible AI clients, powered by native Bun and Elysia. It serves both protocols from a single server, routes every model across any configured provider, and translates requests and responses in real time — streaming and prompt caching included. Underneath it runs a full delivery engine: per-account health tracking, quota and cooldown enforcement, automatic failover across pools and providers, usage accounting, and telemetry. Point OpenCode, Cline, Claude Code, Codex, or any compatible client at Cartethyia and it keeps its native protocol while the gateway absorbs every provider-specific difference behind it. Runs on embedded SQLite or external PostgreSQL with optional Redis coordination, ships as a global CLI with a system-tray console, and needs only Bun 1.4+ alongside Node.js/npm.",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -69,6 +69,8 @@
|
|
|
69
69
|
"check:migrations": "bun run scripts/test/check-migrations.ts"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
+
"@grpc/grpc-js": "^1.14.7",
|
|
73
|
+
"@grpc/proto-loader": "^0.8.1",
|
|
72
74
|
"drizzle-orm": "0.45.2",
|
|
73
75
|
"elysia": "2.0.0-beta.16",
|
|
74
76
|
"enquirer": "^2.4.1",
|
package/src/config/security.ts
CHANGED
|
@@ -9,7 +9,7 @@ const ENCRYPTION_KEY_LENGTH = 32;
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Per-IP request ceiling for the unauthenticated abuse-protection layer.
|
|
12
|
-
* Defaults to
|
|
12
|
+
* Defaults to 540 requests per window so an unset env does not mean unlimited;
|
|
13
13
|
* operators tune it via `IP_RATE_MAX_PER_WINDOW`.
|
|
14
14
|
*/
|
|
15
15
|
export function resolveIpRateLimit(): number {
|
package/src/config/spec.ts
CHANGED
|
@@ -89,11 +89,12 @@ export const CONFIG_SPEC = {
|
|
|
89
89
|
CARTETHYIA_API_KEY: { kind: "optional-text" },
|
|
90
90
|
CARTETHYIA_SERVER_MAX_BODY_BYTES: {
|
|
91
91
|
kind: "int",
|
|
92
|
-
// A
|
|
93
|
-
//
|
|
94
|
-
// admission's job, so an
|
|
95
|
-
// sets the ceiling in
|
|
96
|
-
|
|
92
|
+
// A 1M-token context is roughly 4+ MB of text (Qoder gRPC/legacy paths
|
|
93
|
+
// accept it), so 16 MB admits every real request while bounding the
|
|
94
|
+
// worst-case hold. How many may be in flight is admission's job, so an
|
|
95
|
+
// operator with even larger payloads raises this and sets the ceiling in
|
|
96
|
+
// Settings.
|
|
97
|
+
default: 16 * 1024 * 1024,
|
|
97
98
|
min: 1024,
|
|
98
99
|
max: Number.MAX_SAFE_INTEGER,
|
|
99
100
|
},
|
|
@@ -172,6 +173,12 @@ export const CONFIG_SPEC = {
|
|
|
172
173
|
*/
|
|
173
174
|
CARTETHYIA_DISABLED_TASKS: { kind: "list" },
|
|
174
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Force the Qoder UMID bridge to the mini-ELF bundle on Linux
|
|
178
|
+
* (`1` = always mini, `0` = never mini; absent = auto-detect containers).
|
|
179
|
+
*/
|
|
180
|
+
CARTETHYIA_QODER_UMID_MINI: { kind: "int", default: 0, min: 0, max: 1 },
|
|
181
|
+
|
|
175
182
|
/**
|
|
176
183
|
* How long a day's telemetry is kept, in days.
|
|
177
184
|
*
|
|
@@ -269,7 +276,7 @@ export const CONFIG_SPEC = {
|
|
|
269
276
|
CARTETHYIA_PROXY_MAX_FREE_SOCKETS: { kind: "int", default: 20, min: 0, max: 100_000 },
|
|
270
277
|
|
|
271
278
|
// Security (encryption key, public origin, abuse ceiling)
|
|
272
|
-
IP_RATE_MAX_PER_WINDOW: { kind: "int", default:
|
|
279
|
+
IP_RATE_MAX_PER_WINDOW: { kind: "int", default: 540, min: 1, max: Number.MAX_SAFE_INTEGER },
|
|
273
280
|
CARTETHYIA_ENCRYPTION_KEY: {
|
|
274
281
|
kind: "required",
|
|
275
282
|
error:
|