@yoopta/editor 4.0.0-rc.0 → 4.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"YooptaEditor.d.ts","sourceRoot":"","sources":["../src/YooptaEditor.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAiB,MAAM,4CAA4C,CAAC;AAUpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1B,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACnF,KAAK,CAAC,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH,CAAC;AAYF,QAAA,MAAM,YAAY,oGASf,KAAK,gBAwCP,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"YooptaEditor.d.ts","sourceRoot":"","sources":["../src/YooptaEditor.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAiB,MAAM,4CAA4C,CAAC;AAUpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1B,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACnF,KAAK,CAAC,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH,CAAC;AAYF,QAAA,MAAM,YAAY,oGASf,KAAK,gBAyCP,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -9,4 +9,4 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from
9
9
  * tabbable 6.2.0
10
10
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
11
11
  */
12
- var Zc=["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(","),Gc="undefined"==typeof Element,Jc=Gc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Qc=!Gc&&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},ed=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},td=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!ed(a,!1))if("SLOT"===a.tagName){var u=a.assignedElements(),s=e(u.length?u:a.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:a,candidates:s})}else{Jc.call(a,Zc)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),c=!ed(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&c){var d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},nd=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},rd=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))&&!nd(e)?0:e.tabIndex},od=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},id=function(e){return"INPUT"===e.tagName},ad=function(e){return function(e){return id(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Qc(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(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 o=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!o||o===e}(e)},ud=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},sd=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Jc.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Jc.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ud(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,u=Qc(e);if(a&&!a.shadowRoot&&!0===r(a))return ud(e);e=e.assignedSlot?e.assignedSlot:a||u===e.ownerDocument?a:u.host}e=i}if(function(e){var t,n,r,o,i=e&&Qc(e),a=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&a;){var s,l,c;u=!(null===(l=a=null===(s=i=Qc(a))||void 0===s?void 0:s.host)||void 0===l||null===(c=l.ownerDocument)||void 0===c||!c.contains(a))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ld=function(e,t){return!(t.disabled||ed(t)||function(e){return id(e)&&"hidden"===e.type}(t)||sd(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 r=t.children.item(n);if("LEGEND"===r.tagName)return!!Jc.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},cd=function(e,t){return!(ad(t)||rd(t)<0||!ld(e,t))},dd=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},fd=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,u=function(e,t){var n=rd(e);return n<0&&t&&!nd(e)?0:n}(a,i),s=i?e(t.candidates):a;0===u?i?n.push.apply(n,s):n.push(a):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:s})})),r.sort(od).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},pd=function(e,t){var n;return n=(t=t||{}).getShadowRoot?td([e],t.includeContainer,{filter:cd.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dd}):function(e,t,n){if(ed(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Zc));return t&&Jc.call(e,Zc)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,cd.bind(null,t)),fd(n)};const hd=r["useInsertionEffect".toString()]||(e=>e());var vd="undefined"!=typeof document?s:l;function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gd.apply(this,arguments)}let md=!1,Dd=0;const bd=()=>"floating-ui-"+Dd++;const yd=r["useId".toString()]||function(){const[e,t]=r.useState((()=>md?bd():void 0));return vd((()=>{null==e&&t(bd())}),[]),r.useEffect((()=>{md||(md=!0)}),[]),e};const Cd=r.createContext(null),wd=r.createContext(null);function Bd(e){return"data-floating-ui-"+e}const Ed=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xd(e,t){const n=pd(e,Ed());"prev"===t&&n.reverse();const r=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}(function(e){return(null==e?void 0:e.ownerDocument)||document}(e)));return n.slice(r+1)[0]}function Ad(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!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&&Ul(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Fd(e){pd(e,Ed()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function kd(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 Od={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 Sd(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const jd=r.forwardRef((function(e,t){const[n,o]=r.useState();vd((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Sd),()=>{document.removeEventListener("keydown",Sd)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Bd("focus-guard")]:"",style:Od};return r.createElement("span",gd({},e,i))})),Pd=r.createContext(null),Rd=Bd("portal");function Td(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),a=yd(),u=Nd(),s=r.useRef(null);return vd((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{s.current=null}))}),[o]),vd((()=>{if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=a,n.setAttribute(Rd,""),e.appendChild(n),s.current=n,i(n)}),[t,a]),vd((()=>{if(s.current)return;let e=n||(null==u?void 0:u.portalNode);e&&!ql(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=a,o.setAttribute(Rd,""),e=r||e,e.appendChild(o),s.current=o,i(o)}),[t,n,a,u]),o}({id:n,root:o}),[u,s]=r.useState(null),l=r.useRef(null),c=r.useRef(null),d=r.useRef(null),f=r.useRef(null),p=!!u&&!u.modal&&u.open&&i&&!(!o&&!a);return r.useEffect((()=>{if(a&&i&&(null==u||!u.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&&Ad(e)){("focusin"===e.type?kd:Fd)(a)}}}),[a,i,null==u?void 0:u.modal]),r.createElement(Pd.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:a,setFocusManagerState:s})),[i,a])},p&&a&&r.createElement(jd,{"data-type":"outside",ref:l,onFocus:e=>{if(Ad(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=xd(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),p&&a&&r.createElement("span",{"aria-owns":a.id,style:Od}),a&&A(t,a),p&&a&&r.createElement(jd,{"data-type":"outside",ref:c,onFocus:e=>{if(Ad(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=xd(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent))}}}))}const Nd=()=>r.useContext(Pd),_d=new Set,Md=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=yd();return vd((()=>{if(!n)return;_d.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,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,u=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,l;const e=(null==(s=window.visualViewport)?void 0:s.offsetLeft)||0,n=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(u-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{_d.delete(i),0===_d.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,u)))}}),[i,n]),r.createElement("div",gd({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Ld(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[a,u]=r.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||a,l=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:u}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Kc(p,o)||h(o);const[v,g]=r.useState(null),[m,D]=r.useState(null),b=r.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),y=r.useCallback((e=>{e!==x.current&&(x.current=e,D(e))}),[]),C=a||v,w=u||m,E=r.useRef(null),x=r.useRef(null),A=r.useRef(d),F=null!=l,k=Yc(l),O=Yc(i),S=r.useCallback((()=>{if(!E.current||!x.current)return;const e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Hc(E.current,x.current,e).then((e=>{const t={...e,isPositioned:!0};j.current&&!Kc(A.current,t)&&(A.current=t,B.flushSync((()=>{f(t)})))}))}),[p,t,n,O]);Uc((()=>{!1===c&&A.current.isPositioned&&(A.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[c]);const j=r.useRef(!1);Uc((()=>(j.current=!0,()=>{j.current=!1})),[]),Uc((()=>{if(C&&(E.current=C),w&&(x.current=w),C&&w){if(k.current)return k.current(C,w,S);S()}}),[C,w,S,k,F]);const P=r.useMemo((()=>({reference:E,floating:x,setReference:b,setFloating:y})),[b,y]),R=r.useMemo((()=>({reference:C,floating:w})),[C,w]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Xc(R.floating,d.x),r=Xc(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...$c(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,R.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:S,refs:P,elements:R,floatingStyles:T})),[d,S,P,R,T])}(e),c=r.useContext(wd),d=null!=((null==(f=r.useContext(Cd))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return hd((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(v.current.openEvent=t),g.emit("openchange",{open:e,event:t,reason:n,nested:d}),null==o||o(e,t,n)})),h=r.useRef(null),v=r.useRef({}),g=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],m=yd(),D=r.useCallback((e=>{const t=ql(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),b=r.useCallback((e=>{(ql(e)||null===e)&&(h.current=e,u(e)),(ql(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!ql(e))&&l.refs.setReference(e)}),[l.refs]),y=r.useMemo((()=>({...l.refs,setReference:b,setPositionReference:D,domReference:h})),[l.refs,b,D]),C=r.useMemo((()=>({...l.elements,domReference:s})),[l.elements,s]),w=r.useMemo((()=>({...l,refs:y,elements:C,dataRef:v,nodeId:i,floatingId:m,events:g,open:n,onOpenChange:p})),[l,i,m,g,n,p,y,C]);return vd((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===i));e&&(e.context=w)})),r.useMemo((()=>({...l,context:w,refs:y,elements:C})),[l,y,C,w])}var Id;function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zd.apply(this,arguments)}var Wd=function(e){return r.createElement("svg",zd({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Id||(Id=r.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 Vd(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var qd=["color"],Hd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,qd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Ud=["color"],Kd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Ud);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),$d=["color"],Xd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,$d);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Yd=["color"],Zd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Yd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Gd=["color"],Jd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Gd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Qd=["color"],ef=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Qd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.10505 12C4.70805 12 4.4236 11.912 4.25171 11.736C4.0839 11.5559 4 11.2715 4 10.8827V4.11733C4 3.72033 4.08595 3.43588 4.25784 3.26398C4.43383 3.08799 4.71623 3 5.10505 3C6.42741 3 8.25591 3 9.02852 3C10.1373 3 11.0539 3.98153 11.0539 5.1846C11.0539 6.08501 10.6037 6.81855 9.70327 7.23602C10.8657 7.44851 11.5176 8.62787 11.5176 9.48128C11.5176 10.5125 10.9902 12 9.27734 12C8.77742 12 6.42626 12 5.10505 12ZM8.37891 8.00341H5.8V10.631H8.37891C8.9 10.631 9.6296 10.1211 9.6296 9.29877C9.6296 8.47643 8.9 8.00341 8.37891 8.00341ZM5.8 4.36903V6.69577H8.17969C8.53906 6.69577 9.27734 6.35939 9.27734 5.50002C9.27734 4.64064 8.48047 4.36903 8.17969 4.36903H5.8Z",fill:r}))})),tf=["color"],nf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,tf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.67494 3.50017C5.67494 3.25164 5.87641 3.05017 6.12494 3.05017H10.6249C10.8735 3.05017 11.0749 3.25164 11.0749 3.50017C11.0749 3.7487 10.8735 3.95017 10.6249 3.95017H9.00587L7.2309 11.05H8.87493C9.12345 11.05 9.32493 11.2515 9.32493 11.5C9.32493 11.7486 9.12345 11.95 8.87493 11.95H4.37493C4.1264 11.95 3.92493 11.7486 3.92493 11.5C3.92493 11.2515 4.1264 11.05 4.37493 11.05H5.99397L7.76894 3.95017H6.12494C5.87641 3.95017 5.67494 3.7487 5.67494 3.50017Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),rf=["color"],of=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,rf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),af=["color"],uf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,af);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.00003 3.25C5.00003 2.97386 4.77617 2.75 4.50003 2.75C4.22389 2.75 4.00003 2.97386 4.00003 3.25V7.10003H2.49998C2.27906 7.10003 2.09998 7.27912 2.09998 7.50003C2.09998 7.72094 2.27906 7.90003 2.49998 7.90003H4.00003V8.55C4.00003 10.483 5.56703 12.05 7.50003 12.05C9.43303 12.05 11 10.483 11 8.55V7.90003H12.5C12.7209 7.90003 12.9 7.72094 12.9 7.50003C12.9 7.27912 12.7209 7.10003 12.5 7.10003H11V3.25C11 2.97386 10.7762 2.75 10.5 2.75C10.2239 2.75 10 2.97386 10 3.25V7.10003H5.00003V3.25ZM5.00003 7.90003V8.55C5.00003 9.93071 6.11932 11.05 7.50003 11.05C8.88074 11.05 10 9.93071 10 8.55V7.90003H5.00003Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),sf=["color"],lf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,sf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M3.94993 2.95002L3.94993 4.49998C3.94993 4.74851 3.74845 4.94998 3.49993 4.94998C3.2514 4.94998 3.04993 4.74851 3.04993 4.49998V2.50004C3.04993 2.45246 3.05731 2.40661 3.07099 2.36357C3.12878 2.18175 3.29897 2.05002 3.49993 2.05002H11.4999C11.6553 2.05002 11.7922 2.12872 11.8731 2.24842C11.9216 2.32024 11.9499 2.40682 11.9499 2.50002L11.9499 2.50004V4.49998C11.9499 4.74851 11.7485 4.94998 11.4999 4.94998C11.2514 4.94998 11.0499 4.74851 11.0499 4.49998V2.95002H8.04993V12.05H9.25428C9.50281 12.05 9.70428 12.2515 9.70428 12.5C9.70428 12.7486 9.50281 12.95 9.25428 12.95H5.75428C5.50575 12.95 5.30428 12.7486 5.30428 12.5C5.30428 12.2515 5.50575 12.05 5.75428 12.05H6.94993V2.95002H3.94993Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),cf=["color"],df=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,cf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),ff=["color"],pf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,ff);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.00001 2.75C5.00001 2.47386 4.77615 2.25 4.50001 2.25C4.22387 2.25 4.00001 2.47386 4.00001 2.75V8.05C4.00001 9.983 5.56702 11.55 7.50001 11.55C9.43301 11.55 11 9.983 11 8.05V2.75C11 2.47386 10.7762 2.25 10.5 2.25C10.2239 2.25 10 2.47386 10 2.75V8.05C10 9.43071 8.88072 10.55 7.50001 10.55C6.1193 10.55 5.00001 9.43071 5.00001 8.05V2.75ZM3.49998 13.1001C3.27906 13.1001 3.09998 13.2791 3.09998 13.5001C3.09998 13.721 3.27906 13.9001 3.49998 13.9001H11.5C11.7209 13.9001 11.9 13.721 11.9 13.5001C11.9 13.2791 11.7209 13.1001 11.5 13.1001H3.49998Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),hf=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));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()}},vf={"text/plain":"Text","text/html":"Url",default:"Text"};var gf=function(e,t){var n,r,o,i,a,u,s=!1;t||(t={}),n=t.debug||!1;try{if(o=hf(),i=document.createRange(),a=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=vf[t.format]||vf.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),i.selectNodeContents(u),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");s=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=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(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),u&&document.body.removeChild(u),o()}return s};function mf(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function Df(e){if(!e)return;const t=mf(e);return t?e[t]:void 0}const bf=({actions:n,editor:r,onMouseEnter:o,selectedAction:i,onClose:a,empty:u,mode:s="create"})=>{const l="toggle"===s,c=l?n.filter((e=>function(e){var t;if(!e)return!1;const n=Df(e.elements);return"void"!==(null===(t=null==n?void 0:n.props)||void 0===t?void 0:t.nodeType)}(r.blocks[e]))):n;return e("div",Object.assign({className:"bg-white z-50 h-auto max-h-[330px] max-w-[250px] w-72 overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 transition-all shadow-md"},{children:e("div",Object.assign({className:"max-h-[300px] overflow-y-auto overflow-x-hidden"},{children:t("div",Object.assign({"data-action-menu-list":!0,className:"overflow-hidden p-0 text-foreground"},{children:[u&&e("div",Object.assign({className:"text-left text-muted-foreground text-xs px-1 py-1"},{children:"No actions available"})),c.map(((n,u)=>{var s;const c=r.blocks[n];return c?t("button",Object.assign({onMouseEnter:o,"aria-selected":n===i,"data-action-menu-item":!0,"data-action-menu-item-type":n,onClick:()=>{l?r.toggleBlock(n,{focus:!0}):r.blocks[n].create({deleteText:!0,focus:!0}),a()},className:"flex w-full cursor-pointer items-center space-x-2 rounded-md px-1 py-1 mb-0.5 last:mb-0 text-left text-sm hover:bg-[#f4f4f5] aria-selected:bg-[#f0f0f0]"},{children:[e("div",Object.assign({className:"flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-white"},{children:e(lf,{})})),t("div",{children:[e("div",Object.assign({className:"font-medium"},{children:(null===(s=c.options)||void 0===s?void 0:s.displayLabel)||c.type})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:"Description"}))]})]}),n):null}))]}))}))}))},yf=({children:t})=>e("div",Object.assign({className:"flex flex-col"},{children:t})),Cf=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"bg-[#FFF] relative min-w-[200px] w-auto overflow-hidden rounded-md border bg-popover py-[6px] px-0 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"},{children:t})),wf=({children:t})=>e("div",Object.assign({className:"relative flex cursor-default select-none items-center text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"},{children:t})),Bf=({isOpen:n,onClose:r,refs:o,floatingStyles:i,children:a})=>{var u;const s=P(),[l,c]=f(!1),{refs:d,floatingStyles:p}=Ld({placement:"right",open:l,onOpenChange:c,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc});if(!n)return null;const h=k(s,{at:s.selection}),v=Df(s.blocks[(null==h?void 0:h.type)||""].elements),g="void"===(null===(u=null==v?void 0:v.props)||void 0===u?void 0:u.nodeType);return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(Cf,{children:[t(yf,{children:[e(wf,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),r()}},{children:[e(df,{className:"w-4 h-4 mr-2"}),"Delete"]}))}),e(wf,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),r()}},{children:[e(Zd,{className:"w-4 h-4 mr-2"}),"Duplicate"]}))}),!g&&t(wf,{children:[l&&e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>c(!1)},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(bf,{actions:Object.keys(s.blocks),editor:s,selectedAction:"",onClose:()=>c(!1),empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",ref:d.setReference,onClick:()=>c((e=>!e))},{children:[e(Wd,{className:"w-4 h-4 mr-2"}),"Turn into"]}))]}),e(wf,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=k(s);e&&gf(`${window.location.origin}${window.location.pathname}#${e.id}`),r()}},{children:[e(of,{className:"w-4 h-4 mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var Ef=Object.freeze({__proto__:null,BlockOptions:Bf,BlockOptionsMenuContent:Cf,BlockOptionsMenuGroup:yf,BlockOptionsMenuItem:wf,BlockOptionsSeparator:({className:t})=>e("div",{className:`h-[1px] bg-[#37352f14] my-[4px] w-full ${t}`})});function xf(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Af={actions:"vuZgncnq",hovered:"_8Eqjiv7m",actionButton:"WabGEp54",plusButton:"_0C8RpLmz"};function Ff(...e){return e.filter(Boolean).join(" ")}xf(".vuZgncnq{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition:opacity .18s ease-in}._8Eqjiv7m{opacity:1}.WabGEp54{all:unset;align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;color:rgba(55,53,47,.35);cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition:background-color .18s cubic-bezier(.4,0,.2,1);width:auto;width:18px}.WabGEp54:active,.WabGEp54:focus,.WabGEp54:hover{background-color:rgba(55,54,47,.08)}._0C8RpLmz{width:24px}");const kf=({block:n,editor:r,dragHandleProps:o,showActions:i,onChangeActiveBlock:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c}=Ld({placement:"right-start",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec()]}),{setActivatorNodeRef:d,attributes:p,listeners:h}=o;return t("div",Object.assign({contentEditable:!1,className:Ff(Af.actions,i&&Af.hovered,"yoopta-element-actions")},{children:[e("button",Object.assign({type:"button",onClick:()=>{const e=K(U()),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0})},className:Ff(Af.actionButton,Af.plusButton,"yoopta-element-actions-plus")},{children:e(kn,{})})),e("button",Object.assign({type:"button",className:Ff(Af.actionButton,"yoopta-element-actions-drag"),ref:e=>{d(e),l.setReference(e)}},p,h,{onClick:e=>{e.stopPropagation(),a(n.id),console.log("editor.children",r.children);const t=On(r,{at:[n.meta.order]});console.log("block",n),console.log("slate",t),r.focusBlock(n.id),t&&setTimeout((()=>{Es.blur(t),Es.deselect(t),Gi.deselect(t),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),s(!0)}),10)}},{children:e(An,{})})),e(Bf,{isOpen:u,refs:l,floatingStyles:c,onClose:()=>s(!1)})]}))},Of=({children:n,block:r,blockId:o})=>{var i;const a=P(),[u,s]=f(null),{attributes:l,listeners:c,setNodeRef:d,setActivatorNodeRef:p,transform:h,transition:v,active:g,over:m,isOver:D,isDragging:b}=Dn({id:o}),y={transform:he.Translate.toString(h),transition:v,opacity:b?.7:1,marginLeft:20*r.meta.depth+"px"},C=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=u===o,B=e=>s(e);return t("div",Object.assign({className:"relative py-0 px-[2px] mt-[2px] mb-[1px] rounded yoopta-block-wrapper",onMouseEnter:()=>B(o),onMouseLeave:()=>s(null),"data-yoopta-block-id":o,style:y,"data-yoopta-block":!0,ref:d},{children:[e(kf,{block:r,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:l,listeners:c},showActions:w,onChangeActiveBlock:B}),e("div",Object.assign({className:Af.content,style:{borderBottom:D&&!b?"2px solid #007aff":"none"}},{children:n})),C&&e("div",{className:"absolute left-0 top-0 bg-[#2383e224] z-[90] rounded opacity-100 h-full w-full pointer-events-none yoopta-selection-block"})]}))};function Sf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var jf={};Object.defineProperty(jf,"__esModule",{value:!0});for(var Pf="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Rf={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Tf={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Pf?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Nf={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},_f=1;_f<20;_f++)Nf["f"+_f]=111+_f;function Mf(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Lf(e,t)})),o=function(e){return r.some((function(t){return If(t,e)}))};return null==n?o:o(n)}function Lf(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var a in Rf)r[Rf[a]]=!1;var u=!0,s=!1,l=void 0;try{for(var c,d=o[Symbol.iterator]();!(u=(c=d.next()).done);u=!0){var f=c.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Wf(f),v=Rf[h];if(f.length>1&&!v&&!Tf[f]&&!Nf[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&v||(n?r.key=h:r.which=zf(f)),v&&(r[v]=!p||null)}}catch(e){s=!0,l=e}finally{try{!u&&d.return&&d.return()}finally{if(s)throw l}}return r}function If(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function zf(e){return e=Wf(e),Nf[e]||e.toUpperCase().charCodeAt(0)}function Wf(e){return e=e.toLowerCase(),e=Tf[e]||e}jf.default=Mf,jf.isHotkey=Mf,jf.isCodeHotkey=function(e,t){return Mf(e,t)};var Vf=jf.isKeyHotkey=function(e,t){return Mf(e,{byKey:!0},t)};jf.parseHotkey=Lf,jf.compareHotkey=If,jf.toKeyCode=zf,jf.toKeyName=Wf;const qf={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"},Hf={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"},Uf={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Kf=e=>{const t=qf[e],n=Hf[e],r=Uf[e],o=t&&Vf(t),i=n&&Vf(n),a=r&&Vf(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!a||!a(e)))},$f={isBold:Kf("bold"),isCompose:Kf("compose"),isArrowLeft:Kf("arrowLeft"),isArrowRight:Kf("arrowRight"),isArrowUp:Kf("arrowUp"),isArrowDown:Kf("arrowDown"),isDeleteBackward:Kf("deleteBackward"),isDeleteForward:Kf("deleteForward"),isDeleteLineBackward:Kf("deleteLineBackward"),isDeleteLineForward:Kf("deleteLineForward"),isDeleteWordBackward:Kf("deleteWordBackward"),isDeleteWordForward:Kf("deleteWordForward"),isExtendBackward:Kf("extendBackward"),isExtendForward:Kf("extendForward"),isExtendLineBackward:Kf("extendLineBackward"),isExtendLineForward:Kf("extendLineForward"),isItalic:Kf("italic"),isMoveLineBackward:Kf("moveLineBackward"),isMoveLineForward:Kf("moveLineForward"),isCtrlLeft:Kf("ctrlLeft"),isCtrlRight:Kf("ctrlRight"),isRedo:Kf("redo"),isShiftEnter:Kf("shiftEnter"),isEnter:Kf("enter"),isTransposeCharacter:Kf("transposeCharacter"),isUndo:Kf("undo"),isSpace:Kf("space"),isSelect:Kf("select"),isTab:Kf("tab"),isShiftTab:Kf("shiftTab"),isBackspace:Kf("backspace"),isCmdEnter:Kf("cmdEnter"),isCmd:Kf("cmd"),isEscape:Kf("escape"),isSlashCommand:Kf("slashCommand"),isShiftArrowUp:Kf("shiftArrowUp"),isShiftArrowDown:Kf("shiftArrowDown"),isKekceburek:Kf("kekCeburek")};const Xf={onKeyDown:function(e){return t=>{const n=On(e,{at:e.selection});if(!n||!n.selection)return;const r=Io.parent(n.selection.anchor.path);if($f.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if($f.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const o=ui.isStart(n,n.selection.anchor,r),i=ui.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const a=K(U()),u=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:u,slate:n,focus:!0})}else if($f.isBackspace(t)){if(t.isDefaultPrevented())return;const r=Io.parent(n.selection.anchor.path);if(ui.isStart(n,n.selection.anchor,r)){t.preventDefault();const o=ui.string(n,r),i=e.selection?e.selection[0]-1:0,a=On(e,{at:[i]});let u;if(a&&(u=function(e,t){const[,n]=ui.last(e,t);return{path:n,offset:ui.string(e,n).length}}(a,r)),0===o.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:u});{if(Zo.isExpanded(n.selection))return Gi.delete(n,{at:n.selection});if(!a)return;if(0===ui.string(a,[0,0]).length)return e.deleteBlock({at:[i],focus:!0,focusAt:u});const t=Array.from(ui.nodes(n,{at:[0],match:e=>!ui.isEditor(e)&&(bi.isText(e)||ui.isInline(n,e)),mode:"highest"})),r=t.map((([e])=>e));return Gi.insertNodes(a,r,{at:ui.end(a,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:u})}}}else{if($f.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=ui.first(n,[0]),[,o]=ui.last(n,[n.children.length-1]),i=ui.range(n,r,o),a=Zo.equals(n.selection,i);if(Zo.isExpanded(n.selection)&&a)return t.preventDefault(),Es.blur(n),Es.deselect(n),Gi.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if($f.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if($f.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if($f.isArrowUp(t)){if(t.isDefaultPrevented())return;const r=Io.parent(n.selection.anchor.path),o=ui.isStart(n,n.selection.anchor,r);if(console.log("isStart",o),console.log("parentPath",r),console.log("slate.children",n.children),o){const n=e.selection?[e.selection[0]-1]:null,r=On(e,{at:n}),o=k(e,{at:n});if(r&&o){const[,n]=ui.last(r,[0]),i={path:n,offset:ui.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1})}}}if($f.isArrowDown(t)){const r=Io.parent(n.selection.anchor.path);if(ui.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=On(e,{at:n}),i=k(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=ui.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(Zo.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Vf(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}};function Yf(e){try{return new URL(e),!0}catch(e){return!1}}const Zf=(e,t)=>{(e=>{const[t]=ui.nodes(e,{match:e=>!ui.isEditor(e)&&Jo.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{Gi.unwrapNodes(e,{match:e=>!ui.isEditor(e)&&Jo.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&Zo.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};r?Gi.insertNodes(e,o):(Gi.wrapNodes(e,o,{split:!0}),Gi.collapse(e,{edge:"end"}))},Gf=i(void 0),Jf=({children:t})=>{const[n,r]=f({}),o=d(((e,t)=>{r((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[n]),i=d((e=>{r((t=>{const n=Object.assign({},t);return delete n[e],n}))}),[n]),a=c((()=>({tools:n,registerTool:o,unregisterTool:i})),[n]);return e(Gf.Provider,Object.assign({value:a},{children:t}))},Qf=()=>{const e=a(Gf);if(void 0===e)throw new Error("useTools must be used within a ToolsProvider");return e},ep=({children:t,attributes:n,placeholder:r})=>{const o=a(ol),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))},tp=({id:t,customEditor:r,elements:o,marks:i,events:a,options:s,placeholder:l="Type '/' for commands"})=>{const d=P(),f=R(t),p=u(f.value).current,h=f.type,{tools:v}=Qf(),g=c((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=c((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(i)),[i]),D=c((()=>{let e=d.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,u="inlineVoid"===r;u&&(e.markableVoid=e=>e.type===t),(a||u)&&(e.isVoid=e=>e.type===t),(i||u)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n,isInline:r,isElementReadOnly:o,isSelectable:i}=e;return e.isInline=e=>["link","mention"].includes(e.type)||r(e),e.insertText=t=>{t&&Yf(t)?Zf(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Yf(r)?Zf(e,r):t(n)},e})(e))})),e}),[]),b=c((()=>{if(!a)return{};const e={hotkeys:$f,currentBlock:f,defaultBlock:K()},t={};return Object.keys(a).forEach((n=>{t[n]=function(t){if(a[n]){a[n](d,D,e)(t)}}})),t}),[a,d]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":h},{children:e(np,{id:t,slate:D,initialValue:p,onChange:e=>d.updateBlock(t,{value:e}),decorate:e=>{var t;const n=[],[r,o]=e,i=(null===(t=d.selection)||void 0===t?void 0:t[0])===f.meta.order;return D.selection&&i&&!ui.isEditor(r)&&""===ui.string(D,[o[0]])&&Zo.includes(D.selection,o)&&Zo.isCollapsed(D.selection)&&n.push(Object.assign(Object.assign({},D.selection),{withPlaceholder:!0})),n},renderLeaf:t=>{var n,r,o,i,a;let{children:u,leaf:s,attributes:c}=t;const p=Sf(s,["text"]),h=(null===(n=d.selection)||void 0===n?void 0:n[0])===f.meta.order;p&&Object.keys(p).forEach((e=>{const t=m[e];t&&(u=t.render({children:u,leaf:s}))}));const v=!("void"===(null===(a=null===(i=null===(o=null===(r=t.children)||void 0===r?void 0:r.props)||void 0===o?void 0:o.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&h&&s.withPlaceholder;return e(ep,Object.assign({attributes:c,placeholder:v?l:void 0},{children:u}))},renderElement:r=>{const o=g[r.element.type];return o?e(o,Object.assign({},r,{blockId:t,options:s})):e(n,{})},eventHandlers:b,onKeyDown:e=>{var t;if(v.actionMenu){const t=v.actionMenu,{events:n}=t,r=Sf(t,["events"]);null==n||n.onKeyDown(d,D,r)(e)}null===(t=b.onKeyDown)||void 0===t||t.call(b,e),Xf.onKeyDown(d)(e)},onKeyUp:e=>{var t;if(v.actionMenu){const t=v.actionMenu,{events:n}=t,r=Sf(t,["events"]);null==n||n.onKeyUp(d,D,r)(e)}null===(t=null==b?void 0:b.onKeyUp)||void 0===t||t.call(b,e)},onFocus:e=>{var t;null===(t=null==b?void 0:b.onFocus)||void 0===t||t.call(b,e)},onMouseDown:e=>{var t,n;if((null===(t=d.selection)||void 0===t?void 0:t[0])!==f.meta.order&&d.setSelection([f.meta.order]),v.toolbar){const t=v.toolbar,{events:n}=t,r=Sf(t,["events"]);null==n||n.onMouseDown(d,D,r)(e)}null===(n=null==b?void 0:b.onMouseDown)||void 0===n||n.call(b,e)},onBlur:e=>{var t;e.preventDefault(),null===(t=null==b?void 0:b.onBlur)||void 0===t||t.call(b,e)},customEditor:r})}))},np=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:a,eventHandlers:u,onKeyDown:s,onKeyUp:l,onFocus:c,onMouseDown:d,onBlur:f,customEditor:p,decorate:h})=>"function"==typeof p?p({id:t,type:"",editor:n,attributes:{},children:[]}):e(Pl,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(wl,Object.assign({renderElement:a,renderLeaf:i,className:"focus-visible:outline-none focus:outline-none",spellCheck:!0},u,{onKeyDown:s,onKeyUp:l,onFocus:c,onMouseDown:d,decorate:h,onBlur:f}),`editable-${t}`)}),`slate-${t}`))),rp=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c((()=>[...t].filter((e=>null!=e))),[...t])}(Ae(mt,{activationConstraint:{delay:100,tolerance:0}}),Ae(ft,{coordinateGetter:Cn})),handleDragEnd:d((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:d((t=>{e.setBlockSelected(null)}),[])}),op=[],ip=({editor:t,marks:n})=>{const{sensors:r,handleDragEnd:o,handleDragStart:i}=rp({editor:t}),a=Object.keys(t.children),u=c((()=>0===a.length?op:a.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[a]),s=[];for(let r=0;r<u.length;r++){const o=u[r],i=t.children[o],a=t.plugins[i.type];i&&a?s.push(e(Of,Object.assign({block:i,blockId:o},{children:e(tp,{type:i.type,id:o,marks:n,events:a.events,elements:a.elements,options:a.options},o)}),o)):console.error(`Plugin ${i.type} not found`)}return e(Yt,Object.assign({sensors:r,collisionDetection:Te,onDragStart:i,onDragEnd:o},{children:e(dn,Object.assign({items:u,strategy:sn},{children:s}))}))},ap=({editor:e,yooptaEditorRef:t,root:n})=>{const[r,o]=f({origin:[0,0],coords:[0,0],selection:!1}),i=n=>{var i;const a=null===(i=t.current)||void 0===i?void 0:i.contains(n.target);if(!a&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),s();a||o({origin:[n.pageX,n.pageY-window.pageYOffset],coords:[n.pageX,n.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!r.selection)return;o((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const n=((e,t)=>{const n=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((r,o)=>{if(!r)return;const i=r.getBoundingClientRect(),a=Math.min(e[1],t[1]),u=Math.min(e[0],t[0]),s=Math.max(e[1],t[1]),l=Math.max(e[0],t[0]);a<i.bottom&&s>i.top&&u<i.right&&l>i.left&&n.push(o)})),n})(r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(n,{only:!0})},u=()=>{s()};l((()=>{var e;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===(e=t.current)||void 0===e?void 0:e.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",u),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",u)}}),[e.selectedBlocks,r,n]);const s=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:s})},up=({origin:t,coords:n,isOpen:r})=>{if(!r)return null;const o={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:o})},sp={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},lp=({marks:n,className:r,autoFocus:o=!0,selectionBoxRoot:i})=>{const a=P(),s=u(null),c=ap({editor:a,yooptaEditorRef:s,root:i});let d=u(sp).current;l((()=>{if(!o)return;const e=k(a,{at:[0]});e&&a.focusBlock(e.id)}),[o]),l((()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h))),[a.selectedBlocks]);const f=()=>{Array.isArray(a.selectedBlocks)&&a.selectedBlocks.length>0&&a.setBlockSelected(null)},p=()=>{d.indexToSelect=null,d.startedIndexToSelect=null,d.selectionStarted=!1},h=e=>{var t,n,r,o,i;if($f.isSelect(e)){if((null===(t=a.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(a.children).length)return void e.preventDefault();if(d.selectionStarted)return e.preventDefault(),void a.setBlockSelected([],{allSelected:!0})}if($f.isBackspace(e)){e.stopPropagation();if(Array.isArray(a.selectedBlocks)&&(null===(n=a.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(a.children).length)return e.preventDefault(),a.deleteBlock({deleteAll:!0}),a.setBlockSelected(null),void p();if(Array.isArray(a.selectedBlocks)&&(null===(r=a.selectedBlocks)||void 0===r?void 0:r.length)>0)return e.preventDefault(),a.deleteBlock({fromPaths:a.selectedBlocks}),a.setBlockSelected(null),void p()}if($f.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(d.selectionStarted&&null!==d.startedIndexToSelect&&null!==d.indexToSelect){const e=d.indexToSelect,t=e-1;if(0===e)return;if(e===d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if(t<d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if((null===(o=a.selectedBlocks)||void 0===o?void 0:o.includes(e))&&e!==d.startedIndexToSelect){const n=a.selectedBlocks.filter((t=>t!==e));return a.setBlockSelected(n,{only:!0}),void(d.indexToSelect=t)}return}const t=k(a),n=On(a);if(!n||!n.selection||!t)return;const r=Io.parent(n.selection.anchor.path),i=ui.isStart(n,n.selection.focus,r);if(Zo.isExpanded(n.selection)&&i){const r=a.selection?[a.selection[0]-1]:[0],o=k(a,{at:r});t&&o&&(e.preventDefault(),Es.blur(n),Es.deselect(n),Gi.deselect(n),a.setSelection(null),a.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)-1]),d.startedIndexToSelect=t.meta.order,d.indexToSelect=t.meta.order-1,d.selectionStarted=!0)}}if($f.isShiftArrowDown(e)){if(d.selectionStarted&&null!==d.indexToSelect&&null!==d.startedIndexToSelect){const e=d.indexToSelect,t=e+1;if(t===Object.keys(a.children).length)return;if(e===d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if(t>d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if((null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==d.startedIndexToSelect){const n=a.selectedBlocks.filter((t=>t!==e));return a.setBlockSelected(n,{only:!0}),void(d.indexToSelect=t)}return}const t=k(a),n=On(a);if(!n||!n.selection||!t)return;const r=Io.parent(n.selection.anchor.path),o=ui.isEnd(n,n.selection.focus,r);if(Zo.isExpanded(n.selection)&&o){const r=a.selection?[a.selection[0]+1]:[0],o=k(a,{at:r});t&&o&&(e.preventDefault(),Es.blur(n),Es.deselect(n),Gi.deselect(n),a.setSelection(null),a.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),d.startedIndexToSelect=t.meta.order,d.indexToSelect=t.meta.order+1,d.selectionStarted=!0)}}},v=(g={userSelect:c.selection?"none":"auto",pointerEvents:c.selection?"none":"auto"},Object.assign({paddingBottom:150},g));var g;return t("div",Object.assign({id:"yoopta-editor",className:r,style:v,ref:s,onClick:e=>{p(),(e=>{var t;const n=s.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10);if(e.clientY>=o){const e=Object.keys(a.children).length-1,n=k(a,{at:[e]}),r=On(a,{at:[e]});if(n&&r&&r.selection){const e=ui.string(r,r.selection.anchor.path),o=Io.parent(r.selection.anchor.path),[i]=ui.node(r,o);if(Jo.isElement(i)&&"void"!==(null===(t=i.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void a.focusBlock(n.id,{slate:r})}const o=K(U()),i=e+1;a.insertBlock(o,{at:[i],focus:!0})}})(e),f()},onBlur:e=>{var t;(null===(t=s.current)||void 0===t?void 0:t.contains(e.relatedTarget))||(p(),f())}},{children:[e(ip,{editor:a,marks:n}),e(up,{origin:c.origin,coords:c.coords,isOpen:c.selection})]}))},cp=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return l((()=>r(!0)),[]),n?e:t};var dp={isHistory:e=>Or(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||ii.isOperationList(e.redos[0]))&&(0===e.undos.length||ii.isOperationList(e.undos[0]))},fp=new WeakMap,pp=new WeakMap,hp={isHistoryEditor:e=>dp.isHistory(e.history)&&ui.isEditor(e),isMerging:e=>pp.get(e),isSaving:e=>fp.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=hp.isMerging(e);pp.set(e,!1),t(),pp.set(e,n)},withoutSaving(e,t){var n=hp.isSaving(e);fp.set(e,!1),t(),fp.set(e,n)}},vp=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];hp.withoutSaving(t,(()=>{ui.withoutNormalizing(t,(()=>{for(var e of r)t.apply(e)}))})),e.redos.pop(),e.undos.push(r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];hp.withoutSaving(t,(()=>{ui.withoutNormalizing(t,(()=>{var e=r.map(ii.inverse).reverse();for(var n of e)t.apply(n)}))})),e.redos.push(r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,a=i[i.length-1],u=a&&a[a.length-1],s=Dp(e,u),l=hp.isSaving(t),c=hp.isMerging(t);if(null==l&&(l=mp(e)),l){if(null==c&&(c=null!=a&&(0!==r.length||(gp(e,u)||s))),a&&c)s&&a.pop(),a.push(e);else{var d=[e];i.push(d)}for(;i.length>100;)i.shift();bp(e)&&(o.redos=[])}n(e)},t},gp=(e,t)=>"set_selection"===e.type||(!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!Io.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!Io.equals(e.path,t.path))),mp=(e,t)=>"set_selection"!==e.type||null!=e.properties&&null!=e.newProperties,Dp=(e,t)=>!(!t||"set_selection"!==e.type||"set_selection"!==t.type),bp=e=>"set_selection"!==e.type,yp=Symbol.for("immer-nothing"),Cp=Symbol.for("immer-draftable"),wp=Symbol.for("immer-state");function Bp(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ep=Object.getPrototypeOf;function xp(e){return!!e&&!!e[wp]}function Ap(e){return!!e&&(kp(e)||Array.isArray(e)||!!e[Cp]||!!e.constructor?.[Cp]||Rp(e)||Tp(e))}var Fp=Object.prototype.constructor.toString();function kp(e){if(!e||"object"!=typeof e)return!1;const t=Ep(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)===Fp}function Op(e,t){0===Sp(e)?Object.entries(e).forEach((([n,r])=>{t(n,r,e)})):e.forEach(((n,r)=>t(r,n,e)))}function Sp(e){const t=e[wp];return t?t.type_:Array.isArray(e)?1:Rp(e)?2:Tp(e)?3:0}function jp(e,t){return 2===Sp(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Pp(e,t,n){const r=Sp(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Rp(e){return e instanceof Map}function Tp(e){return e instanceof Set}function Np(e){return e.copy_||e.base_}function _p(e,t){if(Rp(e))return new Map(e);if(Tp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&kp(e)){if(!Ep(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[wp];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Ep(e),n)}function Mp(e,t=!1){return Ip(e)||xp(e)||!Ap(e)||(Sp(e)>1&&(e.set=e.add=e.clear=e.delete=Lp),Object.freeze(e),t&&Op(e,((e,t)=>Mp(t,!0)))),e}function Lp(){Bp(2)}function Ip(e){return Object.isFrozen(e)}var zp,Wp={};function Vp(e){const t=Wp[e];return t||Bp(0),t}function qp(){return zp}function Hp(e,t){t&&(Vp("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Up(e){Kp(e),e.drafts_.forEach(Xp),e.drafts_=null}function Kp(e){e===zp&&(zp=e.parent_)}function $p(e){return zp={drafts_:[],parent_:zp,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xp(e){const t=e[wp];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Yp(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[wp].modified_&&(Up(t),Bp(4)),Ap(e)&&(e=Zp(t,e),t.parent_||Jp(t,e)),t.patches_&&Vp("Patches").generateReplacementPatches_(n[wp].base_,e,t.patches_,t.inversePatches_)):e=Zp(t,n,[]),Up(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yp?e:void 0}function Zp(e,t,n){if(Ip(t))return t;const r=t[wp];if(!r)return Op(t,((o,i)=>Gp(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Jp(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),Op(o,((o,a)=>Gp(e,r,t,o,a,n,i))),Jp(e,t,!1),n&&e.patches_&&Vp("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Gp(e,t,n,r,o,i,a){if(xp(o)){const a=Zp(e,o,i&&t&&3!==t.type_&&!jp(t.assigned_,r)?i.concat(r):void 0);if(Pp(n,r,a),!xp(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(Ap(o)&&!Ip(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Zp(e,o),t&&t.scope_.parent_||Jp(e,o)}}function Jp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Mp(t,n)}var Qp={get(e,t){if(t===wp)return e;const n=Np(e);if(!jp(n,t))return function(e,t,n){const r=nh(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Ap(r)?r:r===th(e.base_,t)?(oh(e),e.copy_[t]=ih(r,e)):r},has:(e,t)=>t in Np(e),ownKeys:e=>Reflect.ownKeys(Np(e)),set(e,t,n){const r=nh(Np(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=th(Np(e),t),o=r?.[wp];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||jp(e.base_,t)))return!0;oh(e),rh(e)}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!==th(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,oh(e),rh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Np(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Bp(11)},getPrototypeOf:e=>Ep(e.base_),setPrototypeOf(){Bp(12)}},eh={};function th(e,t){const n=e[wp];return(n?Np(n):e)[t]}function nh(e,t){if(!(t in e))return;let n=Ep(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Ep(n)}}function rh(e){e.modified_||(e.modified_=!0,e.parent_&&rh(e.parent_))}function oh(e){e.copy_||(e.copy_=_p(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Op(Qp,((e,t)=>{eh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),eh.deleteProperty=function(e,t){return eh.set.call(this,e,t,void 0)},eh.set=function(e,t,n){return Qp.set.call(this,e[0],t,n,e[0])};function ih(e,t){const n=Rp(e)?Vp("MapSet").proxyMap_(e,t):Tp(e)?Vp("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:qp(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Qp;n&&(o=[r],i=eh);const{revoke:a,proxy:u}=Proxy.revocable(o,i);return r.draft_=u,r.revoke_=a,u}(e,t);return(t?t.scope_:qp()).drafts_.push(n),n}function ah(e){if(!Ap(e)||Ip(e))return e;const t=e[wp];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_p(e,t.scope_.immer_.useStrictShallowCopy_)}else n=_p(e,!0);return Op(n,((e,t)=>{Pp(n,e,ah(t))})),t&&(t.finalized_=!1),n}var uh=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 r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&Bp(6),void 0!==n&&"function"!=typeof n&&Bp(7),Ap(e)){const o=$p(this),i=ih(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Up(o):Kp(o)}return Hp(o,n),Yp(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===yp&&(r=void 0),this.autoFreeze_&&Mp(r,!0),n){const t=[],o=[];Vp("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}Bp(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;const o=this.produce(e,t,((e,t)=>{n=e,r=t}));return[o,n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ap(e)||Bp(8),xp(e)&&(e=function(e){xp(e)||Bp(10);return ah(e)}(e));const t=$p(this),n=ih(e,void 0);return n[wp].isManual_=!0,Kp(t),n}finishDraft(e,t){const n=e&&e[wp];n&&n.isManual_||Bp(9);const{scope_:r}=n;return Hp(r,t),Yp(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Vp("Patches").applyPatches_;return xp(e)?r(e,t):this.produce(e,(e=>r(e,t)))}};uh.produce,uh.produceWithPatches.bind(uh),uh.setAutoFreeze.bind(uh),uh.setUseStrictShallowCopy.bind(uh),uh.applyPatches.bind(uh);var sh=uh.createDraft.bind(uh),lh=uh.finishDraft.bind(uh);function ch(e,t={nodeType:"block"}){return{id:U(),type:e,children:[{text:""}],props:t}}function dh(e,t){const n=[];return t.forEach((t=>{const r=e.elements[t];if(Array.isArray(r.children)&&r.children.length>0){const o=dh(e,r.children),i=ch(t,r.props);i.children=o,n.push(i)}else n.push(ch(t,r.props))})),n}function fh(e,t,n){e.children=sh(e.children);const r=k(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const o=On(e,{at:[null==r?void 0:r.meta.order]});if(!o||!o.selection)return;const i=e.blocks[t],a=Object.entries(i.elements),u=1===a.length?a[0]:a.find((e=>e[1].asRoot));if(console.log("rootElementFromBlock",u),!u)throw new Error(`No root element found in the block elements. Passed block: ${i}`);const[s,l]=u;let c=[];const d=Array.isArray(l.children)&&l.children.length>0,f=ch(s,l.props||{nodeType:"block"}),p=f.props.nodeType;d&&(c=dh(i,l.children));const h="void"===p,v="block"===p;if(Gi.setNodes(o,f,{at:[0,0],match:e=>Jo.isElement(e),mode:"highest"}),d){let e=[0,0];c.forEach((t=>{Jo.isElement(t)&&(Gi.insertNodes(o,t,{at:e,match:e=>Jo.isElement(e),mode:"lowest"}),e.push(0)),t.children&&t.children.forEach((t=>{Jo.isElement(t)&&(Gi.insertNodes(o,t,{at:e,match:e=>Jo.isElement(e),mode:"lowest"}),e.push(0))}))}))}(null==n?void 0:n.deleteText)&&Gi.delete(o,{at:d?[0,0,0]:[0,0]}),(v||h)&&(r.type=i.type),r.value=o.children;const g=r.id;e.children=lh(e.children),e.applyChanges(),(null==n?void 0:n.focus)&&e.focusBlock(g,{slate:o})}function ph(e,t){const n=On(e);if(!n)return!1;const r=ui.marks(n);return!!(null==r?void 0:r[t])}const hh=(e,t)=>{const{insertText:n}=t;return t.insertText=r=>{var o;const{selection:i}=t;if(" "===r&&i&&Zo.isCollapsed(i)){const{anchor:a}=i,u=ui.above(t,{match:e=>Jo.isElement(e)&&ui.isBlock(t,e),mode:"lowest"});if(!u)return;const[,s]=u,l=ui.parent(t,s),[c]=l;if(Jo.isElement(c)&&!bi.isText(c.children[0]))return n(r);const d=u?s:[],f={anchor:a,focus:ui.start(t,d)},p=ui.string(t,f),h=null===(o=e.shortcuts)||void 0===o?void 0:o[p];if(!!h&&!h.isActive())return Gi.select(t,f),Gi.delete(t),void h.create({deleteText:!1})}n(r)},t};function vh(e,t,n){e.children=sh(e.children);const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);n.meta&&(r.meta=n.meta),n.value&&(r.value=n.value),e.children=lh(e.children),e.emit("block:update",{id:t,data:n})}function gh(e,t,n){e.children=sh(e.children);const r=k(e,{at:e.selection});if(!r)throw new Error("Block from not found at current selection");const o=mf(e.blocks[r.type].elements);if(r.type===t)return void(e.children=lh(e.children));const i=On(e,{at:[r.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${r.meta.order}`);const a=mf(e.blocks[t].elements);ui.withoutNormalizing(i,(()=>{const n=function(e,t={}){var n;const{at:r,elementType:o}=t,i=r||(null===(n=e.selection)||void 0===n?void 0:n.anchor.path);if(!i)return;let a=e=>!ui.isEditor(e)&&Jo.isElement(e);o&&(a=e=>!ui.isEditor(e)&&Jo.isElement(e)&&e.type===o);const u=Io.parent(i),s=ui.nodes(e,{at:u,match:a,mode:"lowest"});if(s){const[e]=s;return e}}(i,{elementType:o});console.log({fromBlockRootElementType:o,node:n}),Gi.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>Jo.isElement(e)&&!ui.isInline(i,e)});const u={id:r.id,type:t,meta:Object.assign(Object.assign({},r.meta),{order:r.meta.order}),value:i.children};e.blockEditorsMap[r.id]=i,e.children[r.id]=u,e.children=lh(e.children),e.applyChanges()}))}function mh(e,t){const n={};return t.forEach((t=>{const r=t.type;n[r]={hotkey:t.hotkey,type:r,getValue:()=>function(e,t){const n=On(e);if(!n)return null;const r=ui.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>ph(e,r),toggle:()=>function(e,t){const n=On(e),r=ph(e,t);n&&(r?ui.removeMark(n,t):ui.addMark(n,t,!0),e.applyChanges())}(e,r),update:t=>function(e,t,n){const r=On(e);console.log("update editor.selection",e.selection),console.log("text format slate.selection",r),r&&r.selection&&Zo.isExpanded(r.selection)&&(ui.addMark(r,t,n),e.applyChanges())}(e,r,t)}})),n}function Dh(e,t){const n={};return t.forEach(((t,r)=>{var o;const i=Df(t.elements),a=null===(o=null==i?void 0:i.props)||void 0===o?void 0:o.nodeType;if(!("inline"===a||"inlineVoid"===a)){const o={};Object.keys(t.elements).forEach((e=>{const n=Sf(t.elements[e],["render"]);o[e]=n}));const{displayLabel:i,placeholder:a,align:u,shortcuts:s}=t.options||{};n[t.type]={type:t.type,elements:o,order:r,options:{displayLabel:i,placeholder:a,align:u,shortcuts:s},isActive:()=>{const n=k(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{gh(e,t)},create:n=>{fh(e,t.type,n)},update:(t,n)=>{vh(e,t,n)},updateElement:(t,n,r)=>{!function(e,t,n,r){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const i=On(e,{at:[o.meta.order]});i?ui.withoutNormalizing(i,(()=>{const[t]=ui.nodes(i,{at:[0],match:e=>Jo.isElement(e)&&e.type===n}),o=null==t?void 0:t[0],a=(null==o?void 0:o.props)||{},u={props:Object.assign(Object.assign({},a),r)};console.log("updatedNode",u),Gi.setNodes(i,u,{at:[0],match:e=>Jo.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges()})):console.warn("No slate found")}(e,t,n,r)},delete:()=>{console.log("block.delete")}}}})),n}function bh(e){return vp(hh(e,Ml(xa())))}function yh(){return yh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yh.apply(this,arguments)}function Ch(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function wh(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>i(e)));return function(n){const r=(null==n?void 0:n[e])||t;return c((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=i(r),u=n.length;function s(t){const{scope:n,children:r,...i}=t,a=(null==n?void 0:n[e][u])||o,s=c((()=>i),Object.values(i));return m(a.Provider,{value:s},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,i){const s=(null==i?void 0:i[e][u])||o,l=a(s);if(l)return l;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Bh(r,...t)]}function Bh(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return c((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function Eh(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function xh(...e){return d(Eh(...e),e)}const Ah=g(((e,t)=>{const{children:n,...r}=e,o=D.toArray(n),i=o.find(Oh);if(i){const e=i.props.children,n=o.map((t=>t===i?D.count(e)>1?D.only(null):b(e)?e.props.children:null:t));return m(Fh,yh({},r,{ref:t}),b(e)?y(e,void 0,n):null)}return m(Fh,yh({},r,{ref:t}),n)}));Ah.displayName="Slot";const Fh=g(((e,t)=>{const{children:n,...r}=e;return b(n)?y(n,{...Sh(r,n.props),ref:t?Eh(t,n.ref):n.ref}):D.count(n)>1?D.only(null):null}));Fh.displayName="SlotClone";const kh=({children:e})=>m(C,null,e);function Oh(e){return b(e)&&e.type===kh}function Sh(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const jh=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?s:()=>{},Ph=r["useId".toString()]||(()=>{});let Rh=0;const Th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=g(((e,n)=>{const{asChild:r,...o}=e,i=r?Ah:t;return l((()=>{window[Symbol.for("radix-ui")]=!0}),[]),m(i,yh({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function Nh(e){const t=u(e);return l((()=>{t.current=e})),c((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function _h({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=f(e),[r]=n,o=u(r),i=Nh(t);return l((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,a=i?e:r,s=Nh(n);return[a,d((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else o(t)}),[i,e,o,s])]}const Mh=i(void 0);function Lh(e){const t=a(Mh);return e||t||"ltr"}const Ih="rovingFocusGroup.onEntryFocus",zh={bubbles:!1,cancelable:!0},Wh="RovingFocusGroup",[Vh,qh,Hh]=function(e){const t=e+"CollectionProvider",[n,r]=wh(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),u=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return o.createElement(i,{scope:t,itemMap:a,collectionRef:r},n)},Slot:o.forwardRef(((e,t)=>{const{scope:n,children:r}=e,i=xh(t,a(u,n).collectionRef);return o.createElement(Ah,{ref:i},r)})),ItemSlot:o.forwardRef(((e,t)=>{const{scope:n,children:r,...i}=e,u=o.useRef(null),c=xh(t,u),d=a(s,n);return o.useEffect((()=>(d.itemMap.set(u,{ref:u,...i}),()=>{d.itemMap.delete(u)}))),o.createElement(Ah,{[l]:"",ref:c},r)}))},function(t){const n=a(e+"CollectionConsumer",t),r=o.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}(Wh),[Uh,Kh]=wh(Wh,[Hh]),[$h,Xh]=Uh(Wh),Yh=g(((e,t)=>m(Vh.Provider,{scope:e.__scopeRovingFocusGroup},m(Vh.Slot,{scope:e.__scopeRovingFocusGroup},m(Zh,yh({},e,{ref:t})))))),Zh=g(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:p,...h}=e,v=u(null),g=xh(t,v),D=Lh(i),[b=null,y]=_h({prop:a,defaultProp:s,onChange:c}),[C,w]=f(!1),B=Nh(p),E=qh(n),x=u(!1),[A,F]=f(0);return l((()=>{const e=v.current;if(e)return e.addEventListener(Ih,B),()=>e.removeEventListener(Ih,B)}),[B]),m($h,{scope:n,orientation:r,dir:D,loop:o,currentTabStopId:b,onItemFocus:d((e=>y(e)),[y]),onItemShiftTab:d((()=>w(!0)),[]),onFocusableItemAdd:d((()=>F((e=>e+1))),[]),onFocusableItemRemove:d((()=>F((e=>e-1))),[])},m(Th.div,yh({tabIndex:C||0===A?-1:0,"data-orientation":r},h,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ch(e.onMouseDown,(()=>{x.current=!0})),onFocus:Ch(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!C){const t=new CustomEvent(Ih,zh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=E().filter((e=>e.focusable));Qh([e.find((e=>e.active)),e.find((e=>e.id===b)),...e].filter(Boolean).map((e=>e.ref.current)))}}x.current=!1})),onBlur:Ch(e.onBlur,(()=>w(!1)))})))})),Gh=g(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:a,...u}=e,s=function(e){const[t,n]=r.useState(Ph());return jh((()=>{e||n((e=>null!=e?e:String(Rh++)))}),[e]),e||(t?`radix-${t}`:"")}(),c=a||s,d=Xh("RovingFocusGroupItem",n),f=d.currentTabStopId===c,p=qh(n),{onFocusableItemAdd:h,onFocusableItemRemove:v}=d;return l((()=>{if(o)return h(),()=>v()}),[o,h,v]),m(Vh.ItemSlot,{scope:n,id:c,focusable:o,active:i},m(Th.span,yh({tabIndex:f?0:-1,"data-orientation":d.orientation},u,{ref:t,onMouseDown:Ch(e.onMouseDown,(e=>{o?d.onItemFocus(c):e.preventDefault()})),onFocus:Ch(e.onFocus,(()=>d.onItemFocus(c))),onKeyDown:Ch(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Jh[r]}(e,d.orientation,d.dir);if(void 0!==t){e.preventDefault();let o=p().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>Qh(o)))}var n,r}))})))})),Jh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qh(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const ev=Yh,tv=Gh,nv="horizontal",rv=["horizontal","vertical"],ov=g(((e,t)=>{const{decorative:n,orientation:r=nv,...o}=e,i=iv(r)?r:nv,a=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return m(Th.div,yh({"data-orientation":i},a,o,{ref:t}))}));function iv(e){return rv.includes(e)}ov.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!iv(r)?new Error(function(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:\n - horizontal\n - vertical\n\nDefaulting to \`${nv}\`.`}(o,n)):null}};const av=ov,uv=g(((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,u]=_h({prop:n,onChange:o,defaultProp:r});return m(Th.button,yh({type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Ch(e.onClick,(()=>{e.disabled||u(!a)}))}))})),sv="ToggleGroup",[lv,cv]=wh(sv,[Kh]),dv=Kh(),fv=o.forwardRef(((e,t)=>{const{type:n,...r}=e;if("single"===n){const e=r;return o.createElement(vv,yh({},e,{ref:t}))}if("multiple"===n){const e=r;return o.createElement(gv,yh({},e,{ref:t}))}throw new Error(`Missing prop \`type\` expected on \`${sv}\``)})),[pv,hv]=lv(sv),vv=o.forwardRef(((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=(()=>{}),...a}=e,[u,s]=_h({prop:n,defaultProp:r,onChange:i});return o.createElement(pv,{scope:e.__scopeToggleGroup,type:"single",value:u?[u]:[],onItemActivate:s,onItemDeactivate:o.useCallback((()=>s("")),[s])},o.createElement(bv,yh({},a,{ref:t})))})),gv=o.forwardRef(((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=(()=>{}),...a}=e,[u=[],s]=_h({prop:n,defaultProp:r,onChange:i}),l=o.useCallback((e=>s(((t=[])=>[...t,e]))),[s]),c=o.useCallback((e=>s(((t=[])=>t.filter((t=>t!==e))))),[s]);return o.createElement(pv,{scope:e.__scopeToggleGroup,type:"multiple",value:u,onItemActivate:l,onItemDeactivate:c},o.createElement(bv,yh({},a,{ref:t})))})),[mv,Dv]=lv(sv),bv=o.forwardRef(((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:u,loop:s=!0,...l}=e,c=dv(n),d=Lh(u),f={role:"group",dir:d,...l};return o.createElement(mv,{scope:n,rovingFocus:i,disabled:r},i?o.createElement(ev,yh({asChild:!0},c,{orientation:a,dir:d,loop:s}),o.createElement(Th.div,yh({},f,{ref:t}))):o.createElement(Th.div,yh({},f,{ref:t})))})),yv="ToggleGroupItem",Cv=o.forwardRef(((e,t)=>{const n=hv(yv,e.__scopeToggleGroup),r=Dv(yv,e.__scopeToggleGroup),i=dv(e.__scopeToggleGroup),a=n.value.includes(e.value),u=r.disabled||e.disabled,s={...e,pressed:a,disabled:u},l=o.useRef(null);return r.rovingFocus?o.createElement(tv,yh({asChild:!0},i,{focusable:!u,active:a,ref:l}),o.createElement(wv,yh({},s,{ref:t}))):o.createElement(wv,yh({},s,{ref:t}))})),wv=o.forwardRef(((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,a=hv(yv,n),u={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s="single"===a.type?u:void 0;return o.createElement(uv,yh({},s,i,{ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}}))})),Bv=fv,Ev=Cv,xv="Toolbar",[Av,Fv]=wh(xv,[Kh,cv]),kv=Kh(),Ov=cv(),[Sv,jv]=Av(xv),Pv=g(((e,t)=>{const{__scopeToolbar:n,orientation:r="horizontal",dir:o,loop:i=!0,...a}=e,u=kv(n),s=Lh(o);return m(Sv,{scope:n,orientation:r,dir:s},m(ev,yh({asChild:!0},u,{orientation:r,dir:s,loop:i}),m(Th.div,yh({role:"toolbar","aria-orientation":r,dir:s},a,{ref:t}))))})),Rv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=jv("ToolbarSeparator",n);return m(av,yh({orientation:"horizontal"===o.orientation?"vertical":"horizontal"},r,{ref:t}))})),Tv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=kv(n);return m(tv,yh({asChild:!0},o,{focusable:!e.disabled}),m(Th.button,yh({type:"button"},r,{ref:t})))})),Nv=Pv,_v=Rv,Mv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=jv("ToolbarToggleGroup",n),i=Ov(n);return m(Bv,yh({"data-orientation":o.orientation,dir:o.dir},i,r,{ref:t,rovingFocus:!1}))})),Lv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=Ov(n),i={__scopeToolbar:e.__scopeToolbar};return m(Tv,yh({asChild:!0},i),m(Ev,yh({},o,r,{ref:t})))})),Iv=[["Default","black"],["Gray","#787774"],["Brown","#976D57"],["Orange","#CC772F"],["Yellow","#C29243"],["Green","#548064"],["Blue","#477DA5"],["Purple","#A48BBE"],["Pink","#B35588"],["Red","#C4554D"]],zv=[["Default","unset"],["Gray","#F1F1EF"],["Brown","#F3EEEE"],["Orange","#F8ECDF"],["Yellow","#FAF3DD"],["Green","#EEF3ED"],["Blue","#E9F3F7"],["Purple","#F6F3F8"],["Pink","#F9F2F5"],["Red","#FAECEC"]],Wv={border:"1px solid #e3e3e3"},Vv=({editor:n,highlightColors:r,onClose:o,refs:i,floatingStyles:a})=>{const u=(e,t)=>(null==r?void 0:r[e])===t?{border:"2px solid #3b82f6",backgroundColor:t}:Object.assign({backgroundColor:t},Wv),s=(e,t)=>{const o=n.formats.highlight.getValue();(null==o?void 0:o[e])!==t?n.formats.highlight.update(Object.assign(Object.assign({},r),{[e]:t})):n.formats.highlight.update(Object.assign(Object.assign({},r),{[e]:void 0}))};return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:o},{children:e("div",Object.assign({style:a,ref:i.setFloating,onClick:e=>e.stopPropagation()},{children:t("div",Object.assign({className:"bg-white p-[5px] rounded-md shadow-md border shadow-y-[4px]"},{children:[t("div",Object.assign({className:"flex items-center justify-between"},{children:[e("span",Object.assign({className:"text-xs"},{children:"Text color"})),e(Kd,{width:14,height:14})]})),e("div",Object.assign({className:"flex items-center"},{children:Iv.map((([t,n])=>e("button",{title:t,type:"button",className:"w-[25px] h-[25px] rounded-md mx-[2px] my-[5px] border-[#e3e3e3]",style:u("color",n),onClick:()=>s("color",n)},t)))})),t("div",Object.assign({className:"flex items-center justify-between mt-1"},{children:[e("span",Object.assign({className:"text-xs"},{children:"Background color"})),e(Kd,{width:14,height:14})]})),e("div",Object.assign({className:"flex items-center"},{children:zv.map((([t,n])=>e("button",{title:t,type:"button",className:"w-[25px] h-[25px] rounded-md mx-[2px] my-[5px] border-[#e3e3e3]",style:u("backgroundColor",n),onClick:()=>s("backgroundColor",n)},t)))}))]}))}))}))}))},qv=bf,Hv=({activeBlock:n,editor:r})=>{var o;const[i,a]=f(!1),[u,s]=f(!1),{refs:l,floatingStyles:c}=Ld({placement:"bottom-start",open:i,onOpenChange:a,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),{refs:d,floatingStyles:p}=Ld({placement:"top-end",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),h=e=>{var t,n;return{backgroundColor:(null===(t=r.formats[e])||void 0===t?void 0:t.isActive())?"#1183ff":void 0,color:(null===(n=r.formats[e])||void 0===n?void 0:n.isActive())?"#fff":void 0}},v=r.formats.highlight,g=null==v?void 0:v.getValue(),m=(null===(o=null==n?void 0:n.options)||void 0===o?void 0:o.displayLabel)||(null==n?void 0:n.type)||"";return t(Nv,Object.assign({className:"bg-white flex z-50 p-[5px] rounded-md shadow-md border shadow-y-[4px]"},{children:[t(Mv,Object.assign({className:"flex items-center",type:"single","aria-label":"Block formatting"},{children:[i&&e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>a(!1)},{children:e("div",Object.assign({style:c,ref:l.setFloating},{children:e(qv,{actions:Object.keys(r.blocks),editor:r,selectedAction:m,onClose:()=>a(!1),empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),u&&e(Vv,{editor:r,floatingStyles:p,refs:d,onClose:()=>s(!1),highlightColors:g}),e(Lv,Object.assign({className:"h-full px-[10px] py-0 hover:bg-[#f4f4f5] rounded-md",value:m,"aria-label":m,ref:l.setReference,onClick:()=>a((e=>!e))},{children:e("span",Object.assign({className:"mr-0"},{children:m}))}))]})),e(_v,{className:"bg-[#dbd8e0] mx-[6px] my-0 w-[1px]"}),e(Mv,Object.assign({className:"flex items-center",type:"single","aria-label":"Block formatting"},{children:e(Lv,Object.assign({className:"h-full px-[10px] py-0 hover:bg-[#f4f4f5] rounded-md",value:"LinkTool","aria-label":"LinkTool"},{children:e("span",Object.assign({className:"mr-0"},{children:"Link"}))}))})),e(_v,{className:"bg-[#dbd8e0] mx-[6px] my-0 w-[1px]"}),t(Mv,Object.assign({className:"flex items-center",type:"multiple","aria-label":"Text formatting"},{children:[r.formats.bold&&e(Lv,Object.assign({className:"h-[32px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"bold","aria-label":"Bold",style:h("bold"),onClick:()=>r.formats.bold.toggle()},{children:e(ef,{width:20,height:20})})),r.formats.italic&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"italic","aria-label":"Italic",style:h("italic"),onClick:()=>r.formats.italic.toggle()},{children:e(nf,{width:20,height:20})})),r.formats.underline&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"underline","aria-label":"Underline",style:h("underline"),onClick:()=>r.formats.underline.toggle()},{children:e(pf,{width:20,height:20})})),r.formats.strike&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"strike","aria-label":"Strike",style:h("strike"),onClick:()=>r.formats.strike.toggle()},{children:e(uf,{width:20,height:20})})),r.formats.code&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"code","aria-label":"Code",style:h("code"),onClick:()=>r.formats.code.toggle()},{children:e(Xd,{width:20,height:20})})),r.formats.highlight&&t(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"highlight","aria-label":"Highlight",style:{color:null==g?void 0:g.color,backgroundColor:null==g?void 0:g.backgroundColor,backgroundImage:null==g?void 0:g.backgroundImage,WebkitTextFillColor:null==g?void 0:g.webkitTextFillColor},ref:d.setReference,onClick:()=>s((e=>!e))},{children:[e("span",Object.assign({className:"text-lg px-1 font-serif text-col"},{children:"A"})),e(u?Kd:Hd,{width:10})]}))]}))]}))},Uv=()=>{const t=P(),[n,r]=f(!1),{refs:o,floatingStyles:i}=Ld({placement:"top",open:n,onOpenChange:r,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),a=yr((()=>{const e=window.getSelection();if(!e||(null==e?void 0:e.isCollapsed))return r(!1);const t=e.getRangeAt(0),n=t.getBoundingClientRect(),i=t.toString().trim(),a=document.getElementById("yoopta-editor"),u=null==t?void 0:t.commonAncestorContainer;if(!(null==a?void 0:a.contains(u)))return r(!1);t&&i.length>0&&(o.setReference({getBoundingClientRect:()=>n,getClientRects:()=>t.getClientRects()}),r(!0))}),200);if(l((()=>(window.document.addEventListener("selectionchange",a),()=>window.document.removeEventListener("selectionchange",a))),[t.selectedBlocks]),!n)return null;const u=Object.values(t.blocks).find((e=>e.isActive()));return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:e(Hv,{activeBlock:u,editor:t})}))}))},Kv={onKeyDown:(e,t,n)=>e=>{const{open:r,close:o,state:i}=n;if($f.isSlashCommand(e)){if(!t.selection)return;const n=Io.parent(t.selection.anchor.path),o=ui.string(t,n),a=ui.isStart(t,t.selection.anchor,t.selection.focus);if(console.log("event.key",e.key),console.log("state.open",i.open),!a||o.trim().length>0)return;const u=window.getSelection();if(!u)return;const s=u.getRangeAt(0),l=s.getBoundingClientRect();s&&(i.refs.setReference({getBoundingClientRect:()=>l,getClientRects:()=>s.getClientRects()}),r())}if(i.open)if($f.isTab(e))e.preventDefault();else if($f.isArrowUp(e))e.preventDefault();else if($f.isArrowDown(e))e.preventDefault();else if($f.isArrowLeft(e))e.preventDefault();else if($f.isArrowRight(e))e.preventDefault();else{if($f.isBackspace(e)){if(!t.selection)return;if(ui.isStart(t,t.selection.anchor,t.selection.focus))return o()}if($f.isEscape(e))return e.preventDefault(),void o();$f.isEnter(e)&&e.preventDefault()}},onKeyUp:(e,t,{open:n,close:r,change:o,state:i})=>e=>{if(!t.selection)return;const n=Io.parent(t.selection.anchor.path),i=ui.string(t,n);if(0===i.length)return r();o({text:i})}},$v=(e,t,n)=>!(!e||!(null==e?void 0:e[n]))&&e[n].toLowerCase().indexOf(t.toLowerCase())>-1,Xv=({trigger:t="/",render:n})=>{const r=P(),{registerTool:o,unregisterTool:i,tools:a}=Qf(),[u,s]=f(!1),{refs:c,floatingStyles:d,update:p}=Ld({placement:"bottom-start",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),h=Object.keys(r.blocks).sort(((e,t)=>r.blocks[e].order-r.blocks[t].order)),[v,g]=f(h[0]),[m,D]=f(h),b=()=>s(!0),y=()=>s(!1),C=({text:e})=>{const n=e.trim().replace(t,"");if(0===n.length||n===t)return D(h);D(h.filter((e=>((e,t)=>!t||$v(e,t,"type")||$v(e.options,t,"displayLabel"))(r.blocks[e],n))))};l((()=>(o("actionMenu",{open:b,close:y,change:C,state:{isMenuOpen:u,refs:c},component:bf,events:Kv}),()=>i("actionMenu"))),[u,c]),l((()=>{if(u&&a.actionMenu)return document.addEventListener("click",y),()=>document.removeEventListener("click",y)}),[u,a.actionMenu]);const w=e=>{const t=e.currentTarget.getAttribute("data-action-menu-item-type");g(t)},B=0===m.length;if(l((()=>{p();let e=setTimeout((()=>{B&&y()}),3e3);return()=>clearTimeout(e)}),[m.length,u,c]),!u)return null;if(n){const t=e=>({onMouseEnter:w,selectedAction:v});return e(Td,{children:e("div",Object.assign({className:"absolute z-[9999] m-0 left-0 top-0 right-auto bottom-auto",style:d,ref:c.setFloating},{children:n({getItemProps:t,actions:m,editor:r,onMouseEnter:w,selectedAction:v,onClose:y,empty:B})}))})}return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e("div",Object.assign({className:"absolute z-[9999] m-0 left-0 top-0 right-auto bottom-auto",style:d,ref:c.setFloating},{children:e(bf,{actions:m,editor:r,onMouseEnter:w,selectedAction:v,onClose:y,empty:B})}))}))},Yv=(()=>{const e=U();return{[e]:K(e)}})(),Zv=new W,Gv=(e,t)=>Zv.on(e,t),Jv=(e,t)=>Zv.once(e,t),Qv=(e,t)=>Zv.off(e,t),eg=(e,t)=>Zv.emit(e,t),tg=({editor:n,value:r,marks:o,plugins:i,autoFocus:a,className:u,tools:s,selectionBoxRoot:l})=>{const d=()=>{n.emit("change",n.children),v((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},p=c((()=>i.map((e=>e.getPlugin))),[i]),[h,v]=f((()=>(n.applyChanges=d,o&&(n.formats=mh(n,o)),n.blocks=Dh(n,p),n.children=Yv,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const r=bh(e);t[n]=r})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,r,o,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(r=e.options)||void 0===r?void 0:r.shortcuts.length)>0&&(null===(i=null===(o=e.options)||void 0===o?void 0:o.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 r;const o=e.elements[t],i=null===(r=o.props)||void 0===r?void 0:r.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=o)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const r=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:r})}})),t}(p),n.on=Gv,n.once=Jv,n.off=Qv,n.emit=eg,{editor:n,version:0})));return e(cp,{children:e(j,Object.assign({editorState:h},{children:t(Jf,{children:[e(lp,{marks:o,autoFocus:a,className:u,selectionBoxRoot:l}),e(Xv,{}),e(Uv,{})]})}))})},ng=Object.assign(Object.assign({},Ef),{ExtendedBlockActions:({className:r,style:o,onClick:i,children:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c}=Ld({placement:"bottom-start",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc});return t(n,{children:[u&&e(Bf,Object.assign({isOpen:u,onClose:()=>s(!1),refs:l,floatingStyles:c},{children:a})),e("button",Object.assign({type:"button",ref:l.setReference,className:`absolute right-[10px] top-[10px] flex items-center justify-between z-10 opacity-1 bg-[#eee] w-[22px] h-[22px] transition-opacity duration-150 ease-in border-none cursor-pointer rounded-[2px] p-[0_4px] ${r}`,onClick:()=>{null==i||i(),s(!0)},style:o},{children:e(Jd,{})}))]})}});function rg(e,t){const n=Object.keys(e.children),{type:r}=t||{},o=n.find((t=>e.children[t].type===r));return o?e.children[o]:null}function og(e,t,n={}){const{focusAt:r,waitExecution:o=!0,waitExecutionMs:i=0}=n,a=()=>{const o=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!o||!i)return;const a=function(e,t){if(di.isPoint(t))return t;if(Io.isPath(t))return{path:t,offset:0};const[,n]=ui.first(e,[0]);return{path:n||[0,0],offset:0}}(o,r);Gi.select(o,a),Es.focus(o),e.setSelection([i.meta.order])};o?setTimeout((()=>a()),i):a()}function ig(e){return Array.from(new Set(e))}var ag={},ug={get exports(){return ag},set exports(e){ag=e}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",a="[object Date]",u="[object Function]",s="[object GeneratorFunction]",l="[object Map]",c="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",v="[object String]",g="[object Symbol]",m="[object WeakMap]",D="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",C="[object Float64Array]",w="[object Int8Array]",B="[object Int16Array]",E="[object Int32Array]",x="[object Uint8Array]",A="[object Uint8ClampedArray]",F="[object Uint16Array]",k="[object Uint32Array]",O=/\w*$/,S=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,P={};P[o]=P["[object Array]"]=P[D]=P[b]=P[i]=P[a]=P[y]=P[C]=P[w]=P[B]=P[E]=P[l]=P[c]=P[d]=P[p]=P[h]=P[v]=P[g]=P[x]=P[A]=P[F]=P[k]=!0,P["[object Error]"]=P[u]=P[m]=!1;var R="object"==typeof L&&L&&L.Object===Object&&L,T="object"==typeof self&&self&&self.Object===Object&&self,N=R||T||Function("return this")(),_=t&&!t.nodeType&&t,M=_&&e&&!e.nodeType&&e,I=M&&M.exports===_;function z(e,t){return e.set(t[0],t[1]),e}function W(e,t){return e.add(t),e}function V(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function q(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function U(e,t){return function(n){return e(t(n))}}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,Y=Function.prototype,Z=Object.prototype,G=N["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=Y.toString,ee=Z.hasOwnProperty,te=Z.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=I?N.Buffer:void 0,oe=N.Symbol,ie=N.Uint8Array,ae=U(Object.getPrototypeOf,Object),ue=Object.create,se=Z.propertyIsEnumerable,le=X.splice,ce=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,fe=U(Object.keys,Object),pe=Le(N,"DataView"),he=Le(N,"Map"),ve=Le(N,"Promise"),ge=Le(N,"Set"),me=Le(N,"WeakMap"),De=Le(Object,"create"),be=qe(pe),ye=qe(he),Ce=qe(ve),we=qe(ge),Be=qe(me),Ee=oe?oe.prototype:void 0,xe=Ee?Ee.valueOf:void 0;function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Fe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ke(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){this.__data__=new Fe(e)}function Se(e,t){var n=Ue(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!se.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||We(a,r))||n.push(a);return n}function je(e,t,n){var r=e[t];ee.call(e,t)&&He(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Pe(e,t){for(var n=e.length;n--;)if(He(e[n][0],t))return n;return-1}function Re(e,t,n,r,f,m,S){var j;if(r&&(j=m?r(e,f,m,S):r(e)),void 0!==j)return j;if(!Ye(e))return e;var R=Ue(e);if(R){if(j=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,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,j)}else{var T=ze(e),N=T==u||T==s;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(T==d||T==o||N&&!m){if(q(e))return m?e:{};if(j=function(e){return"function"!=typeof e.constructor||Ve(e)?{}:(t=ae(e),Ye(t)?ue(t):{});var t}(N?{}:e),!t)return function(e,t){return _e(e,Ie(e),t)}(e,function(e,t){return e&&_e(t,Ze(t),e)}(j,e))}else{if(!P[T])return m?e:{};j=function(e,t,n,r){var o=e.constructor;switch(t){case D:return Ne(e);case i:case a:return new o(+e);case b:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case y:case C:case w:case B:case E:case x:case A:case F:case k:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(H(e),!0):H(e);return V(r,z,new e.constructor)}(e,r,n);case c:case v:return new o(e);case p:return function(e){var t=new e.constructor(e.source,O.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var r=t?n(K(e),!0):K(e);return V(r,W,new e.constructor)}(e,r,n);case g:return u=e,xe?Object(xe.call(u)):{}}var u}(e,T,Re,t)}}S||(S=new Oe);var _=S.get(e);if(_)return _;if(S.set(e,j),!R)var M=n?function(e){return function(e,t,n){var r=t(e);return Ue(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ze,Ie)}(e):Ze(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(M||e,(function(o,i){M&&(o=e[i=o]),je(j,i,Re(o,t,n,r,i,e,S))})),j}function Te(e){return!(!Ye(e)||(t=e,J&&J in t))&&(Xe(e)||q(e)?ne:S).test(qe(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function _e(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],u=r?r(n[a],e[a],a,n,e):void 0;je(n,a,void 0===u?e[a]:u)}return n}function Me(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Te(n)?n:void 0}Ae.prototype.clear=function(){this.__data__=De?De(null):{}},Ae.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ae.prototype.get=function(e){var t=this.__data__;if(De){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ae.prototype.has=function(e){var t=this.__data__;return De?void 0!==t[e]:ee.call(t,e)},Ae.prototype.set=function(e,t){return this.__data__[e]=De&&void 0===t?n:t,this},Fe.prototype.clear=function(){this.__data__=[]},Fe.prototype.delete=function(e){var t=this.__data__,n=Pe(t,e);return!(n<0)&&(n==t.length-1?t.pop():le.call(t,n,1),!0)},Fe.prototype.get=function(e){var t=this.__data__,n=Pe(t,e);return n<0?void 0:t[n][1]},Fe.prototype.has=function(e){return Pe(this.__data__,e)>-1},Fe.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ke.prototype.clear=function(){this.__data__={hash:new Ae,map:new(he||Fe),string:new Ae}},ke.prototype.delete=function(e){return Me(this,e).delete(e)},ke.prototype.get=function(e){return Me(this,e).get(e)},ke.prototype.has=function(e){return Me(this,e).has(e)},ke.prototype.set=function(e,t){return Me(this,e).set(e,t),this},Oe.prototype.clear=function(){this.__data__=new Fe},Oe.prototype.delete=function(e){return this.__data__.delete(e)},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Fe){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this;n=this.__data__=new ke(r)}return n.set(e,t),this};var Ie=ce?U(ce,Object):function(){return[]},ze=function(e){return te.call(e)};function We(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function Ve(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function qe(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function He(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=b||he&&ze(new he)!=l||ve&&ze(ve.resolve())!=f||ge&&ze(new ge)!=h||me&&ze(new me)!=m)&&(ze=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?qe(n):void 0;if(r)switch(r){case be:return b;case ye:return l;case Ce:return f;case we:return h;case Be:return m}return t});var Ue=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Xe(e)}var $e=de||function(){return!1};function Xe(e){var t=Ye(e)?te.call(e):"";return t==u||t==s}function Ye(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ke(e)?Se(e):function(e){if(!Ve(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 Re(e,!0,!0)}}(ug,ag);var sg=ag;function lg(e,t={}){const{blockId:n,focus:r}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let o=null;if(n&&(o=e.children[n],!o))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(o=k(e,{at:t.at}),!o))throw new Error(`Block in path ${t.at} not found`);if(!o)throw new Error("Block not found");e.children=sh(e.children);Object.values(e.children).forEach((e=>{e.meta.order>o.meta.order&&(e.meta.order+=1)}));const i=(a=o,"function"==typeof window.structuredClone?window.structuredClone(a):sg(a));var a;const u=bh(e);i.id=U(),i.meta.order=o.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=u;const s=i.id;e.children=lh(e.children),e.applyChanges(),r&&e.focusBlock(s,{waitExecution:!0})}function cg(e,t){Es.blur(t),Es.deselect(t),Gi.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const dg=()=>{const e={children:{},selection:null,selectedBlocks:null,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=sh(e.children);const{at:r=null,focus:o=!1,slate:i=null}=n,a=k(e),u=r,s={id:U(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let l=!1;if(i&&i.selection){const e=ui.string(i,i.selection.anchor.path);l=ui.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(u){const[t]=u;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),s.meta.order=t}else{const t=Object.keys(e.children).length;s.meta.order=t}const c=bh(e);e.blockEditorsMap[s.id]=c,l&&a&&(s.meta.order=a.meta.order,a.meta.order+=1),e.children[s.id]=s;const d=null==a?void 0:a.id;e.children=lh(e.children),e.applyChanges(),o&&e.focusBlock(l&&d?d:s.id)}(e,...t),deleteBlock:(...t)=>function(e,t={}){const{at:n=e.selection,deleteAll:r=!1,fromPaths:o,focus:i}=t;if(console.log("BEFORE options.focusAt",t.focusAt),Array.isArray(o)&&o.length>0)return e.children=sh(e.children),o.forEach((t=>{const n=k(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])})),Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=lh(e.children),void e.applyChanges();if(r||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=K(U()),n=bh(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}),void e.applyChanges()}if(!n)return;e.children=sh(e.children);const[a]=n,u=Object.keys(e.children),s=u.find((t=>e.children[t].meta.order===a));if(u.forEach((t=>{const n=e.children[t];n.meta.order>a&&(n.meta.order-=1)})),s&&(delete e.children[s],delete e.blockEditorsMap[s]),e.children=lh(e.children),e.applyChanges(),i){const n=e.selection?e.selection[0]-1:0,r=k(e,{at:[n]});console.log("AFTER options.focusAt",t.focusAt),r&&e.focusBlock(r.id,{focusAt:t.focusAt})}}(e,...t),duplicateBlock:(...t)=>lg(e,...t),toggleBlock:(...t)=>gh(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=sh(e.children);const r=k(e);r&&(r.meta.depth=r.meta.depth+1,e.children=lh(e.children),e.applyChanges())}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=sh(e.children);const r=k(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=lh(e.children),e.applyChanges())}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=sh(e.children);const[r]=n,o=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===r)),a=o.meta.order<i.meta.order,u=o.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>o.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:u&&e.meta.order<o.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),o.meta.order=r,e.children=lh(e.children),e.applyChanges()}(e,...t),focusBlock:(...t)=>og(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>vh(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:r=!0}=t,o=k(e);n&&n.selection&&o&&ui.withoutNormalizing(n,(()=>{e.children=sh(e.children);const t=Io.parent(n.selection.anchor.path);Gi.splitNodes(n,{at:n.selection,match:e=>Jo.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=n.children.slice()[i];Gi.removeNodes(n,{at:[i],match:e=>Jo.isElement(e),mode:"highest"});const u={id:U(),type:o.type,meta:{order:o.meta.order+1,depth:o.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=u.meta.order&&(e.meta.order+=1)}));const s=bh(e);e.blockEditorsMap[u.id]=s,e.children[u.id]=u,e.children=lh(e.children),e.applyChanges(),r&&e.focusBlock(u.id,{slate:s})}))}(e,...t),setSelection:(...t)=>function(e,t){e.selection=t,e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:r=!1,allSelected:o=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(r)e.selectedBlocks=t;else if(o){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=ig(t)}else e.selectedBlocks=ig(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const r=null!==(n=t.slate)&&void 0!==n?n:On(e);if(!r)return;const{waitExecution:o,waitExecutionMs:i}=t;o?setTimeout((()=>cg(e,r)),i):(cg(e,r),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};function fg({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}xf('/*! 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: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-auto{bottom:auto}.left-0{left:0}.right-\\[10px\\]{right:10px}.right-auto{right:auto}.top-0{top:0}.top-\\[10px\\]{top:10px}.z-10{z-index:10}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[90\\]{z-index:90}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.mx-\\[2px\\]{margin-left:2px;margin-right:2px}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.mx-\\[6px\\]{margin-left:6px;margin-right:6px}.my-0{margin-bottom:0;margin-top:0}.my-\\[4px\\]{margin-bottom:4px;margin-top:4px}.my-\\[5px\\]{margin-bottom:5px;margin-top:5px}.mb-0{margin-bottom:0}.mb-0\\.5{margin-bottom:.125rem}.mb-\\[1px\\]{margin-bottom:1px}.ml-\\[2px\\]{margin-left:2px}.mr-0{margin-right:0}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-\\[2px\\]{margin-top:2px}.\\!block{display:block!important}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.h-4{height:1rem}.h-\\[1px\\]{height:1px}.h-\\[22px\\]{height:22px}.h-\\[25px\\]{height:25px}.h-\\[32px\\]{height:32px}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[300px\\]{max-height:300px}.max-h-\\[330px\\]{max-height:330px}.w-10{width:2.5rem}.w-4{width:1rem}.w-72{width:18rem}.w-\\[1px\\]{width:1px}.w-\\[22px\\]{width:22px}.w-\\[25px\\]{width:25px}.w-auto{width:auto}.w-full{width:100%}.min-w-\\[200px\\]{min-width:200px}.max-w-\\[250px\\]{max-width:250px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.border-\\[\\#e3e3e3\\]{--tw-border-opacity:1;border-color:rgb(227 227 227/var(--tw-border-opacity))}.bg-\\[\\#2383e224\\]{background-color:#2383e224}.bg-\\[\\#37352f14\\]{background-color:#37352f14}.bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-\\[\\#dbd8e0\\]{--tw-bg-opacity:1;background-color:rgb(219 216 224/var(--tw-bg-opacity))}.bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-0{padding:0}.p-\\[0_4px\\]{padding:0 4px}.p-\\[5px\\]{padding:5px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.px-\\[5px\\]{padding-left:5px;padding-right:5px}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.text-left{text-align:left}.font-serif{font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.italic{font-style:italic}.leading-\\[120\\%\\]{line-height:120%}.underline{text-decoration-line:underline}.opacity-100{opacity:1}.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)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.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)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}.yoopta-placeholder:after{color:#aaa;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.last\\:mb-0:last-child{margin-bottom:0}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:bg-\\[\\#f4f4f5\\]:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.aria-selected\\:bg-\\[\\#f0f0f0\\][aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(240 240 240/var(--tw-bg-opacity))}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}');export{$f as HOTKEYS,ng as UI,F as YooptaPlugin,dg as createYooptaEditor,fg as createYooptaMark,tg as default,k as findPluginBlockBySelectionPath,rg as findPluginBlockByType,On as findSlateBySelectionPath,U as generateId,R as useBlockData,M as useBlockSelected,T as useYooptaBlock,P as useYooptaEditor,N as useYooptaPlugin,_ as useYooptaPluginOptions};
12
+ var Zc=["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(","),Gc="undefined"==typeof Element,Jc=Gc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Qc=!Gc&&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},ed=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},td=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!ed(a,!1))if("SLOT"===a.tagName){var u=a.assignedElements(),s=e(u.length?u:a.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:a,candidates:s})}else{Jc.call(a,Zc)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),c=!ed(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&c){var d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},nd=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},rd=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))&&!nd(e)?0:e.tabIndex},od=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},id=function(e){return"INPUT"===e.tagName},ad=function(e){return function(e){return id(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Qc(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(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 o=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!o||o===e}(e)},ud=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},sd=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Jc.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Jc.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ud(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,u=Qc(e);if(a&&!a.shadowRoot&&!0===r(a))return ud(e);e=e.assignedSlot?e.assignedSlot:a||u===e.ownerDocument?a:u.host}e=i}if(function(e){var t,n,r,o,i=e&&Qc(e),a=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&a;){var s,l,c;u=!(null===(l=a=null===(s=i=Qc(a))||void 0===s?void 0:s.host)||void 0===l||null===(c=l.ownerDocument)||void 0===c||!c.contains(a))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ld=function(e,t){return!(t.disabled||ed(t)||function(e){return id(e)&&"hidden"===e.type}(t)||sd(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 r=t.children.item(n);if("LEGEND"===r.tagName)return!!Jc.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},cd=function(e,t){return!(ad(t)||rd(t)<0||!ld(e,t))},dd=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},fd=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,u=function(e,t){var n=rd(e);return n<0&&t&&!nd(e)?0:n}(a,i),s=i?e(t.candidates):a;0===u?i?n.push.apply(n,s):n.push(a):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:s})})),r.sort(od).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},pd=function(e,t){var n;return n=(t=t||{}).getShadowRoot?td([e],t.includeContainer,{filter:cd.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dd}):function(e,t,n){if(ed(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Zc));return t&&Jc.call(e,Zc)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,cd.bind(null,t)),fd(n)};const hd=r["useInsertionEffect".toString()]||(e=>e());var vd="undefined"!=typeof document?s:l;function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gd.apply(this,arguments)}let md=!1,Dd=0;const bd=()=>"floating-ui-"+Dd++;const yd=r["useId".toString()]||function(){const[e,t]=r.useState((()=>md?bd():void 0));return vd((()=>{null==e&&t(bd())}),[]),r.useEffect((()=>{md||(md=!0)}),[]),e};const Cd=r.createContext(null),wd=r.createContext(null);function Bd(e){return"data-floating-ui-"+e}const Ed=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xd(e,t){const n=pd(e,Ed());"prev"===t&&n.reverse();const r=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}(function(e){return(null==e?void 0:e.ownerDocument)||document}(e)));return n.slice(r+1)[0]}function Ad(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!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&&Ul(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Fd(e){pd(e,Ed()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function kd(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 Od={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 Sd(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const jd=r.forwardRef((function(e,t){const[n,o]=r.useState();vd((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Sd),()=>{document.removeEventListener("keydown",Sd)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Bd("focus-guard")]:"",style:Od};return r.createElement("span",gd({},e,i))})),Pd=r.createContext(null),Rd=Bd("portal");function Td(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),a=yd(),u=Nd(),s=r.useRef(null);return vd((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{s.current=null}))}),[o]),vd((()=>{if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=a,n.setAttribute(Rd,""),e.appendChild(n),s.current=n,i(n)}),[t,a]),vd((()=>{if(s.current)return;let e=n||(null==u?void 0:u.portalNode);e&&!ql(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=a,o.setAttribute(Rd,""),e=r||e,e.appendChild(o),s.current=o,i(o)}),[t,n,a,u]),o}({id:n,root:o}),[u,s]=r.useState(null),l=r.useRef(null),c=r.useRef(null),d=r.useRef(null),f=r.useRef(null),p=!!u&&!u.modal&&u.open&&i&&!(!o&&!a);return r.useEffect((()=>{if(a&&i&&(null==u||!u.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&&Ad(e)){("focusin"===e.type?kd:Fd)(a)}}}),[a,i,null==u?void 0:u.modal]),r.createElement(Pd.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:a,setFocusManagerState:s})),[i,a])},p&&a&&r.createElement(jd,{"data-type":"outside",ref:l,onFocus:e=>{if(Ad(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=xd(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),p&&a&&r.createElement("span",{"aria-owns":a.id,style:Od}),a&&A(t,a),p&&a&&r.createElement(jd,{"data-type":"outside",ref:c,onFocus:e=>{if(Ad(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=xd(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent))}}}))}const Nd=()=>r.useContext(Pd),_d=new Set,Md=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=yd();return vd((()=>{if(!n)return;_d.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,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,u=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,l;const e=(null==(s=window.visualViewport)?void 0:s.offsetLeft)||0,n=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(u-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{_d.delete(i),0===_d.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,u)))}}),[i,n]),r.createElement("div",gd({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Ld(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[a,u]=r.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||a,l=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:u}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Kc(p,o)||h(o);const[v,g]=r.useState(null),[m,D]=r.useState(null),b=r.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),y=r.useCallback((e=>{e!==x.current&&(x.current=e,D(e))}),[]),C=a||v,w=u||m,E=r.useRef(null),x=r.useRef(null),A=r.useRef(d),F=null!=l,k=Yc(l),O=Yc(i),S=r.useCallback((()=>{if(!E.current||!x.current)return;const e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Hc(E.current,x.current,e).then((e=>{const t={...e,isPositioned:!0};j.current&&!Kc(A.current,t)&&(A.current=t,B.flushSync((()=>{f(t)})))}))}),[p,t,n,O]);Uc((()=>{!1===c&&A.current.isPositioned&&(A.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[c]);const j=r.useRef(!1);Uc((()=>(j.current=!0,()=>{j.current=!1})),[]),Uc((()=>{if(C&&(E.current=C),w&&(x.current=w),C&&w){if(k.current)return k.current(C,w,S);S()}}),[C,w,S,k,F]);const P=r.useMemo((()=>({reference:E,floating:x,setReference:b,setFloating:y})),[b,y]),R=r.useMemo((()=>({reference:C,floating:w})),[C,w]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=Xc(R.floating,d.x),r=Xc(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...$c(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,R.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:S,refs:P,elements:R,floatingStyles:T})),[d,S,P,R,T])}(e),c=r.useContext(wd),d=null!=((null==(f=r.useContext(Cd))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return hd((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(v.current.openEvent=t),g.emit("openchange",{open:e,event:t,reason:n,nested:d}),null==o||o(e,t,n)})),h=r.useRef(null),v=r.useRef({}),g=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],m=yd(),D=r.useCallback((e=>{const t=ql(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),b=r.useCallback((e=>{(ql(e)||null===e)&&(h.current=e,u(e)),(ql(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!ql(e))&&l.refs.setReference(e)}),[l.refs]),y=r.useMemo((()=>({...l.refs,setReference:b,setPositionReference:D,domReference:h})),[l.refs,b,D]),C=r.useMemo((()=>({...l.elements,domReference:s})),[l.elements,s]),w=r.useMemo((()=>({...l,refs:y,elements:C,dataRef:v,nodeId:i,floatingId:m,events:g,open:n,onOpenChange:p})),[l,i,m,g,n,p,y,C]);return vd((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===i));e&&(e.context=w)})),r.useMemo((()=>({...l,context:w,refs:y,elements:C})),[l,y,C,w])}var Id;function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zd.apply(this,arguments)}var Wd=function(e){return r.createElement("svg",zd({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Id||(Id=r.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 Vd(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var qd=["color"],Hd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,qd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Ud=["color"],Kd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Ud);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),$d=["color"],Xd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,$d);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Yd=["color"],Zd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Yd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Gd=["color"],Jd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Gd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Qd=["color"],ef=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,Qd);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.10505 12C4.70805 12 4.4236 11.912 4.25171 11.736C4.0839 11.5559 4 11.2715 4 10.8827V4.11733C4 3.72033 4.08595 3.43588 4.25784 3.26398C4.43383 3.08799 4.71623 3 5.10505 3C6.42741 3 8.25591 3 9.02852 3C10.1373 3 11.0539 3.98153 11.0539 5.1846C11.0539 6.08501 10.6037 6.81855 9.70327 7.23602C10.8657 7.44851 11.5176 8.62787 11.5176 9.48128C11.5176 10.5125 10.9902 12 9.27734 12C8.77742 12 6.42626 12 5.10505 12ZM8.37891 8.00341H5.8V10.631H8.37891C8.9 10.631 9.6296 10.1211 9.6296 9.29877C9.6296 8.47643 8.9 8.00341 8.37891 8.00341ZM5.8 4.36903V6.69577H8.17969C8.53906 6.69577 9.27734 6.35939 9.27734 5.50002C9.27734 4.64064 8.48047 4.36903 8.17969 4.36903H5.8Z",fill:r}))})),tf=["color"],nf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,tf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.67494 3.50017C5.67494 3.25164 5.87641 3.05017 6.12494 3.05017H10.6249C10.8735 3.05017 11.0749 3.25164 11.0749 3.50017C11.0749 3.7487 10.8735 3.95017 10.6249 3.95017H9.00587L7.2309 11.05H8.87493C9.12345 11.05 9.32493 11.2515 9.32493 11.5C9.32493 11.7486 9.12345 11.95 8.87493 11.95H4.37493C4.1264 11.95 3.92493 11.7486 3.92493 11.5C3.92493 11.2515 4.1264 11.05 4.37493 11.05H5.99397L7.76894 3.95017H6.12494C5.87641 3.95017 5.67494 3.7487 5.67494 3.50017Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),rf=["color"],of=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,rf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),af=["color"],uf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,af);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.00003 3.25C5.00003 2.97386 4.77617 2.75 4.50003 2.75C4.22389 2.75 4.00003 2.97386 4.00003 3.25V7.10003H2.49998C2.27906 7.10003 2.09998 7.27912 2.09998 7.50003C2.09998 7.72094 2.27906 7.90003 2.49998 7.90003H4.00003V8.55C4.00003 10.483 5.56703 12.05 7.50003 12.05C9.43303 12.05 11 10.483 11 8.55V7.90003H12.5C12.7209 7.90003 12.9 7.72094 12.9 7.50003C12.9 7.27912 12.7209 7.10003 12.5 7.10003H11V3.25C11 2.97386 10.7762 2.75 10.5 2.75C10.2239 2.75 10 2.97386 10 3.25V7.10003H5.00003V3.25ZM5.00003 7.90003V8.55C5.00003 9.93071 6.11932 11.05 7.50003 11.05C8.88074 11.05 10 9.93071 10 8.55V7.90003H5.00003Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),sf=["color"],lf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,sf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M3.94993 2.95002L3.94993 4.49998C3.94993 4.74851 3.74845 4.94998 3.49993 4.94998C3.2514 4.94998 3.04993 4.74851 3.04993 4.49998V2.50004C3.04993 2.45246 3.05731 2.40661 3.07099 2.36357C3.12878 2.18175 3.29897 2.05002 3.49993 2.05002H11.4999C11.6553 2.05002 11.7922 2.12872 11.8731 2.24842C11.9216 2.32024 11.9499 2.40682 11.9499 2.50002L11.9499 2.50004V4.49998C11.9499 4.74851 11.7485 4.94998 11.4999 4.94998C11.2514 4.94998 11.0499 4.74851 11.0499 4.49998V2.95002H8.04993V12.05H9.25428C9.50281 12.05 9.70428 12.2515 9.70428 12.5C9.70428 12.7486 9.50281 12.95 9.25428 12.95H5.75428C5.50575 12.95 5.30428 12.7486 5.30428 12.5C5.30428 12.2515 5.50575 12.05 5.75428 12.05H6.94993V2.95002H3.94993Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),cf=["color"],df=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,cf);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),ff=["color"],pf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Vd(e,ff);return m("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m("path",{d:"M5.00001 2.75C5.00001 2.47386 4.77615 2.25 4.50001 2.25C4.22387 2.25 4.00001 2.47386 4.00001 2.75V8.05C4.00001 9.983 5.56702 11.55 7.50001 11.55C9.43301 11.55 11 9.983 11 8.05V2.75C11 2.47386 10.7762 2.25 10.5 2.25C10.2239 2.25 10 2.47386 10 2.75V8.05C10 9.43071 8.88072 10.55 7.50001 10.55C6.1193 10.55 5.00001 9.43071 5.00001 8.05V2.75ZM3.49998 13.1001C3.27906 13.1001 3.09998 13.2791 3.09998 13.5001C3.09998 13.721 3.27906 13.9001 3.49998 13.9001H11.5C11.7209 13.9001 11.9 13.721 11.9 13.5001C11.9 13.2791 11.7209 13.1001 11.5 13.1001H3.49998Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),hf=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));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()}},vf={"text/plain":"Text","text/html":"Url",default:"Text"};var gf=function(e,t){var n,r,o,i,a,u,s=!1;t||(t={}),n=t.debug||!1;try{if(o=hf(),i=document.createRange(),a=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=vf[t.format]||vf.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),i.selectNodeContents(u),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");s=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),s=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=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(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),u&&document.body.removeChild(u),o()}return s};function mf(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function Df(e){if(!e)return;const t=mf(e);return t?e[t]:void 0}const bf=({actions:n,editor:r,onMouseEnter:o,selectedAction:i,onClose:a,empty:u,mode:s="create"})=>{const l="toggle"===s,c=l?n.filter((e=>function(e){var t;if(!e)return!1;const n=Df(e.elements);return"void"!==(null===(t=null==n?void 0:n.props)||void 0===t?void 0:t.nodeType)}(r.blocks[e]))):n;return e("div",Object.assign({className:"bg-white z-50 h-auto max-h-[330px] max-w-[250px] w-72 overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 transition-all shadow-md"},{children:e("div",Object.assign({className:"max-h-[300px] overflow-y-auto overflow-x-hidden"},{children:t("div",Object.assign({"data-action-menu-list":!0,className:"overflow-hidden p-0 text-foreground"},{children:[u&&e("div",Object.assign({className:"text-left text-muted-foreground text-xs px-1 py-1"},{children:"No actions available"})),c.map(((n,u)=>{var s;const c=r.blocks[n];return c?t("button",Object.assign({onMouseEnter:o,"aria-selected":n===i,"data-action-menu-item":!0,"data-action-menu-item-type":n,onClick:()=>{l?r.toggleBlock(n,{focus:!0}):r.blocks[n].create({deleteText:!0,focus:!0}),a()},className:"flex w-full cursor-pointer items-center space-x-2 rounded-md px-1 py-1 mb-0.5 last:mb-0 text-left text-sm hover:bg-[#f4f4f5] aria-selected:bg-[#f0f0f0]"},{children:[e("div",Object.assign({className:"flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-white"},{children:e(lf,{})})),t("div",{children:[e("div",Object.assign({className:"font-medium"},{children:(null===(s=c.options)||void 0===s?void 0:s.displayLabel)||c.type})),e("div",Object.assign({className:"text-xs text-muted-foreground"},{children:"Description"}))]})]}),n):null}))]}))}))}))},yf=({children:t})=>e("div",Object.assign({className:"flex flex-col"},{children:t})),Cf=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"bg-[#FFF] relative min-w-[200px] w-auto overflow-hidden rounded-md border bg-popover py-[6px] px-0 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"},{children:t})),wf=({children:t})=>e("div",Object.assign({className:"relative flex cursor-default select-none items-center text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"},{children:t})),Bf=({isOpen:n,onClose:r,refs:o,floatingStyles:i,children:a})=>{var u;const s=P(),[l,c]=f(!1),{refs:d,floatingStyles:p}=Ld({placement:"right",open:l,onOpenChange:c,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc});if(!n)return null;const h=k(s,{at:s.selection}),v=Df(s.blocks[(null==h?void 0:h.type)||""].elements),g="void"===(null===(u=null==v?void 0:v.props)||void 0===u?void 0:u.nodeType);return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(Cf,{children:[t(yf,{children:[e(wf,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),r()}},{children:[e(df,{className:"w-4 h-4 mr-2"}),"Delete"]}))}),e(wf,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),r()}},{children:[e(Zd,{className:"w-4 h-4 mr-2"}),"Duplicate"]}))}),!g&&t(wf,{children:[l&&e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>c(!1)},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(bf,{actions:Object.keys(s.blocks),editor:s,selectedAction:"",onClose:()=>c(!1),empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",ref:d.setReference,onClick:()=>c((e=>!e))},{children:[e(Wd,{className:"w-4 h-4 mr-2"}),"Turn into"]}))]}),e(wf,{children:t("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=k(s);e&&gf(`${window.location.origin}${window.location.pathname}#${e.id}`),r()}},{children:[e(of,{className:"w-4 h-4 mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var Ef=Object.freeze({__proto__:null,BlockOptions:Bf,BlockOptionsMenuContent:Cf,BlockOptionsMenuGroup:yf,BlockOptionsMenuItem:wf,BlockOptionsSeparator:({className:t})=>e("div",{className:`h-[1px] bg-[#37352f14] my-[4px] w-full ${t}`})});function xf(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Af={actions:"vuZgncnq",hovered:"_8Eqjiv7m",actionButton:"WabGEp54",plusButton:"_0C8RpLmz"};function Ff(...e){return e.filter(Boolean).join(" ")}xf(".vuZgncnq{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition:opacity .18s ease-in}._8Eqjiv7m{opacity:1}.WabGEp54{all:unset;align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;color:rgba(55,53,47,.35);cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition:background-color .18s cubic-bezier(.4,0,.2,1);width:auto;width:18px}.WabGEp54:active,.WabGEp54:focus,.WabGEp54:hover{background-color:rgba(55,54,47,.08)}._0C8RpLmz{width:24px}");const kf=({block:n,editor:r,dragHandleProps:o,showActions:i,onChangeActiveBlock:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c}=Ld({placement:"right-start",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec()]}),{setActivatorNodeRef:d,attributes:p,listeners:h}=o;return t("div",Object.assign({contentEditable:!1,className:Ff(Af.actions,i&&Af.hovered,"yoopta-element-actions")},{children:[e("button",Object.assign({type:"button",onClick:()=>{const e=K(U()),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0})},className:Ff(Af.actionButton,Af.plusButton,"yoopta-element-actions-plus")},{children:e(kn,{})})),e("button",Object.assign({type:"button",className:Ff(Af.actionButton,"yoopta-element-actions-drag"),ref:e=>{d(e),l.setReference(e)}},p,h,{onClick:e=>{e.stopPropagation(),a(n.id),console.log("editor.children",r.children);const t=On(r,{at:[n.meta.order]});console.log("block",n),console.log("slate",t),r.focusBlock(n.id),t&&setTimeout((()=>{Es.blur(t),Es.deselect(t),Gi.deselect(t),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),s(!0)}),10)}},{children:e(An,{})})),e(Bf,{isOpen:u,refs:l,floatingStyles:c,onClose:()=>s(!1)})]}))},Of=({children:n,block:r,blockId:o})=>{var i;const a=P(),[u,s]=f(null),{attributes:l,listeners:c,setNodeRef:d,setActivatorNodeRef:p,transform:h,transition:v,active:g,over:m,isOver:D,isDragging:b}=Dn({id:o}),y={transform:he.Translate.toString(h),transition:v,opacity:b?.7:1,marginLeft:20*r.meta.depth+"px"},C=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=u===o,B=e=>s(e);return t("div",Object.assign({className:"relative py-0 px-[2px] mt-[2px] mb-[1px] rounded yoopta-block-wrapper",onMouseEnter:()=>B(o),onMouseLeave:()=>s(null),"data-yoopta-block-id":o,style:y,"data-yoopta-block":!0,ref:d},{children:[e(kf,{block:r,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:l,listeners:c},showActions:w,onChangeActiveBlock:B}),e("div",Object.assign({className:Af.content,style:{borderBottom:D&&!b?"2px solid #007aff":"none"}},{children:n})),C&&e("div",{className:"absolute left-0 top-0 bg-[#2383e224] z-[90] rounded opacity-100 h-full w-full pointer-events-none yoopta-selection-block"})]}))};function Sf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var jf={};Object.defineProperty(jf,"__esModule",{value:!0});for(var Pf="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Rf={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Tf={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Pf?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Nf={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},_f=1;_f<20;_f++)Nf["f"+_f]=111+_f;function Mf(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Lf(e,t)})),o=function(e){return r.some((function(t){return If(t,e)}))};return null==n?o:o(n)}function Lf(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var a in Rf)r[Rf[a]]=!1;var u=!0,s=!1,l=void 0;try{for(var c,d=o[Symbol.iterator]();!(u=(c=d.next()).done);u=!0){var f=c.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Wf(f),v=Rf[h];if(f.length>1&&!v&&!Tf[f]&&!Nf[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&v||(n?r.key=h:r.which=zf(f)),v&&(r[v]=!p||null)}}catch(e){s=!0,l=e}finally{try{!u&&d.return&&d.return()}finally{if(s)throw l}}return r}function If(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function zf(e){return e=Wf(e),Nf[e]||e.toUpperCase().charCodeAt(0)}function Wf(e){return e=e.toLowerCase(),e=Tf[e]||e}jf.default=Mf,jf.isHotkey=Mf,jf.isCodeHotkey=function(e,t){return Mf(e,t)};var Vf=jf.isKeyHotkey=function(e,t){return Mf(e,{byKey:!0},t)};jf.parseHotkey=Lf,jf.compareHotkey=If,jf.toKeyCode=zf,jf.toKeyName=Wf;const qf={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"},Hf={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"},Uf={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Kf=e=>{const t=qf[e],n=Hf[e],r=Uf[e],o=t&&Vf(t),i=n&&Vf(n),a=r&&Vf(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!a||!a(e)))},$f={isBold:Kf("bold"),isCompose:Kf("compose"),isArrowLeft:Kf("arrowLeft"),isArrowRight:Kf("arrowRight"),isArrowUp:Kf("arrowUp"),isArrowDown:Kf("arrowDown"),isDeleteBackward:Kf("deleteBackward"),isDeleteForward:Kf("deleteForward"),isDeleteLineBackward:Kf("deleteLineBackward"),isDeleteLineForward:Kf("deleteLineForward"),isDeleteWordBackward:Kf("deleteWordBackward"),isDeleteWordForward:Kf("deleteWordForward"),isExtendBackward:Kf("extendBackward"),isExtendForward:Kf("extendForward"),isExtendLineBackward:Kf("extendLineBackward"),isExtendLineForward:Kf("extendLineForward"),isItalic:Kf("italic"),isMoveLineBackward:Kf("moveLineBackward"),isMoveLineForward:Kf("moveLineForward"),isCtrlLeft:Kf("ctrlLeft"),isCtrlRight:Kf("ctrlRight"),isRedo:Kf("redo"),isShiftEnter:Kf("shiftEnter"),isEnter:Kf("enter"),isTransposeCharacter:Kf("transposeCharacter"),isUndo:Kf("undo"),isSpace:Kf("space"),isSelect:Kf("select"),isTab:Kf("tab"),isShiftTab:Kf("shiftTab"),isBackspace:Kf("backspace"),isCmdEnter:Kf("cmdEnter"),isCmd:Kf("cmd"),isEscape:Kf("escape"),isSlashCommand:Kf("slashCommand"),isShiftArrowUp:Kf("shiftArrowUp"),isShiftArrowDown:Kf("shiftArrowDown"),isKekceburek:Kf("kekCeburek")};const Xf={onKeyDown:function(e){return t=>{const n=On(e,{at:e.selection});if(!n||!n.selection)return;const r=Io.parent(n.selection.anchor.path);if($f.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if($f.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const o=ui.isStart(n,n.selection.anchor,r),i=ui.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const a=K(U()),u=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:u,slate:n,focus:!0})}else if($f.isBackspace(t)){if(t.isDefaultPrevented())return;const r=Io.parent(n.selection.anchor.path);if(ui.isStart(n,n.selection.anchor,r)){t.preventDefault();const o=ui.string(n,r),i=e.selection?e.selection[0]-1:0,a=On(e,{at:[i]});let u;if(a&&(u=function(e,t){const[,n]=ui.last(e,t);return{path:n,offset:ui.string(e,n).length}}(a,r)),0===o.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:u});{if(Zo.isExpanded(n.selection))return Gi.delete(n,{at:n.selection});if(!a)return;if(0===ui.string(a,[0,0]).length)return e.deleteBlock({at:[i],focus:!0,focusAt:u});const t=Array.from(ui.nodes(n,{at:[0],match:e=>!ui.isEditor(e)&&(bi.isText(e)||ui.isInline(n,e)),mode:"highest"})),r=t.map((([e])=>e));return Gi.insertNodes(a,r,{at:ui.end(a,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:u})}}}else{if($f.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=ui.first(n,[0]),[,o]=ui.last(n,[n.children.length-1]),i=ui.range(n,r,o),a=Zo.equals(n.selection,i);if(Zo.isExpanded(n.selection)&&a)return t.preventDefault(),Es.blur(n),Es.deselect(n),Gi.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if($f.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if($f.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if($f.isArrowUp(t)){if(t.isDefaultPrevented())return;const r=Io.parent(n.selection.anchor.path),o=ui.isStart(n,n.selection.anchor,r);if(console.log("isStart",o),console.log("parentPath",r),console.log("slate.children",n.children),o){const n=e.selection?[e.selection[0]-1]:null,r=On(e,{at:n}),o=k(e,{at:n});if(r&&o){const[,n]=ui.last(r,[0]),i={path:n,offset:ui.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1})}}}if($f.isArrowDown(t)){const r=Io.parent(n.selection.anchor.path);if(ui.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=On(e,{at:n}),i=k(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=ui.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(Zo.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Vf(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}};function Yf(e){try{return new URL(e),!0}catch(e){return!1}}const Zf=(e,t)=>{(e=>{const[t]=ui.nodes(e,{match:e=>!ui.isEditor(e)&&Jo.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{Gi.unwrapNodes(e,{match:e=>!ui.isEditor(e)&&Jo.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&Zo.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};r?Gi.insertNodes(e,o):(Gi.wrapNodes(e,o,{split:!0}),Gi.collapse(e,{edge:"end"}))},Gf=i(void 0),Jf=({children:t})=>{const[n,r]=f({}),o=d(((e,t)=>{r((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[n]),i=d((e=>{r((t=>{const n=Object.assign({},t);return delete n[e],n}))}),[n]),a=c((()=>({tools:n,registerTool:o,unregisterTool:i})),[n]);return e(Gf.Provider,Object.assign({value:a},{children:t}))},Qf=()=>{const e=a(Gf);if(void 0===e)throw new Error("useTools must be used within a ToolsProvider");return e},ep=({children:t,attributes:n,placeholder:r})=>{const o=a(ol),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))},tp=({id:t,customEditor:r,elements:o,marks:i,events:a,options:s,placeholder:l="Type '/' for commands"})=>{const d=P(),f=R(t),p=u(f.value).current,h=f.type,{tools:v}=Qf(),g=c((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=c((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(i)),[i]),D=c((()=>{let e=d.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,u="inlineVoid"===r;u&&(e.markableVoid=e=>e.type===t),(a||u)&&(e.isVoid=e=>e.type===t),(i||u)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n,isInline:r,isElementReadOnly:o,isSelectable:i}=e;return e.isInline=e=>["link","mention"].includes(e.type)||r(e),e.insertText=t=>{t&&Yf(t)?Zf(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Yf(r)?Zf(e,r):t(n)},e})(e))})),e}),[]),b=c((()=>{if(!a)return{};const e={hotkeys:$f,currentBlock:f,defaultBlock:K()},t={};return Object.keys(a).forEach((n=>{t[n]=function(t){if(a[n]){a[n](d,D,e)(t)}}})),t}),[a,d]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":h},{children:e(np,{id:t,slate:D,initialValue:p,onChange:e=>d.updateBlock(t,{value:e}),decorate:e=>{var t;const n=[],[r,o]=e,i=(null===(t=d.selection)||void 0===t?void 0:t[0])===f.meta.order;return D.selection&&i&&!ui.isEditor(r)&&""===ui.string(D,[o[0]])&&Zo.includes(D.selection,o)&&Zo.isCollapsed(D.selection)&&n.push(Object.assign(Object.assign({},D.selection),{withPlaceholder:!0})),n},renderLeaf:t=>{var n,r,o,i,a;let{children:u,leaf:s,attributes:c}=t;const p=Sf(s,["text"]),h=(null===(n=d.selection)||void 0===n?void 0:n[0])===f.meta.order;p&&Object.keys(p).forEach((e=>{const t=m[e];t&&(u=t.render({children:u,leaf:s}))}));const v=!("void"===(null===(a=null===(i=null===(o=null===(r=t.children)||void 0===r?void 0:r.props)||void 0===o?void 0:o.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&h&&s.withPlaceholder;return e(ep,Object.assign({attributes:c,placeholder:v?l:void 0},{children:u}))},renderElement:r=>{const o=g[r.element.type];return o?e(o,Object.assign({},r,{blockId:t,options:s})):e(n,{})},eventHandlers:b,onKeyDown:e=>{var t;if(v.actionMenu){const t=v.actionMenu,{events:n}=t,r=Sf(t,["events"]);null==n||n.onKeyDown(d,D,r)(e)}null===(t=b.onKeyDown)||void 0===t||t.call(b,e),Xf.onKeyDown(d)(e)},onKeyUp:e=>{var t;if(v.actionMenu){const t=v.actionMenu,{events:n}=t,r=Sf(t,["events"]);null==n||n.onKeyUp(d,D,r)(e)}null===(t=null==b?void 0:b.onKeyUp)||void 0===t||t.call(b,e)},onFocus:e=>{var t;null===(t=null==b?void 0:b.onFocus)||void 0===t||t.call(b,e)},onMouseDown:e=>{var t,n;if((null===(t=d.selection)||void 0===t?void 0:t[0])!==f.meta.order&&d.setSelection([f.meta.order]),v.toolbar){const t=v.toolbar,{events:n}=t,r=Sf(t,["events"]);null==n||n.onMouseDown(d,D,r)(e)}null===(n=null==b?void 0:b.onMouseDown)||void 0===n||n.call(b,e)},onBlur:e=>{var t;e.preventDefault(),null===(t=null==b?void 0:b.onBlur)||void 0===t||t.call(b,e)},customEditor:r})}))},np=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:a,eventHandlers:u,onKeyDown:s,onKeyUp:l,onFocus:c,onMouseDown:d,onBlur:f,customEditor:p,decorate:h})=>"function"==typeof p?p({id:t,type:"",editor:n,attributes:{},children:[]}):e(Pl,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(wl,Object.assign({renderElement:a,renderLeaf:i,className:"focus-visible:outline-none focus:outline-none",spellCheck:!0},u,{onKeyDown:s,onKeyUp:l,onFocus:c,onMouseDown:d,decorate:h,onBlur:f}),`editable-${t}`)}),`slate-${t}`))),rp=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c((()=>[...t].filter((e=>null!=e))),[...t])}(Ae(mt,{activationConstraint:{delay:100,tolerance:0}}),Ae(ft,{coordinateGetter:Cn})),handleDragEnd:d((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:d((t=>{e.setBlockSelected(null)}),[])}),op=[],ip=({editor:t,marks:n})=>{const{sensors:r,handleDragEnd:o,handleDragStart:i}=rp({editor:t}),a=Object.keys(t.children),u=c((()=>0===a.length?op:a.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[a]),s=[];for(let r=0;r<u.length;r++){const o=u[r],i=t.children[o],a=t.plugins[i.type];i&&a?s.push(e(Of,Object.assign({block:i,blockId:o},{children:e(tp,{type:i.type,id:o,marks:n,events:a.events,elements:a.elements,options:a.options},o)}),o)):console.error(`Plugin ${i.type} not found`)}return e(Yt,Object.assign({sensors:r,collisionDetection:Te,onDragStart:i,onDragEnd:o},{children:e(dn,Object.assign({items:u,strategy:sn},{children:s}))}))},ap=({editor:e,yooptaEditorRef:t,root:n})=>{const[r,o]=f({origin:[0,0],coords:[0,0],selection:!1}),i=n=>{var i;const a=null===(i=t.current)||void 0===i?void 0:i.contains(n.target);if(!a&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),s();a||o({origin:[n.pageX,n.pageY-window.pageYOffset],coords:[n.pageX,n.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!r.selection)return;o((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const n=((e,t)=>{const n=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((r,o)=>{if(!r)return;const i=r.getBoundingClientRect(),a=Math.min(e[1],t[1]),u=Math.min(e[0],t[0]),s=Math.max(e[1],t[1]),l=Math.max(e[0],t[0]);a<i.bottom&&s>i.top&&u<i.right&&l>i.left&&n.push(o)})),n})(r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(n,{only:!0})},u=()=>{s()};l((()=>{var e;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===(e=t.current)||void 0===e?void 0:e.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",u),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",u)}}),[e.selectedBlocks,r,n]);const s=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:s})},up=({origin:t,coords:n,isOpen:r})=>{if(!r)return null;const o={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:o})},sp={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},lp=({marks:n,className:r,autoFocus:o=!0,selectionBoxRoot:i})=>{const a=P(),s=u(null),c=ap({editor:a,yooptaEditorRef:s,root:i});let d=u(sp).current;l((()=>{if(!o)return;const e=k(a,{at:[0]});e&&a.focusBlock(e.id)}),[o]),l((()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h))),[a.selectedBlocks]);const f=()=>{Array.isArray(a.selectedBlocks)&&a.selectedBlocks.length>0&&a.setBlockSelected(null)},p=()=>{d.indexToSelect=null,d.startedIndexToSelect=null,d.selectionStarted=!1},h=e=>{var t,n,r,o,i;if($f.isSelect(e)){if((null===(t=a.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(a.children).length)return void e.preventDefault();if(d.selectionStarted)return e.preventDefault(),void a.setBlockSelected([],{allSelected:!0})}if($f.isBackspace(e)){e.stopPropagation();if(Array.isArray(a.selectedBlocks)&&(null===(n=a.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(a.children).length)return e.preventDefault(),a.deleteBlock({deleteAll:!0}),a.setBlockSelected(null),void p();if(Array.isArray(a.selectedBlocks)&&(null===(r=a.selectedBlocks)||void 0===r?void 0:r.length)>0)return e.preventDefault(),a.deleteBlock({fromPaths:a.selectedBlocks}),a.setBlockSelected(null),void p()}if($f.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(d.selectionStarted&&null!==d.startedIndexToSelect&&null!==d.indexToSelect){const e=d.indexToSelect,t=e-1;if(0===e)return;if(e===d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if(t<d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if((null===(o=a.selectedBlocks)||void 0===o?void 0:o.includes(e))&&e!==d.startedIndexToSelect){const n=a.selectedBlocks.filter((t=>t!==e));return a.setBlockSelected(n,{only:!0}),void(d.indexToSelect=t)}return}const t=k(a),n=On(a);if(!n||!n.selection||!t)return;const r=Io.parent(n.selection.anchor.path),i=ui.isStart(n,n.selection.focus,r);if(Zo.isExpanded(n.selection)&&i){const r=a.selection?[a.selection[0]-1]:[0],o=k(a,{at:r});t&&o&&(e.preventDefault(),Es.blur(n),Es.deselect(n),Gi.deselect(n),a.setSelection(null),a.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)-1]),d.startedIndexToSelect=t.meta.order,d.indexToSelect=t.meta.order-1,d.selectionStarted=!0)}}if($f.isShiftArrowDown(e)){if(d.selectionStarted&&null!==d.indexToSelect&&null!==d.startedIndexToSelect){const e=d.indexToSelect,t=e+1;if(t===Object.keys(a.children).length)return;if(e===d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if(t>d.startedIndexToSelect)return a.setBlockSelected([t]),void(d.indexToSelect=t);if((null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==d.startedIndexToSelect){const n=a.selectedBlocks.filter((t=>t!==e));return a.setBlockSelected(n,{only:!0}),void(d.indexToSelect=t)}return}const t=k(a),n=On(a);if(!n||!n.selection||!t)return;const r=Io.parent(n.selection.anchor.path),o=ui.isEnd(n,n.selection.focus,r);if(Zo.isExpanded(n.selection)&&o){const r=a.selection?[a.selection[0]+1]:[0],o=k(a,{at:r});t&&o&&(e.preventDefault(),Es.blur(n),Es.deselect(n),Gi.deselect(n),a.setSelection(null),a.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),d.startedIndexToSelect=t.meta.order,d.indexToSelect=t.meta.order+1,d.selectionStarted=!0)}}},v=(g={userSelect:c.selection?"none":"auto",pointerEvents:c.selection?"none":"auto"},Object.assign({paddingBottom:150},g));var g;return t("div",Object.assign({id:"yoopta-editor",className:r,style:v,ref:s,onClick:e=>{p(),(e=>{var t;const n=s.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10);if(e.clientY>=o){const e=Object.keys(a.children).length-1,n=k(a,{at:[e]}),r=On(a,{at:[e]});if(n&&r&&r.selection){const e=ui.string(r,r.selection.anchor.path),o=Io.parent(r.selection.anchor.path),[i]=ui.node(r,o);if(Jo.isElement(i)&&"void"!==(null===(t=i.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void a.focusBlock(n.id,{slate:r})}const o=K(U()),i=e+1;a.insertBlock(o,{at:[i],focus:!0})}})(e),f()},onBlur:e=>{var t;(null===(t=s.current)||void 0===t?void 0:t.contains(e.relatedTarget))||(p(),f())}},{children:[e(ip,{editor:a,marks:n}),e(up,{origin:c.origin,coords:c.coords,isOpen:c.selection})]}))},cp=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return l((()=>r(!0)),[]),n?e:t};var dp={isHistory:e=>Or(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||ii.isOperationList(e.redos[0]))&&(0===e.undos.length||ii.isOperationList(e.undos[0]))},fp=new WeakMap,pp=new WeakMap,hp={isHistoryEditor:e=>dp.isHistory(e.history)&&ui.isEditor(e),isMerging:e=>pp.get(e),isSaving:e=>fp.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=hp.isMerging(e);pp.set(e,!1),t(),pp.set(e,n)},withoutSaving(e,t){var n=hp.isSaving(e);fp.set(e,!1),t(),fp.set(e,n)}},vp=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];hp.withoutSaving(t,(()=>{ui.withoutNormalizing(t,(()=>{for(var e of r)t.apply(e)}))})),e.redos.pop(),e.undos.push(r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];hp.withoutSaving(t,(()=>{ui.withoutNormalizing(t,(()=>{var e=r.map(ii.inverse).reverse();for(var n of e)t.apply(n)}))})),e.redos.push(r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,a=i[i.length-1],u=a&&a[a.length-1],s=Dp(e,u),l=hp.isSaving(t),c=hp.isMerging(t);if(null==l&&(l=mp(e)),l){if(null==c&&(c=null!=a&&(0!==r.length||(gp(e,u)||s))),a&&c)s&&a.pop(),a.push(e);else{var d=[e];i.push(d)}for(;i.length>100;)i.shift();bp(e)&&(o.redos=[])}n(e)},t},gp=(e,t)=>"set_selection"===e.type||(!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!Io.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!Io.equals(e.path,t.path))),mp=(e,t)=>"set_selection"!==e.type||null!=e.properties&&null!=e.newProperties,Dp=(e,t)=>!(!t||"set_selection"!==e.type||"set_selection"!==t.type),bp=e=>"set_selection"!==e.type,yp=Symbol.for("immer-nothing"),Cp=Symbol.for("immer-draftable"),wp=Symbol.for("immer-state");function Bp(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ep=Object.getPrototypeOf;function xp(e){return!!e&&!!e[wp]}function Ap(e){return!!e&&(kp(e)||Array.isArray(e)||!!e[Cp]||!!e.constructor?.[Cp]||Rp(e)||Tp(e))}var Fp=Object.prototype.constructor.toString();function kp(e){if(!e||"object"!=typeof e)return!1;const t=Ep(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)===Fp}function Op(e,t){0===Sp(e)?Object.entries(e).forEach((([n,r])=>{t(n,r,e)})):e.forEach(((n,r)=>t(r,n,e)))}function Sp(e){const t=e[wp];return t?t.type_:Array.isArray(e)?1:Rp(e)?2:Tp(e)?3:0}function jp(e,t){return 2===Sp(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Pp(e,t,n){const r=Sp(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Rp(e){return e instanceof Map}function Tp(e){return e instanceof Set}function Np(e){return e.copy_||e.base_}function _p(e,t){if(Rp(e))return new Map(e);if(Tp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&kp(e)){if(!Ep(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[wp];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Ep(e),n)}function Mp(e,t=!1){return Ip(e)||xp(e)||!Ap(e)||(Sp(e)>1&&(e.set=e.add=e.clear=e.delete=Lp),Object.freeze(e),t&&Op(e,((e,t)=>Mp(t,!0)))),e}function Lp(){Bp(2)}function Ip(e){return Object.isFrozen(e)}var zp,Wp={};function Vp(e){const t=Wp[e];return t||Bp(0),t}function qp(){return zp}function Hp(e,t){t&&(Vp("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Up(e){Kp(e),e.drafts_.forEach(Xp),e.drafts_=null}function Kp(e){e===zp&&(zp=e.parent_)}function $p(e){return zp={drafts_:[],parent_:zp,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xp(e){const t=e[wp];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Yp(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[wp].modified_&&(Up(t),Bp(4)),Ap(e)&&(e=Zp(t,e),t.parent_||Jp(t,e)),t.patches_&&Vp("Patches").generateReplacementPatches_(n[wp].base_,e,t.patches_,t.inversePatches_)):e=Zp(t,n,[]),Up(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yp?e:void 0}function Zp(e,t,n){if(Ip(t))return t;const r=t[wp];if(!r)return Op(t,((o,i)=>Gp(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Jp(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),Op(o,((o,a)=>Gp(e,r,t,o,a,n,i))),Jp(e,t,!1),n&&e.patches_&&Vp("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Gp(e,t,n,r,o,i,a){if(xp(o)){const a=Zp(e,o,i&&t&&3!==t.type_&&!jp(t.assigned_,r)?i.concat(r):void 0);if(Pp(n,r,a),!xp(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(Ap(o)&&!Ip(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Zp(e,o),t&&t.scope_.parent_||Jp(e,o)}}function Jp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Mp(t,n)}var Qp={get(e,t){if(t===wp)return e;const n=Np(e);if(!jp(n,t))return function(e,t,n){const r=nh(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Ap(r)?r:r===th(e.base_,t)?(oh(e),e.copy_[t]=ih(r,e)):r},has:(e,t)=>t in Np(e),ownKeys:e=>Reflect.ownKeys(Np(e)),set(e,t,n){const r=nh(Np(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=th(Np(e),t),o=r?.[wp];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||jp(e.base_,t)))return!0;oh(e),rh(e)}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!==th(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,oh(e),rh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Np(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Bp(11)},getPrototypeOf:e=>Ep(e.base_),setPrototypeOf(){Bp(12)}},eh={};function th(e,t){const n=e[wp];return(n?Np(n):e)[t]}function nh(e,t){if(!(t in e))return;let n=Ep(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Ep(n)}}function rh(e){e.modified_||(e.modified_=!0,e.parent_&&rh(e.parent_))}function oh(e){e.copy_||(e.copy_=_p(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Op(Qp,((e,t)=>{eh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),eh.deleteProperty=function(e,t){return eh.set.call(this,e,t,void 0)},eh.set=function(e,t,n){return Qp.set.call(this,e[0],t,n,e[0])};function ih(e,t){const n=Rp(e)?Vp("MapSet").proxyMap_(e,t):Tp(e)?Vp("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:qp(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Qp;n&&(o=[r],i=eh);const{revoke:a,proxy:u}=Proxy.revocable(o,i);return r.draft_=u,r.revoke_=a,u}(e,t);return(t?t.scope_:qp()).drafts_.push(n),n}function ah(e){if(!Ap(e)||Ip(e))return e;const t=e[wp];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_p(e,t.scope_.immer_.useStrictShallowCopy_)}else n=_p(e,!0);return Op(n,((e,t)=>{Pp(n,e,ah(t))})),t&&(t.finalized_=!1),n}var uh=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 r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&Bp(6),void 0!==n&&"function"!=typeof n&&Bp(7),Ap(e)){const o=$p(this),i=ih(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Up(o):Kp(o)}return Hp(o,n),Yp(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===yp&&(r=void 0),this.autoFreeze_&&Mp(r,!0),n){const t=[],o=[];Vp("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}Bp(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;const o=this.produce(e,t,((e,t)=>{n=e,r=t}));return[o,n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ap(e)||Bp(8),xp(e)&&(e=function(e){xp(e)||Bp(10);return ah(e)}(e));const t=$p(this),n=ih(e,void 0);return n[wp].isManual_=!0,Kp(t),n}finishDraft(e,t){const n=e&&e[wp];n&&n.isManual_||Bp(9);const{scope_:r}=n;return Hp(r,t),Yp(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Vp("Patches").applyPatches_;return xp(e)?r(e,t):this.produce(e,(e=>r(e,t)))}};uh.produce,uh.produceWithPatches.bind(uh),uh.setAutoFreeze.bind(uh),uh.setUseStrictShallowCopy.bind(uh),uh.applyPatches.bind(uh);var sh=uh.createDraft.bind(uh),lh=uh.finishDraft.bind(uh);function ch(e,t={nodeType:"block"}){return{id:U(),type:e,children:[{text:""}],props:t}}function dh(e,t){const n=[];return t.forEach((t=>{const r=e.elements[t];if(Array.isArray(r.children)&&r.children.length>0){const o=dh(e,r.children),i=ch(t,r.props);i.children=o,n.push(i)}else n.push(ch(t,r.props))})),n}function fh(e,t,n){e.children=sh(e.children);const r=k(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const o=On(e,{at:[null==r?void 0:r.meta.order]});if(!o||!o.selection)return;const i=e.blocks[t],a=Object.entries(i.elements),u=1===a.length?a[0]:a.find((e=>e[1].asRoot));if(console.log("rootElementFromBlock",u),!u)throw new Error(`No root element found in the block elements. Passed block: ${i}`);const[s,l]=u;let c=[];const d=Array.isArray(l.children)&&l.children.length>0,f=ch(s,l.props||{nodeType:"block"}),p=f.props.nodeType;d&&(c=dh(i,l.children));const h="void"===p,v="block"===p;if(Gi.setNodes(o,f,{at:[0,0],match:e=>Jo.isElement(e),mode:"highest"}),d){let e=[0,0];c.forEach((t=>{Jo.isElement(t)&&(Gi.insertNodes(o,t,{at:e,match:e=>Jo.isElement(e),mode:"lowest"}),e.push(0)),t.children&&t.children.forEach((t=>{Jo.isElement(t)&&(Gi.insertNodes(o,t,{at:e,match:e=>Jo.isElement(e),mode:"lowest"}),e.push(0))}))}))}(null==n?void 0:n.deleteText)&&Gi.delete(o,{at:d?[0,0,0]:[0,0]}),(v||h)&&(r.type=i.type),r.value=o.children;const g=r.id;e.children=lh(e.children),e.applyChanges(),(null==n?void 0:n.focus)&&e.focusBlock(g,{slate:o})}function ph(e,t){const n=On(e);if(!n)return!1;const r=ui.marks(n);return!!(null==r?void 0:r[t])}const hh=(e,t)=>{const{insertText:n}=t;return t.insertText=r=>{var o;const{selection:i}=t;if(" "===r&&i&&Zo.isCollapsed(i)){const{anchor:a}=i,u=ui.above(t,{match:e=>Jo.isElement(e)&&ui.isBlock(t,e),mode:"lowest"});if(!u)return;const[,s]=u,l=ui.parent(t,s),[c]=l;if(Jo.isElement(c)&&!bi.isText(c.children[0]))return n(r);const d=u?s:[],f={anchor:a,focus:ui.start(t,d)},p=ui.string(t,f),h=null===(o=e.shortcuts)||void 0===o?void 0:o[p];if(!!h&&!h.isActive())return Gi.select(t,f),Gi.delete(t),void h.create({deleteText:!1})}n(r)},t};function vh(e,t,n){e.children=sh(e.children);const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);n.meta&&(r.meta=n.meta),n.value&&(r.value=n.value),e.children=lh(e.children),e.emit("block:update",{id:t,data:n})}function gh(e,t,n){e.children=sh(e.children);const r=k(e,{at:e.selection});if(!r)throw new Error("Block from not found at current selection");const o=mf(e.blocks[r.type].elements);if(r.type===t)return void(e.children=lh(e.children));const i=On(e,{at:[r.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${r.meta.order}`);const a=mf(e.blocks[t].elements);ui.withoutNormalizing(i,(()=>{const n=function(e,t={}){var n;const{at:r,elementType:o}=t,i=r||(null===(n=e.selection)||void 0===n?void 0:n.anchor.path);if(!i)return;let a=e=>!ui.isEditor(e)&&Jo.isElement(e);o&&(a=e=>!ui.isEditor(e)&&Jo.isElement(e)&&e.type===o);const u=Io.parent(i),s=ui.nodes(e,{at:u,match:a,mode:"lowest"});if(s){const[e]=s;return e}}(i,{elementType:o});console.log({fromBlockRootElementType:o,node:n}),Gi.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>Jo.isElement(e)&&!ui.isInline(i,e)});const u={id:r.id,type:t,meta:Object.assign(Object.assign({},r.meta),{order:r.meta.order}),value:i.children};e.blockEditorsMap[r.id]=i,e.children[r.id]=u,e.children=lh(e.children),e.applyChanges()}))}function mh(e,t){const n={};return t.forEach((t=>{const r=t.type;n[r]={hotkey:t.hotkey,type:r,getValue:()=>function(e,t){const n=On(e);if(!n)return null;const r=ui.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>ph(e,r),toggle:()=>function(e,t){const n=On(e),r=ph(e,t);n&&(r?ui.removeMark(n,t):ui.addMark(n,t,!0),e.applyChanges())}(e,r),update:t=>function(e,t,n){const r=On(e);console.log("update editor.selection",e.selection),console.log("text format slate.selection",r),r&&r.selection&&Zo.isExpanded(r.selection)&&(ui.addMark(r,t,n),e.applyChanges())}(e,r,t)}})),n}function Dh(e,t){const n={};return t.forEach(((t,r)=>{var o;const i=Df(t.elements),a=null===(o=null==i?void 0:i.props)||void 0===o?void 0:o.nodeType;if(!("inline"===a||"inlineVoid"===a)){const o={};Object.keys(t.elements).forEach((e=>{const n=Sf(t.elements[e],["render"]);o[e]=n}));const{displayLabel:i,placeholder:a,align:u,shortcuts:s}=t.options||{};n[t.type]={type:t.type,elements:o,order:r,options:{displayLabel:i,placeholder:a,align:u,shortcuts:s},isActive:()=>{const n=k(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{gh(e,t)},create:n=>{fh(e,t.type,n)},update:(t,n)=>{vh(e,t,n)},updateElement:(t,n,r)=>{!function(e,t,n,r){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const i=On(e,{at:[o.meta.order]});i?ui.withoutNormalizing(i,(()=>{const[t]=ui.nodes(i,{at:[0],match:e=>Jo.isElement(e)&&e.type===n}),o=null==t?void 0:t[0],a=(null==o?void 0:o.props)||{},u={props:Object.assign(Object.assign({},a),r)};console.log("updatedNode",u),Gi.setNodes(i,u,{at:[0],match:e=>Jo.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges()})):console.warn("No slate found")}(e,t,n,r)},delete:()=>{console.log("block.delete")}}}})),n}function bh(e){return vp(hh(e,Ml(xa())))}function yh(){return yh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yh.apply(this,arguments)}function Ch(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function wh(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>i(e)));return function(n){const r=(null==n?void 0:n[e])||t;return c((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=i(r),u=n.length;function s(t){const{scope:n,children:r,...i}=t,a=(null==n?void 0:n[e][u])||o,s=c((()=>i),Object.values(i));return m(a.Provider,{value:s},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,i){const s=(null==i?void 0:i[e][u])||o,l=a(s);if(l)return l;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Bh(r,...t)]}function Bh(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return c((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function Eh(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function xh(...e){return d(Eh(...e),e)}const Ah=g(((e,t)=>{const{children:n,...r}=e,o=D.toArray(n),i=o.find(Oh);if(i){const e=i.props.children,n=o.map((t=>t===i?D.count(e)>1?D.only(null):b(e)?e.props.children:null:t));return m(Fh,yh({},r,{ref:t}),b(e)?y(e,void 0,n):null)}return m(Fh,yh({},r,{ref:t}),n)}));Ah.displayName="Slot";const Fh=g(((e,t)=>{const{children:n,...r}=e;return b(n)?y(n,{...Sh(r,n.props),ref:t?Eh(t,n.ref):n.ref}):D.count(n)>1?D.only(null):null}));Fh.displayName="SlotClone";const kh=({children:e})=>m(C,null,e);function Oh(e){return b(e)&&e.type===kh}function Sh(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const jh=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?s:()=>{},Ph=r["useId".toString()]||(()=>{});let Rh=0;const Th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=g(((e,n)=>{const{asChild:r,...o}=e,i=r?Ah:t;return l((()=>{window[Symbol.for("radix-ui")]=!0}),[]),m(i,yh({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function Nh(e){const t=u(e);return l((()=>{t.current=e})),c((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function _h({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=f(e),[r]=n,o=u(r),i=Nh(t);return l((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,a=i?e:r,s=Nh(n);return[a,d((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else o(t)}),[i,e,o,s])]}const Mh=i(void 0);function Lh(e){const t=a(Mh);return e||t||"ltr"}const Ih="rovingFocusGroup.onEntryFocus",zh={bubbles:!1,cancelable:!0},Wh="RovingFocusGroup",[Vh,qh,Hh]=function(e){const t=e+"CollectionProvider",[n,r]=wh(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),u=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return o.createElement(i,{scope:t,itemMap:a,collectionRef:r},n)},Slot:o.forwardRef(((e,t)=>{const{scope:n,children:r}=e,i=xh(t,a(u,n).collectionRef);return o.createElement(Ah,{ref:i},r)})),ItemSlot:o.forwardRef(((e,t)=>{const{scope:n,children:r,...i}=e,u=o.useRef(null),c=xh(t,u),d=a(s,n);return o.useEffect((()=>(d.itemMap.set(u,{ref:u,...i}),()=>{d.itemMap.delete(u)}))),o.createElement(Ah,{[l]:"",ref:c},r)}))},function(t){const n=a(e+"CollectionConsumer",t),r=o.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}(Wh),[Uh,Kh]=wh(Wh,[Hh]),[$h,Xh]=Uh(Wh),Yh=g(((e,t)=>m(Vh.Provider,{scope:e.__scopeRovingFocusGroup},m(Vh.Slot,{scope:e.__scopeRovingFocusGroup},m(Zh,yh({},e,{ref:t})))))),Zh=g(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:p,...h}=e,v=u(null),g=xh(t,v),D=Lh(i),[b=null,y]=_h({prop:a,defaultProp:s,onChange:c}),[C,w]=f(!1),B=Nh(p),E=qh(n),x=u(!1),[A,F]=f(0);return l((()=>{const e=v.current;if(e)return e.addEventListener(Ih,B),()=>e.removeEventListener(Ih,B)}),[B]),m($h,{scope:n,orientation:r,dir:D,loop:o,currentTabStopId:b,onItemFocus:d((e=>y(e)),[y]),onItemShiftTab:d((()=>w(!0)),[]),onFocusableItemAdd:d((()=>F((e=>e+1))),[]),onFocusableItemRemove:d((()=>F((e=>e-1))),[])},m(Th.div,yh({tabIndex:C||0===A?-1:0,"data-orientation":r},h,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ch(e.onMouseDown,(()=>{x.current=!0})),onFocus:Ch(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!C){const t=new CustomEvent(Ih,zh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=E().filter((e=>e.focusable));Qh([e.find((e=>e.active)),e.find((e=>e.id===b)),...e].filter(Boolean).map((e=>e.ref.current)))}}x.current=!1})),onBlur:Ch(e.onBlur,(()=>w(!1)))})))})),Gh=g(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:a,...u}=e,s=function(e){const[t,n]=r.useState(Ph());return jh((()=>{e||n((e=>null!=e?e:String(Rh++)))}),[e]),e||(t?`radix-${t}`:"")}(),c=a||s,d=Xh("RovingFocusGroupItem",n),f=d.currentTabStopId===c,p=qh(n),{onFocusableItemAdd:h,onFocusableItemRemove:v}=d;return l((()=>{if(o)return h(),()=>v()}),[o,h,v]),m(Vh.ItemSlot,{scope:n,id:c,focusable:o,active:i},m(Th.span,yh({tabIndex:f?0:-1,"data-orientation":d.orientation},u,{ref:t,onMouseDown:Ch(e.onMouseDown,(e=>{o?d.onItemFocus(c):e.preventDefault()})),onFocus:Ch(e.onFocus,(()=>d.onItemFocus(c))),onKeyDown:Ch(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Jh[r]}(e,d.orientation,d.dir);if(void 0!==t){e.preventDefault();let o=p().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>Qh(o)))}var n,r}))})))})),Jh={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qh(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const ev=Yh,tv=Gh,nv="horizontal",rv=["horizontal","vertical"],ov=g(((e,t)=>{const{decorative:n,orientation:r=nv,...o}=e,i=iv(r)?r:nv,a=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return m(Th.div,yh({"data-orientation":i},a,o,{ref:t}))}));function iv(e){return rv.includes(e)}ov.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!iv(r)?new Error(function(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:\n - horizontal\n - vertical\n\nDefaulting to \`${nv}\`.`}(o,n)):null}};const av=ov,uv=g(((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,u]=_h({prop:n,onChange:o,defaultProp:r});return m(Th.button,yh({type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Ch(e.onClick,(()=>{e.disabled||u(!a)}))}))})),sv="ToggleGroup",[lv,cv]=wh(sv,[Kh]),dv=Kh(),fv=o.forwardRef(((e,t)=>{const{type:n,...r}=e;if("single"===n){const e=r;return o.createElement(vv,yh({},e,{ref:t}))}if("multiple"===n){const e=r;return o.createElement(gv,yh({},e,{ref:t}))}throw new Error(`Missing prop \`type\` expected on \`${sv}\``)})),[pv,hv]=lv(sv),vv=o.forwardRef(((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=(()=>{}),...a}=e,[u,s]=_h({prop:n,defaultProp:r,onChange:i});return o.createElement(pv,{scope:e.__scopeToggleGroup,type:"single",value:u?[u]:[],onItemActivate:s,onItemDeactivate:o.useCallback((()=>s("")),[s])},o.createElement(bv,yh({},a,{ref:t})))})),gv=o.forwardRef(((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=(()=>{}),...a}=e,[u=[],s]=_h({prop:n,defaultProp:r,onChange:i}),l=o.useCallback((e=>s(((t=[])=>[...t,e]))),[s]),c=o.useCallback((e=>s(((t=[])=>t.filter((t=>t!==e))))),[s]);return o.createElement(pv,{scope:e.__scopeToggleGroup,type:"multiple",value:u,onItemActivate:l,onItemDeactivate:c},o.createElement(bv,yh({},a,{ref:t})))})),[mv,Dv]=lv(sv),bv=o.forwardRef(((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:u,loop:s=!0,...l}=e,c=dv(n),d=Lh(u),f={role:"group",dir:d,...l};return o.createElement(mv,{scope:n,rovingFocus:i,disabled:r},i?o.createElement(ev,yh({asChild:!0},c,{orientation:a,dir:d,loop:s}),o.createElement(Th.div,yh({},f,{ref:t}))):o.createElement(Th.div,yh({},f,{ref:t})))})),yv="ToggleGroupItem",Cv=o.forwardRef(((e,t)=>{const n=hv(yv,e.__scopeToggleGroup),r=Dv(yv,e.__scopeToggleGroup),i=dv(e.__scopeToggleGroup),a=n.value.includes(e.value),u=r.disabled||e.disabled,s={...e,pressed:a,disabled:u},l=o.useRef(null);return r.rovingFocus?o.createElement(tv,yh({asChild:!0},i,{focusable:!u,active:a,ref:l}),o.createElement(wv,yh({},s,{ref:t}))):o.createElement(wv,yh({},s,{ref:t}))})),wv=o.forwardRef(((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,a=hv(yv,n),u={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s="single"===a.type?u:void 0;return o.createElement(uv,yh({},s,i,{ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}}))})),Bv=fv,Ev=Cv,xv="Toolbar",[Av,Fv]=wh(xv,[Kh,cv]),kv=Kh(),Ov=cv(),[Sv,jv]=Av(xv),Pv=g(((e,t)=>{const{__scopeToolbar:n,orientation:r="horizontal",dir:o,loop:i=!0,...a}=e,u=kv(n),s=Lh(o);return m(Sv,{scope:n,orientation:r,dir:s},m(ev,yh({asChild:!0},u,{orientation:r,dir:s,loop:i}),m(Th.div,yh({role:"toolbar","aria-orientation":r,dir:s},a,{ref:t}))))})),Rv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=jv("ToolbarSeparator",n);return m(av,yh({orientation:"horizontal"===o.orientation?"vertical":"horizontal"},r,{ref:t}))})),Tv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=kv(n);return m(tv,yh({asChild:!0},o,{focusable:!e.disabled}),m(Th.button,yh({type:"button"},r,{ref:t})))})),Nv=Pv,_v=Rv,Mv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=jv("ToolbarToggleGroup",n),i=Ov(n);return m(Bv,yh({"data-orientation":o.orientation,dir:o.dir},i,r,{ref:t,rovingFocus:!1}))})),Lv=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=Ov(n),i={__scopeToolbar:e.__scopeToolbar};return m(Tv,yh({asChild:!0},i),m(Ev,yh({},o,r,{ref:t})))})),Iv=[["Default","black"],["Gray","#787774"],["Brown","#976D57"],["Orange","#CC772F"],["Yellow","#C29243"],["Green","#548064"],["Blue","#477DA5"],["Purple","#A48BBE"],["Pink","#B35588"],["Red","#C4554D"]],zv=[["Default","unset"],["Gray","#F1F1EF"],["Brown","#F3EEEE"],["Orange","#F8ECDF"],["Yellow","#FAF3DD"],["Green","#EEF3ED"],["Blue","#E9F3F7"],["Purple","#F6F3F8"],["Pink","#F9F2F5"],["Red","#FAECEC"]],Wv={border:"1px solid #e3e3e3"},Vv=({editor:n,highlightColors:r,onClose:o,refs:i,floatingStyles:a})=>{const u=(e,t)=>(null==r?void 0:r[e])===t?{border:"2px solid #3b82f6",backgroundColor:t}:Object.assign({backgroundColor:t},Wv),s=(e,t)=>{const o=n.formats.highlight.getValue();(null==o?void 0:o[e])!==t?n.formats.highlight.update(Object.assign(Object.assign({},r),{[e]:t})):n.formats.highlight.update(Object.assign(Object.assign({},r),{[e]:void 0}))};return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:o},{children:e("div",Object.assign({style:a,ref:i.setFloating,onClick:e=>e.stopPropagation()},{children:t("div",Object.assign({className:"bg-white p-[5px] rounded-md shadow-md border shadow-y-[4px]"},{children:[t("div",Object.assign({className:"flex items-center justify-between"},{children:[e("span",Object.assign({className:"text-xs"},{children:"Text color"})),e(Kd,{width:14,height:14})]})),e("div",Object.assign({className:"flex items-center"},{children:Iv.map((([t,n])=>e("button",{title:t,type:"button",className:"w-[25px] h-[25px] rounded-md mx-[2px] my-[5px] border-[#e3e3e3]",style:u("color",n),onClick:()=>s("color",n)},t)))})),t("div",Object.assign({className:"flex items-center justify-between mt-1"},{children:[e("span",Object.assign({className:"text-xs"},{children:"Background color"})),e(Kd,{width:14,height:14})]})),e("div",Object.assign({className:"flex items-center"},{children:zv.map((([t,n])=>e("button",{title:t,type:"button",className:"w-[25px] h-[25px] rounded-md mx-[2px] my-[5px] border-[#e3e3e3]",style:u("backgroundColor",n),onClick:()=>s("backgroundColor",n)},t)))}))]}))}))}))}))},qv=bf,Hv=({activeBlock:n,editor:r})=>{var o;const[i,a]=f(!1),[u,s]=f(!1),{refs:l,floatingStyles:c}=Ld({placement:"bottom-start",open:i,onOpenChange:a,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),{refs:d,floatingStyles:p}=Ld({placement:"top-end",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),h=e=>{var t,n;return{backgroundColor:(null===(t=r.formats[e])||void 0===t?void 0:t.isActive())?"#1183ff":void 0,color:(null===(n=r.formats[e])||void 0===n?void 0:n.isActive())?"#fff":void 0}},v=r.formats.highlight,g=null==v?void 0:v.getValue(),m=(null===(o=null==n?void 0:n.options)||void 0===o?void 0:o.displayLabel)||(null==n?void 0:n.type)||"";return t(Nv,Object.assign({className:"bg-white flex z-50 p-[5px] rounded-md shadow-md border shadow-y-[4px]"},{children:[t(Mv,Object.assign({className:"flex items-center",type:"single","aria-label":"Block formatting"},{children:[i&&e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Md,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>a(!1)},{children:e("div",Object.assign({style:c,ref:l.setFloating},{children:e(qv,{actions:Object.keys(r.blocks),editor:r,selectedAction:m,onClose:()=>a(!1),empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),u&&e(Vv,{editor:r,floatingStyles:p,refs:d,onClose:()=>s(!1),highlightColors:g}),e(Lv,Object.assign({className:"h-full px-[10px] py-0 hover:bg-[#f4f4f5] rounded-md",value:m,"aria-label":m,ref:l.setReference,onClick:()=>a((e=>!e))},{children:e("span",Object.assign({className:"mr-0"},{children:m}))}))]})),e(_v,{className:"bg-[#dbd8e0] mx-[6px] my-0 w-[1px]"}),e(Mv,Object.assign({className:"flex items-center",type:"single","aria-label":"Block formatting"},{children:e(Lv,Object.assign({className:"h-full px-[10px] py-0 hover:bg-[#f4f4f5] rounded-md",value:"LinkTool","aria-label":"LinkTool"},{children:e("span",Object.assign({className:"mr-0"},{children:"Link"}))}))})),e(_v,{className:"bg-[#dbd8e0] mx-[6px] my-0 w-[1px]"}),t(Mv,Object.assign({className:"flex items-center",type:"multiple","aria-label":"Text formatting"},{children:[r.formats.bold&&e(Lv,Object.assign({className:"h-[32px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"bold","aria-label":"Bold",style:h("bold"),onClick:()=>r.formats.bold.toggle()},{children:e(ef,{width:20,height:20})})),r.formats.italic&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"italic","aria-label":"Italic",style:h("italic"),onClick:()=>r.formats.italic.toggle()},{children:e(nf,{width:20,height:20})})),r.formats.underline&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"underline","aria-label":"Underline",style:h("underline"),onClick:()=>r.formats.underline.toggle()},{children:e(pf,{width:20,height:20})})),r.formats.strike&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"strike","aria-label":"Strike",style:h("strike"),onClick:()=>r.formats.strike.toggle()},{children:e(uf,{width:20,height:20})})),r.formats.code&&e(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"code","aria-label":"Code",style:h("code"),onClick:()=>r.formats.code.toggle()},{children:e(Xd,{width:20,height:20})})),r.formats.highlight&&t(Lv,Object.assign({className:"h-[32px] ml-[2px] hover:bg-[#f4f4f5] rounded-md cursor-pointer inline-flex px-[5px] py-0 items-center justify-center",value:"highlight","aria-label":"Highlight",style:{color:null==g?void 0:g.color,backgroundColor:null==g?void 0:g.backgroundColor,backgroundImage:null==g?void 0:g.backgroundImage,WebkitTextFillColor:null==g?void 0:g.webkitTextFillColor},ref:d.setReference,onClick:()=>s((e=>!e))},{children:[e("span",Object.assign({className:"text-lg px-1 font-serif text-col"},{children:"A"})),e(u?Kd:Hd,{width:10})]}))]}))]}))},Uv=()=>{const t=P(),[n,r]=f(!1),{refs:o,floatingStyles:i}=Ld({placement:"top",open:n,onOpenChange:r,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),a=yr((()=>{const e=window.getSelection();if(!e||(null==e?void 0:e.isCollapsed))return r(!1);const t=e.getRangeAt(0),n=t.getBoundingClientRect(),i=t.toString().trim(),a=document.getElementById("yoopta-editor"),u=null==t?void 0:t.commonAncestorContainer;if(!(null==a?void 0:a.contains(u)))return r(!1);t&&i.length>0&&(o.setReference({getBoundingClientRect:()=>n,getClientRects:()=>t.getClientRects()}),r(!0))}),200);if(l((()=>(window.document.addEventListener("selectionchange",a),()=>window.document.removeEventListener("selectionchange",a))),[t.selectedBlocks]),!n)return null;const u=Object.values(t.blocks).find((e=>e.isActive()));return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:e(Hv,{activeBlock:u,editor:t})}))}))},Kv={onKeyDown:(e,t,n)=>e=>{const{open:r,close:o,state:i}=n;if($f.isSlashCommand(e)){if(!t.selection)return;const n=Io.parent(t.selection.anchor.path),o=ui.string(t,n),a=ui.isStart(t,t.selection.anchor,t.selection.focus);if(console.log("event.key",e.key),console.log("state.open",i.open),!a||o.trim().length>0)return;const u=window.getSelection();if(!u)return;const s=u.getRangeAt(0),l=s.getBoundingClientRect();s&&(i.refs.setReference({getBoundingClientRect:()=>l,getClientRects:()=>s.getClientRects()}),r())}if(i.open)if($f.isTab(e))e.preventDefault();else if($f.isArrowUp(e))e.preventDefault();else if($f.isArrowDown(e))e.preventDefault();else if($f.isArrowLeft(e))e.preventDefault();else if($f.isArrowRight(e))e.preventDefault();else{if($f.isBackspace(e)){if(!t.selection)return;if(ui.isStart(t,t.selection.anchor,t.selection.focus))return o()}if($f.isEscape(e))return e.preventDefault(),void o();$f.isEnter(e)&&e.preventDefault()}},onKeyUp:(e,t,{open:n,close:r,change:o,state:i})=>e=>{if(!t.selection)return;const n=Io.parent(t.selection.anchor.path),i=ui.string(t,n);if(0===i.length)return r();o({text:i})}},$v=(e,t,n)=>!(!e||!(null==e?void 0:e[n]))&&e[n].toLowerCase().indexOf(t.toLowerCase())>-1,Xv=({trigger:t="/",render:n})=>{const r=P(),{registerTool:o,unregisterTool:i,tools:a}=Qf(),[u,s]=f(!1),{refs:c,floatingStyles:d,update:p}=Ld({placement:"bottom-start",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc}),h=Object.keys(r.blocks).sort(((e,t)=>r.blocks[e].order-r.blocks[t].order)),[v,g]=f(h[0]),[m,D]=f(h),b=()=>s(!0),y=()=>s(!1),C=({text:e})=>{const n=e.trim().replace(t,"");if(0===n.length||n===t)return D(h);D(h.filter((e=>((e,t)=>!t||$v(e,t,"type")||$v(e.options,t,"displayLabel"))(r.blocks[e],n))))};l((()=>(o("actionMenu",{open:b,close:y,change:C,state:{isMenuOpen:u,refs:c},component:bf,events:Kv}),()=>i("actionMenu"))),[u,c]),l((()=>{if(u&&a.actionMenu)return document.addEventListener("click",y),()=>document.removeEventListener("click",y)}),[u,a.actionMenu]);const w=e=>{const t=e.currentTarget.getAttribute("data-action-menu-item-type");g(t)},B=0===m.length;if(l((()=>{p();let e=setTimeout((()=>{B&&y()}),3e3);return()=>clearTimeout(e)}),[m.length,u,c]),!u)return null;if(n){const t=e=>({onMouseEnter:w,selectedAction:v});return e(Td,{children:e("div",Object.assign({className:"absolute z-[9999] m-0 left-0 top-0 right-auto bottom-auto",style:d,ref:c.setFloating},{children:n({getItemProps:t,actions:m,editor:r,onMouseEnter:w,selectedAction:v,onClose:y,empty:B})}))})}return e(Td,Object.assign({root:document.getElementById("yoopta-editor")},{children:e("div",Object.assign({className:"absolute z-[9999] m-0 left-0 top-0 right-auto bottom-auto",style:d,ref:c.setFloating},{children:e(bf,{actions:m,editor:r,onMouseEnter:w,selectedAction:v,onClose:y,empty:B})}))}))},Yv=(()=>{const e=U();return{[e]:K(e)}})(),Zv=new W,Gv=(e,t)=>Zv.on(e,t),Jv=(e,t)=>Zv.once(e,t),Qv=(e,t)=>Zv.off(e,t),eg=(e,t)=>Zv.emit(e,t),tg=({editor:n,value:r,marks:o,plugins:i,autoFocus:a,className:u,tools:s,selectionBoxRoot:l})=>{const d=()=>{n.emit("change",n.children),v((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},p=c((()=>i.map((e=>e.getPlugin))),[i]),[h,v]=f((()=>(n.applyChanges=d,o&&(n.formats=mh(n,o)),n.blocks=Dh(n,p),n.children=r||Yv,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const r=bh(e);t[n]=r})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,r,o,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(r=e.options)||void 0===r?void 0:r.shortcuts.length)>0&&(null===(i=null===(o=e.options)||void 0===o?void 0:o.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 r;const o=e.elements[t],i=null===(r=o.props)||void 0===r?void 0:r.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=o)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const r=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:r})}})),t}(p),n.on=Gv,n.once=Jv,n.off=Qv,n.emit=eg,{editor:n,version:0})));return e(cp,{children:e(j,Object.assign({editorState:h},{children:t(Jf,{children:[e(lp,{marks:o,autoFocus:a,className:u,selectionBoxRoot:l}),e(Xv,{}),e(Uv,{})]})}))})},ng=Object.assign(Object.assign({},Ef),{ExtendedBlockActions:({className:r,style:o,onClick:i,children:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c}=Ld({placement:"bottom-start",open:u,onOpenChange:s,middleware:[qc(),Vc(),Wc(),Ec(10)],whileElementsMounted:zc});return t(n,{children:[u&&e(Bf,Object.assign({isOpen:u,onClose:()=>s(!1),refs:l,floatingStyles:c},{children:a})),e("button",Object.assign({type:"button",ref:l.setReference,className:`absolute right-[10px] top-[10px] flex items-center justify-between z-10 opacity-1 bg-[#eee] w-[22px] h-[22px] transition-opacity duration-150 ease-in border-none cursor-pointer rounded-[2px] p-[0_4px] ${r}`,onClick:()=>{null==i||i(),s(!0)},style:o},{children:e(Jd,{})}))]})}});function rg(e,t){const n=Object.keys(e.children),{type:r}=t||{},o=n.find((t=>e.children[t].type===r));return o?e.children[o]:null}function og(e,t,n={}){const{focusAt:r,waitExecution:o=!0,waitExecutionMs:i=0}=n,a=()=>{const o=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!o||!i)return;const a=function(e,t){if(di.isPoint(t))return t;if(Io.isPath(t))return{path:t,offset:0};const[,n]=ui.first(e,[0]);return{path:n||[0,0],offset:0}}(o,r);Gi.select(o,a),Es.focus(o),e.setSelection([i.meta.order])};o?setTimeout((()=>a()),i):a()}function ig(e){return Array.from(new Set(e))}var ag={},ug={get exports(){return ag},set exports(e){ag=e}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",a="[object Date]",u="[object Function]",s="[object GeneratorFunction]",l="[object Map]",c="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",v="[object String]",g="[object Symbol]",m="[object WeakMap]",D="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",C="[object Float64Array]",w="[object Int8Array]",B="[object Int16Array]",E="[object Int32Array]",x="[object Uint8Array]",A="[object Uint8ClampedArray]",F="[object Uint16Array]",k="[object Uint32Array]",O=/\w*$/,S=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,P={};P[o]=P["[object Array]"]=P[D]=P[b]=P[i]=P[a]=P[y]=P[C]=P[w]=P[B]=P[E]=P[l]=P[c]=P[d]=P[p]=P[h]=P[v]=P[g]=P[x]=P[A]=P[F]=P[k]=!0,P["[object Error]"]=P[u]=P[m]=!1;var R="object"==typeof L&&L&&L.Object===Object&&L,T="object"==typeof self&&self&&self.Object===Object&&self,N=R||T||Function("return this")(),_=t&&!t.nodeType&&t,M=_&&e&&!e.nodeType&&e,I=M&&M.exports===_;function z(e,t){return e.set(t[0],t[1]),e}function W(e,t){return e.add(t),e}function V(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function q(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function U(e,t){return function(n){return e(t(n))}}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,Y=Function.prototype,Z=Object.prototype,G=N["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=Y.toString,ee=Z.hasOwnProperty,te=Z.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=I?N.Buffer:void 0,oe=N.Symbol,ie=N.Uint8Array,ae=U(Object.getPrototypeOf,Object),ue=Object.create,se=Z.propertyIsEnumerable,le=X.splice,ce=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,fe=U(Object.keys,Object),pe=Le(N,"DataView"),he=Le(N,"Map"),ve=Le(N,"Promise"),ge=Le(N,"Set"),me=Le(N,"WeakMap"),De=Le(Object,"create"),be=qe(pe),ye=qe(he),Ce=qe(ve),we=qe(ge),Be=qe(me),Ee=oe?oe.prototype:void 0,xe=Ee?Ee.valueOf:void 0;function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Fe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ke(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){this.__data__=new Fe(e)}function Se(e,t){var n=Ue(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!se.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||We(a,r))||n.push(a);return n}function je(e,t,n){var r=e[t];ee.call(e,t)&&He(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Pe(e,t){for(var n=e.length;n--;)if(He(e[n][0],t))return n;return-1}function Re(e,t,n,r,f,m,S){var j;if(r&&(j=m?r(e,f,m,S):r(e)),void 0!==j)return j;if(!Ye(e))return e;var R=Ue(e);if(R){if(j=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,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,j)}else{var T=ze(e),N=T==u||T==s;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(T==d||T==o||N&&!m){if(q(e))return m?e:{};if(j=function(e){return"function"!=typeof e.constructor||Ve(e)?{}:(t=ae(e),Ye(t)?ue(t):{});var t}(N?{}:e),!t)return function(e,t){return _e(e,Ie(e),t)}(e,function(e,t){return e&&_e(t,Ze(t),e)}(j,e))}else{if(!P[T])return m?e:{};j=function(e,t,n,r){var o=e.constructor;switch(t){case D:return Ne(e);case i:case a:return new o(+e);case b:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case y:case C:case w:case B:case E:case x:case A:case F:case k:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(H(e),!0):H(e);return V(r,z,new e.constructor)}(e,r,n);case c:case v:return new o(e);case p:return function(e){var t=new e.constructor(e.source,O.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var r=t?n(K(e),!0):K(e);return V(r,W,new e.constructor)}(e,r,n);case g:return u=e,xe?Object(xe.call(u)):{}}var u}(e,T,Re,t)}}S||(S=new Oe);var _=S.get(e);if(_)return _;if(S.set(e,j),!R)var M=n?function(e){return function(e,t,n){var r=t(e);return Ue(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ze,Ie)}(e):Ze(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(M||e,(function(o,i){M&&(o=e[i=o]),je(j,i,Re(o,t,n,r,i,e,S))})),j}function Te(e){return!(!Ye(e)||(t=e,J&&J in t))&&(Xe(e)||q(e)?ne:S).test(qe(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function _e(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],u=r?r(n[a],e[a],a,n,e):void 0;je(n,a,void 0===u?e[a]:u)}return n}function Me(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Te(n)?n:void 0}Ae.prototype.clear=function(){this.__data__=De?De(null):{}},Ae.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ae.prototype.get=function(e){var t=this.__data__;if(De){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ae.prototype.has=function(e){var t=this.__data__;return De?void 0!==t[e]:ee.call(t,e)},Ae.prototype.set=function(e,t){return this.__data__[e]=De&&void 0===t?n:t,this},Fe.prototype.clear=function(){this.__data__=[]},Fe.prototype.delete=function(e){var t=this.__data__,n=Pe(t,e);return!(n<0)&&(n==t.length-1?t.pop():le.call(t,n,1),!0)},Fe.prototype.get=function(e){var t=this.__data__,n=Pe(t,e);return n<0?void 0:t[n][1]},Fe.prototype.has=function(e){return Pe(this.__data__,e)>-1},Fe.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ke.prototype.clear=function(){this.__data__={hash:new Ae,map:new(he||Fe),string:new Ae}},ke.prototype.delete=function(e){return Me(this,e).delete(e)},ke.prototype.get=function(e){return Me(this,e).get(e)},ke.prototype.has=function(e){return Me(this,e).has(e)},ke.prototype.set=function(e,t){return Me(this,e).set(e,t),this},Oe.prototype.clear=function(){this.__data__=new Fe},Oe.prototype.delete=function(e){return this.__data__.delete(e)},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Fe){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this;n=this.__data__=new ke(r)}return n.set(e,t),this};var Ie=ce?U(ce,Object):function(){return[]},ze=function(e){return te.call(e)};function We(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function Ve(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function qe(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function He(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=b||he&&ze(new he)!=l||ve&&ze(ve.resolve())!=f||ge&&ze(new ge)!=h||me&&ze(new me)!=m)&&(ze=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?qe(n):void 0;if(r)switch(r){case be:return b;case ye:return l;case Ce:return f;case we:return h;case Be:return m}return t});var Ue=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Xe(e)}var $e=de||function(){return!1};function Xe(e){var t=Ye(e)?te.call(e):"";return t==u||t==s}function Ye(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ke(e)?Se(e):function(e){if(!Ve(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 Re(e,!0,!0)}}(ug,ag);var sg=ag;function lg(e,t={}){const{blockId:n,focus:r}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let o=null;if(n&&(o=e.children[n],!o))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(o=k(e,{at:t.at}),!o))throw new Error(`Block in path ${t.at} not found`);if(!o)throw new Error("Block not found");e.children=sh(e.children);Object.values(e.children).forEach((e=>{e.meta.order>o.meta.order&&(e.meta.order+=1)}));const i=(a=o,"function"==typeof window.structuredClone?window.structuredClone(a):sg(a));var a;const u=bh(e);i.id=U(),i.meta.order=o.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=u;const s=i.id;e.children=lh(e.children),e.applyChanges(),r&&e.focusBlock(s,{waitExecution:!0})}function cg(e,t){Es.blur(t),Es.deselect(t),Gi.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const dg=()=>{const e={children:{},selection:null,selectedBlocks:null,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=sh(e.children);const{at:r=null,focus:o=!1,slate:i=null}=n,a=k(e),u=r,s={id:U(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let l=!1;if(i&&i.selection){const e=ui.string(i,i.selection.anchor.path);l=ui.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(u){const[t]=u;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),s.meta.order=t}else{const t=Object.keys(e.children).length;s.meta.order=t}const c=bh(e);e.blockEditorsMap[s.id]=c,l&&a&&(s.meta.order=a.meta.order,a.meta.order+=1),e.children[s.id]=s;const d=null==a?void 0:a.id;e.children=lh(e.children),e.applyChanges(),o&&e.focusBlock(l&&d?d:s.id)}(e,...t),deleteBlock:(...t)=>function(e,t={}){const{at:n=e.selection,deleteAll:r=!1,fromPaths:o,focus:i}=t;if(console.log("BEFORE options.focusAt",t.focusAt),Array.isArray(o)&&o.length>0)return e.children=sh(e.children),o.forEach((t=>{const n=k(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])})),Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=lh(e.children),void e.applyChanges();if(r||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=K(U()),n=bh(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}),void e.applyChanges()}if(!n)return;e.children=sh(e.children);const[a]=n,u=Object.keys(e.children),s=u.find((t=>e.children[t].meta.order===a));if(u.forEach((t=>{const n=e.children[t];n.meta.order>a&&(n.meta.order-=1)})),s&&(delete e.children[s],delete e.blockEditorsMap[s]),e.children=lh(e.children),e.applyChanges(),i){const n=e.selection?e.selection[0]-1:0,r=k(e,{at:[n]});console.log("AFTER options.focusAt",t.focusAt),r&&e.focusBlock(r.id,{focusAt:t.focusAt})}}(e,...t),duplicateBlock:(...t)=>lg(e,...t),toggleBlock:(...t)=>gh(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=sh(e.children);const r=k(e);r&&(r.meta.depth=r.meta.depth+1,e.children=lh(e.children),e.applyChanges())}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=sh(e.children);const r=k(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=lh(e.children),e.applyChanges())}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=sh(e.children);const[r]=n,o=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===r)),a=o.meta.order<i.meta.order,u=o.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>o.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:u&&e.meta.order<o.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),o.meta.order=r,e.children=lh(e.children),e.applyChanges()}(e,...t),focusBlock:(...t)=>og(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>vh(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:r=!0}=t,o=k(e);n&&n.selection&&o&&ui.withoutNormalizing(n,(()=>{e.children=sh(e.children);const t=Io.parent(n.selection.anchor.path);Gi.splitNodes(n,{at:n.selection,match:e=>Jo.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=n.children.slice()[i];Gi.removeNodes(n,{at:[i],match:e=>Jo.isElement(e),mode:"highest"});const u={id:U(),type:o.type,meta:{order:o.meta.order+1,depth:o.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=u.meta.order&&(e.meta.order+=1)}));const s=bh(e);e.blockEditorsMap[u.id]=s,e.children[u.id]=u,e.children=lh(e.children),e.applyChanges(),r&&e.focusBlock(u.id,{slate:s})}))}(e,...t),setSelection:(...t)=>function(e,t){e.selection=t,e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:r=!1,allSelected:o=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(r)e.selectedBlocks=t;else if(o){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=ig(t)}else e.selectedBlocks=ig(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const r=null!==(n=t.slate)&&void 0!==n?n:On(e);if(!r)return;const{waitExecution:o,waitExecutionMs:i}=t;o?setTimeout((()=>cg(e,r)),i):(cg(e,r),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};function fg({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}xf('/*! 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: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-auto{bottom:auto}.left-0{left:0}.right-\\[10px\\]{right:10px}.right-auto{right:auto}.top-0{top:0}.top-\\[10px\\]{top:10px}.z-10{z-index:10}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[90\\]{z-index:90}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.mx-\\[2px\\]{margin-left:2px;margin-right:2px}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.mx-\\[6px\\]{margin-left:6px;margin-right:6px}.my-0{margin-bottom:0;margin-top:0}.my-\\[4px\\]{margin-bottom:4px;margin-top:4px}.my-\\[5px\\]{margin-bottom:5px;margin-top:5px}.mb-0{margin-bottom:0}.mb-0\\.5{margin-bottom:.125rem}.mb-\\[1px\\]{margin-bottom:1px}.ml-\\[2px\\]{margin-left:2px}.mr-0{margin-right:0}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-\\[2px\\]{margin-top:2px}.\\!block{display:block!important}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.h-4{height:1rem}.h-\\[1px\\]{height:1px}.h-\\[22px\\]{height:22px}.h-\\[25px\\]{height:25px}.h-\\[32px\\]{height:32px}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[300px\\]{max-height:300px}.max-h-\\[330px\\]{max-height:330px}.w-10{width:2.5rem}.w-4{width:1rem}.w-72{width:18rem}.w-\\[1px\\]{width:1px}.w-\\[22px\\]{width:22px}.w-\\[25px\\]{width:25px}.w-auto{width:auto}.w-full{width:100%}.min-w-\\[200px\\]{min-width:200px}.max-w-\\[250px\\]{max-width:250px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.border-\\[\\#e3e3e3\\]{--tw-border-opacity:1;border-color:rgb(227 227 227/var(--tw-border-opacity))}.bg-\\[\\#2383e224\\]{background-color:#2383e224}.bg-\\[\\#37352f14\\]{background-color:#37352f14}.bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-\\[\\#dbd8e0\\]{--tw-bg-opacity:1;background-color:rgb(219 216 224/var(--tw-bg-opacity))}.bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-0{padding:0}.p-\\[0_4px\\]{padding:0 4px}.p-\\[5px\\]{padding:5px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.px-\\[5px\\]{padding-left:5px;padding-right:5px}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.text-left{text-align:left}.font-serif{font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.italic{font-style:italic}.leading-\\[120\\%\\]{line-height:120%}.underline{text-decoration-line:underline}.opacity-100{opacity:1}.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)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.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)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}.yoopta-placeholder:after{color:#aaa;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.last\\:mb-0:last-child{margin-bottom:0}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:bg-\\[\\#f4f4f5\\]:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.aria-selected\\:bg-\\[\\#f0f0f0\\][aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(240 240 240/var(--tw-bg-opacity))}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}');export{$f as HOTKEYS,ng as UI,F as YooptaPlugin,dg as createYooptaEditor,fg as createYooptaMark,tg as default,k as findPluginBlockBySelectionPath,rg as findPluginBlockByType,On as findSlateBySelectionPath,U as generateId,R as useBlockData,M as useBlockSelected,T as useYooptaBlock,P as useYooptaEditor,N as useYooptaPlugin,_ as useYooptaPluginOptions};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "4.0.0-rc.0",
3
+ "version": "4.0.0-rc.1",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "scripts": {
36
36
  "start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development",
37
- "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production",
38
- "publish": "yarn build && npm publish --access public"
37
+ "prepublishOnly": "yarn build",
38
+ "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production"
39
39
  },
40
40
  "keywords": [
41
41
  "contenteditable",