@yoopta/editor 4.0.0-rc.27 → 4.0.0-rc.29

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 (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3,4 +3,4 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
5
  */
6
- var Xo=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Zo="undefined"==typeof Element,qo=Zo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Go=!Zo&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Jo=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},Qo=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Jo(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{qo.call(a,Xo)&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var s=a.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(a),d=!Jo(s,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(s&&d){var u=e(!0===s?a.children:s.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},er=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tr=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!er(e)?0:e.tabIndex},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},or=function(e){return"INPUT"===e.tagName},rr=function(e){return function(e){return or(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Go(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!r||r===e}(e)},ir=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},ar=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=qo.call(e,"details>summary:first-of-type")?e.parentElement:e;if(qo.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ir(e)}else{if("function"==typeof o){for(var i=e;e;){var a=e.parentElement,l=Go(e);if(a&&!a.shadowRoot&&!0===o(a))return ir(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,o,r,i=e&&Go(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&a;){var c,s,d;l=!(null===(s=a=null===(c=i=Go(a))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},lr=function(e,t){return!(t.disabled||Jo(t)||function(e){return or(e)&&"hidden"===e.type}(t)||ar(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return!!qo.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},cr=function(e,t){return!(rr(t)||tr(t)<0||!lr(e,t))},sr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},dr=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var n=tr(e);return n<0&&t&&!er(e)?0:n}(a,i),c=i?e(t.candidates):a;0===l?i?n.push.apply(n,c):n.push(a):o.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:c})})),o.sort(nr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ur=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qo([e],t.includeContainer,{filter:cr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:sr}):function(e,t,n){if(Jo(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Xo));return t&&qo.call(e,Xo)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,cr.bind(null,t)),dr(n)};const fr=o["useInsertionEffect".toString()]||(e=>e());var pr="undefined"!=typeof document?c:s;function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},hr.apply(this,arguments)}let gr=!1,yr=0;const vr=()=>"floating-ui-"+yr++;const mr=o["useId".toString()]||function(){const[e,t]=o.useState((()=>gr?vr():void 0));return pr((()=>{null==e&&t(vr())}),[]),o.useEffect((()=>{gr||(gr=!0)}),[]),e};const br=o.createContext(null),wr=o.createContext(null);function xr(e){return"data-floating-ui-"+e}function kr(e){const t=l(e);return pr((()=>{t.current=e})),t}const Er=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const n=ur(e,Er());"prev"===t&&n.reverse();const o=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return n.slice(o+1)[0]}function Or(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Hn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,o)}function Sr(e){ur(e,Er()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const _r={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Rr(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const jr=o.forwardRef((function(e,t){const[n,r]=o.useState();pr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",Rr),()=>{document.removeEventListener("keydown",Rr)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[xr("focus-guard")]:"",style:_r};return o.createElement("span",hr({},e,i))})),Br=o.createContext(null),Ar=xr("portal");function Tr(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:n}=void 0===e?{}:e;const[r,i]=o.useState(null),a=mr(),l=Mr(),c=o.useRef(null);return pr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{c.current=null}))}),[r]),pr((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=a,n.setAttribute(Ar,""),e.appendChild(n),c.current=n,i(n)}),[t,a]),pr((()=>{if(c.current)return;let e=n||(null==l?void 0:l.portalNode);e&&!Fn(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const r=document.createElement("div");r.id=a,r.setAttribute(Ar,""),e=o||e,e.appendChild(r),c.current=r,i(r)}),[t,n,a,l]),r}({id:n,root:r}),[l,c]=o.useState(null),s=o.useRef(null),d=o.useRef(null),u=o.useRef(null),f=o.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!r&&!a);return o.useEffect((()=>{if(a&&i&&(null==l||!l.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Or(e)){("focusin"===e.type?Dr:Sr)(a)}}}),[a,i,null==l?void 0:l.modal]),o.createElement(Br.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:c})),[i,a])},p&&a&&o.createElement(jr,{"data-type":"outside",ref:s,onFocus:e=>{if(Or(e,a)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&a&&o.createElement("span",{"aria-owns":a.id,style:_r}),a&&b(t,a),p&&a&&o.createElement(jr,{"data-type":"outside",ref:d,onFocus:e=>{if(Or(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const Mr=()=>o.useContext(Br),Lr=new Set,Nr=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const i=mr();return pr((()=>{if(!n)return;Lr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[o]=r+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Lr.delete(i),0===Lr.size&&(Object.assign(t,{overflow:"",[o]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,l)))}}),[i,n]),o.createElement("div",hr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Ir(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e,[a,l]=o.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||a,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);Ko(p,r)||h(r);const[g,y]=o.useState(null),[m,b]=o.useState(null),w=o.useCallback((e=>{e!==C.current&&(C.current=e,y(e))}),[]),x=o.useCallback((e=>{e!==O.current&&(O.current=e,b(e))}),[]),k=a||g,E=l||m,C=o.useRef(null),O=o.useRef(null),S=o.useRef(u),D=null!=s,_=$o(s),R=$o(i),j=o.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:t,strategy:n,middleware:p};R.current&&(e.platform=R.current),Ho(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Ko(S.current,t)&&(S.current=t,v.flushSync((()=>{f(t)})))}))}),[p,t,n,R]);Vo((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=o.useRef(!1);Vo((()=>(B.current=!0,()=>{B.current=!1})),[]),Vo((()=>{if(k&&(C.current=k),E&&(O.current=E),k&&E){if(_.current)return _.current(k,E,j);j()}}),[k,E,j,_,D]);const A=o.useMemo((()=>({reference:C,floating:O,setReference:w,setFloating:x})),[w,x]),T=o.useMemo((()=>({reference:k,floating:E})),[k,E]),M=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Yo(T.floating,u.x),o=Yo(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...Wo(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,c,T.floating,u.x,u.y]);return o.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=o.useContext(wr),u=null!=((null==(f=o.useContext(br))?void 0:f.id)||null);var f;const p=function(e){const t=o.useRef((()=>{}));return fr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),h=o.useRef(null),g=o.useRef({}),y=o.useState((()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter((e=>e!==n)))||[])}}}()))[0],m=mr(),b=o.useCallback((e=>{const t=Fn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=o.useCallback((e=>{(Fn(e)||null===e)&&(h.current=e,l(e)),(Fn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Fn(e))&&s.refs.setReference(e)}),[s.refs]),x=o.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=o.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),E=o.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:y,open:n,onOpenChange:p})),[s,i,m,y,n,p,x,k]);return pr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const Pr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Fr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[l,c]=o.useState(!1),[s,d]=o.useState("unmounted"),u=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,a);return pr((()=>{l&&!u&&d("unmounted")}),[l,u]),pr((()=>{if(r){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[n,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:a,duration:l=250}=t,c=e.placement,s=c.split("-")[0],d=o.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof l,f=(u?l:l.open)||0,p=(u?l:l.close)||0,[h,g]=o.useState((()=>({...zr(a,d),...zr(n,d)}))),{isMounted:y,status:v}=Fr(e,{duration:l}),m=kr(n),b=kr(r),w=kr(i),x=kr(a);return pr((()=>{const e=zr(m.current,d),t=zr(w.current,d),n=zr(x.current,d),o=zr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&g({transitionProperty:Object.keys(o).map(Pr).join(","),transitionDuration:f+"ms",...n,...o}),"close"===v){const o=t||e;g({transitionProperty:Object.keys(o).map(Pr).join(","),transitionDuration:p+"ms",...n,...o})}}),[p,w,m,b,x,f,v,d]),{isMounted:y,styles:h}}var Hr;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Vr.apply(this,arguments)}var Kr=function(e){return o.createElement("svg",Vr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Hr||(Hr=o.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Wr(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}var Yr=["color"],$r=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Yr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Xr=["color"],Zr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Xr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),qr=["color"],Gr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,qr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Jr=["color"],Qr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Jr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),ei=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ti={"text/plain":"Text","text/html":"Url",default:"Text"};var ni=function(e,t){var n,o,r,i,a,l,c=!1;t||(t={}),n=t.debug||!1;try{if(r=ei(),i=document.createRange(),a=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),void 0===o.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=ti[t.format]||ti.default;window.clipboardData.setData(r,e)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,e);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))})),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return c};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ri(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}const ii=i(void 0),ai=({children:o,tools:r})=>{const i=V(),a=d((()=>r?Object.keys(r).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=r[t])||void 0===n?void 0:n.render})}),{}):{}),[r]),l=d((()=>!r||i?null:Object.keys(r).map((t=>{var n,o,i;const a=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.tool,l=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.render,c=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return a?e(a,Object.assign({render:l},c),t):null}))),[d]);return e(ii.Provider,Object.assign({value:a},{children:t(n,{children:[l,o]})}))},li=()=>{const e=a(ii);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e},ci=({children:t})=>e("div",Object.assign({className:"yoo-editor-flex yoo-editor-flex-col"},{children:t})),si=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoo-editor-bg-[#FFF] yoo-editor-relative yoo-editor-min-w-[200px] yoo-editor-w-auto yoo-editor-overflow-hidden yoo-editor-rounded-md yoo-editor-border yoo-editor-bg-popover yoo-editor-py-[6px] yoo-editor-px-0 yoo-editor-text-popover-foreground yoo-editor-shadow-md data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),di=({children:t})=>e("div",Object.assign({className:"yoo-editor-relative yoo-editor-flex yoo-editor-cursor-default yoo-editor-select-none yoo-editor-items-center yoo-editor-text-sm yoo-editor-outline-none yoo-editor-transition-colors focus:yoo-editor-bg-accent focus:yoo-editor-text-accent-foreground data-[disabled]:yoo-editor-pointer-events-none data-[disabled]:yoo-editor-opacity-50"},{children:t})),ui=({isOpen:n,onClose:o,refs:r,style:i,children:a})=>{var l,c;const s=z(),d=li(),[u,p]=f(!1),{refs:h,floatingStyles:g,context:y}=Ir({placement:"right",open:u,onOpenChange:p,middleware:[Uo(),Fo(),zo(),ko(10)],whileElementsMounted:Po}),{isMounted:v,styles:m}=Ur(y,{duration:100});if(!n)return null;const b=L(s,{at:s.selection}),w=ri(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(l=null==w?void 0:w.props)||void 0===l?void 0:l.nodeType),k=d.ActionMenu,E=Object.assign(Object.assign({},g),m);return e(Tr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Nr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:o},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(si,{children:[t(ci,{children:[e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),o()}},{children:[e(Qr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),o()}},{children:[e($r,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(di,{children:[v&&!!k&&e(Tr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Nr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:E,ref:h.setFloating},{children:e(k,{actions:Object.keys(s.blocks),editor:s,selectedAction:"",onClose:()=>{p(!1),o()},empty:!1,onMouseEnter:()=>{},mode:"toggle",view:"small"})}))}))})),t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Kr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=L(s);e&&(ni(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),o()}},{children:[e(Gr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var fi=Object.freeze({__proto__:null,BlockOptions:ui,BlockOptionsMenuContent:si,BlockOptionsMenuGroup:ci,BlockOptionsMenuItem:di,BlockOptionsSeparator:({className:t})=>e("div",{className:`yoo-editor-h-[1px] yoo-editor-bg-[#37352f14] yoo-editor-my-[4px] yoo-editor-w-full ${t}`})});const pi=({block:n,editor:o,dragHandleProps:r,showActions:i,onChangeActiveBlock:a})=>{const[l,c]=f(!1),{refs:s,floatingStyles:d,context:u}=Ir({placement:"right-start",open:l,onOpenChange:c,middleware:[Uo(),Fo(),zo(),ko()]}),{isMounted:p,styles:h}=Ur(u,{duration:100}),{setActivatorNodeRef:g,attributes:y,listeners:v}=r,m=Object.assign(Object.assign({},d),h);return t("div",Object.assign({contentEditable:!1,"data-hovered-state":i,className:'yoo-editor-flex yoo-editor-absolute -yoo-editor-left-[50px] yoo-editor-top-[2px] yoo-editor-opacity-0 yoo-editor-transition-opacity yoopta-element-actions data-[hovered-state="true"]:yoo-editor-opacity-100'},{children:[e("button",Object.assign({type:"button",onClick:()=>{const e=J({id:q()}),t=[n.meta.order+1];o.setSelection([n.meta.order]),o.insertBlock(e,{at:t,focus:!0})},className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoo-editor-w-[24px] yoopta-element-actions-plus"},{children:e(Mn,{})})),e("button",Object.assign({type:"button",className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoopta-element-actions-drag",ref:e=>{g(e),s.setReference(e)}},y,v,{onClick:e=>{e.stopPropagation(),a(n.id);const t=Ln(o,{at:[n.meta.order]});o.focusBlock(n.id),t&&setTimeout((()=>{o.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),R.deselect(t)),o.setBlockSelected([n.meta.order],{only:!0}),o.setSelection([n.meta.order]),c(!0)}),10)}},{children:e(An,{})})),e(ui,{isOpen:p,refs:s,style:m,onClose:()=>c(!1)})]}))},hi=({children:n,block:o,blockId:r})=>{var i;const a=z(),[l,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:y,isDragging:v}=Cn({id:r,disabled:a.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:v?.7:1,marginLeft:20*o.meta.depth+"px"},b=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(o.meta.order),w=l===r,x={borderBottom:y&&!v?"2px solid #007aff":"none"};return t("div",Object.assign({className:"yoo-editor-relative yoo-editor-py-0 yoo-editor-px-[2px] yoo-editor-mt-[2px] yoo-editor-mb-[1px] yoo-editor-rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||c(r)},onMouseLeave:()=>{a.readOnly||c(null)},"data-yoopta-block-id":r,style:m,"data-yoopta-block":!0,"data-hovered-block":w,ref:u},{children:[!a.readOnly&&e(pi,{block:o,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:n})),b&&!a.readOnly&&e("div",{className:"yoo-editor-absolute yoo-editor-left-0 yoo-editor-top-0 yoo-editor-bg-[#2383e224] yoo-editor-z-[90] yoo-editor-rounded yoo-editor-opacity-100 yoo-editor-h-full yoo-editor-w-full yoo-editor-pointer-events-none yoopta-selection-block"})]}))};function gi(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;var yi={};Object.defineProperty(yi,"__esModule",{value:!0});for(var vi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),mi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},bi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:vi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},wi={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},xi=1;xi<20;xi++)wi["f"+xi]=111+xi;function ki(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var o=e.map((function(e){return Ei(e,t)})),r=function(e){return o.some((function(t){return Ci(t,e)}))};return null==n?r:r(n)}function Ei(e,t){var n=t&&t.byKey,o={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var a in mi)o[mi[a]]=!1;var l=!0,c=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Si(f),g=mi[h];if(f.length>1&&!g&&!bi[f]&&!wi[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?o.key=h:o.which=Oi(f)),g&&(o[g]=!p||null)}}catch(e){c=!0,s=e}finally{try{!l&&u.return&&u.return()}finally{if(c)throw s}}return o}function Ci(e,t){for(var n in e){var o=e[n],r=void 0;if(null!=o&&((null!=(r="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===o&&93===t.which?91:t.which:t[n])||!1!==o)&&r!==o))return!1}return!0}function Oi(e){return e=Si(e),wi[e]||e.toUpperCase().charCodeAt(0)}function Si(e){return e=e.toLowerCase(),e=bi[e]||e}yi.default=ki,yi.isHotkey=ki,yi.isCodeHotkey=function(e,t){return ki(e,t)};var Di=yi.isKeyHotkey=function(e,t){return ki(e,{byKey:!0},t)};yi.parseHotkey=Ei,yi.compareHotkey=Ci,yi.toKeyCode=Oi,yi.toKeyName=Si;const _i={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",slashCommand:"/",kekCeburek:"mod+enter"},Ri={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},ji={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Bi=e=>{const t=_i[e],n=Ri[e],o=ji[e],r=t&&Di(t),i=n&&Di(n),a=o&&Di(o);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!a||!a(e)))},Ai={isBold:Bi("bold"),isCompose:Bi("compose"),isArrowLeft:Bi("arrowLeft"),isArrowRight:Bi("arrowRight"),isArrowUp:Bi("arrowUp"),isArrowDown:Bi("arrowDown"),isDeleteBackward:Bi("deleteBackward"),isDeleteForward:Bi("deleteForward"),isDeleteLineBackward:Bi("deleteLineBackward"),isDeleteLineForward:Bi("deleteLineForward"),isDeleteWordBackward:Bi("deleteWordBackward"),isDeleteWordForward:Bi("deleteWordForward"),isExtendBackward:Bi("extendBackward"),isExtendForward:Bi("extendForward"),isExtendLineBackward:Bi("extendLineBackward"),isExtendLineForward:Bi("extendLineForward"),isItalic:Bi("italic"),isMoveLineBackward:Bi("moveLineBackward"),isMoveLineForward:Bi("moveLineForward"),isCtrlLeft:Bi("ctrlLeft"),isCtrlRight:Bi("ctrlRight"),isRedo:Bi("redo"),isShiftEnter:Bi("shiftEnter"),isEnter:Bi("enter"),isTransposeCharacter:Bi("transposeCharacter"),isUndo:Bi("undo"),isSpace:Bi("space"),isSelect:Bi("select"),isTab:Bi("tab"),isShiftTab:Bi("shiftTab"),isBackspace:Bi("backspace"),isCmdEnter:Bi("cmdEnter"),isCmd:Bi("cmd"),isEscape:Bi("escape"),isSlashCommand:Bi("slashCommand"),isShiftArrowUp:Bi("shiftArrowUp"),isShiftArrowDown:Bi("shiftArrowDown"),isKekceburek:Bi("kekCeburek")};const Ti={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const o=S.parent(n.selection.anchor.path);if(Ai.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Ai.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=D.isStart(n,n.selection.anchor,o),i=D.isEnd(n,n.selection.anchor,o);if(!r&&!i)return void e.splitBlock({slate:n,focus:!0});const a=J({id:q()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:l,slate:n,focus:!0})}else if(Ai.isBackspace(t)){if(t.isDefaultPrevented())return;const o=L(e,{at:e.selection}),r=e.blocks[(null==o?void 0:o.type)||""],i=S.parent(n.selection.anchor.path);if(D.isStart(n,n.selection.anchor,i)){t.preventDefault();const o=D.string(n,i),a=e.selection?e.selection[0]-1:0,l=Ln(e,{at:[a]});let c;if(l&&!r.hasCustomEditor&&(c=function(e,t){const[,n]=D.last(e,t);return{path:n,offset:D.string(e,n).length}}(l,i)),0===o.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:c});{if(j.isExpanded(n.selection))return R.delete(n,{at:n.selection});if(!l)return;if(0===D.string(l,[0,0]).length)return e.deleteBlock({at:[a],focus:!0,focusAt:c});const t=Array.from(D.nodes(n,{at:[0],match:e=>!D.isEditor(e)&&(B.isText(e)||D.isInline(n,e)),mode:"highest"})).map((([e])=>e));return R.insertNodes(l,t,{at:D.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:c})}}}else{if(Ai.isSelect(t)){if(t.isDefaultPrevented())return;const[,o]=D.first(n,[0]),[,r]=D.last(n,[n.children.length-1]),i=D.range(n,o,r),a=j.equals(n.selection,i);if(j.isExpanded(n.selection)&&a)return t.preventDefault(),w.blur(n),w.deselect(n),R.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Ai.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Ai.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Ai.isArrowUp(t)){if(t.isDefaultPrevented())return;const o=S.parent(n.selection.anchor.path);if(D.isStart(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]-1]:null,o=Ln(e,{at:n}),r=L(e,{at:n});if(o&&r){const[,n]=D.last(o,[0]),i={path:n,offset:D.string(o,n).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Ai.isArrowDown(t)){if(t.isDefaultPrevented())return;const o=S.parent(n.selection.anchor.path);if(D.isEnd(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]+1]:null,r=Ln(e,{at:n}),i=L(e,{at:n});if(r&&i){const n=function(e,t){const[,n]=D.first(e,t);return{path:n,offset:0}}(r,o);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(j.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Di(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Mi=({children:t,attributes:n,placeholder:o})=>{const r=x(),i=Object.assign({},n);return r&&o&&(i["data-placeholder"]=o,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Li(e){try{return new URL(e),!0}catch(e){return!1}}const Ni=(e,t)=>{(e=>{const[t]=D.nodes(e,{match:e=>!D.isEditor(e)&&_.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{R.unwrapNodes(e,{match:e=>!D.isEditor(e)&&_.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,o=n&&j.isCollapsed(n),r={type:"link",children:o?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};o?R.insertNodes(e,r):(R.wrapNodes(e,r,{split:!0}),R.collapse(e,{edge:"end"}))};function Ii(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Pi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function zi(e,t,n){var o,r,i;if(3===n.nodeType){return null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const a=n;let l=Array.from(a.childNodes).map((n=>zi(e,t,n))).flat();if(Pi[n.nodeName]){return{[Pi[n.nodeName].type]:!0,text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const o=t[n.nodeName],r=e.blocks[o.type],a=oi(r.elements)||"",c=r.elements[a],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:q(),type:a,children:s&&!r.hasCustomEditor?[{text:""}]:l.map(Fi),props:Object.assign({nodeType:"block"},c.props)};if(o.parse){const e=o.parse(n);if(e)if(_.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return J({id:q(),type:o.type,value:[d],meta:{order:0,depth:0}})}return l}function Fi(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Ii(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Ui={html:{deserialize:function(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const o=e.plugins[n],{parsers:r}=o;if(r){const{html:e}=r;if(e){const{deserialize:o}=e;if(o){const{nodeNames:e}=o;e&&e.forEach((e=>{t[e]={type:n,parse:o.parse}}))}}}})),t}(e);return zi(e,n,t).filter(Ii)},serialize:function(){}},markdown:{}},Hi=({id:t,customEditor:n,elements:o,marks:r,events:i,options:a,placeholder:c="Type '/' for commands"})=>{var s,f;const p=z(),h=F(t),g=l(h.value).current,y=h.type,v=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),b=d((()=>{let e=p.blockEditorsMap[t];return Object.keys(o).forEach((t=>{var n;const r=null===(n=o[t].props)||void 0===n?void 0:n.nodeType,i="inline"===r,a="void"===r,l="inlineVoid"===r;l&&(e.markableVoid=e=>e.type===t),(a||l)&&(e.isVoid=e=>e.type===t),(i||l)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&Li(t)?Ni(e,t):n(t)},e.insertData=n=>{const o=n.getData("text/plain");o&&Li(o)?Ni(e,o):t(n)},e})(e))})),e}),[]),w=d((()=>{if(!i||p.readOnly)return{};const e={hotkeys:Ai,currentBlock:h,defaultBlock:J({id:q()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](p,b,e)(t)}}})),t}),[i,p,h]),x=u((e=>p.updateBlock(t,{value:e})),[t]),k=u((n=>{const o=v[n.element.type];return o?e(o,Object.assign({},n,{blockId:t,HTMLAttributes:null==a?void 0:a.HTMLAttributes})):e(C,Object.assign({},n))}),[o]),E=u((t=>{var n,o,r,i,a;let{children:l,leaf:s,attributes:d}=t;const u=gi(s,["text"]),f=(null===(n=p.selection)||void 0===n?void 0:n[0])===h.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(l=t.render({children:l,leaf:s}))}));const g=!("void"===(null===(a=null===(i=null===(r=null===(o=t.children)||void 0===o?void 0:o.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&f&&s.withPlaceholder;return e(Mi,Object.assign({attributes:d,placeholder:g?c:void 0},{children:l}))}),[r]),O=u((e=>{var t;p.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),Ti.onKeyDown(p)(e))}),[w.onKeyDown,p.readOnly]),S=u((e=>{var t;p.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)}),[w.onKeyUp,p.readOnly]),_=u((e=>{var t,n;p.readOnly||((null===(t=p.selection)||void 0===t?void 0:t[0])!==h.meta.order&&p.setSelection([h.meta.order]),null===(n=null==w?void 0:w.onClick)||void 0===n||n.call(w,e))}),[w.onClick,p.readOnly,null===(s=p.selection)||void 0===s?void 0:s[0]]),R=u((e=>{var t;p.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))}),[w.onBlur,p.readOnly]),B=u((e=>{var t;p.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)}),[w.onFocus,p.readOnly]),A=u((e=>{var t;if(p.readOnly)return;null===(t=null==w?void 0:w.onPaste)||void 0===t||t.call(w,e);const n=e.clipboardData.getData("text/html"),o=(new DOMParser).parseFromString(n,"text/html");if(o.body.childNodes.length>0){const e=Ui.html.deserialize(p,o.body);if(e.length>0)return void p.insertBlocks(e,{at:p.selection,focus:!0})}}),[w.onPaste,p.readOnly]),T=u((e=>{var t;const n=[];if(p.readOnly)return n;const[o,r]=e,i=(null===(t=p.selection)||void 0===t?void 0:t[0])===h.meta.order;return b.selection&&i&&!D.isEditor(o)&&""===D.string(b,[r[0]])&&j.includes(b.selection,r)&&j.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[p.readOnly,null===(f=p.selection)||void 0===f?void 0:f[0]]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":y},{children:e(Vi,{id:t,slate:b,initialValue:g,onChange:x,decorate:T,renderLeaf:E,renderElement:k,eventHandlers:w,onKeyDown:O,onKeyUp:S,onFocus:B,onClick:_,onBlur:R,customEditor:n,readOnly:p.readOnly,onPaste:A})}))},Vi=p((({id:t,slate:n,initialValue:o,onChange:r,renderLeaf:i,renderElement:a,eventHandlers:l,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:y})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:o,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:a,renderLeaf:i,className:"focus-visible:yoo-editor-outline-none focus:yoo-editor-outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:g,onBlur:f,readOnly:y,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Vi.displayName="SlateEditorInstance";const Ki=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Ae(Et,{activationConstraint:{delay:100,tolerance:0}}),Ae(mt,{coordinateGetter:Dn})),handleDragEnd:u((t=>{const{active:n,over:o}=t;if(n&&o&&n.id!==o.id){const t=e.children[o.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),Wi=[],Yi=({editor:t,marks:o,placeholder:r})=>{const i=V(),{sensors:a,handleDragEnd:l,handleDragStart:c}=Ki({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Wi:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],a=t.children[i],l=t.plugins[a.type];a&&l?f.push(e(hi,Object.assign({block:a,blockId:i},{children:e(Hi,{type:a.type,id:i,marks:o,customEditor:l.customEditor,events:l.events,elements:l.elements,options:l.options,placeholder:r},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e(n,{children:f}):e(tn,Object.assign({sensors:a,collisionDetection:Fe,onDragStart:c,onDragEnd:l},{children:e(vn,Object.assign({disabled:i,items:u,strategy:hn},{children:f}))}))},$i=({editor:e,yooptaEditorRef:t,root:n})=>{const[o,r]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var a;if(e.readOnly||!1===n)return;const l=null===(a=t.current)||void 0===a?void 0:a.contains(i.target);if(!l&&!o.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||r({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!o.selection||e.readOnly||!1===n)return;r((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t)=>{const n=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((o,r)=>{if(!o)return;const i=o.getBoundingClientRect(),a=Math.min(e[1],t[1]),l=Math.min(e[0],t[0]),c=Math.max(e[1],t[1]),s=Math.max(e[0],t[0]);a<i.bottom&&c>i.top&&l<i.right&&s>i.left&&n.push(r)})),n})(o.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var o;if(e.readOnly||!1===n)return;const r=n&&"current"in n?n.current:n||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(o=t.current)||void 0===o?void 0:o.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",i),r.addEventListener("mousemove",a),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",l)}}),[e.selectedBlocks,o,n,e.readOnly]);const c=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},o),{onClose:c})},Xi=({origin:t,coords:n,isOpen:o})=>{if(!o)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})},Zi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},qi=({placeholder:n,marks:o,className:r,selectionBoxRoot:i,width:a,autoFocus:c=!0})=>{const d=z(),u=V(),f=l(null),p=$i({editor:d,yooptaEditorRef:f,root:i});let h=l(Zi).current;s((()=>{if(!c||u)return;const e=L(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.selectedBlocks,u]);const g=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},y=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},v=e=>{var t,n,o,r,i;if(!u){if(Ai.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Ai.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void y();if(Array.isArray(d.selectedBlocks)&&(null===(o=d.selectedBlocks)||void 0===o?void 0:o.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void y()}if(Ai.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(r=d.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const o=S.parent(n.selection.anchor.path),i=D.isStart(n,n.selection.focus,o);if(j.isExpanded(n.selection)&&i){const o=d.selection?[d.selection[0]-1]:[0],r=L(d,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),R.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Ai.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const o=S.parent(n.selection.anchor.path),r=D.isEnd(n,n.selection.focus,o);if(j.isExpanded(n.selection)&&r){const o=d.selection?[d.selection[0]+1]:[0],r=L(d,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),R.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:a},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({id:"yoopta-editor",className:r,style:m,ref:f,onClick:e=>{u||(y(),(e=>{var t;const n=f.current;if(!n)return;const{bottom:o}=n.getBoundingClientRect(),r=o-parseInt(getComputedStyle(n).paddingBottom,10),i=J({id:q()});if(e.clientY>=r){const e=Object.keys(d.children).length-1,n=L(d,{at:[e]}),o=Ln(d,{at:[e]});if(n&&o&&o.selection){const e=D.string(o,o.selection.anchor.path),r=S.parent(o.selection.anchor.path),[a]=D.node(o,r);if(n.type===i.type&&_.isElement(a)&&"void"!==(null===(t=a.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:o})}const r=e+1;d.insertBlock(i,{at:[r],focus:!0})}})(e),g())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(y(),g())}},{children:[e(Yi,{editor:d,marks:o,placeholder:n}),!1!==i&&e(Xi,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},Gi=({children:e,fallback:t=null})=>{const[n,o]=f(!1);return s((()=>o(!0)),[]),n?e:t};var Ji=Symbol.for("immer-nothing"),Qi=Symbol.for("immer-draftable"),ea=Symbol.for("immer-state");function ta(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var na=Object.getPrototypeOf;function oa(e){return!!e&&!!e[ea]}function ra(e){return!!e&&(aa(e)||Array.isArray(e)||!!e[Qi]||!!e.constructor?.[Qi]||ua(e)||fa(e))}var ia=Object.prototype.constructor.toString();function aa(e){if(!e||"object"!=typeof e)return!1;const t=na(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ia}function la(e,t){0===ca(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function ca(e){const t=e[ea];return t?t.type_:Array.isArray(e)?1:ua(e)?2:fa(e)?3:0}function sa(e,t){return 2===ca(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function da(e,t,n){const o=ca(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function ua(e){return e instanceof Map}function fa(e){return e instanceof Set}function pa(e){return e.copy_||e.base_}function ha(e,t){if(ua(e))return new Map(e);if(fa(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&aa(e)){if(!na(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[ea];let o=Reflect.ownKeys(n);for(let t=0;t<o.length;t++){const r=o[t],i=n[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(na(e),n)}function ga(e,t=!1){return va(e)||oa(e)||!ra(e)||(ca(e)>1&&(e.set=e.add=e.clear=e.delete=ya),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>ga(t,!0)))),e}function ya(){ta(2)}function va(e){return Object.isFrozen(e)}var ma,ba={};function wa(e){const t=ba[e];return t||ta(0),t}function xa(){return ma}function ka(e,t){t&&(wa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ea(e){Ca(e),e.drafts_.forEach(Sa),e.drafts_=null}function Ca(e){e===ma&&(ma=e.parent_)}function Oa(e){return ma={drafts_:[],parent_:ma,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Sa(e){const t=e[ea];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Da(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[ea].modified_&&(Ea(t),ta(4)),ra(e)&&(e=_a(t,e),t.parent_||ja(t,e)),t.patches_&&wa("Patches").generateReplacementPatches_(n[ea].base_,e,t.patches_,t.inversePatches_)):e=_a(t,n,[]),Ea(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ji?e:void 0}function _a(e,t,n){if(va(t))return t;const o=t[ea];if(!o)return la(t,((r,i)=>Ra(e,o,t,r,i,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return ja(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,i=!1;3===o.type_&&(r=new Set(t),t.clear(),i=!0),la(r,((r,a)=>Ra(e,o,t,r,a,n,i))),ja(e,t,!1),n&&e.patches_&&wa("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Ra(e,t,n,o,r,i,a){if(oa(r)){const a=_a(e,r,i&&t&&3!==t.type_&&!sa(t.assigned_,o)?i.concat(o):void 0);if(da(n,o,a),!oa(a))return;e.canAutoFreeze_=!1}else a&&n.add(r);if(ra(r)&&!va(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;_a(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||ja(e,r)}}function ja(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ga(t,n)}var Ba={get(e,t){if(t===ea)return e;const n=pa(e);if(!sa(n,t))return function(e,t,n){const o=Ma(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!ra(o)?o:o===Ta(e.base_,t)?(Na(e),e.copy_[t]=Ia(o,e)):o},has:(e,t)=>t in pa(e),ownKeys:e=>Reflect.ownKeys(pa(e)),set(e,t,n){const o=Ma(pa(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=Ta(pa(e),t),a=o?.[ea];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(i=o)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==n||sa(e.base_,t)))return!0;Na(e),La(e)}var r,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ta(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Na(e),La(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=pa(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){ta(11)},getPrototypeOf:e=>na(e.base_),setPrototypeOf(){ta(12)}},Aa={};function Ta(e,t){const n=e[ea];return(n?pa(n):e)[t]}function Ma(e,t){if(!(t in e))return;let n=na(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=na(n)}}function La(e){e.modified_||(e.modified_=!0,e.parent_&&La(e.parent_))}function Na(e){e.copy_||(e.copy_=ha(e.base_,e.scope_.immer_.useStrictShallowCopy_))}la(Ba,((e,t)=>{Aa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Aa.deleteProperty=function(e,t){return Aa.set.call(this,e,t,void 0)},Aa.set=function(e,t,n){return Ba.set.call(this,e[0],t,n,e[0])};function Ia(e,t){const n=ua(e)?wa("MapSet").proxyMap_(e,t):fa(e)?wa("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:xa(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=Ba;n&&(r=[o],i=Aa);const{revoke:a,proxy:l}=Proxy.revocable(r,i);return o.draft_=l,o.revoke_=a,l}(e,t);return(t?t.scope_:xa()).drafts_.push(n),n}function Pa(e){if(!ra(e)||va(e))return e;const t=e[ea];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ha(e,t.scope_.immer_.useStrictShallowCopy_)}else n=ha(e,!0);return la(n,((e,t)=>{da(n,e,Pa(t))})),t&&(t.finalized_=!1),n}var za=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,(e=>t.call(this,e,...r)))}}let o;if("function"!=typeof t&&ta(6),void 0!==n&&"function"!=typeof n&&ta(7),ra(e)){const r=Oa(this),i=Ia(e,void 0);let a=!0;try{o=t(i),a=!1}finally{a?Ea(r):Ca(r)}return ka(r,n),Da(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===Ji&&(o=void 0),this.autoFreeze_&&ga(o,!0),n){const t=[],r=[];wa("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}ta(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,o;return[this.produce(e,t,((e,t)=>{n=e,o=t})),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ra(e)||ta(8),oa(e)&&(e=function(e){oa(e)||ta(10);return Pa(e)}(e));const t=Oa(this),n=Ia(e,void 0);return n[ea].isManual_=!0,Ca(t),n}finishDraft(e,t){const n=e&&e[ea];n&&n.isManual_||ta(9);const{scope_:o}=n;return ka(o,t),Da(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=wa("Patches").applyPatches_;return oa(e)?o(e,t):this.produce(e,(e=>o(e,t)))}};za.produce,za.produceWithPatches.bind(za),za.setAutoFreeze.bind(za),za.setUseStrictShallowCopy.bind(za),za.applyPatches.bind(za);var Fa=za.createDraft.bind(za),Ua=za.finishDraft.bind(za);function Ha(e,t){const n=Ln(e);if(!n)return!1;const o=D.marks(n);return!!(null==o?void 0:o[t])}const Va=(e,t)=>{const{insertText:n}=t;return t.insertText=o=>{var r;const{selection:i}=t;if(" "===o&&i&&j.isCollapsed(i)){const{anchor:a}=i,l=D.above(t,{match:e=>_.isElement(e)&&D.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,s=D.parent(t,c),[d]=s;if(_.isElement(d)&&!B.isText(d.children[0]))return n(o);const u=l?c:[],f={anchor:a,focus:D.start(t,u)},p=D.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return R.select(t,f),R.delete(t),void h.create({deleteText:!1})}n(o)},t};function Ka(e,t,n){e.children=Fa(e.children);let o=!1;const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);n.id&&(r.id=n.id,o=!0),n.type&&(r.type=n.type,o=!0),n.meta&&(r.meta=n.meta,o=!0),n.value&&(r.value=n.value),e.children=Ua(e.children),o&&e.applyChanges(),e.emit("change",e.children)}function Wa(e,t,n){e.children=Fa(e.children);const o=L(e,{at:e.selection});if(!o)throw new Error("Block from not found at current selection");const r=oi(e.blocks[o.type].elements);if(o.type===t)return void(e.children=Ua(e.children));const i=Ln(e,{at:[o.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${o.meta.order}`);const a=oi(e.blocks[t].elements);D.withoutNormalizing(i,(()=>{!function(e,t={}){var n;const{at:o,elementType:r}=t,i=o||(null===(n=e.selection)||void 0===n?void 0:n.anchor.path);if(!i)return;let a=e=>!D.isEditor(e)&&_.isElement(e);r&&(a=e=>!D.isEditor(e)&&_.isElement(e)&&e.type===r);const l=S.parent(i),c=D.nodes(e,{at:l,match:a,mode:"lowest"});if(c){const[e]=c}}(i,{elementType:r}),R.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>_.isElement(e)&&!D.isInline(i,e)});const n={id:o.id,type:t,meta:Object.assign(Object.assign({},o.meta),{order:o.meta.order}),value:i.children};e.blockEditorsMap[o.id]=i,e.children[o.id]=n,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children)}))}function Ya(e,t={}){const{at:n=e.selection,deleteAll:o=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=Fa(e.children),r.forEach((t=>{const n=L(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=Ua(e.children),e.applyChanges(),void e.emit("change",e.children)}if(o||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=J({id:q()}),n=Za(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:n,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!n)return;e.children=Fa(e.children);const[a]=n,l=Object.keys(e.children),c=l.find((t=>e.children[t].meta.order===a));if(l.forEach((t=>{const n=e.children[t];n.meta.order>a&&(n.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,o=L(e,{at:[n]});o&&e.focusBlock(o.id,{focusAt:t.focusAt})}}function $a(e,t){const n={};return t.forEach((t=>{const o=t.type;n[o]={hotkey:t.hotkey,type:o,getValue:()=>function(e,t){const n=Ln(e);if(!n)return null;const o=D.marks(n);return null==o?void 0:o[t]}(e,o),isActive:()=>Ha(e,o),toggle:()=>function(e,t){const n=Ln(e),o=Ha(e,t);n&&(o?D.removeMark(n,t):D.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,o),update:t=>function(e,t,n){const o=Ln(e);o&&o.selection&&j.isExpanded(o.selection)&&(D.addMark(o,t,n),e.applyChanges(),e.emit("change",e.children))}(e,o,t)}})),n}function Xa(e,t){const n={};return t.forEach(((t,o)=>{var r;const i=ri(t.elements),a=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.nodeType;if(!("inline"===a||"inlineVoid"===a)){const o={};Object.keys(t.elements).forEach((e=>{const n=gi(t.elements[e],["render"]);o[e]=n}));const{display:r,placeholder:i,align:a,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:o,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,align:a,shortcuts:l},isActive:()=>{const n=L(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{Wa(e,t)},create:n=>{!function(e,t,n){var o;e.children=Fa(e.children);const r=L(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==n?void 0:n.slate)||Ln(e,{at:[null==r?void 0:r.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],l=oi(a.elements),c=a.elements[l];if(!c)return;const s=Object.assign({nodeType:(null===(o=c.props)||void 0===o?void 0:o.nodeType)||"block"},c.props),d=G({id:q(),type:l,props:s});R.setNodes(i,d,{at:[0,0],match:e=>_.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&R.delete(i,{at:[0,0]});const u=J({id:r.id,type:a.type,meta:{order:r.meta.order,depth:r.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{Ka(e,t,n)},updateElement:(t,n,o)=>{!function(e,t,n,o){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=Ln(e,{at:[r.meta.order]});i?D.withoutNormalizing(i,(()=>{const[t]=D.nodes(i,{at:[0],match:e=>_.isElement(e)&&e.type===n}),r=null==t?void 0:t[0],a=(null==r?void 0:r.props)||{},l={props:Object.assign(Object.assign({},a),o)};R.setNodes(i,l,{at:[0],match:e=>_.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,n,o)},delete:t=>{Ya(e,t)}}}})),n}function Za(e){return Va(e,O(A()))}function qa({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const Ga=qa({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),Ja=(()=>{const e=q();return{[e]:J({id:e})}})(),Qa=new X,el=(e,t)=>Qa.on(e,t),tl=(e,t)=>Qa.once(e,t),nl=(e,t)=>Qa.off(e,t),ol=(e,t)=>Qa.emit(e,t);const rl=({editor:n,value:o,marks:r,plugins:i,autoFocus:a,className:l,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:g})=>{const y=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=d((()=>r?[Ga,...r]:[Ga]),[r]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>(n.applyChanges=y,n.readOnly=h||!1,v&&(n.formats=$a(n,v)),n.blocks=Xa(n,m),n.children=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(o)?o:Ja,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const o=Za(e);t[n]=o})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,o,r,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(o=e.options)||void 0===o?void 0:o.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(n),n.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var o;const r=e.elements[t],i=null===(o=r.props)||void 0===o?void 0:o.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=r)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const o=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:o})}})),t}(m),n.on=el,n.once=tl,n.off=nl,n.emit=ol,{editor:n,version:0})));return e(Gi,{children:e(P,Object.assign({editorState:b},{children:t(ai,Object.assign({tools:c},{children:[e(qi,{placeholder:p,marks:v,autoFocus:a,className:l,selectionBoxRoot:s,width:g}),u]}))}))})},il=Object.assign(Object.assign({},fi),{ExtendedBlockActions:({className:o,style:r,onClick:i,children:a})=>{const l=V(),[c,s]=f(!1),{refs:d,floatingStyles:u,context:p}=Ir({placement:"bottom-start",open:c,onOpenChange:s,middleware:[Uo(),Fo(),zo(),ko(10)],whileElementsMounted:Po}),{isMounted:h,styles:g}=Ur(p,{duration:100}),y=Object.assign(Object.assign({},g),u);return l?null:t(n,{children:[h&&e(ui,Object.assign({isOpen:!0,onClose:()=>s(!1),refs:d,style:y},{children:a})),e("button",Object.assign({type:"button",ref:d.setReference,className:`yoo-editor-absolute yoo-editor-right-[8px] yoo-editor-top-[8px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-between yoo-editor-z-10 yoo-editor-opacity-1 yoo-editor-bg-[#eee] yoo-editor-w-[22px] yoo-editor-h-[22px] yoo-editor-transition-opacity yoo-editor-duration-150 yoo-editor-ease-in yoo-editor-border-none yoo-editor-cursor-pointer yoo-editor-rounded-[2px] yoo-editor-p-[0_4px] ${o||""} yoopta-extended-block-actions`,onClick:()=>{null==i||i(),s(!0)},style:c?Object.assign(Object.assign({},r),{opacity:1}):r},{children:e(Zr,{})}))]})}});function al(e,t){const n=Object.keys(e.children),{type:o}=t||{},r=n.find((t=>e.children[t].type===o));return r?e.children[r]:null}function ll(e,t,n={}){try{const{focusAt:o,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=n,l=()=>{const r=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(T.isPoint(t))return t;if(S.isPath(t))return{path:t,offset:0};const[,n]=D.first(e,[0]);return{path:n||[0,0],offset:0}}(r,o);R.select(r,e),w.focus(r)}a&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>l()),i):l()}catch(e){}}function cl(e){return Array.from(new Set(e))}var sl={};!function(e,t){var n="__lodash_hash_undefined__",o=9007199254740991,r="[object Arguments]",i="[object Boolean]",a="[object Date]",l="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",y="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",O="[object Uint8Array]",S="[object Uint8ClampedArray]",D="[object Uint16Array]",_="[object Uint32Array]",R=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[a]=A[w]=A[x]=A[k]=A[E]=A[C]=A[s]=A[d]=A[u]=A[p]=A[h]=A[g]=A[y]=A[O]=A[S]=A[D]=A[_]=!0,A["[object Error]"]=A[l]=A[v]=!1;var T="object"==typeof Y&&Y&&Y.Object===Object&&Y,M="object"==typeof self&&self&&self.Object===Object&&self,L=T||M||Function("return this")(),N=t&&!t.nodeType&&t,I=N&&e&&!e.nodeType&&e,P=I&&I.exports===N;function z(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function U(e,t,n,o){var r=-1,i=e?e.length:0;for(o&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function H(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function K(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=L["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=P?L.Buffer:void 0,re=L.Symbol,ie=L.Uint8Array,ae=K(Object.getPrototypeOf,Object),le=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=oe?oe.isBuffer:void 0,fe=K(Object.keys,Object),pe=Pe(L,"DataView"),he=Pe(L,"Map"),ge=Pe(L,"Promise"),ye=Pe(L,"Set"),ve=Pe(L,"WeakMap"),me=Pe(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ge),ke=Ve(ye),Ee=Ve(ve),Ce=re?re.prototype:void 0,Oe=Ce?Ce.valueOf:void 0;function Se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function De(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function _e(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Re(e){this.__data__=new De(e)}function je(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],o=n.length,i=!!o;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||Ue(a,o))||n.push(a);return n}function Be(e,t,n){var o=e[t];ee.call(e,t)&&Ke(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if(Ke(e[n][0],t))return n;return-1}function Te(e,t,n,o,f,v,j){var B;if(o&&(B=v?o(e,f,v,j):o(e)),void 0!==B)return B;if(!Ze(e))return e;var T=We(e);if(T){if(B=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,o=e.length;t||(t=Array(o));for(;++n<o;)t[n]=e[n];return t}(e,B)}else{var M=Fe(e),L=M==l||M==c;if($e(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(M==u||M==r||L&&!v){if(H(e))return v?e:{};if(B=function(e){return"function"!=typeof e.constructor||He(e)?{}:(t=ae(e),Ze(t)?le(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,ze(e),t)}(e,function(e,t){return e&&Ne(t,qe(t),e)}(B,e))}else{if(!A[M])return v?e:{};B=function(e,t,n,o){var r=e.constructor;switch(t){case m:return Le(e);case i:case a:return new r(+e);case b:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,o);case w:case x:case k:case E:case C:case O:case S:case D:case _:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,o);case s:return function(e,t,n){var o=t?n(V(e),!0):V(e);return U(o,z,new e.constructor)}(e,o,n);case d:case g:return new r(e);case p:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var o=t?n(W(e),!0):W(e);return U(o,F,new e.constructor)}(e,o,n);case y:return l=e,Oe?Object(Oe.call(l)):{}}var l}(e,M,Te,t)}}j||(j=new Re);var N=j.get(e);if(N)return N;if(j.set(e,B),!T)var I=n?function(e){return function(e,t,n){var o=t(e);return We(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,qe,ze)}(e):qe(e);return function(e,t){for(var n=-1,o=e?e.length:0;++n<o&&!1!==t(e[n],n,e););}(I||e,(function(r,i){I&&(r=e[i=r]),Be(B,i,Te(r,t,n,o,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||H(e)?ne:j).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,n,o){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r],l=o?o(n[a],e[a],a,n,e):void 0;Be(n,a,void 0===l?e[a]:l)}return n}function Ie(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Pe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var o=t[e];return o===n?void 0:o}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},De.prototype.clear=function(){this.__data__=[]},De.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),!0)},De.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return Ae(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,o=Ae(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},_e.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||De),string:new Se}},_e.prototype.delete=function(e){return Ie(this,e).delete(e)},_e.prototype.get=function(e){return Ie(this,e).get(e)},_e.prototype.has=function(e){return Ie(this,e).has(e)},_e.prototype.set=function(e,t){return Ie(this,e).set(e,t),this},Re.prototype.clear=function(){this.__data__=new De},Re.prototype.delete=function(e){return this.__data__.delete(e)},Re.prototype.get=function(e){return this.__data__.get(e)},Re.prototype.has=function(e){return this.__data__.has(e)},Re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof De){var o=n.__data__;if(!he||o.length<199)return o.push([e,t]),this;n=this.__data__=new _e(o)}return n.set(e,t),this};var ze=de?K(de,Object):function(){return[]},Fe=function(e){return te.call(e)};function Ue(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&Fe(new pe(new ArrayBuffer(1)))!=b||he&&Fe(new he)!=s||ge&&Fe(ge.resolve())!=f||ye&&Fe(new ye)!=h||ve&&Fe(new ve)!=v)&&(Fe=function(e){var t=te.call(e),n=t==u?e.constructor:void 0,o=n?Ve(n):void 0;if(o)switch(o){case be:return b;case we:return s;case xe:return f;case ke:return h;case Ee:return v}return t});var We=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=Ze(e)?te.call(e):"";return t==l||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!He(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}({get exports(){return sl},set exports(e){sl=e}},sl);var dl=sl;function ul(e,t={}){const{blockId:n,focus:o}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(n&&(r=e.children[n],!r))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(r=L(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=Fa(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(a=r,"function"==typeof window.structuredClone?window.structuredClone(a):dl(a));var a;const l=Za(e);i.id=q(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=l;const c=i.id;e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(c,{waitExecution:!0})}function fl(e,t){w.blur(t),w.deselect(t),R.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const pl=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=Fa(e.children);const{at:o=null,focus:r=!1,slate:i=null}=n,a=L(e),l=o,c={id:q(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=D.string(i,i.selection.anchor.path);s=D.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=Za(e);e.blockEditorsMap[c.id]=d,s&&a&&(c.meta.order=a.meta.order,a.meta.order+=1),e.children[c.id]=c;const u=null==a?void 0:a.id;e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,n={}){e.children=Fa(e.children);const{at:o,focus:r}=n;let i=o||[0];const a=L(e),l=Ln(e);let c=!1,s=!1;if(l&&l.selection){const t=S.parent(l.selection.anchor.path),n=D.string(l,t).trim(),o=D.isStart(l,l.selection.anchor,t);c=""===n&&o,s=!o||n.length>0,w.blur(l),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,n)=>{const o={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+n})};d.push(o.meta.order),e.children[o.id]=o;const r=Za(e);e.blockEditorsMap[o.id]=r})),a&&c){const t=a.meta.order;delete e.children[a.id],delete e.blockEditorsMap[a.id],Object.keys(e.children).forEach((n=>{const o=e.children[n];o.meta.order>t&&(o.meta.order-=1)}))}e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>Ya(e,...t),duplicateBlock:(...t)=>ul(e,...t),toggleBlock:(...t)=>Wa(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Fa(e.children);const o=L(e);o&&(o.meta.depth=o.meta.depth+1,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Fa(e.children);const o=L(e);o&&(o.meta.depth=0===o.meta.depth?0:o.meta.depth-1,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=Fa(e.children);const[o]=n,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===o)),a=r.meta.order<i.meta.order,l=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:l&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=o,r.meta.depth=i.meta.depth,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>ll(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>Ka(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:o=!0}=t,r=L(e);n&&n.selection&&r&&D.withoutNormalizing(n,(()=>{e.children=Fa(e.children);const t=S.parent(n.selection.anchor.path);R.splitNodes(n,{at:n.selection,match:e=>_.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=n.children.slice()[i];R.removeNodes(n,{at:[i],match:e=>_.isElement(e),mode:"highest"});const l={id:q(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=Za(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:o=!0}=n;e.selection=t,o&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:o=!1,allSelected:r=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(o)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=cl(t)}else e.selectedBlocks=cl(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const o=null!==(n=t.slate)&&void 0!==n?n:Ln(e);if(!o)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>fl(e,o)),i):(fl(e,o),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.yoo-editor-pointer-events-none{pointer-events:none}.yoo-editor-absolute{position:absolute}.yoo-editor-relative{position:relative}.-yoo-editor-left-\\[50px\\]{left:-50px}.yoo-editor-left-0{left:0}.yoo-editor-right-\\[8px\\]{right:8px}.yoo-editor-top-0{top:0}.yoo-editor-top-\\[2px\\]{top:2px}.yoo-editor-top-\\[8px\\]{top:8px}.yoo-editor-z-10{z-index:10}.yoo-editor-z-\\[100\\]{z-index:100}.yoo-editor-z-\\[90\\]{z-index:90}.yoo-editor-m-\\[0_1px\\]{margin:0 1px}.yoo-editor-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-editor-my-\\[4px\\]{margin-bottom:4px;margin-top:4px}.yoo-editor-mb-\\[1px\\]{margin-bottom:1px}.yoo-editor-mr-2{margin-right:.5rem}.yoo-editor-mt-\\[2px\\]{margin-top:2px}.yoo-editor-flex{display:flex}.yoo-editor-h-4{height:1rem}.yoo-editor-h-\\[1px\\]{height:1px}.yoo-editor-h-\\[22px\\]{height:22px}.yoo-editor-h-\\[24px\\]{height:24px}.yoo-editor-h-full{height:100%}.yoo-editor-w-4{width:1rem}.yoo-editor-w-\\[18px\\]{width:18px}.yoo-editor-w-\\[22px\\]{width:22px}.yoo-editor-w-\\[24px\\]{width:24px}.yoo-editor-w-auto{width:auto}.yoo-editor-w-full{width:100%}.yoo-editor-min-w-\\[200px\\]{min-width:200px}.yoo-editor-cursor-default{cursor:default}.yoo-editor-cursor-pointer{cursor:pointer}.yoo-editor-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoo-editor-flex-col{flex-direction:column}.yoo-editor-items-center{align-items:center}.yoo-editor-justify-start{justify-content:flex-start}.yoo-editor-justify-center{justify-content:center}.yoo-editor-justify-between{justify-content:space-between}.yoo-editor-overflow-hidden{overflow:hidden}.yoo-editor-rounded{border-radius:.25rem}.yoo-editor-rounded-\\[2px\\]{border-radius:2px}.yoo-editor-rounded-\\[6px\\]{border-radius:6px}.yoo-editor-rounded-md{border-radius:.375rem}.yoo-editor-rounded-sm{border-radius:.125rem}.yoo-editor-border{border-width:1px}.yoo-editor-border-none{border-style:none}.yoo-editor-bg-\\[\\#2383e224\\]{background-color:#2383e224}.yoo-editor-bg-\\[\\#37352f14\\]{background-color:#37352f14}.yoo-editor-bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-editor-bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}.yoo-editor-bg-inherit{background-color:inherit}.yoo-editor-bg-transparent{background-color:transparent}.yoo-editor-p-0{padding:0}.yoo-editor-p-\\[0_4px\\]{padding:0 4px}.yoo-editor-px-0{padding-left:0;padding-right:0}.yoo-editor-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-editor-px-\\[2px\\]{padding-left:2px;padding-right:2px}.yoo-editor-py-0{padding-bottom:0;padding-top:0}.yoo-editor-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-editor-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-editor-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-editor-text-sm{font-size:.875rem;line-height:1.25rem}.yoo-editor-leading-\\[120\\%\\]{line-height:120%}.yoo-editor-text-\\[rgba\\(55\\,53\\,47\\,0\\.35\\)\\]{color:rgba(55,53,47,.35)}.yoo-editor-opacity-0{opacity:0}.yoo-editor-opacity-100{opacity:1}.yoo-editor-shadow-md{--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);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-editor-outline-none{outline:2px solid transparent;outline-offset:2px}.yoo-editor-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-duration-150{transition-duration:.15s}.yoo-editor-duration-\\[180ms\\]{transition-duration:.18s}.yoo-editor-ease-\\[cubic-bezier\\(0\\.4\\,0\\,0\\.2\\,1\\)\\]{transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}#yoopta-editor{height:auto;min-width:400px}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.hover\\:yoo-editor-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.focus\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:focus,.hover\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:hover{background-color:rgba(55,54,47,.08)}.focus\\:yoo-editor-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:yoo-editor-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:active{background-color:rgba(55,54,47,.08)}.data-\\[disabled\\]\\:yoo-editor-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:yoo-editor-opacity-50[data-disabled]{opacity:.5}.data-\\[hovered-state\\=\\"true\\"\\]\\:yoo-editor-opacity-100[data-hovered-state=true]{opacity:1}');export{Ai as HOTKEYS,il as UI,M as YooptaPlugin,J as buildBlockData,G as buildBlockElement,pl as createYooptaEditor,qa as createYooptaMark,rl as default,L as findPluginBlockBySelectionPath,al as findPluginBlockByType,Ln as findSlateBySelectionPath,q as generateId,ri as getRootBlockElement,oi as getRootBlockElementType,F as useBlockData,W as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,H as useYooptaPlugin,K as useYooptaPluginOptions,V as useYooptaReadOnly,li as useYooptaTools};
6
+ var Xo=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Zo="undefined"==typeof Element,qo=Zo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Go=!Zo&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Jo=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},Qo=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Jo(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{qo.call(a,Xo)&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var s=a.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(a),d=!Jo(s,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(s&&d){var u=e(!0===s?a.children:s.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},er=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tr=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!er(e)?0:e.tabIndex},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},or=function(e){return"INPUT"===e.tagName},rr=function(e){return function(e){return or(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Go(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!r||r===e}(e)},ir=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},ar=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=qo.call(e,"details>summary:first-of-type")?e.parentElement:e;if(qo.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ir(e)}else{if("function"==typeof o){for(var i=e;e;){var a=e.parentElement,l=Go(e);if(a&&!a.shadowRoot&&!0===o(a))return ir(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,o,r,i=e&&Go(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&a;){var c,s,d;l=!(null===(s=a=null===(c=i=Go(a))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},lr=function(e,t){return!(t.disabled||Jo(t)||function(e){return or(e)&&"hidden"===e.type}(t)||ar(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return!!qo.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},cr=function(e,t){return!(rr(t)||tr(t)<0||!lr(e,t))},sr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},dr=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var n=tr(e);return n<0&&t&&!er(e)?0:n}(a,i),c=i?e(t.candidates):a;0===l?i?n.push.apply(n,c):n.push(a):o.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:c})})),o.sort(nr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ur=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qo([e],t.includeContainer,{filter:cr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:sr}):function(e,t,n){if(Jo(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Xo));return t&&qo.call(e,Xo)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,cr.bind(null,t)),dr(n)};const fr=o["useInsertionEffect".toString()]||(e=>e());var pr="undefined"!=typeof document?c:s;function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},hr.apply(this,arguments)}let gr=!1,yr=0;const vr=()=>"floating-ui-"+yr++;const mr=o["useId".toString()]||function(){const[e,t]=o.useState((()=>gr?vr():void 0));return pr((()=>{null==e&&t(vr())}),[]),o.useEffect((()=>{gr||(gr=!0)}),[]),e};const br=o.createContext(null),wr=o.createContext(null);function xr(e){return"data-floating-ui-"+e}function kr(e){const t=l(e);return pr((()=>{t.current=e})),t}const Er=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const n=ur(e,Er());"prev"===t&&n.reverse();const o=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return n.slice(o+1)[0]}function Or(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Hn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,o)}function Sr(e){ur(e,Er()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const _r={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Rr(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const jr=o.forwardRef((function(e,t){const[n,r]=o.useState();pr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",Rr),()=>{document.removeEventListener("keydown",Rr)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[xr("focus-guard")]:"",style:_r};return o.createElement("span",hr({},e,i))})),Br=o.createContext(null),Ar=xr("portal");function Tr(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:n}=void 0===e?{}:e;const[r,i]=o.useState(null),a=mr(),l=Mr(),c=o.useRef(null);return pr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{c.current=null}))}),[r]),pr((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=a,n.setAttribute(Ar,""),e.appendChild(n),c.current=n,i(n)}),[t,a]),pr((()=>{if(c.current)return;let e=n||(null==l?void 0:l.portalNode);e&&!Fn(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const r=document.createElement("div");r.id=a,r.setAttribute(Ar,""),e=o||e,e.appendChild(r),c.current=r,i(r)}),[t,n,a,l]),r}({id:n,root:r}),[l,c]=o.useState(null),s=o.useRef(null),d=o.useRef(null),u=o.useRef(null),f=o.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!r&&!a);return o.useEffect((()=>{if(a&&i&&(null==l||!l.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Or(e)){("focusin"===e.type?Dr:Sr)(a)}}}),[a,i,null==l?void 0:l.modal]),o.createElement(Br.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:c})),[i,a])},p&&a&&o.createElement(jr,{"data-type":"outside",ref:s,onFocus:e=>{if(Or(e,a)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&a&&o.createElement("span",{"aria-owns":a.id,style:_r}),a&&b(t,a),p&&a&&o.createElement(jr,{"data-type":"outside",ref:d,onFocus:e=>{if(Or(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const Mr=()=>o.useContext(Br),Lr=new Set,Nr=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const i=mr();return pr((()=>{if(!n)return;Lr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[o]=r+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Lr.delete(i),0===Lr.size&&(Object.assign(t,{overflow:"",[o]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,l)))}}),[i,n]),o.createElement("div",hr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Ir(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e,[a,l]=o.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||a,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);Ko(p,r)||h(r);const[g,y]=o.useState(null),[m,b]=o.useState(null),w=o.useCallback((e=>{e!==C.current&&(C.current=e,y(e))}),[]),x=o.useCallback((e=>{e!==O.current&&(O.current=e,b(e))}),[]),k=a||g,E=l||m,C=o.useRef(null),O=o.useRef(null),S=o.useRef(u),D=null!=s,_=$o(s),R=$o(i),j=o.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:t,strategy:n,middleware:p};R.current&&(e.platform=R.current),Ho(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Ko(S.current,t)&&(S.current=t,v.flushSync((()=>{f(t)})))}))}),[p,t,n,R]);Vo((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=o.useRef(!1);Vo((()=>(B.current=!0,()=>{B.current=!1})),[]),Vo((()=>{if(k&&(C.current=k),E&&(O.current=E),k&&E){if(_.current)return _.current(k,E,j);j()}}),[k,E,j,_,D]);const A=o.useMemo((()=>({reference:C,floating:O,setReference:w,setFloating:x})),[w,x]),T=o.useMemo((()=>({reference:k,floating:E})),[k,E]),M=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Yo(T.floating,u.x),o=Yo(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...Wo(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,c,T.floating,u.x,u.y]);return o.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=o.useContext(wr),u=null!=((null==(f=o.useContext(br))?void 0:f.id)||null);var f;const p=function(e){const t=o.useRef((()=>{}));return fr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),h=o.useRef(null),g=o.useRef({}),y=o.useState((()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter((e=>e!==n)))||[])}}}()))[0],m=mr(),b=o.useCallback((e=>{const t=Fn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=o.useCallback((e=>{(Fn(e)||null===e)&&(h.current=e,l(e)),(Fn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Fn(e))&&s.refs.setReference(e)}),[s.refs]),x=o.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=o.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),E=o.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:y,open:n,onOpenChange:p})),[s,i,m,y,n,p,x,k]);return pr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const Pr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Fr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[l,c]=o.useState(!1),[s,d]=o.useState("unmounted"),u=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,a);return pr((()=>{l&&!u&&d("unmounted")}),[l,u]),pr((()=>{if(r){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[n,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:a,duration:l=250}=t,c=e.placement,s=c.split("-")[0],d=o.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof l,f=(u?l:l.open)||0,p=(u?l:l.close)||0,[h,g]=o.useState((()=>({...zr(a,d),...zr(n,d)}))),{isMounted:y,status:v}=Fr(e,{duration:l}),m=kr(n),b=kr(r),w=kr(i),x=kr(a);return pr((()=>{const e=zr(m.current,d),t=zr(w.current,d),n=zr(x.current,d),o=zr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&g({transitionProperty:Object.keys(o).map(Pr).join(","),transitionDuration:f+"ms",...n,...o}),"close"===v){const o=t||e;g({transitionProperty:Object.keys(o).map(Pr).join(","),transitionDuration:p+"ms",...n,...o})}}),[p,w,m,b,x,f,v,d]),{isMounted:y,styles:h}}var Hr;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Vr.apply(this,arguments)}var Kr=function(e){return o.createElement("svg",Vr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Hr||(Hr=o.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Wr(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}var Yr=["color"],$r=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Yr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Xr=["color"],Zr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Xr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),qr=["color"],Gr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,qr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Jr=["color"],Qr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Wr(e,Jr);return y("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),y("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),ei=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ti={"text/plain":"Text","text/html":"Url",default:"Text"};var ni=function(e,t){var n,o,r,i,a,l,c=!1;t||(t={}),n=t.debug||!1;try{if(r=ei(),i=document.createRange(),a=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),void 0===o.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=ti[t.format]||ti.default;window.clipboardData.setData(r,e)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,e);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))})),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return c};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ri(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}const ii=i(void 0),ai=({children:o,tools:r})=>{const i=V(),a=d((()=>r?Object.keys(r).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=r[t])||void 0===n?void 0:n.render})}),{}):{}),[r]),l=d((()=>!r||i?null:Object.keys(r).map((t=>{var n,o,i;const a=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.tool,l=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.render,c=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return a?e(a,Object.assign({render:l},c),t):null}))),[d]);return e(ii.Provider,Object.assign({value:a},{children:t(n,{children:[l,o]})}))},li=()=>{const e=a(ii);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e},ci=({children:t})=>e("div",Object.assign({className:"yoo-editor-flex yoo-editor-flex-col"},{children:t})),si=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoo-editor-bg-[#FFF] yoo-editor-relative yoo-editor-min-w-[200px] yoo-editor-w-auto yoo-editor-overflow-hidden yoo-editor-rounded-md yoo-editor-border yoo-editor-bg-popover yoo-editor-py-[6px] yoo-editor-px-0 yoo-editor-text-popover-foreground yoo-editor-shadow-md data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),di=({children:t})=>e("div",Object.assign({className:"yoo-editor-relative yoo-editor-flex yoo-editor-cursor-default yoo-editor-select-none yoo-editor-items-center yoo-editor-text-sm yoo-editor-outline-none yoo-editor-transition-colors focus:yoo-editor-bg-accent focus:yoo-editor-text-accent-foreground data-[disabled]:yoo-editor-pointer-events-none data-[disabled]:yoo-editor-opacity-50"},{children:t})),ui=({isOpen:n,onClose:o,refs:r,style:i,children:a})=>{var l,c;const s=z(),d=li(),[u,p]=f(!1),{refs:h,floatingStyles:g,context:y}=Ir({placement:"right",open:u,onOpenChange:p,middleware:[Uo(),Fo(),zo(),ko(10)],whileElementsMounted:Po}),{isMounted:v,styles:m}=Ur(y,{duration:100});if(!n)return null;const b=L(s,{at:s.selection}),w=ri(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(l=null==w?void 0:w.props)||void 0===l?void 0:l.nodeType),k=d.ActionMenu,E=Object.assign(Object.assign({},g),m);return e(Tr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Nr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:o},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(si,{children:[t(ci,{children:[e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),o()}},{children:[e(Qr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),o()}},{children:[e($r,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(di,{children:[v&&!!k&&e(Tr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Nr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:E,ref:h.setFloating},{children:e(k,{actions:Object.keys(s.blocks),editor:s,selectedAction:"",onClose:()=>{p(!1),o()},empty:!1,onMouseEnter:()=>{},mode:"toggle",view:"small"})}))}))})),t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Kr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=L(s);e&&(ni(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),o()}},{children:[e(Gr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var fi=Object.freeze({__proto__:null,BlockOptions:ui,BlockOptionsMenuContent:si,BlockOptionsMenuGroup:ci,BlockOptionsMenuItem:di,BlockOptionsSeparator:({className:t})=>e("div",{className:`yoo-editor-h-[1px] yoo-editor-bg-[#37352f14] yoo-editor-my-[4px] yoo-editor-w-full ${t}`})});const pi=({block:n,editor:o,dragHandleProps:r,showActions:i,onChangeActiveBlock:a})=>{const[l,c]=f(!1),{refs:s,floatingStyles:d,context:u}=Ir({placement:"right-start",open:l,onOpenChange:c,middleware:[Uo(),Fo(),zo(),ko()]}),{isMounted:p,styles:h}=Ur(u,{duration:100}),{setActivatorNodeRef:g,attributes:y,listeners:v}=r,m=Object.assign(Object.assign({},d),h);return t("div",Object.assign({contentEditable:!1,"data-hovered-state":i,className:'yoo-editor-flex yoo-editor-absolute -yoo-editor-left-[50px] yoo-editor-top-[2px] yoo-editor-opacity-0 yoo-editor-transition-opacity yoopta-element-actions data-[hovered-state="true"]:yoo-editor-opacity-100'},{children:[e("button",Object.assign({type:"button",onClick:()=>{const e=J({id:q()}),t=[n.meta.order+1];o.setSelection([n.meta.order]),o.insertBlock(e,{at:t,focus:!0})},className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoo-editor-w-[24px] yoopta-element-actions-plus"},{children:e(Mn,{})})),e("button",Object.assign({type:"button",className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoopta-element-actions-drag",ref:e=>{g(e),s.setReference(e)}},y,v,{onClick:e=>{e.stopPropagation(),a(n.id);const t=Ln(o,{at:[n.meta.order]});o.focusBlock(n.id),t&&setTimeout((()=>{o.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),R.deselect(t)),o.setBlockSelected([n.meta.order],{only:!0}),o.setSelection([n.meta.order]),c(!0)}),10)}},{children:e(An,{})})),e(ui,{isOpen:p,refs:s,style:m,onClose:()=>c(!1)})]}))},hi=({children:n,block:o,blockId:r})=>{var i;const a=z(),[l,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:y,isDragging:v}=Cn({id:r,disabled:a.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:v?.7:1,marginLeft:20*o.meta.depth+"px"},b=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(o.meta.order),w=l===r,x={borderBottom:y&&!v?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoo-editor-relative yoo-editor-py-0 yoo-editor-px-[2px] yoo-editor-mt-[2px] yoo-editor-mb-[1px] yoo-editor-rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||c(r)},onMouseLeave:()=>{a.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":r},{children:[!a.readOnly&&e(pi,{block:o,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:n})),b&&!a.readOnly&&e("div",{className:"yoo-editor-absolute yoo-editor-left-0 yoo-editor-top-0 yoo-editor-bg-[#2383e224] yoo-editor-z-[90] yoo-editor-rounded yoo-editor-opacity-100 yoo-editor-h-full yoo-editor-w-full yoo-editor-pointer-events-none yoopta-selection-block"})]}))};function gi(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;var yi={};Object.defineProperty(yi,"__esModule",{value:!0});for(var vi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),mi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},bi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:vi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},wi={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},xi=1;xi<20;xi++)wi["f"+xi]=111+xi;function ki(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var o=e.map((function(e){return Ei(e,t)})),r=function(e){return o.some((function(t){return Ci(t,e)}))};return null==n?r:r(n)}function Ei(e,t){var n=t&&t.byKey,o={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var a in mi)o[mi[a]]=!1;var l=!0,c=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Si(f),g=mi[h];if(f.length>1&&!g&&!bi[f]&&!wi[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?o.key=h:o.which=Oi(f)),g&&(o[g]=!p||null)}}catch(e){c=!0,s=e}finally{try{!l&&u.return&&u.return()}finally{if(c)throw s}}return o}function Ci(e,t){for(var n in e){var o=e[n],r=void 0;if(null!=o&&((null!=(r="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===o&&93===t.which?91:t.which:t[n])||!1!==o)&&r!==o))return!1}return!0}function Oi(e){return e=Si(e),wi[e]||e.toUpperCase().charCodeAt(0)}function Si(e){return e=e.toLowerCase(),e=bi[e]||e}yi.default=ki,yi.isHotkey=ki,yi.isCodeHotkey=function(e,t){return ki(e,t)};var Di=yi.isKeyHotkey=function(e,t){return ki(e,{byKey:!0},t)};yi.parseHotkey=Ei,yi.compareHotkey=Ci,yi.toKeyCode=Oi,yi.toKeyName=Si;const _i={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",slashCommand:"/",kekCeburek:"mod+enter"},Ri={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},ji={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Bi=e=>{const t=_i[e],n=Ri[e],o=ji[e],r=t&&Di(t),i=n&&Di(n),a=o&&Di(o);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!a||!a(e)))},Ai={isBold:Bi("bold"),isCompose:Bi("compose"),isArrowLeft:Bi("arrowLeft"),isArrowRight:Bi("arrowRight"),isArrowUp:Bi("arrowUp"),isArrowDown:Bi("arrowDown"),isDeleteBackward:Bi("deleteBackward"),isDeleteForward:Bi("deleteForward"),isDeleteLineBackward:Bi("deleteLineBackward"),isDeleteLineForward:Bi("deleteLineForward"),isDeleteWordBackward:Bi("deleteWordBackward"),isDeleteWordForward:Bi("deleteWordForward"),isExtendBackward:Bi("extendBackward"),isExtendForward:Bi("extendForward"),isExtendLineBackward:Bi("extendLineBackward"),isExtendLineForward:Bi("extendLineForward"),isItalic:Bi("italic"),isMoveLineBackward:Bi("moveLineBackward"),isMoveLineForward:Bi("moveLineForward"),isCtrlLeft:Bi("ctrlLeft"),isCtrlRight:Bi("ctrlRight"),isRedo:Bi("redo"),isShiftEnter:Bi("shiftEnter"),isEnter:Bi("enter"),isTransposeCharacter:Bi("transposeCharacter"),isUndo:Bi("undo"),isSpace:Bi("space"),isSelect:Bi("select"),isTab:Bi("tab"),isShiftTab:Bi("shiftTab"),isBackspace:Bi("backspace"),isCmdEnter:Bi("cmdEnter"),isCmd:Bi("cmd"),isEscape:Bi("escape"),isSlashCommand:Bi("slashCommand"),isShiftArrowUp:Bi("shiftArrowUp"),isShiftArrowDown:Bi("shiftArrowDown"),isKekceburek:Bi("kekCeburek")};const Ti={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const o=S.parent(n.selection.anchor.path);if(Ai.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Ai.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=D.isStart(n,n.selection.anchor,o),i=D.isEnd(n,n.selection.anchor,o);if(!r&&!i)return void e.splitBlock({slate:n,focus:!0});const a=J({id:q()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:l,slate:n,focus:!0})}else if(Ai.isBackspace(t)){if(t.isDefaultPrevented())return;const o=L(e,{at:e.selection}),r=e.blocks[(null==o?void 0:o.type)||""],i=S.parent(n.selection.anchor.path);if(D.isStart(n,n.selection.anchor,i)){t.preventDefault();const o=D.string(n,i),a=e.selection?e.selection[0]-1:0,l=Ln(e,{at:[a]});let c;if(l&&!r.hasCustomEditor&&(c=function(e,t){const[,n]=D.last(e,t);return{path:n,offset:D.string(e,n).length}}(l,i)),0===o.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:c});{if(j.isExpanded(n.selection))return R.delete(n,{at:n.selection});if(!l)return;if(0===D.string(l,[0,0]).length)return e.deleteBlock({at:[a],focus:!0,focusAt:c});const t=Array.from(D.nodes(n,{at:[0],match:e=>!D.isEditor(e)&&(B.isText(e)||D.isInline(n,e)),mode:"highest"})).map((([e])=>e));return R.insertNodes(l,t,{at:D.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:c})}}}else{if(Ai.isSelect(t)){if(t.isDefaultPrevented())return;const[,o]=D.first(n,[0]),[,r]=D.last(n,[n.children.length-1]),i=D.range(n,o,r),a=j.equals(n.selection,i);if(j.isExpanded(n.selection)&&a)return t.preventDefault(),w.blur(n),w.deselect(n),R.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Ai.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Ai.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Ai.isArrowUp(t)){if(t.isDefaultPrevented())return;const o=S.parent(n.selection.anchor.path);if(D.isStart(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]-1]:null,o=Ln(e,{at:n}),r=L(e,{at:n});if(o&&r){const[,n]=D.last(o,[0]),i={path:n,offset:D.string(o,n).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Ai.isArrowDown(t)){if(t.isDefaultPrevented())return;const o=S.parent(n.selection.anchor.path);if(D.isEnd(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]+1]:null,r=Ln(e,{at:n}),i=L(e,{at:n});if(r&&i){const n=function(e,t){const[,n]=D.first(e,t);return{path:n,offset:0}}(r,o);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(j.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Di(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Mi=({children:t,attributes:n,placeholder:o})=>{const r=x(),i=Object.assign({},n);return r&&o&&(i["data-placeholder"]=o,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Li(e){try{return new URL(e),!0}catch(e){return!1}}const Ni=(e,t)=>{(e=>{const[t]=D.nodes(e,{match:e=>!D.isEditor(e)&&_.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{R.unwrapNodes(e,{match:e=>!D.isEditor(e)&&_.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,o=n&&j.isCollapsed(n),r={type:"link",children:o?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};o?R.insertNodes(e,r):(R.wrapNodes(e,r,{split:!0}),R.collapse(e,{edge:"end"}))};function Ii(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Pi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function zi(e,t,n){var o,r,i;if(3===n.nodeType){return null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const a=n;let l=Array.from(a.childNodes).map((n=>zi(e,t,n))).flat();if(Pi[n.nodeName]){return{[Pi[n.nodeName].type]:!0,text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const o=t[n.nodeName],r=e.blocks[o.type],a=oi(r.elements)||"",c=r.elements[a],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:q(),type:a,children:s&&!r.hasCustomEditor?[{text:""}]:l.map(Fi),props:Object.assign({nodeType:"block"},c.props)};if(o.parse){const e=o.parse(n);if(e)if(_.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return J({id:q(),type:o.type,value:[d],meta:{order:0,depth:0}})}return l}function Fi(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Ii(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Ui={html:{deserialize:function(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const o=e.plugins[n],{parsers:r}=o;if(r){const{html:e}=r;if(e){const{deserialize:o}=e;if(o){const{nodeNames:e}=o;e&&e.forEach((e=>{t[e]={type:n,parse:o.parse}}))}}}})),t}(e);return zi(e,n,t).filter(Ii)},serialize:function(){}},markdown:{}},Hi=({id:t,customEditor:n,elements:o,marks:r,events:i,options:a,placeholder:c="Type '/' for commands"})=>{var s,f;const p=z(),h=F(t),g=l(h.value).current,y=h.type,v=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),b=d((()=>{let e=p.blockEditorsMap[t];return Object.keys(o).forEach((t=>{var n;const r=null===(n=o[t].props)||void 0===n?void 0:n.nodeType,i="inline"===r,a="void"===r,l="inlineVoid"===r;l&&(e.markableVoid=e=>e.type===t),(a||l)&&(e.isVoid=e=>e.type===t),(i||l)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&Li(t)?Ni(e,t):n(t)},e.insertData=n=>{const o=n.getData("text/plain");o&&Li(o)?Ni(e,o):t(n)},e})(e))})),e}),[]),w=d((()=>{if(!i||p.readOnly)return{};const e={hotkeys:Ai,currentBlock:h,defaultBlock:J({id:q()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](p,b,e)(t)}}})),t}),[i,p,h]),x=u((e=>p.updateBlock(t,{value:e})),[t]),k=u((n=>{const o=v[n.element.type];return o?e(o,Object.assign({},n,{blockId:t,HTMLAttributes:null==a?void 0:a.HTMLAttributes})):e(C,Object.assign({},n))}),[o]),E=u((t=>{var n,o,r,i,a;let{children:l,leaf:s,attributes:d}=t;const u=gi(s,["text"]),f=(null===(n=p.selection)||void 0===n?void 0:n[0])===h.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(l=t.render({children:l,leaf:s}))}));const g=!("void"===(null===(a=null===(i=null===(r=null===(o=t.children)||void 0===o?void 0:o.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&f&&s.withPlaceholder;return e(Mi,Object.assign({attributes:d,placeholder:g?c:void 0},{children:l}))}),[r]),O=u((e=>{var t;p.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),Ti.onKeyDown(p)(e))}),[w.onKeyDown,p.readOnly]),S=u((e=>{var t;p.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)}),[w.onKeyUp,p.readOnly]),_=u((e=>{var t,n;p.readOnly||((null===(t=p.selection)||void 0===t?void 0:t[0])!==h.meta.order&&p.setSelection([h.meta.order]),null===(n=null==w?void 0:w.onClick)||void 0===n||n.call(w,e))}),[w.onClick,p.readOnly,null===(s=p.selection)||void 0===s?void 0:s[0]]),R=u((e=>{var t;p.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))}),[w.onBlur,p.readOnly]),B=u((e=>{var t;p.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)}),[w.onFocus,p.readOnly]),A=u((e=>{var t;if(p.readOnly)return;null===(t=null==w?void 0:w.onPaste)||void 0===t||t.call(w,e);const n=e.clipboardData.getData("text/html"),o=(new DOMParser).parseFromString(n,"text/html");if(o.body.childNodes.length>0){const e=Ui.html.deserialize(p,o.body);if(e.length>0)return void p.insertBlocks(e,{at:p.selection,focus:!0})}}),[w.onPaste,p.readOnly]),T=u((e=>{var t;const n=[];if(p.readOnly)return n;const[o,r]=e,i=(null===(t=p.selection)||void 0===t?void 0:t[0])===h.meta.order;return b.selection&&i&&!D.isEditor(o)&&""===D.string(b,[r[0]])&&j.includes(b.selection,r)&&j.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[p.readOnly,null===(f=p.selection)||void 0===f?void 0:f[0]]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":y},{children:e(Vi,{id:t,slate:b,initialValue:g,onChange:x,decorate:T,renderLeaf:E,renderElement:k,eventHandlers:w,onKeyDown:O,onKeyUp:S,onFocus:B,onClick:_,onBlur:R,customEditor:n,readOnly:p.readOnly,onPaste:A})}))},Vi=p((({id:t,slate:n,initialValue:o,onChange:r,renderLeaf:i,renderElement:a,eventHandlers:l,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:y})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:o,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:a,renderLeaf:i,className:"focus-visible:yoo-editor-outline-none focus:yoo-editor-outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:g,onBlur:f,readOnly:y,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Vi.displayName="SlateEditorInstance";const Ki=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Ae(Et,{activationConstraint:{delay:100,tolerance:0}}),Ae(mt,{coordinateGetter:Dn})),handleDragEnd:u((t=>{const{active:n,over:o}=t;if(n&&o&&n.id!==o.id){const t=e.children[o.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),Wi=[],Yi=({editor:t,marks:o,placeholder:r})=>{const i=V(),{sensors:a,handleDragEnd:l,handleDragStart:c}=Ki({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Wi:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],a=t.children[i],l=t.plugins[a.type];a&&l?f.push(e(hi,Object.assign({block:a,blockId:i},{children:e(Hi,{type:a.type,id:i,marks:o,customEditor:l.customEditor,events:l.events,elements:l.elements,options:l.options,placeholder:r},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e(n,{children:f}):e(tn,Object.assign({sensors:a,collisionDetection:Fe,onDragStart:c,onDragEnd:l},{children:e(vn,Object.assign({disabled:i,items:u,strategy:hn},{children:f}))}))},$i=({editor:e,yooptaEditorRef:t,root:n})=>{const[o,r]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var a;if(e.readOnly||!1===n)return;const l=null===(a=t.current)||void 0===a?void 0:a.contains(i.target);if(!l&&!o.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||r({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!o.selection||e.readOnly||!1===n)return;r((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t)=>{const n=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((o,r)=>{if(!o)return;const i=o.getBoundingClientRect(),a=Math.min(e[1],t[1]),l=Math.min(e[0],t[0]),c=Math.max(e[1],t[1]),s=Math.max(e[0],t[0]);a<i.bottom&&c>i.top&&l<i.right&&s>i.left&&n.push(r)})),n})(o.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var o;if(e.readOnly||!1===n)return;const r=n&&"current"in n?n.current:n||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(o=t.current)||void 0===o?void 0:o.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",i),r.addEventListener("mousemove",a),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",l)}}),[e.selectedBlocks,o,n,e.readOnly]);const c=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},o),{onClose:c})},Xi=({origin:t,coords:n,isOpen:o})=>{if(!o)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})},Zi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},qi=({placeholder:n,marks:o,className:r,selectionBoxRoot:i,width:a,autoFocus:c=!0})=>{const d=z(),u=V(),f=l(null),p=$i({editor:d,yooptaEditorRef:f,root:i});let h=l(Zi).current;s((()=>{if(!c||u)return;const e=L(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.selectedBlocks,u]);const g=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},y=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},v=e=>{var t,n,o,r,i;if(!u){if(Ai.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Ai.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void y();if(Array.isArray(d.selectedBlocks)&&(null===(o=d.selectedBlocks)||void 0===o?void 0:o.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void y()}if(Ai.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(r=d.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const o=S.parent(n.selection.anchor.path),i=D.isStart(n,n.selection.focus,o);if(j.isExpanded(n.selection)&&i){const o=d.selection?[d.selection[0]-1]:[0],r=L(d,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),R.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Ai.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const o=S.parent(n.selection.anchor.path),r=D.isEnd(n,n.selection.focus,o);if(j.isExpanded(n.selection)&&r){const o=d.selection?[d.selection[0]+1]:[0],r=L(d,{at:o});t&&r&&(e.preventDefault(),w.blur(n),w.deselect(n),R.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:a},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({id:"yoopta-editor",className:r,style:m,ref:f,onClick:e=>{u||(y(),(e=>{var t;const n=f.current;if(!n)return;const{bottom:o}=n.getBoundingClientRect(),r=o-parseInt(getComputedStyle(n).paddingBottom,10),i=J({id:q()});if(e.clientY>=r){const e=Object.keys(d.children).length-1,n=L(d,{at:[e]}),o=Ln(d,{at:[e]});if(n&&o&&o.selection){const e=D.string(o,o.selection.anchor.path),r=S.parent(o.selection.anchor.path),[a]=D.node(o,r);if(n.type===i.type&&_.isElement(a)&&"void"!==(null===(t=a.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:o})}const r=e+1;d.insertBlock(i,{at:[r],focus:!0})}})(e),g())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(y(),g())}},{children:[e(Yi,{editor:d,marks:o,placeholder:n}),!1!==i&&e(Xi,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},Gi=({children:e,fallback:t=null})=>{const[n,o]=f(!1);return s((()=>o(!0)),[]),n?e:t};var Ji=Symbol.for("immer-nothing"),Qi=Symbol.for("immer-draftable"),ea=Symbol.for("immer-state");function ta(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var na=Object.getPrototypeOf;function oa(e){return!!e&&!!e[ea]}function ra(e){return!!e&&(aa(e)||Array.isArray(e)||!!e[Qi]||!!e.constructor?.[Qi]||ua(e)||fa(e))}var ia=Object.prototype.constructor.toString();function aa(e){if(!e||"object"!=typeof e)return!1;const t=na(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ia}function la(e,t){0===ca(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function ca(e){const t=e[ea];return t?t.type_:Array.isArray(e)?1:ua(e)?2:fa(e)?3:0}function sa(e,t){return 2===ca(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function da(e,t,n){const o=ca(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function ua(e){return e instanceof Map}function fa(e){return e instanceof Set}function pa(e){return e.copy_||e.base_}function ha(e,t){if(ua(e))return new Map(e);if(fa(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&aa(e)){if(!na(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[ea];let o=Reflect.ownKeys(n);for(let t=0;t<o.length;t++){const r=o[t],i=n[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(na(e),n)}function ga(e,t=!1){return va(e)||oa(e)||!ra(e)||(ca(e)>1&&(e.set=e.add=e.clear=e.delete=ya),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>ga(t,!0)))),e}function ya(){ta(2)}function va(e){return Object.isFrozen(e)}var ma,ba={};function wa(e){const t=ba[e];return t||ta(0),t}function xa(){return ma}function ka(e,t){t&&(wa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ea(e){Ca(e),e.drafts_.forEach(Sa),e.drafts_=null}function Ca(e){e===ma&&(ma=e.parent_)}function Oa(e){return ma={drafts_:[],parent_:ma,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Sa(e){const t=e[ea];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Da(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[ea].modified_&&(Ea(t),ta(4)),ra(e)&&(e=_a(t,e),t.parent_||ja(t,e)),t.patches_&&wa("Patches").generateReplacementPatches_(n[ea].base_,e,t.patches_,t.inversePatches_)):e=_a(t,n,[]),Ea(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ji?e:void 0}function _a(e,t,n){if(va(t))return t;const o=t[ea];if(!o)return la(t,((r,i)=>Ra(e,o,t,r,i,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return ja(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,i=!1;3===o.type_&&(r=new Set(t),t.clear(),i=!0),la(r,((r,a)=>Ra(e,o,t,r,a,n,i))),ja(e,t,!1),n&&e.patches_&&wa("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Ra(e,t,n,o,r,i,a){if(oa(r)){const a=_a(e,r,i&&t&&3!==t.type_&&!sa(t.assigned_,o)?i.concat(o):void 0);if(da(n,o,a),!oa(a))return;e.canAutoFreeze_=!1}else a&&n.add(r);if(ra(r)&&!va(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;_a(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||ja(e,r)}}function ja(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ga(t,n)}var Ba={get(e,t){if(t===ea)return e;const n=pa(e);if(!sa(n,t))return function(e,t,n){const o=Ma(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!ra(o)?o:o===Ta(e.base_,t)?(Na(e),e.copy_[t]=Ia(o,e)):o},has:(e,t)=>t in pa(e),ownKeys:e=>Reflect.ownKeys(pa(e)),set(e,t,n){const o=Ma(pa(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=Ta(pa(e),t),a=o?.[ea];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(i=o)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==n||sa(e.base_,t)))return!0;Na(e),La(e)}var r,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ta(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Na(e),La(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=pa(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){ta(11)},getPrototypeOf:e=>na(e.base_),setPrototypeOf(){ta(12)}},Aa={};function Ta(e,t){const n=e[ea];return(n?pa(n):e)[t]}function Ma(e,t){if(!(t in e))return;let n=na(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=na(n)}}function La(e){e.modified_||(e.modified_=!0,e.parent_&&La(e.parent_))}function Na(e){e.copy_||(e.copy_=ha(e.base_,e.scope_.immer_.useStrictShallowCopy_))}la(Ba,((e,t)=>{Aa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Aa.deleteProperty=function(e,t){return Aa.set.call(this,e,t,void 0)},Aa.set=function(e,t,n){return Ba.set.call(this,e[0],t,n,e[0])};function Ia(e,t){const n=ua(e)?wa("MapSet").proxyMap_(e,t):fa(e)?wa("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:xa(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=Ba;n&&(r=[o],i=Aa);const{revoke:a,proxy:l}=Proxy.revocable(r,i);return o.draft_=l,o.revoke_=a,l}(e,t);return(t?t.scope_:xa()).drafts_.push(n),n}function Pa(e){if(!ra(e)||va(e))return e;const t=e[ea];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ha(e,t.scope_.immer_.useStrictShallowCopy_)}else n=ha(e,!0);return la(n,((e,t)=>{da(n,e,Pa(t))})),t&&(t.finalized_=!1),n}var za=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,(e=>t.call(this,e,...r)))}}let o;if("function"!=typeof t&&ta(6),void 0!==n&&"function"!=typeof n&&ta(7),ra(e)){const r=Oa(this),i=Ia(e,void 0);let a=!0;try{o=t(i),a=!1}finally{a?Ea(r):Ca(r)}return ka(r,n),Da(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===Ji&&(o=void 0),this.autoFreeze_&&ga(o,!0),n){const t=[],r=[];wa("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}ta(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,o;return[this.produce(e,t,((e,t)=>{n=e,o=t})),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ra(e)||ta(8),oa(e)&&(e=function(e){oa(e)||ta(10);return Pa(e)}(e));const t=Oa(this),n=Ia(e,void 0);return n[ea].isManual_=!0,Ca(t),n}finishDraft(e,t){const n=e&&e[ea];n&&n.isManual_||ta(9);const{scope_:o}=n;return ka(o,t),Da(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=wa("Patches").applyPatches_;return oa(e)?o(e,t):this.produce(e,(e=>o(e,t)))}};za.produce,za.produceWithPatches.bind(za),za.setAutoFreeze.bind(za),za.setUseStrictShallowCopy.bind(za),za.applyPatches.bind(za);var Fa=za.createDraft.bind(za),Ua=za.finishDraft.bind(za);function Ha(e,t){const n=Ln(e);if(!n)return!1;const o=D.marks(n);return!!(null==o?void 0:o[t])}const Va=(e,t)=>{const{insertText:n}=t;return t.insertText=o=>{var r;const{selection:i}=t;if(" "===o&&i&&j.isCollapsed(i)){const{anchor:a}=i,l=D.above(t,{match:e=>_.isElement(e)&&D.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,s=D.parent(t,c),[d]=s;if(_.isElement(d)&&!B.isText(d.children[0]))return n(o);const u=l?c:[],f={anchor:a,focus:D.start(t,u)},p=D.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return R.select(t,f),R.delete(t),void h.create({deleteText:!1})}n(o)},t};function Ka(e,t,n){e.children=Fa(e.children);let o=!1;const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);n.id&&(r.id=n.id,o=!0),n.type&&(r.type=n.type,o=!0),n.meta&&(r.meta=n.meta,o=!0),n.value&&(r.value=n.value),e.children=Ua(e.children),o&&e.applyChanges(),e.emit("change",e.children)}function Wa(e,t,n){e.children=Fa(e.children);const o=L(e,{at:e.selection});if(!o)throw new Error("Block from not found at current selection");const r=oi(e.blocks[o.type].elements);if(o.type===t)return void(e.children=Ua(e.children));const i=Ln(e,{at:[o.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${o.meta.order}`);const a=oi(e.blocks[t].elements);D.withoutNormalizing(i,(()=>{!function(e,t={}){var n;const{at:o,elementType:r}=t,i=o||(null===(n=e.selection)||void 0===n?void 0:n.anchor.path);if(!i)return;let a=e=>!D.isEditor(e)&&_.isElement(e);r&&(a=e=>!D.isEditor(e)&&_.isElement(e)&&e.type===r);const l=S.parent(i),c=D.nodes(e,{at:l,match:a,mode:"lowest"});if(c){const[e]=c}}(i,{elementType:r}),R.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>_.isElement(e)&&!D.isInline(i,e)});const n={id:o.id,type:t,meta:Object.assign(Object.assign({},o.meta),{order:o.meta.order}),value:i.children};e.blockEditorsMap[o.id]=i,e.children[o.id]=n,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children)}))}function Ya(e,t={}){const{at:n=e.selection,deleteAll:o=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=Fa(e.children),r.forEach((t=>{const n=L(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=Ua(e.children),e.applyChanges(),void e.emit("change",e.children)}if(o||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=J({id:q()}),n=Za(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:n,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!n)return;e.children=Fa(e.children);const[a]=n,l=Object.keys(e.children),c=l.find((t=>e.children[t].meta.order===a));if(l.forEach((t=>{const n=e.children[t];n.meta.order>a&&(n.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,o=L(e,{at:[n]});o&&e.focusBlock(o.id,{focusAt:t.focusAt})}}function $a(e,t){const n={};return t.forEach((t=>{const o=t.type;n[o]={hotkey:t.hotkey,type:o,getValue:()=>function(e,t){const n=Ln(e);if(!n)return null;const o=D.marks(n);return null==o?void 0:o[t]}(e,o),isActive:()=>Ha(e,o),toggle:()=>function(e,t){const n=Ln(e),o=Ha(e,t);n&&(o?D.removeMark(n,t):D.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,o),update:t=>function(e,t,n){const o=Ln(e);o&&o.selection&&j.isExpanded(o.selection)&&(D.addMark(o,t,n),e.applyChanges(),e.emit("change",e.children))}(e,o,t)}})),n}function Xa(e,t){const n={};return t.forEach(((t,o)=>{var r;const i=ri(t.elements),a=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.nodeType;if(!("inline"===a||"inlineVoid"===a)){const o={};Object.keys(t.elements).forEach((e=>{const n=gi(t.elements[e],["render"]);o[e]=n}));const{display:r,placeholder:i,align:a,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:o,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,align:a,shortcuts:l},isActive:()=>{const n=L(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{Wa(e,t)},create:n=>{!function(e,t,n){var o;e.children=Fa(e.children);const r=L(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==n?void 0:n.slate)||Ln(e,{at:[null==r?void 0:r.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],l=oi(a.elements),c=a.elements[l];if(!c)return;const s=Object.assign({nodeType:(null===(o=c.props)||void 0===o?void 0:o.nodeType)||"block"},c.props),d=G({id:q(),type:l,props:s});R.setNodes(i,d,{at:[0,0],match:e=>_.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&R.delete(i,{at:[0,0]});const u=J({id:r.id,type:a.type,meta:{order:r.meta.order,depth:r.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{Ka(e,t,n)},updateElement:(t,n,o)=>{!function(e,t,n,o){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=Ln(e,{at:[r.meta.order]});i?D.withoutNormalizing(i,(()=>{const[t]=D.nodes(i,{at:[0],match:e=>_.isElement(e)&&e.type===n}),r=null==t?void 0:t[0],a=(null==r?void 0:r.props)||{},l={props:Object.assign(Object.assign({},a),o)};R.setNodes(i,l,{at:[0],match:e=>_.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,n,o)},delete:t=>{Ya(e,t)}}}})),n}function Za(e){return Va(e,O(A()))}function qa({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const Ga=qa({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),Ja=(()=>{const e=q();return{[e]:J({id:e})}})(),Qa=new X,el=(e,t)=>Qa.on(e,t),tl=(e,t)=>Qa.once(e,t),nl=(e,t)=>Qa.off(e,t),ol=(e,t)=>Qa.emit(e,t);const rl=({editor:n,value:o,marks:r,plugins:i,autoFocus:a,className:l,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:g})=>{const y=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=d((()=>r?[Ga,...r]:[Ga]),[r]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>(n.applyChanges=y,n.readOnly=h||!1,v&&(n.formats=$a(n,v)),n.blocks=Xa(n,m),n.children=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(o)?o:Ja,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const o=Za(e);t[n]=o})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,o,r,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(o=e.options)||void 0===o?void 0:o.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(n),n.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var o;const r=e.elements[t],i=null===(o=r.props)||void 0===o?void 0:o.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=r)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const o=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:o})}})),t}(m),n.on=el,n.once=tl,n.off=nl,n.emit=ol,{editor:n,version:0})));return e(Gi,{children:e(P,Object.assign({editorState:b},{children:t(ai,Object.assign({tools:c},{children:[e(qi,{placeholder:p,marks:v,autoFocus:a,className:l,selectionBoxRoot:s,width:g}),u]}))}))})},il=Object.assign(Object.assign({},fi),{ExtendedBlockActions:({className:o,style:r,onClick:i,children:a})=>{const l=V(),[c,s]=f(!1),{refs:d,floatingStyles:u,context:p}=Ir({placement:"bottom-start",open:c,onOpenChange:s,middleware:[Uo(),Fo(),zo(),ko(10)],whileElementsMounted:Po}),{isMounted:h,styles:g}=Ur(p,{duration:100}),y=Object.assign(Object.assign({},g),u);return l?null:t(n,{children:[h&&e(ui,Object.assign({isOpen:!0,onClose:()=>s(!1),refs:d,style:y},{children:a})),e("button",Object.assign({type:"button",ref:d.setReference,className:`yoo-editor-absolute yoo-editor-right-[8px] yoo-editor-top-[8px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-between yoo-editor-z-10 yoo-editor-opacity-1 yoo-editor-bg-[#eee] yoo-editor-w-[22px] yoo-editor-h-[22px] yoo-editor-transition-opacity yoo-editor-duration-150 yoo-editor-ease-in yoo-editor-border-none yoo-editor-cursor-pointer yoo-editor-rounded-[2px] yoo-editor-p-[0_4px] ${o||""} yoopta-extended-block-actions`,onClick:()=>{null==i||i(),s(!0)},style:c?Object.assign(Object.assign({},r),{opacity:1}):r},{children:e(Zr,{})}))]})}});function al(e,t){const n=Object.keys(e.children),{type:o}=t||{},r=n.find((t=>e.children[t].type===o));return r?e.children[r]:null}function ll(e,t,n={}){try{const{focusAt:o,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=n,l=()=>{const r=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(T.isPoint(t))return t;if(S.isPath(t))return{path:t,offset:0};const[,n]=D.first(e,[0]);return{path:n||[0,0],offset:0}}(r,o);R.select(r,e),w.focus(r)}a&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>l()),i):l()}catch(e){}}function cl(e){return Array.from(new Set(e))}var sl={};!function(e,t){var n="__lodash_hash_undefined__",o=9007199254740991,r="[object Arguments]",i="[object Boolean]",a="[object Date]",l="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",y="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",O="[object Uint8Array]",S="[object Uint8ClampedArray]",D="[object Uint16Array]",_="[object Uint32Array]",R=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[a]=A[w]=A[x]=A[k]=A[E]=A[C]=A[s]=A[d]=A[u]=A[p]=A[h]=A[g]=A[y]=A[O]=A[S]=A[D]=A[_]=!0,A["[object Error]"]=A[l]=A[v]=!1;var T="object"==typeof Y&&Y&&Y.Object===Object&&Y,M="object"==typeof self&&self&&self.Object===Object&&self,L=T||M||Function("return this")(),N=t&&!t.nodeType&&t,I=N&&e&&!e.nodeType&&e,P=I&&I.exports===N;function z(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function U(e,t,n,o){var r=-1,i=e?e.length:0;for(o&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function H(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function K(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=L["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=P?L.Buffer:void 0,re=L.Symbol,ie=L.Uint8Array,ae=K(Object.getPrototypeOf,Object),le=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=oe?oe.isBuffer:void 0,fe=K(Object.keys,Object),pe=Pe(L,"DataView"),he=Pe(L,"Map"),ge=Pe(L,"Promise"),ye=Pe(L,"Set"),ve=Pe(L,"WeakMap"),me=Pe(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ge),ke=Ve(ye),Ee=Ve(ve),Ce=re?re.prototype:void 0,Oe=Ce?Ce.valueOf:void 0;function Se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function De(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function _e(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Re(e){this.__data__=new De(e)}function je(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],o=n.length,i=!!o;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||Ue(a,o))||n.push(a);return n}function Be(e,t,n){var o=e[t];ee.call(e,t)&&Ke(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if(Ke(e[n][0],t))return n;return-1}function Te(e,t,n,o,f,v,j){var B;if(o&&(B=v?o(e,f,v,j):o(e)),void 0!==B)return B;if(!Ze(e))return e;var T=We(e);if(T){if(B=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,o=e.length;t||(t=Array(o));for(;++n<o;)t[n]=e[n];return t}(e,B)}else{var M=Fe(e),L=M==l||M==c;if($e(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(M==u||M==r||L&&!v){if(H(e))return v?e:{};if(B=function(e){return"function"!=typeof e.constructor||He(e)?{}:(t=ae(e),Ze(t)?le(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,ze(e),t)}(e,function(e,t){return e&&Ne(t,qe(t),e)}(B,e))}else{if(!A[M])return v?e:{};B=function(e,t,n,o){var r=e.constructor;switch(t){case m:return Le(e);case i:case a:return new r(+e);case b:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,o);case w:case x:case k:case E:case C:case O:case S:case D:case _:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,o);case s:return function(e,t,n){var o=t?n(V(e),!0):V(e);return U(o,z,new e.constructor)}(e,o,n);case d:case g:return new r(e);case p:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var o=t?n(W(e),!0):W(e);return U(o,F,new e.constructor)}(e,o,n);case y:return l=e,Oe?Object(Oe.call(l)):{}}var l}(e,M,Te,t)}}j||(j=new Re);var N=j.get(e);if(N)return N;if(j.set(e,B),!T)var I=n?function(e){return function(e,t,n){var o=t(e);return We(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,qe,ze)}(e):qe(e);return function(e,t){for(var n=-1,o=e?e.length:0;++n<o&&!1!==t(e[n],n,e););}(I||e,(function(r,i){I&&(r=e[i=r]),Be(B,i,Te(r,t,n,o,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||H(e)?ne:j).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,n,o){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r],l=o?o(n[a],e[a],a,n,e):void 0;Be(n,a,void 0===l?e[a]:l)}return n}function Ie(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Pe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var o=t[e];return o===n?void 0:o}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},De.prototype.clear=function(){this.__data__=[]},De.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),!0)},De.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return Ae(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,o=Ae(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},_e.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||De),string:new Se}},_e.prototype.delete=function(e){return Ie(this,e).delete(e)},_e.prototype.get=function(e){return Ie(this,e).get(e)},_e.prototype.has=function(e){return Ie(this,e).has(e)},_e.prototype.set=function(e,t){return Ie(this,e).set(e,t),this},Re.prototype.clear=function(){this.__data__=new De},Re.prototype.delete=function(e){return this.__data__.delete(e)},Re.prototype.get=function(e){return this.__data__.get(e)},Re.prototype.has=function(e){return this.__data__.has(e)},Re.prototype.set=function(e,t){var n=this.__data__;if(n instanceof De){var o=n.__data__;if(!he||o.length<199)return o.push([e,t]),this;n=this.__data__=new _e(o)}return n.set(e,t),this};var ze=de?K(de,Object):function(){return[]},Fe=function(e){return te.call(e)};function Ue(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&Fe(new pe(new ArrayBuffer(1)))!=b||he&&Fe(new he)!=s||ge&&Fe(ge.resolve())!=f||ye&&Fe(new ye)!=h||ve&&Fe(new ve)!=v)&&(Fe=function(e){var t=te.call(e),n=t==u?e.constructor:void 0,o=n?Ve(n):void 0;if(o)switch(o){case be:return b;case we:return s;case xe:return f;case ke:return h;case Ee:return v}return t});var We=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=Ze(e)?te.call(e):"";return t==l||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!He(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}({get exports(){return sl},set exports(e){sl=e}},sl);var dl=sl;function ul(e,t={}){const{blockId:n,focus:o}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(n&&(r=e.children[n],!r))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(r=L(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=Fa(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(a=r,"function"==typeof window.structuredClone?window.structuredClone(a):dl(a));var a;const l=Za(e);i.id=q(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=l;const c=i.id;e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(c,{waitExecution:!0})}function fl(e,t){w.blur(t),w.deselect(t),R.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const pl=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=Fa(e.children);const{at:o=null,focus:r=!1,slate:i=null}=n,a=L(e),l=o,c={id:q(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=D.string(i,i.selection.anchor.path);s=D.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=Za(e);e.blockEditorsMap[c.id]=d,s&&a&&(c.meta.order=a.meta.order,a.meta.order+=1),e.children[c.id]=c;const u=null==a?void 0:a.id;e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,n={}){e.children=Fa(e.children);const{at:o,focus:r}=n;let i=o||[0];const a=L(e),l=Ln(e);let c=!1,s=!1;if(l&&l.selection){const t=S.parent(l.selection.anchor.path),n=D.string(l,t).trim(),o=D.isStart(l,l.selection.anchor,t);c=""===n&&o,s=!o||n.length>0,w.blur(l),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,n)=>{const o={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+n})};d.push(o.meta.order),e.children[o.id]=o;const r=Za(e);e.blockEditorsMap[o.id]=r})),a&&c){const t=a.meta.order;delete e.children[a.id],delete e.blockEditorsMap[a.id],Object.keys(e.children).forEach((n=>{const o=e.children[n];o.meta.order>t&&(o.meta.order-=1)}))}e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>Ya(e,...t),duplicateBlock:(...t)=>ul(e,...t),toggleBlock:(...t)=>Wa(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Fa(e.children);const o=L(e);o&&(o.meta.depth=o.meta.depth+1,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Fa(e.children);const o=L(e);o&&(o.meta.depth=0===o.meta.depth?0:o.meta.depth-1,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=Fa(e.children);const[o]=n,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===o)),a=r.meta.order<i.meta.order,l=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:l&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=o,r.meta.depth=i.meta.depth,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>ll(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>Ka(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:o=!0}=t,r=L(e);n&&n.selection&&r&&D.withoutNormalizing(n,(()=>{e.children=Fa(e.children);const t=S.parent(n.selection.anchor.path);R.splitNodes(n,{at:n.selection,match:e=>_.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=n.children.slice()[i];R.removeNodes(n,{at:[i],match:e=>_.isElement(e),mode:"highest"});const l={id:q(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=Za(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:o=!0}=n;e.selection=t,o&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:o=!1,allSelected:r=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(o)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=cl(t)}else e.selectedBlocks=cl(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const o=null!==(n=t.slate)&&void 0!==n?n:Ln(e);if(!o)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>fl(e,o)),i):(fl(e,o),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.yoo-editor-pointer-events-none{pointer-events:none}.yoo-editor-absolute{position:absolute}.yoo-editor-relative{position:relative}.-yoo-editor-left-\\[50px\\]{left:-50px}.yoo-editor-left-0{left:0}.yoo-editor-right-\\[8px\\]{right:8px}.yoo-editor-top-0{top:0}.yoo-editor-top-\\[2px\\]{top:2px}.yoo-editor-top-\\[8px\\]{top:8px}.yoo-editor-z-10{z-index:10}.yoo-editor-z-\\[100\\]{z-index:100}.yoo-editor-z-\\[90\\]{z-index:90}.yoo-editor-m-\\[0_1px\\]{margin:0 1px}.yoo-editor-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-editor-my-\\[4px\\]{margin-bottom:4px;margin-top:4px}.yoo-editor-mb-\\[1px\\]{margin-bottom:1px}.yoo-editor-mr-2{margin-right:.5rem}.yoo-editor-mt-\\[2px\\]{margin-top:2px}.yoo-editor-flex{display:flex}.yoo-editor-h-4{height:1rem}.yoo-editor-h-\\[1px\\]{height:1px}.yoo-editor-h-\\[22px\\]{height:22px}.yoo-editor-h-\\[24px\\]{height:24px}.yoo-editor-h-full{height:100%}.yoo-editor-w-4{width:1rem}.yoo-editor-w-\\[18px\\]{width:18px}.yoo-editor-w-\\[22px\\]{width:22px}.yoo-editor-w-\\[24px\\]{width:24px}.yoo-editor-w-auto{width:auto}.yoo-editor-w-full{width:100%}.yoo-editor-min-w-\\[200px\\]{min-width:200px}.yoo-editor-cursor-default{cursor:default}.yoo-editor-cursor-pointer{cursor:pointer}.yoo-editor-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoo-editor-flex-col{flex-direction:column}.yoo-editor-items-center{align-items:center}.yoo-editor-justify-start{justify-content:flex-start}.yoo-editor-justify-center{justify-content:center}.yoo-editor-justify-between{justify-content:space-between}.yoo-editor-overflow-hidden{overflow:hidden}.yoo-editor-rounded{border-radius:.25rem}.yoo-editor-rounded-\\[2px\\]{border-radius:2px}.yoo-editor-rounded-\\[6px\\]{border-radius:6px}.yoo-editor-rounded-md{border-radius:.375rem}.yoo-editor-rounded-sm{border-radius:.125rem}.yoo-editor-border{border-width:1px}.yoo-editor-border-none{border-style:none}.yoo-editor-bg-\\[\\#2383e224\\]{background-color:#2383e224}.yoo-editor-bg-\\[\\#37352f14\\]{background-color:#37352f14}.yoo-editor-bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-editor-bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}.yoo-editor-bg-inherit{background-color:inherit}.yoo-editor-bg-transparent{background-color:transparent}.yoo-editor-p-0{padding:0}.yoo-editor-p-\\[0_4px\\]{padding:0 4px}.yoo-editor-px-0{padding-left:0;padding-right:0}.yoo-editor-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-editor-px-\\[2px\\]{padding-left:2px;padding-right:2px}.yoo-editor-py-0{padding-bottom:0;padding-top:0}.yoo-editor-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-editor-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-editor-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-editor-text-sm{font-size:.875rem;line-height:1.25rem}.yoo-editor-leading-\\[120\\%\\]{line-height:120%}.yoo-editor-text-\\[rgba\\(55\\,53\\,47\\,0\\.35\\)\\]{color:rgba(55,53,47,.35)}.yoo-editor-opacity-0{opacity:0}.yoo-editor-opacity-100{opacity:1}.yoo-editor-shadow-md{--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);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-editor-outline-none{outline:2px solid transparent;outline-offset:2px}.yoo-editor-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-duration-150{transition-duration:.15s}.yoo-editor-duration-\\[180ms\\]{transition-duration:.18s}.yoo-editor-ease-\\[cubic-bezier\\(0\\.4\\,0\\,0\\.2\\,1\\)\\]{transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}#yoopta-editor{height:auto;min-width:400px}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.hover\\:yoo-editor-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.focus\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:focus,.hover\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:hover{background-color:rgba(55,54,47,.08)}.focus\\:yoo-editor-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:yoo-editor-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:active{background-color:rgba(55,54,47,.08)}.data-\\[disabled\\]\\:yoo-editor-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:yoo-editor-opacity-50[data-disabled]{opacity:.5}.data-\\[hovered-state\\=\\"true\\"\\]\\:yoo-editor-opacity-100[data-hovered-state=true]{opacity:1}');export{Ai as HOTKEYS,il as UI,M as YooptaPlugin,J as buildBlockData,G as buildBlockElement,pl as createYooptaEditor,qa as createYooptaMark,rl as default,L as findPluginBlockBySelectionPath,al as findPluginBlockByType,Ln as findSlateBySelectionPath,q as generateId,ri as getRootBlockElement,oi as getRootBlockElementType,F as useBlockData,W as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,H as useYooptaPlugin,K as useYooptaPluginOptions,V as useYooptaReadOnly,li as useYooptaTools};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "4.0.0-rc.27",
3
+ "version": "4.0.0-rc.29",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -67,5 +67,5 @@
67
67
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
68
68
  },
69
69
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
70
- "gitHead": "520057761efabc31e3d87b58a16f9ebe76e6fe22"
70
+ "gitHead": "92fc1c6c6e38b757ae264ffa34f126cf280d348a"
71
71
  }