@yoopta/image 4.9.9 → 6.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/commands/index.d.ts +2 -2
  2. package/dist/commands/index.d.ts.map +1 -1
  3. package/dist/hooks/use-upload.d.ts +17 -0
  4. package/dist/hooks/use-upload.d.ts.map +1 -0
  5. package/dist/hooks/use-xhr.d.ts +11 -0
  6. package/dist/hooks/use-xhr.d.ts.map +1 -0
  7. package/dist/index.d.ts +3 -9
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/plugin/{index.d.ts → image-plugin.d.ts} +2 -2
  11. package/dist/plugin/image-plugin.d.ts.map +1 -0
  12. package/dist/types.d.ts +65 -5
  13. package/dist/types.d.ts.map +1 -1
  14. package/dist/utils/limitSizes.d.ts +1 -1
  15. package/dist/utils/limitSizes.d.ts.map +1 -1
  16. package/package.json +7 -11
  17. package/dist/plugin/index.d.ts.map +0 -1
  18. package/dist/ui/EmbedUploader.d.ts +0 -6
  19. package/dist/ui/EmbedUploader.d.ts.map +0 -1
  20. package/dist/ui/FileUploader.d.ts +0 -9
  21. package/dist/ui/FileUploader.d.ts.map +0 -1
  22. package/dist/ui/Image.d.ts +0 -4
  23. package/dist/ui/Image.d.ts.map +0 -1
  24. package/dist/ui/ImageBlockOptions.d.ts +0 -10
  25. package/dist/ui/ImageBlockOptions.d.ts.map +0 -1
  26. package/dist/ui/ImageComponent.d.ts +0 -11
  27. package/dist/ui/ImageComponent.d.ts.map +0 -1
  28. package/dist/ui/ImageUploader.d.ts +0 -11
  29. package/dist/ui/ImageUploader.d.ts.map +0 -1
  30. package/dist/ui/InputAltText.d.ts +0 -11
  31. package/dist/ui/InputAltText.d.ts.map +0 -1
  32. package/dist/ui/Loader.d.ts +0 -10
  33. package/dist/ui/Loader.d.ts.map +0 -1
  34. package/dist/ui/Placeholder.d.ts +0 -7
  35. package/dist/ui/Placeholder.d.ts.map +0 -1
  36. package/dist/ui/Resizer.d.ts +0 -5
  37. package/dist/ui/Resizer.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
- import { YooEditor, YooptaPathIndex } from '@yoopta/editor';
2
- import { ImageElement, ImageElementProps } from '../types';
1
+ import type { YooEditor, YooptaPathIndex } from '@yoopta/editor';
2
+ import type { ImageElement, ImageElementProps } from '../types';
3
3
  type ImageElementOptions = {
4
4
  props?: Omit<ImageElementProps, 'nodeType'>;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE3D,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;CAC7C,CAAC;AAEF,KAAK,kBAAkB,GAAG,mBAAmB,GAAG;IAC9C,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,YAAY,CAAC;IAChG,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAChF,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC9F,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAsB3B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEhE,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;CAC7C,CAAC;AAEF,KAAK,kBAAkB,GAAG,mBAAmB,GAAG;IAC9C,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,YAAY,CAAC;IAChG,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAChF,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC9F,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aA+B3B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ImageUploadOptions, ImageUploadPreview, UseImageDeleteReturn, UseImageUploadReturn } from '../types';
2
+ export declare const useImageDelete: (options: ImageUploadOptions) => UseImageDeleteReturn;
3
+ export declare const useImageUpload: (options: ImageUploadOptions) => UseImageUploadReturn;
4
+ export declare const useImageDimensions: () => {
5
+ getDimensions: (file: File) => Promise<{
6
+ width: number;
7
+ height: number;
8
+ }>;
9
+ };
10
+ export declare const useImagePreview: () => {
11
+ preview: ImageUploadPreview | null;
12
+ generatePreview: (file: File) => {
13
+ url: string;
14
+ };
15
+ clearPreview: () => void;
16
+ };
17
+ //# sourceMappingURL=use-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,cAAc,YAAa,kBAAkB,KAAG,oBAsC5D,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,kBAAkB,KAAG,oBAwC5D,CAAC;AAEF,eAAO,MAAM,kBAAkB;0BACA,IAAI,KAAG,QAAQ;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAsB/E,CAAC;AAEF,eAAO,MAAM,eAAe;;4BAIK,IAAI;;;;CAyBpC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ImageUploadOptions, ImageUploadProgress, UploadError, UploadResult } from '../types';
2
+ export declare const useXHRRequest: ({ onError, onSuccess, onProgress, accept, maxSize, method, endpoint, headers, }: ImageUploadOptions) => {
3
+ xhrFetch: (body: XMLHttpRequestBodyInit) => Promise<UploadResult>;
4
+ cancel: () => void;
5
+ reset: () => void;
6
+ loading: boolean;
7
+ progress: ImageUploadProgress | null;
8
+ error: UploadError | null;
9
+ result: UploadResult | null;
10
+ };
11
+ //# sourceMappingURL=use-xhr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-xhr.d.ts","sourceRoot":"","sources":["../../src/hooks/use-xhr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,YAAY,EAEb,MAAM,UAAU,CAAC;AAqBlB,eAAO,MAAM,aAAa,oFASvB,kBAAkB;qBAUK,sBAAsB,KAAG,QAAQ,YAAY,CAAC;;;;;;;CA+KvE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,6 @@
1
- import { Image } from './plugin';
2
- import { ImageElement, ImageElementProps, ImageUploadResponse } from './types';
3
- import './styles.css';
4
- declare module 'slate' {
5
- interface CustomTypes {
6
- Element: ImageElement;
7
- }
8
- }
1
+ import { Image } from './plugin/image-plugin';
2
+ export { ImageElement, ImageElementProps, ImageUploadResponse, ImagePluginOptions, ImageUploadOptions, ImageDeleteOptions, ImageUploadPreview, UseImageDeleteReturn, UseImageUploadReturn, ImageUploadProgress, } from './types';
3
+ export { useImageUpload, useImageDelete, useImageDimensions, useImagePreview, } from './hooks/use-upload';
9
4
  export { ImageCommands } from './commands';
10
5
  export default Image;
