@radui/ui 0.0.35 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1 @@
1
- 'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as c,isValidElement as u}from"react";import{jsxs as a,jsx as s}from"react/jsx-runtime";import*as f from"react-dom";var d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var m=n(null);function v(){return"undefined"!=typeof window}function h(e){return w(e)?(e.nodeName||"").toLowerCase():"#document"}function g(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function y(e){var t;return null==(t=(w(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function w(e){return!!v()&&(e instanceof Node||e instanceof g(e).Node)}function b(e){return!!v()&&(e instanceof Element||e instanceof g(e).Element)}function x(e){return!!v()&&(e instanceof HTMLElement||e instanceof g(e).HTMLElement)}function E(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof g(e).ShadowRoot)}function R(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=A(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function C(e){return["table","td","th"].includes(h(e))}function S(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function L(e){const t=P(),n=b(e)?A(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function P(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function O(e){return["html","body","#document"].includes(h(e))}function A(e){return g(e).getComputedStyle(e)}function T(e){return b(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(e){if("html"===h(e))return e;const t=e.assignedSlot||e.parentNode||E(e)&&e.host||y(e);return E(t)?t.host:t}function N(e){const t=k(e);return O(t)?e.ownerDocument?e.ownerDocument.body:e.body:x(t)&&R(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),l=g(o);if(i){const e=D(l);return t.concat(l,l.visualViewport||[],R(o)?o:[],e&&n?M(e):[])}return t.concat(o,M(o,[],n))}function D(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&E(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function F(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function B(e){return(null==e?void 0:e.ownerDocument)||document}function H(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function W(e){return"composedPath"in e?e.composedPath()[0]:e.target}const j=["top","right","bottom","left"],V=Math.min,_=Math.max,z=Math.round,q=Math.floor,K=e=>({x:e,y:e}),U={left:"right",right:"left",bottom:"top",top:"bottom"},X={start:"end",end:"start"};function Y(e,t,n){return _(e,V(t,n))}function $(e,t){return"function"==typeof e?e(t):e}function Z(e){return e.split("-")[0]}function G(e){return e.split("-")[1]}function Q(e){return"x"===e?"y":"x"}function J(e){return"y"===e?"height":"width"}function ee(e){return["top","bottom"].includes(Z(e))?"y":"x"}function te(e){return Q(ee(e))}function ne(e){return e.replace(/start|end/g,(e=>X[e]))}function re(e){return e.replace(/left|right|bottom|top/g,(e=>U[e]))}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}}
2
- /*!
3
- * tabbable 6.2.0
4
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var le=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ce="undefined"==typeof Element,ue=ce?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ae=!ce&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},se=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},fe=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!se(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{ue.call(l,le)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var a=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),s=!se(a,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(a&&s){var f=e(!0===a?l.children:a.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},de=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},pe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!de(e)?0:e.tabIndex},me=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ve=function(e){return"INPUT"===e.tagName},he=function(e){return function(e){return ve(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ae(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},ge=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ye=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ue.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ue.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ge(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=ae(e);if(l&&!l.shadowRoot&&!0===r(l))return ge(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,r,o,i=e&&ae(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&l;){var u,a,s;c=!(null===(a=l=null===(u=i=ae(l))||void 0===u?void 0:u.host)||void 0===a||null===(s=a.ownerDocument)||void 0===s||!s.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},we=function(e,t){return!(t.disabled||se(t)||function(e){return ve(e)&&"hidden"===e.type}(t)||ye(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ue.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},be=function(e,t){return!(he(t)||pe(t)<0||!we(e,t))},xe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ee=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=pe(e);return n<0&&t&&!de(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(me).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Re=function(e,t){var n;return n=(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xe}):function(e,t,n){if(se(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(le));return t&&ue.call(e,le)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,be.bind(null,t)),Ee(n)};function Ce(e,t,n){let{reference:r,floating:o}=e;const i=ee(t),l=te(t),c=J(l),u=Z(t),a="y"===i,s=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:s,y:r.y-o.height};break;case"bottom":p={x:s,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(G(t)){case"start":p[l]-=d*(n&&a?-1:1);break;case"end":p[l]+=d*(n&&a?-1:1)}return p}async function Se(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=$(t,e),m=oe(p),v=c[d?"floating"===f?"reference":"floating":f],h=ie(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:s,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=ie(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function Le(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pe(e){return j.some((t=>e[t]>=0))}function Oe(e){const t=A(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=z(n)!==i||z(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Ae(e){return b(e)?e:e.contextElement}function Te(e){const t=Ae(e);if(!x(t))return K(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Oe(t);let l=(i?z(n.width):n.width)/r,c=(i?z(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const ke=K(0);function Ne(e){const t=g(e);return P()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ke}function Me(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ae(e);let l=K(1);t&&(r?b(r)&&(l=Te(r)):l=Te(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==g(e))&&t}(i,n,r)?Ne(i):K(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,s=o.width/l.x,f=o.height/l.y;if(i){const e=g(i),t=r&&b(r)?g(r):r;let n=e,o=D(n);for(;o&&r&&t!==n;){const e=Te(o),t=o.getBoundingClientRect(),r=A(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,s*=e.x,f*=e.y,u+=i,a+=l,n=g(o),o=D(n)}}return ie({width:s,height:f,x:u,y:a})}function De(e,t){const n=T(e).scrollLeft;return t?t.left+n:Me(y(e)).left+n}function Ie(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:De(e,r)),y:r.top+t.scrollTop}}function Fe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=g(e),r=y(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;const e=P();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=T(e),r=e.ownerDocument.body,o=_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+De(e);const c=-n.scrollTop;return"rtl"===A(r).direction&&(l+=_(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(y(e));else if(b(t))r=function(e,t){const n=Me(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?Te(e):K(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=Ne(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ie(r)}function Be(e,t){const n=k(e);return!(n===t||!b(n)||O(n))&&("fixed"===A(n).position||Be(n,t))}function He(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=Me(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=K(0);if(r||!r&&!i)if(("body"!==h(t)||R(o))&&(c=T(t)),r){const e=Me(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=De(o));const a=!o||r||i?K(0):Ie(o,c);return{x:l.left+c.scrollLeft-u.x-a.x,y:l.top+c.scrollTop-u.y-a.y,width:l.width,height:l.height}}function We(e){return"static"===A(e).position}function je(e,t){if(!x(e)||"fixed"===A(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function Ve(e,t){const n=g(e);if(S(e))return n;if(!x(e)){let t=k(e);for(;t&&!O(t);){if(b(t)&&!We(t))return t;t=k(t)}return n}let r=je(e,t);for(;r&&C(r)&&We(r);)r=je(r,t);return r&&O(r)&&We(r)&&!L(r)?n:r||function(e){let t=k(e);for(;x(t)&&!O(t);){if(L(t))return t;if(S(t))return null;t=k(t)}return null}(e)||n}const _e={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),c=!!t&&S(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=K(1);const s=K(0),f=x(r);if((f||!f&&!i)&&(("body"!==h(r)||R(l))&&(u=T(r)),x(r))){const e=Me(r);a=Te(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const d=!l||f||i?K(0):Ie(l,u,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+s.x+d.x,y:n.y*a.y-u.scrollTop*a.y+s.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?S(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=M(e,[],!1).filter((e=>b(e)&&"body"!==h(e))),o=null;const i="fixed"===A(e).position;let l=i?k(e):e;for(;b(l)&&!O(l);){const t=A(l),n=L(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&Be(e,l))?r=r.filter((e=>e!==l)):o=t,l=k(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=Fe(t,n,o);return e.top=_(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=_(r.left,e.left),e}),Fe(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Ve,getElementRects:async function(e){const t=this.getOffsetParent||Ve,n=this.getDimensions,r=await n(e.floating);return{reference:He(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}=Oe(e);return{width:t,height:n}},getScale:Te,isElement:b,isRTL:function(e){return"rtl"===A(e).direction}};function ze(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qe(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,a=Ae(e),s=o||i?[...a?M(a):[],...M(t)]:[];s.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=a&&c?function(e,t){let n,r=null;const o=y(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const a=e.getBoundingClientRect(),{left:s,top:f,width:d,height:p}=a;if(c||t(),!d||!p)return;const m={rootMargin:-q(f)+"px "+-q(o.clientWidth-(s+d))+"px "+-q(o.clientHeight-(f+p))+"px "+-q(s)+"px",threshold:_(0,V(1,u))||1};let v=!0;function h(t){const r=t[0].intersectionRatio;if(r!==u){if(!v)return l();r?l(!1,r):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}1!==r||ze(a,e.getBoundingClientRect())||l(),v=!1}try{r=new IntersectionObserver(h,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),i}(a,n):null;let d,p=-1,m=null;l&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),n()})),a&&!u&&m.observe(a),m.observe(t));let v=u?Me(e):null;return u&&function t(){const r=Me(e);v&&!ze(v,r)&&n();v=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(d)}}const Ke=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=Z(n),c=G(n),u="y"===ee(n),a=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=$(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*s,y:d*a}:{x:d*a,y:p*s}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}},Ue=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=$(e,t),a={x:n,y:r},s=await Se(t,u),f=ee(Z(o)),d=Q(f);let p=a[d],m=a[f];if(i){const e="y"===d?"bottom":"right";p=Y(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";m=Y(m+s["y"===f?"top":"left"],m,m-s[e])}const v=c.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Xe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:a}=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=$(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=Z(o),y=ee(c),w=Z(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(a.floating)),x=d||(w||!v?[re(c)]:function(e){const t=re(e);return[ne(e),t,ne(t)]}(c)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=G(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(Z(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ne)))),i}(c,v,m,b));const R=[c,...x],C=await Se(t,h),S=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(s&&S.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=G(e),o=te(e),i=J(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=re(l)),[l,re(l)]}(o,l,b);S.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:S}],!S.every((e=>e<=0))){var P,O;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(O=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:O.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=L.filter((e=>{if(E){const t=ee(e.placement);return t===y||"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:A[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},Ye=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=$(e,t);switch(r){case"referenceHidden":{const e=Le(await Se(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pe(e)}}}case"escaped":{const e=Le(await Se(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pe(e)}}}default:return{}}}}},$e=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:a,padding:s=0}=$(e,t)||{};if(null==a)return{};const f=oe(s),d={x:n,y:r},p=te(o),m=J(p),v=await l.getDimensions(a),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,L=V(f[g],S),P=V(f[y],S),O=L,A=R-v[m]-P,T=R/2-v[m]/2+C,k=Y(O,T,A),N=!u.arrow&&null!=G(o)&&T!==k&&i.reference[m]/2-(T<O?L:P)-v[m]/2<0,M=N?T<O?T-O:T-A:0;return{[p]:d[p]+M,data:{[p]:k,centerOffset:T-k-M,...N&&{alignmentOffset:M}},reset:N}}}),Ze=(e,t,n)=>{const r=new Map,o={platform:_e,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:s,y:f}=Ce(a,r,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,data:y,reset:w}=await v({x:s,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:a,platform:l,elements:{reference:e,floating:t}});s=null!=h?h:s,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(a=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:s,y:f}=Ce(a,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Ge="undefined"!=typeof document?r:o;function Qe(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(!Qe(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)&&!Qe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Je(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function et(e,t){const n=Je(e);return Math.round(t*n)/n}function tt(t){const n=e.useRef(t);return Ge((()=>{n.current=t})),n}const nt=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?$e({element:n.current,padding:r}).fn(t):{}:n?$e({element:n,padding:r}).fn(t):{};var o}}),rt=(e,t)=>({...Ke(e),options:[e,t]}),ot=(e,t)=>({...Ue(e),options:[e,t]}),it=(e,t)=>({...Xe(e),options:[e,t]}),lt=(e,t)=>({...Ye(e),options:[e,t]}),ct={...e},ut=ct.useInsertionEffect||(e=>e());function at(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return ut((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var st="undefined"!=typeof document?r:o;let ft=!1,dt=0;const pt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dt++;const mt=ct.useId||function(){const[t,n]=e.useState((()=>ft?pt():void 0));return st((()=>{null==t&&n(pt())}),[]),e.useEffect((()=>{ft=!0}),[]),t};let vt;"production"!==process.env.NODE_ENV&&(vt=new Set);const ht=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:u=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:h,...g}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=vt)&&e.has(o)||(null==(i=vt)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=mt(),[b,x]=e.useState(!1);if(st((()=>{if(!o)return;"rtl"===A(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let S=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(S=null);const L=2*d,P=L/2,O=c/2*(f/-8+1),T=u/2*f/4,k=!!v,N=S&&"end"===R?"bottom":"top";let M=S&&"end"===R?"right":"left";S&&b&&(M="end"===R?"left":"right");const D=null!=(null==i?void 0:i.x)?S||i.x:"",I=null!=(null==i?void 0:i.y)?S||i.y:"",F=v||"M0,0 H"+c+" L"+(c-O)+","+(u-T)+" Q"+c/2+","+u+" "+O+","+(u-T)+" Z",B={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[E];return a("svg",{...y,"aria-hidden":!0,ref:n,width:k?c:c+L,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[M]:D,[N]:I,[E]:C||k?"100%":"calc(100% - "+L/2+"px)",transform:[B,h].filter((e=>!!e)).join(" "),...g},children:[L>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:L+(v?0:1),d:F}),s("path",{stroke:L&&!v?y.fill:"none",d:F}),s("clipPath",{id:w,children:s("rect",{x:-P,y:P*(k?-1:1),width:c+L,height:c})})]})}));const gt=e.createContext(null),yt=e.createContext(null),wt=()=>{var t;return(null==(t=e.useContext(gt))?void 0:t.id)||null},bt=()=>e.useContext(yt);function xt(e){return"data-floating-ui-"+e}function Et(e){const t=i(e);return st((()=>{t.current=e})),t}const Rt=xt("safe-polygon");function Ct(e,t,n){return n&&!F(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function St(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const Lt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Pt(e,t){const n=Re(e,Lt());"prev"===t&&n.reverse();const r=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}(B(e)));return n.slice(r+1)[0]}function Ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!I(n,r)}function At(e){Re(e,Lt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Tt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const kt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Nt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Mt=e.forwardRef((function(t,n){const[r,o]=e.useState();st((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Nt),()=>{document.removeEventListener("keydown",Nt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[xt("focus-guard")]:"",style:kt};return s("span",{...t,...i})})),Dt=e.createContext(null),It=xt("portal");function Ft(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=mt(),i=Bt(),[l,c]=e.useState(null),u=e.useRef(null);return st((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),st((()=>{if(!o)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(It,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),st((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(It,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[c,u]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),h=null==c?void 0:c.modal,g=null==c?void 0:c.open,y=!!c&&!c.modal&&c.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!h)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&Ot(e)){("focusin"===e.type?Tt:At)(l)}}}),[l,i,h]),e.useEffect((()=>{l&&(g||Tt(l))}),[g,l]),a(Dt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:u})),[i,l]),children:[y&&l&&s(Mt,{"data-type":"outside",ref:d,onFocus:e=>{if(Ot(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Pt(document.body,"prev")||(null==c?void 0:c.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:kt}),l&&f.createPortal(n,l),y&&l&&s(Mt,{"data-type":"outside",ref:p,onFocus:e=>{if(Ot(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Pt(document.body,"next")||(null==c?void 0:c.domReference);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Bt=()=>e.useContext(Dt),Ht="data-floating-ui-focusable",Wt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},jt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Vt=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function _t(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=mt(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),u=null!=wt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=vt)&&e.has(o)||(null==(i=vt)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,s]=e.useState(o.reference),f=at(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:s})),[]),p=e.useMemo((()=>({reference:a||o.reference||null,floating:o.floating||null,domReference:o.reference})),[a,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}function zt(t){void 0===t&&(t={});const{nodeId:n}=t,r=_t({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,c]=e.useState(null),[u,a]=e.useState(null),s=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=bt();st((()=>{s&&(d.current=s)}),[s]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:c}={},transform:u=!0,whileElementsMounted:a,open:s}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);Qe(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=l||h,R=c||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),P=null!=a,O=tt(a),A=tt(i),T=tt(s),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),Ze(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};N.current&&!Qe(L.current,t)&&(L.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,A,T]);Ge((()=>{!1===s&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[s]);const N=e.useRef(!1);Ge((()=>(N.current=!0,()=>{N.current=!1})),[]),Ge((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(O.current)return O.current(E,R,k);k()}}),[E,R,k,O,P]);const M=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=et(D.floating,d.x),n=et(D.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...Je(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:M,elements:D,floatingStyles:I})),[d,k,M,D,I])}({...t,elements:{...i,...u&&{reference:u}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),m.refs.setReference(t)}),[m.refs]),h=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,c(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),g=e.useMemo((()=>({...m.refs,setReference:h,setPositionReference:v,domReference:d})),[m.refs,h,v]),y=e.useMemo((()=>({...m.elements,domReference:s})),[m.elements,s]),w=e.useMemo((()=>({...m,...o,refs:g,elements:y,nodeId:n})),[m,g,y,n,o]);return st((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:g,elements:y})),[m,g,y,w])}const qt="active",Kt="selected";function Ut(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[qt]:t,[Kt]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Ht]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[qt,Kt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const Xt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Yt(n){var r=n.children,o=n.popperName,c=void 0===o?"":o,u=n.customRootClass,a=void 0===u?"":u,s=n.placement,f=void 0===s?"top":s,d=n.open,v=void 0!==d&&d;p(n,["children","popperName","customRootClass","placement","open"]);var h,g,y=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(a,c),w=i(null),E=l(v),R=E[0],C=E[1],S=zt({placement:f,whileElementsMounted:qe,open:R,middleware:[(h={element:w,padding:4},{...nt(h),options:[h,g]}),rt(9),it({mainAxis:!0,fallbackStrategy:"initialPlacement"}),ot({crossAxis:!1}),lt({strategy:"referenceHidden"})],onOpenChange:C}),L=S.context,T=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=null!=(r=Xt.get(c))?r:c,a=mt(),s=null!=wt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:a},..."menu"===u&&s&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,s,o,a,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":a}}}),[u,i,a,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])}(L),N=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:a=!0,outsidePressEvent:s="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,h=bt(),g=at("function"==typeof a?a:()=>!1),y="function"==typeof a?g:a,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=Vt(m),{escapeKey:S,outsidePress:L}=Vt(v),T=e.useRef(!1),N=at((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(T.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=h?St(h.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),D=at((e=>{var t;const n=()=>{var t;N(e),null==(t=W(e))||t.removeEventListener("keydown",n)};null==(t=W(e))||t.addEventListener("keydown",n)})),F=at((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const c=W(e),u="["+xt("inert")+"]",a=B(i.floating).querySelectorAll(u);let f=b(c)?c:null;for(;f&&!O(f);){const e=k(f);if(O(e)||!b(e))break;f=e}if(a.length&&b(c)&&!c.matches("html,body")&&!I(c,i.floating)&&Array.from(a).every((e=>!I(f,e))))return;if(x(c)&&_){const t=O(c),n=A(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,a="rtl"===n.direction,s=u&&(a?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(s||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=h&&St(h.nodesRef.current,d).some((t=>{var n;return H(e,null==(n=t.context)?void 0:n.elements.floating)}));if(H(e,i.floating)||H(e,i.domReference)||p)return;const m=h?St(h.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),j=at((e=>{var t;const n=()=>{var t;F(e),null==(t=W(e))||t.removeEventListener(s,n)};null==(t=W(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),T.current=!0}function a(){e=window.setTimeout((()=>{T.current=!1}),P()?5:0)}const f=B(i.floating);u&&(f.addEventListener("keydown",S?D:N,S),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",a)),y&&f.addEventListener(s,L?j:F,L);let d=[];return p&&(b(i.domReference)&&(d=M(i.domReference)),b(i.floating)&&(d=d.concat(M(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(M(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",S?D:N,S),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",a)),y&&f.removeEventListener(s,L?j:F,L),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,y,s,r,o,p,c,R,C,N,S,D,F,L,j]),e.useEffect((()=>{w.current=!1}),[y,s]);const V=e.useMemo((()=>({onKeyDown:N,...f&&{[Wt[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[N,o,f,d]),_=e.useMemo((()=>({onKeyDown:N,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[jt[s]]:()=>{w.current=!0}})),[N,s]);return e.useMemo((()=>c?{reference:V,floating:_}:{}),[c,V,_])}(L),D=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:a=0,handleClose:s=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=bt(),v=wt(),h=Et(s),g=Et(a),y=Et(r),w=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),L=e.useRef((()=>{})),P=e.useRef(!1),O=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,P.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!h.current)return;if(!r)return;function e(e){O()&&o(!1,e,"hover")}const t=B(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,h,O]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Ct(g.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[g,o]),T=at((()=>{L.current(),E.current=void 0})),k=at((()=>{if(S.current){const e=B(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Rt),S.current=!1}})),N=at((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&b(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!F(w.current)||d>0&&!Ct(g.current,"open"))return;const t=Ct(g.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(N())return;L.current();const t=B(c.floating);if(clearTimeout(R.current),P.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),T(),N()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!I(c.floating,e.relatedTarget))&&A(e)}function l(e){N()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),T(),N()||A(e)}})(e))}}),[c,u,t,f,d,p,A,T,k,o,r,y,m,g,h,i,N]),st((()=>{var e;if(u&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&O()){S.current=!0;const e=c.floating;if(b(c.domReference)&&e){var t;const n=B(c.floating).body;n.setAttribute(Rt,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,v,c,m,h,O]),st((()=>{r||(w.current=void 0,P.current=!1,T(),k())}),[r,T,k]),e.useEffect((()=>()=>{T(),clearTimeout(x.current),clearTimeout(R.current),k()}),[u,c.domReference,T,k]);const M=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!F(w.current)||r||0===d||P.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(P.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),D=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){N()||A(e.nativeEvent,!1)}})),[A,N]);return e.useMemo((()=>u?{reference:M,floating:D}:{}),[u,M,D])}(L,{}),j=function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>Ut(e,t,"reference")),n),l=e.useCallback((e=>Ut(e,t,"floating")),r),c=e.useCallback((e=>Ut(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([D,T,N]);return t.createElement(m.Provider,{value:{floatingArrowRef:w,dismiss:N,hover:D,role:T,interactions:j,floating:S,isOpen:R,setIsOpen:C,rootClass:y}},r)}function $t(){var e=c(m);if(null==e)throw new Error("Popper connot be used outside of popper context provider");return e}function Zt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Zt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Zt(e))&&(r&&(r+=" "),r+=t);return r}var Qt=["div","span","button","input"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,c=p(n,["asChild","children"]);if(i){var u=t.Children.toArray(l);if(1!==u.length||!t.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,d(d({},c),{ref:r}),l);var a=u[0];return t.cloneElement(a,d(d(d({},c),a.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var t=a.ref;"function"==typeof t?t(e):t&&(t.current=e)}}:{}))}return t.createElement(e,d(d({},c),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{});function Jt(e){var n=e.showArrow,r=void 0===n||n,o=e.className,i=void 0===o?"":o,l=e.children,c=$t(),a=c.isOpen,s=c.rootClass,f=c.floatingArrowRef,p=c.floating,m=c.interactions.getFloatingProps,v=p.refs.setFloating,h=p.floatingStyles,g=p.context;return a?t.createElement(Ft,{root:document.body},t.createElement(Qt.div,d({asChild:u(l),className:Gt("".concat(s,"-floating-element"),i),ref:v,style:h},m()),r&&t.createElement(ht,{className:Gt("rad-ui-arrow ".concat(s,"-arrow")),ref:f,context:g}),l)):null}function en(e){var n=e.children,r=e.className,o=void 0===r?"":r;p(e,["children","className"]);var i=$t(),l=i.rootClass,c=i.floating,a=i.interactions,s=c.refs.setReference,f=a.getReferenceProps;return t.createElement(Qt.span,d({asChild:u(n),className:Gt("rad-ui-popper","".concat(l,"-reference-element"),o),ref:s},f()),n)}var tn=function(e){var n=e.popperName,r=void 0===n?"":n,o=e.customRootClass,i=void 0===o?"":o,l=e.className,c=void 0===l?"":l,u=e.placement,a=void 0===u?"top":u,s=e.children,f=e.open,d=void 0!==f&&f,m=e.showArrow,v=void 0===m||m,h=e.pop,g=void 0===h?t.createElement(t.Fragment,null):h;return p(e,["popperName","customRootClass","className","placement","children","open","showArrow","pop"]),t.createElement(Yt,{customRootClass:i,popperName:r,placement:a,open:d},t.createElement(en,{className:c},s),t.createElement(Jt,{showArrow:v},g))};tn.displayName="Popper",tn.Root=Yt,tn.Trigger=en,tn.Content=Jt;var nn=function(e){var n=e.list,r=void 0===n?[]:n;e.selected;return t.createElement("div",{className:"relative"},t.createElement(tn,{open:!1,placement:"bottom-start",popperName:"dropdown",pop:t.createElement((function(){return t.createElement("ul",{className:"bg-white px-2 py-2 shadow-lg rounded-md"},r.map((function(e,n){return t.createElement("li",{key:n},e.value)})))}),null)},t.createElement("span",null,"Dropdown")))};export{nn as default};
1
+ 'use client';import e from"react";var t=function(t){return t.list,t.selected,e.createElement("div",{className:"relative"},e.createElement("span",null,"Dropdown"))};export{t as default};
@@ -1 +1 @@
1
- 'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,a=arguments.length;t<a;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},e.apply(this,arguments)};function t(r){var e,a,o="";if("string"==typeof r||"number"==typeof r)o+=r;else if("object"==typeof r)if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(a=t(r[e]))&&(o&&(o+=" "),o+=a)}else for(a in r)r[a]&&(o&&(o+=" "),o+=a);return o}function a(){for(var r,e,a=0,o="",n=arguments.length;a<n;a++)(r=arguments[a])&&(e=t(r))&&(o&&(o+=" "),o+=e);return o}"function"==typeof SuppressedError&&SuppressedError;var o=[{label:"H1",tag:"h1"},{label:"H2",tag:"h2"},{label:"H3",tag:"h3"},{label:"H4",tag:"h4"},{label:"H5",tag:"h5"},{label:"H6",tag:"h6"}],n=function(t){var n=t.children,l=t.as,i=void 0===l?"h1":l,c=t.customRootClass,f=void 0===c?"":c,s=t.className,u=void 0===s?"":s,p=function(r,e){var t={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(r);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(r,a[o])&&(t[a[o]]=r[a[o]])}return t}(t,["children","as","customRootClass","className"]),y=function(r,e){if(void 0===r&&(r=""),void 0===e&&(e=""),r)return r;if(!e)return"";var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(f,i||"h1"),h=o.find((function(r){return r.tag===i}))?i:"h1";return r.createElement(h,e({className:a(y,u)},p),n)};n.displayName="Heading";export{n as default};
1
+ 'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r){var e,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(o=t(r[e]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}function o(){for(var r,e,o=0,n="",a=arguments.length;o<a;o++)(r=arguments[o])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var n=function(t){var n=t.children,a=t.as,i=void 0===a?"h1":a,c=t.customRootClass,s=void 0===c?"":c,f=t.className,l=void 0===f?"":f,u=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}(t,["children","as","customRootClass","className"]),p=function(r,e){if(void 0===r&&(r=""),void 0===e&&(e=""),r)return r;if(!e)return"";var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(s,i);return["h1","h2","h3","h4","h5","h6"].includes(i)||(i="h1"),r.createElement(i,e({className:o(p,l)},u),n)};n.displayName="Heading";export{n as default};
@@ -1,5 +1,5 @@
1
- 'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as u}from"react";import{jsxs as c,jsx as s,Fragment as a}from"react/jsx-runtime";import*as f from"react-dom";var d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var m=n({});function v(){return"undefined"!=typeof window}function g(e){return w(e)?(e.nodeName||"").toLowerCase():"#document"}function h(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function y(e){var t;return null==(t=(w(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function w(e){return!!v()&&(e instanceof Node||e instanceof h(e).Node)}function b(e){return!!v()&&(e instanceof Element||e instanceof h(e).Element)}function x(e){return!!v()&&(e instanceof HTMLElement||e instanceof h(e).HTMLElement)}function E(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof h(e).ShadowRoot)}function R(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=A(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function C(e){return["table","td","th"].includes(g(e))}function S(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function L(e){const t=O(),n=b(e)?A(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function O(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function T(e){return["html","body","#document"].includes(g(e))}function A(e){return h(e).getComputedStyle(e)}function P(e){return b(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(e){if("html"===g(e))return e;const t=e.assignedSlot||e.parentNode||E(e)&&e.host||y(e);return E(t)?t.host:t}function M(e){const t=k(e);return T(t)?e.ownerDocument?e.ownerDocument.body:e.body:x(t)&&R(t)?t:M(t)}function D(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=M(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=h(o);if(i){const e=N(l);return t.concat(l,l.visualViewport||[],R(o)?o:[],e&&n?D(e):[])}return t.concat(o,D(o,[],n))}function N(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function F(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&E(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function W(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function H(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function j(e){return!H().includes("jsdom/")&&(!B()&&0===e.width&&0===e.height||B()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function B(){const e=/android/i;return e.test(W())||e.test(H())}function V(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function _(e){return(null==e?void 0:e.ownerDocument)||document}function q(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function K(e){return"composedPath"in e?e.composedPath()[0]:e.target}function X(e){e.preventDefault(),e.stopPropagation()}function U(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return x(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}const Y=["top","right","bottom","left"],$=Math.min,z=Math.max,Z=Math.round,G=e=>({x:e,y:e}),Q={left:"right",right:"left",bottom:"top",top:"bottom"},J={start:"end",end:"start"};function ee(e,t,n){return z(e,$(t,n))}function te(e,t){return"function"==typeof e?e(t):e}function ne(e){return e.split("-")[0]}function re(e){return e.split("-")[1]}function oe(e){return"x"===e?"y":"x"}function ie(e){return"y"===e?"height":"width"}function le(e){return["top","bottom"].includes(ne(e))?"y":"x"}function ue(e){return oe(le(e))}function ce(e){return e.replace(/start|end/g,(e=>J[e]))}function se(e){return e.replace(/left|right|bottom|top/g,(e=>Q[e]))}function ae(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 fe(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}}
1
+ 'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as u}from"react";import{jsxs as c,jsx as s,Fragment as a}from"react/jsx-runtime";import*as f from"react-dom";var d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var m=n({});function v(){return"undefined"!=typeof window}function g(e){return w(e)?(e.nodeName||"").toLowerCase():"#document"}function h(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function y(e){var t;return null==(t=(w(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function w(e){return!!v()&&(e instanceof Node||e instanceof h(e).Node)}function b(e){return!!v()&&(e instanceof Element||e instanceof h(e).Element)}function x(e){return!!v()&&(e instanceof HTMLElement||e instanceof h(e).HTMLElement)}function E(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof h(e).ShadowRoot)}function R(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=A(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function C(e){return["table","td","th"].includes(g(e))}function L(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function S(e){const t=O(),n=b(e)?A(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function O(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function T(e){return["html","body","#document"].includes(g(e))}function A(e){return h(e).getComputedStyle(e)}function P(e){return b(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(e){if("html"===g(e))return e;const t=e.assignedSlot||e.parentNode||E(e)&&e.host||y(e);return E(t)?t.host:t}function M(e){const t=k(e);return T(t)?e.ownerDocument?e.ownerDocument.body:e.body:x(t)&&R(t)?t:M(t)}function D(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=M(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=h(o);if(i){const e=N(l);return t.concat(l,l.visualViewport||[],R(o)?o:[],e&&n?D(e):[])}return t.concat(o,D(o,[],n))}function N(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function I(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&E(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function W(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function H(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function j(e){return!H().includes("jsdom/")&&(!V()&&0===e.width&&0===e.height||V()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function B(){return/apple/i.test(navigator.vendor)}function V(){const e=/android/i;return e.test(W())||e.test(H())}function _(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function q(e){return(null==e?void 0:e.ownerDocument)||document}function K(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function X(e){return"composedPath"in e?e.composedPath()[0]:e.target}function U(e){return x(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Y(e){e.preventDefault(),e.stopPropagation()}const $=["top","right","bottom","left"],z=Math.min,Z=Math.max,G=Math.round,Q=e=>({x:e,y:e}),J={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"};function te(e,t,n){return Z(e,z(t,n))}function ne(e,t){return"function"==typeof e?e(t):e}function re(e){return e.split("-")[0]}function oe(e){return e.split("-")[1]}function ie(e){return"x"===e?"y":"x"}function le(e){return"y"===e?"height":"width"}function ue(e){return["top","bottom"].includes(re(e))?"y":"x"}function ce(e){return ie(ue(e))}function se(e){return e.replace(/start|end/g,(e=>ee[e]))}function ae(e){return e.replace(/left|right|bottom|top/g,(e=>J[e]))}function fe(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 de(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}}
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var de=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),pe="undefined"==typeof Element,me=pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ve=!pe&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ge=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},he=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!ge(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{me.call(l,de)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!ge(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},ye=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},we=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ye(e)?0:e.tabIndex},be=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xe=function(e){return"INPUT"===e.tagName},Ee=function(e){return function(e){return xe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ve(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Re=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ce=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=me.call(e,"details>summary:first-of-type")?e.parentElement:e;if(me.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Re(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=ve(e);if(l&&!l.shadowRoot&&!0===r(l))return Re(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(function(e){var t,n,r,o,i=e&&ve(e),l=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=ve(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Se=function(e,t){return!(t.disabled||ge(t)||function(e){return xe(e)&&"hidden"===e.type}(t)||Ce(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!me.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Le=function(e,t){return!(Ee(t)||we(t)<0||!Se(e,t))},Oe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Te=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=we(e);return n<0&&t&&!ye(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(be).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ae=function(e,t){var n;return n=(t=t||{}).getShadowRoot?he([e],t.includeContainer,{filter:Le.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Oe}):function(e,t,n){if(ge(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(de));return t&&me.call(e,de)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Le.bind(null,t)),Te(n)};function Pe(e,t,n){let{reference:r,floating:o}=e;const i=le(t),l=ue(t),u=ie(l),c=ne(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[u]/2-o[u]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(re(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function ke(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=te(t,e),m=ae(p),v=u[d?"floating"===f?"reference":"floating":f],g=fe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=fe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function Me(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function De(e){return Y.some((t=>e[t]>=0))}function Ne(e){const t=A(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Z(n)!==i||Z(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Ie(e){return b(e)?e:e.contextElement}function Fe(e){const t=Ie(e);if(!x(t))return G(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ne(t);let l=(i?Z(n.width):n.width)/r,u=(i?Z(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const We=G(0);function He(e){const t=h(e);return O()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:We}function je(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ie(e);let l=G(1);t&&(r?b(r)&&(l=Fe(r)):l=Fe(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==h(e))&&t}(i,n,r)?He(i):G(0);let c=(o.left+u.x)/l.x,s=(o.top+u.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=h(i),t=r&&b(r)?h(r):r;let n=e,o=N(n);for(;o&&r&&t!==n;){const e=Fe(o),t=o.getBoundingClientRect(),r=A(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=h(o),o=N(n)}}return fe({width:a,height:f,x:c,y:s})}function Be(e,t){const n=P(e).scrollLeft;return t?t.left+n:je(y(e)).left+n}function Ve(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Be(e,r)),y:r.top+t.scrollTop}}function _e(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=h(e),r=y(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(o){i=o.width,l=o.height;const e=O();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=P(e),r=e.ownerDocument.body,o=z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Be(e);const u=-n.scrollTop;return"rtl"===A(r).direction&&(l+=z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(y(e));else if(b(t))r=function(e,t){const n=je(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?Fe(e):G(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=He(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fe(r)}function qe(e,t){const n=k(e);return!(n===t||!b(n)||T(n))&&("fixed"===A(n).position||qe(n,t))}function Ke(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=je(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=G(0);if(r||!r&&!i)if(("body"!==g(t)||R(o))&&(u=P(t)),r){const e=je(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Be(o));const s=!o||r||i?G(0):Ve(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.y-s.y,width:l.width,height:l.height}}function Xe(e){return"static"===A(e).position}function Ue(e,t){if(!x(e)||"fixed"===A(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function Ye(e,t){const n=h(e);if(S(e))return n;if(!x(e)){let t=k(e);for(;t&&!T(t);){if(b(t)&&!Xe(t))return t;t=k(t)}return n}let r=Ue(e,t);for(;r&&C(r)&&Xe(r);)r=Ue(r,t);return r&&T(r)&&Xe(r)&&!L(r)?n:r||function(e){let t=k(e);for(;x(t)&&!T(t);){if(L(t))return t;if(S(t))return null;t=k(t)}return null}(e)||n}const $e={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),u=!!t&&S(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=G(1);const a=G(0),f=x(r);if((f||!f&&!i)&&(("body"!==g(r)||R(l))&&(c=P(r)),x(r))){const e=je(r);s=Fe(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?G(0):Ve(l,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.scrollTop*s.y+a.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?S(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=D(e,[],!1).filter((e=>b(e)&&"body"!==g(e))),o=null;const i="fixed"===A(e).position;let l=i?k(e):e;for(;b(l)&&!T(l);){const t=A(l),n=L(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&qe(e,l))?r=r.filter((e=>e!==l)):o=t,l=k(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=_e(t,n,o);return e.top=z(r.top,e.top),e.right=$(r.right,e.right),e.bottom=$(r.bottom,e.bottom),e.left=z(r.left,e.left),e}),_e(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Ye,getElementRects:async function(e){const t=this.getOffsetParent||Ye,n=this.getDimensions,r=await n(e.floating);return{reference:Ke(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}=Ne(e);return{width:t,height:n}},getScale:Fe,isElement:b,isRTL:function(e){return"rtl"===A(e).direction}},ze=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=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)),l=ne(n),u=re(n),c="y"===le(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-1:1,f=te(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ze=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=te(e,t),s={x:n,y:r},a=await ke(t,c),f=le(ne(o)),d=oe(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=ee(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=ee(m+a["y"===f?"top":"left"],m,m-a[e])}const v=u.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Ge=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=te(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=ne(o),y=le(u),w=ne(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[se(u)]:function(e){const t=se(e);return[ce(e),t,ce(t)]}(u)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=re(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(ne(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ce)))),i}(u,v,m,b));const R=[u,...x],C=await ke(t,g),S=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&S.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=re(e),o=ue(e),i=ie(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=se(l)),[l,se(l)]}(o,l,b);S.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:S}],!S.every((e=>e<=0))){var O,T;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(T=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=L.filter((e=>{if(E){const t=le(e.placement);return t===y||"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:A[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},Qe=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=te(e,t);switch(r){case"referenceHidden":{const e=Me(await ke(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:De(e)}}}case"escaped":{const e=Me(await ke(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:De(e)}}}default:return{}}}}},Je=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:s,padding:a=0}=te(e,t)||{};if(null==s)return{};const f=ae(a),d={x:n,y:r},p=ue(o),m=ie(p),v=await l.getDimensions(s),g="y"===p,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=u.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,L=$(f[h],S),O=$(f[y],S),T=L,A=R-v[m]-O,P=R/2-v[m]/2+C,k=ee(T,P,A),M=!c.arrow&&null!=re(o)&&P!==k&&i.reference[m]/2-(P<T?L:O)-v[m]/2<0,D=M?P<T?P-T:P-A:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:P-k-D,...M&&{alignmentOffset:D}},reset:M}}}),et=(e,t,n)=>{const r=new Map,o={platform:$e,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Pe(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Pe(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var tt="undefined"!=typeof document?r:o;function nt(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(!nt(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)&&!nt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function rt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ot(e,t){const n=rt(e);return Math.round(t*n)/n}function it(t){const n=e.useRef(t);return tt((()=>{n.current=t})),n}const lt=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?Je({element:n.current,padding:r}).fn(t):{}:n?Je({element:n,padding:r}).fn(t):{};var o}});function ut(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const ct={...e},st=ct.useInsertionEffect||(e=>e());function at(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return st((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var ft="undefined"!=typeof document?r:o;let dt=!1,pt=0;const mt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+pt++;const vt=ct.useId||function(){const[t,n]=e.useState((()=>dt?mt():void 0));return ft((()=>{null==t&&n(mt())}),[]),e.useEffect((()=>{dt=!0}),[]),t};let gt;"production"!==process.env.NODE_ENV&&(gt=new Set);const ht=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:u=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=gt)&&e.has(o)||(null==(i=gt)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=vt(),[b,x]=e.useState(!1);if(ft((()=>{if(!o)return;"rtl"===A(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let S=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(S=null);const L=2*d,O=L/2,T=u/2*(f/-8+1),P=a/2*f/4,k=!!v,M=S&&"end"===R?"bottom":"top";let D=S&&"end"===R?"right":"left";S&&b&&(D="end"===R?"left":"right");const N=null!=(null==i?void 0:i.x)?S||i.x:"",I=null!=(null==i?void 0:i.y)?S||i.y:"",F=v||"M0,0 H"+u+" L"+(u-T)+","+(a-P)+" Q"+u/2+","+a+" "+T+","+(a-P)+" Z",W={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[E];return c("svg",{...y,"aria-hidden":!0,ref:n,width:k?u:u+L,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[D]:N,[M]:I,[E]:C||k?"100%":"calc(100% - "+L/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[L>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:L+(v?0:1),d:F}),s("path",{stroke:L&&!v?y.fill:"none",d:F}),s("clipPath",{id:w,children:s("rect",{x:-O,y:O*(k?-1:1),width:u+L,height:u})})]})}));const yt=e.createContext(null),wt=e.createContext(null),bt=()=>{var t;return(null==(t=e.useContext(yt))?void 0:t.id)||null},xt=()=>e.useContext(wt);function Et(e){return"data-floating-ui-"+e}function Rt(e){const t=i(e);return ft((()=>{t.current=e})),t}const Ct=Et("safe-polygon");function St(e,t,n){return n&&!V(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Lt=0;function Ot(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Lt);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Lt=requestAnimationFrame(i)}function Tt(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function At(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Pt=new WeakMap,kt=new WeakSet,Mt={},Dt=0;const Nt=e=>e&&(e.host||Nt(e.parentNode));function It(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=Nt(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];Mt[o]||(Mt[o]=new WeakMap);const f=Mt[o];return l.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==g(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Pt.get(t)||0,l=i?r+1:r,u=(f.get(t)||0)+1;Pt.set(t,l),f.set(t,u),a.push(t),1===l&&n&&kt.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Dt++,()=>{a.forEach((e=>{const t=Pt.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;Pt.set(e,n),f.set(e,r),n||(!kt.has(e)&&i&&e.removeAttribute(i),kt.delete(e)),r||e.removeAttribute(o)})),Dt--,Dt||(Pt=new WeakMap,Pt=new WeakMap,kt=new WeakSet,Mt={})}}function Ft(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=_(e[0]).body;return It(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Wt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ht(e,t){const n=Ae(e,Wt());"prev"===t&&n.reverse();const r=n.indexOf(I(_(e)));return n.slice(r+1)[0]}function jt(){return Ht(document.body,"next")}function Bt(){return Ht(document.body,"prev")}function Vt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!F(n,r)}function _t(e){Ae(e,Wt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function qt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Kt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Xt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Ut=e.forwardRef((function(t,n){const[r,o]=e.useState();ft((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Xt),()=>{document.removeEventListener("keydown",Xt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Et("focus-guard")]:"",style:Kt};return s("span",{...t,...i})})),Yt=e.createContext(null),$t=Et("portal");const zt=()=>e.useContext(Yt),Zt="data-floating-ui-focusable";function Gt(e){return e?e.hasAttribute(Zt)?e:e.querySelector("["+Zt+"]")||e:null}let Qt=[];function Jt(e){Qt=Qt.filter((e=>e.isConnected)),e&&"body"!==g(e)&&(Qt.push(e),Qt.length>20&&(Qt=Qt.slice(-20)))}function en(){return Qt.slice().reverse().find((e=>e.isConnected))}function tn(e){const t=Wt();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==me.call(e,de)&&Le(t,e)}(e,t)?e:Ae(e,t)[0]||e}const nn=e.forwardRef((function(e,t){return s("button",{...e,type:"button",ref:t,tabIndex:-1,style:Kt})}));let rn=0;let on=()=>{};const ln=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return ft((()=>{if(n)return rn++,1===rn&&(on=function(){const e=/iP(hone|ad|od)|iOS/.test(W()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{rn--,0===rn&&on()}}),[n]),s("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})})),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},sn=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function an(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=vt(),l=e.useRef({}),[u]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),c=null!=bt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=gt)&&e.has(o)||(null==(i=gt)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=at(((e,t,n)=>{l.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:u,floatingId:i,refs:d})),[n,f,p,u,i,d])}const fn="active",dn="selected";function pn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[fn]:t,[dn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Zt]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[fn,dn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const mn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var vn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=vt(),i=zt(),[l,u]=e.useState(null),c=e.useRef(null);return ft((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),ft((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute($t,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),ft((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute($t,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),g=null==u?void 0:u.modal,h=null==u?void 0:u.open,y=!!u&&!u.modal&&u.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!g)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&Vt(e)){("focusin"===e.type?qt:_t)(l)}}}),[l,i,g]),e.useEffect((()=>{l&&(h||qt(l))}),[h,l]),c(Yt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:a})),[i,l]),children:[y&&l&&s(Ut,{"data-type":"outside",ref:d,onFocus:e=>{if(Vt(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Bt()||(null==u?void 0:u.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:Kt}),l&&f.createPortal(n,l),y&&l&&s(Ut,{"data-type":"outside",ref:p,onFocus:e=>{if(Vt(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=jt()||(null==u?void 0:u.domReference);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:ln,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:f=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:g=!1}=t,{open:h,onOpenChange:y,events:w,dataRef:b,elements:{domReference:E,floating:R}}=n,C=at((()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId})),S="number"==typeof u&&u<0,L=U(E)&&S,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,T=!O||l,A=!T||O&&g,P=Rt(i),k=Rt(u),M=Rt(f),D=xt(),N=zt(),W=e.useRef(null),H=e.useRef(null),V=e.useRef(!1),q=e.useRef(!1),Y=e.useRef(-1),$=null!=N,z=Gt(R),Z=at((function(e){return void 0===e&&(e=z),e?Ae(e,Wt()):[]})),G=at((e=>{const t=Z(e);return P.current.map((e=>E&&"reference"===e?E:z&&"floating"===e?z:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){F(z,I(_(z)))&&0===Z().length&&!L&&X(e);const t=G(),n=K(e);"reference"===P.current[0]&&n===E&&(X(e),e.shiftKey?Ot(t[t.length-1]):Ot(t[1])),"floating"===P.current[1]&&n===z&&e.shiftKey&&(X(e),Ot(t[0]))}}const t=_(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,z,p,P,L,Z,G]),e.useEffect((()=>{if(!o&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=K(e),n=Z().indexOf(t);-1!==n&&(Y.current=n)}}),[o,R,Z]),e.useEffect((()=>{if(!o&&v)return R&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=C(),r=!(F(E,t)||F(R,t)||F(t,R)||F(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(Et("focus-guard"))||D&&(At(D.nodesRef.current,n).find((e=>{var n,r;return F(null==(n=e.context)?void 0:n.elements.floating,t)||F(null==(r=e.context)?void 0:r.elements.domReference,t)}))||Tt(D.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Gt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&I(_(z))===_(z).body){x(z)&&z.focus();const e=Y.current,t=Z(),n=t[e]||t[t.length-1]||z;x(n)&&n.focus()}!L&&p||!t||!r||q.current||t===en()||(V.current=!0,y(!1,e,"focus-out"))}))}}),[o,E,R,z,p,D,N,y,v,d,Z,L,C]);const Q=e.useRef(null),J=e.useRef(null),ee=ut([Q,null==N?void 0:N.beforeInsideRef]),te=ut([J,null==N?void 0:N.afterInsideRef]);function ne(e){return!o&&m&&p?s(nn,{ref:"start"===e?W:H,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!R)return;const t=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+Et("portal")+"]"))||[]),n=D&&!p?Tt(null==D?void 0:D.nodesRef.current,C()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[R,...t,...n,W.current,H.current,Q.current,J.current,null==N?void 0:N.beforeOutsideRef.current,null==N?void 0:N.afterOutsideRef.current,P.current.includes("reference")||L?E:null].filter((e=>null!=e)),i=p||L?Ft(r,!A,A):Ft(r);return()=>{i()}}),[o,E,R,p,P,N,L,T,A,D,C]),ft((()=>{if(o||!x(z))return;const e=I(_(z));queueMicrotask((()=>{const t=G(z),n=k.current,r=("number"==typeof n?t[n]:n.current)||z,o=F(z,e);S||o||!h||Ot(r,{preventScroll:r===z})}))}),[o,h,z,S,G,k]),ft((()=>{if(o||!z)return;let e=!1;const t=_(z),n=I(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&E&&Jt(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(V.current=!0),"outside-press"===o&&(l?(V.current=!1,e=!0):V.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(B()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||j(i)))}Jt(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Kt),$&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=I(t),o=F(R,n)||D&&At(D.nodesRef.current,C()).some((e=>{var t;return F(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&Jt(E);const u="boolean"==typeof M.current?en()||l:M.current.current||l;queueMicrotask((()=>{const r=tn(u);M.current&&!V.current&&x(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,R,z,M,b,w,D,$,E,C]),e.useEffect((()=>{queueMicrotask((()=>{V.current=!1}))}),[o]),ft((()=>{if(!o&&N)return N.setFocusManagerState({modal:p,closeOnFocusOut:v,open:h,onOpenChange:y,domReference:E}),()=>{N.setFocusManagerState(null)}}),[o,N,p,h,y,v,E]),ft((()=>{if(o)return;if(!z)return;if("function"!=typeof MutationObserver)return;if(S)return;const e=()=>{const e=z.getAttribute("tabindex"),t=Z(),n=I(_(R)),r=t.indexOf(n);-1!==r&&(Y.current=r),P.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&z.setAttribute("tabindex","0"):"-1"!==e&&z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,R,z,E,P,Z,S]);const re=!o&&T&&(!p||!L)&&($||p);return c(a,{children:[re&&s(Ut,{"data-type":"inside",ref:ee,onFocus:e=>{if(p){const e=G();Ot("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(V.current=!1,Vt(e,N.portalNode)){const e=jt()||E;null==e||e.focus()}else{var t;null==(t=N.beforeOutsideRef.current)||t.focus()}}}),!L&&ne("start"),r,ne("end"),re&&s(Ut,{"data-type":"inside",ref:te,onFocus:e=>{if(p)Ot(G()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(v&&(V.current=!0),Vt(e,N.portalNode)){const e=Bt()||E;null==e||e.focus()}else{var t;null==(t=N.afterOutsideRef.current)||t.focus()}}})]})},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=an({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,u]=e.useState(null),[c,s]=e.useState(null),a=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=xt();ft((()=>{a&&(d.current=a)}),[a]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:c=!0,whileElementsMounted:s,open:a}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);nt(m,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=l||g,R=u||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),O=null!=s,T=it(s),A=it(i),P=it(a),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),et(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};M.current&&!nt(L.current,t)&&(L.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,A,P]);tt((()=>{!1===a&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const M=e.useRef(!1);tt((()=>(M.current=!0,()=>{M.current=!1})),[]),tt((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,O]);const D=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=ot(N.floating,d.x),n=ot(N.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...rt(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:I})),[d,k,D,N,I])}({...t,elements:{...i,...c&&{reference:c}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,u(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),h=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),y=e.useMemo((()=>({...m.elements,domReference:a})),[m.elements,a]),w=e.useMemo((()=>({...m,...o,refs:h,elements:y,nodeId:n})),[m,h,y,n,o]);return ft((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:h,elements:y})),[m,h,y,w])},Arrow:ht,arrow:(e,t)=>({...lt(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=mn.get(u))?r:u,s=vt(),a=null!=bt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>pn(e,t,"reference")),n),l=e.useCallback((e=>pn(e,t,"floating")),r),u=e.useCallback((e=>pn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,g=xt(),h=at("function"==typeof s?s:()=>!1),y="function"==typeof s?h:s,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=sn(m),{escapeKey:S,outsidePress:L}=sn(v),P=e.useRef(!1),M=at((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=g?At(g.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),N=at((e=>{var t;const n=()=>{var t;M(e),null==(t=K(e))||t.removeEventListener("keydown",n)};null==(t=K(e))||t.addEventListener("keydown",n)})),I=at((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const u=K(e),c="["+Et("inert")+"]",s=_(i.floating).querySelectorAll(c);let f=b(u)?u:null;for(;f&&!T(f);){const e=k(f);if(T(e)||!b(e))break;f=e}if(s.length&&b(u)&&!u.matches("html,body")&&!F(u,i.floating)&&Array.from(s).every((e=>!F(f,e))))return;if(x(u)&&j){const t=T(u),n=A(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=g&&At(g.nodesRef.current,d).some((t=>{var n;return q(e,null==(n=t.context)?void 0:n.elements.floating)}));if(q(e,i.floating)||q(e,i.domReference)||p)return;const m=g?At(g.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=at((e=>{var t;const n=()=>{var t;I(e),null==(t=K(e))||t.removeEventListener(a,n)};null==(t=K(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout((()=>{P.current=!1}),O()?5:0)}const f=_(i.floating);c&&(f.addEventListener("keydown",S?N:M,S),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),y&&f.addEventListener(a,L?W:I,L);let d=[];return p&&(b(i.domReference)&&(d=D(i.domReference)),b(i.floating)&&(d=d.concat(D(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(D(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(f.removeEventListener("keydown",S?N:M,S),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),y&&f.removeEventListener(a,L?W:I,L),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,y,a,r,o,p,u,R,C,M,S,N,I,L,W]),e.useEffect((()=>{w.current=!1}),[y,a]);const H=e.useMemo((()=>({onKeyDown:M,...f&&{[un[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[M,o,f,d]),j=e.useMemo((()=>({onKeyDown:M,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[cn[a]]:()=>{w.current=!0}})),[M,a]);return e.useMemo((()=>u?{reference:H,floating:j}:{}),[u,H,j])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=xt(),v=bt(),g=Rt(a),h=Rt(s),y=Rt(r),w=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),L=e.useRef((()=>{})),O=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(c)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=_(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,g,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=St(h.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[h,o]),P=at((()=>{L.current(),E.current=void 0})),k=at((()=>{if(S.current){const e=_(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Ct),S.current=!1}})),M=at((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&b(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=u.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!V(w.current)||d>0&&!St(h.current,"open"))return;const t=St(h.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;L.current();const t=_(u.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!F(u.floating,e.relatedTarget))&&A(e)}function l(e){M()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e)}})(e))}}),[u,c,t,f,d,p,A,P,k,o,r,y,m,h,g,i,M]),ft((()=>{var e;if(c&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){S.current=!0;const e=u.floating;if(b(u.domReference)&&e){var t;const n=_(u.floating).body;n.setAttribute(Ct,"");const r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,v,u,m,g,T]),ft((()=>{r||(w.current=void 0,O.current=!1,P(),k())}),[r,P,k]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),k()}),[c,u.domReference,P,k]);const D=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!V(w.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),N=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){M()||A(e.nativeEvent,!1)}})),[A,M]);return e.useMemo((()=>c?{reference:D,floating:N}:{}),[c,D,N])},flip:(e,t)=>({...Ge(e),options:[e,t]}),shift:(e,t)=>({...Ze(e),options:[e,t]}),hide:(e,t)=>({...Qe(e),options:[e,t]}),offset:(e,t)=>({...ze(e),options:[e,t]})},gn=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)};function hn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=hn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=hn(e))&&(r&&(r+=" "),r+=t);return r}var wn="HoverCard",bn=["div","span","button","input"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,u=p(n,["asChild","children"]);if(i){var c=t.Children.toArray(l);if(1!==c.length||!t.isValidElement(c[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,d(d({},u),{ref:r}),l);var s=c[0];return t.cloneElement(s,d(d(d({},u),s.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var t=s.ref;"function"==typeof t?t(e):t&&(t.current=e)}}:{}))}return t.createElement(e,d(d({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),xn=function(){return console.warn("Direct usage of HoverCard is not supported. Please use HoverCard.Root, HoverCard.Trigger, etc. instead."),null};xn.Root=function(e){var n=e.children,r=e.open,o=void 0===r?void 0:r,u=e.onOpenChange,c=e.customRootClass,s=void 0===c?"":c,a=e.openDelay,f=void 0===a?100:a,v=e.closeDelay,g=void 0===v?200:v,h=p(e,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),y=gn(s,wn),w=gn(s,"".concat(wn,"-trigger")),b=i(null),x=vn.useFloating({placement:"bottom",strategy:"fixed",middleware:[vn.arrow({element:b}),vn.offset(10),vn.flip({mainAxis:!0})]}),E=x.refs,R=x.floatingStyles,C=x.context,S=l(!1),L=S[0],O=S[1],T=l(!1);T[0];var A=T[1],P=void 0!==o,k=P?o:L,M=function(e){P||O(e),null==u||u(e)},D=vn.useRole(C),N=vn.useDismiss(C),I=vn.useHover(C,{delay:100}),F=vn.useInteractions([I,D,N]),W=F.getReferenceProps,H=F.getFloatingProps,j={isOpen:k,handleOpenChange:M,floatingRefs:E,floatingStyles:R,floatingContext:C,arrowRef:b,getReferenceProps:W,getFloatingProps:H,rootClass:y,rootTriggerClass:w,closeWithDelay:function(){A(!0),setTimeout((function(){A((function(e){return e&&M(!1),e}))}),g)},closeWithoutDelay:function(){M(!1)},openWithDelay:function(){A(!1),setTimeout((function(){M(!0)}),f)}};return t.createElement(m.Provider,{value:j},t.createElement("div",d({className:yn(y)},h),n))},xn.Trigger=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=p(e,["children","className"]),l=u(m),c=l.floatingRefs,s=l.closeWithDelay,a=l.openWithDelay,f=l.rootTriggerClass;return t.createElement(t.Fragment,null,t.createElement(bn.span,d({className:yn(f,o),onClick:function(){},onMouseEnter:a,onMouseLeave:s,ref:c.setReference},i),n))},xn.Portal=function(e){var n=e.children,r=e.rootElement,o=void 0===r?void 0:r,i=p(e,["children","rootElement"]),l=u(m).rootTriggerClass,c=o||document.getElementsByClassName(l)[0];return t.createElement(vn.Portal,d({root:c},i),n)},xn.Content=function(e){var n=e.children,r=p(e,["children"]),i=u(m),l=i.isOpen,c=i.floatingRefs,s=i.floatingStyles,a=i.getFloatingProps,f=i.rootClass,v=i.closeWithDelay,g=i.closeWithoutDelay,h=i.openWithDelay;return o((function(){var e=function(){return g()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[g]),l?t.createElement("div",d({onPointerEnter:h,onPointerLeave:v,className:yn(f)},r,{ref:c.setFloating,style:s},a()),n):null},xn.Arrow=function(e){var n=p(e,[]),r=u(m),o=r.floatingContext,i=r.arrowRef,l=r.rootClass;return t.createElement(vn.Arrow,d({className:yn("".concat(l,"-arrow"))},n,{context:o,ref:i}))};export{xn as default};
5
+ */var pe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),me="undefined"==typeof Element,ve=me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ge=!me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},he=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},ye=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!he(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{ve.call(l,pe)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!he(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},we=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},be=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!we(e)?0:e.tabIndex},xe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ee=function(e){return"INPUT"===e.tagName},Re=function(e){return function(e){return Ee(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ge(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Ce=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Le=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ve.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ve.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ce(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=ge(e);if(l&&!l.shadowRoot&&!0===r(l))return Ce(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(function(e){var t,n,r,o,i=e&&ge(e),l=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=ge(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Se=function(e,t){return!(t.disabled||he(t)||function(e){return Ee(e)&&"hidden"===e.type}(t)||Le(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ve.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Oe=function(e,t){return!(Re(t)||be(t)<0||!Se(e,t))},Te=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ae=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=be(e);return n<0&&t&&!we(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(xe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Pe=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ye([e],t.includeContainer,{filter:Oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Te}):function(e,t,n){if(he(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pe));return t&&ve.call(e,pe)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Oe.bind(null,t)),Ae(n)};function ke(e,t,n){let{reference:r,floating:o}=e;const i=ue(t),l=ce(t),u=le(l),c=re(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[u]/2-o[u]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(oe(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function Me(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ne(t,e),m=fe(p),v=u[d?"floating"===f?"reference":"floating":f],g=de(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=de(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function De(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ne(e){return $.some((t=>e[t]>=0))}function Fe(e){const t=A(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=G(n)!==i||G(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Ie(e){return b(e)?e:e.contextElement}function We(e){const t=Ie(e);if(!x(t))return Q(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Fe(t);let l=(i?G(n.width):n.width)/r,u=(i?G(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const He=Q(0);function je(e){const t=h(e);return O()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:He}function Be(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ie(e);let l=Q(1);t&&(r?b(r)&&(l=We(r)):l=We(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==h(e))&&t}(i,n,r)?je(i):Q(0);let c=(o.left+u.x)/l.x,s=(o.top+u.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=h(i),t=r&&b(r)?h(r):r;let n=e,o=N(n);for(;o&&r&&t!==n;){const e=We(o),t=o.getBoundingClientRect(),r=A(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=h(o),o=N(n)}}return de({width:a,height:f,x:c,y:s})}function Ve(e,t){const n=P(e).scrollLeft;return t?t.left+n:Be(y(e)).left+n}function _e(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ve(e,r)),y:r.top+t.scrollTop}}function qe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=h(e),r=y(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(o){i=o.width,l=o.height;const e=O();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=P(e),r=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ve(e);const u=-n.scrollTop;return"rtl"===A(r).direction&&(l+=Z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(y(e));else if(b(t))r=function(e,t){const n=Be(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?We(e):Q(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=je(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return de(r)}function Ke(e,t){const n=k(e);return!(n===t||!b(n)||T(n))&&("fixed"===A(n).position||Ke(n,t))}function Xe(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=Be(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Q(0);if(r||!r&&!i)if(("body"!==g(t)||R(o))&&(u=P(t)),r){const e=Be(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Ve(o));const s=!o||r||i?Q(0):_e(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.y-s.y,width:l.width,height:l.height}}function Ue(e){return"static"===A(e).position}function Ye(e,t){if(!x(e)||"fixed"===A(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function $e(e,t){const n=h(e);if(L(e))return n;if(!x(e)){let t=k(e);for(;t&&!T(t);){if(b(t)&&!Ue(t))return t;t=k(t)}return n}let r=Ye(e,t);for(;r&&C(r)&&Ue(r);)r=Ye(r,t);return r&&T(r)&&Ue(r)&&!S(r)?n:r||function(e){let t=k(e);for(;x(t)&&!T(t);){if(S(t))return t;if(L(t))return null;t=k(t)}return null}(e)||n}const ze={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),u=!!t&&L(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=Q(1);const a=Q(0),f=x(r);if((f||!f&&!i)&&(("body"!==g(r)||R(l))&&(c=P(r)),x(r))){const e=Be(r);s=We(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?Q(0):_e(l,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.scrollTop*s.y+a.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?L(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=D(e,[],!1).filter((e=>b(e)&&"body"!==g(e))),o=null;const i="fixed"===A(e).position;let l=i?k(e):e;for(;b(l)&&!T(l);){const t=A(l),n=S(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&Ke(e,l))?r=r.filter((e=>e!==l)):o=t,l=k(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=qe(t,n,o);return e.top=Z(r.top,e.top),e.right=z(r.right,e.right),e.bottom=z(r.bottom,e.bottom),e.left=Z(r.left,e.left),e}),qe(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:$e,getElementRects:async function(e){const t=this.getOffsetParent||$e,n=this.getDimensions,r=await n(e.floating);return{reference:Xe(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:We,isElement:b,isRTL:function(e){return"rtl"===A(e).direction}},Ze=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=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)),l=re(n),u=oe(n),c="y"===ue(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-1:1,f=ne(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ge=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ne(e,t),s={x:n,y:r},a=await Me(t,c),f=ue(re(o)),d=ie(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=te(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=te(m+a["y"===f?"top":"left"],m,m-a[e])}const v=u.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Qe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=ne(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=re(o),y=ue(u),w=re(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[ae(u)]:function(e){const t=ae(e);return[se(e),t,se(t)]}(u)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=oe(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(re(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(se)))),i}(u,v,m,b));const R=[u,...x],C=await Me(t,g),L=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&L.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=oe(e),o=ce(e),i=le(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=ae(l)),[l,ae(l)]}(o,l,b);L.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:L}],!L.every((e=>e<=0))){var O,T;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(T=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=S.filter((e=>{if(E){const t=ue(e.placement);return t===y||"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:A[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},Je=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ne(e,t);switch(r){case"referenceHidden":{const e=De(await Me(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ne(e)}}}case"escaped":{const e=De(await Me(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ne(e)}}}default:return{}}}}},et=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:s,padding:a=0}=ne(e,t)||{};if(null==s)return{};const f=fe(a),d={x:n,y:r},p=ce(o),m=le(p),v=await l.getDimensions(s),g="y"===p,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=u.floating[w]||i.floating[m]);const C=b/2-x/2,L=R/2-v[m]/2-1,S=z(f[h],L),O=z(f[y],L),T=S,A=R-v[m]-O,P=R/2-v[m]/2+C,k=te(T,P,A),M=!c.arrow&&null!=oe(o)&&P!==k&&i.reference[m]/2-(P<T?S:O)-v[m]/2<0,D=M?P<T?P-T:P-A:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:P-k-D,...M&&{alignmentOffset:D}},reset:M}}}),tt=(e,t,n)=>{const r=new Map,o={platform:ze,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=ke(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=ke(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var nt="undefined"!=typeof document?r:o;function rt(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(!rt(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)&&!rt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ot(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function it(e,t){const n=ot(e);return Math.round(t*n)/n}function lt(t){const n=e.useRef(t);return nt((()=>{n.current=t})),n}const ut=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?et({element:n.current,padding:r}).fn(t):{}:n?et({element:n,padding:r}).fn(t):{};var o}});function ct(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const st={...e},at=st.useInsertionEffect||(e=>e());function ft(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return at((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var dt="undefined"!=typeof document?r:o;let pt=!1,mt=0;const vt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+mt++;const gt=st.useId||function(){const[t,n]=e.useState((()=>pt?vt():void 0));return dt((()=>{null==t&&n(vt())}),[]),e.useEffect((()=>{pt=!0}),[]),t};let ht;"production"!==process.env.NODE_ENV&&(ht=new Set);const yt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:u=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ht)&&e.has(o)||(null==(i=ht)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=gt(),[b,x]=e.useState(!1);if(dt((()=>{if(!o)return;"rtl"===A(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let L=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(L=null);const S=2*d,O=S/2,T=u/2*(f/-8+1),P=a/2*f/4,k=!!v,M=L&&"end"===R?"bottom":"top";let D=L&&"end"===R?"right":"left";L&&b&&(D="end"===R?"left":"right");const N=null!=(null==i?void 0:i.x)?L||i.x:"",F=null!=(null==i?void 0:i.y)?L||i.y:"",I=v||"M0,0 H"+u+" L"+(u-T)+","+(a-P)+" Q"+u/2+","+a+" "+T+","+(a-P)+" Z",W={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[E];return c("svg",{...y,"aria-hidden":!0,ref:n,width:k?u:u+S,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[D]:N,[M]:F,[E]:C||k?"100%":"calc(100% - "+S/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[S>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:S+(v?0:1),d:I}),s("path",{stroke:S&&!v?y.fill:"none",d:I}),s("clipPath",{id:w,children:s("rect",{x:-O,y:O*(k?-1:1),width:u+S,height:u})})]})}));const wt=e.createContext(null),bt=e.createContext(null),xt=()=>{var t;return(null==(t=e.useContext(wt))?void 0:t.id)||null},Et=()=>e.useContext(bt);function Rt(e){return"data-floating-ui-"+e}function Ct(e){const t=i(e);return dt((()=>{t.current=e})),t}const Lt=Rt("safe-polygon");function St(e,t,n){return n&&!_(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Ot=0;function Tt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ot);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ot=requestAnimationFrame(i)}function At(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Pt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let kt=new WeakMap,Mt=new WeakSet,Dt={},Nt=0;const Ft=e=>e&&(e.host||Ft(e.parentNode));function It(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=Ft(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];Dt[o]||(Dt[o]=new WeakMap);const f=Dt[o];return l.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==g(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=kt.get(t)||0,l=i?r+1:r,u=(f.get(t)||0)+1;kt.set(t,l),f.set(t,u),a.push(t),1===l&&n&&Mt.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Nt++,()=>{a.forEach((e=>{const t=kt.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;kt.set(e,n),f.set(e,r),n||(!Mt.has(e)&&i&&e.removeAttribute(i),Mt.delete(e)),r||e.removeAttribute(o)})),Nt--,Nt||(kt=new WeakMap,kt=new WeakMap,Mt=new WeakSet,Dt={})}}function Wt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=q(e[0]).body;return It(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ht=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jt(e,t){const n=Pe(e,Ht());"prev"===t&&n.reverse();const r=n.indexOf(F(q(e)));return n.slice(r+1)[0]}function Bt(){return jt(document.body,"next")}function Vt(){return jt(document.body,"prev")}function _t(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!I(n,r)}function qt(e){Pe(e,Ht()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Kt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Xt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ut(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Yt=e.forwardRef((function(t,n){const[r,o]=e.useState();dt((()=>(B()&&o("button"),document.addEventListener("keydown",Ut),()=>{document.removeEventListener("keydown",Ut)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Rt("focus-guard")]:"",style:Xt};return s("span",{...t,...i})})),$t=e.createContext(null),zt=Rt("portal");const Zt=()=>e.useContext($t),Gt="data-floating-ui-focusable";function Qt(e){return e?e.hasAttribute(Gt)?e:e.querySelector("["+Gt+"]")||e:null}let Jt=[];function en(e){Jt=Jt.filter((e=>e.isConnected)),e&&"body"!==g(e)&&(Jt.push(e),Jt.length>20&&(Jt=Jt.slice(-20)))}function tn(){return Jt.slice().reverse().find((e=>e.isConnected))}function nn(e){const t=Ht();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ve.call(e,pe)&&Oe(t,e)}(e,t)?e:Pe(e,t)[0]||e}const rn=e.forwardRef((function(e,t){return s("button",{...e,type:"button",ref:t,tabIndex:-1,style:Xt})}));let on=0;let ln=()=>{};const un=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return dt((()=>{if(n)return on++,1===on&&(ln=function(){const e=/iP(hone|ad|od)|iOS/.test(W()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{on--,0===on&&ln()}}),[n]),s("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})})),cn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},sn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},an=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function fn(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=gt(),l=e.useRef({}),[u]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),c=null!=xt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ht)&&e.has(o)||(null==(i=ht)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=ft(((e,t,n)=>{l.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:u,floatingId:i,refs:d})),[n,f,p,u,i,d])}const dn="active",pn="selected";function mn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[dn]:t,[pn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Gt]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[dn,pn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var gn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=gt(),i=Zt(),[l,u]=e.useState(null),c=e.useRef(null);return dt((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),dt((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(zt,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),dt((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(zt,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),g=null==u?void 0:u.modal,h=null==u?void 0:u.open,y=!!u&&!u.modal&&u.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!g)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&_t(e)){("focusin"===e.type?Kt:qt)(l)}}}),[l,i,g]),e.useEffect((()=>{l&&(h||Kt(l))}),[h,l]),c($t.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:a})),[i,l]),children:[y&&l&&s(Yt,{"data-type":"outside",ref:d,onFocus:e=>{if(_t(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Vt()||(null==u?void 0:u.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:Xt}),l&&f.createPortal(n,l),y&&l&&s(Yt,{"data-type":"outside",ref:p,onFocus:e=>{if(_t(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Bt()||(null==u?void 0:u.domReference);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:un,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:f=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:g=!1}=t,{open:h,onOpenChange:y,events:w,dataRef:b,elements:{domReference:E,floating:R}}=n,C=ft((()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId})),L="number"==typeof u&&u<0,S=!!(O=E)&&"combobox"===O.getAttribute("role")&&U(O)&&L;var O;const T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,A=!T||l,P=!A||T&&g,k=Ct(i),M=Ct(u),D=Ct(f),N=Et(),W=Zt(),H=e.useRef(null),B=e.useRef(null),_=e.useRef(!1),K=e.useRef(!1),$=e.useRef(-1),z=null!=W,Z=Qt(R),G=ft((function(e){return void 0===e&&(e=Z),e?Pe(e,Ht()):[]})),Q=ft((e=>{const t=G(e);return k.current.map((e=>E&&"reference"===e?E:Z&&"floating"===e?Z:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){I(Z,F(q(Z)))&&0===G().length&&!S&&Y(e);const t=Q(),n=X(e);"reference"===k.current[0]&&n===E&&(Y(e),e.shiftKey?Tt(t[t.length-1]):Tt(t[1])),"floating"===k.current[1]&&n===Z&&e.shiftKey&&(Y(e),Tt(t[0]))}}const t=q(Z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,Z,p,k,S,G,Q]),e.useEffect((()=>{if(!o&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=X(e),n=G().indexOf(t);-1!==n&&($.current=n)}}),[o,R,G]),e.useEffect((()=>{if(!o&&v)return R&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=C(),r=!(I(E,t)||I(R,t)||I(t,R)||I(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Rt("focus-guard"))||N&&(Pt(N.nodesRef.current,n).find((e=>{var n,r;return I(null==(n=e.context)?void 0:n.elements.floating,t)||I(null==(r=e.context)?void 0:r.elements.domReference,t)}))||At(N.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Qt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&F(q(Z))===q(Z).body){x(Z)&&Z.focus();const e=$.current,t=G(),n=t[e]||t[t.length-1]||Z;x(n)&&n.focus()}!S&&p||!t||!r||K.current||t===tn()||(_.current=!0,y(!1,e,"focus-out"))}))}}),[o,E,R,Z,p,N,W,y,v,d,G,S,C]);const J=e.useRef(null),ee=e.useRef(null),te=ct([J,null==W?void 0:W.beforeInsideRef]),ne=ct([ee,null==W?void 0:W.afterInsideRef]);function re(e){return!o&&m&&p?s(rn,{ref:"start"===e?H:B,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!R)return;const t=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Rt("portal")+"]"))||[]),n=N&&!p?At(null==N?void 0:N.nodesRef.current,C()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[R,...t,...n,H.current,B.current,J.current,ee.current,null==W?void 0:W.beforeOutsideRef.current,null==W?void 0:W.afterOutsideRef.current,k.current.includes("reference")||S?E:null].filter((e=>null!=e)),i=p||S?Wt(r,!P,P):Wt(r);return()=>{i()}}),[o,E,R,p,k,W,S,A,P,N,C]),dt((()=>{if(o||!x(Z))return;const e=F(q(Z));queueMicrotask((()=>{const t=Q(Z),n=M.current,r=("number"==typeof n?t[n]:n.current)||Z,o=I(Z,e);L||o||!h||Tt(r,{preventScroll:r===Z})}))}),[o,h,Z,L,Q,M]),dt((()=>{if(o||!Z)return;let e=!1;const t=q(Z),n=F(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&E&&en(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(_.current=!0),"outside-press"===o&&(l?(_.current=!1,e=!0):_.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(V()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||j(i)))}en(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Xt),z&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=F(t),o=I(R,n)||N&&Pt(N.nodesRef.current,C()).some((e=>{var t;return I(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&en(E);const u="boolean"==typeof D.current?tn()||l:D.current.current||l;queueMicrotask((()=>{const r=nn(u);D.current&&!_.current&&x(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,R,Z,D,b,w,N,z,E,C]),e.useEffect((()=>{queueMicrotask((()=>{_.current=!1}))}),[o]),dt((()=>{if(!o&&W)return W.setFocusManagerState({modal:p,closeOnFocusOut:v,open:h,onOpenChange:y,domReference:E}),()=>{W.setFocusManagerState(null)}}),[o,W,p,h,y,v,E]),dt((()=>{if(o)return;if(!Z)return;if("function"!=typeof MutationObserver)return;if(L)return;const e=()=>{const e=Z.getAttribute("tabindex"),t=G(),n=F(q(R)),r=t.indexOf(n);-1!==r&&($.current=r),k.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&Z.setAttribute("tabindex","0"):"-1"!==e&&Z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,R,Z,E,k,G,L]);const oe=!o&&A&&(!p||!S)&&(z||p);return c(a,{children:[oe&&s(Yt,{"data-type":"inside",ref:te,onFocus:e=>{if(p){const e=Q();Tt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(_.current=!1,_t(e,W.portalNode)){const e=Bt()||E;null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!S&&re("start"),r,re("end"),oe&&s(Yt,{"data-type":"inside",ref:ne,onFocus:e=>{if(p)Tt(Q()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(v&&(_.current=!0),_t(e,W.portalNode)){const e=Vt()||E;null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}})]})},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=fn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,u]=e.useState(null),[c,s]=e.useState(null),a=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=Et();dt((()=>{a&&(d.current=a)}),[a]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:c=!0,whileElementsMounted:s,open:a}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);rt(m,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==L.current&&(L.current=e,w(e))}),[]),E=l||g,R=u||y,C=e.useRef(null),L=e.useRef(null),S=e.useRef(d),O=null!=s,T=lt(s),A=lt(i),P=lt(a),k=e.useCallback((()=>{if(!C.current||!L.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),tt(C.current,L.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};M.current&&!rt(S.current,t)&&(S.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,A,P]);nt((()=>{!1===a&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const M=e.useRef(!1);nt((()=>(M.current=!0,()=>{M.current=!1})),[]),nt((()=>{if(E&&(C.current=E),R&&(L.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,O]);const D=e.useMemo((()=>({reference:C,floating:L,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=it(N.floating,d.x),n=it(N.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ot(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:F})),[d,k,D,N,F])}({...t,elements:{...i,...c&&{reference:c}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,u(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),h=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),y=e.useMemo((()=>({...m.elements,domReference:a})),[m.elements,a]),w=e.useMemo((()=>({...m,...o,refs:h,elements:y,nodeId:n})),[m,h,y,n,o]);return dt((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:h,elements:y})),[m,h,y,w])},Arrow:yt,arrow:(e,t)=>({...ut(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=vn.get(u))?r:u,s=gt(),a=null!=xt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useFocus:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:l,elements:u}=t,{enabled:c=!0,visibleOnly:s=!0}=n,a=e.useRef(!1),f=e.useRef(),d=e.useRef(!0);e.useEffect((()=>{if(!c)return;const e=h(u.domReference);function t(){!r&&x(u.domReference)&&u.domReference===F(q(u.domReference))&&(a.current=!0)}function n(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",n,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",n,!0)}}),[u.domReference,r,c]),e.useEffect((()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[i,c]),e.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const p=e.useMemo((()=>({onPointerDown(e){j(e.nativeEvent)||(d.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=X(e.nativeEvent);if(s&&b(t))try{if(B()&&W().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!U(t))return}o(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=b(t)&&t.hasAttribute(Rt("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const i=F(u.domReference?u.domReference.ownerDocument:document);(t||i!==u.domReference)&&(I(null==(e=l.current.floatingContext)?void 0:e.refs.floating.current,i)||I(u.domReference,i)||r||o(!1,n,"focus"))}))}})),[l,u.domReference,o,s]);return e.useMemo((()=>c?{reference:p}:{}),[c,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>mn(e,t,"reference")),n),l=e.useCallback((e=>mn(e,t,"floating")),r),u=e.useCallback((e=>mn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,g=Et(),h=ft("function"==typeof s?s:()=>!1),y="function"==typeof s?h:s,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=an(m),{escapeKey:L,outsidePress:S}=an(v),P=e.useRef(!1),M=ft((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=g?Pt(g.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),N=ft((e=>{var t;const n=()=>{var t;M(e),null==(t=X(e))||t.removeEventListener("keydown",n)};null==(t=X(e))||t.addEventListener("keydown",n)})),F=ft((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const u=X(e),c="["+Rt("inert")+"]",s=q(i.floating).querySelectorAll(c);let f=b(u)?u:null;for(;f&&!T(f);){const e=k(f);if(T(e)||!b(e))break;f=e}if(s.length&&b(u)&&!u.matches("html,body")&&!I(u,i.floating)&&Array.from(s).every((e=>!I(f,e))))return;if(x(u)&&j){const t=T(u),n=A(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=g&&Pt(g.nodesRef.current,d).some((t=>{var n;return K(e,null==(n=t.context)?void 0:n.elements.floating)}));if(K(e,i.floating)||K(e,i.domReference)||p)return;const m=g?Pt(g.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ft((e=>{var t;const n=()=>{var t;F(e),null==(t=X(e))||t.removeEventListener(a,n)};null==(t=X(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout((()=>{P.current=!1}),O()?5:0)}const f=q(i.floating);c&&(f.addEventListener("keydown",L?N:M,L),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),y&&f.addEventListener(a,S?W:F,S);let d=[];return p&&(b(i.domReference)&&(d=D(i.domReference)),b(i.floating)&&(d=d.concat(D(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(D(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(f.removeEventListener("keydown",L?N:M,L),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),y&&f.removeEventListener(a,S?W:F,S),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,y,a,r,o,p,u,R,C,M,L,N,F,S,W]),e.useEffect((()=>{w.current=!1}),[y,a]);const H=e.useMemo((()=>({onKeyDown:M,...f&&{[cn[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[M,o,f,d]),j=e.useMemo((()=>({onKeyDown:M,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[sn[a]]:()=>{w.current=!0}})),[M,a]);return e.useMemo((()=>u?{reference:H,floating:j}:{}),[u,H,j])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=Et(),v=xt(),g=Ct(a),h=Ct(s),y=Ct(r),w=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),L=e.useRef(!1),S=e.useRef((()=>{})),O=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(c)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=q(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,g,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=St(h.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[h,o]),P=ft((()=>{S.current(),E.current=void 0})),k=ft((()=>{if(L.current){const e=q(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Lt),L.current=!1}})),M=ft((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&b(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=u.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!_(w.current)||d>0&&!St(h.current,"open"))return;const t=St(h.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;S.current();const t=q(u.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!I(u.floating,e.relatedTarget))&&A(e)}function l(e){M()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e)}})(e))}}),[u,c,t,f,d,p,A,P,k,o,r,y,m,h,g,i,M]),dt((()=>{var e;if(c&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){L.current=!0;const e=u.floating;if(b(u.domReference)&&e){var t;const n=q(u.floating).body;n.setAttribute(Lt,"");const r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,v,u,m,g,T]),dt((()=>{r||(w.current=void 0,O.current=!1,P(),k())}),[r,P,k]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),k()}),[c,u.domReference,P,k]);const D=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!_(w.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),N=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){M()||A(e.nativeEvent,!1)}})),[A,M]);return e.useMemo((()=>c?{reference:D,floating:N}:{}),[c,D,N])},flip:(e,t)=>({...Qe(e),options:[e,t]}),shift:(e,t)=>({...Ge(e),options:[e,t]}),hide:(e,t)=>({...Je(e),options:[e,t]}),offset:(e,t)=>({...Ze(e),options:[e,t]}),useMergeRefs:ct},hn=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)};function yn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=yn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yn(e))&&(r&&(r+=" "),r+=t);return r}var bn="HoverCard",xn=["div","span","button","input"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,u=p(n,["asChild","children"]);if(i){var c=t.Children.toArray(l);if(1!==c.length||!t.isValidElement(c[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,d(d({},u),{ref:r}),l);var s=c[0];return t.cloneElement(s,d(d(d({},u),s.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var t=s.ref;"function"==typeof t?t(e):t&&(t.current=e)}}:{}))}return t.createElement(e,d(d({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),En=function(){return console.warn("Direct usage of HoverCard is not supported. Please use HoverCard.Root, HoverCard.Trigger, etc. instead."),null};En.Root=function(e){var n=e.children,r=e.open,o=void 0===r?void 0:r,u=e.onOpenChange,c=e.customRootClass,s=void 0===c?"":c,a=e.openDelay,f=void 0===a?100:a,v=e.closeDelay,g=void 0===v?200:v,h=p(e,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),y=hn(s,bn),w=hn(s,"".concat(bn,"-trigger")),b=i(null),x=gn.useFloating({placement:"bottom",strategy:"fixed",middleware:[gn.arrow({element:b}),gn.offset(10),gn.flip({mainAxis:!0})]}),E=x.refs,R=x.floatingStyles,C=x.context,L=l(!1),S=L[0],O=L[1],T=l(!1);T[0];var A=T[1],P=void 0!==o,k=P?o:S,M=function(e){P||O(e),null==u||u(e)},D=gn.useRole(C),N=gn.useDismiss(C),F=gn.useHover(C,{delay:100}),I=gn.useInteractions([F,D,N]),W=I.getReferenceProps,H=I.getFloatingProps,j={isOpen:k,handleOpenChange:M,floatingRefs:E,floatingStyles:R,floatingContext:C,arrowRef:b,getReferenceProps:W,getFloatingProps:H,rootClass:y,rootTriggerClass:w,closeWithDelay:function(){A(!0),setTimeout((function(){A((function(e){return e&&M(!1),e}))}),g)},closeWithoutDelay:function(){M(!1)},openWithDelay:function(){A(!1),setTimeout((function(){M(!0)}),f)}};return t.createElement(m.Provider,{value:j},t.createElement("div",d({className:wn(y)},h),n))},En.Trigger=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=p(e,["children","className"]),l=u(m),c=l.floatingRefs,s=l.closeWithDelay,a=l.openWithDelay,f=l.rootTriggerClass;return t.createElement(t.Fragment,null,t.createElement(xn.span,d({className:wn(f,o),onClick:function(){},onMouseEnter:a,onMouseLeave:s,ref:c.setReference},i),n))},En.Portal=function(e){var n=e.children,r=e.rootElement,o=void 0===r?void 0:r,i=p(e,["children","rootElement"]),l=u(m).rootTriggerClass,c=o||document.getElementsByClassName(l)[0];return t.createElement(gn.Portal,d({root:c},i),n)},En.Content=function(e){var n=e.children,r=p(e,["children"]),i=u(m),l=i.isOpen,c=i.floatingRefs,s=i.floatingStyles,a=i.getFloatingProps,f=i.rootClass,v=i.closeWithDelay,g=i.closeWithoutDelay,h=i.openWithDelay;return o((function(){var e=function(){return g()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[g]),l?t.createElement("div",d({onPointerEnter:h,onPointerLeave:v,className:wn(f)},r,{ref:c.setFloating,style:s},a()),n):null},En.Arrow=function(e){var n=p(e,[]),r=u(m),o=r.floatingContext,i=r.arrowRef,l=r.rootClass;return t.createElement(gn.Arrow,d({className:wn("".concat(l,"-arrow"))},n,{context:o,ref:i}))};export{En as default};
@@ -1 +1 @@
1
- 'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r){var e,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(o=t(r[e]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}function o(){for(var r,e,o=0,n="",a=arguments.length;o<a;o++)(r=arguments[o])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var n="Link",a=function(t){var a=t.children,c=t.href,f=void 0===c?"#":c,i=t.customRootClass,s=t.className,l=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}(t,["children","href","customRootClass","className"]),p=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(i,n);return r.createElement("a",e({href:f,className:o(p,s)},l),a)};a.displayName=n;export{a as default};
1
+ 'use client';import r,{useCallback as e}from"react";var t=function(){return t=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},t.apply(this,arguments)};function n(r){var e,t,o="";if("string"==typeof r||"number"==typeof r)o+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=n(r[e]))&&(o&&(o+=" "),o+=t)}else for(t in r)r[t]&&(o&&(o+=" "),o+=t);return o}function o(){for(var r,e,t=0,o="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=n(r))&&(o&&(o+=" "),o+=e);return o}"function"==typeof SuppressedError&&SuppressedError;var a="Link",i=function(n){var i,c,f=n.children,s=n.href,u=void 0===s?"#":s,l=n.customRootClass,p=n.className,y=n.size,v=void 0===y?"":y,m=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}(n,["children","href","customRootClass","className","size"]),d=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(l,a),O=e((function(){return c?Object.fromEntries(Object.entries(c).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(i,"-").concat(e),t]}))):{}}),[i="link",c={size:v}]);return r.createElement("a",t({href:u,className:o(d,p)},O(),m),f)};i.displayName=a;export{i as default};
@@ -1 +1 @@
1
- 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),i=["div","span","button","input"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,i=void 0!==c&&c,l=t.children,u=a(t,["asChild","children"]);if(i){var d=e.Children.toArray(l);if(1!==d.length||!e.isValidElement(d[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,o(o({},u),{ref:r}),l);var f=d[0];return e.cloneElement(f,o(o(o({},u),f.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=f.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,o(o({},u),{ref:r}),l)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),l=function(n){var t=n.name,r=void 0===t?"":t,c=n.value,l=void 0===c?"":c,u=n.checked,d=void 0!==u&&u,f=n.onClick,s=n.onChange,v=a(n,["name","value","checked","onClick","onChange"]),h={"data-checked":d.toString()};return e.createElement(i.input,o({id:l,type:"radio",value:l,name:r,onClick:function(e){var n,t=null===(n=e.target)||void 0===n?void 0:n.checked;"function"==typeof f&&f({value:l,checked:t})},onChange:function(e){var n=e.target.checked;"function"==typeof s&&s({value:l,checked:n})}},v,h))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,i=t.defaultChecked,l=void 0===i?"":i,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),s=n(l),v=s[0],h=s[1],m={checkedItem:v,setCheckedItem:h,onChange:function(e){h(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:m},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,i=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,s=d.checkedItem,v=d.onChange;return e.createElement("div",o({},u),e.createElement(l,{value:r,name:"radio",checked:s===r,onChange:function(e){f(r),"function"==typeof v&&v(r)}}),e.createElement("label",{htmlFor:r},i))};var s=r({defaultChecked:null,rootClass:"",onChange:null}),v=function(){return console.warn("Direct usage of RadioCards is not supported. Please use RadioCards.Root and RadioCards.Item instead."),null};v.Root=function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,i=n.onChange,l=void 0===i?null:i,d=n.customRootClass,v=void 0===d?"":d,h=function(e,n){if(void 0===e&&(e=""),e)return e;var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(v,"RadioCards");return e.createElement(s.Provider,{value:{defaultChecked:c,rootClass:h,onChange:l}},e.createElement(u.Root,{className:f(h,o),customRootClass:v},t))},v.Item=function(n){var r=n.children,c=n.className,i=void 0===c?"":c,l=a(n,["children","className"]),d=t(s).rootClass;return e.createElement(u.Item,o({className:f("".concat(d,"-item"),i)},l),r)};export{v as default};
1
+ 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),l=["div","span","button","input"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,l=void 0!==c&&c,i=t.children,u=a(t,["asChild","children"]);if(l){var d=e.Children.toArray(i);if(1!==d.length||!e.isValidElement(d[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,o(o({},u),{ref:r}),i);var f=d[0];return e.cloneElement(f,o(o(o({},u),f.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=f.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,o(o({},u),{ref:r}),i)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),i=function(t){var r=t.name,c=void 0===r?"":r,i=t.value,u=void 0===i?"":i,d=t.checked,f=void 0!==d&&d;t.onClick;var s=t.onChange,v=a(t,["name","value","checked","onClick","onChange"]),h=n(f),m=h[0],p=h[1],C={"data-checked":m.toString()};return e.createElement(l.input,o({id:u,type:"radio",value:u,name:c,onChange:function(e){var n=e.target.checked;console.log(n),"function"==typeof s&&(p(n),s({value:u,checked:n}))}},v,C))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,l=t.defaultChecked,i=void 0===l?"":l,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),s=n(i),v=s[0],h=s[1],m={checkedItem:v,setCheckedItem:h,onChange:function(e){h(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:m},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,l=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,s=d.checkedItem,v=d.onChange;return e.createElement("div",o({},u),e.createElement(i,{value:r,name:"radio",checked:s===r,onChange:function(e){f(r),"function"==typeof v&&v(r)}}),e.createElement("label",{htmlFor:r},l))};var s=r({defaultChecked:null,rootClass:"",onChange:null}),v=function(){return console.warn("Direct usage of RadioCards is not supported. Please use RadioCards.Root and RadioCards.Item instead."),null};v.Root=function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,l=n.onChange,i=void 0===l?null:l,d=n.customRootClass,v=void 0===d?"":d,h=function(e,n){if(void 0===e&&(e=""),e)return e;var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(v,"RadioCards");return e.createElement(s.Provider,{value:{defaultChecked:c,rootClass:h,onChange:i}},e.createElement(u.Root,{className:f(h,o),customRootClass:v},t))},v.Item=function(n){var r=n.children,c=n.className,l=void 0===c?"":c,i=a(n,["children","className"]),d=t(s).rootClass;return e.createElement(u.Item,o({className:f("".concat(d,"-item"),l)},i),r)};export{v as default};
@@ -1 +1 @@
1
- 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),l=["div","span","button","input"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,l=void 0!==c&&c,i=t.children,u=a(t,["asChild","children"]);if(l){var d=e.Children.toArray(i);if(1!==d.length||!e.isValidElement(d[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,o(o({},u),{ref:r}),i);var f=d[0];return e.cloneElement(f,o(o(o({},u),f.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=f.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,o(o({},u),{ref:r}),i)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),i=function(n){var t=n.name,r=void 0===t?"":t,c=n.value,i=void 0===c?"":c,u=n.checked,d=void 0!==u&&u,f=n.onClick,s=n.onChange,v=a(n,["name","value","checked","onClick","onChange"]),h={"data-checked":d.toString()};return e.createElement(l.input,o({id:i,type:"radio",value:i,name:r,onClick:function(e){var n,t=null===(n=e.target)||void 0===n?void 0:n.checked;"function"==typeof f&&f({value:i,checked:t})},onChange:function(e){var n=e.target.checked;"function"==typeof s&&s({value:i,checked:n})}},v,h))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,l=t.defaultChecked,i=void 0===l?"":l,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),s=n(i),v=s[0],h=s[1],p={checkedItem:v,setCheckedItem:h,onChange:function(e){h(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:p},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,l=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,s=d.checkedItem,v=d.onChange;return e.createElement("div",o({},u),e.createElement(i,{value:r,name:"radio",checked:s===r,onChange:function(e){f(r),"function"==typeof v&&v(r)}}),e.createElement("label",{htmlFor:r},l))};var s=r({defaultChecked:null,customRootClass:null,onChange:null}),v=function(){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root and RadioGroup.Item instead."),null};v.Root=function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,l=n.onChange,i=void 0===l?null:l,d=n.customRootClass,v=void 0===d?"":d,h=function(e,n){if(void 0===e&&(e=""),e)return e;var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(v,"RadioGroup");return e.createElement(s.Provider,{value:{defaultChecked:c,rootClass:h,onChange:i}},e.createElement(u.Root,{className:f(h,o),customRootClass:v},t))},v.Item=function(n){var r=n.children,c=n.className,l=void 0===c?"":c,i=a(n,["children","className"]),d=t(s).rootClass;return e.createElement(u.Item,o({className:f("".concat(d,"-item"),l)},i),r)};export{v as default};
1
+ 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),l=["div","span","button","input"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,l=void 0!==c&&c,i=t.children,u=a(t,["asChild","children"]);if(l){var d=e.Children.toArray(i);if(1!==d.length||!e.isValidElement(d[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,o(o({},u),{ref:r}),i);var f=d[0];return e.cloneElement(f,o(o(o({},u),f.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=f.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,o(o({},u),{ref:r}),i)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),i=function(t){var r=t.name,c=void 0===r?"":r,i=t.value,u=void 0===i?"":i,d=t.checked,f=void 0!==d&&d;t.onClick;var s=t.onChange,v=a(t,["name","value","checked","onClick","onChange"]),h=n(f),p=h[0],m=h[1],C={"data-checked":p.toString()};return e.createElement(l.input,o({id:u,type:"radio",value:u,name:c,onChange:function(e){var n=e.target.checked;console.log(n),"function"==typeof s&&(m(n),s({value:u,checked:n}))}},v,C))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,l=t.defaultChecked,i=void 0===l?"":l,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),s=n(i),v=s[0],h=s[1],p={checkedItem:v,setCheckedItem:h,onChange:function(e){h(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:p},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,l=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,s=d.checkedItem,v=d.onChange;return e.createElement("div",o({},u),e.createElement(i,{value:r,name:"radio",checked:s===r,onChange:function(e){f(r),"function"==typeof v&&v(r)}}),e.createElement("label",{htmlFor:r},l))};var s=r({defaultChecked:null,customRootClass:null,onChange:null}),v=function(){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root and RadioGroup.Item instead."),null};v.Root=function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,l=n.onChange,i=void 0===l?null:l,d=n.customRootClass,v=void 0===d?"":d,h=function(e,n){if(void 0===e&&(e=""),e)return e;var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(v,"RadioGroup");return e.createElement(s.Provider,{value:{defaultChecked:c,rootClass:h,onChange:i}},e.createElement(u.Root,{className:f(h,o),customRootClass:v},t))},v.Item=function(n){var r=n.children,c=n.className,l=void 0===c?"":c,i=a(n,["children","className"]),d=t(s).rootClass;return e.createElement(u.Item,o({className:f("".concat(d,"-item"),l)},i),r)};export{v as default};
@@ -1 +1 @@
1
- 'use client';import e,{useState as r}from"react";var t=function(){return t=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function n(e){var r,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var c=e.length;for(r=0;r<c;r++)e[r]&&(t=n(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function o(){for(var e,r,t=0,o="",c=arguments.length;t<c;t++)(e=arguments[t])&&(r=n(e))&&(o&&(o+=" "),o+=r);return o}var c="Switch",a=function(n){n.children;var a=n.customRootClass,l=void 0===a?"":a;n.className;var i=n.color,u=void 0===i?"":i,f=n.defaultChecked,s=n.checked,p=n.onChange,d=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}(n,["children","customRootClass","className","color","defaultChecked","checked","onChange"]),h=function(e,r){if(void 0===e&&(e=""),e)return e;var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(l,c),y=r(s||f),v=y[0],m=y[1],b={};return u&&(b["data-accent-color"]=u),e.createElement(e.Fragment,null,e.createElement("input",t({type:"checkbox",className:o(h)},d,{checked:v,onChange:function(e){return m(e.target.checked)}})),e.createElement("button",t({type:"button",onClick:function(){var e=!v;m(e),p(e)},role:"switch","aria-checked":v},b)))};a.displayName=c;export{a as default};
1
+ 'use client';import e,{useCallback as r,useState as t}from"react";var n=function(){return n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},n.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function o(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var c=e.length;for(r=0;r<c;r++)e[r]&&(t=o(e[r]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function c(){for(var e,r,t=0,n="",c=arguments.length;t<c;t++)(e=arguments[t])&&(r=o(e))&&(n&&(n+=" "),n+=r);return n}var a=function(e,t){return r((function(){return t?Object.fromEntries(Object.entries(t).filter((function(e){e[0];var r=e[1];return void 0!==r&&""!==r})).map((function(r){var t=r[0],n=r[1];return["data-".concat(e,"-").concat(t),n]}))):{}}),[e,t])},i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r((function(){return Object.assign.apply(Object,function(e,r,t){if(t||2===arguments.length)for(var n,o=0,c=r.length;o<c;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}([{}],e.filter((function(e){return null!==e})),!1))}),[e])},l="Switch",u=function(r){r.children;var o=r.customRootClass,u=void 0===o?"":o;r.className;var f=r.color,s=void 0===f?"":f,p=r.variant,v=void 0===p?"":p,h=r.size,y=void 0===h?"":h,d=r.defaultChecked,b=r.checked,g=r.onChange,m=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}(r,["children","customRootClass","className","color","variant","size","defaultChecked","checked","onChange"]),O=function(e,r){if(void 0===e&&(e=""),e)return e;var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(u,l),j=t(b||d),k=j[0],C=j[1],w=a("switch",{variant:v,size:y}),E=a("accent",{color:s}),A=i(w(),E());return e.createElement(e.Fragment,null,e.createElement("input",n({type:"checkbox",className:c(O)},m,{checked:k,onChange:function(e){return C(e.target.checked)}})),e.createElement("button",n({type:"button",onClick:function(){var e=!k;C(e),g(e)},role:"switch","aria-checked":k},A())))};u.displayName=l;export{u as default};