@yoopta/ui 6.0.0-beta.7 → 6.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/action-menu-list/action-menu-list.d.ts +49 -13
  2. package/dist/action-menu-list/action-menu-list.d.ts.map +1 -1
  3. package/dist/action-menu-list/context.d.ts +25 -0
  4. package/dist/action-menu-list/context.d.ts.map +1 -0
  5. package/dist/action-menu-list/index.d.ts +5 -5
  6. package/dist/action-menu-list/index.d.ts.map +1 -1
  7. package/dist/action-menu-list.js +1 -1
  8. package/dist/block-dnd/block-dnd-context.d.ts +5 -0
  9. package/dist/block-dnd/block-dnd-context.d.ts.map +1 -0
  10. package/dist/block-dnd/drag-handle.d.ts +4 -0
  11. package/dist/block-dnd/drag-handle.d.ts.map +1 -0
  12. package/dist/block-dnd/index.d.ts +7 -0
  13. package/dist/block-dnd/index.d.ts.map +1 -0
  14. package/dist/block-dnd/sortable-block.d.ts +3 -0
  15. package/dist/block-dnd/sortable-block.d.ts.map +1 -0
  16. package/dist/block-dnd/types.d.ts +78 -0
  17. package/dist/block-dnd/types.d.ts.map +1 -0
  18. package/dist/block-dnd/use-block-dnd.d.ts +29 -0
  19. package/dist/block-dnd/use-block-dnd.d.ts.map +1 -0
  20. package/dist/block-dnd.js +1 -0
  21. package/dist/block-options/block-options.d.ts.map +1 -1
  22. package/dist/block-options.js +1 -1
  23. package/dist/chunks/{floating-ui.react-33212df0.js → floating-ui.react-727e4287.js} +1 -1
  24. package/dist/chunks/{highlight-color-picker-ea799f50.js → highlight-color-picker-ce0b19ac.js} +1 -1
  25. package/dist/element-options.js +1 -1
  26. package/dist/floating-block-actions/context.d.ts +15 -0
  27. package/dist/floating-block-actions/context.d.ts.map +1 -0
  28. package/dist/floating-block-actions/floating-block-actions.d.ts +30 -7
  29. package/dist/floating-block-actions/floating-block-actions.d.ts.map +1 -1
  30. package/dist/floating-block-actions/hooks.d.ts +1 -29
  31. package/dist/floating-block-actions/hooks.d.ts.map +1 -1
  32. package/dist/floating-block-actions/index.d.ts +3 -4
  33. package/dist/floating-block-actions/index.d.ts.map +1 -1
  34. package/dist/floating-block-actions.js +1 -1
  35. package/dist/floating-toolbar/context.d.ts +12 -0
  36. package/dist/floating-toolbar/context.d.ts.map +1 -0
  37. package/dist/floating-toolbar/floating-toolbar.d.ts +44 -0
  38. package/dist/floating-toolbar/floating-toolbar.d.ts.map +1 -0
  39. package/dist/floating-toolbar/index.d.ts +5 -0
  40. package/dist/floating-toolbar/index.d.ts.map +1 -0
  41. package/dist/floating-toolbar.js +1 -0
  42. package/dist/highlight-color-picker.js +1 -1
  43. package/dist/index.d.ts +5 -5
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/overlay.js +1 -1
  47. package/dist/portal.js +1 -1
  48. package/dist/slash-command-menu.js +1 -1
  49. package/package.json +15 -12
  50. package/dist/action-menu-list/hooks.d.ts +0 -912
  51. package/dist/action-menu-list/hooks.d.ts.map +0 -1
  52. package/dist/action-menu-list/store.d.ts +0 -22
  53. package/dist/action-menu-list/store.d.ts.map +0 -1
  54. package/dist/action-menu-list/store.test.d.ts +0 -2
  55. package/dist/action-menu-list/store.test.d.ts.map +0 -1
  56. package/dist/chunks/hooks-814f49b9.js +0 -1
  57. package/dist/chunks/hooks-ad9169d0.js +0 -1
  58. package/dist/chunks/index-06d5c4e7.js +0 -10
  59. package/dist/floating-block-actions/store.d.ts +0 -19
  60. package/dist/floating-block-actions/store.d.ts.map +0 -1
  61. package/dist/floating-block-actions/store.test.d.ts +0 -2
  62. package/dist/floating-block-actions/store.test.d.ts.map +0 -1
  63. package/dist/theme/ThemeProvider.d.ts +0 -16
  64. package/dist/theme/ThemeProvider.d.ts.map +0 -1
  65. package/dist/theme/ThemeToggle.d.ts +0 -6
  66. package/dist/theme/ThemeToggle.d.ts.map +0 -1
  67. package/dist/theme/index.d.ts +0 -5
  68. package/dist/theme/index.d.ts.map +0 -1
  69. package/dist/theme/useTheme.d.ts +0 -8
  70. package/dist/theme/useTheme.d.ts.map +0 -1
  71. package/dist/theme.js +0 -1
  72. package/dist/toolbar/hooks.d.ts +0 -879
  73. package/dist/toolbar/hooks.d.ts.map +0 -1
  74. package/dist/toolbar/index.d.ts +0 -6
  75. package/dist/toolbar/index.d.ts.map +0 -1
  76. package/dist/toolbar/store.d.ts +0 -12
  77. package/dist/toolbar/store.d.ts.map +0 -1
  78. package/dist/toolbar/store.test.d.ts +0 -2
  79. package/dist/toolbar/store.test.d.ts.map +0 -1
  80. package/dist/toolbar/toolbar.d.ts +0 -20
  81. package/dist/toolbar/toolbar.d.ts.map +0 -1
  82. package/dist/toolbar.js +0 -1
