@mmb-digital/design-system-web 0.1.41 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -952,7 +952,7 @@
952
952
  outline-color: ${({theme:e})=>e.colors.focus.light};
953
953
  outline-offset: 2px;
954
954
  }
955
- `,pn=t=>{const{onClick:n}=t;return e.createElement(dn,{type:"button",onClick:n},e.createElement(ne,{size:exports.IconSystemSize.big,type:exports.IconSystemType.close}))},hn=e=>{const t=document.createElement("div");return t.id=e,window.document.body.appendChild(t),t},fn="react-modal-container",mn=r=>{const{children:o,hideCloseButton:a,isOpen:i,modalRootElementId:s=fn,onClose:l,title:c}=r,u=t.useTheme();return(t=>{const{onClose:n}=t,r=e.useCallback((e=>{"Escape"===e.key&&n(exports.ReasonForClosing.ESC)}),[n]);e.useEffect((()=>(window.document.addEventListener("keyup",r),()=>{window.document.removeEventListener("keyup",r)})),[r])})({onClose:l}),i?n.createPortal(e.createElement(e.Fragment,null,e.createElement(sn,{key:"overlay",onClick:()=>{l(exports.ReasonForClosing.OVERLAY)}}),e.createElement(ln,{tabIndex:-1},!a&&e.createElement(un,null,e.createElement(pn,{onClick:()=>{l(exports.ReasonForClosing.CLOSE_BUTTON)}})),e.createElement(cn,null,void 0!==c&&e.createElement("div",null,e.createElement(d,{color:u.colors.fg.neutral.default.light,textAlign:exports.TypographyTextAlign.LEFT,variant:exports.TypographyVariant.H3},c)),e.createElement("div",null,e.createElement(d,{color:u.colors.fg.neutral.subtle.light,variant:exports.TypographyVariant.TEXT_MD},o))))),(e=>{let t=window.document.getElementById(e);if(!t){t=hn(e);const n=new CustomEvent("react.modal.created");window.document.dispatchEvent(n)}return t})(s)):null};function gn(e){return yn(e)?(e.nodeName||"").toLowerCase():"#document"}function bn(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function vn(e){var t;return null==(t=(yn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function yn(e){return e instanceof Node||e instanceof bn(e).Node}function xn(e){return e instanceof Element||e instanceof bn(e).Element}function wn(e){return e instanceof HTMLElement||e instanceof bn(e).HTMLElement}function kn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof bn(e).ShadowRoot)}function Cn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function In(e){return["table","td","th"].includes(gn(e))}function En(e){const t=Tn(),n=Mn(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Sn(e){let t=An(e);for(;wn(t)&&!Dn(t);){if(En(t))return t;t=An(t)}return null}function Tn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Dn(e){return["html","body","#document"].includes(gn(e))}function Mn(e){return bn(e).getComputedStyle(e)}function Ln(e){return xn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function An(e){if("html"===gn(e))return e;const t=e.assignedSlot||e.parentNode||kn(e)&&e.host||vn(e);return kn(t)?t.host:t}function Nn(e){const t=An(e);return Dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:wn(t)&&Cn(t)?t:Nn(t)}function On(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Nn(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=bn(o);return a?t.concat(i,i.visualViewport||[],Cn(o)?o:[],i.frameElement&&n?On(i.frameElement):[]):t.concat(o,On(o,[],n))}function Pn(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 Rn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&kn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Wn(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Bn(){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 Gn(e){return!Bn().includes("jsdom/")&&(!Vn()&&0===e.width&&0===e.height||Vn()&&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 Vn(){const e=/android/i;return e.test(Wn())||e.test(Bn())}function Fn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Hn(e){return(null==e?void 0:e.ownerDocument)||document}function _n(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 Xn(e){return"composedPath"in e?e.composedPath()[0]:e.target}const zn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";const Yn=Math.min,$n=Math.max,jn=Math.round,Zn=Math.floor,Jn=e=>({x:e,y:e}),Un={left:"right",right:"left",bottom:"top",top:"bottom"},Qn={start:"end",end:"start"};function Kn(e,t,n){return $n(e,Yn(t,n))}function qn(e,t){return"function"==typeof e?e(t):e}function er(e){return e.split("-")[0]}function tr(e){return e.split("-")[1]}function nr(e){return"x"===e?"y":"x"}function rr(e){return"y"===e?"height":"width"}function or(e){return["top","bottom"].includes(er(e))?"y":"x"}function ar(e){return nr(or(e))}function ir(e){return e.replace(/start|end/g,(e=>Qn[e]))}function sr(e){return e.replace(/left|right|bottom|top/g,(e=>Un[e]))}function lr(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 cr(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ur(e,t,n){let{reference:r,floating:o}=e;const a=or(t),i=ar(t),s=rr(i),l=er(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(tr(t)){case"start":h[i]-=p*(n&&c?-1:1);break;case"end":h[i]+=p*(n&&c?-1:1)}return h}async function dr(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=qn(t,e),f=lr(h),m=s[p?"floating"===d?"reference":"floating":d],g=cr(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b="floating"===d?{...i.floating,x:r,y:o}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),y=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},x=cr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:l}):b);return{top:(g.top-x.top+f.top)/y.y,bottom:(x.bottom-g.bottom+f.bottom)/y.y,left:(g.left-x.left+f.left)/y.x,right:(x.right-g.right+f.right)/y.x}}const pr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=er(n),s=tr(n),l="y"===or(n),c=["left","top"].includes(i)?-1:1,u=a&&l?-1:1,d=qn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}};function hr(e){const t=Mn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=wn(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=jn(n)!==a||jn(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function fr(e){return xn(e)?e:e.contextElement}function mr(e){const t=fr(e);if(!wn(t))return Jn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=hr(t);let i=(a?jn(n.width):n.width)/r,s=(a?jn(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const gr=Jn(0);function br(e){const t=bn(e);return Tn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:gr}function vr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=fr(e);let i=Jn(1);t&&(r?xn(r)&&(i=mr(r)):i=mr(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==bn(e))&&t}(a,n,r)?br(a):Jn(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=bn(a),t=r&&xn(r)?bn(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=mr(n),t=n.getBoundingClientRect(),r=Mn(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=a,n=bn(n).frameElement}}return cr({width:u,height:d,x:l,y:c})}const yr=[":popover-open",":modal"];function xr(e){let t=!1,n=0,r=0;if(yr.forEach((n=>{!function(n){try{t=t||e.matches(n)}catch(e){}}(n)})),t){const t=Sn(e);if(t){const e=t.getBoundingClientRect();n=e.x,r=e.y}}return[t,n,r]}function wr(e){return vr(vn(e)).left+Ln(e).scrollLeft}function kr(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=bn(e),r=vn(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=Tn();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=vn(e),n=Ln(e),r=e.ownerDocument.body,o=$n(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$n(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+wr(e);const s=-n.scrollTop;return"rtl"===Mn(r).direction&&(i+=$n(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(vn(e));else if(xn(t))r=function(e,t){const n=vr(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=wn(e)?mr(e):Jn(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=br(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return cr(r)}function Cr(e,t){const n=An(e);return!(n===t||!xn(n)||Dn(n))&&("fixed"===Mn(n).position||Cr(n,t))}function Ir(e,t,n,r){const o=wn(t),a=vn(t),i="fixed"===n,s=vr(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Jn(0);if(o||!o&&!i)if(("body"!==gn(t)||Cn(a))&&(l=Ln(t)),o){const e=vr(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&(c.x=wr(a));let u=s.left+l.scrollLeft-c.x,d=s.top+l.scrollTop-c.y;const[p,h,f]=xr(r);return p&&(u+=h,d+=f,o&&(u+=t.clientLeft,d+=t.clientTop)),{x:u,y:d,width:s.width,height:s.height}}function Er(e,t){return wn(e)&&"fixed"!==Mn(e).position?t?t(e):e.offsetParent:null}function Sr(e,t){const n=bn(e);if(!wn(e))return n;let r=Er(e,t);for(;r&&In(r)&&"static"===Mn(r).position;)r=Er(r,t);return r&&("html"===gn(r)||"body"===gn(r)&&"static"===Mn(r).position&&!En(r))?n:r||Sn(e)||n}const Tr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=vn(r),[i]=t?xr(t.floating):[!1];if(r===a||i)return n;let s={scrollLeft:0,scrollTop:0},l=Jn(1);const c=Jn(0),u=wn(r);if((u||!u&&"fixed"!==o)&&(("body"!==gn(r)||Cn(a))&&(s=Ln(r)),wn(r))){const e=vr(r);l=mr(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+c.x,y:n.y*l.y-s.scrollTop*l.y+c.y}},getDocumentElement:vn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=On(e,[],!1).filter((e=>xn(e)&&"body"!==gn(e))),o=null;const a="fixed"===Mn(e).position;let i=a?An(e):e;for(;xn(i)&&!Dn(i);){const t=Mn(i),n=En(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Cn(i)&&!n&&Cr(e,i))?r=r.filter((e=>e!==i)):o=t,i=An(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=a[0],s=a.reduce(((e,n)=>{const r=kr(t,n,o);return e.top=$n(r.top,e.top),e.right=Yn(r.right,e.right),e.bottom=Yn(r.bottom,e.bottom),e.left=$n(r.left,e.left),e}),kr(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Sr,getElementRects:async function(e){const t=this.getOffsetParent||Sr,n=this.getDimensions;return{reference:Ir(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=hr(e);return{width:t,height:n}},getScale:mr,isElement:xn,isRTL:function(e){return"rtl"===Mn(e).direction}};function Dr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=fr(e),u=o||a?[...c?On(c):[],...On(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=vn(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const h={rootMargin:-Zn(u)+"px "+-Zn(o.clientWidth-(c+d))+"px "+-Zn(o.clientHeight-(u+p))+"px "+-Zn(c)+"px",threshold:$n(0,Yn(1,l))||1};let f=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return i();t?i(!1,t):n=setTimeout((()=>{i(!1,1e-7)}),100)}f=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),a}(c,n):null;let p,h=-1,f=null;i&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let m=l?vr(e):null;return l&&function t(){const r=vr(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Mr=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qn(e,t),c={x:n,y:r},u=await dr(t,l),d=or(er(o)),p=nr(d);let h=c[p],f=c[d];if(a){const e="y"===p?"bottom":"right";h=Kn(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=Kn(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Lr=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=qn(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const b=er(o),v=er(s)===s,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(v||!m?[sr(s)]:function(e){const t=sr(e);return[ir(e),t,ir(t)]}(s));p||"none"===f||x.push(...function(e,t,n,r){const o=tr(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}(er(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(ir)))),a}(s,m,f,y));const w=[s,...x],k=await dr(t,g),C=[];let I=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&C.push(k[b]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=tr(e),o=ar(e),a=rr(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=sr(i)),[i,sr(i)]}(o,i,y);C.push(k[e[0]],k[e[1]])}if(I=[...I,{placement:o,overflows:C}],!C.every((e=>e<=0))){var E,S;const e=((null==(E=a.flip)?void 0:E.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(S=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!n)switch(h){case"bestFit":{var T;const e=null==(T=I.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:T[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Ar=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=qn(e,t)||{};if(null==c)return{};const d=lr(u),p={x:n,y:r},h=ar(o),f=rr(h),m=await i.getDimensions(c),g="y"===h,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=a.reference[f]+a.reference[h]-p[h]-a.floating[f],w=p[h]-a.reference[h],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let C=k?k[y]:0;C&&await(null==i.isElement?void 0:i.isElement(k))||(C=s.floating[y]||a.floating[f]);const I=x/2-w/2,E=C/2-m[f]/2-1,S=Yn(d[b],E),T=Yn(d[v],E),D=S,M=C-m[f]-T,L=C/2-m[f]/2+I,A=Kn(D,L,M),N=!l.arrow&&null!=tr(o)&&L!==A&&a.reference[f]/2-(L<D?S:T)-m[f]/2<0,O=N?L<D?L-D:L-M:0;return{[h]:p[h]+O,data:{[h]:A,centerOffset:L-A-O,...N&&{alignmentOffset:O}},reset:N}}}),Nr=(e,t,n)=>{const r=new Map,o={platform:Tr,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ur(c,r,l),p=r,h={},f=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:b,data:v,reset:y}=await m({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=b?b:d,h={...h,[a]:{...h[a],...v}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=ur(c,p,l))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})},Or=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?Ar({element:n.current,padding:r}).fn(t):{}:n?Ar({element:n,padding:r}).fn(t):{};var o}});var Pr="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function Rr(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(!Rr(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)&&!Rr(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Wr(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Br(e,t){const n=Wr(e);return Math.round(t*n)/n}function Gr(e){const t=o.useRef(e);return Pr((()=>{t.current=e})),t}const Vr=o["useInsertionEffect".toString()]||(e=>e());function Fr(e){const t=o.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Vr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}var Hr="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_r.apply(this,arguments)}let Xr=!1,zr=0;const Yr=()=>"floating-ui-"+zr++;const $r=o["useId".toString()]||function(){const[e,t]=o.useState((()=>Xr?Yr():void 0));return Hr((()=>{null==e&&t(Yr())}),[]),o.useEffect((()=>{Xr||(Xr=!0)}),[]),e},jr=o.forwardRef((function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:a}},width:i=14,height:s=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:p,style:{transform:h,...f}={},...m}=e;"production"!==process.env.NODE_ENV&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const g=$r();if(!r)return null;c*=2;const b=c/2,v=i/2*(l/-8+1),y=s/2*l/4,[x,w]=n.split("-"),k=Tr.isRTL(r),C=!!p,I="top"===x||"bottom"===x,E=u&&"end"===w?"bottom":"top";let S=u&&"end"===w?"right":"left";u&&k&&(S="end"===w?"left":"right");const T=null!=(null==a?void 0:a.x)?u||a.x:"",D=null!=(null==a?void 0:a.y)?u||a.y:"",M=p||"M0,0 H"+i+" L"+(i-v)+","+(s-y)+" Q"+i/2+","+s+" "+v+","+(s-y)+" Z",L={top:C?"rotate(180deg)":"",left:C?"rotate(90deg)":"rotate(-90deg)",bottom:C?"":"rotate(180deg)",right:C?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",_r({},m,{"aria-hidden":!0,ref:t,width:C?i:i+c,height:i,viewBox:"0 0 "+i+" "+(s>i?s:i),style:{position:"absolute",pointerEvents:"none",[S]:T,[E]:D,[x]:I||C?"100%":"calc(100% - "+c/2+"px)",transform:""+L+(null!=h?h:""),...f}}),c>0&&o.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:c+(p?0:1),d:M}),o.createElement("path",{stroke:c&&!p?m.fill:"none",d:M}),o.createElement("clipPath",{id:g},o.createElement("rect",{x:-b,y:b*(C?-1:1),width:i+c,height:i})))}));const Zr=o.createContext(null),Jr=o.createContext(null),Ur=()=>{var e;return(null==(e=o.useContext(Zr))?void 0:e.id)||null},Qr=()=>o.useContext(Jr);function Kr(e){return"data-floating-ui-"+e}function qr(t){const n=e.useRef(t);return Hr((()=>{n.current=t})),n}const eo=Kr("safe-polygon");function to(e,t,n){return n&&!Fn(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function no(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 ro={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},oo={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ao=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}};let io;function so(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if("production"!==process.env.NODE_ENV){var s;const t="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";var l,c;if(null!=(s=e.elements)&&s.reference&&!xn(e.elements.reference))if(null==(l=io)||!l.has(t))null==(c=io)||c.add(t),console.error(t)}const[u,d]=o.useState(null),p=(null==(t=e.elements)?void 0:t.reference)||u,h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,h]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=o.useState(r);Rr(f,r)||m(r);const[g,b]=o.useState(null),[v,y]=o.useState(null),x=o.useCallback((e=>{e!==I.current&&(I.current=e,b(e))}),[]),w=o.useCallback((e=>{e!==E.current&&(E.current=e,y(e))}),[]),k=s||g,C=l||v,I=o.useRef(null),E=o.useRef(null),S=o.useRef(p),T=null!=u,D=Gr(u),M=Gr(i),L=o.useCallback((()=>{if(!I.current||!E.current)return;const e={placement:t,strategy:n,middleware:f};M.current&&(e.platform=M.current),Nr(I.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};A.current&&!Rr(S.current,t)&&(S.current=t,a.flushSync((()=>{h(t)})))}))}),[f,t,n,M]);Pr((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[d]);const A=o.useRef(!1);Pr((()=>(A.current=!0,()=>{A.current=!1})),[]),Pr((()=>{if(k&&(I.current=k),C&&(E.current=C),k&&C){if(D.current)return D.current(k,C,L);L()}}),[k,C,L,D,T]);const N=o.useMemo((()=>({reference:I,floating:E,setReference:x,setFloating:w})),[x,w]),O=o.useMemo((()=>({reference:k,floating:C})),[k,C]),P=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=Br(O.floating,p.x),r=Br(O.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Wr(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,O.floating,p.x,p.y]);return o.useMemo((()=>({...p,update:L,refs:N,elements:O,floatingStyles:P})),[p,L,N,O,P])}(e),f=Qr(),m=null!=Ur(),g=Fr(((e,t,n)=>{e&&(v.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:m}),null==r||r(e,t,n)})),b=o.useRef(null),v=o.useRef({}),y=o.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)))||[])}}}()))[0],x=$r(),w=o.useCallback((e=>{const t=xn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;h.refs.setReference(t)}),[h.refs]),k=o.useCallback((e=>{(xn(e)||null===e)&&(b.current=e,d(e)),(xn(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!xn(e))&&h.refs.setReference(e)}),[h.refs]),C=o.useMemo((()=>({...h.refs,setReference:k,setPositionReference:w,domReference:b})),[h.refs,k,w]),I=o.useMemo((()=>({...h.elements,domReference:p})),[h.elements,p]),E=o.useMemo((()=>({...h,refs:C,elements:I,dataRef:v,nodeId:i,floatingId:x,events:y,open:n,onOpenChange:g})),[h,i,x,y,n,g,C,I]);return Hr((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...h,context:E,refs:C,elements:I})),[h,C,I,E])}function lo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:a,refs:i,elements:{domReference:s}}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),p=o.useRef(!0);return o.useEffect((()=>{if(!l)return;const e=bn(s);function t(){!n&&wn(s)&&s===Pn(Hn(s))&&(u.current=!0)}function r(){p.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[s,n,l]),o.useEffect((()=>{if(l)return a.on("openchange",e),()=>{a.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[a,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]),o.useMemo((()=>l?{reference:{onPointerDown(e){Gn(e.nativeEvent)||(p.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=Xn(e.nativeEvent);if(c&&xn(t))try{if(/apple/i.test(navigator.vendor)&&Wn().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&(!wn(n=t)||!n.matches(zn)))return}var n;r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=xn(t)&&t.hasAttribute(Kr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{const o=Pn(s?s.ownerDocument:document);(t||o!==s)&&(Rn(i.floating.current,o)||Rn(s,o)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,c,s,i,r])}"production"!==process.env.NODE_ENV&&(io=new Set);const co="active",uo="selected";function po(e,t,n){const r=new Map,o="item"===n;let a=e;if(o&&e){const{[co]:t,[uo]:n,...r}=e;a=r}return{..."floating"===n&&{tabIndex:-1},...a,...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,a]=t;var i;o&&[co,uo].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(i=r.get(n))||i.push(a),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=a)})),e):e),{})}}const ho=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function mo(e,t){return"function"==typeof e?e(t):e}function go(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:a=250}=t,i=("number"==typeof a?a:a.close)||0,[s,l]=o.useState(!1),[c,u]=o.useState("unmounted"),d=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return Hr((()=>{s&&!d&&u("unmounted")}),[s,d]),Hr((()=>{if(r){if(n){u("initial");const e=requestAnimationFrame((()=>{u("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),u("close")}}),[n,r]),{isMounted:d,status:c}}const bo=t(jr)`
955
+ `,pn=t=>{const{onClick:n}=t;return e.createElement(dn,{type:"button",onClick:n},e.createElement(ne,{size:exports.IconSystemSize.big,type:exports.IconSystemType.close}))},hn=e=>{const t=document.createElement("div");return t.id=e,window.document.body.appendChild(t),t},fn="react-modal-container",mn=r=>{const{children:o,hideCloseButton:a,id:i,isOpen:s,modalRootElementId:l=fn,onClose:c,title:u}=r,p=t.useTheme();return(t=>{const{onClose:n}=t,r=e.useCallback((e=>{"Escape"===e.key&&n(exports.ReasonForClosing.ESC)}),[n]);e.useEffect((()=>(window.document.addEventListener("keyup",r),()=>{window.document.removeEventListener("keyup",r)})),[r])})({onClose:c}),s?n.createPortal(e.createElement(e.Fragment,null,e.createElement(sn,{key:"overlay",onClick:()=>{c(exports.ReasonForClosing.OVERLAY)}}),e.createElement(ln,{id:i,tabIndex:-1},!a&&e.createElement(un,null,e.createElement(pn,{onClick:()=>{c(exports.ReasonForClosing.CLOSE_BUTTON)}})),e.createElement(cn,null,void 0!==u&&e.createElement("div",null,e.createElement(d,{color:p.colors.fg.neutral.default.light,textAlign:exports.TypographyTextAlign.LEFT,variant:exports.TypographyVariant.H3},u)),e.createElement("div",null,e.createElement(d,{color:p.colors.fg.neutral.subtle.light,variant:exports.TypographyVariant.TEXT_MD},o))))),(e=>{let t=window.document.getElementById(e);if(!t){t=hn(e);const n=new CustomEvent("react.modal.created");window.document.dispatchEvent(n)}return t})(l)):null};function gn(e){return yn(e)?(e.nodeName||"").toLowerCase():"#document"}function bn(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function vn(e){var t;return null==(t=(yn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function yn(e){return e instanceof Node||e instanceof bn(e).Node}function xn(e){return e instanceof Element||e instanceof bn(e).Element}function wn(e){return e instanceof HTMLElement||e instanceof bn(e).HTMLElement}function kn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof bn(e).ShadowRoot)}function Cn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function In(e){return["table","td","th"].includes(gn(e))}function En(e){const t=Tn(),n=Mn(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Sn(e){let t=An(e);for(;wn(t)&&!Dn(t);){if(En(t))return t;t=An(t)}return null}function Tn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Dn(e){return["html","body","#document"].includes(gn(e))}function Mn(e){return bn(e).getComputedStyle(e)}function Ln(e){return xn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function An(e){if("html"===gn(e))return e;const t=e.assignedSlot||e.parentNode||kn(e)&&e.host||vn(e);return kn(t)?t.host:t}function Nn(e){const t=An(e);return Dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:wn(t)&&Cn(t)?t:Nn(t)}function On(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Nn(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=bn(o);return a?t.concat(i,i.visualViewport||[],Cn(o)?o:[],i.frameElement&&n?On(i.frameElement):[]):t.concat(o,On(o,[],n))}function Pn(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 Rn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&kn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Wn(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Bn(){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 Gn(e){return!Bn().includes("jsdom/")&&(!Vn()&&0===e.width&&0===e.height||Vn()&&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 Vn(){const e=/android/i;return e.test(Wn())||e.test(Bn())}function Fn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Hn(e){return(null==e?void 0:e.ownerDocument)||document}function _n(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 Xn(e){return"composedPath"in e?e.composedPath()[0]:e.target}const zn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";const Yn=Math.min,$n=Math.max,jn=Math.round,Zn=Math.floor,Jn=e=>({x:e,y:e}),Un={left:"right",right:"left",bottom:"top",top:"bottom"},Qn={start:"end",end:"start"};function Kn(e,t,n){return $n(e,Yn(t,n))}function qn(e,t){return"function"==typeof e?e(t):e}function er(e){return e.split("-")[0]}function tr(e){return e.split("-")[1]}function nr(e){return"x"===e?"y":"x"}function rr(e){return"y"===e?"height":"width"}function or(e){return["top","bottom"].includes(er(e))?"y":"x"}function ar(e){return nr(or(e))}function ir(e){return e.replace(/start|end/g,(e=>Qn[e]))}function sr(e){return e.replace(/left|right|bottom|top/g,(e=>Un[e]))}function lr(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 cr(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ur(e,t,n){let{reference:r,floating:o}=e;const a=or(t),i=ar(t),s=rr(i),l=er(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(tr(t)){case"start":h[i]-=p*(n&&c?-1:1);break;case"end":h[i]+=p*(n&&c?-1:1)}return h}async function dr(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=qn(t,e),f=lr(h),m=s[p?"floating"===d?"reference":"floating":d],g=cr(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),b="floating"===d?{...i.floating,x:r,y:o}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),y=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},x=cr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:l}):b);return{top:(g.top-x.top+f.top)/y.y,bottom:(x.bottom-g.bottom+f.bottom)/y.y,left:(g.left-x.left+f.left)/y.x,right:(x.right-g.right+f.right)/y.x}}const pr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=er(n),s=tr(n),l="y"===or(n),c=["left","top"].includes(i)?-1:1,u=a&&l?-1:1,d=qn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}};function hr(e){const t=Mn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=wn(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=jn(n)!==a||jn(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function fr(e){return xn(e)?e:e.contextElement}function mr(e){const t=fr(e);if(!wn(t))return Jn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=hr(t);let i=(a?jn(n.width):n.width)/r,s=(a?jn(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const gr=Jn(0);function br(e){const t=bn(e);return Tn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:gr}function vr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=fr(e);let i=Jn(1);t&&(r?xn(r)&&(i=mr(r)):i=mr(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==bn(e))&&t}(a,n,r)?br(a):Jn(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=bn(a),t=r&&xn(r)?bn(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=mr(n),t=n.getBoundingClientRect(),r=Mn(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=a,n=bn(n).frameElement}}return cr({width:u,height:d,x:l,y:c})}const yr=[":popover-open",":modal"];function xr(e){let t=!1,n=0,r=0;if(yr.forEach((n=>{!function(n){try{t=t||e.matches(n)}catch(e){}}(n)})),t){const t=Sn(e);if(t){const e=t.getBoundingClientRect();n=e.x,r=e.y}}return[t,n,r]}function wr(e){return vr(vn(e)).left+Ln(e).scrollLeft}function kr(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=bn(e),r=vn(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=Tn();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=vn(e),n=Ln(e),r=e.ownerDocument.body,o=$n(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$n(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+wr(e);const s=-n.scrollTop;return"rtl"===Mn(r).direction&&(i+=$n(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(vn(e));else if(xn(t))r=function(e,t){const n=vr(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=wn(e)?mr(e):Jn(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=br(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return cr(r)}function Cr(e,t){const n=An(e);return!(n===t||!xn(n)||Dn(n))&&("fixed"===Mn(n).position||Cr(n,t))}function Ir(e,t,n,r){const o=wn(t),a=vn(t),i="fixed"===n,s=vr(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Jn(0);if(o||!o&&!i)if(("body"!==gn(t)||Cn(a))&&(l=Ln(t)),o){const e=vr(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&(c.x=wr(a));let u=s.left+l.scrollLeft-c.x,d=s.top+l.scrollTop-c.y;const[p,h,f]=xr(r);return p&&(u+=h,d+=f,o&&(u+=t.clientLeft,d+=t.clientTop)),{x:u,y:d,width:s.width,height:s.height}}function Er(e,t){return wn(e)&&"fixed"!==Mn(e).position?t?t(e):e.offsetParent:null}function Sr(e,t){const n=bn(e);if(!wn(e))return n;let r=Er(e,t);for(;r&&In(r)&&"static"===Mn(r).position;)r=Er(r,t);return r&&("html"===gn(r)||"body"===gn(r)&&"static"===Mn(r).position&&!En(r))?n:r||Sn(e)||n}const Tr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=vn(r),[i]=t?xr(t.floating):[!1];if(r===a||i)return n;let s={scrollLeft:0,scrollTop:0},l=Jn(1);const c=Jn(0),u=wn(r);if((u||!u&&"fixed"!==o)&&(("body"!==gn(r)||Cn(a))&&(s=Ln(r)),wn(r))){const e=vr(r);l=mr(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+c.x,y:n.y*l.y-s.scrollTop*l.y+c.y}},getDocumentElement:vn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=On(e,[],!1).filter((e=>xn(e)&&"body"!==gn(e))),o=null;const a="fixed"===Mn(e).position;let i=a?An(e):e;for(;xn(i)&&!Dn(i);){const t=Mn(i),n=En(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Cn(i)&&!n&&Cr(e,i))?r=r.filter((e=>e!==i)):o=t,i=An(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=a[0],s=a.reduce(((e,n)=>{const r=kr(t,n,o);return e.top=$n(r.top,e.top),e.right=Yn(r.right,e.right),e.bottom=Yn(r.bottom,e.bottom),e.left=$n(r.left,e.left),e}),kr(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Sr,getElementRects:async function(e){const t=this.getOffsetParent||Sr,n=this.getDimensions;return{reference:Ir(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=hr(e);return{width:t,height:n}},getScale:mr,isElement:xn,isRTL:function(e){return"rtl"===Mn(e).direction}};function Dr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=fr(e),u=o||a?[...c?On(c):[],...On(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=vn(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const h={rootMargin:-Zn(u)+"px "+-Zn(o.clientWidth-(c+d))+"px "+-Zn(o.clientHeight-(u+p))+"px "+-Zn(c)+"px",threshold:$n(0,Yn(1,l))||1};let f=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return i();t?i(!1,t):n=setTimeout((()=>{i(!1,1e-7)}),100)}f=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),a}(c,n):null;let p,h=-1,f=null;i&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let m=l?vr(e):null;return l&&function t(){const r=vr(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Mr=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qn(e,t),c={x:n,y:r},u=await dr(t,l),d=or(er(o)),p=nr(d);let h=c[p],f=c[d];if(a){const e="y"===p?"bottom":"right";h=Kn(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=Kn(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Lr=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=qn(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const b=er(o),v=er(s)===s,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(v||!m?[sr(s)]:function(e){const t=sr(e);return[ir(e),t,ir(t)]}(s));p||"none"===f||x.push(...function(e,t,n,r){const o=tr(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}(er(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(ir)))),a}(s,m,f,y));const w=[s,...x],k=await dr(t,g),C=[];let I=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&C.push(k[b]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=tr(e),o=ar(e),a=rr(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=sr(i)),[i,sr(i)]}(o,i,y);C.push(k[e[0]],k[e[1]])}if(I=[...I,{placement:o,overflows:C}],!C.every((e=>e<=0))){var E,S;const e=((null==(E=a.flip)?void 0:E.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(S=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!n)switch(h){case"bestFit":{var T;const e=null==(T=I.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:T[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Ar=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=qn(e,t)||{};if(null==c)return{};const d=lr(u),p={x:n,y:r},h=ar(o),f=rr(h),m=await i.getDimensions(c),g="y"===h,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=a.reference[f]+a.reference[h]-p[h]-a.floating[f],w=p[h]-a.reference[h],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let C=k?k[y]:0;C&&await(null==i.isElement?void 0:i.isElement(k))||(C=s.floating[y]||a.floating[f]);const I=x/2-w/2,E=C/2-m[f]/2-1,S=Yn(d[b],E),T=Yn(d[v],E),D=S,M=C-m[f]-T,L=C/2-m[f]/2+I,A=Kn(D,L,M),N=!l.arrow&&null!=tr(o)&&L!==A&&a.reference[f]/2-(L<D?S:T)-m[f]/2<0,O=N?L<D?L-D:L-M:0;return{[h]:p[h]+O,data:{[h]:A,centerOffset:L-A-O,...N&&{alignmentOffset:O}},reset:N}}}),Nr=(e,t,n)=>{const r=new Map,o={platform:Tr,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ur(c,r,l),p=r,h={},f=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:b,data:v,reset:y}=await m({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=b?b:d,h={...h,[a]:{...h[a],...v}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=ur(c,p,l))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})},Or=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?Ar({element:n.current,padding:r}).fn(t):{}:n?Ar({element:n,padding:r}).fn(t):{};var o}});var Pr="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function Rr(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(!Rr(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)&&!Rr(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Wr(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Br(e,t){const n=Wr(e);return Math.round(t*n)/n}function Gr(e){const t=o.useRef(e);return Pr((()=>{t.current=e})),t}const Vr=o["useInsertionEffect".toString()]||(e=>e());function Fr(e){const t=o.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Vr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}var Hr="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_r.apply(this,arguments)}let Xr=!1,zr=0;const Yr=()=>"floating-ui-"+zr++;const $r=o["useId".toString()]||function(){const[e,t]=o.useState((()=>Xr?Yr():void 0));return Hr((()=>{null==e&&t(Yr())}),[]),o.useEffect((()=>{Xr||(Xr=!0)}),[]),e},jr=o.forwardRef((function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:a}},width:i=14,height:s=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:p,style:{transform:h,...f}={},...m}=e;"production"!==process.env.NODE_ENV&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const g=$r();if(!r)return null;c*=2;const b=c/2,v=i/2*(l/-8+1),y=s/2*l/4,[x,w]=n.split("-"),k=Tr.isRTL(r),C=!!p,I="top"===x||"bottom"===x,E=u&&"end"===w?"bottom":"top";let S=u&&"end"===w?"right":"left";u&&k&&(S="end"===w?"left":"right");const T=null!=(null==a?void 0:a.x)?u||a.x:"",D=null!=(null==a?void 0:a.y)?u||a.y:"",M=p||"M0,0 H"+i+" L"+(i-v)+","+(s-y)+" Q"+i/2+","+s+" "+v+","+(s-y)+" Z",L={top:C?"rotate(180deg)":"",left:C?"rotate(90deg)":"rotate(-90deg)",bottom:C?"":"rotate(180deg)",right:C?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",_r({},m,{"aria-hidden":!0,ref:t,width:C?i:i+c,height:i,viewBox:"0 0 "+i+" "+(s>i?s:i),style:{position:"absolute",pointerEvents:"none",[S]:T,[E]:D,[x]:I||C?"100%":"calc(100% - "+c/2+"px)",transform:""+L+(null!=h?h:""),...f}}),c>0&&o.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:c+(p?0:1),d:M}),o.createElement("path",{stroke:c&&!p?m.fill:"none",d:M}),o.createElement("clipPath",{id:g},o.createElement("rect",{x:-b,y:b*(C?-1:1),width:i+c,height:i})))}));const Zr=o.createContext(null),Jr=o.createContext(null),Ur=()=>{var e;return(null==(e=o.useContext(Zr))?void 0:e.id)||null},Qr=()=>o.useContext(Jr);function Kr(e){return"data-floating-ui-"+e}function qr(t){const n=e.useRef(t);return Hr((()=>{n.current=t})),n}const eo=Kr("safe-polygon");function to(e,t,n){return n&&!Fn(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function no(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 ro={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},oo={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ao=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}};let io;function so(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if("production"!==process.env.NODE_ENV){var s;const t="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";var l,c;if(null!=(s=e.elements)&&s.reference&&!xn(e.elements.reference))if(null==(l=io)||!l.has(t))null==(c=io)||c.add(t),console.error(t)}const[u,d]=o.useState(null),p=(null==(t=e.elements)?void 0:t.reference)||u,h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,h]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=o.useState(r);Rr(f,r)||m(r);const[g,b]=o.useState(null),[v,y]=o.useState(null),x=o.useCallback((e=>{e!==I.current&&(I.current=e,b(e))}),[]),w=o.useCallback((e=>{e!==E.current&&(E.current=e,y(e))}),[]),k=s||g,C=l||v,I=o.useRef(null),E=o.useRef(null),S=o.useRef(p),T=null!=u,D=Gr(u),M=Gr(i),L=o.useCallback((()=>{if(!I.current||!E.current)return;const e={placement:t,strategy:n,middleware:f};M.current&&(e.platform=M.current),Nr(I.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};A.current&&!Rr(S.current,t)&&(S.current=t,a.flushSync((()=>{h(t)})))}))}),[f,t,n,M]);Pr((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[d]);const A=o.useRef(!1);Pr((()=>(A.current=!0,()=>{A.current=!1})),[]),Pr((()=>{if(k&&(I.current=k),C&&(E.current=C),k&&C){if(D.current)return D.current(k,C,L);L()}}),[k,C,L,D,T]);const N=o.useMemo((()=>({reference:I,floating:E,setReference:x,setFloating:w})),[x,w]),O=o.useMemo((()=>({reference:k,floating:C})),[k,C]),P=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=Br(O.floating,p.x),r=Br(O.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Wr(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,O.floating,p.x,p.y]);return o.useMemo((()=>({...p,update:L,refs:N,elements:O,floatingStyles:P})),[p,L,N,O,P])}(e),f=Qr(),m=null!=Ur(),g=Fr(((e,t,n)=>{e&&(v.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:m}),null==r||r(e,t,n)})),b=o.useRef(null),v=o.useRef({}),y=o.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)))||[])}}}()))[0],x=$r(),w=o.useCallback((e=>{const t=xn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;h.refs.setReference(t)}),[h.refs]),k=o.useCallback((e=>{(xn(e)||null===e)&&(b.current=e,d(e)),(xn(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!xn(e))&&h.refs.setReference(e)}),[h.refs]),C=o.useMemo((()=>({...h.refs,setReference:k,setPositionReference:w,domReference:b})),[h.refs,k,w]),I=o.useMemo((()=>({...h.elements,domReference:p})),[h.elements,p]),E=o.useMemo((()=>({...h,refs:C,elements:I,dataRef:v,nodeId:i,floatingId:x,events:y,open:n,onOpenChange:g})),[h,i,x,y,n,g,C,I]);return Hr((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...h,context:E,refs:C,elements:I})),[h,C,I,E])}function lo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:a,refs:i,elements:{domReference:s}}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),p=o.useRef(!0);return o.useEffect((()=>{if(!l)return;const e=bn(s);function t(){!n&&wn(s)&&s===Pn(Hn(s))&&(u.current=!0)}function r(){p.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[s,n,l]),o.useEffect((()=>{if(l)return a.on("openchange",e),()=>{a.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[a,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]),o.useMemo((()=>l?{reference:{onPointerDown(e){Gn(e.nativeEvent)||(p.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=Xn(e.nativeEvent);if(c&&xn(t))try{if(/apple/i.test(navigator.vendor)&&Wn().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&(!wn(n=t)||!n.matches(zn)))return}var n;r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=xn(t)&&t.hasAttribute(Kr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{const o=Pn(s?s.ownerDocument:document);(t||o!==s)&&(Rn(i.floating.current,o)||Rn(s,o)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,c,s,i,r])}"production"!==process.env.NODE_ENV&&(io=new Set);const co="active",uo="selected";function po(e,t,n){const r=new Map,o="item"===n;let a=e;if(o&&e){const{[co]:t,[uo]:n,...r}=e;a=r}return{..."floating"===n&&{tabIndex:-1},...a,...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,a]=t;var i;o&&[co,uo].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(i=r.get(n))||i.push(a),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=a)})),e):e),{})}}const ho=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function mo(e,t){return"function"==typeof e?e(t):e}function go(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:a=250}=t,i=("number"==typeof a?a:a.close)||0,[s,l]=o.useState(!1),[c,u]=o.useState("unmounted"),d=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return Hr((()=>{s&&!d&&u("unmounted")}),[s,d]),Hr((()=>{if(r){if(n){u("initial");const e=requestAnimationFrame((()=>{u("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),u("close")}}),[n,r]),{isMounted:d,status:c}}const bo=t(jr)`
956
956
  fill: ${({chooseColor:e,theme:t})=>e(t.colors.surface.risen)};
957
957
  `,vo=t.css`
958
958
  ${({theme:e})=>e.spacing.sm}