import{r as e,j as t,R as n,b as r,c as o,a as i}from"./vendor-react-RSDKEZ60.js";import{_ as a,b as s,c}from"./vendor-base-5_f7mmWg.js";function l(){return"undefined"!=typeof window}function u(e){return p(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function f(e){var t;return null==(t=(p(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function p(e){return!!l()&&(e instanceof Node||e instanceof d(e).Node)}function m(e){return!!l()&&(e instanceof Element||e instanceof d(e).Element)}function h(e){return!!l()&&(e instanceof HTMLElement||e instanceof d(e).HTMLElement)}function v(e){return!(!l()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof d(e).ShadowRoot)}function g(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=P(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function w(e){return/^(table|td|th)$/.test(u(e))}function y(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const x=/transform|translate|scale|rotate|perspective|filter/,b=/paint|layout|strict|content/,C=e=>!!e&&"none"!==e;let R;function E(e){const t=m(e)?P(e):e;return C(t.transform)||C(t.translate)||C(t.scale)||C(t.rotate)||C(t.perspective)||!T()&&(C(t.backdropFilter)||C(t.filter))||x.test(t.willChange||"")||b.test(t.contain||"")}function T(){return null==R&&(R="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),R}function _(e){return/^(html|body|#document)$/.test(u(e))}function P(e){return d(e).getComputedStyle(e)}function S(e){return m(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function D(e){if("html"===u(e))return e;const t=e.assignedSlot||e.parentNode||v(e)&&e.host||f(e);return v(t)?t.host:t}function N(e){const t=D(e);return _(t)?e.ownerDocument?e.ownerDocument.body:e.body:h(t)&&g(t)?t:N(t)}function M(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=N(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=d(o);if(i){const e=A(a);return t.concat(a,a.visualViewport||[],g(o)?o:[],e&&n?M(e):[])}return t.concat(o,M(o,[],n))}function A(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const O=["top","right","bottom","left"],j=["start","end"],I=O.reduce((e,t)=>e.concat(t,t+"-"+j[0],t+"-"+j[1]),[]),k=Math.min,F=Math.max,L=Math.round,U=Math.floor,W=e=>({x:e,y:e}),H={left:"right",right:"left",bottom:"top",top:"bottom"};function K(e,t,n){return F(e,k(t,n))}function B(e,t){return"function"==typeof e?e(t):e}function $(e){return e.split("-")[0]}function V(e){return e.split("-")[1]}function z(e){return"x"===e?"y":"x"}function X(e){return"y"===e?"height":"width"}function G(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Y(e){return z(G(e))}function q(e,t,n){void 0===n&&(n=!1);const r=V(e),o=Y(e),i=X(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=re(a)),[a,re(a)]}function Z(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const J=["left","right"],Q=["right","left"],ee=["top","bottom"],te=["bottom","top"];function ne(e,t,n,r){const o=V(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Q:J:t?J:Q;case"left":case"right":return t?ee:te;default:return[]}}($(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Z)))),i}function re(e){const t=$(e);return H[t]+e.slice(t.length)}function oe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ie(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ae(e,t,n){let{reference:r,floating:o}=e;const i=G(t),a=Y(t),s=X(a),c=$(t),l="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.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-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(V(t)){case"start":p[a]-=f*(n&&l?-1:1);break;case"end":p[a]+=f*(n&&l?-1:1)}return p}async function se(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=B(t,e),m=oe(p),h=s[f?"floating"===d?"reference":"floating":d],v=ie(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),g="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},x=ie(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:c}):g);return{top:(v.top-x.top+m.top)/y.y,bottom:(x.bottom-v.bottom+m.bottom)/y.y,left:(v.left-x.left+m.left)/y.x,right:(x.right-v.right+m.right)/y.x}}function ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function le(e){return O.some(t=>e[t]>=0)}function ue(e){const t=k(...e.map(e=>e.left)),n=k(...e.map(e=>e.top));return{x:t,y:n,width:F(...e.map(e=>e.right))-t,height:F(...e.map(e=>e.bottom))-n}}const de=new Set(["left","top"]);function fe(e){const t=P(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=h(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=L(n)!==i||L(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function pe(e){return m(e)?e:e.contextElement}function me(e){const t=pe(e);if(!h(t))return W(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fe(t);let a=(i?L(n.width):n.width)/r,s=(i?L(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const he=W(0);function ve(e){const t=d(e);return T()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:he}function ge(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=pe(e);let a=W(1);t&&(r?m(r)&&(a=me(r)):a=me(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==d(e))&&t}(i,n,r)?ve(i):W(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const e=d(i),t=r&&m(r)?d(r):r;let n=e,o=A(n);for(;o&&r&&t!==n;){const e=me(o),t=o.getBoundingClientRect(),r=P(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,f*=e.y,c+=i,l+=a,n=d(o),o=A(n)}}return ie({width:u,height:f,x:c,y:l})}function we(e,t){const n=S(e).scrollLeft;return t?t.left+n:ge(f(e)).left+n}function ye(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-we(e,n),y:n.top+t.scrollTop}}const xe=new Set(["absolute","fixed"]);function be(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=d(e),r=f(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const e=T();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=we(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else l<=25&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=f(e),n=S(e),r=e.ownerDocument.body,o=F(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=F(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+we(e);const s=-n.scrollTop;return"rtl"===P(r).direction&&(a+=F(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(f(e));else if(m(t))r=function(e,t){const n=ge(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=h(e)?me(e):W(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ve(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ie(r)}function Ce(e,t){const n=D(e);return!(n===t||!m(n)||_(n))&&("fixed"===P(n).position||Ce(n,t))}function Re(e,t,n){const r=h(t),o=f(t),i="fixed"===n,a=ge(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=W(0);function l(){c.x=we(o)}if(r||!r&&!i)if(("body"!==u(t)||g(o))&&(s=S(t)),r){const e=ge(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const d=!o||r||i?W(0):ye(o,s);return{x:a.left+s.scrollLeft-c.x-d.x,y:a.top+s.scrollTop-c.y-d.y,width:a.width,height:a.height}}function Ee(e){return"static"===P(e).position}function Te(e,t){if(!h(e)||"fixed"===P(e).position)return null;if(t)return t(e);let n=e.offsetParent;return f(e)===n&&(n=n.ownerDocument.body),n}function _e(e,t){const n=d(e);if(y(e))return n;if(!h(e)){let t=D(e);for(;t&&!_(t);){if(m(t)&&!Ee(t))return t;t=D(t)}return n}let r=Te(e,t);for(;r&&w(r)&&Ee(r);)r=Te(r,t);return r&&_(r)&&Ee(r)&&!E(r)?n:r||function(e){let t=D(e);for(;h(t)&&!_(t);){if(E(t))return t;if(y(t))return null;t=D(t)}return null}(e)||n}const Pe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=f(r),s=!!t&&y(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=W(1);const d=W(0),p=h(r);if((p||!p&&!i)&&(("body"!==u(r)||g(a))&&(c=S(r)),h(r))){const e=ge(r);l=me(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const m=!a||p||i?W(0):ye(a,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+m.x,y:n.y*l.y-c.scrollTop*l.y+d.y+m.y}},getDocumentElement:f,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?y(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=M(e,[],!1).filter(e=>m(e)&&"body"!==u(e)),o=null;const i="fixed"===P(e).position;let a=i?D(e):e;for(;m(a)&&!_(a);){const t=P(a),n=E(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&xe.has(o.position)||g(a)&&!n&&Ce(e,a))?r=r.filter(e=>e!==a):o=t,a=D(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=be(t,n,o);return e.top=F(r.top,e.top),e.right=k(r.right,e.right),e.bottom=k(r.bottom,e.bottom),e.left=F(r.left,e.left),e},be(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:_e,getElementRects:async function(e){const t=this.getOffsetParent||_e,n=this.getDimensions,r=await n(e.floating);return{reference:Re(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=fe(e);return{width:t,height:n}},getScale:me,isElement:m,isRTL:function(e){return"rtl"===P(e).direction}};function Se(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function De(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=pe(e),u=o||i?[...l?M(l):[],...M(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=l&&s?function(e,t){let n,r=null;const o=f(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;const m={rootMargin:-U(d)+"px "+-U(o.clientWidth-(u+f))+"px "+-U(o.clientHeight-(d+p))+"px "+-U(u)+"px",threshold:F(0,k(1,c))||1};let h=!0;function v(t){const r=t[0].intersectionRatio;if(r!==c){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||Se(l,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(v,{...m,root:o.ownerDocument})}catch(g){r=new IntersectionObserver(v,m)}r.observe(e)}(!0),i}(l,n):null;let p,m=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let v=c?ge(e):null;return c&&function t(){const r=ge(e);v&&!Se(v,r)&&n();v=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Ne=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=$(n),s=V(n),c="y"===G(n),l=de.has(a)?-1:1,u=i&&c?-1:1,d=B(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},Me=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:a,placement:s,platform:c,elements:l}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=I,autoAlignment:p=!0,...m}=B(e,t),h=void 0!==d||f===I?function(e,t,n){return(e?[...n.filter(t=>V(t)===e),...n.filter(t=>V(t)!==e)]:n.filter(e=>$(e)===e)).filter(n=>!e||V(n)===e||!!t&&Z(n)!==n)}(d||null,p,f):f,v=await c.detectOverflow(t,m),g=(null==(n=a.autoPlacement)?void 0:n.index)||0,w=h[g];if(null==w)return{};const y=q(w,i,await(null==c.isRTL?void 0:c.isRTL(l.floating)));if(s!==w)return{reset:{placement:h[0]}};const x=[v[$(w)],v[y[0]],v[y[1]]],b=[...(null==(r=a.autoPlacement)?void 0:r.overflows)||[],{placement:w,overflows:x}],C=h[g+1];if(C)return{data:{index:g+1,overflows:b},reset:{placement:C}};const R=b.map(e=>{const t=V(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),E=(null==(o=R.filter(e=>e[2].slice(0,V(e[0])?2:3).every(e=>e<=0))[0])?void 0:o[0])||R[0][0];return E!==s?{data:{index:g+1,overflows:b},reset:{placement:E}}:{}}}},Ae=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=B(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),f=G($(o)),p=z(f);let m=u[p],h=u[f];if(a){const e="y"===p?"bottom":"right";m=K(m+d["y"===p?"top":"left"],m,m-d[e])}if(s){const e="y"===f?"bottom":"right";h=K(h+d["y"===f?"top":"left"],h,h-d[e])}const v=c.fn({...t,[p]:m,[f]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:a,[f]:s}}}}}},Oe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=B(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=$(o),w=G(s),y=$(s)===s,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),b=f||(y||!h?[re(s)]:function(e){const t=re(e);return[Z(e),t,Z(t)]}(s)),C="none"!==m;!f&&C&&b.push(...ne(s,h,m,x));const R=[s,...b],E=await c.detectOverflow(t,v),T=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&T.push(E[g]),d){const e=q(o,a,x);T.push(E[e[0]],E[e[1]])}if(_=[..._,{placement:o,overflows:T}],!T.every(e=>e<=0)){var P,S;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=R[e];if(t){if(!("alignment"===d&&w!==G(t))||_.every(e=>G(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:_},reset:{placement:t}}}let n=null==(S=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!n)switch(p){case"bestFit":{var D;const e=null==(D=_.filter(e=>{if(C){const t=G(e.placement);return t===w||"y"===t}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])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},je=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...l}=B(e,t),u=await a.detectOverflow(t,l),d=$(o),f=V(o),p="y"===G(o),{width:m,height:h}=i.floating;let v,g;"top"===d||"bottom"===d?(v=d,g=f===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,v="end"===f?"top":"bottom");const w=h-u.top-u.bottom,y=m-u.left-u.right,x=k(h-u[v],w),b=k(m-u[g],y),C=!t.middlewareData.shift;let R=x,E=b;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(E=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(R=w),C&&!f){const e=F(u.left,0),t=F(u.right,0),n=F(u.top,0),r=F(u.bottom,0);p?E=m-2*(0!==e||0!==t?e+t:F(u.left,u.right)):R=h-2*(0!==n||0!==r?n+r:F(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:R});const T=await a.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}},Ie=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=B(e,t);switch(o){case"referenceHidden":{const e=ce(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:le(e)}}}case"escaped":{const e=ce(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:le(e)}}}default:return{}}}}},ke=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=B(e,t)||{};if(null==l)return{};const d=oe(u),f={x:n,y:r},p=Y(o),m=X(p),h=await a.getDimensions(l),v="y"===p,g=v?"top":"left",w=v?"bottom":"right",y=v?"clientHeight":"clientWidth",x=i.reference[m]+i.reference[p]-f[p]-i.floating[m],b=f[p]-i.reference[p],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let R=C?C[y]:0;R&&await(null==a.isElement?void 0:a.isElement(C))||(R=s.floating[y]||i.floating[m]);const E=x/2-b/2,T=R/2-h[m]/2-1,_=k(d[g],T),P=k(d[w],T),S=_,D=R-h[m]-P,N=R/2-h[m]/2+E,M=K(S,N,D),A=!c.arrow&&null!=V(o)&&N!==M&&i.reference[m]/2-(N<S?_:P)-h[m]/2<0,O=A?N<S?N-S:N-D:0;return{[p]:f[p]+O,data:{[p]:M,centerOffset:N-M-O,...A&&{alignmentOffset:O}},reset:A}}}),Fe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:s=2,x:c,y:l}=B(e,t),u=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),d=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let r=null;for(let o=0;o<t.length;o++){const e=t[o];!r||e.y-r.y>r.height/2?n.push([e]):n[n.length-1].push(e),r=e}return n.map(e=>ie(ue(e)))}(u),f=ie(ue(u)),p=oe(s);const m=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=c&&null!=l)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if("y"===G(n)){const e=d[0],t=d[d.length-1],r="top"===$(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===$(n),t=F(...d.map(e=>e.right)),r=k(...d.map(e=>e.left)),o=d.filter(n=>e?n.left===r:n.right===t),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return f}},floating:r.floating,strategy:a});return o.reference.x!==m.reference.x||o.reference.y!==m.reference.y||o.reference.width!==m.reference.width||o.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},Le=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=B(e,t),u={x:n,y:r},d=G(o),f=z(d);let p=u[f],m=u[d];const h=B(s,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+v.mainAxis,n=i.reference[f]+i.reference[e]-v.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){var g,w;const e="y"===f?"width":"height",t=de.has($(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=a.offset)?void 0:g[d])||0)+(t?0:v.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(w=a.offset)?void 0:w[d])||0)-(t?v.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ue=(e,t,n)=>{const r=new Map,o={platform:Pe,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ae(l,r,c),f=r,p={},m=0;for(let v=0;v<s.length;v++){var h;const{name:n,fn:i}=s[v],{x:g,y:w,data:y,reset:x}=await i({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:l,platform:{...a,detectOverflow:null!=(h=a.detectOverflow)?h:se},elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=w?w:d,p={...p,[n]:{...p[n],...y}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(l=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=ae(l,f,c))),v=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var We="undefined"!=typeof document?e.useLayoutEffect:function(){};function He(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!He(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!He(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ke(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Be(e,t){const n=Ke(e);return Math.round(t*n)/n}function $e(t){const n=e.useRef(t);return We(()=>{n.current=t}),n}function Ve(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=t,[d,f]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,m]=e.useState(o);He(p,o)||m(o);const[h,v]=e.useState(null),[g,w]=e.useState(null),y=e.useCallback(e=>{e!==R.current&&(R.current=e,v(e))},[]),x=e.useCallback(e=>{e!==E.current&&(E.current=e,w(e))},[]),b=a||h,C=s||g,R=e.useRef(null),E=e.useRef(null),T=e.useRef(d),_=null!=l,P=$e(l),S=$e(i),D=$e(u),N=e.useCallback(()=>{if(!R.current||!E.current)return;const e={placement:n,strategy:r,middleware:p};S.current&&(e.platform=S.current),Ue(R.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};M.current&&!He(T.current,t)&&(T.current=t,f(t))})},[p,n,r,S,D]);We(()=>{!1===u&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const M=e.useRef(!1);We(()=>(M.current=!0,()=>{M.current=!1}),[]),We(()=>{if(b&&(R.current=b),C&&(E.current=C),b&&C){if(P.current)return P.current(b,C,N);N()}},[b,C,N,P,_]);const A=e.useMemo(()=>({reference:R,floating:E,setReference:y,setFloating:x}),[y,x]),O=e.useMemo(()=>({reference:b,floating:C}),[b,C]),j=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!O.floating)return e;const t=Be(O.floating,d.x),n=Be(O.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Ke(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,O.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:N,refs:A,elements:O,floatingStyles:j}),[d,N,A,O,j])}const ze=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?ke({element:n.current,padding:r}).fn(t):{}:n?ke({element:n,padding:r}).fn(t):{};var o}}),Xe=(e,t)=>({...Ne(e),options:[e,t]}),Ge=(e,t)=>({...Ae(e),options:[e,t]}),Ye=(e,t)=>({...Le(e),options:[e,t]}),qe=(e,t)=>({...Oe(e),options:[e,t]}),Ze=(e,t)=>({...je(e),options:[e,t]}),Je=(e,t)=>({...Ie(e),options:[e,t]}),Qe=(e,t)=>({...ze(e),options:[e,t]});function et(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function tt(...e){return t=>{let n=!1;const r=e.map(e=>{const r=et(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():et(e[t],null)}}}}function nt(...t){return e.useCallback(tt(...t),t)}function rt(n){const r=ot(n),o=e.forwardRef((n,o)=>{const{children:i,...a}=n,s=e.Children.toArray(i),c=s.find(st);if(c){const n=c.props.children,i=s.map(t=>t===c?e.Children.count(n)>1?e.Children.only(null):e.isValidElement(n)?n.props.children:null:t);return t.jsx(r,{...a,ref:o,children:e.isValidElement(n)?e.cloneElement(n,void 0,i):null})}return t.jsx(r,{...a,ref:o,children:i})});return o.displayName=`${n}.Slot`,o}function ot(t){const n=e.forwardRef((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==e.Fragment&&(i.ref=n?tt(n,t):t),e.cloneElement(r,i)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var it=Symbol("radix.slottable");function at(e){const n=({children:e})=>t.jsx(t.Fragment,{children:e});return n.displayName=`${e}.Slottable`,n.__radixId=it,n}function st(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===it}var ct=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((n,r)=>{const o=rt(`Primitive.${r}`),i=e.forwardRef((e,n)=>{const{asChild:i,...a}=e,s=i?o:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...a,ref:n})});return i.displayName=`Primitive.${r}`,{...n,[r]:i}},{});function lt(e,t){e&&e.dispatchEvent(t)}var ut=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dt=e.forwardRef((e,n)=>t.jsx(ct.span,{...e,ref:n,style:{...ut,...e.style}}));dt.displayName="VisuallyHidden";var ft=dt;function pt(n,r){const o=e.createContext(r),i=n=>{const{children:r,...i}=n,a=e.useMemo(()=>i,Object.values(i));return t.jsx(o.Provider,{value:a,children:r})};return i.displayName=n+"Provider",[i,function(t){const i=e.useContext(o);if(i)return i;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]}function mt(n,r=[]){let o=[];const i=()=>{const t=o.map(t=>e.createContext(t));return function(r){const o=r?.[n]||t;return e.useMemo(()=>({[`__scope${n}`]:{...r,[n]:o}}),[r,o])}};return i.scopeName=n,[function(r,i){const a=e.createContext(i),s=o.length;o=[...o,i];const c=r=>{const{scope:o,children:i,...c}=r,l=o?.[n]?.[s]||a,u=e.useMemo(()=>c,Object.values(c));return t.jsx(l.Provider,{value:u,children:i})};return c.displayName=r+"Provider",[c,function(t,o){const c=o?.[n]?.[s]||a,l=e.useContext(c);if(l)return l;if(void 0!==i)return i;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},ht(i,...r)]}function ht(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=r.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}function vt(e){const r=e+"CollectionProvider",[o,i]=mt(r),[a,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),c=e=>{const{scope:r,children:o}=e,i=n.useRef(null),s=n.useRef(new Map).current;return t.jsx(a,{scope:r,itemMap:s,collectionRef:i,children:o})};c.displayName=r;const l=e+"CollectionSlot",u=rt(l),d=n.forwardRef((e,n)=>{const{scope:r,children:o}=e,i=nt(n,s(l,r).collectionRef);return t.jsx(u,{ref:i,children:o})});d.displayName=l;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(f),h=n.forwardRef((e,r)=>{const{scope:o,children:i,...a}=e,c=n.useRef(null),l=nt(r,c),u=s(f,o);return n.useEffect(()=>(u.itemMap.set(c,{ref:c,...a}),()=>{u.itemMap.delete(c)})),t.jsx(m,{[p]:"",ref:l,children:i})});return h.displayName=f,[{Provider:c,Slot:d,ItemSlot:h},function(t){const r=s(e+"CollectionConsumer",t);return n.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},i]}var gt=globalThis?.document?e.useLayoutEffect:()=>{},wt=r[" useInsertionEffect ".trim().toString()]||gt;function yt({prop:t,defaultProp:n,onChange:r=()=>{},caller:o}){const[i,a,s]=function({defaultProp:t,onChange:n}){const[r,o]=e.useState(t),i=e.useRef(r),a=e.useRef(n);return wt(()=>{a.current=n},[n]),e.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,o,a]}({defaultProp:n,onChange:r}),c=void 0!==t,l=c?t:i;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==c){const t=e?"controlled":"uncontrolled",n=c?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=c},[c,o])}const u=e.useCallback(e=>{if(c){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&s.current?.(n)}else a(e)},[c,t,a,s]);return[l,u]}function xt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var bt=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Ct(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=Ct(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=Ct(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=Ct(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function Ct(e){return e?.animationName||"none"}bt.displayName="Presence";var Rt=r[" useId ".trim().toString()]||(()=>{}),Et=0;function Tt(t){const[n,r]=e.useState(Rt());return gt(()=>{r(e=>e??String(Et++))},[t]),n?`radix-${n}`:""}var _t="Collapsible",[Pt,St]=mt(_t),[Dt,Nt]=Pt(_t),Mt=e.forwardRef((n,r)=>{const{__scopeCollapsible:o,open:i,defaultOpen:a,disabled:s,onOpenChange:c,...l}=n,[u,d]=yt({prop:i,defaultProp:a??!1,onChange:c,caller:_t});return t.jsx(Dt,{scope:o,disabled:s,contentId:Tt(),open:u,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),children:t.jsx(ct.div,{"data-state":Ft(u),"data-disabled":s?"":void 0,...l,ref:r})})});Mt.displayName=_t;var At="CollapsibleTrigger",Ot=e.forwardRef((e,n)=>{const{__scopeCollapsible:r,...o}=e,i=Nt(At,r);return t.jsx(ct.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ft(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...o,ref:n,onClick:xt(e.onClick,i.onOpenToggle)})});Ot.displayName=At;var jt="CollapsibleContent",It=e.forwardRef((e,n)=>{const{forceMount:r,...o}=e,i=Nt(jt,e.__scopeCollapsible);return t.jsx(bt,{present:r||i.open,children:({present:e})=>t.jsx(kt,{...o,ref:n,present:e})})});It.displayName=jt;var kt=e.forwardRef((n,r)=>{const{__scopeCollapsible:o,present:i,children:a,...s}=n,c=Nt(jt,o),[l,u]=e.useState(i),d=e.useRef(null),f=nt(r,d),p=e.useRef(0),m=p.current,h=e.useRef(0),v=h.current,g=c.open||l,w=e.useRef(g),y=e.useRef(void 0);return e.useEffect(()=>{const e=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(e)},[]),gt(()=>{const e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();p.current=t.height,h.current=t.width,w.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(i)}},[c.open,i]),t.jsx(ct.div,{"data-state":Ft(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!g,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...n.style},children:g&&a})});function Ft(e){return e?"open":"closed"}var Lt=Mt,Ut=Ot,Wt=It,Ht=e.createContext(void 0);function Kt(t){const n=e.useContext(Ht);return t||n||"ltr"}var Bt="Accordion",$t=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Vt,zt,Xt]=vt(Bt),[Gt]=mt(Bt,[Xt,St]),Yt=St(),qt=n.forwardRef((e,n)=>{const{type:r,...o}=e,i=o,a=o;return t.jsx(Vt.Provider,{scope:e.__scopeAccordion,children:"multiple"===r?t.jsx(nn,{...a,ref:n}):t.jsx(tn,{...i,ref:n})})});qt.displayName=Bt;var[Zt,Jt]=Gt(Bt),[Qt,en]=Gt(Bt,{collapsible:!1}),tn=n.forwardRef((e,r)=>{const{value:o,defaultValue:i,onValueChange:a=()=>{},collapsible:s=!1,...c}=e,[l,u]=yt({prop:o,defaultProp:i??"",onChange:a,caller:Bt});return t.jsx(Zt,{scope:e.__scopeAccordion,value:n.useMemo(()=>l?[l]:[],[l]),onItemOpen:u,onItemClose:n.useCallback(()=>s&&u(""),[s,u]),children:t.jsx(Qt,{scope:e.__scopeAccordion,collapsible:s,children:t.jsx(an,{...c,ref:r})})})}),nn=n.forwardRef((e,r)=>{const{value:o,defaultValue:i,onValueChange:a=()=>{},...s}=e,[c,l]=yt({prop:o,defaultProp:i??[],onChange:a,caller:Bt}),u=n.useCallback(e=>l((t=[])=>[...t,e]),[l]),d=n.useCallback(e=>l((t=[])=>t.filter(t=>t!==e)),[l]);return t.jsx(Zt,{scope:e.__scopeAccordion,value:c,onItemOpen:u,onItemClose:d,children:t.jsx(Qt,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx(an,{...s,ref:r})})})}),[rn,on]=Gt(Bt),an=n.forwardRef((e,r)=>{const{__scopeAccordion:o,disabled:i,dir:a,orientation:s="vertical",...c}=e,l=nt(n.useRef(null),r),u=zt(o),d="ltr"===Kt(a),f=function(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}(e.onKeyDown,e=>{if(!$t.includes(e.key))return;const t=e.target,n=u().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),o=n.length;if(-1===r)return;e.preventDefault();let i=r;const a=o-1,c=()=>{i=r+1,i>a&&(i=0)},l=()=>{i=r-1,i<0&&(i=a)};switch(e.key){case"Home":i=0;break;case"End":i=a;break;case"ArrowRight":"horizontal"===s&&(d?c():l());break;case"ArrowDown":"vertical"===s&&c();break;case"ArrowLeft":"horizontal"===s&&(d?l():c());break;case"ArrowUp":"vertical"===s&&l()}const f=i%o;n[f].ref.current?.focus()});return t.jsx(rn,{scope:o,disabled:i,direction:a,orientation:s,children:t.jsx(Vt.Slot,{scope:o,children:t.jsx(ct.div,{...c,"data-orientation":s,ref:l,onKeyDown:i?void 0:f})})})}),sn="AccordionItem",[cn,ln]=Gt(sn),un=n.forwardRef((e,n)=>{const{__scopeAccordion:r,value:o,...i}=e,a=on(sn,r),s=Jt(sn,r),c=Yt(r),l=Tt(),u=o&&s.value.includes(o)||!1,d=a.disabled||e.disabled;return t.jsx(cn,{scope:r,open:u,disabled:d,triggerId:l,children:t.jsx(Lt,{"data-orientation":a.orientation,"data-state":gn(u),...c,...i,ref:n,disabled:d,open:u,onOpenChange:e=>{e?s.onItemOpen(o):s.onItemClose(o)}})})});un.displayName=sn;var dn="AccordionHeader",fn=n.forwardRef((e,n)=>{const{__scopeAccordion:r,...o}=e,i=on(Bt,r),a=ln(dn,r);return t.jsx(ct.h3,{"data-orientation":i.orientation,"data-state":gn(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:n})});fn.displayName=dn;var pn="AccordionTrigger",mn=n.forwardRef((e,n)=>{const{__scopeAccordion:r,...o}=e,i=on(Bt,r),a=ln(pn,r),s=en(pn,r),c=Yt(r);return t.jsx(Vt.ItemSlot,{scope:r,children:t.jsx(Ut,{"aria-disabled":a.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...c,...o,ref:n})})});mn.displayName=pn;var hn="AccordionContent",vn=n.forwardRef((e,n)=>{const{__scopeAccordion:r,...o}=e,i=on(Bt,r),a=ln(hn,r),s=Yt(r);return t.jsx(Wt,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...s,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function gn(e){return e?"open":"closed"}vn.displayName=hn;var wn=qt,yn=un,xn=fn,bn=mn,Cn=vn;function Rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function En(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var Tn,_n="dismissableLayer.update",Pn="dismissableLayer.pointerDownOutside",Sn="dismissableLayer.focusOutside",Dn=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Nn=e.forwardRef((n,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=n,d=e.useContext(Dn),[f,p]=e.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=e.useState({}),v=nt(r,e=>p(e)),g=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(w),x=f?g.indexOf(f):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,C=x>=y,R=function(t,n=globalThis?.document){const r=En(t),o=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){On(Pn,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));C&&!n&&(a?.(e),c?.(e),e.defaultPrevented||l?.())},m),E=function(t,n=globalThis?.document){const r=En(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){On(Sn,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m);return function(t,n=globalThis?.document){const r=En(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{x===d.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},m),e.useEffect(()=>{if(f)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Tn=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),An(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(m.body.style.pointerEvents=Tn)}},[f,m,o,d]),e.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),An())},[f,d]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(_n,e),()=>document.removeEventListener(_n,e)},[]),t.jsx(ct.div,{...u,ref:v,style:{pointerEvents:b?C?"auto":"none":void 0,...n.style},onFocusCapture:Rn(n.onFocusCapture,E.onFocusCapture),onBlurCapture:Rn(n.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Rn(n.onPointerDownCapture,R.onPointerDownCapture)})});Nn.displayName="DismissableLayer";var Mn=e.forwardRef((n,r)=>{const o=e.useContext(Dn),i=e.useRef(null),a=nt(r,i);return e.useEffect(()=>{const e=i.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t.jsx(ct.div,{...n,ref:a})});function An(){const e=new CustomEvent(_n);document.dispatchEvent(e)}function On(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?lt(o,i):o.dispatchEvent(i)}Mn.displayName="DismissableLayerBranch";var jn=Nn,In=Mn,kn="focusScope.autoFocusOnMount",Fn="focusScope.autoFocusOnUnmount",Ln={bubbles:!1,cancelable:!0},Un=e.forwardRef((n,r)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=n,[l,u]=e.useState(null),d=En(a),f=En(s),p=e.useRef(null),m=nt(r,e=>u(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(i){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:Bn(p.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Bn(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Bn(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[i,l,h.paused]),e.useEffect(()=>{if(l){$n.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(kn,Ln);l.addEventListener(kn,d),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bn(r,{select:t}),document.activeElement!==n)return}((e=Wn(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Bn(l))}return()=>{l.removeEventListener(kn,d),setTimeout(()=>{const e=new CustomEvent(Fn,Ln);l.addEventListener(Fn,f),l.dispatchEvent(e),e.defaultPrevented||Bn(t??document.body,{select:!0}),l.removeEventListener(Fn,f),$n.remove(h)},0)}}var e},[l,d,f,h]);const v=e.useCallback(e=>{if(!o&&!i)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,i]=function(e){const t=Wn(e),n=Hn(t,e),r=Hn(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||n!==i?e.shiftKey&&n===r&&(e.preventDefault(),o&&Bn(i,{select:!0})):(e.preventDefault(),o&&Bn(r,{select:!0})):n===t&&e.preventDefault()}},[o,i,h.paused]);return t.jsx(ct.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})});function Wn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Hn(e,t){for(const n of e)if(!Kn(n,{upTo:t}))return n}function Kn(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Bn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Un.displayName="FocusScope";var $n=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Vn(e,t),e.unshift(t)},remove(t){e=Vn(e,t),e[0]?.resume()}}}();function Vn(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var zn=Un,Xn=e.forwardRef((n,r)=>{const{container:i,...a}=n,[s,c]=e.useState(!1);gt(()=>c(!0),[]);const l=i||s&&globalThis?.document?.body;return l?o.createPortal(t.jsx(ct.div,{...a,ref:r}),l):null});Xn.displayName="Portal";var Gn=0;function Yn(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qn()),document.body.insertAdjacentElement("beforeend",e[1]??qn()),Gn++,()=>{1===Gn&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Gn--}},[])}function qn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zn="right-scroll-bar-position",Jn="width-before-scroll-bar";function Qn(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var er="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,tr=new WeakMap;function nr(t,n){var r,o,i,a=(r=null,o=function(e){return t.forEach(function(t){return Qn(t,e)})},(i=e.useState(function(){return{value:r,callback:o,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}})[0]).callback=o,i.facade);return er(function(){var e=tr.get(a);if(e){var n=new Set(e),r=new Set(t),o=a.current;n.forEach(function(e){r.has(e)||Qn(e,null)}),r.forEach(function(e){n.has(e)||Qn(e,o)})}tr.set(a,t)},[t]),a}function rr(e){return e}var or=function(t){var n=t.sideCar,r=s(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,a({},r))};or.isSideCarExport=!0;var ir=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=rr);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=a({async:!0,ssr:!1},e),t}(),ar=function(){},sr=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:ar,onWheelCapture:ar,onTouchMoveCapture:ar}),i=o[0],c=o[1],l=t.forwardProps,u=t.children,d=t.className,f=t.removeScrollBar,p=t.enabled,m=t.shards,h=t.sideCar,v=t.noRelative,g=t.noIsolation,w=t.inert,y=t.allowPinchZoom,x=t.as,b=void 0===x?"div":x,C=t.gapMode,R=s(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,T=nr([r,n]),_=a(a({},R),i);return e.createElement(e.Fragment,null,p&&e.createElement(E,{sideCar:ir,removeScrollBar:f,shards:m,noRelative:v,noIsolation:g,inert:w,setCallbacks:c,allowPinchZoom:!!y,lockRef:r,gapMode:C}),l?e.cloneElement(e.Children.only(u),a(a({},_),{ref:T})):e.createElement(b,a({},_,{className:d,ref:T}),u))});sr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sr.classNames={fullWidth:Jn,zeroRight:Zn};function cr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var lr=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=cr())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ur=function(){var t,n=(t=lr(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},dr={left:0,top:0,right:0,gap:0},fr=function(e){return parseInt(e||"",10)||0},pr=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return dr;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[fr(n),fr(r),fr(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},mr=ur(),hr="data-scroll-locked",vr=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n  .".concat("with-scroll-bars-hidden"," {\n   overflow: hidden ").concat(r,";\n   padding-right: ").concat(s,"px ").concat(r,";\n  }\n  body[").concat(hr,"] {\n    overflow: hidden ").concat(r,";\n    overscroll-behavior: contain;\n    ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n    padding-left: ".concat(o,"px;\n    padding-top: ").concat(i,"px;\n    padding-right: ").concat(a,"px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(s,"px ").concat(r,";\n    "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n  }\n  \n  .").concat(Zn," {\n    right: ").concat(s,"px ").concat(r,";\n  }\n  \n  .").concat(Jn," {\n    margin-right: ").concat(s,"px ").concat(r,";\n  }\n  \n  .").concat(Zn," .").concat(Zn," {\n    right: 0 ").concat(r,";\n  }\n  \n  .").concat(Jn," .").concat(Jn," {\n    margin-right: 0 ").concat(r,";\n  }\n  \n  body[").concat(hr,"] {\n    ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n  }\n")},gr=function(){var e=parseInt(document.body.getAttribute(hr)||"0",10);return isFinite(e)?e:0},wr=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,i=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(hr,(gr()+1).toString()),function(){var e=gr()-1;e<=0?document.body.removeAttribute(hr):document.body.setAttribute(hr,e.toString())}},[]);var a=e.useMemo(function(){return pr(i)},[i]);return e.createElement(mr,{styles:vr(a,!n,i,r?"":"!important")})},yr=!1;if("undefined"!=typeof window)try{var xr=Object.defineProperty({},"passive",{get:function(){return yr=!0,!0}});window.addEventListener("test",xr,xr),window.removeEventListener("test",xr,xr)}catch(xh){yr=!1}var br=!!yr&&{passive:!1},Cr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Rr=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Er(e,r)){var o=Tr(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Er=function(e,t){return"v"===e?function(e){return Cr(e,"overflowY")}(t):function(e){return Cr(e,"overflowX")}(t)},Tr=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},_r=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pr=function(e){return[e.deltaX,e.deltaY]},Sr=function(e){return e&&"current"in e?e.current:e},Dr=function(e){return"\n  .block-interactivity-".concat(e," {pointer-events: none;}\n  .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Nr=0,Mr=[];function Ar(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Or=(jr=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(Nr++)[0],a=e.useState(ur)[0],s=e.useRef(t);e.useEffect(function(){s.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var e=c([t.lockRef.current],(t.shards||[]).map(Sr),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,i=_r(e),a=r.current,c="deltaX"in e?e.deltaX:a[0]-i[0],l="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Rr(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=Rr(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(c||l)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,s=t.contains(a),c=!1,l=i>0,u=0,d=0;do{if(!a)break;var f=Tr(e,a),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&Er(e,a)&&(u+=m,d+=p);var h=a.parentNode;a=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!s&&a!==document.body||s&&(t.contains(a)||t===a));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(p,t,e,"h"===p?c:l)},[]),u=e.useCallback(function(e){var t=e;if(Mr.length&&Mr[Mr.length-1]===a){var r="deltaY"in t?Pr(t):_r(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(s.current.shards||[]).map(Sr).filter(Boolean).filter(function(e){return e.contains(t.target)});(i.length>0?l(t,i[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),d=e.useCallback(function(e,t,r,o){var i={name:e,delta:t,target:r,should:o,shadowParent:Ar(r)};n.current.push(i),setTimeout(function(){n.current=n.current.filter(function(e){return e!==i})},1)},[]),f=e.useCallback(function(e){r.current=_r(e),o.current=void 0},[]),p=e.useCallback(function(e){d(e.type,Pr(e),e.target,l(e,t.lockRef.current))},[]),m=e.useCallback(function(e){d(e.type,_r(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return Mr.push(a),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,br),document.addEventListener("touchmove",u,br),document.addEventListener("touchstart",f,br),function(){Mr=Mr.filter(function(e){return e!==a}),document.removeEventListener("wheel",u,br),document.removeEventListener("touchmove",u,br),document.removeEventListener("touchstart",f,br)}},[]);var h=t.removeScrollBar,v=t.inert;return e.createElement(e.Fragment,null,v?e.createElement(a,{styles:Dr(i)}):null,h?e.createElement(wr,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},ir.useMedium(jr),or);var jr,Ir=e.forwardRef(function(t,n){return e.createElement(sr,a({},t,{ref:n,sideCar:Or}))});Ir.classNames=sr.classNames;var kr=new WeakMap,Fr=new WeakMap,Lr={},Ur=0,Wr=function(e){return e&&(e.host||Wr(e.parentNode))},Hr=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Wr(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Lr[n]||(Lr[n]=new WeakMap);var i=Lr[n],a=[],s=new Set,c=new Set(o),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};o.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,c=(kr.get(e)||0)+1,l=(i.get(e)||0)+1;kr.set(e,c),i.set(e,l),a.push(e),1===c&&o&&Fr.set(e,!0),1===l&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",e,d)}})};return u(t),s.clear(),Ur++,function(){a.forEach(function(e){var t=kr.get(e)-1,o=i.get(e)-1;kr.set(e,t),i.set(e,o),t||(Fr.has(e)||e.removeAttribute(r),Fr.delete(e)),o||e.removeAttribute(n)}),--Ur||(kr=new WeakMap,kr=new WeakMap,Fr=new WeakMap,Lr={})}},Kr=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Hr(r,o,n,"aria-hidden")):function(){return null}};function Br(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}function $r(t){const[n,r]=e.useState(void 0);return gt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}function Vr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function zr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var Xr=e.forwardRef((e,n)=>{const{children:r,width:o=10,height:i=5,...a}=e;return t.jsx(ct.svg,{...a,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xr.displayName="Arrow";var Gr=Xr,Yr="Popper",[qr,Zr]=mt(Yr),[Jr,Qr]=qr(Yr),eo=n=>{const{__scopePopper:r,children:o}=n,[i,a]=e.useState(null);return t.jsx(Jr,{scope:r,anchor:i,onAnchorChange:a,children:o})};eo.displayName=Yr;var to="PopperAnchor",no=e.forwardRef((n,r)=>{const{__scopePopper:o,virtualRef:i,...a}=n,s=Qr(to,o),c=e.useRef(null),l=nt(r,c);return e.useEffect(()=>{s.onAnchorChange(i?.current||c.current)}),i?null:t.jsx(ct.div,{...a,ref:l})});no.displayName=to;var ro="PopperContent",[oo,io]=qr(ro),ao=e.forwardRef((n,r)=>{const{__scopePopper:o,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=n,w=Qr(ro,o),[y,x]=e.useState(null),b=nt(r,e=>x(e)),[C,R]=e.useState(null),E=$r(C),T=E?.width??0,_=E?.height??0,P=i+("center"!==s?"-"+s:""),S="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(d)?d:[d],N=D.length>0,M={padding:S,boundary:D.filter(uo),altBoundary:N},{refs:A,floatingStyles:O,placement:j,isPositioned:I,middlewareData:k}=Ve({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>De(...e,{animationFrame:"always"===h}),elements:{reference:w.anchor},middleware:[Xe({mainAxis:a+_,alignmentAxis:c}),u&&Ge({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?Ye():void 0,...M}),u&&qe({...M}),Ze({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&Qe({element:C,padding:l}),fo({arrowWidth:T,arrowHeight:_}),m&&Je({strategy:"referenceHidden",...M})]}),[F,L]=po(j),U=En(v);gt(()=>{I&&U?.()},[I,U]);const W=k.arrow?.x,H=k.arrow?.y,K=0!==k.arrow?.centerOffset,[B,$]=e.useState();return gt(()=>{y&&$(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:I?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(" "),...k.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:t.jsx(oo,{scope:o,placedSide:F,onArrowChange:R,arrowX:W,arrowY:H,shouldHideArrow:K,children:t.jsx(ct.div,{"data-side":F,"data-align":L,...g,ref:b,style:{...g.style,animation:I?void 0:"none"}})})})});ao.displayName=ro;var so="PopperArrow",co={top:"bottom",right:"left",bottom:"top",left:"right"},lo=e.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=io(so,r),a=co[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(Gr,{...o,ref:n,style:{...o.style,display:"block"}})})});function uo(e){return null!==e}lo.displayName=so;var fo=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[c,l]=po(n),u={start:"0%",center:"50%",end:"100%"}[l],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+s/2;let p="",m="";return"bottom"===c?(p=i?u:`${d}px`,m=-s+"px"):"top"===c?(p=i?u:`${d}px`,m=`${r.floating.height+s}px`):"right"===c?(p=-s+"px",m=i?u:`${f}px`):"left"===c&&(p=`${r.floating.width+s}px`,m=i?u:`${f}px`),{data:{x:p,y:m}}}});function po(e){const[t,n="center"]=e.split("-");return[t,n]}var mo=eo,ho=no,vo=ao,go=lo;var wo=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=yo(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=yo(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=yo(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=yo(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function yo(e){return e?.animationName||"none"}wo.displayName="Presence";var xo="rovingFocusGroup.onEntryFocus",bo={bubbles:!1,cancelable:!0},Co="RovingFocusGroup",[Ro,Eo,To]=vt(Co),[_o,Po]=mt(Co,[To]),[So,Do]=_o(Co),No=e.forwardRef((e,n)=>t.jsx(Ro.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Ro.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Mo,{...e,ref:n})})}));No.displayName=Co;var Mo=e.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:o,orientation:i,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=n,m=e.useRef(null),h=nt(r,m),v=Kt(s),[g,w]=yt({prop:c,defaultProp:l??null,onChange:u,caller:Co}),[y,x]=e.useState(!1),b=En(d),C=Eo(o),R=e.useRef(!1),[E,T]=e.useState(0);return e.useEffect(()=>{const e=m.current;if(e)return e.addEventListener(xo,b),()=>e.removeEventListener(xo,b)},[b]),t.jsx(So,{scope:o,orientation:i,dir:v,loop:a,currentTabStopId:g,onItemFocus:e.useCallback(e=>w(e),[w]),onItemShiftTab:e.useCallback(()=>x(!0),[]),onFocusableItemAdd:e.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>T(e=>e-1),[]),children:t.jsx(ct.div,{tabIndex:y||0===E?-1:0,"data-orientation":i,...p,ref:h,style:{outline:"none",...n.style},onMouseDown:zr(n.onMouseDown,()=>{R.current=!0}),onFocus:zr(n.onFocus,e=>{const t=!R.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(xo,bo);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=C().filter(e=>e.focusable);Io([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),f)}}R.current=!1}),onBlur:zr(n.onBlur,()=>x(!1))})})}),Ao="RovingFocusGroupItem",Oo=e.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:o,focusable:i=!0,active:a=!1,tabStopId:s,children:c,...l}=n,u=Tt(),d=s||u,f=Do(Ao,o),p=f.currentTabStopId===d,m=Eo(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=f;return e.useEffect(()=>{if(i)return h(),()=>v()},[i,h,v]),t.jsx(Ro.ItemSlot,{scope:o,id:d,focusable:i,active:a,children:t.jsx(ct.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:r,onMouseDown:zr(n.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:zr(n.onFocus,()=>f.onItemFocus(d)),onKeyDown:zr(n.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:jo[r]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=f.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>Io(o))}var n,r}),children:"function"==typeof c?c({isCurrentTabStop:p,hasTabStop:null!=g}):c})})});Oo.displayName=Ao;var jo={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Io(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var ko=No,Fo=Oo,Lo=["Enter"," "],Uo=["ArrowUp","PageDown","End"],Wo=["ArrowDown","PageUp","Home",...Uo],Ho={ltr:[...Lo,"ArrowRight"],rtl:[...Lo,"ArrowLeft"]},Ko={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Bo="Menu",[$o,Vo,zo]=vt(Bo),[Xo,Go]=mt(Bo,[zo,Zr,Po]),Yo=Zr(),qo=Po(),[Zo,Jo]=Xo(Bo),[Qo,ei]=Xo(Bo),ti=n=>{const{__scopeMenu:r,open:o=!1,children:i,dir:a,onOpenChange:s,modal:c=!0}=n,l=Yo(r),[u,d]=e.useState(null),f=e.useRef(!1),p=En(s),m=Kt(a);return e.useEffect(()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.jsx(mo,{...l,children:t.jsx(Zo,{scope:r,open:o,onOpenChange:p,content:u,onContentChange:d,children:t.jsx(Qo,{scope:r,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})};ti.displayName=Bo;var ni=e.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e,i=Yo(r);return t.jsx(ho,{...i,...o,ref:n})});ni.displayName="MenuAnchor";var ri="MenuPortal",[oi,ii]=Xo(ri,{forceMount:void 0}),ai=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,a=Jo(ri,n);return t.jsx(oi,{scope:n,forceMount:r,children:t.jsx(wo,{present:r||a.open,children:t.jsx(Xn,{asChild:!0,container:i,children:o})})})};ai.displayName=ri;var si="MenuContent",[ci,li]=Xo(si),ui=e.forwardRef((e,n)=>{const r=ii(si,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,a=Jo(si,e.__scopeMenu),s=ei(si,e.__scopeMenu);return t.jsx($o.Provider,{scope:e.__scopeMenu,children:t.jsx(wo,{present:o||a.open,children:t.jsx($o.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(di,{...i,ref:n}):t.jsx(fi,{...i,ref:n})})})})}),di=e.forwardRef((n,r)=>{const o=Jo(si,n.__scopeMenu),i=e.useRef(null),a=nt(r,i);return e.useEffect(()=>{const e=i.current;if(e)return Kr(e)},[]),t.jsx(mi,{...n,ref:a,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:zr(n.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),fi=e.forwardRef((e,n)=>{const r=Jo(si,e.__scopeMenu);return t.jsx(mi,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),pi=rt("MenuContent.ScrollLock"),mi=e.forwardRef((n,r)=>{const{__scopeMenu:o,loop:i=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:v,...g}=n,w=Jo(si,o),y=ei(si,o),x=Yo(o),b=qo(o),C=Vo(o),[R,E]=e.useState(null),T=e.useRef(null),_=nt(r,T,w.onContentChange),P=e.useRef(0),S=e.useRef(""),D=e.useRef(0),N=e.useRef(null),M=e.useRef("right"),A=e.useRef(0),O=v?Ir:e.Fragment,j=v?{as:pi,allowPinchZoom:!0}:void 0,I=e=>{const t=S.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,o=n.find(e=>e.ref.current===r)?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,c=Math.max(i,0),s.map((e,t)=>s[(c+t)%s.length]));var s,c;1===o.length&&(a=a.filter(e=>e!==n));const l=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}(n.map(e=>e.textValue),t,o),a=n.find(e=>e.textValue===i)?.ref.current;!function e(t){S.current=t,window.clearTimeout(P.current),""!==t&&(P.current=window.setTimeout(()=>e(""),1e3))}(t),a&&setTimeout(()=>a.focus())};e.useEffect(()=>()=>window.clearTimeout(P.current),[]),Yn();const k=e.useCallback(e=>M.current===N.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const e=t[i],s=t[a],c=e.x,l=e.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(o=!o)}return o}(n,t)}(e,N.current?.area),[]);return t.jsx(ci,{scope:o,searchRef:S,onItemEnter:e.useCallback(e=>{k(e)&&e.preventDefault()},[k]),onItemLeave:e.useCallback(e=>{k(e)||(T.current?.focus(),E(null))},[k]),onTriggerLeave:e.useCallback(e=>{k(e)&&e.preventDefault()},[k]),pointerGraceTimerRef:D,onPointerGraceIntentChange:e.useCallback(e=>{N.current=e},[]),children:t.jsx(O,{...j,children:t.jsx(Un,{asChild:!0,trapped:a,onMountAutoFocus:zr(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:t.jsx(Nn,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:t.jsx(ko,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:i,currentTabStopId:R,onCurrentTabStopIdChange:E,onEntryFocus:zr(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(vo,{role:"menu","aria-orientation":"vertical","data-state":Wi(w.open),"data-radix-menu-content":"",dir:y.dir,...x,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:zr(g.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=T.current;if(e.target!==o)return;if(!Wo.includes(e.key))return;e.preventDefault();const i=C().filter(e=>!e.disabled).map(e=>e.ref.current);Uo.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)}),onBlur:zr(n.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(P.current),S.current="")}),onPointerMove:zr(n.onPointerMove,Bi(e=>{const t=e.target,n=A.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>A.current?"right":"left";M.current=t,A.current=e.clientX}}))})})})})})})});ui.displayName=si;var hi=e.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(ct.div,{role:"group",...o,ref:n})});hi.displayName="MenuGroup";var vi=e.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(ct.div,{...o,ref:n})});vi.displayName="MenuLabel";var gi="MenuItem",wi="menu.itemSelect",yi=e.forwardRef((n,r)=>{const{disabled:o=!1,onSelect:i,...a}=n,s=e.useRef(null),c=ei(gi,n.__scopeMenu),l=li(gi,n.__scopeMenu),u=nt(r,s),d=e.useRef(!1);return t.jsx(xi,{...a,ref:u,disabled:o,onClick:zr(n.onClick,()=>{const e=s.current;if(!o&&e){const t=new CustomEvent(wi,{bubbles:!0,cancelable:!0});e.addEventListener(wi,e=>i?.(e),{once:!0}),lt(e,t),t.defaultPrevented?d.current=!1:c.onClose()}}),onPointerDown:e=>{n.onPointerDown?.(e),d.current=!0},onPointerUp:zr(n.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:zr(n.onKeyDown,e=>{const t=""!==l.searchRef.current;o||t&&" "===e.key||Lo.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});yi.displayName=gi;var xi=e.forwardRef((n,r)=>{const{__scopeMenu:o,disabled:i=!1,textValue:a,...s}=n,c=li(gi,o),l=qo(o),u=e.useRef(null),d=nt(r,u),[f,p]=e.useState(!1),[m,h]=e.useState("");return e.useEffect(()=>{const e=u.current;e&&h((e.textContent??"").trim())},[s.children]),t.jsx($o.ItemSlot,{scope:o,disabled:i,textValue:a??m,children:t.jsx(Fo,{asChild:!0,...l,focusable:!i,children:t.jsx(ct.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:d,onPointerMove:zr(n.onPointerMove,Bi(e=>{if(i)c.onItemLeave(e);else if(c.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:zr(n.onPointerLeave,Bi(e=>c.onItemLeave(e))),onFocus:zr(n.onFocus,()=>p(!0)),onBlur:zr(n.onBlur,()=>p(!1))})})})}),bi=e.forwardRef((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(Di,{scope:e.__scopeMenu,checked:r,children:t.jsx(yi,{role:"menuitemcheckbox","aria-checked":Hi(r)?"mixed":r,...i,ref:n,"data-state":Ki(r),onSelect:zr(i.onSelect,()=>o?.(!!Hi(r)||!r),{checkForDefaultPrevented:!1})})})});bi.displayName="MenuCheckboxItem";var Ci="MenuRadioGroup",[Ri,Ei]=Xo(Ci,{value:void 0,onValueChange:()=>{}}),Ti=e.forwardRef((e,n)=>{const{value:r,onValueChange:o,...i}=e,a=En(o);return t.jsx(Ri,{scope:e.__scopeMenu,value:r,onValueChange:a,children:t.jsx(hi,{...i,ref:n})})});Ti.displayName=Ci;var _i="MenuRadioItem",Pi=e.forwardRef((e,n)=>{const{value:r,...o}=e,i=Ei(_i,e.__scopeMenu),a=r===i.value;return t.jsx(Di,{scope:e.__scopeMenu,checked:a,children:t.jsx(yi,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":Ki(a),onSelect:zr(o.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Pi.displayName=_i;var Si="MenuItemIndicator",[Di,Ni]=Xo(Si,{checked:!1}),Mi=e.forwardRef((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,a=Ni(Si,r);return t.jsx(wo,{present:o||Hi(a.checked)||!0===a.checked,children:t.jsx(ct.span,{...i,ref:n,"data-state":Ki(a.checked)})})});Mi.displayName=Si;var Ai=e.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(ct.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});Ai.displayName="MenuSeparator";var Oi=e.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e,i=Yo(r);return t.jsx(go,{...i,...o,ref:n})});Oi.displayName="MenuArrow";var[ji,Ii]=Xo("MenuSub"),ki="MenuSubTrigger",Fi=e.forwardRef((n,r)=>{const o=Jo(ki,n.__scopeMenu),i=ei(ki,n.__scopeMenu),a=Ii(ki,n.__scopeMenu),s=li(ki,n.__scopeMenu),c=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:n.__scopeMenu},f=e.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return e.useEffect(()=>f,[f]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]),t.jsx(ni,{asChild:!0,...d,children:t.jsx(xi,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":a.contentId,"data-state":Wi(o.open),...n,ref:tt(r,a.onTriggerChange),onClick:e=>{n.onClick?.(e),n.disabled||e.defaultPrevented||(e.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:zr(n.onPointerMove,Bi(e=>{s.onItemEnter(e),e.defaultPrevented||n.disabled||o.open||c.current||(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100))})),onPointerLeave:zr(n.onPointerLeave,Bi(e=>{f();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,i=r?-5:5,a=t[r?"left":"right"],c=t[r?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:a,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:a,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:zr(n.onKeyDown,e=>{const t=""!==s.searchRef.current;n.disabled||t&&" "===e.key||Ho[i.dir].includes(e.key)&&(o.onOpenChange(!0),o.content?.focus(),e.preventDefault())})})})});Fi.displayName=ki;var Li="MenuSubContent",Ui=e.forwardRef((n,r)=>{const o=ii(si,n.__scopeMenu),{forceMount:i=o.forceMount,...a}=n,s=Jo(si,n.__scopeMenu),c=ei(si,n.__scopeMenu),l=Ii(Li,n.__scopeMenu),u=e.useRef(null),d=nt(r,u);return t.jsx($o.Provider,{scope:n.__scopeMenu,children:t.jsx(wo,{present:i||s.open,children:t.jsx($o.Slot,{scope:n.__scopeMenu,children:t.jsx(mi,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:"rtl"===c.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:zr(n.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:zr(n.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:zr(n.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=Ko[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});function Wi(e){return e?"open":"closed"}function Hi(e){return"indeterminate"===e}function Ki(e){return Hi(e)?"indeterminate":e?"checked":"unchecked"}function Bi(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ui.displayName=Li;var $i=ti,Vi=ni,zi=ai,Xi=ui,Gi=hi,Yi=vi,qi=yi,Zi=bi,Ji=Ti,Qi=Pi,ea=Mi,ta=Ai,na=Oi,ra=Fi,oa=Ui,ia="ContextMenu",[aa]=mt(ia,[Go]),sa=Go(),[ca,la]=aa(ia),ua=n=>{const{__scopeContextMenu:r,children:o,onOpenChange:i,dir:a,modal:s=!0}=n,[c,l]=e.useState(!1),u=sa(r),d=En(i),f=e.useCallback(e=>{l(e),d(e)},[d]);return t.jsx(ca,{scope:r,open:c,onOpenChange:f,modal:s,children:t.jsx($i,{...u,dir:a,open:c,onOpenChange:f,modal:s,children:o})})};ua.displayName=ia;var da="ContextMenuTrigger",fa=e.forwardRef((n,r)=>{const{__scopeContextMenu:o,disabled:i=!1,...a}=n,s=la(da,o),c=sa(o),l=e.useRef({x:0,y:0}),u=e.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=e.useRef(0),f=e.useCallback(()=>window.clearTimeout(d.current),[]),p=e=>{l.current={x:e.clientX,y:e.clientY},s.onOpenChange(!0)};return e.useEffect(()=>f,[f]),e.useEffect(()=>{i&&f()},[i,f]),t.jsxs(t.Fragment,{children:[t.jsx(Vi,{...c,virtualRef:u}),t.jsx(ct.span,{"data-state":s.open?"open":"closed","data-disabled":i?"":void 0,...a,ref:r,style:{WebkitTouchCallout:"none",...n.style},onContextMenu:i?n.onContextMenu:Vr(n.onContextMenu,e=>{f(),p(e),e.preventDefault()}),onPointerDown:i?n.onPointerDown:Vr(n.onPointerDown,Ra(e=>{f(),d.current=window.setTimeout(()=>p(e),700)})),onPointerMove:i?n.onPointerMove:Vr(n.onPointerMove,Ra(f)),onPointerCancel:i?n.onPointerCancel:Vr(n.onPointerCancel,Ra(f)),onPointerUp:i?n.onPointerUp:Vr(n.onPointerUp,Ra(f))})]})});fa.displayName=da;var pa=e=>{const{__scopeContextMenu:n,...r}=e,o=sa(n);return t.jsx(zi,{...o,...r})};pa.displayName="ContextMenuPortal";var ma="ContextMenuContent",ha=e.forwardRef((n,r)=>{const{__scopeContextMenu:o,...i}=n,a=la(ma,o),s=sa(o),c=e.useRef(!1);return t.jsx(Xi,{...s,...i,ref:r,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:e=>{n.onCloseAutoFocus?.(e),!e.defaultPrevented&&c.current&&e.preventDefault(),c.current=!1},onInteractOutside:e=>{n.onInteractOutside?.(e),e.defaultPrevented||a.modal||(c.current=!0)},style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ha.displayName=ma;e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(Gi,{...i,...o,ref:n})}).displayName="ContextMenuGroup";var va=e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(Yi,{...i,...o,ref:n})});va.displayName="ContextMenuLabel";var ga=e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(qi,{...i,...o,ref:n})});ga.displayName="ContextMenuItem";e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(Zi,{...i,...o,ref:n})}).displayName="ContextMenuCheckboxItem";e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(Ji,{...i,...o,ref:n})}).displayName="ContextMenuRadioGroup";var wa=e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(Qi,{...i,...o,ref:n})});wa.displayName="ContextMenuRadioItem";var ya=e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(ea,{...i,...o,ref:n})});ya.displayName="ContextMenuItemIndicator";var xa=e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(ta,{...i,...o,ref:n})});xa.displayName="ContextMenuSeparator";e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(na,{...i,...o,ref:n})}).displayName="ContextMenuArrow";var ba=e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(ra,{...i,...o,ref:n})});ba.displayName="ContextMenuSubTrigger";var Ca=e.forwardRef((e,n)=>{const{__scopeContextMenu:r,...o}=e,i=sa(r);return t.jsx(oa,{...i,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});function Ra(e){return t=>"mouse"!==t.pointerType?e(t):void 0}Ca.displayName="ContextMenuSubContent";var Ea=ua,Ta=fa,_a=pa,Pa=ha,Sa=va,Da=ga,Na=wa,Ma=ya,Aa=xa,Oa=ba,ja=Ca;function Ia(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var ka=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Fa(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=Fa(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=Fa(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=Fa(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function Fa(e){return e?.animationName||"none"}ka.displayName="Presence";var La="Dialog",[Ua]=mt(La),[Wa,Ha]=Ua(La),Ka=n=>{const{__scopeDialog:r,children:o,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=n,l=e.useRef(null),u=e.useRef(null),[d,f]=yt({prop:i,defaultProp:a??!1,onChange:s,caller:La});return t.jsx(Wa,{scope:r,triggerRef:l,contentRef:u,contentId:Tt(),titleId:Tt(),descriptionId:Tt(),open:d,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),modal:c,children:o})};Ka.displayName=La;var Ba="DialogTrigger";e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ha(Ba,r),a=nt(n,i.triggerRef);return t.jsx(ct.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ls(i.open),...o,ref:a,onClick:Ia(e.onClick,i.onOpenToggle)})}).displayName=Ba;var $a="DialogPortal",[Va,za]=Ua($a,{forceMount:void 0}),Xa=n=>{const{__scopeDialog:r,forceMount:o,children:i,container:a}=n,s=Ha($a,r);return t.jsx(Va,{scope:r,forceMount:o,children:e.Children.map(i,e=>t.jsx(ka,{present:o||s.open,children:t.jsx(Xn,{asChild:!0,container:a,children:e})}))})};Xa.displayName=$a;var Ga="DialogOverlay",Ya=e.forwardRef((e,n)=>{const r=za(Ga,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=Ha(Ga,e.__scopeDialog);return a.modal?t.jsx(ka,{present:o||a.open,children:t.jsx(Za,{...i,ref:n})}):null});Ya.displayName=Ga;var qa=rt("DialogOverlay.RemoveScroll"),Za=e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ha(Ga,r);return t.jsx(Ir,{as:qa,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(ct.div,{"data-state":ls(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),Ja="DialogContent",Qa=e.forwardRef((e,n)=>{const r=za(Ja,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=Ha(Ja,e.__scopeDialog);return t.jsx(ka,{present:o||a.open,children:a.modal?t.jsx(es,{...i,ref:n}):t.jsx(ts,{...i,ref:n})})});Qa.displayName=Ja;var es=e.forwardRef((n,r)=>{const o=Ha(Ja,n.__scopeDialog),i=e.useRef(null),a=nt(r,o.contentRef,i);return e.useEffect(()=>{const e=i.current;if(e)return Kr(e)},[]),t.jsx(ns,{...n,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ia(n.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Ia(n.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Ia(n.onFocusOutside,e=>e.preventDefault())})}),ts=e.forwardRef((n,r)=>{const o=Ha(Ja,n.__scopeDialog),i=e.useRef(!1),a=e.useRef(!1);return t.jsx(ns,{...n,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{n.onCloseAutoFocus?.(e),e.defaultPrevented||(i.current||o.triggerRef.current?.focus(),e.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:e=>{n.onInteractOutside?.(e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const t=e.target,r=o.triggerRef.current?.contains(t);r&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ns=e.forwardRef((n,r)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,...c}=n,l=Ha(Ja,o),u=e.useRef(null),d=nt(r,u);return Yn(),t.jsxs(t.Fragment,{children:[t.jsx(Un,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:s,children:t.jsx(Nn,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":ls(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(ps,{titleId:l.titleId}),t.jsx(ms,{contentRef:u,descriptionId:l.descriptionId})]})]})}),rs="DialogTitle",os=e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ha(rs,r);return t.jsx(ct.h2,{id:i.titleId,...o,ref:n})});os.displayName=rs;var is="DialogDescription",as=e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ha(is,r);return t.jsx(ct.p,{id:i.descriptionId,...o,ref:n})});as.displayName=is;var ss="DialogClose",cs=e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ha(ss,r);return t.jsx(ct.button,{type:"button",...o,ref:n,onClick:Ia(e.onClick,()=>i.onOpenChange(!1))})});function ls(e){return e?"open":"closed"}cs.displayName=ss;var us="DialogTitleWarning",[ds,fs]=pt(us,{contentName:Ja,titleName:rs,docsSlug:"dialog"}),ps=({titleId:t})=>{const n=fs(us),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)||console.error(r)}},[r,t]),null},ms=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fs("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(r)}},[r,t,n]),null},hs=Ka,vs=Xa,gs=Ya,ws=Qa,ys=os,xs=as,bs=cs;function Cs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var Rs="DropdownMenu",[Es]=mt(Rs,[Go]),Ts=Go(),[_s,Ps]=Es(Rs),Ss=n=>{const{__scopeDropdownMenu:r,children:o,dir:i,open:a,defaultOpen:s,onOpenChange:c,modal:l=!0}=n,u=Ts(r),d=e.useRef(null),[f,p]=yt({prop:a,defaultProp:s??!1,onChange:c,caller:Rs});return t.jsx(_s,{scope:r,triggerId:Tt(),triggerRef:d,contentId:Tt(),open:f,onOpenChange:p,onOpenToggle:e.useCallback(()=>p(e=>!e),[p]),modal:l,children:t.jsx($i,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:o})})};Ss.displayName=Rs;var Ds="DropdownMenuTrigger",Ns=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,a=Ps(Ds,r),s=Ts(r);return t.jsx(Vi,{asChild:!0,...s,children:t.jsx(ct.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:tt(n,a.triggerRef),onPointerDown:Cs(e.onPointerDown,e=>{o||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Cs(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Ns.displayName=Ds;var Ms=e=>{const{__scopeDropdownMenu:n,...r}=e,o=Ts(n);return t.jsx(zi,{...o,...r})};Ms.displayName="DropdownMenuPortal";var As="DropdownMenuContent",Os=e.forwardRef((n,r)=>{const{__scopeDropdownMenu:o,...i}=n,a=Ps(As,o),s=Ts(o),c=e.useRef(!1);return t.jsx(Xi,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...i,ref:r,onCloseAutoFocus:Cs(n.onCloseAutoFocus,e=>{c.current||a.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:Cs(n.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.modal&&!r||(c.current=!0)}),style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Os.displayName=As;var js=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(Gi,{...i,...o,ref:n})});js.displayName="DropdownMenuGroup";var Is=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(Yi,{...i,...o,ref:n})});Is.displayName="DropdownMenuLabel";var ks=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(qi,{...i,...o,ref:n})});ks.displayName="DropdownMenuItem";var Fs=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(Zi,{...i,...o,ref:n})});Fs.displayName="DropdownMenuCheckboxItem";var Ls=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(Ji,{...i,...o,ref:n})});Ls.displayName="DropdownMenuRadioGroup";var Us=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(Qi,{...i,...o,ref:n})});Us.displayName="DropdownMenuRadioItem";var Ws=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(ea,{...i,...o,ref:n})});Ws.displayName="DropdownMenuItemIndicator";var Hs=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(ta,{...i,...o,ref:n})});Hs.displayName="DropdownMenuSeparator";e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(na,{...i,...o,ref:n})}).displayName="DropdownMenuArrow";var Ks=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(ra,{...i,...o,ref:n})});Ks.displayName="DropdownMenuSubTrigger";var Bs=e.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=Ts(r);return t.jsx(oa,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Bs.displayName="DropdownMenuSubContent";var $s=Ss,Vs=Ns,zs=Ms,Xs=Os,Gs=ks,Ys=Fs,qs=Ls,Zs=Us,Js=Ws,Qs=Ks,ec=Bs;function tc(e,[t,n]){return Math.min(n,Math.max(t,e))}function nc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var rc="Popper",[oc,ic]=mt(rc),[ac,sc]=oc(rc),cc=n=>{const{__scopePopper:r,children:o}=n,[i,a]=e.useState(null);return t.jsx(ac,{scope:r,anchor:i,onAnchorChange:a,children:o})};cc.displayName=rc;var lc="PopperAnchor",uc=e.forwardRef((n,r)=>{const{__scopePopper:o,virtualRef:i,...a}=n,s=sc(lc,o),c=e.useRef(null),l=nt(r,c);return e.useEffect(()=>{s.onAnchorChange(i?.current||c.current)}),i?null:t.jsx(ct.div,{...a,ref:l})});uc.displayName=lc;var dc="PopperContent",[fc,pc]=oc(dc),mc=e.forwardRef((n,r)=>{const{__scopePopper:o,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=n,w=sc(dc,o),[y,x]=e.useState(null),b=nt(r,e=>x(e)),[C,R]=e.useState(null),E=$r(C),T=E?.width??0,_=E?.height??0,P=i+("center"!==s?"-"+s:""),S="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(d)?d:[d],N=D.length>0,M={padding:S,boundary:D.filter(wc),altBoundary:N},{refs:A,floatingStyles:O,placement:j,isPositioned:I,middlewareData:k}=Ve({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>De(...e,{animationFrame:"always"===h}),elements:{reference:w.anchor},middleware:[Xe({mainAxis:a+_,alignmentAxis:c}),u&&Ge({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?Ye():void 0,...M}),u&&qe({...M}),Ze({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&Qe({element:C,padding:l}),yc({arrowWidth:T,arrowHeight:_}),m&&Je({strategy:"referenceHidden",...M})]}),[F,L]=xc(j),U=En(v);gt(()=>{I&&U?.()},[I,U]);const W=k.arrow?.x,H=k.arrow?.y,K=0!==k.arrow?.centerOffset,[B,$]=e.useState();return gt(()=>{y&&$(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:I?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(" "),...k.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:t.jsx(fc,{scope:o,placedSide:F,onArrowChange:R,arrowX:W,arrowY:H,shouldHideArrow:K,children:t.jsx(ct.div,{"data-side":F,"data-align":L,...g,ref:b,style:{...g.style,animation:I?void 0:"none"}})})})});mc.displayName=dc;var hc="PopperArrow",vc={top:"bottom",right:"left",bottom:"top",left:"right"},gc=e.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=pc(hc,r),a=vc[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(Gr,{...o,ref:n,style:{...o.style,display:"block"}})})});function wc(e){return null!==e}gc.displayName=hc;var yc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[c,l]=xc(n),u={start:"0%",center:"50%",end:"100%"}[l],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+s/2;let p="",m="";return"bottom"===c?(p=i?u:`${d}px`,m=-s+"px"):"top"===c?(p=i?u:`${d}px`,m=`${r.floating.height+s}px`):"right"===c?(p=-s+"px",m=i?u:`${f}px`):"left"===c&&(p=`${r.floating.width+s}px`,m=i?u:`${f}px`),{data:{x:p,y:m}}}});function xc(e){const[t,n="center"]=e.split("-");return[t,n]}var bc=cc,Cc=uc,Rc=mc,Ec=gc;var Tc=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=_c(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=_c(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=_c(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=_c(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function _c(e){return e?.animationName||"none"}Tc.displayName="Presence";var Pc="Popover",[Sc]=mt(Pc,[ic]),Dc=ic(),[Nc,Mc]=Sc(Pc),Ac=n=>{const{__scopePopover:r,children:o,open:i,defaultOpen:a,onOpenChange:s,modal:c=!1}=n,l=Dc(r),u=e.useRef(null),[d,f]=e.useState(!1),[p,m]=yt({prop:i,defaultProp:a??!1,onChange:s,caller:Pc});return t.jsx(bc,{...l,children:t.jsx(Nc,{scope:r,contentId:Tt(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:e.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:e.useCallback(()=>f(!0),[]),onCustomAnchorRemove:e.useCallback(()=>f(!1),[]),modal:c,children:o})})};Ac.displayName=Pc;var Oc="PopoverAnchor",jc=e.forwardRef((n,r)=>{const{__scopePopover:o,...i}=n,a=Mc(Oc,o),s=Dc(o),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=a;return e.useEffect(()=>(c(),()=>l()),[c,l]),t.jsx(Cc,{...s,...i,ref:r})});jc.displayName=Oc;var Ic="PopoverTrigger",kc=e.forwardRef((e,n)=>{const{__scopePopover:r,...o}=e,i=Mc(Ic,r),a=Dc(r),s=nt(n,i.triggerRef),c=t.jsx(ct.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":qc(i.open),...o,ref:s,onClick:nc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:t.jsx(Cc,{asChild:!0,...a,children:c})});kc.displayName=Ic;var Fc="PopoverPortal",[Lc,Uc]=Sc(Fc,{forceMount:void 0}),Wc=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,a=Mc(Fc,n);return t.jsx(Lc,{scope:n,forceMount:r,children:t.jsx(Tc,{present:r||a.open,children:t.jsx(Xn,{asChild:!0,container:i,children:o})})})};Wc.displayName=Fc;var Hc="PopoverContent",Kc=e.forwardRef((e,n)=>{const r=Uc(Hc,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,a=Mc(Hc,e.__scopePopover);return t.jsx(Tc,{present:o||a.open,children:a.modal?t.jsx($c,{...i,ref:n}):t.jsx(Vc,{...i,ref:n})})});Kc.displayName=Hc;var Bc=rt("PopoverContent.RemoveScroll"),$c=e.forwardRef((n,r)=>{const o=Mc(Hc,n.__scopePopover),i=e.useRef(null),a=nt(r,i),s=e.useRef(!1);return e.useEffect(()=>{const e=i.current;if(e)return Kr(e)},[]),t.jsx(Ir,{as:Bc,allowPinchZoom:!0,children:t.jsx(zc,{...n,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nc(n.onCloseAutoFocus,e=>{e.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:nc(n.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:nc(n.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Vc=e.forwardRef((n,r)=>{const o=Mc(Hc,n.__scopePopover),i=e.useRef(!1),a=e.useRef(!1);return t.jsx(zc,{...n,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{n.onCloseAutoFocus?.(e),e.defaultPrevented||(i.current||o.triggerRef.current?.focus(),e.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:e=>{n.onInteractOutside?.(e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const t=e.target,r=o.triggerRef.current?.contains(t);r&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),zc=e.forwardRef((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=Mc(Hc,r),m=Dc(r);return Yn(),t.jsx(Un,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:t.jsx(Nn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:t.jsx(Rc,{"data-state":qc(p.open),role:"dialog",id:p.contentId,...m,...f,ref:n,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Xc="PopoverClose",Gc=e.forwardRef((e,n)=>{const{__scopePopover:r,...o}=e,i=Mc(Xc,r);return t.jsx(ct.button,{type:"button",...o,ref:n,onClick:nc(e.onClick,()=>i.onOpenChange(!1))})});Gc.displayName=Xc;var Yc=e.forwardRef((e,n)=>{const{__scopePopover:r,...o}=e,i=Dc(r);return t.jsx(Ec,{...i,...o,ref:n})});function qc(e){return e?"open":"closed"}Yc.displayName="PopoverArrow";var Zc=Ac,Jc=jc,Qc=kc,el=Wc,tl=Kc,nl=Gc,rl=Yc,ol="rovingFocusGroup.onEntryFocus",il={bubbles:!1,cancelable:!0},al="RovingFocusGroup",[sl,cl,ll]=vt(al),[ul,dl]=mt(al,[ll]),[fl,pl]=ul(al),ml=e.forwardRef((e,n)=>t.jsx(sl.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(sl.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(hl,{...e,ref:n})})}));ml.displayName=al;var hl=e.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:o,orientation:i,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=n,m=e.useRef(null),h=nt(r,m),v=Kt(s),[g,w]=yt({prop:c,defaultProp:l??null,onChange:u,caller:al}),[y,x]=e.useState(!1),b=En(d),C=cl(o),R=e.useRef(!1),[E,T]=e.useState(0);return e.useEffect(()=>{const e=m.current;if(e)return e.addEventListener(ol,b),()=>e.removeEventListener(ol,b)},[b]),t.jsx(fl,{scope:o,orientation:i,dir:v,loop:a,currentTabStopId:g,onItemFocus:e.useCallback(e=>w(e),[w]),onItemShiftTab:e.useCallback(()=>x(!0),[]),onFocusableItemAdd:e.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>T(e=>e-1),[]),children:t.jsx(ct.div,{tabIndex:y||0===E?-1:0,"data-orientation":i,...p,ref:h,style:{outline:"none",...n.style},onMouseDown:Ia(n.onMouseDown,()=>{R.current=!0}),onFocus:Ia(n.onFocus,e=>{const t=!R.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(ol,il);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=C().filter(e=>e.focusable);yl([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),f)}}R.current=!1}),onBlur:Ia(n.onBlur,()=>x(!1))})})}),vl="RovingFocusGroupItem",gl=e.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:o,focusable:i=!0,active:a=!1,tabStopId:s,children:c,...l}=n,u=Tt(),d=s||u,f=pl(vl,o),p=f.currentTabStopId===d,m=cl(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=f;return e.useEffect(()=>{if(i)return h(),()=>v()},[i,h,v]),t.jsx(sl.ItemSlot,{scope:o,id:d,focusable:i,active:a,children:t.jsx(ct.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:r,onMouseDown:Ia(n.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:Ia(n.onFocus,()=>f.onItemFocus(d)),onKeyDown:Ia(n.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:wl[r]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=f.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>yl(o))}var n,r}),children:"function"==typeof c?c({isCurrentTabStop:p,hasTabStop:null!=g}):c})})});gl.displayName=vl;var wl={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yl(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var xl=ml,bl=gl,Cl="Radio",[Rl,El]=mt(Cl),[Tl,_l]=Rl(Cl),Pl=e.forwardRef((n,r)=>{const{__scopeRadio:o,name:i,checked:a=!1,required:s,disabled:c,value:l="on",onCheck:u,form:d,...f}=n,[p,m]=e.useState(null),h=nt(r,e=>m(e)),v=e.useRef(!1),g=!p||(d||!!p.closest("form"));return t.jsxs(Tl,{scope:o,checked:a,disabled:c,children:[t.jsx(ct.button,{type:"button",role:"radio","aria-checked":a,"data-state":Ml(a),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:h,onClick:Ia(n.onClick,e=>{a||u?.(),g&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),g&&t.jsx(Nl,{control:p,bubbles:!v.current,name:i,value:l,checked:a,required:s,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});Pl.displayName=Cl;var Sl="RadioIndicator",Dl=e.forwardRef((e,n)=>{const{__scopeRadio:r,forceMount:o,...i}=e,a=_l(Sl,r);return t.jsx(ka,{present:o||a.checked,children:t.jsx(ct.span,{"data-state":Ml(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:n})})});Dl.displayName=Sl;var Nl=e.forwardRef(({__scopeRadio:n,control:r,checked:o,bubbles:i=!0,...a},s)=>{const c=e.useRef(null),l=nt(c,s),u=Br(o),d=$r(r);return e.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==o&&n){const t=new Event("click",{bubbles:i});n.call(e,o),e.dispatchEvent(t)}},[u,o,i]),t.jsx(ct.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...a,tabIndex:-1,ref:l,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ml(e){return e?"checked":"unchecked"}Nl.displayName="RadioBubbleInput";var Al=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ol="RadioGroup",[jl]=mt(Ol,[dl,El]),Il=dl(),kl=El(),[Fl,Ll]=jl(Ol),Ul=e.forwardRef((e,n)=>{const{__scopeRadioGroup:r,name:o,defaultValue:i,value:a,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,m=Il(r),h=Kt(u),[v,g]=yt({prop:a,defaultProp:i??null,onChange:f,caller:Ol});return t.jsx(Fl,{scope:r,name:o,required:s,disabled:c,value:v,onValueChange:g,children:t.jsx(xl,{asChild:!0,...m,orientation:l,dir:h,loop:d,children:t.jsx(ct.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":c?"":void 0,dir:h,...p,ref:n})})})});Ul.displayName=Ol;var Wl="RadioGroupItem",Hl=e.forwardRef((n,r)=>{const{__scopeRadioGroup:o,disabled:i,...a}=n,s=Ll(Wl,o),c=s.disabled||i,l=Il(o),u=kl(o),d=e.useRef(null),f=nt(r,d),p=s.value===a.value,m=e.useRef(!1);return e.useEffect(()=>{const e=e=>{Al.includes(e.key)&&(m.current=!0)},t=()=>m.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t.jsx(bl,{asChild:!0,...l,focusable:!c,active:p,children:t.jsx(Pl,{disabled:c,required:s.required,checked:p,...u,...a,name:s.name,ref:f,onCheck:()=>s.onValueChange(a.value),onKeyDown:Ia(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Ia(a.onFocus,()=>{m.current&&d.current?.click()})})})});Hl.displayName=Wl;e.forwardRef((e,n)=>{const{__scopeRadioGroup:r,...o}=e,i=kl(r);return t.jsx(Dl,{...i,...o,ref:n})}).displayName="RadioGroupIndicator";var Kl=Ul,Bl=Hl;var $l=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Vl(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=Vl(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=Vl(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=Vl(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function Vl(e){return e?.animationName||"none"}function zl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}$l.displayName="Presence";var Xl="ScrollArea",[Gl]=mt(Xl),[Yl,ql]=Gl(Xl),Zl=e.forwardRef((n,r)=>{const{__scopeScrollArea:o,type:i="hover",dir:a,scrollHideDelay:s=600,...c}=n,[l,u]=e.useState(null),[d,f]=e.useState(null),[p,m]=e.useState(null),[h,v]=e.useState(null),[g,w]=e.useState(null),[y,x]=e.useState(0),[b,C]=e.useState(0),[R,E]=e.useState(!1),[T,_]=e.useState(!1),P=nt(r,e=>u(e)),S=Kt(a);return t.jsx(Yl,{scope:o,type:i,dir:S,scrollHideDelay:s,scrollArea:l,viewport:d,onViewportChange:f,content:p,onContentChange:m,scrollbarX:h,onScrollbarXChange:v,scrollbarXEnabled:R,onScrollbarXEnabledChange:E,scrollbarY:g,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:_,onCornerWidthChange:x,onCornerHeightChange:C,children:t.jsx(ct.div,{dir:S,...c,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":b+"px",...n.style}})})});Zl.displayName=Xl;var Jl="ScrollAreaViewport",Ql=e.forwardRef((n,r)=>{const{__scopeScrollArea:o,children:i,nonce:a,...s}=n,c=ql(Jl,o),l=nt(r,e.useRef(null),c.onViewportChange);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),t.jsx(ct.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...n.style},children:t.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});Ql.displayName=Jl;var eu="ScrollAreaScrollbar",tu=e.forwardRef((n,r)=>{const{forceMount:o,...i}=n,a=ql(eu,n.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=a,l="horizontal"===n.orientation;return e.useEffect(()=>(l?s(!0):c(!0),()=>{l?s(!1):c(!1)}),[l,s,c]),"hover"===a.type?t.jsx(nu,{...i,ref:r,forceMount:o}):"scroll"===a.type?t.jsx(ru,{...i,ref:r,forceMount:o}):"auto"===a.type?t.jsx(ou,{...i,ref:r,forceMount:o}):"always"===a.type?t.jsx(iu,{...i,ref:r}):null});tu.displayName=eu;var nu=e.forwardRef((n,r)=>{const{forceMount:o,...i}=n,a=ql(eu,n.__scopeScrollArea),[s,c]=e.useState(!1);return e.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),c(!0)},r=()=>{t=window.setTimeout(()=>c(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),t.jsx($l,{present:o||s,children:t.jsx(ou,{"data-state":s?"visible":"hidden",...i,ref:r})})}),ru=e.forwardRef((n,r)=>{const{forceMount:o,...i}=n,a=ql(eu,n.__scopeScrollArea),s="horizontal"===n.orientation,c=Eu(()=>u("SCROLL_END"),100),[l,u]=(d="hidden",f={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},e.useReducer((e,t)=>f[e][t]??e,d));var d,f;return e.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,a.scrollHideDelay,u]),e.useEffect(()=>{const e=a.viewport,t=s?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(u("SCROLL"),c()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[a.viewport,s,u,c]),t.jsx($l,{present:o||"hidden"!==l,children:t.jsx(iu,{"data-state":"hidden"===l?"hidden":"visible",...i,ref:r,onPointerEnter:zl(n.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:zl(n.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),ou=e.forwardRef((n,r)=>{const o=ql(eu,n.__scopeScrollArea),{forceMount:i,...a}=n,[s,c]=e.useState(!1),l="horizontal"===n.orientation,u=Eu(()=>{if(o.viewport){const e=o.viewport.offsetWidth<o.viewport.scrollWidth,t=o.viewport.offsetHeight<o.viewport.scrollHeight;c(l?e:t)}},10);return Tu(o.viewport,u),Tu(o.content,u),t.jsx($l,{present:i||s,children:t.jsx(iu,{"data-state":s?"visible":"hidden",...a,ref:r})})}),iu=e.forwardRef((n,r)=>{const{orientation:o="vertical",...i}=n,a=ql(eu,n.__scopeScrollArea),s=e.useRef(null),c=e.useRef(0),[l,u]=e.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=wu(l.viewport,l.content),f={...i,sizes:l,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function p(e,t){return function(e,t,n,r="ltr"){const o=yu(n),i=o/2,a=t||i,s=o-a,c=n.scrollbar.paddingStart+a,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d="ltr"===r?[0,u]:[-1*u,0];return bu([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===o?t.jsx(au,{...f,ref:r,onThumbPositionChange:()=>{if(a.viewport&&s.current){const e=xu(a.viewport.scrollLeft,l,a.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=p(e,a.dir))}}):"vertical"===o?t.jsx(su,{...f,ref:r,onThumbPositionChange:()=>{if(a.viewport&&s.current){const e=xu(a.viewport.scrollTop,l);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=p(e))}}):null}),au=e.forwardRef((n,r)=>{const{sizes:o,onSizesChange:i,...a}=n,s=ql(eu,n.__scopeScrollArea),[c,l]=e.useState(),u=e.useRef(null),d=nt(r,u,s.onScrollbarXChange);return e.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),t.jsx(uu,{"data-orientation":"horizontal",...a,ref:d,sizes:o,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":yu(o)+"px",...n.style},onThumbPointerDown:e=>n.onThumbPointerDown(e.x),onDragScroll:e=>n.onDragScroll(e.x),onWheelScroll:(e,t)=>{if(s.viewport){const r=s.viewport.scrollLeft+e.deltaX;n.onWheelScroll(r),Cu(r,t)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&c&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:gu(c.paddingLeft),paddingEnd:gu(c.paddingRight)}})}})}),su=e.forwardRef((n,r)=>{const{sizes:o,onSizesChange:i,...a}=n,s=ql(eu,n.__scopeScrollArea),[c,l]=e.useState(),u=e.useRef(null),d=nt(r,u,s.onScrollbarYChange);return e.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),t.jsx(uu,{"data-orientation":"vertical",...a,ref:d,sizes:o,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":yu(o)+"px",...n.style},onThumbPointerDown:e=>n.onThumbPointerDown(e.y),onDragScroll:e=>n.onDragScroll(e.y),onWheelScroll:(e,t)=>{if(s.viewport){const r=s.viewport.scrollTop+e.deltaY;n.onWheelScroll(r),Cu(r,t)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&c&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:gu(c.paddingTop),paddingEnd:gu(c.paddingBottom)}})}})}),[cu,lu]=Gl(eu),uu=e.forwardRef((n,r)=>{const{__scopeScrollArea:o,sizes:i,hasThumb:a,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:p,...m}=n,h=ql(eu,o),[v,g]=e.useState(null),w=nt(r,e=>g(e)),y=e.useRef(null),x=e.useRef(""),b=h.viewport,C=i.content-i.viewport,R=En(f),E=En(u),T=Eu(p,10);function _(e){if(y.current){const t=e.clientX-y.current.left,n=e.clientY-y.current.top;d({x:t,y:n})}}return e.useEffect(()=>{const e=e=>{const t=e.target,n=v?.contains(t);n&&R(e,C)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[b,v,C,R]),e.useEffect(E,[i,E]),Tu(v,T),Tu(h.content,T),t.jsx(cu,{scope:o,scrollbar:v,hasThumb:a,onThumbChange:En(s),onThumbPointerUp:En(c),onThumbPositionChange:E,onThumbPointerDown:En(l),children:t.jsx(ct.div,{...m,ref:w,style:{position:"absolute",...m.style},onPointerDown:zl(n.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),_(e)}}),onPointerMove:zl(n.onPointerMove,_),onPointerUp:zl(n.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),du="ScrollAreaThumb",fu=e.forwardRef((e,n)=>{const{forceMount:r,...o}=e,i=lu(du,e.__scopeScrollArea);return t.jsx($l,{present:r||i.hasThumb,children:t.jsx(pu,{ref:n,...o})})}),pu=e.forwardRef((n,r)=>{const{__scopeScrollArea:o,style:i,...a}=n,s=ql(du,o),c=lu(du,o),{onThumbPositionChange:l}=c,u=nt(r,e=>c.onThumbChange(e)),d=e.useRef(void 0),f=Eu(()=>{d.current&&(d.current(),d.current=void 0)},100);return e.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(f(),!d.current){const t=Ru(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,f,l]),t.jsx(ct.div,{"data-state":c.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:zl(n.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;c.onThumbPointerDown({x:n,y:r})}),onPointerUp:zl(n.onPointerUp,c.onThumbPointerUp)})});fu.displayName=du;var mu="ScrollAreaCorner",hu=e.forwardRef((e,n)=>{const r=ql(mu,e.__scopeScrollArea),o=Boolean(r.scrollbarX&&r.scrollbarY);return"scroll"!==r.type&&o?t.jsx(vu,{...e,ref:n}):null});hu.displayName=mu;var vu=e.forwardRef((n,r)=>{const{__scopeScrollArea:o,...i}=n,a=ql(mu,o),[s,c]=e.useState(0),[l,u]=e.useState(0),d=Boolean(s&&l);return Tu(a.scrollbarX,()=>{const e=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(e),u(e)}),Tu(a.scrollbarY,()=>{const e=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(e),c(e)}),d?t.jsx(ct.div,{...i,ref:r,style:{width:s,height:l,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...n.style}}):null});function gu(e){return e?parseInt(e,10):0}function wu(e,t){const n=e/t;return isNaN(n)?0:n}function yu(e){const t=wu(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function xu(e,t,n="ltr"){const r=yu(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,c=tc(e,"ltr"===n?[0,a]:[-1*a,0]);return bu([0,a],[0,s])(c)}function bu(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Cu(e,t){return e>0&&e<t}var Ru=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Eu(t,n){const r=En(t),o=e.useRef(0);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),e.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,n)},[r,n])}function Tu(e,t){const n=En(t);gt(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var _u=Zl,Pu=Ql,Su=tu,Du=fu,Nu=hu;function Mu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var Au="Popper",[Ou,ju]=mt(Au),[Iu,ku]=Ou(Au),Fu=n=>{const{__scopePopper:r,children:o}=n,[i,a]=e.useState(null);return t.jsx(Iu,{scope:r,anchor:i,onAnchorChange:a,children:o})};Fu.displayName=Au;var Lu="PopperAnchor",Uu=e.forwardRef((n,r)=>{const{__scopePopper:o,virtualRef:i,...a}=n,s=ku(Lu,o),c=e.useRef(null),l=nt(r,c);return e.useEffect(()=>{s.onAnchorChange(i?.current||c.current)}),i?null:t.jsx(ct.div,{...a,ref:l})});Uu.displayName=Lu;var Wu="PopperContent",[Hu,Ku]=Ou(Wu),Bu=e.forwardRef((n,r)=>{const{__scopePopper:o,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=n,w=ku(Wu,o),[y,x]=e.useState(null),b=nt(r,e=>x(e)),[C,R]=e.useState(null),E=$r(C),T=E?.width??0,_=E?.height??0,P=i+("center"!==s?"-"+s:""),S="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(d)?d:[d],N=D.length>0,M={padding:S,boundary:D.filter(Xu),altBoundary:N},{refs:A,floatingStyles:O,placement:j,isPositioned:I,middlewareData:k}=Ve({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>De(...e,{animationFrame:"always"===h}),elements:{reference:w.anchor},middleware:[Xe({mainAxis:a+_,alignmentAxis:c}),u&&Ge({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?Ye():void 0,...M}),u&&qe({...M}),Ze({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&Qe({element:C,padding:l}),Gu({arrowWidth:T,arrowHeight:_}),m&&Je({strategy:"referenceHidden",...M})]}),[F,L]=Yu(j),U=En(v);gt(()=>{I&&U?.()},[I,U]);const W=k.arrow?.x,H=k.arrow?.y,K=0!==k.arrow?.centerOffset,[B,$]=e.useState();return gt(()=>{y&&$(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:I?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(" "),...k.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:t.jsx(Hu,{scope:o,placedSide:F,onArrowChange:R,arrowX:W,arrowY:H,shouldHideArrow:K,children:t.jsx(ct.div,{"data-side":F,"data-align":L,...g,ref:b,style:{...g.style,animation:I?void 0:"none"}})})})});Bu.displayName=Wu;var $u="PopperArrow",Vu={top:"bottom",right:"left",bottom:"top",left:"right"},zu=e.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=Ku($u,r),a=Vu[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(Gr,{...o,ref:n,style:{...o.style,display:"block"}})})});function Xu(e){return null!==e}zu.displayName=$u;var Gu=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[c,l]=Yu(n),u={start:"0%",center:"50%",end:"100%"}[l],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+s/2;let p="",m="";return"bottom"===c?(p=i?u:`${d}px`,m=-s+"px"):"top"===c?(p=i?u:`${d}px`,m=`${r.floating.height+s}px`):"right"===c?(p=-s+"px",m=i?u:`${f}px`):"left"===c&&(p=`${r.floating.width+s}px`,m=i?u:`${f}px`),{data:{x:p,y:m}}}});function Yu(e){const[t,n="center"]=e.split("-");return[t,n]}var qu=Fu,Zu=Uu,Ju=Bu,Qu=zu,ed=[" ","Enter","ArrowUp","ArrowDown"],td=[" ","Enter"],nd="Select",[rd,od,id]=vt(nd),[ad]=mt(nd,[id,ju]),sd=ju(),[cd,ld]=ad(nd),[ud,dd]=ad(nd),fd=n=>{const{__scopeSelect:r,children:o,open:i,defaultOpen:a,onOpenChange:s,value:c,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:v}=n,g=sd(r),[w,y]=e.useState(null),[x,b]=e.useState(null),[C,R]=e.useState(!1),E=Kt(d),[T,_]=yt({prop:i,defaultProp:a??!1,onChange:s,caller:nd}),[P,S]=yt({prop:c,defaultProp:l,onChange:u,caller:nd}),D=e.useRef(null),N=!w||(v||!!w.closest("form")),[M,A]=e.useState(new Set),O=Array.from(M).map(e=>e.props.value).join(";");return t.jsx(qu,{...g,children:t.jsxs(cd,{required:h,scope:r,trigger:w,onTriggerChange:y,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:R,contentId:Tt(),value:P,onValueChange:S,open:T,onOpenChange:_,dir:E,triggerPointerDownPosRef:D,disabled:m,children:[t.jsx(rd.Provider,{scope:r,children:t.jsx(ud,{scope:n.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),N?t.jsxs(qd,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:P,onChange:e=>S(e.target.value),disabled:m,form:v,children:[void 0===P?t.jsx("option",{value:""}):null,Array.from(M)]},O):null]})})};fd.displayName=nd;var pd="SelectTrigger",md=e.forwardRef((n,r)=>{const{__scopeSelect:o,disabled:i=!1,...a}=n,s=sd(o),c=ld(pd,o),l=c.disabled||i,u=nt(r,c.onTriggerChange),d=od(o),f=e.useRef("touch"),[p,m,h]=Jd(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===c.value),r=Qd(t,e,n);void 0!==r&&c.onValueChange(r.value)}),v=e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Zu,{asChild:!0,...s,children:t.jsx(ct.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Zd(c.value)?"":void 0,...a,ref:u,onClick:Mu(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&v(e)}),onPointerDown:Mu(a.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:Mu(a.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),t&&" "===e.key||ed.includes(e.key)&&(v(),e.preventDefault())})})})});md.displayName=pd;var hd="SelectValue",vd=e.forwardRef((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:a,placeholder:s="",...c}=e,l=ld(hd,r),{onValueNodeHasChildrenChange:u}=l,d=void 0!==a,f=nt(n,l.onValueNodeChange);return gt(()=>{u(d)},[u,d]),t.jsx(ct.span,{...c,ref:f,style:{pointerEvents:"none"},children:Zd(l.value)?t.jsx(t.Fragment,{children:s}):a})});vd.displayName=hd;var gd=e.forwardRef((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(ct.span,{"aria-hidden":!0,...i,ref:n,children:o||"\u25bc"})});gd.displayName="SelectIcon";var wd=e=>t.jsx(Xn,{asChild:!0,...e});wd.displayName="SelectPortal";var yd="SelectContent",xd=e.forwardRef((n,r)=>{const o=ld(yd,n.__scopeSelect),[a,s]=e.useState();if(gt(()=>{s(new DocumentFragment)},[]),!o.open){const e=a;return e?i.createPortal(t.jsx(Cd,{scope:n.__scopeSelect,children:t.jsx(rd.Slot,{scope:n.__scopeSelect,children:t.jsx("div",{children:n.children})})}),e):null}return t.jsx(Td,{...n,ref:r})});xd.displayName=yd;var bd=10,[Cd,Rd]=ad(yd),Ed=rt("SelectContent.RemoveScroll"),Td=e.forwardRef((n,r)=>{const{__scopeSelect:o,position:i="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:w,...y}=n,x=ld(yd,o),[b,C]=e.useState(null),[R,E]=e.useState(null),T=nt(r,e=>C(e)),[_,P]=e.useState(null),[S,D]=e.useState(null),N=od(o),[M,A]=e.useState(!1),O=e.useRef(!1);e.useEffect(()=>{if(b)return Kr(b)},[b]),Yn();const j=e.useCallback(e=>{const[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&R&&(R.scrollTop=0),i===r&&R&&(R.scrollTop=R.scrollHeight),i?.focus(),document.activeElement!==o)return}},[N,R]),I=e.useCallback(()=>j([_,b]),[j,_,b]);e.useEffect(()=>{M&&I()},[M,I]);const{onOpenChange:k,triggerPointerDownPosRef:F}=x;e.useEffect(()=>{if(b){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||k(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[b,k,F]),e.useEffect(()=>{const e=()=>k(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[k]);const[L,U]=Jd(e=>{const t=N().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Qd(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),W=e.useCallback((e,t,n)=>{const r=!O.current&&!n;(void 0!==x.value&&x.value===t||r)&&(P(e),r&&(O.current=!0))},[x.value]),H=e.useCallback(()=>b?.focus(),[b]),K=e.useCallback((e,t,n)=>{const r=!O.current&&!n;(void 0!==x.value&&x.value===t||r)&&D(e)},[x.value]),B="popper"===i?Pd:_d,$=B===Pd?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:w}:{};return t.jsx(Cd,{scope:o,content:b,viewport:R,onViewportChange:E,itemRefCallback:W,selectedItem:_,onItemLeave:H,itemTextRefCallback:K,focusSelectedItem:I,selectedItemText:S,position:i,isPositioned:M,searchRef:L,children:t.jsx(Ir,{as:Ed,allowPinchZoom:!0,children:t.jsx(Un,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Mu(a,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(Nn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...y,...$,onPlaced:()=>A(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Mu(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>j(t)),e.preventDefault()}})})})})})})});Td.displayName="SelectContentImpl";var _d=e.forwardRef((n,r)=>{const{__scopeSelect:o,onPlaced:i,...a}=n,s=ld(yd,o),c=Rd(yd,o),[l,u]=e.useState(null),[d,f]=e.useState(null),p=nt(r,e=>f(e)),m=od(o),h=e.useRef(!1),v=e.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:y,focusSelectedItem:x}=c,b=e.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&g&&w&&y){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=y.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,i=n.left-o,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-bd,d=tc(i,[bd,Math.max(bd,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-bd,d=tc(i,[bd,Math.max(bd,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const o=m(),a=window.innerHeight-2*bd,c=g.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),v=parseInt(u.borderBottomWidth,10),x=f+p+c+parseInt(u.paddingBottom,10)+v,b=Math.min(5*w.offsetHeight,x),C=window.getComputedStyle(g),R=parseInt(C.paddingTop,10),E=parseInt(C.paddingBottom,10),T=e.top+e.height/2-bd,_=a-T,P=w.offsetHeight/2,S=f+p+(w.offsetTop+P),D=x-S;if(S<=T){const e=o.length>0&&w===o[o.length-1].ref.current;l.style.bottom="0px";const t=d.clientHeight-g.offsetTop-g.offsetHeight,n=S+Math.max(_,P+(e?E:0)+t+v);l.style.height=n+"px"}else{const e=o.length>0&&w===o[0].ref.current;l.style.top="0px";const t=Math.max(T,f+g.offsetTop+(e?R:0)+P)+D;l.style.height=t+"px",g.scrollTop=S-T+g.offsetTop}l.style.margin=`${bd}px 0`,l.style.minHeight=b+"px",l.style.maxHeight=a+"px",i?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,l,d,g,w,y,s.dir,i]);gt(()=>b(),[b]);const[C,R]=e.useState();gt(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const E=e.useCallback(e=>{e&&!0===v.current&&(b(),x?.(),v.current=!1)},[b,x]);return t.jsx(Sd,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:t.jsx(ct.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});_d.displayName="SelectItemAlignedPosition";var Pd=e.forwardRef((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=bd,...a}=e,s=sd(r);return t.jsx(Ju,{...s,...a,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Pd.displayName="SelectPopperPosition";var[Sd,Dd]=ad(yd,{}),Nd="SelectViewport",Md=e.forwardRef((n,r)=>{const{__scopeSelect:o,nonce:i,...a}=n,s=Rd(Nd,o),c=Dd(Nd,o),l=nt(r,s.onViewportChange),u=e.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),t.jsx(rd.Slot,{scope:o,children:t.jsx(ct.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Mu(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*bd,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(o,i);if(a<r){const o=a+e,i=Math.min(r,o),s=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});Md.displayName=Nd;var Ad="SelectGroup",[Od,jd]=ad(Ad);e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,i=Tt();return t.jsx(Od,{scope:r,id:i,children:t.jsx(ct.div,{role:"group","aria-labelledby":i,...o,ref:n})})}).displayName=Ad;var Id="SelectLabel",kd=e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,i=jd(Id,r);return t.jsx(ct.div,{id:i.id,...o,ref:n})});kd.displayName=Id;var Fd="SelectItem",[Ld,Ud]=ad(Fd),Wd=e.forwardRef((n,r)=>{const{__scopeSelect:o,value:i,disabled:a=!1,textValue:s,...c}=n,l=ld(Fd,o),u=Rd(Fd,o),d=l.value===i,[f,p]=e.useState(s??""),[m,h]=e.useState(!1),v=nt(r,e=>u.itemRefCallback?.(e,i,a)),g=Tt(),w=e.useRef("touch"),y=()=>{a||(l.onValueChange(i),l.onOpenChange(!1))};if(""===i)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Ld,{scope:o,value:i,disabled:a,textId:g,isSelected:d,onItemTextChange:e.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:t.jsx(rd.ItemSlot,{scope:o,value:i,disabled:a,textValue:f,children:t.jsx(ct.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...c,ref:v,onFocus:Mu(c.onFocus,()=>h(!0)),onBlur:Mu(c.onBlur,()=>h(!1)),onClick:Mu(c.onClick,()=>{"mouse"!==w.current&&y()}),onPointerUp:Mu(c.onPointerUp,()=>{"mouse"===w.current&&y()}),onPointerDown:Mu(c.onPointerDown,e=>{w.current=e.pointerType}),onPointerMove:Mu(c.onPointerMove,e=>{w.current=e.pointerType,a?u.onItemLeave?.():"mouse"===w.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Mu(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Mu(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(td.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Wd.displayName=Fd;var Hd="SelectItemText",Kd=e.forwardRef((n,r)=>{const{__scopeSelect:o,className:a,style:s,...c}=n,l=ld(Hd,o),u=Rd(Hd,o),d=Ud(Hd,o),f=dd(Hd,o),[p,m]=e.useState(null),h=nt(r,e=>m(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),v=p?.textContent,g=e.useMemo(()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:y}=f;return gt(()=>(w(g),()=>y(g)),[w,y,g]),t.jsxs(t.Fragment,{children:[t.jsx(ct.span,{id:d.textId,...c,ref:h}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?i.createPortal(c.children,l.valueNode):null]})});Kd.displayName=Hd;var Bd="SelectItemIndicator",$d=e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e;return Ud(Bd,r).isSelected?t.jsx(ct.span,{"aria-hidden":!0,...o,ref:n}):null});$d.displayName=Bd;var Vd="SelectScrollUpButton";e.forwardRef((n,r)=>{const o=Rd(Vd,n.__scopeSelect),i=Dd(Vd,n.__scopeSelect),[a,s]=e.useState(!1),c=nt(r,i.onScrollButtonChange);return gt(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Xd,{...n,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Vd;var zd="SelectScrollDownButton";e.forwardRef((n,r)=>{const o=Rd(zd,n.__scopeSelect),i=Dd(zd,n.__scopeSelect),[a,s]=e.useState(!1),c=nt(r,i.onScrollButtonChange);return gt(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),a?t.jsx(Xd,{...n,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=zd;var Xd=e.forwardRef((n,r)=>{const{__scopeSelect:o,onAutoScroll:i,...a}=n,s=Rd("SelectScrollButton",o),c=e.useRef(null),l=od(o),u=e.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return e.useEffect(()=>()=>u(),[u]),gt(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),t.jsx(ct.div,{"aria-hidden":!0,...a,ref:r,style:{flexShrink:0,...a.style},onPointerDown:Mu(a.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(i,50))}),onPointerMove:Mu(a.onPointerMove,()=>{s.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(i,50))}),onPointerLeave:Mu(a.onPointerLeave,()=>{u()})})}),Gd=e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(ct.div,{"aria-hidden":!0,...o,ref:n})});Gd.displayName="SelectSeparator";var Yd="SelectArrow";e.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,i=sd(r),a=ld(Yd,r),s=Rd(Yd,r);return a.open&&"popper"===s.position?t.jsx(Qu,{...i,...o,ref:n}):null}).displayName=Yd;var qd=e.forwardRef(({__scopeSelect:n,value:r,...o},i)=>{const a=e.useRef(null),s=nt(i,a),c=Br(r);return e.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),t.jsx(ct.select,{...o,style:{...ut,...o.style},ref:s,defaultValue:r})});function Zd(e){return""===e||void 0===e}function Jd(t){const n=En(t),r=e.useRef(""),o=e.useRef(0),i=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),a=e.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,i,a]}function Qd(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=(a=e,s=Math.max(o,0),a.map((e,t)=>a[(s+t)%a.length]));var a,s;1===r.length&&(i=i.filter(e=>e!==n));const c=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}qd.displayName="SelectBubbleInput";var ef=fd,tf=md,nf=vd,rf=gd,of=wd,af=xd,sf=Md,cf=kd,lf=Wd,uf=Kd,df=$d,ff=Gd;function pf(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var mf=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=hf(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=hf(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=hf(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=hf(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function hf(e){return e?.animationName||"none"}mf.displayName="Presence";var vf="ToastProvider",[gf,wf,yf]=vt("Toast"),[xf]=mt("Toast",[yf]),[bf,Cf]=xf(vf),Rf=n=>{const{__scopeToast:r,label:o="Notification",duration:i=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:c}=n,[l,u]=e.useState(null),[d,f]=e.useState(0),p=e.useRef(!1),m=e.useRef(!1);return o.trim()||console.error(`Invalid prop \`label\` supplied to \`${vf}\`. Expected non-empty \`string\`.`),t.jsx(gf.Provider,{scope:r,children:t.jsx(bf,{scope:r,label:o,duration:i,swipeDirection:a,swipeThreshold:s,toastCount:d,viewport:l,onViewportChange:u,onToastAdd:e.useCallback(()=>f(e=>e+1),[]),onToastRemove:e.useCallback(()=>f(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:c})})};Rf.displayName=vf;var Ef="ToastViewport",Tf=["F8"],_f="toast.viewportPause",Pf="toast.viewportResume",Sf=e.forwardRef((n,r)=>{const{__scopeToast:o,hotkey:i=Tf,label:a="Notifications ({hotkey})",...s}=n,c=Cf(Ef,o),l=wf(o),u=e.useRef(null),d=e.useRef(null),f=e.useRef(null),p=e.useRef(null),m=nt(r,p,c.onViewportChange),h=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=c.toastCount>0;e.useEffect(()=>{const e=e=>{0!==i.length&&i.every(t=>e[t]||e.code===t)&&p.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),e.useEffect(()=>{const e=u.current,t=p.current;if(v&&e&&t){const n=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(_f);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},r=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(Pf);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&r()},i=()=>{e.contains(document.activeElement)||r()};return e.addEventListener("focusin",n),e.addEventListener("focusout",o),e.addEventListener("pointermove",n),e.addEventListener("pointerleave",i),window.addEventListener("blur",n),window.addEventListener("focus",r),()=>{e.removeEventListener("focusin",n),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",n),e.removeEventListener("pointerleave",i),window.removeEventListener("blur",n),window.removeEventListener("focus",r)}}},[v,c.isClosePausedRef]);const g=e.useCallback(({tabbingDirection:e})=>{const t=l().map(t=>{const n=t.ref.current,r=[n,...zf(n)];return"forwards"===e?r:r.reverse()});return("forwards"===e?t.reverse():t).flat()},[l]);return e.useEffect(()=>{const e=p.current;if(e){const t=t=>{const n=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!n){const n=document.activeElement,r=t.shiftKey;if(t.target===e&&r)return void d.current?.focus();const o=g({tabbingDirection:r?"backwards":"forwards"}),i=o.findIndex(e=>e===n);Xf(o.slice(i+1))?t.preventDefault():r?d.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[l,g]),t.jsxs(In,{ref:u,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&t.jsx(Nf,{ref:d,onFocusFromOutsideViewport:()=>{Xf(g({tabbingDirection:"forwards"}))}}),t.jsx(gf.Slot,{scope:o,children:t.jsx(ct.ol,{tabIndex:-1,...s,ref:m})}),v&&t.jsx(Nf,{ref:f,onFocusFromOutsideViewport:()=>{Xf(g({tabbingDirection:"backwards"}))}})]})});Sf.displayName=Ef;var Df="ToastFocusProxy",Nf=e.forwardRef((e,n)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...i}=e,a=Cf(Df,r);return t.jsx(dt,{"aria-hidden":!0,tabIndex:0,...i,ref:n,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!a.viewport?.contains(t)&&o()}})});Nf.displayName=Df;var Mf="Toast",Af=e.forwardRef((e,n)=>{const{forceMount:r,open:o,defaultOpen:i,onOpenChange:a,...s}=e,[c,l]=yt({prop:o,defaultProp:i??!0,onChange:a,caller:Mf});return t.jsx(mf,{present:r||c,children:t.jsx(If,{open:c,...s,ref:n,onClose:()=>l(!1),onPause:En(e.onPause),onResume:En(e.onResume),onSwipeStart:pf(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:pf(e.onSwipeMove,e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${n}px`)}),onSwipeCancel:pf(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:pf(e.onSwipeEnd,e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${n}px`),l(!1)})})})});Af.displayName=Mf;var[Of,jf]=xf(Mf,{onClose(){}}),If=e.forwardRef((n,r)=>{const{__scopeToast:o,type:a="foreground",duration:s,open:c,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:p,onSwipeMove:m,onSwipeCancel:h,onSwipeEnd:v,...g}=n,w=Cf(Mf,o),[y,x]=e.useState(null),b=nt(r,e=>x(e)),C=e.useRef(null),R=e.useRef(null),E=s||w.duration,T=e.useRef(0),_=e.useRef(E),P=e.useRef(0),{onToastAdd:S,onToastRemove:D}=w,N=En(()=>{const e=y?.contains(document.activeElement);e&&w.viewport?.focus(),l()}),M=e.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(P.current),T.current=(new Date).getTime(),P.current=window.setTimeout(N,e))},[N]);e.useEffect(()=>{const e=w.viewport;if(e){const t=()=>{M(_.current),f?.()},n=()=>{const e=(new Date).getTime()-T.current;_.current=_.current-e,window.clearTimeout(P.current),d?.()};return e.addEventListener(_f,n),e.addEventListener(Pf,t),()=>{e.removeEventListener(_f,n),e.removeEventListener(Pf,t)}}},[w.viewport,E,d,f,M]),e.useEffect(()=>{c&&!w.isClosePausedRef.current&&M(E)},[c,E,w.isClosePausedRef,M]),e.useEffect(()=>(S(),()=>D()),[S,D]);const A=e.useMemo(()=>y?Bf(y):null,[y]);return w.viewport?t.jsxs(t.Fragment,{children:[A&&t.jsx(kf,{__scopeToast:o,role:"status","aria-live":"foreground"===a?"assertive":"polite","aria-atomic":!0,children:A}),t.jsx(Of,{scope:o,onClose:N,children:i.createPortal(t.jsx(gf.ItemSlot,{scope:o,children:t.jsx(jn,{asChild:!0,onEscapeKeyDown:pf(u,()=>{w.isFocusedToastEscapeKeyDownRef.current||N(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:t.jsx(ct.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":w.swipeDirection,...g,ref:b,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:pf(n.onKeyDown,e=>{"Escape"===e.key&&(u?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:pf(n.onPointerDown,e=>{0===e.button&&(C.current={x:e.clientX,y:e.clientY})}),onPointerMove:pf(n.onPointerMove,e=>{if(!C.current)return;const t=e.clientX-C.current.x,n=e.clientY-C.current.y,r=Boolean(R.current),o=["left","right"].includes(w.swipeDirection),i=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,a=o?i(0,t):0,s=o?0:i(0,n),c="touch"===e.pointerType?10:2,l={x:a,y:s},u={originalEvent:e,delta:l};r?(R.current=l,$f("toast.swipeMove",m,u,{discrete:!1})):Vf(l,w.swipeDirection,c)?(R.current=l,$f("toast.swipeStart",p,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(C.current=null)}),onPointerUp:pf(n.onPointerUp,e=>{const t=R.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),R.current=null,C.current=null,t){const n=e.currentTarget,r={originalEvent:e,delta:t};Vf(t,w.swipeDirection,w.swipeThreshold)?$f("toast.swipeEnd",v,r,{discrete:!0}):$f("toast.swipeCancel",h,r,{discrete:!0}),n.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),kf=n=>{const{__scopeToast:r,children:o,...i}=n,a=Cf(Mf,r),[s,c]=e.useState(!1),[l,u]=e.useState(!1);return function(e=()=>{}){const t=En(e);gt(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}(()=>c(!0)),e.useEffect(()=>{const e=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(e)},[]),l?null:t.jsx(Xn,{asChild:!0,children:t.jsx(dt,{...i,children:s&&t.jsxs(t.Fragment,{children:[a.label," ",o]})})})},Ff=e.forwardRef((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(ct.div,{...o,ref:n})});Ff.displayName="ToastTitle";var Lf=e.forwardRef((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(ct.div,{...o,ref:n})});Lf.displayName="ToastDescription";var Uf="ToastAction";e.forwardRef((e,n)=>{const{altText:r,...o}=e;return r.trim()?t.jsx(Kf,{altText:r,asChild:!0,children:t.jsx(Hf,{...o,ref:n})}):(console.error(`Invalid prop \`altText\` supplied to \`${Uf}\`. Expected non-empty \`string\`.`),null)}).displayName=Uf;var Wf="ToastClose",Hf=e.forwardRef((e,n)=>{const{__scopeToast:r,...o}=e,i=jf(Wf,r);return t.jsx(Kf,{asChild:!0,children:t.jsx(ct.button,{type:"button",...o,ref:n,onClick:pf(e.onClick,i.onClose)})})});Hf.displayName=Wf;var Kf=e.forwardRef((e,n)=>{const{__scopeToast:r,altText:o,...i}=e;return t.jsx(ct.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...i,ref:n})});function Bf(e){const t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const n=e.ariaHidden||e.hidden||"none"===e.style.display,r=""===e.dataset.radixToastAnnounceExclude;if(!n)if(r){const n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Bf(e))}}),t}function $f(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?lt(o,i):o.dispatchEvent(i)}var Vf=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return"left"===t||"right"===t?i&&r>n:!i&&o>n};function zf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xf(e){const t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var Gf=Rf,Yf=Sf,qf=Af,Zf=Ff,Jf=Lf,Qf=Hf;function ep(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var tp="Toggle",np=e.forwardRef((e,n)=>{const{pressed:r,defaultPressed:o,onPressedChange:i,...a}=e,[s,c]=yt({prop:r,onChange:i,defaultProp:o??!1,caller:tp});return t.jsx(ct.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:n,onClick:ep(e.onClick,()=>{e.disabled||c(!s)})})});function rp(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}np.displayName=tp;var op="rovingFocusGroup.onEntryFocus",ip={bubbles:!1,cancelable:!0},ap="RovingFocusGroup",[sp,cp,lp]=vt(ap),[up,dp]=mt(ap,[lp]),[fp,pp]=up(ap),mp=e.forwardRef((e,n)=>t.jsx(sp.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(sp.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(hp,{...e,ref:n})})}));mp.displayName=ap;var hp=e.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:o,orientation:i,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=n,m=e.useRef(null),h=nt(r,m),v=Kt(s),[g,w]=yt({prop:c,defaultProp:l??null,onChange:u,caller:ap}),[y,x]=e.useState(!1),b=En(d),C=cp(o),R=e.useRef(!1),[E,T]=e.useState(0);return e.useEffect(()=>{const e=m.current;if(e)return e.addEventListener(op,b),()=>e.removeEventListener(op,b)},[b]),t.jsx(fp,{scope:o,orientation:i,dir:v,loop:a,currentTabStopId:g,onItemFocus:e.useCallback(e=>w(e),[w]),onItemShiftTab:e.useCallback(()=>x(!0),[]),onFocusableItemAdd:e.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>T(e=>e-1),[]),children:t.jsx(ct.div,{tabIndex:y||0===E?-1:0,"data-orientation":i,...p,ref:h,style:{outline:"none",...n.style},onMouseDown:rp(n.onMouseDown,()=>{R.current=!0}),onFocus:rp(n.onFocus,e=>{const t=!R.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(op,ip);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=C().filter(e=>e.focusable);yp([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),f)}}R.current=!1}),onBlur:rp(n.onBlur,()=>x(!1))})})}),vp="RovingFocusGroupItem",gp=e.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:o,focusable:i=!0,active:a=!1,tabStopId:s,children:c,...l}=n,u=Tt(),d=s||u,f=pp(vp,o),p=f.currentTabStopId===d,m=cp(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=f;return e.useEffect(()=>{if(i)return h(),()=>v()},[i,h,v]),t.jsx(sp.ItemSlot,{scope:o,id:d,focusable:i,active:a,children:t.jsx(ct.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:r,onMouseDown:rp(n.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:rp(n.onFocus,()=>f.onItemFocus(d)),onKeyDown:rp(n.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:wp[r]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=f.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>yp(o))}var n,r}),children:"function"==typeof c?c({isCurrentTabStop:p,hasTabStop:null!=g}):c})})});gp.displayName=vp;var wp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yp(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var xp=mp,bp=gp,Cp="ToggleGroup",[Rp]=mt(Cp,[dp]),Ep=dp(),Tp=n.forwardRef((e,n)=>{const{type:r,...o}=e;if("single"===r){const e=o;return t.jsx(Sp,{...e,ref:n})}if("multiple"===r){const e=o;return t.jsx(Dp,{...e,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Cp}\``)});Tp.displayName=Cp;var[_p,Pp]=Rp(Cp),Sp=n.forwardRef((e,r)=>{const{value:o,defaultValue:i,onValueChange:a=()=>{},...s}=e,[c,l]=yt({prop:o,defaultProp:i??"",onChange:a,caller:Cp});return t.jsx(_p,{scope:e.__scopeToggleGroup,type:"single",value:n.useMemo(()=>c?[c]:[],[c]),onItemActivate:l,onItemDeactivate:n.useCallback(()=>l(""),[l]),children:t.jsx(Ap,{...s,ref:r})})}),Dp=n.forwardRef((e,r)=>{const{value:o,defaultValue:i,onValueChange:a=()=>{},...s}=e,[c,l]=yt({prop:o,defaultProp:i??[],onChange:a,caller:Cp}),u=n.useCallback(e=>l((t=[])=>[...t,e]),[l]),d=n.useCallback(e=>l((t=[])=>t.filter(t=>t!==e)),[l]);return t.jsx(_p,{scope:e.__scopeToggleGroup,type:"multiple",value:c,onItemActivate:u,onItemDeactivate:d,children:t.jsx(Ap,{...s,ref:r})})});Tp.displayName=Cp;var[Np,Mp]=Rp(Cp),Ap=n.forwardRef((e,n)=>{const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:i=!0,orientation:a,dir:s,loop:c=!0,...l}=e,u=Ep(r),d=Kt(s),f={role:"group",dir:d,...l};return t.jsx(Np,{scope:r,rovingFocus:i,disabled:o,children:i?t.jsx(xp,{asChild:!0,...u,orientation:a,dir:d,loop:c,children:t.jsx(ct.div,{...f,ref:n})}):t.jsx(ct.div,{...f,ref:n})})}),Op="ToggleGroupItem",jp=n.forwardRef((e,r)=>{const o=Pp(Op,e.__scopeToggleGroup),i=Mp(Op,e.__scopeToggleGroup),a=Ep(e.__scopeToggleGroup),s=o.value.includes(e.value),c=i.disabled||e.disabled,l={...e,pressed:s,disabled:c},u=n.useRef(null);return i.rovingFocus?t.jsx(bp,{asChild:!0,...a,focusable:!c,active:s,ref:u,children:t.jsx(Ip,{...l,ref:r})}):t.jsx(Ip,{...l,ref:r})});jp.displayName=Op;var Ip=n.forwardRef((e,n)=>{const{__scopeToggleGroup:r,value:o,...i}=e,a=Pp(Op,r),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},c="single"===a.type?s:void 0;return t.jsx(np,{...c,...i,ref:n,onPressedChange:e=>{e?a.onItemActivate(o):a.onItemDeactivate(o)}})}),kp=Tp,Fp=jp;function Lp(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var Up="Popper",[Wp,Hp]=mt(Up),[Kp,Bp]=Wp(Up),$p=n=>{const{__scopePopper:r,children:o}=n,[i,a]=e.useState(null);return t.jsx(Kp,{scope:r,anchor:i,onAnchorChange:a,children:o})};$p.displayName=Up;var Vp="PopperAnchor",zp=e.forwardRef((n,r)=>{const{__scopePopper:o,virtualRef:i,...a}=n,s=Bp(Vp,o),c=e.useRef(null),l=nt(r,c);return e.useEffect(()=>{s.onAnchorChange(i?.current||c.current)}),i?null:t.jsx(ct.div,{...a,ref:l})});zp.displayName=Vp;var Xp="PopperContent",[Gp,Yp]=Wp(Xp),qp=e.forwardRef((n,r)=>{const{__scopePopper:o,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=n,w=Bp(Xp,o),[y,x]=e.useState(null),b=nt(r,e=>x(e)),[C,R]=e.useState(null),E=$r(C),T=E?.width??0,_=E?.height??0,P=i+("center"!==s?"-"+s:""),S="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(d)?d:[d],N=D.length>0,M={padding:S,boundary:D.filter(em),altBoundary:N},{refs:A,floatingStyles:O,placement:j,isPositioned:I,middlewareData:k}=Ve({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>De(...e,{animationFrame:"always"===h}),elements:{reference:w.anchor},middleware:[Xe({mainAxis:a+_,alignmentAxis:c}),u&&Ge({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?Ye():void 0,...M}),u&&qe({...M}),Ze({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&Qe({element:C,padding:l}),tm({arrowWidth:T,arrowHeight:_}),m&&Je({strategy:"referenceHidden",...M})]}),[F,L]=nm(j),U=En(v);gt(()=>{I&&U?.()},[I,U]);const W=k.arrow?.x,H=k.arrow?.y,K=0!==k.arrow?.centerOffset,[B,$]=e.useState();return gt(()=>{y&&$(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:I?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(" "),...k.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:t.jsx(Gp,{scope:o,placedSide:F,onArrowChange:R,arrowX:W,arrowY:H,shouldHideArrow:K,children:t.jsx(ct.div,{"data-side":F,"data-align":L,...g,ref:b,style:{...g.style,animation:I?void 0:"none"}})})})});qp.displayName=Xp;var Zp="PopperArrow",Jp={top:"bottom",right:"left",bottom:"top",left:"right"},Qp=e.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=Yp(Zp,r),a=Jp[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(Gr,{...o,ref:n,style:{...o.style,display:"block"}})})});function em(e){return null!==e}Qp.displayName=Zp;var tm=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[c,l]=nm(n),u={start:"0%",center:"50%",end:"100%"}[l],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+s/2;let p="",m="";return"bottom"===c?(p=i?u:`${d}px`,m=-s+"px"):"top"===c?(p=i?u:`${d}px`,m=`${r.floating.height+s}px`):"right"===c?(p=-s+"px",m=i?u:`${f}px`):"left"===c&&(p=`${r.floating.width+s}px`,m=i?u:`${f}px`),{data:{x:p,y:m}}}});function nm(e){const[t,n="center"]=e.split("-");return[t,n]}var rm=$p,om=zp,im=qp,am=Qp;var sm=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=cm(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=cm(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=cm(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=cm(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function cm(e){return e?.animationName||"none"}sm.displayName="Presence";var[lm]=mt("Tooltip",[Hp]),um=Hp(),dm="TooltipProvider",fm=700,pm="tooltip.open",[mm,hm]=lm(dm),vm=n=>{const{__scopeTooltip:r,delayDuration:o=fm,skipDelayDuration:i=300,disableHoverableContent:a=!1,children:s}=n,c=e.useRef(!0),l=e.useRef(!1),u=e.useRef(0);return e.useEffect(()=>{const e=u.current;return()=>window.clearTimeout(e)},[]),t.jsx(mm,{scope:r,isOpenDelayedRef:c,delayDuration:o,onOpen:e.useCallback(()=>{window.clearTimeout(u.current),c.current=!1},[]),onClose:e.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i)},[i]),isPointerInTransitRef:l,onPointerInTransitChange:e.useCallback(e=>{l.current=e},[]),disableHoverableContent:a,children:s})};vm.displayName=dm;var gm="Tooltip",[wm,ym]=lm(gm),xm=n=>{const{__scopeTooltip:r,children:o,open:i,defaultOpen:a,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=n,u=hm(gm,n.__scopeTooltip),d=um(r),[f,p]=e.useState(null),m=Tt(),h=e.useRef(0),v=c??u.disableHoverableContent,g=l??u.delayDuration,w=e.useRef(!1),[y,x]=yt({prop:i,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(pm))):u.onClose(),s?.(e)},caller:gm}),b=e.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),C=e.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w.current=!1,x(!0)},[x]),R=e.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),E=e.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w.current=!0,x(!0),h.current=0},g)},[g,x]);return e.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),t.jsx(rm,{...d,children:t.jsx(wm,{scope:r,contentId:m,open:y,stateAttribute:b,trigger:f,onTriggerChange:p,onTriggerEnter:e.useCallback(()=>{u.isOpenDelayedRef.current?E():C()},[u.isOpenDelayedRef,E,C]),onTriggerLeave:e.useCallback(()=>{v?R():(window.clearTimeout(h.current),h.current=0)},[R,v]),onOpen:C,onClose:R,disableHoverableContent:v,children:o})})};xm.displayName=gm;var bm="TooltipTrigger",Cm=e.forwardRef((n,r)=>{const{__scopeTooltip:o,...i}=n,a=ym(bm,o),s=hm(bm,o),c=um(o),l=nt(r,e.useRef(null),a.onTriggerChange),u=e.useRef(!1),d=e.useRef(!1),f=e.useCallback(()=>u.current=!1,[]);return e.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),t.jsx(om,{asChild:!0,...c,children:t.jsx(ct.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:Lp(n.onPointerMove,e=>{"touch"!==e.pointerType&&(d.current||s.isPointerInTransitRef.current||(a.onTriggerEnter(),d.current=!0))}),onPointerLeave:Lp(n.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Lp(n.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Lp(n.onFocus,()=>{u.current||a.onOpen()}),onBlur:Lp(n.onBlur,a.onClose),onClick:Lp(n.onClick,a.onClose)})})});Cm.displayName=bm;var Rm="TooltipPortal",[Em,Tm]=lm(Rm,{forceMount:void 0}),_m=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,a=ym(Rm,n);return t.jsx(Em,{scope:n,forceMount:r,children:t.jsx(sm,{present:r||a.open,children:t.jsx(Xn,{asChild:!0,container:i,children:o})})})};_m.displayName=Rm;var Pm="TooltipContent",Sm=e.forwardRef((e,n)=>{const r=Tm(Pm,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...a}=e,s=ym(Pm,e.__scopeTooltip);return t.jsx(sm,{present:o||s.open,children:s.disableHoverableContent?t.jsx(Om,{side:i,...a,ref:n}):t.jsx(Dm,{side:i,...a,ref:n})})}),Dm=e.forwardRef((n,r)=>{const o=ym(Pm,n.__scopeTooltip),i=hm(Pm,n.__scopeTooltip),a=e.useRef(null),s=nt(r,a),[c,l]=e.useState(null),{trigger:u,onClose:d}=o,f=a.current,{onPointerInTransitChange:p}=i,m=e.useCallback(()=>{l(null),p(!1)},[p]),h=e.useCallback((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);l(i),p(!0)},[p]);return e.useEffect(()=>()=>m(),[m]),e.useEffect(()=>{if(u&&f){const e=e=>h(e,f),t=e=>h(e,u);return u.addEventListener("pointerleave",e),f.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),f.removeEventListener("pointerleave",t)}}},[u,f,h,m]),e.useEffect(()=>{if(c){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const e=t[i],s=t[a],c=e.x,l=e.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(o=!o)}return o}(n,c);r?m():o&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,f,c,d,m]),t.jsx(Om,{...n,ref:s})}),[Nm,Mm]=lm(gm,{isInside:!1}),Am=at("TooltipContent"),Om=e.forwardRef((n,r)=>{const{__scopeTooltip:o,children:i,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=n,u=ym(Pm,o),d=um(o),{onClose:f}=u;return e.useEffect(()=>(document.addEventListener(pm,f),()=>document.removeEventListener(pm,f)),[f]),e.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&f()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,f]),t.jsx(Nn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:t.jsxs(im,{"data-state":u.stateAttribute,...d,...l,ref:r,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(Am,{children:i}),t.jsx(Nm,{scope:o,isInside:!0,children:t.jsx(ft,{id:u.contentId,role:"tooltip",children:a||i})})]})})});Sm.displayName=Pm;var jm="TooltipArrow";e.forwardRef((e,n)=>{const{__scopeTooltip:r,...o}=e,i=um(r);return Mm(jm,r).isInside?null:t.jsx(am,{...i,...o,ref:n})}).displayName=jm;var Im=vm,km=xm,Fm=Cm,Lm=_m,Um=Sm;var Wm=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Hm(o.current);a.current="mounted"===c?e:"none"},[c]),gt(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=Hm(e);if(t)l("MOUNT");else if("none"===o||"none"===e?.display)l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),gt(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=Hm(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=Hm(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=nt(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function Hm(e){return e?.animationName||"none"}Wm.displayName="Presence";var Km="Dialog",[Bm]=mt(Km),[$m,Vm]=Bm(Km),zm=n=>{const{__scopeDialog:r,children:o,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=n,l=e.useRef(null),u=e.useRef(null),[d,f]=yt({prop:i,defaultProp:a??!1,onChange:s,caller:Km});return t.jsx($m,{scope:r,triggerRef:l,contentRef:u,contentId:Tt(),titleId:Tt(),descriptionId:Tt(),open:d,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),modal:c,children:o})};zm.displayName=Km;var Xm="DialogTrigger";e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Vm(Xm,r),a=nt(n,i.triggerRef);return t.jsx(ct.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":uh(i.open),...o,ref:a,onClick:Rn(e.onClick,i.onOpenToggle)})}).displayName=Xm;var Gm="DialogPortal",[Ym,qm]=Bm(Gm,{forceMount:void 0}),Zm=n=>{const{__scopeDialog:r,forceMount:o,children:i,container:a}=n,s=Vm(Gm,r);return t.jsx(Ym,{scope:r,forceMount:o,children:e.Children.map(i,e=>t.jsx(Wm,{present:o||s.open,children:t.jsx(Xn,{asChild:!0,container:a,children:e})}))})};Zm.displayName=Gm;var Jm="DialogOverlay",Qm=e.forwardRef((e,n)=>{const r=qm(Jm,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=Vm(Jm,e.__scopeDialog);return a.modal?t.jsx(Wm,{present:o||a.open,children:t.jsx(th,{...i,ref:n})}):null});Qm.displayName=Jm;var eh=rt("DialogOverlay.RemoveScroll"),th=e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Vm(Jm,r);return t.jsx(Ir,{as:eh,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(ct.div,{"data-state":uh(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),nh="DialogContent",rh=e.forwardRef((e,n)=>{const r=qm(nh,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=Vm(nh,e.__scopeDialog);return t.jsx(Wm,{present:o||a.open,children:a.modal?t.jsx(oh,{...i,ref:n}):t.jsx(ih,{...i,ref:n})})});rh.displayName=nh;var oh=e.forwardRef((n,r)=>{const o=Vm(nh,n.__scopeDialog),i=e.useRef(null),a=nt(r,o.contentRef,i);return e.useEffect(()=>{const e=i.current;if(e)return Kr(e)},[]),t.jsx(ah,{...n,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rn(n.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Rn(n.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Rn(n.onFocusOutside,e=>e.preventDefault())})}),ih=e.forwardRef((n,r)=>{const o=Vm(nh,n.__scopeDialog),i=e.useRef(!1),a=e.useRef(!1);return t.jsx(ah,{...n,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{n.onCloseAutoFocus?.(e),e.defaultPrevented||(i.current||o.triggerRef.current?.focus(),e.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:e=>{n.onInteractOutside?.(e),e.defaultPrevented||(i.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const t=e.target,r=o.triggerRef.current?.contains(t);r&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),ah=e.forwardRef((n,r)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,...c}=n,l=Vm(nh,o),u=e.useRef(null),d=nt(r,u);return Yn(),t.jsxs(t.Fragment,{children:[t.jsx(Un,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:s,children:t.jsx(Nn,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":uh(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(mh,{titleId:l.titleId}),t.jsx(hh,{contentRef:u,descriptionId:l.descriptionId})]})]})}),sh="DialogTitle";e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Vm(sh,r);return t.jsx(ct.h2,{id:i.titleId,...o,ref:n})}).displayName=sh;var ch="DialogDescription";e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Vm(ch,r);return t.jsx(ct.p,{id:i.descriptionId,...o,ref:n})}).displayName=ch;var lh="DialogClose";function uh(e){return e?"open":"closed"}e.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,i=Vm(lh,r);return t.jsx(ct.button,{type:"button",...o,ref:n,onClick:Rn(e.onClick,()=>i.onOpenChange(!1))})}).displayName=lh;var dh="DialogTitleWarning",[fh,ph]=pt(dh,{contentName:nh,titleName:sh,docsSlug:"dialog"}),mh=({titleId:t})=>{const n=ph(dh),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)||console.error(r)}},[r,t]),null},hh=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ph("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(r)}},[r,t,n]),null},vh=zm,gh=Zm,wh=Qm,yh=rh;export{js as $,Ye as A,g as B,Zf as C,Jf as D,Qf as E,ft as F,In as G,Un as H,Kl as I,Bl as J,Vs as K,Is as L,$s as M,zs as N,Gs as O,Gf as P,Xs as Q,qf as R,Hs as S,ys as T,Zs as U,Yf as V,Ys as W,Qs as X,ec as Y,Js as Z,qs as _,v as a,Tt as a$,Ea as a0,Ta as a1,_a as a2,Pa as a3,Da as a4,Sa as a5,Na as a6,Oa as a7,ja as a8,Aa as a9,rf as aA,of as aB,af as aC,sf as aD,lf as aE,uf as aF,df as aG,cf as aH,ff as aI,_u as aJ,Pu as aK,Su as aL,Du as aM,Nu as aN,kp as aO,Fp as aP,km as aQ,Fm as aR,Lm as aS,Um as aT,Zc as aU,Qc as aV,el as aW,tl as aX,nl as aY,rl as aZ,Jc as a_,Ma as aa,Oe as ab,Ae as ac,Ne as ad,ke as ae,je as af,Me as ag,Ie as ah,Fe as ai,Ue as aj,hs as ak,vs as al,gs as am,ws as an,bs as ao,wn as ap,yn as aq,xn as ar,bn as as,Cn as at,xs as au,Im as av,zn as aw,ef as ax,tf as ay,nf as az,m as b,ct as b0,vh as b1,gh as b2,wh as b3,yh as b4,tt as b5,u as c,p as d,d as e,U as f,P as g,T as h,h as i,_ as j,D as k,B as l,oe as m,Y as n,V as o,X as p,K as q,Je as r,$ as s,qe as t,Ve as u,Ze as v,G as w,De as x,Xe as y,Ge as z};