@@ -2,4 +2,4 @@ import*as e from"react";import{useLayoutEffect as t,useEffect as n,useRef as o}f
2
2
  /*!
3
3
  * tabbable 6.4.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var me=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),he="undefined"==typeof Element,ge=he?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ve=!he&&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},ye=function(e,t){var n;void 0===t&&(t=!0);var o=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===o||"true"===o||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):ye(e.parentNode))},we=function(e,t,n){for(var o=[],r=Array.from(e);r.length;){var i=r.shift();if(!ye(i,!1))if("SLOT"===i.tagName){var l=i.assignedElements(),c=l.length?l:i.children,u=we(c,!0,n);n.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{ge.call(i,me)&&n.filter(i)&&(t||!e.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!ye(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(s&&a){var f=we(!0===s?i.children:s.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else r.unshift.apply(r,i.children)}}return o},be=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},xe=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))&&!be(e)?0:e.tabIndex},Re=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ee=function(e){return"INPUT"===e.tagName},Se=function(e){return function(e){return Ee(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ve(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(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 r=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!r||r===e}(e)},Ae=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},Ce=function(e,t){var n=t.displayCheck,o=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 r=ge.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ge.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ae(e)}else{if("function"==typeof o){for(var i=e;e;){var l=e.parentElement,c=ve(e);if(l&&!l.shadowRoot&&!0===o(l))return Ae(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,o,r,i=e&&ve(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(l)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!c&&l;){var u,s,a;c=!(null===(s=l=null===(u=i=ve(l))||void 0===u?void 0:u.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Le=function(e,t){return!(t.disabled||function(e){return Ee(e)&&"hidden"===e.type}(t)||Ce(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 o=t.children.item(n);if("LEGEND"===o.tagName)return!!ge.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},ke=function(e,t){return!(Se(t)||xe(t)<0||!Le(e,t))},Te=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Oe=function(e){var t=[],n=[];return e.forEach(function(e,o){var r=!!e.scopeParent,i=r?e.scopeParent:e,l=function(e,t){var n=xe(e);return n<0&&t&&!be(e)?0:n}(i,r),c=r?Oe(e.candidates):i;0===l?r?t.push.apply(t,c):t.push(i):n.push({documentOrder:o,tabIndex:l,item:e,isScope:r,content:c})}),n.sort(Re).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Me=function(e,t){var n;return n=(t=t||{}).getShadowRoot?we([e],t.includeContainer,{filter:ke.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Te}):function(e,t,n){if(ye(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(me));return t&&ge.call(e,me)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,ke.bind(null,t)),Oe(n)};function Pe(e,t,n){let{reference:o,floating:r}=e;const i=oe(t),l=re(t),c=te(l),u=J(t),s="y"===i,a=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let p;switch(u){case"top":p={x:a,y:o.y-r.height};break;case"bottom":p={x:a,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(Q(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function De(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=G(t,e),m=de(p),h=c[d?"floating"===f?"reference":"floating":f],g=pe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:s,rootBoundary:a,strategy:u})),v="floating"===f?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=pe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:y,strategy:u}):v);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function Fe(e){const t=z(...e.map(e=>e.left)),n=z(...e.map(e=>e.top));return{x:t,y:n,width:K(...e.map(e=>e.right))-t,height:K(...e.map(e=>e.bottom))-n}}const Ie=new Set(["left","top"]);function Ne(e){const t=C(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=f(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,c=_(n)!==i||_(o)!==l;return c&&(n=i,o=l),{width:n,height:o,$:c}}function We(e){return a(e)?e:e.contextElement}function je(e){const t=We(e);if(!f(t))return X(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ne(t);let l=(i?_(n.width):n.width)/o,c=(i?_(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Be=X(0);function Ve(e){const t=c(e);return E()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Be}function He(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=We(e);let l=X(1);t&&(o?a(o)&&(l=je(o)):l=je(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==c(e))&&t}(i,n,o)?Ve(i):X(0);let s=(r.left+u.x)/l.x,f=(r.top+u.y)/l.y,d=r.width/l.x,p=r.height/l.y;if(i){const e=c(i),t=o&&a(o)?c(o):o;let n=e,r=M(n);for(;r&&o&&t!==n;){const e=je(r),t=r.getBoundingClientRect(),o=C(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,l=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,f*=e.y,d*=e.x,p*=e.y,s+=i,f+=l,n=c(r),r=M(n)}}return pe({width:d,height:p,x:s,y:f})}function qe(e,t){const n=L(e).scrollLeft;return t?t.left+n:He(u(e)).left+n}function ze(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qe(e,n),y:n.top+t.scrollTop}}const Ke=new Set(["absolute","fixed"]);function _e(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=c(e),o=u(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,s=0,a=0;if(r){i=r.width,l=r.height;const e=E();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,a=r.offsetTop)}const f=qe(o);if(f<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-t.clientWidth-r);l<=25&&(i-=l)}else f<=25&&(i+=f);return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t)o=function(e){const t=u(e),n=L(e),o=e.ownerDocument.body,r=K(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=K(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+qe(e);const c=-n.scrollTop;return"rtl"===C(o).direction&&(l+=K(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:c}}(u(e));else if(a(t))o=function(e,t){const n=He(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=f(e)?je(e):X(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=Ve(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pe(o)}function Ue(e,t){const n=k(e);return!(n===t||!a(n)||A(n))&&("fixed"===C(n).position||Ue(n,t))}function Xe(e,t,n){const o=f(t),r=u(t),i="fixed"===n,c=He(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=X(0);function d(){a.x=qe(r)}if(o||!o&&!i)if(("body"!==l(t)||m(r))&&(s=L(t)),o){const e=He(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else r&&d();i&&!o&&r&&d();const p=!r||o||i?X(0):ze(r,s);return{x:c.left+s.scrollLeft-a.x-p.x,y:c.top+s.scrollTop-a.y-p.y,width:c.width,height:c.height}}function $e(e){return"static"===C(e).position}function Ye(e,t){if(!f(e)||"fixed"===C(e).position)return null;if(t)return t(e);let n=e.offsetParent;return u(e)===n&&(n=n.ownerDocument.body),n}function Ze(e,t){const n=c(e);if(y(e))return n;if(!f(e)){let t=k(e);for(;t&&!A(t);){if(a(t)&&!$e(t))return t;t=k(t)}return n}let o=Ye(e,t);for(;o&&g(o)&&$e(o);)o=Ye(o,t);return o&&A(o)&&$e(o)&&!R(o)?n:o||function(e){let t=k(e);for(;f(t)&&!A(t);){if(R(t))return t;if(y(t))return null;t=k(t)}return null}(e)||n}const Ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,c=u(o),s=!!t&&y(t.floating);if(o===c||s&&i)return n;let a={scrollLeft:0,scrollTop:0},d=X(1);const p=X(0),h=f(o);if((h||!h&&!i)&&(("body"!==l(o)||m(c))&&(a=L(o)),f(o))){const e=He(o);d=je(o),p.x=e.x+o.clientLeft,p.y=e.y+o.clientTop}const g=!c||h||i?X(0):ze(c,a);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-a.scrollTop*d.y+p.y+g.y}},getDocumentElement:u,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?y(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=O(e,[],!1).filter(e=>a(e)&&"body"!==l(e)),r=null;const i="fixed"===C(e).position;let c=i?k(e):e;for(;a(c)&&!A(c);){const t=C(c),n=R(c);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&Ke.has(r.position)||m(c)&&!n&&Ue(e,c))?o=o.filter(e=>e!==c):r=t,c=k(c)}return t.set(e,o),o}(t,this._c):[].concat(n),o],c=i[0],u=i.reduce((e,n)=>{const o=_e(t,n,r);return e.top=K(o.top,e.top),e.right=z(o.right,e.right),e.bottom=z(o.bottom,e.bottom),e.left=K(o.left,e.left),e},_e(t,c,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Ze,getElementRects:async function(e){const t=this.getOffsetParent||Ze,n=this.getDimensions,o=await n(e.floating);return{reference:Xe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ne(e);return{width:t,height:n}},getScale:je,isElement:a,isRTL:function(e){return"rtl"===C(e).direction}};function Je(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qe(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,a=We(e),f=r||i?[...a?O(a):[],...O(t)]:[];f.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=a&&c?function(e,t){let n,o=null;const r=u(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const s=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=s;if(c||t(),!d||!p)return;const m={rootMargin:-U(f)+"px "+-U(r.clientWidth-(a+d))+"px "+-U(r.clientHeight-(f+p))+"px "+-U(a)+"px",threshold:K(0,z(1,u))||1};let h=!0;function g(t){const o=t[0].intersectionRatio;if(o!==u){if(!h)return l();o?l(!1,o):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==o||Je(s,e.getBoundingClientRect())||l(),h=!1}try{o=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,m)}o.observe(e)}(!0),i}(a,n):null;let p,m=-1,h=null;l&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===a&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),a&&!s&&h.observe(a),h.observe(t));let g=s?He(e):null;return s&&function t(){const o=He(e);g&&!Je(g,o)&&n();g=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const et=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=J(n),c=Q(n),u="y"===oe(n),s=Ie.has(l)?-1:1,a=i&&u?-1:1,f=G(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:r+u.x,y:i+u.y,data:{...u,placement:l}}}}},tt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=G(e,t),s={x:n,y:o},a=await De(t,u),f=oe(J(r)),d=ee(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=Z(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=Z(m+a["y"===f?"top":"left"],m,m-a[e])}const h=c.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[d]:i,[f]:l}}}}}},nt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=G(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=J(r),y=oe(c),w=J(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(s.floating)),x=d||(w||!h?[fe(c)]:function(e){const t=fe(e);return[ie(e),t,ie(t)]}(c)),R="none"!==m;!d&&R&&x.push(...ae(c,h,m,b));const E=[c,...x],S=await De(t,g),A=[];let C=(null==(o=i.flip)?void 0:o.overflows)||[];if(a&&A.push(S[v]),f){const e=function(e,t,n){void 0===n&&(n=!1);const o=Q(e),r=re(e),i=te(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=fe(l)),[l,fe(l)]}(r,l,b);A.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:r,overflows:A}],!A.every(e=>e<=0)){var L,k;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=E[e];if(t){if(!("alignment"===f&&y!==oe(t))||C.every(e=>oe(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(k=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(p){case"bestFit":{var T;const e=null==(T=C.filter(e=>{if(R){const t=oe(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:T[0];e&&(n=e);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}},ot=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:l,elements:c}=t,{apply:u=()=>{},...s}=G(e,t),a=await De(t,s),f=J(r),d=Q(r),p="y"===oe(r),{width:m,height:h}=i.floating;let g,v;"top"===f||"bottom"===f?(g=f,v=d===(await(null==l.isRTL?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(v=f,g="end"===d?"top":"bottom");const y=h-a.top-a.bottom,w=m-a.left-a.right,b=z(h-a[g],y),x=z(m-a[v],w),R=!t.middlewareData.shift;let E=b,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=w),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(E=y),R&&!d){const e=K(a.left,0),t=K(a.right,0),n=K(a.top,0),o=K(a.bottom,0);p?S=m-2*(0!==e||0!==t?e+t:K(a.left,a.right)):E=h-2*(0!==n||0!==o?n+o:K(a.top,a.bottom))}await u({...t,availableWidth:S,availableHeight:E});const A=await l.getDimensions(c.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}},rt=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=t,{padding:c=2,x:u,y:s}=G(e,t),a=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),f=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let o=null;for(let e=0;e<t.length;e++){const r=t[e];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(e=>pe(Fe(e)))}(a),d=pe(Fe(a)),p=de(c);const m=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&f[0].left>f[1].right&&null!=u&&null!=s)return f.find(e=>u>e.left-p.left&&u<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom)||d;if(f.length>=2){if("y"===oe(n)){const e=f[0],t=f[f.length-1],o="top"===J(n),r=e.top,i=t.bottom,l=o?e.left:t.left,c=o?e.right:t.right;return{top:r,bottom:i,left:l,right:c,width:c-l,height:i-r,x:l,y:r}}const e="left"===J(n),t=K(...f.map(e=>e.right)),o=z(...f.map(e=>e.left)),r=f.filter(n=>e?n.left===o:n.right===t),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:t,width:t-o,height:l-i,x:o,y:i}}return d}},floating:o.floating,strategy:l});return r.reference.x!==m.reference.x||r.reference.y!==m.reference.y||r.reference.width!==m.reference.width||r.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},it=(e,t,n)=>{const o=new Map,r={platform:Ge,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:a,y:f}=Pe(s,o,u),d=o,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:h}=c[n],{x:g,y:v,data:y,reset:w}=await h({x:a,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=v?v:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):w.rects),({x:a,y:f}=Pe(s,d,u))),n=-1)}return{x:a,y:f,placement:d,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var lt="undefined"!=typeof document?t:function(){};function ct(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,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!ct(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!ct(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ut(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function st(e,t){const n=ut(e);return Math.round(t*n)/n}function at(t){const n=e.useRef(t);return lt(()=>{n.current=t}),n}const ft=(e,t)=>({...et(e),options:[e,t]}),dt=(e,t)=>({...tt(e),options:[e,t]}),pt=(e,t)=>({...nt(e),options:[e,t]}),mt=(e,t)=>({...ot(e),options:[e,t]}),ht=(e,t)=>({...rt(e),options:[e,t]});function gt(t){return e.useMemo(()=>t.every(e=>null==e)?null:e=>{t.forEach(t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)})},t)}const vt={...e},yt=vt.useInsertionEffect||(e=>e());function wt(t){const n=e.useRef(()=>{});return yt(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return null==n.current?void 0:n.current(...t)},[])}var bt="undefined"!=typeof document?t:n;function xt(){return xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},xt.apply(this,arguments)}let Rt=!1,Et=0;const St=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Et++;const At=vt.useId||function(){const[t,n]=e.useState(()=>Rt?St():void 0);return bt(()=>{null==t&&n(St())},[]),e.useEffect(()=>{Rt=!0},[]),t};const Ct=e.createContext(null),Lt=e.createContext(null),kt=()=>e.useContext(Lt);function Tt(e){return"data-floating-ui-"+e}function Ot(e){const t=o(e);return bt(()=>{t.current=e}),t}let Mt=0;function Pt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Mt);const i=()=>null==e?void 0:e.focus({preventScroll:n});r?i():Mt=requestAnimationFrame(i)}function Dt(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),o=n;for(;o.length;)o=e.filter(e=>{var t;return null==(t=o)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(o);return n}let Ft=new WeakMap,It=new WeakSet,Nt={},Wt=0;const jt=e=>e&&(e.host||jt(e.parentNode));function Bt(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,c=(u=t,e.map(e=>{if(u.contains(e))return e;const t=jt(e);return u.contains(t)?t:null}).filter(e=>null!=e));var u;const s=new Set,a=new Set(c),f=[];Nt[r]||(Nt[r]=new WeakMap);const d=Nt[r];return c.forEach(function e(t){if(!t||s.has(t))return;s.add(t),t.parentNode&&e(t.parentNode)}),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,t=>{if("script"!==l(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,o=(Ft.get(t)||0)+1,l=(d.get(t)||0)+1;Ft.set(t,o),d.set(t,l),f.push(t),1===o&&n&&It.add(t),1===l&&t.setAttribute(r,""),!n&&i&&t.setAttribute(i,"true")}})}(t),s.clear(),Wt++,()=>{f.forEach(e=>{const t=(Ft.get(e)||0)-1,n=(d.get(e)||0)-1;Ft.set(e,t),d.set(e,n),t||(!It.has(e)&&i&&e.removeAttribute(i),It.delete(e)),n||e.removeAttribute(r)}),Wt--,Wt||(Ft=new WeakMap,Ft=new WeakMap,It=new WeakSet,Nt={})}}function Vt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=j(e[0]).body;return Bt(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Ht=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qt(e,t){const n=Me(e,Ht());"prev"===t&&n.reverse();const o=n.indexOf(P(j(e)));return n.slice(o+1)[0]}function zt(){return qt(document.body,"next")}function Kt(){return qt(document.body,"prev")}function _t(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!D(n,o)}function Ut(e){Me(e,Ht()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Xt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const $t={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Yt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Zt=e.forwardRef(function(t,n){const[o,r]=e.useState();bt(()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",Yt),()=>{document.removeEventListener("keydown",Yt)}),[]);const i={ref:n,tabIndex:0,role:o,"aria-hidden":!o||void 0,[Tt("focus-guard")]:"",style:$t};return e.createElement("span",xt({},t,i))}),Gt=e.createContext(null),Jt=Tt("portal");function Qt(t){const{children:n,id:o,root:i,preserveTabOrder:l=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:o}=t,r=At(),i=en(),[l,c]=e.useState(null),u=e.useRef(null);return bt(()=>()=>{null==l||l.remove(),queueMicrotask(()=>{u.current=null})},[l]),bt(()=>{if(!r)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=r,t.setAttribute(Jt,""),e.appendChild(t),u.current=t,c(t)},[n,r]),bt(()=>{if(null===o)return;if(!r)return;if(u.current)return;let e=o||(null==i?void 0:i.portalNode);e&&!a(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=r,l.setAttribute(Jt,""),e=t||e,e.appendChild(l),u.current=l,c(l)},[n,o,r,i]),l}({id:o,root:i}),[u,s]=e.useState(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),h=null==u?void 0:u.modal,g=null==u?void 0:u.open,v=!!u&&!u.modal&&u.open&&l&&!(!i&&!c);return e.useEffect(()=>{if(c&&l&&!h)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&_t(e)){("focusin"===e.type?Xt:Ut)(c)}}},[c,l,h]),e.useEffect(()=>{c&&(g||Xt(c))},[g,c]),e.createElement(Gt.Provider,{value:e.useMemo(()=>({preserveTabOrder:l,beforeOutsideRef:f,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:s}),[l,c])},v&&c&&e.createElement(Zt,{"data-type":"outside",ref:f,onFocus:e=>{if(_t(e,c)){var t;null==(t=p.current)||t.focus()}else{const e=Kt()||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),v&&c&&e.createElement("span",{"aria-owns":c.id,style:$t}),c&&r.createPortal(n,c),v&&c&&e.createElement(Zt,{"data-type":"outside",ref:d,onFocus:e=>{if(_t(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=zt()||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const en=()=>e.useContext(Gt),tn="data-floating-ui-focusable";let nn=[];function on(e){nn=nn.filter(e=>e.isConnected);let t=e;if(t&&"body"!==l(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ge.call(e,me)&&ke(t,e)}(t,Ht())){const e=Me(t,Ht())[0];e&&(t=e)}nn.push(t),nn.length>20&&(nn=nn.slice(-20))}}function rn(){return nn.slice().reverse().find(e=>e.isConnected)}const ln=e.forwardRef(function(t,n){return e.createElement("button",xt({},t,{type:"button",ref:n,tabIndex:-1,style:$t}))});function cn(t){const{context:n,children:o,disabled:r=!1,order:i=["content"],guards:l=!0,initialFocus:c=0,returnFocus:u=!0,restoreFocus:s=!1,modal:a=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:p=!0}=t,{open:m,refs:h,nodeId:g,onOpenChange:v,events:y,dataRef:w,floatingId:b,elements:{domReference:x,floating:R}}=n,E="number"==typeof c&&c<0,S=q(x)&&E,A="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||l,C=Ot(i),L=Ot(c),k=Ot(u),T=kt(),O=en(),M=e.useRef(null),F=e.useRef(null),I=e.useRef(!1),B=e.useRef(!1),z=e.useRef(-1),K=null!=O,_=(U=R)?U.hasAttribute(tn)?U:U.querySelector("["+tn+"]")||U:null;var U;const X=wt(function(e){return void 0===e&&(e=_),e?Me(e,Ht()):[]}),$=wt(e=>{const t=X(e);return C.current.map(e=>x&&"reference"===e?x:_&&"floating"===e?_:t).filter(Boolean).flat()});function Y(t){return!r&&d&&a?e.createElement(ln,{ref:"start"===t?M:F,onClick:e=>v(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}e.useEffect(()=>{if(r)return;if(!a)return;function e(e){if("Tab"===e.key){D(_,P(j(_)))&&0===X().length&&!S&&H(e);const t=$(),n=V(e);"reference"===C.current[0]&&n===x&&(H(e),e.shiftKey?Pt(t[t.length-1]):Pt(t[1])),"floating"===C.current[1]&&n===_&&e.shiftKey&&(H(e),Pt(t[0]))}}const t=j(_);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,x,_,a,C,S,X,$]),e.useEffect(()=>{if(!r&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=V(e),n=X().indexOf(t);-1!==n&&(z.current=n)}},[r,R,X]),e.useEffect(()=>{if(!r&&p)return R&&f(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){B.current=!0,setTimeout(()=>{B.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(D(x,t)||D(R,t)||D(t,R)||D(null==O?void 0:O.portalNode,t)||null!=t&&t.hasAttribute(Tt("focus-guard"))||T&&(Dt(T.nodesRef.current,g).find(e=>{var n,o;return D(null==(n=e.context)?void 0:n.elements.floating,t)||D(null==(o=e.context)?void 0:o.elements.domReference,t)})||function(e,t){var n;let o=[],r=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;r;){const t=e.find(e=>e.id===r);r=null==t?void 0:t.parentId,t&&(o=o.concat(t))}return o}(T.nodesRef.current,g).find(e=>{var n,o;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(s&&n&&P(j(_))===j(_).body){f(_)&&_.focus();const e=z.current,t=X(),n=t[e]||t[t.length-1]||_;f(n)&&n.focus()}!S&&a||!t||!n||B.current||t===rn()||(I.current=!0,v(!1,e,"focus-out"))})}},[r,x,R,_,a,g,T,O,v,p,s,X,S]),e.useEffect(()=>{var e;if(r)return;const t=Array.from((null==O||null==(e=O.portalNode)?void 0:e.querySelectorAll("["+Tt("portal")+"]"))||[]);if(R){const e=[R,...t,M.current,F.current,C.current.includes("reference")||S?x:null].filter(e=>null!=e),n=a||S?Vt(e,A,!A):Vt(e);return()=>{n()}}},[r,x,R,a,C,O,S,A]),bt(()=>{if(r||!f(_))return;const e=P(j(_));queueMicrotask(()=>{const t=$(_),n=L.current,o=("number"==typeof n?t[n]:n.current)||_,r=D(_,e);E||r||!m||Pt(o,{preventScroll:o===_})})},[r,m,_,E,$,L]),bt(()=>{if(r||!_)return;let e=!1;const t=j(_),n=P(t);let o=w.current.openEvent;function i(t){let{open:n,reason:r,event:i,nested:l}=t;n&&(o=i),"escape-key"===r&&h.domReference.current&&on(h.domReference.current),"hover"===r&&"mouseleave"===i.type&&(I.current=!0),"outside-press"===r&&(l?(I.current=!1,e=!0):I.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(W()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||N(i)))}on(n),y.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,$t),K&&x&&x.insertAdjacentElement("afterend",l),()=>{y.off("openchange",i);const n=P(t),r=D(R,n)||T&&Dt(T.nodesRef.current,g).some(e=>{var t;return D(null==(t=e.context)?void 0:t.elements.floating,n)});(r||o&&["click","mousedown"].includes(o.type))&&h.domReference.current&&on(h.domReference.current);const c="boolean"==typeof k.current?rn()||l:k.current.current||l;queueMicrotask(()=>{k.current&&!I.current&&f(c)&&(c===n||n===t.body||r)&&c.focus({preventScroll:e}),l.remove()})}},[r,R,_,k,w,h,y,T,g,K,x]),e.useEffect(()=>{queueMicrotask(()=>{I.current=!1})},[r]),bt(()=>{if(!r&&O)return O.setFocusManagerState({modal:a,closeOnFocusOut:p,open:m,onOpenChange:v,refs:h}),()=>{O.setFocusManagerState(null)}},[r,O,a,m,v,h,p]),bt(()=>{if(r)return;if(!_)return;if("function"!=typeof MutationObserver)return;if(E)return;const e=()=>{const e=_.getAttribute("tabindex"),t=X(),n=P(j(R)),o=t.indexOf(n);-1!==o&&(z.current=o),C.current.includes("floating")||n!==h.domReference.current&&0===t.length?"0"!==e&&_.setAttribute("tabindex","0"):"-1"!==e&&_.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(_,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,R,_,h,C,X,E]);const Z=!r&&A&&(!a||!S)&&(K||a);return e.createElement(e.Fragment,null,Z&&e.createElement(Zt,{"data-type":"inside",ref:null==O?void 0:O.beforeInsideRef,onFocus:e=>{if(a){const e=$();Pt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(I.current=!1,_t(e,O.portalNode)){const e=zt()||x;null==e||e.focus()}else{var t;null==(t=O.beforeOutsideRef.current)||t.focus()}}}),!S&&Y("start"),o,Y("end"),Z&&e.createElement(Zt,{"data-type":"inside",ref:null==O?void 0:O.afterInsideRef,onFocus:e=>{if(a)Pt($()[0]);else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(p&&(I.current=!0),_t(e,O.portalNode)){const e=Kt()||x;null==e||e.focus()}else{var t;null==(t=O.afterOutsideRef.current)||t.focus()}}}))}let un=0;let sn=()=>{};const an=e.forwardRef(function(t,n){const{lockScroll:o=!1,...r}=t;return bt(()=>{if(o)return un++,1===un&&(sn=function(){const e=/iP(hone|ad|od)|iOS/.test(F()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[n]=o+"px"),e){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(r-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(r,i))}}()),()=>{un--,0===un&&sn()}},[o]),e.createElement("div",xt({ref:n},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}),fn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pn=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 mn(t,n){void 0===n&&(n={});const{open:o,onOpenChange:r,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:d="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:h=!1,bubbles:g,capture:v}=n,y=kt(),w=wt("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,x=e.useRef(!1),R=e.useRef(!1),{escapeKey:S,outsidePress:L}=pn(g),{escapeKey:T,outsidePress:M}=pn(v),P=e.useRef(!1),F=wt(e=>{var t;if(!o||!c||!u||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?Dt(y.nodesRef.current,n):[];if(!S&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.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")}),I=wt(e=>{var t;const n=()=>{var t;F(e),null==(t=V(e))||t.removeEventListener("keydown",n)};null==(t=V(e))||t.addEventListener("keydown",n)}),N=wt(e=>{var t;const n=x.current;x.current=!1;const o=R.current;if(R.current=!1,"click"===d&&o)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=V(e),u="["+Tt("inert")+"]",s=j(i.floating).querySelectorAll(u);let p=a(c)?c:null;for(;p&&!A(p);){const e=k(p);if(A(e)||!a(e))break;p=e}if(s.length&&a(c)&&!c.matches("html,body")&&!D(c,i.floating)&&Array.from(s).every(e=>!D(p,e)))return;if(f(c)&&q){const t=c.clientWidth>0&&c.scrollWidth>c.clientWidth,n=c.clientHeight>0&&c.scrollHeight>c.clientHeight;let o=n&&e.offsetX>c.clientWidth;if(n){"rtl"===C(c).direction&&(o=e.offsetX<=c.offsetWidth-c.clientWidth)}if(o||t&&e.offsetY>c.clientHeight)return}const m=null==(t=l.current.floatingContext)?void 0:t.nodeId,h=y&&Dt(y.nodesRef.current,m).some(t=>{var n;return B(e,null==(n=t.context)?void 0:n.elements.floating)});if(B(e,i.floating)||B(e,i.domReference)||h)return;const g=y?Dt(y.nodesRef.current,m):[];if(g.length>0){let e=!0;if(g.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),W=wt(e=>{var t;const n=()=>{var t;N(e),null==(t=V(e))||t.removeEventListener(d,n)};null==(t=V(e))||t.addEventListener(d,n)});e.useEffect(()=>{if(!o||!c)return;l.current.__escapeKeyBubbles=S,l.current.__outsidePressBubbles=L;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout(()=>{P.current=!1},E()?5:0)}const f=j(i.floating);u&&(f.addEventListener("keydown",T?I:F,T),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),b&&f.addEventListener(d,M?W:N,M);let p=[];return h&&(a(i.domReference)&&(p=O(i.domReference)),a(i.floating)&&(p=p.concat(O(i.floating))),!a(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(O(i.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})}),()=>{u&&(f.removeEventListener("keydown",T?I:F,T),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),b&&f.removeEventListener(d,M?W:N,M),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[l,i,u,b,d,o,r,h,c,S,L,F,T,I,N,M,W]),e.useEffect(()=>{x.current=!1},[b,d]);const H=e.useMemo(()=>({onKeyDown:F,[fn[m]]:e=>{p&&r(!1,e.nativeEvent,"reference-press")}}),[F,r,p,m]),q=e.useMemo(()=>({onKeyDown:F,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[dn[d]]:()=>{x.current=!0}}),[F,d]);return e.useMemo(()=>c?{reference:H,floating:q}:{},[c,H,q])}function hn(t){const{open:n=!1,onOpenChange:o,elements:r}=t,i=At(),l=e.useRef({}),[c]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter(e=>e!==n))||[])}}}()),u=null!=((null==(s=e.useContext(Ct))?void 0:s.id)||null);var s;const[a,f]=e.useState(r.reference),d=wt((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==o||o(e,t,n)}),p=e.useMemo(()=>({setPositionReference:f}),[]),m=e.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return e.useMemo(()=>({dataRef:l,open:n,onOpenChange:d,elements:m,events:c,floatingId:i,refs:p}),[n,d,m,c,i,p])}function gn(t){void 0===t&&(t={});const{nodeId:n}=t,o=hn({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||o,l=i.elements,[c,u]=e.useState(null),[s,f]=e.useState(null),d=(null==l?void 0:l.domReference)||c,p=e.useRef(null),m=kt();bt(()=>{d&&(p.current=d)},[d]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:c,floating:u}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(i);ct(m,i)||h(i);const[g,v]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),x=e.useCallback(e=>{e!==A.current&&(A.current=e,w(e))},[]),R=c||g,E=u||y,S=e.useRef(null),A=e.useRef(null),C=e.useRef(d),L=null!=a,k=at(a),T=at(l),O=at(f),M=e.useCallback(()=>{if(!S.current||!A.current)return;const e={placement:n,strategy:o,middleware:m};T.current&&(e.platform=T.current),it(S.current,A.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};P.current&&!ct(C.current,t)&&(C.current=t,r.flushSync(()=>{p(t)}))})},[m,n,o,T,O]);lt(()=>{!1===f&&C.current.isPositioned&&(C.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[f]);const P=e.useRef(!1);lt(()=>(P.current=!0,()=>{P.current=!1}),[]),lt(()=>{if(R&&(S.current=R),E&&(A.current=E),R&&E){if(k.current)return k.current(R,E,M);M()}},[R,E,M,k,L]);const D=e.useMemo(()=>({reference:S,floating:A,setReference:b,setFloating:x}),[b,x]),F=e.useMemo(()=>({reference:R,floating:E}),[R,E]),I=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!F.floating)return e;const t=st(F.floating,d.x),n=st(F.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...ut(F.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,s,F.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:M,refs:D,elements:F,floatingStyles:I}),[d,M,D,F,I])}({...t,elements:{...l,...s&&{reference:s}}}),g=e.useCallback(e=>{const t=a(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f(t),h.refs.setReference(t)},[h.refs]),v=e.useCallback(e=>{(a(e)||null===e)&&(p.current=e,u(e)),(a(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!a(e))&&h.refs.setReference(e)},[h.refs]),y=e.useMemo(()=>({...h.refs,setReference:v,setPositionReference:g,domReference:p}),[h.refs,v,g]),w=e.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=e.useMemo(()=>({...h,...i,refs:y,elements:w,nodeId:n}),[h,y,w,n,i]);return bt(()=>{i.dataRef.current.floatingContext=b;const e=null==m?void 0:m.nodesRef.current.find(e=>e.id===n);e&&(e.context=b)}),e.useMemo(()=>({...h,context:b,refs:y,elements:w}),[h,y,w,b])}const vn="active",yn="selected";function wn(e,t,n){const o=new Map,r="item"===n;let i=e;if(r&&e){const{[vn]:t,[yn]:n,...o}=e;i=o}return{..."floating"===n&&{tabIndex:-1,[tn]:""},...i,...t.map(t=>{const o=t?t[n]:null;return"function"==typeof o?e?o(e):null:o}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var l;r&&[vn,yn].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof i&&(null==(l=o.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==(e=o.get(n))?void 0:e.map(e=>e(...r)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}function bn(t){void 0===t&&(t=[]);const n=t.map(e=>null==e?void 0:e.reference),o=t.map(e=>null==e?void 0:e.floating),r=t.map(e=>null==e?void 0:e.item),i=e.useCallback(e=>wn(e,t,"reference"),n),l=e.useCallback(e=>wn(e,t,"floating"),o),c=e.useCallback(e=>wn(e,t,"item"),r);return e.useMemo(()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c}),[i,l,c])}const xn=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Rn(e,t){return"function"==typeof e?e(t):e}function En(t,n){void 0===n&&(n={});const{open:o,elements:{floating:r}}=t,{duration:i=250}=n,l=("number"==typeof i?i:i.close)||0,[c,u]=e.useState("unmounted"),s=function(t,n){const[o,r]=e.useState(t);return t&&!o&&r(!0),e.useEffect(()=>{if(!t&&o){const e=setTimeout(()=>r(!1),n);return()=>clearTimeout(e)}},[t,o,n]),o}(o,l);return s||"close"!==c||u("unmounted"),bt(()=>{if(r){if(o){u("initial");const e=requestAnimationFrame(()=>{u("open")});return()=>{cancelAnimationFrame(e)}}u("close")}},[o,r]),{isMounted:s,status:c}}function Sn(t,n){void 0===n&&(n={});const{initial:o={opacity:0},open:r,close:i,common:l,duration:c=250}=n,u=t.placement,s=u.split("-")[0],a=e.useMemo(()=>({side:s,placement:u}),[s,u]),f="number"==typeof c,d=(f?c:c.open)||0,p=(f?c:c.close)||0,[m,h]=e.useState(()=>({...Rn(l,a),...Rn(o,a)})),{isMounted:g,status:v}=En(t,{duration:c}),y=Ot(o),w=Ot(r),b=Ot(i),x=Ot(l);return bt(()=>{const e=Rn(y.current,a),t=Rn(b.current,a),n=Rn(x.current,a),o=Rn(w.current,a)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===v&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===v&&h({transitionProperty:Object.keys(o).map(xn).join(","),transitionDuration:d+"ms",...n,...o}),"close"===v){const o=t||e;h({transitionProperty:Object.keys(o).map(xn).join(","),transitionDuration:p+"ms",...n,...o})}},[p,b,y,w,x,d,v,a]),{isMounted:g,styles:m}}export{cn as F,Qe as a,Sn as b,mt as c,gt as d,mn as e,pt as f,bn as g,At as h,ht as i,Qt as j,an as k,ft as o,dt as s,gn as u};
5
+ */var me=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),he="undefined"==typeof Element,ge=he?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ve=!he&&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},ye=function(e,t){var n;void 0===t&&(t=!0);var o=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===o||"true"===o||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):ye(e.parentNode))},we=function(e,t,n){for(var o=[],r=Array.from(e);r.length;){var i=r.shift();if(!ye(i,!1))if("SLOT"===i.tagName){var l=i.assignedElements(),c=l.length?l:i.children,u=we(c,!0,n);n.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{ge.call(i,me)&&n.filter(i)&&(t||!e.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!ye(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(s&&a){var f=we(!0===s?i.children:s.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else r.unshift.apply(r,i.children)}}return o},be=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},xe=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))&&!be(e)?0:e.tabIndex},Re=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ee=function(e){return"INPUT"===e.tagName},Se=function(e){return function(e){return Ee(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ve(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(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 r=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!r||r===e}(e)},Ae=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},Ce=function(e,t){var n=t.displayCheck,o=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 r=ge.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ge.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ae(e)}else{if("function"==typeof o){for(var i=e;e;){var l=e.parentElement,c=ve(e);if(l&&!l.shadowRoot&&!0===o(l))return Ae(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,o,r,i=e&&ve(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(l)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!c&&l;){var u,s,a;c=!(null===(s=l=null===(u=i=ve(l))||void 0===u?void 0:u.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Le=function(e,t){return!(t.disabled||function(e){return Ee(e)&&"hidden"===e.type}(t)||Ce(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 o=t.children.item(n);if("LEGEND"===o.tagName)return!!ge.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},ke=function(e,t){return!(Se(t)||xe(t)<0||!Le(e,t))},Te=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Oe=function(e){var t=[],n=[];return e.forEach(function(e,o){var r=!!e.scopeParent,i=r?e.scopeParent:e,l=function(e,t){var n=xe(e);return n<0&&t&&!be(e)?0:n}(i,r),c=r?Oe(e.candidates):i;0===l?r?t.push.apply(t,c):t.push(i):n.push({documentOrder:o,tabIndex:l,item:e,isScope:r,content:c})}),n.sort(Re).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Me=function(e,t){var n;return n=(t=t||{}).getShadowRoot?we([e],t.includeContainer,{filter:ke.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Te}):function(e,t,n){if(ye(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(me));return t&&ge.call(e,me)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,ke.bind(null,t)),Oe(n)};function Pe(e,t,n){let{reference:o,floating:r}=e;const i=oe(t),l=re(t),c=te(l),u=J(t),s="y"===i,a=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let p;switch(u){case"top":p={x:a,y:o.y-r.height};break;case"bottom":p={x:a,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(Q(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function De(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=G(t,e),m=de(p),h=c[d?"floating"===f?"reference":"floating":f],g=pe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:s,rootBoundary:a,strategy:u})),v="floating"===f?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=pe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:y,strategy:u}):v);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function Fe(e){const t=z(...e.map(e=>e.left)),n=z(...e.map(e=>e.top));return{x:t,y:n,width:K(...e.map(e=>e.right))-t,height:K(...e.map(e=>e.bottom))-n}}const Ie=new Set(["left","top"]);function Ne(e){const t=C(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=f(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,c=_(n)!==i||_(o)!==l;return c&&(n=i,o=l),{width:n,height:o,$:c}}function We(e){return a(e)?e:e.contextElement}function je(e){const t=We(e);if(!f(t))return X(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ne(t);let l=(i?_(n.width):n.width)/o,c=(i?_(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Be=X(0);function Ve(e){const t=c(e);return E()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Be}function He(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=We(e);let l=X(1);t&&(o?a(o)&&(l=je(o)):l=je(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==c(e))&&t}(i,n,o)?Ve(i):X(0);let s=(r.left+u.x)/l.x,f=(r.top+u.y)/l.y,d=r.width/l.x,p=r.height/l.y;if(i){const e=c(i),t=o&&a(o)?c(o):o;let n=e,r=M(n);for(;r&&o&&t!==n;){const e=je(r),t=r.getBoundingClientRect(),o=C(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,l=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,f*=e.y,d*=e.x,p*=e.y,s+=i,f+=l,n=c(r),r=M(n)}}return pe({width:d,height:p,x:s,y:f})}function qe(e,t){const n=L(e).scrollLeft;return t?t.left+n:He(u(e)).left+n}function ze(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qe(e,n),y:n.top+t.scrollTop}}const Ke=new Set(["absolute","fixed"]);function _e(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=c(e),o=u(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,s=0,a=0;if(r){i=r.width,l=r.height;const e=E();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,a=r.offsetTop)}const f=qe(o);if(f<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-t.clientWidth-r);l<=25&&(i-=l)}else f<=25&&(i+=f);return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t)o=function(e){const t=u(e),n=L(e),o=e.ownerDocument.body,r=K(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=K(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+qe(e);const c=-n.scrollTop;return"rtl"===C(o).direction&&(l+=K(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:c}}(u(e));else if(a(t))o=function(e,t){const n=He(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=f(e)?je(e):X(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=Ve(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pe(o)}function Ue(e,t){const n=k(e);return!(n===t||!a(n)||A(n))&&("fixed"===C(n).position||Ue(n,t))}function Xe(e,t,n){const o=f(t),r=u(t),i="fixed"===n,c=He(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=X(0);function d(){a.x=qe(r)}if(o||!o&&!i)if(("body"!==l(t)||m(r))&&(s=L(t)),o){const e=He(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else r&&d();i&&!o&&r&&d();const p=!r||o||i?X(0):ze(r,s);return{x:c.left+s.scrollLeft-a.x-p.x,y:c.top+s.scrollTop-a.y-p.y,width:c.width,height:c.height}}function $e(e){return"static"===C(e).position}function Ye(e,t){if(!f(e)||"fixed"===C(e).position)return null;if(t)return t(e);let n=e.offsetParent;return u(e)===n&&(n=n.ownerDocument.body),n}function Ze(e,t){const n=c(e);if(y(e))return n;if(!f(e)){let t=k(e);for(;t&&!A(t);){if(a(t)&&!$e(t))return t;t=k(t)}return n}let o=Ye(e,t);for(;o&&g(o)&&$e(o);)o=Ye(o,t);return o&&A(o)&&$e(o)&&!R(o)?n:o||function(e){let t=k(e);for(;f(t)&&!A(t);){if(R(t))return t;if(y(t))return null;t=k(t)}return null}(e)||n}const Ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,c=u(o),s=!!t&&y(t.floating);if(o===c||s&&i)return n;let a={scrollLeft:0,scrollTop:0},d=X(1);const p=X(0),h=f(o);if((h||!h&&!i)&&(("body"!==l(o)||m(c))&&(a=L(o)),f(o))){const e=He(o);d=je(o),p.x=e.x+o.clientLeft,p.y=e.y+o.clientTop}const g=!c||h||i?X(0):ze(c,a);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-a.scrollTop*d.y+p.y+g.y}},getDocumentElement:u,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?y(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=O(e,[],!1).filter(e=>a(e)&&"body"!==l(e)),r=null;const i="fixed"===C(e).position;let c=i?k(e):e;for(;a(c)&&!A(c);){const t=C(c),n=R(c);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&Ke.has(r.position)||m(c)&&!n&&Ue(e,c))?o=o.filter(e=>e!==c):r=t,c=k(c)}return t.set(e,o),o}(t,this._c):[].concat(n),o],c=i[0],u=i.reduce((e,n)=>{const o=_e(t,n,r);return e.top=K(o.top,e.top),e.right=z(o.right,e.right),e.bottom=z(o.bottom,e.bottom),e.left=K(o.left,e.left),e},_e(t,c,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Ze,getElementRects:async function(e){const t=this.getOffsetParent||Ze,n=this.getDimensions,o=await n(e.floating);return{reference:Xe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ne(e);return{width:t,height:n}},getScale:je,isElement:a,isRTL:function(e){return"rtl"===C(e).direction}};function Je(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qe(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,a=We(e),f=r||i?[...a?O(a):[],...O(t)]:[];f.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=a&&c?function(e,t){let n,o=null;const r=u(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const s=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=s;if(c||t(),!d||!p)return;const m={rootMargin:-U(f)+"px "+-U(r.clientWidth-(a+d))+"px "+-U(r.clientHeight-(f+p))+"px "+-U(a)+"px",threshold:K(0,z(1,u))||1};let h=!0;function g(t){const o=t[0].intersectionRatio;if(o!==u){if(!h)return l();o?l(!1,o):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==o||Je(s,e.getBoundingClientRect())||l(),h=!1}try{o=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,m)}o.observe(e)}(!0),i}(a,n):null;let p,m=-1,h=null;l&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===a&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),a&&!s&&h.observe(a),h.observe(t));let g=s?He(e):null;return s&&function t(){const o=He(e);g&&!Je(g,o)&&n();g=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const et=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=J(n),c=Q(n),u="y"===oe(n),s=Ie.has(l)?-1:1,a=i&&u?-1:1,f=G(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:r+u.x,y:i+u.y,data:{...u,placement:l}}}}},tt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=G(e,t),s={x:n,y:o},a=await De(t,u),f=oe(J(r)),d=ee(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=Z(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=Z(m+a["y"===f?"top":"left"],m,m-a[e])}const h=c.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[d]:i,[f]:l}}}}}},nt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=G(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=J(r),y=oe(c),w=J(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(s.floating)),x=d||(w||!h?[fe(c)]:function(e){const t=fe(e);return[ie(e),t,ie(t)]}(c)),R="none"!==m;!d&&R&&x.push(...ae(c,h,m,b));const E=[c,...x],S=await De(t,g),A=[];let C=(null==(o=i.flip)?void 0:o.overflows)||[];if(a&&A.push(S[v]),f){const e=function(e,t,n){void 0===n&&(n=!1);const o=Q(e),r=re(e),i=te(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=fe(l)),[l,fe(l)]}(r,l,b);A.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:r,overflows:A}],!A.every(e=>e<=0)){var L,k;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=E[e];if(t){if(!("alignment"===f&&y!==oe(t))||C.every(e=>oe(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(k=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(p){case"bestFit":{var T;const e=null==(T=C.filter(e=>{if(R){const t=oe(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:T[0];e&&(n=e);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}},ot=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:l,elements:c}=t,{apply:u=()=>{},...s}=G(e,t),a=await De(t,s),f=J(r),d=Q(r),p="y"===oe(r),{width:m,height:h}=i.floating;let g,v;"top"===f||"bottom"===f?(g=f,v=d===(await(null==l.isRTL?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(v=f,g="end"===d?"top":"bottom");const y=h-a.top-a.bottom,w=m-a.left-a.right,b=z(h-a[g],y),x=z(m-a[v],w),R=!t.middlewareData.shift;let E=b,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=w),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(E=y),R&&!d){const e=K(a.left,0),t=K(a.right,0),n=K(a.top,0),o=K(a.bottom,0);p?S=m-2*(0!==e||0!==t?e+t:K(a.left,a.right)):E=h-2*(0!==n||0!==o?n+o:K(a.top,a.bottom))}await u({...t,availableWidth:S,availableHeight:E});const A=await l.getDimensions(c.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}},rt=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=t,{padding:c=2,x:u,y:s}=G(e,t),a=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),f=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let o=null;for(let e=0;e<t.length;e++){const r=t[e];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(e=>pe(Fe(e)))}(a),d=pe(Fe(a)),p=de(c);const m=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&f[0].left>f[1].right&&null!=u&&null!=s)return f.find(e=>u>e.left-p.left&&u<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom)||d;if(f.length>=2){if("y"===oe(n)){const e=f[0],t=f[f.length-1],o="top"===J(n),r=e.top,i=t.bottom,l=o?e.left:t.left,c=o?e.right:t.right;return{top:r,bottom:i,left:l,right:c,width:c-l,height:i-r,x:l,y:r}}const e="left"===J(n),t=K(...f.map(e=>e.right)),o=z(...f.map(e=>e.left)),r=f.filter(n=>e?n.left===o:n.right===t),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:t,width:t-o,height:l-i,x:o,y:i}}return d}},floating:o.floating,strategy:l});return r.reference.x!==m.reference.x||r.reference.y!==m.reference.y||r.reference.width!==m.reference.width||r.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},it=(e,t,n)=>{const o=new Map,r={platform:Ge,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:a,y:f}=Pe(s,o,u),d=o,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:h}=c[n],{x:g,y:v,data:y,reset:w}=await h({x:a,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=v?v:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):w.rects),({x:a,y:f}=Pe(s,d,u))),n=-1)}return{x:a,y:f,placement:d,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var lt="undefined"!=typeof document?t:function(){};function ct(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,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!ct(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!ct(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ut(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function st(e,t){const n=ut(e);return Math.round(t*n)/n}function at(t){const n=e.useRef(t);return lt(()=>{n.current=t}),n}const ft=(e,t)=>({...et(e),options:[e,t]}),dt=(e,t)=>({...tt(e),options:[e,t]}),pt=(e,t)=>({...nt(e),options:[e,t]}),mt=(e,t)=>({...ot(e),options:[e,t]}),ht=(e,t)=>({...rt(e),options:[e,t]});function gt(t){return e.useMemo(()=>t.every(e=>null==e)?null:e=>{t.forEach(t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)})},t)}const vt={...e},yt=vt.useInsertionEffect||(e=>e());function wt(t){const n=e.useRef(()=>{});return yt(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return null==n.current?void 0:n.current(...t)},[])}var bt="undefined"!=typeof document?t:n;function xt(){return xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},xt.apply(this,arguments)}let Rt=!1,Et=0;const St=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Et++;const At=vt.useId||function(){const[t,n]=e.useState(()=>Rt?St():void 0);return bt(()=>{null==t&&n(St())},[]),e.useEffect(()=>{Rt=!0},[]),t};const Ct=e.createContext(null),Lt=e.createContext(null),kt=()=>e.useContext(Lt);function Tt(e){return"data-floating-ui-"+e}function Ot(e){const t=o(e);return bt(()=>{t.current=e}),t}let Mt=0;function Pt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Mt);const i=()=>null==e?void 0:e.focus({preventScroll:n});r?i():Mt=requestAnimationFrame(i)}function Dt(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),o=n;for(;o.length;)o=e.filter(e=>{var t;return null==(t=o)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(o);return n}let Ft=new WeakMap,It=new WeakSet,Nt={},Wt=0;const jt=e=>e&&(e.host||jt(e.parentNode));function Bt(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,c=(u=t,e.map(e=>{if(u.contains(e))return e;const t=jt(e);return u.contains(t)?t:null}).filter(e=>null!=e));var u;const s=new Set,a=new Set(c),f=[];Nt[r]||(Nt[r]=new WeakMap);const d=Nt[r];return c.forEach(function e(t){if(!t||s.has(t))return;s.add(t),t.parentNode&&e(t.parentNode)}),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,t=>{if("script"!==l(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,o=(Ft.get(t)||0)+1,l=(d.get(t)||0)+1;Ft.set(t,o),d.set(t,l),f.push(t),1===o&&n&&It.add(t),1===l&&t.setAttribute(r,""),!n&&i&&t.setAttribute(i,"true")}})}(t),s.clear(),Wt++,()=>{f.forEach(e=>{const t=(Ft.get(e)||0)-1,n=(d.get(e)||0)-1;Ft.set(e,t),d.set(e,n),t||(!It.has(e)&&i&&e.removeAttribute(i),It.delete(e)),n||e.removeAttribute(r)}),Wt--,Wt||(Ft=new WeakMap,Ft=new WeakMap,It=new WeakSet,Nt={})}}function Vt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=j(e[0]).body;return Bt(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Ht=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qt(e,t){const n=Me(e,Ht());"prev"===t&&n.reverse();const o=n.indexOf(P(j(e)));return n.slice(o+1)[0]}function zt(){return qt(document.body,"next")}function Kt(){return qt(document.body,"prev")}function _t(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!D(n,o)}function Ut(e){Me(e,Ht()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Xt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const $t={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Yt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Zt=e.forwardRef(function(t,n){const[o,r]=e.useState();bt(()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",Yt),()=>{document.removeEventListener("keydown",Yt)}),[]);const i={ref:n,tabIndex:0,role:o,"aria-hidden":!o||void 0,[Tt("focus-guard")]:"",style:$t};return e.createElement("span",xt({},t,i))}),Gt=e.createContext(null),Jt=Tt("portal");function Qt(t){const{children:n,id:o,root:i,preserveTabOrder:l=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:o}=t,r=At(),i=en(),[l,c]=e.useState(null),u=e.useRef(null);return bt(()=>()=>{null==l||l.remove(),queueMicrotask(()=>{u.current=null})},[l]),bt(()=>{if(!r)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=r,t.setAttribute(Jt,""),e.appendChild(t),u.current=t,c(t)},[n,r]),bt(()=>{if(null===o)return;if(!r)return;if(u.current)return;let e=o||(null==i?void 0:i.portalNode);e&&!a(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=r,l.setAttribute(Jt,""),e=t||e,e.appendChild(l),u.current=l,c(l)},[n,o,r,i]),l}({id:o,root:i}),[u,s]=e.useState(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),h=null==u?void 0:u.modal,g=null==u?void 0:u.open,v=!!u&&!u.modal&&u.open&&l&&!(!i&&!c);return e.useEffect(()=>{if(c&&l&&!h)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&_t(e)){("focusin"===e.type?Xt:Ut)(c)}}},[c,l,h]),e.useEffect(()=>{c&&(g||Xt(c))},[g,c]),e.createElement(Gt.Provider,{value:e.useMemo(()=>({preserveTabOrder:l,beforeOutsideRef:f,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:s}),[l,c])},v&&c&&e.createElement(Zt,{"data-type":"outside",ref:f,onFocus:e=>{if(_t(e,c)){var t;null==(t=p.current)||t.focus()}else{const e=Kt()||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),v&&c&&e.createElement("span",{"aria-owns":c.id,style:$t}),c&&r.createPortal(n,c),v&&c&&e.createElement(Zt,{"data-type":"outside",ref:d,onFocus:e=>{if(_t(e,c)){var t;null==(t=m.current)||t.focus()}else{const t=zt()||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const en=()=>e.useContext(Gt),tn="data-floating-ui-focusable";let nn=[];function on(e){nn=nn.filter(e=>e.isConnected);let t=e;if(t&&"body"!==l(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ge.call(e,me)&&ke(t,e)}(t,Ht())){const e=Me(t,Ht())[0];e&&(t=e)}nn.push(t),nn.length>20&&(nn=nn.slice(-20))}}function rn(){return nn.slice().reverse().find(e=>e.isConnected)}const ln=e.forwardRef(function(t,n){return e.createElement("button",xt({},t,{type:"button",ref:n,tabIndex:-1,style:$t}))});function cn(t){const{context:n,children:o,disabled:r=!1,order:i=["content"],guards:l=!0,initialFocus:c=0,returnFocus:u=!0,restoreFocus:s=!1,modal:a=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:p=!0}=t,{open:m,refs:h,nodeId:g,onOpenChange:v,events:y,dataRef:w,floatingId:b,elements:{domReference:x,floating:R}}=n,E="number"==typeof c&&c<0,S=q(x)&&E,A="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||l,C=Ot(i),L=Ot(c),k=Ot(u),T=kt(),O=en(),M=e.useRef(null),F=e.useRef(null),I=e.useRef(!1),B=e.useRef(!1),z=e.useRef(-1),K=null!=O,_=(U=R)?U.hasAttribute(tn)?U:U.querySelector("["+tn+"]")||U:null;var U;const X=wt(function(e){return void 0===e&&(e=_),e?Me(e,Ht()):[]}),$=wt(e=>{const t=X(e);return C.current.map(e=>x&&"reference"===e?x:_&&"floating"===e?_:t).filter(Boolean).flat()});function Y(t){return!r&&d&&a?e.createElement(ln,{ref:"start"===t?M:F,onClick:e=>v(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}e.useEffect(()=>{if(r)return;if(!a)return;function e(e){if("Tab"===e.key){D(_,P(j(_)))&&0===X().length&&!S&&H(e);const t=$(),n=V(e);"reference"===C.current[0]&&n===x&&(H(e),e.shiftKey?Pt(t[t.length-1]):Pt(t[1])),"floating"===C.current[1]&&n===_&&e.shiftKey&&(H(e),Pt(t[0]))}}const t=j(_);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,x,_,a,C,S,X,$]),e.useEffect(()=>{if(!r&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=V(e),n=X().indexOf(t);-1!==n&&(z.current=n)}},[r,R,X]),e.useEffect(()=>{if(!r&&p)return R&&f(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){B.current=!0,setTimeout(()=>{B.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(D(x,t)||D(R,t)||D(t,R)||D(null==O?void 0:O.portalNode,t)||null!=t&&t.hasAttribute(Tt("focus-guard"))||T&&(Dt(T.nodesRef.current,g).find(e=>{var n,o;return D(null==(n=e.context)?void 0:n.elements.floating,t)||D(null==(o=e.context)?void 0:o.elements.domReference,t)})||function(e,t){var n;let o=[],r=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;r;){const t=e.find(e=>e.id===r);r=null==t?void 0:t.parentId,t&&(o=o.concat(t))}return o}(T.nodesRef.current,g).find(e=>{var n,o;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(s&&n&&P(j(_))===j(_).body){f(_)&&_.focus();const e=z.current,t=X(),n=t[e]||t[t.length-1]||_;f(n)&&n.focus()}!S&&a||!t||!n||B.current||t===rn()||(I.current=!0,v(!1,e,"focus-out"))})}},[r,x,R,_,a,g,T,O,v,p,s,X,S]),e.useEffect(()=>{var e;if(r)return;const t=Array.from((null==O||null==(e=O.portalNode)?void 0:e.querySelectorAll("["+Tt("portal")+"]"))||[]);if(R){const e=[R,...t,M.current,F.current,C.current.includes("reference")||S?x:null].filter(e=>null!=e),n=a||S?Vt(e,A,!A):Vt(e);return()=>{n()}}},[r,x,R,a,C,O,S,A]),bt(()=>{if(r||!f(_))return;const e=P(j(_));queueMicrotask(()=>{const t=$(_),n=L.current,o=("number"==typeof n?t[n]:n.current)||_,r=D(_,e);E||r||!m||Pt(o,{preventScroll:o===_})})},[r,m,_,E,$,L]),bt(()=>{if(r||!_)return;let e=!1;const t=j(_),n=P(t);let o=w.current.openEvent;function i(t){let{open:n,reason:r,event:i,nested:l}=t;n&&(o=i),"escape-key"===r&&h.domReference.current&&on(h.domReference.current),"hover"===r&&"mouseleave"===i.type&&(I.current=!0),"outside-press"===r&&(l?(I.current=!1,e=!0):I.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(W()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||N(i)))}on(n),y.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,$t),K&&x&&x.insertAdjacentElement("afterend",l),()=>{y.off("openchange",i);const n=P(t),r=D(R,n)||T&&Dt(T.nodesRef.current,g).some(e=>{var t;return D(null==(t=e.context)?void 0:t.elements.floating,n)});(r||o&&["click","mousedown"].includes(o.type))&&h.domReference.current&&on(h.domReference.current);const c="boolean"==typeof k.current?rn()||l:k.current.current||l;queueMicrotask(()=>{k.current&&!I.current&&f(c)&&(c===n||n===t.body||r)&&c.focus({preventScroll:e}),l.remove()})}},[r,R,_,k,w,h,y,T,g,K,x]),e.useEffect(()=>{queueMicrotask(()=>{I.current=!1})},[r]),bt(()=>{if(!r&&O)return O.setFocusManagerState({modal:a,closeOnFocusOut:p,open:m,onOpenChange:v,refs:h}),()=>{O.setFocusManagerState(null)}},[r,O,a,m,v,h,p]),bt(()=>{if(r)return;if(!_)return;if("function"!=typeof MutationObserver)return;if(E)return;const e=()=>{const e=_.getAttribute("tabindex"),t=X(),n=P(j(R)),o=t.indexOf(n);-1!==o&&(z.current=o),C.current.includes("floating")||n!==h.domReference.current&&0===t.length?"0"!==e&&_.setAttribute("tabindex","0"):"-1"!==e&&_.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(_,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,R,_,h,C,X,E]);const Z=!r&&A&&(!a||!S)&&(K||a);return e.createElement(e.Fragment,null,Z&&e.createElement(Zt,{"data-type":"inside",ref:null==O?void 0:O.beforeInsideRef,onFocus:e=>{if(a){const e=$();Pt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(I.current=!1,_t(e,O.portalNode)){const e=zt()||x;null==e||e.focus()}else{var t;null==(t=O.beforeOutsideRef.current)||t.focus()}}}),!S&&Y("start"),o,Y("end"),Z&&e.createElement(Zt,{"data-type":"inside",ref:null==O?void 0:O.afterInsideRef,onFocus:e=>{if(a)Pt($()[0]);else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(p&&(I.current=!0),_t(e,O.portalNode)){const e=Kt()||x;null==e||e.focus()}else{var t;null==(t=O.afterOutsideRef.current)||t.focus()}}}))}let un=0;let sn=()=>{};const an=e.forwardRef(function(t,n){const{lockScroll:o=!1,...r}=t;return bt(()=>{if(o)return un++,1===un&&(sn=function(){const e=/iP(hone|ad|od)|iOS/.test(F()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[n]=o+"px"),e){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(r-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(r,i))}}()),()=>{un--,0===un&&sn()}},[o]),e.createElement("div",xt({ref:n},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}),fn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pn=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 mn(t,n){void 0===n&&(n={});const{open:o,onOpenChange:r,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:d="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:h=!1,bubbles:g,capture:v}=n,y=kt(),w=wt("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,x=e.useRef(!1),R=e.useRef(!1),{escapeKey:S,outsidePress:L}=pn(g),{escapeKey:T,outsidePress:M}=pn(v),P=e.useRef(!1),F=wt(e=>{var t;if(!o||!c||!u||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?Dt(y.nodesRef.current,n):[];if(!S&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.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")}),I=wt(e=>{var t;const n=()=>{var t;F(e),null==(t=V(e))||t.removeEventListener("keydown",n)};null==(t=V(e))||t.addEventListener("keydown",n)}),N=wt(e=>{var t;const n=x.current;x.current=!1;const o=R.current;if(R.current=!1,"click"===d&&o)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=V(e),u="["+Tt("inert")+"]",s=j(i.floating).querySelectorAll(u);let p=a(c)?c:null;for(;p&&!A(p);){const e=k(p);if(A(e)||!a(e))break;p=e}if(s.length&&a(c)&&!c.matches("html,body")&&!D(c,i.floating)&&Array.from(s).every(e=>!D(p,e)))return;if(f(c)&&q){const t=c.clientWidth>0&&c.scrollWidth>c.clientWidth,n=c.clientHeight>0&&c.scrollHeight>c.clientHeight;let o=n&&e.offsetX>c.clientWidth;if(n){"rtl"===C(c).direction&&(o=e.offsetX<=c.offsetWidth-c.clientWidth)}if(o||t&&e.offsetY>c.clientHeight)return}const m=null==(t=l.current.floatingContext)?void 0:t.nodeId,h=y&&Dt(y.nodesRef.current,m).some(t=>{var n;return B(e,null==(n=t.context)?void 0:n.elements.floating)});if(B(e,i.floating)||B(e,i.domReference)||h)return;const g=y?Dt(y.nodesRef.current,m):[];if(g.length>0){let e=!0;if(g.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),W=wt(e=>{var t;const n=()=>{var t;N(e),null==(t=V(e))||t.removeEventListener(d,n)};null==(t=V(e))||t.addEventListener(d,n)});e.useEffect(()=>{if(!o||!c)return;l.current.__escapeKeyBubbles=S,l.current.__outsidePressBubbles=L;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout(()=>{P.current=!1},E()?5:0)}const f=j(i.floating);u&&(f.addEventListener("keydown",T?I:F,T),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),b&&f.addEventListener(d,M?W:N,M);let p=[];return h&&(a(i.domReference)&&(p=O(i.domReference)),a(i.floating)&&(p=p.concat(O(i.floating))),!a(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(O(i.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})}),()=>{u&&(f.removeEventListener("keydown",T?I:F,T),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),b&&f.removeEventListener(d,M?W:N,M),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[l,i,u,b,d,o,r,h,c,S,L,F,T,I,N,M,W]),e.useEffect(()=>{x.current=!1},[b,d]);const H=e.useMemo(()=>({onKeyDown:F,[fn[m]]:e=>{p&&r(!1,e.nativeEvent,"reference-press")}}),[F,r,p,m]),q=e.useMemo(()=>({onKeyDown:F,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[dn[d]]:()=>{x.current=!0}}),[F,d]);return e.useMemo(()=>c?{reference:H,floating:q}:{},[c,H,q])}function hn(t){const{open:n=!1,onOpenChange:o,elements:r}=t,i=At(),l=e.useRef({}),[c]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter(e=>e!==n))||[])}}}()),u=null!=((null==(s=e.useContext(Ct))?void 0:s.id)||null);var s;const[a,f]=e.useState(r.reference),d=wt((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==o||o(e,t,n)}),p=e.useMemo(()=>({setPositionReference:f}),[]),m=e.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return e.useMemo(()=>({dataRef:l,open:n,onOpenChange:d,elements:m,events:c,floatingId:i,refs:p}),[n,d,m,c,i,p])}function gn(t){void 0===t&&(t={});const{nodeId:n}=t,o=hn({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||o,l=i.elements,[c,u]=e.useState(null),[s,f]=e.useState(null),d=(null==l?void 0:l.domReference)||c,p=e.useRef(null),m=kt();bt(()=>{d&&(p.current=d)},[d]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:c,floating:u}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(i);ct(m,i)||h(i);const[g,v]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),x=e.useCallback(e=>{e!==A.current&&(A.current=e,w(e))},[]),R=c||g,E=u||y,S=e.useRef(null),A=e.useRef(null),C=e.useRef(d),L=null!=a,k=at(a),T=at(l),O=at(f),M=e.useCallback(()=>{if(!S.current||!A.current)return;const e={placement:n,strategy:o,middleware:m};T.current&&(e.platform=T.current),it(S.current,A.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};P.current&&!ct(C.current,t)&&(C.current=t,r.flushSync(()=>{p(t)}))})},[m,n,o,T,O]);lt(()=>{!1===f&&C.current.isPositioned&&(C.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[f]);const P=e.useRef(!1);lt(()=>(P.current=!0,()=>{P.current=!1}),[]),lt(()=>{if(R&&(S.current=R),E&&(A.current=E),R&&E){if(k.current)return k.current(R,E,M);M()}},[R,E,M,k,L]);const D=e.useMemo(()=>({reference:S,floating:A,setReference:b,setFloating:x}),[b,x]),F=e.useMemo(()=>({reference:R,floating:E}),[R,E]),I=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!F.floating)return e;const t=st(F.floating,d.x),n=st(F.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...ut(F.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,s,F.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:M,refs:D,elements:F,floatingStyles:I}),[d,M,D,F,I])}({...t,elements:{...l,...s&&{reference:s}}}),g=e.useCallback(e=>{const t=a(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f(t),h.refs.setReference(t)},[h.refs]),v=e.useCallback(e=>{(a(e)||null===e)&&(p.current=e,u(e)),(a(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!a(e))&&h.refs.setReference(e)},[h.refs]),y=e.useMemo(()=>({...h.refs,setReference:v,setPositionReference:g,domReference:p}),[h.refs,v,g]),w=e.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=e.useMemo(()=>({...h,...i,refs:y,elements:w,nodeId:n}),[h,y,w,n,i]);return bt(()=>{i.dataRef.current.floatingContext=b;const e=null==m?void 0:m.nodesRef.current.find(e=>e.id===n);e&&(e.context=b)}),e.useMemo(()=>({...h,context:b,refs:y,elements:w}),[h,y,w,b])}const vn="active",yn="selected";function wn(e,t,n){const o=new Map,r="item"===n;let i=e;if(r&&e){const{[vn]:t,[yn]:n,...o}=e;i=o}return{..."floating"===n&&{tabIndex:-1,[tn]:""},...i,...t.map(t=>{const o=t?t[n]:null;return"function"==typeof o?e?o(e):null:o}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var l;r&&[vn,yn].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof i&&(null==(l=o.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==(e=o.get(n))?void 0:e.map(e=>e(...r)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}function bn(t){void 0===t&&(t=[]);const n=t.map(e=>null==e?void 0:e.reference),o=t.map(e=>null==e?void 0:e.floating),r=t.map(e=>null==e?void 0:e.item),i=e.useCallback(e=>wn(e,t,"reference"),n),l=e.useCallback(e=>wn(e,t,"floating"),o),c=e.useCallback(e=>wn(e,t,"item"),r);return e.useMemo(()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c}),[i,l,c])}const xn=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Rn(e,t){return"function"==typeof e?e(t):e}function En(t,n){void 0===n&&(n={});const{open:o,elements:{floating:r}}=t,{duration:i=250}=n,l=("number"==typeof i?i:i.close)||0,[c,u]=e.useState("unmounted"),s=function(t,n){const[o,r]=e.useState(t);return t&&!o&&r(!0),e.useEffect(()=>{if(!t&&o){const e=setTimeout(()=>r(!1),n);return()=>clearTimeout(e)}},[t,o,n]),o}(o,l);return s||"close"!==c||u("unmounted"),bt(()=>{if(r){if(o){u("initial");const e=requestAnimationFrame(()=>{u("open")});return()=>{cancelAnimationFrame(e)}}u("close")}},[o,r]),{isMounted:s,status:c}}function Sn(t,n){void 0===n&&(n={});const{initial:o={opacity:0},open:r,close:i,common:l,duration:c=250}=n,u=t.placement,s=u.split("-")[0],a=e.useMemo(()=>({side:s,placement:u}),[s,u]),f="number"==typeof c,d=(f?c:c.open)||0,p=(f?c:c.close)||0,[m,h]=e.useState(()=>({...Rn(l,a),...Rn(o,a)})),{isMounted:g,status:v}=En(t,{duration:c}),y=Ot(o),w=Ot(r),b=Ot(i),x=Ot(l);return bt(()=>{const e=Rn(y.current,a),t=Rn(b.current,a),n=Rn(x.current,a),o=Rn(w.current,a)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===v&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===v&&h({transitionProperty:Object.keys(o).map(xn).join(","),transitionDuration:d+"ms",...n,...o}),"close"===v){const o=t||e;h({transitionProperty:Object.keys(o).map(xn).join(","),transitionDuration:p+"ms",...n,...o})}},[p,b,y,w,x,d,v,a]),{isMounted:g,styles:m}}export{cn as F,Qe as a,mt as b,Sn as c,gt as d,mn as e,pt as f,bn as g,At as h,ht as i,Qt as j,an as k,ft as o,dt as s,gn as u};
@@ -1 +1 @@
1
- import{jsxs as o,Fragment as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useState as a,useEffect as c,cloneElement as l}from"react";import{u as n,o as i,f as s,s as g,a as h}from"./floating-ui.react-33212df0.js";import{Z as p,O as d}from"./index-e0185864.js";const u=["#FFFF00","#FFE066","#FFCC99","#FF9999","#99CCFF","#99FF99","#FF99FF","#CC99FF"],m=r(({value:r={backgroundColor:"#FFFF00"},onChange:m,presets:b=u,showInput:k=!0,className:C,children:F,placement:f="bottom",offset:y=8},_)=>{const[v,j]=a(!1),[N,O]=a("backgroundColor"),[w,x]=a(r.backgroundColor),[E,L]=a(r.color),{refs:P,floatingStyles:B}=n({open:v,onOpenChange:j,placement:f,middleware:[i(y),s(),g()],whileElementsMounted:h});c(()=>{r.backgroundColor&&x(r.backgroundColor),r.color&&L(r.color)},[r]),c(()=>{if(!v)return;const o=o=>{const e=o.target,t=P.reference.current,r=P.floating.current;t&&t instanceof Element&&t.contains(e)||(null==r?void 0:r.contains(e))||j(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[v,P.floating,P.reference]);const H=o=>{"backgroundColor"===N?(x(o),null==m||m(Object.assign(Object.assign({},r),{backgroundColor:o}))):(L(o),null==m||m(Object.assign(Object.assign({},r),{color:o})))},M="backgroundColor"===N?w:E,S=l(F,{ref:P.setReference,onClick:o=>{var e,t;o.stopPropagation(),j(o=>!o),null===(t=(e=F.props).onClick)||void 0===t||t.call(e,o)}});return o(e,{children:[S,v&&o("div",Object.assign({ref:o=>{P.setFloating(o),_&&("function"==typeof _?_(o):_.current=o)},style:B,className:`yoopta-highlight-color-picker ${null!=C?C:""}`,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation()},{children:[o("div",Object.assign({className:"yoopta-highlight-color-picker__mode-toggle"},{children:[t("button",Object.assign({type:"button",className:"yoopta-highlight-color-picker__mode-btn","data-active":"backgroundColor"===N,onClick:()=>O("backgroundColor"),"aria-label":"Background color"},{children:"Background"})),t("button",Object.assign({type:"button",className:"yoopta-highlight-color-picker__mode-btn","data-active":"color"===N,onClick:()=>O("color"),"aria-label":"Text color"},{children:"Text"}))]})),t("div",Object.assign({className:"yoopta-highlight-color-picker__picker"},{children:t(p,{color:M,onChange:H,className:"yoopta-highlight-color-picker__react-colorful"})})),b.length>0&&t("div",Object.assign({className:"yoopta-highlight-color-picker__presets"},{children:b.map(o=>{const e=(null==M?void 0:M.toLowerCase())===o.toLowerCase();return t("button",{type:"button",className:"yoopta-highlight-color-picker__preset","data-selected":e,style:{backgroundColor:o},onClick:()=>H(o),"aria-label":`Select color ${o}`},o)})})),k&&o("div",Object.assign({className:"yoopta-highlight-color-picker__hex-row"},{children:[t("div",{className:"yoopta-highlight-color-picker__swatch",style:{backgroundColor:M}}),t(d,{color:M,onChange:H,className:"yoopta-highlight-color-picker__hex-input",prefixed:!0})]}))]}))]})});m.displayName="HighlightColorPicker";export{m as H};
1
+ import{jsxs as o,Fragment as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useState as a,useEffect as c,cloneElement as l}from"react";import{u as n,o as i,f as s,s as g,a as h}from"./floating-ui.react-727e4287.js";import{Z as p,O as d}from"./index-e0185864.js";const u=["#FFFF00","#FFE066","#FFCC99","#FF9999","#99CCFF","#99FF99","#FF99FF","#CC99FF"],m=r(({value:r={backgroundColor:"#FFFF00"},onChange:m,presets:b=u,showInput:k=!0,className:C,children:F,placement:f="bottom",offset:y=8},_)=>{const[v,j]=a(!1),[N,O]=a("backgroundColor"),[w,x]=a(r.backgroundColor),[E,L]=a(r.color),{refs:P,floatingStyles:B}=n({open:v,onOpenChange:j,placement:f,middleware:[i(y),s(),g()],whileElementsMounted:h});c(()=>{r.backgroundColor&&x(r.backgroundColor),r.color&&L(r.color)},[r]),c(()=>{if(!v)return;const o=o=>{const e=o.target,t=P.reference.current,r=P.floating.current;t&&t instanceof Element&&t.contains(e)||(null==r?void 0:r.contains(e))||j(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[v,P.floating,P.reference]);const H=o=>{"backgroundColor"===N?(x(o),null==m||m(Object.assign(Object.assign({},r),{backgroundColor:o}))):(L(o),null==m||m(Object.assign(Object.assign({},r),{color:o})))},M="backgroundColor"===N?w:E,S=l(F,{ref:P.setReference,onClick:o=>{var e,t;o.stopPropagation(),j(o=>!o),null===(t=(e=F.props).onClick)||void 0===t||t.call(e,o)}});return o(e,{children:[S,v&&o("div",Object.assign({ref:o=>{P.setFloating(o),_&&("function"==typeof _?_(o):_.current=o)},style:B,className:`yoopta-highlight-color-picker ${null!=C?C:""}`,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation()},{children:[o("div",Object.assign({className:"yoopta-highlight-color-picker__mode-toggle"},{children:[t("button",Object.assign({type:"button",className:"yoopta-highlight-color-picker__mode-btn","data-active":"backgroundColor"===N,onClick:()=>O("backgroundColor"),"aria-label":"Background color"},{children:"Background"})),t("button",Object.assign({type:"button",className:"yoopta-highlight-color-picker__mode-btn","data-active":"color"===N,onClick:()=>O("color"),"aria-label":"Text color"},{children:"Text"}))]})),t("div",Object.assign({className:"yoopta-highlight-color-picker__picker"},{children:t(p,{color:M,onChange:H,className:"yoopta-highlight-color-picker__react-colorful"})})),b.length>0&&t("div",Object.assign({className:"yoopta-highlight-color-picker__presets"},{children:b.map(o=>{const e=(null==M?void 0:M.toLowerCase())===o.toLowerCase();return t("button",{type:"button",className:"yoopta-highlight-color-picker__preset","data-selected":e,style:{backgroundColor:o},onClick:()=>H(o),"aria-label":`Select color ${o}`},o)})})),k&&o("div",Object.assign({className:"yoopta-highlight-color-picker__hex-row"},{children:[t("div",{className:"yoopta-highlight-color-picker__swatch",style:{backgroundColor:M}}),t(d,{color:M,onChange:H,className:"yoopta-highlight-color-picker__hex-input",prefixed:!0})]}))]}))]})});m.displayName="HighlightColorPicker";export{m as H};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./chunks/style-inject.es-e87a8d02.js";import{jsxs as t,Fragment as o,jsx as n}from"react/jsx-runtime";import{useState as a,useRef as r,useEffect as s,createContext as l,useContext as i,useMemo as d,forwardRef as c,createElement as p}from"react";import{u as m,o as u,f as g,s as b,a as f}from"./chunks/floating-ui.react-33212df0.js";import{Z as h}from"./chunks/index-e0185864.js";import{Portal as x}from"./portal.js";import{Elements as y,useYooptaEditor as k}from"@yoopta/editor";import"react-dom";e('[data-element-options-root]{position:relative}[data-element-options-trigger]{align-items:center;background:transparent;border:none;border-radius:4px;cursor:pointer;display:inline-flex;justify-content:center;padding:4px;transition:background-color .15s ease,opacity .15s ease}[data-element-options-trigger]:hover{background-color:rgba(0,0,0,.05)}[data-element-options-trigger]:focus-visible{outline:2px solid rgba(59,130,246,.5);outline-offset:2px}.yoo-element-options-trigger-icon{color:#6b7280;height:16px;width:16px}[data-element-options-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);min-width:180px;padding:8px;z-index:50}[data-element-options-group]{display:flex;flex-direction:column;gap:6px}[data-element-options-group]+[data-element-options-group]{margin-top:8px}[data-element-options-label]{color:#6b7280;font-size:12px;font-weight:500}[data-element-options-separator]{background-color:#e5e7eb;height:1px;margin:8px 0}[data-element-options-select]{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-select]:hover{border-color:#d1d5db}[data-element-options-select]:focus-visible{outline:2px solid rgba(59,130,246,.5);outline-offset:2px}[data-element-options-select-value]{align-items:center;display:flex;gap:8px}[data-element-options-select-chevron]{color:#9ca3af;height:14px;transition:transform .15s ease;width:14px}[data-element-options-select][data-state=open] [data-element-options-select-chevron]{transform:rotate(180deg)}[data-element-options-select-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);min-width:140px;padding:4px;z-index:51}[data-element-options-select-item]{align-items:center;background:transparent;border:none;border-radius:4px;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:6px 8px;text-align:left;transition:background-color .15s ease;width:100%}[data-element-options-select-item]:hover{background-color:#f3f4f6}[data-element-options-select-item][data-selected=true]{background-color:#eff6ff}[data-element-options-select-item-content]{align-items:center;display:flex;gap:8px}[data-element-options-select-check]{color:#3b82f6;height:14px;width:14px}[data-element-options-select-icon]{align-items:center;display:flex;height:16px;justify-content:center;width:16px}[data-element-options-select-color]{border:1px solid rgba(0,0,0,.1);border-radius:50%;display:inline-block;height:12px;width:12px}[data-element-options-color-picker]{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;font-size:13px;gap:8px;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-color-picker]:hover{border-color:#d1d5db}[data-element-options-color-preview]{border:1px solid rgba(0,0,0,.1);border-radius:4px;display:inline-block;height:20px;width:20px}[data-element-options-color-value]{color:#6b7280;font-family:monospace;font-size:12px}[data-element-options-color-picker-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);padding:12px;z-index:51}[data-element-options-color-picker-content] .react-colorful{height:150px;width:180px}[data-element-options-color-presets]{border-top:1px solid #e5e7eb;display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:10px}[data-element-options-color-preset]{border:2px solid transparent;border-radius:4px;cursor:pointer;height:20px;padding:0;transition:border-color .15s ease,transform .15s ease;width:20px}[data-element-options-color-preset]:hover{transform:scale(1.1)}[data-element-options-color-preset][data-selected=true]{border-color:#3b82f6}[data-element-options-toggle]{align-items:center;background:transparent;border:none;cursor:pointer;display:inline-flex;gap:8px;padding:0}[data-element-options-toggle-thumb]{background-color:#e5e7eb;border-radius:10px;height:20px;position:relative;transition:background-color .2s ease;width:36px}[data-element-options-toggle-thumb]:after{background-color:#fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.1);content:"";height:16px;left:2px;position:absolute;top:2px;transition:transform .2s ease;width:16px}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]{background-color:#3b82f6}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]:after{transform:translateX(16px)}[data-element-options-toggle-label]{color:#374151;font-size:13px}[data-element-options-slider]{align-items:center;display:flex;gap:10px}[data-element-options-slider-input]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#3b82f6 0,#3b82f6 var(--slider-percentage,0),#e5e7eb var(--slider-percentage,0),#e5e7eb 100%);border-radius:2px;cursor:pointer;flex:1;height:4px}[data-element-options-slider-input]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:#fff;border:2px solid #3b82f6;border-radius:50%;cursor:pointer;height:14px;-webkit-transition:transform .15s ease;transition:transform .15s ease;width:14px}[data-element-options-slider-input]::-webkit-slider-thumb:hover{transform:scale(1.1)}[data-element-options-slider-value]{color:#6b7280;font-family:monospace;font-size:12px;min-width:32px;text-align:right}[data-element-options-input]{background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;font-size:13px;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-input]:hover{border-color:#d1d5db}[data-element-options-input]:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.1);outline:none}[data-element-options-input]::-moz-placeholder{color:#9ca3af}[data-element-options-input]::placeholder{color:#9ca3af}@media (prefers-color-scheme:dark){[data-element-options-color-picker-content],[data-element-options-content],[data-element-options-select-content]{background-color:#1f2937;border-color:#374151}[data-element-options-label]{color:#9ca3af}[data-element-options-separator]{background-color:#374151}[data-element-options-color-picker],[data-element-options-input],[data-element-options-select]{background-color:#1f2937;border-color:#374151;color:#f3f4f6}[data-element-options-color-picker]:hover,[data-element-options-input]:hover,[data-element-options-select]:hover{border-color:#4b5563}[data-element-options-select-item]:hover{background-color:#374151}[data-element-options-select-item][data-selected=true]{background-color:rgba(59,130,246,.2)}[data-element-options-color-presets]{border-top-color:#374151}[data-element-options-toggle-thumb]{background-color:#374151}[data-element-options-toggle-label]{color:#d1d5db}[data-element-options-slider-input]{background:linear-gradient(to right,#3b82f6 0,#3b82f6 var(--slider-percentage,0),#374151 var(--slider-percentage,0),#374151 100%)}.yoo-element-options-trigger-icon{color:#9ca3af}[data-element-options-trigger]:hover{background-color:hsla(0,0%,100%,.1)}}');const v=["#000000","#6B7280","#EF4444","#F59E0B","#22C55E","#3B82F6","#8B5CF6","#EC4899"],w=({value:e,onChange:l,presetColors:i=v,className:d,style:c})=>{const[p,y]=a(!1),k=r(null),{refs:w,floatingStyles:O}=m({open:p,placement:"bottom-start",middleware:[u(4),g({padding:8}),b({padding:8})],whileElementsMounted:f});s(()=>{k.current&&w.setReference(k.current)},[w]),s(()=>{if(!p)return;const e=e=>{const t=e.target;k.current&&!k.current.contains(t)&&w.floating.current&&!w.floating.current.contains(t)&&y(!1)},t=e=>{"Escape"===e.key&&y(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[p,w.floating]);const j=e=>{e.preventDefault()};return t(o,{children:[t("button",Object.assign({ref:k,type:"button",className:d,style:c,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!p)},onMouseDown:j,"data-element-options-color-picker":!0,"data-state":p?"open":"closed","aria-expanded":p},{children:[n("span",{"data-element-options-color-preview":!0,style:{backgroundColor:e}}),n("span",Object.assign({"data-element-options-color-value":!0},{children:e}))]})),p&&n(x,Object.assign({id:"element-options-color-picker-portal"},{children:t("div",Object.assign({ref:w.setFloating,style:O,"data-element-options-color-picker-content":!0,onMouseDown:j},{children:[n(h,{color:e,onChange:l}),i.length>0&&n("div",Object.assign({"data-element-options-color-presets":!0},{children:i.map(t=>n("button",{type:"button","data-element-options-color-preset":!0,"data-selected":t===e,style:{backgroundColor:t},onClick:()=>(e=>{l(e)})(t),onMouseDown:j,"aria-label":`Select color ${t}`},t))}))]}))}))]})};w.displayName="ElementOptions.ColorPicker";const O=l(null);function j(){const e=i(O);if(!e)throw new Error("useElementOptionsContext must be used within an ElementOptions.Root");return e}function N(){const{blockId:e,element:t,editor:o,isOpen:n,setIsOpen:a}=j();return{blockId:e,element:t,editor:o,isOpen:n,setIsOpen:a}}function E(){const{blockId:e,element:t,editor:o}=j();return n=>{y.updateElement(o,{blockId:e,type:t.type,props:Object.assign(Object.assign({},t.props),n)})}}O.displayName="ElementOptionsContext";const C=({children:e,className:t,style:o,side:a="bottom",align:l="end",sideOffset:i=4,alignOffset:d=0})=>{const{isOpen:c,setIsOpen:p,triggerRef:h,contentRef:y}=j(),k=r(null),v="center"===l?a:`${a}-${l}`,{refs:w,floatingStyles:O}=m({open:c,placement:v,middleware:[u({mainAxis:i,crossAxis:d}),g({padding:8}),b({padding:8})],whileElementsMounted:f});return s(()=>{h.current&&w.setReference(h.current)},[h,w]),s(()=>{if(!c)return;const e=e=>{const t=e.target,o=h.current,n=k.current;o&&!o.contains(t)&&n&&!n.contains(t)&&p(!1)},t=e=>{"Escape"===e.key&&p(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[c,p,h]),c?n(x,Object.assign({id:"element-options-portal"},{children:n("div",Object.assign({ref:e=>{w.setFloating(e),k.current=e,y&&(y.current=e)},className:t,style:Object.assign(Object.assign({},O),o),"data-element-options-content":!0,"data-state":"open","data-side":a,"data-align":l,role:"dialog","aria-modal":"true"},{children:e}))})):null};C.displayName="ElementOptions.Content";const D=({children:e,className:t,style:o})=>n("div",Object.assign({className:t,style:o,"data-element-options-group":!0},{children:e}));D.displayName="ElementOptions.Group";const z=({value:e,onChange:t,placeholder:o,type:a="text",className:r,style:s})=>n("input",{type:a,value:e,onChange:e=>{t(e.target.value)},onMouseDown:e=>{e.stopPropagation()},placeholder:o,className:r,style:s,"data-element-options-input":!0});z.displayName="ElementOptions.Input";const L=({children:e,className:t,style:o})=>n("label",Object.assign({className:t,style:o,"data-element-options-label":!0},{children:e}));L.displayName="ElementOptions.Label";const M=({blockId:e,element:t,children:o,anchorRef:s,className:l,style:i})=>{const c=k(),[p,m]=a(!1),u=r(null),g=r(null),b=d(()=>({blockId:e,element:t,editor:c,isOpen:p,setIsOpen:m,triggerRef:u,contentRef:g,anchorRef:null!=s?s:null}),[e,t,c,p,s]);return n(O.Provider,Object.assign({value:b},{children:n("div",Object.assign({className:l,style:i,"data-element-options-root":!0,"data-state":p?"open":"closed"},{children:o}))}))};M.displayName="ElementOptions.Root";
1
+ import{s as e}from"./chunks/style-inject.es-e87a8d02.js";import{jsxs as t,Fragment as o,jsx as n}from"react/jsx-runtime";import{useState as a,useRef as r,useEffect as s,createContext as l,useContext as i,useMemo as d,forwardRef as c,createElement as p}from"react";import{u as m,o as u,f as g,s as b,a as f}from"./chunks/floating-ui.react-727e4287.js";import{Z as h}from"./chunks/index-e0185864.js";import{Portal as x}from"./portal.js";import{Elements as y,useYooptaEditor as k}from"@yoopta/editor";import"react-dom";e('[data-element-options-root]{position:relative}[data-element-options-trigger]{align-items:center;background:transparent;border:none;border-radius:4px;cursor:pointer;display:inline-flex;justify-content:center;padding:4px;transition:background-color .15s ease,opacity .15s ease}[data-element-options-trigger]:hover{background-color:rgba(0,0,0,.05)}[data-element-options-trigger]:focus-visible{outline:2px solid rgba(59,130,246,.5);outline-offset:2px}.yoo-element-options-trigger-icon{color:#6b7280;height:16px;width:16px}[data-element-options-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);min-width:180px;padding:8px;z-index:50}[data-element-options-group]{display:flex;flex-direction:column;gap:6px}[data-element-options-group]+[data-element-options-group]{margin-top:8px}[data-element-options-label]{color:#6b7280;font-size:12px;font-weight:500}[data-element-options-separator]{background-color:#e5e7eb;height:1px;margin:8px 0}[data-element-options-select]{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-select]:hover{border-color:#d1d5db}[data-element-options-select]:focus-visible{outline:2px solid rgba(59,130,246,.5);outline-offset:2px}[data-element-options-select-value]{align-items:center;display:flex;gap:8px}[data-element-options-select-chevron]{color:#9ca3af;height:14px;transition:transform .15s ease;width:14px}[data-element-options-select][data-state=open] [data-element-options-select-chevron]{transform:rotate(180deg)}[data-element-options-select-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);min-width:140px;padding:4px;z-index:51}[data-element-options-select-item]{align-items:center;background:transparent;border:none;border-radius:4px;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:6px 8px;text-align:left;transition:background-color .15s ease;width:100%}[data-element-options-select-item]:hover{background-color:#f3f4f6}[data-element-options-select-item][data-selected=true]{background-color:#eff6ff}[data-element-options-select-item-content]{align-items:center;display:flex;gap:8px}[data-element-options-select-check]{color:#3b82f6;height:14px;width:14px}[data-element-options-select-icon]{align-items:center;display:flex;height:16px;justify-content:center;width:16px}[data-element-options-select-color]{border:1px solid rgba(0,0,0,.1);border-radius:50%;display:inline-block;height:12px;width:12px}[data-element-options-color-picker]{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;font-size:13px;gap:8px;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-color-picker]:hover{border-color:#d1d5db}[data-element-options-color-preview]{border:1px solid rgba(0,0,0,.1);border-radius:4px;display:inline-block;height:20px;width:20px}[data-element-options-color-value]{color:#6b7280;font-family:monospace;font-size:12px}[data-element-options-color-picker-content]{background-color:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);padding:12px;z-index:51}[data-element-options-color-picker-content] .react-colorful{height:150px;width:180px}[data-element-options-color-presets]{border-top:1px solid #e5e7eb;display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:10px}[data-element-options-color-preset]{border:2px solid transparent;border-radius:4px;cursor:pointer;height:20px;padding:0;transition:border-color .15s ease,transform .15s ease;width:20px}[data-element-options-color-preset]:hover{transform:scale(1.1)}[data-element-options-color-preset][data-selected=true]{border-color:#3b82f6}[data-element-options-toggle]{align-items:center;background:transparent;border:none;cursor:pointer;display:inline-flex;gap:8px;padding:0}[data-element-options-toggle-thumb]{background-color:#e5e7eb;border-radius:10px;height:20px;position:relative;transition:background-color .2s ease;width:36px}[data-element-options-toggle-thumb]:after{background-color:#fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.1);content:"";height:16px;left:2px;position:absolute;top:2px;transition:transform .2s ease;width:16px}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]{background-color:#3b82f6}[data-element-options-toggle][data-state=checked] [data-element-options-toggle-thumb]:after{transform:translateX(16px)}[data-element-options-toggle-label]{color:#374151;font-size:13px}[data-element-options-slider]{align-items:center;display:flex;gap:10px}[data-element-options-slider-input]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#3b82f6 0,#3b82f6 var(--slider-percentage,0),#e5e7eb var(--slider-percentage,0),#e5e7eb 100%);border-radius:2px;cursor:pointer;flex:1;height:4px}[data-element-options-slider-input]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:#fff;border:2px solid #3b82f6;border-radius:50%;cursor:pointer;height:14px;-webkit-transition:transform .15s ease;transition:transform .15s ease;width:14px}[data-element-options-slider-input]::-webkit-slider-thumb:hover{transform:scale(1.1)}[data-element-options-slider-value]{color:#6b7280;font-family:monospace;font-size:12px;min-width:32px;text-align:right}[data-element-options-input]{background-color:#fff;border:1px solid #e5e7eb;border-radius:6px;font-size:13px;padding:6px 10px;transition:border-color .15s ease;width:100%}[data-element-options-input]:hover{border-color:#d1d5db}[data-element-options-input]:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.1);outline:none}[data-element-options-input]::-moz-placeholder{color:#9ca3af}[data-element-options-input]::placeholder{color:#9ca3af}@media (prefers-color-scheme:dark){[data-element-options-color-picker-content],[data-element-options-content],[data-element-options-select-content]{background-color:#1f2937;border-color:#374151}[data-element-options-label]{color:#9ca3af}[data-element-options-separator]{background-color:#374151}[data-element-options-color-picker],[data-element-options-input],[data-element-options-select]{background-color:#1f2937;border-color:#374151;color:#f3f4f6}[data-element-options-color-picker]:hover,[data-element-options-input]:hover,[data-element-options-select]:hover{border-color:#4b5563}[data-element-options-select-item]:hover{background-color:#374151}[data-element-options-select-item][data-selected=true]{background-color:rgba(59,130,246,.2)}[data-element-options-color-presets]{border-top-color:#374151}[data-element-options-toggle-thumb]{background-color:#374151}[data-element-options-toggle-label]{color:#d1d5db}[data-element-options-slider-input]{background:linear-gradient(to right,#3b82f6 0,#3b82f6 var(--slider-percentage,0),#374151 var(--slider-percentage,0),#374151 100%)}.yoo-element-options-trigger-icon{color:#9ca3af}[data-element-options-trigger]:hover{background-color:hsla(0,0%,100%,.1)}}');const v=["#000000","#6B7280","#EF4444","#F59E0B","#22C55E","#3B82F6","#8B5CF6","#EC4899"],w=({value:e,onChange:l,presetColors:i=v,className:d,style:c})=>{const[p,y]=a(!1),k=r(null),{refs:w,floatingStyles:O}=m({open:p,placement:"bottom-start",middleware:[u(4),g({padding:8}),b({padding:8})],whileElementsMounted:f});s(()=>{k.current&&w.setReference(k.current)},[w]),s(()=>{if(!p)return;const e=e=>{const t=e.target;k.current&&!k.current.contains(t)&&w.floating.current&&!w.floating.current.contains(t)&&y(!1)},t=e=>{"Escape"===e.key&&y(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[p,w.floating]);const j=e=>{e.preventDefault()};return t(o,{children:[t("button",Object.assign({ref:k,type:"button",className:d,style:c,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!p)},onMouseDown:j,"data-element-options-color-picker":!0,"data-state":p?"open":"closed","aria-expanded":p},{children:[n("span",{"data-element-options-color-preview":!0,style:{backgroundColor:e}}),n("span",Object.assign({"data-element-options-color-value":!0},{children:e}))]})),p&&n(x,Object.assign({id:"element-options-color-picker-portal"},{children:t("div",Object.assign({ref:w.setFloating,style:O,"data-element-options-color-picker-content":!0,onMouseDown:j},{children:[n(h,{color:e,onChange:l}),i.length>0&&n("div",Object.assign({"data-element-options-color-presets":!0},{children:i.map(t=>n("button",{type:"button","data-element-options-color-preset":!0,"data-selected":t===e,style:{backgroundColor:t},onClick:()=>(e=>{l(e)})(t),onMouseDown:j,"aria-label":`Select color ${t}`},t))}))]}))}))]})};w.displayName="ElementOptions.ColorPicker";const O=l(null);function j(){const e=i(O);if(!e)throw new Error("useElementOptionsContext must be used within an ElementOptions.Root");return e}function N(){const{blockId:e,element:t,editor:o,isOpen:n,setIsOpen:a}=j();return{blockId:e,element:t,editor:o,isOpen:n,setIsOpen:a}}function E(){const{blockId:e,element:t,editor:o}=j();return n=>{y.updateElement(o,{blockId:e,type:t.type,props:Object.assign(Object.assign({},t.props),n)})}}O.displayName="ElementOptionsContext";const C=({children:e,className:t,style:o,side:a="bottom",align:l="end",sideOffset:i=4,alignOffset:d=0})=>{const{isOpen:c,setIsOpen:p,triggerRef:h,contentRef:y}=j(),k=r(null),v="center"===l?a:`${a}-${l}`,{refs:w,floatingStyles:O}=m({open:c,placement:v,middleware:[u({mainAxis:i,crossAxis:d}),g({padding:8}),b({padding:8})],whileElementsMounted:f});return s(()=>{h.current&&w.setReference(h.current)},[h,w]),s(()=>{if(!c)return;const e=e=>{const t=e.target,o=h.current,n=k.current;o&&!o.contains(t)&&n&&!n.contains(t)&&p(!1)},t=e=>{"Escape"===e.key&&p(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[c,p,h]),c?n(x,Object.assign({id:"element-options-portal"},{children:n("div",Object.assign({ref:e=>{w.setFloating(e),k.current=e,y&&(y.current=e)},className:t,style:Object.assign(Object.assign({},O),o),"data-element-options-content":!0,"data-state":"open","data-side":a,"data-align":l,role:"dialog","aria-modal":"true"},{children:e}))})):null};C.displayName="ElementOptions.Content";const D=({children:e,className:t,style:o})=>n("div",Object.assign({className:t,style:o,"data-element-options-group":!0},{children:e}));D.displayName="ElementOptions.Group";const z=({value:e,onChange:t,placeholder:o,type:a="text",className:r,style:s})=>n("input",{type:a,value:e,onChange:e=>{t(e.target.value)},onMouseDown:e=>{e.stopPropagation()},placeholder:o,className:r,style:s,"data-element-options-input":!0});z.displayName="ElementOptions.Input";const L=({children:e,className:t,style:o})=>n("label",Object.assign({className:t,style:o,"data-element-options-label":!0},{children:e}));L.displayName="ElementOptions.Label";const M=({blockId:e,element:t,children:o,anchorRef:s,className:l,style:i})=>{const c=k(),[p,m]=a(!1),u=r(null),g=r(null),b=d(()=>({blockId:e,element:t,editor:c,isOpen:p,setIsOpen:m,triggerRef:u,contentRef:g,anchorRef:null!=s?s:null}),[e,t,c,p,s]);return n(O.Provider,Object.assign({value:b},{children:n("div",Object.assign({className:l,style:i,"data-element-options-root":!0,"data-state":p?"open":"closed"},{children:o}))}))};M.displayName="ElementOptions.Root";
2
2
  /**
3
3
  * @license lucide-react v0.294.0 - ISC
4
4
  *
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { YooptaBlockData } from '@yoopta/editor';
3
+ export type FloatingBlockActionsContextValue = {
4
+ /** Currently hovered block ID */
5
+ blockId: string | null;
6
+ /** Block data for the hovered block */
7
+ blockData: YooptaBlockData | null;
8
+ /** Whether actions are visible */
9
+ isVisible: boolean;
10
+ /** Hide the floating actions manually */
11
+ hide: () => void;
12
+ };
13
+ export declare const FloatingBlockActionsContext: import("react").Context<FloatingBlockActionsContextValue | null>;
14
+ export declare const useFloatingBlockActionsContext: () => FloatingBlockActionsContextValue;
15
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/context.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,gCAAgC,GAAG;IAC7C,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uCAAuC;IACvC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,kCAAkC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,2BAA2B,kEAA+D,CAAC;AAExG,eAAO,MAAM,8BAA8B,wCAQ1C,CAAC"}
@@ -1,14 +1,37 @@
1
- import { type ReactNode, type CSSProperties } from 'react';
1
+ import { type ReactNode } from 'react';
2
+ import { type YooptaBlockData } from '@yoopta/editor';
2
3
  import './floating-block-actions.css';
4
+ type FloatingBlockActionsApi = {
5
+ /** Currently hovered block ID */
6
+ blockId: string | null;
7
+ /** Block data for the hovered block */
8
+ blockData: YooptaBlockData | null;
9
+ /** Whether actions are visible */
10
+ isVisible: boolean;
11
+ /** Hide the floating actions manually */
12
+ hide: () => void;
13
+ };
3
14
  type FloatingBlockActionsRootProps = {
4
- children: ReactNode;
15
+ children: ReactNode | ((api: FloatingBlockActionsApi) => ReactNode);
16
+ /** When true, hover tracking is paused (e.g., when BlockOptions is open) */
17
+ frozen?: boolean;
5
18
  className?: string;
6
- style?: CSSProperties;
7
19
  };
8
- export declare const FloatingBlockActions: import("react").NamedExoticComponent<FloatingBlockActionsRootProps> & {
9
- readonly type: ({ children, className }: FloatingBlockActionsRootProps) => import("react/jsx-runtime").JSX.Element;
20
+ type FloatingBlockActionsButtonProps = {
21
+ children: ReactNode;
22
+ onClick?: (event: React.MouseEvent) => void;
23
+ className?: string;
24
+ disabled?: boolean;
25
+ title?: string;
26
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
27
+ export declare const FloatingBlockActions: {
28
+ ({ children, frozen, className }: FloatingBlockActionsRootProps): import("react/jsx-runtime").JSX.Element;
29
+ displayName: string;
10
30
  } & {
11
- Root: import("react").MemoExoticComponent<({ children, className }: FloatingBlockActionsRootProps) => import("react/jsx-runtime").JSX.Element>;
31
+ Root: {
32
+ ({ children, frozen, className }: FloatingBlockActionsRootProps): import("react/jsx-runtime").JSX.Element;
33
+ displayName: string;
34
+ };
12
35
  Button: import("react").ForwardRefExoticComponent<{
13
36
  children: ReactNode;
14
37
  onClick?: ((event: React.MouseEvent) => void) | undefined;
@@ -17,5 +40,5 @@ export declare const FloatingBlockActions: import("react").NamedExoticComponent<
17
40
  title?: string | undefined;
18
41
  } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
19
42
  };
20
- export {};
43
+ export type { FloatingBlockActionsRootProps, FloatingBlockActionsButtonProps, FloatingBlockActionsApi };
21
44
  //# sourceMappingURL=floating-block-actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"floating-block-actions.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/floating-block-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,aAAa,EAAQ,MAAM,OAAO,CAAC;AAC7E,OAAO,8BAA8B,CAAC;AAGtC,KAAK,6BAA6B,GAAG;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AA8CF,eAAO,MAAM,oBAAoB;6CApC+B,6BAA6B;;wEAA7B,6BAA6B;;kBAPjF,SAAS;2BACD,gBAAgB,KAAK,IAAI;;;;;CA6C3C,CAAC"}
1
+ {"version":3,"file":"floating-block-actions.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/floating-block-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AAIvE,OAAO,8BAA8B,CAAC;AAEtC,KAAK,uBAAuB,GAAG;IAC7B,iCAAiC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uCAAuC;IACvC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,kCAAkC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACnC,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,EAAE,uBAAuB,KAAK,SAAS,CAAC,CAAC;IACpE,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,+BAA+B,GAAG;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAgNlD,eAAO,MAAM,oBAAoB;sCA1L+C,6BAA6B;;;;0CAA7B,6BAA6B;;;;kBA3BjG,SAAS;2BACD,gBAAgB,KAAK,IAAI;;;;;CAuN3C,CAAC;AAEH,YAAY,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,30 +1,2 @@
1
- /// <reference types="react" />
2
- /**
3
- * Lightweight hook for accessing only store actions
4
- * Use this when you only need to control the state programmatically
5
- * without needing the mouse tracking logic
6
- */
7
- export declare const useFloatingBlockActionsActions: () => {
8
- reference: HTMLElement | null;
9
- floatingBlockId: string | null;
10
- state: import("./store").FloatingBlockActionsState;
11
- styles: import("react").CSSProperties;
12
- toggle: (actionState: import("./store").FloatingBlockActionsState, blockId?: string | null | undefined) => void;
13
- hide: () => void;
14
- reset: () => void;
15
- };
16
- /**
17
- * Full hook for FloatingBlockActions
18
- * Handles mouse tracking, positioning, and provides access to store
19
- * Use this only in the component that renders the FloatingBlockActions
20
- */
21
- export declare const useFloatingBlockActions: () => {
22
- reference: HTMLElement | null;
23
- floatingBlockId: string | null;
24
- state: import("./store").FloatingBlockActionsState;
25
- styles: import("react").CSSProperties;
26
- toggle: (actionState: import("./store").FloatingBlockActionsState, blockId?: string | null | undefined) => void;
27
- hide: () => void;
28
- reset: () => void;
29
- };
1
+ export { useFloatingBlockActionsContext } from './context';
30
2
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/hooks.ts"],"names":[],"mappings":";AAKA;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;CAY1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;CA6HnC,CAAC"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export { FloatingBlockActions } from './floating-block-actions';
2
- export { useFloatingBlockActions, useFloatingBlockActionsActions } from './hooks';
3
- export { useFloatingBlockActionsStore } from './store';
4
- export type { FloatingBlockActionsState, FloatingBlockActionsStore } from './store';
5
- import './floating-block-actions.css';
2
+ export type { FloatingBlockActionsApi, FloatingBlockActionsButtonProps, FloatingBlockActionsRootProps, } from './floating-block-actions';
3
+ export { useFloatingBlockActionsContext } from './hooks';
4
+ export type { FloatingBlockActionsContextValue } from './context';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAGlF,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGpF,OAAO,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/floating-block-actions/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EACV,uBAAuB,EACvB,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAGzD,YAAY,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAC"}
@@ -1 +1 @@
1
- import{_ as o}from"./chunks/_tslib-5e145dfd.js";import{jsx as t}from"react/jsx-runtime";import{memo as a,forwardRef as e,useCallback as i,useEffect as n}from"react";import{s as r}from"./chunks/style-inject.es-e87a8d02.js";import{c as l}from"./chunks/index-06d5c4e7.js";import{useYooptaEditor as s}from"@yoopta/editor";import{t as u}from"./chunks/throttle-dea4a39e.js";r(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-floating-bg:var(--yoopta-ui-background);--yoopta-ui-floating-border:var(--yoopta-ui-border);--yoopta-ui-floating-shadow:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-floating-z-index:100;--yoopta-ui-floating-gap:1px;--yoopta-ui-floating-padding:3px;--yoopta-ui-floating-radius:0.5rem;--yoopta-ui-floating-offset:46px;--yoopta-ui-floating-button-min-width:24px;--yoopta-ui-floating-button-min-height:24px;--yoopta-ui-floating-button-padding-y:4px;--yoopta-ui-floating-button-padding-x:6px;--yoopta-ui-floating-button-color:var(--yoopta-ui-foreground);--yoopta-ui-floating-button-bg:transparent;--yoopta-ui-floating-button-hover:var(--yoopta-ui-accent);--yoopta-ui-floating-button-active:var(--yoopta-ui-accent);--yoopta-ui-floating-button-radius:0.375rem;--yoopta-ui-floating-transition:color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out;--yoopta-ui-floating-ring-offset:2px;--yoopta-ui-floating-ring:var(--yoopta-ui-ring);--yoopta-ui-floating-icon-size:1rem}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-floating-shadow:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.5),0 2px 4px -2px rgba(0,0,0,.3)}.yoopta-ui-floating-block-actions{align-items:center;background-color:hsl(var(--yoopta-ui-floating-bg));border:1px solid hsl(var(--yoopta-ui-floating-border));border-radius:var(--yoopta-ui-floating-radius);box-shadow:var(--yoopta-ui-floating-shadow-md);display:inline-flex;gap:var(--yoopta-ui-floating-gap);padding:var(--yoopta-ui-floating-padding);z-index:var(--yoopta-ui-floating-z-index)}.yoopta-ui-floating-action-button{align-items:center;background-color:var(--yoopta-ui-floating-button-bg);border:none;border-radius:var(--yoopta-ui-floating-button-radius);color:hsl(var(--yoopta-ui-floating-button-color));cursor:pointer;display:inline-flex;font-size:.875rem;font-weight:500;justify-content:center;line-height:1;min-height:var(--yoopta-ui-floating-button-min-height);min-width:var(--yoopta-ui-floating-button-min-width);outline:none;padding:var(--yoopta-ui-floating-button-padding-y) var(--yoopta-ui-floating-button-padding-x);touch-action:manipulation;transition:var(--yoopta-ui-floating-transition);-moz-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap}.yoopta-ui-floating-action-button:hover{background-color:hsl(var(--yoopta-ui-floating-button-hover));color:hsl(var(--yoopta-ui-accent-foreground))}.yoopta-ui-floating-action-button:active{background-color:hsl(var(--yoopta-ui-floating-button-active));transform:scale(.98)}.yoopta-ui-floating-action-button:focus-visible{box-shadow:0 0 0 var(--yoopta-ui-floating-ring-offset) hsl(var(--yoopta-ui-background)),0 0 0 calc(var(--yoopta-ui-floating-ring-offset) + 2px) hsl(var(--yoopta-ui-floating-ring));outline:none}.yoopta-ui-floating-action-button:disabled{opacity:.5;pointer-events:none}.yoopta-ui-floating-action-button svg{flex-shrink:0;height:var(--yoopta-ui-floating-icon-size);width:var(--yoopta-ui-floating-icon-size)}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%}}");const p={position:"fixed",top:0,left:0,opacity:0,pointerEvents:"none",transform:"scale(0.95) translateX(-46px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"},c=l()((o,t)=>({blockId:null,state:"closed",position:{top:0,left:0},styles:p,reference:null,setReference(t){o({reference:t})},toggle(t,a){o({state:t,blockId:a||null})},updatePosition(a,e,i=46){o({position:{top:a,left:e},styles:Object.assign(Object.assign({},t().styles),{top:a,left:e,opacity:1,transform:`scale(1) translateX(-${i+2}px)`,pointerEvents:"auto"})})},hide(){o({state:"closed",blockId:null,styles:Object.assign(Object.assign({},t().styles),{opacity:0,transform:p.transform,pointerEvents:"none"})})},reset(){o({blockId:null,state:"closed",position:{top:0,left:0},styles:p})}})),d=a(({children:o,className:a})=>{const{setReference:e,styles:i}=c();return t("div",Object.assign({ref:e,className:`yoopta-ui-floating-block-actions ${a}`,style:i,contentEditable:!1,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation()},{children:o}))});d.displayName="FloatingBlockActions.Root";const g=e((a,e)=>{var{children:i,onClick:n,className:r="",disabled:l,title:s}=a,u=o(a,["children","onClick","className","disabled","title"]);return t("button",Object.assign({ref:e,type:"button",className:`yoopta-ui-floating-action-button ${r}`,onClick:n,disabled:l,title:s,"aria-label":s},u,{children:i}))});g.displayName="FloatingBlockActions.Button";const f=Object.assign(d,{Root:d,Button:g}),y=()=>{const o=c();return{reference:o.reference,floatingBlockId:o.blockId,state:o.state,styles:o.styles,toggle:o.toggle,hide:o.hide,reset:o.reset}},b=()=>{const o=s(),t=c(),a=i((o,a)=>{var e;const i=o.getBoundingClientRect(),n=(null===(e=t.reference)||void 0===e?void 0:e.offsetWidth)||46;t.updatePosition(i.top+2,i.left,n)},[t]),e=i(()=>{t.hide()},[t]),r=i(t=>{if(!o.refElement)return null;const a=o.refElement.querySelectorAll("[data-yoopta-block]"),e=window.innerHeight;let i=null,n=1/0;if(a.forEach(o=>{const a=o.getBoundingClientRect();if(a.bottom<-200||a.top>e+200)return;if(t>=a.top&&t<=a.bottom)return i=o,void(n=0);const r=t<a.top?a.top-t:t-a.bottom;r<n&&(n=r,i=o)}),i&&n<=100){const t=i.getAttribute("data-yoopta-block-id"),a=t?o.children[t]:null;if(t&&a)return{element:i,data:a}}return null},[o]),l=i(i=>{var n,l;if("frozen"===t.state)return;const s=i.target,u=null===(n=o.refElement)||void 0===n?void 0:n.contains(i.target),p=null===(l=t.reference)||void 0===l?void 0:l.contains(s);if(!u)return e();if(o.readOnly)return;if(p)return;const c=r(i.clientY);if(c){const{element:o,data:e}=c;e.id!==t.blockId&&(t.toggle("hovering",e.id),a(o,e))}else null!==t.blockId&&e()},[t,o,e,r,a]),p=u(l,100,{leading:!0,trailing:!0});return n(()=>{const o=()=>{"frozen"!==t.state&&e()};return document.addEventListener("mousemove",p),document.addEventListener("scroll",o,!0),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("scroll",o,!0)}},[p,e,t.state]),{reference:t.reference,floatingBlockId:t.blockId,state:t.state,styles:t.styles,toggle:t.toggle,hide:t.hide,reset:t.reset}};export{f as FloatingBlockActions,b as useFloatingBlockActions,y as useFloatingBlockActionsActions,c as useFloatingBlockActionsStore};
1
+ import{_ as o}from"./chunks/_tslib-5e145dfd.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useContext as a,forwardRef as n,useRef as e,useState as r,useCallback as u,useMemo as l,useEffect as p}from"react";import{useYooptaEditor as s}from"@yoopta/editor";import{t as c}from"./chunks/throttle-dea4a39e.js";import{s as d}from"./chunks/style-inject.es-e87a8d02.js";const g=i(null),f=()=>{const o=a(g);if(!o)throw new Error("FloatingBlockActions components must be used within <FloatingBlockActions>");return o};d(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-floating-bg:var(--yoopta-ui-background);--yoopta-ui-floating-border:var(--yoopta-ui-border);--yoopta-ui-floating-shadow:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-floating-z-index:100;--yoopta-ui-floating-gap:1px;--yoopta-ui-floating-padding:3px;--yoopta-ui-floating-radius:0.5rem;--yoopta-ui-floating-offset:46px;--yoopta-ui-floating-button-min-width:24px;--yoopta-ui-floating-button-min-height:24px;--yoopta-ui-floating-button-padding-y:4px;--yoopta-ui-floating-button-padding-x:6px;--yoopta-ui-floating-button-color:var(--yoopta-ui-foreground);--yoopta-ui-floating-button-bg:transparent;--yoopta-ui-floating-button-hover:var(--yoopta-ui-accent);--yoopta-ui-floating-button-active:var(--yoopta-ui-accent);--yoopta-ui-floating-button-radius:0.375rem;--yoopta-ui-floating-transition:color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out;--yoopta-ui-floating-ring-offset:2px;--yoopta-ui-floating-ring:var(--yoopta-ui-ring);--yoopta-ui-floating-icon-size:1rem}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-floating-shadow:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-floating-shadow-md:0 4px 6px -1px rgba(0,0,0,.5),0 2px 4px -2px rgba(0,0,0,.3)}.yoopta-ui-floating-block-actions{align-items:center;background-color:hsl(var(--yoopta-ui-floating-bg));border:1px solid hsl(var(--yoopta-ui-floating-border));border-radius:var(--yoopta-ui-floating-radius);box-shadow:var(--yoopta-ui-floating-shadow-md);display:inline-flex;gap:var(--yoopta-ui-floating-gap);padding:var(--yoopta-ui-floating-padding);z-index:var(--yoopta-ui-floating-z-index)}.yoopta-ui-floating-action-button{align-items:center;background-color:var(--yoopta-ui-floating-button-bg);border:none;border-radius:var(--yoopta-ui-floating-button-radius);color:hsl(var(--yoopta-ui-floating-button-color));cursor:pointer;display:inline-flex;font-size:.875rem;font-weight:500;justify-content:center;line-height:1;min-height:var(--yoopta-ui-floating-button-min-height);min-width:var(--yoopta-ui-floating-button-min-width);outline:none;padding:var(--yoopta-ui-floating-button-padding-y) var(--yoopta-ui-floating-button-padding-x);touch-action:manipulation;transition:var(--yoopta-ui-floating-transition);-moz-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap}.yoopta-ui-floating-action-button:hover{background-color:hsl(var(--yoopta-ui-floating-button-hover));color:hsl(var(--yoopta-ui-accent-foreground))}.yoopta-ui-floating-action-button:active{background-color:hsl(var(--yoopta-ui-floating-button-active));transform:scale(.98)}.yoopta-ui-floating-action-button:focus-visible{box-shadow:0 0 0 var(--yoopta-ui-floating-ring-offset) hsl(var(--yoopta-ui-background)),0 0 0 calc(var(--yoopta-ui-floating-ring-offset) + 2px) hsl(var(--yoopta-ui-floating-ring));outline:none}.yoopta-ui-floating-action-button:disabled{opacity:.5;pointer-events:none}.yoopta-ui-floating-action-button svg{flex-shrink:0;height:var(--yoopta-ui-floating-icon-size);width:var(--yoopta-ui-floating-icon-size)}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%}}");const y={position:"fixed",top:0,left:0,opacity:0,pointerEvents:"none",transform:"scale(0.95)",transition:"transform 150ms ease-out"},b=({children:o,frozen:i=!1,className:a=""})=>{var n;const d=s(),f=e(null),[b,m]=r(null),[v,h]=r(y),x=b&&null!==(n=d.children[b])&&void 0!==n?n:null,k=null!==b&&1===v.opacity,w=u(()=>{m(null),h(y)},[]),E=u(o=>{var t,i;const a=o.getBoundingClientRect(),n=null!==(i=null===(t=f.current)||void 0===t?void 0:t.offsetWidth)&&void 0!==i?i:46;var e,r;h((e=a.top+2,r=a.left,{position:"fixed",top:e,left:r,opacity:1,pointerEvents:"auto",transform:`scale(1) translateX(-${n+2}px)`,transition:"transform 150ms ease-out"}))},[]),j=u(o=>{if(!d.refElement)return null;const t=d.refElement.querySelectorAll("[data-yoopta-block]"),i=window.innerHeight;let a=null,n=1/0;for(const e of t){const t=e.getBoundingClientRect();if(t.bottom<-200||t.top>i+200)continue;if(o>=t.top&&o<=t.bottom){a=e,n=0;break}const r=o<t.top?t.top-o:o-t.bottom;r<n&&(n=r,a=e)}if(a&&n<=100){const o=a.getAttribute("data-yoopta-block-id"),t=o?d.children[o]:null;if(o&&t)return{element:a,data:t}}return null},[d]),z=u(o=>{var t,a;if(i)return;const n=o.target,e=null===(t=d.refElement)||void 0===t?void 0:t.contains(n),r=null===(a=f.current)||void 0===a?void 0:a.contains(n);if(!e)return void w();if(d.readOnly)return;if(r)return;const u=j(o.clientY);if(u){const{element:o,data:t}=u;t.id!==b&&(m(t.id),E(o))}else null!==b&&w()},[i,d,b,j,E,w]),B=l(()=>c(z,100,{leading:!0,trailing:!0}),[z]);p(()=>{const o=()=>{i||w()};return document.addEventListener("mousemove",B),document.addEventListener("scroll",o,!0),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("scroll",o,!0)}},[B,w,i]);const N=l(()=>({blockId:b,blockData:x,isVisible:k,hide:w}),[b,x,k,w]),A="function"==typeof o?o(N):o;return t(g.Provider,Object.assign({value:N},{children:t("div",Object.assign({ref:f,className:`yoopta-ui-floating-block-actions ${a}`,style:v,contentEditable:!1,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation()},{children:A}))}))};b.displayName="FloatingBlockActions";const m=n((i,a)=>{var{children:n,onClick:e,className:r="",disabled:u,title:l}=i,p=o(i,["children","onClick","className","disabled","title"]);return t("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-floating-action-button ${r}`,onClick:e,disabled:u,title:l,"aria-label":l},p,{children:n}))});m.displayName="FloatingBlockActions.Button";const v=Object.assign(b,{Root:b,Button:m});export{v as FloatingBlockActions,f as useFloatingBlockActionsContext};
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties } from 'react';
2
+ export type FloatingToolbarContextValue = {
3
+ /** Whether toolbar is open/visible */
4
+ isOpen: boolean;
5
+ /** Floating UI styles for positioning */
6
+ floatingStyles: CSSProperties;
7
+ /** Ref setter for the floating element */
8
+ setFloatingRef: (node: HTMLElement | null) => void;
9
+ };
10
+ export declare const FloatingToolbarContext: import("react").Context<FloatingToolbarContextValue | null>;
11
+ export declare const useFloatingToolbarContext: () => FloatingToolbarContextValue;
12
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/floating-toolbar/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,2BAA2B,GAAG;IACxC,sCAAsC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,cAAc,EAAE,aAAa,CAAC;IAC9B,0CAA0C;IAC1C,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,sBAAsB,6DAA0D,CAAC;AAE9F,eAAO,MAAM,yBAAyB,mCAQrC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import './floating-toolbar.css';
3
+ type FloatingToolbarApi = {
4
+ isOpen: boolean;
5
+ };
6
+ type FloatingToolbarRootProps = {
7
+ children: ReactNode | ((api: FloatingToolbarApi) => ReactNode);
8
+ /** When true, selection tracking is paused (e.g., when a popover is open) */
9
+ frozen?: boolean;
10
+ className?: string;
11
+ };
12
+ type FloatingToolbarContentProps = {
13
+ children: ReactNode;
14
+ className?: string;
15
+ } & HTMLAttributes<HTMLDivElement>;
16
+ type FloatingToolbarGroupProps = HTMLAttributes<HTMLDivElement>;
17
+ type FloatingToolbarSeparatorProps = HTMLAttributes<HTMLDivElement>;
18
+ type FloatingToolbarButtonProps = {
19
+ active?: boolean;
20
+ disabled?: boolean;
21
+ type?: 'button' | 'submit' | 'reset';
22
+ } & HTMLAttributes<HTMLButtonElement>;
23
+ export declare const FloatingToolbar: {
24
+ ({ children, frozen, className }: FloatingToolbarRootProps): import("react/jsx-runtime").JSX.Element;
25
+ displayName: string;
26
+ } & {
27
+ Root: {
28
+ ({ children, frozen, className }: FloatingToolbarRootProps): import("react/jsx-runtime").JSX.Element;
29
+ displayName: string;
30
+ };
31
+ Content: import("react").ForwardRefExoticComponent<{
32
+ children: ReactNode;
33
+ className?: string | undefined;
34
+ } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
35
+ Group: import("react").ForwardRefExoticComponent<FloatingToolbarGroupProps & import("react").RefAttributes<HTMLDivElement>>;
36
+ Separator: import("react").ForwardRefExoticComponent<FloatingToolbarSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
37
+ Button: import("react").ForwardRefExoticComponent<{
38
+ active?: boolean | undefined;
39
+ disabled?: boolean | undefined;
40
+ type?: "button" | "submit" | "reset" | undefined;
41
+ } & HTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
42
+ };
43
+ export type { FloatingToolbarRootProps, FloatingToolbarContentProps, FloatingToolbarGroupProps, FloatingToolbarSeparatorProps, FloatingToolbarButtonProps, FloatingToolbarApi, };
44
+ //# sourceMappingURL=floating-toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floating-toolbar.d.ts","sourceRoot":"","sources":["../../src/floating-toolbar/floating-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAyD,MAAM,OAAO,CAAC;AAenH,OAAO,wBAAwB,CAAC;AAEhC,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;IAC/D,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAgLF,KAAK,2BAA2B,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AA6BnC,KAAK,yBAAyB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAYhE,KAAK,6BAA6B,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAUpE,KAAK,0BAA0B,GAAG;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAmBtC,eAAO,MAAM,eAAe;sCA3P+C,wBAAwB;;;;0CAAxB,wBAAwB;;;;kBA+KvF,SAAS;;;;;;;;;;CAkFnB,CAAC;AAEH,YAAY,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,0BAA0B,EAC1B,kBAAkB,GACnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { FloatingToolbar } from './floating-toolbar';
2
+ export type { FloatingToolbarApi, FloatingToolbarButtonProps, FloatingToolbarContentProps, FloatingToolbarGroupProps, FloatingToolbarRootProps, FloatingToolbarSeparatorProps, } from './floating-toolbar';
3
+ export { useFloatingToolbarContext } from './context';
4
+ export type { FloatingToolbarContextValue } from './context';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/floating-toolbar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAGtD,YAAY,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC"}