@react-hive/honey-layout 17.8.0 → 17.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see index.cjs.LICENSE.txt */
2
- (()=>{var e={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")(),y=t&&!t.nodeType&&t,g=y&&e&&!e.nodeType&&e,b=g&&g.exports===y,x=b&&v.process,w=function(){try{return g&&g.require&&g.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),E=w&&w.isTypedArray,R=Array.prototype,O=Function.prototype,C=Object.prototype,_=h["__core-js_shared__"],S=O.toString,j=C.hasOwnProperty,L=(f=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",A=C.toString,T=S.call(Object),k=RegExp("^"+S.call(j).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,H=R.splice,F=M?M.toStringTag:void 0,W=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),B=P?P.isBuffer:void 0,z=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];j.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&&W?W(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 j.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:j.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():H.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]":F&&F in Object(e)?function(e){var t=j.call(e,F),n=e[F];try{e[F]=void 0;var r=!0}catch(e){}var o=A.call(e);return r&&(t?e[F]=n:delete e[F]),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,y=void 0===h;if(y){var g=ve(l),b=!g&&he(l),x=!g&&!b&&we(l);h=l,g||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?(y=!1,h=function(e){return e.slice()}(l)):x?(y=!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=j.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&S.call(n)==T}(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)&&!ye(s)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):y=!1}y&&(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=W?function(e,t){return W(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!!L&&L in e}(e))&&(ye(e)?k:s).test(function(e){if(null!=e){try{return S.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)&&j.call(e,"callee")&&!N.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&ge(e.length)&&!ye(e)}var he=B||function(){return!1};function ye(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ge(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)&&ge(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&&!j.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&&j.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=z(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=z(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 y(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,g=!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,g&&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=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),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){"use strict";var r=n(953);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){"use strict";!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){"use strict";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){"use strict";e.exports=n(790)},953(e){"use strict";e.exports=require("react")}};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{const e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const u={};t=t||[null,e({}),e([]),e(e)];for(var c=2&o&&r;("object"==typeof c||"function"==typeof c)&&!~t.indexOf(c);c=e(c))Object.getOwnPropertyNames(c).forEach(e=>u[e]=()=>r[e]);return u.default=()=>r,n.d(i,u),i}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var o=t[r++],i=t[r++];n.o(e,o)?0===i&&r++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);let r={};(()=>{"use strict";n.r(r),n.d(r,{HONEY_LAYOUT_CSS_PROPERTY_PREFIX:()=>"$",HoneyBox:()=>v,HoneyContextMenu:()=>Cr,HoneyFlex:()=>y,HoneyGrid:()=>O,HoneyGridColumn:()=>_,HoneyGridColumnStyled:()=>E,HoneyLayerRegistry:()=>jr,HoneyLayoutProvider:()=>Lr,HoneyLayoutThemeOverride:()=>kr,HoneyLazyContent:()=>T,HoneyList:()=>A,HoneyOverlay:()=>U,HoneyPopup:()=>Er,HoneyPopupContext:()=>K,HoneyStatusContent:()=>j,__DEV__:()=>t,applyBreakpointStyles:()=>f,createStyles:()=>a,getHoneyListItemId:()=>S,honeyVisibilityTransitionEffect:()=>Pr,mergeRefs:()=>s,resolveScreenState:()=>d,resolveSpacing:()=>Mr,useHoneyGridContext:()=>C,useHoneyLayerRegistryContext:()=>Sr,useHoneyLayout:()=>W,useHoneyMediaQuery:()=>H,useHoneyOverlay:()=>z,useHoneyPopup:()=>br,useHoneyPopupContext:()=>xr,useRegisterHoneyOverlay:()=>B,warnOnce:()=>h});const e=require("@react-hive/honey-style"),t=!1;function o(e,t){if(!e)throw new Error(t)}t&&"undefined"!=typeof window&&!process.env.VITEST_WORKER_ID&&console.info("[@react-hive/honey-layout]: You are running in development mode. This build is not optimized for production and may include extra checks or logs.");const i=e=>"function"==typeof e,u=(e,...t)=>"function"==typeof e?e(...t):e,c=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,s=(...e)=>t=>{e.forEach(e=>{i(e)?e(t):"object"==typeof e&&(e.current=t)})},l=e=>"$"===e[0],a=t=>({theme:n,...r})=>e.css`
2
+ (()=>{var e={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")(),y=t&&!t.nodeType&&t,g=y&&e&&!e.nodeType&&e,b=g&&g.exports===y,x=b&&v.process,w=function(){try{return g&&g.require&&g.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),E=w&&w.isTypedArray,R=Array.prototype,O=Function.prototype,C=Object.prototype,S=h["__core-js_shared__"],_=O.toString,j=C.hasOwnProperty,L=(f=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",T=C.toString,A=_.call(Object),k=RegExp("^"+_.call(j).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,H=R.splice,F=M?M.toStringTag:void 0,W=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),B=P?P.isBuffer:void 0,z=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];j.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&&W?W(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 j.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:j.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():H.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]":F&&F in Object(e)?function(e){var t=j.call(e,F),n=e[F];try{e[F]=void 0;var r=!0}catch(e){}var o=T.call(e);return r&&(t?e[F]=n:delete e[F]),o}(e):function(e){return T.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,y=void 0===h;if(y){var g=ve(l),b=!g&&he(l),x=!g&&!b&&we(l);h=l,g||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?(y=!1,h=function(e){return e.slice()}(l)):x?(y=!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=j.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==A}(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)&&!ye(s)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):y=!1}y&&(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=W?function(e,t){return W(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!!L&&L in e}(e))&&(ye(e)?k: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)&&j.call(e,"callee")&&!N.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&ge(e.length)&&!ye(e)}var he=B||function(){return!1};function ye(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ge(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)&&ge(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&&!j.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&&j.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=z(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=z(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 y(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,g=!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,g&&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=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),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){"use strict";var r=n(953);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){"use strict";!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){"use strict";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){"use strict";e.exports=n(790)},953(e){"use strict";e.exports=require("react")}};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{const e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const u={};t=t||[null,e({}),e([]),e(e)];for(var c=2&o&&r;("object"==typeof c||"function"==typeof c)&&!~t.indexOf(c);c=e(c))Object.getOwnPropertyNames(c).forEach(e=>u[e]=()=>r[e]);return u.default=()=>r,n.d(i,u),i}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var o=t[r++],i=t[r++];n.o(e,o)?0===i&&r++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);let r={};(()=>{"use strict";n.r(r),n.d(r,{HONEY_LAYOUT_CSS_PROPERTY_PREFIX:()=>"$",HoneyBox:()=>v,HoneyContextMenu:()=>Sr,HoneyContextMenuContentOptionStyled:()=>Rr,HoneyFlex:()=>y,HoneyGrid:()=>O,HoneyGridColumn:()=>S,HoneyGridColumnStyled:()=>E,HoneyLayerRegistry:()=>Lr,HoneyLayoutProvider:()=>Tr,HoneyLayoutThemeOverride:()=>Pr,HoneyLazyContent:()=>A,HoneyList:()=>T,HoneyOverlay:()=>U,HoneyPopup:()=>Er,HoneyPopupContext:()=>K,HoneyStatusContent:()=>j,__DEV__:()=>t,applyBreakpointStyles:()=>f,createStyles:()=>a,getHoneyListItemId:()=>_,honeyVisibilityTransitionEffect:()=>Mr,mergeRefs:()=>s,resolveScreenState:()=>d,resolveSpacing:()=>Dr,useHoneyGridContext:()=>C,useHoneyLayerRegistryContext:()=>jr,useHoneyLayout:()=>W,useHoneyMediaQuery:()=>H,useHoneyOverlay:()=>z,useHoneyPopup:()=>br,useHoneyPopupContext:()=>xr,useRegisterHoneyOverlay:()=>B,warnOnce:()=>h});const e=require("@react-hive/honey-style"),t=!1;function o(e,t){if(!e)throw new Error(t)}t&&"undefined"!=typeof window&&!process.env.VITEST_WORKER_ID&&console.info("[@react-hive/honey-layout]: You are running in development mode. This build is not optimized for production and may include extra checks or logs.");const i=e=>"function"==typeof e,u=(e,...t)=>"function"==typeof e?e(...t):e,c=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,s=(...e)=>t=>{e.forEach(e=>{i(e)?e(t):"object"==typeof e&&(e.current=t)})},l=e=>"$"===e[0],a=t=>({theme:n,...r})=>e.css`
3
3
  ${((e,t)=>Object.entries(e).filter(([e,n])=>"xs"===t&&l(e)||n&&"object"==typeof n&&t in n))(r,t).map(([n,r])=>{const o=n.slice(1);return e.css`
4
4
  ${(e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)})(o)}: ${((t,n,r)=>{const o="object"!=typeof n||Array.isArray(n)?n:n[r];if(void 0!==o){if((0,e.isCssSpacingProperty)(t)){if("number"==typeof o||Array.isArray(o))return(0,e.resolveSpacing)(o,"px")}else if((0,e.isCssColorProperty)(t)&&"string"==typeof o&&(0,e.isThemeColorValue)(o))return(0,e.resolveColor)(o);return o}})(o,r,t)};
5
5
  `})}
@@ -33,7 +33,7 @@
33
33
  min-height: ${n};
34
34
  }
35
35
  `}
36
- `,O=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:o=!0,applyColumnMaxWidth:i=!1,...u})=>{const c=(0,b.useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}),[n,r,o,i]);return(0,g.jsx)(w,{value:c,children:(0,g.jsx)(R,{ref:e,spacing:r,"data-testid":"honey-grid",...u,children:t})})},C=()=>{const e=(0,b.useContext)(w);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}=C();return(0,g.jsx)(E,{columns:n,spacing:r,applyMaxWidth:i,$flexGrow:o?1:0,"data-testid":"honey-grid-column",...t,children:e})},S=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,j=({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,g.jsxs)(g.Fragment,{children:[n&&t&&i,o?c:e]}),L=(0,e.styled)(y,({$overflow:e="hidden auto"})=>({$overflow:e}))``,A=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s=!1,emptyContent:l,...a})=>(0,g.jsx)(L,{role:"list","aria-busy":r,"data-testid":"honey-list",...a,children:(0,g.jsx)(j,{loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s||0===t?.length,emptyContent:l,children:t?.map((t,r,o)=>(0,g.jsx)(b.Fragment,{children:e(t,r,o)},String(S(t,n,r))))})}),T=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,u]=(0,b.useState)(r||t),c=(0,b.useRef)(void 0);return(0,b.useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(c.current),u(!0),()=>{o||(c.current=setTimeout(()=>u(!1),n))}},[t,r,n]),i?e:null};var k={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 y(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,g=!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,g&&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=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),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})}}},P={};function M(e){var t=P[e];if(void 0!==t)return t.exports;var n=P[e]={exports:{}};return k[e](n,n.exports,M),n.exports}M.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return M.d(t,{a:t}),t},M.d=(e,t)=>{for(var n in t)M.o(t,n)&&!M.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},M.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),M.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const D=e=>{const t=(0,b.useRef)(e);return t.current=e,t};var $=M(551);M.n($);var I=n(551),N=n.n(I);const H=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,b.useState)(()=>({...d(e.breakpoints),...n}));return(0,b.useEffect)(()=>{const r=N()(()=>{o({...d(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},F=(0,b.createContext)(void 0),W=()=>{const e=(0,b.useContext)(F);return o(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},B=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=W(),o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},z=(e,{enabled:t=!0,onKeyUp:n}={})=>{const{overlays:r}=W(),o=(0,b.useMemo)(()=>t?r.find(t=>t.id===e)??null:null,[t,r,e]);return(0,b.useEffect)(()=>{if(o&&n)return o.addListener("keyup",n),()=>{o.removeListener("keyup",n)}},[o,n]),o},U=({ref:e,children:t,active:n,overlayId:r,onDeactivate:o,onKeyUp:i,...c})=>{const l=D(i),a=D(o),f=(0,b.useCallback)((e,...t)=>{l.current?l.current(e,...t):"Escape"===e&&a.current()},[]),d=B(n,{id:r,onKeyUp:f}),p=s(d?.setContainerRef,e);return(0,g.jsx)(y,{ref:p,inert:!n,...c,children:u(t,{overlay:d,isActive:n,deactivateOverlay:a.current})})},K=(0,b.createContext)(void 0);function V(){return"undefined"!=typeof window}function q(e){return G(e)?(e.nodeName||"").toLowerCase():"#document"}function X(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Y(e){var t;return null==(t=(G(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function G(e){return!!V()&&(e instanceof Node||e instanceof X(e).Node)}function Z(e){return!!V()&&(e instanceof Element||e instanceof X(e).Element)}function Q(e){return!!V()&&(e instanceof HTMLElement||e instanceof X(e).HTMLElement)}function J(e){return!(!V()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof X(e).ShadowRoot)}function ee(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function te(e){return/^(table|td|th)$/.test(q(e))}function ne(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const re=/transform|translate|scale|rotate|perspective|filter/,oe=/paint|layout|strict|content/,ie=e=>!!e&&"none"!==e;let ue;function ce(e){const t=Z(e)?ae(e):e;return ie(t.transform)||ie(t.translate)||ie(t.scale)||ie(t.rotate)||ie(t.perspective)||!se()&&(ie(t.backdropFilter)||ie(t.filter))||re.test(t.willChange||"")||oe.test(t.contain||"")}function se(){return null==ue&&(ue="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ue}function le(e){return/^(html|body|#document)$/.test(q(e))}function ae(e){return X(e).getComputedStyle(e)}function fe(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function de(e){if("html"===q(e))return e;const t=e.assignedSlot||e.parentNode||J(e)&&e.host||Y(e);return J(t)?t.host:t}function pe(e){const t=de(e);return le(t)?e.ownerDocument?e.ownerDocument.body:e.body:Q(t)&&ee(t)?t:pe(t)}function ve(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=pe(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=X(o);if(i){const e=me(u);return t.concat(u,u.visualViewport||[],ee(o)?o:[],e&&n?ve(e):[])}return t.concat(o,ve(o,[],n))}function me(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var he=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[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(","),ye="undefined"==typeof Element,ge=ye?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,be=!ye&&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},xe=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]"):xe(e.parentNode))},we=function(e,t,n){if(xe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(he));return t&&ge.call(e,he)&&r.unshift(e),r.filter(n)},Ee=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!xe(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,s=Ee(c,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{ge.call(i,he)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!xe(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=Ee(!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},Re=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Oe=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))&&!Re(e)?0:e.tabIndex},Ce=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},_e=function(e){return"INPUT"===e.tagName},Se=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},je=function(e,t){return!(t.disabled||function(e){return _e(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});var o=getComputedStyle(e).visibility;if("hidden"===o||"collapse"===o)return!0;var i=ge.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ge.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Se(e)}else{if("function"==typeof r){for(var u=e;e;){var c=e.parentElement,s=be(e);if(c&&!c.shadowRoot&&!0===r(c))return Se(e);e=e.assignedSlot?e.assignedSlot:c||s===e.ownerDocument?c:s.host}e=u}if(function(e){var t,n,r,o,i=e&&be(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=be(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!!ge.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Le=function(e,t){return!(function(e){return function(e){return _e(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||be(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)||Oe(t)<0||!je(e,t))},Ae=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Te=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=Oe(e);return n<0&&t&&!Re(e)?0:n}(i,o),c=o?Te(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(Ce).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ke=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ee([e],t.includeContainer,{filter:Le.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ae}):we(e,t.includeContainer,Le.bind(null,t)),Te(n)},Pe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ge.call(e,he)&&Le(t,e)};function Me(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function De(){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 $e(){return/apple/i.test(navigator.vendor)}function Ie(){const e=/android/i;return e.test(Me())||e.test(De())}function Ne(){return De().includes("jsdom/")}const He="data-floating-ui-focusable";function Fe(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 We(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&J(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Be(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ze(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 Ue(e){return(null==e?void 0:e.ownerDocument)||document}function Ke(e){return Q(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ve(e){return!!e&&"combobox"===e.getAttribute("role")&&Ke(e)}function qe(e){return e?e.hasAttribute(He)?e:e.querySelector("["+He+"]")||e:null}function Xe(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,...Xe(e,t.id,n)])}function Ye(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 Ge(e){e.preventDefault(),e.stopPropagation()}function Ze(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Qe="undefined"!=typeof document?b.useLayoutEffect:function(){};function Je(e){const t=b.useRef(e);return Qe(()=>{t.current=e}),t}const et={...x}.useInsertionEffect||(e=>e());function tt(e){const t=b.useRef(()=>{});return et(()=>{t.current=e}),b.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 nt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rt(e,t){const n=ke(e,nt()),r=n.length;if(0===r)return;const o=Fe(Ue(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function ot(e){return rt(Ue(e).body,1)||e}function it(e){return rt(Ue(e).body,-1)||e}function ut(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!We(n,r)}function ct(e){ke(e,nt()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function st(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 lt=n(163);const at=["start","end"],ft=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+at[0],t+"-"+at[1]),[]),dt=Math.min,pt=Math.max,vt=Math.round,mt=Math.floor,ht=e=>({x:e,y:e}),yt={left:"right",right:"left",bottom:"top",top:"bottom"};function gt(e,t,n){return pt(e,dt(t,n))}function bt(e,t){return"function"==typeof e?e(t):e}function xt(e){return e.split("-")[0]}function wt(e){return e.split("-")[1]}function Et(e){return"x"===e?"y":"x"}function Rt(e){return"y"===e?"height":"width"}function Ot(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Ct(e){return Et(Ot(e))}function _t(e,t,n){void 0===n&&(n=!1);const r=wt(e),o=Ct(e),i=Rt(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=kt(u)),[u,kt(u)]}function St(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jt=["left","right"],Lt=["right","left"],At=["top","bottom"],Tt=["bottom","top"];function kt(e){const t=xt(e);return yt[t]+e.slice(t.length)}function Pt(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 Mt(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 Dt(e,t,n){let{reference:r,floating:o}=e;const i=Ot(t),u=Ct(t),c=Rt(u),s=xt(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(wt(t)){case"start":p[u]-=d*(n&&l?-1:1);break;case"end":p[u]+=d*(n&&l?-1:1)}return p}async function $t(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}=bt(t,e),v=Pt(p),m=c[d?"floating"===f?"reference":"floating":f],h=Mt(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})),y="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},x=Mt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:g,strategy:s}):y);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 It=new Set(["left","top"]);function Nt(e){const t=ae(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Q(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=vt(n)!==i||vt(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function Ht(e){return Z(e)?e:e.contextElement}function Ft(e){const t=Ht(e);if(!Q(t))return ht(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Nt(t);let u=(i?vt(n.width):n.width)/r,c=(i?vt(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Wt=ht(0);function Bt(e){const t=X(e);return se()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Wt}function zt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ht(e);let u=ht(1);t&&(r?Z(r)&&(u=Ft(r)):u=Ft(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==X(e))&&t}(i,n,r)?Bt(i):ht(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=X(i),t=r&&Z(r)?X(r):r;let n=e,o=me(n);for(;o&&r&&t!==n;){const e=Ft(o),t=o.getBoundingClientRect(),r=ae(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=X(o),o=me(n)}}return Mt({width:a,height:f,x:s,y:l})}function Ut(e,t){const n=fe(e).scrollLeft;return t?t.left+n:zt(Y(e)).left+n}function Kt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ut(e,n),y:n.top+t.scrollTop}}function Vt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=X(e),r=Y(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=se();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}const l=Ut(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=Y(e),n=fe(e),r=e.ownerDocument.body,o=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Ut(e);const c=-n.scrollTop;return"rtl"===ae(r).direction&&(u+=pt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}(Y(e));else if(Z(t))r=function(e,t){const n=zt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Q(e)?Ft(e):ht(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=Bt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Mt(r)}function qt(e,t){const n=de(e);return!(n===t||!Z(n)||le(n))&&("fixed"===ae(n).position||qt(n,t))}function Xt(e,t,n){const r=Q(t),o=Y(t),i="fixed"===n,u=zt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=ht(0);function l(){s.x=Ut(o)}if(r||!r&&!i)if(("body"!==q(t)||ee(o))&&(c=fe(t)),r){const e=zt(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?ht(0):Kt(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 Yt(e){return"static"===ae(e).position}function Gt(e,t){if(!Q(e)||"fixed"===ae(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Y(e)===n&&(n=n.ownerDocument.body),n}function Zt(e,t){const n=X(e);if(ne(e))return n;if(!Q(e)){let t=de(e);for(;t&&!le(t);){if(Z(t)&&!Yt(t))return t;t=de(t)}return n}let r=Gt(e,t);for(;r&&te(r)&&Yt(r);)r=Gt(r,t);return r&&le(r)&&Yt(r)&&!ce(r)?n:r||function(e){let t=de(e);for(;Q(t)&&!le(t);){if(ce(t))return t;if(ne(t))return null;t=de(t)}return null}(e)||n}const Qt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=Y(r),c=!!t&&ne(t.floating);if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=ht(1);const a=ht(0),f=Q(r);if((f||!f&&!i)&&(("body"!==q(r)||ee(u))&&(s=fe(r)),f)){const e=zt(r);l=Ft(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?ht(0):Kt(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:Y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ne(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ve(e,[],!1).filter(e=>Z(e)&&"body"!==q(e)),o=null;const i="fixed"===ae(e).position;let u=i?de(e):e;for(;Z(u)&&!le(u);){const t=ae(u),n=ce(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||ee(u)&&!n&&qt(e,u))?r=r.filter(e=>e!==u):o=t,u=de(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=Vt(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=Vt(t,i[e],o);c=pt(n.top,c),s=dt(n.right,s),l=dt(n.bottom,l),a=pt(n.left,a)}return{width:s-a,height:l-c,x:a,y:c}},getOffsetParent:Zt,getElementRects:async function(e){const t=this.getOffsetParent||Zt,n=this.getDimensions,r=await n(e.floating);return{reference:Xt(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}=Nt(e);return{width:t,height:n}},getScale:Ft,isElement:Z,isRTL:function(e){return"rtl"===ae(e).direction}};function Jt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const en=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}=bt(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=xt(o),g=Ot(c),b=xt(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(l.floating)),w=d||(b||!m?[kt(c)]:function(e){const t=kt(e);return[St(e),t,St(t)]}(c)),E="none"!==v;!d&&E&&w.push(...function(e,t,n,r){const o=wt(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Lt:jt:t?jt:Lt;case"left":case"right":return t?At:Tt;default:return[]}}(xt(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(St)))),i}(c,m,v,x));const R=[c,...w],O=await s.detectOverflow(t,h),C=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&C.push(O[y]),f){const e=_t(o,u,x);C.push(O[e[0]],O[e[1]])}if(_=[..._,{placement:o,overflows:C}],!C.every(e=>e<=0)){var S,j;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=R[e];if(t&&("alignment"!==f||g===Ot(t)||_.every(e=>Ot(e.placement)!==g||e.overflows[0]>0)))return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(j=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!n)switch(p){case"bestFit":{var L;const e=null==(L=_.filter(e=>{if(E){const t=Ot(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},tn=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}=bt(e,t)||{};if(null==l)return{};const f=Pt(a),d={x:n,y:r},p=Ct(o),v=Rt(p),m=await u.getDimensions(l),h="y"===p,y=h?"top":"left",g=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,_=dt(f[y],C),S=dt(f[g],C),j=_,L=R-m[v]-S,A=R/2-m[v]/2+O,T=gt(j,A,L),k=!s.arrow&&null!=wt(o)&&A!==T&&i.reference[v]/2-(A<j?_:S)-m[v]/2<0,P=k?A<j?A-j:A-L:0;return{[p]:d[p]+P,data:{[p]:T,centerOffset:A-T-P,...k&&{alignmentOffset:P}},reset:k}}}),nn=(e,t,n)=>{const r=new Map,o={platform:Qt,...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:$t},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}=Dt(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:y}=m,{x:g,y:b,data:x,reset:w}=await y({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:l,platform:c,elements:{reference:e,floating:t}});a=null!=g?g: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}=Dt(l,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:v}})(e,t,{...o,platform:i})};var rn="undefined"!=typeof document?b.useLayoutEffect:function(){};function on(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(!on(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||on(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function un(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cn(e,t){const n=un(e);return Math.round(t*n)/n}function sn(e){const t=b.useRef(e);return rn(()=>{t.current=e}),t}const ln="data-floating-ui-focusable",an="active",fn="selected",dn={...x};let pn=!1,vn=0;const mn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+vn++,hn=dn.useId||function(){const[e,t]=b.useState(()=>pn?mn():void 0);return Qe(()=>{null==e&&t(mn())},[]),b.useEffect(()=>{pn=!0},[]),e},yn=b.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=hn(),[y,x]=b.useState(!1);if(Qe(()=>{r&&"rtl"===ae(r).direction&&x(!0)},[r]),!r)return null;const[w,E]=n.split("-"),R="top"===w||"bottom"===w;let O=a;(R&&null!=i&&i.x||!R&&null!=i&&i.y)&&(O=null);const C=2*l,_=C/2,S=u/2*(s/-8+1),j=c/2*s/4,L=!!d,A=O&&"end"===E?"bottom":"top";let T=O&&"end"===E?"right":"left";O&&y&&(T="end"===E?"left":"right");const k=null!=(null==o?void 0:o.x)?O||o.x:"",P=null!=(null==o?void 0:o.y)?O||o.y:"",M=d||"M0,0 H"+u+" L"+(u-S)+","+(c-j)+" Q"+u/2+","+c+" "+S+","+(c-j)+" Z",D={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,g.jsxs)("svg",{...m,"aria-hidden":!0,ref:t,width:L?u:u+C,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[T]:k,[A]:P,[w]:R||L?"100%":"calc(100% - "+C/2+"px)",transform:[D,p].filter(e=>!!e).join(" "),...v},children:[C>0&&(0,g.jsx)("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:C+(d?0:1),d:M}),(0,g.jsx)("path",{stroke:C&&!d?m.fill:"none",d:M}),(0,g.jsx)("clipPath",{id:h,children:(0,g.jsx)("rect",{x:-_,y:_*(L?-1:1),width:u+C,height:u})})]})});function gn(){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 bn=b.createContext(null),xn=b.createContext(null),wn=()=>{var e;return(null==(e=b.useContext(bn))?void 0:e.id)||null},En=()=>b.useContext(xn);function Rn(e){const{children:t,id:n}=e,r=wn();return(0,g.jsx)(bn.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function On(e){const{children:t}=e,n=b.useRef([]),r=b.useCallback(e=>{n.current=[...n.current,e]},[]),o=b.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[i]=b.useState(()=>gn());return(0,g.jsx)(xn.Provider,{value:b.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i]),children:t})}function Cn(e){return"data-floating-ui-"+e}function _n(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Sn=Cn("safe-polygon");function jn(e,t,n){if(n&&!Ze(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 Ln(e){return"function"==typeof e?e():e}let An=0;function Tn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(An);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():An=requestAnimationFrame(i)}function kn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&J(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Pn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Mn(e){return"inert"===e?Pn.inert:"aria-hidden"===e?Pn["aria-hidden"]:Pn.none}let Dn=new WeakSet,$n={},In=0;function Nn(e){return e?J(e)?e.host:Nn(e.parentNode):null}const Hn=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Nn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function Fn(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=Hn(t,e),c=new Set,s=new Set(u),l=[];$n[o]||($n[o]=new WeakMap);const a=$n[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=Mn(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&&Dn.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),c.clear(),In++,()=>{l.forEach(e=>{const t=Mn(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!Dn.has(e)&&i&&e.removeAttribute(i),Dn.delete(e)),r||e.removeAttribute(o)}),In--,In||(Pn.inert=new WeakMap,Pn["aria-hidden"]=new WeakMap,Pn.none=new WeakMap,Dn=new WeakSet,$n={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Wn={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},Bn=b.forwardRef(function(e,t){const[n,r]=b.useState();Qe(()=>{$e()&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Cn("focus-guard")]:"",style:Wn};return(0,g.jsx)("span",{...e,...o})}),zn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Un=b.createContext(null),Kn=Cn("portal");function Vn(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=hn(),o=qn(),[i,u]=b.useState(null),c=b.useRef(null);return Qe(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{c.current=null})},[i]),Qe(()=>{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(Kn,""),e.appendChild(n),c.current=n,u(n)},[t,r]),Qe(()=>{if(null===n)return;if(!r)return;if(c.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!G(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(Kn,""),e=i||e,e.appendChild(s),c.current=s,u(s)},[t,n,r,o]),i}({id:n,root:r}),[u,c]=b.useState(null),s=b.useRef(null),l=b.useRef(null),a=b.useRef(null),f=b.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 b.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&&ut(e)&&("focusin"===e.type?st:ct)(i)}},[i,o,d]),b.useEffect(()=>{i&&(p||st(i))},[p,i]),(0,g.jsxs)(Un.Provider,{value:b.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:l,beforeInsideRef:a,afterInsideRef:f,portalNode:i,setFocusManagerState:c}),[o,i]),children:[v&&i&&(0,g.jsx)(Bn,{"data-type":"outside",ref:s,onFocus:e=>{if(ut(e,i)){var t;null==(t=a.current)||t.focus()}else{const e=it(u?u.domReference:null);null==e||e.focus()}}}),v&&i&&(0,g.jsx)("span",{"aria-owns":i.id,style:zn}),i&&lt.createPortal(t,i),v&&i&&(0,g.jsx)(Bn,{"data-type":"outside",ref:l,onFocus:e=>{if(ut(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=ot(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=()=>b.useContext(Un);function Xn(e){return b.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let Yn=[];function Gn(){Yn=Yn.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function Zn(){Gn();const e=Yn[Yn.length-1];return null==e?void 0:e.deref()}function Qn(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=nt(),o=function(e,t){return(t=t||{}).getShadowRoot?Ee([e],t.includeContainer,{filter:je.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):we(e,t.includeContainer,je.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Pe(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 Jn=b.forwardRef(function(e,t){return(0,g.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Wn})});function er(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:y,elements:{domReference:x,floating:w}}=t,E=tt(()=>{var e;return null==(e=y.current.floatingContext)?void 0:e.nodeId}),R=tt(p),O="number"==typeof u&&u<0,C=Ve(x)&&O,_="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,S=!_||i,j=!S||_&&d,L=Je(o),A=Je(u),T=Je(c),k=En(),P=qn(),M=b.useRef(null),D=b.useRef(null),$=b.useRef(!1),I=b.useRef(!1),N=b.useRef(-1),H=b.useRef(-1),F=null!=P,W=qe(w),B=tt(function(e){return void 0===e&&(e=W),e?ke(e,nt()):[]}),z=tt(e=>{const t=B(e);return L.current.map(e=>x&&"reference"===e?x:W&&"floating"===e?W:t).filter(Boolean).flat()});b.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){We(W,Fe(Ue(W)))&&0===B().length&&!C&&Ge(e);const t=z(),n=Be(e);"reference"===L.current[0]&&n===x&&(Ge(e),e.shiftKey?Tn(t[t.length-1]):Tn(t[1])),"floating"===L.current[1]&&n===W&&e.shiftKey&&(Ge(e),Tn(t[0]))}}const t=Ue(W);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,x,W,l,L,C,B,z]),b.useEffect(()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Be(e),n=B().indexOf(t);-1!==n&&(N.current=n)}},[r,w,B]),b.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=Be(e);queueMicrotask(()=>{const o=E(),i=!(We(x,t)||We(w,t)||We(t,w)||We(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Cn("focus-guard"))||k&&(Xe(k.nodesRef.current,o).find(e=>{var n,r;return We(null==(n=e.context)?void 0:n.elements.floating,t)||We(null==(r=e.context)?void 0:r.elements.domReference,t)})||Ye(k.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===x&&W&&Qn(W,L),s&&n!==x&&(null==r||!r.isConnected)&&Fe(Ue(W))===Ue(W).body){Q(W)&&W.focus();const e=N.current,t=B(),n=t[e]||t[t.length-1]||W;Q(n)&&n.focus()}y.current.insideReactTree?y.current.insideReactTree=!1:!C&&l||!t||!i||I.current||t===Zn()||($.current=!0,m(!1,e,"focus-out"))})}const n=Boolean(!k&&P);function o(){_n(H),y.current.insideReactTree=!0,H.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}return w&&Q(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),n&&w.addEventListener("focusout",o,!0),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t),n&&w.removeEventListener("focusout",o,!0)}):void 0},[r,x,w,W,l,k,P,m,f,s,B,C,E,L,y]);const U=b.useRef(null),K=b.useRef(null),V=Xn([U,null==P?void 0:P.beforeInsideRef]),X=Xn([K,null==P?void 0:P.afterInsideRef]);function Y(e){return!r&&a&&l?(0,g.jsx)(Jn,{ref:"start"===e?M:D,onClick:e=>m(!1,e.nativeEvent),children:"string"==typeof a?a:"Dismiss"}):null}b.useEffect(()=>{var e,t;if(r)return;if(!w)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Cn("portal")+"]"))||[]),o=null==(t=(k?Ye(k.nodesRef.current,E()):[]).find(e=>{var t;return Ve((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[w,o,...n,...R(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,L.current.includes("reference")||C?x:null].filter(e=>null!=e),u=l||C?Fn(i,!j,j):Fn(i);return()=>{u()}},[r,x,w,l,L,P,C,S,j,k,E,R]),Qe(()=>{if(r||!Q(W))return;const e=Fe(Ue(W));queueMicrotask(()=>{const t=z(W),n=A.current,r=("number"==typeof n?t[n]:n.current)||W,o=We(W,e);O||o||!v||Tn(r,{preventScroll:r===W})})},[r,v,W,O,z,A]),Qe(()=>{if(r||!W)return;const e=Ue(W);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)||(Ie()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!Ne()&&(!Ie()&&0===e.width&&0===e.height||Ie()&&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=Fe(e),Gn(),t&&"body"!==q(t)&&(Yn.push(new WeakRef(t)),Yn.length>20&&(Yn=Yn.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,Wn),F&&x&&x.insertAdjacentElement("afterend",o),()=>{h.off("openchange",n);const t=Fe(e),r=We(w,t)||k&&Xe(k.nodesRef.current,E(),!1).some(e=>{var n;return We(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof T.current){const e=x||Zn();return e&&e.isConnected?e:o}return T.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=nt();return Pe(e,t)?e:ke(e,t)[0]||e}(i);T.current&&!$.current&&Q(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,w,W,T,y,h,k,F,x,E]),b.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(Gn)}),[r]),Qe(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:v,onOpenChange:m,domReference:x}),()=>{P.setFocusManagerState(null)}},[r,P,l,v,m,f,x]),Qe(()=>{r||W&&Qn(W,L)},[r,W,L]);const G=!r&&S&&(!l||!C)&&(F||l);return(0,g.jsxs)(g.Fragment,{children:[G&&(0,g.jsx)(Bn,{"data-type":"inside",ref:V,onFocus:e=>{if(l){const e=z();Tn("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,ut(e,P.portalNode)){const e=ot(x);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!C&&Y("start"),n,Y("end"),G&&(0,g.jsx)(Bn,{"data-type":"inside",ref:X,onFocus:e=>{if(l)Tn(z()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&($.current=!0),ut(e,P.portalNode)){const e=it(x);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function tr(e){return Q(e.target)&&"BUTTON"===e.target.tagName}function nr(e){return Ke(e)}function rr(e){return null!=e&&null!=e.clientX}const or={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ir={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ur=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 cr(){return Me().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&$e()}function sr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[an]:t,[fn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[ln]:""},...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&&[an,fn].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 lr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),ar=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function fr(e,t){return"function"==typeof e?e(t):e}function dr(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,...dr(e,t.id,n)])}function pr(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 vr(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(){_n(o),d()}if(_n(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:y}=e,g=[h,y],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=kn(f.floating,b),E=kn(f.domReference,b),R=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],_=n>O.right-O.width/2,S=l>O.bottom-O.height/2,j=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(g,R),L=O.width>R.width,A=O.height>R.height,T=(L?R:O).left,k=(L?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&&Z(e.relatedTarget)&&kn(f.floating,e.relatedTarget))return;if(v&&dr(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=[[T,R.top+1],[T,O.bottom-1],[k,O.bottom-1],[k,R.top+1]];break;case"bottom":D=[[T,O.top+1],[T,R.bottom-1],[k,R.bottom-1],[k,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(!pr([h,y],D)){if(i&&!j)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()}pr([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:_?n+4*t:n-4*t,r+t+1],[L?n-t/2:_?n+4*t:n-4*t,r+t+1],[O.left,_||L?O.bottom-t:O.top],[O.right,_?L?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[L?n+t/2:_?n+4*t:n-4*t,r-t],[L?n-t/2:_?n+4*t:n-4*t,r-t],[O.left,_||L?O.top+t:O.bottom],[O.right,_?L?O.top+t:O.bottom:O.top+t]];case"left":{const e=[n+t+1,A?r+t/2:S?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:S?r+4*t:r-4*t];return[[S||A?O.right-t:O.left,O.top],[S?A?O.right-t:O.left:O.right-t,O.bottom],e,o]}case"right":return[[n-t,A?r+t/2:S?r+4*t:r-4*t],[n-t,A?r-t/2:S?r+4*t:r-4*t],[S||A?O.left+t:O.right,O.top],[S?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 mr=({children:e,enabled:t=!0,...n})=>{const r=wn();return!t||r?e:(0,g.jsx)(On,{...n,children:e})},hr=(0,e.styled)(y,({$width:e="max-content"})=>({$width:e}))``,yr=({children:e,enabled:t=!0,...n})=>t?(0,g.jsx)(Vn,{...n,children:e}):e,gr=(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=En(),h=tt("function"==typeof s?s:()=>!1),y="function"==typeof s?h:s,g=b.useRef(!1),{escapeKey:x,outsidePress:w}=ur(p),{escapeKey:E,outsidePress:R}=ur(v),O=b.useRef(!1),C=tt(e=>{var t;if(!n||!u||!c||"Escape"!==e.key)return;if(O.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,s=m?Xe(m.nodesRef.current,o):[];if(!x&&(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")}),_=tt(e=>{var t;const n=()=>{var t;C(e),null==(t=Be(e))||t.removeEventListener("keydown",n)};null==(t=Be(e))||t.addEventListener("keydown",n)}),S=tt(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=g.current;if(g.current=!1,"click"===l&&u)return;if(n)return;if("function"==typeof y&&!y(e))return;const c=Be(e),s="["+Cn("inert")+"]",a=Ue(o.floating).querySelectorAll(s);let f=Z(c)?c:null;for(;f&&!le(f);){const e=de(f);if(le(e)||!Z(e))break;f=e}if(a.length&&Z(c)&&!c.matches("html,body")&&!We(c,o.floating)&&Array.from(a).every(e=>!We(f,e)))return;if(Q(c)&&A){const t=le(c),n=ae(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&&Xe(m.nodesRef.current,d).some(t=>{var n;return ze(e,null==(n=t.context)?void 0:n.elements.floating)});if(ze(e,o.floating)||ze(e,o.domReference)||p)return;const v=m?Xe(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")}),j=tt(e=>{var t;const n=()=>{var t;S(e),null==(t=Be(e))||t.removeEventListener(l,n)};null==(t=Be(e))||t.addEventListener(l,n)});b.useEffect(()=>{if(!n||!u)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function s(){window.clearTimeout(e),O.current=!0}function a(){e=window.setTimeout(()=>{O.current=!1},se()?5:0)}const f=Ue(o.floating);c&&(f.addEventListener("keydown",E?_:C,E),f.addEventListener("compositionstart",s),f.addEventListener("compositionend",a)),y&&f.addEventListener(l,R?j:S,R);let p=[];return d&&(Z(o.domReference)&&(p=ve(o.domReference)),Z(o.floating)&&(p=p.concat(ve(o.floating))),!Z(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(ve(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",E?_:C,E),f.removeEventListener("compositionstart",s),f.removeEventListener("compositionend",a)),y&&f.removeEventListener(l,R?j:S,R),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,c,y,l,n,r,d,u,x,w,C,E,_,S,R,j]),b.useEffect(()=>{i.current.insideReactTree=!1},[i,y,l]);const L=b.useMemo(()=>({onKeyDown:C,...a&&{[or[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[C,r,a,f]),A=b.useMemo(()=>{function e(e){0===e.button&&(g.current=!0)}return{onKeyDown:C,onMouseDown:e,onMouseUp:e,[ir[l]]:()=>{i.current.insideReactTree=!0}}},[C,l,i]);return b.useMemo(()=>u?{reference:L,floating:A}:{},[u,L,A])}(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=b.useRef(),p=b.useRef(!1),v=b.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==c&&(Ze(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:Ze(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||tr(e)||(" "!==e.key||nr(i)||(e.preventDefault(),p.current=!0),function(e){return Q(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!a||tr(e)||nr(i)||" "===e.key&&p.current&&(p.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[o,i,c,l,a,r,n,f,s]);return b.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=En(),v=wn(),m=Je(l),h=Je(s),y=Je(n),g=Je(f),x=b.useRef(),w=b.useRef(-1),E=b.useRef(),R=b.useRef(-1),O=b.useRef(!0),C=b.useRef(!1),_=b.useRef(()=>{}),S=b.useRef(!1),j=tt(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});b.useEffect(()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(_n(w),_n(R),O.current=!0,S.current=!1)}},[c,i]),b.useEffect(()=>{if(!c)return;if(!m.current)return;if(!n)return;function e(e){j()&&r(!1,e,"hover")}const t=Ue(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,r,c,m,j]);const L=b.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=jn(h.current,"close",x.current);o&&!E.current?(_n(w),w.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(_n(w),r(!1,e,n))},[h,r]),A=tt(()=>{_.current(),E.current=void 0}),T=tt(()=>{if(C.current){const e=Ue(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Sn),C.current=!1}}),k=tt(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));b.useEffect(()=>{if(c&&Z(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(_n(w),O.current=!1,a&&!Ze(x.current)||Ln(g.current)>0&&!jn(h.current,"open"))return;const t=jn(h.current,"open",x.current);t?w.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(k())return void T();_.current();const t=Ue(u.floating);if(_n(R),S.current=!1,m.current&&o.current.floatingContext){n||_n(w),E.current=m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){T(),A(),k()||L(e,!0,"safe-polygon")}});const r=E.current;return t.addEventListener("mousemove",r),void(_.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==x.current||!We(u.floating,e.relatedTarget))&&L(e)}function i(e){k()||o.current.floatingContext&&(null==m.current||m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){T(),A(),k()||L(e)}})(e))}function s(){_n(w)}function l(e){k()||L(e,!1)}},[u,c,e,a,d,L,A,T,r,n,y,p,h,m,o,k,g]),Qe(()=>{var e;if(c&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&j()){C.current=!0;const e=u.floating;if(Z(u.domReference)&&e){var t;const n=Ue(u.floating).body;n.setAttribute(Sn,"");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,j]),Qe(()=>{n||(x.current=void 0,S.current=!1,A(),T())},[n,A,T]),b.useEffect(()=>()=>{A(),_n(w),_n(R),T()},[c,u.domReference,A,T]);const P=b.useMemo(()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){O.current||y.current||r(!0,t,"hover")}a&&!Ze(x.current)||n||0===Ln(g.current)||S.current&&e.movementX**2+e.movementY**2<2||(_n(R),"touch"===x.current?o():(S.current=!0,R.current=window.setTimeout(o,Ln(g.current))))}}},[a,r,n,y,g]);return b.useMemo(()=>c?{reference:P}:{},[c,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:vr(),...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=b.useRef(!1),a=b.useRef(-1),f=b.useRef(!0);b.useEffect(()=>{if(!c)return;const e=X(u.domReference);function t(){!n&&Q(u.domReference)&&u.domReference===Fe(Ue(u.domReference))&&(l.current=!0)}function r(){f.current=!0}function o(){f.current=!1}return e.addEventListener("blur",t),cr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),cr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[u.domReference,n,c]),b.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]),b.useEffect(()=>()=>{_n(a)},[]);const d=b.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;const t=Be(e.nativeEvent);if(s&&Z(t))if(cr()&&!e.relatedTarget){if(!f.current&&!Ke(t))return}else if(!function(e){if(!e||Ne())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=Z(t)&&t.hasAttribute(Cn("focus-guard"))&&"outside"===t.getAttribute("data-type");a.current=window.setTimeout(()=>{var e;const c=Fe(u.domReference?u.domReference.ownerDocument:document);(t||c!==u.domReference)&&(We(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,c)||We(u.domReference,c)||o||r(!1,n,"focus"))})}}),[i,u.domReference,r,s]);return b.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=b.useRef(!1),d=b.useRef(null),[p,v]=b.useState(),[m,h]=b.useState([]),y=tt((e,t)=>{f.current||r.current.openEvent&&!rr(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}))}),g=tt(e=>{null==l&&null==a&&(n?d.current||h([]):y(e.clientX,e.clientY))}),x=Ze(p)?o:n,w=b.useCallback(()=>{if(!x||!c||null!=l||null!=a)return;const e=X(o);function t(n){const r=Be(n);We(o,r)?(e.removeEventListener("mousemove",t),d.current=null):y(n.clientX,n.clientY)}if(!r.current.openEvent||rr(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}u.setPositionReference(i)},[x,c,l,a,o,r,u,i,y]);b.useEffect(()=>w(),[w,m]),b.useEffect(()=>{c&&!o&&(f.current=!1)},[c,o]),b.useEffect(()=>{!c&&n&&(f.current=!0)},[c,n]),Qe(()=>{!c||null==l&&null==a||(f.current=!1,y(l,a))},[c,l,a,y]);const E=b.useMemo(()=>{function e(e){let{pointerType:t}=e;v(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return b.useMemo(()=>c?{reference:E}:{},[c,E])}(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=hn(),a=(null==(n=i.domReference)?void 0:n.id)||l,f=b.useMemo(()=>{var e;return(null==(e=qe(i.floating))?void 0:e.id)||u},[i.floating,u]),d=null!=(r=lr.get(s))?r:s,p=null!=wn(),v=b.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=b.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=b.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 b.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=b.useCallback(t=>sr(t,e,"reference"),t),i=b.useCallback(t=>sr(t,e,"floating"),n),u=b.useCallback(t=>sr(t,e,"item"),r);return b.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}([a,f,d,p,v,m,...l])},br=({enabled:e=!0,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:u,clientPointsOptions:c,roleOptions:s,extraInteractions:l,open:a,floatingOptions:f,useOffset:d=!0,offsetOptions:p,useFlip:v=!0,flipOptions:m,useShift:h=!0,shiftOptions:y,useArrow:g=!1,arrowOptions:x,transitionOptions:w,useAutoPlacement:E=!1,autoPlacementOptions:R,useAutoUpdate:O=!1,autoUpdateOptions:C,useAutoSize:_=!1,sizeOptions:S,minAcceptableWidth:j=null,minAcceptableHeight:L=null,maxAcceptableWidth:A,maxAcceptableHeight:T,onOpen:k,onClose:P})=>{const{theme:M}=W(),D=function(){const e=hn(),t=En(),n=wn();return Qe(()=>{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,b.useState)(!1),N=(0,b.useRef)(null),H=e&&(a??$);(0,b.useEffect)(()=>{H&&k?.()},[H]),((e,t)=>{const n=(0,b.useRef)(e);(0,b.useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(e,e=>{e||I(!1)});const F=[];d&&F.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=xt(n),c=wt(n),s="y"===Ot(n),l=It.has(u)?-1:1,a=i&&s?-1:1,f=bt(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]}})(p??M.spacings.base));let B=null;if(E?F.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=ft,autoAlignment:p=!0,...v}=bt(e,t),m=void 0!==f||d===ft?function(e,t,n){return(e?[...n.filter(t=>wt(t)===e),...n.filter(t=>wt(t)!==e)]:n.filter(e=>xt(e)===e)).filter(n=>!e||wt(n)===e||!!t&&St(n)!==n)}(f||null,p,d):d,h=await s.detectOverflow(t,v),y=(null==(n=u.autoPlacement)?void 0:n.index)||0,g=m[y];if(null==g)return{};const b=_t(g,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));if(c!==g)return{reset:{placement:m[0]}};const x=[h[xt(g)],h[b[0]],h[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:g,overflows:x}],E=m[y+1];if(E)return{data:{index:y+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=wt(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,wt(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:y+1,overflows:w},reset:{placement:C}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(R)):v&&(B=(e=>{const t=en(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...m})),_){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}=bt(e,t),a=await u.detectOverflow(t,l),f=xt(o),d=wt(o),p="y"===Ot(o),{width:v,height:m}=i.floating;let h,y;"top"===f||"bottom"===f?(h=f,y=d===(await(null==u.isRTL?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(y=f,h="end"===d?"top":"bottom");const g=m-a.top-a.bottom,b=v-a.left-a.right,x=dt(m-a[h],g),w=dt(v-a[y],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=g),E&&!d){const e=pt(a.left,0),t=pt(a.right,0),n=pt(a.top,0),r=pt(a.bottom,0);p?O=v-2*(0!==e||0!==t?e+t:pt(a.left,a.right)):R=m-2*(0!==n||0!==r?n+r:pt(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]}})({...S,apply({elements:e,rects:t,availableWidth:n,availableHeight:r}){const o=i(j)?j(t.reference):j??t.reference.width,u=i(A)?A(t.reference):Math.min(n,A??1/0),c=i(L)?L(t.reference):L??0,s=i(T)?T(t.reference):Math.min(r,T??1/0);Object.assign(e.floating.style,{minWidth:`${Math.min(o,u)}px`,maxWidth:`${u}px`,minHeight:`${Math.min(c,s)}px`,maxHeight:`${s}px`})}});B?"initialPlacement"===m?.fallbackStrategy?F.push(e,B):F.push(B,e):F.push(e)}else B&&F.push(B);h&&F.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}=bt(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=Ot(xt(o)),p=Et(d);let v=a[p],m=a[d];if(u){const e="y"===p?"bottom":"right";v=gt(v+f["y"===p?"top":"left"],v,v-f[e])}if(c){const e="y"===d?"bottom":"right";m=gt(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,...y})),g&&F.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?tn({element:n.current,padding:r}).fn(t):{}:n?tn({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,...x}));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=hn(),i=b.useRef({}),[u]=b.useState(()=>gn()),c=null!=wn(),[s,l]=b.useState(r.reference),a=tt((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=b.useMemo(()=>({setPositionReference:l}),[]),d=b.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return b.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]=b.useState(null),[c,s]=b.useState(null),l=(null==o?void 0:o.domReference)||i,a=b.useRef(null),f=En();Qe(()=>{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]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=b.useState(r);on(d,r)||p(r);const[v,m]=b.useState(null),[h,y]=b.useState(null),g=b.useCallback(e=>{e!==R.current&&(R.current=e,m(e))},[]),x=b.useCallback(e=>{e!==O.current&&(O.current=e,y(e))},[]),w=i||v,E=u||h,R=b.useRef(null),O=b.useRef(null),C=b.useRef(a),_=null!=s,S=sn(s),j=sn(o),L=sn(l),A=b.useCallback(()=>{if(!R.current||!O.current)return;const e={placement:t,strategy:n,middleware:d};j.current&&(e.platform=j.current),nn(R.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==L.current};T.current&&!on(C.current,t)&&(C.current=t,lt.flushSync(()=>{f(t)}))})},[d,t,n,j,L]);rn(()=>{!1===l&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);const T=b.useRef(!1);rn(()=>(T.current=!0,()=>{T.current=!1}),[]),rn(()=>{if(w&&(R.current=w),E&&(O.current=E),w&&E){if(S.current)return S.current(w,E,A);A()}},[w,E,A,S,_]);const k=b.useMemo(()=>({reference:R,floating:O,setReference:g,setFloating:x}),[g,x]),P=b.useMemo(()=>({reference:w,floating:E}),[w,E]),M=b.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=cn(P.floating,a.x),r=cn(P.floating,a.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...un(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,P.floating,a.x,a.y]);return b.useMemo(()=>({...a,update:A,refs:k,elements:P,floatingStyles:M}),[a,A,k,P,M])}({...e,elements:{...o,...c&&{reference:c}}}),p=b.useCallback(e=>{const t=Z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),d.refs.setReference(t)},[d.refs]),v=b.useCallback(e=>{(Z(e)||null===e)&&(a.current=e,u(e)),(Z(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!Z(e))&&d.refs.setReference(e)},[d.refs]),m=b.useMemo(()=>({...d.refs,setReference:v,setPositionReference:p,domReference:a}),[d.refs,v,p]),h=b.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),y=b.useMemo(()=>({...d,...r,refs:m,elements:h,nodeId:t}),[d,m,h,t,r]);return Qe(()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),b.useMemo(()=>({...d,context:y,refs:m,elements:h}),[d,m,h,y])}({nodeId:D,open:H,middleware:F,onOpenChange:(e,t,n)=>{I(e),e||P?.(n,t)},...O&&{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=Ht(e),a=o||i?[...l?ve(l):[],...t?ve(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=Y(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:-mt(f)+"px "+-mt(o.clientWidth-(a+d))+"px "+-mt(o.clientHeight-(f+p))+"px "+-mt(a)+"px",threshold:pt(0,dt(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||Jt(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?zt(e):null;return s&&function t(){const r=zt(e);m&&!Jt(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,C)},...f}),U=gr(z.context,{enabled:e,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:u,clientPointsOptions:c,roleOptions:s,extraInteractions:l}),K=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=b.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]=b.useState(()=>({...fr(i,l),...fr(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]=b.useState("unmounted"),s=function(e,t){const[n,r]=b.useState(e);return e&&!n&&r(!0),b.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"),Qe(()=>{if(r){if(n){c("initial");const e=requestAnimationFrame(()=>{lt.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(e)}}c("close")}},[n,r]),{isMounted:s,status:u}}(e,{duration:u}),y=Je(n),g=Je(r),x=Je(o),w=Je(i);return Qe(()=>{const e=fr(y.current,l),t=fr(x.current,l),n=fr(w.current,l),r=fr(g.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(ar).join(","),transitionDuration:f+"ms",...n,...r}),"close"===h){const r=t||e;v({transitionProperty:Object.keys(r).map(ar).join(","),transitionDuration:d+"ms",...n,...r})}},[d,x,y,g,w,f,h,l]),{isMounted:m,styles:p}}(z.context,{duration:250,...w});return{nodeId:D,isOpen:H,floating:z,arrowRef:N,interactions:U,transition:K}},xr=()=>{const e=(0,b.useContext)(K);return o(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},wr=({children:e,referenceProps:t,content:n,contentProps:r,focusManagerProps:o,arrowProps:i,portalProps:c,adjustStyles:s,context:l,...a})=>{const{useArrow:f,onClose:d}=a,{nodeId:p,floating:v,isOpen:m,arrowRef:h,interactions:y,transition:x}=br(a),w=(0,b.useCallback)(()=>{d?.("escape-key")},[d]),E=(0,b.useMemo)(()=>({context:l,floatingContext:v.context}),[l,v.context]);return(0,g.jsx)(hr,{ref:v.refs.setReference,...y.getReferenceProps(),...t,"data-testid":"honey-popup",children:(0,g.jsxs)(K,{value:E,children:[u(e,E),(0,g.jsx)(Rn,{id:p,children:x.isMounted&&(0,g.jsx)(yr,{...c,children:(0,g.jsx)(er,{context:v.context,disabled:!m,...o,children:(0,g.jsxs)(U,{ref:v.refs.setFloating,active:m,style:s?.({...v.floatingStyles,...x.styles},{middlewareData:v.middlewareData})??{...v.floatingStyles,...x.styles},onDeactivate:w,...y.getFloatingProps(),...r,"data-testid":"honey-popup-floating-content",children:[f&&(0,g.jsx)(yn,{ref:h,context:v.context,fill:"white",...i}),u(n,E)]})})})})]})})},Er=({useTree:e=!1,...t})=>(0,g.jsx)(mr,{enabled:e,children:(0,g.jsx)(wr,{...t})}),Rr=({option:e,...t})=>{const{context:n,floatingContext:r}=xr();return(0,g.jsx)(v,{onClick:()=>{e.onClick?.({context:n,floatingContext:r})},...t,children:e.label})},Or=({options:e,optionProps:t,floatingOptions:n,...r})=>{const{contentProps:o}=r,{context:i,floatingContext:u}=xr(),c=(0,b.useMemo)(()=>e?.filter(e=>"function"==typeof e.visible?e.visible({context:i,floatingContext:u}):!1!==e.visible),[e]);return(0,g.jsx)(A,{items:c,itemKey:"id",emptyContent:"No options",children:e=>e.options?.length?(0,g.jsx)(Er,{context:i,content:(0,g.jsx)(Or,{options:e.options,optionProps:t,contentProps:o}),event:"hover",referenceProps:{$width:"100%"},floatingOptions:{placement:"right-start",...n},useArrow:!0,...r,children:(0,g.jsx)(Rr,{option:e,...t,children:e.label})}):(0,g.jsx)(Rr,{option:e,...t})})},Cr=({children:e,subProps:t,options:n,optionProps:r,clickOptions:o,context:i,...u})=>{const{contentProps:c}=u;return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(Er,{context:i,content:(0,g.jsx)(Or,{options:n,optionProps:r,contentProps:c,...t}),clickOptions:{toggle:!1,...o},useArrow:!0,...u,children:e})})},_r=(0,b.createContext)(void 0),Sr=()=>{const e=(0,b.useContext)(_r);return o(e,"[@react-hive/honey-layout]: The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component."),e},jr=({children:e})=>{const t=(0,b.useContext)(_r),[n,r]=(0,b.useState)([]),o=(0,b.useMemo)(()=>({layers:n,registerLayer:e=>{const t=c();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,g.jsx)(_r,{value:o,children:e})},Lr=({children:t,theme:n,mediaQueryOptions:r,...o})=>{const i=H(n,r),{overlays:u,registerOverlay:s,unregisterOverlay:l}=(()=>{const[e,t]=(0,b.useState)([]);(0,b.useEffect)(()=>{const t=t=>{e.length&&e[e.length-1].notifyListeners("keyup",t.code,t)};return document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}},[e]);const n=(0,b.useCallback)(e=>{const n=e.id??c(),r=[["keyup",e.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:(t,n,o)=>{const u=e.listenKeys??[];u.length&&!u.includes(n)||(o.preventDefault(),r.forEach(([e,r])=>{e===t&&r(n,i,o)}))}};return t(e=>[...e,i]),i},[]),r=(0,b.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return{overlays:e,registerOverlay:n,unregisterOverlay:r}})(),a=(0,b.useMemo)(()=>({theme:n,screenState:i,overlays:u,registerOverlay:s,unregisterOverlay:l}),[n,i,u]);return(0,g.jsx)(e.HoneyStyleProvider,{theme:n,...o,children:(0,g.jsx)(F,{value:a,children:t})})};var Ar=n(117),Tr=n.n(Ar);const kr=({theme:t,...n})=>{const r=(0,b.useContext)(F),o=(0,b.useMemo)(()=>Tr()(r?.theme,t),[r?.theme,t]);return(0,g.jsx)(e.HoneyStyleProvider,{theme:o,...n})},Pr=({durationMs:t,timingFunction:n="ease-in-out",extraProperties:r=[],activeClassName:o})=>({active:i=!1})=>e.css`
36
+ `,O=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:o=!0,applyColumnMaxWidth:i=!1,...u})=>{const c=(0,b.useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}),[n,r,o,i]);return(0,g.jsx)(w,{value:c,children:(0,g.jsx)(R,{ref:e,spacing:r,"data-testid":"honey-grid",...u,children:t})})},C=()=>{const e=(0,b.useContext)(w);if(!e)throw new Error("The `useHoneyGridContext()` hook can only be used inside <HoneyGrid/> component!");return e},S=({children:e,...t})=>{const{columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}=C();return(0,g.jsx)(E,{columns:n,spacing:r,applyMaxWidth:i,$flexGrow:o?1:0,"data-testid":"honey-grid-column",...t,children:e})},_=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,j=({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,g.jsxs)(g.Fragment,{children:[n&&t&&i,o?c:e]}),L=(0,e.styled)(y,({$overflow:e="hidden auto"})=>({$overflow:e}))``,T=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s=!1,emptyContent:l,...a})=>(0,g.jsx)(L,{role:"list","aria-busy":r,"data-testid":"honey-list",...a,children:(0,g.jsx)(j,{loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s||0===t?.length,emptyContent:l,children:t?.map((t,r,o)=>(0,g.jsx)(b.Fragment,{children:e(t,r,o)},String(_(t,n,r))))})}),A=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,u]=(0,b.useState)(r||t),c=(0,b.useRef)(void 0);return(0,b.useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(c.current),u(!0),()=>{o||(c.current=setTimeout(()=>u(!1),n))}},[t,r,n]),i?e:null};var k={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 y(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,g=!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,g&&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=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),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})}}},P={};function M(e){var t=P[e];if(void 0!==t)return t.exports;var n=P[e]={exports:{}};return k[e](n,n.exports,M),n.exports}M.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return M.d(t,{a:t}),t},M.d=(e,t)=>{for(var n in t)M.o(t,n)&&!M.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},M.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),M.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const D=e=>{const t=(0,b.useRef)(e);return t.current=e,t};var $=M(551);M.n($);var I=n(551),N=n.n(I);const H=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,b.useState)(()=>({...d(e.breakpoints),...n}));return(0,b.useEffect)(()=>{const r=N()(()=>{o({...d(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},F=(0,b.createContext)(void 0),W=()=>{const e=(0,b.useContext)(F);return o(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},B=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=W(),o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},z=(e,{enabled:t=!0,onKeyUp:n}={})=>{const{overlays:r}=W(),o=(0,b.useMemo)(()=>t?r.find(t=>t.id===e)??null:null,[t,r,e]);return(0,b.useEffect)(()=>{if(o&&n)return o.addListener("keyup",n),()=>{o.removeListener("keyup",n)}},[o,n]),o},U=({ref:e,children:t,active:n,overlayId:r,onDeactivate:o,onKeyUp:i,...c})=>{const l=D(i),a=D(o),f=(0,b.useCallback)((e,...t)=>{l.current?l.current(e,...t):"Escape"===e&&a.current()},[]),d=B(n,{id:r,onKeyUp:f}),p=s(d?.setContainerRef,e);return(0,g.jsx)(y,{ref:p,inert:!n,...c,children:u(t,{overlay:d,isActive:n,deactivateOverlay:a.current})})},K=(0,b.createContext)(void 0);function V(){return"undefined"!=typeof window}function q(e){return G(e)?(e.nodeName||"").toLowerCase():"#document"}function X(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Y(e){var t;return null==(t=(G(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function G(e){return!!V()&&(e instanceof Node||e instanceof X(e).Node)}function Z(e){return!!V()&&(e instanceof Element||e instanceof X(e).Element)}function Q(e){return!!V()&&(e instanceof HTMLElement||e instanceof X(e).HTMLElement)}function J(e){return!(!V()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof X(e).ShadowRoot)}function ee(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function te(e){return/^(table|td|th)$/.test(q(e))}function ne(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const re=/transform|translate|scale|rotate|perspective|filter/,oe=/paint|layout|strict|content/,ie=e=>!!e&&"none"!==e;let ue;function ce(e){const t=Z(e)?ae(e):e;return ie(t.transform)||ie(t.translate)||ie(t.scale)||ie(t.rotate)||ie(t.perspective)||!se()&&(ie(t.backdropFilter)||ie(t.filter))||re.test(t.willChange||"")||oe.test(t.contain||"")}function se(){return null==ue&&(ue="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ue}function le(e){return/^(html|body|#document)$/.test(q(e))}function ae(e){return X(e).getComputedStyle(e)}function fe(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function de(e){if("html"===q(e))return e;const t=e.assignedSlot||e.parentNode||J(e)&&e.host||Y(e);return J(t)?t.host:t}function pe(e){const t=de(e);return le(t)?e.ownerDocument?e.ownerDocument.body:e.body:Q(t)&&ee(t)?t:pe(t)}function ve(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=pe(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=X(o);if(i){const e=me(u);return t.concat(u,u.visualViewport||[],ee(o)?o:[],e&&n?ve(e):[])}return t.concat(o,ve(o,[],n))}function me(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var he=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[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(","),ye="undefined"==typeof Element,ge=ye?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,be=!ye&&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},xe=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]"):xe(e.parentNode))},we=function(e,t,n){if(xe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(he));return t&&ge.call(e,he)&&r.unshift(e),r.filter(n)},Ee=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!xe(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,s=Ee(c,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{ge.call(i,he)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!xe(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=Ee(!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},Re=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Oe=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))&&!Re(e)?0:e.tabIndex},Ce=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Se=function(e){return"INPUT"===e.tagName},_e=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},je=function(e,t){return!(t.disabled||function(e){return Se(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});var o=getComputedStyle(e).visibility;if("hidden"===o||"collapse"===o)return!0;var i=ge.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ge.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return _e(e)}else{if("function"==typeof r){for(var u=e;e;){var c=e.parentElement,s=be(e);if(c&&!c.shadowRoot&&!0===r(c))return _e(e);e=e.assignedSlot?e.assignedSlot:c||s===e.ownerDocument?c:s.host}e=u}if(function(e){var t,n,r,o,i=e&&be(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=be(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!!ge.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Le=function(e,t){return!(function(e){return function(e){return Se(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||be(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)||Oe(t)<0||!je(e,t))},Te=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ae=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=Oe(e);return n<0&&t&&!Re(e)?0:n}(i,o),c=o?Ae(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(Ce).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ke=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ee([e],t.includeContainer,{filter:Le.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Te}):we(e,t.includeContainer,Le.bind(null,t)),Ae(n)},Pe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ge.call(e,he)&&Le(t,e)};function Me(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function De(){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 $e(){return/apple/i.test(navigator.vendor)}function Ie(){const e=/android/i;return e.test(Me())||e.test(De())}function Ne(){return De().includes("jsdom/")}const He="data-floating-ui-focusable";function Fe(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 We(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&J(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Be(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ze(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 Ue(e){return(null==e?void 0:e.ownerDocument)||document}function Ke(e){return Q(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ve(e){return!!e&&"combobox"===e.getAttribute("role")&&Ke(e)}function qe(e){return e?e.hasAttribute(He)?e:e.querySelector("["+He+"]")||e:null}function Xe(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,...Xe(e,t.id,n)])}function Ye(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 Ge(e){e.preventDefault(),e.stopPropagation()}function Ze(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Qe="undefined"!=typeof document?b.useLayoutEffect:function(){};function Je(e){const t=b.useRef(e);return Qe(()=>{t.current=e}),t}const et={...x}.useInsertionEffect||(e=>e());function tt(e){const t=b.useRef(()=>{});return et(()=>{t.current=e}),b.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 nt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rt(e,t){const n=ke(e,nt()),r=n.length;if(0===r)return;const o=Fe(Ue(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function ot(e){return rt(Ue(e).body,1)||e}function it(e){return rt(Ue(e).body,-1)||e}function ut(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!We(n,r)}function ct(e){ke(e,nt()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function st(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 lt=n(163);const at=["start","end"],ft=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+at[0],t+"-"+at[1]),[]),dt=Math.min,pt=Math.max,vt=Math.round,mt=Math.floor,ht=e=>({x:e,y:e}),yt={left:"right",right:"left",bottom:"top",top:"bottom"};function gt(e,t,n){return pt(e,dt(t,n))}function bt(e,t){return"function"==typeof e?e(t):e}function xt(e){return e.split("-")[0]}function wt(e){return e.split("-")[1]}function Et(e){return"x"===e?"y":"x"}function Rt(e){return"y"===e?"height":"width"}function Ot(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Ct(e){return Et(Ot(e))}function St(e,t,n){void 0===n&&(n=!1);const r=wt(e),o=Ct(e),i=Rt(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=kt(u)),[u,kt(u)]}function _t(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jt=["left","right"],Lt=["right","left"],Tt=["top","bottom"],At=["bottom","top"];function kt(e){const t=xt(e);return yt[t]+e.slice(t.length)}function Pt(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 Mt(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 Dt(e,t,n){let{reference:r,floating:o}=e;const i=Ot(t),u=Ct(t),c=Rt(u),s=xt(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(wt(t)){case"start":p[u]-=d*(n&&l?-1:1);break;case"end":p[u]+=d*(n&&l?-1:1)}return p}async function $t(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}=bt(t,e),v=Pt(p),m=c[d?"floating"===f?"reference":"floating":f],h=Mt(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})),y="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},x=Mt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:g,strategy:s}):y);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 It=new Set(["left","top"]);function Nt(e){const t=ae(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Q(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=vt(n)!==i||vt(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function Ht(e){return Z(e)?e:e.contextElement}function Ft(e){const t=Ht(e);if(!Q(t))return ht(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Nt(t);let u=(i?vt(n.width):n.width)/r,c=(i?vt(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Wt=ht(0);function Bt(e){const t=X(e);return se()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Wt}function zt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ht(e);let u=ht(1);t&&(r?Z(r)&&(u=Ft(r)):u=Ft(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==X(e))&&t}(i,n,r)?Bt(i):ht(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=X(i),t=r&&Z(r)?X(r):r;let n=e,o=me(n);for(;o&&r&&t!==n;){const e=Ft(o),t=o.getBoundingClientRect(),r=ae(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=X(o),o=me(n)}}return Mt({width:a,height:f,x:s,y:l})}function Ut(e,t){const n=fe(e).scrollLeft;return t?t.left+n:zt(Y(e)).left+n}function Kt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ut(e,n),y:n.top+t.scrollTop}}function Vt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=X(e),r=Y(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=se();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}const l=Ut(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=Y(e),n=fe(e),r=e.ownerDocument.body,o=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Ut(e);const c=-n.scrollTop;return"rtl"===ae(r).direction&&(u+=pt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}(Y(e));else if(Z(t))r=function(e,t){const n=zt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Q(e)?Ft(e):ht(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=Bt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Mt(r)}function qt(e,t){const n=de(e);return!(n===t||!Z(n)||le(n))&&("fixed"===ae(n).position||qt(n,t))}function Xt(e,t,n){const r=Q(t),o=Y(t),i="fixed"===n,u=zt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=ht(0);function l(){s.x=Ut(o)}if(r||!r&&!i)if(("body"!==q(t)||ee(o))&&(c=fe(t)),r){const e=zt(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?ht(0):Kt(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 Yt(e){return"static"===ae(e).position}function Gt(e,t){if(!Q(e)||"fixed"===ae(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Y(e)===n&&(n=n.ownerDocument.body),n}function Zt(e,t){const n=X(e);if(ne(e))return n;if(!Q(e)){let t=de(e);for(;t&&!le(t);){if(Z(t)&&!Yt(t))return t;t=de(t)}return n}let r=Gt(e,t);for(;r&&te(r)&&Yt(r);)r=Gt(r,t);return r&&le(r)&&Yt(r)&&!ce(r)?n:r||function(e){let t=de(e);for(;Q(t)&&!le(t);){if(ce(t))return t;if(ne(t))return null;t=de(t)}return null}(e)||n}const Qt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=Y(r),c=!!t&&ne(t.floating);if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=ht(1);const a=ht(0),f=Q(r);if((f||!f&&!i)&&(("body"!==q(r)||ee(u))&&(s=fe(r)),f)){const e=zt(r);l=Ft(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?ht(0):Kt(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:Y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ne(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ve(e,[],!1).filter(e=>Z(e)&&"body"!==q(e)),o=null;const i="fixed"===ae(e).position;let u=i?de(e):e;for(;Z(u)&&!le(u);){const t=ae(u),n=ce(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||ee(u)&&!n&&qt(e,u))?r=r.filter(e=>e!==u):o=t,u=de(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=Vt(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=Vt(t,i[e],o);c=pt(n.top,c),s=dt(n.right,s),l=dt(n.bottom,l),a=pt(n.left,a)}return{width:s-a,height:l-c,x:a,y:c}},getOffsetParent:Zt,getElementRects:async function(e){const t=this.getOffsetParent||Zt,n=this.getDimensions,r=await n(e.floating);return{reference:Xt(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}=Nt(e);return{width:t,height:n}},getScale:Ft,isElement:Z,isRTL:function(e){return"rtl"===ae(e).direction}};function Jt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const en=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}=bt(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=xt(o),g=Ot(c),b=xt(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(l.floating)),w=d||(b||!m?[kt(c)]:function(e){const t=kt(e);return[_t(e),t,_t(t)]}(c)),E="none"!==v;!d&&E&&w.push(...function(e,t,n,r){const o=wt(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Lt:jt:t?jt:Lt;case"left":case"right":return t?Tt:At;default:return[]}}(xt(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(_t)))),i}(c,m,v,x));const R=[c,...w],O=await s.detectOverflow(t,h),C=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&C.push(O[y]),f){const e=St(o,u,x);C.push(O[e[0]],O[e[1]])}if(S=[...S,{placement:o,overflows:C}],!C.every(e=>e<=0)){var _,j;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=R[e];if(t&&("alignment"!==f||g===Ot(t)||S.every(e=>Ot(e.placement)!==g||e.overflows[0]>0)))return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(j=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!n)switch(p){case"bestFit":{var L;const e=null==(L=S.filter(e=>{if(E){const t=Ot(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},tn=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}=bt(e,t)||{};if(null==l)return{};const f=Pt(a),d={x:n,y:r},p=Ct(o),v=Rt(p),m=await u.getDimensions(l),h="y"===p,y=h?"top":"left",g=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,S=dt(f[y],C),_=dt(f[g],C),j=S,L=R-m[v]-_,T=R/2-m[v]/2+O,A=gt(j,T,L),k=!s.arrow&&null!=wt(o)&&T!==A&&i.reference[v]/2-(T<j?S:_)-m[v]/2<0,P=k?T<j?T-j:T-L:0;return{[p]:d[p]+P,data:{[p]:A,centerOffset:T-A-P,...k&&{alignmentOffset:P}},reset:k}}}),nn=(e,t,n)=>{const r=new Map,o={platform:Qt,...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:$t},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}=Dt(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:y}=m,{x:g,y:b,data:x,reset:w}=await y({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:l,platform:c,elements:{reference:e,floating:t}});a=null!=g?g: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}=Dt(l,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:v}})(e,t,{...o,platform:i})};var rn="undefined"!=typeof document?b.useLayoutEffect:function(){};function on(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(!on(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||on(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function un(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cn(e,t){const n=un(e);return Math.round(t*n)/n}function sn(e){const t=b.useRef(e);return rn(()=>{t.current=e}),t}const ln="data-floating-ui-focusable",an="active",fn="selected",dn={...x};let pn=!1,vn=0;const mn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+vn++,hn=dn.useId||function(){const[e,t]=b.useState(()=>pn?mn():void 0);return Qe(()=>{null==e&&t(mn())},[]),b.useEffect(()=>{pn=!0},[]),e},yn=b.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=hn(),[y,x]=b.useState(!1);if(Qe(()=>{r&&"rtl"===ae(r).direction&&x(!0)},[r]),!r)return null;const[w,E]=n.split("-"),R="top"===w||"bottom"===w;let O=a;(R&&null!=i&&i.x||!R&&null!=i&&i.y)&&(O=null);const C=2*l,S=C/2,_=u/2*(s/-8+1),j=c/2*s/4,L=!!d,T=O&&"end"===E?"bottom":"top";let A=O&&"end"===E?"right":"left";O&&y&&(A="end"===E?"left":"right");const k=null!=(null==o?void 0:o.x)?O||o.x:"",P=null!=(null==o?void 0:o.y)?O||o.y:"",M=d||"M0,0 H"+u+" L"+(u-_)+","+(c-j)+" Q"+u/2+","+c+" "+_+","+(c-j)+" Z",D={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,g.jsxs)("svg",{...m,"aria-hidden":!0,ref:t,width:L?u:u+C,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[A]:k,[T]:P,[w]:R||L?"100%":"calc(100% - "+C/2+"px)",transform:[D,p].filter(e=>!!e).join(" "),...v},children:[C>0&&(0,g.jsx)("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:C+(d?0:1),d:M}),(0,g.jsx)("path",{stroke:C&&!d?m.fill:"none",d:M}),(0,g.jsx)("clipPath",{id:h,children:(0,g.jsx)("rect",{x:-S,y:S*(L?-1:1),width:u+C,height:u})})]})});function gn(){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 bn=b.createContext(null),xn=b.createContext(null),wn=()=>{var e;return(null==(e=b.useContext(bn))?void 0:e.id)||null},En=()=>b.useContext(xn);function Rn(e){const{children:t,id:n}=e,r=wn();return(0,g.jsx)(bn.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function On(e){const{children:t}=e,n=b.useRef([]),r=b.useCallback(e=>{n.current=[...n.current,e]},[]),o=b.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[i]=b.useState(()=>gn());return(0,g.jsx)(xn.Provider,{value:b.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i]),children:t})}function Cn(e){return"data-floating-ui-"+e}function Sn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const _n=Cn("safe-polygon");function jn(e,t,n){if(n&&!Ze(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 Ln(e){return"function"==typeof e?e():e}let Tn=0;function An(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Tn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Tn=requestAnimationFrame(i)}function kn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&J(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Pn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Mn(e){return"inert"===e?Pn.inert:"aria-hidden"===e?Pn["aria-hidden"]:Pn.none}let Dn=new WeakSet,$n={},In=0;function Nn(e){return e?J(e)?e.host:Nn(e.parentNode):null}const Hn=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Nn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function Fn(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=Hn(t,e),c=new Set,s=new Set(u),l=[];$n[o]||($n[o]=new WeakMap);const a=$n[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=Mn(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&&Dn.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),c.clear(),In++,()=>{l.forEach(e=>{const t=Mn(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!Dn.has(e)&&i&&e.removeAttribute(i),Dn.delete(e)),r||e.removeAttribute(o)}),In--,In||(Pn.inert=new WeakMap,Pn["aria-hidden"]=new WeakMap,Pn.none=new WeakMap,Dn=new WeakSet,$n={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Wn={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},Bn=b.forwardRef(function(e,t){const[n,r]=b.useState();Qe(()=>{$e()&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Cn("focus-guard")]:"",style:Wn};return(0,g.jsx)("span",{...e,...o})}),zn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Un=b.createContext(null),Kn=Cn("portal");function Vn(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=hn(),o=qn(),[i,u]=b.useState(null),c=b.useRef(null);return Qe(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{c.current=null})},[i]),Qe(()=>{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(Kn,""),e.appendChild(n),c.current=n,u(n)},[t,r]),Qe(()=>{if(null===n)return;if(!r)return;if(c.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!G(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(Kn,""),e=i||e,e.appendChild(s),c.current=s,u(s)},[t,n,r,o]),i}({id:n,root:r}),[u,c]=b.useState(null),s=b.useRef(null),l=b.useRef(null),a=b.useRef(null),f=b.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 b.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&&ut(e)&&("focusin"===e.type?st:ct)(i)}},[i,o,d]),b.useEffect(()=>{i&&(p||st(i))},[p,i]),(0,g.jsxs)(Un.Provider,{value:b.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:l,beforeInsideRef:a,afterInsideRef:f,portalNode:i,setFocusManagerState:c}),[o,i]),children:[v&&i&&(0,g.jsx)(Bn,{"data-type":"outside",ref:s,onFocus:e=>{if(ut(e,i)){var t;null==(t=a.current)||t.focus()}else{const e=it(u?u.domReference:null);null==e||e.focus()}}}),v&&i&&(0,g.jsx)("span",{"aria-owns":i.id,style:zn}),i&&lt.createPortal(t,i),v&&i&&(0,g.jsx)(Bn,{"data-type":"outside",ref:l,onFocus:e=>{if(ut(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=ot(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=()=>b.useContext(Un);function Xn(e){return b.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let Yn=[];function Gn(){Yn=Yn.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function Zn(){Gn();const e=Yn[Yn.length-1];return null==e?void 0:e.deref()}function Qn(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=nt(),o=function(e,t){return(t=t||{}).getShadowRoot?Ee([e],t.includeContainer,{filter:je.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):we(e,t.includeContainer,je.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Pe(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 Jn=b.forwardRef(function(e,t){return(0,g.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Wn})});function er(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:y,elements:{domReference:x,floating:w}}=t,E=tt(()=>{var e;return null==(e=y.current.floatingContext)?void 0:e.nodeId}),R=tt(p),O="number"==typeof u&&u<0,C=Ve(x)&&O,S="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,_=!S||i,j=!_||S&&d,L=Je(o),T=Je(u),A=Je(c),k=En(),P=qn(),M=b.useRef(null),D=b.useRef(null),$=b.useRef(!1),I=b.useRef(!1),N=b.useRef(-1),H=b.useRef(-1),F=null!=P,W=qe(w),B=tt(function(e){return void 0===e&&(e=W),e?ke(e,nt()):[]}),z=tt(e=>{const t=B(e);return L.current.map(e=>x&&"reference"===e?x:W&&"floating"===e?W:t).filter(Boolean).flat()});b.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){We(W,Fe(Ue(W)))&&0===B().length&&!C&&Ge(e);const t=z(),n=Be(e);"reference"===L.current[0]&&n===x&&(Ge(e),e.shiftKey?An(t[t.length-1]):An(t[1])),"floating"===L.current[1]&&n===W&&e.shiftKey&&(Ge(e),An(t[0]))}}const t=Ue(W);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,x,W,l,L,C,B,z]),b.useEffect(()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Be(e),n=B().indexOf(t);-1!==n&&(N.current=n)}},[r,w,B]),b.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=Be(e);queueMicrotask(()=>{const o=E(),i=!(We(x,t)||We(w,t)||We(t,w)||We(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Cn("focus-guard"))||k&&(Xe(k.nodesRef.current,o).find(e=>{var n,r;return We(null==(n=e.context)?void 0:n.elements.floating,t)||We(null==(r=e.context)?void 0:r.elements.domReference,t)})||Ye(k.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===x&&W&&Qn(W,L),s&&n!==x&&(null==r||!r.isConnected)&&Fe(Ue(W))===Ue(W).body){Q(W)&&W.focus();const e=N.current,t=B(),n=t[e]||t[t.length-1]||W;Q(n)&&n.focus()}y.current.insideReactTree?y.current.insideReactTree=!1:!C&&l||!t||!i||I.current||t===Zn()||($.current=!0,m(!1,e,"focus-out"))})}const n=Boolean(!k&&P);function o(){Sn(H),y.current.insideReactTree=!0,H.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}return w&&Q(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),n&&w.addEventListener("focusout",o,!0),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t),n&&w.removeEventListener("focusout",o,!0)}):void 0},[r,x,w,W,l,k,P,m,f,s,B,C,E,L,y]);const U=b.useRef(null),K=b.useRef(null),V=Xn([U,null==P?void 0:P.beforeInsideRef]),X=Xn([K,null==P?void 0:P.afterInsideRef]);function Y(e){return!r&&a&&l?(0,g.jsx)(Jn,{ref:"start"===e?M:D,onClick:e=>m(!1,e.nativeEvent),children:"string"==typeof a?a:"Dismiss"}):null}b.useEffect(()=>{var e,t;if(r)return;if(!w)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Cn("portal")+"]"))||[]),o=null==(t=(k?Ye(k.nodesRef.current,E()):[]).find(e=>{var t;return Ve((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[w,o,...n,...R(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,L.current.includes("reference")||C?x:null].filter(e=>null!=e),u=l||C?Fn(i,!j,j):Fn(i);return()=>{u()}},[r,x,w,l,L,P,C,_,j,k,E,R]),Qe(()=>{if(r||!Q(W))return;const e=Fe(Ue(W));queueMicrotask(()=>{const t=z(W),n=T.current,r=("number"==typeof n?t[n]:n.current)||W,o=We(W,e);O||o||!v||An(r,{preventScroll:r===W})})},[r,v,W,O,z,T]),Qe(()=>{if(r||!W)return;const e=Ue(W);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)||(Ie()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!Ne()&&(!Ie()&&0===e.width&&0===e.height||Ie()&&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=Fe(e),Gn(),t&&"body"!==q(t)&&(Yn.push(new WeakRef(t)),Yn.length>20&&(Yn=Yn.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,Wn),F&&x&&x.insertAdjacentElement("afterend",o),()=>{h.off("openchange",n);const t=Fe(e),r=We(w,t)||k&&Xe(k.nodesRef.current,E(),!1).some(e=>{var n;return We(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof A.current){const e=x||Zn();return e&&e.isConnected?e:o}return A.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=nt();return Pe(e,t)?e:ke(e,t)[0]||e}(i);A.current&&!$.current&&Q(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,w,W,A,y,h,k,F,x,E]),b.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(Gn)}),[r]),Qe(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:v,onOpenChange:m,domReference:x}),()=>{P.setFocusManagerState(null)}},[r,P,l,v,m,f,x]),Qe(()=>{r||W&&Qn(W,L)},[r,W,L]);const G=!r&&_&&(!l||!C)&&(F||l);return(0,g.jsxs)(g.Fragment,{children:[G&&(0,g.jsx)(Bn,{"data-type":"inside",ref:V,onFocus:e=>{if(l){const e=z();An("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,ut(e,P.portalNode)){const e=ot(x);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!C&&Y("start"),n,Y("end"),G&&(0,g.jsx)(Bn,{"data-type":"inside",ref:X,onFocus:e=>{if(l)An(z()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&($.current=!0),ut(e,P.portalNode)){const e=it(x);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function tr(e){return Q(e.target)&&"BUTTON"===e.target.tagName}function nr(e){return Ke(e)}function rr(e){return null!=e&&null!=e.clientX}const or={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ir={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ur=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 cr(){return Me().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&$e()}function sr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[an]:t,[fn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[ln]:""},...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&&[an,fn].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 lr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),ar=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function fr(e,t){return"function"==typeof e?e(t):e}function dr(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,...dr(e,t.id,n)])}function pr(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 vr(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(){Sn(o),d()}if(Sn(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:y}=e,g=[h,y],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=kn(f.floating,b),E=kn(f.domReference,b),R=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],S=n>O.right-O.width/2,_=l>O.bottom-O.height/2,j=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(g,R),L=O.width>R.width,T=O.height>R.height,A=(L?R:O).left,k=(L?R:O).right,P=(T?R:O).top,M=(T?R:O).bottom;if(w&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&Z(e.relatedTarget)&&kn(f.floating,e.relatedTarget))return;if(v&&dr(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=[[A,R.top+1],[A,O.bottom-1],[k,O.bottom-1],[k,R.top+1]];break;case"bottom":D=[[A,O.top+1],[A,R.bottom-1],[k,R.bottom-1],[k,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(!pr([h,y],D)){if(i&&!j)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()}pr([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:S?n+4*t:n-4*t,r+t+1],[L?n-t/2:S?n+4*t:n-4*t,r+t+1],[O.left,S||L?O.bottom-t:O.top],[O.right,S?L?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[L?n+t/2:S?n+4*t:n-4*t,r-t],[L?n-t/2:S?n+4*t:n-4*t,r-t],[O.left,S||L?O.top+t:O.bottom],[O.right,S?L?O.top+t:O.bottom:O.top+t]];case"left":{const e=[n+t+1,T?r+t/2:_?r+4*t:r-4*t],o=[n+t+1,T?r-t/2:_?r+4*t:r-4*t];return[[_||T?O.right-t:O.left,O.top],[_?T?O.right-t:O.left:O.right-t,O.bottom],e,o]}case"right":return[[n-t,T?r+t/2:_?r+4*t:r-4*t],[n-t,T?r-t/2:_?r+4*t:r-4*t],[_||T?O.left+t:O.right,O.top],[_?T?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 mr=({children:e,enabled:t=!0,...n})=>{const r=wn();return!t||r?e:(0,g.jsx)(On,{...n,children:e})},hr=(0,e.styled)(y,({$width:e="max-content"})=>({$width:e}))``,yr=({children:e,enabled:t=!0,...n})=>t?(0,g.jsx)(Vn,{...n,children:e}):e,gr=(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=En(),h=tt("function"==typeof s?s:()=>!1),y="function"==typeof s?h:s,g=b.useRef(!1),{escapeKey:x,outsidePress:w}=ur(p),{escapeKey:E,outsidePress:R}=ur(v),O=b.useRef(!1),C=tt(e=>{var t;if(!n||!u||!c||"Escape"!==e.key)return;if(O.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,s=m?Xe(m.nodesRef.current,o):[];if(!x&&(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")}),S=tt(e=>{var t;const n=()=>{var t;C(e),null==(t=Be(e))||t.removeEventListener("keydown",n)};null==(t=Be(e))||t.addEventListener("keydown",n)}),_=tt(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=g.current;if(g.current=!1,"click"===l&&u)return;if(n)return;if("function"==typeof y&&!y(e))return;const c=Be(e),s="["+Cn("inert")+"]",a=Ue(o.floating).querySelectorAll(s);let f=Z(c)?c:null;for(;f&&!le(f);){const e=de(f);if(le(e)||!Z(e))break;f=e}if(a.length&&Z(c)&&!c.matches("html,body")&&!We(c,o.floating)&&Array.from(a).every(e=>!We(f,e)))return;if(Q(c)&&T){const t=le(c),n=ae(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&&Xe(m.nodesRef.current,d).some(t=>{var n;return ze(e,null==(n=t.context)?void 0:n.elements.floating)});if(ze(e,o.floating)||ze(e,o.domReference)||p)return;const v=m?Xe(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")}),j=tt(e=>{var t;const n=()=>{var t;_(e),null==(t=Be(e))||t.removeEventListener(l,n)};null==(t=Be(e))||t.addEventListener(l,n)});b.useEffect(()=>{if(!n||!u)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function s(){window.clearTimeout(e),O.current=!0}function a(){e=window.setTimeout(()=>{O.current=!1},se()?5:0)}const f=Ue(o.floating);c&&(f.addEventListener("keydown",E?S:C,E),f.addEventListener("compositionstart",s),f.addEventListener("compositionend",a)),y&&f.addEventListener(l,R?j:_,R);let p=[];return d&&(Z(o.domReference)&&(p=ve(o.domReference)),Z(o.floating)&&(p=p.concat(ve(o.floating))),!Z(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(ve(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",E?S:C,E),f.removeEventListener("compositionstart",s),f.removeEventListener("compositionend",a)),y&&f.removeEventListener(l,R?j:_,R),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,c,y,l,n,r,d,u,x,w,C,E,S,_,R,j]),b.useEffect(()=>{i.current.insideReactTree=!1},[i,y,l]);const L=b.useMemo(()=>({onKeyDown:C,...a&&{[or[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[C,r,a,f]),T=b.useMemo(()=>{function e(e){0===e.button&&(g.current=!0)}return{onKeyDown:C,onMouseDown:e,onMouseUp:e,[ir[l]]:()=>{i.current.insideReactTree=!0}}},[C,l,i]);return b.useMemo(()=>u?{reference:L,floating:T}:{},[u,L,T])}(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=b.useRef(),p=b.useRef(!1),v=b.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==c&&(Ze(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:Ze(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||tr(e)||(" "!==e.key||nr(i)||(e.preventDefault(),p.current=!0),function(e){return Q(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!a||tr(e)||nr(i)||" "===e.key&&p.current&&(p.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[o,i,c,l,a,r,n,f,s]);return b.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=En(),v=wn(),m=Je(l),h=Je(s),y=Je(n),g=Je(f),x=b.useRef(),w=b.useRef(-1),E=b.useRef(),R=b.useRef(-1),O=b.useRef(!0),C=b.useRef(!1),S=b.useRef(()=>{}),_=b.useRef(!1),j=tt(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});b.useEffect(()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(Sn(w),Sn(R),O.current=!0,_.current=!1)}},[c,i]),b.useEffect(()=>{if(!c)return;if(!m.current)return;if(!n)return;function e(e){j()&&r(!1,e,"hover")}const t=Ue(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,r,c,m,j]);const L=b.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=jn(h.current,"close",x.current);o&&!E.current?(Sn(w),w.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(Sn(w),r(!1,e,n))},[h,r]),T=tt(()=>{S.current(),E.current=void 0}),A=tt(()=>{if(C.current){const e=Ue(u.floating).body;e.style.pointerEvents="",e.removeAttribute(_n),C.current=!1}}),k=tt(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));b.useEffect(()=>{if(c&&Z(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(Sn(w),O.current=!1,a&&!Ze(x.current)||Ln(g.current)>0&&!jn(h.current,"open"))return;const t=jn(h.current,"open",x.current);t?w.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(k())return void A();S.current();const t=Ue(u.floating);if(Sn(R),_.current=!1,m.current&&o.current.floatingContext){n||Sn(w),E.current=m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),T(),k()||L(e,!0,"safe-polygon")}});const r=E.current;return t.addEventListener("mousemove",r),void(S.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==x.current||!We(u.floating,e.relatedTarget))&&L(e)}function i(e){k()||o.current.floatingContext&&(null==m.current||m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),T(),k()||L(e)}})(e))}function s(){Sn(w)}function l(e){k()||L(e,!1)}},[u,c,e,a,d,L,T,A,r,n,y,p,h,m,o,k,g]),Qe(()=>{var e;if(c&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&j()){C.current=!0;const e=u.floating;if(Z(u.domReference)&&e){var t;const n=Ue(u.floating).body;n.setAttribute(_n,"");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,j]),Qe(()=>{n||(x.current=void 0,_.current=!1,T(),A())},[n,T,A]),b.useEffect(()=>()=>{T(),Sn(w),Sn(R),A()},[c,u.domReference,T,A]);const P=b.useMemo(()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){O.current||y.current||r(!0,t,"hover")}a&&!Ze(x.current)||n||0===Ln(g.current)||_.current&&e.movementX**2+e.movementY**2<2||(Sn(R),"touch"===x.current?o():(_.current=!0,R.current=window.setTimeout(o,Ln(g.current))))}}},[a,r,n,y,g]);return b.useMemo(()=>c?{reference:P}:{},[c,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:vr(),...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=b.useRef(!1),a=b.useRef(-1),f=b.useRef(!0);b.useEffect(()=>{if(!c)return;const e=X(u.domReference);function t(){!n&&Q(u.domReference)&&u.domReference===Fe(Ue(u.domReference))&&(l.current=!0)}function r(){f.current=!0}function o(){f.current=!1}return e.addEventListener("blur",t),cr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),cr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[u.domReference,n,c]),b.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]),b.useEffect(()=>()=>{Sn(a)},[]);const d=b.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;const t=Be(e.nativeEvent);if(s&&Z(t))if(cr()&&!e.relatedTarget){if(!f.current&&!Ke(t))return}else if(!function(e){if(!e||Ne())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=Z(t)&&t.hasAttribute(Cn("focus-guard"))&&"outside"===t.getAttribute("data-type");a.current=window.setTimeout(()=>{var e;const c=Fe(u.domReference?u.domReference.ownerDocument:document);(t||c!==u.domReference)&&(We(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,c)||We(u.domReference,c)||o||r(!1,n,"focus"))})}}),[i,u.domReference,r,s]);return b.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=b.useRef(!1),d=b.useRef(null),[p,v]=b.useState(),[m,h]=b.useState([]),y=tt((e,t)=>{f.current||r.current.openEvent&&!rr(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}))}),g=tt(e=>{null==l&&null==a&&(n?d.current||h([]):y(e.clientX,e.clientY))}),x=Ze(p)?o:n,w=b.useCallback(()=>{if(!x||!c||null!=l||null!=a)return;const e=X(o);function t(n){const r=Be(n);We(o,r)?(e.removeEventListener("mousemove",t),d.current=null):y(n.clientX,n.clientY)}if(!r.current.openEvent||rr(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}u.setPositionReference(i)},[x,c,l,a,o,r,u,i,y]);b.useEffect(()=>w(),[w,m]),b.useEffect(()=>{c&&!o&&(f.current=!1)},[c,o]),b.useEffect(()=>{!c&&n&&(f.current=!0)},[c,n]),Qe(()=>{!c||null==l&&null==a||(f.current=!1,y(l,a))},[c,l,a,y]);const E=b.useMemo(()=>{function e(e){let{pointerType:t}=e;v(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return b.useMemo(()=>c?{reference:E}:{},[c,E])}(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=hn(),a=(null==(n=i.domReference)?void 0:n.id)||l,f=b.useMemo(()=>{var e;return(null==(e=qe(i.floating))?void 0:e.id)||u},[i.floating,u]),d=null!=(r=lr.get(s))?r:s,p=null!=wn(),v=b.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=b.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=b.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 b.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=b.useCallback(t=>sr(t,e,"reference"),t),i=b.useCallback(t=>sr(t,e,"floating"),n),u=b.useCallback(t=>sr(t,e,"item"),r);return b.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}([a,f,d,p,v,m,...l])},br=({enabled:e=!0,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:u,clientPointsOptions:c,roleOptions:s,extraInteractions:l,open:a,floatingOptions:f,useOffset:d=!0,offsetOptions:p,useFlip:v=!0,flipOptions:m,useShift:h=!0,shiftOptions:y,useArrow:g=!1,arrowOptions:x,transitionOptions:w,useAutoPlacement:E=!1,autoPlacementOptions:R,useAutoUpdate:O=!1,autoUpdateOptions:C,useAutoSize:S=!1,sizeOptions:_,minAcceptableWidth:j=null,minAcceptableHeight:L=null,maxAcceptableWidth:T,maxAcceptableHeight:A,onOpen:k,onClose:P})=>{const{theme:M}=W(),D=function(){const e=hn(),t=En(),n=wn();return Qe(()=>{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,b.useState)(!1),N=(0,b.useRef)(null),H=e&&(a??$);(0,b.useEffect)(()=>{H&&k?.()},[H]),((e,t)=>{const n=(0,b.useRef)(e);(0,b.useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(e,e=>{e||I(!1)});const F=[];d&&F.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=xt(n),c=wt(n),s="y"===Ot(n),l=It.has(u)?-1:1,a=i&&s?-1:1,f=bt(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]}})(p??M.spacings.base));let B=null;if(E?F.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=ft,autoAlignment:p=!0,...v}=bt(e,t),m=void 0!==f||d===ft?function(e,t,n){return(e?[...n.filter(t=>wt(t)===e),...n.filter(t=>wt(t)!==e)]:n.filter(e=>xt(e)===e)).filter(n=>!e||wt(n)===e||!!t&&_t(n)!==n)}(f||null,p,d):d,h=await s.detectOverflow(t,v),y=(null==(n=u.autoPlacement)?void 0:n.index)||0,g=m[y];if(null==g)return{};const b=St(g,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));if(c!==g)return{reset:{placement:m[0]}};const x=[h[xt(g)],h[b[0]],h[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:g,overflows:x}],E=m[y+1];if(E)return{data:{index:y+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=wt(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,wt(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:y+1,overflows:w},reset:{placement:C}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(R)):v&&(B=(e=>{const t=en(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...m})),S){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}=bt(e,t),a=await u.detectOverflow(t,l),f=xt(o),d=wt(o),p="y"===Ot(o),{width:v,height:m}=i.floating;let h,y;"top"===f||"bottom"===f?(h=f,y=d===(await(null==u.isRTL?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(y=f,h="end"===d?"top":"bottom");const g=m-a.top-a.bottom,b=v-a.left-a.right,x=dt(m-a[h],g),w=dt(v-a[y],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=g),E&&!d){const e=pt(a.left,0),t=pt(a.right,0),n=pt(a.top,0),r=pt(a.bottom,0);p?O=v-2*(0!==e||0!==t?e+t:pt(a.left,a.right)):R=m-2*(0!==n||0!==r?n+r:pt(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]}})({..._,apply({elements:e,rects:t,availableWidth:n,availableHeight:r}){const o=i(j)?j(t.reference):j??t.reference.width,u=i(T)?T(t.reference):Math.min(n,T??1/0),c=i(L)?L(t.reference):L??0,s=i(A)?A(t.reference):Math.min(r,A??1/0);Object.assign(e.floating.style,{minWidth:`${Math.min(o,u)}px`,maxWidth:`${u}px`,minHeight:`${Math.min(c,s)}px`,maxHeight:`${s}px`})}});B?"initialPlacement"===m?.fallbackStrategy?F.push(e,B):F.push(B,e):F.push(e)}else B&&F.push(B);h&&F.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}=bt(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=Ot(xt(o)),p=Et(d);let v=a[p],m=a[d];if(u){const e="y"===p?"bottom":"right";v=gt(v+f["y"===p?"top":"left"],v,v-f[e])}if(c){const e="y"===d?"bottom":"right";m=gt(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,...y})),g&&F.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?tn({element:n.current,padding:r}).fn(t):{}:n?tn({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,...x}));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=hn(),i=b.useRef({}),[u]=b.useState(()=>gn()),c=null!=wn(),[s,l]=b.useState(r.reference),a=tt((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=b.useMemo(()=>({setPositionReference:l}),[]),d=b.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return b.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]=b.useState(null),[c,s]=b.useState(null),l=(null==o?void 0:o.domReference)||i,a=b.useRef(null),f=En();Qe(()=>{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]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=b.useState(r);on(d,r)||p(r);const[v,m]=b.useState(null),[h,y]=b.useState(null),g=b.useCallback(e=>{e!==R.current&&(R.current=e,m(e))},[]),x=b.useCallback(e=>{e!==O.current&&(O.current=e,y(e))},[]),w=i||v,E=u||h,R=b.useRef(null),O=b.useRef(null),C=b.useRef(a),S=null!=s,_=sn(s),j=sn(o),L=sn(l),T=b.useCallback(()=>{if(!R.current||!O.current)return;const e={placement:t,strategy:n,middleware:d};j.current&&(e.platform=j.current),nn(R.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==L.current};A.current&&!on(C.current,t)&&(C.current=t,lt.flushSync(()=>{f(t)}))})},[d,t,n,j,L]);rn(()=>{!1===l&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);const A=b.useRef(!1);rn(()=>(A.current=!0,()=>{A.current=!1}),[]),rn(()=>{if(w&&(R.current=w),E&&(O.current=E),w&&E){if(_.current)return _.current(w,E,T);T()}},[w,E,T,_,S]);const k=b.useMemo(()=>({reference:R,floating:O,setReference:g,setFloating:x}),[g,x]),P=b.useMemo(()=>({reference:w,floating:E}),[w,E]),M=b.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=cn(P.floating,a.x),r=cn(P.floating,a.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...un(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,P.floating,a.x,a.y]);return b.useMemo(()=>({...a,update:T,refs:k,elements:P,floatingStyles:M}),[a,T,k,P,M])}({...e,elements:{...o,...c&&{reference:c}}}),p=b.useCallback(e=>{const t=Z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),d.refs.setReference(t)},[d.refs]),v=b.useCallback(e=>{(Z(e)||null===e)&&(a.current=e,u(e)),(Z(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!Z(e))&&d.refs.setReference(e)},[d.refs]),m=b.useMemo(()=>({...d.refs,setReference:v,setPositionReference:p,domReference:a}),[d.refs,v,p]),h=b.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),y=b.useMemo(()=>({...d,...r,refs:m,elements:h,nodeId:t}),[d,m,h,t,r]);return Qe(()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),b.useMemo(()=>({...d,context:y,refs:m,elements:h}),[d,m,h,y])}({nodeId:D,open:H,middleware:F,onOpenChange:(e,t,n)=>{I(e),e||P?.(n,t)},...O&&{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=Ht(e),a=o||i?[...l?ve(l):[],...t?ve(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=Y(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:-mt(f)+"px "+-mt(o.clientWidth-(a+d))+"px "+-mt(o.clientHeight-(f+p))+"px "+-mt(a)+"px",threshold:pt(0,dt(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||Jt(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?zt(e):null;return s&&function t(){const r=zt(e);m&&!Jt(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,C)},...f}),U=gr(z.context,{enabled:e,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:u,clientPointsOptions:c,roleOptions:s,extraInteractions:l}),K=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=b.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]=b.useState(()=>({...fr(i,l),...fr(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]=b.useState("unmounted"),s=function(e,t){const[n,r]=b.useState(e);return e&&!n&&r(!0),b.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"),Qe(()=>{if(r){if(n){c("initial");const e=requestAnimationFrame(()=>{lt.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(e)}}c("close")}},[n,r]),{isMounted:s,status:u}}(e,{duration:u}),y=Je(n),g=Je(r),x=Je(o),w=Je(i);return Qe(()=>{const e=fr(y.current,l),t=fr(x.current,l),n=fr(w.current,l),r=fr(g.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(ar).join(","),transitionDuration:f+"ms",...n,...r}),"close"===h){const r=t||e;v({transitionProperty:Object.keys(r).map(ar).join(","),transitionDuration:d+"ms",...n,...r})}},[d,x,y,g,w,f,h,l]),{isMounted:m,styles:p}}(z.context,{duration:250,...w});return{nodeId:D,isOpen:H,floating:z,arrowRef:N,interactions:U,transition:K}},xr=()=>{const e=(0,b.useContext)(K);return o(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},wr=({children:e,referenceProps:t,content:n,contentProps:r,focusManagerProps:o,arrowProps:i,portalProps:c,adjustStyles:s,context:l,...a})=>{const{useArrow:f,onClose:d}=a,{nodeId:p,floating:v,isOpen:m,arrowRef:h,interactions:y,transition:x}=br(a),w=(0,b.useCallback)(()=>{d?.("escape-key")},[d]),E=(0,b.useMemo)(()=>({context:l,floatingContext:v.context}),[l,v.context]);return(0,g.jsx)(hr,{ref:v.refs.setReference,...y.getReferenceProps(),...t,"data-testid":"honey-popup",children:(0,g.jsxs)(K,{value:E,children:[u(e,E),(0,g.jsx)(Rn,{id:p,children:x.isMounted&&(0,g.jsx)(yr,{...c,children:(0,g.jsx)(er,{context:v.context,disabled:!m,...o,children:(0,g.jsxs)(U,{ref:v.refs.setFloating,active:m,style:s?.({...v.floatingStyles,...x.styles},{middlewareData:v.middlewareData})??{...v.floatingStyles,...x.styles},onDeactivate:w,...y.getFloatingProps(),...r,"data-testid":"honey-popup-floating-content",children:[f&&(0,g.jsx)(yn,{ref:h,context:v.context,fill:"white",...i}),u(n,E)]})})})})]})})},Er=({useTree:e=!1,...t})=>(0,g.jsx)(mr,{enabled:e,children:(0,g.jsx)(wr,{...t})}),Rr=(0,e.styled)(y,{row:!0})``,Or=({option:e,...t})=>{const{context:n,floatingContext:r}=xr(),o=i(e.disabled)?e.disabled({context:n,floatingContext:r}):!1!==e.disabled;return(0,g.jsx)(Rr,{onClick:()=>{e.onClick?.({context:n,floatingContext:r})},role:"menuitem","aria-disabled":o,"data-testid":"honey-context-menu-option",...t,children:e.label})},Cr=({options:e,optionProps:t,floatingOptions:n,...r})=>{const{contentProps:o}=r,{context:u,floatingContext:c}=xr(),s=(0,b.useMemo)(()=>e?.filter(e=>i(e.visible)?e.visible({context:u,floatingContext:c}):!1!==e.visible),[e]);return(0,g.jsx)(T,{items:s,itemKey:"id",emptyContent:"No options","data-testid":"honey-context-menu-options",children:e=>e.options?.length?(0,g.jsx)(Er,{context:u,content:(0,g.jsx)(Cr,{options:e.options,optionProps:t,contentProps:o}),event:"hover",referenceProps:{$width:"100%"},floatingOptions:{placement:"right-start",...n},useArrow:!0,"data-testid":"honey-sub-context-menu",...r,children:(0,g.jsx)(Or,{option:e,...t,children:e.label})}):(0,g.jsx)(Or,{option:e,...t})})},Sr=({children:e,subProps:t,options:n,optionProps:r,roleOptions:o,context:i,...u})=>{const{contentProps:c}=u;return(0,g.jsx)(Er,{context:i,content:(0,g.jsx)(Cr,{options:n,optionProps:r,contentProps:c,...t}),roleOptions:{role:"menu",...o},"data-testid":"honey-context-menu",...u,children:e})},_r=(0,b.createContext)(void 0),jr=()=>{const e=(0,b.useContext)(_r);return o(e,"[@react-hive/honey-layout]: The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component."),e},Lr=({children:e})=>{const t=(0,b.useContext)(_r),[n,r]=(0,b.useState)([]),o=(0,b.useMemo)(()=>({layers:n,registerLayer:e=>{const t=c();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,g.jsx)(_r,{value:o,children:e})},Tr=({children:t,theme:n,mediaQueryOptions:r,...o})=>{const i=H(n,r),{overlays:u,registerOverlay:s,unregisterOverlay:l}=(()=>{const[e,t]=(0,b.useState)([]);(0,b.useEffect)(()=>{const t=t=>{e.length&&e[e.length-1].notifyListeners("keyup",t.code,t)};return document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}},[e]);const n=(0,b.useCallback)(e=>{const n=e.id??c(),r=[["keyup",e.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:(t,n,o)=>{const u=e.listenKeys??[];u.length&&!u.includes(n)||(o.preventDefault(),r.forEach(([e,r])=>{e===t&&r(n,i,o)}))}};return t(e=>[...e,i]),i},[]),r=(0,b.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return{overlays:e,registerOverlay:n,unregisterOverlay:r}})(),a=(0,b.useMemo)(()=>({theme:n,screenState:i,overlays:u,registerOverlay:s,unregisterOverlay:l}),[n,i,u]);return(0,g.jsx)(e.HoneyStyleProvider,{theme:n,...o,children:(0,g.jsx)(F,{value:a,children:t})})};var Ar=n(117),kr=n.n(Ar);const Pr=({theme:t,...n})=>{const r=(0,b.useContext)(F),o=(0,b.useMemo)(()=>kr()(r?.theme,t),[r?.theme,t]);return(0,g.jsx)(e.HoneyStyleProvider,{theme:o,...n})},Mr=({durationMs:t,timingFunction:n="ease-in-out",extraProperties:r=[],activeClassName:o})=>({active:i=!1})=>e.css`
37
37
  opacity: ${i?1:0};
38
38
  visibility: ${i?"visible":"hidden"};
39
39
 
@@ -47,5 +47,5 @@
47
47
  visibility: visible;
48
48
  }
49
49
  `}
50
- `,Mr=e.resolveSpacing})(),module.exports=r})();
50
+ `,Dr=e.resolveSpacing})(),module.exports=r})();
51
51
  //# sourceMappingURL=index.cjs.map