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