11
- export { ImageElement, ImageElementProps, ImageUploadResponse };
12
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,YAAY,CAAC;KACvB;CACF;AAED,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAe,KAAK,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{generateId as e,Blocks as t,Elements as o,UI as i,useYooptaEditor as n,useYooptaPluginOptions as r,useBlockData as a,useYooptaReadOnly as s,useBlockSelected as l,YooptaPlugin as c}from"@yoopta/editor";import{jsxs as p,jsx as g,Fragment as d}from"react/jsx-runtime";import*as h from"react";import{useState as m,useEffect as u,Fragment as f,useLayoutEffect as y,forwardRef as w,createElement as x,useMemo as b}from"react";import*as v from"react-dom";import{flushSync as C}from"react-dom";const z={buildImageElements:(t,o={})=>{const i=Object.assign(Object.assign({},o.props),{nodeType:"void"});return{id:e(),type:"image",children:[{text:""}],props:i}},insertImage:(e,o={})=>{const{at:i,focus:n,props:r}=o,a=z.buildImageElements(e,{props:r}),s=t.buildBlockData({value:[a],type:"Image",meta:{align:"center",depth:0}});t.insertBlock(e,s.type,{focus:n,at:i,blockData:s})},deleteImage:(e,o)=>{t.deleteBlock(e,{blockId:o})},updateImage:(e,t,i)=>{o.updateElement(e,t,{props:i})}};function k(e,t,o,i){return new(o||(o=Promise))((function(n,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const _={position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",zIndex:999,maxWidth:"90vw",maxHeight:"90vh",cursor:"zoom-out"},R=({width:e,height:t,src:o,alt:n,fit:r,bgColor:a,attributes:s,children:l,layout:c="intrinsic"})=>{const[d,h]=m(!1);u((()=>{const e=e=>{"Escape"===e.key&&d&&h(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[d]);let y={objectFit:r||"contain",backgroundColor:a||"transparent",cursor:"zoom-in"};"responsive"===c?(y.width="100%",y.height="auto"):["fixed","fill","intrinsic"].includes(c)&&(y.width="100%",y.height="100%"),d&&(y=Object.assign(Object.assign({},y),_));const w=()=>{h((e=>!e))};return p("div",Object.assign({className:"yoopta-image-inner "+(d?"yoopta-image--is-zoomed":""),"data-layout":c},s,{children:[o&&g("img",{src:o,width:e,height:t,alt:n||"",decoding:"async",loading:"lazy",style:y,onClick:w}),l,n&&g("div",Object.assign({className:"yoopta-image-alt",title:n},{children:g("div",Object.assign({className:"yoopta-image-alt-text"},{children:"ALT"}))})),d&&g(i.Portal,Object.assign({id:"image-zoom"},{children:g(i.Overlay,Object.assign({onClick:w,lockScroll:!0,className:"yoopta-image-zoom-overlay yoo-image-bg-[rgba(255,255,255,0.95)]"},{children:g(f,{})}))}))]}))};var S,O=(S=function(e,t){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},S(e,t)},function(e,t){function o(){this.constructor=e}S(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),j=function(){return j=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},j.apply(this,arguments)},L={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},N={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},E={width:"20px",height:"20px",position:"absolute"},M={top:j(j({},L),{top:"-5px"}),right:j(j({},N),{left:void 0,right:"-5px"}),bottom:j(j({},L),{top:void 0,bottom:"-5px"}),left:j(j({},N),{left:"-5px"}),topRight:j(j({},E),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:j(j({},E),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:j(j({},E),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:j(j({},E),{left:"-10px",top:"-10px",cursor:"nw-resize"})},H=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return O(t,e),t.prototype.render=function(){return h.createElement("div",{className:this.props.className||"",style:j(j({position:"absolute",userSelect:"none"},M[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(h.PureComponent),W=function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),B=function(){return B=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},B.apply(this,arguments)},P={width:"auto",height:"auto"},A=function(e,t,o){return Math.max(Math.min(e,o),t)},T=function(e,t){return Math.round(e/t)*t},F=function(e,t){return new RegExp(e,"i").test(t)},I=function(e){return Boolean(e.touches&&e.touches.length)},D=function(e,t,o){void 0===o&&(o=0);var i=t.reduce((function(o,i,n){return Math.abs(i-e)<Math.abs(t[o]-e)?n:o}),0),n=Math.abs(t[i]-e);return 0===o||n<o?t[i]:e},V=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,t,o,i){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return o*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return i*(Number(e.replace("vh",""))/100)}return e},Z=["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"],U="__resizable_base__",G=function(e){function t(t){var o=e.call(this,t)||this;return o.ratio=1,o.resizable=null,o.parentLeft=0,o.parentTop=0,o.resizableLeft=0,o.resizableRight=0,o.resizableTop=0,o.resizableBottom=0,o.targetLeft=0,o.targetTop=0,o.appendBase=function(){if(!o.resizable||!o.window)return null;var e=o.parentNode;if(!e)return null;var t=o.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(U):t.className+=U,e.appendChild(t),t},o.removeBase=function(e){var t=o.parentNode;t&&t.removeChild(e)},o.ref=function(e){e&&(o.resizable=e)},o.state={isResizing:!1,width:void 0===(o.propsSize&&o.propsSize.width)?"auto":o.propsSize&&o.propsSize.width,height:void 0===(o.propsSize&&o.propsSize.height)?"auto":o.propsSize&&o.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},o.onResizeStart=o.onResizeStart.bind(o),o.onMouseMove=o.onMouseMove.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o}return W(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||P},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,i=this.resizable.offsetHeight,n=this.resizable.style.position;"relative"!==n&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:o,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=n}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,o=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var o=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/o[t]*100+"%"}return V(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?V(t.width):o("width"),height:t&&void 0!==t.height&&!this.state.isResizing?V(t.height):o("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,o=this.parentNode.style.flexWrap;"wrap"!==o&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var i={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=o),this.removeBase(e),i},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var o=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==o&&"auto"!==o?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var o,i,n=this.props.boundsByDirection,r=this.state.direction,a=n&&F("left",r),s=n&&F("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(o=a?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=s?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(o=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),i&&Number.isFinite(i)&&(t=t&&t<i?t:i),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var o=this.props.scale||1,i=this.props.resizeRatio||1,n=this.state,r=n.direction,a=n.original,s=this.props,l=s.lockAspectRatio,c=s.lockAspectRatioExtraHeight,p=s.lockAspectRatioExtraWidth,g=a.width,d=a.height,h=c||0,m=p||0;return F("right",r)&&(g=a.width+(e-a.x)*i/o,l&&(d=(g-m)/this.ratio+h)),F("left",r)&&(g=a.width-(e-a.x)*i/o,l&&(d=(g-m)/this.ratio+h)),F("bottom",r)&&(d=a.height+(t-a.y)*i/o,l&&(g=(d-h)*this.ratio+m)),F("top",r)&&(d=a.height-(t-a.y)*i/o,l&&(g=(d-h)*this.ratio+m)),{newWidth:g,newHeight:d}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,o,i){var n=this.props,r=n.lockAspectRatio,a=n.lockAspectRatioExtraHeight,s=n.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,c=void 0===o.width||o.width<0?e:o.width,p=void 0===i.height?10:i.height,g=void 0===o.height||o.height<0?t:o.height,d=a||0,h=s||0;if(r){var m=(p-d)*this.ratio+h,u=(g-d)*this.ratio+h,f=(l-h)/this.ratio+d,y=(c-h)/this.ratio+d,w=Math.max(l,m),x=Math.min(c,u),b=Math.max(p,f),v=Math.min(g,y);e=A(e,w,x),t=A(t,b,v)}else e=A(e,l,c),t=A(t,p,g);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),n=i.left,r=i.top,a=i.right,s=i.bottom;this.resizableLeft=n,this.resizableRight=a,this.resizableTop=r,this.resizableBottom=s}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var o,i=0,n=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(i=e.nativeEvent.clientX,n=e.nativeEvent.clientY):e.nativeEvent&&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,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var a=this.parentNode;if(a){var s=this.window.getComputedStyle(a).flexDirection;this.flexDir=s.startsWith("row")?"row":"column",o=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:n,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:B(B({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:o};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&I(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var o=this.props,i=o.maxWidth,n=o.maxHeight,r=o.minWidth,a=o.minHeight,s=I(e)?e.touches[0].clientX:e.clientX,l=I(e)?e.touches[0].clientY:e.clientY,c=this.state,p=c.direction,g=c.original,d=c.width,h=c.height,m=this.getParentSize(),u=function(e,t,o,i,n,r,a){return i=$(i,e.width,t,o),n=$(n,e.height,t,o),r=$(r,e.width,t,o),a=$(a,e.height,t,o),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===n?void 0:Number(n),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===a?void 0:Number(a)}}(m,this.window.innerWidth,this.window.innerHeight,i,n,r,a);i=u.maxWidth,n=u.maxHeight,r=u.minWidth,a=u.minHeight;var f=this.calculateNewSizeFromDirection(s,l),y=f.newHeight,w=f.newWidth,x=this.calculateNewMaxFromBoundary(i,n);this.props.snap&&this.props.snap.x&&(w=D(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(y=D(y,this.props.snap.y,this.props.snapGap));var b=this.calculateNewSizeFromAspectRatio(w,y,{width:x.maxWidth,height:x.maxHeight},{width:r,height:a});if(w=b.newWidth,y=b.newHeight,this.props.grid){var v=T(w,this.props.grid[0]),z=T(y,this.props.grid[1]),k=this.props.snapGap||0;w=0===k||Math.abs(v-w)<=k?v:w,y=0===k||Math.abs(z-y)<=k?z:y}var _={width:w-g.width,height:y-g.height};if(d&&"string"==typeof d)if(d.endsWith("%"))w=w/m.width*100+"%";else if(d.endsWith("vw")){w=w/this.window.innerWidth*100+"vw"}else if(d.endsWith("vh")){w=w/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))y=y/m.height*100+"%";else if(h.endsWith("vw")){y=y/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){y=y/this.window.innerHeight*100+"vh"}var R={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(y,"height")};"row"===this.flexDir?R.flexBasis=R.width:"column"===this.flexDir&&(R.flexBasis=R.height),C((function(){t.setState(R)})),this.props.onResize&&this.props.onResize(e,p,this.resizable,_)}},t.prototype.onMouseUp=function(e){var t=this.state,o=t.isResizing,i=t.direction,n=t.original;if(o&&this.resizable){var r={width:this.size.width-n.width,height:this.size.height-n.height};this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:B(B({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,o=t.enable,i=t.handleStyles,n=t.handleClasses,r=t.handleWrapperStyle,a=t.handleWrapperClass,s=t.handleComponent;if(!o)return null;var l=Object.keys(o).map((function(t){return!1!==o[t]?h.createElement(H,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:n&&n[t]},s&&s[t]?s[t]:null):null}));return h.createElement("div",{className:a,style:r},l)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,o){return-1!==Z.indexOf(o)||(t[o]=e.props[o]),t}),{}),o=B(B(B({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return h.createElement(i,B({ref:this.ref,style:o,className:this.props.className},t),this.state.isResizing&&h.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(h.PureComponent);function X(e){return J(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function q(e){var t;return null==(t=(J(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function J(e){return e instanceof Node||e instanceof Y(e).Node}function K(e){return e instanceof Element||e instanceof Y(e).Element}function Q(e){return e instanceof HTMLElement||e instanceof Y(e).HTMLElement}function ee(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot)}function te(e){const{overflow:t,overflowX:o,overflowY:i,display:n}=ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+o)&&!["inline","contents"].includes(n)}function oe(e){return["table","td","th"].includes(X(e))}function ie(e){const t=ne(),o=ae(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function ne(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function re(e){return["html","body","#document"].includes(X(e))}function ae(e){return Y(e).getComputedStyle(e)}function se(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function le(e){if("html"===X(e))return e;const t=e.assignedSlot||e.parentNode||ee(e)&&e.host||q(e);return ee(t)?t.host:t}function ce(e){const t=le(e);return re(t)?e.ownerDocument?e.ownerDocument.body:e.body:Q(t)&&te(t)?t:ce(t)}function pe(e,t,o){var i;void 0===t&&(t=[]),void 0===o&&(o=!0);const n=ce(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),a=Y(n);return r?t.concat(a,a.visualViewport||[],te(n)?n:[],a.frameElement&&o?pe(a.frameElement):[]):t.concat(n,pe(n,[],o))}const ge=Math.min,de=Math.max,he=Math.round,me=e=>({x:e,y:e}),ue={left:"right",right:"left",bottom:"top",top:"bottom"},fe={start:"end",end:"start"};function ye(e,t,o){return de(e,ge(t,o))}function we(e,t){return"function"==typeof e?e(t):e}function xe(e){return e.split("-")[0]}function be(e){return e.split("-")[1]}function ve(e){return"x"===e?"y":"x"}function Ce(e){return"y"===e?"height":"width"}function ze(e){return["top","bottom"].includes(xe(e))?"y":"x"}function ke(e){return ve(ze(e))}function _e(e){return e.replace(/start|end/g,(e=>fe[e]))}function Re(e){return e.replace(/left|right|bottom|top/g,(e=>ue[e]))}function Se(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 Oe(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function je(e,t,o){let{reference:i,floating:n}=e;const r=ze(t),a=ke(t),s=Ce(a),l=xe(t),c="y"===r,p=i.x+i.width/2-n.width/2,g=i.y+i.height/2-n.height/2,d=i[s]/2-n[s]/2;let h;switch(l){case"top":h={x:p,y:i.y-n.height};break;case"bottom":h={x:p,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:g};break;case"left":h={x:i.x-n.width,y:g};break;default:h={x:i.x,y:i.y}}switch(be(t)){case"start":h[a]-=d*(o&&c?-1:1);break;case"end":h[a]+=d*(o&&c?-1:1)}return h}async function Le(e,t){var o;void 0===t&&(t={});const{x:i,y:n,platform:r,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:d=!1,padding:h=0}=we(t,e),m=Se(h),u=s[d?"floating"===g?"reference":"floating":g],f=Oe(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(u)))||o?u:u.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:p,strategy:l})),y="floating"===g?{...a.floating,x:i,y:n}:a.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),x=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},b=Oe(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:w,strategy:l}):y);return{top:(f.top-b.top+m.top)/x.y,bottom:(b.bottom-f.bottom+m.bottom)/x.y,left:(f.left-b.left+m.left)/x.x,right:(b.right-f.right+m.right)/x.x}}function Ne(e){const t=ge(...e.map((e=>e.left))),o=ge(...e.map((e=>e.top)));return{x:t,y:o,width:de(...e.map((e=>e.right)))-t,height:de(...e.map((e=>e.bottom)))-o}}const Ee=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,i;const{x:n,y:r,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:o,platform:i,elements:n}=e,r=await(null==i.isRTL?void 0:i.isRTL(n.floating)),a=xe(o),s=be(o),l="y"===ze(o),c=["left","top"].includes(a)?-1:1,p=r&&l?-1:1,g=we(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:m}="number"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),l?{x:h*p,y:d*c}:{x:d*c,y:h*p}}(t,e);return a===(null==(o=s.offset)?void 0:o.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:a}}}}};function Me(e){const t=ae(e);let o=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const n=Q(e),r=n?e.offsetWidth:o,a=n?e.offsetHeight:i,s=he(o)!==r||he(i)!==a;return s&&(o=r,i=a),{width:o,height:i,$:s}}function He(e){return K(e)?e:e.contextElement}function We(e){const t=He(e);if(!Q(t))return me(1);const o=t.getBoundingClientRect(),{width:i,height:n,$:r}=Me(t);let a=(r?he(o.width):o.width)/i,s=(r?he(o.height):o.height)/n;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Be=me(0);function Pe(e){const t=Y(e);return ne()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Be}function Ae(e,t,o,i){void 0===t&&(t=!1),void 0===o&&(o=!1);const n=e.getBoundingClientRect(),r=He(e);let a=me(1);t&&(i?K(i)&&(a=We(i)):a=We(e));const s=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==Y(e))&&t}(r,o,i)?Pe(r):me(0);let l=(n.left+s.x)/a.x,c=(n.top+s.y)/a.y,p=n.width/a.x,g=n.height/a.y;if(r){const e=Y(r),t=i&&K(i)?Y(i):i;let o=e,n=o.frameElement;for(;n&&i&&t!==o;){const e=We(n),t=n.getBoundingClientRect(),i=ae(n),r=t.left+(n.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(n.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,p*=e.x,g*=e.y,l+=r,c+=a,o=Y(n),n=o.frameElement}}return Oe({width:p,height:g,x:l,y:c})}const Te=[":popover-open",":modal"];function Fe(e){return Te.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ie(e){return Ae(q(e)).left+se(e).scrollLeft}function De(e,t,o){let i;if("viewport"===t)i=function(e,t){const o=Y(e),i=q(e),n=o.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,l=0;if(n){r=n.width,a=n.height;const e=ne();(!e||e&&"fixed"===t)&&(s=n.offsetLeft,l=n.offsetTop)}return{width:r,height:a,x:s,y:l}}(e,o);else if("document"===t)i=function(e){const t=q(e),o=se(e),i=e.ownerDocument.body,n=de(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=de(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-o.scrollLeft+Ie(e);const s=-o.scrollTop;return"rtl"===ae(i).direction&&(a+=de(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:a,y:s}}(q(e));else if(K(t))i=function(e,t){const o=Ae(e,!0,"fixed"===t),i=o.top+e.clientTop,n=o.left+e.clientLeft,r=Q(e)?We(e):me(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:i*r.y}}(t,o);else{const o=Pe(e);i={...t,x:t.x-o.x,y:t.y-o.y}}return Oe(i)}function Ve(e,t){const o=le(e);return!(o===t||!K(o)||re(o))&&("fixed"===ae(o).position||Ve(o,t))}function $e(e,t,o){const i=Q(t),n=q(t),r="fixed"===o,a=Ae(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const l=me(0);if(i||!i&&!r)if(("body"!==X(t)||te(n))&&(s=se(t)),i){const e=Ae(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else n&&(l.x=Ie(n));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Ze(e,t){return Q(e)&&"fixed"!==ae(e).position?t?t(e):e.offsetParent:null}function Ue(e,t){const o=Y(e);if(!Q(e)||Fe(e))return o;let i=Ze(e,t);for(;i&&oe(i)&&"static"===ae(i).position;)i=Ze(i,t);return i&&("html"===X(i)||"body"===X(i)&&"static"===ae(i).position&&!ie(i))?o:i||function(e){let t=le(e);for(;Q(t)&&!re(t);){if(ie(t))return t;t=le(t)}return null}(e)||o}const Ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:i,strategy:n}=e;const r="fixed"===n,a=q(i),s=!!t&&Fe(t.floating);if(i===a||s&&r)return o;let l={scrollLeft:0,scrollTop:0},c=me(1);const p=me(0),g=Q(i);if((g||!g&&!r)&&(("body"!==X(i)||te(a))&&(l=se(i)),Q(i))){const e=Ae(i);c=We(i),p.x=e.x+i.clientLeft,p.y=e.y+i.clientTop}return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+p.x,y:o.y*c.y-l.scrollTop*c.y+p.y}},getDocumentElement:q,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:i,strategy:n}=e;const r=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let i=pe(e,[],!1).filter((e=>K(e)&&"body"!==X(e))),n=null;const r="fixed"===ae(e).position;let a=r?le(e):e;for(;K(a)&&!re(a);){const t=ae(a),o=ie(a);o||"fixed"!==t.position||(n=null),(r?!o&&!n:!o&&"static"===t.position&&n&&["absolute","fixed"].includes(n.position)||te(a)&&!o&&Ve(e,a))?i=i.filter((e=>e!==a)):n=t,a=le(a)}return t.set(e,i),i}(t,this._c):[].concat(o),i],a=r[0],s=r.reduce(((e,o)=>{const i=De(t,o,n);return e.top=de(i.top,e.top),e.right=ge(i.right,e.right),e.bottom=ge(i.bottom,e.bottom),e.left=de(i.left,e.left),e}),De(t,a,n));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ue,getElementRects:async function(e){const t=this.getOffsetParent||Ue,o=this.getDimensions;return{reference:$e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=Me(e);return{width:t,height:o}},getScale:We,isElement:K,isRTL:function(e){return"rtl"===ae(e).direction}},Xe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:i,placement:n}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...l}=we(e,t),c={x:o,y:i},p=await Le(t,l),g=ze(xe(n)),d=ve(g);let h=c[d],m=c[g];if(r){const e="y"===d?"bottom":"right";h=ye(h+p["y"===d?"top":"left"],h,h-p[e])}if(a){const e="y"===g?"bottom":"right";m=ye(m+p["y"===g?"top":"left"],m,m-p[e])}const u=s.fn({...t,[d]:h,[g]:m});return{...u,data:{x:u.x-o,y:u.y-i}}}}},Ye=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,i;const{placement:n,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:u=!0,...f}=we(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const y=xe(n),w=xe(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=d||(w||!u?[Re(s)]:function(e){const t=Re(e);return[_e(e),t,_e(t)]}(s));d||"none"===m||b.push(...function(e,t,o,i){const n=be(e);let r=function(e,t,o){const i=["left","right"],n=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?n:i:t?i:n;case"left":case"right":return t?r:a;default:return[]}}(xe(e),"start"===o,i);return n&&(r=r.map((e=>e+"-"+n)),t&&(r=r.concat(r.map(_e)))),r}(s,u,m,x));const v=[s,...b],C=await Le(t,f),z=[];let k=(null==(i=r.flip)?void 0:i.overflows)||[];if(p&&z.push(C[y]),g){const e=function(e,t,o){void 0===o&&(o=!1);const i=be(e),n=ke(e),r=Ce(n);let a="x"===n?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=Re(a)),[a,Re(a)]}(n,a,x);z.push(C[e[0]],C[e[1]])}if(k=[...k,{placement:n,overflows:z}],!z.every((e=>e<=0))){var _,R;const e=((null==(_=r.flip)?void 0:_.index)||0)+1,t=v[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let o=null==(R=k.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:R.placement;if(!o)switch(h){case"bestFit":{var S;const e=null==(S=k.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0];e&&(o=e);break}case"initialPlacement":o=s}if(n!==o)return{reset:{placement:o}}}return{}}}},qe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:i,rects:n,platform:r,strategy:a}=t,{padding:s=2,x:l,y:c}=we(e,t),p=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),g=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let i=null;for(let e=0;e<t.length;e++){const n=t[e];!i||n.y-i.y>i.height/2?o.push([n]):o[o.length-1].push(n),i=n}return o.map((e=>Oe(Ne(e))))}(p),d=Oe(Ne(p)),h=Se(s);const m=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===g.length&&g[0].left>g[1].right&&null!=l&&null!=c)return g.find((e=>l>e.left-h.left&&l<e.right+h.right&&c>e.top-h.top&&c<e.bottom+h.bottom))||d;if(g.length>=2){if("y"===ze(o)){const e=g[0],t=g[g.length-1],i="top"===xe(o),n=e.top,r=t.bottom,a=i?e.left:t.left,s=i?e.right:t.right;return{top:n,bottom:r,left:a,right:s,width:s-a,height:r-n,x:a,y:n}}const e="left"===xe(o),t=de(...g.map((e=>e.right))),i=ge(...g.map((e=>e.left))),n=g.filter((o=>e?o.left===i:o.right===t)),r=n[0].top,a=n[n.length-1].bottom;return{top:r,bottom:a,left:i,right:t,width:t-i,height:a-r,x:i,y:r}}return d}},floating:i.floating,strategy:a});return n.reference.x!==m.reference.x||n.reference.y!==m.reference.y||n.reference.width!==m.reference.width||n.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},Je=(e,t,o)=>{const i=new Map,n={platform:Ge,...o},r={...n.platform,_c:i};return(async(e,t,o)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:a}=o,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:n}),{x:p,y:g}=je(c,i,l),d=i,h={},m=0;for(let o=0;o<s.length;o++){const{name:r,fn:u}=s[o],{x:f,y:y,data:w,reset:x}=await u({x:p,y:g,initialPlacement:i,placement:d,strategy:n,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});p=null!=f?f:p,g=null!=y?y:g,h={...h,[r]:{...h[r],...w}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(c=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:n}):x.rects),({x:p,y:g}=je(c,d,l))),o=-1)}return{x:p,y:g,placement:d,strategy:n,middlewareData:h}})(e,t,{...n,platform:r})};var Ke="undefined"!=typeof document?y:u;function Qe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let o,i,n;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(i=o;0!=i--;)if(!Qe(e[i],t[i]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(i=o;0!=i--;)if(!{}.hasOwnProperty.call(t,n[i]))return!1;for(i=o;0!=i--;){const o=n[i];if(("_owner"!==o||!e.$$typeof)&&!Qe(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function et(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tt(e,t){const o=et(e);return Math.round(t*o)/o}function ot(e){const t=h.useRef(e);return Ke((()=>{t.current=e})),t}const it=h["useInsertionEffect".toString()]||(e=>e());var nt="undefined"!=typeof document?y:u;let rt=!1,at=0;const st=()=>"floating-ui-"+at++;const lt=h["useId".toString()]||function(){const[e,t]=h.useState((()=>rt?st():void 0));return nt((()=>{null==e&&t(st())}),[]),h.useEffect((()=>{rt||(rt=!0)}),[]),e};const ct=h.createContext(null),pt=h.createContext(null);function gt(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:i,nodeId:n}=e,[r,a]=h.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||r,l=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:i=[],platform:n,elements:{reference:r,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[p,g]=h.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=h.useState(i);Qe(d,i)||m(i);const[u,f]=h.useState(null),[y,w]=h.useState(null),x=h.useCallback((e=>{e!==k.current&&(k.current=e,f(e))}),[]),b=h.useCallback((e=>{e!==_.current&&(_.current=e,w(e))}),[]),C=r||u,z=a||y,k=h.useRef(null),_=h.useRef(null),R=h.useRef(p),S=null!=l,O=ot(l),j=ot(n),L=h.useCallback((()=>{if(!k.current||!_.current)return;const e={placement:t,strategy:o,middleware:d};j.current&&(e.platform=j.current),Je(k.current,_.current,e).then((e=>{const t={...e,isPositioned:!0};N.current&&!Qe(R.current,t)&&(R.current=t,v.flushSync((()=>{g(t)})))}))}),[d,t,o,j]);Ke((()=>{!1===c&&R.current.isPositioned&&(R.current.isPositioned=!1,g((e=>({...e,isPositioned:!1}))))}),[c]);const N=h.useRef(!1);Ke((()=>(N.current=!0,()=>{N.current=!1})),[]),Ke((()=>{if(C&&(k.current=C),z&&(_.current=z),C&&z){if(O.current)return O.current(C,z,L);L()}}),[C,z,L,O,S]);const E=h.useMemo((()=>({reference:k,floating:_,setReference:x,setFloating:b})),[x,b]),M=h.useMemo((()=>({reference:C,floating:z})),[C,z]),H=h.useMemo((()=>{const e={position:o,left:0,top:0};if(!M.floating)return e;const t=tt(M.floating,p.x),i=tt(M.floating,p.y);return s?{...e,transform:"translate("+t+"px, "+i+"px)",...et(M.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:i}}),[o,s,M.floating,p.x,p.y]);return h.useMemo((()=>({...p,update:L,refs:E,elements:M,floatingStyles:H})),[p,L,E,M,H])}(e),c=h.useContext(pt),p=null!=((null==(g=h.useContext(ct))?void 0:g.id)||null);var g;const d=function(e){const t=h.useRef((()=>{}));return it((()=>{t.current=e})),h.useCallback((function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(u.current.openEvent=t),f.emit("openchange",{open:e,event:t,reason:o,nested:p}),null==i||i(e,t,o)})),m=h.useRef(null),u=h.useRef({}),f=h.useState((()=>function(){const e=new Map;return{emit(t,o){var i;null==(i=e.get(t))||i.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var i;e.set(t,(null==(i=e.get(t))?void 0:i.filter((e=>e!==o)))||[])}}}()))[0],y=lt(),w=h.useCallback((e=>{const t=K(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),x=h.useCallback((e=>{(K(e)||null===e)&&(m.current=e,a(e)),(K(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!K(e))&&l.refs.setReference(e)}),[l.refs]),b=h.useMemo((()=>({...l.refs,setReference:x,setPositionReference:w,domReference:m})),[l.refs,x,w]),C=h.useMemo((()=>({...l.elements,domReference:s})),[l.elements,s]),z=h.useMemo((()=>({...l,refs:b,elements:C,dataRef:u,nodeId:n,floatingId:y,events:f,open:o,onOpenChange:d})),[l,n,y,f,o,d,b,C]);return nt((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===n));e&&(e.context=z)})),h.useMemo((()=>({...l,context:z,refs:b,elements:C})),[l,b,C,z])}function dt(e,t){if(null==e)return{};var o,i,n={},r=Object.keys(e);for(i=0;i<r.length;i++)o=r[i],t.indexOf(o)>=0||(n[o]=e[o]);return n}var ht=["color"],mt=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,ht);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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"}))})),ut=["color"],ft=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,ut);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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"}))})),yt=["color"],wt=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,yt);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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"}))})),xt=["color"],bt=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,xt);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("path",{d:"M3.94993 2.95002L3.94993 4.49998C3.94993 4.74851 3.74845 4.94998 3.49993 4.94998C3.2514 4.94998 3.04993 4.74851 3.04993 4.49998V2.50004C3.04993 2.45246 3.05731 2.40661 3.07099 2.36357C3.12878 2.18175 3.29897 2.05002 3.49993 2.05002H11.4999C11.6553 2.05002 11.7922 2.12872 11.8731 2.24842C11.9216 2.32024 11.9499 2.40682 11.9499 2.50002L11.9499 2.50004V4.49998C11.9499 4.74851 11.7485 4.94998 11.4999 4.94998C11.2514 4.94998 11.0499 4.74851 11.0499 4.49998V2.95002H8.04993V12.05H9.25428C9.50281 12.05 9.70428 12.2515 9.70428 12.5C9.70428 12.7486 9.50281 12.95 9.25428 12.95H5.75428C5.50575 12.95 5.30428 12.7486 5.30428 12.5C5.30428 12.2515 5.50575 12.05 5.75428 12.05H6.94993V2.95002H3.94993Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),vt=["color"],Ct=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,vt);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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"}))})),zt=["color"],kt=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,zt);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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"}))})),_t=["color"],Rt=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,_t);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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"}))})),St=["color"],Ot=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,St);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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"}))})),jt=["color"],Lt=w((function(e,t){var o=e.color,i=void 0===o?"currentColor":o,n=dt(e,jt);return x("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),x("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 Nt=({blockId:e,onClose:t})=>{const i=n(),[r,a]=m(""),s=0===r.length;return p("div",Object.assign({className:"yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-white-space-nowrap yoo-image-w-full"},{children:[g("input",{type:"text",placeholder:"Paste image link",value:r,className:"yoo-image-items-center yoo-image-bg-[hsla(45,13%,94%,.6)] yoo-image-rounded-[4px] yoo-image-shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] yoo-image-cursor-text yoo-image-flex yoo-image-text-[14px] yoo-image-h-[32px] yoo-image-leading-[20px] yoo-image-px-[6px] yoo-image-relative yoo-image-w-full yoo-image-border-none",onChange:e=>a(e.target.value)}),g("button",Object.assign({type:"button",className:"yoopta-button yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-cursor-pointer yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-flex-shrink-0 yoo-image-white-space-nowrap yoo-image-h-[28px] yoo-image-rounded-[4px] yoo-image-shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] yoo-image-bg-[rgb(35,131,226)] yoo-image-text-white yoo-image-fill-white yoo-image-leading-[1.2] yoo-image-px-[12px] yoo-image-text-[14px] yoo-image-font-medium yoo-image-w-full yoo-image-max-w-[300px] yoo-image-mx-auto yoo-image-m-[12px_0_6px] disabled:yoo-image-bg-[rgba(35,131,226,0.5)] disabled:yoo-image-cursor-not-allowed",disabled:s,onClick:()=>{0!==r.length&&(o.updateElement(i,e,{type:"image",props:{src:r}}),t())}},{children:"Embed image"}))]}))},Et=e=>"number"==typeof e?e:parseInt(e.replace(/[^\d]/g,"")),Mt=(e,t)=>{const o=Et(e.width),i=Et(e.height),n=Et(t.width),r=Et(t.height);if(o<=n&&i<=r)return{width:o,height:i};const a=o/n,s=i/r,l=Math.max(a,s),c=Math.round(o/l),p=Math.round(i/l);return{width:Math.min(c,n),height:Math.min(p,r)}},Ht=({accept:e="image/*",onClose:t,blockId:i,onSetLoading:a})=>{const s=r("Image"),l=n();return g("div",Object.assign({className:"yoo-image-user-select-none yoo-image-transition-bg yoo-image-duration-20 yoo-image-ease-in yoo-image-white-space-nowrap yoo-image-rounded-[4px] yoo-image-h-[32px] yoo-image-px-[12px] yoo-image-border yoo-image-border-solid yoo-image-border-[rgba(55,53,47,0.16)] yoo-image-w-full yoo-image-cursor-pointer"},{children:p("label",Object.assign({htmlFor:"image-uploader",className:"yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-font-medium yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-h-full"},{children:[g("input",{type:"file",id:"image-uploader",className:"yoo-image-absolute yoo-image-left-0 yoo-image-top-0 yoo-image-invisible",accept:(null==s?void 0:s.accept)||e,onChange:e=>{const n=e.target.files[0];n&&(e=>{k(void 0,void 0,void 0,(function*(){var n,r;if(null==s?void 0:s.onUpload){t(),a(!0);try{const t=yield null==s?void 0:s.onUpload(e),r=l.plugins.Image.elements.image.props,a=t.sizes||r.sizes,c=null===(n=l.plugins.Image.options)||void 0===n?void 0:n.maxSizes,p=Mt(a,{width:c.maxWidth,height:c.maxHeight});o.updateElement(l,i,{type:"image",props:{src:t.src,alt:t.alt,sizes:p,bgColor:t.bgColor||r.bgColor,fit:t.fit||r.fit||"fill"}})}catch(e){null===(r=null==s?void 0:s.onError)||void 0===r||r.call(s,e)}finally{a(!1)}}else console.warn("onUpload not provided")}))})(n)},multiple:!1}),"Upload image"]}))}))},{Overlay:Wt,Portal:Bt}=i,Pt=({floatingStyles:e,refs:t,onClose:o,blockId:i,onSetLoading:n})=>{const[r,a]=m("upload"),s=e=>a(e),l="upload"===r,c="embed"===r,d=e=>({borderBottom:e?"2px solid #2483e2":"2px solid transparent"});return g(Bt,Object.assign({id:"yoo-image-uploader-portal"},{children:g(Wt,Object.assign({lockScroll:!0,className:"yoo-image-z-[100]",onClick:o},{children:g("div",Object.assign({ref:t.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:p("div",Object.assign({className:"yoo-image-flex yoo-image-flex-col yoo-image-min-w-[540px] yoo-image-max-w-[calc(100vw-24px)] yoo-image-h-full yoo-image-max-h-[420px] yoo-image-bg-[#FFFFFF] yoo-image-shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[p("div",Object.assign({className:"yoo-image-w-full yoo-image-flex yoo-image-text-[14px] yoo-image-p-[0_8px] yoo-image-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-image-relative yoo-image-z-10 yoo-image-h-[40px]"},{children:[g("button",Object.assign({type:"button",onClick:()=>s("upload"),style:d(l),className:"yoopta-button yoo-image-py-[6px] yoo-image-whitespace-nowrap yoo-image-min-w-0 yoo-image-flex-shrink-0 yoo-image-text-[rgb(55,53,47)] yoo-image-relative yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-bg-inherit yoo-image-transition-[height_20ms_ease-in] yoo-image-inline-flex yoo-image-items-center yoo-image-h-full yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-px-[8px]"},{children:"Upload"})),g("button",Object.assign({type:"button",onClick:()=>s("embed"),style:d(c),className:"yoopta-button yoo-image-py-[6px] yoo-image-whitespace-nowrap yoo-image-min-w-0 yoo-image-flex-shrink-0 yoo-image-text-[rgb(55,53,47)] yoo-image-relative yoo-image-cursor-pointer yoo-image-user-select-none yoo-image-bg-inherit yoo-image-transition-[height_20ms_ease-in] yoo-image-inline-flex yoo-image-items-center yoo-image-h-full yoo-image-text-[14px] yoo-image-leading-[1.2] yoo-image-px-[8px]"},{children:"Image link"}))]})),p("div",Object.assign({className:"yoo-image-pt-[6px] yoo-image-pb-[6px] yoo-image-mt-[4px] yoo-image-flex yoo-image-justify-center yoo-image-mr-[12px] yoo-image-ml-[12px]"},{children:[c&&g(Nt,{onClose:o,blockId:i}),l&&g(Ht,{onClose:o,blockId:i,onSetLoading:n})]}))]}))}))}))}))},At=({className:e,width:t,height:o,children:i})=>p("div",Object.assign({className:e},{children:[i,g("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-image-h-4 yoo-image-w-4 yoo-image-animate-spin"},{children:g("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),Tt=({attributes:e,children:t,blockId:o})=>{const[i,n]=m(!1),[r,a]=m(!1),{refs:s,floatingStyles:l}=gt({placement:"bottom",open:i,onOpenChange:n,middleware:[qe(),Ye(),Xe(),Ee(10)]});return p("div",Object.assign({className:"yoo-image-w-full yoo-image-user-select-none yoo-image-m-[20px_0_10px] yoo-image-relative yoo-image-flex"},e,{contentEditable:!1},{children:[p("button",Object.assign({className:"yoopta-button yoo-image-p-[12px_36px_12px_12px] yoo-image-flex yoo-image-items-center yoo-image-text-left yoo-image-w-full yoo-image-overflow-hidden yoo-image-rounded-[3px] yoo-image-text-[14px] yoo-image-text-[rgba(55,53,47,0.65)] yoo-image-relative yoo-image-cursor-pointer yoo-image-border-none yoo-image-bg-[#efefef] yoo-image-transition-[background-color_100ms_ease-in] hover:yoo-image-bg-[#e3e3e3]",onClick:()=>n(!0),disabled:r,type:"button",ref:s.setReference},{children:[g(r?At:mt,{className:"yoo-image-mr-2 yoo-image-user-select-none",width:24,height:24}),g("span",Object.assign({className:"yoo-image-font-medium"},{children:r?"Loading...":"Click to add image"})),r&&g("div",{className:"yoo-image-absolute yoo-image-top-0 yoo-image-left-0 yoo-image-h-full yoo-image-bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),i&&g(Pt,{blockId:o,floatingStyles:l,refs:s,onClose:()=>n(!1),onSetLoading:e=>a(e)}),t]}))};var Ft;function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},It.apply(this,arguments)}var Dt,Vt=function(e){return h.createElement("svg",It({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),Ft||(Ft=h.createElement("path",{d:"M20 6 9 17l-5-5"})))};function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},$t.apply(this,arguments)}var Zt=function(e){return h.createElement("svg",$t({viewBox:"0 0 16 16",style:{width:16,height:16,display:"block",fill:"rgba(55,53,47,.85)",flexShrink:0}},e),Dt||(Dt=h.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{Overlay:Ut,Portal:Gt}=i,Xt=({floatingStyles:e,onClose:t,refs:o,value:i,onChange:n,onSave:r,onDelete:a})=>g(Gt,Object.assign({id:"yoo-image-uploader-portal"},{children:g(Ut,Object.assign({lockScroll:!0,className:"yoo-image-z-[100]",onClick:t},{children:g("div",Object.assign({ref:o.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:p("div",Object.assign({className:"yoopta-image-input-root yoo-image-shadow-y-[4px]"},{children:[p("div",{children:[g("label",Object.assign({htmlFor:"alt",className:"yoopta-image-input-label"},{children:"Alternative text"})),g("input",{id:"alt",type:"text",className:"yoopta-image-input-ui",name:"alt",value:i,onChange:e=>n(e.target.value),placeholder:"Edit alt text",autoComplete:"off"})]}),p("div",Object.assign({className:"yoo-image-mt-2 yoo-image-flex yoo-image-justify-between"},{children:[g("button",Object.assign({type:"button",className:"yoopta-button yoo-image-bg-[#1183ff] yoo-image-text-[#fff] yoo-image-text-sm yoo-image-font-medium yoo-image-py-[5px] yoo-image-px-[10px] yoo-image-rounded-md yoo-image-shadow-sm disabled:yoo-image-opacity-50",disabled:!i,onClick:r},{children:"Update"})),g("button",Object.assign({type:"button",className:"yoopta-button yoo-image-ml-2 yoo-image-bg-[#f4f4f5] yoo-image-text-[#000] yoo-image-text-sm yoo-image-font-medium yoo-image-py-[5px] yoo-image-px-[10px] yoo-image-rounded-md yoo-image-shadow-sm disabled:yoo-image-opacity-50",onClick:a},{children:"Delete"}))]}))]}))}))}))})),Yt={left:kt,center:Ct,right:Rt},{ExtendedBlockActions:qt,BlockOptionsMenuGroup:Jt,BlockOptionsMenuItem:Kt,BlockOptionsSeparator:Qt}=i,eo=({editor:e,block:i,props:n})=>{var a;const s=r("Image"),[l,c]=m(!1),[d,h]=m(!1),[u,f]=m((null==n?void 0:n.alt)||""),{refs:y,floatingStyles:w}=gt({placement:"left",open:l,onOpenChange:c,middleware:[qe(),Ye(),Xe(),Ee(10)]}),x=e=>h(e),b=(null===(a=null==i?void 0:i.meta)||void 0===a?void 0:a.align)||"center",v=Yt[b];return p(qt,Object.assign({onClick:()=>e.setPath({current:i.meta.order}),className:"yoopta-image-options"},{children:[g(Qt,{}),p(Jt,{children:[g(Kt,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-image-justify-between",onClick:()=>{o.updateElement(e,i.id,{type:"image",props:{fit:"contain"}})}},{children:[p("span",Object.assign({className:"yoo-image-flex"},{children:[g(ft,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Fit"]})),"contain"===(null==n?void 0:n.fit)&&g(Vt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4"})]}))}),g(Kt,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-image-justify-between",onClick:()=>{o.updateElement(e,i.id,{type:"image",props:{fit:"fill"}})}},{children:[p("span",Object.assign({className:"yoo-image-flex"},{children:[g(Lt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Fill"]})),"fill"===(null==n?void 0:n.fit)&&g(Vt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4"})]}))}),g(Kt,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button yoo-image-justify-between",onClick:()=>{o.updateElement(e,i.id,{type:"image",props:{fit:"cover"}})}},{children:[p("span",Object.assign({className:"yoo-image-flex"},{children:[g(wt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Cover"]})),"cover"===(null==n?void 0:n.fit)&&g(Vt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4"})]}))})]}),g(Qt,{}),p(Jt,{children:[l&&g(Xt,{value:u,onChange:e=>f(e),floatingStyles:w,onClose:()=>c(!1),refs:y,onDelete:()=>{f(""),o.updateElement(e,i.id,{type:"image",props:{alt:""}}),c(!1)},onSave:()=>{u&&(o.updateElement(e,i.id,{type:"image",props:{alt:u}}),c(!1))}}),g(Kt,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:y.setReference,onClick:()=>c(!0)},{children:[g(bt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Alt text"]}))}),g(Kt,{children:p("label",Object.assign({htmlFor:"image-uploader",className:"yoo-image-rounded-sm yoo-image-relative hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start data-[disabled=true]:yoo-image-cursor-not-allowed data-[disabled=true]:yoo-image-pointer-events-none data-[disabled=true]:yoo-image-opacity-50","data-disabled":d},{children:[g("input",{type:"file",accept:s.accept,multiple:!1,id:"image-uploader",className:"yoo-image-absolute yoo-image-hidden",onChange:t=>k(void 0,void 0,void 0,(function*(){var r;if(!(null==s?void 0:s.onUpload))throw new Error("onUpload not provided in plugin options. Check Image.extend({}) method");const a=null===(r=t.target.files)||void 0===r?void 0:r[0];if(a){x(!0);try{const t=yield null==s?void 0:s.onUpload(a),r=e.plugins.Image.elements.image.props;o.updateElement(e,i.id,{type:"image",props:{src:t.src,alt:t.alt,sizes:t.sizes||r.sizes,bgColor:(null==n?void 0:n.bgColor)||t.bgColor||r.bgColor,fit:(null==n?void 0:n.fit)||t.fit||r.fit||"fill"}})}catch(e){}finally{x(!1)}}})),disabled:d}),d?g(At,{className:"yoo-image-mr-2 yoo-image-user-select-none",width:24,height:24}):g(Ot,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Replace image"]}))})]}),g(Qt,{}),p(Jt,{children:[g(Kt,{children:p("button",Object.assign({type:"button",className:"yoopta-button yoo-image-rounded-sm hover:yoo-image-bg-[#37352f14] yoo-image-leading-[120%] yoo-image-px-2 yoo-image-py-1.5 yoo-image-mx-[4px] yoo-image-cursor-pointer yoo-image-w-full yoo-image-flex yoo-image-justify-start",onClick:()=>{const o=["left","center","right"];if(!i)return;const n=o[(o.indexOf(b)+1)%o.length];t.updateBlock(e,i.id,{meta:Object.assign(Object.assign({},i.meta),{align:n})})}},{children:[g(v,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Alignment"]}))}),g(Kt,{children:p("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{if(!n||!n.src)return;const e=document.createElement("a");e.href=n.src,e.download=n.alt||n.src,e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},{children:[g(Zt,{width:16,height:16,className:"yoo-image-w-4 yoo-image-h-4 yoo-image-mr-2"}),"Download"]}))})]})]}))},to=({position:e})=>g("div",Object.assign({contentEditable:!1,className:"yoo-image-absolute yoo-image-pointer-events-none yoo-image-flex yoo-image-items-center yoo-image-justify-center yoo-image-z-10 yoo-image-opacity-1 yoo-image-h-full yoo-image-w-[15px] yoo-image-cursor-col-resize yoo-image-transition-opacity yoo-image-duration-150 yoo-image-ease-in "+("left"===e?"yoo-image-left-0 yoo-image-top-0":"yoo-image-right-0 yoo-image-top-0")},{children:g("div",{className:"yoo-image-opacity-100 yoo-image-transition-opacity yoo-image-duration-300 yoo-image-ease-in yoo-image-rounded-[20px] yoo-image-bg-[rgba(15,15,15,0.6)] yoo-image-border yoo-image-border-solid yoo-image-border-[rgba(255,255,255,0.9)] yoo-image-w-[6px] yoo-image-h-[48px] yoo-image-max-h-[50%] yoo-image-shadow-[0_0_0_.5px_#FFF]"})})),oo={left:"flex-start",center:"center",right:"flex-end"},io=new c({type:"Image",elements:{image:{render:e=>{var t,{extendRender:i}=e,c=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o}(e,["extendRender"]);const{element:h,blockId:f,children:y,attributes:w}=c,{src:x,alt:v,srcSet:C,bgColor:z,fit:k,sizes:_}=h.props||{},S=a(f),O=n(),j=s(),L=r("Image"),[N,E]=m({width:(null==_?void 0:_.width)||650,height:(null==_?void 0:_.height)||440});u((()=>E({width:(null==_?void 0:_.width)||650,height:(null==_?void 0:_.height)||440})),[h.props]);const M=l({blockId:f}),H=b((()=>{var e,t;return{minWidth:300,size:{width:N.width,height:N.height},maxWidth:(null===(e=null==L?void 0:L.maxSizes)||void 0===e?void 0:e.maxWidth)||800,maxHeight:(null===(t=null==L?void 0:L.maxSizes)||void 0===t?void 0:t.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!j,right:!j},handleStyles:{left:{left:0},right:{right:0}},onResize:(e,t,o)=>{j||E({width:o.offsetWidth,height:o.offsetHeight})},onResizeStop:(e,t,i)=>{j||o.updateElement(O,f,{type:"image",props:{sizes:{width:i.offsetWidth,height:i.offsetHeight}}})},handleComponent:{left:j?g(d,{}):g(to,{position:"left"}),right:j?g(d,{}):g(to,{position:"right"})}}}),[N.width,N.height]);if(!x)return j?g(d,{}):g(Tt,Object.assign({attributes:w,blockId:f},{children:y}));const W=`yoopta-align-${(null===(t=null==S?void 0:S.meta)||void 0===t?void 0:t.align)||"center"}`;return g("div",Object.assign({contentEditable:!1,draggable:!1,className:`yoo-image-mt-4 yoo-image-relative yoo-image-flex ${W} yoopta-image`},{children:p(G,Object.assign({},H,{className:"yoo-image-my-0 yoo-image-flex"},{children:[M&&g("div",{className:"yoo-image-absolute yoo-image-pointer-events-none yoo-image-inset-0 yoo-image-bg-[rgba(35,131,226,0.14)] yoo-image-z-[81] yoo-image-rounded-[3px] yoo-image-opacity-100 yoo-image-transition-opacity yoo-image-duration-150 yoo-image-ease-in"}),i?i(c):g(R,Object.assign({src:x,alt:v,srcSet:C,fit:k,width:null==N?void 0:N.width,bgColor:z,height:null==N?void 0:N.height,attributes:w},{children:y})),!j&&g(eo,{block:S,editor:O,props:h.props})]}))}))},props:{src:null,alt:null,srcSet:null,bgColor:null,fit:"contain",sizes:{width:650,height:500},nodeType:"void"}}},commands:z,options:{display:{title:"Image",description:"Upload from device or insert with link"},onUpload:()=>Promise.resolve({src:null,alt:null}),accept:"image/png, image/jpeg, image/gif, image/webp",maxSizes:{maxWidth:650,maxHeight:550}},parsers:{html:{deserialize:{nodeNames:["IMG"],parse:(t,o)=>{var i;if("IMG"===t.nodeName){const n={width:t.getAttribute("width")?parseInt(t.getAttribute("width")||"650",10):650,height:t.getAttribute("height")?parseInt(t.getAttribute("height")||"500",10):500},r=null===(i=o.plugins.Image.options)||void 0===i?void 0:i.maxSizes,a=Mt(n,{width:r.maxWidth,height:r.maxHeight}),s={nodeType:"void",src:t.getAttribute("src")||"",alt:t.getAttribute("alt")||"",srcSet:t.getAttribute("srcset")||"",fit:t.getAttribute("objectFit")||"contain",sizes:a};return{id:e(),type:"image",children:[{text:""}],props:s}}}},serialize:(e,t,o)=>{const{align:i="center",depth:n=0}=o||{};return`<div style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${oo[i]||"center"};">\n <img data-meta-align="${i}" data-meta-depth="${n}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" objectFit="${e.props.fit}"/>\n </div>`}},markdown:{serialize:(e,t)=>`![${e.props.alt||e.id}](${e.props.src})\n`},email:{serialize:(e,t,o)=>{const{align:i="center",depth:n=0}=o||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${oo[i]||"center"}; margin-top: 1rem;">\n <img data-meta-align="${i}" style="margin: 0 auto; object-fit:${e.props.fit||"contain"};" data-meta-depth="${n}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" />\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".yoo-image-pointer-events-none{pointer-events:none}.yoo-image-invisible{visibility:hidden}.yoo-image-absolute{position:absolute}.yoo-image-relative{position:relative}.yoo-image-inset-0{inset:0}.yoo-image-left-0{left:0}.yoo-image-right-0{right:0}.yoo-image-top-0{top:0}.yoo-image-z-10{z-index:10}.yoo-image-z-\\[100\\]{z-index:100}.yoo-image-z-\\[81\\]{z-index:81}.yoo-image-m-\\[12px_0_6px\\]{margin:12px 0 6px}.yoo-image-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-image-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-image-mx-auto{margin-left:auto;margin-right:auto}.yoo-image-my-0{margin-bottom:0;margin-top:0}.yoo-image-ml-2{margin-left:.5rem}.yoo-image-ml-\\[12px\\]{margin-left:12px}.yoo-image-mr-2{margin-right:.5rem}.yoo-image-mr-\\[12px\\]{margin-right:12px}.yoo-image-mt-2{margin-top:.5rem}.yoo-image-mt-4{margin-top:1rem}.yoo-image-mt-\\[4px\\]{margin-top:4px}.yoo-image-flex{display:flex}.yoo-image-inline-flex{display:inline-flex}.yoo-image-hidden{display:none}.yoo-image-h-4{height:1rem}.yoo-image-h-\\[28px\\]{height:28px}.yoo-image-h-\\[32px\\]{height:32px}.yoo-image-h-\\[40px\\]{height:40px}.yoo-image-h-\\[48px\\]{height:48px}.yoo-image-h-full{height:100%}.yoo-image-max-h-\\[420px\\]{max-height:420px}.yoo-image-max-h-\\[50\\%\\]{max-height:50%}.yoo-image-w-4{width:1rem}.yoo-image-w-\\[15px\\]{width:15px}.yoo-image-w-\\[6px\\]{width:6px}.yoo-image-w-full{width:100%}.yoo-image-min-w-0{min-width:0}.yoo-image-min-w-\\[540px\\]{min-width:540px}.yoo-image-max-w-\\[300px\\]{max-width:300px}.yoo-image-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-image-flex-shrink-0{flex-shrink:0}@keyframes yoo-image-spin{to{transform:rotate(1turn)}}.yoo-image-animate-spin{animation:yoo-image-spin 1s linear infinite}.yoo-image-cursor-col-resize{cursor:col-resize}.yoo-image-cursor-pointer{cursor:pointer}.yoo-image-cursor-text{cursor:text}.yoo-image-flex-col{flex-direction:column}.yoo-image-items-center{align-items:center}.yoo-image-justify-start{justify-content:flex-start}.yoo-image-justify-center{justify-content:center}.yoo-image-justify-between{justify-content:space-between}.yoo-image-overflow-hidden{overflow:hidden}.yoo-image-whitespace-nowrap{white-space:nowrap}.yoo-image-rounded-\\[20px\\]{border-radius:20px}.yoo-image-rounded-\\[3px\\]{border-radius:3px}.yoo-image-rounded-\\[4px\\]{border-radius:4px}.yoo-image-rounded-md{border-radius:.375rem}.yoo-image-rounded-sm{border-radius:.125rem}.yoo-image-border{border-width:1px}.yoo-image-border-solid{border-style:solid}.yoo-image-border-none{border-style:none}.yoo-image-border-\\[rgba\\(255\\,255\\,255\\,0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.yoo-image-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.yoo-image-bg-\\[\\#1183ff\\]{--tw-bg-opacity:1;background-color:rgb(17 131 255/var(--tw-bg-opacity))}.yoo-image-bg-\\[\\#FFFFFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-image-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-image-bg-\\[\\#f4f4f5\\]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity))}.yoo-image-bg-\\[hsla\\(45\\,13\\%\\,94\\%\\,\\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.yoo-image-bg-\\[rgb\\(35\\,131\\,226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.yoo-image-bg-\\[rgba\\(15\\,15\\,15\\,0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.yoo-image-bg-\\[rgba\\(255\\,255\\,255\\,0\\.95\\)\\]{background-color:hsla(0,0%,100%,.95)}.yoo-image-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-image-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.yoo-image-bg-inherit{background-color:inherit}.yoo-image-fill-white{fill:#fff}.yoo-image-p-\\[0_8px\\]{padding:0 8px}.yoo-image-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-image-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-image-px-\\[10px\\]{padding-left:10px;padding-right:10px}.yoo-image-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-image-px-\\[6px\\]{padding-left:6px;padding-right:6px}.yoo-image-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-image-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-image-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-image-py-\\[5px\\]{padding-bottom:5px;padding-top:5px}.yoo-image-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-image-pb-\\[6px\\]{padding-bottom:6px}.yoo-image-pt-\\[6px\\]{padding-top:6px}.yoo-image-text-left{text-align:left}.yoo-image-text-\\[14px\\]{font-size:14px}.yoo-image-text-sm{font-size:.875rem;line-height:1.25rem}.yoo-image-font-medium{font-weight:500}.yoo-image-leading-\\[1\\.2\\]{line-height:1.2}.yoo-image-leading-\\[120\\%\\]{line-height:120%}.yoo-image-leading-\\[20px\\]{line-height:20px}.yoo-image-text-\\[\\#000\\]{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.yoo-image-text-\\[\\#fff\\]{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoo-image-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-image-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-image-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoo-image-opacity-100{opacity:1}.yoo-image-shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[inset_0_0_0_1px_hsla\\(0\\,0\\%\\,6\\%\\,\\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\,_rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\,_rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-\\[rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_0px_0px_1px_inset\\,_rgba\\(15\\,15\\,15\\,0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-image-transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-image-duration-150{transition-duration:.15s}.yoo-image-duration-300{transition-duration:.3s}.yoo-image-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-image .yoopta-image-options{opacity:0;transition:opacity .15s ease-in-out}.yoopta-image:hover .yoopta-image-options{opacity:1}.yoopta-image-inner{position:relative;width:100%}.yoopta-image-input-root{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-radius:.375rem;border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);display:flex;flex-direction:column;min-width:340px;padding:10px;z-index:50}.yoopta-image-input-label{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity));display:block;font-size:.75rem;font-weight:500;line-height:1rem;margin-bottom:5px}.yoopta-image-input-ui{--tw-border-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(229 231 235/var(--tw-border-opacity));border-radius:.375rem;border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(55 65 81/var(--tw-text-opacity));font-size:.875rem;font-weight:500;line-height:1.25rem;padding:5px 10px;width:100%}.yoopta-image-alt{background-color:#00000099;border-radius:.25rem;bottom:8px;position:absolute;right:8px}.yoopta-image-alt-text{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));cursor:pointer;font-size:10px;font-weight:500;padding:4px 6px}.yoopta-image-zoom-overlay{height:100%;width:100%;z-index:50}.hover\\:yoo-image-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:yoo-image-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:yoo-image-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:yoo-image-bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}.disabled\\:yoo-image-opacity-50:disabled{opacity:.5}.data-\\[disabled\\=true\\]\\:yoo-image-pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\[disabled\\=true\\]\\:yoo-image-cursor-not-allowed[data-disabled=true]{cursor:not-allowed}.data-\\[disabled\\=true\\]\\:yoo-image-opacity-50[data-disabled=true]{opacity:.5}");export{z as ImageCommands,io as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{generateId as r,Blocks as s,Elements as n,YooptaPlugin as i}from"@yoopta/editor";import{useState as o,useRef as a,useCallback as l}from"react";const d={buildImageElements:(e,t={})=>{const s=Object.assign(Object.assign({},t.props),{nodeType:"void"});return{id:r(),type:"image",children:[{text:""}],props:s}},insertImage:(e,t={})=>{const{at:r,focus:n,props:i}=t,o=d.buildImageElements(e,{props:i}),a=s.buildBlockData({value:[o],type:"Image",meta:{align:"center",depth:0}});s.insertBlock(e,a.type,{focus:n,at:r,blockData:a})},deleteImage:(e,t)=>{s.deleteBlock(e,{blockId:t})},updateImage:(e,t,r)=>{n.updateElement(e,{blockId:t,type:"image",props:r})}},c=e=>"number"==typeof e?e:parseInt(e.replace(/[^\d]/g,""),10),p={left:"flex-start",center:"center",right:"flex-end"},g=new i({type:"Image",elements:e("image",{render:r=>{var s,n;return t("div",Object.assign({},r.attributes,{contentEditable:!1},{children:[e("img",{src:r.element.props.src,alt:r.element.props.alt,width:null===(s=r.element.props.sizes)||void 0===s?void 0:s.width,height:null===(n=r.element.props.sizes)||void 0===n?void 0:n.height,style:{objectFit:r.element.props.fit}}),r.children]}))},props:{id:null,src:null,alt:null,srcSet:null,bgColor:null,fit:null,sizes:{width:0,height:0}},nodeType:"void"}),commands:d,options:{display:{title:"Image",description:"Upload from device or insert with link"},maxSizes:{maxWidth:650,maxHeight:550}},parsers:{html:{deserialize:{nodeNames:["IMG"],parse:(e,t)=>{var s;if("IMG"===e.nodeName){const n={width:e.getAttribute("width")?parseInt(e.getAttribute("width")||"650",10):650,height:e.getAttribute("height")?parseInt(e.getAttribute("height")||"500",10):500},i=null===(s=t.plugins.Image.options)||void 0===s?void 0:s.maxSizes,o=((e,t)=>{const r=c(e.width),s=c(e.height),n=c(t.width),i=c(t.height);if(r<=n&&s<=i)return{width:r,height:s};const o=r/n,a=s/i,l=Math.max(o,a),d=Math.round(r/l),p=Math.round(s/l);return{width:Math.min(d,n),height:Math.min(p,i)}})(n,{width:i.maxWidth,height:i.maxHeight}),a={id:r(),nodeType:"void",src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",srcSet:e.getAttribute("srcset")||"",fit:e.getAttribute("objectFit")||"contain",sizes:o};return{id:r(),type:"image",children:[{text:""}],props:a}}}},serialize:(e,t,r)=>{const{align:s="center",depth:n=0}=r||{};return`<div style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${p[s]||"center"};">\n <img data-meta-align="${s}" data-meta-depth="${n}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" objectFit="${e.props.fit}"/>\n </div>`}},markdown:{serialize:e=>`![${e.props.alt||e.id}](${e.props.src})\n`},email:{serialize:(e,t,r)=>{const{align:s="center",depth:n=0}=r||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${p[s]||"center"}; margin-top: 1rem;">\n <img data-meta-align="${s}" style="margin: 0 auto; object-fit:${e.props.fit||"contain"};" data-meta-depth="${n}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" />\n </td>\n </tr>\n </tbody>\n </table>\n `}}}}),u=({onError:e,onSuccess:t,onProgress:r,accept:s,maxSize:n,method:i="POST",endpoint:d,headers:c})=>{const[p,g]=o({loading:!1,progress:null,error:null,result:null}),u=a(null),h=l(()=>{u.current&&(u.current.abort(),u.current=null)},[]),m=l(()=>{g({loading:!1,progress:null,error:null,result:null})},[]);return Object.assign(Object.assign({},p),{xhrFetch:o=>new Promise((a,l)=>{if(o instanceof File){const t=((e,t,r)=>{if(t&&!t.includes(e.type))return{message:`Invalid file type. Allowed types: ${t}`,code:"INVALID_TYPE"};if(r&&e.size>r)return{message:`File size exceeds ${(r/1024/1024).toFixed(2)}MB`,code:"FILE_TOO_LARGE"};return null})(o,s,n);if(t)return g(e=>Object.assign(Object.assign({},e),{error:t})),null==e||e(t),void l(t)}g({loading:!0,progress:{loaded:0,total:o instanceof File?o.size:0,percentage:0},error:null,result:null});const p=new XMLHttpRequest;u.current=p,p.upload.addEventListener("progress",e=>{if(e.lengthComputable){const t={loaded:e.loaded,total:e.total,percentage:Math.round(e.loaded/e.total*100)};g(e=>Object.assign(Object.assign({},e),{progress:t})),null==r||r(t)}}),p.addEventListener("load",()=>{if(p.status>=200&&p.status<300)try{const e=JSON.parse(p.responseText);g(t=>Object.assign(Object.assign({},t),{loading:!1,result:e})),null==t||t(e),a(e)}catch(t){const r={message:"Failed to parse server response",code:"PARSE_ERROR",status:p.status};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:r})),null==e||e(r),l(r)}else{const t={message:`Upload failed with status ${p.status}`,code:"HTTP_ERROR",status:p.status};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}}),p.addEventListener("error",()=>{const t={message:"Network error occurred",code:"NETWORK_ERROR"};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}),p.addEventListener("abort",()=>{const e={message:"Upload cancelled",code:"ABORT"};g(t=>Object.assign(Object.assign({},t),{loading:!1,error:e})),l(e)}),p.addEventListener("timeout",()=>{const t={message:"Upload timeout",code:"TIMEOUT"};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}),p.open(i,d),c&&Object.entries(c).forEach(([e,t])=>{p.setRequestHeader(e,t)}),p.timeout=3e4,p.send(o)}),cancel:h,reset:m})},h=e=>{const{endpoint:t,method:r="DELETE",headers:s={},fieldName:n="file",onSuccess:i,onError:o,onProgress:a}=e,{xhrFetch:l,cancel:d,reset:c,loading:p,progress:g,error:h,result:m}=u({onError:o,onSuccess:i,onProgress:a,fieldName:n,method:r,endpoint:t,headers:s});return{loading:p,progress:g,error:h,result:m,deleteImage:e=>{var t;const r=null===(t=e.props)||void 0===t?void 0:t.id;if(!r)throw new Error("FileId is required");return l(JSON.stringify({fileId:r}))},cancel:d,reset:c}},m=e=>{const{endpoint:t,method:r="POST",headers:s={},fieldName:n="file",maxSize:i,accept:o="image/jpeg, image/jpg, image/png, image/gif, image/webp",onSuccess:a,onError:l,onProgress:d}=e,{xhrFetch:c,cancel:p,reset:g,loading:h,progress:m,error:b,result:f}=u({onError:l,onSuccess:a,onProgress:d,fieldName:n,accept:o,maxSize:i,method:r,endpoint:t,headers:s});return{loading:h,progress:m,error:b,result:f,upload:e=>{const t=new FormData;return t.append(null!=n?n:"yoopta-image-file",e),c(t)},cancel:p,reset:g}},b=()=>({getDimensions:e=>new Promise((t,r)=>{const s=new Image,n=URL.createObjectURL(e);s.onload=()=>{URL.revokeObjectURL(n),t({width:s.naturalWidth,height:s.naturalHeight})},s.onerror=()=>{URL.revokeObjectURL(n),r(new Error("Failed to load image"))},s.src=n})}),f=()=>{const[e,t]=o(null);return{preview:e,generatePreview:r=>{e&&URL.revokeObjectURL(e.url);const s=URL.createObjectURL(r);return t({url:s}),{url:s}},clearPreview:()=>{e&&(URL.revokeObjectURL(e.url),t(null))}}};export{d as ImageCommands,g as default,h as useImageDelete,b as useImageDimensions,f as useImagePreview,m as useImageUpload};
@@ -1,5 +1,5 @@
1
1
  import { YooptaPlugin } from '@yoopta/editor';
2
- import { ImageElementMap, ImagePluginOptions } from '../types';
2
+ import type { ImageElementMap, ImagePluginOptions } from '../types';
3
3
  declare const Image: YooptaPlugin<ImageElementMap, ImagePluginOptions>;
4
4
  export { Image };
5
- //# sourceMappingURL=index.d.ts.map
5
+ //# sourceMappingURL=image-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/image-plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAqB,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgCvF,QAAA,MAAM,KAAK,mDAiGT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
package/dist/types.d.ts CHANGED
@@ -4,6 +4,7 @@ export type ImageSizes = {
4
4
  height: number | string;
5
5
  };
6
6
  export type ImageElementProps = {
7
+ id: string | null;
7
8
  src?: string | null;
8
9
  alt?: string | null;
9
10
  srcSet?: string | null;
@@ -18,17 +19,76 @@ export type ImageOptimizationFields = {
18
19
  deviceSizes?: number[];
19
20
  provider?: 'imgix' | 'cloudinary' | 'akamai';
20
21
  };
21
- export type ImagePluginOptions = {
22
- onUpload: (file: File) => Promise<ImageUploadResponse>;
23
- onError?: (error: any) => void;
22
+ export type ImageUploadOptions = {
23
+ endpoint: string;
24
+ method?: 'POST' | 'PUT' | 'DELETE' | 'PATCH';
25
+ headers?: Record<string, string>;
26
+ fieldName?: string;
27
+ maxSize?: number;
24
28
  accept?: string;
25
- optimizations?: ImageOptimizationFields;
29
+ onProgress?: (progress: any) => void;
30
+ onSuccess?: (result: any) => void;
31
+ onError?: (error: any) => void;
32
+ };
33
+ export type ImageDeleteOptions = {
34
+ endpoint: string;
35
+ method?: 'DELETE' | 'PATCH';
36
+ headers?: Record<string, string>;
37
+ fieldName?: string;
38
+ onProgress?: (progress: any) => void;
39
+ onSuccess?: (result: any) => void;
40
+ onError?: (error: any) => void;
41
+ };
42
+ export type ImagePluginOptions = {
43
+ upload?: ImageUploadOptions;
44
+ delete?: ImageDeleteOptions;
26
45
  maxSizes?: {
27
46
  maxWidth?: number | string;
28
47
  maxHeight?: number | string;
29
- };
48
+ } | null;
49
+ optimizations?: ImageOptimizationFields | null;
30
50
  };
31
51
  export type ImageElementMap = {
32
52
  image: ImageElement;
33
53
  };
54
+ export type ImageUploadProgress = {
55
+ loaded: number;
56
+ total: number;
57
+ percentage: number;
58
+ };
59
+ export type UploadError = {
60
+ message: string;
61
+ code?: string;
62
+ status?: number;
63
+ };
64
+ export type UploadResult = {
65
+ id: string;
66
+ url: string;
67
+ width?: number;
68
+ height?: number;
69
+ size?: number;
70
+ format?: string;
71
+ [key: string]: any;
72
+ };
73
+ export type UploadState = {
74
+ loading: boolean;
75
+ progress: ImageUploadProgress | null;
76
+ error: UploadError | null;
77
+ result: UploadResult | null;
78
+ };
79
+ export type UseImageUploadReturn = {
80
+ upload: (file: File) => Promise<UploadResult>;
81
+ cancel: () => void;
82
+ reset: () => void;
83
+ } & UploadState;
84
+ export type UseImageDeleteReturn = {
85
+ deleteImage: (element: ImageElement) => Promise<UploadResult>;
86
+ cancel: () => void;
87
+ reset: () => void;
88
+ } & UploadState;
89
+ export type ImageUploadPreview = {
90
+ url: string;
91
+ width?: number;
92
+ height?: number;
93
+ };
34
94
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AAEpE,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AAEpE,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC7B,GAAG,IAAI,CAAC;IACT,aAAa,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACrC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,GAAG,WAAW,CAAC;AAEhB,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9D,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,GAAG,WAAW,CAAC;AAEhB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ImageSizes } from '../types';
1
+ import type { ImageSizes } from '../types';
2
2
  /**
3
3
  * Limits image sizes to not exceed maximum allowed dimensions
4
4
  * @param sizes Current image dimensions
@@ -1 +1 @@
1
- {"version":3,"file":"limitSizes.d.ts","sourceRoot":"","sources":["../../src/utils/limitSizes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAYtC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,UAAW,UAAU,YAAY,UAAU,KAAG,UAqBpE,CAAC"}
1
+ {"version":3,"file":"limitSizes.d.ts","sourceRoot":"","sources":["../../src/utils/limitSizes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAY3C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,UAAW,UAAU,YAAY,UAAU,KAAG,UAqBpE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/image",
3
- "version": "4.9.9",
3
+ "version": "6.0.0-beta.2",
4
4
  "description": "Image plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
@@ -14,12 +14,13 @@
14
14
  "dist/"
15
15
  ],
16
16
  "peerDependencies": {
17
- "@yoopta/editor": "^4.0.0-rc.10",
18
- "react": ">=17.0.2",
19
- "react-dom": ">=17.0.2"
17
+ "@yoopta/editor": ">=4.9.9",
18
+ "react": ">=18.2.0",
19
+ "react-dom": ">=18.2.0"
20
20
  },
21
21
  "publishConfig": {
22
- "registry": "https://registry.npmjs.org"
22
+ "registry": "https://registry.npmjs.org",
23
+ "access": "public"
23
24
  },
24
25
  "repository": {
25
26
  "type": "git",
@@ -34,10 +35,5 @@
34
35
  "bugs": {
35
36
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
36
37
  },
37
- "dependencies": {
38
- "@floating-ui/react": "^0.26.9",
39
- "@radix-ui/react-icons": "^1.3.0",
40
- "re-resizable": "^6.9.11"
41
- },
42
- "gitHead": "e8260945d74e2b26e8c66a3ddf4da8ceb45bc74d"
38
+ "gitHead": "58d2c0e3b3b615017e0adb353b80dc493a571186"
43
39
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAE,eAAe,EAA0C,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAWvG,QAAA,MAAM,KAAK,mDA0GT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,6 +0,0 @@
1
- declare const EmbedUploader: ({ blockId, onClose }: {
2
- blockId: any;
3
- onClose: any;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export { EmbedUploader };
6
- //# sourceMappingURL=EmbedUploader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmbedUploader.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedUploader.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa;;;6CAwClB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,9 +0,0 @@
1
- type Props = {
2
- onClose: () => void;
3
- blockId: string;
4
- accept?: string;
5
- onSetLoading: (_s: boolean) => void;
6
- };
7
- declare const FileUploader: ({ accept, onClose, blockId, onSetLoading }: Props) => import("react/jsx-runtime").JSX.Element;
8
- export { FileUploader };
9
- //# sourceMappingURL=FileUploader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FileUploader.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,YAAY,+CAA4D,KAAK,4CA8DlF,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import { PluginElementRenderProps } from '@yoopta/editor';
2
- declare const ImageRender: ({ extendRender, ...props }: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element;
3
- export { ImageRender };
4
- //# sourceMappingURL=Image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/ui/Image.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAMzB,MAAM,gBAAgB,CAAC;AAQxB,QAAA,MAAM,WAAW,+BAAgC,wBAAwB,4CAyGxE,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- import { YooEditor, YooptaBlockData } from '@yoopta/editor';
2
- import { ImageElementProps } from '../types';
3
- type Props = {
4
- editor: YooEditor;
5
- block: YooptaBlockData;
6
- props?: ImageElementProps;
7
- };
8
- declare const ImageBlockOptions: ({ editor, block, props: imageProps }: Props) => import("react/jsx-runtime").JSX.Element;
9
- export { ImageBlockOptions };
10
- //# sourceMappingURL=ImageBlockOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImageBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/ImageBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgD,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAW1G,OAAO,EAAE,iBAAiB,EAA2C,MAAM,UAAU,CAAC;AAgBtF,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,iBAAiB,yCAA0C,KAAK,4CA6NrE,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- import { RenderElementProps } from 'slate-react';
2
- import { ImageElementProps } from '../types';
3
- type ImageComponentProps = Omit<ImageElementProps, 'sizes'> & {
4
- width: number | string;
5
- height: number | string;
6
- layout?: Layout;
7
- } & Pick<RenderElementProps, 'attributes' | 'children'>;
8
- type Layout = 'fill' | 'responsive' | 'intrinsic' | 'fixed';
9
- declare const ImageComponent: ({ width, height, src, alt, fit, bgColor, attributes, children, layout, }: ImageComponentProps) => import("react/jsx-runtime").JSX.Element;
10
- export { ImageComponent, ImageComponentProps };
11
- //# sourceMappingURL=ImageComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImageComponent.d.ts","sourceRoot":"","sources":["../../src/ui/ImageComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG;IAC5D,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAAC,kBAAkB,EAAE,YAAY,GAAG,UAAU,CAAC,CAAC;AAExD,KAAK,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;AAe5D,QAAA,MAAM,cAAc,6EAUjB,mBAAmB,4CA2ErB,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- type Props = {
3
- floatingStyles: CSSProperties;
4
- refs: any;
5
- blockId: string;
6
- onClose: () => void;
7
- onSetLoading: (_s: boolean) => void;
8
- };
9
- declare const ImageUploader: ({ floatingStyles, refs, onClose, blockId, onSetLoading }: Props) => import("react/jsx-runtime").JSX.Element;
10
- export { ImageUploader };
11
- //# sourceMappingURL=ImageUploader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImageUploader.d.ts","sourceRoot":"","sources":["../../src/ui/ImageUploader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAIhD,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAKF,QAAA,MAAM,aAAa,6DAA8D,KAAK,4CA8CrF,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- declare const InputAltText: ({ floatingStyles, onClose, refs, value, onChange, onSave, onDelete }: {
2
- floatingStyles: any;
3
- onClose: any;
4
- refs: any;
5
- value: any;
6
- onChange: any;
7
- onSave: any;
8
- onDelete: any;
9
- }) => import("react/jsx-runtime").JSX.Element;
10
- export { InputAltText };
11
- //# sourceMappingURL=InputAltText.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputAltText.d.ts","sourceRoot":"","sources":["../../src/ui/InputAltText.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY;;;;;;;;6CA4CjB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- import { ReactNode } from 'react';
2
- type Props = {
3
- className?: string;
4
- children?: ReactNode;
5
- width?: number;
6
- height?: number;
7
- };
8
- declare const Loader: ({ className, width, height, children }: Props) => import("react/jsx-runtime").JSX.Element;
9
- export { Loader };
10
- //# sourceMappingURL=Loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../src/ui/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,MAAM,2CAA4C,KAAK,4CAoB5D,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,7 +0,0 @@
1
- declare const Placeholder: ({ attributes, children, blockId }: {
2
- attributes: any;
3
- children: any;
4
- blockId: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export { Placeholder };
7
- //# sourceMappingURL=Placeholder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../src/ui/Placeholder.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,WAAW;;;;6CAwDhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- declare const Resizer: ({ position }: {
2
- position: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
- export { Resizer };
5
- //# sourceMappingURL=Resizer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Resizer.d.ts","sourceRoot":"","sources":["../../src/ui/Resizer.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO;;6CASZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}