@spark233/plugin-traffic 0.0.0-stage → 0.2.5
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/LICENSE.spark233 +21 -0
- package/README.md +34 -2
- package/assets/LICENSE.lucide +43 -0
- package/assets/icon.ico +0 -0
- package/assets/icon.png +0 -0
- package/assets/icon.svg +1 -0
- package/assets/theme-icons/blue-dark/icon.ico +0 -0
- package/assets/theme-icons/blue-dark/icon.png +0 -0
- package/assets/theme-icons/blue-light/icon.ico +0 -0
- package/assets/theme-icons/blue-light/icon.png +0 -0
- package/assets/theme-icons/green-dark/icon.ico +0 -0
- package/assets/theme-icons/green-dark/icon.png +0 -0
- package/assets/theme-icons/green-light/icon.ico +0 -0
- package/assets/theme-icons/green-light/icon.png +0 -0
- package/assets/theme-icons/orange-dark/icon.ico +0 -0
- package/assets/theme-icons/orange-dark/icon.png +0 -0
- package/assets/theme-icons/orange-light/icon.ico +0 -0
- package/assets/theme-icons/orange-light/icon.png +0 -0
- package/assets/theme-icons/purple-dark/icon.ico +0 -0
- package/assets/theme-icons/purple-dark/icon.png +0 -0
- package/assets/theme-icons/purple-light/icon.ico +0 -0
- package/assets/theme-icons/purple-light/icon.png +0 -0
- package/assets/theme-icons/rose-dark/icon.ico +0 -0
- package/assets/theme-icons/rose-dark/icon.png +0 -0
- package/assets/theme-icons/rose-light/icon.ico +0 -0
- package/assets/theme-icons/rose-light/icon.png +0 -0
- package/backend.mjs +8144 -0
- package/collector.ps1 +46 -0
- package/legal/HarmonyOS_Fonts.txt +34 -0
- package/legal/SourceHanSerif.txt +96 -0
- package/legal/spark233-renderer-THIRD_PARTY_NOTICES.md +670 -0
- package/native/Dia2Lib.dll +0 -0
- package/native/KernelTraceControl.dll +0 -0
- package/native/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/native/Microsoft.Data.Sqlite.dll +0 -0
- package/native/Microsoft.Diagnostics.FastSerialization.dll +0 -0
- package/native/Microsoft.Diagnostics.NETCore.Client.dll +0 -0
- package/native/Microsoft.Diagnostics.Tracing.TraceEvent.dll +0 -0
- package/native/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
- package/native/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/native/Microsoft.Win32.Registry.dll +0 -0
- package/native/SQLitePCLRaw.batteries_v2.dll +0 -0
- package/native/SQLitePCLRaw.core.dll +0 -0
- package/native/SQLitePCLRaw.provider.dynamic_cdecl.dll +0 -0
- package/native/System.Buffers.dll +0 -0
- package/native/System.Collections.Immutable.dll +0 -0
- package/native/System.IO.Pipelines.dll +0 -0
- package/native/System.Memory.dll +0 -0
- package/native/System.Numerics.Vectors.dll +0 -0
- package/native/System.Reflection.Metadata.dll +0 -0
- package/native/System.Reflection.TypeExtensions.dll +0 -0
- package/native/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/native/System.Security.AccessControl.dll +0 -0
- package/native/System.Security.Principal.Windows.dll +0 -0
- package/native/System.Text.Encodings.Web.dll +0 -0
- package/native/System.Text.Json.dll +0 -0
- package/native/System.Threading.Tasks.Extensions.dll +0 -0
- package/native/TraceReloggerLib.dll +0 -0
- package/native/e_sqlite3.dll +0 -0
- package/native/licenses/Microsoft.Bcl.AsyncInterfaces.nuspec +27 -0
- package/native/licenses/Microsoft.Data.Sqlite.Core.nuspec +37 -0
- package/native/licenses/Microsoft.Data.Sqlite.nuspec +36 -0
- package/native/licenses/Microsoft.Diagnostics.NETCore.Client.nuspec +30 -0
- package/native/licenses/Microsoft.Diagnostics.Tracing.TraceEvent.nuspec +41 -0
- package/native/licenses/Microsoft.Extensions.DependencyInjection.Abstractions-LICENSE.TXT +23 -0
- package/native/licenses/Microsoft.Extensions.DependencyInjection.Abstractions.nuspec +35 -0
- package/native/licenses/Microsoft.Extensions.Logging.Abstractions-LICENSE.TXT +23 -0
- package/native/licenses/Microsoft.Extensions.Logging.Abstractions.nuspec +48 -0
- package/native/licenses/Microsoft.Win32.Registry-LICENSE.TXT +23 -0
- package/native/licenses/Microsoft.Win32.Registry.nuspec +94 -0
- package/native/licenses/SQLitePCLRaw.bundle_e_sqlite3.nuspec +43 -0
- package/native/licenses/SQLitePCLRaw.core.nuspec +19 -0
- package/native/licenses/SQLitePCLRaw.lib.e_sqlite3.nuspec +17 -0
- package/native/licenses/SQLitePCLRaw.provider.dynamic_cdecl.nuspec +19 -0
- package/native/licenses/System.Buffers.nuspec +24 -0
- package/native/licenses/System.Collections.Immutable.nuspec +33 -0
- package/native/licenses/System.IO.Pipelines.nuspec +38 -0
- package/native/licenses/System.Memory.nuspec +32 -0
- package/native/licenses/System.Numerics.Vectors.nuspec +27 -0
- package/native/licenses/System.Reflection.Metadata-LICENSE.TXT +23 -0
- package/native/licenses/System.Reflection.Metadata.nuspec +34 -0
- package/native/licenses/System.Reflection.TypeExtensions-LICENSE.TXT +23 -0
- package/native/licenses/System.Reflection.TypeExtensions.nuspec +64 -0
- package/native/licenses/System.Runtime.CompilerServices.Unsafe.nuspec +27 -0
- package/native/licenses/System.Security.AccessControl-LICENSE.TXT +23 -0
- package/native/licenses/System.Security.AccessControl.nuspec +55 -0
- package/native/licenses/System.Security.Principal.Windows-LICENSE.TXT +23 -0
- package/native/licenses/System.Security.Principal.Windows.nuspec +68 -0
- package/native/licenses/System.Text.Encodings.Web.nuspec +38 -0
- package/native/licenses/System.Text.Json.nuspec +50 -0
- package/native/licenses/System.Threading.Tasks.Extensions.nuspec +28 -0
- package/native/licenses/System.ValueTuple.nuspec +25 -0
- package/native/licenses/dependencies.json +158 -0
- package/native/msdia140.dll +0 -0
- package/native/resources.json +226 -0
- package/native/spark233.Traffic.Core.dll +0 -0
- package/native/spark233.Traffic.Core.dll.config +59 -0
- package/native/spark233.TrafficClient.exe +0 -0
- package/native/spark233.TrafficClient.exe.config +62 -0
- package/native/spark233.TrafficService.exe +0 -0
- package/native/spark233.TrafficService.exe.config +62 -0
- package/native/spark233.TrafficSetup.exe +0 -0
- package/native/spark233.TrafficSetup.exe.config +62 -0
- package/package.json +356 -3
- package/renderer/assets/HarmonyOS_Sans_SC-BKicpBgU.ttf +0 -0
- package/renderer/assets/SourceHanSerifSC-Regular-KhFegrri.woff2 +0 -0
- package/renderer/assets/index-D40wqc6o.css +2 -0
- package/renderer/assets/index-DqTMamUW.js +2 -0
- package/renderer/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/renderer/assets/vendor-react-DCTAcUCH.js +9 -0
- package/renderer/index.html +15 -0
- package/renderer/spark233-renderer.json +1 -0
- package/renderer/spark233-shared-ui.json +18 -0
- package/renderer/spark233-ui.json +11 -0
- package/widgets/hud.json +59 -0
- package/widgets/traffic-hover.json +36 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,t}from"./rolldown-runtime-WkwZ5CU-.js";import{i as n,n as r,r as i,t as a}from"./vendor-react-DCTAcUCH.js";(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)}})();var o=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function s(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:o(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var c=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},l=e=>{let t=c(e);return t.charAt(0).toUpperCase()+t.slice(1)},u=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),d={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function f(e){return e!=null}function p(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??d.width,a=e.size??e.height??d.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?u(...c):u(`lucide`,...s,...c),p=t.absoluteStrokeWidth?Number(t.strokeWidth??d[`stroke-width`])*Number(e.size??e.width??d.width)/Number(t.size??t.width??d.width):t.strokeWidth??d[`stroke-width`];return[`svg`,{...Object.entries(d).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&f(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&f(t.width)&&{[r(`width`)]:t.width},...`height`in t&&f(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function m(e,t={}){return p(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var h=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},g=e(n(),1),_=(0,g.createContext)({}),v=()=>(0,g.useContext)(_),y=(0,g.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:d={node:l,aliases:[],size:24},...f},p)=>{let{size:_=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=v()??{},w=!!c||h(f),[T,E,D=[]]=m(d,{color:e??S,width:n??t??_,height:r??t??_,strokeWidth:i??y,absoluteStrokeWidth:a??b,nonScalingStroke:o??x,className:u(C,s),hasA11yProp:w,attributes:f});return(0,g.createElement)(T,{ref:p,...E},[...D.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function b(e,t=[],n=[]){let r=typeof e==`string`?s(e,t,n):e,i=(0,g.forwardRef)(({className:e,...t},n)=>(0,g.createElement)(y,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=l(r.name)),i}var x={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};x.node;var S=b(x),C={name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]};C.node;var w=b(C),T={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};T.node;var E=b(T),D={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};D.node;var O=b(D),k={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};k.node;var A=b(k),j={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};j.node;var M=b(j),N={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};N.node;var P=b(N),F={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};F.node;var I=b(F),L={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};L.node;var R=b(L),z={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};z.node;var B=b(z),V={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};V.node;var H=b(V),U={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};U.node;var ee=b(U),te={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};te.node;var W=b(te),G={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};G.node;var ne=b(G),re={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};re.node;var ie=b(re),ae={name:`square-x`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-square`]};ae.node;var oe=b(ae),se={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};se.node;var ce=b(se);function le(){return typeof window<`u`}function ue(e){return pe(e)?(e.nodeName||``).toLowerCase():`#document`}function de(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fe(e){return((pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pe(e){return le()?e instanceof Node||e instanceof de(e).Node:!1}function K(e){return le()?e instanceof Element||e instanceof de(e).Element:!1}function q(e){return le()?e instanceof HTMLElement||e instanceof de(e).HTMLElement:!1}function me(e){return!le()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof de(e).ShadowRoot}function he(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ge(e){return/^(table|td|th)$/.test(ue(e))}function _e(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ve=/transform|translate|scale|rotate|perspective|filter/,ye=/paint|layout|strict|content/,be=e=>!!e&&e!==`none`,xe;function Se(e){let t=K(e)?Ee(e):e;return be(t.transform)||be(t.translate)||be(t.scale)||be(t.rotate)||be(t.perspective)||!we()&&(be(t.backdropFilter)||be(t.filter))||ve.test(t.willChange||``)||ye.test(t.contain||``)}function Ce(e){let t=Oe(e);for(;q(t)&&!Te(t);){if(Se(t))return t;if(_e(t))return null;t=Oe(t)}return null}function we(){return xe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xe}function Te(e){return/^(html|body|#document)$/.test(ue(e))}function Ee(e){return de(e).getComputedStyle(e)}function De(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oe(e){if(ue(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||me(e)&&e.host||fe(e);return me(t)?t.host:t}function ke(e){let t=Oe(e);return Te(t)?(e.ownerDocument||e).body:q(t)&&he(t)?t:ke(t)}function Ae(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ke(e),i=r===e.ownerDocument?.body,a=de(r);if(i){let e=je(a);return t.concat(a,a.visualViewport||[],he(r)?r:[],e&&n?Ae(e):[])}return t.concat(r,Ae(r,[],n))}function je(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Me={...g},Ne={};function Pe(e,t){let n=g.useRef(Ne);return n.current===Ne&&(n.current=e(t)),n}var Fe=Me.useInsertionEffect,Ie=Fe&&Fe!==Me.useLayoutEffect?Fe:e=>e();function J(e){let t=Pe(Le).current;return t.next=e,Ie(t.effect),t.trampoline}function Le(){let e={next:void 0,callback:Re,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Re(){}var Y=typeof document<`u`?g.useLayoutEffect:()=>{};function ze(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Be={};function Ve(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ue(t);let a=Ue(e);return t&&(a=We(a,t)),n&&(a=We(a,n)),r&&(a=We(a,r)),i&&(a=We(a,i)),a}function He(e){if(e.length===0)return Be;if(e.length===1)return Ue(e[0]);let t=Ue(e[0]);for(let n=1;n<e.length;n+=1)t=We(t,e[n]);return t}function Ue(e){return Je(e)?{...e(Be)}:Ge(e)}function We(e,t){return Je(t)?t(e):Ke(e,t)}function Ge(e){let t={...e};for(let e in t){let n=t[e];qe(e,n)&&(t[e]=Xe(n))}return t}function Ke(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ze(e.style,r);break;case`className`:e[n]=Qe(e.className,r);break;default:e[n]=qe(n,r)?Ye(e[n],r):r}}return e}function qe(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Je(e){return typeof e==`function`}function Ye(e,t){return t?e?(...n)=>{let r=n[0];if($e(r)){let i=r;Ze(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Xe(t):e}function Xe(e){return e&&((...t)=>{let n=t[0];return $e(n)&&Ze(n),e(...t)})}function Ze(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Qe(e,t){return t?e?t+` `+e:t:e}function $e(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function et(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var tt=et(`https://base-ui.com/production-error`,`Base UI`),nt=g.createContext(void 0);function rt(e=!1){let t=g.useContext(nt);if(t===void 0&&!e)throw Error(tt(16));return t}function it(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:g.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function X(e){return e?.ownerDocument||document}function at(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(de(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function ot(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=g.useRef(null),s=rt(!0),c=a??s!==void 0,{props:l}=it({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=g.useCallback(()=>{let e=o.current;st(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:g.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Ve({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Ze(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=st(r),s=!i&&ct(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),at(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),at(r,e)))},onKeyUp(e){t||(Ze(e),a?.(e),e.target===e.currentTarget&&i&&c&&st(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),at(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:J(e=>{o.current=e,u()})}}function st(e){return q(e)&&e.tagName===`BUTTON`}function ct(e){return q(e)&&e.tagName===`A`&&!!e.href}function lt(e,t,n,r){let i=Pe(dt).current;return ft(i,e,t,n,r)&&mt(i,[e,t,n,r]),i.callback}function ut(e){let t=Pe(dt).current;return pt(t,e)&&mt(t,e),t.callback}function dt(){return{callback:null,cleanup:null,refs:[]}}function ft(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function pt(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function mt(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var ht=19;function gt(e){return ht>=e}function _t(e){if(!g.isValidElement(e))return null;let t=e,n=t.props;return(gt(19)?n?.ref:t.ref)??null}function vt(){}var yt=Object.freeze([]),bt=Object.freeze({});function xt(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function St(e,t){return typeof e==`function`?e(t):e}function Ct(e,t){return typeof e==`function`?e(t):e}function wt(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ot(r));let i=Tt(t,n,r);if(n.enabled===!1)return null;let a=n.state??bt;return kt(e,r,i,a)}function Tt(e,t,n){let{className:r,style:i}=e,{state:a=bt,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?St(r,a):void 0,d=l?Ct(i,a):void 0,f=l?xt(a,c):bt,p=l&&s?Et(s):void 0,m=l?ze(f,p)??{}:bt;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ut([m.ref,_t(n),...o]):lt(m.ref,_t(n),o):lt(null,null)),l?(u!==void 0&&(m.className=Qe(m.className,u)),d!==void 0&&(m.style=ze(m.style,d)),m):bt}function Et(e){return Array.isArray(e)?He(e):Ve(void 0,e)}var Dt=Symbol.for(`react.lazy`);function Ot(e){if(e?.$$typeof!==Dt)return e;let t=g.Children.toArray(e)[0];return g.isValidElement(t)?t:e}function kt(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ve(n,t.props);return e.ref=n.ref,g.cloneElement(t,e)}return At(e,n)}function At(e,t){return e===`button`?(0,g.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,g.createElement)(`img`,{alt:``,...t,key:t.key}):g.createElement(e,t)}var jt=g.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=ot({disabled:i,focusableWhenDisabled:a,native:o});return wt(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Mt=r();function Nt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Nt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Pt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Nt(e))&&(r&&(r+=` `),r+=t);return r}var Ft=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,It=Pt,Lt=(e,t)=>n=>{if(t?.variants==null)return It(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ft(t)||Ft(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return It(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Rt=48,zt=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Rt-t;return n},Bt=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Vt=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Rt;n+=i>>>1^-(i&1),t[r]=n}return t},Ht=384,Ut=[],Wt=Bt(zt(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Gt=Bt(zt(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Kt=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,qt=(()=>{let e=Wt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Wt[n];i<Wt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Wt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Wt[i];a<Wt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Jt=zt(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Yt=Bt(zt(`123333359346463635126536711576`)),Xt=zt(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Zt=zt(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Qt=Vt(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),$t=(()=>{let e=new Int32Array(319).fill(-1),t=Vt(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=Vt(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),en=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),tn=Vt(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),nn=Vt(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),rn=Vt(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),an=new Int32Array(995),on=new Int32Array(995),sn=new Int32Array(995),cn=``,ln=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<tn.length;r++)for(let i of en[rn[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),ln[a*2]=cn.length,ln[a*2+1]=i.length,cn+=i),an[n]=tn[r],on[n]=nn[r],sn[n]=a,n++}}var un=Vt(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),dn=Bt(zt(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),fn=Vt(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),pn=zt(`ij`),mn=zt(``),hn=zt(`1`),gn={GROUP_COUNT:Ht,customValidatorNames:Ut,edgeStart:Wt,labelStart:Gt,labelText:Kt,edgeTarget:qt,nodeGroup:Jt,nodeVlist:$t,vlistPat:Yt,vlistOps:Xt,vlistRef:Zt,vlistGroup:Qt,litAnchor:an,litGroup:on,litPool:sn,poolOffsets:ln,poolText:cn,adjGid:un,adjStart:dn,adjTgt:fn,patGid:pn,patTgt:mn,postfixLookupGroups:hn,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},_n=`line`in Error(),vn=-1,yn=-1,bn=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},xn=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Sn=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(bn(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(bn(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,H=V.length,U=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,W=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,G=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ne=0,re=-1,ie=-1,ae=-1,oe=-1,se=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ce=e=>/\s/.test(String.fromCharCode(e)),le=(e,t,n)=>{if(ne=0,re=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ne=1;else if(r===40&&i===41)ne=2;else return;ae=t+1,oe=n-1;let a=t+1;if(se(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!se(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(re=t+1,ie=a,ae=a+1)}},ue=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},de=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pe=e=>!!e&&!Number.isNaN(Number(e)),K=(e,t,n)=>{if(n-t<11||!ue(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ue(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ue(e,t+10,t+18,`-normal/`)},q=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],me=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),he=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ge=(e,t,n,r)=>{if(e>=10){if(e>=25)return U[e-25](t.slice(n,r));let i=e-10;if(ne!==q[i])return!1;if(re>=0){for(let e of me[i])if(ue(t,re,ie,e))return!0;return!1}switch(he[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ae,oe);return ee.test(e)&&!te.test(e)}case 3:return pe(t.slice(ae,oe));case 4:return G.test(t.slice(ae,oe));default:return W.test(t.slice(ae,oe))}}switch(e){case 0:return!0;case 1:return ne===0;case 2:return ne===1;case 3:return ne===2;case 4:return de.test(t.slice(n,r));case 5:return pe(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&pe(t.slice(n,r-1));case 8:return fe.test(t.slice(n,r));default:return K(t,n,r)}},_e=new Set(typeof E==`string`?E.split(` `):E),ve=(e,t,n,r,i,a)=>{let o=bn(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ye=new Map,be=new Map,xe=2,Se=4096,Ce=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||_e.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=be.get(s);return c===void 0&&be.set(s,c=xe++),c},we=new Map,Te=r,Ee=r+4096,De=()=>Te++,Oe=2097152,ke=8192,Ae=new Int32Array(ke),je=Array(ke).fill(null),Me=new Int32Array(ke),Ne=new Int32Array(ke),Pe=new Uint8Array(ke),Fe=0,Ie=(e,t,n,r,i,a,o,s)=>{let c=e;if(je[e]!==null){if(je[e|1]===null)c=e|1;else if(!(Fe++&3))c=e|Fe>>2&1;else return}je[c]=t.slice(n,r),Ae[c]=i,Me[c]=a,Ne[c]=o,Pe[c]=s},J=()=>je.fill(null),Le=256,Re=[new Int32Array(Le),new Int32Array(Le),new Int32Array(Le),new Int32Array(Le)],[Y,ze,Be,Ve]=Re,He=new Uint8Array(Le),Ue=new Uint8Array(Le),We=()=>{Le*=2,Re=Re.map(e=>{let t=new Int32Array(Le);return t.set(e),t}),[Y,ze,Be,Ve]=Re;let e=new Uint8Array(Le);e.set(He),He=e,Ue=new Uint8Array(Le)},Ge=64,Ke=new Int32Array(Ge),qe=new Int32Array(Ge),Je=new Int32Array(r),Ye=2048,Xe=21,Ze=new Float64Array(Ye),Qe=new Int32Array(Ye),$e=0,et=(e,t)=>{if(e===0&&t<r)return Je[t]===$e?1:(Je[t]=$e,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Xe;for(;Qe[i]===$e;){if(Ze[i]===n)return 1;i=i+1&Ye-1}return Ze[i]=n,Qe[i]=$e,0},tt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?vn:ve(we,e,t+1,r,0,De)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=qe[t];if(r>n)continue;let i=Ke[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;le(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ge(d[t],e,r,n))return p[h+t]}return vn},nt=e=>{let t=e.length,n=0,c=0,u=!1;(xe>Se||ye.size>Se)&&(ye=new Map,be=new Map,xe=2,J()),Te>Ee&&(we=new Map,Te=r,J());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ce(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ce(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Le&&We();let _=n++;Y[_]=p,ze[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Ae[y]===v&&je[y]!==null&&je[y].length===g?t=y:Ae[y|1]===v&&je[y|1]!==null&&je[y|1].length===g&&(t=y|1),t>=0){let n=je[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Be[_]=Me[t],Ve[_]=Ne[t],He[_]=Pe[t];continue}}}let b=p;if(H!==0){if(h-p<=H||!e.startsWith(V,p)){Be[_]=vn,Ie(y,e,p,h,v,vn,0,0);continue}b=p+H}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Ke[0]=0,qe[0]=M,R=1);let z=yn,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?yn:P,B=R),P!==yn){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=yn;else{let e=i[P],t=i[P+1],c=yn;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ge){Ge*=2;let e=new Int32Array(Ge);e.set(Ke),Ke=e;let t=new Int32Array(Ge);t.set(qe),qe=t}Ke[R]=r,qe[R]=t+2,R++}}A===D&&(z=F<I?yn:P,B=R);let U=F<I?yn:P,ee,te=!1;if(A>=0){if(te=!0,ee=tt(e,E,A,z,B),ee!==vn&&ee<r&&j[ee]){let t=tt(e,E,D,U,R);t!==vn&&t!==ee&&(ee=t,te=!1)}else ee===vn&&(ee=tt(e,E,D,U,R),te=!1)}else ee=tt(e,E,D,U,R);let W=0,G=0;ee===vn?Be[_]=vn:(G=+!!te,W=b>=C?+!!O:ve(ye,e,b,C,+!!O,e=>Ce(e,O)),Be[_]=ee,He[_]=G,Ve[_]=W),Ie(y,e,p,h,v,ee,W,G)}if(n===0)return``;if(n===1)return Y[0]===0&&ze[0]===t?e:e.slice(Y[0],ze[0]);if(n*k>Ye){for(;n*k>Ye;)Ye<<=1,Xe--;Ze=new Float64Array(Ye),Qe=new Int32Array(Ye)}if(xe>=Oe||Te>=Oe)throw Error(`cn: too many distinct classes in one merge`);$e=$e+1|0,$e===0&&(Je.fill(0),Qe.fill(0),$e=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Be[e];if(t===vn){Ue[e]=1;continue}let n=Ve[e];if(et(n,t)===1)Ue[e]=0,f=!0;else if(Ue[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)et(n,x[e]);if(He[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&et(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ue[m]){m++;continue}let t=Y[m],r=ze[m],i=m+1;for(;i<n&&Ue[i]&&Y[i]===r+1&&e.charCodeAt(r)===32;)r=ze[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},rt=16384,it=new Int32Array(rt*2),X=0,at=1,ot=Object.create(null),st=Object.create(null),ct=new Map,lt=new Map,ut=0,dt=0,ft=()=>{X^=rt,at=at+1|0,dt=0},pt=e=>{let t=ot[e];if(t!==void 0)return t;let n=xn(e,0,e.length),r=(n&16383)+X,i=it[r]===(n^at)||it[r^rt]===(n^at-1);return i&&(t=st[e],t!==void 0)?(ot[e]=t,t):(t=nt(e),i?(ot[e]=t,++ut>z&&(ut=0,st=ot,ot=Object.create(null),ft())):(it[r]=n^at,++dt>rt&&ft()),t)},mt=e=>{let t=ct.get(e);if(t!==void 0)return t;let n=xn(e,0,e.length),r=(n&16383)+X,i=it[r]===(n^at)||it[r^rt]===(n^at-1);return i&&(t=lt.get(e),t!==void 0)?(ct.set(e,t),t):(t=nt(e),i?(ct.set(e,t),++ut>z&&(ut=0,lt=ct,ct=new Map,ft())):(it[r]=n^at,++dt>rt&&ft()),t)},ht=e=>{let t=xn(e,0,e.length),n=(t&16383)+X;return it[n]===(t^at)||it[n^rt]===(t^at-1)||(it[n]=t^at,++dt>rt&&ft(),!1)},gt=z===0?nt:_n?e=>{let t=ct.get(e);return t===void 0?mt(e):t}:pt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?gt(arguments[0]):gt(Tn.apply(null,arguments))},mergeString:gt,seenBefore:z===0?()=>!1:ht,mergeUncached:nt}},Cn=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Cn(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},wn=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Cn(i,t);a&&(n&&(n+=` `),n+=a)}return n},Tn=function(){return wn(arguments,!1)},En=256,Dn=16,On=1024,kn=4096,An=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(kn).fill(``),l=Array(kn).fill(``),u=Array(kn).fill(``));let i=xn(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Cn(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Dn&&(_.miss=Dn,_.skip=On,_.e.length=0,_.at=0);let u=_.e;u.length<En?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Cn(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},jn=Sn(gn),Mn=An(jn.mergeString,jn);jn.merge;var Z=a(),Nn=Lt(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform,opacity] outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Pn({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Z.jsx)(jt,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Mn(Nn({variant:t,size:n,className:e})),...r})}var Fn=Lt(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function In({className:e,variant:t,...n}){return(0,Z.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:Mn(Fn({variant:t}),e),...n})}function Ln({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`alert-description`,className:Mn(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function Rn(e){return wt(e.defaultTagName??`div`,e,e)}var zn=Lt(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,opacity] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Bn({className:e,variant:t=`default`,render:n,...r}){return Rn({defaultTagName:`span`,props:Ve({className:Mn(zn({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var Vn=`data-valid`,Hn=`data-invalid`,Un={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Wn={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Gn={valid(e){return e===null?null:e?{[Vn]:``}:{[Hn]:``}}},Kn={invalid:void 0,name:void 0,validityData:{state:Un,errors:[],error:``,value:``,initialValue:null},setValidityData:vt,disabled:void 0,setTouched:vt,setDirty:vt,setFilled:vt,setFocused:vt,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Wn,registerFieldControl:vt,validation:{getValidationProps:(e,t=bt)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:vt,getInputControl:()=>null,commit:async()=>{},change:vt}},qn=g.createContext(Kn);function Jn(e=!0){let t=g.useContext(qn);if(t.setValidityData===vt&&!e)throw Error(tt(28));return t}var Yn=g.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:vt,validationMode:`onSubmit`,submitCountRef:{current:0}});function Xn(){return g.useContext(Yn)}function Zn(){let[,e]=g.useState({});return g.useCallback(()=>{e({})},[])}var Qn=0;function $n(e,t=`mui`){let n=g.useRef(void 0),r=Zn(),i=e??n.current;return g.useEffect(()=>{n.current??(Qn+=1,n.current=`${t}-${Qn}`,e??r())},[e,t,r]),i}var er=Me.useId;function tr(e,t){if(er!==void 0){let n=er();return e??(t?`${t}-${n}`:n)}return $n(e,t)}function nr(e){return tr(e,`base-ui`)}var rr=g.createContext({controlId:void 0,registerControlId:vt,resetControlId:vt,labelId:void 0,setLabelId:vt,messageIds:[],setMessageIds:vt,getDescriptionProps:e=>e});function ir(){return g.useContext(rr)}function ar(e,t,n,r=!0,i,a){let[o,s]=g.useState(),c=nr(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return Y(()=>{let i=e||t||l||!r?void 0:or(n.current,c);o!==i&&s(i)}),u}function or(e,t){let n=sr(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function sr(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function cr(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=ir(),o=nr(),s=Pe(()=>Symbol()),c=g.useRef(!1),l=g.useRef(!1),u=J(()=>{c.current&&i!==vt&&(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===vt){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}function lr(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ur,platform:dr,maxTouchPoints:fr}=lr(),pr=ur.toLowerCase(),mr=dr.toLowerCase(),hr=/^i(os$|p)/.test(mr)||mr===`macintel`&&fr>1,gr=`android`,_r=mr===gr||pr.includes(gr),vr=!hr&&mr.startsWith(`mac`);mr.startsWith(`win`),!_r&&/^(linux|chrome os)/.test(mr);var yr=vr||hr,br=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!br&&pr.includes(`firefox`),!br&&pr.includes(`chrom`);var xr=yr,Sr=/jsdom|happydom/.test(pr);function Cr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&me(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function wr(e,t){let n=e;for(;n;){if(K(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(me(n)?n.host:null)}return null}function Tr(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Er=`data-base-ui-focusable`,Dr=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Or=`ArrowLeft`,kr=`ArrowRight`,Ar=`ArrowUp`,jr=`ArrowDown`,Mr=`data-starting-style`,Nr=`data-ending-style`,Pr={[Mr]:``},Fr={[Nr]:``},Ir={transitionStatus(e){return e===`starting`?Pr:e===`ending`?Fr:null}},Lr=`data-open`,Rr=`data-closed`,zr=`data-anchor-hidden`,Br=`data-popup-open`,Vr=`data-pressed`,Hr={[Br]:``,[Vr]:``},Ur={[Lr]:``},Wr={[Rr]:``},Gr={[zr]:``},Kr={open(e){return e?Hr:null}},qr={open(e){return e?Ur:Wr},anchorHidden(e){return e?Gr:null}},Jr={...qr,...Ir},Yr=`data-trigger-disabled`;function Xr(e,t){if(!K(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Yr);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(Yr);return!1}function Zr(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Qr(e){return e.matches(`html,body`)}function $r(e){return q(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ei(e){return wr(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Dr}`)!=null}function ti(e){return e?e.getAttribute(`role`)===`combobox`&&$r(e):!1}function ni(e){if(!e||Sr)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ri(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ii(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ii(e,t.id,n)])}function ai(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function oi(e){e.preventDefault(),e.stopPropagation()}function si(e){return`nativeEvent`in e}function ci(e){return e.pointerType===``&&e.isTrusted?!0:_r&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function li(e){return Sr?!1:!_r&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(_r||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ui(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function di(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var fi=Math.min,pi=Math.max,mi=Math.round,hi=Math.floor,gi=e=>({x:e,y:e}),_i={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vi(e,t,n){return pi(e,fi(t,n))}function yi(e,t){return typeof e==`function`?e(t):e}function bi(e){return e.split(`-`)[0]}function xi(e){return e.split(`-`)[1]}function Si(e){return e===`x`?`y`:`x`}function Ci(e){return e===`y`?`height`:`width`}function wi(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ti(e){return Si(wi(e))}function Ei(e,t,n){n===void 0&&(n=!1);let r=xi(e),i=Ti(e),a=Ci(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fi(o)),[o,Fi(o)]}function Di(e){let t=Fi(e);return[Oi(e),t,Oi(t)]}function Oi(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ki=[`left`,`right`],Ai=[`right`,`left`],ji=[`top`,`bottom`],Mi=[`bottom`,`top`];function Ni(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ai:ki:t?ki:Ai;case`left`:case`right`:return t?ji:Mi;default:return[]}}function Pi(e,t,n,r){let i=xi(e),a=Ni(bi(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Oi)))),a}function Fi(e){let t=bi(e);return _i[t]+e.slice(t.length)}function Ii(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Li(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ii(e)}function Ri(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 zi(e,t){return t<0||t>=e.length}function Bi(e,t){return Ui(e.current,{disabledIndices:t})}function Vi(e,t){return Ui(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Hi(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Ui(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:zi(e,u)?-1:u,wrapped:d}}function Ui(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Wi(e,a,r));return a}function Wi(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Ki(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Gi(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Ki(e,t=e?Ee(e):null){return!e||!e.isConnected||!t||Gi(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var qi=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ji(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return me(n)?n.host:null}function Yi(e){for(let t of Array.from(e.children))if(ue(t)===`summary`)return t;return null}function Xi(e,t){let n=Yi(t);return!!n&&(e===n||Q(n,e))}function Zi(e){let t=e?ue(e):``;return e!=null&&e.matches(qi)&&(t!==`summary`||e.parentElement!=null&&ue(e.parentElement)===`details`&&Yi(e.parentElement)===e)&&(t!==`details`||Yi(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Qi(e){if(!Zi(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ji(t)){let n=t!==e,r=ue(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ue(t)===`details`&&!t.open&&!Xi(e,t)||t.hasAttribute(`hidden`)||!r&&!$i(t,n))return!1}return!0}function $i(e,t){let n=Ee(e);return t?n.display!==`none`:Ki(e,n)}function ea(e){let t=e.tabIndex;if(t<0){let t=ue(e);if(t===`details`||t===`audio`||t===`video`||q(e)&&e.isContentEditable)return 0}return t}function ta(e){if(ue(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function na(e,t){let n=ta(e);if(!n)return!0;let r=t.find(e=>{let t=ta(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ta(e);return t?.name===n.name&&t.form===n.form})===n}function ra(e){if(q(e)&&ue(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return q(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ia(e,t){ra(e).forEach(e=>{Zi(e)&&t.push(e),ia(e,t)})}function aa(e,t,n){ra(e).forEach(e=>{q(e)&&e.matches(t)&&n.push(e),aa(e,t,n)})}function oa(e){return Qi(e)&&ea(e)>=0}function sa(e){let t=[];return ia(e,t),t.filter(Qi)}function ca(e){let t=sa(e);return t.filter(e=>ea(e)>=0&&na(e,t))}function la(e,t){let n=ca(e),r=n.length;if(r===0)return;let i=Cr(X(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ua(e){return la(X(e).body,1)||e}function da(e){return la(X(e).body,-1)||e}function fa(e,t,n){if(!e)return null;let r=[];ia(X(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Qi);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&oa(o)&&na(o,a))return o}return r[i]}function pa(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function ma(e){ca(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ha(e){let t=[];aa(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ga(e){g.useEffect(e,yt)}var _a=0,va=class e{static create(){return new e}currentId=_a;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=_a,t()},e)}isStarted(){return this.currentId!==_a}clear=()=>{this.currentId!==_a&&(clearTimeout(this.currentId),this.currentId=_a)};disposeEffect=()=>this.clear};function ya(){let e=Pe(va.create).current;return ga(e.disposeEffect),e}var ba=g.createContext({disabled:!1});function xa(){return g.useContext(ba)}var Sa=null;globalThis.requestAnimationFrame;var Ca=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},wa=class e{static create(){return new e}static request(e){return Ca.request(e)}static cancel(e){return Ca.cancel(e)}currentId=Sa;request(e){this.cancel(),this.currentId=Ca.request(()=>{this.currentId=Sa,e()})}cancel=()=>{this.currentId!==Sa&&(Ca.cancel(this.currentId),this.currentId=Sa)};disposeEffect=()=>this.cancel};function Ta(){let e=Pe(wa.create).current;return ga(e.disposeEffect),e}function Ea(e){return e==null?e:`current`in e?e.current:e}function Da(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Oa=e(i(),1),ka=null;function Aa(e){if(!ka){let e=[];ka=e,queueMicrotask(()=>{ka=null,Oa.flushSync(()=>{for(let t of e)t()})})}ka.push(e)}function ja(e,t=!1,n=!1){let r=Ta();return J((i,a=null)=>{r.cancel();let o=Ea(e);if(o==null)return;let s=o,c=()=>{n?Aa(()=>{a?.aborted||i()}):Oa.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Da(s).map(e=>e.finished.then(vt))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Da(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Mr;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Ma(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=J(a),s=ja(r,n,i);g.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Na(e,t=!1,n=!1,r=!1){let[i,a]=g.useState(e&&t?`idle`:void 0),[o,s]=g.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=wa.request(()=>{a(`ending`)});return()=>{wa.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t||i===void 0)return;let n=wa.request(()=>{a(void 0)});return()=>{wa.cancel(n)}},[t,e,i]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=wa.request(()=>{a(`idle`)});return()=>{wa.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Pa(e,t,n){let{setFocused:r,focusOwnerRef:i}=Jn(),a=J(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Y(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Fa(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Jn(),s=Pe(()=>Symbol());Y(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Ia(e,t){let n=g.useRef(e),r=J(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function La(e,t,n,r){let i=!1,a=!1,o=r??bt;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Ra(e,t,n){let r=n??bt;return{reason:e,event:t??new Event(`base-ui`),...r}}var za=`none`,Ba=`trigger-press`,Va=`trigger-hover`,Ha=`trigger-focus`,Ua=`outside-press`,Wa=`item-press`,Ga=`close-press`,Ka=`focus-out`,qa=`escape-key`,Ja=`list-navigation`,Ya=`keyboard`,Xa=`pointer`,Za=`cancel-open`,Qa=`sibling-open`,$a=`imperative-action`,eo=g.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:_,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=Jn(),{clearErrors:C,elementRef:w,submitCountRef:T}=Xn(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=ir(),A=cr({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=J(()=>S.inputRef.current?.value);Fa(S.inputRef,A,M,N,!E,a),Y(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,l,S.inputRef,b]),Ia(M,()=>{M!==void 0&&(C(D),v(M!==(y.initialValue??``)),S.change(M))});let P=g.useRef(null),F=Pa(E,P),I=ya();return wt(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=La(za,e.nativeEvent);c?.(t,n),!j&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(_(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){_(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:Gn})}),to=g.forwardRef(function(e,t){return(0,Z.jsx)(eo,{ref:t,...e})});function no({className:e,type:t,...n}){return(0,Z.jsx)(to,{type:t,"data-slot":`input`,className:Mn(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var ro=g.createContext(void 0);function io(e){let t=g.useContext(ro);if(!e&&t===void 0)throw Error(tt(27));return t}var ao=g.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=io(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return wt(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Jr,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),oo=g.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=io(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=ot({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,La(Ga,e.nativeEvent))}return wt(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),so=g.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=io(),c=nr(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),wt(`p`,e,{ref:t,props:[{id:c},o]})});function co(e,t){return t!=null&&!ui(t)?0:typeof e==`function`?e():e}function lo(e,t,n){let r=co(e,n);return typeof r==`number`?r:r?.[t]}function uo(e){return typeof e==`function`?e():e}function fo(e,t){return t||e===`click`||e===`mousedown`}function po(e){return e?.includes(`mouse`)&&e!==`mousedown`}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function mo(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function ho(e){let t=Pe(go,e).current;return t.next=e,Y(t.effect),t}function go(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var _o={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},vo={..._o,position:`fixed`,margin:0,top:0,left:0},yo={..._o,position:`absolute`},bo=g.forwardRef(function(e,t){let[n,r]=g.useState();Y(()=>{xr&&br&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:vo,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function xo(e){return`data-base-ui-${e}`}var So=0;function Co(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(So);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),vt;let o=requestAnimationFrame(a);return So=o,()=>{So===o&&(cancelAnimationFrame(o),So=0)}}var wo=`data-base-ui-inert`,To=new WeakMap,Eo=new WeakSet,Do=new WeakMap,Oo=0;function ko(e){return e?me(e)?e.host:ko(e.parentNode):null}var Ao=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ko(t);return e.contains(n)?n:null}).filter(e=>e!=null),jo=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Mo=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ue(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function No(e,t,n,{mark:r=!0}){let i=Ao(t,e),a=r?Mo(t,jo(i),new Set(i)):[],o=[],s=[];if(n){let e=Ao(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Mo(t,jo(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(To.get(e)||0)+1;To.set(e,r),o.push(e),r===1&&n&&Eo.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Do.get(e)||0)+1;Do.set(e,t),s.push(e),t===1&&e.setAttribute(wo,``)}),Oo+=1,()=>{o.forEach(e=>{let t=(To.get(e)||0)-1;To.set(e,t),t||(Eo.has(e)||e.removeAttribute(`aria-hidden`),Eo.delete(e))}),r&&s.forEach(e=>{let t=(Do.get(e)||0)-1;Do.set(e,t),t||e.removeAttribute(wo)}),--Oo,Oo||(To=new WeakMap,Eo=new WeakSet,Do=new WeakMap)}}function Po(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=X(e[0]).body;return No(e,i,n,{mark:r})}var Fo={style:{transition:`none`}},Io={fallbackAxisSide:`none`},Lo={fallbackAxisSide:`end`},Ro={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},zo=g.createContext(null),Bo=()=>g.useContext(zo),Vo=xo(`portal`);function Ho(e={}){let{ref:t,container:n,componentProps:r=bt,elementProps:i}=e,a=tr(),o=Bo()?.portalNode,[s,c]=g.useState(null),[l,u]=g.useState(null),d=J(e=>{e!==null&&u(e)}),f=g.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(pe(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=wt(`div`,r,{ref:[t,d],props:[{id:a,[Vo]:``},i]}),m=s&&p?Oa.createPortal(p,s):null;return{node:l,nodeId:g.isValidElement(p)?p.props.id:void 0,subtree:m}}var Uo=g.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Ho({container:o,ref:t,componentProps:e,elementProps:c}),f=g.useRef(null),p=g.useRef(null),m=g.useRef(null),h=g.useRef(null),[_,v]=g.useState(null),y=g.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!l;g.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&pa(e)&&(e.type===`focusin`?y.current&&=(ha(l),!1):(ma(l),y.current=!0))}return mo($(l,`focusin`,e,!0),$(l,`focusout`,e,!0))},[l,b]),Y(()=>{l&&x===!0&&y.current&&(ha(l),y.current=!1)},[x,l]);let C=g.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:v}),[l]);return(0,Z.jsxs)(g.Fragment,{children:[d,(0,Z.jsxs)(zo.Provider,{value:C,children:[S&&l&&(0,Z.jsx)(bo,{"data-type":`outside`,ref:f,onFocus:e=>{pa(e,l)?m.current?.focus():da(_?_.domReference:null)?.focus()}}),S&&l&&(0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:Ro}),l&&Oa.createPortal(a,l),S&&l&&(0,Z.jsx)(bo,{"data-type":`outside`,ref:p,onFocus:e=>{pa(e,l)?h.current?.focus():(ua(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,La(`focus-out`,e.nativeEvent)))}})]})]})});function Wo(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Go=class{nodesRef={current:[]};events=Wo();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Ko=g.createContext(null),qo=g.createContext(null),Jo=()=>g.useContext(Ko)?.id||null,Yo=e=>{let t=g.useContext(qo);return e??t};function Xo(e){let t=tr(),n=Yo(e),r=Jo();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Zo(e){let{children:t,id:n}=e,r=Jo();return(0,Z.jsx)(Ko.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Qo(e){let{children:t,externalTree:n}=e,r=Pe(()=>n??new Go).current;return(0,Z.jsx)(qo.Provider,{value:r,children:t})}function $o(e,t){let n=de(Tr(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(ci(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var es=20,ts=[];function ns(){ts=ts.filter(e=>e.deref()?.isConnected)}function rs(e){ns(),e&&ue(e)!==`body`&&(ts.push(new WeakRef(e)),ts.length>es&&(ts=ts.slice(-20)))}function is(){return ns(),ts[ts.length-1]?.deref()}function as(e){return e?oa(e)?e:ca(e)[0]||e:null}function os(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=sa(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return oa(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ss(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=J(()=>x.current.floatingContext?.nodeId),C=i===!1,w=ti(v)&&C,T=ho(i),E=ho(a),D=ho(o),O=ho(u),k=ho(_),A=Yo(m),j=Bo(),M=g.useRef(!1),N=g.useRef(!1),P=g.useRef(!1),F=g.useRef(null),I=g.useRef(``),L=g.useRef(``),R=g.useRef(null),z=g.useRef(null),B=lt(R,p,j?.beforeInsideRef),V=lt(z,j?.afterInsideRef),H=ya(),U=ya(),ee=Ta(),te=j!=null,W=ri(y),G=J((e=W)=>e?ca(e):[]),ne=J(()=>h?.().filter(e=>e!=null)??[]);g.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(W,Cr(X(W)))&&G().length===0&&!w&&oi(e)}return $(X(W),`keydown`,e)},[r,W,c,w,G]),g.useEffect(()=>{if(r||!_)return;let e=X(W);function t(){P.current=!1}function n(e){let t=Tr(e),n=ne(),r=Q(y,t)||Q(v,t)||Q(j?.portalNode,t)||n.some(e=>e===t||Q(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,wr(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,U.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return mo($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,y,v,W,_,j,U,ne]),g.useEffect(()=>{if(r||!l)return;let e=X(W);function n(){N.current=!0,U.start(0,()=>{N.current=!1})}function i(e){let t=Tr(e);oa(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Tr(n);c&&r==null&&a!=null&&Q(y,a)&&rs(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=ne(),p=r?.hasAttribute(xo(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,Ea(f),Ea(d)].includes(r),m=!(Q(v,r)||Q(y,r)||Q(r,y)||Q(j?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||A&&(ii(A.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||ai(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,ri(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&W&&os(W),s&&i!==v&&!Ki(a)&&Cr(e)===e.body){if(q(W)&&(W.focus(),s===`popup`)){ee.request(()=>{W.focus()});return}let e=G(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;q(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&m&&!N.current&&(w||r!==is())&&(M.current=!0,t.setOpen(!1,La(Ka,n)))})}function o(){P.current||(x.current.insideReactTree=!0,H.start(0,()=>{x.current.insideReactTree=!1}))}let u=q(v)?v:null;if(y||u)return mo(u&&$(u,`focusout`,a),u&&$(u,`pointerdown`,n),y&&$(y,`focusin`,i),y&&$(y,`focusout`,a),y&&j&&$(y,`focusout`,o,!0))},[r,v,y,W,c,A,j,t,l,s,G,w,S,x,H,U,ee,d,f,ne]),g.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${xo(`portal`)}]`)||[]),t=(A?ai(A.nodesRef.current,S()):[]).find(e=>ti(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Po([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...ne(),t,Ea(f),Ea(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Po([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,j,w,A,S,d,f,ne]),Y(()=>{if(!_||r||!q(W))return;I.current=``,L.current=``;let e=X(W),t=Cr(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||Q(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():Ea(r),o||=a();let s=Q(W,Cr(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&ci(c);Co(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=Cr(e);return!(t!==o&&Q(W,t))}})})},[r,_,W,G,T,O,k,x]);let re=g.useRef(null);Y(()=>{if(r||!W){re.current=null;return}re.current&&=(re.current.cancelled=!0,null);let e=X(W),t=Cr(e),n=O.current==null;rs(t);function i(e){if(e.open||(I.current=$o(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(xo(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(ci(e.nativeEvent)||li(e.nativeEvent))M.current=!1;else{let e=!1;X(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&ue(t)!==`body`?t:null,s=n?o||a:a||o;return s||=is()||null,typeof i==`boolean`?s:Ea(i)||s||null}return()=>{b.off(`openchange`,i);let t=Cr(e),n=ne(),r=Q(y,t)||n.some(e=>e===t||Q(e,t))||A&&ii(A.nodesRef.current,S(),!1).some(e=>Q(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};re.current=l,queueMicrotask(()=>{re.current===l&&(re.current=null);let n=as(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&q(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,W,E,D,O,b,A,v,S,ne]),Y(()=>{if(!br||_||!y)return;let e=Cr(X(y));q(e)&&$r(e)&&Q(y,e)&&e.blur()},[_,y]),Y(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,l,v]),Y(()=>{if(!r&&W)return os(W),()=>{queueMicrotask(ns)}},[r,W]);let ie=!r&&(!c||!w)&&(te||c);return(0,Z.jsxs)(g.Fragment,{children:[ie&&(0,Z.jsx)(bo,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=G();Co(e[e.length-1])}else j?.portalNode&&(M.current=!1,pa(e,j.portalNode)?ua(v)?.focus():Ea(f??j.beforeOutsideRef)?.focus())}}),n,ie&&(0,Z.jsx)(bo,{"data-type":`inside`,ref:V,onFocus:e=>{c?Co(G()[0]):j?.portalNode&&(l&&(M.current=!0),pa(e,j.portalNode)?da(v)?.focus():Ea(d??j.afterOutsideRef)?.focus())}})]})}function cs(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Ba}=t,l=e.context.dataRef,u=g.useRef(void 0),d=Ta(),f=ya(),p=g.useMemo(()=>{function t(t,n,r,i){let a=La(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=ui(e.pointerType,!0)&&li(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||ui(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Tr(s),p=$r(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:ui(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return g.useMemo(()=>n?{reference:p}:bt,[n,p])}function ls(){return!1}function us(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ds(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ls,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Yo(c),m=J(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,_=h!==!1,v=J(()=>a),{escapeKey:y,outsidePress:b}=us(s),x=g.useRef(!1),S=g.useRef(!1),C=g.useRef(!1),w=g.useRef(!1),T=g.useRef(!1),E=g.useRef(``),D=g.useRef(null),O=ya(),k=ya(),A=ya(),j=J(()=>{k.clear(),d.current.insideReactTree=!1}),M=J(e=>{let t=d.current.floatingContext?.nodeId;return(p?ii(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=J(t=>Zr(t,e.select(`floatingElement`))||Zr(t,e.select(`domReferenceElement`))),P=J(t=>{o()&&e.setOpen(!1,La(Ba,t.nativeEvent))}),F=J(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=si(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=La(qa,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=J(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=J(t=>{if(!l||!n||t.button!==0)return;let r=Tr(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=J(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});g.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),g.useEffect(()=>j,[j]),g.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new va,i=X(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(br?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function g(e){let t=d.current.floatingContext?.nodeId,n=p&&ii(p.nodesRef.current,t).some(t=>Zr(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=Tr(n),i=`[${xo(`inert`)}]`,a=K(r)?r.getRootNode():null,o=Array.from((me(a)?a:X(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=K(r)?r:null;for(;c&&!Te(c);){let e=Oe(c);if(Te(e)||!K(e))break;c=e}if(!(o.length&&K(r)&&!Qr(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(q(r)&&!(`touches`in n)){let e=Te(r),t=Ee(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!g(n)){if(f()===`intentional`){if(n.detail!==0&&!ci(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,La(Ua,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Tr(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():g(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function V(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function H(e){L(e,V)}function U(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ee(e){L(e,U)}let te=mo(r&&mo($(i,`keydown`,F),$(i,`compositionstart`,a),$(i,`compositionend`,o)),_&&mo($(i,`click`,z,!0),$(i,`pointerdown`,z,!0),$(i,`pointerup`,B,!0),$(i,`pointercancel`,B,!0),$(i,`mousedown`,z,!0),$(i,`mouseup`,B,!0),$(i,`touchstart`,R,{capture:!0,passive:!0}),$(i,`touchmove`,H,{capture:!0,passive:!0}),$(i,`touchend`,ee,{capture:!0,passive:!0})));return()=>{te(),t.clear(),c(),C.current=!1}},[d,u,r,_,h,l,n,y,b,F,j,v,M,N,p,e,O,A]);let z=g.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=g.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return g.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function fs(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};K(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function ps(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=J(i),{mounted:c,setMounted:l,transitionStatus:u}=Na(t,!1,!1,o),d=!t&&r;Y(()=>{t&&s(!1)},[t,s]);let f=g.useRef(c),p=g.useRef(!1),m=Zn(),h=()=>{f.current=!1,l(!1),a()};Y(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let _=J(()=>{f.current&&(t?(p.current=!0,m()):h())});return Ma({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}var ms={tabIndex:-1,[Er]:``};function hs(e){return t=>t!==`touch`||e.current}function gs(e,t=!1){let n=tr(),r=Jo()!=null,i=Pe(()=>e(n,r)).current;return fs({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function _s({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function vs(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function ys(e,t){let n=g.useRef(null);return J(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),vs(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),vs(t))})}function bs(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function xs(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ss(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ys(e,n),o=J(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=J(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Cs(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=g.useRef(null),i=e.useState(`open`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=La(za);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function ws(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=ps({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Pe(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ts(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:bt,inactiveTriggerProps:bt,popupProps:bt})},[e])}function Es(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ds=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Os=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ks=t(((e,t)=>{t.exports=Os()})),As=t((e=>{var t=n(),r=ks();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),js=t(((e,t)=>{t.exports=As()})),Ms=[],Ns=void 0;function Ps(){return Ns}function Fs(e){Ms.push(e)}function Is(e){let t=(t,n)=>{let r=Pe(Rs).current,i;try{Ns=r;for(let e of Ms)e.before(r);i=e(t,n);for(let e of Ms)e.after(r);r.didInitialize=!0}finally{Ns=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ls(e){return g.forwardRef(Is(e))}function Rs(){return{didInitialize:!1}}var zs=ks(),Bs=js(),Vs=gt(19)?Ws:Gs;function Hs(e,t,n,r,i){return Vs(e,t,n,r,i)}function Us(e,t,n,r,i){let a=g.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,zs.useSyncExternalStore)(e.subscribe,a,a)}Fs({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,zs.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ws(e,t,n,r,i){let a=Ps();if(!a)return Us(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Gs(e,t,n,r,i){return(0,Bs.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ks=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Hs(this,e,t,n,r)}},qs=class extends Ks{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){g.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){g.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return g.useDebugValue(e),Hs(this,this.selectors[e],t,n,r)}useContextCallback(e,t){g.useDebugValue(e);let n=J(t??vt);this.context[e]=n}useStateSetter(e){let t=g.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Js={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Ys=class extends qs{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Wo(),nested:n,triggerElements:i},Js),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&di(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Xs(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ys({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:bt,inactiveTriggerProps:bt,popupProps:bt}}var Zs=e=>e.triggerIdProp??e.activeTriggerId,Qs=e=>e.openProp??e.open,$s=e=>(e.popupElement?.id??e.floatingId)||void 0;function ec(e,t){return t!==void 0&&Qs(e)&&Zs(e)===t}function tc(e,t){return ec(e,t)?!0:t!==void 0&&Qs(e)&&Zs(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var nc={open:Qs,mounted:e=>e.mounted,transitionStatus:e=>Qs(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Zs,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:$s,isTriggerActive:(e,t)=>t!==void 0&&Zs(e)===t,isOpenedByTrigger:(e,t)=>ec(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Zs(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>tc(e,t)?$s(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function rc(e){let t=g.useCallback(t=>e===void 0?vt:e.subscribeStore(t),[e]),n=g.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,zs.useSyncExternalStore)(t,n,()=>e?.serverStore)}var ic=vr&&br;function ac(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=g.useRef(!1),s=g.useRef(null),c=g.useRef(!0),l=ya();g.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=de(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&q(t)&&t===Cr(X(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return mo($(r,`blur`,i),ic&&$(r,`keydown`,a,!0),ic&&$(r,`pointerdown`,l,!0))},[e,n]),g.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);K(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=g.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Tr(n.nativeEvent);if(K(a)){if(ic&&!n.relatedTarget){if(!c.current&&!$r(a))return}else if(!ni(a))return}let u=Xr(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,La(Ha,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,La(Ha,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=K(r)&&r.hasAttribute(xo(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Cr(X(t));!r&&n===t||Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||Xr(r??n,e.context.triggerElements)||e.setOpen(!1,La(Ha,i))})}}},[a,r,e,l]);return g.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var oc=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new va;restTimeout=new va;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},sc=new WeakMap;function cc(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&sc.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),sc.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function lc(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=sc.get(n);a&&a!==e&&cc(a),cc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,sc.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function uc(e){let t=e.context.dataRef.current,n=Pe(()=>t.hoverInteractionState??oc.create()).current;return t.hoverInteractionState||=n,ga(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function dc(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Yo(),u=Jo(),d=uc(e),f=ya(),p=J(()=>fo(c.current.openEvent?.type,d.interactedInside)),m=J(()=>po(c.current.openEvent?.type)),h=J(()=>{cc(d)});Y(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),g.useEffect(()=>h,[h]),Y(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&K(s)&&o){let e=s,t=o,n=X(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??wr(e,`[data-rootownerid]`)??n.body;return lc(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),g.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ii(l.nodesRef.current,u).length>0)}function a(t){let n=lo(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,La(Va,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Tr(e);ei(t)?d.interactedInside=wr(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Xr(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&K(o)&&ii(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,La(Va,n)),l.events.emit(`floating.closed`,n)})}let y=o;return mo(y&&$(y,`mouseenter`,g),y&&$(y,`mouseleave`,_),y&&$(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var fc={current:null};function pc(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=fc,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:_}=e.context,v=Yo(l),y=uc(e),b=g.useRef(!1),x=ho(i),S=ho(r),C=ho(o),w=ho(n),T=ho(p),E=ho(f),D=J(()=>fo(h.current.openEvent?.type,y.interactedInside)),O=J(()=>T.current?.()!==!1),k=J((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!K(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),A=J(()=>{y.handler&&=(X(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=J(()=>{cc(y)});return u&&(y.handleCloseOptions=i?.__options),g.useEffect(()=>A,[A]),g.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===Va,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),g.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=lo(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,La(Va,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,La(Va,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!K(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!ui(y.pointerType))return;let n=uo(C.current),r=lo(S.current,`open`,y.pointerType),i=Tr(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(K(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}K(o)&&K(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&K(c)&&K(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,La(Va,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,La(Va,t,c))}):g&&O()&&e.setOpen(!0,La(Va,t,c)))}function o(n){if(D()){j();return}A();let r=X(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Xr(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else y.pointerType===`touch`&&Q(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Q(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=m?$(r,`mouseout`,l):void 0;return s?mo($(r,`mousemove`,i,{once:!0}),$(r,`mouseenter`,i),$(r,`mouseleave`,o),f):mo($(r,`mouseenter`,i),$(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),g.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!ui(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;lc(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=uo(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,La(Va,n,r))}y.pointerType===`touch`?Oa.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function mc(e){return br&&e.movementX===0&&e.movementY===0}function hc(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function gc(e,t){return hc(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function _c(e,t,n){return hc(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function vc(e,t,n){return hc(t,n?e===Or:e===kr,e===jr)}function yc(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:hc(t,n?e===kr:e===Or,e===Ar)}function bc(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=ri(D),j=ti(O),M=ho(A),N=Jo(),P=Yo(S),F=g.useRef(f),I=g.useRef(o??-1),L=g.useRef(null),R=g.useRef(!0),z=J(e=>{i(I.current===-1?null:I.current,e)}),B=g.useRef(!!D),V=g.useRef(E),H=g.useRef(!1),U=g.useRef(!1),ee=g.useRef(null),te=ho(h),W=ho(E),G=ho(o),ne=ho(x),re=Ta(),ie=Ta(),ae=J(()=>{re.cancel();function e(e){d||(ee.current=Co(e,{sync:H.current,preventScroll:!0}))}let t=n.current[I.current],r=U.current;t&&e(t),(H.current?e=>e():e=>re.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),de&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{k.current.orientation=_},[k,_]),Y(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),Y(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(U.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),Y(()=>{if(a){if(!E)H.current=!1;else if(D){if(r==null){if(H.current=!1,G.current!=null)return;if(B.current&&(I.current=-1,ae()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ie.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||_c(L.current,v,u)||l?Bi(n):Vi(n),L.current=null,z())};t()}}else zi(n.current,r)||(I.current=r,ae(),U.current=!1)}}},[a,E,D,r,G,l,n,v,u,z,ae,ie]),Y(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=Cr(X(O??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),Y(()=>{V.current=E,B.current=!!D});let oe=r!=null,se=J(e=>{if(!W.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),ce=J(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),le=J(()=>Bi(n,te.current)),ue=J(t=>{if(R.current=!1,H.current=!0,t.which===229||!W.current&&t.currentTarget===M.current)return;if(l&&yc(t.key,_,u,T)){gc(t.key,ce())||oi(t),e.setOpen(!1,La(Ja,t.nativeEvent));let n=C?.current??O;q(n)&&n.focus();return}r!=null&&r!==I.current&&!zi(n.current,r)&&(I.current=r);let i=I.current,a=Bi(n,h),o=Vi(n,h);if(j||(t.key===`Home`&&(oi(t),I.current=a,z(t)),t.key===`End`&&(oi(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,_,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),_===`both`)return}if(gc(t.key,_)){oi(t);let e=Cr(t.currentTarget.ownerDocument);if(E&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){I.current=_c(t.key,_,u)?a:o,z(t),r===I.current&&ae();return}let{index:l,wrapped:f}=Hi(n.current,i,{decrement:!_c(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(H.current=!1),I.current=l,z(t)}}),de=g.useMemo(()=>({onFocus(e){H.current=!0,se(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){mc(e)||(H.current=!0,U.current=!1,p&&se(e))},onPointerLeave(e){if(!W.current||!R.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ne.current&&(ee.current?.(),ee.current=null,I.current=-1,z(e),!d)){let e=M.current,t=Cr(X(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[se,W,M,p,n,z,ne,d]),fe=g.useMemo(()=>d&&E&&oe&&{"aria-activedescendant":`${b}-${r}`},[d,E,oe,b,r]),pe=g.useMemo(()=>({...j?{}:fe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=Tr(t.nativeEvent);if(n&&!Q(M.current,n))return;oi(t);let r=La(Ka,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&q(i)&&i.focus()}else ue(t)},onPointerMove(e){mc(e)||(R.current=!0)}}),[fe,ue,M,j,e,E,d,O,C]),K=g.useMemo(()=>{function t(t){e.setOpen(!0,La(Ja,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&ci(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&li(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=vc(n.key,ce(),u),o=gc(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||$r(n.currentTarget)))return ue(n);if(r||m||!i){if(s){let e=gc(n.key,ce());L.current=l&&e?null:n.key}l?a&&(oi(n),r?(I.current=le(),z(n),d&&M.current?.focus()):t(n)):o&&(G.current!=null&&(I.current=G.current),oi(n),!r&&m?t(n):ue(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ue,f,le,l,z,e,m,_,v,ce,u,G,d,M]),me=g.useMemo(()=>({...fe,...K}),[fe,K]);return g.useMemo(()=>a?{reference:me,floating:pe,item:de,trigger:K}:{},[a,me,pe,K,de])}function xc(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=J(s),f=e.useState(`open`),p=ya(),m=g.useRef(``),h=g.useRef(u??i??-1),_=g.useRef(null),v=J(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Ki(n)||n?.matches(`:disabled`)?!1:o==null||!Wi(yt,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let g=n.current;if(m.current.length>0&&e.key===` `&&(oi(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(g,m.current)===-1&&e.key!==` `&&d?.(!1),g==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(oi(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),g.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=_.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=_.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(g,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),_.current=b)}),y=J(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(p.clear(),m.current=``,h.current=_.current,d?.(!1))});Y(()=>{(f||u===null)&&(p.clear(),_.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let b=g.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return g.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Sc=.1,Cc=Sc*Sc,wc=.5;function Tc(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Ec(e,t,n,r,i,a,o,s,c,l){let u=!1;return Tc(e,t,n,r,i,a)&&(u=!u),Tc(e,t,i,a,o,s)&&(u=!u),Tc(e,t,o,s,c,l)&&(u=!u),Tc(e,t,c,l,n,r)&&(u=!u),u}function Dc(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Oc(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function kc(e={}){let{blockPointerEvents:t=!1}=e,n=new va,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Cc;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Tr(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&K(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&ii(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Oc(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Oc(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Oc(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Oc(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Dc(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?wc/2:wc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+wc+1,o=C||T?S.bottom-wc:S.top,s=C?T?S.bottom-wc:S.top:S.bottom-wc;M=Ec(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?wc/2:wc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-wc,o=C||T?S.top+wc:S.bottom,s=C?T?S.top+wc:S.bottom:S.top+wc;M=Ec(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?wc/2:wc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+wc+1,o=w||E?S.right-wc:S.left,s=w?E?S.right-wc:S.left:S.right-wc;M=Ec(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?wc/2:wc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-wc,o=w||E?S.left+wc:S.right,s=w?E?S.left+wc:S.right:S.left+wc;M=Ec(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Ac(e,t,n){let{reference:r,floating:i}=e,a=wi(t),o=Ti(t),s=Ci(o),c=bi(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=xi(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function jc(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}=yi(t,e),p=Li(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ri(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=Ri(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 Mc=50,Nc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ac(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<Mc&&(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}=Ac(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Pc=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}=yi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=bi(r),_=wi(o),v=bi(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fi(o)]:Di(o)),x=p!==`none`;!d&&x&&b.push(...Pi(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=Ei(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`||_===wi(t)||T.every(e=>wi(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=wi(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{}}}},Fc=new Set([`left`,`top`]);async function Ic(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=bi(n),s=xi(n),c=wi(n)===`y`,l=Fc.has(o)?-1:1,u=a&&c?-1:1,d=yi(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 Lc=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 Ic(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}}}}},Rc=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}=yi(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=wi(i),p=Si(f),m=u[p],h=u[f],g=(e,t)=>vi(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}}}}}},zc=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}=yi(e,t),u={x:n,y:r},d=wi(i),f=Si(d),p=u[f],m=u[d],h=yi(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=Fc.has(bi(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}}}},Bc=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}=yi(e,t),c=await i.detectOverflow(t,s),l=bi(n),u=xi(n),d=wi(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=fi(p-c[m],g),y=fi(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*pi(c.left,c.right):S=p-2*pi(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 Vc(e){let t=Ee(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=q(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mi(n)!==a||mi(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Hc(e){return K(e)?e:e.contextElement}function Uc(e){let t=Hc(e);if(!q(t))return gi(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Vc(t),o=(a?mi(n.width):n.width)/r,s=(a?mi(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Wc=gi(0);function Gc(e){let t=de(e);return!we()||!t.visualViewport?Wc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===de(e)}function qc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Hc(e),o=gi(1);t&&(r?K(r)&&(o=Uc(r)):o=Uc(e));let s=Kc(a,n,r)?Gc(a):gi(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=de(a),t=K(r)?de(r):r,n=e,i=je(n);for(;i&&t!==n;){let e=Uc(i),t=i.getBoundingClientRect(),r=Ee(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=de(i),i=je(n)}}return Ri({width:u,height:d,x:c,y:l})}function Jc(e,t){let n=De(e).scrollLeft;return t?t.left+n:qc(fe(e)).left+n}function Yc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Jc(e,n),y:n.top+t.scrollTop}}function Xc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=fe(r),s=t?_e(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gi(1),u=gi(0),d=q(r);if((d||!a)&&((ue(r)!==`body`||he(o))&&(c=De(r)),d)){let e=qc(r);l=Uc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Yc(o,c):gi(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 Zc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Qc(e){let t=De(e),n=e.ownerDocument.body,r=pi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=pi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Jc(e),o=-t.scrollTop;return Ee(n).direction===`rtl`&&(a+=pi(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var $c=25;function el(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=de(e),a=fe(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!we()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Jc(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<=$c&&(s-=o)}return{width:s,height:c,x:l,y:u}}function tl(e,t){let n=qc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Uc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function nl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=el(e,n,t);else if(t===`document`)r=Qc(fe(e));else if(K(t))r=tl(t,n);else{let n=Gc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ri(r)}function rl(e,t){let n=t.get(e);if(n)return n;let r=Ae(e,[],!1).filter(e=>K(e)&&ue(e)!==`body`),i=null,a=Ee(e).position===`fixed`,o=a?Oe(e):e;for(;K(o)&&!Te(o);){let e=Ee(o),t=Se(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Oe(o)}return t.set(e,r),r}function il(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_e(t)?[]:rl(t,this._c):[].concat(n),r],o=nl(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=nl(t,a[e],i);s=pi(n.top,s),c=fi(n.right,c),l=fi(n.bottom,l),u=pi(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function al(e){let{width:t,height:n}=Vc(e);return{width:t,height:n}}function ol(e,t,n){let r=q(t),i=fe(t),a=n===`fixed`,o=qc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gi(0);if((r||!a)&&((ue(t)!==`body`||he(i))&&(s=De(t)),r)){let e=qc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Jc(i));let l=i&&!r&&!a?Yc(i,s):gi(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 sl(e){return Ee(e).position===`static`}function cl(e,t){if(!q(e)||Ee(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return fe(e)===n&&(n=n.ownerDocument.body),n}function ll(e,t){let n=de(e);if(_e(e))return n;if(!q(e)){let t=Oe(e);for(;t&&!Te(t);){if(K(t)&&!sl(t))return t;t=Oe(t)}return n}let r=cl(e,t);for(;r&&ge(r)&&sl(r);)r=cl(r,t);return r&&Te(r)&&sl(r)&&!Se(r)?n:r||Ce(e)||n}var ul=async function(e){let t=this.getOffsetParent||ll,n=this.getDimensions,r=await n(e.floating);return{reference:ol(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dl(e){return Ee(e).direction===`rtl`}var fl={convertOffsetParentRelativeRectToViewportRelativeRect:Xc,getDocumentElement:fe,getClippingRect:il,getOffsetParent:ll,getElementRects:ul,getClientRects:Zc,getDimensions:al,getScale:Uc,isElement:K,isRTL:dl};function pl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ml(e,t,n){let r=null,i,a=fe(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=hi(d),h=hi(a.clientWidth-(u+f)),g=hi(a.clientHeight-(d+p)),_=hi(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:pi(0,fi(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!pl(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=de(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function hl(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=Hc(e),u=i||a?[...l?Ae(l):[],...t?Ae(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ml(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?qc(e):null;c&&g();function g(){let t=qc(e);h&&!pl(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 gl=Lc,_l=Rc,vl=Pc,yl=Bc,bl=zc,xl=(e,t,n)=>{let r=new Map,i=n??{},a={...fl,...i.platform,_c:r};return Nc(e,t,{...i,platform:a})},Sl=typeof document<`u`?g.useLayoutEffect:function(){};function Cl(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(!Cl(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)&&!Cl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function wl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tl(e,t){let n=wl(e);return Math.round(t*n)/n}function El(e){let t=g.useRef(e);return Sl(()=>{t.current=e}),t}function Dl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);Cl(f,r)||p(r);let[m,h]=g.useState(null),[_,v]=g.useState(null),y=g.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=g.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||_,C=g.useRef(null),w=g.useRef(null),T=g.useRef(u),E=c!=null,D=El(c),O=El(i),k=El(l),A=g.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),xl(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Cl(T.current,t)&&(T.current=t,Oa.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Sl(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=g.useRef(!1);Sl(()=>(j.current=!0,()=>{j.current=!1}),[]),Sl(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=g.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=g.useMemo(()=>({reference:x,floating:S}),[x,S]),P=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Tl(N.floating,u.x),r=Tl(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...wl(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Ol=(e,t)=>{let n=gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},kl=(e,t)=>{let n=_l(e);return{name:n.name,fn:n.fn,options:[e,t]}},Al=(e,t)=>({fn:bl(e).fn,options:[e,t]}),jl=(e,t)=>{let n=vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ml=(e,t)=>{let n=yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nl=g.createContext(void 0);function Pl(){let e=g.useContext(Nl);if(e===void 0)throw Error(tt(26));return e}var Fl=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Il=`--nested-dialogs`,Ll=`data-nested-dialog-open`,Rl={...qr,...Ir,nestedDialogOpen(e){return e?{[Ll]:``}:null}},zl=g.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=io(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Pl(),Ma({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?hs(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=wt(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...ms,hidden:!m,onKeyDown(e){Fl.has(e.key)&&e.stopPropagation()},style:{[Il]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Rl});return(0,Z.jsx)(ss,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function Bl(e){return gt(19)?e:e?`true`:void 0}var Vl=g.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Hl=g.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=io(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Z.jsx)(Nl.Provider,{value:n,children:(0,Z.jsxs)(Uo,{ref:t,...r,children:[a&&o===!0&&(0,Z.jsx)(Vl,{ref:i.context.internalBackdropRef,inert:Bl(!s)}),e.children]})}):null}),Ul={},Wl={},Gl=``;function Kl(e,t){return he(e)?e:t}function ql(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Kl(t,n)).overflowY)}function Jl(e){if(typeof document>`u`)return!1;let t=X(e);return de(t).innerWidth-t.documentElement.clientWidth>0}function Yl(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=X(e),n=t.documentElement,r=t.body,i=Kl(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Xl(e){let t=X(e),n=t.documentElement,r=t.body,i=Kl(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Zl(e){let t=X(e),n=t.documentElement,r=t.body,i=de(n),a=0,o=0,s=!1,c=wa.create();if(br&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Ul={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Gl=n.style.scrollBehavior,Wl={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Kl(n,r);s=Yl(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Ul),Object.assign(r.style,Wl),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Gl)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Ql=new class{lockCount=0;restore=null;timeoutLock=va.create();timeoutUnlock=va.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=X(e),n=t.documentElement,r=t.body,i=de(n);if(ql(i,n,r)){let t=new i.MutationObserver(()=>{ql(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=hr||!Jl(e);this.restore=a?Xl(e):Zl(e)}};function $l(e=!0,t=null){Y(()=>{if(e)return Ql.acquire(t)},[e,t])}function eu({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=g.useState(0),[d,f]=g.useState(0),p=l===0,m=ds(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Tr(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Q(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return $l(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),Y(()=>{!r&&!i&&(u(0),f(0))},[r,i]),Y(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Ts(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var tu={...nc,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},nu=class extends qs{constructor(e,t,n){let r=new Ds,i=ru(e,r,t,n);super(i,iu(r),tu)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(bs(this.state,e,t.trigger)))}};function ru(e,t,n,r=!1){return{...Xs(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function iu(e){return{popupRef:g.createRef(),backdropRef:g.createRef(),internalBackdropRef:g.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function au(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,_=m||s,v=m?`alertdialog`:`dialog`,y=io(!0),b={modal:h,disablePointerDismissal:_,nested:y!=null,role:v},x=gs((e,t)=>new nu({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);Es(x,S),Cs(x);let{forceUnmount:T}=ws(S,x);g.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,La($a))}),[T,x]);let E=S||C||u!=null;return(0,Z.jsxs)(ro.Provider,{value:x,children:[u&&(0,Z.jsx)(_s,{handle:u,store:x}),E&&(0,Z.jsx)(eu,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var ou=Is(function(e){return au(`dialog`,e)}),su=g.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=io(),c=nr(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),wt(`h2`,e,{ref:t,props:[{id:c},o]})});function cu(e){let t=g.useRef(``),n=g.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:g.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function lu(e,t){let{onClick:n,onPointerDown:r}=cu(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(hr?`touch`:``))}));return g.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function uu(e){let[t,n]=g.useState(null),r=lu(e,n);return Ia(e,t=>{t&&!e&&n(null)}),g.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function du({...e}){return(0,Z.jsx)(ou,{"data-slot":`dialog`,...e})}function fu({...e}){return(0,Z.jsx)(Hl,{"data-slot":`dialog-portal`,...e})}function pu({className:e,...t}){return(0,Z.jsx)(ao,{"data-slot":`dialog-overlay`,className:Mn(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function mu({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Z.jsxs)(fu,{children:[(0,Z.jsx)(pu,{}),(0,Z.jsxs)(zl,{"data-slot":`dialog-content`,className:Mn(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Z.jsxs)(oo,{"data-slot":`dialog-close`,render:(0,Z.jsx)(Pn,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Z.jsx)(ce,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function hu({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`dialog-header`,className:Mn(`flex flex-col gap-2`,e),...t})}function gu({className:e,...t}){return(0,Z.jsx)(su,{"data-slot":`dialog-title`,className:Mn(`cn-font-heading text-base leading-none font-medium`,e),...t})}function _u({className:e,...t}){return(0,Z.jsx)(so,{"data-slot":`dialog-description`,className:Mn(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function vu({className:e,containerClassName:t,...n}){return(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:Mn(`relative w-full overflow-x-auto`,t),children:(0,Z.jsx)(`table`,{"data-slot":`table`,className:Mn(`w-full caption-bottom border-collapse text-sm`,e),...n})})}function yu({className:e,...t}){return(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:Mn(`[&_tr]:border-b [&_tr]:border-border`,e),...t})}function bu({className:e,...t}){return(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:Mn(`[&_tr:last-child]:border-0`,e),...t})}function xu({className:e,...t}){return(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:Mn(`border-b border-border/60 transition-colors`,e),...t})}function Su({className:e,...t}){return(0,Z.jsx)(`th`,{"data-slot":`table-head`,className:Mn(`h-8 px-2 text-left align-middle text-xs font-medium whitespace-nowrap text-muted-foreground`,e),...t})}function Cu({className:e,...t}){return(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:Mn(`px-2 align-middle`,e),...t})}function wu(e){if(e??=globalThis.spark233,!e)throw Error(`spark233 plugin preload is unavailable`);let t=e,n=!0,r,i=[],a=new Map,o=new Set,s=new Set,c=new Map,l=new Map,u=new Map,d=new Map,f=(e,r)=>n?t.request(e,r):Promise.reject(Error(`Plugin browser client was released`)),p=e=>!!r&&e.pluginId===r.owner.pluginId&&e.version===r.owner.version&&e.instanceId===r.owner.instanceId,m=e=>{n&&r?.activation&&r.activationId&&a.get(e)!==r.activationId&&(a.set(e,r.activationId),e(r.activation))},h=e=>{if(n){if(!r)i.push(e);else if(p(e.owner)){if(e.type===`activation`){r.activation=e.activation,r.activationId=e.activationId;for(let e of a.keys())m(e)}else if(e.type===`theme`){r.theme=e.theme;for(let t of o)t(e.theme)}else if(e.type===`query-cancel`)u.get(e.requestId)?.abort(),u.delete(e.requestId);else if(e.type===`query`){let t=new AbortController;u.set(e.requestId,t),(async()=>{let r;try{let n=e.activation.commandId;n&&!l.has(n)&&await new Promise(e=>{let r=d.get(n)??new Set,i=()=>{clearTimeout(a),r.delete(i),r.size||d.delete(n),t.signal.removeEventListener(`abort`,i),e(void 0)},a=setTimeout(i,250);r.add(i),d.set(n,r),t.signal.addEventListener(`abort`,i,{once:!0}),t.signal.aborted&&i()}),t.signal.throwIfAborted();let i=n?l.get(n):void 0;if(!i)throw Error(`Plugin query handler is not registered`);r={value:await i(e.activation,t.signal)}}catch(e){r={error:e instanceof Error?e.message.slice(0,1e3):String(e).slice(0,1e3)}}n&&!t.signal.aborted&&await f(`query.result`,{requestId:e.requestId,...r}).catch(()=>f(`query.result`,{requestId:e.requestId,error:`Plugin query result is invalid or exceeds the payload limit`}))})().catch(()=>{}).finally(()=>{u.get(e.requestId)===t&&u.delete(e.requestId)})}else(async()=>{let t={ok:!0};try{for(let n of s)if(t=await n(e.reason),!t.ok)break}catch(e){t={ok:!1,reason:e instanceof Error?e.message:String(e)}}t.ok||(t={ok:!1,reason:String(t.reason).slice(0,1e3)}),n&&await f(`lifecycle.result`,{requestId:e.requestId,decision:t})})().catch(()=>{})}}},g=t.subscribe(h),_=f(`context.get`).then(e=>{if(!n)throw Error(`Plugin browser client was released`);if(r=e,!r?.owner?.instanceId)throw Error(`Invalid plugin session context`);for(let e of i.splice(0))h(e);return r}),v=e=>(a.set(e,void 0),_.then(()=>{a.has(e)&&m(e)}).catch(()=>{}),()=>{a.delete(e)});return v(e=>{let t=e.commandId?c.get(e.commandId):void 0;t&&Promise.resolve(t(e)).catch(()=>{})}),{context:async()=>(await _,structuredClone(r)),storage:{get:e=>f(`storage.get`,{key:e}),set:async(e,t)=>{await f(`storage.set`,{key:e,value:t})},remove:async e=>{await f(`storage.remove`,{key:e})}},registerCommand:async(e,t)=>(await _,await f(`command.register`,{id:e}),c.set(e,t),r?.activation?.commandId===e&&await t(r.activation),()=>{c.get(e)===t&&c.delete(e)}),registerQuery:async(e,t)=>{l.set(e,t);for(let t of[...d.get(e)??[]])t();try{await _,await f(`command.register`,{id:e})}catch(n){throw l.get(e)===t&&l.delete(e),n}return()=>{l.get(e)===t&&l.delete(e)}},onActivation:v,onTheme:e=>(o.add(e),()=>{o.delete(e)}),onPrepareStop:e=>(s.add(e),()=>{s.delete(e)}),capability:(e,t,n)=>f(`capability.invoke`,{capability:e,operation:t,...n===void 0?{}:{payload:n}}),close:async()=>{await f(`window.close`)},window:{minimize:async()=>{await f(`window.minimize`)},toggleMaximize:async()=>{await f(`window.toggleMaximize`)},isMaximized:async()=>await f(`window.isMaximized`)===!0,setStatus:async e=>{await f(`window.status`,{...e.subtitle===void 0?{}:{subtitle:e.subtitle},...e.runState===void 0?{}:{runState:e.runState}})}},dispose:()=>{n=!1,g(),i.length=0,a.clear(),o.clear(),s.clear(),c.clear(),l.clear();for(let e of u.values())e.abort();u.clear()}}}var Tu=wu(),Eu=(e,t)=>Tu.capability(`node.backend`,`invoke`,{commandId:e,...t===void 0?{}:{parameters:t}});async function Du(e,t){let n=await Eu(e,t);if(!n||typeof n!=`object`||Array.isArray(n))return n;let r=n,i={...r},a=new Map,o=[],s={},c=new Map,l=e=>{for(let t of e.processes??[]){let e=a.get(t.appId);if(!e)a.set(t.appId,{...t,instances:[...t.instances]});else{let n=new Set(e.instances.map(e=>e.id));for(let r of t.instances)n.has(r.id)||(e.instances.push(r),n.add(r.id))}}o.push(...e.rows??[]),Object.assign(s,e.icons);for(let[t,n]of Object.entries(e.iconChunks??{})){let e=c.get(t);e?e.push(...n):c.set(t,[...n])}};l(r);let u=r.nextCursor,d=new Set,f=t&&typeof t==`object`&&!Array.isArray(t)?t:{};for(;u;){if(d.has(u))throw Error(`流量分页游标重复,请重新查询。`);d.add(u);let t=await Eu(e,{...f,cursor:u});l(t),u=t.nextCursor}Array.isArray(r.processes)&&(i.processes=[...a.values()]),Array.isArray(r.rows)&&(i.rows=o);for(let[e,t]of c)s[e]=t.join(``);return(r.icons||r.iconChunks||Array.isArray(r.processes))&&(i.icons=s),delete i.iconChunks,`nextCursor`in r&&(i.nextCursor=null),i}var Ou={warming:`建立基线中`,complete:`采样正常`,gap:`采样有缺口`,paused:`已暂停`,unavailable:`采集不可用`},ku={application:`应用程序`,system:`系统程序`,unknown:`未识别`};function Au({name:e,executable:t,icon:n,prefix:r}){let i=t.split(/[\\/]/).pop()||`路径不可用`;return(0,Z.jsxs)(`div`,{className:`traffic-app`,children:[r,n?(0,Z.jsx)(`img`,{className:`traffic-icon`,src:n,alt:``,draggable:!1}):(0,Z.jsx)(`span`,{className:`traffic-icon traffic-icon-fallback`,"aria-hidden":`true`,children:(e||i).slice(0,1).toUpperCase()}),(0,Z.jsxs)(`span`,{className:`traffic-app-copy`,title:t||e,children:[(0,Z.jsx)(`strong`,{children:e||i}),(0,Z.jsx)(`small`,{children:i})]})]})}function ju({value:e,onChange:t}){return(0,Z.jsxs)(`div`,{className:`traffic-search`,children:[(0,Z.jsx)(ne,{size:14,"aria-hidden":`true`}),(0,Z.jsx)(no,{type:`search`,"aria-label":`搜索程序名称或文件名`,placeholder:`搜索程序名称或文件名`,value:e,onChange:e=>t(e.target.value)})]})}function Mu({value:e,onChange:t}){return(0,Z.jsxs)(`select`,{className:`traffic-select`,"aria-label":`筛选程序类别`,value:e,onChange:e=>t(e.target.value),children:[(0,Z.jsx)(`option`,{value:`all`,children:`全部程序类别`}),Object.entries(ku).map(([e,t])=>(0,Z.jsx)(`option`,{value:e,children:t},e))]})}function Nu({children:e,active:t,ascending:n,onClick:r}){return(0,Z.jsxs)(`button`,{type:`button`,className:`traffic-sort`,"data-active":t,onClick:r,children:[e,(0,Z.jsx)(t?n?E:S:w,{size:12,"aria-hidden":`true`})]})}function Pu({title:e,children:t}){return(0,Z.jsxs)(`div`,{className:`traffic-empty`,children:[(0,Z.jsx)(`strong`,{children:e}),(0,Z.jsx)(`p`,{children:t})]})}function Fu(e){let t=(e instanceof Error?e.message:String(e)).replace(/^Error invoking remote method '[^']+':\s*(?:Error:\s*)?/,``);return/row-too-large|response-too-large|metadata-too-large/.test(t)?`历史查询返回的数据过大,请更新流量采集服务后重试。`:/history-query-too-large-narrow-range/.test(t)?`查询范围过大,请缩短日期范围后重试。`:/cursor-expired|query-capacity-reached/.test(t)?`查询已过期,请刷新重试。`:t}function Iu({row:e,scope:t,onClose:n,instanceIds:r}){let[i,a]=(0,g.useState)(),[o,s]=(0,g.useState)(),[c,l]=(0,g.useState)(0),[u,d]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let n=!1,i,o=Tu.onPrepareStop(()=>(n=!0,clearTimeout(i),{ok:!0})),c=async()=>{d(!0);try{let i=await Du(`connections`,{appId:e.appId,scope:t,...r?{processInstanceIds:r}:{}});n||(a(i),s(void 0))}catch(e){n||s(Fu(e))}finally{n||(d(!1),i=setTimeout(()=>void c(),2e3))}};return c(),()=>{n=!0,clearTimeout(i),o()}},[e.appId,t,c,r]),(0,Z.jsx)(du,{open:!0,onOpenChange:e=>{e||n()},children:(0,Z.jsxs)(mu,{className:`traffic-connection-dialog`,children:[(0,Z.jsxs)(hu,{children:[(0,Z.jsxs)(gu,{children:[e.name,` · 网络连接`]}),(0,Z.jsxs)(_u,{children:[`显示`,t===`machine`?`已授权整机`:`当前账户`,`范围内的 TCP 连接和 UDP 端点。UDP 本地端点没有固定远端地址。`]})]}),o&&(0,Z.jsx)(In,{variant:`destructive`,children:(0,Z.jsx)(Ln,{children:o})}),(0,Z.jsxs)(`div`,{className:`traffic-connection-table`,children:[(0,Z.jsxs)(vu,{children:[(0,Z.jsx)(yu,{children:(0,Z.jsxs)(xu,{children:[(0,Z.jsx)(Su,{children:`PID`}),(0,Z.jsx)(Su,{children:`协议`}),(0,Z.jsx)(Su,{children:`本地地址`}),(0,Z.jsx)(Su,{children:`远端地址`}),(0,Z.jsx)(Su,{children:`状态`})]})}),(0,Z.jsx)(bu,{children:i?.rows.map(e=>(0,Z.jsxs)(xu,{children:[(0,Z.jsx)(Cu,{children:e.pid}),(0,Z.jsx)(Cu,{title:e.kind===`udp-local`?`UDP 本地端点`:e.kind===`udp-observed`?`实际观察到的 UDP 远端`:`TCP 连接`,children:e.protocol}),(0,Z.jsxs)(Cu,{children:[e.localAddress.includes(`:`)?`[${e.localAddress}]`:e.localAddress,`:`,e.localPort]}),(0,Z.jsx)(Cu,{children:e.remoteAddress===null?`—`:`${e.remoteAddress.includes(`:`)?`[${e.remoteAddress}]`:e.remoteAddress}:${e.remotePort??`—`}`}),(0,Z.jsx)(Cu,{children:e.kind===`udp-local`?`本地端点`:e.state||`—`})]},e.id))})]}),!i?.rows.length&&(0,Z.jsx)(Pu,{title:!i&&u?`正在读取连接`:`当前没有可显示的连接`,children:i?.message||`连接可能已经关闭,或不在当前授权范围内。`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`p`,{className:`traffic-connection-status`,children:[i?`${i.rows.length} 个连接 / 端点 · ${Ou[i.coverage]}`:`等待连接数据`,i?.message?` · ${i.message}`:``]}),(0,Z.jsx)(Pn,{variant:`outline`,size:`sm`,disabled:u,onClick:()=>l(e=>e+1),children:`刷新`})]})]})})}function Lu(e){return au(`alert-dialog`,e)}function Ru({...e}){return(0,Z.jsx)(Lu,{"data-slot":`alert-dialog`,...e})}function zu({...e}){return(0,Z.jsx)(Hl,{"data-slot":`alert-dialog-portal`,...e})}function Bu({className:e,...t}){return(0,Z.jsx)(ao,{"data-slot":`alert-dialog-overlay`,className:Mn(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Vu({className:e,size:t=`default`,...n}){return(0,Z.jsxs)(zu,{children:[(0,Z.jsx)(Bu,{}),(0,Z.jsx)(zl,{"data-slot":`alert-dialog-content`,"data-size":t,className:Mn(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function Hu({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:Mn(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Uu({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:Mn(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Wu({className:e,...t}){return(0,Z.jsx)(su,{"data-slot":`alert-dialog-title`,className:Mn(`cn-font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Gu({className:e,...t}){return(0,Z.jsx)(so,{"data-slot":`alert-dialog-description`,className:Mn(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ku({className:e,...t}){return(0,Z.jsx)(Pn,{"data-slot":`alert-dialog-action`,className:Mn(e),...t})}function qu({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,Z.jsx)(oo,{"data-slot":`alert-dialog-cancel`,className:Mn(e),render:(0,Z.jsx)(Pn,{variant:t,size:n}),...r})}function Ju(e){if(e===null)return`—`;let t=Number(e);if(!Number.isFinite(t)||t<0)return`—`;let n=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`],r=Math.min(6,Math.max(0,Math.floor(Math.log2(Math.max(1,t))/10)));return`${(t/1024**r).toFixed(+!!r)} ${n[r]}`}function Yu(e){if(e===null)return`—`;let t=[`B/s`,`KB/s`,`MB/s`,`GB/s`],n=Math.min(3,Math.max(0,Math.floor(Math.log2(Math.max(1,e))/10)));return`${(e/1024**n).toFixed(+!!n)} ${t[n]}`}var Xu=[[`today`,`今天`],[`yesterday`,`昨天`],[`week`,`最近 7 天`],[`month`,`本月`],[`custom`,`自定义`]];function Zu(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Qu(e,t,n,r){let i=new Date(`${e===`custom`?t:r}T00:00:00`),a=new Date(`${e===`custom`?n:r}T00:00:00`);return!Number.isFinite(i.getTime())||!Number.isFinite(a.getTime())||(e===`yesterday`&&i.setDate(i.getDate()-1),e===`week`&&i.setDate(i.getDate()-6),e===`month`&&i.setDate(1),e!==`yesterday`&&a.setDate(a.getDate()+1),a<=i)?null:{from:i.toISOString(),to:a.toISOString(),label:`${Zu(i)} — ${Zu(new Date(a.getTime()-1))}`}}var $u=e=>BigInt(e.rxBytes)+BigInt(e.txBytes);function ed({active:e,scope:t,icons:n}){let[r,i]=(0,g.useState)(`today`),[a,o]=(0,g.useState)(()=>Zu(new Date)),[s,c]=(0,g.useState)(a),[l,u]=(0,g.useState)(a),[d,f]=(0,g.useState)(``),[p,m]=(0,g.useState)(`all`),[h,_]=(0,g.useState)(`total`),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(),[S,C]=(0,g.useState)(),[w,T]=(0,g.useState)(!1),[E,D]=(0,g.useState)(!1),[O,k]=(0,g.useState)(!1),[A,j]=(0,g.useState)(0),M=(0,g.useRef)(new Map),N=(0,g.useMemo)(()=>Qu(r,s,l,a),[r,s,l,a]),P=N?`${t}:${N.from}:${N.to}`:``,F=N?.from,I=N?.to;(0,g.useEffect)(()=>{let e=setInterval(()=>o(Zu(new Date)),6e4),t=Tu.onPrepareStop(()=>(clearInterval(e),{ok:!0}));return()=>{clearInterval(e),t()}},[]),(0,g.useEffect)(()=>{if(!e||!F||!I)return;let n=!1,r,i=Tu.onPrepareStop(()=>(n=!0,clearTimeout(r),{ok:!0})),a=async()=>{C(void 0);let e=M.current.get(P);if(e&&x({key:P,value:e.value}),e&&Date.now()-e.at<3e4)r=setTimeout(()=>void a(),Math.max(1e3,3e4-(Date.now()-e.at)));else{T(!0),C(void 0);try{let e=await Du(`history`,{from:F,to:I,scope:t});if(n)return;M.current.set(P,{at:Date.now(),value:e}),x({key:P,value:e})}catch(e){n||C(Fu(e))}finally{n||(T(!1),r=setTimeout(()=>void a(),3e4))}}};return a(),()=>{n=!0,clearTimeout(r),i()}},[e,F,I,t,P,A]);let L=b?.key===P?b.value:void 0,R=(0,g.useMemo)(()=>{let e=d.trim().toLocaleLowerCase();return(L?.rows??[]).filter(t=>(!e||`${t.name} ${t.executable}`.toLocaleLowerCase().includes(e))&&(p===`all`||t.category===p)).sort((e,t)=>{let n;if(h===`name`||h===`category`){let r=h===`name`?e.name:ku[e.category],i=h===`name`?t.name:ku[t.category];n=r.localeCompare(i,`zh-CN`)}else{let r=h===`rx`?BigInt(e.rxBytes):h===`tx`?BigInt(e.txBytes):$u(e),i=h===`rx`?BigInt(t.rxBytes):h===`tx`?BigInt(t.txBytes):$u(t);n=r===i?0:r>i?1:-1}return(v?n:-n)||e.appId.localeCompare(t.appId)})},[L?.rows,d,p,h,v]),z=e=>{y(h===e?!v:e===`name`||e===`category`),_(e)},B=(e,t)=>(0,Z.jsx)(Nu,{active:h===e,ascending:v,onClick:()=>z(e),children:t}),V=async()=>{k(!0);try{await Du(`history.clear`,{scope:t,confirmed:!0}),M.current.clear(),x(void 0),D(!1),j(e=>e+1),C(void 0)}catch(e){C(Fu(e))}finally{k(!1)}};return(0,Z.jsxs)(`section`,{className:`traffic-view`,hidden:!e,"aria-label":`历史流量`,children:[(0,Z.jsxs)(`div`,{className:`traffic-summary`,children:[(0,Z.jsxs)(`span`,{className:`traffic-summary-item`,children:[`下载总量`,` `,(0,Z.jsx)(`strong`,{className:`traffic-download`,children:Ju(L?.totals.rxBytes??null)})]}),(0,Z.jsxs)(`span`,{className:`traffic-summary-item`,children:[`上传总量`,` `,(0,Z.jsx)(`strong`,{className:`traffic-upload`,children:Ju(L?.totals.txBytes??null)})]}),(0,Z.jsx)(`span`,{className:`traffic-summary-note`,children:N?.label??`请选择有效日期范围`})]}),(0,Z.jsxs)(`div`,{className:`traffic-toolbar traffic-date-toolbar`,children:[(0,Z.jsx)(`div`,{className:`traffic-periods`,"aria-label":`历史日期范围`,children:Xu.map(([e,t])=>(0,Z.jsx)(Pn,{size:`xs`,variant:r===e?`secondary`:`ghost`,"aria-pressed":r===e,onClick:()=>i(e),children:t},e))}),r===`custom`&&(0,Z.jsxs)(`div`,{className:`traffic-date-range`,children:[(0,Z.jsx)(no,{type:`date`,"aria-label":`开始日期`,value:s,max:l||a,onChange:e=>c(e.target.value)}),(0,Z.jsx)(`span`,{className:`traffic-muted`,children:`至`}),(0,Z.jsx)(no,{type:`date`,"aria-label":`结束日期`,value:l,min:s,max:a,onChange:e=>u(e.target.value)})]}),(0,Z.jsx)(`span`,{className:`traffic-toolbar-end`,children:w&&L?`后台更新中…`:`含已退出的程序`})]}),(0,Z.jsxs)(`div`,{className:`traffic-toolbar`,children:[(0,Z.jsx)(ju,{value:d,onChange:f}),(0,Z.jsx)(Mu,{value:p,onChange:m}),(0,Z.jsx)(Pn,{variant:`ghost`,size:`xs`,disabled:w||!N,onClick:()=>{M.current.delete(P),j(e=>e+1)},children:`刷新`}),(0,Z.jsxs)(`span`,{className:`traffic-toolbar-end`,children:[t===`machine`?`已授权整机`:`当前账户`,`进程记录`]})]}),L&&N&&((L.resolutionSec??0)>=86400||L.from!==N.from)&&(0,Z.jsx)(`div`,{className:`traffic-notice`,children:(0,Z.jsx)(In,{children:(0,Z.jsx)(Ln,{title:(L.resolutionSec??0)>=86400?`按 UTC 日聚合,以下为对应的本地时间。`:`已按历史数据粒度对齐。`,children:`统计范围:${new Date(L.from).toLocaleString(`zh-CN`,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})} — ${new Date(L.to).toLocaleString(`zh-CN`,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}`})})}),(S||!N)&&(0,Z.jsx)(`div`,{className:`traffic-notice`,children:(0,Z.jsx)(In,{variant:S?`destructive`:`default`,children:(0,Z.jsx)(Ln,{children:S||`开始日期须早于或等于结束日期。`})})}),(0,Z.jsxs)(`div`,{className:`traffic-table-area`,children:[(0,Z.jsxs)(vu,{className:`traffic-table`,children:[(0,Z.jsx)(yu,{children:(0,Z.jsxs)(xu,{children:[(0,Z.jsx)(Su,{"aria-sort":h===`name`?v?`ascending`:`descending`:void 0,children:B(`name`,`程序名称`)}),(0,Z.jsx)(Su,{"aria-sort":h===`category`?v?`ascending`:`descending`:void 0,children:B(`category`,`程序类别`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,"aria-sort":h===`rx`?v?`ascending`:`descending`:void 0,children:B(`rx`,`下载流量`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,"aria-sort":h===`tx`?v?`ascending`:`descending`:void 0,children:B(`tx`,`上传流量`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,"aria-sort":h===`total`?v?`ascending`:`descending`:void 0,children:B(`total`,`合计`)})]})}),(0,Z.jsx)(bu,{children:R.map(e=>(0,Z.jsxs)(xu,{children:[(0,Z.jsx)(Cu,{children:(0,Z.jsx)(Au,{name:e.name,executable:e.executable,icon:e.iconId?n[e.iconId]:void 0})}),(0,Z.jsx)(Cu,{className:`traffic-muted`,children:ku[e.category]}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-download`,children:Ju(e.rxBytes)}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-upload`,children:Ju(e.txBytes)}),(0,Z.jsx)(Cu,{className:`traffic-numeric`,children:Ju($u(e).toString())})]},e.appId))})]}),!R.length&&(0,Z.jsx)(Pu,{title:w&&!L?`正在读取历史记录`:S&&!L?`历史记录暂不可用`:`没有符合条件的流量记录`,children:L?`调整日期或筛选条件。`:void 0})]}),(0,Z.jsxs)(`footer`,{className:`traffic-footer`,children:[(0,Z.jsxs)(`span`,{title:L?.message,children:[R.length,` 个程序 · `,L?Ou[L.coverage]:`等待记录`,L?.resolutionSec?` · 每 ${L.resolutionSec>=86400?`${L.resolutionSec/86400} 天`:L.resolutionSec>=3600?`${L.resolutionSec/3600} 小时`:L.resolutionSec>=60?`${L.resolutionSec/60} 分钟`:`${L.resolutionSec} 秒`}统计`:``,L?.durableThrough?` · 最近保存 ${new Date(L.durableThrough).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}`:``]}),(0,Z.jsx)(Pn,{variant:`ghost`,size:`xs`,disabled:O||!L,onClick:()=>D(!0),children:`清空历史记录`})]}),(0,Z.jsx)(Ru,{open:E,onOpenChange:D,children:(0,Z.jsxs)(Vu,{children:[(0,Z.jsxs)(Hu,{children:[(0,Z.jsxs)(Wu,{children:[`清空`,t===`machine`?`整机`:`当前账户`,`流量历史?`]}),(0,Z.jsx)(Gu,{children:`该范围所有日期的历史记录都会被删除,删除后无法恢复。采集会继续记录后续流量。`})]}),S&&(0,Z.jsx)(In,{variant:`destructive`,children:(0,Z.jsx)(Ln,{children:S})}),(0,Z.jsxs)(Uu,{children:[(0,Z.jsx)(qu,{disabled:O,children:`取消`}),(0,Z.jsx)(Ku,{variant:`destructive`,disabled:O,onClick:()=>void V(),children:O?`正在清空…`:`清空记录`})]})]})})]})}function td({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=g.useRef(e!==void 0),[a,o]=g.useState(()=>t);return[i&&e!==void 0?e:a,g.useCallback(e=>{i||o(e)},[])]}function nd(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var rd=`data-checked`,id=`data-unchecked`;function ad(e){return{checked(t){return e.indeterminate?{}:t?{[rd]:``}:{[id]:``}},...Gn}}var od=g.createContext(void 0);function sd(){return g.useContext(od)}var cd=g.createContext(void 0);function ld(){let e=g.useContext(cd);if(e===void 0)throw Error(tt(14));return e}var ud=`data-parent`,dd=g.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:_=!1,uncheckedValue:v,value:y,nativeButton:b=!1,style:x,...S}=e,{clearErrors:C}=Xn(),{disabled:w,name:T,setDirty:E,setFilled:D,setTouched:O,state:k,validationMode:A,validityData:j,validation:M}=Jn(),N=xa(),{labelId:P,registerControlId:F,getDescriptionProps:I}=ir(),L=sd(),R=L?.allValues===void 0?void 0:L.parent,z=R!==void 0,B=w||N.disabled||L?.disabled||o,V=T??d,H=y??V,U=nr(),ee=L?.registerControlId!==F,te=cr({id:c||void 0,enabled:ee}),W=b?te:U,G={};z&&(p?G=R.getParentProps():H!==void 0&&(G=R.getChildProps(H)));let{checked:ne=n,indeterminate:re=l,onCheckedChange:ie,...ae}=G,oe=L?.value,se=g.useRef(null),ce=Pa(B,se),{getButtonProps:le,buttonRef:ue}=ot({disabled:B,native:b}),fe=L?.validation??M,[pe,K]=td({controlled:H!==void 0&&oe!==void 0&&!p?oe.includes(H):ne,default:i,name:`Checkbox`,state:`checked`}),q=z?!!ne:pe,me=z&&re||l;Fa(se,U,pe,void 0,!L&&!B,d);let he=R?.registerChildId,ge=g.useRef(null),_e=fe.registerInput,ve=L?H:void 0,ye=g.useCallback(e=>_e(e,{controlRef:se,value:ve}),[_e,ve]),be=lt(u,ge,p?void 0:ye),xe=ar(a,P,ge,!b,te,S[`aria-label`]);Y(()=>{ge.current&&(ge.current.indeterminate=me),L||D(pe)},[pe,me,L,D]),Ia(pe,()=>{L||(C(V),E(pe!==j.initialValue),fe.change(pe))});let Se=Ve({checked:pe,disabled:B,form:s,name:p?void 0:V,id:b?void 0:te,required:_,ref:be,style:V?yo:vo,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=La(za,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(ie?.(t,n),!n.isCanceled&&(K(t),H!==void 0&&L!==void 0&&!p&&!z))){let e=t?[...L.value,H]:L.value.filter(e=>e!==H);L.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){se.current?.focus()}},y===void 0?bt:{value:(L?pe&&y:y)||``},I,e=>fe.getValidationProps(B,e));g.useEffect(()=>{if(!R||H===void 0)return;let e=R.disabledStatesRef.current;return e.set(H,B),()=>{e.delete(H)}},[R,B,H]);let Ce=g.useMemo(()=>({...k,checked:q,disabled:B,readOnly:m,required:_,indeterminate:me}),[k,q,B,m,_,me]),we=ad(Ce),Te=wt(`span`,e,{state:Ce,ref:[ue,se,t],props:[{id:W,role:`checkbox`,"aria-checked":me?`mixed`:q,"aria-readonly":m||void 0,"aria-required":_||void 0,"aria-labelledby":xe,[ud]:p?``:void 0,onFocus(){ce(!0)},onBlur(){let e=ge.current;e&&(O(!0),ce(!1),A===`onBlur`&&fe.commit(L?oe:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=ge.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),de(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||nd(t)?.click()})},onClick(e){if(m||B)return;e.preventDefault();let t=ge.current;t&&at(t,e)}},S,ae,le,I,e=>fe.getValidationProps(B,e)],stateAttributesMapping:we}),Ee=Te.props.id;return Y(()=>{if(he&&!p&&H!==void 0&&Ee!==void 0)return he(H,Ee)},[he,p,H,Ee]),(0,Z.jsxs)(cd.Provider,{value:Ce,children:[Te,!pe&&!L&&V&&!p&&v!==void 0&&(0,Z.jsx)(`input`,{type:`hidden`,form:s,name:V,value:v,disabled:B}),(0,Z.jsx)(`input`,{...Se,suppressHydrationWarning:!0})]})}),fd=g.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=ld(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Na(c),f=g.useRef(null),p={...s,transitionStatus:u};Ma({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...ad(s),...Ir},h=a||l,_=wt(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?_:null});function pd({className:e,...t}){return(0,Z.jsx)(dd,{"data-slot":`checkbox`,className:Mn(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,Z.jsx)(fd,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,Z.jsx)(O,{"aria-hidden":`true`})})})}var md=g.createContext(void 0);function hd(e=!0){let t=g.useContext(md);if(t===void 0&&!e)throw Error(tt(25));return t}var gd=g.createContext(void 0);function _d(e){let t=g.useContext(gd);if(t===void 0&&!e)throw Error(tt(33));return t}var vd=g.createContext(void 0);function yd(e){let t=g.useContext(vd);if(t===void 0&&!e)throw Error(tt(36));return t}var bd=g.createContext(null);function xd(e=`root`){let t=g.useContext(bd),n=g.useContext(vd);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Sd={visible:!0,ref:null};function Cd(){return Sd}function wd(e,t,n=`root`){let r=xd(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Cd)({label:e.label,children:e.children,render:e.render}),a=lt(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Td(e){e.preventDefault()}function Ed(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=yd(),u=hd(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),_=u!==void 0,v=!f&&h&&n?0:-1;return g.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":p,onMouseDown:f?Td:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Wa})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,_&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||_&&!vr&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!_||e.button===2)&&c.type===`regular-item`&&at(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,_,c.type,p,f])}var Dd={type:`regular-item`};function Od(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=g.useRef(null),{getButtonProps:d,buttonRef:f}=ot({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Ed({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=g.useCallback(e=>Ve(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=lt(u,f);return g.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var kd=g.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Ad(){return g.useContext(kd)}function jd(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Ad(),u=g.useRef(-1),[d,f]=g.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=g.useRef(null),h=g.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Md=g.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=yd(),f=jd({guess:!0,label:a}),p=nr(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=Od({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Dd});return wt(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Nd=g.forwardRef(function(e,t){let n=wd(e,t);return n.visible?(0,Z.jsx)(Md,{...e,ref:n.ref}):null}),Pd=g.createContext(void 0);function Fd(e){let t=g.useContext(Pd);if(t===void 0&&!e)throw Error(tt(69));return t}function Id(e){return e===`starting`?Fo:bt}var Ld=g.createContext(void 0);function Rd(){return g.useContext(Ld)}function zd(e,t){let n=Ot(e.render);if(g.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Bd(e,t,n){let r=zd(e,t),i=r===t?void 0:r;return[r,g.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Vd(e,t,n){let r=Ot(e.render),i=g.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Hd=g.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=yd(),m=Rd(),{side:h,align:_}=_d(),v=Fd(!0)!=null,y=l.useState(`open`),b=l.useState(`transitionStatus`),x=l.useState(`popupProps`),S=l.useState(`mounted`),C=l.useState(`instantType`),w=l.useState(`activeTriggerElement`),T=l.useState(`parent`),E=l.useState(`lastOpenChangeReason`),D=l.useState(`rootId`),O=l.useState(`floatingRootContext`),k=l.useState(`floatingTreeRoot`),A=l.useState(`closeDelay`),j=l.useState(`hoverEnabled`),M=l.useState(`disabled`),N=l.useState(`openMethod`),P=l.useState(`activeTriggerId`),F=l.useState(`listElement`),[I,L]=Bd(e,u,d),R=Vd(e,w,P),z=T.type===`menu`?m:void 0,B=T.type===`context-menu`,V=s??T.type!==`menu`;s===void 0&&F&&T.type!==`menu`&&(V=()=>l.state.activeIndex===null&&F),Ma({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}}),g.useEffect(()=>{function e(e){l.setOpen(!1,La(e.reason,e.domEvent))}return k.events.on(`close`,e),()=>{k.events.off(`close`,e)}},[k.events,l]),dc(O,{enabled:j&&!M&&!B&&T.type!==`menubar`,closeDelay:A});let H=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:U,handleFocus:ee}=(g.useContext(bd)?.useParentHandoff??Wd)(l,T,y,f),te=wt(`div`,e,{state:{transitionStatus:b,side:h,align:_,open:y,nested:T.type===`menu`,instant:C},ref:[t,l.context.popupRef,H,L],stateAttributesMapping:Jr,props:[x,{id:I,...F?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":R},onKeyDown(e){z?.onPopupKeyDown?.(e),v&&Fl.has(e.key)&&e.stopPropagation()},onFocus:ee},Id(b),c,{"data-rootownerid":D}]}),W=T.type===void 0||B;(w||T.type===`menubar`&&E!==`outside-press`)&&(W=!0);let G=z?.getReturnElement??U;return(0,Z.jsx)(ss,{context:O,openInteractionType:N,modal:B,disabled:!S,returnFocus:a??G??W,explicitReturnFocus:a===void 0&&G?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type===`menubar`?void 0:k,previousFocusableElement:w,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:te})}),Ud={parentVirtualFocusRef:void 0,handleFocus:void 0};function Wd(){return Ud}var Gd=g.forwardRef(function(e,t){let n=xd()?.Popup??Hd;return(0,Z.jsx)(n,{...e,ref:t})}),Kd=g.createContext(void 0);function qd(){let e=g.useContext(Kd);if(e===void 0)throw Error(tt(32));return e}var Jd=g.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=yd();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Z.jsx)(Kd.Provider,{value:n,children:(0,Z.jsx)(Uo,{ref:t,...r,portalOwnerRole:o})})});function Yd(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=g.useState(null),d=g.useRef(null),f=Yo(n),p=g.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Dl({...e,elements:{...p,...l&&{reference:l}}}),h=g.useCallback(e=>{let t=K(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),_=g.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),v=g.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=g.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[m,_,v,t,r,s,c]);return Y(()=>{o&&(d.current=o)},[o]),Y(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),g.useMemo(()=>({...m,context:y,refs:_,elements:v,rootStore:r}),[m,_,v,y,r])}var Xd=g.createContext(void 0);function Zd(){return g.useContext(Xd)?.direction??`ltr`}var Qd=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}=yi(e,t)||{};if(l==null)return{};let d=Li(u),f={x:n,y:r},p=Ti(i),m=Ci(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=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=vi(D,k,O),j=!c.arrow&&xi(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),$d=(e,t)=>{let{name:n,fn:r}=Qd(e);return{name:n,fn:r,options:[e,t]}},ef={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},tf={sideX:`left`,sideY:`top`},nf=`--available-width`,rf=`--available-height`,af=`--anchor-width`,of=`--anchor-height`,sf=`--transform-origin`,cf=nf,lf=rf;function uf(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function df(e,t,n){let{rects:r,placement:i}=e;return{side:uf(t,bi(i),n),align:xi(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ff(e){return pf(e,Yd)}function pf(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=J(k),j=k?A:n,M=ho(n),N=ho(_),P=Zd()===`rtl`,[F,I]=g.useState(null);!_&&F!==null&&I(null);let L=S===`placement`,R=F?bi(F):null,z=F&&L?xi(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,H=V===`center`?B:`${B}-${V}`,U=l;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let ee=+(i===`bottom`),te=+(i===`top`),W=+(i===`right`),G=+(i===`left`),ne={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:U},re=g.useRef(null),ie=ho(a),ae=ho(s),oe=typeof a==`function`?0:a,se=typeof s==`function`?0:s,ce=[];p&&ce.push(p),ce.push(Ol(e=>{let t=df(e,i,P),n=typeof ie.current==`function`?ie.current(t):ie.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,se,P,i]));let le=T===`none`&&w!==`shift`,ue=!le&&(u||D||w===`shift`),fe=w===`none`?null:jl({...ne,padding:{top:U.top+1+ee,right:U.right+1+G,bottom:U.bottom+1+te,left:U.left+1+W},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),pe=le?null:kl({...ne,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ue,limiter:u||D?void 0:Al(e=>{if(!re.current)return{};let{width:t,height:n}=re.current.getBoundingClientRect(),r=wi(bi(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[ne,u,D,O,U,T]);w===`shift`||T===`shift`||V===`center`?ce.push(pe,fe):ce.push(fe,pe),ce.push(Ml({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(cf,`${t}px`),i.setProperty(lf,`${n}px`);let a=de(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(af,`${u}px`),i.setProperty(of,`${d}px`)}}),$d(e=>({element:re.current||X(e.elements.floating).createElement(`div`),padding:re.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=bi(r),u=xi(r),d=wi(l)===`y`,f=re.current,p=typeof a==`function`?a(df(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(sf,d?`${m} ${h}`:`${h} ${m}`),{}}},ef,x),Y(()=>{!_&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,h]);let K=g.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:q,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?_:void 0,placement:H,middleware:ce,strategy:r,whileElementsMounted:m?void 0:(...e)=>hl(...e,K),nodeId:b,externalTree:C}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||tf,Te=xe?r:`fixed`,Ee=g.useMemo(()=>{let e;return e=xe?x?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[cf]=`100vw`,e[lf]=`100vh`,xe||(e.opacity=0),e},[x,Te,Ce,he,we,ge,Se,xe]),De=g.useRef(null);Y(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(mf(t)?t.current:t)||null;n!==De.current&&(q.setPositionReference(n),De.current=n)},[_,q,j,M]),g.useEffect(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&mf(e)&&e.current!==De.current&&(q.setPositionReference(e.current),De.current=e.current)},[_,q,j,M]),g.useEffect(()=>{if(m&&_&&me.reference&&me.floating)return hl(me.reference,me.floating,ve,K)},[m,_,me,ve,K]);let Oe=bi(ye),ke=uf(i,Oe,P),Ae=xi(ye)||`center`,je=!!_e.hide?.referenceHidden;Y(()=>{S&&_&&xe&&(Oe!==B||L&&Ae!==V)&&I(ye)},[S,L,_,xe,ye,Oe,Ae,B,V]);let Me=g.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return g.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:re,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:q,context:be,isPositioned:xe,update:ve}),[Ee,Me,re,Ne,ke,Ae,Oe,je,q,be,xe,ve])}function mf(e){return e!=null&&`current`in e}function hf(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=g.useState(0),s=Pe(_f).current,c=Pe(gf).current,l=g.useRef(0),u=g.useRef(!0),d=g.useRef(null),f=g.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),_=J(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!bf(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&xf(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=yf(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=J(()=>{let[e,t]=vf(c),n=_(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&_(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,_]),Y(()=>{u.current&&y()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=J(e=>(s.add(e),()=>{s.delete(e)})),x=g.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,Z.jsx)(kd.Provider,{value:x,children:t})}function gf(){return new Map}function _f(){return new Set}function vf(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>xf(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function yf(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function bf(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function xf(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Sf(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=g.useRef(null),o=g.useRef(null),s=ja(r);Y(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Y(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function Cf(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),wt(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Id(r),i],stateAttributesMapping:qr})}var wf=20;function Tf(e,t,n,r){let[i,a]=g.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=X(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-wf)},[e,t,n]),$l(e&&(!t||i),r)}var Ef=g.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Io,style:_,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=yd(),S=qd(),C=hd(!0),w=y.useState(`parent`),T=y.useState(`floatingRootContext`),E=y.useState(`floatingTreeRoot`),D=y.useState(`mounted`),O=y.useState(`open`),k=y.useState(`modal`),A=y.useState(`openMethod`),j=y.useState(`activeTriggerElement`),M=y.useState(`transitionStatus`),N=y.useState(`positionerElement`),P=y.useState(`instantType`),F=y.useState(`adaptiveOrigin`),I=y.useState(`lastOpenChangeReason`),L=y.useState(`floatingNodeId`),R=y.useState(`floatingParentNodeId`),z=T.useState(`domReferenceElement`),B=n,V=c,H=l,U=s,ee=h;w.type===`context-menu`&&(B=n??w.context?.anchor,U??=`start`,!o&&U!==`center`&&(H=e.alignOffset??2,V=e.sideOffset??-5));let te=o,W=U;w.type===`menu`?(te??=`inline-end`,W??=`start`,ee=e.collisionAvoidance??Lo):w.type===`menubar`&&(te??=w.context.orientation===`vertical`?`inline-end`:`bottom`,W??=`start`);let G=w.type===`context-menu`,ne=ff({anchor:B,floatingRootContext:T,positionMethod:C?`fixed`:r,mounted:D,side:te,sideOffset:V,align:W,alignOffset:H,arrowPadding:G?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:L,keepMounted:S,disableAnchorTracking:m,collisionAvoidance:ee,shift:G?{crossAxis:!(`side`in ee&&ee.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:E,adaptiveOrigin:F,lazyFlip:b?`placement`:!1});g.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===L&&y.set(`hoverEnabled`,!1),e.nodeId!==L&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,La(Qa)))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[y,E.events,L]),g.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,La(t))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[E.events,y]);let re=ya();g.useEffect(()=>{O||re.clear()},[O,re]),g.useEffect(()=>{function e(e){if(O&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&j&&j!==e.target){let e=y.select(`closeDelay`);e>0?re.isStarted()||re.start(e,()=>{y.setOpen(!1,La(Qa))}):y.setOpen(!1,La(Qa))}else re.clear()}}return E.events.on(`itemhover`,e),()=>{E.events.off(`itemhover`,e)}},[E.events,O,j,y,re]),g.useEffect(()=>{let e={open:O,nodeId:L,parentNodeId:R,reason:y.select(`lastOpenChangeReason`)};E.events.emit(`menuopenchange`,e)},[E.events,O,y,L,R]),Sf({store:y,domReference:z,positionerElement:N,open:O});let ie={open:O,side:ne.side,align:ne.align,anchorHidden:ne.anchorHidden,nested:w.type===`menu`,instant:P},ae=w.type===`menubar`&&w.context.modal;Tf(O&&(ae||k&&I!==`trigger-hover`),A===`touch`,N,j);let oe=Cf(e,ie,{styles:ne.positionerStyles,transitionStatus:M,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!D,inert:!O}),se=D&&w.type!==`menu`&&(w.type!==`menubar`&&k&&I!==`trigger-hover`||w.type===`menubar`&&w.context.modal),ce=null;return w.type===`menubar`?ce=w.context.contentElement:w.type===void 0&&(ce=j),(0,Z.jsxs)(gd.Provider,{value:ne,children:[se&&(0,Z.jsx)(Vl,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:Bl(!O),cutout:ce}),(0,Z.jsx)(Zo,{id:L,children:(0,Z.jsx)(hf,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:oe})})]})}),Df=g.createContext(null);function Of(e){let t=g.useContext(Df);if(t===null&&!e)throw Error(tt(5));return t}function kf(e){return e==null?za:e.type.startsWith(`key`)?Ya:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Xa:za}var Af={...nc,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=nc.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>br&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!nc.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},jf=class extends qs{constructor(e,t,n=!1){let r=new Ds,i=Nf(r,t,n,e);super(i,Mf(r),Af),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Mf(e){return{positionerRef:g.createRef(),popupRef:g.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:g.createRef(),beforeTriggerFocusGuardRef:g.createRef(),beforeContentFocusGuardRef:g.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Nf(e,t,n=!1,r){return{...Xs(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:bt,inputProps:bt,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Go,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:bt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Pf=g.createContext(null);function Ff(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function If(e,t){return e===`list-navigation`||Ff(e,t)}var Lf=Is(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:_=!0,isSubmenu:v=!1,virtualFocus:y=!1,virtualFocusRef:b,allowEscape:x=!0,resetOnPointerLeave:S=!0}=e,C=hd(!0),w=yd(!0),T=Of(!0),E=w?.store,D=w?.virtualFocus??!1,O=g.useMemo(()=>v&&E?{type:`menu`,store:E}:T?{type:`menubar`,context:T}:C&&!E?{type:`context-menu`,context:C}:{type:void 0},[C,E,T,v]),k=nr(),A=nr(),[j,M]=g.useState(void 0),N=(j??A)||void 0,P=Jo(),F=O.type===`menu`?O.store:void 0,I=(n??o)&&F?.state.transitionStatus===`starting`,L=Pe(()=>I?F?.state.instantType:void 0).current,R=Pe(()=>{let e=new jf({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:O,disabled:s,highlightItemOnHover:_,modal:O.type===void 0?c:void 0,rootId:k,instantType:L},N,P!=null);return e.context.virtualFocusRef=b,e}).current;R.useControlledProp(`openProp`,n),R.useControlledProp(`triggerIdProp`,m),R.useContextCallback(`onOpenChangeComplete`,i);let z=R.useState(`floatingTreeRoot`),B=Xo(z),V=R.useState(`open`),H=R.useState(`activeTriggerElement`),U=R.useState(`positionerElement`),ee=R.useState(`hoverEnabled`),te=R.useState(`disabled`),W=R.useState(`lastOpenChangeReason`),G=R.useState(`parent`),ne=R.useState(`activeIndex`),re=R.useState(`keyboardOpen`),ie=R.useState(`payload`),ae=R.useState(`floatingParentNodeId`),oe=g.useRef(null),se=g.useRef(G.type!==`context-menu`),ce=ya(),le=g.useRef(!0),ue=ya(),de=ae!=null,{openMethod:fe,triggerProps:pe}=uu(V);R.useSyncedValues({disabled:s,highlightItemOnHover:_,modal:G.type===void 0?c:void 0,openMethod:fe,rootId:k}),Cs(R);let{forceUnmount:K,transitionStatus:q}=ws(V,R,()=>{R.set(`allowMouseEnter`,!1)},I),me=ja(R.context.popupRef);g.useEffect(()=>{if(L===void 0)return;let e=()=>{R.state.instantType===L&&R.set(`instantType`,void 0)};if(!V){e();return}if(q!==void 0)return;if(R.context.popupRef.current==null){e();return}let t=new AbortController;return me(e,t.signal),()=>{t.abort()}},[L,V,q,me,R]),Y(()=>{C&&!w?R.update({parent:{type:`context-menu`,context:C},floatingNodeId:B,floatingParentNodeId:P}):(w||!R.select(`activeTriggerElement`))&&R.update({floatingNodeId:B,floatingParentNodeId:P})},[C,w,B,P,H,R]),g.useEffect(()=>{V||(oe.current=null),G.type===`context-menu`&&(V?ce.start(500,()=>{se.current=!0}):(ce.clear(),se.current=!1))},[ce,V,G.type]),Y(()=>{!V&&!ee&&R.set(`hoverEnabled`,!0)},[V,ee,R]);let he=J((e,t)=>{let n=t.reason;if(!e&&!R.select(`open`)||V===e&&t.trigger===H&&W===n)return;let i=xs(t);if(!e&&t.trigger==null&&(t.trigger=H??void 0),r?.(e,t),t.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!le.current)return;e&&n===`trigger-focus`?(le.current=!1,ue.start(300,()=>{le.current=!0})):(le.current=!0,ue.clear());let o=!e&&(n===`escape-key`||n==null);oe.current=t.event;let s=bs(R.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&If(n,a),s.instantType=G.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Ff(n,a)?`click`:o?`dismiss`:void 0,R.update(s)}),ge=fs({popupStore:R,floatingRootContext:R.state.floatingRootContext,floatingId:N,nested:P!=null,onOpenChange:he}),_e=ge.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>he(e,t);return _e.on(`setOpen`,e),()=>{_e?.off(`setOpen`,e)}},[_e,he]),Y(()=>R.subscribeToParentMenu(),[R]);let ve=g.useCallback(()=>{R.setOpen(!1,La($a))},[R]);g.useImperativeHandle(d,()=>({unmount:K,close:ve}),[K,ve]);let ye;G.type===`context-menu`&&(ye=G.context),g.useImperativeHandle(ye?.positionerRef,()=>U,[U]),g.useImperativeHandle(ye?.actionsRef,()=>({setOpen:he}),[he]);let be=ds(ge,{enabled:!te,bubbles:{escapeKey:f&&G.type===`menu`},outsidePress(){return G.type!==`context-menu`||oe.current?.type===`contextmenu`||se.current},externalTree:de?z:void 0}),xe=Zd(),Se=bc(ge,{enabled:!te,listRef:R.context.itemDomElements,activeIndex:ne,virtual:y,nested:G.type===`menubar`||!y&&G.type!==void 0,parentOrientation:G.type===`menubar`?G.context.orientation:void 0,loopFocus:l,focusItemOnOpen:y?re:void 0,allowEscape:y&&l&&x,orientation:u,triggerOrientation:y?`vertical`:u,rtl:xe===`rtl`,disabledIndices:yt,onNavigate(e,t){R.setActiveIndex(e,kf(t),t?.nativeEvent)},openOnArrowKeyDown:G.type!==`context-menu`&&!(y&&v),externalTree:!y&&de?z:void 0,nestedReturnFocusRef:F?.context.virtualFocusRef,focusItemOnHover:_,resetOnPointerLeave:S}),Ce=g.useCallback(e=>{R.context.typingRef.current=e},[R]),we=xc(ge,{enabled:!te&&!y,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:ne,resetMs:500,onMatch:(e,t)=>{V&&e!==ne&&R.setActiveIndex(e,Ya,t.nativeEvent)},onTyping:Ce}),Te=J(a),Ee=g.useRef(-1),De=J(()=>{let e=R.state.activeIndex,t=e===null?void 0:R.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ee.current===n&&R.context.reportedItem===t)return;Ee.current=n,R.context.reportedItem=t,y&&R.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=R.context;R.context.highlightReason=za,R.context.highlightEvent=void 0,a&&Te(t,Ra(r,i,{label:t===void 0?void 0:R.context.itemLabels.current[n]??void 0}))});Y(()=>{De()},[ne,De]);let Oe=g.useMemo(()=>{if(!y)return Se.reference;if(!Se.trigger)return bt;let{onFocus:e,...t}=Se.trigger;return t},[y,Se.reference,Se.trigger]);R.useSyncedValue(`inputProps`,y?Se.reference??bt:bt);let ke=g.useMemo(()=>{let e=Ve(we.reference,Oe,be.reference,{onMouseMove(){R.set(`allowMouseEnter`,!0)}},pe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=V,e},[R,we.reference,Oe,be.reference,pe,V]),Ae=g.useMemo(()=>{let e=Ve(Se.trigger,be.trigger,pe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Se.trigger,be.trigger,pe]);Pe(()=>(R.update({inactiveTriggerProps:Ae}),null)),Ts(R,{floatingRootContext:ge,activeTriggerProps:ke,inactiveTriggerProps:Ae,popupProps:g.useMemo(()=>Ve(ms,{onMouseMove(){R.set(`allowMouseEnter`,!0),G.type===`menu`&&R.set(`hoverEnabled`,!1)},onClick(){R.select(`hoverEnabled`)&&R.set(`hoverEnabled`,!1)},onKeyDown(e){let t=R.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},we.floating,Se.floating,be.floating),[G.type,R,we.floating,Se.floating,be.floating]),itemProps:Se.item??bt});let je=g.useMemo(()=>({store:R,parent:O,orientation:u,loopFocus:l,allowEscape:x,defaultFloatingId:A,setRenderedFloatingId:M,virtualFocus:y,parentVirtualFocus:D,syncHighlightedItem:De}),[R,O,u,l,x,A,y,D,De]),Me=typeof t==`function`?t({payload:ie}):t,Ne=(0,Z.jsxs)(vd.Provider,{value:je,children:[p&&(0,Z.jsx)(_s,{handle:p,store:R}),Me]});return(G.type===void 0||G.type===`context-menu`)&&(Ne=(0,Z.jsx)(Qo,{externalTree:z,children:Ne})),Ne});function Rf(e){let t=g.useContext(Pf);if(t===null)return(0,Z.jsx)(Lf,{...e});let n=t.Root;return(0,Z.jsx)(Pf.Provider,{value:null,children:(0,Z.jsx)(n,{...t.options,...e})})}var zf=5;function Bf(e,t){let n=Vf(t);return e.clientX>=n.left-zf&&e.clientX<=n.right+zf&&e.clientY>=n.top-zf&&e.clientY<=n.bottom+zf}function Vf(e){let t=e.getBoundingClientRect(),n=de(e);if(Sr)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Hf(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=rt(),{ref:i,index:a}=jd(e),o=n===a,s=g.useRef(null),c=lt(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Uf(e){let{render:t,className:n,style:r,state:i=bt,props:a=yt,refs:o=yt,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Hf({metadata:s});return wt(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Wf(e){if(q(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Te(e))return Wf(Oe(e))}function Gf(e,t){function n(n,r,i){let a=n.currentTarget;Oa.flushSync(()=>{e.setOpen(!1,La(Ka,n.nativeEvent,a))}),fa(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&pa(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Kf(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=g.useRef(!1);return g.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,X(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:bt,[t,n,r])}var qf=Ls(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=yd(!0),h=rc(d)??m?.store;if(!h)throw Error(tt(85));let _=nr(s),v=h.useState(`isTriggerActive`,_),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,_),x=h.useState(`triggerControlsId`,_),S=g.useRef(null),C=Yf(),w=rt(!0),T=Yo(),E=g.useMemo(()=>T??new Go,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Ss(_,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:Xo(E),floatingParentNodeId:Jo(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=ot({disabled:j,native:o});g.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=g.useRef(null),F=ya(),I=J(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Q(P.current,t)||Q(h.select(`positionerElement`),t)||t===P.current||t!=null&&Wf(t)===h.select(`rootId`)||Bf(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:Za})});g.useEffect(()=>{let e=X(P.current);if(b&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,I,{once:!0}),()=>{e.removeEventListener(`mouseup`,I)}},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=pc(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:kc({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=Jf(b,h.select(`lastOpenChangeReason`)),B=cs(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),V=ac(y,{enabled:!j&&L}),H=Kf({open:b,enabled:k,mouseDownAction:`open`}),U=g.useMemo(()=>Ve(V.reference,B.reference),[V.reference,B.reference]),ee=h.useState(`triggerProps`,O),te=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:W,handleFocusTargetFocus:G}=Gf(h,S),ne={disabled:j,open:b},re=[P,t,N,D,S],ie=[U,R??bt,ee,{"aria-haspopup":`menu`,"aria-controls":x,id:_,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),X(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},te,k?{role:`menuitem`}:{},H,p,M],ae=wt(`button`,e,{enabled:!k,stateAttributesMapping:Kr,state:ne,ref:re,props:ie});return k?(0,Z.jsx)(Uf,{tag:`button`,render:n,className:r,style:i,state:ne,refs:re,props:ie,stateAttributesMapping:Kr}):b?(0,Z.jsxs)(g.Fragment,{children:[(0,Z.jsx)(bo,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:W},`${_}-pre-focus-guard`),(0,Z.jsx)(g.Fragment,{children:ae},_),(0,Z.jsx)(bo,{ref:h.context.triggerFocusTargetRef,onFocus:G},`${_}-post-focus-guard`)]}):(0,Z.jsx)(g.Fragment,{children:ae},_)});function Jf(e,t){let n=ya(),[r,i]=g.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Yf(){let e=Of(!0);return g.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var Xf=g.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return wt(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Zf(e){let[t,n]=g.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=g.useRef(null),i=g.useRef(null),a=g.useRef(null),o=g.useRef(null),s=g.useRef(!0),c=g.useRef(null),l=tr(),u=g.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,Z.jsx)(md.Provider,{value:u,children:(0,Z.jsx)(vd.Provider,{value:void 0,children:(0,Z.jsx)(Rf,{...e})})})}var Qf=500,$f=g.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=hd(!1),{store:m}=yd(!1),h=m.useState(`open`),_=m.useState(`disabled`),v=g.useRef(null),y=g.useRef(null),b=ya(),x=ya(),S=g.useRef(!1),C=g.useRef(null);function w(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),S.current=!1,s.current?.setOpen(!0,La(Ba,n)),x.start(Qf,()=>{S.current=!0})}function T(e){if(_)return;d.current=!0,oi(e),w(e.clientX,e.clientY,e.nativeEvent);let t=X(v.current);C.current?.abort();let n=new AbortController;C.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!S.current)return;x.clear(),S.current=!1;let t=Tr(e);Q(u.current,t)||p&&t&&Wf(t)===p||s.current?.setOpen(!1,La(Za,e))},{once:!0,signal:n.signal})}function E(){b.clear(),y.current=null}function D(e){if(_||(d.current=!1,e.touches.length!==1)){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};y.current=n,b.start(Qf,()=>{w(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1)E();else if(b.isStarted()&&y.current){let t=e.touches[0],n=Math.abs(t.clientX-y.current.x),r=Math.abs(t.clientY-y.current.y);(n>10||r>10)&&E()}}return g.useEffect(()=>()=>{C.current?.abort()},[]),g.useEffect(()=>{function e(e){if(_)return;let t=Tr(e);(Q(v.current,t)||Q(c.current,t)||Q(l.current,t))&&e.preventDefault()}return $(X(v.current),`contextmenu`,e)},[l,_,c]),wt(`div`,e,{state:{open:h},ref:[v,t],props:[{onContextMenu:T,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:Kr})}),ep=Ef;function tp({...e}){return(0,Z.jsx)(Zf,{"data-slot":`context-menu`,...e})}function np({className:e,...t}){return(0,Z.jsx)($f,{"data-slot":`context-menu-trigger`,className:Mn(`select-none`,e),...t})}function rp({className:e,align:t=`start`,alignOffset:n=4,side:r=`right`,sideOffset:i=0,...a}){return(0,Z.jsx)(Jd,{children:(0,Z.jsx)(ep,{className:`isolate z-50 outline-none`,align:t,alignOffset:n,side:r,sideOffset:i,children:(0,Z.jsx)(Gd,{"data-slot":`context-menu-content`,className:Mn(`cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function ip({className:e,inset:t,variant:n=`default`,...r}){return(0,Z.jsx)(Nd,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:Mn(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function ap({className:e,...t}){return(0,Z.jsx)(Xf,{"data-slot":`context-menu-separator`,className:Mn(`-mx-1 my-1 h-px bg-border`,e),...t})}function op({...e}){return(0,Z.jsx)(Rf,{"data-slot":`dropdown-menu`,...e})}function sp({...e}){return(0,Z.jsx)(qf,{"data-slot":`dropdown-menu-trigger`,...e})}function cp({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,Z.jsx)(Jd,{children:(0,Z.jsx)(Ef,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,Z.jsx)(Gd,{"data-slot":`dropdown-menu-content`,className:Mn(`cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function lp({className:e,inset:t,variant:n=`default`,...r}){return(0,Z.jsx)(Nd,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:Mn(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function up({className:e,...t}){return(0,Z.jsx)(Xf,{"data-slot":`dropdown-menu-separator`,className:Mn(`-mx-1 my-1 h-px bg-border`,e),...t})}function dp({selection:e,context:t,onConnections:n,onAction:r}){let i=t?ip:lp,a=t?ap:up;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(i,{disabled:!e.row.executable||!e.instances.length,onClick:()=>r(e,`reveal`),children:[(0,Z.jsx)(I,{}),`定位文件`]}),(0,Z.jsxs)(i,{disabled:!e.row.executable||!e.instances.length,onClick:()=>r(e,`properties`),children:[(0,Z.jsx)(R,{}),`文件属性`]}),(0,Z.jsxs)(i,{disabled:!e.instances.length,onClick:()=>n(e),children:[(0,Z.jsx)(B,{}),`查看连接`]}),(0,Z.jsx)(a,{}),(0,Z.jsxs)(i,{variant:`destructive`,disabled:!e.instances.length||e.instances.length>256,onClick:()=>r(e,`terminate`),children:[(0,Z.jsx)(oe,{}),e.instances.length>1?`结束全部进程(${e.instances.length})`:`结束进程`]})]})}function fp({row:e,instance:t,scope:n,children:r,onMenuOpenChange:i,onConnections:a,onAction:o}){let s=()=>{let r=t?[t]:e.instances;return{row:{...e,instances:r.map(e=>({...e}))},scope:n,instances:r.map(({id:e,pid:t,name:n})=>({id:e,pid:t,name:n}))}},[c,l]=(0,g.useState)(),u=e=>{e&&l(s()),i(e)},d=c??s(),f={onConnections:a,onAction:o};return(0,Z.jsxs)(tp,{onOpenChange:u,children:[(0,Z.jsxs)(np,{render:(0,Z.jsx)(xu,{className:t?`traffic-instance`:void 0}),children:[r,(0,Z.jsx)(Cu,{children:(0,Z.jsxs)(`div`,{className:`traffic-row-actions`,children:[(0,Z.jsx)(Pn,{variant:`ghost`,size:`xs`,onClick:()=>a(s()),children:`连接`}),(0,Z.jsxs)(op,{onOpenChange:u,children:[(0,Z.jsx)(sp,{render:(0,Z.jsx)(Pn,{variant:`ghost`,size:`icon-xs`,"aria-label":`更多操作 · ${t?`${t.name} · PID ${t.pid}`:e.name}`}),children:(0,Z.jsx)(P,{size:16})}),(0,Z.jsx)(cp,{align:`end`,className:`w-44`,children:(0,Z.jsx)(dp,{selection:d,...f})})]})]})})]}),(0,Z.jsx)(rp,{className:`w-44`,children:(0,Z.jsx)(dp,{selection:d,context:!0,...f})})]})}function pp({selection:e,busy:t,onCancel:n,onConfirm:r}){return(0,Z.jsx)(Ru,{open:!0,onOpenChange:e=>{!e&&!t&&n()},children:(0,Z.jsxs)(Vu,{children:[(0,Z.jsxs)(Hu,{children:[(0,Z.jsx)(Wu,{children:e.instances.length>1?`结束全部 ${e.instances.length} 个进程?`:`结束此进程?`}),(0,Z.jsxs)(Gu,{children:[`将结束 `,e.row.name,` 的以下进程,未保存的内容可能丢失。`]})]}),(0,Z.jsx)(`ul`,{className:`traffic-termination-targets`,children:e.instances.map(e=>(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`span`,{children:e.name}),(0,Z.jsxs)(`span`,{children:[`PID `,e.pid]})]},e.id))}),(0,Z.jsxs)(Uu,{children:[(0,Z.jsx)(qu,{disabled:t,onClick:n,children:`取消`}),(0,Z.jsx)(Ku,{variant:`destructive`,disabled:t,onClick:r,children:t?`正在结束…`:`确认结束`})]})]})})}var mp={name:e=>e.name,category:e=>ku[e.category],rx:e=>e.rxBytesPerSecond,tx:e=>e.txBytesPerSecond,runRx:e=>e.runRxBytes??null,runTx:e=>e.runTxBytes??null,connections:e=>e.tcpConnections};function hp({state:e,active:t,onConnections:n,onAction:r}){let[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(`all`),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(`rx`),[f,p]=(0,g.useState)(!1),[m,h]=(0,g.useState)(!1),[_,v]=(0,g.useState)(!1),[y,b]=(0,g.useState)(!1),[x,S]=(0,g.useState)(new Set),[C,w]=(0,g.useState)([]),T=(0,g.useRef)(``),E=m||_||y||!!e?.processes.some(e=>x.has(e.id)),D={scope:e?.process.scope??`own`,onConnections:n,onAction:r,onMenuOpenChange:b},O=(0,g.useMemo)(()=>{let t=i.trim().toLocaleLowerCase();return(e?.processes??[]).filter(e=>(!t||`${e.name} ${e.executable}`.toLocaleLowerCase().includes(t))&&(o===`all`||e.category===o)&&(!c||(e.rxBytesPerSecond??0)>0||(e.txBytesPerSecond??0)>0)).sort((e,t)=>{let n=mp[u](e),r=mp[u](t);if(n===null)return r===null?e.id.localeCompare(t.id):1;if(r===null)return-1;let i=(u===`runRx`||u===`runTx`)&&typeof n==`string`&&typeof r==`string`?BigInt(n)<BigInt(r)?-1:+(BigInt(n)>BigInt(r)):typeof n==`string`&&typeof r==`string`?n.localeCompare(r,`zh-CN`):Number(n)-Number(r);return(f?i:-i)||e.id.localeCompare(t.id)})},[e?.processes,i,o,c,u,f]);(0,g.useEffect)(()=>{let e=`${u}:${f}`,t=O.map(e=>e.id),n=E&&T.current===e;T.current=e,w(e=>{let r=new Set(t),i=new Set(e),a=n?[...e.filter(e=>r.has(e)),...t.filter(e=>!i.has(e))]:t;return a.length===e.length&&a.every((t,n)=>e[n]===t)?e:a})},[O,E,u,f]);let k=new Map(O.map(e=>[e.id,e])),j=C.length?C.flatMap(e=>k.has(e)?[k.get(e)]:[]):O,N=e=>{p(u===e?!f:e===`name`||e===`category`),d(e)},P=(e,t)=>(0,Z.jsx)(Nu,{active:u===e,ascending:f,onClick:()=>N(e),children:t});return(0,Z.jsxs)(`section`,{className:`traffic-view`,hidden:!t,"aria-label":`实时流量`,children:[(0,Z.jsxs)(`div`,{className:`traffic-summary`,children:[(0,Z.jsxs)(`span`,{className:`traffic-summary-item`,children:[`下载总速度`,` `,(0,Z.jsxs)(`strong`,{className:`traffic-download`,children:[`↓ `,Yu(e?.rxBytesPerSecond??null)]})]}),(0,Z.jsxs)(`span`,{className:`traffic-summary-item`,children:[`上传总速度`,` `,(0,Z.jsxs)(`strong`,{className:`traffic-upload`,children:[`↑ `,Yu(e?.txBytesPerSecond??null)]})]}),(0,Z.jsx)(`span`,{className:`traffic-summary-note`,children:`活动物理网卡总量 · 包含局域网流量`})]}),(0,Z.jsxs)(`div`,{className:`traffic-toolbar`,children:[(0,Z.jsx)(ju,{value:i,onChange:a}),(0,Z.jsx)(Mu,{value:o,onChange:s}),(0,Z.jsxs)(`label`,{className:`traffic-check`,children:[(0,Z.jsx)(pd,{checked:c,onCheckedChange:e=>l(!!e)}),`仅显示有流量的程序`]}),(0,Z.jsx)(`span`,{className:`traffic-toolbar-end`,children:E?`排序已暂时固定,数值继续刷新`:`每秒刷新`})]}),(0,Z.jsxs)(`div`,{className:`traffic-table-area`,onPointerEnter:()=>h(!0),onPointerLeave:()=>h(!1),onFocusCapture:()=>v(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||v(!1)},children:[(0,Z.jsxs)(vu,{className:`traffic-table traffic-realtime-table`,children:[(0,Z.jsx)(yu,{children:(0,Z.jsxs)(xu,{children:[(0,Z.jsx)(Su,{"aria-sort":u===`name`?f?`ascending`:`descending`:void 0,children:P(`name`,`程序名称`)}),(0,Z.jsx)(Su,{"aria-sort":u===`category`?f?`ascending`:`descending`:void 0,children:P(`category`,`程序类别`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,"aria-sort":u===`rx`?f?`ascending`:`descending`:void 0,children:P(`rx`,`下载速度`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,"aria-sort":u===`tx`?f?`ascending`:`descending`:void 0,children:P(`tx`,`上传速度`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,title:`程序本次运行期间已采集的流量`,"aria-sort":u===`runRx`?f?`ascending`:`descending`:void 0,children:P(`runRx`,`本次下载`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,title:`程序本次运行期间已采集的流量`,"aria-sort":u===`runTx`?f?`ascending`:`descending`:void 0,children:P(`runTx`,`本次上传`)}),(0,Z.jsx)(Su,{className:`traffic-numeric`,"aria-sort":u===`connections`?f?`ascending`:`descending`:void 0,children:P(`connections`,`TCP 连接`)}),(0,Z.jsx)(Su,{children:`操作`})]})}),(0,Z.jsx)(bu,{children:j.map(t=>(0,Z.jsxs)(g.Fragment,{children:[(0,Z.jsxs)(fp,{row:t,...D,children:[(0,Z.jsx)(Cu,{children:(0,Z.jsx)(Au,{name:t.name,executable:t.executable,icon:t.iconId?e?.icons[t.iconId]:void 0,prefix:(0,Z.jsx)(Pn,{className:`traffic-expand`,variant:`ghost`,size:`icon-xs`,"aria-label":`${x.has(t.id)?`收起`:`展开`}${t.name}的进程`,"aria-expanded":x.has(t.id),disabled:!t.instances.length,onClick:()=>S(e=>{let n=new Set(e);return n.has(t.id)?n.delete(t.id):n.add(t.id),n}),children:x.has(t.id)?(0,Z.jsx)(A,{size:13}):(0,Z.jsx)(M,{size:13})})})}),(0,Z.jsx)(Cu,{className:`traffic-muted`,children:ku[t.category]}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-download`,children:Yu(t.rxBytesPerSecond)}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-upload`,children:Yu(t.txBytesPerSecond)}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-download`,title:t.runCoverage===`gap`?`仅包含已采集流量`:`本次运行累计`,children:Ju(t.runRxBytes??null)}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-upload`,title:t.runCoverage===`gap`?`仅包含已采集流量`:`本次运行累计`,children:Ju(t.runTxBytes??null)}),(0,Z.jsx)(Cu,{className:`traffic-numeric`,title:`UDP 流:${t.udpFlows??`未知`}`,children:t.tcpConnections??`—`})]}),x.has(t.id)&&t.instances.map(e=>(0,Z.jsxs)(fp,{row:t,instance:e,...D,children:[(0,Z.jsx)(Cu,{title:e.executable,children:(0,Z.jsxs)(`span`,{className:`traffic-instance-label`,children:[(0,Z.jsx)(`span`,{children:e.name||t.name}),(0,Z.jsxs)(`span`,{className:`traffic-muted`,children:[`PID `,e.pid]})]})}),(0,Z.jsx)(Cu,{className:`traffic-muted`,children:`进程实例`}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-download`,children:Yu(e.rxBytesPerSecond)}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-upload`,children:Yu(e.txBytesPerSecond)}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-download`,children:Ju(e.runRxBytes??null)}),(0,Z.jsx)(Cu,{className:`traffic-numeric traffic-upload`,children:Ju(e.runTxBytes??null)}),(0,Z.jsx)(Cu,{className:`traffic-numeric`,children:e.tcpConnections??`—`})]},e.id))]},t.id))})]}),!O.length&&(0,Z.jsx)(Pu,{title:e?e.process.status===`collecting`?`没有符合条件的程序`:`进程流量尚未就绪`:`正在连接流量采集器`,children:e?.process.status===`not-installed`?`在上方启用进程采集。`:e?.process.status===`collecting`?`调整搜索或筛选条件。`:void 0})]}),(0,Z.jsxs)(`footer`,{className:`traffic-footer`,children:[(0,Z.jsxs)(`span`,{title:`网卡总量与进程合计的统计范围不同。`,children:[O.length,` 个程序`,e?` · ${e.process.scope===`machine`?`已授权整机`:`当前账户`}进程范围`:``]}),(0,Z.jsxs)(`span`,{title:e?.adapters.map(e=>`${e.name}: ${e.addresses.join(`, `)}`).join(`
|
|
2
|
+
`),children:[e?.adapters.length??0,` 张活动物理网卡`]})]})]})}function gp(){let[e,t]=(0,g.useState)(`realtime`),[n,r]=(0,g.useState)(),[i,a]=(0,g.useState)(),[o,s]=(0,g.useState)(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(),f=(0,g.useMemo)(()=>u?.instances.map(e=>e.id),[u]),[p,m]=(0,g.useState)(),[h,_]=(0,g.useState)(),v=(0,g.useRef)(!1),y=(0,g.useRef)(0),b=(0,g.useRef)(!1);(0,g.useEffect)(()=>{v.current=!0;let e=!0,t,n=Tu.onTheme(e=>{document.documentElement.dataset.theme=e.effective}),i=Tu.onPrepareStop(()=>(e=!1,v.current=!1,y.current+=1,clearTimeout(t),{ok:!0})),o=async()=>{let n=y.current;try{if(b.current)return;let t=await Du(`snapshot`);e&&n===y.current&&(r(t),a(void 0))}catch(t){e&&n===y.current&&a(Fu(t))}finally{e&&(t=setTimeout(()=>void o(),1e3))}};return Tu.context().then(t=>{e&&(document.documentElement.dataset.theme=t.theme.effective)}).catch(t=>{e&&a(Fu(t))}),o(),()=>{e=!1,v.current=!1,y.current+=1,clearTimeout(t),n(),i()}},[]);let x=async(e,t)=>{if(b.current)return;b.current=!0;let n=++y.current;l(!0),s(void 0);try{let i=await Du(e,t);v.current&&n===y.current&&(r(i),a(void 0))}catch(e){v.current&&n===y.current&&s(Fu(e))}finally{b.current=!1,v.current&&l(!1)}},S=n?.process.scope??`own`,C=async(e,t)=>{if(!b.current){b.current=!0,++y.current,l(!0),s(void 0),_(void 0);try{let n=e.instances.map(e=>e.id),r=await Du(`process.action`,{scope:e.scope,appId:e.row.appId,action:t,processInstanceIds:t===`terminate`?n:n.slice(0,1),...t===`terminate`?{confirmed:!0}:{}});if(!v.current)return;let i=r.results.filter(e=>e.status===`failed`);if(i.length&&s(i.map(t=>`PID ${e.instances.find(e=>e.id===t.instanceId)?.pid??`—`}:${t.message}`).join(`;`)),t===`terminate`){let e=r.results.filter(e=>e.status===`terminated`).length,t=r.results.filter(e=>e.status===`exited`).length;_(`已结束 ${e} 个进程${t?`,${t} 个进程已退出`:``}${i.length?`,${i.length} 个操作失败`:``}。`),m(void 0)}else i.length||_(t===`reveal`?`已在资源管理器中定位程序文件。`:`已打开文件属性窗口。`)}catch(e){v.current&&s(Fu(e))}finally{b.current=!1,v.current&&l(!1)}}},w=(e,t)=>{c||(t===`terminate`?m(e):C(e,t))},T=!!(n?.process.canEnable&&[`not-installed`,`unavailable`,`error`].includes(n.process.status)),E=n&&n.process.status!==`collecting`&&n.process.status!==`paused`;return(0,Z.jsxs)(`main`,{className:`traffic-page`,children:[(0,Z.jsxs)(`header`,{className:`traffic-topbar`,children:[(0,Z.jsxs)(`nav`,{className:`traffic-tabs`,"aria-label":`流量视图`,children:[(0,Z.jsx)(Pn,{className:`traffic-tab`,variant:`ghost`,"aria-pressed":e===`realtime`,onClick:()=>t(`realtime`),children:`实时流量`}),(0,Z.jsx)(Pn,{className:`traffic-tab`,variant:`ghost`,"aria-pressed":e===`history`,onClick:()=>t(`history`),children:`历史流量`})]}),(0,Z.jsxs)(`div`,{className:`traffic-top-actions`,children:[(0,Z.jsxs)(`select`,{className:`traffic-select`,"aria-label":`进程统计范围`,value:S,disabled:c||!n,onChange:e=>void x(`process.scope`,{scope:e.target.value}),children:[(0,Z.jsx)(`option`,{value:`own`,children:`当前账户`}),(0,Z.jsx)(`option`,{value:`machine`,disabled:!n?.process.canMachine,children:`整机(需授权)`})]}),(0,Z.jsx)(Bn,{variant:`secondary`,title:n?.process.message||(n?.process.coverage===`gap`?`缺失数值显示为 —,历史仅累计已采集的流量。`:`进程采样状态`),children:n?Ou[n.process.coverage]:`连接中`}),(0,Z.jsx)(Pn,{variant:`ghost`,size:`icon-sm`,"aria-label":n?.paused?`继续采集`:`暂停采集`,title:n?.paused?`继续采集`:`暂停采集`,disabled:c||!n,onClick:()=>void x(`pause`,{paused:!n?.paused}),children:n?.paused?(0,Z.jsx)(ee,{size:14}):(0,Z.jsx)(H,{size:14})}),(0,Z.jsx)(Pn,{variant:`ghost`,size:`icon-sm`,"aria-label":`重新连接采集器`,title:`重新连接采集器`,disabled:c,onClick:()=>void x(`retry`),children:(0,Z.jsx)(W,{size:14})})]})]}),(o||i)&&(0,Z.jsx)(`div`,{className:`traffic-notice pt-3`,children:(0,Z.jsx)(In,{variant:`destructive`,children:(0,Z.jsx)(Ln,{children:o||i})})}),E&&(0,Z.jsx)(`div`,{className:`traffic-notice pt-3`,children:(0,Z.jsx)(In,{children:(0,Z.jsx)(Ln,{children:(0,Z.jsxs)(`div`,{className:`traffic-notice-line`,children:[(0,Z.jsxs)(`span`,{className:`traffic-notice-text`,children:[(0,Z.jsx)(`strong`,{children:n.process.status===`not-installed`?`启用按程序流量统计`:n.process.status===`starting`?`正在连接进程采集服务`:`进程采集暂不可用`}),(n.process.status===`error`||n.process.status===`unavailable`)&&n.process.message&&(0,Z.jsx)(`span`,{children:n.process.message})]}),T&&(0,Z.jsxs)(Pn,{size:`sm`,disabled:c,onClick:()=>void x(`process.enable`,{scope:S}),children:[(0,Z.jsx)(ie,{size:14}),c?`正在启用…`:S===`machine`?`授权整机采集`:`启用进程采集`]})]})})})}),h&&(0,Z.jsx)(`div`,{className:`traffic-notice`,role:`status`,children:h}),(0,Z.jsx)(hp,{active:e===`realtime`,state:n,onConnections:d,onAction:w}),(0,Z.jsx)(ed,{active:e===`history`,scope:S,icons:n?.icons??{}}),u&&(0,Z.jsx)(Iu,{row:u.row,scope:u.scope,instanceIds:f,onClose:()=>d(void 0)},`${u.scope}:${u.row.appId}:${u.instances.map(e=>e.id).join(`,`)}`),p&&(0,Z.jsx)(pp,{selection:p,busy:c,onCancel:()=>m(void 0),onConfirm:()=>void C(p,`terminate`)})]})}var _p=document.getElementById(`root`);_p&&(0,Mt.createRoot)(_p).render((0,Z.jsx)(gp,{}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));export{c as n,o as t};
|