@yoopta/video 4.9.0 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{generateId as e,Blocks as o,Elements as t,useYooptaEditor as i,useYooptaPluginOptions as n,UI as r,useBlockData as s,useYooptaReadOnly as d,useBlockSelected as l,YooptaPlugin as a}from"@yoopta/editor";import{jsxs as c,jsx as p,Fragment as h}from"react/jsx-runtime";import*as u from"react";import{useState as v,useEffect as f,useRef as y,useLayoutEffect as g,forwardRef as m,createElement as w,useMemo as b}from"react";import*as x from"react-dom";import{flushSync as C}from"react-dom";function z(e,o){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&o.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)o.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(t[i[n]]=e[i[n]])}return t}function _(e,o,t,i){return new(t||(t=Promise))((function(n,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function d(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var o;e.done?n(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(s,d)}l((i=i.apply(e,o||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const R={buildVideoElements:(o,t={})=>{const i=Object.assign(Object.assign({},t.props),{nodeType:"void"});return{id:e(),type:"video",children:[{text:""}],props:i}},insertVideo:(e,t={})=>{const{at:i,focus:n,props:r}=t,s=R.buildVideoElements(e,{props:r}),d=o.buildBlockData({value:[s],type:"Video",meta:{align:"center",depth:0}});o.insertBlock(e,d.type,{focus:n,at:i,blockData:d})},deleteVideo:(e,t)=>{o.deleteBlock(e,{blockId:t})},updateVideo:(e,o,i)=>{t.updateElement(e,o,{props:i})}};function S(e,{threshold:o=0,root:t=null,rootMargin:i="0%",freezeOnceVisible:n=!1}={}){const[r,s]=v({}),d=r.isIntersecting&&n,l=([e])=>s(e);return f((()=>{const n=null==e?void 0:e.current;if(!window.IntersectionObserver||d||!n)return;const r=new IntersectionObserver(l,{threshold:o,root:t,rootMargin:i});return r.observe(n),()=>r.disconnect()}),[e,o,t,i,d]),r}const k={vimeo:function(e){var{videoId:o,children:t,attributes:i}=e,n=z(e,["videoId","children","attributes"]);const r=y(null),[s,d]=v(null),[l,a]=v(!1),{isIntersecting:h}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return f((()=>{fetch(`https://vimeo.com/api/v2/video/${o}.json`).then((e=>e.json())).then((e=>d(e[0].thumbnail_medium))).catch((()=>d(null)))}),[o]),c("div",Object.assign({},i,{ref:e=>{r.current=e,i.ref(e)},className:"yoo-video-relative"},{children:[p("img",{src:s||"",alt:"vimeo_video_preview",width:"100%",height:"100%",className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-w-full yoo-video-h-full",style:{opacity:h&&l?0:1,zIndex:h&&l?-1:0}}),h&&p("iframe",Object.assign({title:"Video Player",src:`https://player.vimeo.com/video/${o}?badge=0&byline=0&portrait=0&title=0`,frameBorder:0,allowFullScreen:!0,onLoad:()=>a(!0),className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0"},n)),t]}))},youtube:function(e){var{videoId:o,children:t,attributes:i}=e,n=z(e,["videoId","children","attributes"]);const r=y(null),[s,d]=v(!1),{isIntersecting:l}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return c("div",Object.assign({},i,{ref:e=>{r.current=e,i.ref(e)},className:"yoo-video-relative"},{children:[p("img",{src:`https://i.ytimg.com/vi/${o}/default.jpg`,alt:"youtube_video_preview",width:"100%",height:"100%",className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-w-full yoo-video-h-full",style:{opacity:l&&s?0:1,zIndex:l&&s?-1:0}}),l&&p("iframe",Object.assign({title:"Video Player",src:`https://www.youtube.com/embed/${o}`,frameBorder:0,onLoad:()=>d(!0),allowFullScreen:!0,className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0"},n)),t]}))},dailymotion:function(e){var{videoId:o,attributes:t,children:i}=e,n=z(e,["videoId","attributes","children"]);const r=y(null),[s,d]=v(null),[l,a]=v(!1),{isIntersecting:h}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return f((()=>{fetch((e=>`https://api.dailymotion.com/video/${e}?fields=thumbnail_url`)(o)).then((e=>e.json())).then((e=>d(e.thumbnail_url))).catch((()=>d(null)))}),[o]),c("div",Object.assign({},t,{ref:e=>{r.current=e,t.ref(e)},className:"yoo-video-relative"},{children:[p("img",{src:s||"",alt:"daylimotion_video_preview",width:"100%",height:"100%",className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-w-full yoo-video-h-full",style:{opacity:h&&l?0:1,zIndex:h&&l?-1:0}}),h&&p("iframe",Object.assign({title:"Dailymotion Video Player",frameBorder:0,onLoad:()=>a(!0),src:`https://www.dailymotion.com/embed/video/${o}`,allowFullScreen:!0,className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0"},n)),i]}))}},O=({width:e,height:o,src:t,bgColor:i,poster:n,provider:r,fit:s,attributes:d,children:l})=>{const a={backgroundColor:i||"transparent",objectFit:s||"contain"};if(r&&r.id&&r.type&&k[r.type]){const t=k[r.type];return p(t,Object.assign({videoId:r.id,width:e,height:o,attributes:d},{children:l}))}return c("div",Object.assign({className:"yoo-video-w-full"},d,{children:[t&&p("video",{preload:"metadata",poster:n,src:t,width:e,height:o,onDragStart:e=>e.preventDefault(),className:"yoo-video-object-cover yoo-video-w-full yoo-video-h-full",style:a,playsInline:!0,controls:!0}),l]}))};var L,j=(L=function(e,o){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])},L(e,o)},function(e,o){function t(){this.constructor=e}L(e,o),e.prototype=null===o?Object.create(o):(t.prototype=o.prototype,new t)}),N=function(){return N=Object.assign||function(e){for(var o,t=1,i=arguments.length;t<i;t++)for(var n in o=arguments[t])Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e},N.apply(this,arguments)},E={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},M={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},H={width:"20px",height:"20px",position:"absolute"},W={top:N(N({},E),{top:"-5px"}),right:N(N({},M),{left:void 0,right:"-5px"}),bottom:N(N({},E),{top:void 0,bottom:"-5px"}),left:N(N({},M),{left:"-5px"}),topRight:N(N({},H),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:N(N({},H),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:N(N({},H),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:N(N({},H),{left:"-10px",top:"-10px",cursor:"nw-resize"})},B=function(e){function o(){var o=null!==e&&e.apply(this,arguments)||this;return o.onMouseDown=function(e){o.props.onResizeStart(e,o.props.direction)},o.onTouchStart=function(e){o.props.onResizeStart(e,o.props.direction)},o}return j(o,e),o.prototype.render=function(){return u.createElement("div",{className:this.props.className||"",style:N(N({position:"absolute",userSelect:"none"},W[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},o}(u.PureComponent),P=function(){var e=function(o,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])},e(o,t)};return function(o,t){function i(){this.constructor=o}e(o,t),o.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),V=function(){return V=Object.assign||function(e){for(var o,t=1,i=arguments.length;t<i;t++)for(var n in o=arguments[t])Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e},V.apply(this,arguments)},A={width:"auto",height:"auto"},F=function(e,o,t){return Math.max(Math.min(e,t),o)},T=function(e,o){return Math.round(e/o)*o},D=function(e,o){return new RegExp(e,"i").test(o)},I=function(e){return Boolean(e.touches&&e.touches.length)},Z=function(e,o,t){void 0===t&&(t=0);var i=o.reduce((function(t,i,n){return Math.abs(i-e)<Math.abs(o[t]-e)?n:t}),0),n=Math.abs(o[i]-e);return 0===t||n<t?o[i]:e},U=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"},$=function(e,o,t,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return o*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return t*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},Y=["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"],X="__resizable_base__",G=function(e){function o(o){var t=e.call(this,o)||this;return t.ratio=1,t.resizable=null,t.parentLeft=0,t.parentTop=0,t.resizableLeft=0,t.resizableRight=0,t.resizableTop=0,t.resizableBottom=0,t.targetLeft=0,t.targetTop=0,t.appendBase=function(){if(!t.resizable||!t.window)return null;var e=t.parentNode;if(!e)return null;var o=t.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(X):o.className+=X,e.appendChild(o),o},t.removeBase=function(e){var o=t.parentNode;o&&o.removeChild(e)},t.ref=function(e){e&&(t.resizable=e)},t.state={isResizing:!1,width:void 0===(t.propsSize&&t.propsSize.width)?"auto":t.propsSize&&t.propsSize.width,height:void 0===(t.propsSize&&t.propsSize.height)?"auto":t.propsSize&&t.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},t.onResizeStart=t.onResizeStart.bind(t),t.onMouseMove=t.onMouseMove.bind(t),t.onMouseUp=t.onMouseUp.bind(t),t}return P(o,e),Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||A},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"size",{get:function(){var e=0,o=0;if(this.resizable&&this.window){var t=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:t,o="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=n}return{width:e,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"sizeStyle",{get:function(){var e=this,o=this.props.size,t=function(o){if(void 0===e.state[o]||"auto"===e.state[o])return"auto";if(e.propsSize&&e.propsSize[o]&&e.propsSize[o].toString().endsWith("%")){if(e.state[o].toString().endsWith("%"))return e.state[o].toString();var t=e.getParentSize();return Number(e.state[o].toString().replace("px",""))/t[o]*100+"%"}return U(e.state[o])};return{width:o&&void 0!==o.width&&!this.state.isResizing?U(o.width):t("width"),height:o&&void 0!==o.height&&!this.state.isResizing?U(o.height):t("height")}},enumerable:!1,configurable:!0}),o.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 o=!1,t=this.parentNode.style.flexWrap;"wrap"!==t&&(o=!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 o&&(this.parentNode.style.flexWrap=t),this.removeBase(e),i},o.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))},o.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))},o.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})}},o.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},o.prototype.createSizeForCssProperty=function(e,o){var t=this.propsSize&&this.propsSize[o];return"auto"!==this.state[o]||this.state.original[o]!==e||void 0!==t&&"auto"!==t?e:"auto"},o.prototype.calculateNewMaxFromBoundary=function(e,o){var t,i,n=this.props.boundsByDirection,r=this.state.direction,s=n&&D("left",r),d=n&&D("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(t=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=d?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(t=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=d?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(t=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=d?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return t&&Number.isFinite(t)&&(e=e&&e<t?e:t),i&&Number.isFinite(i)&&(o=o&&o<i?o:i),{maxWidth:e,maxHeight:o}},o.prototype.calculateNewSizeFromDirection=function(e,o){var t=this.props.scale||1,i=this.props.resizeRatio||1,n=this.state,r=n.direction,s=n.original,d=this.props,l=d.lockAspectRatio,a=d.lockAspectRatioExtraHeight,c=d.lockAspectRatioExtraWidth,p=s.width,h=s.height,u=a||0,v=c||0;return D("right",r)&&(p=s.width+(e-s.x)*i/t,l&&(h=(p-v)/this.ratio+u)),D("left",r)&&(p=s.width-(e-s.x)*i/t,l&&(h=(p-v)/this.ratio+u)),D("bottom",r)&&(h=s.height+(o-s.y)*i/t,l&&(p=(h-u)*this.ratio+v)),D("top",r)&&(h=s.height-(o-s.y)*i/t,l&&(p=(h-u)*this.ratio+v)),{newWidth:p,newHeight:h}},o.prototype.calculateNewSizeFromAspectRatio=function(e,o,t,i){var n=this.props,r=n.lockAspectRatio,s=n.lockAspectRatioExtraHeight,d=n.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,a=void 0===t.width||t.width<0?e:t.width,c=void 0===i.height?10:i.height,p=void 0===t.height||t.height<0?o:t.height,h=s||0,u=d||0;if(r){var v=(c-h)*this.ratio+u,f=(p-h)*this.ratio+u,y=(l-u)/this.ratio+h,g=(a-u)/this.ratio+h,m=Math.max(l,v),w=Math.min(a,f),b=Math.max(c,y),x=Math.min(p,g);e=F(e,m,w),o=F(o,b,x)}else e=F(e,l,a),o=F(o,c,p);return{newWidth:e,newHeight:o}},o.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var o=e.getBoundingClientRect();this.parentLeft=o.left,this.parentTop=o.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var t=this.props.bounds.getBoundingClientRect();this.targetLeft=t.left,this.targetTop=t.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),n=i.left,r=i.top,s=i.right,d=i.bottom;this.resizableLeft=n,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=d}},o.prototype.onResizeStart=function(e,o){if(this.resizable&&this.window){var t,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&&I(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,o,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 d=this.window.getComputedStyle(s).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",t=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:V(V({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:o,flexBasis:t};this.setState(l)}},o.prototype.onMouseMove=function(e){var o=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&I(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var t=this.props,i=t.maxWidth,n=t.maxHeight,r=t.minWidth,s=t.minHeight,d=I(e)?e.touches[0].clientX:e.clientX,l=I(e)?e.touches[0].clientY:e.clientY,a=this.state,c=a.direction,p=a.original,h=a.width,u=a.height,v=this.getParentSize(),f=function(e,o,t,i,n,r,s){return i=$(i,e.width,o,t),n=$(n,e.height,o,t),r=$(r,e.width,o,t),s=$(s,e.height,o,t),{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===s?void 0:Number(s)}}(v,this.window.innerWidth,this.window.innerHeight,i,n,r,s);i=f.maxWidth,n=f.maxHeight,r=f.minWidth,s=f.minHeight;var y=this.calculateNewSizeFromDirection(d,l),g=y.newHeight,m=y.newWidth,w=this.calculateNewMaxFromBoundary(i,n);this.props.snap&&this.props.snap.x&&(m=Z(m,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(g=Z(g,this.props.snap.y,this.props.snapGap));var b=this.calculateNewSizeFromAspectRatio(m,g,{width:w.maxWidth,height:w.maxHeight},{width:r,height:s});if(m=b.newWidth,g=b.newHeight,this.props.grid){var x=T(m,this.props.grid[0]),z=T(g,this.props.grid[1]),_=this.props.snapGap||0;m=0===_||Math.abs(x-m)<=_?x:m,g=0===_||Math.abs(z-g)<=_?z:g}var R={width:m-p.width,height:g-p.height};if(h&&"string"==typeof h)if(h.endsWith("%"))m=m/v.width*100+"%";else if(h.endsWith("vw")){m=m/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){m=m/this.window.innerHeight*100+"vh"}if(u&&"string"==typeof u)if(u.endsWith("%"))g=g/v.height*100+"%";else if(u.endsWith("vw")){g=g/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){g=g/this.window.innerHeight*100+"vh"}var S={width:this.createSizeForCssProperty(m,"width"),height:this.createSizeForCssProperty(g,"height")};"row"===this.flexDir?S.flexBasis=S.width:"column"===this.flexDir&&(S.flexBasis=S.height),C((function(){o.setState(S)})),this.props.onResize&&this.props.onResize(e,c,this.resizable,R)}},o.prototype.onMouseUp=function(e){var o=this.state,t=o.isResizing,i=o.direction,n=o.original;if(t&&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:V(V({},this.state.backgroundStyle),{cursor:"auto"})})}},o.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},o.prototype.renderResizer=function(){var e=this,o=this.props,t=o.enable,i=o.handleStyles,n=o.handleClasses,r=o.handleWrapperStyle,s=o.handleWrapperClass,d=o.handleComponent;if(!t)return null;var l=Object.keys(t).map((function(o){return!1!==t[o]?u.createElement(B,{key:o,direction:o,onResizeStart:e.onResizeStart,replaceStyles:i&&i[o],className:n&&n[o]},d&&d[o]?d[o]:null):null}));return u.createElement("div",{className:s,style:r},l)},o.prototype.render=function(){var e=this,o=Object.keys(this.props).reduce((function(o,t){return-1!==Y.indexOf(t)||(o[t]=e.props[t]),o}),{}),t=V(V(V({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&&(t.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return u.createElement(i,V({ref:this.ref,style:t,className:this.props.className},o),this.state.isResizing&&u.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},o.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},o}(u.PureComponent);function q(e){return Q(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var o;return(null==e||null==(o=e.ownerDocument)?void 0:o.defaultView)||window}function K(e){var o;return null==(o=(Q(e)?e.ownerDocument:e.document)||window.document)?void 0:o.documentElement}function Q(e){return e instanceof Node||e instanceof J(e).Node}function ee(e){return e instanceof Element||e instanceof J(e).Element}function oe(e){return e instanceof HTMLElement||e instanceof J(e).HTMLElement}function te(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof J(e).ShadowRoot)}function ie(e){const{overflow:o,overflowX:t,overflowY:i,display:n}=le(e);return/auto|scroll|overlay|hidden|clip/.test(o+i+t)&&!["inline","contents"].includes(n)}function ne(e){return["table","td","th"].includes(q(e))}function re(e){const o=se(),t=le(e);return"none"!==t.transform||"none"!==t.perspective||!!t.containerType&&"normal"!==t.containerType||!o&&!!t.backdropFilter&&"none"!==t.backdropFilter||!o&&!!t.filter&&"none"!==t.filter||["transform","perspective","filter"].some((e=>(t.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(t.contain||"").includes(e)))}function se(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function de(e){return["html","body","#document"].includes(q(e))}function le(e){return J(e).getComputedStyle(e)}function ae(e){return ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ce(e){if("html"===q(e))return e;const o=e.assignedSlot||e.parentNode||te(e)&&e.host||K(e);return te(o)?o.host:o}function pe(e){const o=ce(e);return de(o)?e.ownerDocument?e.ownerDocument.body:e.body:oe(o)&&ie(o)?o:pe(o)}function he(e,o,t){var i;void 0===o&&(o=[]),void 0===t&&(t=!0);const n=pe(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),s=J(n);return r?o.concat(s,s.visualViewport||[],ie(n)?n:[],s.frameElement&&t?he(s.frameElement):[]):o.concat(n,he(n,[],t))}const ue=Math.min,ve=Math.max,fe=Math.round,ye=e=>({x:e,y:e}),ge={left:"right",right:"left",bottom:"top",top:"bottom"},me={start:"end",end:"start"};function we(e,o,t){return ve(e,ue(o,t))}function be(e,o){return"function"==typeof e?e(o):e}function xe(e){return e.split("-")[0]}function Ce(e){return e.split("-")[1]}function ze(e){return"x"===e?"y":"x"}function _e(e){return"y"===e?"height":"width"}function Re(e){return["top","bottom"].includes(xe(e))?"y":"x"}function Se(e){return ze(Re(e))}function ke(e){return e.replace(/start|end/g,(e=>me[e]))}function Oe(e){return e.replace(/left|right|bottom|top/g,(e=>ge[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 je(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ne(e,o,t){let{reference:i,floating:n}=e;const r=Re(o),s=Se(o),d=_e(s),l=xe(o),a="y"===r,c=i.x+i.width/2-n.width/2,p=i.y+i.height/2-n.height/2,h=i[d]/2-n[d]/2;let u;switch(l){case"top":u={x:c,y:i.y-n.height};break;case"bottom":u={x:c,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:p};break;case"left":u={x:i.x-n.width,y:p};break;default:u={x:i.x,y:i.y}}switch(Ce(o)){case"start":u[s]-=h*(t&&a?-1:1);break;case"end":u[s]+=h*(t&&a?-1:1)}return u}async function Ee(e,o){var t;void 0===o&&(o={});const{x:i,y:n,platform:r,rects:s,elements:d,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:h=!1,padding:u=0}=be(o,e),v=Le(u),f=d[h?"floating"===p?"reference":"floating":p],y=je(await r.getClippingRect({element:null==(t=await(null==r.isElement?void 0:r.isElement(f)))||t?f:f.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(d.floating)),boundary:a,rootBoundary:c,strategy:l})),g="floating"===p?{...s.floating,x:i,y:n}:s.reference,m=await(null==r.getOffsetParent?void 0:r.getOffsetParent(d.floating)),w=await(null==r.isElement?void 0:r.isElement(m))&&await(null==r.getScale?void 0:r.getScale(m))||{x:1,y:1},b=je(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:g,offsetParent:m,strategy:l}):g);return{top:(y.top-b.top+v.top)/w.y,bottom:(b.bottom-y.bottom+v.bottom)/w.y,left:(y.left-b.left+v.left)/w.x,right:(b.right-y.right+v.right)/w.x}}function Me(e){const o=ue(...e.map((e=>e.left))),t=ue(...e.map((e=>e.top)));return{x:o,y:t,width:ve(...e.map((e=>e.right)))-o,height:ve(...e.map((e=>e.bottom)))-t}}const He=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(o){var t,i;const{x:n,y:r,placement:s,middlewareData:d}=o,l=await async function(e,o){const{placement:t,platform:i,elements:n}=e,r=await(null==i.isRTL?void 0:i.isRTL(n.floating)),s=xe(t),d=Ce(t),l="y"===Re(t),a=["left","top"].includes(s)?-1:1,c=r&&l?-1:1,p=be(o,e);let{mainAxis:h,crossAxis:u,alignmentAxis:v}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return d&&"number"==typeof v&&(u="end"===d?-1*v:v),l?{x:u*c,y:h*a}:{x:h*a,y:u*c}}(o,e);return s===(null==(t=d.offset)?void 0:t.placement)&&null!=(i=d.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:s}}}}};function We(e){const o=le(e);let t=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const n=oe(e),r=n?e.offsetWidth:t,s=n?e.offsetHeight:i,d=fe(t)!==r||fe(i)!==s;return d&&(t=r,i=s),{width:t,height:i,$:d}}function Be(e){return ee(e)?e:e.contextElement}function Pe(e){const o=Be(e);if(!oe(o))return ye(1);const t=o.getBoundingClientRect(),{width:i,height:n,$:r}=We(o);let s=(r?fe(t.width):t.width)/i,d=(r?fe(t.height):t.height)/n;return s&&Number.isFinite(s)||(s=1),d&&Number.isFinite(d)||(d=1),{x:s,y:d}}const Ve=ye(0);function Ae(e){const o=J(e);return se()&&o.visualViewport?{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}:Ve}function Fe(e,o,t,i){void 0===o&&(o=!1),void 0===t&&(t=!1);const n=e.getBoundingClientRect(),r=Be(e);let s=ye(1);o&&(i?ee(i)&&(s=Pe(i)):s=Pe(e));const d=function(e,o,t){return void 0===o&&(o=!1),!(!t||o&&t!==J(e))&&o}(r,t,i)?Ae(r):ye(0);let l=(n.left+d.x)/s.x,a=(n.top+d.y)/s.y,c=n.width/s.x,p=n.height/s.y;if(r){const e=J(r),o=i&&ee(i)?J(i):i;let t=e,n=t.frameElement;for(;n&&i&&o!==t;){const e=Pe(n),o=n.getBoundingClientRect(),i=le(n),r=o.left+(n.clientLeft+parseFloat(i.paddingLeft))*e.x,s=o.top+(n.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,a*=e.y,c*=e.x,p*=e.y,l+=r,a+=s,t=J(n),n=t.frameElement}}return je({width:c,height:p,x:l,y:a})}const Te=[":popover-open",":modal"];function De(e){return Te.some((o=>{try{return e.matches(o)}catch(e){return!1}}))}function Ie(e){return Fe(K(e)).left+ae(e).scrollLeft}function Ze(e,o,t){let i;if("viewport"===o)i=function(e,o){const t=J(e),i=K(e),n=t.visualViewport;let r=i.clientWidth,s=i.clientHeight,d=0,l=0;if(n){r=n.width,s=n.height;const e=se();(!e||e&&"fixed"===o)&&(d=n.offsetLeft,l=n.offsetTop)}return{width:r,height:s,x:d,y:l}}(e,t);else if("document"===o)i=function(e){const o=K(e),t=ae(e),i=e.ownerDocument.body,n=ve(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),r=ve(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let s=-t.scrollLeft+Ie(e);const d=-t.scrollTop;return"rtl"===le(i).direction&&(s+=ve(o.clientWidth,i.clientWidth)-n),{width:n,height:r,x:s,y:d}}(K(e));else if(ee(o))i=function(e,o){const t=Fe(e,!0,"fixed"===o),i=t.top+e.clientTop,n=t.left+e.clientLeft,r=oe(e)?Pe(e):ye(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:i*r.y}}(o,t);else{const t=Ae(e);i={...o,x:o.x-t.x,y:o.y-t.y}}return je(i)}function Ue(e,o){const t=ce(e);return!(t===o||!ee(t)||de(t))&&("fixed"===le(t).position||Ue(t,o))}function $e(e,o,t){const i=oe(o),n=K(o),r="fixed"===t,s=Fe(e,!0,r,o);let d={scrollLeft:0,scrollTop:0};const l=ye(0);if(i||!i&&!r)if(("body"!==q(o)||ie(n))&&(d=ae(o)),i){const e=Fe(o,!0,r,o);l.x=e.x+o.clientLeft,l.y=e.y+o.clientTop}else n&&(l.x=Ie(n));return{x:s.left+d.scrollLeft-l.x,y:s.top+d.scrollTop-l.y,width:s.width,height:s.height}}function Ye(e,o){return oe(e)&&"fixed"!==le(e).position?o?o(e):e.offsetParent:null}function Xe(e,o){const t=J(e);if(!oe(e)||De(e))return t;let i=Ye(e,o);for(;i&&ne(i)&&"static"===le(i).position;)i=Ye(i,o);return i&&("html"===q(i)||"body"===q(i)&&"static"===le(i).position&&!re(i))?t:i||function(e){let o=ce(e);for(;oe(o)&&!de(o);){if(re(o))return o;o=ce(o)}return null}(e)||t}const Ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:o,rect:t,offsetParent:i,strategy:n}=e;const r="fixed"===n,s=K(i),d=!!o&&De(o.floating);if(i===s||d&&r)return t;let l={scrollLeft:0,scrollTop:0},a=ye(1);const c=ye(0),p=oe(i);if((p||!p&&!r)&&(("body"!==q(i)||ie(s))&&(l=ae(i)),oe(i))){const e=Fe(i);a=Pe(i),c.x=e.x+i.clientLeft,c.y=e.y+i.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+c.x,y:t.y*a.y-l.scrollTop*a.y+c.y}},getDocumentElement:K,getClippingRect:function(e){let{element:o,boundary:t,rootBoundary:i,strategy:n}=e;const r=[..."clippingAncestors"===t?function(e,o){const t=o.get(e);if(t)return t;let i=he(e,[],!1).filter((e=>ee(e)&&"body"!==q(e))),n=null;const r="fixed"===le(e).position;let s=r?ce(e):e;for(;ee(s)&&!de(s);){const o=le(s),t=re(s);t||"fixed"!==o.position||(n=null),(r?!t&&!n:!t&&"static"===o.position&&n&&["absolute","fixed"].includes(n.position)||ie(s)&&!t&&Ue(e,s))?i=i.filter((e=>e!==s)):n=o,s=ce(s)}return o.set(e,i),i}(o,this._c):[].concat(t),i],s=r[0],d=r.reduce(((e,t)=>{const i=Ze(o,t,n);return e.top=ve(i.top,e.top),e.right=ue(i.right,e.right),e.bottom=ue(i.bottom,e.bottom),e.left=ve(i.left,e.left),e}),Ze(o,s,n));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}},getOffsetParent:Xe,getElementRects:async function(e){const o=this.getOffsetParent||Xe,t=this.getDimensions;return{reference:$e(e.reference,await o(e.floating),e.strategy),floating:{x:0,y:0,...await t(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:o,height:t}=We(e);return{width:o,height:t}},getScale:Pe,isElement:ee,isRTL:function(e){return"rtl"===le(e).direction}},qe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(o){const{x:t,y:i,placement:n}=o,{mainAxis:r=!0,crossAxis:s=!1,limiter:d={fn:e=>{let{x:o,y:t}=e;return{x:o,y:t}}},...l}=be(e,o),a={x:t,y:i},c=await Ee(o,l),p=Re(xe(n)),h=ze(p);let u=a[h],v=a[p];if(r){const e="y"===h?"bottom":"right";u=we(u+c["y"===h?"top":"left"],u,u-c[e])}if(s){const e="y"===p?"bottom":"right";v=we(v+c["y"===p?"top":"left"],v,v-c[e])}const f=d.fn({...o,[h]:u,[p]:v});return{...f,data:{x:f.x-t,y:f.y-i}}}}},Je=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(o){var t,i;const{placement:n,middlewareData:r,rects:s,initialPlacement:d,platform:l,elements:a}=o,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...y}=be(e,o);if(null!=(t=r.arrow)&&t.alignmentOffset)return{};const g=xe(n),m=xe(d)===d,w=await(null==l.isRTL?void 0:l.isRTL(a.floating)),b=h||(m||!f?[Oe(d)]:function(e){const o=Oe(e);return[ke(e),o,ke(o)]}(d));h||"none"===v||b.push(...function(e,o,t,i){const n=Ce(e);let r=function(e,o,t){const i=["left","right"],n=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return t?o?n:i:o?i:n;case"left":case"right":return o?r:s;default:return[]}}(xe(e),"start"===t,i);return n&&(r=r.map((e=>e+"-"+n)),o&&(r=r.concat(r.map(ke)))),r}(d,f,v,w));const x=[d,...b],C=await Ee(o,y),z=[];let _=(null==(i=r.flip)?void 0:i.overflows)||[];if(c&&z.push(C[g]),p){const e=function(e,o,t){void 0===t&&(t=!1);const i=Ce(e),n=Se(e),r=_e(n);let s="x"===n?i===(t?"end":"start")?"right":"left":"start"===i?"bottom":"top";return o.reference[r]>o.floating[r]&&(s=Oe(s)),[s,Oe(s)]}(n,s,w);z.push(C[e[0]],C[e[1]])}if(_=[..._,{placement:n,overflows:z}],!z.every((e=>e<=0))){var R,S;const e=((null==(R=r.flip)?void 0:R.index)||0)+1,o=x[e];if(o)return{data:{index:e,overflows:_},reset:{placement:o}};let t=null==(S=_.filter((e=>e.overflows[0]<=0)).sort(((e,o)=>e.overflows[1]-o.overflows[1]))[0])?void 0:S.placement;if(!t)switch(u){case"bestFit":{var k;const e=null==(k=_.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,o)=>e+o),0)])).sort(((e,o)=>e[1]-o[1]))[0])?void 0:k[0];e&&(t=e);break}case"initialPlacement":t=d}if(n!==t)return{reset:{placement:t}}}return{}}}},Ke=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(o){const{placement:t,elements:i,rects:n,platform:r,strategy:s}=o,{padding:d=2,x:l,y:a}=be(e,o),c=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),p=function(e){const o=e.slice().sort(((e,o)=>e.y-o.y)),t=[];let i=null;for(let e=0;e<o.length;e++){const n=o[e];!i||n.y-i.y>i.height/2?t.push([n]):t[t.length-1].push(n),i=n}return t.map((e=>je(Me(e))))}(c),h=je(Me(c)),u=Le(d);const v=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=l&&null!=a)return p.find((e=>l>e.left-u.left&&l<e.right+u.right&&a>e.top-u.top&&a<e.bottom+u.bottom))||h;if(p.length>=2){if("y"===Re(t)){const e=p[0],o=p[p.length-1],i="top"===xe(t),n=e.top,r=o.bottom,s=i?e.left:o.left,d=i?e.right:o.right;return{top:n,bottom:r,left:s,right:d,width:d-s,height:r-n,x:s,y:n}}const e="left"===xe(t),o=ve(...p.map((e=>e.right))),i=ue(...p.map((e=>e.left))),n=p.filter((t=>e?t.left===i:t.right===o)),r=n[0].top,s=n[n.length-1].bottom;return{top:r,bottom:s,left:i,right:o,width:o-i,height:s-r,x:i,y:r}}return h}},floating:i.floating,strategy:s});return n.reference.x!==v.reference.x||n.reference.y!==v.reference.y||n.reference.width!==v.reference.width||n.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Qe=(e,o,t)=>{const i=new Map,n={platform:Ge,...t},r={...n.platform,_c:i};return(async(e,o,t)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:s}=t,d=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(o));let a=await s.getElementRects({reference:e,floating:o,strategy:n}),{x:c,y:p}=Ne(a,i,l),h=i,u={},v=0;for(let t=0;t<d.length;t++){const{name:r,fn:f}=d[t],{x:y,y:g,data:m,reset:w}=await f({x:c,y:p,initialPlacement:i,placement:h,strategy:n,middlewareData:u,rects:a,platform:s,elements:{reference:e,floating:o}});c=null!=y?y:c,p=null!=g?g:p,u={...u,[r]:{...u[r],...m}},w&&v<=50&&(v++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(a=!0===w.rects?await s.getElementRects({reference:e,floating:o,strategy:n}):w.rects),({x:c,y:p}=Ne(a,h,l))),t=-1)}return{x:c,y:p,placement:h,strategy:n,middlewareData:u}})(e,o,{...n,platform:r})};var eo="undefined"!=typeof document?g:f;function oo(e,o){if(e===o)return!0;if(typeof e!=typeof o)return!1;if("function"==typeof e&&e.toString()===o.toString())return!0;let t,i,n;if(e&&o&&"object"==typeof e){if(Array.isArray(e)){if(t=e.length,t!==o.length)return!1;for(i=t;0!=i--;)if(!oo(e[i],o[i]))return!1;return!0}if(n=Object.keys(e),t=n.length,t!==Object.keys(o).length)return!1;for(i=t;0!=i--;)if(!{}.hasOwnProperty.call(o,n[i]))return!1;for(i=t;0!=i--;){const t=n[i];if(("_owner"!==t||!e.$$typeof)&&!oo(e[t],o[t]))return!1}return!0}return e!=e&&o!=o}function to(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function io(e,o){const t=to(e);return Math.round(o*t)/t}function no(e){const o=u.useRef(e);return eo((()=>{o.current=e})),o}const ro=u["useInsertionEffect".toString()]||(e=>e());var so="undefined"!=typeof document?g:f;let lo=!1,ao=0;const co=()=>"floating-ui-"+ao++;const po=u["useId".toString()]||function(){const[e,o]=u.useState((()=>lo?co():void 0));return so((()=>{null==e&&o(co())}),[]),u.useEffect((()=>{lo||(lo=!0)}),[]),e};const ho=u.createContext(null),uo=u.createContext(null);function vo(e){var o;void 0===e&&(e={});const{open:t=!1,onOpenChange:i,nodeId:n}=e,[r,s]=u.useState(null),d=(null==(o=e.elements)?void 0:o.reference)||r,l=function(e){void 0===e&&(e={});const{placement:o="bottom",strategy:t="absolute",middleware:i=[],platform:n,elements:{reference:r,floating:s}={},transform:d=!0,whileElementsMounted:l,open:a}=e,[c,p]=u.useState({x:0,y:0,strategy:t,placement:o,middlewareData:{},isPositioned:!1}),[h,v]=u.useState(i);oo(h,i)||v(i);const[f,y]=u.useState(null),[g,m]=u.useState(null),w=u.useCallback((e=>{e!==_.current&&(_.current=e,y(e))}),[]),b=u.useCallback((e=>{e!==R.current&&(R.current=e,m(e))}),[]),C=r||f,z=s||g,_=u.useRef(null),R=u.useRef(null),S=u.useRef(c),k=null!=l,O=no(l),L=no(n),j=u.useCallback((()=>{if(!_.current||!R.current)return;const e={placement:o,strategy:t,middleware:h};L.current&&(e.platform=L.current),Qe(_.current,R.current,e).then((e=>{const o={...e,isPositioned:!0};N.current&&!oo(S.current,o)&&(S.current=o,x.flushSync((()=>{p(o)})))}))}),[h,o,t,L]);eo((()=>{!1===a&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const N=u.useRef(!1);eo((()=>(N.current=!0,()=>{N.current=!1})),[]),eo((()=>{if(C&&(_.current=C),z&&(R.current=z),C&&z){if(O.current)return O.current(C,z,j);j()}}),[C,z,j,O,k]);const E=u.useMemo((()=>({reference:_,floating:R,setReference:w,setFloating:b})),[w,b]),M=u.useMemo((()=>({reference:C,floating:z})),[C,z]),H=u.useMemo((()=>{const e={position:t,left:0,top:0};if(!M.floating)return e;const o=io(M.floating,c.x),i=io(M.floating,c.y);return d?{...e,transform:"translate("+o+"px, "+i+"px)",...to(M.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:o,top:i}}),[t,d,M.floating,c.x,c.y]);return u.useMemo((()=>({...c,update:j,refs:E,elements:M,floatingStyles:H})),[c,j,E,M,H])}(e),a=u.useContext(uo),c=null!=((null==(p=u.useContext(ho))?void 0:p.id)||null);var p;const h=function(e){const o=u.useRef((()=>{}));return ro((()=>{o.current=e})),u.useCallback((function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return null==o.current?void 0:o.current(...t)}),[])}(((e,o,t)=>{e&&(f.current.openEvent=o),y.emit("openchange",{open:e,event:o,reason:t,nested:c}),null==i||i(e,o,t)})),v=u.useRef(null),f=u.useRef({}),y=u.useState((()=>function(){const e=new Map;return{emit(o,t){var i;null==(i=e.get(o))||i.forEach((e=>e(t)))},on(o,t){e.set(o,[...e.get(o)||[],t])},off(o,t){var i;e.set(o,(null==(i=e.get(o))?void 0:i.filter((e=>e!==t)))||[])}}}()))[0],g=po(),m=u.useCallback((e=>{const o=ee(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(o)}),[l.refs]),w=u.useCallback((e=>{(ee(e)||null===e)&&(v.current=e,s(e)),(ee(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!ee(e))&&l.refs.setReference(e)}),[l.refs]),b=u.useMemo((()=>({...l.refs,setReference:w,setPositionReference:m,domReference:v})),[l.refs,w,m]),C=u.useMemo((()=>({...l.elements,domReference:d})),[l.elements,d]),z=u.useMemo((()=>({...l,refs:b,elements:C,dataRef:f,nodeId:n,floatingId:g,events:y,open:t,onOpenChange:h})),[l,n,g,y,t,h,b,C]);return so((()=>{const e=null==a?void 0:a.nodesRef.current.find((e=>e.id===n));e&&(e.context=z)})),u.useMemo((()=>({...l,context:z,refs:b,elements:C})),[l,b,C,z])}function fo(e,o){if(null==e)return{};var t,i,n={},r=Object.keys(e);for(i=0;i<r.length;i++)t=r[i],o.indexOf(t)>=0||(n[t]=e[t]);return n}var yo=["color"],go=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,yo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H12C12.5523 13 13 12.5523 13 12V8.5C13 8.22386 12.7761 8 12.5 8C12.2239 8 12 8.22386 12 8.5V12H3V3L6.5 3C6.77614 3 7 2.77614 7 2.5C7 2.22386 6.77614 2 6.5 2H3ZM12.8536 2.14645C12.9015 2.19439 12.9377 2.24964 12.9621 2.30861C12.9861 2.36669 12.9996 2.4303 13 2.497L13 2.5V2.50049V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3.70711L6.85355 8.85355C6.65829 9.04882 6.34171 9.04882 6.14645 8.85355C5.95118 8.65829 5.95118 8.34171 6.14645 8.14645L11.2929 3H9.5C9.22386 3 9 2.77614 9 2.5C9 2.22386 9.22386 2 9.5 2H12.4999H12.5C12.5678 2 12.6324 2.01349 12.6914 2.03794C12.7504 2.06234 12.8056 2.09851 12.8536 2.14645Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),mo=["color"],wo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,mo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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"}))})),bo=["color"],xo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,bo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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"}))})),Co=["color"],zo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Co);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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"}))})),_o=["color"],Ro=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,_o);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),So=["color"],ko=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,So);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Oo=["color"],Lo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Oo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),jo=["color"],No=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,jo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M1.90321 7.29677C1.90321 10.341 4.11041 12.4147 6.58893 12.8439C6.87255 12.893 7.06266 13.1627 7.01355 13.4464C6.96444 13.73 6.69471 13.9201 6.41109 13.871C3.49942 13.3668 0.86084 10.9127 0.86084 7.29677C0.860839 5.76009 1.55996 4.55245 2.37639 3.63377C2.96124 2.97568 3.63034 2.44135 4.16846 2.03202L2.53205 2.03202C2.25591 2.03202 2.03205 1.80816 2.03205 1.53202C2.03205 1.25588 2.25591 1.03202 2.53205 1.03202L5.53205 1.03202C5.80819 1.03202 6.03205 1.25588 6.03205 1.53202L6.03205 4.53202C6.03205 4.80816 5.80819 5.03202 5.53205 5.03202C5.25591 5.03202 5.03205 4.80816 5.03205 4.53202L5.03205 2.68645L5.03054 2.68759L5.03045 2.68766L5.03044 2.68767L5.03043 2.68767C4.45896 3.11868 3.76059 3.64538 3.15554 4.3262C2.44102 5.13021 1.90321 6.10154 1.90321 7.29677ZM13.0109 7.70321C13.0109 4.69115 10.8505 2.6296 8.40384 2.17029C8.12093 2.11718 7.93465 1.84479 7.98776 1.56188C8.04087 1.27898 8.31326 1.0927 8.59616 1.14581C11.4704 1.68541 14.0532 4.12605 14.0532 7.70321C14.0532 9.23988 13.3541 10.4475 12.5377 11.3662C11.9528 12.0243 11.2837 12.5586 10.7456 12.968L12.3821 12.968C12.6582 12.968 12.8821 13.1918 12.8821 13.468C12.8821 13.7441 12.6582 13.968 12.3821 13.968L9.38205 13.968C9.10591 13.968 8.88205 13.7441 8.88205 13.468L8.88205 10.468C8.88205 10.1918 9.10591 9.96796 9.38205 9.96796C9.65819 9.96796 9.88205 10.1918 9.88205 10.468L9.88205 12.3135L9.88362 12.3123C10.4551 11.8813 11.1535 11.3546 11.7585 10.6738C12.4731 9.86976 13.0109 8.89844 13.0109 7.70321Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Eo=["color"],Mo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Eo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M4.76447 3.12199C5.63151 3.04859 6.56082 3 7.5 3C8.43918 3 9.36849 3.04859 10.2355 3.12199C11.2796 3.21037 11.9553 3.27008 12.472 3.39203C12.9425 3.50304 13.2048 3.64976 13.4306 3.88086C13.4553 3.90618 13.4902 3.94414 13.5133 3.97092C13.7126 4.20149 13.8435 4.4887 13.918 5.03283C13.9978 5.6156 14 6.37644 14 7.52493C14 8.66026 13.9978 9.41019 13.9181 9.98538C13.8439 10.5206 13.7137 10.8061 13.5125 11.0387C13.4896 11.0651 13.4541 11.1038 13.4296 11.1287C13.2009 11.3625 12.9406 11.5076 12.4818 11.6164C11.9752 11.7365 11.3143 11.7942 10.2878 11.8797C9.41948 11.9521 8.47566 12 7.5 12C6.52434 12 5.58052 11.9521 4.7122 11.8797C3.68572 11.7942 3.02477 11.7365 2.51816 11.6164C2.05936 11.5076 1.7991 11.3625 1.57037 11.1287C1.54593 11.1038 1.51035 11.0651 1.48748 11.0387C1.28628 10.8061 1.15612 10.5206 1.08193 9.98538C1.00221 9.41019 1 8.66026 1 7.52493C1 6.37644 1.00216 5.6156 1.082 5.03283C1.15654 4.4887 1.28744 4.20149 1.48666 3.97092C1.5098 3.94414 1.54468 3.90618 1.56942 3.88086C1.7952 3.64976 2.05752 3.50304 2.52796 3.39203C3.04473 3.27008 3.7204 3.21037 4.76447 3.12199ZM0 7.52493C0 5.28296 0 4.16198 0.729985 3.31713C0.766457 3.27491 0.815139 3.22194 0.854123 3.18204C1.63439 2.38339 2.64963 2.29744 4.68012 2.12555C5.56923 2.05028 6.52724 2 7.5 2C8.47276 2 9.43077 2.05028 10.3199 2.12555C12.3504 2.29744 13.3656 2.38339 14.1459 3.18204C14.1849 3.22194 14.2335 3.27491 14.27 3.31713C15 4.16198 15 5.28296 15 7.52493C15 9.74012 15 10.8477 14.2688 11.6929C14.2326 11.7348 14.1832 11.7885 14.1444 11.8281C13.3629 12.6269 12.3655 12.71 10.3709 12.8763C9.47971 12.9505 8.50782 13 7.5 13C6.49218 13 5.52028 12.9505 4.62915 12.8763C2.63446 12.71 1.63712 12.6269 0.855558 11.8281C0.816844 11.7885 0.767442 11.7348 0.731221 11.6929C0 10.8477 0 9.74012 0 7.52493ZM5.25 5.38264C5.25 5.20225 5.43522 5.08124 5.60041 5.15369L10.428 7.27105C10.6274 7.35853 10.6274 7.64147 10.428 7.72895L5.60041 9.84631C5.43522 9.91876 5.25 9.79775 5.25 9.61736V5.38264Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ho=["color"],Wo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Ho);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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 Bo={youtube:e=>{const o=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return o&&11===o[2].length?o[2]:null},vimeo:e=>new URL(e).pathname.split("/")[1],dailymotion:e=>{const o=e.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);return null!==o?void 0!==o[4]?o[4]:o[2]:null}},Po=({blockId:e,onClose:o})=>{const n=i(),[r,s]=v(""),d=0===r.length;return c("div",Object.assign({className:"yoo-video-cursor-pointer yoo-video-user-select-none yoo-video-transition-bg yoo-video-duration-20 yoo-video-ease-in yoo-video-white-space-nowrap yoo-video-w-full"},{children:[p("input",{type:"text",placeholder:"Paste video link",value:r,className:"yoo-video-items-center yoo-video-bg-[hsla(45,13%,94%,.6)] yoo-video-rounded-[4px] yoo-video-shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] yoo-video-cursor-text yoo-video-flex yoo-video-text-[14px] yoo-video-h-[32px] yoo-video-leading-[20px] yoo-video-px-[6px] yoo-video-relative yoo-video-w-full yoo-video-border-none",onChange:e=>s(e.target.value)}),p("button",Object.assign({type:"button",className:"yoopta-button yoo-video-user-select-none yoo-video-transition-bg yoo-video-duration-20 yoo-video-ease-in yoo-video-cursor-pointer yoo-video-flex yoo-video-items-center yoo-video-justify-center yoo-video-flex-shrink-0 yoo-video-white-space-nowrap yoo-video-h-[28px] yoo-video-rounded-[4px] yoo-video-shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] yoo-video-bg-[rgb(35,131,226)] yoo-video-text-white yoo-video-fill-white yoo-video-leading-[1.2] yoo-video-px-[12px] yoo-video-text-[14px] yoo-video-font-medium yoo-video-w-full yoo-video-max-w-[300px] yoo-video-mx-auto yoo-video-m-[12px_0_6px] disabled:yoo-video-bg-[rgba(35,131,226,0.5)] disabled:yoo-video-cursor-not-allowed",disabled:d,onClick:()=>{var i;if(0===r.length)return;const s=(d=r).includes("youtube.com")||d.includes("youtu.be")?"youtube":d.includes("vimeo.com")?"vimeo":d.includes("dailymotion.com")||d.includes("dai.ly")?"dailymotion":null;var d;const l=s?null===(i=Bo[s])||void 0===i?void 0:i.call(Bo,r):null;if(!s||!l)return console.warn("Unsopperted video provider or video id is not found.");t.updateElement(n,e,{type:"video",props:{src:r,provider:{type:s,id:l,url:r}}}),o()}},{children:"Embed video"}))]}))},Vo=({accept:e="video/*",onClose:o,blockId:r,onSetLoading:s})=>{const d=n("Video"),l=i();return p("div",Object.assign({className:"yoo-video-user-select-none yoo-video-transition-bg yoo-video-duration-20 yoo-video-ease-in yoo-video-white-space-nowrap yoo-video-rounded-[4px] yoo-video-h-[32px] yoo-video-px-[12px] yoo-video-border yoo-video-border-solid yoo-video-border-[rgba(55,53,47,0.16)] yoo-video-w-full yoo-video-cursor-pointer"},{children:c("label",Object.assign({htmlFor:"video-uploader",className:"yoo-video-text-[14px] yoo-video-leading-[1.2] yoo-video-font-medium yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-items-center yoo-video-justify-center yoo-video-h-full"},{children:[p("input",{type:"file",id:"video-uploader",className:"yoo-video-absolute yoo-video-left-0 yoo-video-top-0 yoo-video-invisible",accept:(null==d?void 0:d.accept)||e,onChange:e=>{const i=e.target.files[0];i&&(e=>{_(void 0,void 0,void 0,(function*(){if(!(null==d?void 0:d.onUpload))throw new Error("onUpload not provided in plugin options. Check Video.extend({}) method");o(),s(!0);try{const o=yield null==d?void 0:d.onUpload(e),i=l.plugins.Video.elements.video.props;t.updateElement(l,r,{type:"video",props:{src:o.src,sizes:o.sizes||i.sizes,bgColor:o.bgColor||i.bgColor,fit:o.fit||i.fit||"cover",settings:o.settings||i.settings,poster:o.poster||i.poster}})}catch(e){}finally{s(!1)}}))})(i)},multiple:!1}),"Upload video"]}))}))},{Overlay:Ao,Portal:Fo}=r,To=({floatingStyles:e,refs:o,onClose:t,blockId:i,onSetLoading:n})=>{const[r,s]=v("upload"),d=e=>s(e),l="upload"===r,a="embed"===r,h=e=>({borderBottom:e?"2px solid #2483e2":"2px solid transparent"});return p(Fo,Object.assign({id:"yoo-video-uploader-portal"},{children:p(Ao,Object.assign({lockScroll:!0,className:"yoo-video-z-[100]",onClick:t},{children:p("div",Object.assign({ref:o.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:c("div",Object.assign({className:"yoo-video-flex yoo-video-flex-col yoo-video-min-w-[540px] yoo-video-max-w-[calc(100vw-24px)] yoo-video-h-full yoo-video-max-h-[420px] yoo-video-bg-[#FFFFFF] yoo-video-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-video-w-full yoo-video-flex yoo-video-text-[14px] yoo-video-p-[0_8px] yoo-video-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-video-relative yoo-video-z-10 yoo-video-h-[40px]"},{children:[p("button",Object.assign({type:"button",onClick:()=>d("upload"),style:h(l),className:"yoopta-button yoo-video-py-[6px] yoo-video-whitespace-nowrap yoo-video-min-w-0 yoo-video-flex-shrink-0 yoo-video-text-[rgb(55,53,47)] yoo-video-relative yoo-video-cursor-pointer yoo-video-user-select-none yoo-video-bg-inherit yoo-video-transition-[height_20ms_ease-in] yoo-video-inline-flex yoo-video-items-center yoo-video-h-full yoo-video-text-[14px] yoo-video-leading-[1.2] yoo-video-px-[8px]"},{children:"Upload"})),p("button",Object.assign({type:"button",onClick:()=>d("embed"),style:h(a),className:"yoopta-button yoo-video-py-[6px] yoo-video-whitespace-nowrap yoo-video-min-w-0 yoo-video-flex-shrink-0 yoo-video-text-[rgb(55,53,47)] yoo-video-relative yoo-video-cursor-pointer yoo-video-user-select-none yoo-video-bg-inherit yoo-video-transition-[height_20ms_ease-in] yoo-video-inline-flex yoo-video-items-center yoo-video-h-full yoo-video-text-[14px] yoo-video-leading-[1.2] yoo-video-px-[8px]"},{children:"Video link"}))]})),c("div",Object.assign({className:"yoo-video-pt-[6px] yoo-video-pb-[6px] yoo-video-mt-[4px] yoo-video-flex yoo-video-justify-center yoo-video-mr-[12px] yoo-video-ml-[12px]"},{children:[a&&p(Po,{onClose:t,blockId:i}),l&&p(Vo,{onClose:t,blockId:i,onSetLoading:n})]}))]}))}))}))}))},Do=({className:e,width:o,height:t,children:i})=>c("div",Object.assign({className:e},{children:[i,p("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:o,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-video-h-4 yoo-video-w-4 yoo-video-animate-spin"},{children:p("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),Io={width:"100%",transition:"width 100ms ease-in"},Zo=({attributes:e,children:o,blockId:t})=>{const[i,n]=v(!1),[r,s]=v(!1),{refs:d,floatingStyles:l}=vo({placement:"bottom",open:i,onOpenChange:n,middleware:[Ke(),Je(),qe(),He(10)]});return c("div",Object.assign({className:"yoo-video-w-full yoo-video-user-select-none yoo-video-m-[20px_0_10px] yoo-video-relative yoo-video-flex"},e,{contentEditable:!1},{children:[c("button",Object.assign({type:"button",className:"yoopta-button yoo-video-p-[12px_36px_12px_12px] yoo-video-flex yoo-video-items-center yoo-video-text-left yoo-video-w-full yoo-video-overflow-hidden yoo-video-rounded-[3px] yoo-video-text-[14px] yoo-video-text-[rgba(55,53,47,0.65)] yoo-video-relative yoo-video-cursor-pointer yoo-video-border-none yoo-video-bg-[#efefef] yoo-video-transition-[background-color_100ms_ease-in] hover:yoo-video-bg-[#e3e3e3]",onClick:()=>n(!0),disabled:r,ref:d.setReference},{children:[p(r?Do:Mo,{className:"yoo-video-mr-2 yoo-video-user-select-none",width:24,height:24}),p("span",Object.assign({className:"yoo-video-font-medium"},{children:r?"Loading...":"Click to add video"})),r&&p("div",{className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-h-full yoo-video-bg-[rgba(55,53,47,0.16)]",style:Io})]})),i&&p(To,{blockId:t,floatingStyles:l,refs:d,onClose:()=>n(!1),onSetLoading:e=>s(e)}),o]}))};var Uo;function $o(){return $o=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$o.apply(this,arguments)}var Yo,Xo=function(e){return u.createElement("svg",$o({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"checkmark_svg__lucide checkmark_svg__lucide-check"},e),Uo||(Uo=u.createElement("path",{d:"M20 6 9 17l-5-5"})))};function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Go.apply(this,arguments)}var qo=function(e){return u.createElement("svg",Go({viewBox:"0 0 16 16",style:{width:16,height:16,display:"block",fill:"rgba(55,53,47,.85)",flexShrink:0}},e),Yo||(Yo=u.createElement("path",{d:"M8.215 15.126c3.862 0 7.061-3.192 7.061-7.062 0-3.862-3.199-7.061-7.068-7.061-3.862 0-7.055 3.2-7.055 7.061 0 3.87 3.2 7.062 7.062 7.062zm0-1.388a5.654 5.654 0 0 1-5.667-5.674 5.642 5.642 0 0 1 5.66-5.667 5.66 5.66 0 0 1 5.68 5.667 5.66 5.66 0 0 1-5.673 5.674zm0-9.174c-.342 0-.602.247-.602.588v3.234l.062 1.401-.622-.766-.766-.8a.557.557 0 0 0-.41-.177.54.54 0 0 0-.56.547c0 .164.054.3.163.41l2.256 2.283c.15.157.294.226.479.226.191 0 .335-.075.485-.226l2.256-2.283a.557.557 0 0 0 .164-.41.539.539 0 0 0-.56-.547.523.523 0 0 0-.41.178l-.766.793-.622.779.054-1.408V5.152c0-.341-.253-.588-.601-.588z"})))};const Jo={left:ko,center:Ro,right:Lo},{ExtendedBlockActions:Ko,BlockOptionsMenuGroup:Qo,BlockOptionsMenuItem:et,BlockOptionsSeparator:ot}=r,tt={poster:!1,video:!1},it=({editor:e,block:i,props:r})=>{var s,d;const l=n("Video"),[a,u]=v(tt),f=(e,o)=>u((t=>Object.assign(Object.assign({},t),{[e]:o}))),y=!!(null===(s=null==r?void 0:r.provider)||void 0===s?void 0:s.id),g=(null===(d=null==i?void 0:i.meta)||void 0===d?void 0:d.align)||"center",m=Jo[g];return c(Ko,Object.assign({onClick:()=>e.setPath({current:i.meta.order}),id:"yoopta-video-options"},{children:[p(ot,{}),!y&&c(h,{children:[c(Qo,{children:[p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-video-justify-between",onClick:()=>{t.updateElement(e,i.id,{type:"video",props:{fit:"contain"}})}},{children:[c("span",Object.assign({className:"yoo-video-flex"},{children:[p(xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Fit"]})),"contain"===(null==r?void 0:r.fit)&&p(Xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4"})]}))}),p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-video-justify-between",onClick:()=>{t.updateElement(e,i.id,{type:"video",props:{fit:"fill"}})}},{children:[c("span",Object.assign({className:"yoo-video-flex"},{children:[p(Wo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Fill"]})),"fill"===(null==r?void 0:r.fit)&&p(Xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4"})]}))}),p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-video-justify-between",onClick:()=>{t.updateElement(e,i.id,{type:"video",props:{fit:"cover"}})}},{children:[c("span",Object.assign({className:"yoo-video-flex"},{children:[p(zo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Cover"]})),"cover"===(null==r?void 0:r.fit)&&p(Xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4"})]}))})]}),p(ot,{})]}),!y&&c(h,{children:[c(Qo,{children:[p(et,{children:c("label",Object.assign({htmlFor:"video-uploader",className:"yoo-video-rounded-sm yoo-video-relative hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start data-[disabled=true]:yoo-video-cursor-not-allowed data-[disabled=true]:yoo-video-pointer-events-none data-[disabled=true]:yoo-video-opacity-50","data-disabled":a.video},{children:[p("input",{type:"file",accept:l.accept,multiple:!1,id:"video-uploader",className:"yoo-video-absolute yoo-video-hidden",onChange:o=>_(void 0,void 0,void 0,(function*(){var n;if(!(null==l?void 0:l.onUpload))throw new Error("onUpload not provided in plugin options. Check Video.extend({}) method");const s=null===(n=o.target.files)||void 0===n?void 0:n[0];if(!s)return;f("video",!0);const d=yield null==l?void 0:l.onUpload(s),a=e.plugins.Video.elements.video.props;t.updateElement(e,i.id,{type:"video",props:{src:d.src,sizes:d.sizes||a.sizes,bgColor:d.bgColor||a.bgColor,fit:(null==r?void 0:r.fit)||d.fit||a.fit||"cover",settings:(null==r?void 0:r.settings)||d.settings||a.settings}}),f("video",!1)})),disabled:a.video}),a.video?p(Do,{className:"yoo-video-mr-2 yoo-video-user-select-none",width:24,height:24}):p(No,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Replace video"]}))}),l.onUploadPoster&&p(et,{children:c("label",Object.assign({htmlFor:"video-poster-uploader",className:"yoo-video-rounded-sm yoo-video-relative hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start data-[disabled=true]:yoo-video-cursor-not-allowed data-[disabled=true]:yoo-video-pointer-events-none data-[disabled=true]:yoo-video-opacity-50","data-disabled":a.poster},{children:[p("input",{type:"file",accept:"image/*",multiple:!1,id:"video-poster-uploader",className:"yoo-video-absolute yoo-video-hidden",onChange:o=>_(void 0,void 0,void 0,(function*(){var n,r;if(!(null==l?void 0:l.onUploadPoster))throw new Error("onUploadPoster not provided in plugin options. Check Video.extend({}) method");const s=null===(n=o.target.files)||void 0===n?void 0:n[0];if(!s)return;f("poster",!0);const d=yield null===(r=l.onUploadPoster)||void 0===r?void 0:r.call(l,s);t.updateElement(e,i.id,{type:"video",props:{poster:d}}),f("poster",!1)})),disabled:a.poster}),a.poster?p(Do,{className:"yoo-video-mr-2 yoo-video-user-select-none",width:24,height:24}):p(wo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),(null==r?void 0:r.poster)?"Replace poster":"Add poster"]}))})]}),p(ot,{})]}),c(Qo,{children:[p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-button yoo-video-rounded-sm hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start",onClick:()=>{const t=["left","center","right"];if(!i)return;const n=t[(t.indexOf(g)+1)%t.length];o.updateBlock(e,i.id,{meta:Object.assign(Object.assign({},i.meta),{align:n})})}},{children:[p(m,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Alignment"]}))}),p(et,{children:p("button",Object.assign({type:"button",className:"yoopta-button yoo-video-rounded-sm hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start",onClick:y?()=>{var e,o;(null===(e=null==r?void 0:r.provider)||void 0===e?void 0:e.url)&&window.open(null===(o=null==r?void 0:r.provider)||void 0===o?void 0:o.url,"_blank")}:()=>{if(!r||!r.src||y)return;const e=document.createElement("a");e.href=r.src,e.download=r.src,e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},{children:c(h,y?{children:[p(go,{width:16,height:16,className:"yoo-embed-w-4 yoo-embed-h-4 yoo-embed-mr-2"}),"Open"]}:{children:[p(qo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Download"]})}))})]})]}))},nt=({position:e})=>p("div",Object.assign({contentEditable:!1,className:"yoo-video-absolute yoo-video-pointer-events-none yoo-video-flex yoo-video-items-center yoo-video-justify-center yoo-video-z-10 yoo-video-opacity-1 yoo-video-h-full yoo-video-w-[15px] yoo-video-cursor-col-resize yoo-video-transition-opacity yoo-video-duration-150 yoo-video-ease-in "+("left"===e?"yoo-video-left-0 yoo-video-top-0":"yoo-video-right-0 yoo-video-top-0")},{children:p("div",{className:"yoo-video-opacity-100 yoo-video-transition-opacity yoo-video-duration-300 yoo-video-ease-in yoo-video-rounded-[20px] yoo-video-bg-[rgba(15,15,15,0.6)] yoo-video-border yoo-video-border-solid yoo-video-border-[rgba(255,255,255,0.9)] yoo-video-w-[6px] yoo-video-h-[48px] yoo-video-max-h-[50%] yoo-video-shadow-[0_0_0_.5px_#FFF]"})})),rt={left:"flex-start",center:"center",right:"flex-end"},st=new a({type:"Video",elements:{video:{render:e=>{var o,{extendRender:r}=e,a=z(e,["extendRender"]);const{element:h,blockId:u,attributes:y,children:g}=a,{src:m,srcSet:w,bgColor:x,settings:C,sizes:_,poster:R,provider:S,fit:k}=h.props||{},L=s(u),j=i(),N=n("Video"),E=d(),[M,H]=v({width:(null==_?void 0:_.width)||750,height:(null==_?void 0:_.height)||440});f((()=>H({width:(null==_?void 0:_.width)||650,height:(null==_?void 0:_.height)||440})),[h.props]);const W=l({blockId:u}),B=b((()=>{var e,o;return{minWidth:300,size:{width:M.width,height:M.height},maxWidth:(null===(e=null==N?void 0:N.maxSizes)||void 0===e?void 0:e.maxWidth)||800,maxHeight:(null===(o=null==N?void 0:N.maxSizes)||void 0===o?void 0:o.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!E,right:!E},handleStyles:{left:{left:0},right:{right:0}},onResize:(e,o,t)=>{H({width:t.offsetWidth,height:t.offsetHeight})},onResizeStop:(e,o,i)=>{t.updateElement(j,u,{type:"video",props:{sizes:{width:i.offsetWidth,height:i.offsetHeight}}})},handleComponent:{left:p(nt,{position:"left"}),right:p(nt,{position:"right"})}}}),[M.width,M.height]);if(!m)return p(Zo,Object.assign({attributes:y,blockId:u},{children:g}));const P=`yoopta-align-${(null===(o=null==L?void 0:L.meta)||void 0===o?void 0:o.align)||"center"}`;return p("div",Object.assign({contentEditable:!1,draggable:!1,className:`yoo-video-mt-4 yoo-video-relative yoo-video-flex ${P} yoopta-video`},{children:c(G,Object.assign({},B,{className:"yoo-video-my-0 yoo-video-flex"},{children:[W&&p("div",{className:"yoo-video-absolute yoo-video-pointer-events-none yoo-video-inset-0 yoo-video-bg-[rgba(35,131,226,0.14)] yoo-video-z-[81] yoo-video-rounded-[3px] yoo-video-opacity-100 yoo-video-transition-opacity yoo-video-duration-150 yoo-video-ease-in"}),r?r(a):p(O,Object.assign({src:m,srcSet:w,width:null==M?void 0:M.width,settings:C,bgColor:x,height:null==M?void 0:M.height,poster:R,provider:S,fit:k,attributes:y},{children:g})),!E&&p(it,{block:L,editor:j,settings:C,props:h.props})]}))}))},props:{src:null,srcSet:null,bgColor:null,sizes:{width:650,height:400},nodeType:"void",fit:"cover",provider:{type:null,id:""},settings:{controls:!1,loop:!0,muted:!0,autoPlay:!0}}}},options:{accept:"video/*",maxSizes:{maxWidth:650,maxHeight:550},onUpload:()=>_(void 0,void 0,void 0,(function*(){return Promise.resolve({src:""})})),display:{title:"Video",description:"Upload from device, embed from Youtube, Vimeo"}},commands:R,parsers:{html:{deserialize:{nodeNames:["VIDEO"],parse:o=>{if("VIDEO"===o.nodeName){const t=o.getAttribute("src"),i=o.getAttribute("srcset"),n=o.getAttribute("bgcolor"),r={width:o.getAttribute("width"),height:o.getAttribute("height")},s=o.getAttribute("controls"),d=o.getAttribute("loop"),l=o.getAttribute("muted"),a=o.getAttribute("autoplay"),c={src:t,srcSet:i,bgColor:n,sizes:r,fit:o.getAttribute("objectFit")||"cover",settings:{controls:!!s,loop:!!d,muted:!!l,autoPlay:!!a}};return{id:e(),type:"video",children:[{text:""}],props:c}}}},serialize:(e,o,t)=>{const{align:i="center",depth:n=0}=t||{};return`\n <div style="margin-left: ${n}px; display: flex; width: 100%; justify-content: "${rt[i]||"center"}"">\n <video data-meta-align="${i}" data-meta-depth="${n}" src="${e.props.src}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" controls="${e.props.settings.controls}" loop="${e.props.settings.loop}" muted="${e.props.settings.muted}" autoplay="${e.props.settings.autoPlay}" style="margin: 0 auto;" objectFit="${e.props.fit}" />\n </div>`}},markdown:{serialize:(e,o)=>`\n`}}});!function(e,o){void 0===o&&(o={});var t=o.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-video-pointer-events-none{pointer-events:none}.yoo-video-invisible{visibility:hidden}.yoo-video-absolute{position:absolute}.yoo-video-relative{position:relative}.yoo-video-inset-0{inset:0}.yoo-video-left-0{left:0}.yoo-video-right-0{right:0}.yoo-video-top-0{top:0}.yoo-video-z-10{z-index:10}.yoo-video-z-\\[100\\]{z-index:100}.yoo-video-z-\\[81\\]{z-index:81}.yoo-video-m-\\[12px_0_6px\\]{margin:12px 0 6px}.yoo-video-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-video-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-video-mx-auto{margin-left:auto;margin-right:auto}.yoo-video-my-0{margin-bottom:0;margin-top:0}.yoo-video-ml-\\[12px\\]{margin-left:12px}.yoo-video-mr-2{margin-right:.5rem}.yoo-video-mr-\\[12px\\]{margin-right:12px}.yoo-video-mt-4{margin-top:1rem}.yoo-video-mt-\\[4px\\]{margin-top:4px}.yoo-video-flex{display:flex}.yoo-video-inline-flex{display:inline-flex}.yoo-video-hidden{display:none}.yoo-video-h-4{height:1rem}.yoo-video-h-\\[28px\\]{height:28px}.yoo-video-h-\\[32px\\]{height:32px}.yoo-video-h-\\[40px\\]{height:40px}.yoo-video-h-\\[48px\\]{height:48px}.yoo-video-h-full{height:100%}.yoo-video-max-h-\\[420px\\]{max-height:420px}.yoo-video-max-h-\\[50\\%\\]{max-height:50%}.yoo-video-w-4{width:1rem}.yoo-video-w-\\[15px\\]{width:15px}.yoo-video-w-\\[6px\\]{width:6px}.yoo-video-w-full{width:100%}.yoo-video-min-w-0{min-width:0}.yoo-video-min-w-\\[540px\\]{min-width:540px}.yoo-video-max-w-\\[300px\\]{max-width:300px}.yoo-video-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-video-flex-shrink-0{flex-shrink:0}@keyframes yoo-video-spin{to{transform:rotate(1turn)}}.yoo-video-animate-spin{animation:yoo-video-spin 1s linear infinite}.yoo-video-cursor-col-resize{cursor:col-resize}.yoo-video-cursor-pointer{cursor:pointer}.yoo-video-cursor-text{cursor:text}.yoo-video-flex-col{flex-direction:column}.yoo-video-items-center{align-items:center}.yoo-video-justify-start{justify-content:flex-start}.yoo-video-justify-center{justify-content:center}.yoo-video-justify-between{justify-content:space-between}.yoo-video-overflow-hidden{overflow:hidden}.yoo-video-whitespace-nowrap{white-space:nowrap}.yoo-video-rounded-\\[20px\\]{border-radius:20px}.yoo-video-rounded-\\[3px\\]{border-radius:3px}.yoo-video-rounded-\\[4px\\]{border-radius:4px}.yoo-video-rounded-sm{border-radius:.125rem}.yoo-video-border{border-width:1px}.yoo-video-border-solid{border-style:solid}.yoo-video-border-none{border-style:none}.yoo-video-border-\\[rgba\\(255\\,255\\,255\\,0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.yoo-video-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.yoo-video-bg-\\[\\#FFFFFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-video-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-video-bg-\\[hsla\\(45\\,13\\%\\,94\\%\\,\\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.yoo-video-bg-\\[rgb\\(35\\,131\\,226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.yoo-video-bg-\\[rgba\\(15\\,15\\,15\\,0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.yoo-video-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-video-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.yoo-video-bg-inherit{background-color:inherit}.yoo-video-fill-white{fill:#fff}.yoo-video-object-cover{-o-object-fit:cover;object-fit:cover}.yoo-video-p-\\[0_8px\\]{padding:0 8px}.yoo-video-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-video-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-video-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-video-px-\\[6px\\]{padding-left:6px;padding-right:6px}.yoo-video-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-video-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-video-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-video-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-video-pb-\\[6px\\]{padding-bottom:6px}.yoo-video-pt-\\[6px\\]{padding-top:6px}.yoo-video-text-left{text-align:left}.yoo-video-text-\\[14px\\]{font-size:14px}.yoo-video-font-medium{font-weight:500}.yoo-video-leading-\\[1\\.2\\]{line-height:1.2}.yoo-video-leading-\\[120\\%\\]{line-height:120%}.yoo-video-leading-\\[20px\\]{line-height:20px}.yoo-video-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-video-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-video-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoo-video-opacity-100{opacity:1}.yoo-video-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-video-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-video-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-video-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-video-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-video-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-video-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-video-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-video-duration-150{transition-duration:.15s}.yoo-video-duration-300{transition-duration:.3s}.yoo-video-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-video .yoopta-video-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-video:hover .yoopta-video-options{opacity:1}.hover\\:yoo-video-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:yoo-video-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:yoo-video-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:yoo-video-bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}.data-\\[disabled\\=true\\]\\:yoo-video-pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\[disabled\\=true\\]\\:yoo-video-cursor-not-allowed[data-disabled=true]{cursor:not-allowed}.data-\\[disabled\\=true\\]\\:yoo-video-opacity-50[data-disabled=true]{opacity:.5}");export{R as VideoCommands,st as default};
|
|
1
|
+
import{generateId as e,Blocks as o,Elements as t,useYooptaEditor as i,useYooptaPluginOptions as n,UI as r,useBlockData as s,useYooptaReadOnly as d,useBlockSelected as l,YooptaPlugin as a}from"@yoopta/editor";import{jsxs as c,jsx as p,Fragment as h}from"react/jsx-runtime";import*as u from"react";import{useState as v,useEffect as f,useRef as y,useLayoutEffect as g,forwardRef as m,createElement as w,useMemo as b}from"react";import*as x from"react-dom";import{flushSync as C}from"react-dom";function z(e,o){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&o.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)o.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(t[i[n]]=e[i[n]])}return t}function _(e,o,t,i){return new(t||(t=Promise))((function(n,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function d(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var o;e.done?n(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(s,d)}l((i=i.apply(e,o||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const R={buildVideoElements:(o,t={})=>{const i=Object.assign(Object.assign({},t.props),{nodeType:"void"});return{id:e(),type:"video",children:[{text:""}],props:i}},insertVideo:(e,t={})=>{const{at:i,focus:n,props:r}=t,s=R.buildVideoElements(e,{props:r}),d=o.buildBlockData({value:[s],type:"Video",meta:{align:"center",depth:0}});o.insertBlock(e,d.type,{focus:n,at:i,blockData:d})},deleteVideo:(e,t)=>{o.deleteBlock(e,{blockId:t})},updateVideo:(e,o,i)=>{t.updateElement(e,o,{props:i})}};function S(e,{threshold:o=0,root:t=null,rootMargin:i="0%",freezeOnceVisible:n=!1}={}){const[r,s]=v({}),d=r.isIntersecting&&n,l=([e])=>s(e);return f((()=>{const n=null==e?void 0:e.current;if(!window.IntersectionObserver||d||!n)return;const r=new IntersectionObserver(l,{threshold:o,root:t,rootMargin:i});return r.observe(n),()=>r.disconnect()}),[e,o,t,i,d]),r}const k={vimeo:function(e){var{videoId:o,children:t,attributes:i}=e,n=z(e,["videoId","children","attributes"]);const r=y(null),[s,d]=v(null),[l,a]=v(!1),{isIntersecting:h}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return f((()=>{fetch(`https://vimeo.com/api/v2/video/${o}.json`).then((e=>e.json())).then((e=>d(e[0].thumbnail_medium))).catch((()=>d(null)))}),[o]),c("div",Object.assign({},i,{ref:e=>{r.current=e,i.ref(e)},className:"yoo-video-relative"},{children:[p("img",{src:s||"",alt:"vimeo_video_preview",width:"100%",height:"100%",className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-w-full yoo-video-h-full",style:{opacity:h&&l?0:1,zIndex:h&&l?-1:0}}),h&&p("iframe",Object.assign({title:"Video Player",src:`https://player.vimeo.com/video/${o}?badge=0&byline=0&portrait=0&title=0`,frameBorder:0,allowFullScreen:!0,onLoad:()=>a(!0),className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0"},n)),t]}))},youtube:function(e){var{videoId:o,children:t,attributes:i}=e,n=z(e,["videoId","children","attributes"]);const r=y(null),[s,d]=v(!1),{isIntersecting:l}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return c("div",Object.assign({},i,{ref:e=>{r.current=e,i.ref(e)},className:"yoo-video-relative"},{children:[p("img",{src:`https://i.ytimg.com/vi/${o}/default.jpg`,alt:"youtube_video_preview",width:"100%",height:"100%",className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-w-full yoo-video-h-full",style:{opacity:l&&s?0:1,zIndex:l&&s?-1:0}}),l&&p("iframe",Object.assign({title:"Video Player",src:`https://www.youtube.com/embed/${o}`,frameBorder:0,onLoad:()=>d(!0),allowFullScreen:!0,className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0"},n)),t]}))},dailymotion:function(e){var{videoId:o,attributes:t,children:i}=e,n=z(e,["videoId","attributes","children"]);const r=y(null),[s,d]=v(null),[l,a]=v(!1),{isIntersecting:h}=S(r,{freezeOnceVisible:!0,rootMargin:"50%"});return f((()=>{fetch((e=>`https://api.dailymotion.com/video/${e}?fields=thumbnail_url`)(o)).then((e=>e.json())).then((e=>d(e.thumbnail_url))).catch((()=>d(null)))}),[o]),c("div",Object.assign({},t,{ref:e=>{r.current=e,t.ref(e)},className:"yoo-video-relative"},{children:[p("img",{src:s||"",alt:"daylimotion_video_preview",width:"100%",height:"100%",className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-w-full yoo-video-h-full",style:{opacity:h&&l?0:1,zIndex:h&&l?-1:0}}),h&&p("iframe",Object.assign({title:"Dailymotion Video Player",frameBorder:0,onLoad:()=>a(!0),src:`https://www.dailymotion.com/embed/video/${o}`,allowFullScreen:!0,className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0"},n)),i]}))}},O=({width:e,height:o,src:t,bgColor:i,poster:n,provider:r,fit:s,attributes:d,children:l})=>{const a={backgroundColor:i||"transparent",objectFit:s||"contain"};if(r&&r.id&&r.type&&k[r.type]){const t=k[r.type];return p(t,Object.assign({videoId:r.id,width:e,height:o,attributes:d},{children:l}))}return c("div",Object.assign({className:"yoo-video-w-full"},d,{children:[t&&p("video",{preload:"metadata",poster:n,src:t,width:e,height:o,onDragStart:e=>e.preventDefault(),className:"yoo-video-object-cover yoo-video-w-full yoo-video-h-full",style:a,playsInline:!0,controls:!0}),l]}))};var L,j=(L=function(e,o){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])},L(e,o)},function(e,o){function t(){this.constructor=e}L(e,o),e.prototype=null===o?Object.create(o):(t.prototype=o.prototype,new t)}),N=function(){return N=Object.assign||function(e){for(var o,t=1,i=arguments.length;t<i;t++)for(var n in o=arguments[t])Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e},N.apply(this,arguments)},E={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},M={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},H={width:"20px",height:"20px",position:"absolute"},W={top:N(N({},E),{top:"-5px"}),right:N(N({},M),{left:void 0,right:"-5px"}),bottom:N(N({},E),{top:void 0,bottom:"-5px"}),left:N(N({},M),{left:"-5px"}),topRight:N(N({},H),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:N(N({},H),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:N(N({},H),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:N(N({},H),{left:"-10px",top:"-10px",cursor:"nw-resize"})},B=function(e){function o(){var o=null!==e&&e.apply(this,arguments)||this;return o.onMouseDown=function(e){o.props.onResizeStart(e,o.props.direction)},o.onTouchStart=function(e){o.props.onResizeStart(e,o.props.direction)},o}return j(o,e),o.prototype.render=function(){return u.createElement("div",{className:this.props.className||"",style:N(N({position:"absolute",userSelect:"none"},W[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},o}(u.PureComponent),P=function(){var e=function(o,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])},e(o,t)};return function(o,t){function i(){this.constructor=o}e(o,t),o.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),V=function(){return V=Object.assign||function(e){for(var o,t=1,i=arguments.length;t<i;t++)for(var n in o=arguments[t])Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e},V.apply(this,arguments)},A={width:"auto",height:"auto"},F=function(e,o,t){return Math.max(Math.min(e,t),o)},T=function(e,o){return Math.round(e/o)*o},D=function(e,o){return new RegExp(e,"i").test(o)},I=function(e){return Boolean(e.touches&&e.touches.length)},Z=function(e,o,t){void 0===t&&(t=0);var i=o.reduce((function(t,i,n){return Math.abs(i-e)<Math.abs(o[t]-e)?n:t}),0),n=Math.abs(o[i]-e);return 0===t||n<t?o[i]:e},U=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"},$=function(e,o,t,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return o*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return t*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},Y=["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"],X="__resizable_base__",G=function(e){function o(o){var t=e.call(this,o)||this;return t.ratio=1,t.resizable=null,t.parentLeft=0,t.parentTop=0,t.resizableLeft=0,t.resizableRight=0,t.resizableTop=0,t.resizableBottom=0,t.targetLeft=0,t.targetTop=0,t.appendBase=function(){if(!t.resizable||!t.window)return null;var e=t.parentNode;if(!e)return null;var o=t.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(X):o.className+=X,e.appendChild(o),o},t.removeBase=function(e){var o=t.parentNode;o&&o.removeChild(e)},t.ref=function(e){e&&(t.resizable=e)},t.state={isResizing:!1,width:void 0===(t.propsSize&&t.propsSize.width)?"auto":t.propsSize&&t.propsSize.width,height:void 0===(t.propsSize&&t.propsSize.height)?"auto":t.propsSize&&t.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},t.onResizeStart=t.onResizeStart.bind(t),t.onMouseMove=t.onMouseMove.bind(t),t.onMouseUp=t.onMouseUp.bind(t),t}return P(o,e),Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||A},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"size",{get:function(){var e=0,o=0;if(this.resizable&&this.window){var t=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:t,o="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=n}return{width:e,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"sizeStyle",{get:function(){var e=this,o=this.props.size,t=function(o){if(void 0===e.state[o]||"auto"===e.state[o])return"auto";if(e.propsSize&&e.propsSize[o]&&e.propsSize[o].toString().endsWith("%")){if(e.state[o].toString().endsWith("%"))return e.state[o].toString();var t=e.getParentSize();return Number(e.state[o].toString().replace("px",""))/t[o]*100+"%"}return U(e.state[o])};return{width:o&&void 0!==o.width&&!this.state.isResizing?U(o.width):t("width"),height:o&&void 0!==o.height&&!this.state.isResizing?U(o.height):t("height")}},enumerable:!1,configurable:!0}),o.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 o=!1,t=this.parentNode.style.flexWrap;"wrap"!==t&&(o=!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 o&&(this.parentNode.style.flexWrap=t),this.removeBase(e),i},o.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))},o.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))},o.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})}},o.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},o.prototype.createSizeForCssProperty=function(e,o){var t=this.propsSize&&this.propsSize[o];return"auto"!==this.state[o]||this.state.original[o]!==e||void 0!==t&&"auto"!==t?e:"auto"},o.prototype.calculateNewMaxFromBoundary=function(e,o){var t,i,n=this.props.boundsByDirection,r=this.state.direction,s=n&&D("left",r),d=n&&D("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(t=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=d?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(t=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=d?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(t=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=d?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return t&&Number.isFinite(t)&&(e=e&&e<t?e:t),i&&Number.isFinite(i)&&(o=o&&o<i?o:i),{maxWidth:e,maxHeight:o}},o.prototype.calculateNewSizeFromDirection=function(e,o){var t=this.props.scale||1,i=this.props.resizeRatio||1,n=this.state,r=n.direction,s=n.original,d=this.props,l=d.lockAspectRatio,a=d.lockAspectRatioExtraHeight,c=d.lockAspectRatioExtraWidth,p=s.width,h=s.height,u=a||0,v=c||0;return D("right",r)&&(p=s.width+(e-s.x)*i/t,l&&(h=(p-v)/this.ratio+u)),D("left",r)&&(p=s.width-(e-s.x)*i/t,l&&(h=(p-v)/this.ratio+u)),D("bottom",r)&&(h=s.height+(o-s.y)*i/t,l&&(p=(h-u)*this.ratio+v)),D("top",r)&&(h=s.height-(o-s.y)*i/t,l&&(p=(h-u)*this.ratio+v)),{newWidth:p,newHeight:h}},o.prototype.calculateNewSizeFromAspectRatio=function(e,o,t,i){var n=this.props,r=n.lockAspectRatio,s=n.lockAspectRatioExtraHeight,d=n.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,a=void 0===t.width||t.width<0?e:t.width,c=void 0===i.height?10:i.height,p=void 0===t.height||t.height<0?o:t.height,h=s||0,u=d||0;if(r){var v=(c-h)*this.ratio+u,f=(p-h)*this.ratio+u,y=(l-u)/this.ratio+h,g=(a-u)/this.ratio+h,m=Math.max(l,v),w=Math.min(a,f),b=Math.max(c,y),x=Math.min(p,g);e=F(e,m,w),o=F(o,b,x)}else e=F(e,l,a),o=F(o,c,p);return{newWidth:e,newHeight:o}},o.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var o=e.getBoundingClientRect();this.parentLeft=o.left,this.parentTop=o.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var t=this.props.bounds.getBoundingClientRect();this.targetLeft=t.left,this.targetTop=t.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),n=i.left,r=i.top,s=i.right,d=i.bottom;this.resizableLeft=n,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=d}},o.prototype.onResizeStart=function(e,o){if(this.resizable&&this.window){var t,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&&I(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,o,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 d=this.window.getComputedStyle(s).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",t=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:V(V({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:o,flexBasis:t};this.setState(l)}},o.prototype.onMouseMove=function(e){var o=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&I(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var t=this.props,i=t.maxWidth,n=t.maxHeight,r=t.minWidth,s=t.minHeight,d=I(e)?e.touches[0].clientX:e.clientX,l=I(e)?e.touches[0].clientY:e.clientY,a=this.state,c=a.direction,p=a.original,h=a.width,u=a.height,v=this.getParentSize(),f=function(e,o,t,i,n,r,s){return i=$(i,e.width,o,t),n=$(n,e.height,o,t),r=$(r,e.width,o,t),s=$(s,e.height,o,t),{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===s?void 0:Number(s)}}(v,this.window.innerWidth,this.window.innerHeight,i,n,r,s);i=f.maxWidth,n=f.maxHeight,r=f.minWidth,s=f.minHeight;var y=this.calculateNewSizeFromDirection(d,l),g=y.newHeight,m=y.newWidth,w=this.calculateNewMaxFromBoundary(i,n);this.props.snap&&this.props.snap.x&&(m=Z(m,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(g=Z(g,this.props.snap.y,this.props.snapGap));var b=this.calculateNewSizeFromAspectRatio(m,g,{width:w.maxWidth,height:w.maxHeight},{width:r,height:s});if(m=b.newWidth,g=b.newHeight,this.props.grid){var x=T(m,this.props.grid[0]),z=T(g,this.props.grid[1]),_=this.props.snapGap||0;m=0===_||Math.abs(x-m)<=_?x:m,g=0===_||Math.abs(z-g)<=_?z:g}var R={width:m-p.width,height:g-p.height};if(h&&"string"==typeof h)if(h.endsWith("%"))m=m/v.width*100+"%";else if(h.endsWith("vw")){m=m/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){m=m/this.window.innerHeight*100+"vh"}if(u&&"string"==typeof u)if(u.endsWith("%"))g=g/v.height*100+"%";else if(u.endsWith("vw")){g=g/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){g=g/this.window.innerHeight*100+"vh"}var S={width:this.createSizeForCssProperty(m,"width"),height:this.createSizeForCssProperty(g,"height")};"row"===this.flexDir?S.flexBasis=S.width:"column"===this.flexDir&&(S.flexBasis=S.height),C((function(){o.setState(S)})),this.props.onResize&&this.props.onResize(e,c,this.resizable,R)}},o.prototype.onMouseUp=function(e){var o=this.state,t=o.isResizing,i=o.direction,n=o.original;if(t&&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:V(V({},this.state.backgroundStyle),{cursor:"auto"})})}},o.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},o.prototype.renderResizer=function(){var e=this,o=this.props,t=o.enable,i=o.handleStyles,n=o.handleClasses,r=o.handleWrapperStyle,s=o.handleWrapperClass,d=o.handleComponent;if(!t)return null;var l=Object.keys(t).map((function(o){return!1!==t[o]?u.createElement(B,{key:o,direction:o,onResizeStart:e.onResizeStart,replaceStyles:i&&i[o],className:n&&n[o]},d&&d[o]?d[o]:null):null}));return u.createElement("div",{className:s,style:r},l)},o.prototype.render=function(){var e=this,o=Object.keys(this.props).reduce((function(o,t){return-1!==Y.indexOf(t)||(o[t]=e.props[t]),o}),{}),t=V(V(V({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&&(t.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return u.createElement(i,V({ref:this.ref,style:t,className:this.props.className},o),this.state.isResizing&&u.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},o.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},o}(u.PureComponent);function q(e){return Q(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var o;return(null==e||null==(o=e.ownerDocument)?void 0:o.defaultView)||window}function K(e){var o;return null==(o=(Q(e)?e.ownerDocument:e.document)||window.document)?void 0:o.documentElement}function Q(e){return e instanceof Node||e instanceof J(e).Node}function ee(e){return e instanceof Element||e instanceof J(e).Element}function oe(e){return e instanceof HTMLElement||e instanceof J(e).HTMLElement}function te(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof J(e).ShadowRoot)}function ie(e){const{overflow:o,overflowX:t,overflowY:i,display:n}=le(e);return/auto|scroll|overlay|hidden|clip/.test(o+i+t)&&!["inline","contents"].includes(n)}function ne(e){return["table","td","th"].includes(q(e))}function re(e){const o=se(),t=le(e);return"none"!==t.transform||"none"!==t.perspective||!!t.containerType&&"normal"!==t.containerType||!o&&!!t.backdropFilter&&"none"!==t.backdropFilter||!o&&!!t.filter&&"none"!==t.filter||["transform","perspective","filter"].some((e=>(t.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(t.contain||"").includes(e)))}function se(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function de(e){return["html","body","#document"].includes(q(e))}function le(e){return J(e).getComputedStyle(e)}function ae(e){return ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ce(e){if("html"===q(e))return e;const o=e.assignedSlot||e.parentNode||te(e)&&e.host||K(e);return te(o)?o.host:o}function pe(e){const o=ce(e);return de(o)?e.ownerDocument?e.ownerDocument.body:e.body:oe(o)&&ie(o)?o:pe(o)}function he(e,o,t){var i;void 0===o&&(o=[]),void 0===t&&(t=!0);const n=pe(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),s=J(n);return r?o.concat(s,s.visualViewport||[],ie(n)?n:[],s.frameElement&&t?he(s.frameElement):[]):o.concat(n,he(n,[],t))}const ue=Math.min,ve=Math.max,fe=Math.round,ye=e=>({x:e,y:e}),ge={left:"right",right:"left",bottom:"top",top:"bottom"},me={start:"end",end:"start"};function we(e,o,t){return ve(e,ue(o,t))}function be(e,o){return"function"==typeof e?e(o):e}function xe(e){return e.split("-")[0]}function Ce(e){return e.split("-")[1]}function ze(e){return"x"===e?"y":"x"}function _e(e){return"y"===e?"height":"width"}function Re(e){return["top","bottom"].includes(xe(e))?"y":"x"}function Se(e){return ze(Re(e))}function ke(e){return e.replace(/start|end/g,(e=>me[e]))}function Oe(e){return e.replace(/left|right|bottom|top/g,(e=>ge[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 je(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ne(e,o,t){let{reference:i,floating:n}=e;const r=Re(o),s=Se(o),d=_e(s),l=xe(o),a="y"===r,c=i.x+i.width/2-n.width/2,p=i.y+i.height/2-n.height/2,h=i[d]/2-n[d]/2;let u;switch(l){case"top":u={x:c,y:i.y-n.height};break;case"bottom":u={x:c,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:p};break;case"left":u={x:i.x-n.width,y:p};break;default:u={x:i.x,y:i.y}}switch(Ce(o)){case"start":u[s]-=h*(t&&a?-1:1);break;case"end":u[s]+=h*(t&&a?-1:1)}return u}async function Ee(e,o){var t;void 0===o&&(o={});const{x:i,y:n,platform:r,rects:s,elements:d,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:h=!1,padding:u=0}=be(o,e),v=Le(u),f=d[h?"floating"===p?"reference":"floating":p],y=je(await r.getClippingRect({element:null==(t=await(null==r.isElement?void 0:r.isElement(f)))||t?f:f.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(d.floating)),boundary:a,rootBoundary:c,strategy:l})),g="floating"===p?{...s.floating,x:i,y:n}:s.reference,m=await(null==r.getOffsetParent?void 0:r.getOffsetParent(d.floating)),w=await(null==r.isElement?void 0:r.isElement(m))&&await(null==r.getScale?void 0:r.getScale(m))||{x:1,y:1},b=je(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:g,offsetParent:m,strategy:l}):g);return{top:(y.top-b.top+v.top)/w.y,bottom:(b.bottom-y.bottom+v.bottom)/w.y,left:(y.left-b.left+v.left)/w.x,right:(b.right-y.right+v.right)/w.x}}function Me(e){const o=ue(...e.map((e=>e.left))),t=ue(...e.map((e=>e.top)));return{x:o,y:t,width:ve(...e.map((e=>e.right)))-o,height:ve(...e.map((e=>e.bottom)))-t}}const He=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(o){var t,i;const{x:n,y:r,placement:s,middlewareData:d}=o,l=await async function(e,o){const{placement:t,platform:i,elements:n}=e,r=await(null==i.isRTL?void 0:i.isRTL(n.floating)),s=xe(t),d=Ce(t),l="y"===Re(t),a=["left","top"].includes(s)?-1:1,c=r&&l?-1:1,p=be(o,e);let{mainAxis:h,crossAxis:u,alignmentAxis:v}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return d&&"number"==typeof v&&(u="end"===d?-1*v:v),l?{x:u*c,y:h*a}:{x:h*a,y:u*c}}(o,e);return s===(null==(t=d.offset)?void 0:t.placement)&&null!=(i=d.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:s}}}}};function We(e){const o=le(e);let t=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const n=oe(e),r=n?e.offsetWidth:t,s=n?e.offsetHeight:i,d=fe(t)!==r||fe(i)!==s;return d&&(t=r,i=s),{width:t,height:i,$:d}}function Be(e){return ee(e)?e:e.contextElement}function Pe(e){const o=Be(e);if(!oe(o))return ye(1);const t=o.getBoundingClientRect(),{width:i,height:n,$:r}=We(o);let s=(r?fe(t.width):t.width)/i,d=(r?fe(t.height):t.height)/n;return s&&Number.isFinite(s)||(s=1),d&&Number.isFinite(d)||(d=1),{x:s,y:d}}const Ve=ye(0);function Ae(e){const o=J(e);return se()&&o.visualViewport?{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}:Ve}function Fe(e,o,t,i){void 0===o&&(o=!1),void 0===t&&(t=!1);const n=e.getBoundingClientRect(),r=Be(e);let s=ye(1);o&&(i?ee(i)&&(s=Pe(i)):s=Pe(e));const d=function(e,o,t){return void 0===o&&(o=!1),!(!t||o&&t!==J(e))&&o}(r,t,i)?Ae(r):ye(0);let l=(n.left+d.x)/s.x,a=(n.top+d.y)/s.y,c=n.width/s.x,p=n.height/s.y;if(r){const e=J(r),o=i&&ee(i)?J(i):i;let t=e,n=t.frameElement;for(;n&&i&&o!==t;){const e=Pe(n),o=n.getBoundingClientRect(),i=le(n),r=o.left+(n.clientLeft+parseFloat(i.paddingLeft))*e.x,s=o.top+(n.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,a*=e.y,c*=e.x,p*=e.y,l+=r,a+=s,t=J(n),n=t.frameElement}}return je({width:c,height:p,x:l,y:a})}const Te=[":popover-open",":modal"];function De(e){return Te.some((o=>{try{return e.matches(o)}catch(e){return!1}}))}function Ie(e){return Fe(K(e)).left+ae(e).scrollLeft}function Ze(e,o,t){let i;if("viewport"===o)i=function(e,o){const t=J(e),i=K(e),n=t.visualViewport;let r=i.clientWidth,s=i.clientHeight,d=0,l=0;if(n){r=n.width,s=n.height;const e=se();(!e||e&&"fixed"===o)&&(d=n.offsetLeft,l=n.offsetTop)}return{width:r,height:s,x:d,y:l}}(e,t);else if("document"===o)i=function(e){const o=K(e),t=ae(e),i=e.ownerDocument.body,n=ve(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),r=ve(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let s=-t.scrollLeft+Ie(e);const d=-t.scrollTop;return"rtl"===le(i).direction&&(s+=ve(o.clientWidth,i.clientWidth)-n),{width:n,height:r,x:s,y:d}}(K(e));else if(ee(o))i=function(e,o){const t=Fe(e,!0,"fixed"===o),i=t.top+e.clientTop,n=t.left+e.clientLeft,r=oe(e)?Pe(e):ye(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:i*r.y}}(o,t);else{const t=Ae(e);i={...o,x:o.x-t.x,y:o.y-t.y}}return je(i)}function Ue(e,o){const t=ce(e);return!(t===o||!ee(t)||de(t))&&("fixed"===le(t).position||Ue(t,o))}function $e(e,o,t){const i=oe(o),n=K(o),r="fixed"===t,s=Fe(e,!0,r,o);let d={scrollLeft:0,scrollTop:0};const l=ye(0);if(i||!i&&!r)if(("body"!==q(o)||ie(n))&&(d=ae(o)),i){const e=Fe(o,!0,r,o);l.x=e.x+o.clientLeft,l.y=e.y+o.clientTop}else n&&(l.x=Ie(n));return{x:s.left+d.scrollLeft-l.x,y:s.top+d.scrollTop-l.y,width:s.width,height:s.height}}function Ye(e,o){return oe(e)&&"fixed"!==le(e).position?o?o(e):e.offsetParent:null}function Xe(e,o){const t=J(e);if(!oe(e)||De(e))return t;let i=Ye(e,o);for(;i&&ne(i)&&"static"===le(i).position;)i=Ye(i,o);return i&&("html"===q(i)||"body"===q(i)&&"static"===le(i).position&&!re(i))?t:i||function(e){let o=ce(e);for(;oe(o)&&!de(o);){if(re(o))return o;o=ce(o)}return null}(e)||t}const Ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:o,rect:t,offsetParent:i,strategy:n}=e;const r="fixed"===n,s=K(i),d=!!o&&De(o.floating);if(i===s||d&&r)return t;let l={scrollLeft:0,scrollTop:0},a=ye(1);const c=ye(0),p=oe(i);if((p||!p&&!r)&&(("body"!==q(i)||ie(s))&&(l=ae(i)),oe(i))){const e=Fe(i);a=Pe(i),c.x=e.x+i.clientLeft,c.y=e.y+i.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+c.x,y:t.y*a.y-l.scrollTop*a.y+c.y}},getDocumentElement:K,getClippingRect:function(e){let{element:o,boundary:t,rootBoundary:i,strategy:n}=e;const r=[..."clippingAncestors"===t?function(e,o){const t=o.get(e);if(t)return t;let i=he(e,[],!1).filter((e=>ee(e)&&"body"!==q(e))),n=null;const r="fixed"===le(e).position;let s=r?ce(e):e;for(;ee(s)&&!de(s);){const o=le(s),t=re(s);t||"fixed"!==o.position||(n=null),(r?!t&&!n:!t&&"static"===o.position&&n&&["absolute","fixed"].includes(n.position)||ie(s)&&!t&&Ue(e,s))?i=i.filter((e=>e!==s)):n=o,s=ce(s)}return o.set(e,i),i}(o,this._c):[].concat(t),i],s=r[0],d=r.reduce(((e,t)=>{const i=Ze(o,t,n);return e.top=ve(i.top,e.top),e.right=ue(i.right,e.right),e.bottom=ue(i.bottom,e.bottom),e.left=ve(i.left,e.left),e}),Ze(o,s,n));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}},getOffsetParent:Xe,getElementRects:async function(e){const o=this.getOffsetParent||Xe,t=this.getDimensions;return{reference:$e(e.reference,await o(e.floating),e.strategy),floating:{x:0,y:0,...await t(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:o,height:t}=We(e);return{width:o,height:t}},getScale:Pe,isElement:ee,isRTL:function(e){return"rtl"===le(e).direction}},qe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(o){const{x:t,y:i,placement:n}=o,{mainAxis:r=!0,crossAxis:s=!1,limiter:d={fn:e=>{let{x:o,y:t}=e;return{x:o,y:t}}},...l}=be(e,o),a={x:t,y:i},c=await Ee(o,l),p=Re(xe(n)),h=ze(p);let u=a[h],v=a[p];if(r){const e="y"===h?"bottom":"right";u=we(u+c["y"===h?"top":"left"],u,u-c[e])}if(s){const e="y"===p?"bottom":"right";v=we(v+c["y"===p?"top":"left"],v,v-c[e])}const f=d.fn({...o,[h]:u,[p]:v});return{...f,data:{x:f.x-t,y:f.y-i}}}}},Je=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(o){var t,i;const{placement:n,middlewareData:r,rects:s,initialPlacement:d,platform:l,elements:a}=o,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...y}=be(e,o);if(null!=(t=r.arrow)&&t.alignmentOffset)return{};const g=xe(n),m=xe(d)===d,w=await(null==l.isRTL?void 0:l.isRTL(a.floating)),b=h||(m||!f?[Oe(d)]:function(e){const o=Oe(e);return[ke(e),o,ke(o)]}(d));h||"none"===v||b.push(...function(e,o,t,i){const n=Ce(e);let r=function(e,o,t){const i=["left","right"],n=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return t?o?n:i:o?i:n;case"left":case"right":return o?r:s;default:return[]}}(xe(e),"start"===t,i);return n&&(r=r.map((e=>e+"-"+n)),o&&(r=r.concat(r.map(ke)))),r}(d,f,v,w));const x=[d,...b],C=await Ee(o,y),z=[];let _=(null==(i=r.flip)?void 0:i.overflows)||[];if(c&&z.push(C[g]),p){const e=function(e,o,t){void 0===t&&(t=!1);const i=Ce(e),n=Se(e),r=_e(n);let s="x"===n?i===(t?"end":"start")?"right":"left":"start"===i?"bottom":"top";return o.reference[r]>o.floating[r]&&(s=Oe(s)),[s,Oe(s)]}(n,s,w);z.push(C[e[0]],C[e[1]])}if(_=[..._,{placement:n,overflows:z}],!z.every((e=>e<=0))){var R,S;const e=((null==(R=r.flip)?void 0:R.index)||0)+1,o=x[e];if(o)return{data:{index:e,overflows:_},reset:{placement:o}};let t=null==(S=_.filter((e=>e.overflows[0]<=0)).sort(((e,o)=>e.overflows[1]-o.overflows[1]))[0])?void 0:S.placement;if(!t)switch(u){case"bestFit":{var k;const e=null==(k=_.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,o)=>e+o),0)])).sort(((e,o)=>e[1]-o[1]))[0])?void 0:k[0];e&&(t=e);break}case"initialPlacement":t=d}if(n!==t)return{reset:{placement:t}}}return{}}}},Ke=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(o){const{placement:t,elements:i,rects:n,platform:r,strategy:s}=o,{padding:d=2,x:l,y:a}=be(e,o),c=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),p=function(e){const o=e.slice().sort(((e,o)=>e.y-o.y)),t=[];let i=null;for(let e=0;e<o.length;e++){const n=o[e];!i||n.y-i.y>i.height/2?t.push([n]):t[t.length-1].push(n),i=n}return t.map((e=>je(Me(e))))}(c),h=je(Me(c)),u=Le(d);const v=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=l&&null!=a)return p.find((e=>l>e.left-u.left&&l<e.right+u.right&&a>e.top-u.top&&a<e.bottom+u.bottom))||h;if(p.length>=2){if("y"===Re(t)){const e=p[0],o=p[p.length-1],i="top"===xe(t),n=e.top,r=o.bottom,s=i?e.left:o.left,d=i?e.right:o.right;return{top:n,bottom:r,left:s,right:d,width:d-s,height:r-n,x:s,y:n}}const e="left"===xe(t),o=ve(...p.map((e=>e.right))),i=ue(...p.map((e=>e.left))),n=p.filter((t=>e?t.left===i:t.right===o)),r=n[0].top,s=n[n.length-1].bottom;return{top:r,bottom:s,left:i,right:o,width:o-i,height:s-r,x:i,y:r}}return h}},floating:i.floating,strategy:s});return n.reference.x!==v.reference.x||n.reference.y!==v.reference.y||n.reference.width!==v.reference.width||n.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Qe=(e,o,t)=>{const i=new Map,n={platform:Ge,...t},r={...n.platform,_c:i};return(async(e,o,t)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:s}=t,d=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(o));let a=await s.getElementRects({reference:e,floating:o,strategy:n}),{x:c,y:p}=Ne(a,i,l),h=i,u={},v=0;for(let t=0;t<d.length;t++){const{name:r,fn:f}=d[t],{x:y,y:g,data:m,reset:w}=await f({x:c,y:p,initialPlacement:i,placement:h,strategy:n,middlewareData:u,rects:a,platform:s,elements:{reference:e,floating:o}});c=null!=y?y:c,p=null!=g?g:p,u={...u,[r]:{...u[r],...m}},w&&v<=50&&(v++,"object"==typeof w&&(w.placement&&(h=w.placement),w.rects&&(a=!0===w.rects?await s.getElementRects({reference:e,floating:o,strategy:n}):w.rects),({x:c,y:p}=Ne(a,h,l))),t=-1)}return{x:c,y:p,placement:h,strategy:n,middlewareData:u}})(e,o,{...n,platform:r})};var eo="undefined"!=typeof document?g:f;function oo(e,o){if(e===o)return!0;if(typeof e!=typeof o)return!1;if("function"==typeof e&&e.toString()===o.toString())return!0;let t,i,n;if(e&&o&&"object"==typeof e){if(Array.isArray(e)){if(t=e.length,t!==o.length)return!1;for(i=t;0!=i--;)if(!oo(e[i],o[i]))return!1;return!0}if(n=Object.keys(e),t=n.length,t!==Object.keys(o).length)return!1;for(i=t;0!=i--;)if(!{}.hasOwnProperty.call(o,n[i]))return!1;for(i=t;0!=i--;){const t=n[i];if(("_owner"!==t||!e.$$typeof)&&!oo(e[t],o[t]))return!1}return!0}return e!=e&&o!=o}function to(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function io(e,o){const t=to(e);return Math.round(o*t)/t}function no(e){const o=u.useRef(e);return eo((()=>{o.current=e})),o}const ro=u["useInsertionEffect".toString()]||(e=>e());var so="undefined"!=typeof document?g:f;let lo=!1,ao=0;const co=()=>"floating-ui-"+ao++;const po=u["useId".toString()]||function(){const[e,o]=u.useState((()=>lo?co():void 0));return so((()=>{null==e&&o(co())}),[]),u.useEffect((()=>{lo||(lo=!0)}),[]),e};const ho=u.createContext(null),uo=u.createContext(null);function vo(e){var o;void 0===e&&(e={});const{open:t=!1,onOpenChange:i,nodeId:n}=e,[r,s]=u.useState(null),d=(null==(o=e.elements)?void 0:o.reference)||r,l=function(e){void 0===e&&(e={});const{placement:o="bottom",strategy:t="absolute",middleware:i=[],platform:n,elements:{reference:r,floating:s}={},transform:d=!0,whileElementsMounted:l,open:a}=e,[c,p]=u.useState({x:0,y:0,strategy:t,placement:o,middlewareData:{},isPositioned:!1}),[h,v]=u.useState(i);oo(h,i)||v(i);const[f,y]=u.useState(null),[g,m]=u.useState(null),w=u.useCallback((e=>{e!==_.current&&(_.current=e,y(e))}),[]),b=u.useCallback((e=>{e!==R.current&&(R.current=e,m(e))}),[]),C=r||f,z=s||g,_=u.useRef(null),R=u.useRef(null),S=u.useRef(c),k=null!=l,O=no(l),L=no(n),j=u.useCallback((()=>{if(!_.current||!R.current)return;const e={placement:o,strategy:t,middleware:h};L.current&&(e.platform=L.current),Qe(_.current,R.current,e).then((e=>{const o={...e,isPositioned:!0};N.current&&!oo(S.current,o)&&(S.current=o,x.flushSync((()=>{p(o)})))}))}),[h,o,t,L]);eo((()=>{!1===a&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const N=u.useRef(!1);eo((()=>(N.current=!0,()=>{N.current=!1})),[]),eo((()=>{if(C&&(_.current=C),z&&(R.current=z),C&&z){if(O.current)return O.current(C,z,j);j()}}),[C,z,j,O,k]);const E=u.useMemo((()=>({reference:_,floating:R,setReference:w,setFloating:b})),[w,b]),M=u.useMemo((()=>({reference:C,floating:z})),[C,z]),H=u.useMemo((()=>{const e={position:t,left:0,top:0};if(!M.floating)return e;const o=io(M.floating,c.x),i=io(M.floating,c.y);return d?{...e,transform:"translate("+o+"px, "+i+"px)",...to(M.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:o,top:i}}),[t,d,M.floating,c.x,c.y]);return u.useMemo((()=>({...c,update:j,refs:E,elements:M,floatingStyles:H})),[c,j,E,M,H])}(e),a=u.useContext(uo),c=null!=((null==(p=u.useContext(ho))?void 0:p.id)||null);var p;const h=function(e){const o=u.useRef((()=>{}));return ro((()=>{o.current=e})),u.useCallback((function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return null==o.current?void 0:o.current(...t)}),[])}(((e,o,t)=>{e&&(f.current.openEvent=o),y.emit("openchange",{open:e,event:o,reason:t,nested:c}),null==i||i(e,o,t)})),v=u.useRef(null),f=u.useRef({}),y=u.useState((()=>function(){const e=new Map;return{emit(o,t){var i;null==(i=e.get(o))||i.forEach((e=>e(t)))},on(o,t){e.set(o,[...e.get(o)||[],t])},off(o,t){var i;e.set(o,(null==(i=e.get(o))?void 0:i.filter((e=>e!==t)))||[])}}}()))[0],g=po(),m=u.useCallback((e=>{const o=ee(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(o)}),[l.refs]),w=u.useCallback((e=>{(ee(e)||null===e)&&(v.current=e,s(e)),(ee(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!ee(e))&&l.refs.setReference(e)}),[l.refs]),b=u.useMemo((()=>({...l.refs,setReference:w,setPositionReference:m,domReference:v})),[l.refs,w,m]),C=u.useMemo((()=>({...l.elements,domReference:d})),[l.elements,d]),z=u.useMemo((()=>({...l,refs:b,elements:C,dataRef:f,nodeId:n,floatingId:g,events:y,open:t,onOpenChange:h})),[l,n,g,y,t,h,b,C]);return so((()=>{const e=null==a?void 0:a.nodesRef.current.find((e=>e.id===n));e&&(e.context=z)})),u.useMemo((()=>({...l,context:z,refs:b,elements:C})),[l,b,C,z])}function fo(e,o){if(null==e)return{};var t,i,n={},r=Object.keys(e);for(i=0;i<r.length;i++)t=r[i],o.indexOf(t)>=0||(n[t]=e[t]);return n}var yo=["color"],go=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,yo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H12C12.5523 13 13 12.5523 13 12V8.5C13 8.22386 12.7761 8 12.5 8C12.2239 8 12 8.22386 12 8.5V12H3V3L6.5 3C6.77614 3 7 2.77614 7 2.5C7 2.22386 6.77614 2 6.5 2H3ZM12.8536 2.14645C12.9015 2.19439 12.9377 2.24964 12.9621 2.30861C12.9861 2.36669 12.9996 2.4303 13 2.497L13 2.5V2.50049V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3.70711L6.85355 8.85355C6.65829 9.04882 6.34171 9.04882 6.14645 8.85355C5.95118 8.65829 5.95118 8.34171 6.14645 8.14645L11.2929 3H9.5C9.22386 3 9 2.77614 9 2.5C9 2.22386 9.22386 2 9.5 2H12.4999H12.5C12.5678 2 12.6324 2.01349 12.6914 2.03794C12.7504 2.06234 12.8056 2.09851 12.8536 2.14645Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),mo=["color"],wo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,mo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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"}))})),bo=["color"],xo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,bo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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"}))})),Co=["color"],zo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Co);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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"}))})),_o=["color"],Ro=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,_o);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H10.5C10.7761 7 11 7.22386 11 7.5C11 7.77614 10.7761 8 10.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM3 10.5C3 10.2239 3.22386 10 3.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H3.5C3.22386 11 3 10.7761 3 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),So=["color"],ko=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,So);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H7.5C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H10.5C10.7761 10 11 10.2239 11 10.5C11 10.7761 10.7761 11 10.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Oo=["color"],Lo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Oo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M2 4.5C2 4.22386 2.22386 4 2.5 4H12.5C12.7761 4 13 4.22386 13 4.5C13 4.77614 12.7761 5 12.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM7 7.5C7 7.22386 7.22386 7 7.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H7.5C7.22386 8 7 7.77614 7 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H4.5C4.22386 11 4 10.7761 4 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),jo=["color"],No=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,jo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M1.90321 7.29677C1.90321 10.341 4.11041 12.4147 6.58893 12.8439C6.87255 12.893 7.06266 13.1627 7.01355 13.4464C6.96444 13.73 6.69471 13.9201 6.41109 13.871C3.49942 13.3668 0.86084 10.9127 0.86084 7.29677C0.860839 5.76009 1.55996 4.55245 2.37639 3.63377C2.96124 2.97568 3.63034 2.44135 4.16846 2.03202L2.53205 2.03202C2.25591 2.03202 2.03205 1.80816 2.03205 1.53202C2.03205 1.25588 2.25591 1.03202 2.53205 1.03202L5.53205 1.03202C5.80819 1.03202 6.03205 1.25588 6.03205 1.53202L6.03205 4.53202C6.03205 4.80816 5.80819 5.03202 5.53205 5.03202C5.25591 5.03202 5.03205 4.80816 5.03205 4.53202L5.03205 2.68645L5.03054 2.68759L5.03045 2.68766L5.03044 2.68767L5.03043 2.68767C4.45896 3.11868 3.76059 3.64538 3.15554 4.3262C2.44102 5.13021 1.90321 6.10154 1.90321 7.29677ZM13.0109 7.70321C13.0109 4.69115 10.8505 2.6296 8.40384 2.17029C8.12093 2.11718 7.93465 1.84479 7.98776 1.56188C8.04087 1.27898 8.31326 1.0927 8.59616 1.14581C11.4704 1.68541 14.0532 4.12605 14.0532 7.70321C14.0532 9.23988 13.3541 10.4475 12.5377 11.3662C11.9528 12.0243 11.2837 12.5586 10.7456 12.968L12.3821 12.968C12.6582 12.968 12.8821 13.1918 12.8821 13.468C12.8821 13.7441 12.6582 13.968 12.3821 13.968L9.38205 13.968C9.10591 13.968 8.88205 13.7441 8.88205 13.468L8.88205 10.468C8.88205 10.1918 9.10591 9.96796 9.38205 9.96796C9.65819 9.96796 9.88205 10.1918 9.88205 10.468L9.88205 12.3135L9.88362 12.3123C10.4551 11.8813 11.1535 11.3546 11.7585 10.6738C12.4731 9.86976 13.0109 8.89844 13.0109 7.70321Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Eo=["color"],Mo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Eo);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("path",{d:"M4.76447 3.12199C5.63151 3.04859 6.56082 3 7.5 3C8.43918 3 9.36849 3.04859 10.2355 3.12199C11.2796 3.21037 11.9553 3.27008 12.472 3.39203C12.9425 3.50304 13.2048 3.64976 13.4306 3.88086C13.4553 3.90618 13.4902 3.94414 13.5133 3.97092C13.7126 4.20149 13.8435 4.4887 13.918 5.03283C13.9978 5.6156 14 6.37644 14 7.52493C14 8.66026 13.9978 9.41019 13.9181 9.98538C13.8439 10.5206 13.7137 10.8061 13.5125 11.0387C13.4896 11.0651 13.4541 11.1038 13.4296 11.1287C13.2009 11.3625 12.9406 11.5076 12.4818 11.6164C11.9752 11.7365 11.3143 11.7942 10.2878 11.8797C9.41948 11.9521 8.47566 12 7.5 12C6.52434 12 5.58052 11.9521 4.7122 11.8797C3.68572 11.7942 3.02477 11.7365 2.51816 11.6164C2.05936 11.5076 1.7991 11.3625 1.57037 11.1287C1.54593 11.1038 1.51035 11.0651 1.48748 11.0387C1.28628 10.8061 1.15612 10.5206 1.08193 9.98538C1.00221 9.41019 1 8.66026 1 7.52493C1 6.37644 1.00216 5.6156 1.082 5.03283C1.15654 4.4887 1.28744 4.20149 1.48666 3.97092C1.5098 3.94414 1.54468 3.90618 1.56942 3.88086C1.7952 3.64976 2.05752 3.50304 2.52796 3.39203C3.04473 3.27008 3.7204 3.21037 4.76447 3.12199ZM0 7.52493C0 5.28296 0 4.16198 0.729985 3.31713C0.766457 3.27491 0.815139 3.22194 0.854123 3.18204C1.63439 2.38339 2.64963 2.29744 4.68012 2.12555C5.56923 2.05028 6.52724 2 7.5 2C8.47276 2 9.43077 2.05028 10.3199 2.12555C12.3504 2.29744 13.3656 2.38339 14.1459 3.18204C14.1849 3.22194 14.2335 3.27491 14.27 3.31713C15 4.16198 15 5.28296 15 7.52493C15 9.74012 15 10.8477 14.2688 11.6929C14.2326 11.7348 14.1832 11.7885 14.1444 11.8281C13.3629 12.6269 12.3655 12.71 10.3709 12.8763C9.47971 12.9505 8.50782 13 7.5 13C6.49218 13 5.52028 12.9505 4.62915 12.8763C2.63446 12.71 1.63712 12.6269 0.855558 11.8281C0.816844 11.7885 0.767442 11.7348 0.731221 11.6929C0 10.8477 0 9.74012 0 7.52493ZM5.25 5.38264C5.25 5.20225 5.43522 5.08124 5.60041 5.15369L10.428 7.27105C10.6274 7.35853 10.6274 7.64147 10.428 7.72895L5.60041 9.84631C5.43522 9.91876 5.25 9.79775 5.25 9.61736V5.38264Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ho=["color"],Wo=m((function(e,o){var t=e.color,i=void 0===t?"currentColor":t,n=fo(e,Ho);return w("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:o}),w("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 Bo={youtube:e=>{const o=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return o&&11===o[2].length?o[2]:null},vimeo:e=>new URL(e).pathname.split("/")[1],dailymotion:e=>{const o=e.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);return null!==o?void 0!==o[4]?o[4]:o[2]:null}},Po=({blockId:e,onClose:o})=>{const n=i(),[r,s]=v(""),d=0===r.length;return c("div",Object.assign({className:"yoo-video-cursor-pointer yoo-video-user-select-none yoo-video-transition-bg yoo-video-duration-20 yoo-video-ease-in yoo-video-white-space-nowrap yoo-video-w-full"},{children:[p("input",{type:"text",placeholder:"Paste video link",value:r,className:"yoo-video-items-center yoo-video-bg-[hsla(45,13%,94%,.6)] yoo-video-rounded-[4px] yoo-video-shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] yoo-video-cursor-text yoo-video-flex yoo-video-text-[14px] yoo-video-h-[32px] yoo-video-leading-[20px] yoo-video-px-[6px] yoo-video-relative yoo-video-w-full yoo-video-border-none",onChange:e=>s(e.target.value)}),p("button",Object.assign({type:"button",className:"yoopta-button yoo-video-user-select-none yoo-video-transition-bg yoo-video-duration-20 yoo-video-ease-in yoo-video-cursor-pointer yoo-video-flex yoo-video-items-center yoo-video-justify-center yoo-video-flex-shrink-0 yoo-video-white-space-nowrap yoo-video-h-[28px] yoo-video-rounded-[4px] yoo-video-shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] yoo-video-bg-[rgb(35,131,226)] yoo-video-text-white yoo-video-fill-white yoo-video-leading-[1.2] yoo-video-px-[12px] yoo-video-text-[14px] yoo-video-font-medium yoo-video-w-full yoo-video-max-w-[300px] yoo-video-mx-auto yoo-video-m-[12px_0_6px] disabled:yoo-video-bg-[rgba(35,131,226,0.5)] disabled:yoo-video-cursor-not-allowed",disabled:d,onClick:()=>{var i;if(0===r.length)return;const s=(d=r).includes("youtube.com")||d.includes("youtu.be")?"youtube":d.includes("vimeo.com")?"vimeo":d.includes("dailymotion.com")||d.includes("dai.ly")?"dailymotion":null;var d;const l=s?null===(i=Bo[s])||void 0===i?void 0:i.call(Bo,r):null;if(!s||!l)return console.warn("Unsopperted video provider or video id is not found.");t.updateElement(n,e,{type:"video",props:{src:r,provider:{type:s,id:l,url:r}}}),o()}},{children:"Embed video"}))]}))},Vo=({accept:e="video/*",onClose:o,blockId:r,onSetLoading:s})=>{const d=n("Video"),l=i();return p("div",Object.assign({className:"yoo-video-user-select-none yoo-video-transition-bg yoo-video-duration-20 yoo-video-ease-in yoo-video-white-space-nowrap yoo-video-rounded-[4px] yoo-video-h-[32px] yoo-video-px-[12px] yoo-video-border yoo-video-border-solid yoo-video-border-[rgba(55,53,47,0.16)] yoo-video-w-full yoo-video-cursor-pointer"},{children:c("label",Object.assign({htmlFor:"video-uploader",className:"yoo-video-text-[14px] yoo-video-leading-[1.2] yoo-video-font-medium yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-items-center yoo-video-justify-center yoo-video-h-full"},{children:[p("input",{type:"file",id:"video-uploader",className:"yoo-video-absolute yoo-video-left-0 yoo-video-top-0 yoo-video-invisible",accept:(null==d?void 0:d.accept)||e,onChange:e=>{const i=e.target.files[0];i&&(e=>{_(void 0,void 0,void 0,(function*(){if(!(null==d?void 0:d.onUpload))throw new Error("onUpload not provided in plugin options. Check Video.extend({}) method");o(),s(!0);try{const o=yield null==d?void 0:d.onUpload(e),i=l.plugins.Video.elements.video.props;t.updateElement(l,r,{type:"video",props:{src:o.src,sizes:o.sizes||i.sizes,bgColor:o.bgColor||i.bgColor,fit:o.fit||i.fit||"cover",settings:o.settings||i.settings,poster:o.poster||i.poster}})}catch(e){}finally{s(!1)}}))})(i)},multiple:!1}),"Upload video"]}))}))},{Overlay:Ao,Portal:Fo}=r,To=({floatingStyles:e,refs:o,onClose:t,blockId:i,onSetLoading:n})=>{const[r,s]=v("upload"),d=e=>s(e),l="upload"===r,a="embed"===r,h=e=>({borderBottom:e?"2px solid #2483e2":"2px solid transparent"});return p(Fo,Object.assign({id:"yoo-video-uploader-portal"},{children:p(Ao,Object.assign({lockScroll:!0,className:"yoo-video-z-[100]",onClick:t},{children:p("div",Object.assign({ref:o.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:c("div",Object.assign({className:"yoo-video-flex yoo-video-flex-col yoo-video-min-w-[540px] yoo-video-max-w-[calc(100vw-24px)] yoo-video-h-full yoo-video-max-h-[420px] yoo-video-bg-[#FFFFFF] yoo-video-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-video-w-full yoo-video-flex yoo-video-text-[14px] yoo-video-p-[0_8px] yoo-video-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-video-relative yoo-video-z-10 yoo-video-h-[40px]"},{children:[p("button",Object.assign({type:"button",onClick:()=>d("upload"),style:h(l),className:"yoopta-button yoo-video-py-[6px] yoo-video-whitespace-nowrap yoo-video-min-w-0 yoo-video-flex-shrink-0 yoo-video-text-[rgb(55,53,47)] yoo-video-relative yoo-video-cursor-pointer yoo-video-user-select-none yoo-video-bg-inherit yoo-video-transition-[height_20ms_ease-in] yoo-video-inline-flex yoo-video-items-center yoo-video-h-full yoo-video-text-[14px] yoo-video-leading-[1.2] yoo-video-px-[8px]"},{children:"Upload"})),p("button",Object.assign({type:"button",onClick:()=>d("embed"),style:h(a),className:"yoopta-button yoo-video-py-[6px] yoo-video-whitespace-nowrap yoo-video-min-w-0 yoo-video-flex-shrink-0 yoo-video-text-[rgb(55,53,47)] yoo-video-relative yoo-video-cursor-pointer yoo-video-user-select-none yoo-video-bg-inherit yoo-video-transition-[height_20ms_ease-in] yoo-video-inline-flex yoo-video-items-center yoo-video-h-full yoo-video-text-[14px] yoo-video-leading-[1.2] yoo-video-px-[8px]"},{children:"Video link"}))]})),c("div",Object.assign({className:"yoo-video-pt-[6px] yoo-video-pb-[6px] yoo-video-mt-[4px] yoo-video-flex yoo-video-justify-center yoo-video-mr-[12px] yoo-video-ml-[12px]"},{children:[a&&p(Po,{onClose:t,blockId:i}),l&&p(Vo,{onClose:t,blockId:i,onSetLoading:n})]}))]}))}))}))}))},Do=({className:e,width:o,height:t,children:i})=>c("div",Object.assign({className:e},{children:[i,p("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:o,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-video-h-4 yoo-video-w-4 yoo-video-animate-spin"},{children:p("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),Io={width:"100%",transition:"width 100ms ease-in"},Zo=({attributes:e,children:o,blockId:t})=>{const[i,n]=v(!1),[r,s]=v(!1),{refs:d,floatingStyles:l}=vo({placement:"bottom",open:i,onOpenChange:n,middleware:[Ke(),Je(),qe(),He(10)]});return c("div",Object.assign({className:"yoo-video-w-full yoo-video-user-select-none yoo-video-m-[20px_0_10px] yoo-video-relative yoo-video-flex"},e,{contentEditable:!1},{children:[c("button",Object.assign({type:"button",className:"yoopta-button yoo-video-p-[12px_36px_12px_12px] yoo-video-flex yoo-video-items-center yoo-video-text-left yoo-video-w-full yoo-video-overflow-hidden yoo-video-rounded-[3px] yoo-video-text-[14px] yoo-video-text-[rgba(55,53,47,0.65)] yoo-video-relative yoo-video-cursor-pointer yoo-video-border-none yoo-video-bg-[#efefef] yoo-video-transition-[background-color_100ms_ease-in] hover:yoo-video-bg-[#e3e3e3]",onClick:()=>n(!0),disabled:r,ref:d.setReference},{children:[p(r?Do:Mo,{className:"yoo-video-mr-2 yoo-video-user-select-none",width:24,height:24}),p("span",Object.assign({className:"yoo-video-font-medium"},{children:r?"Loading...":"Click to add video"})),r&&p("div",{className:"yoo-video-absolute yoo-video-top-0 yoo-video-left-0 yoo-video-h-full yoo-video-bg-[rgba(55,53,47,0.16)]",style:Io})]})),i&&p(To,{blockId:t,floatingStyles:l,refs:d,onClose:()=>n(!1),onSetLoading:e=>s(e)}),o]}))};var Uo;function $o(){return $o=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$o.apply(this,arguments)}var Yo,Xo=function(e){return u.createElement("svg",$o({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"checkmark_svg__lucide checkmark_svg__lucide-check"},e),Uo||(Uo=u.createElement("path",{d:"M20 6 9 17l-5-5"})))};function Go(){return Go=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Go.apply(this,arguments)}var qo=function(e){return u.createElement("svg",Go({viewBox:"0 0 16 16",style:{width:16,height:16,display:"block",fill:"rgba(55,53,47,.85)",flexShrink:0}},e),Yo||(Yo=u.createElement("path",{d:"M8.215 15.126c3.862 0 7.061-3.192 7.061-7.062 0-3.862-3.199-7.061-7.068-7.061-3.862 0-7.055 3.2-7.055 7.061 0 3.87 3.2 7.062 7.062 7.062zm0-1.388a5.654 5.654 0 0 1-5.667-5.674 5.642 5.642 0 0 1 5.66-5.667 5.66 5.66 0 0 1 5.68 5.667 5.66 5.66 0 0 1-5.673 5.674zm0-9.174c-.342 0-.602.247-.602.588v3.234l.062 1.401-.622-.766-.766-.8a.557.557 0 0 0-.41-.177.54.54 0 0 0-.56.547c0 .164.054.3.163.41l2.256 2.283c.15.157.294.226.479.226.191 0 .335-.075.485-.226l2.256-2.283a.557.557 0 0 0 .164-.41.539.539 0 0 0-.56-.547.523.523 0 0 0-.41.178l-.766.793-.622.779.054-1.408V5.152c0-.341-.253-.588-.601-.588z"})))};const Jo={left:ko,center:Ro,right:Lo},{ExtendedBlockActions:Ko,BlockOptionsMenuGroup:Qo,BlockOptionsMenuItem:et,BlockOptionsSeparator:ot}=r,tt={poster:!1,video:!1},it=({editor:e,block:i,props:r})=>{var s,d;const l=n("Video"),[a,u]=v(tt),f=(e,o)=>u((t=>Object.assign(Object.assign({},t),{[e]:o}))),y=!!(null===(s=null==r?void 0:r.provider)||void 0===s?void 0:s.id),g=(null===(d=null==i?void 0:i.meta)||void 0===d?void 0:d.align)||"center",m=Jo[g];return c(Ko,Object.assign({onClick:()=>e.setPath({current:i.meta.order}),id:"yoopta-video-options"},{children:[p(ot,{}),!y&&c(h,{children:[c(Qo,{children:[p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-video-justify-between",onClick:()=>{t.updateElement(e,i.id,{type:"video",props:{fit:"contain"}})}},{children:[c("span",Object.assign({className:"yoo-video-flex"},{children:[p(xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Fit"]})),"contain"===(null==r?void 0:r.fit)&&p(Xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4"})]}))}),p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-video-justify-between",onClick:()=>{t.updateElement(e,i.id,{type:"video",props:{fit:"fill"}})}},{children:[c("span",Object.assign({className:"yoo-video-flex"},{children:[p(Wo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Fill"]})),"fill"===(null==r?void 0:r.fit)&&p(Xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4"})]}))}),p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-video-justify-between",onClick:()=>{t.updateElement(e,i.id,{type:"video",props:{fit:"cover"}})}},{children:[c("span",Object.assign({className:"yoo-video-flex"},{children:[p(zo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Cover"]})),"cover"===(null==r?void 0:r.fit)&&p(Xo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4"})]}))})]}),p(ot,{})]}),!y&&c(h,{children:[c(Qo,{children:[p(et,{children:c("label",Object.assign({htmlFor:"video-uploader",className:"yoo-video-rounded-sm yoo-video-relative hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start data-[disabled=true]:yoo-video-cursor-not-allowed data-[disabled=true]:yoo-video-pointer-events-none data-[disabled=true]:yoo-video-opacity-50","data-disabled":a.video},{children:[p("input",{type:"file",accept:l.accept,multiple:!1,id:"video-uploader",className:"yoo-video-absolute yoo-video-hidden",onChange:o=>_(void 0,void 0,void 0,(function*(){var n;if(!(null==l?void 0:l.onUpload))throw new Error("onUpload not provided in plugin options. Check Video.extend({}) method");const s=null===(n=o.target.files)||void 0===n?void 0:n[0];if(!s)return;f("video",!0);const d=yield null==l?void 0:l.onUpload(s),a=e.plugins.Video.elements.video.props;t.updateElement(e,i.id,{type:"video",props:{src:d.src,sizes:d.sizes||a.sizes,bgColor:d.bgColor||a.bgColor,fit:(null==r?void 0:r.fit)||d.fit||a.fit||"cover",settings:(null==r?void 0:r.settings)||d.settings||a.settings}}),f("video",!1)})),disabled:a.video}),a.video?p(Do,{className:"yoo-video-mr-2 yoo-video-user-select-none",width:24,height:24}):p(No,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Replace video"]}))}),l.onUploadPoster&&p(et,{children:c("label",Object.assign({htmlFor:"video-poster-uploader",className:"yoo-video-rounded-sm yoo-video-relative hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start data-[disabled=true]:yoo-video-cursor-not-allowed data-[disabled=true]:yoo-video-pointer-events-none data-[disabled=true]:yoo-video-opacity-50","data-disabled":a.poster},{children:[p("input",{type:"file",accept:"image/*",multiple:!1,id:"video-poster-uploader",className:"yoo-video-absolute yoo-video-hidden",onChange:o=>_(void 0,void 0,void 0,(function*(){var n,r;if(!(null==l?void 0:l.onUploadPoster))throw new Error("onUploadPoster not provided in plugin options. Check Video.extend({}) method");const s=null===(n=o.target.files)||void 0===n?void 0:n[0];if(!s)return;f("poster",!0);const d=yield null===(r=l.onUploadPoster)||void 0===r?void 0:r.call(l,s);t.updateElement(e,i.id,{type:"video",props:{poster:d}}),f("poster",!1)})),disabled:a.poster}),a.poster?p(Do,{className:"yoo-video-mr-2 yoo-video-user-select-none",width:24,height:24}):p(wo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),(null==r?void 0:r.poster)?"Replace poster":"Add poster"]}))})]}),p(ot,{})]}),c(Qo,{children:[p(et,{children:c("button",Object.assign({type:"button",className:"yoopta-button yoo-video-rounded-sm hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start",onClick:()=>{const t=["left","center","right"];if(!i)return;const n=t[(t.indexOf(g)+1)%t.length];o.updateBlock(e,i.id,{meta:Object.assign(Object.assign({},i.meta),{align:n})})}},{children:[p(m,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Alignment"]}))}),p(et,{children:p("button",Object.assign({type:"button",className:"yoopta-button yoo-video-rounded-sm hover:yoo-video-bg-[#37352f14] yoo-video-leading-[120%] yoo-video-px-2 yoo-video-py-1.5 yoo-video-mx-[4px] yoo-video-cursor-pointer yoo-video-w-full yoo-video-flex yoo-video-justify-start",onClick:y?()=>{var e,o;(null===(e=null==r?void 0:r.provider)||void 0===e?void 0:e.url)&&window.open(null===(o=null==r?void 0:r.provider)||void 0===o?void 0:o.url,"_blank")}:()=>{if(!r||!r.src||y)return;const e=document.createElement("a");e.href=r.src,e.download=r.src,e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},{children:c(h,y?{children:[p(go,{width:16,height:16,className:"yoo-embed-w-4 yoo-embed-h-4 yoo-embed-mr-2"}),"Open"]}:{children:[p(qo,{width:16,height:16,className:"yoo-video-w-4 yoo-video-h-4 yoo-video-mr-2"}),"Download"]})}))})]})]}))},nt=({position:e})=>p("div",Object.assign({contentEditable:!1,className:"yoo-video-absolute yoo-video-pointer-events-none yoo-video-flex yoo-video-items-center yoo-video-justify-center yoo-video-z-10 yoo-video-opacity-1 yoo-video-h-full yoo-video-w-[15px] yoo-video-cursor-col-resize yoo-video-transition-opacity yoo-video-duration-150 yoo-video-ease-in "+("left"===e?"yoo-video-left-0 yoo-video-top-0":"yoo-video-right-0 yoo-video-top-0")},{children:p("div",{className:"yoo-video-opacity-100 yoo-video-transition-opacity yoo-video-duration-300 yoo-video-ease-in yoo-video-rounded-[20px] yoo-video-bg-[rgba(15,15,15,0.6)] yoo-video-border yoo-video-border-solid yoo-video-border-[rgba(255,255,255,0.9)] yoo-video-w-[6px] yoo-video-h-[48px] yoo-video-max-h-[50%] yoo-video-shadow-[0_0_0_.5px_#FFF]"})})),rt={left:"flex-start",center:"center",right:"flex-end"},st=new a({type:"Video",elements:{video:{render:e=>{var o,{extendRender:r}=e,a=z(e,["extendRender"]);const{element:h,blockId:u,attributes:y,children:g}=a,{src:m,srcSet:w,bgColor:x,settings:C,sizes:_,poster:R,provider:S,fit:k}=h.props||{},L=s(u),j=i(),N=n("Video"),E=d(),[M,H]=v({width:(null==_?void 0:_.width)||750,height:(null==_?void 0:_.height)||440});f((()=>H({width:(null==_?void 0:_.width)||650,height:(null==_?void 0:_.height)||440})),[h.props]);const W=l({blockId:u}),B=b((()=>{var e,o;return{minWidth:300,size:{width:M.width,height:M.height},maxWidth:(null===(e=null==N?void 0:N.maxSizes)||void 0===e?void 0:e.maxWidth)||800,maxHeight:(null===(o=null==N?void 0:N.maxSizes)||void 0===o?void 0:o.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!E,right:!E},handleStyles:{left:{left:0},right:{right:0}},onResize:(e,o,t)=>{H({width:t.offsetWidth,height:t.offsetHeight})},onResizeStop:(e,o,i)=>{t.updateElement(j,u,{type:"video",props:{sizes:{width:i.offsetWidth,height:i.offsetHeight}}})},handleComponent:{left:p(nt,{position:"left"}),right:p(nt,{position:"right"})}}}),[M.width,M.height]);if(!m)return p(Zo,Object.assign({attributes:y,blockId:u},{children:g}));const P=`yoopta-align-${(null===(o=null==L?void 0:L.meta)||void 0===o?void 0:o.align)||"center"}`;return p("div",Object.assign({contentEditable:!1,draggable:!1,className:`yoo-video-mt-4 yoo-video-relative yoo-video-flex ${P} yoopta-video`},{children:c(G,Object.assign({},B,{className:"yoo-video-my-0 yoo-video-flex"},{children:[W&&p("div",{className:"yoo-video-absolute yoo-video-pointer-events-none yoo-video-inset-0 yoo-video-bg-[rgba(35,131,226,0.14)] yoo-video-z-[81] yoo-video-rounded-[3px] yoo-video-opacity-100 yoo-video-transition-opacity yoo-video-duration-150 yoo-video-ease-in"}),r?r(a):p(O,Object.assign({src:m,srcSet:w,width:null==M?void 0:M.width,settings:C,bgColor:x,height:null==M?void 0:M.height,poster:R,provider:S,fit:k,attributes:y},{children:g})),!E&&p(it,{block:L,editor:j,settings:C,props:h.props})]}))}))},props:{src:null,srcSet:null,bgColor:null,sizes:{width:650,height:400},nodeType:"void",fit:"cover",provider:{type:null,id:""},settings:{controls:!1,loop:!0,muted:!0,autoPlay:!0}}}},options:{accept:"video/*",maxSizes:{maxWidth:650,maxHeight:550},onUpload:()=>_(void 0,void 0,void 0,(function*(){return Promise.resolve({src:""})})),display:{title:"Video",description:"Upload from device, embed from Youtube, Vimeo"}},commands:R,parsers:{html:{deserialize:{nodeNames:["VIDEO"],parse:o=>{if("VIDEO"===o.nodeName){const t=o.getAttribute("src"),i=o.getAttribute("srcset"),n=o.getAttribute("bgcolor"),r={width:o.getAttribute("width"),height:o.getAttribute("height")},s=o.getAttribute("controls"),d=o.getAttribute("loop"),l=o.getAttribute("muted"),a=o.getAttribute("autoplay"),c={src:t,srcSet:i,bgColor:n,sizes:r,fit:o.getAttribute("objectFit")||"cover",settings:{controls:!!s,loop:!!d,muted:!!l,autoPlay:!!a}};return{id:e(),type:"video",children:[{text:""}],props:c}}}},serialize:(e,o,t)=>{const{align:i="center",depth:n=0}=t||{};return`\n <div style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${rt[i]||"center"};">\n <video data-meta-align="${i}" data-meta-depth="${n}" src="${e.props.src}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" controls="${e.props.settings.controls}" loop="${e.props.settings.loop}" muted="${e.props.settings.muted}" autoplay="${e.props.settings.autoPlay}" style="margin: 0 auto;" objectFit="${e.props.fit}" />\n </div>`}},markdown:{serialize:(e,o)=>`\n`}}});!function(e,o){void 0===o&&(o={});var t=o.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-video-pointer-events-none{pointer-events:none}.yoo-video-invisible{visibility:hidden}.yoo-video-absolute{position:absolute}.yoo-video-relative{position:relative}.yoo-video-inset-0{inset:0}.yoo-video-left-0{left:0}.yoo-video-right-0{right:0}.yoo-video-top-0{top:0}.yoo-video-z-10{z-index:10}.yoo-video-z-\\[100\\]{z-index:100}.yoo-video-z-\\[81\\]{z-index:81}.yoo-video-m-\\[12px_0_6px\\]{margin:12px 0 6px}.yoo-video-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-video-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-video-mx-auto{margin-left:auto;margin-right:auto}.yoo-video-my-0{margin-bottom:0;margin-top:0}.yoo-video-ml-\\[12px\\]{margin-left:12px}.yoo-video-mr-2{margin-right:.5rem}.yoo-video-mr-\\[12px\\]{margin-right:12px}.yoo-video-mt-4{margin-top:1rem}.yoo-video-mt-\\[4px\\]{margin-top:4px}.yoo-video-flex{display:flex}.yoo-video-inline-flex{display:inline-flex}.yoo-video-hidden{display:none}.yoo-video-h-4{height:1rem}.yoo-video-h-\\[28px\\]{height:28px}.yoo-video-h-\\[32px\\]{height:32px}.yoo-video-h-\\[40px\\]{height:40px}.yoo-video-h-\\[48px\\]{height:48px}.yoo-video-h-full{height:100%}.yoo-video-max-h-\\[420px\\]{max-height:420px}.yoo-video-max-h-\\[50\\%\\]{max-height:50%}.yoo-video-w-4{width:1rem}.yoo-video-w-\\[15px\\]{width:15px}.yoo-video-w-\\[6px\\]{width:6px}.yoo-video-w-full{width:100%}.yoo-video-min-w-0{min-width:0}.yoo-video-min-w-\\[540px\\]{min-width:540px}.yoo-video-max-w-\\[300px\\]{max-width:300px}.yoo-video-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-video-flex-shrink-0{flex-shrink:0}@keyframes yoo-video-spin{to{transform:rotate(1turn)}}.yoo-video-animate-spin{animation:yoo-video-spin 1s linear infinite}.yoo-video-cursor-col-resize{cursor:col-resize}.yoo-video-cursor-pointer{cursor:pointer}.yoo-video-cursor-text{cursor:text}.yoo-video-flex-col{flex-direction:column}.yoo-video-items-center{align-items:center}.yoo-video-justify-start{justify-content:flex-start}.yoo-video-justify-center{justify-content:center}.yoo-video-justify-between{justify-content:space-between}.yoo-video-overflow-hidden{overflow:hidden}.yoo-video-whitespace-nowrap{white-space:nowrap}.yoo-video-rounded-\\[20px\\]{border-radius:20px}.yoo-video-rounded-\\[3px\\]{border-radius:3px}.yoo-video-rounded-\\[4px\\]{border-radius:4px}.yoo-video-rounded-sm{border-radius:.125rem}.yoo-video-border{border-width:1px}.yoo-video-border-solid{border-style:solid}.yoo-video-border-none{border-style:none}.yoo-video-border-\\[rgba\\(255\\,255\\,255\\,0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.yoo-video-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.yoo-video-bg-\\[\\#FFFFFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-video-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-video-bg-\\[hsla\\(45\\,13\\%\\,94\\%\\,\\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.yoo-video-bg-\\[rgb\\(35\\,131\\,226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.yoo-video-bg-\\[rgba\\(15\\,15\\,15\\,0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.yoo-video-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-video-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.yoo-video-bg-inherit{background-color:inherit}.yoo-video-fill-white{fill:#fff}.yoo-video-object-cover{-o-object-fit:cover;object-fit:cover}.yoo-video-p-\\[0_8px\\]{padding:0 8px}.yoo-video-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-video-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-video-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-video-px-\\[6px\\]{padding-left:6px;padding-right:6px}.yoo-video-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-video-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-video-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-video-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-video-pb-\\[6px\\]{padding-bottom:6px}.yoo-video-pt-\\[6px\\]{padding-top:6px}.yoo-video-text-left{text-align:left}.yoo-video-text-\\[14px\\]{font-size:14px}.yoo-video-font-medium{font-weight:500}.yoo-video-leading-\\[1\\.2\\]{line-height:1.2}.yoo-video-leading-\\[120\\%\\]{line-height:120%}.yoo-video-leading-\\[20px\\]{line-height:20px}.yoo-video-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-video-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-video-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoo-video-opacity-100{opacity:1}.yoo-video-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-video-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-video-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-video-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-video-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-video-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-video-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-video-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-video-duration-150{transition-duration:.15s}.yoo-video-duration-300{transition-duration:.3s}.yoo-video-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-video .yoopta-video-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-video:hover .yoopta-video-options{opacity:1}.hover\\:yoo-video-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:yoo-video-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:yoo-video-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:yoo-video-bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}.data-\\[disabled\\=true\\]\\:yoo-video-pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\[disabled\\=true\\]\\:yoo-video-cursor-not-allowed[data-disabled=true]{cursor:not-allowed}.data-\\[disabled\\=true\\]\\:yoo-video-opacity-50[data-disabled=true]{opacity:.5}");export{R as VideoCommands,st as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAS/D,QAAA,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAS/D,QAAA,MAAM,KAAK,mDAwHT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/video",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.1",
|
|
4
4
|
"description": "Video plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@radix-ui/react-icons": "^1.3.0",
|
|
40
40
|
"re-resizable": "^6.9.11"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "35395d0531032215038090494c72bc33d2bcc535"
|
|
43
43
|
}
|