@react-hive/honey-layout 17.3.1 → 17.3.2

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.
Files changed (28) hide show
  1. package/dist/components/HoneyBox/HoneyBox.d.ts +1 -1
  2. package/dist/components/HoneyContextMenu/HoneyContextMenu.d.ts +2 -1
  3. package/dist/components/HoneyContextMenu/HoneyContextMenuContent.d.ts +2 -1
  4. package/dist/components/HoneyContextMenu/HoneyContextMenuContentOption.d.ts +2 -1
  5. package/dist/components/HoneyFlex/HoneyFlex.d.ts +1 -1
  6. package/dist/components/HoneyGrid/HoneyGrid.d.ts +2 -1
  7. package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +1 -1
  8. package/dist/components/HoneyGridColumn/HoneyGridColumn.d.ts +2 -1
  9. package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +1 -1
  10. package/dist/components/HoneyLayerRegistry/HoneyLayerRegistry.d.ts +1 -1
  11. package/dist/components/HoneyList/HoneyList.d.ts +2 -1
  12. package/dist/components/HoneyList/HoneyListStyled.d.ts +1 -1
  13. package/dist/components/HoneyOverlay.d.ts +2 -1
  14. package/dist/components/HoneyPopup/HoneyPopup.d.ts +2 -1
  15. package/dist/components/HoneyPopup/HoneyPopupContent.d.ts +2 -1
  16. package/dist/components/HoneyPopup/HoneyPopupPortal.d.ts +1 -1
  17. package/dist/components/HoneyPopup/HoneyPopupStyled.d.ts +1 -1
  18. package/dist/components/HoneyPopup/HoneyPopupTree.d.ts +1 -1
  19. package/dist/components/HoneyStatusContent.d.ts +1 -1
  20. package/dist/index.cjs +3 -3
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.dev.cjs +48 -48
  23. package/dist/index.dev.cjs.map +1 -1
  24. package/dist/index.mjs +3 -3
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/providers/HoneyLayoutProvider.d.ts +2 -1
  27. package/dist/providers/HoneyLayoutThemeOverride.d.ts +2 -1
  28. package/package.json +8 -7
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see index.mjs.LICENSE.txt */
2
- import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,css as r,isCssColorProperty as o,isCssSpacingProperty as i,isThemeColorValue as u,resolveColor as c,resolveSpacing as s,styled as l}from"@react-hive/honey-style";var a={117(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Function]",c="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a[i]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a[u]=a["[object Map]"]=a["[object Number]"]=a[c]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var f,d,p,v="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,h=v||m||Function("return this")(),g=t&&!t.nodeType&&t,y=g&&e&&!e.nodeType&&e,b=y&&y.exports===g,x=b&&v.process,w=function(){try{return y&&y.require&&y.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),E=w&&w.isTypedArray,R=Array.prototype,O=Function.prototype,C=Object.prototype,j=h["__core-js_shared__"],_=O.toString,S=C.hasOwnProperty,k=(f=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",A=C.toString,L=_.call(Object),T=RegExp("^"+_.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=b?h.Buffer:void 0,M=h.Symbol,D=h.Uint8Array,$=(P&&P.allocUnsafe,d=Object.getPrototypeOf,p=Object,function(e){return d(p(e))}),I=Object.create,N=C.propertyIsEnumerable,F=R.splice,W=M?M.toStringTag:void 0,H=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=P?P.isBuffer:void 0,B=Math.max,U=Date.now,K=ce(h,"Map"),V=ce(Object,"create"),q=function(){function e(){}return function(t){if(!be(t))return{};if(I)return I(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=this.__data__=new Y(e);this.size=t.size}function Q(e,t,n){(void 0!==n&&!de(e[t],n)||void 0===n&&!(t in e))&&te(e,t,n)}function J(e,t,n){var r=e[t];S.call(e,t)&&de(r,n)&&(void 0!==n||t in e)||te(e,t,n)}function ee(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}function te(e,t,n){"__proto__"==t&&H?H(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}X.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(V){var n=t[e];return n===r?void 0:n}return S.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:S.call(t,e)},X.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=ee(t,e);return!(n<0||(n==t.length-1?t.pop():F.call(t,n,1),--this.size,0))},Y.prototype.get=function(e){var t=this.__data__,n=ee(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return ee(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(K||Y),string:new X}},G.prototype.delete=function(e){var t=ue(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return ue(this,e).get(e)},G.prototype.has=function(e){return ue(this,e).has(e)},G.prototype.set=function(e,t){var n=ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new Y,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!K||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(e,t),this.size=n.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":W&&W in Object(e)?function(e){var t=S.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(e){}var o=A.call(e);return r&&(t?e[W]=n:delete e[W]),o}(e):function(e){return A.call(e)}(e)}function re(e){return xe(e)&&ne(e)==i}function oe(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),i=n(e),u=i.length;u--;){var c=i[++r];if(!1===t(o[c],c,o))break}}(t,function(i,u){if(o||(o=new Z),be(i))!function(e,t,n,r,o,i,u){var s=ae(e,n),l=ae(t,n),a=u.get(l);if(a)Q(e,n,a);else{var f,d,p,v,m,h=i?i(s,l,n+"",e,t,u):void 0,g=void 0===h;if(g){var y=ve(l),b=!y&&he(l),x=!y&&!b&&we(l);h=l,y||b||x?ve(s)?h=s:xe(m=s)&&me(m)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(s):b?(g=!1,h=function(e){return e.slice()}(l)):x?(g=!1,v=new(p=(f=l).buffer).constructor(p.byteLength),new D(v).set(new D(p)),d=v,h=new f.constructor(d,f.byteOffset,f.length)):h=[]:function(e){if(!xe(e)||ne(e)!=c)return!1;var t=$(e);if(null===t)return!0;var n=S.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==L}(l)||pe(l)?(h=s,pe(s)?h=function(e){return function(e,t,n){var r=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var u=t[o],c=void 0;void 0===c&&(c=e[u]),r?te(n,u,c):J(n,u,c)}return n}(e,Ee(e))}(s):be(s)&&!ge(s)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):g=!1}g&&(u.set(l,h),o(h,l,r,i,u),u.delete(l)),Q(e,n,h)}}(e,t,u,n,oe,r,o);else{var s=r?r(ae(e,u),i,u+"",e,t,o):void 0;void 0===s&&(s=i),Q(e,u,s)}},Ee)}var ie=H?function(e,t){return H(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ce;function ue(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ce(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!be(e)||function(e){return!!k&&k in e}(e))&&(ge(e)?T:s).test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function se(e,t){var n=typeof e;return!!(t=t??o)&&("number"==n||"symbol"!=n&&l.test(e))&&e>-1&&e%1==0&&e<t}function le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function ae(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fe=function(e){var t=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ie);function de(e,t){return e===t||e!=e&&t!=t}var pe=re(function(){return arguments}())?re:function(e){return xe(e)&&S.call(e,"callee")&&!N.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&ye(e.length)&&!ge(e)}var he=z||function(){return!1};function ge(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function be(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=E?function(e){return function(t){return e(t)}}(E):function(e){return xe(e)&&ye(e.length)&&!!a[ne(e)]};function Ee(e){return me(e)?function(e,t){var n=ve(e),r=!n&&pe(e),o=!n&&!r&&he(e),i=!n&&!r&&!o&&we(e),u=n||r||o||i,c=u?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=c.length;for(var l in e)!t&&!S.call(e,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||se(l,s))||c.push(l);return c}(e,!0):function(e){if(!be(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=le(e),n=[];for(var r in e)("constructor"!=r||!t&&S.call(e,r))&&n.push(r);return n}(e)}var Re,Oe=(Re=function(e,t,n){oe(e,t,n)},function(e,t){return fe(function(e,t,n){return t=B(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=B(r.length-t,0),u=Array(i);++o<i;)u[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(u),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,c)}}(e,t,Ce),e+"")}(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Re.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!be(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&se(t,n.length):"string"==r&&t in n)&&de(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var u=t[n];u&&Re(e,u,n)}return e}));function Ce(e){return e}e.exports=Oe},551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,c,s,l,a=0,f=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,c=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===s)return function(e){return a=e,s=setTimeout(w,t),f?b(e):c}(l);if(d)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),c}return t=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),R.cancel=function(){void 0!==s&&clearTimeout(s),a=0,o=l=i=s=void 0},R.flush=function(){return void 0===s?c:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}},597(e,t,n){var r=n(649);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(o(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal"),s=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(o(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:c,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=s.T,n=u.p;try{if(s.T=null,u.p=2,e)return e()}finally{s.T=t,u.p=n,u.d.f()}}},65(e,t,n){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(597)},757(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},325(e,t,n){e.exports=n(757)},649(t){t.exports=e}},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={id:e,loaded:!1,exports:{}};return a[e](n,n.exports,d),n.loaded=!0,n.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);const p=!1,v="$";function m(e,t){if(!e)throw new Error(t)}const h=e=>"function"==typeof e,g=(e,...t)=>"function"==typeof e?e(...t):e,y=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,b=(...e)=>t=>{e.forEach(e=>{h(e)?e(t):"object"==typeof e&&(e.current=t)})},x=e=>"$"===e[0],w=e=>({theme:t,...n})=>r`
2
+ import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,css as r,isCssColorProperty as o,isCssSpacingProperty as i,isThemeColorValue as u,resolveColor as c,resolveSpacing as s,styled as l}from"@react-hive/honey-style";var a={117(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Function]",c="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a[i]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a[u]=a["[object Map]"]=a["[object Number]"]=a[c]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var f,d,p,v="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,h=v||m||Function("return this")(),g=t&&!t.nodeType&&t,y=g&&e&&!e.nodeType&&e,b=y&&y.exports===g,x=b&&v.process,w=function(){try{return y&&y.require&&y.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),E=w&&w.isTypedArray,R=Array.prototype,O=Function.prototype,C=Object.prototype,j=h["__core-js_shared__"],_=O.toString,S=C.hasOwnProperty,k=(f=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",A=C.toString,L=_.call(Object),T=RegExp("^"+_.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=b?h.Buffer:void 0,M=h.Symbol,D=h.Uint8Array,$=(P&&P.allocUnsafe,d=Object.getPrototypeOf,p=Object,function(e){return d(p(e))}),I=Object.create,N=C.propertyIsEnumerable,F=R.splice,W=M?M.toStringTag:void 0,H=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=P?P.isBuffer:void 0,B=Math.max,U=Date.now,K=ce(h,"Map"),V=ce(Object,"create"),q=function(){function e(){}return function(t){if(!be(t))return{};if(I)return I(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=this.__data__=new Y(e);this.size=t.size}function Q(e,t,n){(void 0!==n&&!de(e[t],n)||void 0===n&&!(t in e))&&te(e,t,n)}function J(e,t,n){var r=e[t];S.call(e,t)&&de(r,n)&&(void 0!==n||t in e)||te(e,t,n)}function ee(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}function te(e,t,n){"__proto__"==t&&H?H(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}X.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(V){var n=t[e];return n===r?void 0:n}return S.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:S.call(t,e)},X.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=ee(t,e);return!(n<0||(n==t.length-1?t.pop():F.call(t,n,1),--this.size,0))},Y.prototype.get=function(e){var t=this.__data__,n=ee(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return ee(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(K||Y),string:new X}},G.prototype.delete=function(e){var t=ue(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return ue(this,e).get(e)},G.prototype.has=function(e){return ue(this,e).has(e)},G.prototype.set=function(e,t){var n=ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new Y,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!K||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(e,t),this.size=n.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":W&&W in Object(e)?function(e){var t=S.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(e){}var o=A.call(e);return r&&(t?e[W]=n:delete e[W]),o}(e):function(e){return A.call(e)}(e)}function re(e){return xe(e)&&ne(e)==i}function oe(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),i=n(e),u=i.length;u--;){var c=i[++r];if(!1===t(o[c],c,o))break}}(t,function(i,u){if(o||(o=new Z),be(i))!function(e,t,n,r,o,i,u){var s=ae(e,n),l=ae(t,n),a=u.get(l);if(a)Q(e,n,a);else{var f,d,p,v,m,h=i?i(s,l,n+"",e,t,u):void 0,g=void 0===h;if(g){var y=ve(l),b=!y&&he(l),x=!y&&!b&&we(l);h=l,y||b||x?ve(s)?h=s:xe(m=s)&&me(m)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(s):b?(g=!1,h=function(e){return e.slice()}(l)):x?(g=!1,v=new(p=(f=l).buffer).constructor(p.byteLength),new D(v).set(new D(p)),d=v,h=new f.constructor(d,f.byteOffset,f.length)):h=[]:function(e){if(!xe(e)||ne(e)!=c)return!1;var t=$(e);if(null===t)return!0;var n=S.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==L}(l)||pe(l)?(h=s,pe(s)?h=function(e){return function(e,t,n){var r=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var u=t[o],c=void 0;void 0===c&&(c=e[u]),r?te(n,u,c):J(n,u,c)}return n}(e,Ee(e))}(s):be(s)&&!ge(s)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):g=!1}g&&(u.set(l,h),o(h,l,r,i,u),u.delete(l)),Q(e,n,h)}}(e,t,u,n,oe,r,o);else{var s=r?r(ae(e,u),i,u+"",e,t,o):void 0;void 0===s&&(s=i),Q(e,u,s)}},Ee)}var ie=H?function(e,t){return H(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ce;function ue(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ce(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!be(e)||function(e){return!!k&&k in e}(e))&&(ge(e)?T:s).test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function se(e,t){var n=typeof e;return!!(t=t??o)&&("number"==n||"symbol"!=n&&l.test(e))&&e>-1&&e%1==0&&e<t}function le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function ae(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fe=function(e){var t=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ie);function de(e,t){return e===t||e!=e&&t!=t}var pe=re(function(){return arguments}())?re:function(e){return xe(e)&&S.call(e,"callee")&&!N.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&ye(e.length)&&!ge(e)}var he=z||function(){return!1};function ge(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function be(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=E?function(e){return function(t){return e(t)}}(E):function(e){return xe(e)&&ye(e.length)&&!!a[ne(e)]};function Ee(e){return me(e)?function(e,t){var n=ve(e),r=!n&&pe(e),o=!n&&!r&&he(e),i=!n&&!r&&!o&&we(e),u=n||r||o||i,c=u?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=c.length;for(var l in e)!t&&!S.call(e,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||se(l,s))||c.push(l);return c}(e,!0):function(e){if(!be(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=le(e),n=[];for(var r in e)("constructor"!=r||!t&&S.call(e,r))&&n.push(r);return n}(e)}var Re,Oe=(Re=function(e,t,n){oe(e,t,n)},function(e,t){return fe(function(e,t,n){return t=B(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=B(r.length-t,0),u=Array(i);++o<i;)u[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(u),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,c)}}(e,t,Ce),e+"")}(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Re.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!be(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&se(t,n.length):"string"==r&&t in n)&&de(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var u=t[n];u&&Re(e,u,n)}return e}));function Ce(e){return e}e.exports=Oe},551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,c,s,l,a=0,f=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,c=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===s)return function(e){return a=e,s=setTimeout(w,t),f?b(e):c}(l);if(d)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),c}return t=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),R.cancel=function(){void 0!==s&&clearTimeout(s),a=0,o=l=i=s=void 0},R.flush=function(){return void 0===s?c:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}},355(e,t,n){var r=n(649);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(o(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal"),s=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(o(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:c,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=s.T,n=u.p;try{if(s.T=null,u.p=2,e)return e()}finally{s.T=t,u.p=n,u.d.f()}}},163(e,t,n){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(355)},790(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},684(e,t,n){e.exports=n(790)},649(t){t.exports=e}},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={id:e,loaded:!1,exports:{}};return a[e](n,n.exports,d),n.loaded=!0,n.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);const p=!1,v="$";function m(e,t){if(!e)throw new Error(t)}const h=e=>"function"==typeof e,g=(e,...t)=>"function"==typeof e?e(...t):e,y=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,b=(...e)=>t=>{e.forEach(e=>{h(e)?e(t):"object"==typeof e&&(e.current=t)})},x=e=>"$"===e[0],w=e=>({theme:t,...n})=>r`
3
3
  ${((e,t)=>Object.entries(e).filter(([e,n])=>"xs"===t&&x(e)||n&&"object"==typeof n&&t in n))(n,e).map(([t,n])=>{const l=t.slice(1);return r`
4
4
  ${(e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)})(l)}: ${((e,t,n)=>{const r="object"!=typeof t||Array.isArray(t)?t:t[n];if(void 0!==r){if(i(e)){if("number"==typeof r||Array.isArray(r))return s(r,"px")}else if(o(e)&&"string"==typeof r&&u(r))return c(r);return r}})(l,n,e)};
5
5
  `})}
@@ -13,7 +13,7 @@ import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,cs
13
13
 
14
14
  ${t.map(O)};
15
15
  `}
16
- `,j=new Set,_=(e,t)=>{j.has(e)||(j.add(e),console.warn(t))},S=l(C,({inline:e=!1,row:t=!1,center:n=!1,centerX:r=!1,centerY:o=!1,$display:i,$flexDirection:u,$alignItems:c,$justifyContent:s,...l})=>{const a=u??(t?"row":"column"),f="row"===a;return{$display:e?"inline-flex":i??"flex",$flexDirection:a,$alignItems:c??(n||(f?o:r)?"center":void 0),$justifyContent:s??(n||(f?r:o)?"center":void 0),"data-testid":l["data-testid"]??"honey-flex"}})``;var k=d(325),A=d(649);const L=(0,A.createContext)(void 0),T=l(S)`
16
+ `,j=new Set,_=(e,t)=>{j.has(e)||(j.add(e),console.warn(t))},S=l(C,({inline:e=!1,row:t=!1,center:n=!1,centerX:r=!1,centerY:o=!1,$display:i,$flexDirection:u,$alignItems:c,$justifyContent:s,...l})=>{const a=u??(t?"row":"column"),f="row"===a;return{$display:e?"inline-flex":i??"flex",$flexDirection:a,$alignItems:c??(n||(f?o:r)?"center":void 0),$justifyContent:s??(n||(f?r:o)?"center":void 0),"data-testid":l["data-testid"]??"honey-flex"}})``;var k=d(684),A=d(649);const L=(0,A.createContext)(void 0),T=l(S)`
17
17
  ${({columns:e,takeColumns:t=1,spacing:n=0,applyMaxWidth:o,applyBasis:i=!0,theme:u})=>{let c=null;return i&&(c=`calc(${t*(100/e)}% - ${s(n,null)({theme:u})/e*(e-t)}px)`),r`
18
18
  flex-basis: ${c};
19
19
 
@@ -33,7 +33,7 @@ import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,cs
33
33
  min-height: ${t};
34
34
  }
35
35
  `}
36
- `,M=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:o=!0,applyColumnMaxWidth:i=!1,...u})=>{const c=(0,A.useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}),[n,r,o,i]);return(0,k.jsx)(L,{value:c,children:(0,k.jsx)(P,{ref:e,spacing:r,"data-testid":"honey-grid",...u,children:t})})},D=()=>{const e=(0,A.useContext)(L);if(!e)throw new Error("The `useHoneyGridContext()` hook can only be used inside <HoneyGrid/> component!");return e},$=({children:e,...t})=>{const{columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}=D();return(0,k.jsx)(T,{columns:n,spacing:r,applyMaxWidth:i,$flexGrow:o?1:0,"data-testid":"honey-grid-column",...t,children:e})},I=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,N=({children:e,loading:t=!1,loadingOverContent:n=!1,error:r=!1,empty:o=!1,loadingContent:i=null,errorContent:u=null,emptyContent:c=null})=>r?u:!n&&t?i:(0,k.jsxs)(k.Fragment,{children:[n&&t&&i,o?c:e]}),F=l(S,({$overflow:e="hidden auto"})=>({$overflow:e}))``,W=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s=!1,emptyContent:l,...a})=>(0,k.jsx)(F,{role:"list","aria-busy":r,"data-testid":"honey-list",...a,children:(0,k.jsx)(N,{loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s||0===t?.length,emptyContent:l,children:t?.map((t,r,o)=>(0,k.jsx)(A.Fragment,{children:e(t,r,o)},String(I(t,n,r))))})}),H=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,u]=(0,A.useState)(r||t),c=(0,A.useRef)(void 0);return(0,A.useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(c.current),u(!0),()=>{o||(c.current=setTimeout(()=>u(!1),n))}},[t,r,n]),i?e:null};var z=d(551),B=d.n(z);const U=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,A.useState)(()=>({...R(e.breakpoints),...n}));return(0,A.useEffect)(()=>{const r=B()(()=>{o({...R(e.breakpoints),...n})},t);return r(),window.addEventListener("resize",r),window.screen.orientation.addEventListener("change",r),()=>{r.cancel(),window.removeEventListener("resize",r),window.screen.orientation.removeEventListener("change",r)}},[]),r},K=(0,A.createContext)(void 0),V=()=>{const e=(0,A.useContext)(K);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},q=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=V(),o=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},X=(e,{onKeyUp:t}={})=>{const{overlays:n}=V(),r=n.find(t=>t.id===e);return(0,A.useEffect)(()=>{if(r&&t)return r.addListener("keyup",t),()=>{r.removeListener("keyup",t)}},[r,t]),r},Y=({ref:e,children:t,active:n,overlayId:r,onDeactivate:o,...i})=>{const u=q(n,{id:r,onKeyUp:(0,A.useCallback)(e=>{"Escape"===e&&o()},[o])}),c=b(u?.setContainerRef,e);return(0,k.jsx)(S,{ref:c,inert:!n,...i,children:g(t,{overlay:u,deactivateOverlay:o})})},G=(0,A.createContext)(void 0);function Z(){return"undefined"!=typeof window}function Q(e){return te(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ee(e){var t;return null==(t=(te(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function te(e){return!!Z()&&(e instanceof Node||e instanceof J(e).Node)}function ne(e){return!!Z()&&(e instanceof Element||e instanceof J(e).Element)}function re(e){return!!Z()&&(e instanceof HTMLElement||e instanceof J(e).HTMLElement)}function oe(e){return!(!Z()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof J(e).ShadowRoot)}function ie(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function ue(e){return/^(table|td|th)$/.test(Q(e))}function ce(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const se=/transform|translate|scale|rotate|perspective|filter/,le=/paint|layout|strict|content/,ae=e=>!!e&&"none"!==e;let fe;function de(e){const t=ne(e)?me(e):e;return ae(t.transform)||ae(t.translate)||ae(t.scale)||ae(t.rotate)||ae(t.perspective)||!pe()&&(ae(t.backdropFilter)||ae(t.filter))||se.test(t.willChange||"")||le.test(t.contain||"")}function pe(){return null==fe&&(fe="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fe}function ve(e){return/^(html|body|#document)$/.test(Q(e))}function me(e){return J(e).getComputedStyle(e)}function he(e){return ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if("html"===Q(e))return e;const t=e.assignedSlot||e.parentNode||oe(e)&&e.host||ee(e);return oe(t)?t.host:t}function ye(e){const t=ge(e);return ve(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&ie(t)?t:ye(t)}function be(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ye(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=J(o);if(i){const e=xe(u);return t.concat(u,u.visualViewport||[],ie(o)?o:[],e&&n?be(e):[])}return t.concat(o,be(o,[],n))}function xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var we=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),Ee="undefined"==typeof Element,Re=Ee?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Oe=!Ee&&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},Ce=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):Ce(e.parentNode))},je=function(e,t,n){if(Ce(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(we));return t&&Re.call(e,we)&&r.unshift(e),r.filter(n)},_e=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!Ce(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,s=_e(c,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{Re.call(i,we)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!Ce(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=_e(!0===l?i.children:l.children,!0,n);n.flatten?r.push.apply(r,f):r.push({scopeParent:i,candidates:f})}else o.unshift.apply(o,i.children)}}return r},Se=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ke=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))&&!Se(e)?0:e.tabIndex},Ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Le=function(e){return"INPUT"===e.tagName},Te=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Pe=function(e,t){return!(t.disabled||function(e){return Le(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=Re.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Re.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Te(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,c=Oe(e);if(u&&!u.shadowRoot&&!0===r(u))return Te(e);e=e.assignedSlot?e.assignedSlot:u||c===e.ownerDocument?u:c.host}e=i}if(function(e){var t,n,r,o,i=e&&Oe(e),u=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&u;){var s,l,a;c=!(null===(l=u=null===(s=i=Oe(u))||void 0===s?void 0:s.host)||void 0===l||null===(a=l.ownerDocument)||void 0===a||!a.contains(u))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(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!!Re.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Me=function(e,t){return!(function(e){return function(e){return Le(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Oe(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)}(t)||ke(t)<0||!Pe(e,t))},De=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},$e=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,u=function(e,t){var n=ke(e);return n<0&&t&&!Se(e)?0:n}(i,o),c=o?$e(e.candidates):i;0===u?o?t.push.apply(t,c):t.push(i):n.push({documentOrder:r,tabIndex:u,item:e,isScope:o,content:c})}),n.sort(Ae).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Ie=function(e,t){var n;return n=(t=t||{}).getShadowRoot?_e([e],t.includeContainer,{filter:Me.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:De}):je(e,t.includeContainer,Me.bind(null,t)),$e(n)},Ne=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Re.call(e,we)&&Me(t,e)};function Fe(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function We(){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 He(){return/apple/i.test(navigator.vendor)}function ze(){const e=/android/i;return e.test(Fe())||e.test(We())}function Be(){return We().includes("jsdom/")}const Ue="data-floating-ui-focusable";function Ke(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 Ve(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&oe(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Xe(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 Ye(e){return(null==e?void 0:e.ownerDocument)||document}function Ge(e){return re(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ze(e){return!!e&&"combobox"===e.getAttribute("role")&&Ge(e)}function Qe(e){return e?e.hasAttribute(Ue)?e:e.querySelector("["+Ue+"]")||e:null}function Je(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...Je(e,t.id,n)])}function et(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function tt(e){e.preventDefault(),e.stopPropagation()}function nt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var rt="undefined"!=typeof document?A.useLayoutEffect:function(){};function ot(e){const t=A.useRef(e);return rt(()=>{t.current=e}),t}const it={...A}.useInsertionEffect||(e=>e());function ut(e){const t=A.useRef(()=>{});return it(()=>{t.current=e}),A.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)},[])}const ct=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function st(e,t){const n=Ie(e,ct()),r=n.length;if(0===r)return;const o=Ke(Ye(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function lt(e){return st(Ye(e).body,1)||e}function at(e){return st(Ye(e).body,-1)||e}function ft(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ve(n,r)}function dt(e){Ie(e,ct()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function pt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var vt=d(65);const mt=["start","end"],ht=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+mt[0],t+"-"+mt[1]),[]),gt=Math.min,yt=Math.max,bt=Math.round,xt=Math.floor,wt=e=>({x:e,y:e}),Et={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(e,t,n){return yt(e,gt(t,n))}function Ot(e,t){return"function"==typeof e?e(t):e}function Ct(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function _t(e){return"x"===e?"y":"x"}function St(e){return"y"===e?"height":"width"}function kt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function At(e){return _t(kt(e))}function Lt(e,t,n){void 0===n&&(n=!1);const r=jt(e),o=At(e),i=St(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=It(u)),[u,It(u)]}function Tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Pt=["left","right"],Mt=["right","left"],Dt=["top","bottom"],$t=["bottom","top"];function It(e){const t=Ct(e);return Et[t]+e.slice(t.length)}function Nt(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 Ft(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Wt(e,t,n){let{reference:r,floating:o}=e;const i=kt(t),u=At(t),c=St(u),s=Ct(t),l="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(s){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(jt(t)){case"start":p[u]-=d*(n&&l?-1:1);break;case"end":p[u]+=d*(n&&l?-1:1)}return p}async function Ht(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:u,elements:c,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Ot(t,e),v=Nt(p),m=c[d?"floating"===f?"reference":"floating":f],h=Ft(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(c.floating)),boundary:l,rootBoundary:a,strategy:s})),g="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.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=Ft(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:s}):g);return{top:(h.top-x.top+v.top)/b.y,bottom:(x.bottom-h.bottom+v.bottom)/b.y,left:(h.left-x.left+v.left)/b.x,right:(x.right-h.right+v.right)/b.x}}const zt=new Set(["left","top"]);function Bt(e){const t=me(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=re(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=bt(n)!==i||bt(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function Ut(e){return ne(e)?e:e.contextElement}function Kt(e){const t=Ut(e);if(!re(t))return wt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Bt(t);let u=(i?bt(n.width):n.width)/r,c=(i?bt(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Vt=wt(0);function qt(e){const t=J(e);return pe()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Vt}function Xt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ut(e);let u=wt(1);t&&(r?ne(r)&&(u=Kt(r)):u=Kt(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==J(e))&&t}(i,n,r)?qt(i):wt(0);let s=(o.left+c.x)/u.x,l=(o.top+c.y)/u.y,a=o.width/u.x,f=o.height/u.y;if(i){const e=J(i),t=r&&ne(r)?J(r):r;let n=e,o=xe(n);for(;o&&r&&t!==n;){const e=Kt(o),t=o.getBoundingClientRect(),r=me(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,l*=e.y,a*=e.x,f*=e.y,s+=i,l+=u,n=J(o),o=xe(n)}}return Ft({width:a,height:f,x:s,y:l})}function Yt(e,t){const n=he(e).scrollLeft;return t?t.left+n:Xt(ee(e)).left+n}function Gt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Yt(e,n),y:n.top+t.scrollTop}}function Zt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=J(e),r=ee(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,c=0,s=0;if(o){i=o.width,u=o.height;const e=pe();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}const l=Yt(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,u=Math.abs(r.clientWidth-t.clientWidth-o);u<=25&&(i-=u)}else l<=25&&(i+=l);return{width:i,height:u,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=ee(e),n=he(e),r=e.ownerDocument.body,o=yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Yt(e);const c=-n.scrollTop;return"rtl"===me(r).direction&&(u+=yt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}(ee(e));else if(ne(t))r=function(e,t){const n=Xt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=re(e)?Kt(e):wt(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=qt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ft(r)}function Qt(e,t){const n=ge(e);return!(n===t||!ne(n)||ve(n))&&("fixed"===me(n).position||Qt(n,t))}function Jt(e,t,n){const r=re(t),o=ee(t),i="fixed"===n,u=Xt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=wt(0);function l(){s.x=Yt(o)}if(r||!r&&!i)if(("body"!==Q(t)||ie(o))&&(c=he(t)),r){const e=Xt(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const a=!o||r||i?wt(0):Gt(o,c);return{x:u.left+c.scrollLeft-s.x-a.x,y:u.top+c.scrollTop-s.y-a.y,width:u.width,height:u.height}}function en(e){return"static"===me(e).position}function tn(e,t){if(!re(e)||"fixed"===me(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function nn(e,t){const n=J(e);if(ce(e))return n;if(!re(e)){let t=ge(e);for(;t&&!ve(t);){if(ne(t)&&!en(t))return t;t=ge(t)}return n}let r=tn(e,t);for(;r&&ue(r)&&en(r);)r=tn(r,t);return r&&ve(r)&&en(r)&&!de(r)?n:r||function(e){let t=ge(e);for(;re(t)&&!ve(t);){if(de(t))return t;if(ce(t))return null;t=ge(t)}return null}(e)||n}const rn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=ee(r),c=!!t&&ce(t.floating);if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=wt(1);const a=wt(0),f=re(r);if((f||!f&&!i)&&(("body"!==Q(r)||ie(u))&&(s=he(r)),f)){const e=Xt(r);l=Kt(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?wt(0):Gt(u,s);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+a.x+d.x,y:n.y*l.y-s.scrollTop*l.y+a.y+d.y}},getDocumentElement:ee,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ce(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=be(e,[],!1).filter(e=>ne(e)&&"body"!==Q(e)),o=null;const i="fixed"===me(e).position;let u=i?ge(e):e;for(;ne(u)&&!ve(u);){const t=me(u),n=de(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||ie(u)&&!n&&Qt(e,u))?r=r.filter(e=>e!==u):o=t,u=ge(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=Zt(t,i[0],o);let c=u.top,s=u.right,l=u.bottom,a=u.left;for(let e=1;e<i.length;e++){const n=Zt(t,i[e],o);c=yt(n.top,c),s=gt(n.right,s),l=gt(n.bottom,l),a=yt(n.left,a)}return{width:s-a,height:l-c,x:a,y:c}},getOffsetParent:nn,getElementRects:async function(e){const t=this.getOffsetParent||nn,n=this.getDimensions,r=await n(e.floating);return{reference:Jt(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}=Bt(e);return{width:t,height:n}},getScale:Kt,isElement:ne,isRTL:function(e){return"rtl"===me(e).direction}};function on(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const un=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:c,platform:s,elements:l}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...h}=Ot(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=Ct(o),y=kt(c),b=Ct(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(l.floating)),w=d||(b||!m?[It(c)]:function(e){const t=It(e);return[Tt(e),t,Tt(t)]}(c)),E="none"!==v;!d&&E&&w.push(...function(e,t,n,r){const o=jt(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Mt:Pt:t?Pt:Mt;case"left":case"right":return t?Dt:$t;default:return[]}}(Ct(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Tt)))),i}(c,m,v,x));const R=[c,...w],O=await s.detectOverflow(t,h),C=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&C.push(O[g]),f){const e=Lt(o,u,x);C.push(O[e[0]],O[e[1]])}if(j=[...j,{placement:o,overflows:C}],!C.every(e=>e<=0)){var _,S;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=R[e];if(t&&("alignment"!==f||y===kt(t)||j.every(e=>kt(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(S=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!n)switch(p){case"bestFit":{var k;const e=null==(k=j.filter(e=>{if(E){const t=kt(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:k[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},cn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:u,elements:c,middlewareData:s}=t,{element:l,padding:a=0}=Ot(e,t)||{};if(null==l)return{};const f=Nt(a),d={x:n,y:r},p=At(o),v=St(p),m=await u.getDimensions(l),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[v]+i.reference[p]-d[p]-i.floating[v],w=d[p]-i.reference[p],E=await(null==u.getOffsetParent?void 0:u.getOffsetParent(l));let R=E?E[b]:0;R&&await(null==u.isElement?void 0:u.isElement(E))||(R=c.floating[b]||i.floating[v]);const O=x/2-w/2,C=R/2-m[v]/2-1,j=gt(f[g],C),_=gt(f[y],C),S=j,k=R-m[v]-_,A=R/2-m[v]/2+O,L=Rt(S,A,k),T=!s.arrow&&null!=jt(o)&&A!==L&&i.reference[v]/2-(A<S?j:_)-m[v]/2<0,P=T?A<S?A-S:A-k:0;return{[p]:d[p]+P,data:{[p]:L,centerOffset:A-L-P,...T&&{alignmentOffset:P}},reset:T}}}),sn=(e,t,n)=>{const r=new Map,o={platform:rn,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,c=u.detectOverflow?u:{...u,detectOverflow:Ht},s=await(null==u.isRTL?void 0:u.isRTL(t));let l=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Wt(l,r,s),d=r,p=0;const v={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:h,fn:g}=m,{x:y,y:b,data:x,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:l,platform:c,elements:{reference:e,floating:t}});a=null!=y?y:a,f=null!=b?b:f,v[h]={...v[h],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(l=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Wt(l,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:v}})(e,t,{...o,platform:i})};var ln="undefined"!=typeof document?A.useLayoutEffect:function(){};function an(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(!an(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||an(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function fn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dn(e,t){const n=fn(e);return Math.round(t*n)/n}function pn(e){const t=A.useRef(e);return ln(()=>{t.current=e}),t}const vn="data-floating-ui-focusable",mn="active",hn="selected",gn={...A};let yn=!1,bn=0;const xn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+bn++,wn=gn.useId||function(){const[e,t]=A.useState(()=>yn?xn():void 0);return rt(()=>{null==e&&t(xn())},[]),A.useEffect(()=>{yn=!0},[]),e},En=A.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:u=14,height:c=7,tipRadius:s=0,strokeWidth:l=0,staticOffset:a,stroke:f,d,style:{transform:p,...v}={},...m}=e,h=wn(),[g,y]=A.useState(!1);if(rt(()=>{r&&"rtl"===me(r).direction&&y(!0)},[r]),!r)return null;const[b,x]=n.split("-"),w="top"===b||"bottom"===b;let E=a;(w&&null!=i&&i.x||!w&&null!=i&&i.y)&&(E=null);const R=2*l,O=R/2,C=u/2*(s/-8+1),j=c/2*s/4,_=!!d,S=E&&"end"===x?"bottom":"top";let L=E&&"end"===x?"right":"left";E&&g&&(L="end"===x?"left":"right");const T=null!=(null==o?void 0:o.x)?E||o.x:"",P=null!=(null==o?void 0:o.y)?E||o.y:"",M=d||"M0,0 H"+u+" L"+(u-C)+","+(c-j)+" Q"+u/2+","+c+" "+C+","+(c-j)+" Z",D={top:_?"rotate(180deg)":"",left:_?"rotate(90deg)":"rotate(-90deg)",bottom:_?"":"rotate(180deg)",right:_?"rotate(-90deg)":"rotate(90deg)"}[b];return(0,k.jsxs)("svg",{...m,"aria-hidden":!0,ref:t,width:_?u:u+R,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[L]:T,[S]:P,[b]:w||_?"100%":"calc(100% - "+R/2+"px)",transform:[D,p].filter(e=>!!e).join(" "),...v},children:[R>0&&(0,k.jsx)("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:R+(d?0:1),d:M}),(0,k.jsx)("path",{stroke:R&&!d?m.fill:"none",d:M}),(0,k.jsx)("clipPath",{id:h,children:(0,k.jsx)("rect",{x:-O,y:O*(_?-1:1),width:u+R,height:u})})]})});function Rn(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const On=A.createContext(null),Cn=A.createContext(null),jn=()=>{var e;return(null==(e=A.useContext(On))?void 0:e.id)||null},_n=()=>A.useContext(Cn);function Sn(e){const{children:t,id:n}=e,r=jn();return(0,k.jsx)(On.Provider,{value:A.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kn(e){const{children:t}=e,n=A.useRef([]),r=A.useCallback(e=>{n.current=[...n.current,e]},[]),o=A.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[i]=A.useState(()=>Rn());return(0,k.jsx)(Cn.Provider,{value:A.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i]),children:t})}function An(e){return"data-floating-ui-"+e}function Ln(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Tn=An("safe-polygon");function Pn(e,t,n){if(n&&!nt(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function Mn(e){return"function"==typeof e?e():e}let Dn=0;function $n(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Dn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Dn=requestAnimationFrame(i)}function In(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&oe(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Nn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Fn(e){return"inert"===e?Nn.inert:"aria-hidden"===e?Nn["aria-hidden"]:Nn.none}let Wn=new WeakSet,Hn={},zn=0;function Bn(e){return e?oe(e)?e.host:Bn(e.parentNode):null}const Un=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Bn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function Kn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=(o=e[0],(null==o?void 0:o.ownerDocument)||document).body;var o;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=Un(t,e),c=new Set,s=new Set(u),l=[];Hn[o]||(Hn[o]=new WeakMap);const a=Hn[o];return u.forEach(function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!s.has(t)&&[].forEach.call(t.children,t=>{if("script"!==Q(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Fn(i),u=(r.get(t)||0)+1,c=(a.get(t)||0)+1;r.set(t,u),a.set(t,c),l.push(t),1===u&&n&&Wn.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),c.clear(),zn++,()=>{l.forEach(e=>{const t=Fn(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!Wn.has(e)&&i&&e.removeAttribute(i),Wn.delete(e)),r||e.removeAttribute(o)}),zn--,zn||(Nn.inert=new WeakMap,Nn["aria-hidden"]=new WeakMap,Nn.none=new WeakMap,Wn=new WeakSet,Hn={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Vn={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},qn=A.forwardRef(function(e,t){const[n,r]=A.useState();rt(()=>{He()&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[An("focus-guard")]:"",style:Vn};return(0,k.jsx)("span",{...e,...o})}),Xn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Yn=A.createContext(null),Gn=An("portal");function Zn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=wn(),o=Qn(),[i,u]=A.useState(null),c=A.useRef(null);return rt(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{c.current=null})},[i]),rt(()=>{if(!r)return;if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(Gn,""),e.appendChild(n),c.current=n,u(n)},[t,r]),rt(()=>{if(null===n)return;if(!r)return;if(c.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!te(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const s=document.createElement("div");s.id=r,s.setAttribute(Gn,""),e=i||e,e.appendChild(s),c.current=s,u(s)},[t,n,r,o]),i}({id:n,root:r}),[u,c]=A.useState(null),s=A.useRef(null),l=A.useRef(null),a=A.useRef(null),f=A.useRef(null),d=null==u?void 0:u.modal,p=null==u?void 0:u.open,v=!!u&&!u.modal&&u.open&&o&&!(!r&&!i);return A.useEffect(()=>{if(i&&o&&!d)return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&ft(e)&&("focusin"===e.type?pt:dt)(i)}},[i,o,d]),A.useEffect(()=>{i&&(p||pt(i))},[p,i]),(0,k.jsxs)(Yn.Provider,{value:A.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:l,beforeInsideRef:a,afterInsideRef:f,portalNode:i,setFocusManagerState:c}),[o,i]),children:[v&&i&&(0,k.jsx)(qn,{"data-type":"outside",ref:s,onFocus:e=>{if(ft(e,i)){var t;null==(t=a.current)||t.focus()}else{const e=at(u?u.domReference:null);null==e||e.focus()}}}),v&&i&&(0,k.jsx)("span",{"aria-owns":i.id,style:Xn}),i&&vt.createPortal(t,i),v&&i&&(0,k.jsx)(qn,{"data-type":"outside",ref:l,onFocus:e=>{if(ft(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=lt(u?u.domReference:null);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Qn=()=>A.useContext(Yn);function Jn(e){return A.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let er=[];function tr(){er=er.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function nr(){tr();const e=er[er.length-1];return null==e?void 0:e.deref()}function rr(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=ct(),o=function(e,t){return(t=t||{}).getShadowRoot?_e([e],t.includeContainer,{filter:Pe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):je(e,t.includeContainer,Pe.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Ne(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==u&&e.setAttribute("tabindex","0"):("-1"!==u||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const or=A.forwardRef(function(e,t){return(0,k.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Vn})});function ir(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:u=0,returnFocus:c=!0,restoreFocus:s=!1,modal:l=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:v,onOpenChange:m,events:h,dataRef:g,elements:{domReference:y,floating:b}}=t,x=ut(()=>{var e;return null==(e=g.current.floatingContext)?void 0:e.nodeId}),w=ut(p),E="number"==typeof u&&u<0,R=Ze(y)&&E,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,C=!O||i,j=!C||O&&d,_=ot(o),S=ot(u),L=ot(c),T=_n(),P=Qn(),M=A.useRef(null),D=A.useRef(null),$=A.useRef(!1),I=A.useRef(!1),N=A.useRef(-1),F=A.useRef(-1),W=null!=P,H=Qe(b),z=ut(function(e){return void 0===e&&(e=H),e?Ie(e,ct()):[]}),B=ut(e=>{const t=z(e);return _.current.map(e=>y&&"reference"===e?y:H&&"floating"===e?H:t).filter(Boolean).flat()});A.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){Ve(H,Ke(Ye(H)))&&0===z().length&&!R&&tt(e);const t=B(),n=qe(e);"reference"===_.current[0]&&n===y&&(tt(e),e.shiftKey?$n(t[t.length-1]):$n(t[1])),"floating"===_.current[1]&&n===H&&e.shiftKey&&(tt(e),$n(t[0]))}}const t=Ye(H);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,y,H,l,_,R,z,B]),A.useEffect(()=>{if(!r&&b)return b.addEventListener("focusin",e),()=>{b.removeEventListener("focusin",e)};function e(e){const t=qe(e),n=z().indexOf(t);-1!==n&&(N.current=n)}},[r,b,z]),A.useEffect(()=>{if(r)return;if(!f)return;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=qe(e);queueMicrotask(()=>{const o=x(),i=!(Ve(y,t)||Ve(b,t)||Ve(t,b)||Ve(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(An("focus-guard"))||T&&(Je(T.nodesRef.current,o).find(e=>{var n,r;return Ve(null==(n=e.context)?void 0:n.elements.floating,t)||Ve(null==(r=e.context)?void 0:r.elements.domReference,t)})||et(T.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Qe(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===y&&H&&rr(H,_),s&&n!==y&&(null==r||!r.isConnected)&&Ke(Ye(H))===Ye(H).body){re(H)&&H.focus();const e=N.current,t=z(),n=t[e]||t[t.length-1]||H;re(n)&&n.focus()}g.current.insideReactTree?g.current.insideReactTree=!1:!R&&l||!t||!i||I.current||t===nr()||($.current=!0,m(!1,e,"focus-out"))})}const n=Boolean(!T&&P);function o(){Ln(F),g.current.insideReactTree=!0,F.current=window.setTimeout(()=>{g.current.insideReactTree=!1})}return b&&re(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),b.addEventListener("focusout",t),n&&b.addEventListener("focusout",o,!0),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),b.removeEventListener("focusout",t),n&&b.removeEventListener("focusout",o,!0)}):void 0},[r,y,b,H,l,T,P,m,f,s,z,R,x,_,g]);const U=A.useRef(null),K=A.useRef(null),V=Jn([U,null==P?void 0:P.beforeInsideRef]),q=Jn([K,null==P?void 0:P.afterInsideRef]);function X(e){return!r&&a&&l?(0,k.jsx)(or,{ref:"start"===e?M:D,onClick:e=>m(!1,e.nativeEvent),children:"string"==typeof a?a:"Dismiss"}):null}A.useEffect(()=>{var e,t;if(r)return;if(!b)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+An("portal")+"]"))||[]),o=null==(t=(T?et(T.nodesRef.current,x()):[]).find(e=>{var t;return Ze((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[b,o,...n,...w(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,_.current.includes("reference")||R?y:null].filter(e=>null!=e),u=l||R?Kn(i,!j,j):Kn(i);return()=>{u()}},[r,y,b,l,_,P,R,C,j,T,x,w]),rt(()=>{if(r||!re(H))return;const e=Ke(Ye(H));queueMicrotask(()=>{const t=B(H),n=S.current,r=("number"==typeof n?t[n]:n.current)||H,o=Ve(H,e);E||o||!v||$n(r,{preventScroll:r===H})})},[r,v,H,E,B,S]),rt(()=>{if(r||!H)return;const e=Ye(H);var t;function n(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&($.current=!0),"outside-press"===t)if(r)$.current=!1;else if(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(ze()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!Be()&&(!ze()&&0===e.width&&0===e.height||ze()&&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)}(n))$.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),$.current=!e}}t=Ke(e),tr(),t&&"body"!==Q(t)&&(er.push(new WeakRef(t)),er.length>20&&(er=er.slice(-20))),h.on("openchange",n);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,Vn),W&&y&&y.insertAdjacentElement("afterend",o),()=>{h.off("openchange",n);const t=Ke(e),r=Ve(b,t)||T&&Je(T.nodesRef.current,x(),!1).some(e=>{var n;return Ve(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof L.current){const e=y||nr();return e&&e.isConnected?e:o}return L.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=ct();return Ne(e,t)?e:Ie(e,t)[0]||e}(i);L.current&&!$.current&&re(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,b,H,L,g,h,T,W,y,x]),A.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(tr)}),[r]),rt(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:v,onOpenChange:m,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,l,v,m,f,y]),rt(()=>{r||H&&rr(H,_)},[r,H,_]);const Y=!r&&C&&(!l||!R)&&(W||l);return(0,k.jsxs)(k.Fragment,{children:[Y&&(0,k.jsx)(qn,{"data-type":"inside",ref:V,onFocus:e=>{if(l){const e=B();$n("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,ft(e,P.portalNode)){const e=lt(y);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!R&&X("start"),n,X("end"),Y&&(0,k.jsx)(qn,{"data-type":"inside",ref:q,onFocus:e=>{if(l)$n(B()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&($.current=!0),ft(e,P.portalNode)){const e=at(y);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function ur(e){return re(e.target)&&"BUTTON"===e.target.tagName}function cr(e){return Ge(e)}function sr(e){return null!=e&&null!=e.clientX}const lr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ar={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},fr=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 dr(){return Fe().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&He()}function pr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[mn]:t,[hn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[vn]:""},...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 u;o&&[mn,hn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.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 vr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),mr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function hr(e,t){return"function"==typeof e?e(t):e}function gr(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...gr(e,t.id,n)])}function yr(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,u=i-1;e<i;u=e++){const[i,c]=t[e]||[0,0],[s,l]=t[u]||[0,0];c>=r!=l>=r&&n<=(s-i)*(r-c)/(l-c)+i&&(o=!o)}return o}function br(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,u=null,c=null,s="undefined"!=typeof performance?performance.now():0;const l=e=>{let{x:n,y:l,placement:a,elements:f,onClose:d,nodeId:p,tree:v}=e;return function(e){function m(){Ln(o),d()}if(Ln(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:g}=e,y=[h,g],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=In(f.floating,b),E=In(f.domReference,b),R=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],j=n>O.right-O.width/2,_=l>O.bottom-O.height/2,S=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,R),k=O.width>R.width,A=O.height>R.height,L=(k?R:O).left,T=(k?R:O).right,P=(A?R:O).top,M=(A?R:O).bottom;if(w&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&ne(e.relatedTarget)&&In(f.floating,e.relatedTarget))return;if(v&&gr(v.nodesRef.current,p).length)return;if("top"===C&&l>=R.bottom-1||"bottom"===C&&l<=R.top+1||"left"===C&&n>=R.right-1||"right"===C&&n<=R.left+1)return m();let D=[];switch(C){case"top":D=[[L,R.top+1],[L,O.bottom-1],[T,O.bottom-1],[T,R.top+1]];break;case"bottom":D=[[L,O.top+1],[L,R.bottom-1],[T,R.bottom-1],[T,O.top+1]];break;case"left":D=[[O.right-1,M],[O.right-1,P],[R.left+1,P],[R.left+1,M]];break;case"right":D=[[R.right-1,M],[R.right-1,P],[O.left+1,P],[O.left+1,M]]}if(!yr([h,g],D)){if(i&&!S)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-s;if(null===u||null===c||0===r)return u=e,c=t,s=n,null;const o=e-u,i=t-c,l=Math.sqrt(o*o+i*i);return u=e,c=t,s=n,l/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}yr([h,g],function(e){let[n,r]=e;switch(C){case"top":return[[k?n+t/2:j?n+4*t:n-4*t,r+t+1],[k?n-t/2:j?n+4*t:n-4*t,r+t+1],[O.left,j||k?O.bottom-t:O.top],[O.right,j?k?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[k?n+t/2:j?n+4*t:n-4*t,r-t],[k?n-t/2:j?n+4*t:n-4*t,r-t],[O.left,j||k?O.top+t:O.bottom],[O.right,j?k?O.top+t:O.bottom:O.top+t]];case"left":{const e=[n+t+1,A?r+t/2:_?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:_?r+4*t:r-4*t];return[[_||A?O.right-t:O.left,O.top],[_?A?O.right-t:O.left:O.right-t,O.bottom],e,o]}case"right":return[[n-t,A?r+t/2:_?r+4*t:r-4*t],[n-t,A?r-t/2:_?r+4*t:r-4*t],[_||A?O.left+t:O.right,O.top],[_?A?O.left+t:O.right:O.left+t,O.bottom]]}}([n,l]))?!i&&r&&(o.current=window.setTimeout(m,40)):m()}}};return l.__options={blockPointerEvents:n},l}const xr=({children:e,enabled:t=!0,...n})=>{const r=jn();return!t||r?e:(0,k.jsx)(kn,{...n,children:e})},wr=l(S,({$width:e="max-content"})=>({$width:e}))``,Er=({children:e,enabled:t=!0,...n})=>t?(0,k.jsx)(Zn,{...n,children:e}):e;var Rr={551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,c,s,l,a=0,f=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,c=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===s)return function(e){return a=e,s=setTimeout(w,t),f?b(e):c}(l);if(d)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),c}return t=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),R.cancel=function(){void 0!==s&&clearTimeout(s),a=0,o=l=i=s=void 0},R.flush=function(){return void 0===s?c:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}}},Or={};function Cr(e){var t=Or[e];if(void 0!==t)return t.exports;var n=Or[e]={exports:{}};return Rr[e](n,n.exports,Cr),n.exports}Cr.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return Cr.d(t,{a:t}),t},Cr.d=(e,t)=>{for(var n in t)Cr.o(t,n)&&!Cr.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},Cr.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),Cr.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var jr=Cr(551);Cr.n(jr);const _r=(e,{enabled:t=!0,event:n="click",dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:u,clientPointsOptions:c,roleOptions:s,extraInteractions:l=[]})=>{const a=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:l="pointerdown",referencePress:a=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:v}=t,m=_n(),h=ut("function"==typeof s?s:()=>!1),g="function"==typeof s?h:s,y=A.useRef(!1),{escapeKey:b,outsidePress:x}=fr(p),{escapeKey:w,outsidePress:E}=fr(v),R=A.useRef(!1),O=ut(e=>{var t;if(!n||!u||!c||"Escape"!==e.key)return;if(R.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,s=m?Je(m.nodesRef.current,o):[];if(!b&&(e.stopPropagation(),s.length>0)){let e=!0;if(s.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),C=ut(e=>{var t;const n=()=>{var t;O(e),null==(t=qe(e))||t.removeEventListener("keydown",n)};null==(t=qe(e))||t.addEventListener("keydown",n)}),j=ut(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=y.current;if(y.current=!1,"click"===l&&u)return;if(n)return;if("function"==typeof g&&!g(e))return;const c=qe(e),s="["+An("inert")+"]",a=Ye(o.floating).querySelectorAll(s);let f=ne(c)?c:null;for(;f&&!ve(f);){const e=ge(f);if(ve(e)||!ne(e))break;f=e}if(a.length&&ne(c)&&!c.matches("html,body")&&!Ve(c,o.floating)&&Array.from(a).every(e=>!Ve(f,e)))return;if(re(c)&&k){const t=ve(c),n=me(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),u=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,s=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,l="rtl"===n.direction,a=s&&(l?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=u&&e.offsetY>c.clientHeight;if(a||f)return}const d=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=m&&Je(m.nodesRef.current,d).some(t=>{var n;return Xe(e,null==(n=t.context)?void 0:n.elements.floating)});if(Xe(e,o.floating)||Xe(e,o.domReference)||p)return;const v=m?Je(m.nodesRef.current,d):[];if(v.length>0){let e=!0;if(v.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),_=ut(e=>{var t;const n=()=>{var t;j(e),null==(t=qe(e))||t.removeEventListener(l,n)};null==(t=qe(e))||t.addEventListener(l,n)});A.useEffect(()=>{if(!n||!u)return;i.current.__escapeKeyBubbles=b,i.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function s(){window.clearTimeout(e),R.current=!0}function a(){e=window.setTimeout(()=>{R.current=!1},pe()?5:0)}const f=Ye(o.floating);c&&(f.addEventListener("keydown",w?C:O,w),f.addEventListener("compositionstart",s),f.addEventListener("compositionend",a)),g&&f.addEventListener(l,E?_:j,E);let p=[];return d&&(ne(o.domReference)&&(p=be(o.domReference)),ne(o.floating)&&(p=p.concat(be(o.floating))),!ne(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(be(o.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{c&&(f.removeEventListener("keydown",w?C:O,w),f.removeEventListener("compositionstart",s),f.removeEventListener("compositionend",a)),g&&f.removeEventListener(l,E?_:j,E),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,c,g,l,n,r,d,u,b,x,O,w,C,j,E,_]),A.useEffect(()=>{i.current.insideReactTree=!1},[i,g,l]);const S=A.useMemo(()=>({onKeyDown:O,...a&&{[lr[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[O,r,a,f]),k=A.useMemo(()=>{function e(e){0===e.button&&(y.current=!0)}return{onKeyDown:O,onMouseDown:e,onMouseUp:e,[ar[l]]:()=>{i.current.insideReactTree=!0}}},[O,l,i]);return A.useMemo(()=>u?{reference:S,floating:k}:{},[u,S,k])}(e,{escapeKey:!1,...r}),f=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:u=!0,event:c="click",toggle:s=!0,ignoreMouse:l=!1,keyboardHandlers:a=!0,stickIfOpen:f=!0}=t,d=A.useRef(),p=A.useRef(!1),v=A.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==c&&(nt(t,!0)&&l||(!n||!s||o.current.openEvent&&f&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===c&&d.current?d.current=void 0:nt(t,!0)&&l||(!n||!s||o.current.openEvent&&f&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!a||ur(e)||(" "!==e.key||cr(i)||(e.preventDefault(),p.current=!0),function(e){return re(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!a||ur(e)||cr(i)||" "===e.key&&p.current&&(p.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[o,i,c,l,a,r,n,f,s]);return A.useMemo(()=>u?{reference:v}:{},[u,v])}(e,{enabled:t&&"click"===n,...o}),d=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:u}=e,{enabled:c=!0,delay:s=0,handleClose:l=null,mouseOnly:a=!1,restMs:f=0,move:d=!0}=t,p=_n(),v=jn(),m=ot(l),h=ot(s),g=ot(n),y=ot(f),b=A.useRef(),x=A.useRef(-1),w=A.useRef(),E=A.useRef(-1),R=A.useRef(!0),O=A.useRef(!1),C=A.useRef(()=>{}),j=A.useRef(!1),_=ut(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});A.useEffect(()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(Ln(x),Ln(E),R.current=!0,j.current=!1)}},[c,i]),A.useEffect(()=>{if(!c)return;if(!m.current)return;if(!n)return;function e(e){_()&&r(!1,e,"hover")}const t=Ye(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,r,c,m,_]);const S=A.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Pn(h.current,"close",b.current);o&&!w.current?(Ln(x),x.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(Ln(x),r(!1,e,n))},[h,r]),k=ut(()=>{C.current(),w.current=void 0}),L=ut(()=>{if(O.current){const e=Ye(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Tn),O.current=!1}}),T=ut(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));A.useEffect(()=>{if(c&&ne(u.domReference)){const r=u.domReference,o=u.floating;return n&&r.addEventListener("mouseleave",i),d&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),o&&(o.addEventListener("mouseleave",i),o.addEventListener("mouseenter",s),o.addEventListener("mouseleave",l)),()=>{n&&r.removeEventListener("mouseleave",i),d&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),o&&(o.removeEventListener("mouseleave",i),o.removeEventListener("mouseenter",s),o.removeEventListener("mouseleave",l))}}function e(e){if(Ln(x),R.current=!1,a&&!nt(b.current)||Mn(y.current)>0&&!Pn(h.current,"open"))return;const t=Pn(h.current,"open",b.current);t?x.current=window.setTimeout(()=>{g.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(T())return void L();C.current();const t=Ye(u.floating);if(Ln(E),j.current=!1,m.current&&o.current.floatingContext){n||Ln(x),w.current=m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||S(e,!0,"safe-polygon")}});const r=w.current;return t.addEventListener("mousemove",r),void(C.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!Ve(u.floating,e.relatedTarget))&&S(e)}function i(e){T()||o.current.floatingContext&&(null==m.current||m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||S(e)}})(e))}function s(){Ln(x)}function l(e){T()||S(e,!1)}},[u,c,e,a,d,S,k,L,r,n,g,p,h,m,o,T,y]),rt(()=>{var e;if(c&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&_()){O.current=!0;const e=u.floating;if(ne(u.domReference)&&e){var t;const n=Ye(u.floating).body;n.setAttribute(Tn,"");const r=u.domReference,o=null==p||null==(t=p.nodesRef.current.find(e=>e.id===v))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[c,n,v,u,p,m,_]),rt(()=>{n||(b.current=void 0,j.current=!1,k(),L())},[n,k,L]),A.useEffect(()=>()=>{k(),Ln(x),Ln(E),L()},[c,u.domReference,k,L]);const P=A.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){R.current||g.current||r(!0,t,"hover")}a&&!nt(b.current)||n||0===Mn(y.current)||j.current&&e.movementX**2+e.movementY**2<2||(Ln(E),"touch"===b.current?o():(j.current=!0,E.current=window.setTimeout(o,Mn(y.current))))}}},[a,r,n,g,y]);return A.useMemo(()=>c?{reference:P}:{},[c,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:br(),...i}),p=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:u}=e,{enabled:c=!0,visibleOnly:s=!0}=t,l=A.useRef(!1),a=A.useRef(-1),f=A.useRef(!0);A.useEffect(()=>{if(!c)return;const e=J(u.domReference);function t(){!n&&re(u.domReference)&&u.domReference===Ke(Ye(u.domReference))&&(l.current=!0)}function r(){f.current=!0}function o(){f.current=!1}return e.addEventListener("blur",t),dr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),dr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[u.domReference,n,c]),A.useEffect(()=>{if(c)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(l.current=!0)}},[o,c]),A.useEffect(()=>()=>{Ln(a)},[]);const d=A.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;const t=qe(e.nativeEvent);if(s&&ne(t))if(dr()&&!e.relatedTarget){if(!f.current&&!Ge(t))return}else if(!function(e){if(!e||Be())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;r(!0,e.nativeEvent,"focus")},onBlur(e){l.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=ne(t)&&t.hasAttribute(An("focus-guard"))&&"outside"===t.getAttribute("data-type");a.current=window.setTimeout(()=>{var e;const c=Ke(u.domReference?u.domReference.ownerDocument:document);(t||c!==u.domReference)&&(Ve(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,c)||Ve(u.domReference,c)||o||r(!1,n,"focus"))})}}),[i,u.domReference,r,s]);return A.useMemo(()=>c?{reference:d}:{},[c,d])}(e,{enabled:t&&"focus"===n,...u}),v=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:u}=e,{enabled:c=!0,axis:s="both",x:l=null,y:a=null}=t,f=A.useRef(!1),d=A.useRef(null),[p,v]=A.useState(),[m,h]=A.useState([]),g=ut((e,t)=>{f.current||r.current.openEvent&&!sr(r.current.openEvent)||u.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const u=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,l=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let a=u.width,f=u.height,d=u.x,p=u.y;return null==n&&t.x&&c&&(n=u.x-t.x),null==r&&t.y&&s&&(r=u.y-t.y),d-=n||0,p-=r||0,a=0,f=0,!o||l?(a="y"===t.axis?u.width:0,f="x"===t.axis?u.height:0,d=c&&null!=t.x?t.x:d,p=s&&null!=t.y?t.y:p):o&&!l&&(f="x"===t.axis?u.height:f,a="y"===t.axis?u.width:a),o=!0,{width:a,height:f,x:d,y:p,top:p,right:d+a,bottom:p+f,left:d}}}}(i,{x:e,y:t,axis:s,dataRef:r,pointerType:p}))}),y=ut(e=>{null==l&&null==a&&(n?d.current||h([]):g(e.clientX,e.clientY))}),b=nt(p)?o:n,x=A.useCallback(()=>{if(!b||!c||null!=l||null!=a)return;const e=J(o);function t(n){const r=qe(n);Ve(o,r)?(e.removeEventListener("mousemove",t),d.current=null):g(n.clientX,n.clientY)}if(!r.current.openEvent||sr(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}u.setPositionReference(i)},[b,c,l,a,o,r,u,i,g]);A.useEffect(()=>x(),[x,m]),A.useEffect(()=>{c&&!o&&(f.current=!1)},[c,o]),A.useEffect(()=>{!c&&n&&(f.current=!0)},[c,n]),rt(()=>{!c||null==l&&null==a||(f.current=!1,g(l,a))},[c,l,a,g]);const w=A.useMemo(()=>{function e(e){let{pointerType:t}=e;v(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return A.useMemo(()=>c?{reference:w}:{},[c,w])}(e,{enabled:t&&"point"===n,...c}),m=function(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:u}=e,{enabled:c=!0,role:s="dialog"}=t,l=wn(),a=(null==(n=i.domReference)?void 0:n.id)||l,f=A.useMemo(()=>{var e;return(null==(e=Qe(i.floating))?void 0:e.id)||u},[i.floating,u]),d=null!=(r=vr.get(s))?r:s,p=null!=jn(),v=A.useMemo(()=>"tooltip"===d||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":o?f:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:a},..."menu"===d&&p&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[d,f,p,o,a,s]),m=A.useMemo(()=>{const e={id:f,...d&&{role:d}};return"tooltip"===d||"label"===s?e:{...e,..."menu"===d&&{"aria-labelledby":a}}},[d,f,a,s]),h=A.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:f+"-fui-option"}};switch(s){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[f,s]);return A.useMemo(()=>c?{reference:v,floating:m,item:h}:{},[c,v,m,h])}(e,s);return function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=A.useCallback(t=>pr(t,e,"reference"),t),i=A.useCallback(t=>pr(t,e,"floating"),n),u=A.useCallback(t=>pr(t,e,"item"),r);return A.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}([a,f,d,p,v,m,...l])},Sr=({enabled:e=!0,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s,open:l,floatingOptions:a,useOffset:f=!0,offsetOptions:d,useFlip:p=!0,flipOptions:v,useShift:m=!0,shiftOptions:g,useArrow:y=!1,arrowOptions:b,transitionOptions:x,useAutoPlacement:w=!1,autoPlacementOptions:E,useAutoUpdate:R=!1,autoUpdateOptions:O,useAutoSize:C=!1,sizeOptions:j,minAcceptableWidth:_=null,minAcceptableHeight:S=null,maxAcceptableWidth:k,maxAcceptableHeight:L,onOpen:T,onClose:P})=>{const{theme:M}=V(),D=function(){const e=wn(),t=_n(),n=jn();return rt(()=>{if(!e)return;const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}},[t,e,n]),e}(),[$,I]=(0,A.useState)(!1),N=(0,A.useRef)(null),F=e&&(l??$);(0,A.useEffect)(()=>{F&&T?.()},[F]),((e,t)=>{const n=(0,A.useRef)(e);(0,A.useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(e,e=>{e||I(!1)});const W=[];f&&W.push((e=>{const t=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:c}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=Ct(n),c=jt(n),s="y"===kt(n),l=zt.has(u)?-1:1,a=i&&s?-1:1,f=Ot(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof v&&(p="end"===c?-1*v:v),s?{x:p*a,y:d*l}:{x:d*l,y:p*a}}(t,e);return u===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:u}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(d??M.spacings.base));let H=null;if(w?W.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:u,placement:c,platform:s,elements:l}=t,{crossAxis:a=!1,alignment:f,allowedPlacements:d=ht,autoAlignment:p=!0,...v}=Ot(e,t),m=void 0!==f||d===ht?function(e,t,n){return(e?[...n.filter(t=>jt(t)===e),...n.filter(t=>jt(t)!==e)]:n.filter(e=>Ct(e)===e)).filter(n=>!e||jt(n)===e||!!t&&Tt(n)!==n)}(f||null,p,d):d,h=await s.detectOverflow(t,v),g=(null==(n=u.autoPlacement)?void 0:n.index)||0,y=m[g];if(null==y)return{};const b=Lt(y,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));if(c!==y)return{reset:{placement:m[0]}};const x=[h[Ct(y)],h[b[0]],h[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:y,overflows:x}],E=m[g+1];if(E)return{data:{index:g+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=jt(e.placement);return[e.placement,t&&a?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),O=R.filter(e=>e[2].slice(0,jt(e[0])?2:3).every(e=>e<=0)),C=(null==(o=O[0])?void 0:o[0])||R[0][0];return C!==c?{data:{index:g+1,overflows:w},reset:{placement:C}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(E)):p&&(H=(e=>{const t=un(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...v})),C){const e=(e=>{const t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:u,elements:c}=t,{apply:s=()=>{},...l}=Ot(e,t),a=await u.detectOverflow(t,l),f=Ct(o),d=jt(o),p="y"===kt(o),{width:v,height:m}=i.floating;let h,g;"top"===f||"bottom"===f?(h=f,g=d===(await(null==u.isRTL?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(g=f,h="end"===d?"top":"bottom");const y=m-a.top-a.bottom,b=v-a.left-a.right,x=gt(m-a[h],y),w=gt(v-a[g],b),E=!t.middlewareData.shift;let R=x,O=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(O=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(R=y),E&&!d){const e=yt(a.left,0),t=yt(a.right,0),n=yt(a.top,0),r=yt(a.bottom,0);p?O=v-2*(0!==e||0!==t?e+t:yt(a.left,a.right)):R=m-2*(0!==n||0!==r?n+r:yt(a.top,a.bottom))}await s({...t,availableWidth:O,availableHeight:R});const C=await u.getDimensions(c.floating);return v!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({...j,apply({elements:e,rects:t,availableWidth:n,availableHeight:r}){const o=h(_)?_(t.reference):_??t.reference.width,i=h(k)?k(t.reference):Math.min(n,k??1/0),u=h(S)?S(t.reference):S??0,c=h(L)?L(t.reference):Math.min(r,L??1/0);Object.assign(e.floating.style,{minWidth:`${Math.min(o,i)}px`,maxWidth:`${i}px`,minHeight:`${Math.min(u,c)}px`,maxHeight:`${c}px`})}});H?"initialPlacement"===v?.fallbackStrategy?W.push(e,H):W.push(H,e):W.push(e)}else H&&W.push(H);m&&W.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:u=!0,crossAxis:c=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ot(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=kt(Ct(o)),p=_t(d);let v=a[p],m=a[d];if(u){const e="y"===p?"bottom":"right";v=Rt(v+f["y"===p?"top":"left"],v,v-f[e])}if(c){const e="y"===d?"bottom":"right";m=Rt(m+f["y"===d?"top":"left"],m,m-f[e])}const h=s.fn({...t,[p]:v,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:u,[d]:c}}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({padding:M.spacings.base,...g})),y&&W.push(((e,t)=>{const n=(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?cn({element:n.current,padding:r}).fn(t):{}:n?cn({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}})({element:N,padding:M.spacings.base,...b}));const z=function(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=wn(),i=A.useRef({}),[u]=A.useState(()=>Rn()),c=null!=jn(),[s,l]=A.useState(r.reference),a=ut((e,t,r)=>{i.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:r,nested:c}),null==n||n(e,t,r)}),f=A.useMemo(()=>({setPositionReference:l}),[]),d=A.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return A.useMemo(()=>({dataRef:i,open:t,onOpenChange:a,elements:d,events:u,floatingId:o,refs:f}),[t,a,d,u,o,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,u]=A.useState(null),[c,s]=A.useState(null),l=(null==o?void 0:o.domReference)||i,a=A.useRef(null),f=_n();rt(()=>{l&&(a.current=l)},[l]);const d=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:u}={},transform:c=!0,whileElementsMounted:s,open:l}=e,[a,f]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=A.useState(r);an(d,r)||p(r);const[v,m]=A.useState(null),[h,g]=A.useState(null),y=A.useCallback(e=>{e!==E.current&&(E.current=e,m(e))},[]),b=A.useCallback(e=>{e!==R.current&&(R.current=e,g(e))},[]),x=i||v,w=u||h,E=A.useRef(null),R=A.useRef(null),O=A.useRef(a),C=null!=s,j=pn(s),_=pn(o),S=pn(l),k=A.useCallback(()=>{if(!E.current||!R.current)return;const e={placement:t,strategy:n,middleware:d};_.current&&(e.platform=_.current),sn(E.current,R.current,e).then(e=>{const t={...e,isPositioned:!1!==S.current};L.current&&!an(O.current,t)&&(O.current=t,vt.flushSync(()=>{f(t)}))})},[d,t,n,_,S]);ln(()=>{!1===l&&O.current.isPositioned&&(O.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);const L=A.useRef(!1);ln(()=>(L.current=!0,()=>{L.current=!1}),[]),ln(()=>{if(x&&(E.current=x),w&&(R.current=w),x&&w){if(j.current)return j.current(x,w,k);k()}},[x,w,k,j,C]);const T=A.useMemo(()=>({reference:E,floating:R,setReference:y,setFloating:b}),[y,b]),P=A.useMemo(()=>({reference:x,floating:w}),[x,w]),M=A.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=dn(P.floating,a.x),r=dn(P.floating,a.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...fn(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,P.floating,a.x,a.y]);return A.useMemo(()=>({...a,update:k,refs:T,elements:P,floatingStyles:M}),[a,k,T,P,M])}({...e,elements:{...o,...c&&{reference:c}}}),p=A.useCallback(e=>{const t=ne(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),d.refs.setReference(t)},[d.refs]),v=A.useCallback(e=>{(ne(e)||null===e)&&(a.current=e,u(e)),(ne(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!ne(e))&&d.refs.setReference(e)},[d.refs]),m=A.useMemo(()=>({...d.refs,setReference:v,setPositionReference:p,domReference:a}),[d.refs,v,p]),h=A.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),g=A.useMemo(()=>({...d,...r,refs:m,elements:h,nodeId:t}),[d,m,h,t,r]);return rt(()=>{r.dataRef.current.floatingContext=g;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=g)}),A.useMemo(()=>({...d,context:g,refs:m,elements:h}),[d,m,h,g])}({nodeId:D,open:F,middleware:W,onOpenChange:(e,t,n)=>{I(e),e||P?.(n,t)},...R&&{whileElementsMounted:(e,t,n)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,l=Ut(e),a=o||i?[...l?be(l):[],...t?be(t):[]]:[];a.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const f=l&&c?function(e,t){let n,r=null;const o=ee(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function u(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const l=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=l;if(c||t(),!d||!p)return;const v={rootMargin:-xt(f)+"px "+-xt(o.clientWidth-(a+d))+"px "+-xt(o.clientHeight-(f+p))+"px "+-xt(a)+"px",threshold:yt(0,gt(1,s))||1};let m=!0;function h(t){const r=t[0].intersectionRatio;if(r!==s){if(!m)return u();r?u(!1,r):n=setTimeout(()=>{u(!1,1e-7)},1e3)}1!==r||on(l,e.getBoundingClientRect())||u(),m=!1}try{r=new IntersectionObserver(h,{...v,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,v)}r.observe(e)}(!0),i}(l,n):null;let d,p=-1,v=null;u&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),l&&!s&&v.observe(l),t&&v.observe(t));let m=s?Xt(e):null;return s&&function t(){const r=Xt(e);m&&!on(m,r)&&n(),m=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;a.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=v)||e.disconnect(),v=null,s&&cancelAnimationFrame(d)}}(e,t,n,O)},...a}),B=_r(z.context,{enabled:e,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s}),U=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:u=250}=t,c=e.placement,s=c.split("-")[0],l=A.useMemo(()=>({side:s,placement:c}),[s,c]),a="number"==typeof u,f=(a?u:u.open)||0,d=(a?u:u.close)||0,[p,v]=A.useState(()=>({...hr(i,l),...hr(n,l)})),{isMounted:m,status:h}=function(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,[u,c]=A.useState("unmounted"),s=function(e,t){const[n,r]=A.useState(e);return e&&!n&&r(!0),A.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,i);return s||"close"!==u||c("unmounted"),rt(()=>{if(r){if(n){c("initial");const e=requestAnimationFrame(()=>{vt.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(e)}}c("close")}},[n,r]),{isMounted:s,status:u}}(e,{duration:u}),g=ot(n),y=ot(r),b=ot(o),x=ot(i);return rt(()=>{const e=hr(g.current,l),t=hr(b.current,l),n=hr(x.current,l),r=hr(y.current,l)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===h&&v(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===h&&v({transitionProperty:Object.keys(r).map(mr).join(","),transitionDuration:f+"ms",...n,...r}),"close"===h){const r=t||e;v({transitionProperty:Object.keys(r).map(mr).join(","),transitionDuration:d+"ms",...n,...r})}},[d,b,g,y,x,f,h,l]),{isMounted:m,styles:p}}(z.context,{duration:250,...x});return{nodeId:D,isOpen:F,floating:z,arrowRef:N,interactions:B,transition:U}},kr=()=>{const e=(0,A.useContext)(G);return m(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},Ar=({children:e,referenceProps:t,content:n,contentProps:r,focusManagerProps:o,arrowProps:i,portalProps:u,adjustStyles:c,context:s,...l})=>{const{useArrow:a,onClose:f}=l,{nodeId:d,floating:p,isOpen:v,arrowRef:m,interactions:h,transition:y}=Sr(l),b=(0,A.useCallback)(()=>{f?.("escape-key")},[f]),x=(0,A.useMemo)(()=>({context:s,floatingContext:p.context}),[s,p.context]);return(0,k.jsx)(wr,{ref:p.refs.setReference,...h.getReferenceProps(),...t,"data-testid":"honey-popup",children:(0,k.jsxs)(G,{value:x,children:[g(e,x),(0,k.jsx)(Sn,{id:d,children:y.isMounted&&(0,k.jsx)(Er,{...u,children:(0,k.jsx)(ir,{context:p.context,disabled:!v,...o,children:(0,k.jsx)(Y,{ref:p.refs.setFloating,active:v,style:c?.({...p.floatingStyles,...y.styles},{middlewareData:p.middlewareData})??{...p.floatingStyles,...y.styles},onDeactivate:b,...h.getFloatingProps(),...r,"data-testid":"honey-popup-floating-content",children:(0,k.jsxs)(k.Fragment,{children:[a&&(0,k.jsx)(En,{ref:m,context:p.context,fill:"white",...i}),g(n,x)]})})})})})]})})},Lr=({useTree:e=!1,...t})=>(0,k.jsx)(xr,{enabled:e,children:(0,k.jsx)(Ar,{...t})}),Tr=({option:e,...t})=>{const{context:n,floatingContext:r}=kr();return(0,k.jsx)(C,{onClick:()=>{e.onClick?.({context:n,floatingContext:r})},...t,children:e.label})},Pr=({options:e,optionProps:t,floatingOptions:n,...r})=>{const{contentProps:o}=r,{context:i,floatingContext:u}=kr(),c=(0,A.useMemo)(()=>e?.filter(e=>"function"==typeof e.visible?e.visible({context:i,floatingContext:u}):!1!==e.visible),[e]);return(0,k.jsx)(W,{items:c,itemKey:"id",emptyContent:"No options",children:e=>e.options?.length?(0,k.jsx)(Lr,{context:i,content:(0,k.jsx)(Pr,{options:e.options,optionProps:t,contentProps:o}),event:"hover",referenceProps:{$width:"100%"},floatingOptions:{placement:"right-start",...n},useArrow:!0,...r,children:(0,k.jsx)(Tr,{option:e,...t,children:e.label})}):(0,k.jsx)(Tr,{option:e,...t})})},Mr=({children:e,subProps:t,options:n,optionProps:r,clickOptions:o,context:i,...u})=>{const{contentProps:c}=u;return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(Lr,{context:i,content:(0,k.jsx)(Pr,{options:n,optionProps:r,contentProps:c,...t}),clickOptions:{toggle:!1,...o},useArrow:!0,...u,children:e})})},Dr=(0,A.createContext)(void 0),$r=()=>{const e=(0,A.useContext)(Dr);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component."),e},Ir=({children:e})=>{const t=(0,A.useContext)(Dr),[n,r]=(0,A.useState)([]),o=(0,A.useMemo)(()=>({layers:n,registerLayer:e=>{const t=y();return r(n=>[...n,{id:t,payload:e}]),t},unregisterLayer:e=>{r(t=>t.filter(t=>t.id!==e))},getLayerIndex:e=>n.findIndex(t=>t.id===e)}),[n]);return t?e:(0,k.jsx)(Dr,{value:o,children:e})},Nr=({children:e,theme:t,mediaQueryOptions:r,...o})=>{const i=U(t,r),{overlays:u,registerOverlay:c,unregisterOverlay:s}=(()=>{const e=(0,A.useRef)([]);(0,A.useEffect)(()=>{const t=t=>{const n=e.current;n.length&&n[n.length-1].notifyListeners("keyup",t.code,t)};return document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}},[]);const t=(0,A.useCallback)(t=>{const n=t.id??y(),r=[["keyup",t.onKeyUp]],o={current:null},i={containerRef:o,id:n,setContainerRef:e=>{o.current=e},addListener:(e,t)=>{r.push([e,t])},removeListener:(e,t)=>{const n=r.findIndex(([n,r])=>n===e&&r===t);-1!==n&&r.splice(n,1)},notifyListeners:(e,n,o)=>{const u=t.listenKeys??[];u.length&&!u.includes(n)||(o.preventDefault(),r.forEach(([t,r])=>{t===e&&r(n,i,o)}))}};return e.current.push(i),i},[]),n=(0,A.useCallback)(t=>{e.current=e.current.filter(e=>e.id!==t)},[]);return{overlays:e.current,registerOverlay:t,unregisterOverlay:n}})(),l=(0,A.useMemo)(()=>({theme:t,screenState:i,overlays:u,registerOverlay:c,unregisterOverlay:s}),[t,i,u]);return(0,k.jsx)(n,{theme:t,...o,children:(0,k.jsx)(K,{value:l,children:e})})};var Fr=d(117),Wr=d.n(Fr);const Hr=({theme:e,...t})=>{const r=(0,A.useContext)(K),o=(0,A.useMemo)(()=>Wr()(r?.theme,e),[r?.theme,e]);return(0,k.jsx)(n,{theme:o,...t})},zr=({durationMs:e,timingFunction:t="ease-in-out",extraProperties:n=[],activeClassName:o})=>({active:i=!1})=>r`
36
+ `,M=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:o=!0,applyColumnMaxWidth:i=!1,...u})=>{const c=(0,A.useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}),[n,r,o,i]);return(0,k.jsx)(L,{value:c,children:(0,k.jsx)(P,{ref:e,spacing:r,"data-testid":"honey-grid",...u,children:t})})},D=()=>{const e=(0,A.useContext)(L);if(!e)throw new Error("The `useHoneyGridContext()` hook can only be used inside <HoneyGrid/> component!");return e},$=({children:e,...t})=>{const{columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}=D();return(0,k.jsx)(T,{columns:n,spacing:r,applyMaxWidth:i,$flexGrow:o?1:0,"data-testid":"honey-grid-column",...t,children:e})},I=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,N=({children:e,loading:t=!1,loadingOverContent:n=!1,error:r=!1,empty:o=!1,loadingContent:i=null,errorContent:u=null,emptyContent:c=null})=>r?u:!n&&t?i:(0,k.jsxs)(k.Fragment,{children:[n&&t&&i,o?c:e]}),F=l(S,({$overflow:e="hidden auto"})=>({$overflow:e}))``,W=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s=!1,emptyContent:l,...a})=>(0,k.jsx)(F,{role:"list","aria-busy":r,"data-testid":"honey-list",...a,children:(0,k.jsx)(N,{loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s||0===t?.length,emptyContent:l,children:t?.map((t,r,o)=>(0,k.jsx)(A.Fragment,{children:e(t,r,o)},String(I(t,n,r))))})}),H=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,u]=(0,A.useState)(r||t),c=(0,A.useRef)(void 0);return(0,A.useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(c.current),u(!0),()=>{o||(c.current=setTimeout(()=>u(!1),n))}},[t,r,n]),i?e:null};var z=d(551),B=d.n(z);const U=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,A.useState)(()=>({...R(e.breakpoints),...n}));return(0,A.useEffect)(()=>{const r=B()(()=>{o({...R(e.breakpoints),...n})},t);return r(),window.addEventListener("resize",r),window.screen.orientation.addEventListener("change",r),()=>{r.cancel(),window.removeEventListener("resize",r),window.screen.orientation.removeEventListener("change",r)}},[]),r},K=(0,A.createContext)(void 0),V=()=>{const e=(0,A.useContext)(K);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},q=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=V(),o=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},X=(e,{onKeyUp:t}={})=>{const{overlays:n}=V(),r=n.find(t=>t.id===e);return(0,A.useEffect)(()=>{if(r&&t)return r.addListener("keyup",t),()=>{r.removeListener("keyup",t)}},[r,t]),r},Y=({ref:e,children:t,active:n,overlayId:r,onDeactivate:o,...i})=>{const u=q(n,{id:r,onKeyUp:(0,A.useCallback)(e=>{"Escape"===e&&o()},[o])}),c=b(u?.setContainerRef,e);return(0,k.jsx)(S,{ref:c,inert:!n,...i,children:g(t,{overlay:u,deactivateOverlay:o})})},G=(0,A.createContext)(void 0);function Z(){return"undefined"!=typeof window}function Q(e){return te(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ee(e){var t;return null==(t=(te(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function te(e){return!!Z()&&(e instanceof Node||e instanceof J(e).Node)}function ne(e){return!!Z()&&(e instanceof Element||e instanceof J(e).Element)}function re(e){return!!Z()&&(e instanceof HTMLElement||e instanceof J(e).HTMLElement)}function oe(e){return!(!Z()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof J(e).ShadowRoot)}function ie(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function ue(e){return/^(table|td|th)$/.test(Q(e))}function ce(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const se=/transform|translate|scale|rotate|perspective|filter/,le=/paint|layout|strict|content/,ae=e=>!!e&&"none"!==e;let fe;function de(e){const t=ne(e)?me(e):e;return ae(t.transform)||ae(t.translate)||ae(t.scale)||ae(t.rotate)||ae(t.perspective)||!pe()&&(ae(t.backdropFilter)||ae(t.filter))||se.test(t.willChange||"")||le.test(t.contain||"")}function pe(){return null==fe&&(fe="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),fe}function ve(e){return/^(html|body|#document)$/.test(Q(e))}function me(e){return J(e).getComputedStyle(e)}function he(e){return ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if("html"===Q(e))return e;const t=e.assignedSlot||e.parentNode||oe(e)&&e.host||ee(e);return oe(t)?t.host:t}function ye(e){const t=ge(e);return ve(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&ie(t)?t:ye(t)}function be(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ye(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=J(o);if(i){const e=xe(u);return t.concat(u,u.visualViewport||[],ie(o)?o:[],e&&n?be(e):[])}return t.concat(o,be(o,[],n))}function xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var we=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),Ee="undefined"==typeof Element,Re=Ee?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Oe=!Ee&&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},Ce=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):Ce(e.parentNode))},je=function(e,t,n){if(Ce(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(we));return t&&Re.call(e,we)&&r.unshift(e),r.filter(n)},_e=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!Ce(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,s=_e(c,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{Re.call(i,we)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!Ce(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=_e(!0===l?i.children:l.children,!0,n);n.flatten?r.push.apply(r,f):r.push({scopeParent:i,candidates:f})}else o.unshift.apply(o,i.children)}}return r},Se=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ke=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))&&!Se(e)?0:e.tabIndex},Ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Le=function(e){return"INPUT"===e.tagName},Te=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Pe=function(e,t){return!(t.disabled||function(e){return Le(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=Re.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Re.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Te(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,c=Oe(e);if(u&&!u.shadowRoot&&!0===r(u))return Te(e);e=e.assignedSlot?e.assignedSlot:u||c===e.ownerDocument?u:c.host}e=i}if(function(e){var t,n,r,o,i=e&&Oe(e),u=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&u;){var s,l,a;c=!(null===(l=u=null===(s=i=Oe(u))||void 0===s?void 0:s.host)||void 0===l||null===(a=l.ownerDocument)||void 0===a||!a.contains(u))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(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!!Re.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Me=function(e,t){return!(function(e){return function(e){return Le(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Oe(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)}(t)||ke(t)<0||!Pe(e,t))},De=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},$e=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,u=function(e,t){var n=ke(e);return n<0&&t&&!Se(e)?0:n}(i,o),c=o?$e(e.candidates):i;0===u?o?t.push.apply(t,c):t.push(i):n.push({documentOrder:r,tabIndex:u,item:e,isScope:o,content:c})}),n.sort(Ae).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Ie=function(e,t){var n;return n=(t=t||{}).getShadowRoot?_e([e],t.includeContainer,{filter:Me.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:De}):je(e,t.includeContainer,Me.bind(null,t)),$e(n)},Ne=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Re.call(e,we)&&Me(t,e)};function Fe(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function We(){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 He(){return/apple/i.test(navigator.vendor)}function ze(){const e=/android/i;return e.test(Fe())||e.test(We())}function Be(){return We().includes("jsdom/")}const Ue="data-floating-ui-focusable";function Ke(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 Ve(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&oe(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Xe(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 Ye(e){return(null==e?void 0:e.ownerDocument)||document}function Ge(e){return re(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ze(e){return!!e&&"combobox"===e.getAttribute("role")&&Ge(e)}function Qe(e){return e?e.hasAttribute(Ue)?e:e.querySelector("["+Ue+"]")||e:null}function Je(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...Je(e,t.id,n)])}function et(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function tt(e){e.preventDefault(),e.stopPropagation()}function nt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var rt="undefined"!=typeof document?A.useLayoutEffect:function(){};function ot(e){const t=A.useRef(e);return rt(()=>{t.current=e}),t}const it={...A}.useInsertionEffect||(e=>e());function ut(e){const t=A.useRef(()=>{});return it(()=>{t.current=e}),A.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)},[])}const ct=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function st(e,t){const n=Ie(e,ct()),r=n.length;if(0===r)return;const o=Ke(Ye(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function lt(e){return st(Ye(e).body,1)||e}function at(e){return st(Ye(e).body,-1)||e}function ft(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ve(n,r)}function dt(e){Ie(e,ct()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function pt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var vt=d(163);const mt=["start","end"],ht=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+mt[0],t+"-"+mt[1]),[]),gt=Math.min,yt=Math.max,bt=Math.round,xt=Math.floor,wt=e=>({x:e,y:e}),Et={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(e,t,n){return yt(e,gt(t,n))}function Ot(e,t){return"function"==typeof e?e(t):e}function Ct(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function _t(e){return"x"===e?"y":"x"}function St(e){return"y"===e?"height":"width"}function kt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function At(e){return _t(kt(e))}function Lt(e,t,n){void 0===n&&(n=!1);const r=jt(e),o=At(e),i=St(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=It(u)),[u,It(u)]}function Tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Pt=["left","right"],Mt=["right","left"],Dt=["top","bottom"],$t=["bottom","top"];function It(e){const t=Ct(e);return Et[t]+e.slice(t.length)}function Nt(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 Ft(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Wt(e,t,n){let{reference:r,floating:o}=e;const i=kt(t),u=At(t),c=St(u),s=Ct(t),l="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(s){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(jt(t)){case"start":p[u]-=d*(n&&l?-1:1);break;case"end":p[u]+=d*(n&&l?-1:1)}return p}async function Ht(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:u,elements:c,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Ot(t,e),v=Nt(p),m=c[d?"floating"===f?"reference":"floating":f],h=Ft(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(c.floating)),boundary:l,rootBoundary:a,strategy:s})),g="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.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=Ft(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:s}):g);return{top:(h.top-x.top+v.top)/b.y,bottom:(x.bottom-h.bottom+v.bottom)/b.y,left:(h.left-x.left+v.left)/b.x,right:(x.right-h.right+v.right)/b.x}}const zt=new Set(["left","top"]);function Bt(e){const t=me(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=re(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=bt(n)!==i||bt(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function Ut(e){return ne(e)?e:e.contextElement}function Kt(e){const t=Ut(e);if(!re(t))return wt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Bt(t);let u=(i?bt(n.width):n.width)/r,c=(i?bt(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Vt=wt(0);function qt(e){const t=J(e);return pe()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Vt}function Xt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ut(e);let u=wt(1);t&&(r?ne(r)&&(u=Kt(r)):u=Kt(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==J(e))&&t}(i,n,r)?qt(i):wt(0);let s=(o.left+c.x)/u.x,l=(o.top+c.y)/u.y,a=o.width/u.x,f=o.height/u.y;if(i){const e=J(i),t=r&&ne(r)?J(r):r;let n=e,o=xe(n);for(;o&&r&&t!==n;){const e=Kt(o),t=o.getBoundingClientRect(),r=me(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,l*=e.y,a*=e.x,f*=e.y,s+=i,l+=u,n=J(o),o=xe(n)}}return Ft({width:a,height:f,x:s,y:l})}function Yt(e,t){const n=he(e).scrollLeft;return t?t.left+n:Xt(ee(e)).left+n}function Gt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Yt(e,n),y:n.top+t.scrollTop}}function Zt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=J(e),r=ee(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,c=0,s=0;if(o){i=o.width,u=o.height;const e=pe();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}const l=Yt(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,u=Math.abs(r.clientWidth-t.clientWidth-o);u<=25&&(i-=u)}else l<=25&&(i+=l);return{width:i,height:u,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=ee(e),n=he(e),r=e.ownerDocument.body,o=yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Yt(e);const c=-n.scrollTop;return"rtl"===me(r).direction&&(u+=yt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}(ee(e));else if(ne(t))r=function(e,t){const n=Xt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=re(e)?Kt(e):wt(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=qt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ft(r)}function Qt(e,t){const n=ge(e);return!(n===t||!ne(n)||ve(n))&&("fixed"===me(n).position||Qt(n,t))}function Jt(e,t,n){const r=re(t),o=ee(t),i="fixed"===n,u=Xt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=wt(0);function l(){s.x=Yt(o)}if(r||!r&&!i)if(("body"!==Q(t)||ie(o))&&(c=he(t)),r){const e=Xt(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const a=!o||r||i?wt(0):Gt(o,c);return{x:u.left+c.scrollLeft-s.x-a.x,y:u.top+c.scrollTop-s.y-a.y,width:u.width,height:u.height}}function en(e){return"static"===me(e).position}function tn(e,t){if(!re(e)||"fixed"===me(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function nn(e,t){const n=J(e);if(ce(e))return n;if(!re(e)){let t=ge(e);for(;t&&!ve(t);){if(ne(t)&&!en(t))return t;t=ge(t)}return n}let r=tn(e,t);for(;r&&ue(r)&&en(r);)r=tn(r,t);return r&&ve(r)&&en(r)&&!de(r)?n:r||function(e){let t=ge(e);for(;re(t)&&!ve(t);){if(de(t))return t;if(ce(t))return null;t=ge(t)}return null}(e)||n}const rn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=ee(r),c=!!t&&ce(t.floating);if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=wt(1);const a=wt(0),f=re(r);if((f||!f&&!i)&&(("body"!==Q(r)||ie(u))&&(s=he(r)),f)){const e=Xt(r);l=Kt(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?wt(0):Gt(u,s);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+a.x+d.x,y:n.y*l.y-s.scrollTop*l.y+a.y+d.y}},getDocumentElement:ee,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ce(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=be(e,[],!1).filter(e=>ne(e)&&"body"!==Q(e)),o=null;const i="fixed"===me(e).position;let u=i?ge(e):e;for(;ne(u)&&!ve(u);){const t=me(u),n=de(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||ie(u)&&!n&&Qt(e,u))?r=r.filter(e=>e!==u):o=t,u=ge(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=Zt(t,i[0],o);let c=u.top,s=u.right,l=u.bottom,a=u.left;for(let e=1;e<i.length;e++){const n=Zt(t,i[e],o);c=yt(n.top,c),s=gt(n.right,s),l=gt(n.bottom,l),a=yt(n.left,a)}return{width:s-a,height:l-c,x:a,y:c}},getOffsetParent:nn,getElementRects:async function(e){const t=this.getOffsetParent||nn,n=this.getDimensions,r=await n(e.floating);return{reference:Jt(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}=Bt(e);return{width:t,height:n}},getScale:Kt,isElement:ne,isRTL:function(e){return"rtl"===me(e).direction}};function on(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const un=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:c,platform:s,elements:l}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...h}=Ot(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=Ct(o),y=kt(c),b=Ct(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(l.floating)),w=d||(b||!m?[It(c)]:function(e){const t=It(e);return[Tt(e),t,Tt(t)]}(c)),E="none"!==v;!d&&E&&w.push(...function(e,t,n,r){const o=jt(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Mt:Pt:t?Pt:Mt;case"left":case"right":return t?Dt:$t;default:return[]}}(Ct(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Tt)))),i}(c,m,v,x));const R=[c,...w],O=await s.detectOverflow(t,h),C=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&C.push(O[g]),f){const e=Lt(o,u,x);C.push(O[e[0]],O[e[1]])}if(j=[...j,{placement:o,overflows:C}],!C.every(e=>e<=0)){var _,S;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=R[e];if(t&&("alignment"!==f||y===kt(t)||j.every(e=>kt(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(S=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!n)switch(p){case"bestFit":{var k;const e=null==(k=j.filter(e=>{if(E){const t=kt(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:k[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},cn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:u,elements:c,middlewareData:s}=t,{element:l,padding:a=0}=Ot(e,t)||{};if(null==l)return{};const f=Nt(a),d={x:n,y:r},p=At(o),v=St(p),m=await u.getDimensions(l),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[v]+i.reference[p]-d[p]-i.floating[v],w=d[p]-i.reference[p],E=await(null==u.getOffsetParent?void 0:u.getOffsetParent(l));let R=E?E[b]:0;R&&await(null==u.isElement?void 0:u.isElement(E))||(R=c.floating[b]||i.floating[v]);const O=x/2-w/2,C=R/2-m[v]/2-1,j=gt(f[g],C),_=gt(f[y],C),S=j,k=R-m[v]-_,A=R/2-m[v]/2+O,L=Rt(S,A,k),T=!s.arrow&&null!=jt(o)&&A!==L&&i.reference[v]/2-(A<S?j:_)-m[v]/2<0,P=T?A<S?A-S:A-k:0;return{[p]:d[p]+P,data:{[p]:L,centerOffset:A-L-P,...T&&{alignmentOffset:P}},reset:T}}}),sn=(e,t,n)=>{const r=new Map,o={platform:rn,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,c=u.detectOverflow?u:{...u,detectOverflow:Ht},s=await(null==u.isRTL?void 0:u.isRTL(t));let l=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Wt(l,r,s),d=r,p=0;const v={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:h,fn:g}=m,{x:y,y:b,data:x,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:l,platform:c,elements:{reference:e,floating:t}});a=null!=y?y:a,f=null!=b?b:f,v[h]={...v[h],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(l=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Wt(l,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:v}})(e,t,{...o,platform:i})};var ln="undefined"!=typeof document?A.useLayoutEffect:function(){};function an(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(!an(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||an(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function fn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dn(e,t){const n=fn(e);return Math.round(t*n)/n}function pn(e){const t=A.useRef(e);return ln(()=>{t.current=e}),t}const vn="data-floating-ui-focusable",mn="active",hn="selected",gn={...A};let yn=!1,bn=0;const xn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+bn++,wn=gn.useId||function(){const[e,t]=A.useState(()=>yn?xn():void 0);return rt(()=>{null==e&&t(xn())},[]),A.useEffect(()=>{yn=!0},[]),e},En=A.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:u=14,height:c=7,tipRadius:s=0,strokeWidth:l=0,staticOffset:a,stroke:f,d,style:{transform:p,...v}={},...m}=e,h=wn(),[g,y]=A.useState(!1);if(rt(()=>{r&&"rtl"===me(r).direction&&y(!0)},[r]),!r)return null;const[b,x]=n.split("-"),w="top"===b||"bottom"===b;let E=a;(w&&null!=i&&i.x||!w&&null!=i&&i.y)&&(E=null);const R=2*l,O=R/2,C=u/2*(s/-8+1),j=c/2*s/4,_=!!d,S=E&&"end"===x?"bottom":"top";let L=E&&"end"===x?"right":"left";E&&g&&(L="end"===x?"left":"right");const T=null!=(null==o?void 0:o.x)?E||o.x:"",P=null!=(null==o?void 0:o.y)?E||o.y:"",M=d||"M0,0 H"+u+" L"+(u-C)+","+(c-j)+" Q"+u/2+","+c+" "+C+","+(c-j)+" Z",D={top:_?"rotate(180deg)":"",left:_?"rotate(90deg)":"rotate(-90deg)",bottom:_?"":"rotate(180deg)",right:_?"rotate(-90deg)":"rotate(90deg)"}[b];return(0,k.jsxs)("svg",{...m,"aria-hidden":!0,ref:t,width:_?u:u+R,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[L]:T,[S]:P,[b]:w||_?"100%":"calc(100% - "+R/2+"px)",transform:[D,p].filter(e=>!!e).join(" "),...v},children:[R>0&&(0,k.jsx)("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:R+(d?0:1),d:M}),(0,k.jsx)("path",{stroke:R&&!d?m.fill:"none",d:M}),(0,k.jsx)("clipPath",{id:h,children:(0,k.jsx)("rect",{x:-O,y:O*(_?-1:1),width:u+R,height:u})})]})});function Rn(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const On=A.createContext(null),Cn=A.createContext(null),jn=()=>{var e;return(null==(e=A.useContext(On))?void 0:e.id)||null},_n=()=>A.useContext(Cn);function Sn(e){const{children:t,id:n}=e,r=jn();return(0,k.jsx)(On.Provider,{value:A.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function kn(e){const{children:t}=e,n=A.useRef([]),r=A.useCallback(e=>{n.current=[...n.current,e]},[]),o=A.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[i]=A.useState(()=>Rn());return(0,k.jsx)(Cn.Provider,{value:A.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i]),children:t})}function An(e){return"data-floating-ui-"+e}function Ln(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Tn=An("safe-polygon");function Pn(e,t,n){if(n&&!nt(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function Mn(e){return"function"==typeof e?e():e}let Dn=0;function $n(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Dn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Dn=requestAnimationFrame(i)}function In(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&oe(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Nn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Fn(e){return"inert"===e?Nn.inert:"aria-hidden"===e?Nn["aria-hidden"]:Nn.none}let Wn=new WeakSet,Hn={},zn=0;function Bn(e){return e?oe(e)?e.host:Bn(e.parentNode):null}const Un=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Bn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function Kn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=(o=e[0],(null==o?void 0:o.ownerDocument)||document).body;var o;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=Un(t,e),c=new Set,s=new Set(u),l=[];Hn[o]||(Hn[o]=new WeakMap);const a=Hn[o];return u.forEach(function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!s.has(t)&&[].forEach.call(t.children,t=>{if("script"!==Q(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Fn(i),u=(r.get(t)||0)+1,c=(a.get(t)||0)+1;r.set(t,u),a.set(t,c),l.push(t),1===u&&n&&Wn.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),c.clear(),zn++,()=>{l.forEach(e=>{const t=Fn(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!Wn.has(e)&&i&&e.removeAttribute(i),Wn.delete(e)),r||e.removeAttribute(o)}),zn--,zn||(Nn.inert=new WeakMap,Nn["aria-hidden"]=new WeakMap,Nn.none=new WeakMap,Wn=new WeakSet,Hn={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Vn={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},qn=A.forwardRef(function(e,t){const[n,r]=A.useState();rt(()=>{He()&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[An("focus-guard")]:"",style:Vn};return(0,k.jsx)("span",{...e,...o})}),Xn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Yn=A.createContext(null),Gn=An("portal");function Zn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=wn(),o=Qn(),[i,u]=A.useState(null),c=A.useRef(null);return rt(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{c.current=null})},[i]),rt(()=>{if(!r)return;if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(Gn,""),e.appendChild(n),c.current=n,u(n)},[t,r]),rt(()=>{if(null===n)return;if(!r)return;if(c.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!te(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const s=document.createElement("div");s.id=r,s.setAttribute(Gn,""),e=i||e,e.appendChild(s),c.current=s,u(s)},[t,n,r,o]),i}({id:n,root:r}),[u,c]=A.useState(null),s=A.useRef(null),l=A.useRef(null),a=A.useRef(null),f=A.useRef(null),d=null==u?void 0:u.modal,p=null==u?void 0:u.open,v=!!u&&!u.modal&&u.open&&o&&!(!r&&!i);return A.useEffect(()=>{if(i&&o&&!d)return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&ft(e)&&("focusin"===e.type?pt:dt)(i)}},[i,o,d]),A.useEffect(()=>{i&&(p||pt(i))},[p,i]),(0,k.jsxs)(Yn.Provider,{value:A.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:l,beforeInsideRef:a,afterInsideRef:f,portalNode:i,setFocusManagerState:c}),[o,i]),children:[v&&i&&(0,k.jsx)(qn,{"data-type":"outside",ref:s,onFocus:e=>{if(ft(e,i)){var t;null==(t=a.current)||t.focus()}else{const e=at(u?u.domReference:null);null==e||e.focus()}}}),v&&i&&(0,k.jsx)("span",{"aria-owns":i.id,style:Xn}),i&&vt.createPortal(t,i),v&&i&&(0,k.jsx)(qn,{"data-type":"outside",ref:l,onFocus:e=>{if(ft(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=lt(u?u.domReference:null);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Qn=()=>A.useContext(Yn);function Jn(e){return A.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let er=[];function tr(){er=er.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function nr(){tr();const e=er[er.length-1];return null==e?void 0:e.deref()}function rr(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=ct(),o=function(e,t){return(t=t||{}).getShadowRoot?_e([e],t.includeContainer,{filter:Pe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):je(e,t.includeContainer,Pe.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Ne(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==u&&e.setAttribute("tabindex","0"):("-1"!==u||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const or=A.forwardRef(function(e,t){return(0,k.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Vn})});function ir(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:u=0,returnFocus:c=!0,restoreFocus:s=!1,modal:l=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:v,onOpenChange:m,events:h,dataRef:g,elements:{domReference:y,floating:b}}=t,x=ut(()=>{var e;return null==(e=g.current.floatingContext)?void 0:e.nodeId}),w=ut(p),E="number"==typeof u&&u<0,R=Ze(y)&&E,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,C=!O||i,j=!C||O&&d,_=ot(o),S=ot(u),L=ot(c),T=_n(),P=Qn(),M=A.useRef(null),D=A.useRef(null),$=A.useRef(!1),I=A.useRef(!1),N=A.useRef(-1),F=A.useRef(-1),W=null!=P,H=Qe(b),z=ut(function(e){return void 0===e&&(e=H),e?Ie(e,ct()):[]}),B=ut(e=>{const t=z(e);return _.current.map(e=>y&&"reference"===e?y:H&&"floating"===e?H:t).filter(Boolean).flat()});A.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){Ve(H,Ke(Ye(H)))&&0===z().length&&!R&&tt(e);const t=B(),n=qe(e);"reference"===_.current[0]&&n===y&&(tt(e),e.shiftKey?$n(t[t.length-1]):$n(t[1])),"floating"===_.current[1]&&n===H&&e.shiftKey&&(tt(e),$n(t[0]))}}const t=Ye(H);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,y,H,l,_,R,z,B]),A.useEffect(()=>{if(!r&&b)return b.addEventListener("focusin",e),()=>{b.removeEventListener("focusin",e)};function e(e){const t=qe(e),n=z().indexOf(t);-1!==n&&(N.current=n)}},[r,b,z]),A.useEffect(()=>{if(r)return;if(!f)return;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=qe(e);queueMicrotask(()=>{const o=x(),i=!(Ve(y,t)||Ve(b,t)||Ve(t,b)||Ve(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(An("focus-guard"))||T&&(Je(T.nodesRef.current,o).find(e=>{var n,r;return Ve(null==(n=e.context)?void 0:n.elements.floating,t)||Ve(null==(r=e.context)?void 0:r.elements.domReference,t)})||et(T.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Qe(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===y&&H&&rr(H,_),s&&n!==y&&(null==r||!r.isConnected)&&Ke(Ye(H))===Ye(H).body){re(H)&&H.focus();const e=N.current,t=z(),n=t[e]||t[t.length-1]||H;re(n)&&n.focus()}g.current.insideReactTree?g.current.insideReactTree=!1:!R&&l||!t||!i||I.current||t===nr()||($.current=!0,m(!1,e,"focus-out"))})}const n=Boolean(!T&&P);function o(){Ln(F),g.current.insideReactTree=!0,F.current=window.setTimeout(()=>{g.current.insideReactTree=!1})}return b&&re(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),b.addEventListener("focusout",t),n&&b.addEventListener("focusout",o,!0),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),b.removeEventListener("focusout",t),n&&b.removeEventListener("focusout",o,!0)}):void 0},[r,y,b,H,l,T,P,m,f,s,z,R,x,_,g]);const U=A.useRef(null),K=A.useRef(null),V=Jn([U,null==P?void 0:P.beforeInsideRef]),q=Jn([K,null==P?void 0:P.afterInsideRef]);function X(e){return!r&&a&&l?(0,k.jsx)(or,{ref:"start"===e?M:D,onClick:e=>m(!1,e.nativeEvent),children:"string"==typeof a?a:"Dismiss"}):null}A.useEffect(()=>{var e,t;if(r)return;if(!b)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+An("portal")+"]"))||[]),o=null==(t=(T?et(T.nodesRef.current,x()):[]).find(e=>{var t;return Ze((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[b,o,...n,...w(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,_.current.includes("reference")||R?y:null].filter(e=>null!=e),u=l||R?Kn(i,!j,j):Kn(i);return()=>{u()}},[r,y,b,l,_,P,R,C,j,T,x,w]),rt(()=>{if(r||!re(H))return;const e=Ke(Ye(H));queueMicrotask(()=>{const t=B(H),n=S.current,r=("number"==typeof n?t[n]:n.current)||H,o=Ve(H,e);E||o||!v||$n(r,{preventScroll:r===H})})},[r,v,H,E,B,S]),rt(()=>{if(r||!H)return;const e=Ye(H);var t;function n(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&($.current=!0),"outside-press"===t)if(r)$.current=!1;else if(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(ze()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!Be()&&(!ze()&&0===e.width&&0===e.height||ze()&&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)}(n))$.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),$.current=!e}}t=Ke(e),tr(),t&&"body"!==Q(t)&&(er.push(new WeakRef(t)),er.length>20&&(er=er.slice(-20))),h.on("openchange",n);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,Vn),W&&y&&y.insertAdjacentElement("afterend",o),()=>{h.off("openchange",n);const t=Ke(e),r=Ve(b,t)||T&&Je(T.nodesRef.current,x(),!1).some(e=>{var n;return Ve(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof L.current){const e=y||nr();return e&&e.isConnected?e:o}return L.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=ct();return Ne(e,t)?e:Ie(e,t)[0]||e}(i);L.current&&!$.current&&re(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,b,H,L,g,h,T,W,y,x]),A.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(tr)}),[r]),rt(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:v,onOpenChange:m,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,l,v,m,f,y]),rt(()=>{r||H&&rr(H,_)},[r,H,_]);const Y=!r&&C&&(!l||!R)&&(W||l);return(0,k.jsxs)(k.Fragment,{children:[Y&&(0,k.jsx)(qn,{"data-type":"inside",ref:V,onFocus:e=>{if(l){const e=B();$n("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,ft(e,P.portalNode)){const e=lt(y);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!R&&X("start"),n,X("end"),Y&&(0,k.jsx)(qn,{"data-type":"inside",ref:q,onFocus:e=>{if(l)$n(B()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&($.current=!0),ft(e,P.portalNode)){const e=at(y);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function ur(e){return re(e.target)&&"BUTTON"===e.target.tagName}function cr(e){return Ge(e)}function sr(e){return null!=e&&null!=e.clientX}const lr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ar={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},fr=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 dr(){return Fe().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&He()}function pr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[mn]:t,[hn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[vn]:""},...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 u;o&&[mn,hn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.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 vr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),mr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function hr(e,t){return"function"==typeof e?e(t):e}function gr(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...gr(e,t.id,n)])}function yr(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,u=i-1;e<i;u=e++){const[i,c]=t[e]||[0,0],[s,l]=t[u]||[0,0];c>=r!=l>=r&&n<=(s-i)*(r-c)/(l-c)+i&&(o=!o)}return o}function br(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,u=null,c=null,s="undefined"!=typeof performance?performance.now():0;const l=e=>{let{x:n,y:l,placement:a,elements:f,onClose:d,nodeId:p,tree:v}=e;return function(e){function m(){Ln(o),d()}if(Ln(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:g}=e,y=[h,g],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=In(f.floating,b),E=In(f.domReference,b),R=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],j=n>O.right-O.width/2,_=l>O.bottom-O.height/2,S=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,R),k=O.width>R.width,A=O.height>R.height,L=(k?R:O).left,T=(k?R:O).right,P=(A?R:O).top,M=(A?R:O).bottom;if(w&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&ne(e.relatedTarget)&&In(f.floating,e.relatedTarget))return;if(v&&gr(v.nodesRef.current,p).length)return;if("top"===C&&l>=R.bottom-1||"bottom"===C&&l<=R.top+1||"left"===C&&n>=R.right-1||"right"===C&&n<=R.left+1)return m();let D=[];switch(C){case"top":D=[[L,R.top+1],[L,O.bottom-1],[T,O.bottom-1],[T,R.top+1]];break;case"bottom":D=[[L,O.top+1],[L,R.bottom-1],[T,R.bottom-1],[T,O.top+1]];break;case"left":D=[[O.right-1,M],[O.right-1,P],[R.left+1,P],[R.left+1,M]];break;case"right":D=[[R.right-1,M],[R.right-1,P],[O.left+1,P],[O.left+1,M]]}if(!yr([h,g],D)){if(i&&!S)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-s;if(null===u||null===c||0===r)return u=e,c=t,s=n,null;const o=e-u,i=t-c,l=Math.sqrt(o*o+i*i);return u=e,c=t,s=n,l/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}yr([h,g],function(e){let[n,r]=e;switch(C){case"top":return[[k?n+t/2:j?n+4*t:n-4*t,r+t+1],[k?n-t/2:j?n+4*t:n-4*t,r+t+1],[O.left,j||k?O.bottom-t:O.top],[O.right,j?k?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[k?n+t/2:j?n+4*t:n-4*t,r-t],[k?n-t/2:j?n+4*t:n-4*t,r-t],[O.left,j||k?O.top+t:O.bottom],[O.right,j?k?O.top+t:O.bottom:O.top+t]];case"left":{const e=[n+t+1,A?r+t/2:_?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:_?r+4*t:r-4*t];return[[_||A?O.right-t:O.left,O.top],[_?A?O.right-t:O.left:O.right-t,O.bottom],e,o]}case"right":return[[n-t,A?r+t/2:_?r+4*t:r-4*t],[n-t,A?r-t/2:_?r+4*t:r-4*t],[_||A?O.left+t:O.right,O.top],[_?A?O.left+t:O.right:O.left+t,O.bottom]]}}([n,l]))?!i&&r&&(o.current=window.setTimeout(m,40)):m()}}};return l.__options={blockPointerEvents:n},l}const xr=({children:e,enabled:t=!0,...n})=>{const r=jn();return!t||r?e:(0,k.jsx)(kn,{...n,children:e})},wr=l(S,({$width:e="max-content"})=>({$width:e}))``,Er=({children:e,enabled:t=!0,...n})=>t?(0,k.jsx)(Zn,{...n,children:e}):e;var Rr={551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,c,s,l,a=0,f=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,c=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===s)return function(e){return a=e,s=setTimeout(w,t),f?b(e):c}(l);if(d)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),c}return t=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),R.cancel=function(){void 0!==s&&clearTimeout(s),a=0,o=l=i=s=void 0},R.flush=function(){return void 0===s?c:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}}},Or={};function Cr(e){var t=Or[e];if(void 0!==t)return t.exports;var n=Or[e]={exports:{}};return Rr[e](n,n.exports,Cr),n.exports}Cr.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return Cr.d(t,{a:t}),t},Cr.d=(e,t)=>{for(var n in t)Cr.o(t,n)&&!Cr.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},Cr.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),Cr.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var jr=Cr(551);Cr.n(jr);const _r=(e,{enabled:t=!0,event:n="click",dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:u,clientPointsOptions:c,roleOptions:s,extraInteractions:l=[]})=>{const a=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:l="pointerdown",referencePress:a=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:v}=t,m=_n(),h=ut("function"==typeof s?s:()=>!1),g="function"==typeof s?h:s,y=A.useRef(!1),{escapeKey:b,outsidePress:x}=fr(p),{escapeKey:w,outsidePress:E}=fr(v),R=A.useRef(!1),O=ut(e=>{var t;if(!n||!u||!c||"Escape"!==e.key)return;if(R.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,s=m?Je(m.nodesRef.current,o):[];if(!b&&(e.stopPropagation(),s.length>0)){let e=!0;if(s.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),C=ut(e=>{var t;const n=()=>{var t;O(e),null==(t=qe(e))||t.removeEventListener("keydown",n)};null==(t=qe(e))||t.addEventListener("keydown",n)}),j=ut(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=y.current;if(y.current=!1,"click"===l&&u)return;if(n)return;if("function"==typeof g&&!g(e))return;const c=qe(e),s="["+An("inert")+"]",a=Ye(o.floating).querySelectorAll(s);let f=ne(c)?c:null;for(;f&&!ve(f);){const e=ge(f);if(ve(e)||!ne(e))break;f=e}if(a.length&&ne(c)&&!c.matches("html,body")&&!Ve(c,o.floating)&&Array.from(a).every(e=>!Ve(f,e)))return;if(re(c)&&k){const t=ve(c),n=me(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),u=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,s=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,l="rtl"===n.direction,a=s&&(l?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=u&&e.offsetY>c.clientHeight;if(a||f)return}const d=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=m&&Je(m.nodesRef.current,d).some(t=>{var n;return Xe(e,null==(n=t.context)?void 0:n.elements.floating)});if(Xe(e,o.floating)||Xe(e,o.domReference)||p)return;const v=m?Je(m.nodesRef.current,d):[];if(v.length>0){let e=!0;if(v.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),_=ut(e=>{var t;const n=()=>{var t;j(e),null==(t=qe(e))||t.removeEventListener(l,n)};null==(t=qe(e))||t.addEventListener(l,n)});A.useEffect(()=>{if(!n||!u)return;i.current.__escapeKeyBubbles=b,i.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function s(){window.clearTimeout(e),R.current=!0}function a(){e=window.setTimeout(()=>{R.current=!1},pe()?5:0)}const f=Ye(o.floating);c&&(f.addEventListener("keydown",w?C:O,w),f.addEventListener("compositionstart",s),f.addEventListener("compositionend",a)),g&&f.addEventListener(l,E?_:j,E);let p=[];return d&&(ne(o.domReference)&&(p=be(o.domReference)),ne(o.floating)&&(p=p.concat(be(o.floating))),!ne(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(be(o.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{c&&(f.removeEventListener("keydown",w?C:O,w),f.removeEventListener("compositionstart",s),f.removeEventListener("compositionend",a)),g&&f.removeEventListener(l,E?_:j,E),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,c,g,l,n,r,d,u,b,x,O,w,C,j,E,_]),A.useEffect(()=>{i.current.insideReactTree=!1},[i,g,l]);const S=A.useMemo(()=>({onKeyDown:O,...a&&{[lr[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[O,r,a,f]),k=A.useMemo(()=>{function e(e){0===e.button&&(y.current=!0)}return{onKeyDown:O,onMouseDown:e,onMouseUp:e,[ar[l]]:()=>{i.current.insideReactTree=!0}}},[O,l,i]);return A.useMemo(()=>u?{reference:S,floating:k}:{},[u,S,k])}(e,{escapeKey:!1,...r}),f=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:u=!0,event:c="click",toggle:s=!0,ignoreMouse:l=!1,keyboardHandlers:a=!0,stickIfOpen:f=!0}=t,d=A.useRef(),p=A.useRef(!1),v=A.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==c&&(nt(t,!0)&&l||(!n||!s||o.current.openEvent&&f&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===c&&d.current?d.current=void 0:nt(t,!0)&&l||(!n||!s||o.current.openEvent&&f&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!a||ur(e)||(" "!==e.key||cr(i)||(e.preventDefault(),p.current=!0),function(e){return re(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!a||ur(e)||cr(i)||" "===e.key&&p.current&&(p.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[o,i,c,l,a,r,n,f,s]);return A.useMemo(()=>u?{reference:v}:{},[u,v])}(e,{enabled:t&&"click"===n,...o}),d=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:u}=e,{enabled:c=!0,delay:s=0,handleClose:l=null,mouseOnly:a=!1,restMs:f=0,move:d=!0}=t,p=_n(),v=jn(),m=ot(l),h=ot(s),g=ot(n),y=ot(f),b=A.useRef(),x=A.useRef(-1),w=A.useRef(),E=A.useRef(-1),R=A.useRef(!0),O=A.useRef(!1),C=A.useRef(()=>{}),j=A.useRef(!1),_=ut(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});A.useEffect(()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(Ln(x),Ln(E),R.current=!0,j.current=!1)}},[c,i]),A.useEffect(()=>{if(!c)return;if(!m.current)return;if(!n)return;function e(e){_()&&r(!1,e,"hover")}const t=Ye(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,r,c,m,_]);const S=A.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Pn(h.current,"close",b.current);o&&!w.current?(Ln(x),x.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(Ln(x),r(!1,e,n))},[h,r]),k=ut(()=>{C.current(),w.current=void 0}),L=ut(()=>{if(O.current){const e=Ye(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Tn),O.current=!1}}),T=ut(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));A.useEffect(()=>{if(c&&ne(u.domReference)){const r=u.domReference,o=u.floating;return n&&r.addEventListener("mouseleave",i),d&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),o&&(o.addEventListener("mouseleave",i),o.addEventListener("mouseenter",s),o.addEventListener("mouseleave",l)),()=>{n&&r.removeEventListener("mouseleave",i),d&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),o&&(o.removeEventListener("mouseleave",i),o.removeEventListener("mouseenter",s),o.removeEventListener("mouseleave",l))}}function e(e){if(Ln(x),R.current=!1,a&&!nt(b.current)||Mn(y.current)>0&&!Pn(h.current,"open"))return;const t=Pn(h.current,"open",b.current);t?x.current=window.setTimeout(()=>{g.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(T())return void L();C.current();const t=Ye(u.floating);if(Ln(E),j.current=!1,m.current&&o.current.floatingContext){n||Ln(x),w.current=m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||S(e,!0,"safe-polygon")}});const r=w.current;return t.addEventListener("mousemove",r),void(C.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!Ve(u.floating,e.relatedTarget))&&S(e)}function i(e){T()||o.current.floatingContext&&(null==m.current||m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||S(e)}})(e))}function s(){Ln(x)}function l(e){T()||S(e,!1)}},[u,c,e,a,d,S,k,L,r,n,g,p,h,m,o,T,y]),rt(()=>{var e;if(c&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&_()){O.current=!0;const e=u.floating;if(ne(u.domReference)&&e){var t;const n=Ye(u.floating).body;n.setAttribute(Tn,"");const r=u.domReference,o=null==p||null==(t=p.nodesRef.current.find(e=>e.id===v))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[c,n,v,u,p,m,_]),rt(()=>{n||(b.current=void 0,j.current=!1,k(),L())},[n,k,L]),A.useEffect(()=>()=>{k(),Ln(x),Ln(E),L()},[c,u.domReference,k,L]);const P=A.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){R.current||g.current||r(!0,t,"hover")}a&&!nt(b.current)||n||0===Mn(y.current)||j.current&&e.movementX**2+e.movementY**2<2||(Ln(E),"touch"===b.current?o():(j.current=!0,E.current=window.setTimeout(o,Mn(y.current))))}}},[a,r,n,g,y]);return A.useMemo(()=>c?{reference:P}:{},[c,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:br(),...i}),p=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:u}=e,{enabled:c=!0,visibleOnly:s=!0}=t,l=A.useRef(!1),a=A.useRef(-1),f=A.useRef(!0);A.useEffect(()=>{if(!c)return;const e=J(u.domReference);function t(){!n&&re(u.domReference)&&u.domReference===Ke(Ye(u.domReference))&&(l.current=!0)}function r(){f.current=!0}function o(){f.current=!1}return e.addEventListener("blur",t),dr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),dr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[u.domReference,n,c]),A.useEffect(()=>{if(c)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(l.current=!0)}},[o,c]),A.useEffect(()=>()=>{Ln(a)},[]);const d=A.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;const t=qe(e.nativeEvent);if(s&&ne(t))if(dr()&&!e.relatedTarget){if(!f.current&&!Ge(t))return}else if(!function(e){if(!e||Be())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;r(!0,e.nativeEvent,"focus")},onBlur(e){l.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=ne(t)&&t.hasAttribute(An("focus-guard"))&&"outside"===t.getAttribute("data-type");a.current=window.setTimeout(()=>{var e;const c=Ke(u.domReference?u.domReference.ownerDocument:document);(t||c!==u.domReference)&&(Ve(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,c)||Ve(u.domReference,c)||o||r(!1,n,"focus"))})}}),[i,u.domReference,r,s]);return A.useMemo(()=>c?{reference:d}:{},[c,d])}(e,{enabled:t&&"focus"===n,...u}),v=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:u}=e,{enabled:c=!0,axis:s="both",x:l=null,y:a=null}=t,f=A.useRef(!1),d=A.useRef(null),[p,v]=A.useState(),[m,h]=A.useState([]),g=ut((e,t)=>{f.current||r.current.openEvent&&!sr(r.current.openEvent)||u.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const u=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,l=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let a=u.width,f=u.height,d=u.x,p=u.y;return null==n&&t.x&&c&&(n=u.x-t.x),null==r&&t.y&&s&&(r=u.y-t.y),d-=n||0,p-=r||0,a=0,f=0,!o||l?(a="y"===t.axis?u.width:0,f="x"===t.axis?u.height:0,d=c&&null!=t.x?t.x:d,p=s&&null!=t.y?t.y:p):o&&!l&&(f="x"===t.axis?u.height:f,a="y"===t.axis?u.width:a),o=!0,{width:a,height:f,x:d,y:p,top:p,right:d+a,bottom:p+f,left:d}}}}(i,{x:e,y:t,axis:s,dataRef:r,pointerType:p}))}),y=ut(e=>{null==l&&null==a&&(n?d.current||h([]):g(e.clientX,e.clientY))}),b=nt(p)?o:n,x=A.useCallback(()=>{if(!b||!c||null!=l||null!=a)return;const e=J(o);function t(n){const r=qe(n);Ve(o,r)?(e.removeEventListener("mousemove",t),d.current=null):g(n.clientX,n.clientY)}if(!r.current.openEvent||sr(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}u.setPositionReference(i)},[b,c,l,a,o,r,u,i,g]);A.useEffect(()=>x(),[x,m]),A.useEffect(()=>{c&&!o&&(f.current=!1)},[c,o]),A.useEffect(()=>{!c&&n&&(f.current=!0)},[c,n]),rt(()=>{!c||null==l&&null==a||(f.current=!1,g(l,a))},[c,l,a,g]);const w=A.useMemo(()=>{function e(e){let{pointerType:t}=e;v(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return A.useMemo(()=>c?{reference:w}:{},[c,w])}(e,{enabled:t&&"point"===n,...c}),m=function(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:u}=e,{enabled:c=!0,role:s="dialog"}=t,l=wn(),a=(null==(n=i.domReference)?void 0:n.id)||l,f=A.useMemo(()=>{var e;return(null==(e=Qe(i.floating))?void 0:e.id)||u},[i.floating,u]),d=null!=(r=vr.get(s))?r:s,p=null!=jn(),v=A.useMemo(()=>"tooltip"===d||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":o?f:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:a},..."menu"===d&&p&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[d,f,p,o,a,s]),m=A.useMemo(()=>{const e={id:f,...d&&{role:d}};return"tooltip"===d||"label"===s?e:{...e,..."menu"===d&&{"aria-labelledby":a}}},[d,f,a,s]),h=A.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:f+"-fui-option"}};switch(s){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[f,s]);return A.useMemo(()=>c?{reference:v,floating:m,item:h}:{},[c,v,m,h])}(e,s);return function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=A.useCallback(t=>pr(t,e,"reference"),t),i=A.useCallback(t=>pr(t,e,"floating"),n),u=A.useCallback(t=>pr(t,e,"item"),r);return A.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}([a,f,d,p,v,m,...l])},Sr=({enabled:e=!0,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s,open:l,floatingOptions:a,useOffset:f=!0,offsetOptions:d,useFlip:p=!0,flipOptions:v,useShift:m=!0,shiftOptions:g,useArrow:y=!1,arrowOptions:b,transitionOptions:x,useAutoPlacement:w=!1,autoPlacementOptions:E,useAutoUpdate:R=!1,autoUpdateOptions:O,useAutoSize:C=!1,sizeOptions:j,minAcceptableWidth:_=null,minAcceptableHeight:S=null,maxAcceptableWidth:k,maxAcceptableHeight:L,onOpen:T,onClose:P})=>{const{theme:M}=V(),D=function(){const e=wn(),t=_n(),n=jn();return rt(()=>{if(!e)return;const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}},[t,e,n]),e}(),[$,I]=(0,A.useState)(!1),N=(0,A.useRef)(null),F=e&&(l??$);(0,A.useEffect)(()=>{F&&T?.()},[F]),((e,t)=>{const n=(0,A.useRef)(e);(0,A.useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(e,e=>{e||I(!1)});const W=[];f&&W.push((e=>{const t=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:c}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=Ct(n),c=jt(n),s="y"===kt(n),l=zt.has(u)?-1:1,a=i&&s?-1:1,f=Ot(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof v&&(p="end"===c?-1*v:v),s?{x:p*a,y:d*l}:{x:d*l,y:p*a}}(t,e);return u===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:u}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(d??M.spacings.base));let H=null;if(w?W.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:u,placement:c,platform:s,elements:l}=t,{crossAxis:a=!1,alignment:f,allowedPlacements:d=ht,autoAlignment:p=!0,...v}=Ot(e,t),m=void 0!==f||d===ht?function(e,t,n){return(e?[...n.filter(t=>jt(t)===e),...n.filter(t=>jt(t)!==e)]:n.filter(e=>Ct(e)===e)).filter(n=>!e||jt(n)===e||!!t&&Tt(n)!==n)}(f||null,p,d):d,h=await s.detectOverflow(t,v),g=(null==(n=u.autoPlacement)?void 0:n.index)||0,y=m[g];if(null==y)return{};const b=Lt(y,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));if(c!==y)return{reset:{placement:m[0]}};const x=[h[Ct(y)],h[b[0]],h[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:y,overflows:x}],E=m[g+1];if(E)return{data:{index:g+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=jt(e.placement);return[e.placement,t&&a?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),O=R.filter(e=>e[2].slice(0,jt(e[0])?2:3).every(e=>e<=0)),C=(null==(o=O[0])?void 0:o[0])||R[0][0];return C!==c?{data:{index:g+1,overflows:w},reset:{placement:C}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(E)):p&&(H=(e=>{const t=un(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...v})),C){const e=(e=>{const t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:u,elements:c}=t,{apply:s=()=>{},...l}=Ot(e,t),a=await u.detectOverflow(t,l),f=Ct(o),d=jt(o),p="y"===kt(o),{width:v,height:m}=i.floating;let h,g;"top"===f||"bottom"===f?(h=f,g=d===(await(null==u.isRTL?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(g=f,h="end"===d?"top":"bottom");const y=m-a.top-a.bottom,b=v-a.left-a.right,x=gt(m-a[h],y),w=gt(v-a[g],b),E=!t.middlewareData.shift;let R=x,O=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(O=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(R=y),E&&!d){const e=yt(a.left,0),t=yt(a.right,0),n=yt(a.top,0),r=yt(a.bottom,0);p?O=v-2*(0!==e||0!==t?e+t:yt(a.left,a.right)):R=m-2*(0!==n||0!==r?n+r:yt(a.top,a.bottom))}await s({...t,availableWidth:O,availableHeight:R});const C=await u.getDimensions(c.floating);return v!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({...j,apply({elements:e,rects:t,availableWidth:n,availableHeight:r}){const o=h(_)?_(t.reference):_??t.reference.width,i=h(k)?k(t.reference):Math.min(n,k??1/0),u=h(S)?S(t.reference):S??0,c=h(L)?L(t.reference):Math.min(r,L??1/0);Object.assign(e.floating.style,{minWidth:`${Math.min(o,i)}px`,maxWidth:`${i}px`,minHeight:`${Math.min(u,c)}px`,maxHeight:`${c}px`})}});H?"initialPlacement"===v?.fallbackStrategy?W.push(e,H):W.push(H,e):W.push(e)}else H&&W.push(H);m&&W.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:u=!0,crossAxis:c=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ot(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=kt(Ct(o)),p=_t(d);let v=a[p],m=a[d];if(u){const e="y"===p?"bottom":"right";v=Rt(v+f["y"===p?"top":"left"],v,v-f[e])}if(c){const e="y"===d?"bottom":"right";m=Rt(m+f["y"===d?"top":"left"],m,m-f[e])}const h=s.fn({...t,[p]:v,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:u,[d]:c}}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({padding:M.spacings.base,...g})),y&&W.push(((e,t)=>{const n=(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?cn({element:n.current,padding:r}).fn(t):{}:n?cn({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}})({element:N,padding:M.spacings.base,...b}));const z=function(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=wn(),i=A.useRef({}),[u]=A.useState(()=>Rn()),c=null!=jn(),[s,l]=A.useState(r.reference),a=ut((e,t,r)=>{i.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:r,nested:c}),null==n||n(e,t,r)}),f=A.useMemo(()=>({setPositionReference:l}),[]),d=A.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return A.useMemo(()=>({dataRef:i,open:t,onOpenChange:a,elements:d,events:u,floatingId:o,refs:f}),[t,a,d,u,o,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,u]=A.useState(null),[c,s]=A.useState(null),l=(null==o?void 0:o.domReference)||i,a=A.useRef(null),f=_n();rt(()=>{l&&(a.current=l)},[l]);const d=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:u}={},transform:c=!0,whileElementsMounted:s,open:l}=e,[a,f]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=A.useState(r);an(d,r)||p(r);const[v,m]=A.useState(null),[h,g]=A.useState(null),y=A.useCallback(e=>{e!==E.current&&(E.current=e,m(e))},[]),b=A.useCallback(e=>{e!==R.current&&(R.current=e,g(e))},[]),x=i||v,w=u||h,E=A.useRef(null),R=A.useRef(null),O=A.useRef(a),C=null!=s,j=pn(s),_=pn(o),S=pn(l),k=A.useCallback(()=>{if(!E.current||!R.current)return;const e={placement:t,strategy:n,middleware:d};_.current&&(e.platform=_.current),sn(E.current,R.current,e).then(e=>{const t={...e,isPositioned:!1!==S.current};L.current&&!an(O.current,t)&&(O.current=t,vt.flushSync(()=>{f(t)}))})},[d,t,n,_,S]);ln(()=>{!1===l&&O.current.isPositioned&&(O.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);const L=A.useRef(!1);ln(()=>(L.current=!0,()=>{L.current=!1}),[]),ln(()=>{if(x&&(E.current=x),w&&(R.current=w),x&&w){if(j.current)return j.current(x,w,k);k()}},[x,w,k,j,C]);const T=A.useMemo(()=>({reference:E,floating:R,setReference:y,setFloating:b}),[y,b]),P=A.useMemo(()=>({reference:x,floating:w}),[x,w]),M=A.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=dn(P.floating,a.x),r=dn(P.floating,a.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...fn(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,P.floating,a.x,a.y]);return A.useMemo(()=>({...a,update:k,refs:T,elements:P,floatingStyles:M}),[a,k,T,P,M])}({...e,elements:{...o,...c&&{reference:c}}}),p=A.useCallback(e=>{const t=ne(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),d.refs.setReference(t)},[d.refs]),v=A.useCallback(e=>{(ne(e)||null===e)&&(a.current=e,u(e)),(ne(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!ne(e))&&d.refs.setReference(e)},[d.refs]),m=A.useMemo(()=>({...d.refs,setReference:v,setPositionReference:p,domReference:a}),[d.refs,v,p]),h=A.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),g=A.useMemo(()=>({...d,...r,refs:m,elements:h,nodeId:t}),[d,m,h,t,r]);return rt(()=>{r.dataRef.current.floatingContext=g;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=g)}),A.useMemo(()=>({...d,context:g,refs:m,elements:h}),[d,m,h,g])}({nodeId:D,open:F,middleware:W,onOpenChange:(e,t,n)=>{I(e),e||P?.(n,t)},...R&&{whileElementsMounted:(e,t,n)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,l=Ut(e),a=o||i?[...l?be(l):[],...t?be(t):[]]:[];a.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const f=l&&c?function(e,t){let n,r=null;const o=ee(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function u(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const l=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=l;if(c||t(),!d||!p)return;const v={rootMargin:-xt(f)+"px "+-xt(o.clientWidth-(a+d))+"px "+-xt(o.clientHeight-(f+p))+"px "+-xt(a)+"px",threshold:yt(0,gt(1,s))||1};let m=!0;function h(t){const r=t[0].intersectionRatio;if(r!==s){if(!m)return u();r?u(!1,r):n=setTimeout(()=>{u(!1,1e-7)},1e3)}1!==r||on(l,e.getBoundingClientRect())||u(),m=!1}try{r=new IntersectionObserver(h,{...v,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,v)}r.observe(e)}(!0),i}(l,n):null;let d,p=-1,v=null;u&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),l&&!s&&v.observe(l),t&&v.observe(t));let m=s?Xt(e):null;return s&&function t(){const r=Xt(e);m&&!on(m,r)&&n(),m=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;a.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=v)||e.disconnect(),v=null,s&&cancelAnimationFrame(d)}}(e,t,n,O)},...a}),B=_r(z.context,{enabled:e,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s}),U=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:u=250}=t,c=e.placement,s=c.split("-")[0],l=A.useMemo(()=>({side:s,placement:c}),[s,c]),a="number"==typeof u,f=(a?u:u.open)||0,d=(a?u:u.close)||0,[p,v]=A.useState(()=>({...hr(i,l),...hr(n,l)})),{isMounted:m,status:h}=function(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,[u,c]=A.useState("unmounted"),s=function(e,t){const[n,r]=A.useState(e);return e&&!n&&r(!0),A.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,i);return s||"close"!==u||c("unmounted"),rt(()=>{if(r){if(n){c("initial");const e=requestAnimationFrame(()=>{vt.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(e)}}c("close")}},[n,r]),{isMounted:s,status:u}}(e,{duration:u}),g=ot(n),y=ot(r),b=ot(o),x=ot(i);return rt(()=>{const e=hr(g.current,l),t=hr(b.current,l),n=hr(x.current,l),r=hr(y.current,l)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===h&&v(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===h&&v({transitionProperty:Object.keys(r).map(mr).join(","),transitionDuration:f+"ms",...n,...r}),"close"===h){const r=t||e;v({transitionProperty:Object.keys(r).map(mr).join(","),transitionDuration:d+"ms",...n,...r})}},[d,b,g,y,x,f,h,l]),{isMounted:m,styles:p}}(z.context,{duration:250,...x});return{nodeId:D,isOpen:F,floating:z,arrowRef:N,interactions:B,transition:U}},kr=()=>{const e=(0,A.useContext)(G);return m(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},Ar=({children:e,referenceProps:t,content:n,contentProps:r,focusManagerProps:o,arrowProps:i,portalProps:u,adjustStyles:c,context:s,...l})=>{const{useArrow:a,onClose:f}=l,{nodeId:d,floating:p,isOpen:v,arrowRef:m,interactions:h,transition:y}=Sr(l),b=(0,A.useCallback)(()=>{f?.("escape-key")},[f]),x=(0,A.useMemo)(()=>({context:s,floatingContext:p.context}),[s,p.context]);return(0,k.jsx)(wr,{ref:p.refs.setReference,...h.getReferenceProps(),...t,"data-testid":"honey-popup",children:(0,k.jsxs)(G,{value:x,children:[g(e,x),(0,k.jsx)(Sn,{id:d,children:y.isMounted&&(0,k.jsx)(Er,{...u,children:(0,k.jsx)(ir,{context:p.context,disabled:!v,...o,children:(0,k.jsxs)(Y,{ref:p.refs.setFloating,active:v,style:c?.({...p.floatingStyles,...y.styles},{middlewareData:p.middlewareData})??{...p.floatingStyles,...y.styles},onDeactivate:b,...h.getFloatingProps(),...r,"data-testid":"honey-popup-floating-content",children:[a&&(0,k.jsx)(En,{ref:m,context:p.context,fill:"white",...i}),g(n,x)]})})})})]})})},Lr=({useTree:e=!1,...t})=>(0,k.jsx)(xr,{enabled:e,children:(0,k.jsx)(Ar,{...t})}),Tr=({option:e,...t})=>{const{context:n,floatingContext:r}=kr();return(0,k.jsx)(C,{onClick:()=>{e.onClick?.({context:n,floatingContext:r})},...t,children:e.label})},Pr=({options:e,optionProps:t,floatingOptions:n,...r})=>{const{contentProps:o}=r,{context:i,floatingContext:u}=kr(),c=(0,A.useMemo)(()=>e?.filter(e=>"function"==typeof e.visible?e.visible({context:i,floatingContext:u}):!1!==e.visible),[e]);return(0,k.jsx)(W,{items:c,itemKey:"id",emptyContent:"No options",children:e=>e.options?.length?(0,k.jsx)(Lr,{context:i,content:(0,k.jsx)(Pr,{options:e.options,optionProps:t,contentProps:o}),event:"hover",referenceProps:{$width:"100%"},floatingOptions:{placement:"right-start",...n},useArrow:!0,...r,children:(0,k.jsx)(Tr,{option:e,...t,children:e.label})}):(0,k.jsx)(Tr,{option:e,...t})})},Mr=({children:e,subProps:t,options:n,optionProps:r,clickOptions:o,context:i,...u})=>{const{contentProps:c}=u;return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(Lr,{context:i,content:(0,k.jsx)(Pr,{options:n,optionProps:r,contentProps:c,...t}),clickOptions:{toggle:!1,...o},useArrow:!0,...u,children:e})})},Dr=(0,A.createContext)(void 0),$r=()=>{const e=(0,A.useContext)(Dr);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component."),e},Ir=({children:e})=>{const t=(0,A.useContext)(Dr),[n,r]=(0,A.useState)([]),o=(0,A.useMemo)(()=>({layers:n,registerLayer:e=>{const t=y();return r(n=>[...n,{id:t,payload:e}]),t},unregisterLayer:e=>{r(t=>t.filter(t=>t.id!==e))},getLayerIndex:e=>n.findIndex(t=>t.id===e)}),[n]);return t?e:(0,k.jsx)(Dr,{value:o,children:e})},Nr=({children:e,theme:t,mediaQueryOptions:r,...o})=>{const i=U(t,r),{overlays:u,registerOverlay:c,unregisterOverlay:s}=(()=>{const e=(0,A.useRef)([]);(0,A.useEffect)(()=>{const t=t=>{const n=e.current;n.length&&n[n.length-1].notifyListeners("keyup",t.code,t)};return document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}},[]);const t=(0,A.useCallback)(t=>{const n=t.id??y(),r=[["keyup",t.onKeyUp]],o={current:null},i={containerRef:o,id:n,setContainerRef:e=>{o.current=e},addListener:(e,t)=>{r.push([e,t])},removeListener:(e,t)=>{const n=r.findIndex(([n,r])=>n===e&&r===t);-1!==n&&r.splice(n,1)},notifyListeners:(e,n,o)=>{const u=t.listenKeys??[];u.length&&!u.includes(n)||(o.preventDefault(),r.forEach(([t,r])=>{t===e&&r(n,i,o)}))}};return e.current.push(i),i},[]),n=(0,A.useCallback)(t=>{e.current=e.current.filter(e=>e.id!==t)},[]);return{overlays:e.current,registerOverlay:t,unregisterOverlay:n}})(),l=(0,A.useMemo)(()=>({theme:t,screenState:i,overlays:u,registerOverlay:c,unregisterOverlay:s}),[t,i,u]);return(0,k.jsx)(n,{theme:t,...o,children:(0,k.jsx)(K,{value:l,children:e})})};var Fr=d(117),Wr=d.n(Fr);const Hr=({theme:e,...t})=>{const r=(0,A.useContext)(K),o=(0,A.useMemo)(()=>Wr()(r?.theme,e),[r?.theme,e]);return(0,k.jsx)(n,{theme:o,...t})},zr=({durationMs:e,timingFunction:t="ease-in-out",extraProperties:n=[],activeClassName:o})=>({active:i=!1})=>r`
37
37
  opacity: ${i?1:0};
38
38
  visibility: ${i?"visible":"hidden"};
39
39