@yoopta/image 4.0.0-rc.0 → 4.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Akhmed Ibragimov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ import{useYooptaEditor as e,useYooptaPluginOptions as t,UI as o,useBlockData as i,useYooptaReadOnly as n,useBlockSelected as r,YooptaPlugin as a,generateId as s}from"@yoopta/editor";import{jsx as l,jsxs as c,Fragment as d}from"react/jsx-runtime";import*as p from"react";import{useLayoutEffect as u,useEffect as h,forwardRef as g,createElement as f,useState as m,useMemo as y}from"react";import*as w from"react-dom";import{flushSync as x,createPortal as b}from"react-dom";const v=({width:e,height:t,src:o,alt:i,fit:n,bgColor:r,layout:a="intrinsic"})=>{const s={objectFit:n||"contain",backgroundColor:r||"transparent"},c="fixed"===a,d="fill"===a,p="intrinsic"===a;return"responsive"===a&&(s.width="100%",s.height="auto"),c&&(s.width="100%",s.height="100%"),d&&(s.width="100%",s.height="100%"),p&&(s.width="100%",s.height="100%"),l("div",Object.assign({className:"yoo-image-w-full","data-layout":a},{children:o&&l("img",{src:o,width:e,height:t,alt:i||"",decoding:"async",loading:"lazy",style:s})}))};var C,z=(C=function(e,t){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},C(e,t)},function(e,t){function o(){this.constructor=e}C(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),R=function(){return R=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},R.apply(this,arguments)},S={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},_={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},E={width:"20px",height:"20px",position:"absolute"},k={top:R(R({},S),{top:"-5px"}),right:R(R({},_),{left:void 0,right:"-5px"}),bottom:R(R({},S),{top:void 0,bottom:"-5px"}),left:R(R({},_),{left:"-5px"}),topRight:R(R({},E),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:R(R({},E),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:R(R({},E),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:R(R({},E),{left:"-10px",top:"-10px",cursor:"nw-resize"})},L=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return z(t,e),t.prototype.render=function(){return p.createElement("div",{className:this.props.className||"",style:R(R({position:"absolute",userSelect:"none"},k[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(p.PureComponent),N=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),O=function(){return O=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},O.apply(this,arguments)},M={width:"auto",height:"auto"},W=function(e,t,o){return Math.max(Math.min(e,o),t)},j=function(e,t){return Math.round(e/t)*t},A=function(e,t){return new RegExp(e,"i").test(t)},T=function(e){return Boolean(e.touches&&e.touches.length)},B=function(e,t,o){void 0===o&&(o=0);var i=t.reduce((function(o,i,n){return Math.abs(i-e)<Math.abs(t[o]-e)?n:o}),0),n=Math.abs(t[i]-e);return 0===o||n<o?t[i]:e},H=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},P=function(e,t,o,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return o*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},I=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],D="__resizable_base__",F=function(e){function t(t){var o=e.call(this,t)||this;return o.ratio=1,o.resizable=null,o.parentLeft=0,o.parentTop=0,o.resizableLeft=0,o.resizableRight=0,o.resizableTop=0,o.resizableBottom=0,o.targetLeft=0,o.targetTop=0,o.appendBase=function(){if(!o.resizable||!o.window)return null;var e=o.parentNode;if(!e)return null;var t=o.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(D):t.className+=D,e.appendChild(t),t},o.removeBase=function(e){var t=o.parentNode;t&&t.removeChild(e)},o.ref=function(e){e&&(o.resizable=e)},o.state={isResizing:!1,width:void 0===(o.propsSize&&o.propsSize.width)?"auto":o.propsSize&&o.propsSize.width,height:void 0===(o.propsSize&&o.propsSize.height)?"auto":o.propsSize&&o.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},o.onResizeStart=o.onResizeStart.bind(o),o.onMouseMove=o.onMouseMove.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o}return N(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||M},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,i=this.resizable.offsetHeight,n=this.resizable.style.position;"relative"!==n&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:o,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=n}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,o=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var o=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/o[t]*100+"%"}return H(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?H(t.width):o("width"),height:t&&void 0!==t.height&&!this.state.isResizing?H(t.height):o("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,o=this.parentNode.style.flexWrap;"wrap"!==o&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var i={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=o),this.removeBase(e),i},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var o=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==o&&"auto"!==o?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var o,i,n=this.props.boundsByDirection,r=this.state.direction,a=n&&A("left",r),s=n&&A("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(o=a?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=s?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(o=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),i&&Number.isFinite(i)&&(t=t&&t<i?t:i),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var o=this.props.scale||1,i=this.props.resizeRatio||1,n=this.state,r=n.direction,a=n.original,s=this.props,l=s.lockAspectRatio,c=s.lockAspectRatioExtraHeight,d=s.lockAspectRatioExtraWidth,p=a.width,u=a.height,h=c||0,g=d||0;return A("right",r)&&(p=a.width+(e-a.x)*i/o,l&&(u=(p-g)/this.ratio+h)),A("left",r)&&(p=a.width-(e-a.x)*i/o,l&&(u=(p-g)/this.ratio+h)),A("bottom",r)&&(u=a.height+(t-a.y)*i/o,l&&(p=(u-h)*this.ratio+g)),A("top",r)&&(u=a.height-(t-a.y)*i/o,l&&(p=(u-h)*this.ratio+g)),{newWidth:p,newHeight:u}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,o,i){var n=this.props,r=n.lockAspectRatio,a=n.lockAspectRatioExtraHeight,s=n.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,c=void 0===o.width||o.width<0?e:o.width,d=void 0===i.height?10:i.height,p=void 0===o.height||o.height<0?t:o.height,u=a||0,h=s||0;if(r){var g=(d-u)*this.ratio+h,f=(p-u)*this.ratio+h,m=(l-h)/this.ratio+u,y=(c-h)/this.ratio+u,w=Math.max(l,g),x=Math.min(c,f),b=Math.max(d,m),v=Math.min(p,y);e=W(e,w,x),t=W(t,b,v)}else e=W(e,l,c),t=W(t,d,p);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),n=i.left,r=i.top,a=i.right,s=i.bottom;this.resizableLeft=n,this.resizableRight=a,this.resizableTop=r,this.resizableBottom=s}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var o,i=0,n=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(i=e.nativeEvent.clientX,n=e.nativeEvent.clientY):e.nativeEvent&&T(e.nativeEvent)&&(i=e.nativeEvent.touches[0].clientX,n=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var a=this.parentNode;if(a){var s=this.window.getComputedStyle(a).flexDirection;this.flexDir=s.startsWith("row")?"row":"column",o=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:O(O({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:o};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&T(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var o=this.props,i=o.maxWidth,n=o.maxHeight,r=o.minWidth,a=o.minHeight,s=T(e)?e.touches[0].clientX:e.clientX,l=T(e)?e.touches[0].clientY:e.clientY,c=this.state,d=c.direction,p=c.original,u=c.width,h=c.height,g=this.getParentSize(),f=function(e,t,o,i,n,r,a){return i=P(i,e.width,t,o),n=P(n,e.height,t,o),r=P(r,e.width,t,o),a=P(a,e.height,t,o),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===n?void 0:Number(n),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===a?void 0:Number(a)}}(g,this.window.innerWidth,this.window.innerHeight,i,n,r,a);i=f.maxWidth,n=f.maxHeight,r=f.minWidth,a=f.minHeight;var m=this.calculateNewSizeFromDirection(s,l),y=m.newHeight,w=m.newWidth,b=this.calculateNewMaxFromBoundary(i,n);this.props.snap&&this.props.snap.x&&(w=B(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(y=B(y,this.props.snap.y,this.props.snapGap));var v=this.calculateNewSizeFromAspectRatio(w,y,{width:b.maxWidth,height:b.maxHeight},{width:r,height:a});if(w=v.newWidth,y=v.newHeight,this.props.grid){var C=j(w,this.props.grid[0]),z=j(y,this.props.grid[1]),R=this.props.snapGap||0;w=0===R||Math.abs(C-w)<=R?C:w,y=0===R||Math.abs(z-y)<=R?z:y}var S={width:w-p.width,height:y-p.height};if(u&&"string"==typeof u)if(u.endsWith("%"))w=w/g.width*100+"%";else if(u.endsWith("vw")){w=w/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){w=w/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))y=y/g.height*100+"%";else if(h.endsWith("vw")){y=y/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){y=y/this.window.innerHeight*100+"vh"}var _={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(y,"height")};"row"===this.flexDir?_.flexBasis=_.width:"column"===this.flexDir&&(_.flexBasis=_.height),x((function(){t.setState(_)})),this.props.onResize&&this.props.onResize(e,d,this.resizable,S)}},t.prototype.onMouseUp=function(e){var t=this.state,o=t.isResizing,i=t.direction,n=t.original;if(o&&this.resizable){var r={width:this.size.width-n.width,height:this.size.height-n.height};this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:O(O({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,o=t.enable,i=t.handleStyles,n=t.handleClasses,r=t.handleWrapperStyle,a=t.handleWrapperClass,s=t.handleComponent;if(!o)return null;var l=Object.keys(o).map((function(t){return!1!==o[t]?p.createElement(L,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:n&&n[t]},s&&s[t]?s[t]:null):null}));return p.createElement("div",{className:a,style:r},l)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,o){return-1!==I.indexOf(o)||(t[o]=e.props[o]),t}),{}),o=O(O(O({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return p.createElement(i,O({ref:this.ref,style:o,className:this.props.className},t),this.state.isResizing&&p.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(p.PureComponent);function V(e){return X(e)?(e.nodeName||"").toLowerCase():"#document"}function U(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Z(e){var t;return null==(t=(X(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function X(e){return e instanceof Node||e instanceof U(e).Node}function Y(e){return e instanceof Element||e instanceof U(e).Element}function G(e){return e instanceof HTMLElement||e instanceof U(e).HTMLElement}function $(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof U(e).ShadowRoot)}function q(e){const{overflow:t,overflowX:o,overflowY:i,display:n}=te(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+o)&&!["inline","contents"].includes(n)}function J(e){return["table","td","th"].includes(V(e))}function K(e){const t=Q(),o=te(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function Q(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ee(e){return["html","body","#document"].includes(V(e))}function te(e){return U(e).getComputedStyle(e)}function oe(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ie(e){if("html"===V(e))return e;const t=e.assignedSlot||e.parentNode||$(e)&&e.host||Z(e);return $(t)?t.host:t}function ne(e){const t=ie(e);return ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&q(t)?t:ne(t)}function re(e,t,o){var i;void 0===t&&(t=[]),void 0===o&&(o=!0);const n=ne(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),a=U(n);return r?t.concat(a,a.visualViewport||[],q(n)?n:[],a.frameElement&&o?re(a.frameElement):[]):t.concat(n,re(n,[],o))}const ae=Math.min,se=Math.max,le=Math.round,ce=e=>({x:e,y:e}),de={left:"right",right:"left",bottom:"top",top:"bottom"},pe={start:"end",end:"start"};function ue(e,t,o){return se(e,ae(t,o))}function he(e,t){return"function"==typeof e?e(t):e}function ge(e){return e.split("-")[0]}function fe(e){return e.split("-")[1]}function me(e){return"x"===e?"y":"x"}function ye(e){return"y"===e?"height":"width"}function we(e){return["top","bottom"].includes(ge(e))?"y":"x"}function xe(e){return me(we(e))}function be(e){return e.replace(/start|end/g,(e=>pe[e]))}function ve(e){return e.replace(/left|right|bottom|top/g,(e=>de[e]))}function Ce(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ze(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Re(e,t,o){let{reference:i,floating:n}=e;const r=we(t),a=xe(t),s=ye(a),l=ge(t),c="y"===r,d=i.x+i.width/2-n.width/2,p=i.y+i.height/2-n.height/2,u=i[s]/2-n[s]/2;let h;switch(l){case"top":h={x:d,y:i.y-n.height};break;case"bottom":h={x:d,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:p};break;case"left":h={x:i.x-n.width,y:p};break;default:h={x:i.x,y:i.y}}switch(fe(t)){case"start":h[a]-=u*(o&&c?-1:1);break;case"end":h[a]+=u*(o&&c?-1:1)}return h}async function Se(e,t){var o;void 0===t&&(t={});const{x:i,y:n,platform:r,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=he(t,e),g=Ce(h),f=s[u?"floating"===p?"reference":"floating":p],m=ze(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(f)))||o?f:f.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y="floating"===p?{...a.floating,x:i,y:n}:a.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),x=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=ze(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:w,strategy:l}):y);return{top:(m.top-b.top+g.top)/x.y,bottom:(b.bottom-m.bottom+g.bottom)/x.y,left:(m.left-b.left+g.left)/x.x,right:(b.right-m.right+g.right)/x.x}}function _e(e){const t=ae(...e.map((e=>e.left))),o=ae(...e.map((e=>e.top)));return{x:t,y:o,width:se(...e.map((e=>e.right)))-t,height:se(...e.map((e=>e.bottom)))-o}}const Ee=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,i;const{x:n,y:r,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:o,platform:i,elements:n}=e,r=await(null==i.isRTL?void 0:i.isRTL(n.floating)),a=ge(o),s=fe(o),l="y"===we(o),c=["left","top"].includes(a)?-1:1,d=r&&l?-1:1,p=he(t,e);let{mainAxis:u,crossAxis:h,alignmentAxis:g}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&"number"==typeof g&&(h="end"===s?-1*g:g),l?{x:h*d,y:u*c}:{x:u*c,y:h*d}}(t,e);return a===(null==(o=s.offset)?void 0:o.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:a}}}}};function ke(e){const t=te(e);let o=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const n=G(e),r=n?e.offsetWidth:o,a=n?e.offsetHeight:i,s=le(o)!==r||le(i)!==a;return s&&(o=r,i=a),{width:o,height:i,$:s}}function Le(e){return Y(e)?e:e.contextElement}function Ne(e){const t=Le(e);if(!G(t))return ce(1);const o=t.getBoundingClientRect(),{width:i,height:n,$:r}=ke(t);let a=(r?le(o.width):o.width)/i,s=(r?le(o.height):o.height)/n;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Oe=ce(0);function Me(e){const t=U(e);return Q()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Oe}function We(e,t,o,i){void 0===t&&(t=!1),void 0===o&&(o=!1);const n=e.getBoundingClientRect(),r=Le(e);let a=ce(1);t&&(i?Y(i)&&(a=Ne(i)):a=Ne(e));const s=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==U(e))&&t}(r,o,i)?Me(r):ce(0);let l=(n.left+s.x)/a.x,c=(n.top+s.y)/a.y,d=n.width/a.x,p=n.height/a.y;if(r){const e=U(r),t=i&&Y(i)?U(i):i;let o=e,n=o.frameElement;for(;n&&i&&t!==o;){const e=Ne(n),t=n.getBoundingClientRect(),i=te(n),r=t.left+(n.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(n.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,p*=e.y,l+=r,c+=a,o=U(n),n=o.frameElement}}return ze({width:d,height:p,x:l,y:c})}const je=[":popover-open",":modal"];function Ae(e){return je.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Te(e){return We(Z(e)).left+oe(e).scrollLeft}function Be(e,t,o){let i;if("viewport"===t)i=function(e,t){const o=U(e),i=Z(e),n=o.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,l=0;if(n){r=n.width,a=n.height;const e=Q();(!e||e&&"fixed"===t)&&(s=n.offsetLeft,l=n.offsetTop)}return{width:r,height:a,x:s,y:l}}(e,o);else if("document"===t)i=function(e){const t=Z(e),o=oe(e),i=e.ownerDocument.body,n=se(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=se(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-o.scrollLeft+Te(e);const s=-o.scrollTop;return"rtl"===te(i).direction&&(a+=se(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:a,y:s}}(Z(e));else if(Y(t))i=function(e,t){const o=We(e,!0,"fixed"===t),i=o.top+e.clientTop,n=o.left+e.clientLeft,r=G(e)?Ne(e):ce(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:i*r.y}}(t,o);else{const o=Me(e);i={...t,x:t.x-o.x,y:t.y-o.y}}return ze(i)}function He(e,t){const o=ie(e);return!(o===t||!Y(o)||ee(o))&&("fixed"===te(o).position||He(o,t))}function Pe(e,t,o){const i=G(t),n=Z(t),r="fixed"===o,a=We(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const l=ce(0);if(i||!i&&!r)if(("body"!==V(t)||q(n))&&(s=oe(t)),i){const e=We(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else n&&(l.x=Te(n));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Ie(e,t){return G(e)&&"fixed"!==te(e).position?t?t(e):e.offsetParent:null}function De(e,t){const o=U(e);if(!G(e)||Ae(e))return o;let i=Ie(e,t);for(;i&&J(i)&&"static"===te(i).position;)i=Ie(i,t);return i&&("html"===V(i)||"body"===V(i)&&"static"===te(i).position&&!K(i))?o:i||function(e){let t=ie(e);for(;G(t)&&!ee(t);){if(K(t))return t;t=ie(t)}return null}(e)||o}const Fe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:i,strategy:n}=e;const r="fixed"===n,a=Z(i),s=!!t&&Ae(t.floating);if(i===a||s&&r)return o;let l={scrollLeft:0,scrollTop:0},c=ce(1);const d=ce(0),p=G(i);if((p||!p&&!r)&&(("body"!==V(i)||q(a))&&(l=oe(i)),G(i))){const e=We(i);c=Ne(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+d.x,y:o.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:Z,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:i,strategy:n}=e;const r=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let i=re(e,[],!1).filter((e=>Y(e)&&"body"!==V(e))),n=null;const r="fixed"===te(e).position;let a=r?ie(e):e;for(;Y(a)&&!ee(a);){const t=te(a),o=K(a);o||"fixed"!==t.position||(n=null),(r?!o&&!n:!o&&"static"===t.position&&n&&["absolute","fixed"].includes(n.position)||q(a)&&!o&&He(e,a))?i=i.filter((e=>e!==a)):n=t,a=ie(a)}return t.set(e,i),i}(t,this._c):[].concat(o),i],a=r[0],s=r.reduce(((e,o)=>{const i=Be(t,o,n);return e.top=se(i.top,e.top),e.right=ae(i.right,e.right),e.bottom=ae(i.bottom,e.bottom),e.left=se(i.left,e.left),e}),Be(t,a,n));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:De,getElementRects:async function(e){const t=this.getOffsetParent||De,o=this.getDimensions;return{reference:Pe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=ke(e);return{width:t,height:o}},getScale:Ne,isElement:Y,isRTL:function(e){return"rtl"===te(e).direction}},Ve=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:i,placement:n}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...l}=he(e,t),c={x:o,y:i},d=await Se(t,l),p=we(ge(n)),u=me(p);let h=c[u],g=c[p];if(r){const e="y"===u?"bottom":"right";h=ue(h+d["y"===u?"top":"left"],h,h-d[e])}if(a){const e="y"===p?"bottom":"right";g=ue(g+d["y"===p?"top":"left"],g,g-d[e])}const f=s.fn({...t,[u]:h,[p]:g});return{...f,data:{x:f.x-o,y:f.y-i}}}}},Ue=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,i;const{placement:n,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:f=!0,...m}=he(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const y=ge(n),w=ge(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=u||(w||!f?[ve(s)]:function(e){const t=ve(e);return[be(e),t,be(t)]}(s));u||"none"===g||b.push(...function(e,t,o,i){const n=fe(e);let r=function(e,t,o){const i=["left","right"],n=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?n:i:t?i:n;case"left":case"right":return t?r:a;default:return[]}}(ge(e),"start"===o,i);return n&&(r=r.map((e=>e+"-"+n)),t&&(r=r.concat(r.map(be)))),r}(s,f,g,x));const v=[s,...b],C=await Se(t,m),z=[];let R=(null==(i=r.flip)?void 0:i.overflows)||[];if(d&&z.push(C[y]),p){const e=function(e,t,o){void 0===o&&(o=!1);const i=fe(e),n=xe(e),r=ye(n);let a="x"===n?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=ve(a)),[a,ve(a)]}(n,a,x);z.push(C[e[0]],C[e[1]])}if(R=[...R,{placement:n,overflows:z}],!z.every((e=>e<=0))){var S,_;const e=((null==(S=r.flip)?void 0:S.index)||0)+1,t=v[e];if(t)return{data:{index:e,overflows:R},reset:{placement:t}};let o=null==(_=R.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:_.placement;if(!o)switch(h){case"bestFit":{var E;const e=null==(E=R.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:E[0];e&&(o=e);break}case"initialPlacement":o=s}if(n!==o)return{reset:{placement:o}}}return{}}}},Ze=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:i,rects:n,platform:r,strategy:a}=t,{padding:s=2,x:l,y:c}=he(e,t),d=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),p=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let i=null;for(let e=0;e<t.length;e++){const n=t[e];!i||n.y-i.y>i.height/2?o.push([n]):o[o.length-1].push(n),i=n}return o.map((e=>ze(_e(e))))}(d),u=ze(_e(d)),h=Ce(s);const g=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=l&&null!=c)return p.find((e=>l>e.left-h.left&&l<e.right+h.right&&c>e.top-h.top&&c<e.bottom+h.bottom))||u;if(p.length>=2){if("y"===we(o)){const e=p[0],t=p[p.length-1],i="top"===ge(o),n=e.top,r=t.bottom,a=i?e.left:t.left,s=i?e.right:t.right;return{top:n,bottom:r,left:a,right:s,width:s-a,height:r-n,x:a,y:n}}const e="left"===ge(o),t=se(...p.map((e=>e.right))),i=ae(...p.map((e=>e.left))),n=p.filter((o=>e?o.left===i:o.right===t)),r=n[0].top,a=n[n.length-1].bottom;return{top:r,bottom:a,left:i,right:t,width:t-i,height:a-r,x:i,y:r}}return u}},floating:i.floating,strategy:a});return n.reference.x!==g.reference.x||n.reference.y!==g.reference.y||n.reference.width!==g.reference.width||n.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}},Xe=(e,t,o)=>{const i=new Map,n={platform:Fe,...o},r={...n.platform,_c:i};return(async(e,t,o)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:a}=o,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:p}=Re(c,i,l),u=i,h={},g=0;for(let o=0;o<s.length;o++){const{name:r,fn:f}=s[o],{x:m,y:y,data:w,reset:x}=await f({x:d,y:p,initialPlacement:i,placement:u,strategy:n,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=m?m:d,p=null!=y?y:p,h={...h,[r]:{...h[r],...w}},x&&g<=50&&(g++,"object"==typeof x&&(x.placement&&(u=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:n}):x.rects),({x:d,y:p}=Re(c,u,l))),o=-1)}return{x:d,y:p,placement:u,strategy:n,middlewareData:h}})(e,t,{...n,platform:r})};var Ye="undefined"!=typeof document?u:h;function Ge(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 o,i,n;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(i=o;0!=i--;)if(!Ge(e[i],t[i]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(i=o;0!=i--;)if(!{}.hasOwnProperty.call(t,n[i]))return!1;for(i=o;0!=i--;){const o=n[i];if(("_owner"!==o||!e.$$typeof)&&!Ge(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function $e(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qe(e,t){const o=$e(e);return Math.round(t*o)/o}function Je(e){const t=p.useRef(e);return Ye((()=>{t.current=e})),t}
2
+ /*!
3
+ * tabbable 6.2.0
4
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
+ */
6
+ var Ke=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Qe="undefined"==typeof Element,et=Qe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,tt=!Qe&&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},ot=function e(t,o){var i;void 0===o&&(o=!0);var n=null==t||null===(i=t.getAttribute)||void 0===i?void 0:i.call(t,"inert");return""===n||"true"===n||o&&t&&e(t.parentNode)},it=function e(t,o,i){for(var n=[],r=Array.from(t);r.length;){var a=r.shift();if(!ot(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,i);i.flatten?n.push.apply(n,l):n.push({scopeParent:a,candidates:l})}else{et.call(a,Ke)&&i.filter(a)&&(o||!t.includes(a))&&n.push(a);var c=a.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(a),d=!ot(c,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(c&&d){var p=e(!0===c?a.children:c.children,!0,i);i.flatten?n.push.apply(n,p):n.push({scopeParent:a,candidates:p})}else r.unshift.apply(r,a.children)}}return n},nt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},rt=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!nt(e)?0:e.tabIndex},at=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},st=function(e){return"INPUT"===e.tagName},lt=function(e){return function(e){return st(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||tt(e),i=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(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 n=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!n||n===e}(e)},ct=function(e){var t=e.getBoundingClientRect(),o=t.width,i=t.height;return 0===o&&0===i},dt=function(e,t){var o=t.displayCheck,i=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var n=et.call(e,"details>summary:first-of-type")?e.parentElement:e;if(et.call(n,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return ct(e)}else{if("function"==typeof i){for(var r=e;e;){var a=e.parentElement,s=tt(e);if(a&&!a.shadowRoot&&!0===i(a))return ct(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=r}if(function(e){var t,o,i,n,r=e&&tt(e),a=null===(t=r)||void 0===t?void 0:t.host,s=!1;if(r&&r!==e)for(s=!!(null!==(o=a)&&void 0!==o&&null!==(i=o.ownerDocument)&&void 0!==i&&i.contains(a)||null!=e&&null!==(n=e.ownerDocument)&&void 0!==n&&n.contains(e));!s&&a;){var l,c,d;s=!(null===(c=a=null===(l=r=tt(a))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},pt=function(e,t){return!(t.disabled||ot(t)||function(e){return st(e)&&"hidden"===e.type}(t)||dt(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 o=0;o<t.children.length;o++){var i=t.children.item(o);if("LEGEND"===i.tagName)return!!et.call(t,"fieldset[disabled] *")||!i.contains(e)}return!0}t=t.parentElement}return!1}(t))},ut=function(e,t){return!(lt(t)||rt(t)<0||!pt(e,t))},ht=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},gt=function e(t){var o=[],i=[];return t.forEach((function(t,n){var r=!!t.scopeParent,a=r?t.scopeParent:t,s=function(e,t){var o=rt(e);return o<0&&t&&!nt(e)?0:o}(a,r),l=r?e(t.candidates):a;0===s?r?o.push.apply(o,l):o.push(a):i.push({documentOrder:n,tabIndex:s,item:t,isScope:r,content:l})})),i.sort(at).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},ft=function(e,t){var o;return o=(t=t||{}).getShadowRoot?it([e],t.includeContainer,{filter:ut.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ht}):function(e,t,o){if(ot(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Ke));return t&&et.call(e,Ke)&&i.unshift(e),i.filter(o)}(e,t.includeContainer,ut.bind(null,t)),gt(o)};const mt=p["useInsertionEffect".toString()]||(e=>e());var yt="undefined"!=typeof document?u:h;function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},wt.apply(this,arguments)}let xt=!1,bt=0;const vt=()=>"floating-ui-"+bt++;const Ct=p["useId".toString()]||function(){const[e,t]=p.useState((()=>xt?vt():void 0));return yt((()=>{null==e&&t(vt())}),[]),p.useEffect((()=>{xt||(xt=!0)}),[]),e};const zt=p.createContext(null),Rt=p.createContext(null);function St(e){return"data-floating-ui-"+e}const _t=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Et(e,t){const o=ft(e,_t());"prev"===t&&o.reverse();const i=o.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(o=t)||null==(o=o.shadowRoot)?void 0:o.activeElement);){var o;t=t.shadowRoot.activeElement}return t}((null==(n=e)?void 0:n.ownerDocument)||document));var n;return o.slice(i+1)[0]}function kt(e,t){const o=t||e.currentTarget,i=e.relatedTarget;return!i||!function(e,t){if(!e||!t)return!1;const o=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(o&&$(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,i)}function Lt(e){ft(e,_t()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Nt(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 Ot={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 Mt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Wt=p.forwardRef((function(e,t){const[o,i]=p.useState();yt((()=>(/apple/i.test(navigator.vendor)&&i("button"),document.addEventListener("keydown",Mt),()=>{document.removeEventListener("keydown",Mt)})),[]);const n={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[St("focus-guard")]:"",style:Ot};return p.createElement("span",wt({},e,n))})),jt=p.createContext(null),At=St("portal");function Tt(e){let{children:t,id:o,root:i=null,preserveTabOrder:n=!0}=e;const r=function(e){let{id:t,root:o}=void 0===e?{}:e;const[i,n]=p.useState(null),r=Ct(),a=Bt(),s=p.useRef(null);return yt((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{s.current=null}))}),[i]),yt((()=>{if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=r,o.setAttribute(At,""),e.appendChild(o),s.current=o,n(o)}),[t,r]),yt((()=>{if(s.current)return;let e=o||(null==a?void 0:a.portalNode);e&&!Y(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(At,""),e=i||e,e.appendChild(l),s.current=l,n(l)}),[t,o,r,a]),i}({id:o,root:i}),[a,s]=p.useState(null),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),u=p.useRef(null),h=!!a&&!a.modal&&a.open&&n&&!(!i&&!r);return p.useEffect((()=>{if(r&&n&&(null==a||!a.modal))return r.addEventListener("focusin",e,!0),r.addEventListener("focusout",e,!0),()=>{r.removeEventListener("focusin",e,!0),r.removeEventListener("focusout",e,!0)};function e(e){if(r&&kt(e)){("focusin"===e.type?Nt:Lt)(r)}}}),[r,n,null==a?void 0:a.modal]),p.createElement(jt.Provider,{value:p.useMemo((()=>({preserveTabOrder:n,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:r,setFocusManagerState:s})),[n,r])},h&&r&&p.createElement(Wt,{"data-type":"outside",ref:l,onFocus:e=>{if(kt(e,r)){var t;null==(t=d.current)||t.focus()}else{const e=Et(document.body,"prev")||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),h&&r&&p.createElement("span",{"aria-owns":r.id,style:Ot}),r&&b(t,r),h&&r&&p.createElement(Wt,{"data-type":"outside",ref:c,onFocus:e=>{if(kt(e,r)){var t;null==(t=u.current)||t.focus()}else{const t=Et(document.body,"next")||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}const Bt=()=>p.useContext(jt),Ht=new Set,Pt=p.forwardRef((function(e,t){let{lockScroll:o=!1,...i}=e;const n=Ct();return yt((()=>{if(!o)return;Ht.add(n);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,s=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[i]=r+"px"),e){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,o=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(s-Math.floor(o))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Ht.delete(n),0===Ht.size&&(Object.assign(t,{overflow:"",[i]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,s)))}}),[n,o]),p.createElement("div",wt({ref:t},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))}));function It(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:i,nodeId:n}=e,[r,a]=p.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||r,l=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:i=[],platform:n,elements:{reference:r,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,u]=p.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=p.useState(i);Ge(h,i)||g(i);const[f,m]=p.useState(null),[y,x]=p.useState(null),b=p.useCallback((e=>{e!==R.current&&(R.current=e,m(e))}),[]),v=p.useCallback((e=>{e!==S.current&&(S.current=e,x(e))}),[]),C=r||f,z=a||y,R=p.useRef(null),S=p.useRef(null),_=p.useRef(d),E=null!=l,k=Je(l),L=Je(n),N=p.useCallback((()=>{if(!R.current||!S.current)return;const e={placement:t,strategy:o,middleware:h};L.current&&(e.platform=L.current),Xe(R.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};O.current&&!Ge(_.current,t)&&(_.current=t,w.flushSync((()=>{u(t)})))}))}),[h,t,o,L]);Ye((()=>{!1===c&&_.current.isPositioned&&(_.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const O=p.useRef(!1);Ye((()=>(O.current=!0,()=>{O.current=!1})),[]),Ye((()=>{if(C&&(R.current=C),z&&(S.current=z),C&&z){if(k.current)return k.current(C,z,N);N()}}),[C,z,N,k,E]);const M=p.useMemo((()=>({reference:R,floating:S,setReference:b,setFloating:v})),[b,v]),W=p.useMemo((()=>({reference:C,floating:z})),[C,z]),j=p.useMemo((()=>{const e={position:o,left:0,top:0};if(!W.floating)return e;const t=qe(W.floating,d.x),i=qe(W.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+i+"px)",...$e(W.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:i}}),[o,s,W.floating,d.x,d.y]);return p.useMemo((()=>({...d,update:N,refs:M,elements:W,floatingStyles:j})),[d,N,M,W,j])}(e),c=p.useContext(Rt),d=null!=((null==(u=p.useContext(zt))?void 0:u.id)||null);var u;const h=function(e){const t=p.useRef((()=>{}));return mt((()=>{t.current=e})),p.useCallback((function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(f.current.openEvent=t),m.emit("openchange",{open:e,event:t,reason:o,nested:d}),null==i||i(e,t,o)})),g=p.useRef(null),f=p.useRef({}),m=p.useState((()=>function(){const e=new Map;return{emit(t,o){var i;null==(i=e.get(t))||i.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var i;e.set(t,(null==(i=e.get(t))?void 0:i.filter((e=>e!==o)))||[])}}}()))[0],y=Ct(),x=p.useCallback((e=>{const t=Y(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),b=p.useCallback((e=>{(Y(e)||null===e)&&(g.current=e,a(e)),(Y(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!Y(e))&&l.refs.setReference(e)}),[l.refs]),v=p.useMemo((()=>({...l.refs,setReference:b,setPositionReference:x,domReference:g})),[l.refs,b,x]),C=p.useMemo((()=>({...l.elements,domReference:s})),[l.elements,s]),z=p.useMemo((()=>({...l,refs:v,elements:C,dataRef:f,nodeId:n,floatingId:y,events:m,open:o,onOpenChange:h})),[l,n,y,m,o,h,v,C]);return yt((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===n));e&&(e.context=z)})),p.useMemo((()=>({...l,context:z,refs:v,elements:C})),[l,v,C,z])}function Dt(e,t){if(null==e)return{};var o,i,n={},r=Object.keys(e);for(i=0;i<r.length;i++)o=r[i],t.indexOf(o)>=0||(n[o]=e[o]);return n}var Ft=["color"],Vt=g((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=Dt(e,Ft);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),f("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ut=["color"],Zt=g((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=Dt(e,Ut);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),f("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Xt=["color"],Yt=g((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=Dt(e,Xt);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),f("path",{d:"M7.81832 0.68179C7.64258 0.506054 7.35766 0.506054 7.18192 0.68179L5.18192 2.68179C5.00619 2.85753 5.00619 3.14245 5.18192 3.31819C5.35766 3.49392 5.64258 3.49392 5.81832 3.31819L7.05012 2.08638L7.05012 5.50023C7.05012 5.74876 7.25159 5.95023 7.50012 5.95023C7.74865 5.95023 7.95012 5.74876 7.95012 5.50023L7.95012 2.08638L9.18192 3.31819C9.35766 3.49392 9.64258 3.49392 9.81832 3.31819C9.99406 3.14245 9.99406 2.85753 9.81832 2.68179L7.81832 0.68179ZM7.95012 12.9136V9.50023C7.95012 9.2517 7.74865 9.05023 7.50012 9.05023C7.25159 9.05023 7.05012 9.2517 7.05012 9.50023V12.9136L5.81832 11.6818C5.64258 11.5061 5.35766 11.5061 5.18192 11.6818C5.00619 11.8575 5.00619 12.1424 5.18192 12.3182L7.18192 14.3182C7.26632 14.4026 7.38077 14.45 7.50012 14.45C7.61947 14.45 7.73393 14.4026 7.81832 14.3182L9.81832 12.3182C9.99406 12.1424 9.99406 11.8575 9.81832 11.6818C9.64258 11.5061 9.35766 11.5061 9.18192 11.6818L7.95012 12.9136ZM1.49994 7.00017C1.2238 7.00017 0.999939 7.22403 0.999939 7.50017C0.999939 7.77631 1.2238 8.00017 1.49994 8.00017L13.4999 8.00017C13.7761 8.00017 13.9999 7.77631 13.9999 7.50017C13.9999 7.22403 13.7761 7.00017 13.4999 7.00017L1.49994 7.00017Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Gt=["color"],$t=g((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=Dt(e,Gt);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),f("path",{d:"M11.5 3.04999C11.7485 3.04999 11.95 3.25146 11.95 3.49999V7.49999C11.95 7.74852 11.7485 7.94999 11.5 7.94999C11.2515 7.94999 11.05 7.74852 11.05 7.49999V4.58639L4.58638 11.05H7.49999C7.74852 11.05 7.94999 11.2515 7.94999 11.5C7.94999 11.7485 7.74852 11.95 7.49999 11.95L3.49999 11.95C3.38064 11.95 3.26618 11.9026 3.18179 11.8182C3.0974 11.7338 3.04999 11.6193 3.04999 11.5L3.04999 7.49999C3.04999 7.25146 3.25146 7.04999 3.49999 7.04999C3.74852 7.04999 3.94999 7.25146 3.94999 7.49999L3.94999 10.4136L10.4136 3.94999L7.49999 3.94999C7.25146 3.94999 7.04999 3.74852 7.04999 3.49999C7.04999 3.25146 7.25146 3.04999 7.49999 3.04999L11.5 3.04999Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),qt=["color"],Jt=g((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=Dt(e,qt);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),f("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}));const Kt=({blockId:t,onClose:o})=>{const i=e(),[n,r]=m(""),a=0===n.length;return c("div",Object.assign({className:"yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-white-space-nowrap yoo-image-w-full"},{children:[l("input",{type:"text",placeholder:"Paste image link",value:n,className:"yoo-image-items-center yoo-image-bg-[hsla(45,13%,94%,.6)] yoo-image-rounded-[4px] yoo-image-shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] yoo-image-cursor-text yoo-image-flex yoo-image-text-[14px] yoo-image-h-[32px] yoo-image-leading-[20px] yoo-image-px-[6px] yoo-image-relative yoo-image-w-full yoo-image-border-none",onChange:e=>r(e.target.value)}),l("button",Object.assign({type:"button",className:"yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-cursor-pointer yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-flex-shrink-0 yoo-image-white-space-nowrap yoo-image-h-[28px] yoo-image-rounded-[4px] yoo-image-shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] yoo-image-bg-[rgb(35,131,226)] yoo-image-text-white yoo-image-fill-white yoo-image-leading-[1.2] yoo-image-px-[12px] yoo-image-text-[14px] yoo-image-font-medium yoo-image-w-full yoo-image-max-w-[300px] yoo-image-mx-auto yoo-image-m-[12px_0_6px] disabled:yoo-image-bg-[rgba(35,131,226,0.5)] disabled:yoo-image-cursor-not-allowed",disabled:a,onClick:()=>{0!==n.length&&(i.blocks.Image.updateElement(t,"image",{src:n}),o())}},{children:"Embed image"}))]}))};function Qt(e,t,o,i){return new(o||(o=Promise))((function(n,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const eo=({accept:o="image/*",onClose:i,blockId:n,onSetLoading:r})=>{const a=t("Image"),s=e();return l("div",Object.assign({className:"yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-white-space-nowrap yoo-image-rounded-[4px] yoo-image-h-[32px] yoo-image-px-[12px] yoo-image-border yoo-image-border-[rgba(55,53,47,0.16)] yoo-image-w-full yoo-image-cursor-pointer"},{children:c("label",Object.assign({htmlFor:"image-uploader",className:"yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-font-medium yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-h-full"},{children:[l("input",{type:"file",id:"image-uploader",className:"yoo-image-absolute yoo-image-left-0 yoo-image-top-0 yoo-image-invisible",accept:(null==a?void 0:a.accept)||o,onChange:e=>{const t=e.target.files[0];t&&(e=>{Qt(void 0,void 0,void 0,(function*(){if(null==a?void 0:a.onUpload){i(),r(!0);try{const t=yield null==a?void 0:a.onUpload(e);s.blocks.Image.updateElement(n,"image",{src:t.src,alt:t.alt,sizes:t.sizes,bgColor:t.bgColor,fit:"contain"})}catch(e){}finally{r(!1)}}else console.warn("onUpload not provided")}))})(t)},multiple:!1}),"Upload image"]}))}))},to=({floatingStyles:e,refs:t,onClose:o,blockId:i,onSetLoading:n})=>{const[r,a]=m("upload"),s=e=>a(e),d="upload"===r,p="embed"===r,u=e=>({borderBottom:e?"2px solid #2483e2":"2px solid transparent"});return l(Tt,Object.assign({id:"yoo-image-uploader-portal",root:document.getElementById("yoopta-editor")},{children:l(Pt,Object.assign({lockScroll:!0,className:"yoo-image-z-[100]",onClick:o},{children:l("div",Object.assign({ref:t.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:c("div",Object.assign({className:"yoo-image-flex yoo-image-flex-col yoo-image-min-w-[540px] yoo-image-max-w-[calc(100vw-24px)] yoo-image-h-full yoo-image-max-h-[420px] yoo-image-bg-white yoo-image-shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[c("div",Object.assign({className:"yoo-image-w-full yoo-image-flex yoo-image-text-[14px] yoo-image-p-[0_8px] yoo-image-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-image-relative yoo-image-z-10 yoo-image-h-[40px]"},{children:[l("button",Object.assign({type:"button",onClick:()=>s("upload"),style:u(d),className:"yoo-image-py-[6px] yoo-image-whitespace-nowrap yoo-image-min-w-0 yoo-image-flex-shrink-0 yoo-image-text-[rgb(55,53,47)] yoo-image-relative yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-bg-inherit yoo-image-transition-[height_20ms_ease-in] yoo-image-inline-flex yoo-image-items-center yoo-image-h-full yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-px-[8px]"},{children:"Upload"})),l("button",Object.assign({type:"button",onClick:()=>s("embed"),style:u(p),className:"yoo-image-py-[6px] yoo-image-whitespace-nowrap yoo-image-min-w-0 yoo-image-flex-shrink-0 yoo-image-text-[rgb(55,53,47)] yoo-image-relative yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-bg-inherit yoo-image-transition-[height_20ms_ease-in] yoo-image-inline-flex yoo-image-items-center yoo-image-h-full yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-px-[8px]"},{children:"Image link"}))]})),c("div",Object.assign({className:"yoo-image-pt-[6px] yoo-image-pb-[6px] yoo-image-mt-[4px] yoo-image-flex yoo-image-justify-center yoo-image-mr-[12px] yoo-image-ml-[12px]"},{children:[p&&l(Kt,{onClose:o,blockId:i}),d&&l(eo,{onClose:o,blockId:i,onSetLoading:n})]}))]}))}))}))}))},oo=({className:e,width:t,height:o,children:i})=>c("div",Object.assign({className:e},{children:[i,l("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-image-h-4 yoo-image-w-4 yoo-image-animate-spin"},{children:l("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),io=({attributes:e,children:t,blockId:o})=>{const[i,n]=m(!1),[r,a]=m(!1),{refs:s,floatingStyles:d}=It({placement:"bottom",open:i,onOpenChange:n,middleware:[Ze(),Ue(),Ve(),Ee(10)]});return c("div",Object.assign({className:"yoo-image-w-full yoo-image-user-select-none yoo-image-m-[20px_0_10px] yoo-image-relative yoo-image-flex"},e,{contentEditable:!1},{children:[c("button",Object.assign({className:"yoo-image-p-[12px_36px_12px_12px] yoo-image-flex yoo-image-items-center yoo-image-text-left yoo-image-w-full yoo-image-overflow-hidden yoo-image-rounded-[3px] yoo-image-text-[14px] yoo-image-text-[rgba(55,53,47,0.65)] yoo-image-relative yoo-image-cursor-pointer yoo-image-border-none yoo-image-bg-[#efefef] yoo-image-transition-[background-color_100ms_ease-in] hover:yoo-image-bg-[#e3e3e3]",onClick:()=>n(!0),disabled:r,ref:s.setReference},{children:[l(r?oo:Zt,{className:"yoo-image-mr-2 yoo-image-user-select-none",width:24,height:24}),l("span",Object.assign({className:"yoo-image-font-medium"},{children:r?"Loading...":"Click to add image"})),r&&l("div",{className:"yoo-image-absolute yoo-image-top-0 yoo-image-left-0 yoo-image-h-full yoo-image-bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),i&&l(to,{blockId:o,floatingStyles:d,refs:s,onClose:()=>n(!1),onSetLoading:e=>a(e)}),t]}))},{ExtendedBlockActions:no,BlockOptionsMenuGroup:ro,BlockOptionsMenuItem:ao,BlockOptionsSeparator:so}=o,lo=({editor:e,block:t,props:o})=>c(no,Object.assign({onClick:()=>e.setSelection([t.meta.order]),className:"yoopta-image-options"},{children:[l(so,{}),c(ro,{children:[l(ao,{children:c("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{e.blocks.Image.updateElement(t.id,"image",{fit:"contain"})}},{children:[l(Yt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Fit"]}))}),l(ao,{children:c("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{e.blocks.Image.updateElement(t.id,"image",{fit:"fill"})}},{children:[l(Jt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Fill"]}))}),l(ao,{children:c("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{e.blocks.Image.updateElement(t.id,"image",{fit:"cover"})}},{children:[l($t,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Cover"]}))})]}),l(so,{}),l(ro,{children:l(ao,{children:c("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{if(!o||!o.src)return;const e=document.createElement("a");e.href=o.src,e.download=o.alt||o.src,e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},{children:[l(Vt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Download"]}))})})]})),co=({position:e})=>l("div",Object.assign({contentEditable:!1,className:"yoo-image-absolute yoo-image-pointer-events-none yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-z-10 yoo-image-opacity-1 yoo-image-h-full yoo-image-w-[15px] yoo-image-cursor-col-resize yoo-image-transition-opacity yoo-image-duration-150 yoo-image-ease-in "+("left"===e?"yoo-image-left-0 yoo-image-top-0":"yoo-image-right-0 yoo-image-top-0")},{children:l("div",{className:"yoo-image-opacity-100 yoo-image-transition-opacity yoo-image-duration-300 yoo-image-ease-in yoo-image-rounded-[20px] yoo-image-bg-[rgba(15,15,15,0.6)] yoo-image-border yoo-image-border-[rgba(255,255,255,0.9)] yoo-image-w-[6px] yoo-image-h-[48px] yoo-image-max-h-[50%] yoo-image-shadow-[0_0_0_.5px_#FFF]"})})),po=new a({type:"Image",elements:{image:{render:({element:o,attributes:a,children:s,blockId:p})=>{const{src:u,alt:g,srcSet:f,bgColor:w,fit:x,sizes:b}=o.props||{},C=i(p),z=e(),R=n(),S=t("Image"),[_,E]=m({width:(null==b?void 0:b.width)||650,height:(null==b?void 0:b.height)||440});h((()=>E({width:(null==b?void 0:b.width)||650,height:(null==b?void 0:b.height)||440})),[o.props]);const k=r({blockId:p}),L=y((()=>{var e,t;return{minWidth:300,size:{width:_.width,height:_.height},maxWidth:(null===(e=null==S?void 0:S.maxSizes)||void 0===e?void 0:e.maxWidth)||800,maxHeight:(null===(t=null==S?void 0:S.maxSizes)||void 0===t?void 0:t.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!R,right:!R},handleStyles:{left:{left:0},right:{right:0}},onResize:(e,t,o)=>{R||E({width:o.offsetWidth,height:o.offsetHeight})},onResizeStop:(e,t,o)=>{R||z.blocks.Image.updateElement(p,"image",{sizes:{width:o.offsetWidth,height:o.offsetHeight}})},handleComponent:{left:R?l(d,{}):l(co,{position:"left"}),right:R?l(d,{}):l(co,{position:"right"})}}}),[_.width,_.height]);return u?l("div",Object.assign({"data-element-type":o.type,contentEditable:!1,draggable:!1,className:"yoo-image-mt-4 yoo-image-relative yoopta-image"},a,{children:c(F,Object.assign({},L,{className:"yoo-image-mx-auto yoo-image-my-0 yoo-image-flex"},{children:[k&&l("div",{className:"yoo-image-absolute yoo-image-pointer-events-none yoo-image-inset-0 yoo-image-bg-[rgba(35,131,226,0.14)] yoo-image-z-[81] yoo-image-rounded-[3px] yoo-image-opacity-100 yoo-image-transition-opacity yoo-image-duration-150 yoo-image-ease-in"}),l(v,{src:u,alt:g,srcSet:f,fit:x,width:null==_?void 0:_.width,bgColor:w,height:null==_?void 0:_.height}),!R&&l(lo,{block:C,editor:z,props:o.props}),s]}))})):R?null:l(io,Object.assign({attributes:a,blockId:p},{children:s}))},props:{src:null,alt:null,srcSet:null,bgColor:null,fit:"contain",sizes:{width:650,height:500},nodeType:"void"}}},options:{display:{title:"Image",description:"Upload from device or embed with link"},onUpload:()=>Promise.resolve({src:null,alt:null}),accept:"image/png, image/jpeg, image/gif, image/webp",maxSizes:{maxWidth:650,maxHeight:550}},parsers:{html:{deserialize:{nodeNames:["IMG"],parse:e=>{if("IMG"===e.nodeName){const t={src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",srcSet:e.getAttribute("srcset")||"",sizes:{width:e.getAttribute("width")?parseInt(e.getAttribute("width")||"650",10):650,height:e.getAttribute("height")?parseInt(e.getAttribute("height")||"500",10):500}};return{id:s(),type:"image",children:[{text:""}],props:t}}}}}}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-image-pointer-events-none{pointer-events:none}.yoo-image-invisible{visibility:hidden}.yoo-image-absolute{position:absolute}.yoo-image-relative{position:relative}.yoo-image-inset-0{inset:0}.yoo-image-left-0{left:0}.yoo-image-right-0{right:0}.yoo-image-top-0{top:0}.yoo-image-z-10{z-index:10}.yoo-image-z-\\[100\\]{z-index:100}.yoo-image-z-\\[81\\]{z-index:81}.yoo-image-m-\\[12px_0_6px\\]{margin:12px 0 6px}.yoo-image-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-image-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-image-mx-auto{margin-left:auto;margin-right:auto}.yoo-image-my-0{margin-bottom:0;margin-top:0}.yoo-image-ml-\\[12px\\]{margin-left:12px}.yoo-image-mr-2{margin-right:.5rem}.yoo-image-mr-\\[12px\\]{margin-right:12px}.yoo-image-mt-4{margin-top:1rem}.yoo-image-mt-\\[4px\\]{margin-top:4px}.yoo-image-flex{display:flex}.yoo-image-inline-flex{display:inline-flex}.yoo-image-h-4{height:1rem}.yoo-image-h-\\[28px\\]{height:28px}.yoo-image-h-\\[32px\\]{height:32px}.yoo-image-h-\\[40px\\]{height:40px}.yoo-image-h-\\[48px\\]{height:48px}.yoo-image-h-full{height:100%}.yoo-image-max-h-\\[420px\\]{max-height:420px}.yoo-image-max-h-\\[50\\%\\]{max-height:50%}.yoo-image-w-4{width:1rem}.yoo-image-w-\\[15px\\]{width:15px}.yoo-image-w-\\[6px\\]{width:6px}.yoo-image-w-full{width:100%}.yoo-image-min-w-0{min-width:0}.yoo-image-min-w-\\[540px\\]{min-width:540px}.yoo-image-max-w-\\[300px\\]{max-width:300px}.yoo-image-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-image-flex-shrink-0{flex-shrink:0}@keyframes yoo-image-spin{to{transform:rotate(1turn)}}.yoo-image-animate-spin{animation:yoo-image-spin 1s linear infinite}.yoo-image-cursor-col-resize{cursor:col-resize}.yoo-image-cursor-pointer{cursor:pointer}.yoo-image-cursor-text{cursor:text}.yoo-image-flex-col{flex-direction:column}.yoo-image-items-center{align-items:center}.yoo-image-justify-start{justify-content:flex-start}.yoo-image-justify-center{justify-content:center}.yoo-image-overflow-hidden{overflow:hidden}.yoo-image-whitespace-nowrap{white-space:nowrap}.yoo-image-rounded-\\[20px\\]{border-radius:20px}.yoo-image-rounded-\\[3px\\]{border-radius:3px}.yoo-image-rounded-\\[4px\\]{border-radius:4px}.yoo-image-rounded-sm{border-radius:.125rem}.yoo-image-border{border-width:1px}.yoo-image-border-none{border-style:none}.yoo-image-border-\\[rgba\\(255\\,255\\,255\\,0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.yoo-image-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.yoo-image-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-image-bg-\\[hsla\\(45\\,13\\%\\,94\\%\\,\\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.yoo-image-bg-\\[rgb\\(35\\,131\\,226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.yoo-image-bg-\\[rgba\\(15\\,15\\,15\\,0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.yoo-image-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-image-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.yoo-image-bg-inherit{background-color:inherit}.yoo-image-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-image-fill-white{fill:#fff}.yoo-image-p-\\[0_8px\\]{padding:0 8px}.yoo-image-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-image-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-image-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-image-px-\\[6px\\]{padding-left:6px;padding-right:6px}.yoo-image-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-image-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-image-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-image-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-image-pb-\\[6px\\]{padding-bottom:6px}.yoo-image-pt-\\[6px\\]{padding-top:6px}.yoo-image-text-left{text-align:left}.yoo-image-text-\\[14px\\]{font-size:14px}.yoo-image-font-medium{font-weight:500}.yoo-image-leading-\\[1\\.2\\]{line-height:1.2}.yoo-image-leading-\\[120\\%\\]{line-height:120%}.yoo-image-leading-\\[20px\\]{line-height:20px}.yoo-image-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-image-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-image-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoo-image-opacity-100{opacity:1}.yoo-image-shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[inset_0_0_0_1px_hsla\\(0\\,0\\%\\,6\\%\\,\\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\,_rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\,_rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_0px_0px_1px_inset\\,_rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-duration-150{transition-duration:.15s}.yoo-image-duration-300{transition-duration:.3s}.yoo-image-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-image .yoopta-image-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-image:hover .yoopta-image-options{opacity:1}.hover\\:yoo-image-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:yoo-image-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:yoo-image-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:yoo-image-bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}");export{po as default};
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import{useYooptaEditor as t,useYooptaPluginOptions as e,UI as n,useBlockData as i,useBlockSelected as o,YooptaPlugin as r}from"@yoopta/editor";import{jsx as s,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{useLayoutEffect as c,useEffect as d,forwardRef as p,createElement as u,useState as h,useMemo as f}from"react";import*as g from"react-dom";import{flushSync as m,createPortal as x}from"react-dom";const w=({width:t,height:e,src:n,alt:i,fit:o,bgColor:r,layout:a="intrinsic"})=>{const l={objectFit:o||"contain",backgroundColor:r||"transparent"},c="fixed"===a,d="fill"===a,p="intrinsic"===a;return"responsive"===a&&(l.width="100%",l.height="auto"),c&&(l.width="100%",l.height="100%"),d&&(l.width="100%",l.height="100%"),p&&(l.width="100%",l.height="100%"),s("div",Object.assign({className:"w-full","data-layout":a},{children:n&&s("img",{src:n,width:t,height:e,alt:i||"",decoding:"async",loading:"lazy",style:l})}))};var b,v=(b=function(t,e){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},b(t,e)},function(t,e){function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(){return y=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},y.apply(this,arguments)},C={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},z={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},R={width:"20px",height:"20px",position:"absolute"},S={top:y(y({},C),{top:"-5px"}),right:y(y({},z),{left:void 0,right:"-5px"}),bottom:y(y({},C),{top:void 0,bottom:"-5px"}),left:y(y({},z),{left:"-5px"}),topRight:y(y({},R),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:y(y({},R),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:y(y({},R),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:y(y({},R),{left:"-10px",top:"-10px",cursor:"nw-resize"})},_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){e.props.onResizeStart(t,e.props.direction)},e.onTouchStart=function(t){e.props.onResizeStart(t,e.props.direction)},e}return v(e,t),e.prototype.render=function(){return l.createElement("div",{className:this.props.className||"",style:y(y({position:"absolute",userSelect:"none"},S[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},e}(l.PureComponent),k=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=function(){return E=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},E.apply(this,arguments)},L={width:"auto",height:"auto"},O=function(t,e,n){return Math.max(Math.min(t,n),e)},N=function(t,e){return Math.round(t/e)*e},M=function(t,e){return new RegExp(t,"i").test(e)},W=function(t){return Boolean(t.touches&&t.touches.length)},j=function(t,e,n){void 0===n&&(n=0);var i=e.reduce((function(n,i,o){return Math.abs(i-t)<Math.abs(e[n]-t)?o:n}),0),o=Math.abs(e[i]-t);return 0===n||o<n?e[i]:t},T=function(t){return"auto"===(t=t.toString())||t.endsWith("px")||t.endsWith("%")||t.endsWith("vh")||t.endsWith("vw")||t.endsWith("vmax")||t.endsWith("vmin")?t:t+"px"},A=function(t,e,n,i){if(t&&"string"==typeof t){if(t.endsWith("px"))return Number(t.replace("px",""));if(t.endsWith("%"))return e*(Number(t.replace("%",""))/100);if(t.endsWith("vw"))return n*(Number(t.replace("vw",""))/100);if(t.endsWith("vh"))return i*(Number(t.replace("vh",""))/100)}return t},B=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],H="__resizable_base__",P=function(t){function e(e){var n=t.call(this,e)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var t=n.parentNode;if(!t)return null;var e=n.window.document.createElement("div");return e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.transform="scale(0, 0)",e.style.left="0",e.style.flex="0 0 100%",e.classList?e.classList.add(H):e.className+=H,t.appendChild(e),e},n.removeBase=function(t){var e=n.parentNode;e&&e.removeChild(t)},n.ref=function(t){t&&(n.resizable=t)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return k(e,t),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||L},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var t=0,e=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,i=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),t="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,e="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=o}return{width:t,height:e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sizeStyle",{get:function(){var t=this,e=this.props.size,n=function(e){if(void 0===t.state[e]||"auto"===t.state[e])return"auto";if(t.propsSize&&t.propsSize[e]&&t.propsSize[e].toString().endsWith("%")){if(t.state[e].toString().endsWith("%"))return t.state[e].toString();var n=t.getParentSize();return Number(t.state[e].toString().replace("px",""))/n[e]*100+"%"}return T(t.state[e])};return{width:e&&void 0!==e.width&&!this.state.isResizing?T(e.width):n("width"),height:e&&void 0!==e.height&&!this.state.isResizing?T(e.height):n("height")}},enumerable:!1,configurable:!0}),e.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var t=this.appendBase();if(!t)return{width:0,height:0};var e=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(e=!0,this.parentNode.style.flexWrap="wrap"),t.style.position="relative",t.style.minWidth="100%",t.style.minHeight="100%";var i={width:t.offsetWidth,height:t.offsetHeight};return e&&(this.parentNode.style.flexWrap=n),this.removeBase(t),i},e.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},e.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},e.prototype.componentDidMount=function(){if(this.resizable&&this.window){var t=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==t.flexBasis?t.flexBasis:void 0})}},e.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},e.prototype.createSizeForCssProperty=function(t,e){var n=this.propsSize&&this.propsSize[e];return"auto"!==this.state[e]||this.state.original[e]!==t||void 0!==n&&"auto"!==n?t:"auto"},e.prototype.calculateNewMaxFromBoundary=function(t,e){var n,i,o=this.props.boundsByDirection,r=this.state.direction,s=o&&M("left",r),a=o&&M("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(t=t&&t<n?t:n),i&&Number.isFinite(i)&&(e=e&&e<i?e:i),{maxWidth:t,maxHeight:e}},e.prototype.calculateNewSizeFromDirection=function(t,e){var n=this.props.scale||1,i=this.props.resizeRatio||1,o=this.state,r=o.direction,s=o.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,d=a.lockAspectRatioExtraWidth,p=s.width,u=s.height,h=c||0,f=d||0;return M("right",r)&&(p=s.width+(t-s.x)*i/n,l&&(u=(p-f)/this.ratio+h)),M("left",r)&&(p=s.width-(t-s.x)*i/n,l&&(u=(p-f)/this.ratio+h)),M("bottom",r)&&(u=s.height+(e-s.y)*i/n,l&&(p=(u-h)*this.ratio+f)),M("top",r)&&(u=s.height-(e-s.y)*i/n,l&&(p=(u-h)*this.ratio+f)),{newWidth:p,newHeight:u}},e.prototype.calculateNewSizeFromAspectRatio=function(t,e,n,i){var o=this.props,r=o.lockAspectRatio,s=o.lockAspectRatioExtraHeight,a=o.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,c=void 0===n.width||n.width<0?t:n.width,d=void 0===i.height?10:i.height,p=void 0===n.height||n.height<0?e:n.height,u=s||0,h=a||0;if(r){var f=(d-u)*this.ratio+h,g=(p-u)*this.ratio+h,m=(l-h)/this.ratio+u,x=(c-h)/this.ratio+u,w=Math.max(l,f),b=Math.min(c,g),v=Math.max(d,m),y=Math.min(p,x);t=O(t,w,b),e=O(e,v,y)}else t=O(t,l,c),e=O(e,d,p);return{newWidth:t,newHeight:e}},e.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var t=this.parentNode;if(t){var e=t.getBoundingClientRect();this.parentLeft=e.left,this.parentTop=e.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),o=i.left,r=i.top,s=i.right,a=i.bottom;this.resizableLeft=o,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=a}},e.prototype.onResizeStart=function(t,e){if(this.resizable&&this.window){var n,i=0,o=0;if(t.nativeEvent&&function(t){return Boolean((t.clientX||0===t.clientX)&&(t.clientY||0===t.clientY))}(t.nativeEvent)?(i=t.nativeEvent.clientX,o=t.nativeEvent.clientY):t.nativeEvent&&W(t.nativeEvent)&&(i=t.nativeEvent.touches[0].clientX,o=t.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(t,e,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:E(E({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),direction:e,flexBasis:n};this.setState(l)}},e.prototype.onMouseMove=function(t){var e=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&W(t))try{t.preventDefault(),t.stopPropagation()}catch(t){}var n=this.props,i=n.maxWidth,o=n.maxHeight,r=n.minWidth,s=n.minHeight,a=W(t)?t.touches[0].clientX:t.clientX,l=W(t)?t.touches[0].clientY:t.clientY,c=this.state,d=c.direction,p=c.original,u=c.width,h=c.height,f=this.getParentSize(),g=function(t,e,n,i,o,r,s){return i=A(i,t.width,e,n),o=A(o,t.height,e,n),r=A(r,t.width,e,n),s=A(s,t.height,e,n),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,i,o,r,s);i=g.maxWidth,o=g.maxHeight,r=g.minWidth,s=g.minHeight;var x=this.calculateNewSizeFromDirection(a,l),w=x.newHeight,b=x.newWidth,v=this.calculateNewMaxFromBoundary(i,o);this.props.snap&&this.props.snap.x&&(b=j(b,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(w=j(w,this.props.snap.y,this.props.snapGap));var y=this.calculateNewSizeFromAspectRatio(b,w,{width:v.maxWidth,height:v.maxHeight},{width:r,height:s});if(b=y.newWidth,w=y.newHeight,this.props.grid){var C=N(b,this.props.grid[0]),z=N(w,this.props.grid[1]),R=this.props.snapGap||0;b=0===R||Math.abs(C-b)<=R?C:b,w=0===R||Math.abs(z-w)<=R?z:w}var S={width:b-p.width,height:w-p.height};if(u&&"string"==typeof u)if(u.endsWith("%"))b=b/f.width*100+"%";else if(u.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))w=w/f.height*100+"%";else if(h.endsWith("vw")){w=w/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){w=w/this.window.innerHeight*100+"vh"}var _={width:this.createSizeForCssProperty(b,"width"),height:this.createSizeForCssProperty(w,"height")};"row"===this.flexDir?_.flexBasis=_.width:"column"===this.flexDir&&(_.flexBasis=_.height),m((function(){e.setState(_)})),this.props.onResize&&this.props.onResize(t,d,this.resizable,S)}},e.prototype.onMouseUp=function(t){var e=this.state,n=e.isResizing,i=e.direction,o=e.original;if(n&&this.resizable){var r={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(t,i,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:E(E({},this.state.backgroundStyle),{cursor:"auto"})})}},e.prototype.updateSize=function(t){this.setState({width:t.width,height:t.height})},e.prototype.renderResizer=function(){var t=this,e=this.props,n=e.enable,i=e.handleStyles,o=e.handleClasses,r=e.handleWrapperStyle,s=e.handleWrapperClass,a=e.handleComponent;if(!n)return null;var c=Object.keys(n).map((function(e){return!1!==n[e]?l.createElement(_,{key:e,direction:e,onResizeStart:t.onResizeStart,replaceStyles:i&&i[e],className:o&&o[e]},a&&a[e]?a[e]:null):null}));return l.createElement("div",{className:s,style:r},c)},e.prototype.render=function(){var t=this,e=Object.keys(this.props).reduce((function(e,n){return-1!==B.indexOf(n)||(e[n]=t.props[n]),e}),{}),n=E(E(E({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return l.createElement(i,E({ref:this.ref,style:n,className:this.props.className},e),this.state.isResizing&&l.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},e.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},e}(l.PureComponent);function I(t){return V(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function F(t){var e;return null==(e=(V(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function V(t){return t instanceof Node||t instanceof D(t).Node}function U(t){return t instanceof Element||t instanceof D(t).Element}function Z(t){return t instanceof HTMLElement||t instanceof D(t).HTMLElement}function X(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof D(t).ShadowRoot)}function Y(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=K(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function G(t){return["table","td","th"].includes(I(t))}function $(t){const e=q(),n=K(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function q(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function J(t){return["html","body","#document"].includes(I(t))}function K(t){return D(t).getComputedStyle(t)}function Q(t){return U(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function tt(t){if("html"===I(t))return t;const e=t.assignedSlot||t.parentNode||X(t)&&t.host||F(t);return X(e)?e.host:e}function et(t){const e=tt(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:Z(e)&&Y(e)?e:et(e)}function nt(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=et(t),r=o===(null==(i=t.ownerDocument)?void 0:i.body),s=D(o);return r?e.concat(s,s.visualViewport||[],Y(o)?o:[],s.frameElement&&n?nt(s.frameElement):[]):e.concat(o,nt(o,[],n))}const it=Math.min,ot=Math.max,rt=Math.round,st=t=>({x:t,y:t}),at={left:"right",right:"left",bottom:"top",top:"bottom"},lt={start:"end",end:"start"};function ct(t,e,n){return ot(t,it(e,n))}function dt(t,e){return"function"==typeof t?t(e):t}function pt(t){return t.split("-")[0]}function ut(t){return t.split("-")[1]}function ht(t){return"x"===t?"y":"x"}function ft(t){return"y"===t?"height":"width"}function gt(t){return["top","bottom"].includes(pt(t))?"y":"x"}function mt(t){return ht(gt(t))}function xt(t){return t.replace(/start|end/g,(t=>lt[t]))}function wt(t){return t.replace(/left|right|bottom|top/g,(t=>at[t]))}function bt(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function vt(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function yt(t,e,n){let{reference:i,floating:o}=t;const r=gt(e),s=mt(e),a=ft(s),l=pt(e),c="y"===r,d=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,u=i[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:i.y-o.height};break;case"bottom":h={x:d,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:p};break;case"left":h={x:i.x-o.width,y:p};break;default:h={x:i.x,y:i.y}}switch(ut(e)){case"start":h[s]-=u*(n&&c?-1:1);break;case"end":h[s]+=u*(n&&c?-1:1)}return h}async function Ct(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=dt(e,t),f=bt(h),g=a[u?"floating"===p?"reference":"floating":p],m=vt(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),x="floating"===p?{...s.floating,x:i,y:o}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=vt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(m.top-v.top+f.top)/b.y,bottom:(v.bottom-m.bottom+f.bottom)/b.y,left:(m.left-v.left+f.left)/b.x,right:(v.right-m.right+f.right)/b.x}}function zt(t){const e=it(...t.map((t=>t.left))),n=it(...t.map((t=>t.top)));return{x:e,y:n,width:ot(...t.map((t=>t.right)))-e,height:ot(...t.map((t=>t.bottom)))-n}}const Rt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=pt(n),a=ut(n),l="y"===gt(n),c=["left","top"].includes(s)?-1:1,d=r&&l?-1:1,p=dt(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&"number"==typeof f&&(h="end"===a?-1*f:f),l?{x:h*d,y:u*c}:{x:u*c,y:h*d}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}};function St(t){const e=K(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=Z(t),r=o?t.offsetWidth:n,s=o?t.offsetHeight:i,a=rt(n)!==r||rt(i)!==s;return a&&(n=r,i=s),{width:n,height:i,$:a}}function _t(t){return U(t)?t:t.contextElement}function kt(t){const e=_t(t);if(!Z(e))return st(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=St(e);let s=(r?rt(n.width):n.width)/i,a=(r?rt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Et=st(0);function Lt(t){const e=D(t);return q()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Et}function Ot(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),r=_t(t);let s=st(1);e&&(i?U(i)&&(s=kt(i)):s=kt(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==D(t))&&e}(r,n,i)?Lt(r):st(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(r){const t=D(r),e=i&&U(i)?D(i):i;let n=t,o=n.frameElement;for(;o&&i&&e!==n;){const t=kt(o),e=o.getBoundingClientRect(),i=K(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,p*=t.y,l+=r,c+=s,n=D(o),o=n.frameElement}}return vt({width:d,height:p,x:l,y:c})}const Nt=[":popover-open",":modal"];function Mt(t){return Nt.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function Wt(t){return Ot(F(t)).left+Q(t).scrollLeft}function jt(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=D(t),i=F(t),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const t=q();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)i=function(t){const e=F(t),n=Q(t),i=t.ownerDocument.body,o=ot(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=ot(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+Wt(t);const a=-n.scrollTop;return"rtl"===K(i).direction&&(s+=ot(e.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:a}}(F(t));else if(U(e))i=function(t,e){const n=Ot(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=Z(t)?kt(t):st(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:i*r.y}}(e,n);else{const n=Lt(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return vt(i)}function Tt(t,e){const n=tt(t);return!(n===e||!U(n)||J(n))&&("fixed"===K(n).position||Tt(n,e))}function At(t,e,n){const i=Z(e),o=F(e),r="fixed"===n,s=Ot(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=st(0);if(i||!i&&!r)if(("body"!==I(e)||Y(o))&&(a=Q(e)),i){const t=Ot(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&(l.x=Wt(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Bt(t,e){return Z(t)&&"fixed"!==K(t).position?e?e(t):t.offsetParent:null}function Ht(t,e){const n=D(t);if(!Z(t)||Mt(t))return n;let i=Bt(t,e);for(;i&&G(i)&&"static"===K(i).position;)i=Bt(i,e);return i&&("html"===I(i)||"body"===I(i)&&"static"===K(i).position&&!$(i))?n:i||function(t){let e=tt(t);for(;Z(e)&&!J(e);){if($(e))return e;e=tt(e)}return null}(t)||n}const Pt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r="fixed"===o,s=F(i),a=!!e&&Mt(e.floating);if(i===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=st(1);const d=st(0),p=Z(i);if((p||!p&&!r)&&(("body"!==I(i)||Y(s))&&(l=Q(i)),Z(i))){const t=Ot(i);c=kt(i),d.x=t.x+i.clientLeft,d.y=t.y+i.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:F,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[..."clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=nt(t,[],!1).filter((t=>U(t)&&"body"!==I(t))),o=null;const r="fixed"===K(t).position;let s=r?tt(t):t;for(;U(s)&&!J(s);){const e=K(s),n=$(s);n||"fixed"!==e.position||(o=null),(r?!n&&!o:!n&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||Y(s)&&!n&&Tt(t,s))?i=i.filter((t=>t!==s)):o=e,s=tt(s)}return e.set(t,i),i}(e,this._c):[].concat(n),i],s=r[0],a=r.reduce(((t,n)=>{const i=jt(e,n,o);return t.top=ot(i.top,t.top),t.right=it(i.right,t.right),t.bottom=it(i.bottom,t.bottom),t.left=ot(i.left,t.left),t}),jt(e,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ht,getElementRects:async function(t){const e=this.getOffsetParent||Ht,n=this.getDimensions;return{reference:At(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=St(t);return{width:e,height:n}},getScale:kt,isElement:U,isRTL:function(t){return"rtl"===K(t).direction}},It=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=dt(t,e),c={x:n,y:i},d=await Ct(e,l),p=gt(pt(o)),u=ht(p);let h=c[u],f=c[p];if(r){const t="y"===u?"bottom":"right";h=ct(h+d["y"===u?"top":"left"],h,h-d[t])}if(s){const t="y"===p?"bottom":"right";f=ct(f+d["y"===p?"top":"left"],f,f-d[t])}const g=a.fn({...e,[u]:h,[p]:f});return{...g,data:{x:g.x-n,y:g.y-i}}}}},Dt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=dt(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=pt(o),w=pt(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),v=u||(w||!g?[wt(a)]:function(t){const e=wt(t);return[xt(t),e,xt(e)]}(a));u||"none"===f||v.push(...function(t,e,n,i){const o=ut(t);let r=function(t,e,n){const i=["left","right"],o=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?r:s;default:return[]}}(pt(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(xt)))),r}(a,g,f,b));const y=[a,...v],C=await Ct(e,m),z=[];let R=(null==(i=r.flip)?void 0:i.overflows)||[];if(d&&z.push(C[x]),p){const t=function(t,e,n){void 0===n&&(n=!1);const i=ut(t),o=mt(t),r=ft(o);let s="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=wt(s)),[s,wt(s)]}(o,s,b);z.push(C[t[0]],C[t[1]])}if(R=[...R,{placement:o,overflows:z}],!z.every((t=>t<=0))){var S,_;const t=((null==(S=r.flip)?void 0:S.index)||0)+1,e=y[t];if(e)return{data:{index:t,overflows:R},reset:{placement:e}};let n=null==(_=R.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:_.placement;if(!n)switch(h){case"bestFit":{var k;const t=null==(k=R.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Ft=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:o,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=dt(t,e),d=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),p=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let i=null;for(let t=0;t<e.length;t++){const o=e[t];!i||o.y-i.y>i.height/2?n.push([o]):n[n.length-1].push(o),i=o}return n.map((t=>vt(zt(t))))}(d),u=vt(zt(d)),h=bt(a);const f=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=l&&null!=c)return p.find((t=>l>t.left-h.left&&l<t.right+h.right&&c>t.top-h.top&&c<t.bottom+h.bottom))||u;if(p.length>=2){if("y"===gt(n)){const t=p[0],e=p[p.length-1],i="top"===pt(n),o=t.top,r=e.bottom,s=i?t.left:e.left,a=i?t.right:e.right;return{top:o,bottom:r,left:s,right:a,width:a-s,height:r-o,x:s,y:o}}const t="left"===pt(n),e=ot(...p.map((t=>t.right))),i=it(...p.map((t=>t.left))),o=p.filter((n=>t?n.left===i:n.right===e)),r=o[0].top,s=o[o.length-1].bottom;return{top:r,bottom:s,left:i,right:e,width:e-i,height:s-r,x:i,y:r}}return u}},floating:i.floating,strategy:s});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},Vt=(t,e,n)=>{const i=new Map,o={platform:Pt,...n},r={...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:p}=yt(c,i,l),u=i,h={},f=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:x,data:w,reset:b}=await g({x:d,y:p,initialPlacement:i,placement:u,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});d=null!=m?m:d,p=null!=x?x:p,h={...h,[r]:{...h[r],...w}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):b.rects),({x:d,y:p}=yt(c,u,l))),n=-1)}return{x:d,y:p,placement:u,strategy:o,middlewareData:h}})(t,e,{...o,platform:r})};var Ut="undefined"!=typeof document?c:d;function Zt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,i,o;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(!Zt(t[i],e[i]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!{}.hasOwnProperty.call(e,o[i]))return!1;for(i=n;0!=i--;){const n=o[i];if(("_owner"!==n||!t.$$typeof)&&!Zt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function Xt(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Yt(t,e){const n=Xt(t);return Math.round(e*n)/n}function Gt(t){const e=l.useRef(t);return Ut((()=>{e.current=t})),e}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@yoopta/editor"),t=require("react/jsx-runtime"),o=require("react"),i=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var r=n(o),a=n(i);const s=({width:e,height:o,src:i,alt:n,fit:r,bgColor:a,layout:s="intrinsic"})=>{const l={objectFit:r||"contain",backgroundColor:a||"transparent"},c="fixed"===s,u="fill"===s,d="intrinsic"===s;return"responsive"===s&&(l.width="100%",l.height="auto"),c&&(l.width="100%",l.height="100%"),u&&(l.width="100%",l.height="100%"),d&&(l.width="100%",l.height="100%"),t.jsx("div",Object.assign({className:"yoo-image-w-full","data-layout":s},{children:i&&t.jsx("img",{src:i,width:e,height:o,alt:n||"",decoding:"async",loading:"lazy",style:l})}))};var l,c=(l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},l(e,t)},function(e,t){function o(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),u=function(){return u=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},u.apply(this,arguments)},d={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},p={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},h={width:"20px",height:"20px",position:"absolute"},g={top:u(u({},d),{top:"-5px"}),right:u(u({},p),{left:void 0,right:"-5px"}),bottom:u(u({},d),{top:void 0,bottom:"-5px"}),left:u(u({},p),{left:"-5px"}),topRight:u(u({},h),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:u(u({},h),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:u(u({},h),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:u(u({},h),{left:"-10px",top:"-10px",cursor:"nw-resize"})},f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return c(t,e),t.prototype.render=function(){return r.createElement("div",{className:this.props.className||"",style:u(u({position:"absolute",userSelect:"none"},g[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(r.PureComponent),m=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),y=function(){return y=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},y.apply(this,arguments)},x={width:"auto",height:"auto"},w=function(e,t,o){return Math.max(Math.min(e,o),t)},b=function(e,t){return Math.round(e/t)*t},v=function(e,t){return new RegExp(e,"i").test(t)},C=function(e){return Boolean(e.touches&&e.touches.length)},S=function(e,t,o){void 0===o&&(o=0);var i=t.reduce((function(o,i,n){return Math.abs(i-e)<Math.abs(t[o]-e)?n:o}),0),n=Math.abs(t[i]-e);return 0===o||n<o?t[i]:e},z=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},R=function(e,t,o,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return o*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},E=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],_="__resizable_base__",j=function(e){function t(t){var o=e.call(this,t)||this;return o.ratio=1,o.resizable=null,o.parentLeft=0,o.parentTop=0,o.resizableLeft=0,o.resizableRight=0,o.resizableTop=0,o.resizableBottom=0,o.targetLeft=0,o.targetTop=0,o.appendBase=function(){if(!o.resizable||!o.window)return null;var e=o.parentNode;if(!e)return null;var t=o.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(_):t.className+=_,e.appendChild(t),t},o.removeBase=function(e){var t=o.parentNode;t&&t.removeChild(e)},o.ref=function(e){e&&(o.resizable=e)},o.state={isResizing:!1,width:void 0===(o.propsSize&&o.propsSize.width)?"auto":o.propsSize&&o.propsSize.width,height:void 0===(o.propsSize&&o.propsSize.height)?"auto":o.propsSize&&o.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},o.onResizeStart=o.onResizeStart.bind(o),o.onMouseMove=o.onMouseMove.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o}return m(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,i=this.resizable.offsetHeight,n=this.resizable.style.position;"relative"!==n&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:o,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=n}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,o=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var o=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/o[t]*100+"%"}return z(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?z(t.width):o("width"),height:t&&void 0!==t.height&&!this.state.isResizing?z(t.height):o("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,o=this.parentNode.style.flexWrap;"wrap"!==o&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var i={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=o),this.removeBase(e),i},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var o=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==o&&"auto"!==o?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var o,i,n=this.props.boundsByDirection,r=this.state.direction,a=n&&v("left",r),s=n&&v("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(o=a?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=s?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(o=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),i&&Number.isFinite(i)&&(t=t&&t<i?t:i),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var o=this.props.scale||1,i=this.props.resizeRatio||1,n=this.state,r=n.direction,a=n.original,s=this.props,l=s.lockAspectRatio,c=s.lockAspectRatioExtraHeight,u=s.lockAspectRatioExtraWidth,d=a.width,p=a.height,h=c||0,g=u||0;return v("right",r)&&(d=a.width+(e-a.x)*i/o,l&&(p=(d-g)/this.ratio+h)),v("left",r)&&(d=a.width-(e-a.x)*i/o,l&&(p=(d-g)/this.ratio+h)),v("bottom",r)&&(p=a.height+(t-a.y)*i/o,l&&(d=(p-h)*this.ratio+g)),v("top",r)&&(p=a.height-(t-a.y)*i/o,l&&(d=(p-h)*this.ratio+g)),{newWidth:d,newHeight:p}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,o,i){var n=this.props,r=n.lockAspectRatio,a=n.lockAspectRatioExtraHeight,s=n.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,c=void 0===o.width||o.width<0?e:o.width,u=void 0===i.height?10:i.height,d=void 0===o.height||o.height<0?t:o.height,p=a||0,h=s||0;if(r){var g=(u-p)*this.ratio+h,f=(d-p)*this.ratio+h,m=(l-h)/this.ratio+p,y=(c-h)/this.ratio+p,x=Math.max(l,g),b=Math.min(c,f),v=Math.max(u,m),C=Math.min(d,y);e=w(e,x,b),t=w(t,v,C)}else e=w(e,l,c),t=w(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),n=i.left,r=i.top,a=i.right,s=i.bottom;this.resizableLeft=n,this.resizableRight=a,this.resizableTop=r,this.resizableBottom=s}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var o,i=0,n=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(i=e.nativeEvent.clientX,n=e.nativeEvent.clientY):e.nativeEvent&&C(e.nativeEvent)&&(i=e.nativeEvent.touches[0].clientX,n=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var a=this.parentNode;if(a){var s=this.window.getComputedStyle(a).flexDirection;this.flexDir=s.startsWith("row")?"row":"column",o=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:y(y({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:o};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&C(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var o=this.props,n=o.maxWidth,r=o.maxHeight,a=o.minWidth,s=o.minHeight,l=C(e)?e.touches[0].clientX:e.clientX,c=C(e)?e.touches[0].clientY:e.clientY,u=this.state,d=u.direction,p=u.original,h=u.width,g=u.height,f=this.getParentSize(),m=function(e,t,o,i,n,r,a){return i=R(i,e.width,t,o),n=R(n,e.height,t,o),r=R(r,e.width,t,o),a=R(a,e.height,t,o),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===n?void 0:Number(n),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===a?void 0:Number(a)}}(f,this.window.innerWidth,this.window.innerHeight,n,r,a,s);n=m.maxWidth,r=m.maxHeight,a=m.minWidth,s=m.minHeight;var y=this.calculateNewSizeFromDirection(l,c),x=y.newHeight,w=y.newWidth,v=this.calculateNewMaxFromBoundary(n,r);this.props.snap&&this.props.snap.x&&(w=S(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(x=S(x,this.props.snap.y,this.props.snapGap));var z=this.calculateNewSizeFromAspectRatio(w,x,{width:v.maxWidth,height:v.maxHeight},{width:a,height:s});if(w=z.newWidth,x=z.newHeight,this.props.grid){var E=b(w,this.props.grid[0]),_=b(x,this.props.grid[1]),j=this.props.snapGap||0;w=0===j||Math.abs(E-w)<=j?E:w,x=0===j||Math.abs(_-x)<=j?_:x}var k={width:w-p.width,height:x-p.height};if(h&&"string"==typeof h)if(h.endsWith("%"))w=w/f.width*100+"%";else if(h.endsWith("vw")){w=w/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){w=w/this.window.innerHeight*100+"vh"}if(g&&"string"==typeof g)if(g.endsWith("%"))x=x/f.height*100+"%";else if(g.endsWith("vw")){x=x/this.window.innerWidth*100+"vw"}else if(g.endsWith("vh")){x=x/this.window.innerHeight*100+"vh"}var L={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(x,"height")};"row"===this.flexDir?L.flexBasis=L.width:"column"===this.flexDir&&(L.flexBasis=L.height),i.flushSync((function(){t.setState(L)})),this.props.onResize&&this.props.onResize(e,d,this.resizable,k)}},t.prototype.onMouseUp=function(e){var t=this.state,o=t.isResizing,i=t.direction,n=t.original;if(o&&this.resizable){var r={width:this.size.width-n.width,height:this.size.height-n.height};this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:y(y({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,o=t.enable,i=t.handleStyles,n=t.handleClasses,a=t.handleWrapperStyle,s=t.handleWrapperClass,l=t.handleComponent;if(!o)return null;var c=Object.keys(o).map((function(t){return!1!==o[t]?r.createElement(f,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:n&&n[t]},l&&l[t]?l[t]:null):null}));return r.createElement("div",{className:s,style:a},c)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,o){return-1!==E.indexOf(o)||(t[o]=e.props[o]),t}),{}),o=y(y(y({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return r.createElement(i,y({ref:this.ref,style:o,className:this.props.className},t),this.state.isResizing&&r.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(r.PureComponent);function k(e){return N(e)?(e.nodeName||"").toLowerCase():"#document"}function L(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function O(e){var t;return null==(t=(N(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function N(e){return e instanceof Node||e instanceof L(e).Node}function M(e){return e instanceof Element||e instanceof L(e).Element}function W(e){return e instanceof HTMLElement||e instanceof L(e).HTMLElement}function A(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof L(e).ShadowRoot)}function T(e){const{overflow:t,overflowX:o,overflowY:i,display:n}=D(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+o)&&!["inline","contents"].includes(n)}function B(e){return["table","td","th"].includes(k(e))}function P(e){const t=H(),o=D(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function H(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function I(e){return["html","body","#document"].includes(k(e))}function D(e){return L(e).getComputedStyle(e)}function F(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function V(e){if("html"===k(e))return e;const t=e.assignedSlot||e.parentNode||A(e)&&e.host||O(e);return A(t)?t.host:t}function U(e){const t=V(e);return I(t)?e.ownerDocument?e.ownerDocument.body:e.body:W(t)&&T(t)?t:U(t)}function Y(e,t,o){var i;void 0===t&&(t=[]),void 0===o&&(o=!0);const n=U(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),a=L(n);return r?t.concat(a,a.visualViewport||[],T(n)?n:[],a.frameElement&&o?Y(a.frameElement):[]):t.concat(n,Y(n,[],o))}const Z=Math.min,X=Math.max,G=Math.round,q=e=>({x:e,y:e}),$={left:"right",right:"left",bottom:"top",top:"bottom"},J={start:"end",end:"start"};function K(e,t,o){return X(e,Z(t,o))}function Q(e,t){return"function"==typeof e?e(t):e}function ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function oe(e){return"x"===e?"y":"x"}function ie(e){return"y"===e?"height":"width"}function ne(e){return["top","bottom"].includes(ee(e))?"y":"x"}function re(e){return oe(ne(e))}function ae(e){return e.replace(/start|end/g,(e=>J[e]))}function se(e){return e.replace(/left|right|bottom|top/g,(e=>$[e]))}function le(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ce(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ue(e,t,o){let{reference:i,floating:n}=e;const r=ne(t),a=re(t),s=ie(a),l=ee(t),c="y"===r,u=i.x+i.width/2-n.width/2,d=i.y+i.height/2-n.height/2,p=i[s]/2-n[s]/2;let h;switch(l){case"top":h={x:u,y:i.y-n.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-n.width,y:d};break;default:h={x:i.x,y:i.y}}switch(te(t)){case"start":h[a]-=p*(o&&c?-1:1);break;case"end":h[a]+=p*(o&&c?-1:1)}return h}async function de(e,t){var o;void 0===t&&(t={});const{x:i,y:n,platform:r,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Q(t,e),g=le(h),f=s[p?"floating"===d?"reference":"floating":d],m=ce(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(f)))||o?f:f.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{...a.floating,x:i,y:n}:a.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),w=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},b=ce(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:x,strategy:l}):y);return{top:(m.top-b.top+g.top)/w.y,bottom:(b.bottom-m.bottom+g.bottom)/w.y,left:(m.left-b.left+g.left)/w.x,right:(b.right-m.right+g.right)/w.x}}function pe(e){const t=Z(...e.map((e=>e.left))),o=Z(...e.map((e=>e.top)));return{x:t,y:o,width:X(...e.map((e=>e.right)))-t,height:X(...e.map((e=>e.bottom)))-o}}const he=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,i;const{x:n,y:r,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:o,platform:i,elements:n}=e,r=await(null==i.isRTL?void 0:i.isRTL(n.floating)),a=ee(o),s=te(o),l="y"===ne(o),c=["left","top"].includes(a)?-1:1,u=r&&l?-1:1,d=Q(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof g&&(h="end"===s?-1*g:g),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return a===(null==(o=s.offset)?void 0:o.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:a}}}}};function ge(e){const t=D(e);let o=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const n=W(e),r=n?e.offsetWidth:o,a=n?e.offsetHeight:i,s=G(o)!==r||G(i)!==a;return s&&(o=r,i=a),{width:o,height:i,$:s}}function fe(e){return M(e)?e:e.contextElement}function me(e){const t=fe(e);if(!W(t))return q(1);const o=t.getBoundingClientRect(),{width:i,height:n,$:r}=ge(t);let a=(r?G(o.width):o.width)/i,s=(r?G(o.height):o.height)/n;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ye=q(0);function xe(e){const t=L(e);return H()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ye}function we(e,t,o,i){void 0===t&&(t=!1),void 0===o&&(o=!1);const n=e.getBoundingClientRect(),r=fe(e);let a=q(1);t&&(i?M(i)&&(a=me(i)):a=me(e));const s=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==L(e))&&t}(r,o,i)?xe(r):q(0);let l=(n.left+s.x)/a.x,c=(n.top+s.y)/a.y,u=n.width/a.x,d=n.height/a.y;if(r){const e=L(r),t=i&&M(i)?L(i):i;let o=e,n=o.frameElement;for(;n&&i&&t!==o;){const e=me(n),t=n.getBoundingClientRect(),i=D(n),r=t.left+(n.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(n.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=r,c+=a,o=L(n),n=o.frameElement}}return ce({width:u,height:d,x:l,y:c})}const be=[":popover-open",":modal"];function ve(e){return be.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ce(e){return we(O(e)).left+F(e).scrollLeft}function Se(e,t,o){let i;if("viewport"===t)i=function(e,t){const o=L(e),i=O(e),n=o.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,l=0;if(n){r=n.width,a=n.height;const e=H();(!e||e&&"fixed"===t)&&(s=n.offsetLeft,l=n.offsetTop)}return{width:r,height:a,x:s,y:l}}(e,o);else if("document"===t)i=function(e){const t=O(e),o=F(e),i=e.ownerDocument.body,n=X(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=X(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-o.scrollLeft+Ce(e);const s=-o.scrollTop;return"rtl"===D(i).direction&&(a+=X(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:a,y:s}}(O(e));else if(M(t))i=function(e,t){const o=we(e,!0,"fixed"===t),i=o.top+e.clientTop,n=o.left+e.clientLeft,r=W(e)?me(e):q(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:i*r.y}}(t,o);else{const o=xe(e);i={...t,x:t.x-o.x,y:t.y-o.y}}return ce(i)}function ze(e,t){const o=V(e);return!(o===t||!M(o)||I(o))&&("fixed"===D(o).position||ze(o,t))}function Re(e,t,o){const i=W(t),n=O(t),r="fixed"===o,a=we(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const l=q(0);if(i||!i&&!r)if(("body"!==k(t)||T(n))&&(s=F(t)),i){const e=we(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else n&&(l.x=Ce(n));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Ee(e,t){return W(e)&&"fixed"!==D(e).position?t?t(e):e.offsetParent:null}function _e(e,t){const o=L(e);if(!W(e)||ve(e))return o;let i=Ee(e,t);for(;i&&B(i)&&"static"===D(i).position;)i=Ee(i,t);return i&&("html"===k(i)||"body"===k(i)&&"static"===D(i).position&&!P(i))?o:i||function(e){let t=V(e);for(;W(t)&&!I(t);){if(P(t))return t;t=V(t)}return null}(e)||o}const je={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:i,strategy:n}=e;const r="fixed"===n,a=O(i),s=!!t&&ve(t.floating);if(i===a||s&&r)return o;let l={scrollLeft:0,scrollTop:0},c=q(1);const u=q(0),d=W(i);if((d||!d&&!r)&&(("body"!==k(i)||T(a))&&(l=F(i)),W(i))){const e=we(i);c=me(i),u.x=e.x+i.clientLeft,u.y=e.y+i.clientTop}return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+u.x,y:o.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:O,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:i,strategy:n}=e;const r=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let i=Y(e,[],!1).filter((e=>M(e)&&"body"!==k(e))),n=null;const r="fixed"===D(e).position;let a=r?V(e):e;for(;M(a)&&!I(a);){const t=D(a),o=P(a);o||"fixed"!==t.position||(n=null),(r?!o&&!n:!o&&"static"===t.position&&n&&["absolute","fixed"].includes(n.position)||T(a)&&!o&&ze(e,a))?i=i.filter((e=>e!==a)):n=t,a=V(a)}return t.set(e,i),i}(t,this._c):[].concat(o),i],a=r[0],s=r.reduce(((e,o)=>{const i=Se(t,o,n);return e.top=X(i.top,e.top),e.right=Z(i.right,e.right),e.bottom=Z(i.bottom,e.bottom),e.left=X(i.left,e.left),e}),Se(t,a,n));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:_e,getElementRects:async function(e){const t=this.getOffsetParent||_e,o=this.getDimensions;return{reference:Re(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=ge(e);return{width:t,height:o}},getScale:me,isElement:M,isRTL:function(e){return"rtl"===D(e).direction}},ke=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:i,placement:n}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...l}=Q(e,t),c={x:o,y:i},u=await de(t,l),d=ne(ee(n)),p=oe(d);let h=c[p],g=c[d];if(r){const e="y"===p?"bottom":"right";h=K(h+u["y"===p?"top":"left"],h,h-u[e])}if(a){const e="y"===d?"bottom":"right";g=K(g+u["y"===d?"top":"left"],g,g-u[e])}const f=s.fn({...t,[p]:h,[d]:g});return{...f,data:{x:f.x-o,y:f.y-i}}}}},Le=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,i;const{placement:n,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:f=!0,...m}=Q(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const y=ee(n),x=ee(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=p||(x||!f?[se(s)]:function(e){const t=se(e);return[ae(e),t,ae(t)]}(s));p||"none"===g||b.push(...function(e,t,o,i){const n=te(e);let r=function(e,t,o){const i=["left","right"],n=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?n:i:t?i:n;case"left":case"right":return t?r:a;default:return[]}}(ee(e),"start"===o,i);return n&&(r=r.map((e=>e+"-"+n)),t&&(r=r.concat(r.map(ae)))),r}(s,f,g,w));const v=[s,...b],C=await de(t,m),S=[];let z=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&S.push(C[y]),d){const e=function(e,t,o){void 0===o&&(o=!1);const i=te(e),n=re(e),r=ie(n);let a="x"===n?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=se(a)),[a,se(a)]}(n,a,w);S.push(C[e[0]],C[e[1]])}if(z=[...z,{placement:n,overflows:S}],!S.every((e=>e<=0))){var R,E;const e=((null==(R=r.flip)?void 0:R.index)||0)+1,t=v[e];if(t)return{data:{index:e,overflows:z},reset:{placement:t}};let o=null==(E=z.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!o)switch(h){case"bestFit":{var _;const e=null==(_=z.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:_[0];e&&(o=e);break}case"initialPlacement":o=s}if(n!==o)return{reset:{placement:o}}}return{}}}},Oe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:i,rects:n,platform:r,strategy:a}=t,{padding:s=2,x:l,y:c}=Q(e,t),u=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),d=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let i=null;for(let e=0;e<t.length;e++){const n=t[e];!i||n.y-i.y>i.height/2?o.push([n]):o[o.length-1].push(n),i=n}return o.map((e=>ce(pe(e))))}(u),p=ce(pe(u)),h=le(s);const g=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=l&&null!=c)return d.find((e=>l>e.left-h.left&&l<e.right+h.right&&c>e.top-h.top&&c<e.bottom+h.bottom))||p;if(d.length>=2){if("y"===ne(o)){const e=d[0],t=d[d.length-1],i="top"===ee(o),n=e.top,r=t.bottom,a=i?e.left:t.left,s=i?e.right:t.right;return{top:n,bottom:r,left:a,right:s,width:s-a,height:r-n,x:a,y:n}}const e="left"===ee(o),t=X(...d.map((e=>e.right))),i=Z(...d.map((e=>e.left))),n=d.filter((o=>e?o.left===i:o.right===t)),r=n[0].top,a=n[n.length-1].bottom;return{top:r,bottom:a,left:i,right:t,width:t-i,height:a-r,x:i,y:r}}return p}},floating:i.floating,strategy:a});return n.reference.x!==g.reference.x||n.reference.y!==g.reference.y||n.reference.width!==g.reference.width||n.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}},Ne=(e,t,o)=>{const i=new Map,n={platform:je,...o},r={...n.platform,_c:i};return(async(e,t,o)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:a}=o,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=ue(c,i,l),p=i,h={},g=0;for(let o=0;o<s.length;o++){const{name:r,fn:f}=s[o],{x:m,y:y,data:x,reset:w}=await f({x:u,y:d,initialPlacement:i,placement:p,strategy:n,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=y?y:d,h={...h,[r]:{...h[r],...x}},w&&g<=50&&(g++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:n}):w.rects),({x:u,y:d}=ue(c,p,l))),o=-1)}return{x:u,y:d,placement:p,strategy:n,middlewareData:h}})(e,t,{...n,platform:r})};var Me="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function We(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 o,i,n;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(i=o;0!=i--;)if(!We(e[i],t[i]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(i=o;0!=i--;)if(!{}.hasOwnProperty.call(t,n[i]))return!1;for(i=o;0!=i--;){const o=n[i];if(("_owner"!==o||!e.$$typeof)&&!We(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function Ae(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Te(e,t){const o=Ae(e);return Math.round(t*o)/o}function Be(e){const t=r.useRef(e);return Me((()=>{t.current=e})),t}
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
5
  */
6
- var $t=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),qt="undefined"==typeof Element,Jt=qt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Kt=!qt&&Element.prototype.getRootNode?function(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},Qt=function t(e,n){var i;void 0===n&&(n=!0);var o=null==e||null===(i=e.getAttribute)||void 0===i?void 0:i.call(e,"inert");return""===o||"true"===o||n&&e&&t(e.parentNode)},te=function t(e,n,i){for(var o=[],r=Array.from(e);r.length;){var s=r.shift();if(!Qt(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=t(a.length?a:s.children,!0,i);i.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{Jt.call(s,$t)&&i.filter(s)&&(n||!e.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(s),d=!Qt(c,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(s));if(c&&d){var p=t(!0===c?s.children:c.children,!0,i);i.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else r.unshift.apply(r,s.children)}}return o},ee=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ne=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(t){var e,n=null==t||null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return""===n||"true"===n}(t))&&!ee(t)?0:t.tabIndex},ie=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},oe=function(t){return"INPUT"===t.tagName},re=function(t){return function(t){return oe(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,n=t.form||Kt(t),i=function(t){return n.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=i(window.CSS.escape(t.name));else try{e=i(t.name)}catch(t){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",t.message),!1}var o=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]}(e,t.form);return!o||o===t}(t)},se=function(t){var e=t.getBoundingClientRect(),n=e.width,i=e.height;return 0===n&&0===i},ae=function(t,e){var n=e.displayCheck,i=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var o=Jt.call(t,"details>summary:first-of-type")?t.parentElement:t;if(Jt.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return se(t)}else{if("function"==typeof i){for(var r=t;t;){var s=t.parentElement,a=Kt(t);if(s&&!s.shadowRoot&&!0===i(s))return se(t);t=t.assignedSlot?t.assignedSlot:s||a===t.ownerDocument?s:a.host}t=r}if(function(t){var e,n,i,o,r=t&&Kt(t),s=null===(e=r)||void 0===e?void 0:e.host,a=!1;if(r&&r!==t)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(i=n.ownerDocument)&&void 0!==i&&i.contains(s)||null!=t&&null!==(o=t.ownerDocument)&&void 0!==o&&o.contains(t));!a&&s;){var l,c,d;a=!(null===(c=s=null===(l=r=Kt(s))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(s))}return a}(t))return!t.getClientRects().length;if("legacy-full"!==n)return!0}return!1},le=function(t,e){return!(e.disabled||Qt(e)||function(t){return oe(t)&&"hidden"===t.type}(e)||ae(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some((function(t){return"SUMMARY"===t.tagName}))}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var n=0;n<e.children.length;n++){var i=e.children.item(n);if("LEGEND"===i.tagName)return!!Jt.call(e,"fieldset[disabled] *")||!i.contains(t)}return!0}e=e.parentElement}return!1}(e))},ce=function(t,e){return!(re(e)||ne(e)<0||!le(t,e))},de=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},pe=function t(e){var n=[],i=[];return e.forEach((function(e,o){var r=!!e.scopeParent,s=r?e.scopeParent:e,a=function(t,e){var n=ne(t);return n<0&&e&&!ee(t)?0:n}(s,r),l=r?t(e.candidates):s;0===a?r?n.push.apply(n,l):n.push(s):i.push({documentOrder:o,tabIndex:a,item:e,isScope:r,content:l})})),i.sort(ie).reduce((function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t}),[]).concat(n)},ue=function(t,e){var n;return n=(e=e||{}).getShadowRoot?te([t],e.includeContainer,{filter:ce.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:de}):function(t,e,n){if(Qt(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll($t));return e&&Jt.call(t,$t)&&i.unshift(t),i.filter(n)}(t,e.includeContainer,ce.bind(null,e)),pe(n)};const he=l["useInsertionEffect".toString()]||(t=>t());var fe="undefined"!=typeof document?c:d;function ge(){return ge=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ge.apply(this,arguments)}let me=!1,xe=0;const we=()=>"floating-ui-"+xe++;const be=l["useId".toString()]||function(){const[t,e]=l.useState((()=>me?we():void 0));return fe((()=>{null==t&&e(we())}),[]),l.useEffect((()=>{me||(me=!0)}),[]),t};const ve=l.createContext(null),ye=l.createContext(null);function Ce(t){return"data-floating-ui-"+t}const ze=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Re(t,e){const n=ue(t,ze());"prev"===e&&n.reverse();const i=n.indexOf(function(t){let e=t.activeElement;for(;null!=(null==(n=e)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;e=e.shadowRoot.activeElement}return e}((null==(o=t)?void 0:o.ownerDocument)||document));var o;return n.slice(i+1)[0]}function Se(t,e){const n=e||t.currentTarget,i=t.relatedTarget;return!i||!function(t,e){if(!t||!e)return!1;const n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&X(n)){let n=e;for(;n;){if(t===n)return!0;n=n.parentNode||n.host}}return!1}(n,i)}function _e(t){ue(t,ze()).forEach((t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}))}function ke(t){t.querySelectorAll("[data-tabindex]").forEach((t=>{const e=t.dataset.tabindex;delete t.dataset.tabindex,e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")}))}const Ee={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 Le(t){"Tab"===t.key&&(t.target,clearTimeout(undefined))}const Oe=l.forwardRef((function(t,e){const[n,i]=l.useState();fe((()=>(/apple/i.test(navigator.vendor)&&i("button"),document.addEventListener("keydown",Le),()=>{document.removeEventListener("keydown",Le)})),[]);const o={ref:e,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ce("focus-guard")]:"",style:Ee};return l.createElement("span",ge({},t,o))})),Ne=l.createContext(null),Me=Ce("portal");function We(t){let{children:e,id:n,root:i=null,preserveTabOrder:o=!0}=t;const r=function(t){let{id:e,root:n}=void 0===t?{}:t;const[i,o]=l.useState(null),r=be(),s=je(),a=l.useRef(null);return fe((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{a.current=null}))}),[i]),fe((()=>{if(a.current)return;const t=e?document.getElementById(e):null;if(!t)return;const n=document.createElement("div");n.id=r,n.setAttribute(Me,""),t.appendChild(n),a.current=n,o(n)}),[e,r]),fe((()=>{if(a.current)return;let t=n||(null==s?void 0:s.portalNode);t&&!U(t)&&(t=t.current),t=t||document.body;let i=null;e&&(i=document.createElement("div"),i.id=e,t.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(Me,""),t=i||t,t.appendChild(l),a.current=l,o(l)}),[e,n,r,s]),i}({id:n,root:i}),[s,a]=l.useState(null),c=l.useRef(null),d=l.useRef(null),p=l.useRef(null),u=l.useRef(null),h=!!s&&!s.modal&&s.open&&o&&!(!i&&!r);return l.useEffect((()=>{if(r&&o&&(null==s||!s.modal))return r.addEventListener("focusin",t,!0),r.addEventListener("focusout",t,!0),()=>{r.removeEventListener("focusin",t,!0),r.removeEventListener("focusout",t,!0)};function t(t){if(r&&Se(t)){("focusin"===t.type?ke:_e)(r)}}}),[r,o,null==s?void 0:s.modal]),l.createElement(Ne.Provider,{value:l.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:u,portalNode:r,setFocusManagerState:a})),[o,r])},h&&r&&l.createElement(Oe,{"data-type":"outside",ref:c,onFocus:t=>{if(Se(t,r)){var e;null==(e=p.current)||e.focus()}else{const t=Re(document.body,"prev")||(null==s?void 0:s.refs.domReference.current);null==t||t.focus()}}}),h&&r&&l.createElement("span",{"aria-owns":r.id,style:Ee}),r&&x(e,r),h&&r&&l.createElement(Oe,{"data-type":"outside",ref:d,onFocus:t=>{if(Se(t,r)){var e;null==(e=u.current)||e.focus()}else{const e=Re(document.body,"next")||(null==s?void 0:s.refs.domReference.current);null==e||e.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,t.nativeEvent))}}}))}const je=()=>l.useContext(Ne),Te=new Set,Ae=l.forwardRef((function(t,e){let{lockScroll:n=!1,...i}=t;const o=be();return fe((()=>{if(!n)return;Te.add(o);const t=/iP(hone|ad|od)|iOS/.test(function(){const t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}()),e=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,s=e.left?parseFloat(e.left):window.pageXOffset,a=e.top?parseFloat(e.top):window.pageYOffset;if(e.overflow="hidden",r&&(e[i]=r+"px"),t){var l,c;const t=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(e,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(s-Math.floor(t))+"px",right:"0"})}return()=>{Te.delete(o),0===Te.size&&(Object.assign(e,{overflow:"",[i]:""}),t&&(Object.assign(e,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a)))}}),[o,n]),l.createElement("div",ge({ref:e},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))}));function Be(t){var e;void 0===t&&(t={});const{open:n=!1,onOpenChange:i,nodeId:o}=t,[r,s]=l.useState(null),a=(null==(e=t.elements)?void 0:e.reference)||r,c=function(t){void 0===t&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:o,elements:{reference:r,floating:s}={},transform:a=!0,whileElementsMounted:c,open:d}=t,[p,u]=l.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,f]=l.useState(i);Zt(h,i)||f(i);const[m,x]=l.useState(null),[w,b]=l.useState(null),v=l.useCallback((t=>{t!==R.current&&(R.current=t,x(t))}),[]),y=l.useCallback((t=>{t!==S.current&&(S.current=t,b(t))}),[]),C=r||m,z=s||w,R=l.useRef(null),S=l.useRef(null),_=l.useRef(p),k=null!=c,E=Gt(c),L=Gt(o),O=l.useCallback((()=>{if(!R.current||!S.current)return;const t={placement:e,strategy:n,middleware:h};L.current&&(t.platform=L.current),Vt(R.current,S.current,t).then((t=>{const e={...t,isPositioned:!0};N.current&&!Zt(_.current,e)&&(_.current=e,g.flushSync((()=>{u(e)})))}))}),[h,e,n,L]);Ut((()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,u((t=>({...t,isPositioned:!1}))))}),[d]);const N=l.useRef(!1);Ut((()=>(N.current=!0,()=>{N.current=!1})),[]),Ut((()=>{if(C&&(R.current=C),z&&(S.current=z),C&&z){if(E.current)return E.current(C,z,O);O()}}),[C,z,O,E,k]);const M=l.useMemo((()=>({reference:R,floating:S,setReference:v,setFloating:y})),[v,y]),W=l.useMemo((()=>({reference:C,floating:z})),[C,z]),j=l.useMemo((()=>{const t={position:n,left:0,top:0};if(!W.floating)return t;const e=Yt(W.floating,p.x),i=Yt(W.floating,p.y);return a?{...t,transform:"translate("+e+"px, "+i+"px)",...Xt(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:e,top:i}}),[n,a,W.floating,p.x,p.y]);return l.useMemo((()=>({...p,update:O,refs:M,elements:W,floatingStyles:j})),[p,O,M,W,j])}(t),d=l.useContext(ye),p=null!=((null==(u=l.useContext(ve))?void 0:u.id)||null);var u;const h=function(t){const e=l.useRef((()=>{}));return he((()=>{e.current=t})),l.useCallback((function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return null==e.current?void 0:e.current(...n)}),[])}(((t,e,n)=>{t&&(m.current.openEvent=e),x.emit("openchange",{open:t,event:e,reason:n,nested:p}),null==i||i(t,e,n)})),f=l.useRef(null),m=l.useRef({}),x=l.useState((()=>function(){const t=new Map;return{emit(e,n){var i;null==(i=t.get(e))||i.forEach((t=>t(n)))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var i;t.set(e,(null==(i=t.get(e))?void 0:i.filter((t=>t!==n)))||[])}}}()))[0],w=be(),b=l.useCallback((t=>{const e=U(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),contextElement:t}:t;c.refs.setReference(e)}),[c.refs]),v=l.useCallback((t=>{(U(t)||null===t)&&(f.current=t,s(t)),(U(c.refs.reference.current)||null===c.refs.reference.current||null!==t&&!U(t))&&c.refs.setReference(t)}),[c.refs]),y=l.useMemo((()=>({...c.refs,setReference:v,setPositionReference:b,domReference:f})),[c.refs,v,b]),C=l.useMemo((()=>({...c.elements,domReference:a})),[c.elements,a]),z=l.useMemo((()=>({...c,refs:y,elements:C,dataRef:m,nodeId:o,floatingId:w,events:x,open:n,onOpenChange:h})),[c,o,w,x,n,h,y,C]);return fe((()=>{const t=null==d?void 0:d.nodesRef.current.find((t=>t.id===o));t&&(t.context=z)})),l.useMemo((()=>({...c,context:z,refs:y,elements:C})),[c,y,C,z])}function He(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(o[n]=t[n]);return o}var Pe=["color"],Ie=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Pe);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),De=["color"],Fe=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,De);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ve=["color"],Ue=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Ve);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M7.81832 0.68179C7.64258 0.506054 7.35766 0.506054 7.18192 0.68179L5.18192 2.68179C5.00619 2.85753 5.00619 3.14245 5.18192 3.31819C5.35766 3.49392 5.64258 3.49392 5.81832 3.31819L7.05012 2.08638L7.05012 5.50023C7.05012 5.74876 7.25159 5.95023 7.50012 5.95023C7.74865 5.95023 7.95012 5.74876 7.95012 5.50023L7.95012 2.08638L9.18192 3.31819C9.35766 3.49392 9.64258 3.49392 9.81832 3.31819C9.99406 3.14245 9.99406 2.85753 9.81832 2.68179L7.81832 0.68179ZM7.95012 12.9136V9.50023C7.95012 9.2517 7.74865 9.05023 7.50012 9.05023C7.25159 9.05023 7.05012 9.2517 7.05012 9.50023V12.9136L5.81832 11.6818C5.64258 11.5061 5.35766 11.5061 5.18192 11.6818C5.00619 11.8575 5.00619 12.1424 5.18192 12.3182L7.18192 14.3182C7.26632 14.4026 7.38077 14.45 7.50012 14.45C7.61947 14.45 7.73393 14.4026 7.81832 14.3182L9.81832 12.3182C9.99406 12.1424 9.99406 11.8575 9.81832 11.6818C9.64258 11.5061 9.35766 11.5061 9.18192 11.6818L7.95012 12.9136ZM1.49994 7.00017C1.2238 7.00017 0.999939 7.22403 0.999939 7.50017C0.999939 7.77631 1.2238 8.00017 1.49994 8.00017L13.4999 8.00017C13.7761 8.00017 13.9999 7.77631 13.9999 7.50017C13.9999 7.22403 13.7761 7.00017 13.4999 7.00017L1.49994 7.00017Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ze=["color"],Xe=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Ze);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M11.5 3.04999C11.7485 3.04999 11.95 3.25146 11.95 3.49999V7.49999C11.95 7.74852 11.7485 7.94999 11.5 7.94999C11.2515 7.94999 11.05 7.74852 11.05 7.49999V4.58639L4.58638 11.05H7.49999C7.74852 11.05 7.94999 11.2515 7.94999 11.5C7.94999 11.7485 7.74852 11.95 7.49999 11.95L3.49999 11.95C3.38064 11.95 3.26618 11.9026 3.18179 11.8182C3.0974 11.7338 3.04999 11.6193 3.04999 11.5L3.04999 7.49999C3.04999 7.25146 3.25146 7.04999 3.49999 7.04999C3.74852 7.04999 3.94999 7.25146 3.94999 7.49999L3.94999 10.4136L10.4136 3.94999L7.49999 3.94999C7.25146 3.94999 7.04999 3.74852 7.04999 3.49999C7.04999 3.25146 7.25146 3.04999 7.49999 3.04999L11.5 3.04999Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ye=["color"],Ge=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Ye);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}));const $e=({blockId:e,onClose:n})=>{const i=t(),[o,r]=h(""),l=0===o.length;return a("div",Object.assign({className:"cursor-pointer user-select-none transition-bg duration-20 ease-in white-space-nowrap w-full"},{children:[s("input",{type:"text",placeholder:"Paste image link",value:o,className:"items-center bg-[hsla(45,13%,94%,.6)] rounded-[4px] shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] cursor-text flex text-[14px] h-[32px] leading-[20px] px-[6px] relative w-full border-none",onChange:t=>r(t.target.value)}),s("button",Object.assign({type:"button",className:"user-select-none transition-bg duration-20 ease-in cursor-pointer flex items-center justify-center flex-shrink-0 white-space-nowrap h-[28px] rounded-[4px] shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] bg-[rgb(35,131,226)] text-white fill-white leading-[1.2] px-[12px] text-[14px] font-medium w-full max-w-[300px] mx-auto m-[12px_0_6px] disabled:bg-[rgba(35,131,226,0.5)] disabled:cursor-not-allowed",disabled:l,onClick:()=>{0!==o.length&&(i.blocks.Image.updateElement(e,"image",{src:o}),n())}},{children:"Embed image"}))]}))};function qe(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Je=({accept:n="image/*",onClose:i,blockId:o,onSetLoading:r})=>{const l=e("Image"),c=t();return s("div",Object.assign({className:"user-select-none transition-bg duration-20 ease-in white-space-nowrap rounded-[4px] h-[32px] px-[12px] border border-[rgba(55,53,47,0.16)] w-full cursor-pointer"},{children:a("label",Object.assign({htmlFor:"image-uploader",className:"text-[14px] leading-[1.2] font-medium cursor-pointer w-full flex items-center justify-center h-full"},{children:[s("input",{type:"file",id:"image-uploader",className:"absolute left-0 top-0 invisible",accept:(null==l?void 0:l.accept)||n,onChange:t=>{const e=t.target.files[0];e&&(t=>{qe(void 0,void 0,void 0,(function*(){if(null==l?void 0:l.onUpload){i(),r(!0);try{const e=yield null==l?void 0:l.onUpload(t);c.blocks.Image.updateElement(o,"image",{src:e.src,alt:e.alt,sizes:e.sizes,bgColor:e.bgColor,fit:"contain"})}catch(t){}finally{r(!1)}}else console.warn("onUpload not provided")}))})(e)},multiple:!1}),"Upload image"]}))}))},Ke=({floatingStyles:t,refs:e,onClose:n,blockId:i,onSetLoading:o})=>{const[r,l]=h("upload"),c=t=>l(t),d="upload"===r,p="embed"===r,u=t=>({borderBottom:t?"2px solid #2483e2":"2px solid transparent"});return s(We,Object.assign({root:document.getElementById("yoopta-editor")},{children:s(Ae,Object.assign({lockScroll:!0,className:"z-[100]",onClick:n},{children:s("div",Object.assign({ref:e.setFloating,style:t,onClick:t=>t.stopPropagation()},{children:a("div",Object.assign({className:"flex flex-col min-w-[540px] max-w-[calc(100vw-24px)] h-full max-h-[420px] bg-white shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[a("div",Object.assign({className:"w-full flex text-[14px] p-[0_8px] shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] relative z-10 h-[40px]"},{children:[s("button",Object.assign({type:"button",onClick:()=>c("upload"),style:u(d),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Upload"})),s("button",Object.assign({type:"button",onClick:()=>c("embed"),style:u(p),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Image link"}))]})),a("div",Object.assign({className:"pt-[6px] pb-[6px] mt-[4px] flex justify-center mr-[12px] ml-[12px]"},{children:[p&&s($e,{onClose:n,blockId:i}),d&&s(Je,{onClose:n,blockId:i,onSetLoading:o})]}))]}))}))}))}))},Qe=({className:t,width:e,height:n,children:i})=>a("div",Object.assign({className:t},{children:[i,s("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:e,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 h-4 w-4 animate-spin"},{children:s("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),tn=({attributes:t,children:e,blockId:n})=>{const[i,o]=h(!1),[r,l]=h(!1),{refs:c,floatingStyles:d}=Be({placement:"bottom",open:i,onOpenChange:o,middleware:[Ft(),Dt(),It(),Rt(10)]});return a("div",Object.assign({className:"w-full user-select-none m-[20px_0_10px] relative flex"},t,{contentEditable:!1},{children:[a("button",Object.assign({className:"p-[12px_36px_12px_12px] flex items-center text-left w-full overflow-hidden rounded-[3px] text-[14px] text-[rgba(55,53,47,0.65)] relative cursor-pointer border-none bg-[#efefef] transition-[background-color_100ms_ease-in] hover:bg-[#e3e3e3]",onClick:()=>o(!0),disabled:r,ref:c.setReference},{children:[s(r?Qe:Fe,{className:"mr-2 user-select-none",width:24,height:24}),s("span",Object.assign({className:"font-medium"},{children:r?"Loading...":"Click to add image"})),r&&s("div",{className:"absolute top-0 left-0 h-full bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),i&&s(Ke,{blockId:n,floatingStyles:d,refs:c,onClose:()=>o(!1),onSetLoading:t=>l(t)}),e]}))},{ExtendedBlockActions:en,BlockOptionsMenuGroup:nn,BlockOptionsMenuItem:on,BlockOptionsSeparator:rn}=n,sn=({editor:t,block:e,props:n})=>a(en,Object.assign({onClick:()=>t.setSelection([e.meta.order])},{children:[s(rn,{}),a(nn,{children:[s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"contain"})}},{children:[s(Ue,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fit"]}))}),s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"fill"})}},{children:[s(Ge,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fill"]}))}),s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"cover"})}},{children:[s(Xe,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Cover"]}))})]}),s(rn,{}),s(nn,{children:s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{if(!n||!n.src)return;const t=document.createElement("a");t.href=n.src,t.download=n.alt||n.src,t.target="_blank",t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),document.body.removeChild(t)}},{children:[s(Ie,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Download"]}))})})]})),an=({position:t})=>s("div",Object.assign({contentEditable:!1,className:"absolute pointer-events-none flex items-center justify-center z-10 opacity-1 h-full w-[15px] cursor-col-resize transition-opacity duration-150 ease-in "+("left"===t?"left-0 top-0":"right-0 top-0")},{children:s("div",{className:"opacity-100 transition-opacity duration-300 ease-in rounded-[20px] bg-[rgba(15,15,15,0.6)] border border-[rgba(255,255,255,0.9)] w-[6px] h-[48px] max-h-[50%] shadow-[0_0_0_.5px_#FFF]"})})),ln=new r({type:"Image",elements:{image:{render:({element:n,attributes:r,children:l,blockId:c})=>{const{src:p,alt:u,srcSet:g,bgColor:m,fit:x,sizes:b}=n.props||{},v=i(c),y=t(),C=e("Image"),[z,R]=h({width:(null==b?void 0:b.width)||650,height:(null==b?void 0:b.height)||440});d((()=>R({width:(null==b?void 0:b.width)||650,height:(null==b?void 0:b.height)||440})),[n.props]);const S=o({blockId:c});const _=f((()=>{var t,e;return{minWidth:300,size:{width:z.width,height:z.height},maxWidth:(null===(t=null==C?void 0:C.maxSizes)||void 0===t?void 0:t.maxWidth)||800,maxHeight:(null===(e=null==C?void 0:C.maxSizes)||void 0===e?void 0:e.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!0,right:!0},handleStyles:{left:{left:0},right:{right:0}},onResize:(t,e,n)=>{R({width:n.offsetWidth,height:n.offsetHeight})},onResizeStop:(t,e,n)=>{y.blocks.Image.updateElement(c,"image",{sizes:{width:n.offsetWidth,height:n.offsetHeight}})},handleComponent:{left:s(an,{position:"left"}),right:s(an,{position:"right"})}}}),[z.width,z.height]);return p?s("div",Object.assign({contentEditable:!1,draggable:!1,className:"mt-4 relative"},r,{children:a(P,Object.assign({},_,{className:"mx-auto my-0 flex"},{children:[S&&s("div",{className:"absolute pointer-events-none inset-0 bg-[rgba(35,131,226,0.14)] z-[81] rounded-[3px] opacity-100 transition-opacity duration-150 ease-in"}),s(w,{src:p,alt:u,srcSet:g,fit:x,width:null==z?void 0:z.width,bgColor:m,height:null==z?void 0:z.height}),s(sn,{block:v,editor:y,props:n.props}),l]}))})):s(tn,Object.assign({attributes:r,blockId:c},{children:l}))},props:{src:null,alt:null,srcSet:null,bgColor:null,fit:"contain",sizes:{width:650,height:500},nodeType:"void"}}},options:{displayLabel:"Image",onUpload:()=>Promise.resolve({src:null,alt:null}),accept:"image/png, image/jpeg, image/gif, image/webp",maxSizes:{maxWidth:650,maxHeight:550}}});!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-\\[100\\]{z-index:100}.z-\\[81\\]{z-index:81}.m-\\[12px_0_6px\\]{margin:12px 0 6px}.m-\\[20px_0_10px\\]{margin:20px 0 10px}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.ml-\\[12px\\]{margin-left:12px}.mr-2{margin-right:.5rem}.mr-\\[12px\\]{margin-right:12px}.mt-4{margin-top:1rem}.mt-\\[4px\\]{margin-top:4px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.h-4{height:1rem}.h-\\[28px\\]{height:28px}.h-\\[32px\\]{height:32px}.h-\\[40px\\]{height:40px}.h-\\[48px\\]{height:48px}.h-full{height:100%}.max-h-\\[420px\\]{max-height:420px}.max-h-\\[50\\%\\]{max-height:50%}.w-4{width:1rem}.w-\\[15px\\]{width:15px}.w-\\[6px\\]{width:6px}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[540px\\]{min-width:540px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.flex-shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.border-\\[rgba\\(255\\2c 255\\2c 255\\2c 0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.border-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.bg-\\[hsla\\(45\\2c 13\\%\\2c 94\\%\\2c \\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.bg-\\[rgb\\(35\\2c 131\\2c 226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.bg-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.bg-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.bg-inherit{background-color:inherit}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.fill-white{fill:#fff}.p-\\[0_8px\\]{padding:0 8px}.p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-\\[6px\\]{padding-top:6px}.pb-\\[6px\\],.py-\\[6px\\]{padding-bottom:6px}.pt-\\[6px\\]{padding-top:6px}.text-left{text-align:left}.text-\\[14px\\]{font-size:14px}.font-medium{font-weight:500}.leading-\\[1\\.2\\]{line-height:1.2}.leading-\\[120\\%\\]{line-height:120%}.leading-\\[20px\\]{line-height:20px}.text-\\[rgb\\(55\\2c 53\\2c 47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.text-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.65\\)\\]{color:rgba(55,53,47,.65)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-100{opacity:1}.shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color)}.shadow-\\[0_0_0_\\.5px_\\#FFF\\],.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color)}.shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\2c _rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\2c _rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_0px_0px_1px_inset\\2c _rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}");export{ln as default};
6
+ var Pe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),He="undefined"==typeof Element,Ie=He?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,De=!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},Fe=function e(t,o){var i;void 0===o&&(o=!0);var n=null==t||null===(i=t.getAttribute)||void 0===i?void 0:i.call(t,"inert");return""===n||"true"===n||o&&t&&e(t.parentNode)},Ve=function e(t,o,i){for(var n=[],r=Array.from(t);r.length;){var a=r.shift();if(!Fe(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,i);i.flatten?n.push.apply(n,l):n.push({scopeParent:a,candidates:l})}else{Ie.call(a,Pe)&&i.filter(a)&&(o||!t.includes(a))&&n.push(a);var c=a.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(a),u=!Fe(c,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(c&&u){var d=e(!0===c?a.children:c.children,!0,i);i.flatten?n.push.apply(n,d):n.push({scopeParent:a,candidates:d})}else r.unshift.apply(r,a.children)}}return n},Ue=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ye=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!Ue(e)?0:e.tabIndex},Ze=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Xe=function(e){return"INPUT"===e.tagName},Ge=function(e){return function(e){return Xe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||De(e),i=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(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 n=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!n||n===e}(e)},qe=function(e){var t=e.getBoundingClientRect(),o=t.width,i=t.height;return 0===o&&0===i},$e=function(e,t){var o=t.displayCheck,i=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var n=Ie.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ie.call(n,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return qe(e)}else{if("function"==typeof i){for(var r=e;e;){var a=e.parentElement,s=De(e);if(a&&!a.shadowRoot&&!0===i(a))return qe(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=r}if(function(e){var t,o,i,n,r=e&&De(e),a=null===(t=r)||void 0===t?void 0:t.host,s=!1;if(r&&r!==e)for(s=!!(null!==(o=a)&&void 0!==o&&null!==(i=o.ownerDocument)&&void 0!==i&&i.contains(a)||null!=e&&null!==(n=e.ownerDocument)&&void 0!==n&&n.contains(e));!s&&a;){var l,c,u;s=!(null===(c=a=null===(l=r=De(a))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},Je=function(e,t){return!(t.disabled||Fe(t)||function(e){return Xe(e)&&"hidden"===e.type}(t)||$e(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 o=0;o<t.children.length;o++){var i=t.children.item(o);if("LEGEND"===i.tagName)return!!Ie.call(t,"fieldset[disabled] *")||!i.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ke=function(e,t){return!(Ge(t)||Ye(t)<0||!Je(e,t))},Qe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},et=function e(t){var o=[],i=[];return t.forEach((function(t,n){var r=!!t.scopeParent,a=r?t.scopeParent:t,s=function(e,t){var o=Ye(e);return o<0&&t&&!Ue(e)?0:o}(a,r),l=r?e(t.candidates):a;0===s?r?o.push.apply(o,l):o.push(a):i.push({documentOrder:n,tabIndex:s,item:t,isScope:r,content:l})})),i.sort(Ze).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},tt=function(e,t){var o;return o=(t=t||{}).getShadowRoot?Ve([e],t.includeContainer,{filter:Ke.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Qe}):function(e,t,o){if(Fe(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Pe));return t&&Ie.call(e,Pe)&&i.unshift(e),i.filter(o)}(e,t.includeContainer,Ke.bind(null,t)),et(o)};const ot=r["useInsertionEffect".toString()]||(e=>e());var it="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function nt(){return nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},nt.apply(this,arguments)}let rt=!1,at=0;const st=()=>"floating-ui-"+at++;const lt=r["useId".toString()]||function(){const[e,t]=r.useState((()=>rt?st():void 0));return it((()=>{null==e&&t(st())}),[]),r.useEffect((()=>{rt||(rt=!0)}),[]),e};const ct=r.createContext(null),ut=r.createContext(null);function dt(e){return"data-floating-ui-"+e}const pt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ht(e,t){const o=tt(e,pt());"prev"===t&&o.reverse();const i=o.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(o=t)||null==(o=o.shadowRoot)?void 0:o.activeElement);){var o;t=t.shadowRoot.activeElement}return t}((null==(n=e)?void 0:n.ownerDocument)||document));var n;return o.slice(i+1)[0]}function gt(e,t){const o=t||e.currentTarget,i=e.relatedTarget;return!i||!function(e,t){if(!e||!t)return!1;const o=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(o&&A(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,i)}function ft(e){tt(e,pt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function mt(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 yt={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 xt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const wt=r.forwardRef((function(e,t){const[o,i]=r.useState();it((()=>(/apple/i.test(navigator.vendor)&&i("button"),document.addEventListener("keydown",xt),()=>{document.removeEventListener("keydown",xt)})),[]);const n={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[dt("focus-guard")]:"",style:yt};return r.createElement("span",nt({},e,n))})),bt=r.createContext(null),vt=dt("portal");function Ct(e){let{children:t,id:o,root:n=null,preserveTabOrder:a=!0}=e;const s=function(e){let{id:t,root:o}=void 0===e?{}:e;const[i,n]=r.useState(null),a=lt(),s=St(),l=r.useRef(null);return it((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),it((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=a,o.setAttribute(vt,""),e.appendChild(o),l.current=o,n(o)}),[t,a]),it((()=>{if(l.current)return;let e=o||(null==s?void 0:s.portalNode);e&&!M(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const r=document.createElement("div");r.id=a,r.setAttribute(vt,""),e=i||e,e.appendChild(r),l.current=r,n(r)}),[t,o,a,s]),i}({id:o,root:n}),[l,c]=r.useState(null),u=r.useRef(null),d=r.useRef(null),p=r.useRef(null),h=r.useRef(null),g=!!l&&!l.modal&&l.open&&a&&!(!n&&!s);return r.useEffect((()=>{if(s&&a&&(null==l||!l.modal))return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&gt(e)){("focusin"===e.type?mt:ft)(s)}}}),[s,a,null==l?void 0:l.modal]),r.createElement(bt.Provider,{value:r.useMemo((()=>({preserveTabOrder:a,beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:h,portalNode:s,setFocusManagerState:c})),[a,s])},g&&s&&r.createElement(wt,{"data-type":"outside",ref:u,onFocus:e=>{if(gt(e,s)){var t;null==(t=p.current)||t.focus()}else{const e=ht(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),g&&s&&r.createElement("span",{"aria-owns":s.id,style:yt}),s&&i.createPortal(t,s),g&&s&&r.createElement(wt,{"data-type":"outside",ref:d,onFocus:e=>{if(gt(e,s)){var t;null==(t=h.current)||t.focus()}else{const t=ht(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const St=()=>r.useContext(bt),zt=new Set,Rt=r.forwardRef((function(e,t){let{lockScroll:o=!1,...i}=e;const n=lt();return it((()=>{if(!o)return;zt.add(n);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,s=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[i]=r+"px"),e){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,o=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(s-Math.floor(o))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{zt.delete(n),0===zt.size&&(Object.assign(t,{overflow:"",[i]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,s)))}}),[n,o]),r.createElement("div",nt({ref:t},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))}));function Et(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:i,nodeId:n}=e,[s,l]=r.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||s,u=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:i=[],platform:n,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,h]=r.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[g,f]=r.useState(i);We(g,i)||f(i);const[m,y]=r.useState(null),[x,w]=r.useState(null),b=r.useCallback((e=>{e!==z.current&&(z.current=e,y(e))}),[]),v=r.useCallback((e=>{e!==R.current&&(R.current=e,w(e))}),[]),C=s||m,S=l||x,z=r.useRef(null),R=r.useRef(null),E=r.useRef(p),_=null!=u,j=Be(u),k=Be(n),L=r.useCallback((()=>{if(!z.current||!R.current)return;const e={placement:t,strategy:o,middleware:g};k.current&&(e.platform=k.current),Ne(z.current,R.current,e).then((e=>{const t={...e,isPositioned:!0};O.current&&!We(E.current,t)&&(E.current=t,a.flushSync((()=>{h(t)})))}))}),[g,t,o,k]);Me((()=>{!1===d&&E.current.isPositioned&&(E.current.isPositioned=!1,h((e=>({...e,isPositioned:!1}))))}),[d]);const O=r.useRef(!1);Me((()=>(O.current=!0,()=>{O.current=!1})),[]),Me((()=>{if(C&&(z.current=C),S&&(R.current=S),C&&S){if(j.current)return j.current(C,S,L);L()}}),[C,S,L,j,_]);const N=r.useMemo((()=>({reference:z,floating:R,setReference:b,setFloating:v})),[b,v]),M=r.useMemo((()=>({reference:C,floating:S})),[C,S]),W=r.useMemo((()=>{const e={position:o,left:0,top:0};if(!M.floating)return e;const t=Te(M.floating,p.x),i=Te(M.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+i+"px)",...Ae(M.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:i}}),[o,c,M.floating,p.x,p.y]);return r.useMemo((()=>({...p,update:L,refs:N,elements:M,floatingStyles:W})),[p,L,N,M,W])}(e),d=r.useContext(ut),p=null!=((null==(h=r.useContext(ct))?void 0:h.id)||null);var h;const g=function(e){const t=r.useRef((()=>{}));return ot((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(m.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:o,nested:p}),null==i||i(e,t,o)})),f=r.useRef(null),m=r.useRef({}),y=r.useState((()=>function(){const e=new Map;return{emit(t,o){var i;null==(i=e.get(t))||i.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var i;e.set(t,(null==(i=e.get(t))?void 0:i.filter((e=>e!==o)))||[])}}}()))[0],x=lt(),w=r.useCallback((e=>{const t=M(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;u.refs.setReference(t)}),[u.refs]),b=r.useCallback((e=>{(M(e)||null===e)&&(f.current=e,l(e)),(M(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!M(e))&&u.refs.setReference(e)}),[u.refs]),v=r.useMemo((()=>({...u.refs,setReference:b,setPositionReference:w,domReference:f})),[u.refs,b,w]),C=r.useMemo((()=>({...u.elements,domReference:c})),[u.elements,c]),S=r.useMemo((()=>({...u,refs:v,elements:C,dataRef:m,nodeId:n,floatingId:x,events:y,open:o,onOpenChange:g})),[u,n,x,y,o,g,v,C]);return it((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===n));e&&(e.context=S)})),r.useMemo((()=>({...u,context:S,refs:v,elements:C})),[u,v,C,S])}function _t(e,t){if(null==e)return{};var o,i,n={},r=Object.keys(e);for(i=0;i<r.length;i++)o=r[i],t.indexOf(o)>=0||(n[o]=e[o]);return n}var jt=["color"],kt=o.forwardRef((function(e,t){var i=e.color,n=void 0===i?"currentColor":i,r=_t(e,jt);return o.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),o.createElement("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Lt=["color"],Ot=o.forwardRef((function(e,t){var i=e.color,n=void 0===i?"currentColor":i,r=_t(e,Lt);return o.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),o.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Nt=["color"],Mt=o.forwardRef((function(e,t){var i=e.color,n=void 0===i?"currentColor":i,r=_t(e,Nt);return o.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),o.createElement("path",{d:"M7.81832 0.68179C7.64258 0.506054 7.35766 0.506054 7.18192 0.68179L5.18192 2.68179C5.00619 2.85753 5.00619 3.14245 5.18192 3.31819C5.35766 3.49392 5.64258 3.49392 5.81832 3.31819L7.05012 2.08638L7.05012 5.50023C7.05012 5.74876 7.25159 5.95023 7.50012 5.95023C7.74865 5.95023 7.95012 5.74876 7.95012 5.50023L7.95012 2.08638L9.18192 3.31819C9.35766 3.49392 9.64258 3.49392 9.81832 3.31819C9.99406 3.14245 9.99406 2.85753 9.81832 2.68179L7.81832 0.68179ZM7.95012 12.9136V9.50023C7.95012 9.2517 7.74865 9.05023 7.50012 9.05023C7.25159 9.05023 7.05012 9.2517 7.05012 9.50023V12.9136L5.81832 11.6818C5.64258 11.5061 5.35766 11.5061 5.18192 11.6818C5.00619 11.8575 5.00619 12.1424 5.18192 12.3182L7.18192 14.3182C7.26632 14.4026 7.38077 14.45 7.50012 14.45C7.61947 14.45 7.73393 14.4026 7.81832 14.3182L9.81832 12.3182C9.99406 12.1424 9.99406 11.8575 9.81832 11.6818C9.64258 11.5061 9.35766 11.5061 9.18192 11.6818L7.95012 12.9136ZM1.49994 7.00017C1.2238 7.00017 0.999939 7.22403 0.999939 7.50017C0.999939 7.77631 1.2238 8.00017 1.49994 8.00017L13.4999 8.00017C13.7761 8.00017 13.9999 7.77631 13.9999 7.50017C13.9999 7.22403 13.7761 7.00017 13.4999 7.00017L1.49994 7.00017Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Wt=["color"],At=o.forwardRef((function(e,t){var i=e.color,n=void 0===i?"currentColor":i,r=_t(e,Wt);return o.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),o.createElement("path",{d:"M11.5 3.04999C11.7485 3.04999 11.95 3.25146 11.95 3.49999V7.49999C11.95 7.74852 11.7485 7.94999 11.5 7.94999C11.2515 7.94999 11.05 7.74852 11.05 7.49999V4.58639L4.58638 11.05H7.49999C7.74852 11.05 7.94999 11.2515 7.94999 11.5C7.94999 11.7485 7.74852 11.95 7.49999 11.95L3.49999 11.95C3.38064 11.95 3.26618 11.9026 3.18179 11.8182C3.0974 11.7338 3.04999 11.6193 3.04999 11.5L3.04999 7.49999C3.04999 7.25146 3.25146 7.04999 3.49999 7.04999C3.74852 7.04999 3.94999 7.25146 3.94999 7.49999L3.94999 10.4136L10.4136 3.94999L7.49999 3.94999C7.25146 3.94999 7.04999 3.74852 7.04999 3.49999C7.04999 3.25146 7.25146 3.04999 7.49999 3.04999L11.5 3.04999Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Tt=["color"],Bt=o.forwardRef((function(e,t){var i=e.color,n=void 0===i?"currentColor":i,r=_t(e,Tt);return o.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),o.createElement("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}));const Pt=({blockId:i,onClose:n})=>{const r=e.useYooptaEditor(),[a,s]=o.useState(""),l=0===a.length;return t.jsxs("div",Object.assign({className:"yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-white-space-nowrap yoo-image-w-full"},{children:[t.jsx("input",{type:"text",placeholder:"Paste image link",value:a,className:"yoo-image-items-center yoo-image-bg-[hsla(45,13%,94%,.6)] yoo-image-rounded-[4px] yoo-image-shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] yoo-image-cursor-text yoo-image-flex yoo-image-text-[14px] yoo-image-h-[32px] yoo-image-leading-[20px] yoo-image-px-[6px] yoo-image-relative yoo-image-w-full yoo-image-border-none",onChange:e=>s(e.target.value)}),t.jsx("button",Object.assign({type:"button",className:"yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-cursor-pointer yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-flex-shrink-0 yoo-image-white-space-nowrap yoo-image-h-[28px] yoo-image-rounded-[4px] yoo-image-shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] yoo-image-bg-[rgb(35,131,226)] yoo-image-text-white yoo-image-fill-white yoo-image-leading-[1.2] yoo-image-px-[12px] yoo-image-text-[14px] yoo-image-font-medium yoo-image-w-full yoo-image-max-w-[300px] yoo-image-mx-auto yoo-image-m-[12px_0_6px] disabled:yoo-image-bg-[rgba(35,131,226,0.5)] disabled:yoo-image-cursor-not-allowed",disabled:l,onClick:()=>{0!==a.length&&(r.blocks.Image.updateElement(i,"image",{src:a}),n())}},{children:"Embed image"}))]}))};function Ht(e,t,o,i){return new(o||(o=Promise))((function(n,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const It=({accept:o="image/*",onClose:i,blockId:n,onSetLoading:r})=>{const a=e.useYooptaPluginOptions("Image"),s=e.useYooptaEditor();return t.jsx("div",Object.assign({className:"yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-white-space-nowrap yoo-image-rounded-[4px] yoo-image-h-[32px] yoo-image-px-[12px] yoo-image-border yoo-image-border-[rgba(55,53,47,0.16)] yoo-image-w-full yoo-image-cursor-pointer"},{children:t.jsxs("label",Object.assign({htmlFor:"image-uploader",className:"yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-font-medium yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-h-full"},{children:[t.jsx("input",{type:"file",id:"image-uploader",className:"yoo-image-absolute yoo-image-left-0 yoo-image-top-0 yoo-image-invisible",accept:(null==a?void 0:a.accept)||o,onChange:e=>{const t=e.target.files[0];t&&(e=>{Ht(void 0,void 0,void 0,(function*(){if(null==a?void 0:a.onUpload){i(),r(!0);try{const t=yield null==a?void 0:a.onUpload(e);s.blocks.Image.updateElement(n,"image",{src:t.src,alt:t.alt,sizes:t.sizes,bgColor:t.bgColor,fit:"contain"})}catch(e){}finally{r(!1)}}else console.warn("onUpload not provided")}))})(t)},multiple:!1}),"Upload image"]}))}))},Dt=({floatingStyles:e,refs:i,onClose:n,blockId:r,onSetLoading:a})=>{const[s,l]=o.useState("upload"),c=e=>l(e),u="upload"===s,d="embed"===s,p=e=>({borderBottom:e?"2px solid #2483e2":"2px solid transparent"});return t.jsx(Ct,Object.assign({id:"yoo-image-uploader-portal",root:document.getElementById("yoopta-editor")},{children:t.jsx(Rt,Object.assign({lockScroll:!0,className:"yoo-image-z-[100]",onClick:n},{children:t.jsx("div",Object.assign({ref:i.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:t.jsxs("div",Object.assign({className:"yoo-image-flex yoo-image-flex-col yoo-image-min-w-[540px] yoo-image-max-w-[calc(100vw-24px)] yoo-image-h-full yoo-image-max-h-[420px] yoo-image-bg-white yoo-image-shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[t.jsxs("div",Object.assign({className:"yoo-image-w-full yoo-image-flex yoo-image-text-[14px] yoo-image-p-[0_8px] yoo-image-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-image-relative yoo-image-z-10 yoo-image-h-[40px]"},{children:[t.jsx("button",Object.assign({type:"button",onClick:()=>c("upload"),style:p(u),className:"yoo-image-py-[6px] yoo-image-whitespace-nowrap yoo-image-min-w-0 yoo-image-flex-shrink-0 yoo-image-text-[rgb(55,53,47)] yoo-image-relative yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-bg-inherit yoo-image-transition-[height_20ms_ease-in] yoo-image-inline-flex yoo-image-items-center yoo-image-h-full yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-px-[8px]"},{children:"Upload"})),t.jsx("button",Object.assign({type:"button",onClick:()=>c("embed"),style:p(d),className:"yoo-image-py-[6px] yoo-image-whitespace-nowrap yoo-image-min-w-0 yoo-image-flex-shrink-0 yoo-image-text-[rgb(55,53,47)] yoo-image-relative yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-bg-inherit yoo-image-transition-[height_20ms_ease-in] yoo-image-inline-flex yoo-image-items-center yoo-image-h-full yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-px-[8px]"},{children:"Image link"}))]})),t.jsxs("div",Object.assign({className:"yoo-image-pt-[6px] yoo-image-pb-[6px] yoo-image-mt-[4px] yoo-image-flex yoo-image-justify-center yoo-image-mr-[12px] yoo-image-ml-[12px]"},{children:[d&&t.jsx(Pt,{onClose:n,blockId:r}),u&&t.jsx(It,{onClose:n,blockId:r,onSetLoading:a})]}))]}))}))}))}))},Ft=({className:e,width:o,height:i,children:n})=>t.jsxs("div",Object.assign({className:e},{children:[n,t.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:o,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-image-h-4 yoo-image-w-4 yoo-image-animate-spin"},{children:t.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),Vt=({attributes:e,children:i,blockId:n})=>{const[r,a]=o.useState(!1),[s,l]=o.useState(!1),{refs:c,floatingStyles:u}=Et({placement:"bottom",open:r,onOpenChange:a,middleware:[Oe(),Le(),ke(),he(10)]});return t.jsxs("div",Object.assign({className:"yoo-image-w-full yoo-image-user-select-none yoo-image-m-[20px_0_10px] yoo-image-relative yoo-image-flex"},e,{contentEditable:!1},{children:[t.jsxs("button",Object.assign({className:"yoo-image-p-[12px_36px_12px_12px] yoo-image-flex yoo-image-items-center yoo-image-text-left yoo-image-w-full yoo-image-overflow-hidden yoo-image-rounded-[3px] yoo-image-text-[14px] yoo-image-text-[rgba(55,53,47,0.65)] yoo-image-relative yoo-image-cursor-pointer yoo-image-border-none yoo-image-bg-[#efefef] yoo-image-transition-[background-color_100ms_ease-in] hover:yoo-image-bg-[#e3e3e3]",onClick:()=>a(!0),disabled:s,ref:c.setReference},{children:[s?t.jsx(Ft,{className:"yoo-image-mr-2 yoo-image-user-select-none",width:24,height:24}):t.jsx(Ot,{className:"yoo-image-mr-2 yoo-image-user-select-none",width:24,height:24}),t.jsx("span",Object.assign({className:"yoo-image-font-medium"},{children:s?"Loading...":"Click to add image"})),s&&t.jsx("div",{className:"yoo-image-absolute yoo-image-top-0 yoo-image-left-0 yoo-image-h-full yoo-image-bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),r&&t.jsx(Dt,{blockId:n,floatingStyles:u,refs:c,onClose:()=>a(!1),onSetLoading:e=>l(e)}),i]}))},{ExtendedBlockActions:Ut,BlockOptionsMenuGroup:Yt,BlockOptionsMenuItem:Zt,BlockOptionsSeparator:Xt}=e.UI,Gt=({editor:e,block:o,props:i})=>t.jsxs(Ut,Object.assign({onClick:()=>e.setSelection([o.meta.order]),className:"yoopta-image-options"},{children:[t.jsx(Xt,{}),t.jsxs(Yt,{children:[t.jsx(Zt,{children:t.jsxs("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{e.blocks.Image.updateElement(o.id,"image",{fit:"contain"})}},{children:[t.jsx(Mt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Fit"]}))}),t.jsx(Zt,{children:t.jsxs("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{e.blocks.Image.updateElement(o.id,"image",{fit:"fill"})}},{children:[t.jsx(Bt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Fill"]}))}),t.jsx(Zt,{children:t.jsxs("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{e.blocks.Image.updateElement(o.id,"image",{fit:"cover"})}},{children:[t.jsx(At,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Cover"]}))})]}),t.jsx(Xt,{}),t.jsx(Yt,{children:t.jsx(Zt,{children:t.jsxs("button",Object.assign({type:"button",className:"yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{if(!i||!i.src)return;const e=document.createElement("a");e.href=i.src,e.download=i.alt||i.src,e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},{children:[t.jsx(kt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Download"]}))})})]})),qt=({position:e})=>t.jsx("div",Object.assign({contentEditable:!1,className:"yoo-image-absolute yoo-image-pointer-events-none yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-z-10 yoo-image-opacity-1 yoo-image-h-full yoo-image-w-[15px] yoo-image-cursor-col-resize yoo-image-transition-opacity yoo-image-duration-150 yoo-image-ease-in "+("left"===e?"yoo-image-left-0 yoo-image-top-0":"yoo-image-right-0 yoo-image-top-0")},{children:t.jsx("div",{className:"yoo-image-opacity-100 yoo-image-transition-opacity yoo-image-duration-300 yoo-image-ease-in yoo-image-rounded-[20px] yoo-image-bg-[rgba(15,15,15,0.6)] yoo-image-border yoo-image-border-[rgba(255,255,255,0.9)] yoo-image-w-[6px] yoo-image-h-[48px] yoo-image-max-h-[50%] yoo-image-shadow-[0_0_0_.5px_#FFF]"})})),$t=new e.YooptaPlugin({type:"Image",elements:{image:{render:({element:i,attributes:n,children:r,blockId:a})=>{const{src:l,alt:c,srcSet:u,bgColor:d,fit:p,sizes:h}=i.props||{},g=e.useBlockData(a),f=e.useYooptaEditor(),m=e.useYooptaReadOnly(),y=e.useYooptaPluginOptions("Image"),[x,w]=o.useState({width:(null==h?void 0:h.width)||650,height:(null==h?void 0:h.height)||440});o.useEffect((()=>w({width:(null==h?void 0:h.width)||650,height:(null==h?void 0:h.height)||440})),[i.props]);const b=e.useBlockSelected({blockId:a}),v=o.useMemo((()=>{var e,o;return{minWidth:300,size:{width:x.width,height:x.height},maxWidth:(null===(e=null==y?void 0:y.maxSizes)||void 0===e?void 0:e.maxWidth)||800,maxHeight:(null===(o=null==y?void 0:y.maxSizes)||void 0===o?void 0:o.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!m,right:!m},handleStyles:{left:{left:0},right:{right:0}},onResize:(e,t,o)=>{m||w({width:o.offsetWidth,height:o.offsetHeight})},onResizeStop:(e,t,o)=>{m||f.blocks.Image.updateElement(a,"image",{sizes:{width:o.offsetWidth,height:o.offsetHeight}})},handleComponent:{left:m?t.jsx(t.Fragment,{}):t.jsx(qt,{position:"left"}),right:m?t.jsx(t.Fragment,{}):t.jsx(qt,{position:"right"})}}}),[x.width,x.height]);return l?t.jsx("div",Object.assign({"data-element-type":i.type,contentEditable:!1,draggable:!1,className:"yoo-image-mt-4 yoo-image-relative yoopta-image"},n,{children:t.jsxs(j,Object.assign({},v,{className:"yoo-image-mx-auto yoo-image-my-0 yoo-image-flex"},{children:[b&&t.jsx("div",{className:"yoo-image-absolute yoo-image-pointer-events-none yoo-image-inset-0 yoo-image-bg-[rgba(35,131,226,0.14)] yoo-image-z-[81] yoo-image-rounded-[3px] yoo-image-opacity-100 yoo-image-transition-opacity yoo-image-duration-150 yoo-image-ease-in"}),t.jsx(s,{src:l,alt:c,srcSet:u,fit:p,width:null==x?void 0:x.width,bgColor:d,height:null==x?void 0:x.height}),!m&&t.jsx(Gt,{block:g,editor:f,props:i.props}),r]}))})):m?null:t.jsx(Vt,Object.assign({attributes:n,blockId:a},{children:r}))},props:{src:null,alt:null,srcSet:null,bgColor:null,fit:"contain",sizes:{width:650,height:500},nodeType:"void"}}},options:{display:{title:"Image",description:"Upload from device or embed with link"},onUpload:()=>Promise.resolve({src:null,alt:null}),accept:"image/png, image/jpeg, image/gif, image/webp",maxSizes:{maxWidth:650,maxHeight:550}},parsers:{html:{deserialize:{nodeNames:["IMG"],parse:t=>{if("IMG"===t.nodeName){const o={src:t.getAttribute("src")||"",alt:t.getAttribute("alt")||"",srcSet:t.getAttribute("srcset")||"",sizes:{width:t.getAttribute("width")?parseInt(t.getAttribute("width")||"650",10):650,height:t.getAttribute("height")?parseInt(t.getAttribute("height")||"500",10):500}};return{id:e.generateId(),type:"image",children:[{text:""}],props:o}}}}}}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-image-pointer-events-none{pointer-events:none}.yoo-image-invisible{visibility:hidden}.yoo-image-absolute{position:absolute}.yoo-image-relative{position:relative}.yoo-image-inset-0{inset:0}.yoo-image-left-0{left:0}.yoo-image-right-0{right:0}.yoo-image-top-0{top:0}.yoo-image-z-10{z-index:10}.yoo-image-z-\\[100\\]{z-index:100}.yoo-image-z-\\[81\\]{z-index:81}.yoo-image-m-\\[12px_0_6px\\]{margin:12px 0 6px}.yoo-image-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-image-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-image-mx-auto{margin-left:auto;margin-right:auto}.yoo-image-my-0{margin-bottom:0;margin-top:0}.yoo-image-ml-\\[12px\\]{margin-left:12px}.yoo-image-mr-2{margin-right:.5rem}.yoo-image-mr-\\[12px\\]{margin-right:12px}.yoo-image-mt-4{margin-top:1rem}.yoo-image-mt-\\[4px\\]{margin-top:4px}.yoo-image-flex{display:flex}.yoo-image-inline-flex{display:inline-flex}.yoo-image-h-4{height:1rem}.yoo-image-h-\\[28px\\]{height:28px}.yoo-image-h-\\[32px\\]{height:32px}.yoo-image-h-\\[40px\\]{height:40px}.yoo-image-h-\\[48px\\]{height:48px}.yoo-image-h-full{height:100%}.yoo-image-max-h-\\[420px\\]{max-height:420px}.yoo-image-max-h-\\[50\\%\\]{max-height:50%}.yoo-image-w-4{width:1rem}.yoo-image-w-\\[15px\\]{width:15px}.yoo-image-w-\\[6px\\]{width:6px}.yoo-image-w-full{width:100%}.yoo-image-min-w-0{min-width:0}.yoo-image-min-w-\\[540px\\]{min-width:540px}.yoo-image-max-w-\\[300px\\]{max-width:300px}.yoo-image-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-image-flex-shrink-0{flex-shrink:0}@keyframes yoo-image-spin{to{transform:rotate(1turn)}}.yoo-image-animate-spin{animation:yoo-image-spin 1s linear infinite}.yoo-image-cursor-col-resize{cursor:col-resize}.yoo-image-cursor-pointer{cursor:pointer}.yoo-image-cursor-text{cursor:text}.yoo-image-flex-col{flex-direction:column}.yoo-image-items-center{align-items:center}.yoo-image-justify-start{justify-content:flex-start}.yoo-image-justify-center{justify-content:center}.yoo-image-overflow-hidden{overflow:hidden}.yoo-image-whitespace-nowrap{white-space:nowrap}.yoo-image-rounded-\\[20px\\]{border-radius:20px}.yoo-image-rounded-\\[3px\\]{border-radius:3px}.yoo-image-rounded-\\[4px\\]{border-radius:4px}.yoo-image-rounded-sm{border-radius:.125rem}.yoo-image-border{border-width:1px}.yoo-image-border-none{border-style:none}.yoo-image-border-\\[rgba\\(255\\,255\\,255\\,0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.yoo-image-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.yoo-image-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-image-bg-\\[hsla\\(45\\,13\\%\\,94\\%\\,\\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.yoo-image-bg-\\[rgb\\(35\\,131\\,226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.yoo-image-bg-\\[rgba\\(15\\,15\\,15\\,0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.yoo-image-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-image-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.yoo-image-bg-inherit{background-color:inherit}.yoo-image-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-image-fill-white{fill:#fff}.yoo-image-p-\\[0_8px\\]{padding:0 8px}.yoo-image-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-image-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-image-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-image-px-\\[6px\\]{padding-left:6px;padding-right:6px}.yoo-image-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-image-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-image-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-image-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-image-pb-\\[6px\\]{padding-bottom:6px}.yoo-image-pt-\\[6px\\]{padding-top:6px}.yoo-image-text-left{text-align:left}.yoo-image-text-\\[14px\\]{font-size:14px}.yoo-image-font-medium{font-weight:500}.yoo-image-leading-\\[1\\.2\\]{line-height:1.2}.yoo-image-leading-\\[120\\%\\]{line-height:120%}.yoo-image-leading-\\[20px\\]{line-height:20px}.yoo-image-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-image-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-image-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoo-image-opacity-100{opacity:1}.yoo-image-shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[inset_0_0_0_1px_hsla\\(0\\,0\\%\\,6\\%\\,\\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\,_rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\,_rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_0px_0px_1px_inset\\,_rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-duration-150{transition-duration:.15s}.yoo-image-duration-300{transition-duration:.3s}.yoo-image-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-image .yoopta-image-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-image:hover .yoopta-image-options{opacity:1}.hover\\:yoo-image-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:yoo-image-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:yoo-image-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:yoo-image-bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}"),exports.default=$t;
@@ -1,3 +1,5 @@
1
- declare const Image: any;
1
+ import { YooptaPlugin } from '@yoopta/editor';
2
+ import { ImageElementProps, ImagePluginOptions } from '../types';
3
+ declare const Image: YooptaPlugin<"image", ImageElementProps, ImagePluginOptions>;
2
4
  export { Image };
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,KAAK,KA0BT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAuB,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAItF,QAAA,MAAM,KAAK,8DAsDT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  declare const EmbedUploader: ({ blockId, onClose }: {
3
2
  blockId: any;
4
3
  onClose: any;
5
- }) => JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export { EmbedUploader };
7
6
  //# sourceMappingURL=EmbedUploader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmbedUploader.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedUploader.tsx"],"names":[],"mappings":";AAGA,QAAA,MAAM,aAAa;;;iBAqClB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"EmbedUploader.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedUploader.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa;;;6CAqClB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  onClose: () => void;
4
3
  blockId: string;
5
4
  accept?: string;
6
5
  onSetLoading: (_s: boolean) => void;
7
6
  };
8
- declare const FileUploader: ({ accept, onClose, blockId, onSetLoading }: Props) => JSX.Element;
7
+ declare const FileUploader: ({ accept, onClose, blockId, onSetLoading }: Props) => import("react/jsx-runtime").JSX.Element;
9
8
  export { FileUploader };
10
9
  //# sourceMappingURL=FileUploader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FileUploader.tsx"],"names":[],"mappings":";AAGA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,YAAY,+CAA4D,KAAK,gBAmDlF,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FileUploader.tsx"],"names":[],"mappings":"AAGA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,YAAY,+CAA4D,KAAK,4CAmDlF,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,5 +1,4 @@
1
- /// <reference types="react" />
2
- import { ImagePluginOptions } from '../types';
3
- declare const ImageRender: ({ element, attributes, children, blockId }: PluginElementRenderProps<ImagePluginOptions>) => JSX.Element;
1
+ import { PluginElementRenderProps } from '@yoopta/editor';
2
+ declare const ImageRender: ({ element, attributes, children, blockId }: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element | null;
4
3
  export { ImageRender };
5
4
  //# sourceMappingURL=Image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/ui/Image.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,QAAA,MAAM,WAAW,2GAmFhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/ui/Image.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAKzB,MAAM,gBAAgB,CAAC;AAQxB,QAAA,MAAM,WAAW,+CAAgD,wBAAwB,mDA8FxF,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { YooEditor, YooptaBlockData } from '@yoopta/editor';
3
2
  import { ImageElementProps } from '../types';
4
3
  type Props = {
@@ -6,6 +5,6 @@ type Props = {
6
5
  block: YooptaBlockData;
7
6
  props?: ImageElementProps;
8
7
  };
9
- declare const ImageBlockOptions: ({ editor, block, props: imageProps }: Props) => JSX.Element;
8
+ declare const ImageBlockOptions: ({ editor, block, props: imageProps }: Props) => import("react/jsx-runtime").JSX.Element;
10
9
  export { ImageBlockOptions };
11
10
  //# sourceMappingURL=ImageBlockOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/ImageBlockOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAuB,MAAM,UAAU,CAAC;AAIlE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,iBAAiB,yCAA0C,KAAK,gBAyFrE,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"ImageBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/ImageBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAuB,MAAM,UAAU,CAAC;AAIlE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,iBAAiB,yCAA0C,KAAK,4CAyFrE,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ImageElementProps } from '../types';
3
2
  type ImageComponentProps = Omit<ImageElementProps, 'sizes'> & {
4
3
  width: number;
@@ -6,6 +5,6 @@ type ImageComponentProps = Omit<ImageElementProps, 'sizes'> & {
6
5
  layout?: Layout;
7
6
  };
8
7
  type Layout = 'fill' | 'responsive' | 'intrinsic' | 'fixed';
9
- declare const ImageComponent: ({ width, height, src, alt, fit, bgColor, layout }: ImageComponentProps) => JSX.Element;
8
+ declare const ImageComponent: ({ width, height, src, alt, fit, bgColor, layout }: ImageComponentProps) => import("react/jsx-runtime").JSX.Element;
10
9
  export { ImageComponent, ImageComponentProps };
11
10
  //# sourceMappingURL=ImageComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageComponent.d.ts","sourceRoot":"","sources":["../../src/ui/ImageComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;AAE5D,QAAA,MAAM,cAAc,sDAAqE,mBAAmB,gBAsC3G,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"ImageComponent.d.ts","sourceRoot":"","sources":["../../src/ui/ImageComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;AAE5D,QAAA,MAAM,cAAc,sDAAqE,mBAAmB,4CAsC3G,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
@@ -6,6 +6,6 @@ type Props = {
6
6
  onClose: () => void;
7
7
  onSetLoading: (_s: boolean) => void;
8
8
  };
9
- declare const ImageUploader: ({ floatingStyles, refs, onClose, blockId, onSetLoading }: Props) => JSX.Element;
9
+ declare const ImageUploader: ({ floatingStyles, refs, onClose, blockId, onSetLoading }: Props) => import("react/jsx-runtime").JSX.Element;
10
10
  export { ImageUploader };
11
11
  //# sourceMappingURL=ImageUploader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageUploader.d.ts","sourceRoot":"","sources":["../../src/ui/ImageUploader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAIhD,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAIF,QAAA,MAAM,aAAa,6DAA8D,KAAK,gBA8CrF,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"ImageUploader.d.ts","sourceRoot":"","sources":["../../src/ui/ImageUploader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAIhD,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAIF,QAAA,MAAM,aAAa,6DAA8D,KAAK,4CA8CrF,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -5,6 +5,6 @@ type Props = {
5
5
  width?: number;
6
6
  height?: number;
7
7
  };
8
- declare const Loader: ({ className, width, height, children }: Props) => JSX.Element;
8
+ declare const Loader: ({ className, width, height, children }: Props) => import("react/jsx-runtime").JSX.Element;
9
9
  export { Loader };
10
10
  //# sourceMappingURL=Loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../src/ui/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,MAAM,2CAA4C,KAAK,gBAoB5D,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../src/ui/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,MAAM,2CAA4C,KAAK,4CAoB5D,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  declare const Placeholder: ({ attributes, children, blockId }: {
3
2
  attributes: any;
4
3
  children: any;
5
4
  blockId: any;
6
- }) => JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
7
6
  export { Placeholder };
8
7
  //# sourceMappingURL=Placeholder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../src/ui/Placeholder.tsx"],"names":[],"mappings":";AAMA,QAAA,MAAM,WAAW;;;;iBA8ChB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../src/ui/Placeholder.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,WAAW;;;;6CAuDhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  declare const Resizer: ({ position }: {
3
2
  position: any;
4
- }) => JSX.Element;
3
+ }) => import("react/jsx-runtime").JSX.Element;
5
4
  export { Resizer };
6
5
  //# sourceMappingURL=Resizer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Resizer.d.ts","sourceRoot":"","sources":["../../src/ui/Resizer.tsx"],"names":[],"mappings":";AAAA,QAAA,MAAM,OAAO;;iBASZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"Resizer.d.ts","sourceRoot":"","sources":["../../src/ui/Resizer.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO;;6CASZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,24 +1,21 @@
1
1
  {
2
2
  "name": "@yoopta/image",
3
- "version": "4.0.0-rc.0",
3
+ "version": "4.0.0-rc.10",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
7
7
  "license": "MIT",
8
8
  "private": false,
9
- "type": "module",
10
9
  "main": "dist/index.js",
11
- "module": "dist/index.js",
10
+ "module": "dist/index.es.js",
12
11
  "types": "./dist/index.d.ts",
13
12
  "files": [
14
13
  "dist/"
15
14
  ],
16
15
  "peerDependencies": {
17
- "@yoopta/editor": "=>4.0.0-rc.0",
16
+ "@yoopta/editor": "^4.0.0-rc.10",
18
17
  "react": ">=17.0.2",
19
- "react-dom": ">=17.0.2",
20
- "slate": ">=0.72.3",
21
- "slate-react": ">=0.95.0"
18
+ "react-dom": ">=17.0.2"
22
19
  },
23
20
  "publishConfig": {
24
21
  "registry": "https://registry.yarnpkg.com"
@@ -30,8 +27,8 @@
30
27
  "scripts": {
31
28
  "test": "node ./__tests__/yoopta-image.test.js",
32
29
  "start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development",
33
- "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production",
34
- "publish": "yarn build && npm publish --access public"
30
+ "prepublishOnly": "yarn build",
31
+ "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production"
35
32
  },
36
33
  "bugs": {
37
34
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
@@ -40,5 +37,6 @@
40
37
  "@floating-ui/react": "^0.26.9",
41
38
  "@radix-ui/react-icons": "^1.3.0",
42
39
  "re-resizable": "^6.9.11"
43
- }
40
+ },
41
+ "gitHead": "567acde8d698e93e42b9090db68d66d93f3cc30d"
44
42
  }