@mmb-digital/design-system-web 0.1.217 → 0.1.218

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
@@ -2,7 +2,7 @@
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var ur=["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(","),cr="undefined"==typeof Element,dr=cr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,pr=!cr&&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},hr=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)},fr=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!hr(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{dr.call(a,ur)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var u=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),c=!hr(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(u&&c){var d=e(!0===u?a.children:u.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},mr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},gr=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))&&!mr(e)?0:e.tabIndex},vr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},yr=function(e){return"INPUT"===e.tagName},br=function(e){return function(e){return yr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||pr(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)},xr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},kr=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=dr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(dr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return xr(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=pr(e);if(a&&!a.shadowRoot&&!0===r(a))return xr(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&pr(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var l,u,c;s=!(null===(u=a=null===(l=i=pr(a))||void 0===l?void 0:l.host)||void 0===u||null===(c=u.ownerDocument)||void 0===c||!c.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},wr=function(e,t){return!(t.disabled||hr(t)||function(e){return yr(e)&&"hidden"===e.type}(t)||kr(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!!dr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Cr=function(e,t){return!(br(t)||gr(t)<0||!wr(e,t))},Er=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Sr=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=gr(e);return n<0&&t&&!mr(e)?0:n}(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:l})})),r.sort(vr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},_r=function(e,t){var n;return n=(t=t||{}).getShadowRoot?fr([e],t.includeContainer,{filter:Cr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Er}):function(e,t,n){if(hr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ur));return t&&dr.call(e,ur)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Cr.bind(null,t)),Sr(n)};function Ir(e,t,n){let{reference:r,floating:o}=e;const i=rr(t),a=or(t),s=nr(a),l=Jn(t),u="y"===i,c=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:c,y:r.y-o.height};break;case"bottom":h={x:c,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(er(t)){case"start":h[a]-=p*(n&&u?-1:1);break;case"end":h[a]+=p*(n&&u?-1:1)}return h}async function Mr(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Xn(t,e),f=sr(h),m=s[p?"floating"===d?"reference":"floating":d],g=lr(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=lr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+f.top)/b.y,bottom:(x.bottom-g.bottom+f.bottom)/b.y,left:(g.left-x.left+f.left)/b.x,right:(x.right-g.right+f.right)/b.x}}function Lr(e){const t=Sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vn(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Kn(n)!==i||Kn(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Tr(e){return gn(e)?e:e.contextElement}function Dr(e){const t=Tr(e);if(!vn(t))return qn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Lr(t);let a=(i?Kn(n.width):n.width)/r,s=(i?Kn(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Pr=qn(0);function Or(e){const t=hn(e);return Cn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Pr}function Rr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Tr(e);let a=qn(1);t&&(r?gn(r)&&(a=Dr(r)):a=Dr(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==hn(e))&&t}(i,n,r)?Or(i):qn(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=hn(i),t=r&&gn(r)?hn(r):r;let n=e,o=Tn(n);for(;o&&r&&t!==n;){const e=Dr(o),t=o.getBoundingClientRect(),r=Sn(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=hn(o),o=Tn(n)}}return lr({width:c,height:d,x:l,y:u})}function Ar(e,t){const n=_n(e).scrollLeft;return t?t.left+n:Rr(fn(e)).left+n}function Nr(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ar(e,r)),y:r.top+t.scrollTop}}function Vr(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=hn(e),r=fn(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Cn();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=fn(e),n=_n(e),r=e.ownerDocument.body,o=Yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Ar(e);const s=-n.scrollTop;return"rtl"===Sn(r).direction&&(a+=Yn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(fn(e));else if(gn(t))r=function(e,t){const n=Rr(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=vn(e)?Dr(e):qn(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=Or(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lr(r)}function Br(e,t){const n=In(e);return!(n===t||!gn(n)||En(n))&&("fixed"===Sn(n).position||Br(n,t))}function Fr(e,t,n){const r=vn(t),o=fn(t),i="fixed"===n,a=Rr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=qn(0);if(r||!r&&!i)if(("body"!==pn(t)||bn(o))&&(s=_n(t)),r){const e=Rr(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Ar(o));const u=!o||r||i?qn(0):Nr(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function jr(e){return"static"===Sn(e).position}function $r(e,t){if(!vn(e)||"fixed"===Sn(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fn(e)===n&&(n=n.ownerDocument.body),n}function Wr(e,t){const n=hn(e);if(kn(e))return n;if(!vn(e)){let t=In(e);for(;t&&!En(t);){if(gn(t)&&!jr(t))return t;t=In(t)}return n}let r=$r(e,t);for(;r&&xn(r)&&jr(r);)r=$r(r,t);return r&&En(r)&&jr(r)&&!wn(r)?n:r||function(e){let t=In(e);for(;vn(t)&&!En(t);){if(wn(t))return t;if(kn(t))return null;t=In(t)}return null}(e)||n}const Hr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=fn(r),s=!!t&&kn(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=qn(1);const c=qn(0),d=vn(r);if((d||!d&&!i)&&(("body"!==pn(r)||bn(a))&&(l=_n(r)),vn(r))){const e=Rr(r);u=Dr(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const p=!a||d||i?qn(0):Nr(a,l,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}},getDocumentElement:fn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?kn(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ln(e,[],!1).filter((e=>gn(e)&&"body"!==pn(e))),o=null;const i="fixed"===Sn(e).position;let a=i?In(e):e;for(;gn(a)&&!En(a);){const t=Sn(a),n=wn(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||bn(a)&&!n&&Br(e,a))?r=r.filter((e=>e!==a)):o=t,a=In(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Vr(t,n,o);return e.top=Yn(r.top,e.top),e.right=zn(r.right,e.right),e.bottom=zn(r.bottom,e.bottom),e.left=Yn(r.left,e.left),e}),Vr(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Wr,getElementRects:async function(e){const t=this.getOffsetParent||Wr,n=this.getDimensions,r=await n(e.floating);return{reference:Fr(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}=Lr(e);return{width:t,height:n}},getScale:Dr,isElement:gn,isRTL:function(e){return"rtl"===Sn(e).direction}};function zr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=Tr(e),c=o||i?[...u?Ln(u):[],...Ln(t)]:[];c.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=u&&s?function(e,t){let n,r=null;const o=fn(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:u,top:c,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const h={rootMargin:-Un(c)+"px "+-Un(o.clientWidth-(u+d))+"px "+-Un(o.clientHeight-(c+p))+"px "+-Un(u)+"px",threshold:Yn(0,zn(1,l))||1};let f=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}f=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(u,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),u&&!l&&f.observe(u),f.observe(t));let m=l?Rr(e):null;return l&&function t(){const r=Rr(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;c.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Yr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Jn(n),s=er(n),l="y"===rr(n),u=["left","top"].includes(a)?-1:1,c=i&&l?-1:1,d=Xn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*c,y:p*u}:{x:p*u,y:h*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Kr=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:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Xn(e,t),u={x:n,y:r},c=await Mr(t,l),d=rr(Jn(o)),p=tr(d);let h=u[p],f=u[d];if(i){const e="y"===p?"bottom":"right";h=Qn(h+c["y"===p?"top":"left"],h,h-c[e])}if(a){const e="y"===d?"bottom":"right";f=Qn(f+c["y"===d?"top":"left"],f,f-c[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},Ur=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Xn(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Jn(o),y=rr(s),b=Jn(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(u.floating)),k=p||(b||!m?[ar(s)]:function(e){const t=ar(e);return[ir(e),t,ir(t)]}(s)),w="none"!==f;!p&&w&&k.push(...function(e,t,n,r){const o=er(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(Jn(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ir)))),i}(s,m,f,x));const C=[s,...k],E=await Mr(t,g),S=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&S.push(E[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=er(e),o=or(e),i=nr(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ar(a)),[a,ar(a)]}(o,a,x);S.push(E[e[0]],E[e[1]])}if(_=[..._,{placement:o,overflows:S}],!S.every((e=>e<=0))){var I,M;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(M=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:M.placement;if(!n)switch(h){case"bestFit":{var L;const e=null==(L=_.filter((e=>{if(w){const t=rr(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:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},qr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=Xn(e,t)||{};if(null==u)return{};const d=sr(c),p={x:n,y:r},h=or(o),f=nr(h),m=await a.getDimensions(u),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let C=w?w[b]:0;C&&await(null==a.isElement?void 0:a.isElement(w))||(C=s.floating[b]||i.floating[f]);const E=x/2-k/2,S=C/2-m[f]/2-1,_=zn(d[v],S),I=zn(d[y],S),M=_,L=C-m[f]-I,T=C/2-m[f]/2+E,D=Qn(M,T,L),P=!l.arrow&&null!=er(o)&&T!==D&&i.reference[f]/2-(T<M?_:I)-m[f]/2<0,O=P?T<M?T-M:T-L:0;return{[h]:p[h]+O,data:{[h]:D,centerOffset:T-D-O,...P&&{alignmentOffset:O}},reset:P}}}),Zr=(e,t,n)=>{const r=new Map,o={platform:Hr,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Ir(u,r,l),p=r,h={},f=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:v,data:y,reset:b}=await m({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:a,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=v?v:d,h={...h,[i]:{...h[i],...y}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:d}=Ir(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var Gr="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function Qr(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(!Qr(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)&&!Qr(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Xr(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jr(e,t){const n=Xr(e);return Math.round(t*n)/n}function eo(e){const t=h.useRef(e);return Gr((()=>{t.current=e})),t}const to=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?qr({element:n.current,padding:r}).fn(t):{}:n?qr({element:n,padding:r}).fn(t):{};var o}}),no=(e,t)=>({...Yr(e),options:[e,t]}),ro=(e,t)=>({...Kr(e),options:[e,t]}),oo=(e,t)=>({...Ur(e),options:[e,t]}),io=(e,t)=>({...to(e),options:[e,t]});function ao(e){return h.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const so={...h},lo=so.useInsertionEffect||(e=>e());function uo(e){const t=h.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return lo((()=>{t.current=e})),h.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 co="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;let po=!1,ho=0;const fo=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ho++;const mo=so.useId||function(){const[e,t]=h.useState((()=>po?fo():void 0));return co((()=>{null==e&&t(fo())}),[]),h.useEffect((()=>{po=!0}),[]),e};let go;"production"!==process.env.NODE_ENV&&(go=new Set);const vo=h.forwardRef((function(e,t){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:a}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:d,stroke:p,d:f,style:{transform:m,...g}={},...v}=e;"production"!==process.env.NODE_ENV&&(t||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=go)&&e.has(o)||(null==(i=go)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const y=mo(),[b,x]=h.useState(!1);if(co((()=>{if(!o)return;"rtl"===Sn(o).direction&&x(!0)}),[o]),!o)return null;const[k,w]=r.split("-"),C="top"===k||"bottom"===k;let E=d;(C&&null!=a&&a.x||!C&&null!=a&&a.y)&&(E=null);const S=2*c,_=S/2,I=s/2*(u/-8+1),M=l/2*u/4,L=!!f,T=E&&"end"===w?"bottom":"top";let D=E&&"end"===w?"right":"left";E&&b&&(D="end"===w?"left":"right");const P=null!=(null==i?void 0:i.x)?E||i.x:"",O=null!=(null==i?void 0:i.y)?E||i.y:"",R=f||"M0,0 H"+s+" L"+(s-I)+","+(l-M)+" Q"+s/2+","+l+" "+I+","+(l-M)+" Z",A={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[k];return n.jsxs("svg",{...v,"aria-hidden":!0,ref:t,width:L?s:s+S,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[D]:P,[T]:O,[k]:C||L?"100%":"calc(100% - "+S/2+"px)",transform:[A,m].filter((e=>!!e)).join(" "),...g},children:[S>0&&n.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:p,strokeWidth:S+(f?0:1),d:R}),n.jsx("path",{stroke:S&&!f?v.fill:"none",d:R}),n.jsx("clipPath",{id:y,children:n.jsx("rect",{x:-_,y:_*(L?-1:1),width:s+S,height:s})})]})}));const yo=h.createContext(null),bo=h.createContext(null),xo=()=>{var e;return(null==(e=h.useContext(yo))?void 0:e.id)||null},ko=()=>h.useContext(bo);function wo(e){return"data-floating-ui-"+e}function Co(t){const n=e.useRef(t);return co((()=>{n.current=t})),n}const Eo=wo("safe-polygon");function So(e,t,n){return n&&!Bn(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function _o(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 Io=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Mo(e,t){const n=_r(e,Io());"prev"===t&&n.reverse();const r=n.indexOf(Dn(Fn(e)));return n.slice(r+1)[0]}function Lo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Pn(n,r)}function To(e){_r(e,Io()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Do(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 Po={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 Oo(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Ro=h.forwardRef((function(e,t){const[r,o]=h.useState();co((()=>(Nn()&&o("button"),document.addEventListener("keydown",Oo),()=>{document.removeEventListener("keydown",Oo)})),[]);const i={ref:t,tabIndex:0,role:r,"aria-hidden":!r||void 0,[wo("focus-guard")]:"",style:Po};return n.jsx("span",{...e,...i})})),Ao=h.createContext(null),No=wo("portal");function Vo(e){const{children:t,id:r,root:o,preserveTabOrder:i=!0}=e,a=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=mo(),o=Bo(),[i,a]=h.useState(null),s=h.useRef(null);return co((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{s.current=null}))}),[i]),co((()=>{if(!r)return;if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(No,""),e.appendChild(n),s.current=n,a(n)}),[t,r]),co((()=>{if(null===n)return;if(!r)return;if(s.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!gn(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(No,""),e=i||e,e.appendChild(l),s.current=l,a(l)}),[t,n,r,o]),i}({id:r,root:o}),[s,l]=h.useState(null),u=h.useRef(null),c=h.useRef(null),d=h.useRef(null),p=h.useRef(null),m=null==s?void 0:s.modal,g=null==s?void 0:s.open,v=!!s&&!s.modal&&s.open&&i&&!(!o&&!a);return h.useEffect((()=>{if(a&&i&&!m)return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Lo(e)){("focusin"===e.type?Do:To)(a)}}}),[a,i,m]),h.useEffect((()=>{a&&(g||Do(a))}),[g,a]),n.jsxs(Ao.Provider,{value:h.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:p,portalNode:a,setFocusManagerState:l})),[i,a]),children:[v&&a&&n.jsx(Ro,{"data-type":"outside",ref:u,onFocus:e=>{if(Lo(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=Mo(document.body,"prev")||(null==s?void 0:s.domReference);null==e||e.focus()}}}),v&&a&&n.jsx("span",{"aria-owns":a.id,style:Po}),a&&f.createPortal(t,a),v&&a&&n.jsx(Ro,{"data-type":"outside",ref:c,onFocus:e=>{if(Lo(e,a)){var t;null==(t=p.current)||t.focus()}else{const t=Mo(document.body,"next")||(null==s?void 0:s.domReference);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Bo=()=>h.useContext(Ao),Fo="data-floating-ui-focusable";function jo(e){return vn(e.target)&&"BUTTON"===e.target.tagName}function $o(e){return Hn(e)}const Wo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ho={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},zo=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 Yo(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=mo(),i=h.useRef({}),[a]=h.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)))||[])}}}())),s=null!=xo();if("production"!==process.env.NODE_ENV){const e=r.reference;e&&!gn(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=go)&&e.has(o)||(null==(i=go)||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[l,u]=h.useState(r.reference),c=uo(((e,t,r)=>{i.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)})),d=h.useMemo((()=>({setPositionReference:u})),[]),p=h.useMemo((()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference})),[l,r.reference,r.floating]);return h.useMemo((()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:a,floatingId:o,refs:d})),[t,c,p,a,o,d])}function Ko(e){void 0===e&&(e={});const{nodeId:t}=e,n=Yo({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=h.useState(null),[s,l]=h.useState(null),u=(null==o?void 0:o.domReference)||i,c=h.useRef(null),d=ko();co((()=>{u&&(c.current=u)}),[u]);const p=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=h.useState(r);Qr(p,r)||m(r);const[g,v]=h.useState(null),[y,b]=h.useState(null),x=h.useCallback((e=>{e!==E.current&&(E.current=e,v(e))}),[]),k=h.useCallback((e=>{e!==S.current&&(S.current=e,b(e))}),[]),w=i||g,C=a||y,E=h.useRef(null),S=h.useRef(null),_=h.useRef(c),I=null!=l,M=eo(l),L=eo(o),T=eo(u),D=h.useCallback((()=>{if(!E.current||!S.current)return;const e={placement:t,strategy:n,middleware:p};L.current&&(e.platform=L.current),Zr(E.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};P.current&&!Qr(_.current,t)&&(_.current=t,f.flushSync((()=>{d(t)})))}))}),[p,t,n,L,T]);Gr((()=>{!1===u&&_.current.isPositioned&&(_.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[u]);const P=h.useRef(!1);Gr((()=>(P.current=!0,()=>{P.current=!1})),[]),Gr((()=>{if(w&&(E.current=w),C&&(S.current=C),w&&C){if(M.current)return M.current(w,C,D);D()}}),[w,C,D,M,I]);const O=h.useMemo((()=>({reference:E,floating:S,setReference:x,setFloating:k})),[x,k]),R=h.useMemo((()=>({reference:w,floating:C})),[w,C]),A=h.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Jr(R.floating,c.x),r=Jr(R.floating,c.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Xr(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,R.floating,c.x,c.y]);return h.useMemo((()=>({...c,update:D,refs:O,elements:R,floatingStyles:A})),[c,D,O,R,A])}({...e,elements:{...o,...s&&{reference:s}}}),m=h.useCallback((e=>{const t=gn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),p.refs.setReference(t)}),[p.refs]),g=h.useCallback((e=>{(gn(e)||null===e)&&(c.current=e,a(e)),(gn(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!gn(e))&&p.refs.setReference(e)}),[p.refs]),v=h.useMemo((()=>({...p.refs,setReference:g,setPositionReference:m,domReference:c})),[p.refs,g,m]),y=h.useMemo((()=>({...p.elements,domReference:u})),[p.elements,u]),b=h.useMemo((()=>({...p,...r,refs:v,elements:y,nodeId:t})),[p,v,y,t,r]);return co((()=>{r.dataRef.current.floatingContext=b;const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===t));e&&(e.context=b)})),h.useMemo((()=>({...p,context:b,refs:v,elements:y})),[p,v,y,b])}function Uo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:a}=e,{enabled:s=!0,visibleOnly:l=!0}=t,u=h.useRef(!1),c=h.useRef(),d=h.useRef(!0);h.useEffect((()=>{if(!s)return;const e=hn(a.domReference);function t(){!n&&vn(a.domReference)&&a.domReference===Dn(Fn(a.domReference))&&(u.current=!0)}function r(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,s]),h.useEffect((()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[o,s]),h.useEffect((()=>()=>{clearTimeout(c.current)}),[]);const p=h.useMemo((()=>({onPointerDown(e){An(e.nativeEvent)||(d.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=$n(e.nativeEvent);if(l&&gn(t))try{if(Nn()&&On().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!Hn(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=gn(t)&&t.hasAttribute(wo("focus-guard"))&&"outside"===t.getAttribute("data-type");c.current=window.setTimeout((()=>{var e;const s=Dn(a.domReference?a.domReference.ownerDocument:document);(t||s!==a.domReference)&&(Pn(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,s)||Pn(a.domReference,s)||o||r(!1,n,"focus"))}))}})),[i,a.domReference,r,l]);return h.useMemo((()=>s?{reference:p}:{}),[s,p])}const qo="active",Zo="selected";function Go(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[qo]:t,[Zo]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Fo]:""},...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 a;o&&[qo,Zo].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(a=r.get(n))||a.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 Qo=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Xo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Jo(e,t){return"function"==typeof e?e(t):e}function ei(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[a,s]=h.useState("unmounted"),l=function(e,t){const[n,r]=h.useState(e);return e&&!n&&r(!0),h.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return l||"close"!==a||s("unmounted"),co((()=>{if(r){if(n){s("initial");const e=requestAnimationFrame((()=>{s("open")}));return()=>{cancelAnimationFrame(e)}}s("close")}}),[n,r]),{isMounted:l,status:a}}function ti(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,a=i-1;e<i;a=e++){const[i,s]=t[e]||[0,0],[l,u]=t[a]||[0,0];s>=r!=u>=r&&n<=(l-i)*(r-s)/(u-s)+i&&(o=!o)}return o}function ni(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,a=null,s=null,l=performance.now();const u=e=>{let{x:n,y:u,placement:c,elements:d,onClose:p,nodeId:h,tree:f}=e;return function(e){function m(){clearTimeout(o),p()}if(clearTimeout(o),!d.domReference||!d.floating||null==c||null==n||null==u)return;const{clientX:g,clientY:v}=e,y=[g,v],b=$n(e),x="mouseleave"===e.type,k=Pn(d.floating,b),w=Pn(d.domReference,b),C=d.domReference.getBoundingClientRect(),E=d.floating.getBoundingClientRect(),S=c.split("-")[0],_=n>E.right-E.width/2,I=u>E.bottom-E.height/2,M=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,C),L=E.width>C.width,T=E.height>C.height,D=(L?C:E).left,P=(L?C:E).right,O=(T?C:E).top,R=(T?C:E).bottom;if(k&&(i=!0,!x))return;if(w&&(i=!1),w&&!x)return void(i=!0);if(x&&gn(e.relatedTarget)&&Pn(d.floating,e.relatedTarget))return;if(f&&_o(f.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===S&&u>=C.bottom-1||"bottom"===S&&u<=C.top+1||"left"===S&&n>=C.right-1||"right"===S&&n<=C.left+1)return m();let A=[];switch(S){case"top":A=[[D,C.top+1],[D,E.bottom-1],[P,E.bottom-1],[P,C.top+1]];break;case"bottom":A=[[D,E.top+1],[D,C.bottom-1],[P,C.bottom-1],[P,E.top+1]];break;case"left":A=[[E.right-1,R],[E.right-1,O],[C.left+1,O],[C.left+1,R]];break;case"right":A=[[C.right-1,R],[C.right-1,O],[E.left+1,O],[E.left+1,R]]}if(!ti([g,v],A)){if(i&&!M)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===a||null===s||0===r)return a=e,s=t,l=n,null;const o=e-a,i=t-s,u=Math.sqrt(o*o+i*i);return a=e,s=t,l=n,u/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}ti([g,v],function(e){let[n,r]=e;switch(S){case"top":return[[L?n+t/2:_?n+4*t:n-4*t,r+t+1],[L?n-t/2:_?n+4*t:n-4*t,r+t+1],...[[E.left,_||L?E.bottom-t:E.top],[E.right,_?L?E.bottom-t:E.top:E.bottom-t]]];case"bottom":return[[L?n+t/2:_?n+4*t:n-4*t,r-t],[L?n-t/2:_?n+4*t:n-4*t,r-t],...[[E.left,_||L?E.top+t:E.bottom],[E.right,_?L?E.top+t:E.bottom:E.top+t]]];case"left":{const e=[n+t+1,T?r+t/2:I?r+4*t:r-4*t],o=[n+t+1,T?r-t/2:I?r+4*t:r-4*t];return[...[[I||T?E.right-t:E.left,E.top],[I?T?E.right-t:E.left:E.right-t,E.bottom]],e,o]}case"right":return[[n-t,T?r+t/2:I?r+4*t:r-4*t],[n-t,T?r-t/2:I?r+4*t:r-4*t],...[[I||T?E.left+t:E.right,E.top],[I?T?E.left+t:E.right:E.left+t,E.bottom]]]}}([n,u]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return u.__options={blockPointerEvents:n},u}const ri=e=>!("boolean"==typeof e||null==e),oi=n=>{const{ariaDisabled:r,ariaLabel:o,buttonStyle:i,children:a,disabled:s=!1,fullWidth:l=!1,href:u,htmlRef:c,iconLeft:d,iconRight:p,iconSystemLeft:h,iconSystemRight:f,isLoading:m=!1,onClick:g,size:v=exports.ButtonSize.md,suppressHydrationWarning:y,type:b}=n,x=t.useTheme(),{chooseColor:k,colorScheme:w,mediaType:C}=$(n),E=e.useRef(null),S=ao([c,E]),_=function(t){const[n,r]=e.useState(!1);return on("mouseenter",(()=>{r(!0)}),t),on("mouseleave",(()=>{r(!1)}),t),n}(E),I=e.useMemo((()=>{switch(!0){case i===exports.ButtonStyle.primary&&s:return k(x.colors.fg.disabled);case i===exports.ButtonStyle.primary&&_:case i===exports.ButtonStyle.primary:return k(x.colors.fg.neutral.white);case i===exports.ButtonStyle.secondary&&s:return k(x.colors.fg.disabled);case i===exports.ButtonStyle.secondary&&_:return k(x.colors.fg.brand.bold);case i===exports.ButtonStyle.secondary:return k(x.colors.fg.neutral.subtle);case i===exports.ButtonStyle.tertiary&&s:return k(x.colors.fg.disabled);case i===exports.ButtonStyle.tertiary&&_:return k(x.colors.fg.brand.bold);case i===exports.ButtonStyle.tertiary:return k(x.colors.fg.neutral.subtle);default:throw new Error("unexpected combination when specifying the button icon color button.tsx")}}),[i,k,s,_,x]),M=e.useMemo((()=>{switch(v){case exports.ButtonSize.xs:return exports.TypographyVariant.textXs;case exports.ButtonSize.sm:case exports.ButtonSize.md:return exports.TypographyVariant.textSm;case exports.ButtonSize.xl:return exports.TypographyVariant.textMd;case exports.ButtonSize.xxl:return exports.TypographyVariant.textLg;default:throw new Error("unexpected enum value of ButtonSize in button.tsx")}}),[v]),L=e.useMemo((()=>{switch(v){case exports.ButtonSize.xs:return exports.IconSystemSize.small;case exports.ButtonSize.sm:case exports.ButtonSize.md:case exports.ButtonSize.xl:case exports.ButtonSize.xxl:return exports.IconSystemSize.big;default:throw new Error("unexpected enum value of ButtonSize in button.tsx")}}),[v]);return e.createElement(Rt,{$buttonStyle:i,$chooseColor:k,$fullWidth:l,$size:v,$type:b,"aria-disabled":r,"aria-label":o,as:b===exports.ButtonType.anchor?"a":void 0,disabled:s,href:u,ref:S,suppressHydrationWarning:y,type:b===exports.ButtonType.button||b===exports.ButtonType.submit||b===exports.ButtonType.reset?b:void 0,onClick:g},m&&e.createElement(Nt,null,e.createElement(ht,{colorScheme:w,size:exports.IconSystemSize.big,stroke:I,type:exports.IconSystemType.spinner})),void 0!==d&&e.createElement(At,null,d),void 0!==h&&e.createElement(ht,{colorScheme:w,size:L,stroke:I,type:h}),ri(a)&&e.createElement(Z,{color:"inherit",colorScheme:w,mediaType:C,variant:M,weight:exports.FontWeight.medium500},a),void 0!==p&&e.createElement(At,null,p),void 0!==f&&e.createElement(ht,{colorScheme:w,size:L,stroke:I,type:f}))};function ii(e){return ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ii(e)}function ai(e){var t=function(e,t){if("object"!=ii(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ii(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ii(t)?t:t+""}function si(e,t,n){return(t=ai(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function li(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?li(Object(n),!0).forEach((function(t){si(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):li(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ci(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function di(e,t){if(e){if("string"==typeof e)return ci(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ci(e,t):void 0}}function pi(e){return function(e){if(Array.isArray(e))return ci(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||di(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||di(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var fi,mi={exports:{}};
5
+ */var ur=["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(","),cr="undefined"==typeof Element,dr=cr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,pr=!cr&&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},hr=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)},fr=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!hr(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{dr.call(a,ur)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var u=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),c=!hr(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(u&&c){var d=e(!0===u?a.children:u.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},mr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},gr=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))&&!mr(e)?0:e.tabIndex},vr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},yr=function(e){return"INPUT"===e.tagName},br=function(e){return function(e){return yr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||pr(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)},xr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},kr=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=dr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(dr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return xr(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=pr(e);if(a&&!a.shadowRoot&&!0===r(a))return xr(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&pr(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var l,u,c;s=!(null===(u=a=null===(l=i=pr(a))||void 0===l?void 0:l.host)||void 0===u||null===(c=u.ownerDocument)||void 0===c||!c.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},wr=function(e,t){return!(t.disabled||hr(t)||function(e){return yr(e)&&"hidden"===e.type}(t)||kr(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!!dr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Cr=function(e,t){return!(br(t)||gr(t)<0||!wr(e,t))},Er=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Sr=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=gr(e);return n<0&&t&&!mr(e)?0:n}(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:l})})),r.sort(vr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},_r=function(e,t){var n;return n=(t=t||{}).getShadowRoot?fr([e],t.includeContainer,{filter:Cr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Er}):function(e,t,n){if(hr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ur));return t&&dr.call(e,ur)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Cr.bind(null,t)),Sr(n)};function Ir(e,t,n){let{reference:r,floating:o}=e;const i=rr(t),a=or(t),s=nr(a),l=Jn(t),u="y"===i,c=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:c,y:r.y-o.height};break;case"bottom":h={x:c,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(er(t)){case"start":h[a]-=p*(n&&u?-1:1);break;case"end":h[a]+=p*(n&&u?-1:1)}return h}async function Mr(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Xn(t,e),f=sr(h),m=s[p?"floating"===d?"reference":"floating":d],g=lr(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=lr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+f.top)/b.y,bottom:(x.bottom-g.bottom+f.bottom)/b.y,left:(g.left-x.left+f.left)/b.x,right:(x.right-g.right+f.right)/b.x}}function Lr(e){const t=Sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vn(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Kn(n)!==i||Kn(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Tr(e){return gn(e)?e:e.contextElement}function Dr(e){const t=Tr(e);if(!vn(t))return qn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Lr(t);let a=(i?Kn(n.width):n.width)/r,s=(i?Kn(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Pr=qn(0);function Or(e){const t=hn(e);return Cn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Pr}function Rr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Tr(e);let a=qn(1);t&&(r?gn(r)&&(a=Dr(r)):a=Dr(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==hn(e))&&t}(i,n,r)?Or(i):qn(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=hn(i),t=r&&gn(r)?hn(r):r;let n=e,o=Tn(n);for(;o&&r&&t!==n;){const e=Dr(o),t=o.getBoundingClientRect(),r=Sn(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=hn(o),o=Tn(n)}}return lr({width:c,height:d,x:l,y:u})}function Ar(e,t){const n=_n(e).scrollLeft;return t?t.left+n:Rr(fn(e)).left+n}function Nr(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ar(e,r)),y:r.top+t.scrollTop}}function Vr(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=hn(e),r=fn(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Cn();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=fn(e),n=_n(e),r=e.ownerDocument.body,o=Yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Ar(e);const s=-n.scrollTop;return"rtl"===Sn(r).direction&&(a+=Yn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(fn(e));else if(gn(t))r=function(e,t){const n=Rr(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=vn(e)?Dr(e):qn(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=Or(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lr(r)}function Br(e,t){const n=In(e);return!(n===t||!gn(n)||En(n))&&("fixed"===Sn(n).position||Br(n,t))}function Fr(e,t,n){const r=vn(t),o=fn(t),i="fixed"===n,a=Rr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=qn(0);if(r||!r&&!i)if(("body"!==pn(t)||bn(o))&&(s=_n(t)),r){const e=Rr(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Ar(o));const u=!o||r||i?qn(0):Nr(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function jr(e){return"static"===Sn(e).position}function $r(e,t){if(!vn(e)||"fixed"===Sn(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fn(e)===n&&(n=n.ownerDocument.body),n}function Wr(e,t){const n=hn(e);if(kn(e))return n;if(!vn(e)){let t=In(e);for(;t&&!En(t);){if(gn(t)&&!jr(t))return t;t=In(t)}return n}let r=$r(e,t);for(;r&&xn(r)&&jr(r);)r=$r(r,t);return r&&En(r)&&jr(r)&&!wn(r)?n:r||function(e){let t=In(e);for(;vn(t)&&!En(t);){if(wn(t))return t;if(kn(t))return null;t=In(t)}return null}(e)||n}const Hr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=fn(r),s=!!t&&kn(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=qn(1);const c=qn(0),d=vn(r);if((d||!d&&!i)&&(("body"!==pn(r)||bn(a))&&(l=_n(r)),vn(r))){const e=Rr(r);u=Dr(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const p=!a||d||i?qn(0):Nr(a,l,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}},getDocumentElement:fn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?kn(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ln(e,[],!1).filter((e=>gn(e)&&"body"!==pn(e))),o=null;const i="fixed"===Sn(e).position;let a=i?In(e):e;for(;gn(a)&&!En(a);){const t=Sn(a),n=wn(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||bn(a)&&!n&&Br(e,a))?r=r.filter((e=>e!==a)):o=t,a=In(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Vr(t,n,o);return e.top=Yn(r.top,e.top),e.right=zn(r.right,e.right),e.bottom=zn(r.bottom,e.bottom),e.left=Yn(r.left,e.left),e}),Vr(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Wr,getElementRects:async function(e){const t=this.getOffsetParent||Wr,n=this.getDimensions,r=await n(e.floating);return{reference:Fr(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}=Lr(e);return{width:t,height:n}},getScale:Dr,isElement:gn,isRTL:function(e){return"rtl"===Sn(e).direction}};function zr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=Tr(e),c=o||i?[...u?Ln(u):[],...Ln(t)]:[];c.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=u&&s?function(e,t){let n,r=null;const o=fn(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:u,top:c,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const h={rootMargin:-Un(c)+"px "+-Un(o.clientWidth-(u+d))+"px "+-Un(o.clientHeight-(c+p))+"px "+-Un(u)+"px",threshold:Yn(0,zn(1,l))||1};let f=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}f=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(u,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),u&&!l&&f.observe(u),f.observe(t));let m=l?Rr(e):null;return l&&function t(){const r=Rr(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;c.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Yr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Jn(n),s=er(n),l="y"===rr(n),u=["left","top"].includes(a)?-1:1,c=i&&l?-1:1,d=Xn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*c,y:p*u}:{x:p*u,y:h*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Kr=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:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Xn(e,t),u={x:n,y:r},c=await Mr(t,l),d=rr(Jn(o)),p=tr(d);let h=u[p],f=u[d];if(i){const e="y"===p?"bottom":"right";h=Qn(h+c["y"===p?"top":"left"],h,h-c[e])}if(a){const e="y"===d?"bottom":"right";f=Qn(f+c["y"===d?"top":"left"],f,f-c[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},Ur=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Xn(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Jn(o),y=rr(s),b=Jn(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(u.floating)),k=p||(b||!m?[ar(s)]:function(e){const t=ar(e);return[ir(e),t,ir(t)]}(s)),w="none"!==f;!p&&w&&k.push(...function(e,t,n,r){const o=er(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(Jn(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ir)))),i}(s,m,f,x));const C=[s,...k],E=await Mr(t,g),S=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&S.push(E[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=er(e),o=or(e),i=nr(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ar(a)),[a,ar(a)]}(o,a,x);S.push(E[e[0]],E[e[1]])}if(_=[..._,{placement:o,overflows:S}],!S.every((e=>e<=0))){var I,M;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(M=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:M.placement;if(!n)switch(h){case"bestFit":{var L;const e=null==(L=_.filter((e=>{if(w){const t=rr(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:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},qr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=Xn(e,t)||{};if(null==u)return{};const d=sr(c),p={x:n,y:r},h=or(o),f=nr(h),m=await a.getDimensions(u),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let C=w?w[b]:0;C&&await(null==a.isElement?void 0:a.isElement(w))||(C=s.floating[b]||i.floating[f]);const E=x/2-k/2,S=C/2-m[f]/2-1,_=zn(d[v],S),I=zn(d[y],S),M=_,L=C-m[f]-I,T=C/2-m[f]/2+E,D=Qn(M,T,L),P=!l.arrow&&null!=er(o)&&T!==D&&i.reference[f]/2-(T<M?_:I)-m[f]/2<0,O=P?T<M?T-M:T-L:0;return{[h]:p[h]+O,data:{[h]:D,centerOffset:T-D-O,...P&&{alignmentOffset:O}},reset:P}}}),Zr=(e,t,n)=>{const r=new Map,o={platform:Hr,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Ir(u,r,l),p=r,h={},f=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:v,data:y,reset:b}=await m({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:a,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=v?v:d,h={...h,[i]:{...h[i],...y}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:d}=Ir(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var Gr="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function Qr(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(!Qr(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)&&!Qr(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Xr(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jr(e,t){const n=Xr(e);return Math.round(t*n)/n}function eo(e){const t=h.useRef(e);return Gr((()=>{t.current=e})),t}const to=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?qr({element:n.current,padding:r}).fn(t):{}:n?qr({element:n,padding:r}).fn(t):{};var o}}),no=(e,t)=>({...Yr(e),options:[e,t]}),ro=(e,t)=>({...Kr(e),options:[e,t]}),oo=(e,t)=>({...Ur(e),options:[e,t]}),io=(e,t)=>({...to(e),options:[e,t]});function ao(e){return h.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const so={...h},lo=so.useInsertionEffect||(e=>e());function uo(e){const t=h.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return lo((()=>{t.current=e})),h.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 co="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;let po=!1,ho=0;const fo=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ho++;const mo=so.useId||function(){const[e,t]=h.useState((()=>po?fo():void 0));return co((()=>{null==e&&t(fo())}),[]),h.useEffect((()=>{po=!0}),[]),e};let go;"production"!==process.env.NODE_ENV&&(go=new Set);const vo=h.forwardRef((function(e,t){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:a}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:d,stroke:p,d:f,style:{transform:m,...g}={},...v}=e;"production"!==process.env.NODE_ENV&&(t||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=go)&&e.has(o)||(null==(i=go)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const y=mo(),[b,x]=h.useState(!1);if(co((()=>{if(!o)return;"rtl"===Sn(o).direction&&x(!0)}),[o]),!o)return null;const[k,w]=r.split("-"),C="top"===k||"bottom"===k;let E=d;(C&&null!=a&&a.x||!C&&null!=a&&a.y)&&(E=null);const S=2*c,_=S/2,I=s/2*(u/-8+1),M=l/2*u/4,L=!!f,T=E&&"end"===w?"bottom":"top";let D=E&&"end"===w?"right":"left";E&&b&&(D="end"===w?"left":"right");const P=null!=(null==i?void 0:i.x)?E||i.x:"",O=null!=(null==i?void 0:i.y)?E||i.y:"",R=f||"M0,0 H"+s+" L"+(s-I)+","+(l-M)+" Q"+s/2+","+l+" "+I+","+(l-M)+" Z",A={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[k];return n.jsxs("svg",{...v,"aria-hidden":!0,ref:t,width:L?s:s+S,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[D]:P,[T]:O,[k]:C||L?"100%":"calc(100% - "+S/2+"px)",transform:[A,m].filter((e=>!!e)).join(" "),...g},children:[S>0&&n.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:p,strokeWidth:S+(f?0:1),d:R}),n.jsx("path",{stroke:S&&!f?v.fill:"none",d:R}),n.jsx("clipPath",{id:y,children:n.jsx("rect",{x:-_,y:_*(L?-1:1),width:s+S,height:s})})]})}));const yo=h.createContext(null),bo=h.createContext(null),xo=()=>{var e;return(null==(e=h.useContext(yo))?void 0:e.id)||null},ko=()=>h.useContext(bo);function wo(e){return"data-floating-ui-"+e}function Co(t){const n=e.useRef(t);return co((()=>{n.current=t})),n}const Eo=wo("safe-polygon");function So(e,t,n){return n&&!Bn(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function _o(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 Io=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Mo(e,t){const n=_r(e,Io());"prev"===t&&n.reverse();const r=n.indexOf(Dn(Fn(e)));return n.slice(r+1)[0]}function Lo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Pn(n,r)}function To(e){_r(e,Io()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Do(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 Po={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 Oo(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Ro=h.forwardRef((function(e,t){const[r,o]=h.useState();co((()=>(Nn()&&o("button"),document.addEventListener("keydown",Oo),()=>{document.removeEventListener("keydown",Oo)})),[]);const i={ref:t,tabIndex:0,role:r,"aria-hidden":!r||void 0,[wo("focus-guard")]:"",style:Po};return n.jsx("span",{...e,...i})})),Ao=h.createContext(null),No=wo("portal");function Vo(e){const{children:t,id:r,root:o,preserveTabOrder:i=!0}=e,a=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=mo(),o=Bo(),[i,a]=h.useState(null),s=h.useRef(null);return co((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{s.current=null}))}),[i]),co((()=>{if(!r)return;if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(No,""),e.appendChild(n),s.current=n,a(n)}),[t,r]),co((()=>{if(null===n)return;if(!r)return;if(s.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!gn(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(No,""),e=i||e,e.appendChild(l),s.current=l,a(l)}),[t,n,r,o]),i}({id:r,root:o}),[s,l]=h.useState(null),u=h.useRef(null),c=h.useRef(null),d=h.useRef(null),p=h.useRef(null),m=null==s?void 0:s.modal,g=null==s?void 0:s.open,v=!!s&&!s.modal&&s.open&&i&&!(!o&&!a);return h.useEffect((()=>{if(a&&i&&!m)return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Lo(e)){("focusin"===e.type?Do:To)(a)}}}),[a,i,m]),h.useEffect((()=>{a&&(g||Do(a))}),[g,a]),n.jsxs(Ao.Provider,{value:h.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:p,portalNode:a,setFocusManagerState:l})),[i,a]),children:[v&&a&&n.jsx(Ro,{"data-type":"outside",ref:u,onFocus:e=>{if(Lo(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=Mo(document.body,"prev")||(null==s?void 0:s.domReference);null==e||e.focus()}}}),v&&a&&n.jsx("span",{"aria-owns":a.id,style:Po}),a&&f.createPortal(t,a),v&&a&&n.jsx(Ro,{"data-type":"outside",ref:c,onFocus:e=>{if(Lo(e,a)){var t;null==(t=p.current)||t.focus()}else{const t=Mo(document.body,"next")||(null==s?void 0:s.domReference);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Bo=()=>h.useContext(Ao),Fo="data-floating-ui-focusable";function jo(e){return vn(e.target)&&"BUTTON"===e.target.tagName}function $o(e){return Hn(e)}const Wo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ho={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},zo=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 Yo(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=mo(),i=h.useRef({}),[a]=h.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)))||[])}}}())),s=null!=xo();if("production"!==process.env.NODE_ENV){const e=r.reference;e&&!gn(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=go)&&e.has(o)||(null==(i=go)||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[l,u]=h.useState(r.reference),c=uo(((e,t,r)=>{i.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)})),d=h.useMemo((()=>({setPositionReference:u})),[]),p=h.useMemo((()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference})),[l,r.reference,r.floating]);return h.useMemo((()=>({dataRef:i,open:t,onOpenChange:c,elements:p,events:a,floatingId:o,refs:d})),[t,c,p,a,o,d])}function Ko(e){void 0===e&&(e={});const{nodeId:t}=e,n=Yo({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=h.useState(null),[s,l]=h.useState(null),u=(null==o?void 0:o.domReference)||i,c=h.useRef(null),d=ko();co((()=>{u&&(c.current=u)}),[u]);const p=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=h.useState(r);Qr(p,r)||m(r);const[g,v]=h.useState(null),[y,b]=h.useState(null),x=h.useCallback((e=>{e!==E.current&&(E.current=e,v(e))}),[]),k=h.useCallback((e=>{e!==S.current&&(S.current=e,b(e))}),[]),w=i||g,C=a||y,E=h.useRef(null),S=h.useRef(null),_=h.useRef(c),I=null!=l,M=eo(l),L=eo(o),T=eo(u),D=h.useCallback((()=>{if(!E.current||!S.current)return;const e={placement:t,strategy:n,middleware:p};L.current&&(e.platform=L.current),Zr(E.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};P.current&&!Qr(_.current,t)&&(_.current=t,f.flushSync((()=>{d(t)})))}))}),[p,t,n,L,T]);Gr((()=>{!1===u&&_.current.isPositioned&&(_.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[u]);const P=h.useRef(!1);Gr((()=>(P.current=!0,()=>{P.current=!1})),[]),Gr((()=>{if(w&&(E.current=w),C&&(S.current=C),w&&C){if(M.current)return M.current(w,C,D);D()}}),[w,C,D,M,I]);const O=h.useMemo((()=>({reference:E,floating:S,setReference:x,setFloating:k})),[x,k]),R=h.useMemo((()=>({reference:w,floating:C})),[w,C]),A=h.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Jr(R.floating,c.x),r=Jr(R.floating,c.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Xr(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,R.floating,c.x,c.y]);return h.useMemo((()=>({...c,update:D,refs:O,elements:R,floatingStyles:A})),[c,D,O,R,A])}({...e,elements:{...o,...s&&{reference:s}}}),m=h.useCallback((e=>{const t=gn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),p.refs.setReference(t)}),[p.refs]),g=h.useCallback((e=>{(gn(e)||null===e)&&(c.current=e,a(e)),(gn(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!gn(e))&&p.refs.setReference(e)}),[p.refs]),v=h.useMemo((()=>({...p.refs,setReference:g,setPositionReference:m,domReference:c})),[p.refs,g,m]),y=h.useMemo((()=>({...p.elements,domReference:u})),[p.elements,u]),b=h.useMemo((()=>({...p,...r,refs:v,elements:y,nodeId:t})),[p,v,y,t,r]);return co((()=>{r.dataRef.current.floatingContext=b;const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===t));e&&(e.context=b)})),h.useMemo((()=>({...p,context:b,refs:v,elements:y})),[p,v,y,b])}function Uo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:a}=e,{enabled:s=!0,visibleOnly:l=!0}=t,u=h.useRef(!1),c=h.useRef(),d=h.useRef(!0);h.useEffect((()=>{if(!s)return;const e=hn(a.domReference);function t(){!n&&vn(a.domReference)&&a.domReference===Dn(Fn(a.domReference))&&(u.current=!0)}function r(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,s]),h.useEffect((()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[o,s]),h.useEffect((()=>()=>{clearTimeout(c.current)}),[]);const p=h.useMemo((()=>({onPointerDown(e){An(e.nativeEvent)||(d.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=$n(e.nativeEvent);if(l&&gn(t))try{if(Nn()&&On().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!Hn(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=gn(t)&&t.hasAttribute(wo("focus-guard"))&&"outside"===t.getAttribute("data-type");c.current=window.setTimeout((()=>{var e;const s=Dn(a.domReference?a.domReference.ownerDocument:document);(t||s!==a.domReference)&&(Pn(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,s)||Pn(a.domReference,s)||o||r(!1,n,"focus"))}))}})),[i,a.domReference,r,l]);return h.useMemo((()=>s?{reference:p}:{}),[s,p])}const qo="active",Zo="selected";function Go(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[qo]:t,[Zo]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Fo]:""},...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 a;o&&[qo,Zo].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(a=r.get(n))||a.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 Qo=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Xo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Jo(e,t){return"function"==typeof e?e(t):e}function ei(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[a,s]=h.useState("unmounted"),l=function(e,t){const[n,r]=h.useState(e);return e&&!n&&r(!0),h.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return l||"close"!==a||s("unmounted"),co((()=>{if(r){if(n){s("initial");const e=requestAnimationFrame((()=>{s("open")}));return()=>{cancelAnimationFrame(e)}}s("close")}}),[n,r]),{isMounted:l,status:a}}function ti(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,a=i-1;e<i;a=e++){const[i,s]=t[e]||[0,0],[l,u]=t[a]||[0,0];s>=r!=u>=r&&n<=(l-i)*(r-s)/(u-s)+i&&(o=!o)}return o}function ni(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,a=null,s=null,l=performance.now();const u=e=>{let{x:n,y:u,placement:c,elements:d,onClose:p,nodeId:h,tree:f}=e;return function(e){function m(){clearTimeout(o),p()}if(clearTimeout(o),!d.domReference||!d.floating||null==c||null==n||null==u)return;const{clientX:g,clientY:v}=e,y=[g,v],b=$n(e),x="mouseleave"===e.type,k=Pn(d.floating,b),w=Pn(d.domReference,b),C=d.domReference.getBoundingClientRect(),E=d.floating.getBoundingClientRect(),S=c.split("-")[0],_=n>E.right-E.width/2,I=u>E.bottom-E.height/2,M=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,C),L=E.width>C.width,T=E.height>C.height,D=(L?C:E).left,P=(L?C:E).right,O=(T?C:E).top,R=(T?C:E).bottom;if(k&&(i=!0,!x))return;if(w&&(i=!1),w&&!x)return void(i=!0);if(x&&gn(e.relatedTarget)&&Pn(d.floating,e.relatedTarget))return;if(f&&_o(f.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===S&&u>=C.bottom-1||"bottom"===S&&u<=C.top+1||"left"===S&&n>=C.right-1||"right"===S&&n<=C.left+1)return m();let A=[];switch(S){case"top":A=[[D,C.top+1],[D,E.bottom-1],[P,E.bottom-1],[P,C.top+1]];break;case"bottom":A=[[D,E.top+1],[D,C.bottom-1],[P,C.bottom-1],[P,E.top+1]];break;case"left":A=[[E.right-1,R],[E.right-1,O],[C.left+1,O],[C.left+1,R]];break;case"right":A=[[C.right-1,R],[C.right-1,O],[E.left+1,O],[E.left+1,R]]}if(!ti([g,v],A)){if(i&&!M)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===a||null===s||0===r)return a=e,s=t,l=n,null;const o=e-a,i=t-s,u=Math.sqrt(o*o+i*i);return a=e,s=t,l=n,u/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}ti([g,v],function(e){let[n,r]=e;switch(S){case"top":return[[L?n+t/2:_?n+4*t:n-4*t,r+t+1],[L?n-t/2:_?n+4*t:n-4*t,r+t+1],...[[E.left,_||L?E.bottom-t:E.top],[E.right,_?L?E.bottom-t:E.top:E.bottom-t]]];case"bottom":return[[L?n+t/2:_?n+4*t:n-4*t,r-t],[L?n-t/2:_?n+4*t:n-4*t,r-t],...[[E.left,_||L?E.top+t:E.bottom],[E.right,_?L?E.top+t:E.bottom:E.top+t]]];case"left":{const e=[n+t+1,T?r+t/2:I?r+4*t:r-4*t],o=[n+t+1,T?r-t/2:I?r+4*t:r-4*t];return[...[[I||T?E.right-t:E.left,E.top],[I?T?E.right-t:E.left:E.right-t,E.bottom]],e,o]}case"right":return[[n-t,T?r+t/2:I?r+4*t:r-4*t],[n-t,T?r-t/2:I?r+4*t:r-4*t],...[[I||T?E.left+t:E.right,E.top],[I?T?E.left+t:E.right:E.left+t,E.bottom]]]}}([n,u]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return u.__options={blockPointerEvents:n},u}const ri=e=>!("boolean"==typeof e||null==e),oi=n=>{const{"aria-disabled":r,"aria-label":o,ariaDisabled:i,ariaLabel:a,buttonStyle:s,children:l,className:u,colorScheme:c,disabled:d=!1,fullWidth:p=!1,href:h,htmlRef:f,iconLeft:m,iconRight:g,iconSystemLeft:v,iconSystemRight:y,isLoading:b=!1,mediaType:x,onClick:k,size:w=exports.ButtonSize.md,suppressHydrationWarning:C,type:E}=n,S=wt(n,["aria-disabled","aria-label","ariaDisabled","ariaLabel","buttonStyle","children","className","colorScheme","disabled","fullWidth","href","htmlRef","iconLeft","iconRight","iconSystemLeft","iconSystemRight","isLoading","mediaType","onClick","size","suppressHydrationWarning","type"]),_=t.useTheme(),{chooseColor:I,colorScheme:M,mediaType:L}=$(n),T=e.useRef(null),D=ao([f,T]),P=function(t){const[n,r]=e.useState(!1);return on("mouseenter",(()=>{r(!0)}),t),on("mouseleave",(()=>{r(!1)}),t),n}(T),O=e.useMemo((()=>{switch(!0){case s===exports.ButtonStyle.primary&&d:return I(_.colors.fg.disabled);case s===exports.ButtonStyle.primary&&P:case s===exports.ButtonStyle.primary:return I(_.colors.fg.neutral.white);case s===exports.ButtonStyle.secondary&&d:return I(_.colors.fg.disabled);case s===exports.ButtonStyle.secondary&&P:return I(_.colors.fg.brand.bold);case s===exports.ButtonStyle.secondary:return I(_.colors.fg.neutral.subtle);case s===exports.ButtonStyle.tertiary&&d:return I(_.colors.fg.disabled);case s===exports.ButtonStyle.tertiary&&P:return I(_.colors.fg.brand.bold);case s===exports.ButtonStyle.tertiary:return I(_.colors.fg.neutral.subtle);default:throw new Error("unexpected combination when specifying the button icon color button.tsx")}}),[s,I,d,P,_]),R=e.useMemo((()=>{switch(w){case exports.ButtonSize.xs:return exports.TypographyVariant.textXs;case exports.ButtonSize.sm:case exports.ButtonSize.md:return exports.TypographyVariant.textSm;case exports.ButtonSize.xl:return exports.TypographyVariant.textMd;case exports.ButtonSize.xxl:return exports.TypographyVariant.textLg;default:throw new Error("unexpected enum value of ButtonSize in button.tsx")}}),[w]),A=e.useMemo((()=>{switch(w){case exports.ButtonSize.xs:return exports.IconSystemSize.small;case exports.ButtonSize.sm:case exports.ButtonSize.md:case exports.ButtonSize.xl:case exports.ButtonSize.xxl:return exports.IconSystemSize.big;default:throw new Error("unexpected enum value of ButtonSize in button.tsx")}}),[w]);return e.createElement(Rt,Object.assign({$buttonStyle:s,$chooseColor:I,$fullWidth:p,$size:w,$type:E,"aria-disabled":null!=r?r:i,"aria-label":null!=o?o:a,as:E===exports.ButtonType.anchor?"a":void 0,className:u,disabled:d,href:h,ref:D,suppressHydrationWarning:C,type:E===exports.ButtonType.button||E===exports.ButtonType.submit||E===exports.ButtonType.reset?E:void 0,onClick:k},S),b&&e.createElement(Nt,null,e.createElement(ht,{colorScheme:M,size:exports.IconSystemSize.big,stroke:O,type:exports.IconSystemType.spinner})),void 0!==m&&e.createElement(At,null,m),void 0!==v&&e.createElement(ht,{colorScheme:M,size:A,stroke:O,type:v}),ri(l)&&e.createElement(Z,{color:"inherit",colorScheme:M,mediaType:L,variant:R,weight:exports.FontWeight.medium500},l),void 0!==g&&e.createElement(At,null,g),void 0!==y&&e.createElement(ht,{colorScheme:M,size:A,stroke:O,type:y}))};function ii(e){return ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ii(e)}function ai(e){var t=function(e,t){if("object"!=ii(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ii(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ii(t)?t:t+""}function si(e,t,n){return(t=ai(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function li(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?li(Object(n),!0).forEach((function(t){si(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):li(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ci(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function di(e,t){if(e){if("string"==typeof e)return ci(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ci(e,t):void 0}}function pi(e){return function(e){if(Array.isArray(e))return ci(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||di(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||di(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var fi,mi={exports:{}};
6
6
  /*!
7
7
  Copyright (c) 2018 Jed Watson.
8
8
  Licensed under the MIT License (MIT), see