@yoopta/editor 4.0.0-rc.3 → 4.0.0-rc.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/UI/BlockOptions/BlockOptions.d.ts +12 -11
  2. package/dist/UI/BlockOptions/BlockOptions.d.ts.map +1 -1
  3. package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts +1 -1
  4. package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts.map +1 -1
  5. package/dist/UI/index.d.ts +11 -11
  6. package/dist/YooptaEditor.d.ts +10 -8
  7. package/dist/YooptaEditor.d.ts.map +1 -1
  8. package/dist/components/Block/Block.d.ts +1 -2
  9. package/dist/components/Block/Block.d.ts.map +1 -1
  10. package/dist/components/Block/BlockActions.d.ts +1 -2
  11. package/dist/components/Block/BlockActions.d.ts.map +1 -1
  12. package/dist/components/Editor/Editor.d.ts +4 -2
  13. package/dist/components/Editor/Editor.d.ts.map +1 -1
  14. package/dist/components/Editor/RenderBlocks.d.ts +2 -2
  15. package/dist/components/Editor/RenderBlocks.d.ts.map +1 -1
  16. package/dist/components/Editor/utils.d.ts.map +1 -1
  17. package/dist/components/SelectionBox/SelectionBox.d.ts +2 -2
  18. package/dist/components/SelectionBox/SelectionBox.d.ts.map +1 -1
  19. package/dist/components/SelectionBox/hooks.d.ts.map +1 -1
  20. package/dist/components/TextLeaf/TextLeaf.d.ts +1 -2
  21. package/dist/components/TextLeaf/TextLeaf.d.ts.map +1 -1
  22. package/dist/contexts/YooptaContext/ToolsContext.d.ts +23 -0
  23. package/dist/contexts/YooptaContext/ToolsContext.d.ts.map +1 -0
  24. package/dist/contexts/{UltraYooptaContext/UltraYooptaContext.d.ts → YooptaContext/YooptaContext.d.ts} +8 -9
  25. package/dist/contexts/YooptaContext/YooptaContext.d.ts.map +1 -0
  26. package/dist/editor/index.d.ts.map +1 -1
  27. package/dist/editor/selection/setBlockSelected.d.ts +1 -1
  28. package/dist/editor/selection/setBlockSelected.d.ts.map +1 -1
  29. package/dist/editor/textFormats/toggle.d.ts.map +1 -1
  30. package/dist/editor/textFormats/update.d.ts.map +1 -1
  31. package/dist/editor/transforms/createBlock.d.ts.map +1 -1
  32. package/dist/editor/transforms/decreaseBlockDepth.d.ts.map +1 -1
  33. package/dist/editor/transforms/deleteBlock.d.ts.map +1 -1
  34. package/dist/editor/transforms/duplicateBlock.d.ts.map +1 -1
  35. package/dist/editor/transforms/focusBlock.d.ts.map +1 -1
  36. package/dist/editor/transforms/increaseBlockDepth.d.ts.map +1 -1
  37. package/dist/editor/transforms/insertBlock.d.ts +1 -1
  38. package/dist/editor/transforms/insertBlock.d.ts.map +1 -1
  39. package/dist/editor/transforms/insertBlocks.d.ts +3 -0
  40. package/dist/editor/transforms/insertBlocks.d.ts.map +1 -0
  41. package/dist/editor/transforms/moveBlock.d.ts.map +1 -1
  42. package/dist/editor/transforms/splitBlock.d.ts.map +1 -1
  43. package/dist/editor/transforms/toggleBlock.d.ts.map +1 -1
  44. package/dist/editor/transforms/updateBlock.d.ts.map +1 -1
  45. package/dist/editor/transforms/updateBlockElement.d.ts.map +1 -1
  46. package/dist/editor/types.d.ts +10 -9
  47. package/dist/editor/types.d.ts.map +1 -1
  48. package/dist/handlers/onKeyDown.d.ts.map +1 -1
  49. package/dist/index.d.ts +5 -3
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +2 -8
  52. package/dist/marks/FakeSelectionMark.d.ts +5 -0
  53. package/dist/marks/FakeSelectionMark.d.ts.map +1 -0
  54. package/dist/parsers/deserializeHTML.d.ts +10 -0
  55. package/dist/parsers/deserializeHTML.d.ts.map +1 -0
  56. package/dist/parsers/deserializeMarkdown.d.ts +2 -0
  57. package/dist/parsers/deserializeMarkdown.d.ts.map +1 -0
  58. package/dist/parsers/index.d.ts +10 -0
  59. package/dist/parsers/index.d.ts.map +1 -0
  60. package/dist/parsers/serializeHTML.d.ts +2 -0
  61. package/dist/parsers/serializeHTML.d.ts.map +1 -0
  62. package/dist/parsers/serializeMarkdown.d.ts +2 -0
  63. package/dist/parsers/serializeMarkdown.d.ts.map +1 -0
  64. package/dist/plugins/SlateEditorComponent.d.ts +4 -5
  65. package/dist/plugins/SlateEditorComponent.d.ts.map +1 -1
  66. package/dist/plugins/createYooptaPlugin.d.ts +12 -4
  67. package/dist/plugins/createYooptaPlugin.d.ts.map +1 -1
  68. package/dist/plugins/extenstions/withInlines.d.ts.map +1 -1
  69. package/dist/plugins/types.d.ts +29 -15
  70. package/dist/plugins/types.d.ts.map +1 -1
  71. package/dist/utils/editorBuilders.d.ts +3 -3
  72. package/dist/utils/editorBuilders.d.ts.map +1 -1
  73. package/dist/utils/findSlateBySelectionPath.d.ts +2 -1
  74. package/dist/utils/findSlateBySelectionPath.d.ts.map +1 -1
  75. package/dist/utils/generateId.d.ts.map +1 -1
  76. package/dist/utils/getMaxOffsetInElement.d.ts.map +1 -1
  77. package/dist/utils/validators.d.ts +2 -0
  78. package/dist/utils/validators.d.ts.map +1 -0
  79. package/package.json +8 -12
  80. package/dist/contexts/UltraYooptaContext/ToolsContext.d.ts +0 -25
  81. package/dist/contexts/UltraYooptaContext/ToolsContext.d.ts.map +0 -1
  82. package/dist/contexts/UltraYooptaContext/UltraYooptaContext.d.ts.map +0 -1
  83. package/dist/tools/ActionMenuList/ActionMenuComponent.d.ts +0 -14
  84. package/dist/tools/ActionMenuList/ActionMenuComponent.d.ts.map +0 -1
  85. package/dist/tools/ActionMenuList/ActionMenuList.d.ts +0 -10
  86. package/dist/tools/ActionMenuList/ActionMenuList.d.ts.map +0 -1
  87. package/dist/tools/Toolbar/HighlightColor.d.ts +0 -14
  88. package/dist/tools/Toolbar/HighlightColor.d.ts.map +0 -1
  89. package/dist/tools/Toolbar/Toolbar.d.ts +0 -4
  90. package/dist/tools/Toolbar/Toolbar.d.ts.map +0 -1
  91. package/dist/tools/Toolbar/ToolbarComponent.d.ts +0 -9
  92. package/dist/tools/Toolbar/ToolbarComponent.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,12 +1,6 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from"react";import o,{createContext as i,useContext as a,useRef as u,useLayoutEffect as s,useEffect as l,useMemo as c,useCallback as d,useState as f,memo as p,useReducer as h,Component as v,forwardRef as g,createElement as m,Children as D,isValidElement as b,cloneElement as C,Fragment as y}from"react";import{randomFillSync as w}from"crypto";import*as B from"react-dom";import E,{unstable_batchedUpdates as x,createPortal as A}from"react-dom";class F{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const t=Object.assign(Object.assign({},this.plugin.options),e);return new F({type:this.plugin.type,elements:this.plugin.elements,events:this.plugin.events,options:t})}}function O(e,t={}){const n=Object.keys(e.children),{at:r=e.selection}=t,o=n.find((t=>e.children[t].meta.order===(null==r?void 0:r[0])));return o?e.children[o]:null}const k={editor:{getBlock:()=>{},insertBlock:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,blockEditorsMap:{},children:{}}},S=i(k),j=({children:t,editorState:n})=>{const r=u(k);return r.current={editor:n.editor},e(S.Provider,Object.assign({value:r.current},{children:t}))},P=()=>{const e=a(S);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},R=e=>P().children[e],T=e=>P().blocks[e],N=e=>P().plugins[e],_=e=>{var t;return null===(t=N(e))||void 0===t?void 0:t.options},M=({blockId:e,path:t})=>{var n;const r=P();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let o;return e&&(o=r.children[e]),t&&(o=O(r,{at:t})),(null===(n=r.selection)||void 0===n?void 0:n[0])===(null==o?void 0:o.meta.order)};var L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},I={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var u=new o(r,i||e,a),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],u]:e._events[s].push(u):(e._events[s]=u,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function u(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),u.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},u.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},u.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,o,i,a){var u=n?n+e:e;if(!this._events[u])return!1;var s,l,c=this._events[u],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,o),!0;case 5:return c.fn.call(c.context,t,r,o,i),!0;case 6:return c.fn.call(c.context,t,r,o,i,a),!0}for(l=1,s=new Array(d-1);l<d;l++)s[l-1]=arguments[l];c.fn.apply(c.context,s)}else{var f,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,r);break;case 4:c[l].fn.call(c[l].context,t,r,o);break;default:if(!s)for(f=1,s=new Array(d-1);f<d;f++)s[f-1]=arguments[f];c[l].fn.apply(c[l].context,s)}}return!0},u.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},u.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},u.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var u=this._events[i];if(u.fn)u.fn!==t||o&&!u.once||r&&u.context!==r||a(this,i);else{for(var s=0,l=[],c=u.length;s<c;s++)(u[s].fn!==t||o&&!u[s].once||r&&u[s].context!==r)&&l.push(u[s]);l.length?this._events[i]=1===l.length?l[0]:l:a(this,i)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u}({get exports(){return I},set exports(e){I=e}});var z=I;let W,V,q=(e=21)=>{var t;t=e-=0,!W||W.length<t?(W=Buffer.allocUnsafe(128*t),w(W),V=0):V+t>W.length&&(w(W),V=0),V+=t;let n="";for(let t=V-e;t<V;t++)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&W[t]];return n};const H=()=>{var e;return"undefined"==typeof window?q():"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?function(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}():q()},U=e=>({id:H(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),K=e=>({id:(null==e?void 0:e.id)||H(),value:(null==e?void 0:e.value)||[U()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const $="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Y(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function X(e){return"nodeType"in e}function Z(e){var t,n;return e?Y(e)?e:X(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function G(e){const{Document:t}=Z(e);return e instanceof t}function J(e){return!Y(e)&&e instanceof Z(e).HTMLElement}function Q(e){return e instanceof Z(e).SVGElement}function ee(e){return e?Y(e)?e.document:X(e)?G(e)?e:J(e)||Q(e)?e.ownerDocument:document:document:document}const te=$?s:l;function ne(e){const t=u(e);return te((()=>{t.current=e})),d((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)}),[])}function re(e,t){void 0===t&&(t=[e]);const n=u(e);return te((()=>{n.current!==e&&(n.current=e)}),t),n}function oe(e,t){const n=u();return c((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function ie(e){const t=ne(e),n=u(null),r=d((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function ae(e){const t=u();return l((()=>{t.current=e}),[e]),t.current}let ue={};function se(e,t){return c((()=>{if(t)return t;const n=null==ue[e]?0:ue[e]+1;return ue[e]=n,e+"-"+n}),[e,t])}function le(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const ce=le(1),de=le(-1);function fe(e){if(!e)return!1;const{KeyboardEvent:t}=Z(e.target);return t&&e instanceof t}function pe(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Z(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const he=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[he.Translate.toString(e),he.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ve="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ge(e){return e.matches(ve)?e:e.querySelector(ve)}const me={display:"none"};function De(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:me},n)}function be(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Ce=i(null);const ye={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},we={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Be(e){let{announcements:t=we,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ye}=e;const{announce:u,announcement:s}=function(){const[e,t]=f("");return{announce:d((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=se("DndLiveRegion"),[h,v]=f(!1);if(l((()=>{v(!0)}),[]),function(e){const t=a(Ce);l((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(c((()=>({onDragStart(e){let{active:n}=e;u(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&u(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;u(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;u(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;u(t.onDragCancel({active:n,over:r}))}})),[u,t])),!h)return null;const g=o.createElement(o.Fragment,null,o.createElement(De,{id:r,value:i.draggable}),o.createElement(be,{id:p,announcement:s}));return n?A(g,n):g}var Ee;function xe(){}function Ae(e,t){return c((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Ee||(Ee={}));const Fe=Object.freeze({x:0,y:0});function Oe(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ke(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Se(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function je(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Pe(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Re(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Te=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Re(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Oe(Re(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(ke)};function Ne(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,u=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*u;return Number((o/(n+r-o)).toFixed(4))}return 0}const _e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Ne(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Se)};function Me(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Fe}function Le(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const Ie=Le(1);const ze={ignoreTransform:!1};function We(e,t){void 0===t&&(t=ze);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Z(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:u}=r,s=e.left-a-(1-o)*parseFloat(n),l=e.top-u-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:c,height:d,top:l,right:s+c,bottom:l+d,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:u,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:u,right:s}}function Ve(e){return We(e,{ignoreTransform:!0})}function qe(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(G(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!J(o)||Q(o))return n;if(n.includes(o))return n;const i=Z(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Z(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=Z(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function He(e){const[t]=qe(e,1);return null!=t?t:null}function Ue(e){return $&&e?Y(e)?e:X(e)?G(e)||e===ee(e).scrollingElement?window:J(e)?e:null:null:null}function Ke(e){return Y(e)?e.scrollX:e.scrollLeft}function $e(e){return Y(e)?e.scrollY:e.scrollTop}function Ye(e){return{x:Ke(e),y:$e(e)}}var Xe;function Ze(e){return!(!$||!e)&&e===document.scrollingElement}function Ge(e){const t={x:0,y:0},n=Ze(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Xe||(Xe={}));const Je={x:.2,y:.2};function Qe(e,t,n,r,o){let{top:i,left:a,right:u,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=Je);const{isTop:l,isBottom:c,isLeft:d,isRight:f}=Ge(e),p={x:0,y:0},h={x:0,y:0},v=t.height*o.y,g=t.width*o.x;return!l&&i<=t.top+v?(p.y=Xe.Backward,h.y=r*Math.abs((t.top+v-i)/v)):!c&&s>=t.bottom-v&&(p.y=Xe.Forward,h.y=r*Math.abs((t.bottom-v-s)/v)),!f&&u>=t.right-g?(p.x=Xe.Forward,h.x=r*Math.abs((t.right-g-u)/g)):!d&&a<=t.left+g&&(p.x=Xe.Backward,h.x=r*Math.abs((t.left+g-a)/g)),{direction:p,speed:h}}function et(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function tt(e){return e.reduce(((e,t)=>ce(e,Ye(t))),Fe)}const nt=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Ke(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+$e(t)),0)}]];class rt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=qe(t),r=tt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of nt)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ot{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function it(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var at,ut;function st(e){e.preventDefault()}function lt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(at||(at={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ut||(ut={}));const ct={start:[ut.Space,ut.Enter],cancel:[ut.Esc],end:[ut.Space,ut.Enter]},dt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ut.Right:return{...n,x:n.x+25};case ut.Left:return{...n,x:n.x-25};case ut.Down:return{...n,y:n.y+25};case ut.Up:return{...n,y:n.y-25}}};class ft{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ot(ee(t)),this.windowListeners=new ot(Z(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(at.Resize,this.handleCancel),this.windowListeners.add(at.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(at.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=We),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);He(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Fe)}handleKeyDown(e){if(fe(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ct,coordinateGetter:i=dt,scrollBehavior:a="smooth"}=r,{code:u}=e;if(o.end.includes(u))return void this.handleEnd(e);if(o.cancel.includes(u))return void this.handleCancel(e);const{collisionRect:s}=n.current,l=s?{x:s.left,y:s.top}:Fe;this.referenceCoordinates||(this.referenceCoordinates=l);const c=i(e,{active:t,context:n.current,currentCoordinates:l});if(c){const t=de(c,l),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:u,isLeft:s,isBottom:l,maxScroll:d,minScroll:f}=Ge(n),p=et(n),h={x:Math.min(o===ut.Right?p.right-p.width/2:p.right,Math.max(o===ut.Right?p.left:p.left+p.width/2,c.x)),y:Math.min(o===ut.Down?p.bottom-p.height/2:p.bottom,Math.max(o===ut.Down?p.top:p.top+p.height/2,c.y))},v=o===ut.Right&&!u||o===ut.Left&&!s,g=o===ut.Down&&!l||o===ut.Up&&!i;if(v&&h.x!==c.x){const e=n.scrollLeft+t.x,i=o===ut.Right&&e<=d.x||o===ut.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===ut.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&h.y!==c.y){const e=n.scrollTop+t.y,i=o===ut.Down&&e<=d.y||o===ut.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===ut.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,ce(de(c,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function pt(e){return Boolean(e&&"distance"in e)}function ht(e){return Boolean(e&&"delay"in e)}ft.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ct,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class vt{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Z(e);return e instanceof t?e:ee(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=ee(i),this.documentListeners=new ot(this.document),this.listeners=new ot(n),this.windowListeners=new ot(Z(i)),this.initialCoordinates=null!=(r=pe(o))?r:Fe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(at.Resize,this.handleCancel),this.windowListeners.add(at.DragStart,st),this.windowListeners.add(at.VisibilityChange,this.handleCancel),this.windowListeners.add(at.ContextMenu,st),this.documentListeners.add(at.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ht(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(pt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(at.Click,lt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(at.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const u=null!=(t=pe(e))?t:Fe,s=de(r,u);if(!n&&a){if(pt(a)){if(null!=a.tolerance&&it(s,a.tolerance))return this.handleCancel();if(it(s,a.distance))return this.handleStart()}return ht(a)&&it(s,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(u)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ut.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const gt={move:{name:"pointermove"},end:{name:"pointerup"}};class mt extends vt{constructor(e){const{event:t}=e,n=ee(t.target);super(e,gt,n)}}mt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const Dt={move:{name:"mousemove"},end:{name:"mouseup"}};var bt;!function(e){e[e.RightClick=2]="RightClick"}(bt||(bt={}));(class extends vt{constructor(e){super(e,Dt,ee(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==bt.RightClick&&(null==r||r({event:n}),!0)}}];const Ct={move:{name:"touchmove"},end:{name:"touchend"}};var yt,wt;function Bt(e){let{acceleration:t,activator:n=yt.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=wt.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:v,threshold:g}=e;const m=function(e){let{delta:t,disabled:n}=e;const r=ae(t);return oe((e=>{if(n||!r||!e)return Et;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Xe.Backward]:e.x[Xe.Backward]||-1===o.x,[Xe.Forward]:e.x[Xe.Forward]||1===o.x},y:{[Xe.Backward]:e.y[Xe.Backward]||-1===o.y,[Xe.Forward]:e.y[Xe.Forward]||1===o.y}}}),[n,t,r])}({delta:v,disabled:!i}),[D,b]=function(){const e=u(null);return[d(((t,n)=>{e.current=setInterval(t,n)}),[]),d((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),C=u({x:0,y:0}),y=u({x:0,y:0}),w=c((()=>{switch(n){case yt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case yt.DraggableRect:return o}}),[n,o,f]),B=u(null),E=d((()=>{const e=B.current;if(!e)return;const t=C.current.x*y.current.x,n=C.current.y*y.current.y;e.scrollBy(t,n)}),[]),x=c((()=>s===wt.TreeOrder?[...p].reverse():p),[s,p]);l((()=>{if(i&&p.length&&w){for(const e of x){if(!1===(null==r?void 0:r(e)))continue;const n=p.indexOf(e),o=h[n];if(!o)continue;const{direction:i,speed:u}=Qe(e,o,w,t,g);for(const e of["x","y"])m[e][i[e]]||(u[e]=0,i[e]=0);if(u.x>0||u.y>0)return b(),B.current=e,D(E,a),C.current=u,void(y.current=i)}C.current={x:0,y:0},y.current={x:0,y:0},b()}else b()}),[t,E,r,b,i,a,JSON.stringify(w),JSON.stringify(m),D,p,x,h,JSON.stringify(g)])}(class extends vt{constructor(e){super(e,Ct)}static setup(){return window.addEventListener(Ct.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ct.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(yt||(yt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(wt||(wt={}));const Et={x:{[Xe.Backward]:!1,[Xe.Forward]:!1},y:{[Xe.Backward]:!1,[Xe.Forward]:!1}};var xt,At;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xt||(xt={})),function(e){e.Optimized="optimized"}(At||(At={}));const Ft=new Map;function Ot(e,t){return oe((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function kt(e){let{callback:t,disabled:n}=e;const r=ne(t),o=c((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return l((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function St(e){return new rt(We(e),e)}function jt(e,t,n){void 0===t&&(t=St);const[r,o]=h((function(r){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);if(JSON.stringify(r)===JSON.stringify(i))return r;return i}),null),i=function(e){let{callback:t,disabled:n}=e;const r=ne(t),o=c((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return l((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),a=kt({callback:o});return te((()=>{o(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),r}const Pt=[];function Rt(e,t){void 0===t&&(t=[]);const n=u(null);return l((()=>{n.current=null}),t),l((()=>{const t=e!==Fe;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?de(e,n.current):Fe}function Tt(e){return c((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Nt=[];function _t(e){let{measure:t}=e;const[n,r]=f(null),o=d((e=>{for(const{target:n}of e)if(J(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t]),i=kt({callback:o}),a=d((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return J(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)}),[t,i]),[u,s]=ie(a);return c((()=>({nodeRef:u,rect:n,setRef:s})),[n,u,s])}const Mt=[{sensor:mt,options:{}},{sensor:ft,options:{}}],Lt={current:{}},It={draggable:{measure:Ve},droppable:{measure:Ve,strategy:xt.WhileDragging,frequency:At.Optimized},dragOverlay:{measure:We}};class zt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Wt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new zt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:xe},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:It,measureDroppableContainers:xe,windowRect:null,measuringScheduled:!1},Vt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:xe,draggableNodes:new Map,over:null,measureDroppableContainers:xe}),qt=i(Wt);function Ht(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new zt}}}function Ut(e,t){switch(t.type){case Ee.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ee.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Ee.DragEnd:case Ee.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ee.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new zt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Ee.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new zt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Ee.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new zt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Kt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=a(Vt),i=ae(r),u=ae(null==n?void 0:n.id);return l((()=>{if(!t&&!r&&i&&null!=u){if(!fe(i))return;if(document.activeElement===i.target)return;const e=o.get(u);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=ge(e);if(t){t.focus();break}}}))}}),[r,t,o,u,i]),null}const $t=i({...Fe,scaleX:1,scaleY:1});var Yt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Yt||(Yt={}));const Xt=p((function(e){var t,n,r,i;let{id:a,accessibility:s,autoScroll:p=!0,children:v,sensors:g=Mt,collisionDetection:m=_e,measuring:D,modifiers:b,...C}=e;const y=h(Ut,void 0,Ht),[w,B]=y,[E,A]=function(){const[e]=f((()=>new Set)),t=d((t=>(e.add(t),()=>e.delete(t))),[e]);return[d((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[F,O]=f(Yt.Uninitialized),k=F===Yt.Initialized,{draggable:{active:S,nodes:j,translate:P},droppable:{containers:R}}=w,T=S?j.get(S):null,N=u({initial:null,translated:null}),_=c((()=>{var e;return null!=S?{id:S,data:null!=(e=null==T?void 0:T.data)?e:Lt,rect:N}:null}),[S,T]),M=u(null),[L,I]=f(null),[z,W]=f(null),V=re(C,Object.values(C)),q=se("DndDescribedBy",a),H=c((()=>R.getEnabled()),[R]),U=c((()=>({draggable:{...It.draggable,...null==K?void 0:K.draggable},droppable:{...It.droppable,...null==K?void 0:K.droppable},dragOverlay:{...It.dragOverlay,...null==K?void 0:K.dragOverlay}})),[null==(K=D)?void 0:K.draggable,null==K?void 0:K.droppable,null==K?void 0:K.dragOverlay]);var K;const{droppableRects:Y,measureDroppableContainers:X,measuringScheduled:G}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=f(null),{frequency:s,measure:c,strategy:p}=o,h=u(e),v=function(){switch(p){case xt.Always:return!1;case xt.BeforeDragging:return n;default:return!n}}(),g=re(v),m=d((function(e){void 0===e&&(e=[]),g.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),D=u(null),b=oe((t=>{if(v&&!n)return Ft;if(!t||t===Ft||h.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new rt(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,i,n,v,c]);return l((()=>{h.current=e}),[e]),l((()=>{v||m()}),[n,v]),l((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),l((()=>{v||"number"!=typeof s||null!==D.current||(D.current=setTimeout((()=>{m(),D.current=null}),s))}),[s,v,m,...r]),{droppableRects:b,measureDroppableContainers:m,measuringScheduled:null!=i}}(H,{dragging:k,dependencies:[P.x,P.y],config:U.droppable}),J=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return oe((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(j,S),Q=c((()=>z?pe(z):null),[z]),ee=function(){const e=!1===(null==L?void 0:L.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,n=k&&!e&&!t;if("object"==typeof p)return{...p,enabled:n};return{enabled:n}}(),ne=function(e,t){return Ot(e,t)}(J,U.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=u(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;te((()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Me(n(e),r);if(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=He(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,a,s,r,n])}({activeNode:S?j.get(S):null,config:ee.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const ie=jt(J,U.draggable.measure,ne),ae=jt(J?J.parentElement:null),ue=u({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=R.getNodeFor(null==(t=ue.current.over)?void 0:t.id),de=_t({measure:U.dragOverlay.measure}),fe=null!=(n=de.nodeRef.current)?n:J,he=k?null!=(r=de.rect)?r:ie:null,ve=Boolean(de.nodeRef.current&&de.rect),ge=Me(me=ve?null:ie,Ot(me));var me;const De=Tt(fe?Z(fe):null),be=function(e){const t=u(e),n=oe((n=>e?n&&n!==Pt&&e&&t.current&&e.parentNode===t.current.parentNode?n:qe(e):Pt),[e]);return l((()=>{t.current=e}),[e]),n}(k?null!=le?le:J:null),ye=function(e,t){void 0===t&&(t=We);const[n]=e,r=Tt(n?Z(n):null),[o,i]=h((function(){return e.length?e.map((e=>Ze(e)?r:new rt(t(e),e))):Nt}),Nt),a=kt({callback:i});return e.length>0&&o===Nt&&i(),te((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),o}(be),we=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(b,{transform:{x:P.x-ge.x,y:P.y-ge.y,scaleX:1,scaleY:1},activatorEvent:z,active:_,activeNodeRect:ie,containerNodeRect:ae,draggingNodeRect:he,over:ue.current.over,overlayNodeRect:de.rect,scrollableAncestors:be,scrollableAncestorRects:ye,windowRect:De}),xe=Q?ce(Q,P):null,Ae=function(e){const[t,n]=f(null),r=u(e),o=d((e=>{const t=Ue(e.target);t&&n((e=>e?(e.set(t,Ye(t)),new Map(e)):null))}),[]);return l((()=>{const t=r.current;if(e!==t){i(t);const a=e.map((e=>{const t=Ue(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Ye(t)]):null})).filter((e=>null!=e));n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Ue(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),c((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ce(e,t)),Fe):tt(e):Fe),[e,t])}(be),Oe=Rt(Ae),ke=Rt(Ae,[ie]),Se=ce(we,Oe),je=he?Ie(he,we):null,Re=_&&je?m({active:_,collisionRect:je,droppableRects:Y,droppableContainers:H,pointerCoordinates:xe}):null,Te=Pe(Re,"id"),[Ne,Le]=f(null),ze=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ve?we:ce(we,ke),null!=(i=null==Ne?void 0:Ne.rect)?i:null,ie),Ve=d(((e,t)=>{let{sensor:n,options:r}=t;if(null==M.current)return;const o=j.get(M.current);if(!o)return;const i=e.nativeEvent,a=new n({active:M.current,activeNode:o,event:i,options:r,context:ue,onStart(e){const t=M.current;if(null==t)return;const n=j.get(t);if(!n)return;const{onDragStart:r}=V.current,o={active:{id:t,data:n.data,rect:N}};x((()=>{null==r||r(o),O(Yt.Initializing),B({type:Ee.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o})}))},onMove(e){B({type:Ee.DragMove,coordinates:e})},onEnd:u(Ee.DragEnd),onCancel:u(Ee.DragCancel)});function u(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ue.current;let a=null;if(t&&o){const{cancelDrop:u}=V.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Ee.DragEnd&&"function"==typeof u){await Promise.resolve(u(a))&&(e=Ee.DragCancel)}}M.current=null,x((()=>{B({type:e}),O(Yt.Uninitialized),Le(null),I(null),W(null);const t=e===Ee.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[t];null==e||e(a),E({type:t,event:a})}}))}}x((()=>{I(a),W(e.nativeEvent)}))}),[j]),Ke=d(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=j.get(r);if(null!==M.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},M.current=r,Ve(n,t))}),[j,Ve]),$e=function(e,t){return c((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(g,Ke);!function(e){l((()=>{if(!$)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(g),te((()=>{ie&&F===Yt.Initializing&&O(Yt.Initialized)}),[ie,F]),l((()=>{const{onDragMove:e}=V.current,{active:t,activatorEvent:n,collisions:r,over:o}=ue.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Se.x,y:Se.y},over:o};x((()=>{null==e||e(i),E({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),l((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ue.current;if(!e||null==M.current||!t||!o)return;const{onDragOver:i}=V.current,a=r.get(Te),u=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:u};x((()=>{Le(u),null==i||i(s),E({type:"onDragOver",event:s})}))}),[Te]),te((()=>{ue.current={activatorEvent:z,active:_,activeNode:J,collisionRect:je,collisions:Re,droppableRects:Y,draggableNodes:j,draggingNode:fe,draggingNodeRect:he,droppableContainers:R,over:Ne,scrollableAncestors:be,scrollAdjustedTranslate:Se},N.current={initial:he,translated:je}}),[_,J,Re,je,j,fe,he,Y,R,Ne,be,Se]),Bt({...ee,delta:P,draggingRect:je,pointerCoordinates:xe,scrollableAncestors:be,scrollableAncestorRects:ye});const Xe=c((()=>({active:_,activeNode:J,activeNodeRect:ie,activatorEvent:z,collisions:Re,containerNodeRect:ae,dragOverlay:de,draggableNodes:j,droppableContainers:R,droppableRects:Y,over:Ne,measureDroppableContainers:X,scrollableAncestors:be,scrollableAncestorRects:ye,measuringConfiguration:U,measuringScheduled:G,windowRect:De})),[_,J,ie,z,Re,ae,de,j,R,Y,Ne,X,be,ye,U,G,De]),Ge=c((()=>({activatorEvent:z,activators:$e,active:_,activeNodeRect:ie,ariaDescribedById:{draggable:q},dispatch:B,draggableNodes:j,over:Ne,measureDroppableContainers:X})),[z,$e,_,ie,B,q,j,Ne,X]);return o.createElement(Ce.Provider,{value:A},o.createElement(Vt.Provider,{value:Ge},o.createElement(qt.Provider,{value:Xe},o.createElement($t.Provider,{value:ze},v)),o.createElement(Kt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),o.createElement(Be,{...s,hiddenTextDescribedById:q}))})),Zt=i(null),Gt="button",Jt="Droppable";function Qt(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=se(Jt),{activators:u,activatorEvent:s,active:l,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:h}=a(Vt),{role:v=Gt,roleDescription:g="draggable",tabIndex:m=0}=null!=o?o:{},D=(null==l?void 0:l.id)===t,b=a(D?$t:Zt),[C,y]=ie(),[w,B]=ie(),E=function(e,t){return c((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(u,t),x=re(n);te((()=>(p.set(t,{id:t,key:i,node:C,activatorNode:w,data:x}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:l,activatorEvent:s,activeNodeRect:d,attributes:c((()=>({role:v,tabIndex:m,"aria-disabled":r,"aria-pressed":!(!D||v!==Gt)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[r,v,m,D,g,f.draggable]),isDragging:D,listeners:r?void 0:E,node:C,over:h,setNodeRef:y,setActivatorNodeRef:B,transform:b}}const en="Droppable",tn={timeout:25};function nn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function rn(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function on(e){return null!==e&&e>=0}const an=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=nn(t,r,n),a=t[o],u=i[o];return u&&a?{x:u.left-a.left,y:u.top-a.top,scaleX:u.width/a.width,scaleY:u.height/a.height}:null},un={scaleX:1,scaleY:1},sn=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const u=null!=(t=i[n])?t:r;if(!u)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(u.top+u.height):e.top-u.top,...un}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-u.height-s,...un}:o<n&&o>=a?{x:0,y:u.height+s,...un}:{x:0,y:0,...un}};const ln="Sortable",cn=o.createContext({activeIndex:-1,containerId:ln,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:an,disabled:{draggable:!1,droppable:!1}});function dn(e){let{children:t,id:n,items:r,strategy:i=an,disabled:s=!1}=e;const{active:d,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:v}=a(qt),g=se(ln,n),m=Boolean(null!==f.rect),D=c((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),b=null!=d,C=d?D.indexOf(d.id):-1,y=h?D.indexOf(h.id):-1,w=u(D),B=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(D,w.current),E=-1!==y&&-1===C||B,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(s);te((()=>{B&&b&&v(D)}),[B,D,b,v]),l((()=>{w.current=D}),[D]);const A=c((()=>({activeIndex:C,containerId:g,disabled:x,disableTransforms:E,items:D,overIndex:y,useDragOverlay:m,sortedRects:rn(D,p),strategy:i})),[C,g,x.draggable,x.droppable,E,D,y,p,m,i]);return o.createElement(cn.Provider,{value:A},t)}const fn=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return nn(n,r,o).indexOf(t)},pn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:u,previousContainerId:s,transition:l}=e;return!(!l||!r)&&((u===i||o!==a)&&(!!n||a!==o&&t===s))},hn={duration:200,easing:"ease"},vn="transform",gn=he.Transition.toString({property:vn,duration:0,easing:"linear"}),mn={roleDescription:"sortable"};function Dn(e){let{animateLayoutChanges:t=pn,attributes:n,disabled:r,data:o,getNewIndex:i=fn,id:s,strategy:p,resizeObserverConfig:h,transition:v=hn}=e;const{items:g,containerId:m,activeIndex:D,disabled:b,disableTransforms:C,sortedRects:y,overIndex:w,useDragOverlay:B,strategy:E}=a(cn),x=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,b),A=g.indexOf(s),F=c((()=>({sortable:{containerId:m,index:A,items:g},...o})),[m,o,A,g]),O=c((()=>g.slice(g.indexOf(s))),[g,s]),{rect:k,node:S,isOver:j,setNodeRef:P}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=se(en),{active:s,dispatch:c,over:f,measureDroppableContainers:p}=a(Vt),h=u({disabled:n}),v=u(!1),g=u(null),m=u(null),{disabled:D,updateMeasurementsFor:b,timeout:C}={...tn,...o},y=re(null!=b?b:r),w=kt({callback:d((()=>{v.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{p(Array.isArray(y.current)?y.current:[y.current]),m.current=null}),C)):v.current=!0}),[C]),disabled:D||!s}),B=d(((e,t)=>{w&&(t&&(w.unobserve(t),v.current=!1),e&&w.observe(e))}),[w]),[E,x]=ie(B),A=re(t);return l((()=>{w&&E.current&&(w.disconnect(),v.current=!1,w.observe(E.current))}),[E,w]),te((()=>(c({type:Ee.RegisterDroppable,element:{id:r,key:i,disabled:n,node:E,rect:g,data:A}}),()=>c({type:Ee.UnregisterDroppable,key:i,id:r}))),[r]),l((()=>{n!==h.current.disabled&&(c({type:Ee.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)}),[r,i,n,c]),{active:s,rect:g,isOver:(null==f?void 0:f.id)===r,node:E,over:f,setNodeRef:x}}({id:s,data:F,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...h}}),{active:R,activatorEvent:T,activeNodeRect:N,attributes:_,setNodeRef:M,listeners:L,isDragging:I,over:z,setActivatorNodeRef:W,transform:V}=Qt({id:s,data:F,attributes:{...mn,...n},disabled:x.draggable}),q=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c((()=>e=>{t.forEach((t=>t(e)))}),t)}(P,M),H=Boolean(R),U=H&&!C&&on(D)&&on(w),K=!B&&I,$=K&&U?V:null,Y=U?null!=$?$:(null!=p?p:E)({rects:y,activeNodeRect:N,activeIndex:D,overIndex:w,index:A}):null,X=on(D)&&on(w)?i({id:s,items:g,activeIndex:D,overIndex:w}):A,Z=null==R?void 0:R.id,G=u({activeId:Z,items:g,newIndex:X,containerId:m}),J=g!==G.current.items,Q=t({active:R,containerId:m,isDragging:I,isSorting:H,id:s,index:A,items:g,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:v,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=f(null),s=u(n);return te((()=>{if(!t&&n!==s.current&&r.current){const e=o.current;if(e){const t=We(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==s.current&&(s.current=n)}),[t,n,r,o]),l((()=>{i&&a(null)}),[i]),i}({disabled:!Q,index:A,node:S,rect:k});return l((()=>{H&&G.current.newIndex!==X&&(G.current.newIndex=X),m!==G.current.containerId&&(G.current.containerId=m),g!==G.current.items&&(G.current.items=g)}),[H,X,m,g]),l((()=>{if(Z===G.current.activeId)return;if(Z&&!G.current.activeId)return void(G.current.activeId=Z);const e=setTimeout((()=>{G.current.activeId=Z}),50);return()=>clearTimeout(e)}),[Z]),{active:R,activeIndex:D,attributes:_,data:F,rect:k,index:A,newIndex:X,items:g,isOver:j,isSorting:H,isDragging:I,listeners:L,node:S,overIndex:w,over:z,setNodeRef:q,setActivatorNodeRef:W,setDroppableNodeRef:P,setDraggableNodeRef:M,transform:null!=ee?ee:Y,transition:function(){if(ee||J&&G.current.newIndex===A)return gn;if(K&&!fe(T)||!v)return;if(H||Q)return he.Transition.toString({...v,property:vn});return}()}}function bn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Cn=[ut.Down,ut.Right,ut.Up,ut.Left],yn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:u}}=t;if(Cn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case ut.Down:r.top<i.top&&t.push(n);break;case ut.Up:r.top>i.top&&t.push(n);break;case ut.Left:r.left>i.left&&t.push(n);break;case ut.Right:r.left<i.left&&t.push(n)}}));const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=je(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=je(r),a=o.reduce(((e,t,r)=>e+Oe(n[r],t)),0),u=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:u}})}}return i.sort(ke)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let l=Pe(s,"id");if(l===(null==a?void 0:a.id)&&s.length>1&&(l=s[1].id),null!=l){const e=i.get(n.id),t=i.get(l),a=t?o.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&a&&e&&t){const n=qe(s).some(((e,t)=>u[t]!==e)),o=wn(e,t),i=function(e,t){if(!bn(e)||!bn(t))return!1;if(!wn(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),l=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},c={x:a.left,y:a.top};return l.x&&l.y?c:de(c,l)}}}};function wn(e,t){return!(!bn(e)||!bn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var Bn;function En(){return En=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},En.apply(this,arguments)}var xn,An=function(e){return r.createElement("svg",En({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Bn||(Bn=r.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function Fn(){return Fn=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},Fn.apply(this,arguments)}var On=function(e){return r.createElement("svg",Fn({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),xn||(xn=r.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function kn(e,t={}){const n=Object.keys(e.children),{at:r=e.selection}=t,o=n.find((t=>e.children[t].meta.order===(null==r?void 0:r[0])));if(o)return e.blockEditorsMap[o]}var Sn=function(e){if(e=String(e||""),Rn.test(e))return"rtl";if(Tn.test(e))return"ltr";return"neutral"},jn="֑-߿יִ-﷽ﹰ-ﻼ",Pn="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Rn=new RegExp("^[^"+Pn+"]*["+jn+"]"),Tn=new RegExp("^[^"+jn+"]*["+Pn+"]");var Nn=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_n="object"==typeof L&&L&&L.Object===Object&&L,Mn="object"==typeof self&&self&&self.Object===Object&&self,Ln=_n||Mn||Function("return this")(),In=Ln,zn=function(){return In.Date.now()},Wn=/\s/;var Vn=function(e){for(var t=e.length;t--&&Wn.test(e.charAt(t)););return t},qn=Vn,Hn=/^\s+/;var Un=function(e){return e?e.slice(0,qn(e)+1).replace(Hn,""):e},Kn=Ln.Symbol,$n=Kn,Yn=Object.prototype,Xn=Yn.hasOwnProperty,Zn=Yn.toString,Gn=$n?$n.toStringTag:void 0;var Jn=function(e){var t=Xn.call(e,Gn),n=e[Gn];try{e[Gn]=void 0;var r=!0}catch(e){}var o=Zn.call(e);return r&&(t?e[Gn]=n:delete e[Gn]),o},Qn=Object.prototype.toString;var er=Jn,tr=function(e){return Qn.call(e)},nr=Kn?Kn.toStringTag:void 0;var rr=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nr&&nr in Object(e)?er(e):tr(e)},or=function(e){return null!=e&&"object"==typeof e};var ir=Un,ar=Nn,ur=function(e){return"symbol"==typeof e||or(e)&&"[object Symbol]"==rr(e)},sr=/^[-+]0x[0-9a-f]+$/i,lr=/^0b[01]+$/i,cr=/^0o[0-7]+$/i,dr=parseInt;var fr=Nn,pr=zn,hr=function(e){if("number"==typeof e)return e;if(ur(e))return NaN;if(ar(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ar(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ir(e);var n=lr.test(e);return n||cr.test(e)?dr(e.slice(2),n?2:8):sr.test(e)?NaN:+e},vr=Math.max,gr=Math.min;var mr=function(e,t,n){var r,o,i,a,u,s,l=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,l=t,a=e.apply(i,n)}function h(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-l>=i}function v(){var e=pr();if(h(e))return g(e);u=setTimeout(v,function(e){var n=t-(e-s);return d?gr(n,i-(e-l)):n}(e))}function g(e){return u=void 0,f&&r?p(e):(r=o=void 0,a)}function m(){var e=pr(),n=h(e);if(r=arguments,o=this,s=e,n){if(void 0===u)return function(e){return l=e,u=setTimeout(v,t),c?p(e):a}(s);if(d)return clearTimeout(u),u=setTimeout(v,t),p(s)}return void 0===u&&(u=setTimeout(v,t)),a}return t=hr(t)||0,fr(n)&&(c=!!n.leading,i=(d="maxWait"in n)?vr(hr(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),m.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=s=o=u=void 0},m.flush=function(){return void 0===u?a:g(pr())},m},Dr=mr,br=Nn;var Cr=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return br(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Dr(e,t,{leading:r,maxWait:t,trailing:o})};const yr=e=>"object"==typeof e&&null!=e&&1===e.nodeType,wr=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,Br=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return wr(n.overflowY,t)||wr(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Er=(e,t,n,r,o,i,a,u)=>i<e&&a>t||i>e&&a<t?0:i<=e&&u<=n||a>=t&&u>=n?i-e-r:a>t&&u<n||i<e&&u>n?a-t+o:0,xr=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},Ar=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:u,inline:s,boundary:l,skipOverflowHiddenElements:c}=t,d="function"==typeof l?l:e=>e!==l;if(!yr(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,p=[];let h=e;for(;yr(h)&&d(h);){if(h=xr(h),h===f){p.push(h);break}null!=h&&h===document.body&&Br(h)&&!Br(document.documentElement)||null!=h&&Br(h,c)&&p.push(h)}const v=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,g=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:D}=window,{height:b,width:C,top:y,right:w,bottom:B,left:E}=e.getBoundingClientRect(),{top:x,right:A,bottom:F,left:O}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let k="start"===u||"nearest"===u?y-x:"end"===u?B+F:y+b/2-x+F,S="center"===s?E+C/2-O+A:"end"===s?w+A:E-O;const j=[];for(let e=0;e<p.length;e++){const t=p[e],{height:n,width:r,top:o,right:i,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===a&&y>=0&&E>=0&&B<=g&&w<=v&&y>=o&&B<=l&&E>=c&&w<=i)return j;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),x=parseInt(d.borderTopWidth,10),A=parseInt(d.borderRightWidth,10),F=parseInt(d.borderBottomWidth,10);let O=0,P=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-A:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-x-F:0,N="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,_="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)O="start"===u?k:"end"===u?k-g:"nearest"===u?Er(D,D+g,g,x,F,D+k,D+k+b,b):k-g/2,P="start"===s?S:"center"===s?S-v/2:"end"===s?S-v:Er(m,m+v,v,h,A,m+S,m+S+C,C),O=Math.max(0,O+D),P=Math.max(0,P+m);else{O="start"===u?k-o-x:"end"===u?k-l+F+T:"nearest"===u?Er(o,l,n,x,F+T,k,k+b,b):k-(o+n/2)+T/2,P="start"===s?S-c-h:"center"===s?S-(c+r/2)+R/2:"end"===s?S-i+A+R:Er(c,i,r,h,A+R,S,S+C,C);const{scrollLeft:e,scrollTop:a}=t;O=0===_?0:Math.max(0,Math.min(a+O/_,t.scrollHeight-n/_+T)),P=0===N?0:Math.max(0,Math.min(e+P/N,t.scrollWidth-r/N+R)),k+=a-O,S+=e-P}j.push({el:t,top:O,left:P})}return j};function Fr(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(Ar(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:o,top:i,left:a}of Ar(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=a-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}
2
- /*!
3
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
- *
5
- * Copyright (c) 2014-2017, Jon Schlinkert.
6
- * Released under the MIT License.
7
- */function Or(e){return"[object Object]"===Object.prototype.toString.call(e)}function kr(e){var t,n;return!1!==Or(e)&&(void 0===(t=e.constructor)||!1!==Or(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}var Sr=Symbol.for("immer-nothing"),jr=Symbol.for("immer-draftable"),Pr=Symbol.for("immer-state");function Rr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Tr=Object.getPrototypeOf;function Nr(e){return!!e&&!!e[Pr]}function _r(e){return!!e&&(Lr(e)||Array.isArray(e)||!!e[jr]||!!e.constructor?.[jr]||qr(e)||Hr(e))}var Mr=Object.prototype.constructor.toString();function Lr(e){if(!e||"object"!=typeof e)return!1;const t=Tr(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)===Mr}function Ir(e,t){0===zr(e)?Object.entries(e).forEach((([n,r])=>{t(n,r,e)})):e.forEach(((n,r)=>t(r,n,e)))}function zr(e){const t=e[Pr];return t?t.type_:Array.isArray(e)?1:qr(e)?2:Hr(e)?3:0}function Wr(e,t){return 2===zr(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Vr(e,t,n){const r=zr(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function qr(e){return e instanceof Map}function Hr(e){return e instanceof Set}function Ur(e){return e.copy_||e.base_}function Kr(e,t){if(qr(e))return new Map(e);if(Hr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Lr(e)){if(!Tr(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[Pr];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(Tr(e),n)}function $r(e,t=!1){return Xr(e)||Nr(e)||!_r(e)||(zr(e)>1&&(e.set=e.add=e.clear=e.delete=Yr),Object.freeze(e),t&&Ir(e,((e,t)=>$r(t,!0)))),e}function Yr(){Rr(2)}function Xr(e){return Object.isFrozen(e)}var Zr,Gr={};function Jr(e){const t=Gr[e];return t||Rr(0),t}function Qr(){return Zr}function eo(e,t){t&&(Jr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function to(e){no(e),e.drafts_.forEach(oo),e.drafts_=null}function no(e){e===Zr&&(Zr=e.parent_)}function ro(e){return Zr={drafts_:[],parent_:Zr,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function oo(e){const t=e[Pr];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function io(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Pr].modified_&&(to(t),Rr(4)),_r(e)&&(e=ao(t,e),t.parent_||so(t,e)),t.patches_&&Jr("Patches").generateReplacementPatches_(n[Pr].base_,e,t.patches_,t.inversePatches_)):e=ao(t,n,[]),to(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Sr?e:void 0}function ao(e,t,n){if(Xr(t))return t;const r=t[Pr];if(!r)return Ir(t,((o,i)=>uo(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return so(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),Ir(o,((o,a)=>uo(e,r,t,o,a,n,i))),so(e,t,!1),n&&e.patches_&&Jr("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function uo(e,t,n,r,o,i,a){if(Nr(o)){const a=ao(e,o,i&&t&&3!==t.type_&&!Wr(t.assigned_,r)?i.concat(r):void 0);if(Vr(n,r,a),!Nr(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(_r(o)&&!Xr(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ao(e,o),t&&t.scope_.parent_||so(e,o)}}function so(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$r(t,n)}var lo={get(e,t){if(t===Pr)return e;const n=Ur(e);if(!Wr(n,t))return function(e,t,n){const r=po(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_||!_r(r)?r:r===fo(e.base_,t)?(vo(e),e.copy_[t]=go(r,e)):r},has:(e,t)=>t in Ur(e),ownKeys:e=>Reflect.ownKeys(Ur(e)),set(e,t,n){const r=po(Ur(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=fo(Ur(e),t),a=r?.[Pr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||Wr(e.base_,t)))return!0;vo(e),ho(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==fo(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,vo(e),ho(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Ur(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Rr(11)},getPrototypeOf:e=>Tr(e.base_),setPrototypeOf(){Rr(12)}},co={};function fo(e,t){const n=e[Pr];return(n?Ur(n):e)[t]}function po(e,t){if(!(t in e))return;let n=Tr(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Tr(n)}}function ho(e){e.modified_||(e.modified_=!0,e.parent_&&ho(e.parent_))}function vo(e){e.copy_||(e.copy_=Kr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Ir(lo,((e,t)=>{co[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),co.deleteProperty=function(e,t){return co.set.call(this,e,t,void 0)},co.set=function(e,t,n){return lo.set.call(this,e[0],t,n,e[0])};function go(e,t){const n=qr(e)?Jr("MapSet").proxyMap_(e,t):Hr(e)?Jr("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Qr(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=lo;n&&(o=[r],i=co);const{revoke:a,proxy:u}=Proxy.revocable(o,i);return r.draft_=u,r.revoke_=a,u}(e,t);return(t?t.scope_:Qr()).drafts_.push(n),n}function mo(e){if(!_r(e)||Xr(e))return e;const t=e[Pr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Kr(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Kr(e,!0);return Ir(n,((e,t)=>{Vr(n,e,mo(t))})),t&&(t.finalized_=!1),n}var Do=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&&Rr(6),void 0!==n&&"function"!=typeof n&&Rr(7),_r(e)){const o=ro(this),i=go(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?to(o):no(o)}return eo(o,n),io(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Sr&&(r=void 0),this.autoFreeze_&&$r(r,!0),n){const t=[],o=[];Jr("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}Rr(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){_r(e)||Rr(8),Nr(e)&&(e=function(e){Nr(e)||Rr(10);return mo(e)}(e));const t=ro(this),n=go(e,void 0);return n[Pr].isManual_=!0,no(t),n}finishDraft(e,t){const n=e&&e[Pr];n&&n.isManual_||Rr(9);const{scope_:r}=n;return eo(r,t),io(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=Jr("Patches").applyPatches_;return Nr(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},bo=Do.produce;Do.produceWithPatches.bind(Do),Do.setAutoFreeze.bind(Do),Do.setUseStrictShallowCopy.bind(Do),Do.applyPatches.bind(Do);var Co=Do.createDraft.bind(Do),yo=Do.finishDraft.bind(Do),wo={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Po.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Bo={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=ai.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},Eo={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Uo.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},xo=new WeakMap,Ao=new WeakMap,Fo=new WeakMap,Oo=new WeakMap,ko=new WeakMap,So=new WeakMap,jo=new WeakMap,Po={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=Po.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r];if(o!==t[r])break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return Po.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return Po.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return Po.equals(r,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===Po.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===Po.compare(e,t),isBefore:(e,t)=>-1===Po.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===Po.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===Po.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===Po.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===Po.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&Po.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!Po.isAncestor(t,e)&&!Po.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(Po.equals(i,r)||Po.endsBefore(i,r)||Po.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(Po.equals(a,r)||Po.isAncestor(a,r))return null;Po.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:u,position:s}=t;Po.equals(u,r)||Po.endsBefore(u,r)?r[u.length-1]-=1:Po.isAncestor(u,r)&&(r[u.length-1]-=1,r[u.length]+=s);break;case"split_node":var{path:l,position:c}=t;if(Po.equals(l,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else Po.endsBefore(l,r)?r[l.length-1]+=1:Po.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break;case"move_node":var{path:d,newPath:f}=t;if(Po.equals(d,f))return r;if(Po.isAncestor(d,r)||Po.equals(d,r)){var p=f.slice();return Po.endsBefore(d,f)&&d.length<f.length&&(p[d.length-1]-=1),p.concat(r.slice(d.length))}Po.isSibling(d,f)&&(Po.isAncestor(f,r)||Po.equals(f,r))?Po.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:Po.endsBefore(f,r)||Po.equals(f,r)||Po.isAncestor(f,r)?(Po.endsBefore(d,r)&&(r[d.length-1]-=1),r[f.length-1]+=1):Po.endsBefore(d,r)&&(Po.equals(f,r)&&(r[f.length-1]+=1),r[d.length-1]-=1)}return r}};function Ro(e){return Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(e)}function To(e){var t=function(e,t){if("object"!==Ro(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ro(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ro(t)?t:String(t)}function No(e,t,n){return(t=To(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_o(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lo={transform(e,t){e.children=Co(e.children);var n=e.selection&&Co(e.selection);try{n=((e,t,n)=>{switch(n.type){case"insert_node":var{path:r,node:o}=n,i=Go.parent(e,r),a=r[r.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[u,s]of Uo.points(t))t[s]=ai.transform(u,n);break;case"insert_text":var{path:l,offset:c,text:d}=n;if(0===d.length)break;var f=Go.leaf(e,l),p=f.text.slice(0,c),h=f.text.slice(c);if(f.text=p+d+h,t)for(var[v,g]of Uo.points(t))t[g]=ai.transform(v,n);break;case"merge_node":var{path:m}=n,D=Go.get(e,m),b=Po.previous(m),C=Go.get(e,b),y=Go.parent(e,m),w=m[m.length-1];if(hi.isText(D)&&hi.isText(C))C.text+=D.text;else{if(hi.isText(D)||hi.isText(C))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(m,"] to nodes of different interfaces: ").concat(si.stringify(D)," ").concat(si.stringify(C)));C.children.push(...D.children)}if(y.children.splice(w,1),t)for(var[B,E]of Uo.points(t))t[E]=ai.transform(B,n);break;case"move_node":var{path:x,newPath:A}=n;if(Po.isAncestor(x,A))throw new Error("Cannot move a path [".concat(x,"] to new path [").concat(A,"] because the destination is inside itself."));var F=Go.get(e,x),O=Go.parent(e,x),k=x[x.length-1];O.children.splice(k,1);var S=Po.transform(x,n),j=Go.get(e,Po.parent(S)),P=S[S.length-1];if(j.children.splice(P,0,F),t)for(var[R,T]of Uo.points(t))t[T]=ai.transform(R,n);break;case"remove_node":var{path:N}=n,_=N[N.length-1];if(Go.parent(e,N).children.splice(_,1),t)for(var[M,L]of Uo.points(t)){var I=ai.transform(M,n);if(null!=t&&null!=I)t[L]=I;else{var z=void 0,W=void 0;for(var[V,q]of Go.texts(e)){if(-1!==Po.compare(q,N)){W=[V,q];break}z=[V,q]}var H=!1;z&&W&&(H=Po.equals(W[1],N)?!Po.hasPrevious(W[1]):Po.common(z[1],N).length<Po.common(W[1],N).length),z&&!H?(M.path=z[1],M.offset=z[0].text.length):W?(M.path=W[1],M.offset=0):t=null}}break;case"remove_text":var{path:U,offset:K,text:$}=n;if(0===$.length)break;var Y=Go.leaf(e,U),X=Y.text.slice(0,K),Z=Y.text.slice(K+$.length);if(Y.text=X+Z,t)for(var[G,J]of Uo.points(t))t[J]=ai.transform(G,n);break;case"set_node":var{path:Q,properties:ee,newProperties:te}=n;if(0===Q.length)throw new Error("Cannot set properties on the root node!");var ne=Go.get(e,Q);for(var re in te){if("children"===re||"text"===re)throw new Error('Cannot set the "'.concat(re,'" property of nodes!'));var oe=te[re];null==oe?delete ne[re]:ne[re]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete ne[ie];break;case"set_selection":var{newProperties:ae}=n;if(null==ae)t=ae;else{if(null==t){if(!Uo.isRange(ae))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(si.stringify(ae)," when there is no current selection."));t=Mo({},ae)}for(var ue in ae){var se=ae[ue];if(null==se){if("anchor"===ue||"focus"===ue)throw new Error('Cannot remove the "'.concat(ue,'" selection property'));delete t[ue]}else t[ue]=se}}break;case"split_node":var{path:le,position:ce,properties:de}=n;if(0===le.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(le,"] because the root node cannot be split."));var fe,pe=Go.get(e,le),he=Go.parent(e,le),ve=le[le.length-1];if(hi.isText(pe)){var ge=pe.text.slice(0,ce),me=pe.text.slice(ce);pe.text=ge,fe=Mo(Mo({},de),{},{text:me})}else{var De=pe.children.slice(0,ce),be=pe.children.slice(ce);pe.children=De,fe=Mo(Mo({},de),{},{children:be})}if(he.children.splice(ve+1,0,fe),t)for(var[Ce,ye]of Uo.points(t))t[ye]=ai.transform(Ce,n)}return t})(e,n,t)}finally{e.children=yo(e.children),e.selection=n?Nr(n)?yo(n):n:null}}},Io={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},zo={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Wo=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(kr(r)&&kr(o)){if(!Wo(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(r!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0};function Vo(e,t){if(null==e)return{};var n,r,o=function(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}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var qo=["anchor","focus"];function Ho(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Uo={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return Uo.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=Uo.edges(e);return t},equals:(e,t)=>ai.equals(e.anchor,t.anchor)&&ai.equals(e.focus,t.focus),includes(e,t){if(Uo.isRange(t)){if(Uo.includes(e,t.anchor)||Uo.includes(e,t.focus))return!0;var[n,r]=Uo.edges(e),[o,i]=Uo.edges(t);return ai.isBefore(n,o)&&ai.isAfter(r,i)}var[a,u]=Uo.edges(e),s=!1,l=!1;return ai.isPoint(t)?(s=ai.compare(t,a)>=0,l=ai.compare(t,u)<=0):(s=Po.compare(t,a.path)>=0,l=Po.compare(t,u.path)<=0),s&&l},intersection(e,t){var n=Vo(e,qo),[r,o]=Uo.edges(e),[i,a]=Uo.edges(t),u=ai.isBefore(r,i)?i:r,s=ai.isBefore(o,a)?o:a;return ai.isBefore(s,u)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ho(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ho(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({anchor:u,focus:s},n)},isBackward(e){var{anchor:t,focus:n}=e;return ai.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return ai.equals(t,n)},isExpanded:e=>!Uo.isCollapsed(e),isForward:e=>!Uo.isBackward(e),isRange:e=>kr(e)&&ai.isPoint(e.anchor)&&ai.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Uo.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return bo(e,(e=>{if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var a=Uo.isCollapsed(e);Uo.isForward(e)?(r="forward",o=a?r:"backward"):(r="backward",o=a?r:"forward")}else"outward"===i?Uo.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var u=ai.transform(e.anchor,t,{affinity:r}),s=ai.transform(e.focus,t,{affinity:o});if(!u||!s)return null;e.anchor=u,e.focus=s}))}},Ko=e=>kr(e)&&Go.isNodeList(e.children)&&!ni.isEditor(e),$o={isAncestor:e=>kr(e)&&Go.isNodeList(e.children),isElement:Ko,isElementList:e=>Array.isArray(e)&&e.every((e=>$o.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Ko(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Yo=["children"],Xo=["text"],Zo=new WeakMap,Go={ancestor(e,t){var n=Go.get(e,t);if(hi.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(si.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of Po.ancestors(t,n)){var o=[Go.ancestor(e,r),r];yield o}}()},child(e,t){if(hi.isText(e))throw new Error("Cannot get the child of a text node: ".concat(si.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(si.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Go.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a<i.length;){var u=Go.child(o,a),s=t.concat(a);yield[u,s],a=r?a-1:a+1}}()},common(e,t,n){var r=Po.common(t,n);return[Go.get(e,r),r]},descendant(e,t){var n=Go.get(e,t);if(ni.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(si.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Go.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Go.nodes(e,t))$o.isElement(n)&&(yield[n,r])}()},extractProps:e=>$o.isAncestor(e)?Vo(e,Yo):Vo(e,Xo),first(e,t){for(var n=t.slice(),r=Go.get(e,n);r&&!hi.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(hi.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(si.stringify(e)));var n=bo({children:e.children},(e=>{var[n,r]=Uo.edges(t),o=Go.nodes(e,{reverse:!0,pass:e=>{var[,n]=e;return!Uo.includes(t,n)}});for(var[,i]of o){if(!Uo.includes(t,i)){var a=Go.parent(e,i),u=i[i.length-1];a.children.splice(u,1)}if(Po.equals(i,r.path)){var s=Go.leaf(e,i);s.text=s.text.slice(0,r.offset)}if(Po.equals(i,n.path)){var l=Go.leaf(e,i);l.text=l.text.slice(n.offset)}}ni.isEditor(e)&&(e.selection=null)}));return n.children},get(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(hi.isText(n)||!n.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(si.stringify(e)));n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(hi.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isNode:e=>hi.isText(e)||$o.isElement(e)||ni.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Zo.get(e);if(void 0!==t)return t;var n=e.every((e=>Go.isNode(e)));return Zo.set(e,n),n},last(e,t){for(var n=t.slice(),r=Go.get(e,n);r&&!hi.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Go.get(e,t);if(!hi.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(si.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of Po.levels(t,n)){var o=Go.get(e,r);yield[o,r]}}()},matches:(e,t)=>$o.isElement(e)&&$o.isElementProps(t)&&$o.matches(e,t)||hi.isText(e)&&hi.isTextProps(t)&&hi.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,u=[],s=e;!i||!(r?Po.isBefore(u,i):Po.isAfter(u,i));)if(a.has(s)||(yield[s,u]),a.has(s)||hi.isText(s)||0===s.children.length||null!=n&&!1!==n([s,u])){if(0===u.length)break;if(!r){var l=Po.next(u);if(Go.has(e,l)){u=l,s=Go.get(e,u);continue}}if(r&&0!==u[u.length-1])u=Po.previous(u),s=Go.get(e,u);else u=Po.parent(u),s=Go.get(e,u),a.add(s)}else{a.add(s);var c=r?s.children.length-1:0;Po.isAncestor(u,o)&&(c=o[u.length]),u=u.concat(c),s=Go.get(e,u)}}()},parent(e,t){var n=Po.parent(t),r=Go.get(e,n);if(hi.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>hi.isText(e)?e.text:e.children.map(Go.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Go.nodes(e,t))hi.isText(n)&&(yield[n,r])}()}};function Jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ei={isNodeOperation:e=>ei.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!kr(e))return!1;switch(e.type){case"insert_node":case"remove_node":return Po.isPath(e.path)&&Go.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&Po.isPath(e.path);case"merge_node":return"number"==typeof e.position&&Po.isPath(e.path)&&kr(e.properties);case"move_node":return Po.isPath(e.path)&&Po.isPath(e.newPath);case"set_node":return Po.isPath(e.path)&&kr(e.properties)&&kr(e.newProperties);case"set_selection":return null===e.properties&&Uo.isRange(e.newProperties)||null===e.newProperties&&Uo.isRange(e.properties)||kr(e.properties)&&kr(e.newProperties);case"split_node":return Po.isPath(e.path)&&"number"==typeof e.position&&kr(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>ei.isOperation(e))),isSelectionOperation:e=>ei.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>ei.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Qo(Qo({},e),{},{type:"remove_node"});case"insert_text":return Qo(Qo({},e),{},{type:"remove_text"});case"merge_node":return Qo(Qo({},e),{},{type:"split_node",path:Po.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(Po.equals(t,n))return e;if(Po.isSibling(n,t))return Qo(Qo({},e),{},{path:t,newPath:n});var r=Po.transform(n,e),o=Po.transform(Po.next(n),e);return Qo(Qo({},e),{},{path:r,newPath:o});case"remove_node":return Qo(Qo({},e),{},{type:"insert_node"});case"remove_text":return Qo(Qo({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Qo(Qo({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:u,newProperties:s}=e;return Qo(Qo({},e),{},null==u?{properties:s,newProperties:null}:null==s?{properties:null,newProperties:u}:{properties:s,newProperties:u});case"split_node":return Qo(Qo({},e),{},{type:"merge_node",path:Po.next(e.path)})}}},ti=new WeakMap,ni={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:e=>(e=>{var t=ti.get(e);if(void 0!==t)return t;if(!kr(e))return!1;var n="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||kr(e.marks))&&(null===e.selection||Uo.isRange(e.selection))&&Go.isNodeList(e.children)&&ei.isOperationList(e.operations);return ti.set(e,n),n})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}},ri={isSpan:e=>Array.isArray(e)&&2===e.length&&e.every(Po.isPath)};function oi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oi(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ai={compare(e,t){var n=Po.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===ai.compare(e,t),isBefore:(e,t)=>-1===ai.compare(e,t),equals:(e,t)=>e.offset===t.offset&&Po.equals(e.path,t.path),isPoint:e=>kr(e)&&"number"==typeof e.offset&&Po.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return bo(e,(e=>{if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=Po.transform(o,t,n);break;case"insert_text":Po.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(e.offset+=t.text.length);break;case"merge_node":Po.equals(t.path,o)&&(e.offset+=t.position),e.path=Po.transform(o,t,n);break;case"remove_text":Po.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(Po.equals(t.path,o)||Po.isAncestor(t.path,o))return null;e.path=Po.transform(o,t,n);break;case"split_node":if(Po.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(e.offset-=t.position,e.path=Po.transform(o,t,ii(ii({},n),{},{affinity:"forward"})))}else e.path=Po.transform(o,t,n)}}))}},ui=void 0,si={setScrubber(e){ui=e},stringify:e=>JSON.stringify(e,ui)},li=["text"],ci=["anchor","focus"];function di(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?di(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):di(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pi,hi={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){return Vo(e,li)}return Wo(r?o(e):e,r?o(t):t)},isText:e=>kr(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>hi.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[fi({},e)];for(var r of t){var o=Vo(r,ci),[i,a]=Uo.edges(r),u=[],s=0,l=i.offset,c=a.offset;for(var d of n){var{length:f}=d.text,p=s;if(s+=f,l<=p&&s<=c)Object.assign(d,o),u.push(d);else if(l!==c&&(l===s||c===p)||l>s||c<p||c===p&&0!==p)u.push(d);else{var h=d,v=void 0,g=void 0;if(c<s){var m=c-p;g=fi(fi({},h),{},{text:h.text.slice(m)}),h=fi(fi({},h),{},{text:h.text.slice(0,m)})}if(l>p){var D=l-p;v=fi(fi({},h),{},{text:h.text.slice(0,D)}),h=fi(fi({},h),{},{text:h.text.slice(D)})}Object.assign(h,o),v&&u.push(v),u.push(h),g&&u.push(g)}}n=u}return n}},vi=e=>e.selection?e.selection:e.children.length>0?ni.end(e,[]):[0],gi=(e,t)=>{var[n]=ni.node(e,t);return e=>e===n},mi=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?Bi(e):e,o=pi.None,i=pi.None,a=0,u=null;for(var s of r){var l=s.codePointAt(0);if(!l)break;var c=Ni(s,l);if([o,i]=n?[i,c]:[c,o],_i(o,pi.ZWJ)&&_i(i,pi.ExtPict)&&!zi(n?e.substring(0,a):e.substring(0,e.length-a)))break;if(_i(o,pi.RI)&&_i(i,pi.RI)&&!(u=null!==u?!u:!!n||Vi(e.substring(0,e.length-a))))break;if(o!==pi.None&&i!==pi.None&&Li(o,i))break;a+=s.length}return a||1},Di=/\s/,bi=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Ci=/['\u2018\u2019]/,yi=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},wi=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Di.test(t))return!1;if(Ci.test(t)){var o=mi(n,r),[i,a]=yi(n,o,r);if(e(i,a,r))return!0}return!bi.test(t)},Bi=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(xi(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(Ei(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},Ei=e=>e>=55296&&e<=56319,xi=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(pi||(pi={}));var Ai=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,Fi=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Oi=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,ki=/^[\u1100-\u115F\uA960-\uA97C]$/,Si=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,ji=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Pi=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,Ri=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Ti=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,Ni=(e,t)=>{var n=pi.Any;return-1!==e.search(Ai)&&(n|=pi.Extend),8205===t&&(n|=pi.ZWJ),t>=127462&&t<=127487&&(n|=pi.RI),-1!==e.search(Fi)&&(n|=pi.Prepend),-1!==e.search(Oi)&&(n|=pi.SpacingMark),-1!==e.search(ki)&&(n|=pi.L),-1!==e.search(Si)&&(n|=pi.V),-1!==e.search(ji)&&(n|=pi.T),-1!==e.search(Pi)&&(n|=pi.LV),-1!==e.search(Ri)&&(n|=pi.LVT),-1!==e.search(Ti)&&(n|=pi.ExtPict),n};function _i(e,t){return 0!=(e&t)}var Mi=[[pi.L,pi.L|pi.V|pi.LV|pi.LVT],[pi.LV|pi.V,pi.V|pi.T],[pi.LVT|pi.T,pi.T],[pi.Any,pi.Extend|pi.ZWJ],[pi.Any,pi.SpacingMark],[pi.Prepend,pi.Any],[pi.ZWJ,pi.ExtPict],[pi.RI,pi.RI]];function Li(e,t){return-1===Mi.findIndex((n=>_i(e,n[0])&&_i(t,n[1])))}var Ii=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,zi=e=>-1!==e.search(Ii),Wi=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Vi=e=>{var t=e.match(Wi);return null!==t&&t[0].length/2%2==1},qi={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ni.withoutNormalizing(e,(()=>{var{voids:r=!1}=n,{at:o=vi(e)}=n;if(Po.isPath(o)&&(o=ni.range(e,o)),Uo.isRange(o))if(Uo.isCollapsed(o))o=o.anchor;else{var i=Uo.end(o);if(!r&&ni.void(e,{at:i}))return;var a=Uo.start(o),u=ni.pointRef(e,a),s=ni.pointRef(e,i);Ki.delete(e,{at:o,voids:r});var l=u.unref(),c=s.unref();o=l||c,Ki.setSelection(e,{anchor:o,focus:o})}if(!(!r&&ni.void(e,{at:o})||ni.elementReadOnly(e,{at:o}))){var{path:d,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:f,text:t})}}))}};function Hi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ui(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hi(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ki=Ui(Ui(Ui(Ui({},Lo),Io),zo),qi),$i=new WeakMap;function Yi(e,t,n){var r,o,i=xo.get(e)||[],a=Ao.get(e)||new Set,u=e=>{if(e){var t=e.join(",");o.has(t)||(o.add(t),r.push(e))}};if(n)for(var s of(r=[],o=new Set,i)){u(n(s))}else r=i,o=a;for(var l of t)u(l);xo.set(e,r),Ao.set(e,o)}var Xi=(e,t)=>{for(var n of ni.pathRefs(e))wo.transform(n,t);for(var r of ni.pointRefs(e))Bo.transform(r,t);for(var o of ni.rangeRefs(e))Eo.transform(o,t);if(!(e=>$i.get(e)||!1)(e)){var i=Po.operationCanTransformPath(t)?e=>Po.transform(e,t):void 0;Yi(e,e.getDirtyPaths(t),i)}Ki.transform(e,t),e.operations.push(t),ni.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),Fo.get(e)||(Fo.set(e,!0),Promise.resolve().then((()=>{Fo.set(e,!1),e.onChange({operation:t}),e.operations=[]})))};function Zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zi(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ji(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ji(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ji(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ea(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ea(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ea(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function na(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?na(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):na(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function aa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ua=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aa(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({text:t},o);Ki.insertNodes(e,i,{at:n.at,voids:n.voids})}else Ki.insertText(e,t,n);e.marks=null}};var sa=["text"],la=["text"];var ca=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:r}=t,o=e=>xo.get(e)||[],i=e=>{var t=o(e).pop(),n=t.join(",");return(e=>Ao.get(e)||new Set)(e).delete(n),t};if(ni.isNormalizing(e)){if(n){var a=Array.from(Go.nodes(e),(e=>{var[,t]=e;return t})),u=new Set(a.map((e=>e.join(","))));xo.set(e,a),Ao.set(e,u)}0!==o(e).length&&ni.withoutNormalizing(e,(()=>{for(var t of o(e))if(Go.has(e,t)){var n=ni.node(e,t),[a,u]=n;$o.isElement(a)&&0===a.children.length&&e.normalizeNode(n,{operation:r})}for(var s=o(e),l=s.length,c=0;0!==s.length;){if(!e.shouldNormalize({dirtyPaths:s,iteration:c,initialDirtyPathsLength:l,operation:r}))return;var d=i(e);if(Go.has(e,d)){var f=ni.node(e,d);e.normalizeNode(f,{operation:r})}c++,s=o(e)}}))}};function da(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1,ignoreNonSelectable:a=!1}=t;if(n){var u=ni.range(e,n),[s,l]=Uo.edges(u),c=o?l:s,d=!1,f="",p=0,h=0,v=0;for(var[g,m]of ni.nodes(e,{at:n,reverse:o,voids:i,ignoreNonSelectable:a})){if($o.isElement(g)){if(!i&&(e.isVoid(g)||e.isElementReadOnly(g))){yield ni.start(e,m);continue}if(e.isInline(g))continue;if(ni.hasInlines(e,g)){var D=Po.isAncestor(m,l.path)?l:ni.end(e,m),b=Po.isAncestor(m,s.path)?s:ni.start(e,m);f=ni.string(e,{anchor:b,focus:D},{voids:i}),d=!0}}if(hi.isText(g)){var C=Po.equals(m,c.path);for(C?(h=o?c.offset:g.text.length-c.offset,v=c.offset):(h=g.text.length,v=o?h:0),(C||d||"offset"===r)&&(yield{path:m,offset:v},d=!1);;){if(0===p){if(""===f)break;p=y(f,r,o),f=yi(f,p,o)[1]}if(v=o?v-p:v+p,(h-=p)<0){p=-h;break}p=0,yield{path:m,offset:v}}}}}function y(e,t,n){return"character"===t?mi(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=mi(e,t),[i,a]=yi(e,o,t);if(wi(i,a,t))r=!0,n+=o;else{if(r)break;n+=o}e=a}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}function fa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var pa=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!hi.isText(t))return!1;var[r,o]=ni.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},o=Uo.isExpanded(n),i=!1;if(!o){var[a,u]=ni.node(e,n);if(a&&r(a,u)){var[s]=ni.parent(e,u);i=s&&e.markableVoid(s)}}if(o||i)Ki.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fa(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},ni.marks(e)||{});delete l[t],e.marks=l,Fo.get(e)||e.onChange()}}};function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function va(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ha(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ga=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ni.withoutNormalizing(e,(()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:a=!0}=n,{at:u,match:s,select:l}=n;if(Go.isNode(t)&&(t=[t]),0!==t.length){var[c]=t;if(u||(u=vi(e),!1!==l&&(l=!0)),null==l&&(l=!1),Uo.isRange(u))if(r||(u=ni.unhangRange(e,u,{voids:o})),Uo.isCollapsed(u))u=u.anchor;else{var[,d]=Uo.edges(u),f=ni.pointRef(e,d);Ki.delete(e,{at:u}),u=f.unref()}if(ai.isPoint(u)){null==s&&(s=hi.isText(c)?e=>hi.isText(e):e.isInline(c)?t=>hi.isText(t)||ni.isInline(e,t):t=>$o.isElement(t)&&ni.isBlock(e,t));var[p]=ni.nodes(e,{at:u.path,match:s,mode:i,voids:o});if(!p)return;var[,h]=p,v=ni.pathRef(e,h),g=ni.isEnd(e,u,h);Ki.splitNodes(e,{at:u,match:s,mode:i,voids:o});var m=v.unref();u=g?Po.next(m):m}var D=Po.parent(u),b=u[u.length-1];if(o||!ni.void(e,{at:D})){if(a){var C=[],y=Po.levels(D);((e,t,n)=>{var r=$i.get(e)||!1;$i.set(e,!0);try{t(),n()}finally{$i.set(e,r)}})(e,(()=>{var n=function(){var t=D.concat(b);b++;var n={type:"insert_node",path:t,node:r};e.apply(n),u=Po.next(u),C.push(n),hi.isText?y.push(...Array.from(Go.nodes(r),(e=>{var[,n]=e;return t.concat(n)}))):y.push(t)};for(var r of t)n()}),(()=>{Yi(e,y,(e=>{var t=e;for(var n of C)if(Po.operationCanTransformPath(n)&&!(t=Po.transform(t,n)))return null;return t}))}))}else for(var w of t){var B=D.concat(b);b++,e.apply({type:"insert_node",path:B,node:w}),u=Po.next(u)}if(u=Po.previous(u),l){var E=ni.end(e,u);E&&Ki.select(e,E)}}}}))},ma=["text"],Da=["children"],ba=(e,t)=>{if($o.isElement(t)){var n=t;return!!ni.isVoid(e,t)||1===n.children.length&&ba(e,n.children[0])}return!ni.isEditor(t)},Ca=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni.withoutNormalizing(e,(()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:u=!1}=t;if(null==o&&(o=t=>$o.isElement(t)&&ni.isBlock(e,t)),Uo.isRange(i)&&(i=((e,t)=>{if(Uo.isCollapsed(t))return t.anchor;var[,n]=Uo.edges(t),r=ni.pointRef(e,n);return Ki.delete(e,{at:t}),r.unref()})(e,i)),Po.isPath(i)){var s=i,l=ni.point(e,s),[c]=ni.parent(e,s);o=e=>e===c,a=l.path.length-s.length+1,i=l,u=!0}if(i){var d,f=ni.pointRef(e,i,{affinity:"backward"});try{var[p]=ni.nodes(e,{at:i,match:o,mode:n,voids:r});if(!p)return;var h=ni.void(e,{at:i,mode:"highest"});if(!r&&h){var[v,g]=h;if($o.isElement(v)&&e.isInline(v)){var m=ni.after(e,g);if(!m){var D=Po.next(g);Ki.insertNodes(e,{text:""},{at:D,voids:r}),m=ni.point(e,D)}i=m,u=!0}a=i.path.length-g.length+1,u=!0}d=ni.pointRef(e,i);var b=i.path.length-a,[,C]=p,y=i.path.slice(0,b),w=0===a?i.offset:i.path[b]+0;for(var[B,E]of ni.levels(e,{at:y,reverse:!0,voids:r})){var x=!1;if(E.length<C.length||0===E.length||!r&&$o.isElement(B)&&ni.isVoid(e,B))break;var A=f.current,F=ni.isEnd(e,A,E);if(u||!f||!ni.isEdge(e,A,E)){x=!0;var O=Go.extractProps(B);e.apply({type:"split_node",path:E,position:w,properties:O})}w=E[E.length-1]+(x||F?1:0)}if(null==t.at){var k=d.current||ni.end(e,[]);Ki.select(e,k)}}finally{var S;f.unref(),null===(S=d)||void 0===S||S.unref()}}}))};function ya(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ya(Object(n),!0).forEach((function(t){No(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ya(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ba,Ea=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xi(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var{selection:r}=e;if(r){var o=(t,n)=>{if(!hi.isText(t))return!1;var[r,o]=ni.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=Uo.isExpanded(r),a=!1;if(!i){var[u,s]=ni.node(e,r);if(u&&o(u,s)){var[l]=ni.parent(e,s);a=l&&e.markableVoid(l)}}if(i||a)Ki.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var c=Gi(Gi({},ni.marks(e)||{}),{},{[t]:n});e.marks=c,Fo.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Uo.isCollapsed(n)&&Ki.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Uo.isCollapsed(n)&&Ki.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{direction:t="forward"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e;n&&Uo.isExpanded(n)&&Ki.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;return t?Go.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{Ki.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{Ki.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ni.withoutNormalizing(e,(()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=vi(e),batchDirty:a=!0}=n;if(t.length){if(Uo.isRange(i))if(r||(i=ni.unhangRange(e,i,{voids:o})),Uo.isCollapsed(i))i=i.anchor;else{var[,u]=Uo.edges(i);if(!o&&ni.void(e,{at:u}))return;var s=ni.pointRef(e,u);Ki.delete(e,{at:i}),i=s.unref()}else Po.isPath(i)&&(i=ni.start(e,i));if(o||!ni.void(e,{at:i})){var l=ni.above(e,{at:i,match:t=>$o.isElement(t)&&ni.isInline(e,t),mode:"highest",voids:o});if(l){var[,c]=l;ni.isEnd(e,i,c)?i=ni.after(e,c):ni.isStart(e,i,c)&&(i=ni.before(e,c))}var d=ni.above(e,{match:t=>$o.isElement(t)&&ni.isBlock(e,t),at:i,voids:o}),[,f]=d,p=ni.isStart(e,i,f),h=ni.isEnd(e,i,f),v=p&&h,g=!p||p&&h,m=!h,[,D]=Go.first({children:t},[]),[,b]=Go.last({children:t},[]),C=[],y=t=>{var[n,r]=t;return!(0===r.length||!v&&(g&&Po.isAncestor(r,D)&&$o.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||m&&Po.isAncestor(r,b)&&$o.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))};for(var w of Go.nodes({children:t},{pass:y}))y(w)&&C.push(w);var B=[],E=[],x=[],A=!0,F=!1;for(var[O]of C)$o.isElement(O)&&!e.isInline(O)?(A=!1,F=!0,E.push(O)):A?B.push(O):x.push(O);var[k]=ni.nodes(e,{at:i,match:t=>hi.isText(t)||ni.isInline(e,t),mode:"highest",voids:o}),[,S]=k,j=ni.isStart(e,i,S),P=ni.isEnd(e,i,S),R=ni.pathRef(e,h&&!x.length?Po.next(f):f),T=ni.pathRef(e,P?Po.next(S):S);Ki.splitNodes(e,{at:i,match:t=>F?$o.isElement(t)&&ni.isBlock(e,t):hi.isText(t)||ni.isInline(e,t),mode:F?"lowest":"highest",always:F&&(!p||B.length>0)&&(!h||x.length>0),voids:o});var N,_=ni.pathRef(e,!j||j&&P?Po.next(S):S);if(Ki.insertNodes(e,B,{at:_.current,match:t=>hi.isText(t)||ni.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),v&&!B.length&&E.length&&!x.length&&Ki.delete(e,{at:f,voids:o}),Ki.insertNodes(e,E,{at:R.current,match:t=>$o.isElement(t)&&ni.isBlock(e,t),mode:"lowest",voids:o,batchDirty:a}),Ki.insertNodes(e,x,{at:T.current,match:t=>hi.isText(t)||ni.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),!n.at&&(x.length>0&&T.current?N=Po.previous(T.current):E.length>0&&R.current?N=Po.previous(R.current):_.current&&(N=Po.previous(_.current)),N)){var M=ni.end(e,N);Ki.select(e,M)}_.unref(),R.unref(),T.unref()}}}))}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{Ki.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ua(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var[n,r]=t;if(!hi.isText(n))if($o.isElement(n)&&0===n.children.length)Ki.insertNodes(e,{text:""},{at:r.concat(0),voids:!0});else for(var o=!ni.isEditor(n)&&$o.isElement(n)&&(e.isInline(n)||0===n.children.length||hi.isText(n.children[0])||e.isInline(n.children[0])),i=0,a=0;a<n.children.length;a++,i++){var u=Go.get(e,r);if(!hi.isText(u)){var s=u.children[i],l=u.children[i-1],c=a===n.children.length-1;(hi.isText(s)||$o.isElement(s)&&e.isInline(s))!==o?(Ki.removeNodes(e,{at:r.concat(i),voids:!0}),i--):$o.isElement(s)?e.isInline(s)&&(null!=l&&hi.isText(l)?c&&(Ki.insertNodes(e,{text:""},{at:r.concat(i+1),voids:!0}),i++):(Ki.insertNodes(e,{text:""},{at:r.concat(i),voids:!0}),i++)):null!=l&&hi.isText(l)&&(hi.equals(s,l,{loose:!0})?(Ki.mergeNodes(e,{at:r.concat(i),voids:!0}),i--):""===l.text?(Ki.removeNodes(e,{at:r.concat(i-1),voids:!0}),i--):""===s.text&&(Ki.removeNodes(e,{at:r.concat(i),voids:!0}),i--))}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pa(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return Po.levels(n);case"insert_node":var{node:r,path:o}=t,i=Po.levels(o),a=hi.isText(r)?[]:Array.from(Go.nodes(r),(e=>{var[,t]=e;return o.concat(t)}));return[...i,...a];case"merge_node":var{path:u}=t;return[...Po.ancestors(u),Po.previous(u)];case"move_node":var{path:s,newPath:l}=t;if(Po.equals(s,l))return[];var c=[],d=[];for(var f of Po.ancestors(s)){var p=Po.transform(f,t);c.push(p)}for(var h of Po.ancestors(l)){var v=Po.transform(h,t);d.push(v)}var g=d[d.length-1],m=l[l.length-1],D=g.concat(m);return[...c,...d,D];case"remove_node":var{path:b}=t;return[...Po.ancestors(b)];case"split_node":var{path:C}=t;return[...Po.levels(C),Po.next(C)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,o=42*r;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=ni.path(e,o),u="lowest"===r;for(var[s,l]of ni.levels(e,{at:a,voids:n,match:i,reverse:u}))if(!hi.isText(s))if(Uo.isRange(o)){if(Po.isAncestor(l,o.anchor.path)&&Po.isAncestor(l,o.focus.path))return[s,l]}else if(!Po.equals(a,l))return[s,l]}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:ni.point(e,t,{edge:"end"}),focus:ni.end(e,[])},{distance:i=1}=r,a=0;for(var u of ni.positions(e,Qi(Qi({},r),{},{at:o}))){if(a>i)break;0!==a&&(n=u),a++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:ni.start(e,[]),focus:ni.point(e,t,{edge:"start"})},{distance:i=1}=r,a=0;for(var u of ni.positions(e,ta(ta({},r),{},{at:o,reverse:!0}))){if(a>i)break;0!==a&&(n=u),a++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)Ki.select(e,r.anchor);else if("focus"===n)Ki.select(e,r.focus);else if("start"===n){var[o]=Uo.edges(r);Ki.select(e,o)}else if("end"===n){var[,i]=Uo.edges(r);Ki.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni.withoutNormalizing(e,(()=>{var n,r,{reverse:o=!1,unit:i="character",distance:a=1,voids:u=!1}=t,{at:s=e.selection,hanging:l=!1}=t;if(s){var c=!1;if(Uo.isRange(s)&&Uo.isCollapsed(s)&&(c=!0,s=s.anchor),ai.isPoint(s)){var d=ni.void(e,{at:s,mode:"highest"});if(!u&&d){var[,f]=d;s=f}else{var p={unit:i,distance:a};s={anchor:s,focus:o?ni.before(e,s,p)||ni.start(e,[]):ni.after(e,s,p)||ni.end(e,[])},l=!0}}if(Po.isPath(s))Ki.removeNodes(e,{at:s,voids:u});else if(!Uo.isCollapsed(s)){if(!l){var[,h]=Uo.edges(s),v=ni.end(e,[]);ai.equals(h,v)||(s=ni.unhangRange(e,s,{voids:u}))}var[g,m]=Uo.edges(s),D=ni.above(e,{match:t=>$o.isElement(t)&&ni.isBlock(e,t),at:g,voids:u}),b=ni.above(e,{match:t=>$o.isElement(t)&&ni.isBlock(e,t),at:m,voids:u}),C=D&&b&&!Po.equals(D[1],b[1]),y=Po.equals(g.path,m.path),w=u?null:null!==(n=ni.void(e,{at:g,mode:"highest"}))&&void 0!==n?n:ni.elementReadOnly(e,{at:g,mode:"highest"}),B=u?null:null!==(r=ni.void(e,{at:m,mode:"highest"}))&&void 0!==r?r:ni.elementReadOnly(e,{at:m,mode:"highest"});if(w){var E=ni.before(e,g);E&&D&&Po.isAncestor(D[1],E.path)&&(g=E)}if(B){var x=ni.after(e,m);x&&b&&Po.isAncestor(b[1],x.path)&&(m=x)}var A,F=[];for(var O of ni.nodes(e,{at:s,voids:u})){var[k,S]=O;A&&0===Po.compare(S,A)||(!u&&$o.isElement(k)&&(ni.isVoid(e,k)||ni.isElementReadOnly(e,k))||!Po.isCommon(S,g.path)&&!Po.isCommon(S,m.path))&&(F.push(O),A=S)}var j=Array.from(F,(t=>{var[,n]=t;return ni.pathRef(e,n)})),P=ni.pointRef(e,g),R=ni.pointRef(e,m),T="";if(!y&&!w){var N=P.current,[_]=ni.leaf(e,N),{path:M}=N,{offset:L}=g,I=_.text.slice(L);I.length>0&&(e.apply({type:"remove_text",path:M,offset:L,text:I}),T=I)}if(j.reverse().map((e=>e.unref())).filter((e=>null!==e)).forEach((t=>Ki.removeNodes(e,{at:t,voids:u}))),!B){var z=R.current,[W]=ni.leaf(e,z),{path:V}=z,q=y?g.offset:0,H=W.text.slice(q,m.offset);H.length>0&&(e.apply({type:"remove_text",path:V,offset:q,text:H}),T=H)}!y&&C&&R.current&&P.current&&Ki.mergeNodes(e,{at:R.current,hanging:!0,voids:u}),c&&o&&"character"===i&&T.length>1&&T.match(/[\u0E00-\u0E7F]+/)&&Ki.insertText(e,T.slice(0,T.length-a));var U=P.unref(),K=R.unref(),$=o?U||K:K||U;null==t.at&&$&&Ki.select(e,$)}}}))}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>[ni.start(e,t),ni.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ni.above(e,ra(ra({},t),{},{match:t=>$o.isElement(t)&&ni.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>ni.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=ni.path(e,t,{edge:"start"});return ni.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=ni.range(e,t);return Go.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:o}=n;if(t)return t;if(Uo.isExpanded(n)){if(ni.isEnd(e,r,r.path)){var i=ni.after(e,r);i&&(r=i)}var[a]=ni.nodes(e,{match:hi.isText,at:{anchor:r,focus:o}});if(a){var[u]=a;return Vo(u,sa)}return{}}var{path:s}=r,[l]=ni.leaf(e,s);if(0===r.offset){var c=ni.previous(e,{at:s,match:hi.isText}),d=ni.above(e,{match:t=>$o.isElement(t)&&ni.isVoid(e,t)&&e.markableVoid(t)});if(!d){var f=ni.above(e,{match:t=>$o.isElement(t)&&ni.isBlock(e,t)});if(c&&f){var[p,h]=c,[,v]=f;Po.isAncestor(v,h)&&(l=p)}}}return Vo(l,la)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some((t=>$o.isElement(t)&&ni.isBlock(e,t))))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some((t=>hi.isText(t)||ni.isInline(e,t))))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Go.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.every((e=>hi.isText(e))))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ga(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>ni.isStart(e,t,n)||ni.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&hi.isText(r)&&""===r.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var r=ni.end(e,n);return ai.equals(t,r)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=Oo.get(e);return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{if(0!==t.offset)return!1;var r=ni.start(e,n);return ai.equals(t,r)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=ni.path(e,t,{edge:"end"});return ni.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ni.path(e,t,n);return[Go.leaf(e,r),r]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var a=[],u=ni.path(e,n);for(var[s,l]of Go.levels(e,u))if(i(s,l)&&(a.push([s,l]),!o&&$o.isElement(s)&&ni.isVoid(e,s)))break;r&&a.reverse(),yield*a}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni.withoutNormalizing(e,(()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(null==i&&(i=Po.isPath(n)?gi(e,n):t=>$o.isElement(t)&&ni.isBlock(e,t)),n){var a=ni.nodes(e,{at:n,match:i,mode:r,voids:o}),u=Array.from(a,(t=>{var[,n]=t;return ni.pathRef(e,n)}));for(var s of u){var l=s.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=ni.node(e,Po.parent(l)),[d,f]=c,p=l[l.length-1],{length:h}=d.children;if(1===h){var v=Po.next(f);Ki.moveNodes(e,{at:l,to:v,voids:o}),Ki.removeNodes(e,{at:f,voids:o})}else if(0===p)Ki.moveNodes(e,{at:l,to:f,voids:o});else if(p===h-1){var g=Po.next(f);Ki.moveNodes(e,{at:l,to:g,voids:o})}else{var m=Po.next(l),D=Po.next(f);Ki.splitNodes(e,{at:m,voids:o}),Ki.moveNodes(e,{at:l,to:D,voids:o})}}}}))}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni.withoutNormalizing(e,(()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){if(null==n)if(Po.isPath(r)){var[u]=ni.parent(e,r);n=e=>u.children.includes(e)}else n=t=>$o.isElement(t)&&ni.isBlock(e,t);if(!o&&Uo.isRange(r)&&(r=ni.unhangRange(e,r,{voids:i})),Uo.isRange(r))if(Uo.isCollapsed(r))r=r.anchor;else{var[,s]=Uo.edges(r),l=ni.pointRef(e,s);Ki.delete(e,{at:r}),r=l.unref(),null==t.at&&Ki.select(e,r)}var[c]=ni.nodes(e,{at:r,match:n,voids:i,mode:a}),d=ni.previous(e,{at:r,match:n,voids:i,mode:a});if(c&&d){var[f,p]=c,[h,v]=d;if(0!==p.length&&0!==v.length){var g,m,D=Po.next(v),b=Po.common(p,v),C=Po.isSibling(p,v),y=Array.from(ni.levels(e,{at:p}),(e=>{var[t]=e;return t})).slice(b.length).slice(0,-1),w=ni.above(e,{at:p,mode:"highest",match:t=>y.includes(t)&&ba(e,t)}),B=w&&ni.pathRef(e,w[1]);if(hi.isText(f)&&hi.isText(h)){var E=Vo(f,ma);m=h.text.length,g=E}else{if(!$o.isElement(f)||!$o.isElement(h))throw new Error("Cannot merge the node at path [".concat(p,"] with the previous sibling because it is not the same kind: ").concat(si.stringify(f)," ").concat(si.stringify(h)));E=Vo(f,Da),m=h.children.length,g=E}C||Ki.moveNodes(e,{at:p,to:D,voids:i}),B&&Ki.removeNodes(e,{at:B.current,voids:i}),$o.isElement(h)&&ni.isEmpty(e,h)||hi.isText(h)&&""===h.text&&0!==v[v.length-1]?Ki.removeNodes(e,{at:v,voids:i}):e.apply({type:"merge_node",path:D,position:m,properties:g}),B&&B.unref()}}}}))}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){"start"===a&&(a=Uo.isBackward(n)?"focus":"anchor"),"end"===a&&(a=Uo.isBackward(n)?"anchor":"focus");var{anchor:u,focus:s}=n,l={distance:r,unit:o,ignoreNonSelectable:!0},c={};if(null==a||"anchor"===a){var d=i?ni.before(e,u,l):ni.after(e,u,l);d&&(c.anchor=d)}if(null==a||"focus"===a){var f=i?ni.before(e,s,l):ni.after(e,s,l);f&&(c.focus=f)}Ki.setSelection(e,c)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{ni.withoutNormalizing(e,(()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){null==a&&(a=Po.isPath(r)?gi(e,r):t=>$o.isElement(t)&&ni.isBlock(e,t));var u=ni.pathRef(e,n),s=ni.nodes(e,{at:r,match:a,mode:o,voids:i}),l=Array.from(s,(t=>{var[,n]=t;return ni.pathRef(e,n)}));for(var c of l){var d=c.unref(),f=u.current;0!==d.length&&e.apply({type:"move_node",path:d,newPath:f}),u.current&&Po.isSibling(f,d)&&Po.isAfter(f,d)&&(u.current=Po.next(u.current))}u.unref()}}))})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=ni.after(e,i,{voids:r});if(a){var[,u]=ni.last(e,[]),s=[a.path,u];if(Po.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(Po.isPath(i)){var[l]=ni.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=ni.nodes(e,{at:s,match:o,mode:n,voids:r});return c}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ni.path(e,t,n),o=Go.get(e,r);return[o,r]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1,ignoreNonSelectable:u=!1}=t,{match:s}=t;if(s||(s=()=>!0),n){var l,c;if(ri.isSpan(n))l=n[0],c=n[1];else{var d=ni.path(e,n,{edge:"start"}),f=ni.path(e,n,{edge:"end"});l=i?f:d,c=i?d:f}var p,h=Go.nodes(e,{reverse:i,from:l,to:c,pass:t=>{var[n]=t;return!(!$o.isElement(n)||(a||!ni.isVoid(e,n)&&!ni.isElementReadOnly(e,n))&&(!u||ni.isSelectable(e,n)))}}),v=[];for(var[g,m]of h)if(!u||!$o.isElement(g)||ni.isSelectable(e,g)){var D=p&&0===Po.compare(m,p[1]);if("highest"!==r||!D)if(s(g,m))if("lowest"===r&&D)p=[g,m];else{var b="lowest"===r?p:[g,m];b&&(o?v.push(b):yield b),p=[g,m]}else if(o&&!D&&hi.isText(g))return}"lowest"===r&&p&&(o?v.push(p):yield p),o&&(yield*v)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ca(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ni.path(e,t,n),o=Po.parent(r);return ni.node(e,o)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(Po.isPath(t))if("start"===o){var[,i]=Go.first(e,t);t=i}else if("end"===o){var[,a]=Go.last(e,t);t=a}return Uo.isRange(t)&&(t="start"===o?Uo.start(t):"end"===o?Uo.end(t):Po.common(t.anchor.path,t.focus.path)),ai.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return ni.pathRefs(e).delete(o),o.current=null,t}};return ni.pathRefs(e).add(o),o}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=ko.get(e);return t||(t=new Set,ko.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(Po.isPath(t)){var o;if("end"===r){var[,i]=Go.last(e,t);o=i}else{var[,a]=Go.first(e,t);o=a}var u=Go.get(e,o);if(!hi.isText(u))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?u.text.length:0}}if(Uo.isRange(t)){var[s,l]=Uo.edges(t);return"start"===r?s:l}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return ni.pointRefs(e).delete(o),o.current=null,t}};return ni.pointRefs(e).add(o),o}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=So.get(e);return t||(t=new Set,So.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return da(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=ni.before(e,i,{voids:r});if(a){var[,u]=ni.first(e,[]),s=[a.path,u];if(Po.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(Po.isPath(i)){var[l]=ni.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=ni.nodes(e,{reverse:!0,at:s,match:o,mode:n,voids:r});return c}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>Uo.isRange(t)&&!n?t:{anchor:ni.start(e,t),focus:ni.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return ni.rangeRefs(e).delete(o),o.current=null,t}};return ni.rangeRefs(e).add(o),o}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=jo.get(e);return t||(t=new Set,jo.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni.withoutNormalizing(e,(()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=Po.isPath(i)?gi(e,i):t=>$o.isElement(t)&&ni.isBlock(e,t)),!n&&Uo.isRange(i)&&(i=ni.unhangRange(e,i,{voids:r}));var u=ni.nodes(e,{at:i,match:a,mode:o,voids:r}),s=Array.from(u,(t=>{var[,n]=t;return ni.pathRef(e,n)}));for(var l of s){var c=l.unref();if(c){var[d]=ni.node(e,c);e.apply({type:"remove_node",path:c,node:d})}}}}))}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;if(t=ni.range(e,t),n)Ki.setSelection(e,t);else{if(!Uo.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(si.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ni.withoutNormalizing(e,(()=>{var{match:r,at:o=e.selection,compare:i,merge:a}=n,{hanging:u=!1,mode:s="lowest",split:l=!1,voids:c=!1}=n;if(o){if(null==r&&(r=Po.isPath(o)?gi(e,o):t=>$o.isElement(t)&&ni.isBlock(e,t)),!u&&Uo.isRange(o)&&(o=ni.unhangRange(e,o,{voids:c})),l&&Uo.isRange(o)){if(Uo.isCollapsed(o)&&ni.leaf(e,o.anchor)[0].text.length>0)return;var d=ni.rangeRef(e,o,{affinity:"inward"}),[f,p]=Uo.edges(o),h="lowest"===s?"lowest":"highest",v=ni.isEnd(e,p,p.path);Ki.splitNodes(e,{at:p,match:r,mode:h,voids:c,always:!v});var g=ni.isStart(e,f,f.path);Ki.splitNodes(e,{at:f,match:r,mode:h,voids:c,always:!g}),o=d.unref(),null==n.at&&Ki.select(e,o)}for(var[m,D]of(i||(i=(e,t)=>e!==t),ni.nodes(e,{at:o,match:r,mode:s,voids:c}))){var b={},C={};if(0!==D.length){var y=!1;for(var w in t)"children"!==w&&"text"!==w&&i(t[w],m[w])&&(y=!0,m.hasOwnProperty(w)&&(b[w]=m[w]),a?null!=t[w]&&(C[w]=a(m[w],t[w])):null!=t[w]&&(C[w]=t[w]));y&&e.apply({type:"set_node",path:D,properties:b,newProperties:C})}}}}))}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{Oo.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=Uo.isBackward(r)?"focus":"anchor"),"end"===o&&(o=Uo.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,u="anchor"===o?i:a;Ki.setSelection(e,{["anchor"===o?"anchor":"focus"]:va(va({},u),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e,r={},o={};if(n){for(var i in t)("anchor"===i&&null!=t.anchor&&!ai.equals(t.anchor,n.anchor)||"focus"===i&&null!=t.focus&&!ai.equals(t.focus,n.focus)||"anchor"!==i&&"focus"!==i&&t[i]!==n[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ca(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>ni.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=ni.range(e,t),[i,a]=Uo.edges(o),u="";for(var[s,l]of ni.nodes(e,{at:o,match:hi.isText,voids:r})){var c=s.text;Po.equals(l,a.path)&&(c=c.slice(0,a.offset)),Po.equals(l,i.path)&&(c=c.slice(i.offset)),u+=c}return u}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=Uo.edges(t);if(0!==o.offset||0!==i.offset||Uo.isCollapsed(t)||Po.hasPrevious(i.path))return t;var a=ni.above(e,{at:i,match:t=>$o.isElement(t)&&ni.isBlock(e,t),voids:r}),u=a?a[1]:[],s={anchor:ni.start(e,o),focus:i},l=!0;for(var[c,d]of ni.nodes(e,{at:s,match:hi.isText,reverse:!0,voids:r}))if(l)l=!1;else if(""!==c.text||Po.isBefore(d,u)){i={path:d,offset:c.text.length};break}return{anchor:o,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;Ki.setNodes(e,r,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ni.withoutNormalizing(e,(()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=Po.isPath(i)?gi(e,i):t=>$o.isElement(t)&&ni.isBlock(e,t)),Po.isPath(i)&&(i=ni.range(e,i));var u=Uo.isRange(i)?ni.rangeRef(e,i):null,s=ni.nodes(e,{at:i,match:a,mode:n,voids:o}),l=Array.from(s,(t=>{var[,n]=t;return ni.pathRef(e,n)})).reverse(),c=function(){var t=d.unref(),[n]=ni.node(e,t),i=ni.range(e,t);r&&u&&(i=Uo.intersection(u.current,i)),Ki.liftNodes(e,{at:i,match:e=>$o.isAncestor(n)&&n.children.includes(e),voids:o})};for(var d of l)c();u&&u.unref()}}))}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ni.above(e,ia(ia({},t),{},{match:t=>$o.isElement(t)&&ni.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=ni.isNormalizing(e);ni.setNormalizing(e,!1);try{t()}finally{ni.setNormalizing(e,n)}ni.normalize(e)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ni.withoutNormalizing(e,(()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:u=e.selection}=n;if(u){if(null==a&&(a=Po.isPath(u)?gi(e,u):e.isInline(t)?t=>$o.isElement(t)&&ni.isInline(e,t)||hi.isText(t):t=>$o.isElement(t)&&ni.isBlock(e,t)),o&&Uo.isRange(u)){var[s,l]=Uo.edges(u),c=ni.rangeRef(e,u,{affinity:"inward"});Ki.splitNodes(e,{at:l,match:a,voids:i}),Ki.splitNodes(e,{at:s,match:a,voids:i}),u=c.unref(),null==n.at&&Ki.select(e,u)}var d=Array.from(ni.nodes(e,{at:u,match:e.isInline(t)?t=>$o.isElement(t)&&ni.isBlock(e,t):e=>ni.isEditor(e),mode:"lowest",voids:i})),f=function(){var n=Uo.isRange(u)?Uo.intersection(u,ni.range(e,p)):u;if(!n)return 0;var o=Array.from(ni.nodes(e,{at:n,match:a,mode:r,voids:i}));if(o.length>0){var[s]=o,l=o[o.length-1],[,c]=s,[,d]=l;if(0===c.length&&0===d.length)return 0;var f=Po.equals(c,d)?Po.parent(c):Po.common(c,d),h=ni.range(e,c,d),v=ni.node(e,f),[g]=v,m=f.length+1,D=Po.next(d.slice(0,m)),b=wa(wa({},t),{},{children:[]});Ki.insertNodes(e,b,{at:D,voids:i}),Ki.moveNodes(e,{at:h,match:e=>$o.isAncestor(g)&&g.children.includes(e),to:D.concat(0),voids:i})}};for(var[,p]of d)f()}}))}(e,...n)}};return e},xa=[],Aa="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Ba||(Ba={}));var Fa,Oa=function(e){return Object.freeze(e)},ka=function(e,t){this.inlineSize=e,this.blockSize=t,Oa(this)},Sa=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Oa(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),ja=function(e){return e instanceof SVGElement&&"getBBox"in e},Pa=function(e){if(ja(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},Ra=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Ta="undefined"!=typeof window?window:{},Na=new WeakMap,_a=/auto|scroll/,Ma=/^tb|vertical/,La=/msie|trident/i.test(Ta.navigator&&Ta.navigator.userAgent),Ia=function(e){return parseFloat(e||"0")},za=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new ka((n?t:e)||0,(n?e:t)||0)},Wa=Oa({devicePixelContentBoxSize:za(),borderBoxSize:za(),contentBoxSize:za(),contentRect:new Sa(0,0,0,0)}),Va=function(e,t){if(void 0===t&&(t=!1),Na.has(e)&&!t)return Na.get(e);if(Pa(e))return Na.set(e,Wa),Wa;var n=getComputedStyle(e),r=ja(e)&&e.ownerSVGElement&&e.getBBox(),o=!La&&"border-box"===n.boxSizing,i=Ma.test(n.writingMode||""),a=!r&&_a.test(n.overflowY||""),u=!r&&_a.test(n.overflowX||""),s=r?0:Ia(n.paddingTop),l=r?0:Ia(n.paddingRight),c=r?0:Ia(n.paddingBottom),d=r?0:Ia(n.paddingLeft),f=r?0:Ia(n.borderTopWidth),p=r?0:Ia(n.borderRightWidth),h=r?0:Ia(n.borderBottomWidth),v=d+l,g=s+c,m=(r?0:Ia(n.borderLeftWidth))+p,D=f+h,b=u?e.offsetHeight-D-e.clientHeight:0,C=a?e.offsetWidth-m-e.clientWidth:0,y=o?v+m:0,w=o?g+D:0,B=r?r.width:Ia(n.width)-y-C,E=r?r.height:Ia(n.height)-w-b,x=B+v+C+m,A=E+g+b+D,F=Oa({devicePixelContentBoxSize:za(Math.round(B*devicePixelRatio),Math.round(E*devicePixelRatio),i),borderBoxSize:za(x,A,i),contentBoxSize:za(B,E,i),contentRect:new Sa(d,s,B,E)});return Na.set(e,F),F},qa=function(e,t,n){var r=Va(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case Ba.DEVICE_PIXEL_CONTENT_BOX:return a;case Ba.BORDER_BOX:return o;default:return i}},Ha=function(e){var t=Va(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Oa([t.borderBoxSize]),this.contentBoxSize=Oa([t.contentBoxSize]),this.devicePixelContentBoxSize=Oa([t.devicePixelContentBoxSize])},Ua=function(e){if(Pa(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Ka=function(){var e=1/0,t=[];xa.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Ha(t.target),o=Ua(t.target);r.push(n),t.lastReportedSize=qa(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},$a=function(e){xa.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(Ua(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Ya=function(){var e,t=0;for($a(t);xa.some((function(e){return e.activeTargets.length>0}));)t=Ka(),$a(t);return xa.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Aa}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Aa),window.dispatchEvent(e)),t>0},Xa=[],Za=function(e){if(!Fa){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Xa.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Fa=function(){n.textContent="".concat(t?t--:t++)}}Xa.push(e),Fa()},Ga=0,Ja={attributes:!0,characterData:!0,childList:!0,subtree:!0},Qa=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],eu=function(e){return void 0===e&&(e=0),Date.now()+e},tu=!1,nu=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!tu){tu=!0;var n,r=eu(e);n=function(){var n=!1;try{n=Ya()}finally{if(tu=!1,e=r-eu(),!Ga)return;n?t.run(1e3):e>0?t.run(e):t.start()}},Za((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Ja)};document.body?t():Ta.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Qa.forEach((function(t){return Ta.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Qa.forEach((function(t){return Ta.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ru=function(e){!Ga&&e>0&&nu.start(),!(Ga+=e)&&nu.stop()},ou=function(){function e(e,t){this.target=e,this.observedBox=t||Ba.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=qa(this.target,this.observedBox,!0);return e=this.target,ja(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),iu=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},au=new WeakMap,uu=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},su=function(){function e(){}return e.connect=function(e,t){var n=new iu(e,t);au.set(e,n)},e.observe=function(e,t,n){var r=au.get(e),o=0===r.observationTargets.length;uu(r.observationTargets,t)<0&&(o&&xa.push(r),r.observationTargets.push(new ou(t,n&&n.box)),ru(1),nu.schedule())},e.unobserve=function(e,t){var n=au.get(e),r=uu(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&xa.splice(xa.indexOf(n),1),n.observationTargets.splice(r,1),ru(-1))},e.disconnect=function(e){var t=this,n=au.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),lu=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");su.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ra(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");su.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ra(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");su.unobserve(this,e)},e.prototype.disconnect=function(){su.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),cu={};Object.defineProperty(cu,"__esModule",{value:!0});for(var du="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),fu={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},pu={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:du?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},hu={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},vu=1;vu<20;vu++)hu["f"+vu]=111+vu;function gu(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return mu(e,t)})),o=function(e){return r.some((function(t){return Du(t,e)}))};return null==n?o:o(n)}function mu(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var a in fu)r[fu[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=Cu(f),v=fu[h];if(f.length>1&&!v&&!pu[f]&&!hu[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&v||(n?r.key=h:r.which=bu(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 Du(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 bu(e){return e=Cu(e),hu[e]||e.toUpperCase().charCodeAt(0)}function Cu(e){return e=e.toLowerCase(),e=pu[e]||e}cu.default=gu;var yu=cu.isHotkey=gu;cu.isCodeHotkey=function(e,t){return gu(e,t)};var wu=cu.isKeyHotkey=function(e,t){return gu(e,{byKey:!0},t)};function Bu(e,t){if(null==e)return{};var n,r,o=function(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}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Eu(e){return Eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu(e)}function xu(e){var t=function(e,t){if("object"!==Eu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Eu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Eu(t)?t:String(t)}function Au(e,t,n){return(t=xu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}cu.parseHotkey=mu,cu.compareHotkey=Du,cu.toKeyCode=bu,cu.toKeyName=Cu;var Fu=i(null),Ou=()=>{var e=a(Fu);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},ku=parseInt(o.version.split(".")[0],10),Su="undefined"!=typeof navigator&&"undefined"!=typeof window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ju="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),Pu="undefined"!=typeof navigator&&/Android/.test(navigator.userAgent),Ru="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Tu="undefined"!=typeof navigator&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),Nu="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),_u="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),Mu="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),Lu=Pu&&"undefined"!=typeof navigator&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),Iu="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),zu="undefined"!=typeof navigator&&/.*UCBrowser/.test(navigator.userAgent),Wu="undefined"!=typeof navigator&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),Vu=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),qu=(!Mu||!Lu)&&!Nu&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,Hu=new WeakMap,Uu=new WeakMap,Ku=new WeakMap,$u=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,Zu=new WeakMap,Gu=new WeakMap,Ju=new WeakMap,Qu=new WeakMap,es=new WeakMap,ts=new WeakMap,ns=new WeakMap,rs=new WeakMap,os=new WeakMap,is=new WeakMap,as=new WeakMap,us=new WeakMap,ss=new WeakMap,ls=new WeakMap,cs=new WeakMap,ds=Symbol("placeholder"),fs=Symbol("mark-placeholder"),ps=globalThis.Text,hs=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,vs=e=>gs(e)&&1===e.nodeType,gs=e=>{var t=hs(e);return!!t&&e instanceof t.Node},ms=e=>{var t=e&&e.anchorNode&&hs(e.anchorNode);return!!t&&e instanceof t.Selection},Ds=e=>gs(e)&&3===e.nodeType,bs=(e,t,n)=>{for(var r,{childNodes:o}=e,i=o[t],a=t,u=!1,s=!1;(gs(r=i)&&8===r.nodeType||vs(i)&&0===i.childNodes.length||vs(i)&&"false"===i.getAttribute("contenteditable"))&&(!u||!s);)a>=o.length?(u=!0,a=t-1,n="backward"):a<0?(s=!0,a=t+1,n="forward"):(i=o[a],t=a,a+="forward"===n?1:-1);return[i,t]},Cs=(e,t,n)=>{var[r]=bs(e,t,n);return r},ys=e=>{var t="";if(Ds(e)&&e.nodeValue)return e.nodeValue;if(vs(e)){for(var n of Array.from(e.childNodes))t+=ys(n);var r=getComputedStyle(e).getPropertyValue("display");"block"!==r&&"list"!==r&&"BR"!==e.tagName||(t+="\n")}return t},ws=/data-slate-fragment="(.+?)"/m,Bs=(e,t,n)=>{var{target:r}=t;if(vs(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:o}=As.getWindow(e);if(o.contains(r))return As.hasDOMNode(e,r,{editable:!0});var i=n.find((e=>{var{addedNodes:t,removedNodes:n}=e;for(var o of t)if(o===r||o.contains(r))return!0;for(var i of n)if(i===r||i.contains(r))return!0}));return!(!i||i===t)&&Bs(e,i,n)},Es=0;class xs{constructor(){Au(this,"id",void 0),this.id="".concat(Es++)}}var As={androidPendingDiffs:e=>us.get(e),androidScheduleFlush:e=>{var t;null===(t=os.get(e))||void 0===t||t()},blur:e=>{var t=As.toDOMNode(e,e),n=As.findDocumentOrShadowRoot(e);es.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=As.findDocumentOrShadowRoot(e).getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),t&&Ki.deselect(e)},findDocumentOrShadowRoot:e=>{var t=As.toDOMNode(e,e),n=t.getRootNode();return(n instanceof Document||n instanceof ShadowRoot)&&null!=n.getSelection?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:n,clientY:r,target:o}=t;if(null==n||null==r)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,a=As.toSlateNode(e,t.target),u=As.findPath(e,a);if($o.isElement(a)&&ni.isVoid(e,a)){var s=o.getBoundingClientRect(),l=e.isInline(a)?n-s.left<s.left+s.width-n:r-s.top<s.top+s.height-r,c=ni.point(e,u,{edge:l?"start":"end"}),d=l?ni.before(e,c):ni.after(e,c);if(d)return ni.range(e,d)}var{document:f}=As.getWindow(e);if(f.caretRangeFromPoint)i=f.caretRangeFromPoint(n,r);else{var p=f.caretPositionFromPoint(n,r);p&&((i=f.createRange()).setStart(p.offsetNode,p.offset),i.setEnd(p.offsetNode,p.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return As.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},findKey:(e,t)=>{var n=Gu.get(t);return n||(n=new xs,Gu.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var o=Uu.get(r);if(null==o){if(ni.isEditor(r))return n;break}var i=Hu.get(r);if(null==i)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(si.stringify(t)))},focus:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{retries:5};if(!es.get(e)){if(t.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(e.operations.length>0)setTimeout((()=>{As.focus(e,{retries:t.retries-1})}),10);else{var n=As.toDOMNode(e,e),r=As.findDocumentOrShadowRoot(e);if(r.activeElement!==n){if(e.selection&&r instanceof Document){var o=r.getSelection(),i=As.toDOMRange(e,e.selection);null==o||o.removeAllRanges(),null==o||o.addRange(i)}e.selection||(Ki.select(e,ni.start(e,[])),e.onChange()),es.set(e,!0),n.focus({preventScroll:!0})}}}},getWindow:e=>{var t=Ku.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{editable:o=!1}=r,i=As.toDOMNode(e,e);try{n=vs(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!n&&!(n.closest("[data-slate-editor]")!==i||o&&!n.isContentEditable&&("boolean"!=typeof n.isContentEditable||n.closest('[contenteditable="false"]')!==i)&&!n.getAttribute("data-slate-zero-width"))},hasEditableTarget:(e,t)=>gs(t)&&As.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return ni.hasPath(e,n.path)&&ni.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>As.hasEditableTarget(e,t)||As.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>gs(t)&&As.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!ts.get(e),isFocused:e=>!!es.get(e),isReadOnly:e=>!!Qu.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(Qu.get(e))return!1;var n=As.hasTarget(e,t)&&As.toSlateNode(e,t);return $o.isElement(n)&&ni.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=Ju.get(e),r=ni.isEditor(t)?$u.get(e):null==n?void 0:n.get(As.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(si.stringify(t)));return r},toDOMPoint:(e,t)=>{var n,[r]=ni.node(e,t.path),o=As.toDOMNode(e,r);ni.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i=Array.from(o.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),a=0,u=0;u<i.length;u++){var s=i[u],l=s.childNodes[0];if(null!=l&&null!=l.textContent){var{length:c}=l.textContent,d=s.getAttribute("data-slate-length"),f=a+(null==d?c:parseInt(d,10)),p=i[u+1];if(t.offset===f&&null!=p&&p.hasAttribute("data-slate-mark-placeholder")){var h,v=p.childNodes[0];n=[v instanceof ps?v:p,null!==(h=p.textContent)&&void 0!==h&&h.startsWith("\ufeff")?1:0];break}if(t.offset<=f){n=[l,Math.min(c,Math.max(0,t.offset-a))];break}a=f}}if(!n)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(si.stringify(t)));return n},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,o=Uo.isBackward(t),i=As.toDOMPoint(e,n),a=Uo.isCollapsed(t)?i:As.toDOMPoint(e,r),u=As.getWindow(e).document.createRange(),[s,l]=o?a:i,[c,d]=o?i:a,f=!!(vs(s)?s:s.parentElement).getAttribute("data-slate-zero-width"),p=!!(vs(c)?c:c.parentElement).getAttribute("data-slate-zero-width");return u.setStart(s,f?1:l),u.setEnd(c,p?1:d),u},toSlateNode:(e,t)=>{var n=vs(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Xu.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},toSlatePoint:(e,t,n)=>{var{exactMatch:r,suppressThrow:o}=n,[i,a]=r?t:(e=>{var[t,n]=e;if(vs(t)&&t.childNodes.length){var r=n===t.childNodes.length,o=r?n-1:n;for([t,o]=bs(t,o,r?"backward":"forward"),r=o<n;vs(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=Cs(t,i,r?"backward":"forward")}n=r&&null!=t.textContent?t.textContent.length:0}return[t,n]})(t),u=i.parentNode,s=null,l=0;if(u){var c,d,f=As.toDOMNode(e,e),p=u.closest('[data-slate-void="true"]'),h=p&&f.contains(p)?p:null,v=u.closest("[data-slate-leaf]"),g=null;if(v){if(s=v.closest('[data-slate-node="text"]')){var m=As.getWindow(e).document.createRange();m.setStart(s,0),m.setEnd(i,a);var D=m.cloneContents();[...Array.prototype.slice.call(D.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(D.querySelectorAll("[contenteditable=false]"))].forEach((e=>{Pu&&!r&&e.hasAttribute("data-slate-zero-width")&&e.textContent.length>0&&"\ufeff"!==e.textContext?e.textContent.startsWith("\ufeff")&&(e.textContent=e.textContent.slice(1)):e.parentNode.removeChild(e)})),l=D.textContent.length,g=s}}else if(h){for(var b=h.querySelectorAll("[data-slate-leaf]"),C=0;C<b.length;C++){var y=b[C];if(As.hasDOMNode(e,y)){v=y;break}}v?(s=v.closest('[data-slate-node="text"]'),l=(g=v).textContent.length,g.querySelectorAll("[data-slate-zero-width]").forEach((e=>{l-=e.textContent.length}))):l=1}g&&l===g.textContent.length&&Pu&&"z"===g.getAttribute("data-slate-zero-width")&&null!==(c=g.textContent)&&void 0!==c&&c.startsWith("\ufeff")&&(u.hasAttribute("data-slate-zero-width")||Ru&&null!==(d=g.textContent)&&void 0!==d&&d.endsWith("\n\n"))&&l--}if(Pu&&!s&&!r){var w=u.hasAttribute("data-slate-node")?u:u.closest("[data-slate-node]");if(w&&As.hasDOMNode(e,w,{editable:!0})){var B=As.toSlateNode(e,w),{path:E,offset:x}=ni.start(e,As.findPath(e,B));return w.querySelector("[data-slate-leaf]")||(x=a),{path:E,offset:x}}}if(!s){if(o)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var A=As.toSlateNode(e,s);return{path:As.findPath(e,A),offset:l}},toSlateRange:(e,t,n)=>{var r,o,i,a,u,s,l,{exactMatch:c,suppressThrow:d}=n;if(ms(t)?t.anchorNode:t.startContainer)if(ms(t)){if(Ru&&t.rangeCount>1){a=t.focusNode;var f=t.getRangeAt(0),p=t.getRangeAt(t.rangeCount-1);if(a instanceof HTMLTableRowElement&&f.startContainer instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement){function h(e){return e.childElementCount>0?h(e.children[0]):e}var v=f.startContainer,g=p.startContainer,m=h(v.children[f.startOffset]),D=h(g.children[p.startOffset]);u=0,o=D.childNodes.length>0?D.childNodes[0]:D,a=m.childNodes.length>0?m.childNodes[0]:m,i=D instanceof HTMLElement?D.innerHTML.length:0}else f.startContainer===a?(o=p.endContainer,i=p.endOffset,u=f.startOffset):(o=f.startContainer,i=f.endOffset,u=p.startOffset)}else o=t.anchorNode,i=t.anchorOffset,a=t.focusNode,u=t.focusOffset;s=_u&&(e=>{for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1})(o)||Ru?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed}else o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,s=t.collapsed;if(null==o||null==a||null==i||null==u)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));(Ru&&null!==(r=a.textContent)&&void 0!==r&&r.endsWith("\n\n")&&u===a.textContent.length&&u--,"getAttribute"in a&&"false"===a.getAttribute("contenteditable")&&"true"!==a.getAttribute("data-slate-void"))&&(a=o,u=(null===(l=o.textContent)||void 0===l?void 0:l.length)||0);var b=As.toSlatePoint(e,[o,i],{exactMatch:c,suppressThrow:d});if(!b)return null;var C=s?b:As.toSlatePoint(e,[a,u],{exactMatch:c,suppressThrow:d});if(!C)return null;var y={anchor:b,focus:C};return Uo.isExpanded(y)&&Uo.isForward(y)&&vs(a)&&ni.void(e,{at:y.focus,mode:"highest"})&&(y=ni.unhangRange(e,y,{voids:!0})),y}};function Fs(e,t){var{path:n,diff:r}=t;if(!ni.hasPath(e,n))return!1;var o=Go.get(e,n);if(!hi.isText(o))return!1;if(r.start!==o.text.length||0===r.text.length)return o.text.slice(r.start,r.start+r.text.length)===r.text;var i=Po.next(n);if(!ni.hasPath(e,i))return!1;var a=Go.get(e,i);return hi.isText(a)&&a.text.startsWith(r.text)}function Os(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce(((e,t)=>e.slice(0,t.start)+t.text+e.slice(t.end)),e)}function ks(e,t){var{start:n,end:r,text:o}=t,i=e.slice(n,r),a=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return n}(i,o),u=function(e,t,n){for(var r=Math.min(e.length,t.length,n),o=0;o<r;o++)if(e.charAt(e.length-o-1)!==t.charAt(t.length-o-1))return o;return r}(i,o,Math.min(i.length-a,o.length-a)),s={start:n+a,end:r-u,text:o.slice(a,o.length-u)};return s.start===s.end&&0===s.text.length?null:s}function Ss(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function js(e,t){var{path:n,offset:r}=t;if(!ni.hasPath(e,n))return null;var o=Go.get(e,n);if(!hi.isText(o))return null;var i=ni.above(e,{match:t=>$o.isElement(t)&&ni.isBlock(e,t),at:n});if(!i)return null;for(;r>o.text.length;){var a=ni.next(e,{at:n,match:hi.isText});if(!a||!Po.isDescendant(a[1],i[1]))return null;r-=o.text.length,o=a[0],n=a[1]}return{path:n,offset:r}}function Ps(e,t){var n=js(e,t.anchor);if(!n)return null;if(Uo.isCollapsed(t))return{anchor:n,focus:n};var r=js(e,t.focus);return r?{anchor:n,focus:r}:null}function Rs(e,t,n){var r=us.get(e),o=null==r?void 0:r.find((e=>{var{path:n}=e;return Po.equals(n,t.path)}));if(!o||t.offset<=o.diff.start)return ai.transform(t,n,{affinity:"backward"});var{diff:i}=o;if(t.offset<=i.start+i.text.length){var a={path:t.path,offset:i.start},u=ai.transform(a,n,{affinity:"backward"});return u?{path:u.path,offset:u.offset+t.offset-i.start}:null}var s={path:t.path,offset:t.offset-i.text.length+i.end-i.start},l=ai.transform(s,n,{affinity:"backward"});return l?"split_node"===n.type&&Po.equals(n.path,t.path)&&s.offset<n.position&&i.start<n.position?l:{path:l.path,offset:l.offset+i.text.length-i.end+i.start}:null}function Ts(e,t,n){var r=Rs(e,t.anchor,n);if(!r)return null;if(Uo.isCollapsed(t))return{anchor:r,focus:r};var o=Rs(e,t.focus,n);return o?{anchor:r,focus:o}:null}function Ns(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ns(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ns(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ms(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,o=!1,i=null,a=null,u=null,s=0,l=!1,c=()=>{var e=ls.get(t);if(ls.delete(t),e){var{selection:n}=t,r=Ps(t,e);!r||n&&Uo.equals(r,n)||Ki.select(t,r)}},d=()=>{if(a&&(clearTimeout(a),a=null),u&&(clearTimeout(u),u=null),g()||v()){o||(o=!0,setTimeout((()=>o=!1))),v()&&(o="action");var e=t.selection&&ni.rangeRef(t,t.selection,{affinity:"forward"});as.set(t,t.marks),ss.get(t),us.get(t);for(var i,s=g();i=null===(d=us.get(t))||void 0===d?void 0:d[0];){var d,f,p=is.get(t);void 0!==p&&(is.delete(t),t.marks=p),p&&!1===l&&(l=null);var h=Ss(i);t.selection&&Uo.equals(t.selection,h)||Ki.select(t,h),i.diff.text?ni.insertText(t,i.diff.text):ni.deleteFragment(t),us.set(t,null===(f=us.get(t))||void 0===f?void 0:f.filter((e=>{var{id:t}=e;return t!==i.id}))),Fs(t,i)||(s=!1,ss.delete(t),as.delete(t),o="action",ls.delete(t),n.cancel(),r.cancel(),null==e||e.unref())}var m=null==e?void 0:e.unref();if(!m||ls.get(t)||t.selection&&Uo.equals(m,t.selection)||Ki.select(t,m),v())(()=>{var e=ss.get(t);if(ss.delete(t),e){if(e.at){var n=ai.isPoint(e.at)?js(t,e.at):Ps(t,e.at);if(!n)return;var r=ni.range(t,n);t.selection&&Uo.equals(t.selection,r)||Ki.select(t,n)}e.run()}})();else{s&&n(),n.flush(),r.flush(),c();var D=as.get(t);as.delete(t),void 0!==D&&(t.marks=D,t.onChange())}}else c()},f=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Yu.get(t);n&&(g()||e?n.style.display="none":n.style.removeProperty("display"))},p=(e,n)=>{var r,o=null!==(r=us.get(t))&&void 0!==r?r:[];us.set(t,o);var i=Go.leaf(t,e),a=o.findIndex((t=>Po.equals(t.path,e)));if(a<0)return ks(i.text,n)&&o.push({path:e,diff:n,id:s++}),void f();var u=function(e,t,n){var r=Math.min(t.start,n.start),o=Math.max(0,Math.min(t.start+t.text.length,n.end)-n.start),i=Os(e,t,n),a=Math.max(n.start+n.text.length,t.start+t.text.length+(t.start+t.text.length>n.start?n.text.length:0)-o),u=i.slice(r,a);return ks(e,{start:r,end:Math.max(t.end,n.end-t.text.length+(t.end-t.start)),text:u})}(i.text,o[a].diff,n);if(!u)return o.splice(a,1),void f();o[a]=_s(_s({},o[a]),{},{diff:u})},h=function(e){var{at:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l=!1,ls.delete(t),n.cancel(),r.cancel(),v()&&d(),ss.set(t,{at:o,run:e}),u=setTimeout(d)},v=()=>!!ss.get(t),g=()=>{var e;return!(null===(e=us.get(t))||void 0===e||!e.length)},m=e=>{ls.set(t,e),a&&(clearTimeout(a),a=null);var{selection:n}=t;if(e){var r=!n||!Po.equals(n.anchor.path,e.anchor.path),o=!n||!Po.equals(n.anchor.path.slice(0,-1),e.anchor.path.slice(0,-1));(r&&l||o)&&(l=!1),(r||g())&&(a=setTimeout(d,200))}},D=()=>{v()||(u=setTimeout(d))};return{flush:d,scheduleFlush:D,hasPendingDiffs:g,hasPendingAction:v,hasPendingChanges:()=>v()||g(),isFlushing:()=>o,handleUserSelect:m,handleCompositionEnd:e=>{i&&clearTimeout(i),i=setTimeout((()=>{ts.set(t,!1),d()}),25)},handleCompositionStart:e=>{ts.set(t,!0),i&&(clearTimeout(i),i=null)},handleDOMBeforeInput:e=>{var n;a&&(clearTimeout(a),a=null);var{inputType:r}=e,o=null,i=e.dataTransfer||e.data||void 0;!1!==l&&"insertText"!==r&&"insertCompositionText"!==r&&(l=!1);var[u]=e.getTargetRanges();u&&(o=As.toSlateRange(t,u,{exactMatch:!1,suppressThrow:!0}));var s=As.getWindow(t).getSelection();if(!o&&s&&(u=s,o=As.toSlateRange(t,s,{exactMatch:!1,suppressThrow:!0})),o=null!==(n=o)&&void 0!==n?n:t.selection){var c,d=!0;if(r.startsWith("delete")){if(Uo.isExpanded(o)){var[f,v]=Uo.edges(o);if(Go.leaf(t,f.path).text.length===f.offset&&0===v.offset){var g=ni.next(t,{at:f.path,match:hi.isText});g&&Po.equals(g[1],v.path)&&(o={anchor:v,focus:v})}}var b=r.endsWith("Backward")?"backward":"forward",[C,y]=Uo.edges(o),[w,B]=ni.leaf(t,C.path),E={text:"",start:C.offset,end:y.offset},x=us.get(t),A=null==x?void 0:x.find((e=>Po.equals(e.path,B))),F=A?[A.diff,E]:[E];if(0===Os(w.text,...F).length&&(d=!1),Uo.isExpanded(o)){if(d&&Po.equals(o.anchor.path,o.focus.path)){var O={path:o.anchor.path,offset:C.offset},k=ni.range(t,O,O);return m(k),p(o.anchor.path,{text:"",end:y.offset,start:C.offset})}return h((()=>ni.deleteFragment(t,{direction:b})),{at:o})}}switch(r){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return h((()=>ni.deleteFragment(t)),{at:o});case"deleteContent":case"deleteContentForward":var{anchor:S}=o;if(d&&Uo.isCollapsed(o)){var j=Go.leaf(t,S.path);if(S.offset<j.text.length)return p(S.path,{text:"",start:S.offset,end:S.offset+1})}return h((()=>ni.deleteForward(t)),{at:o});case"deleteContentBackward":var P,{anchor:R}=o,T=ms(u)?u.isCollapsed:!(null===(P=u)||void 0===P||!P.collapsed);return d&&T&&Uo.isCollapsed(o)&&R.offset>0?p(R.path,{text:"",start:R.offset-1,end:R.offset}):h((()=>ni.deleteBackward(t)),{at:o});case"deleteEntireSoftLine":return h((()=>{ni.deleteBackward(t,{unit:"line"}),ni.deleteForward(t,{unit:"line"})}),{at:o});case"deleteHardLineBackward":return h((()=>ni.deleteBackward(t,{unit:"block"})),{at:o});case"deleteSoftLineBackward":return h((()=>ni.deleteBackward(t,{unit:"line"})),{at:o});case"deleteHardLineForward":return h((()=>ni.deleteForward(t,{unit:"block"})),{at:o});case"deleteSoftLineForward":return h((()=>ni.deleteForward(t,{unit:"line"})),{at:o});case"deleteWordBackward":return h((()=>ni.deleteBackward(t,{unit:"word"})),{at:o});case"deleteWordForward":return h((()=>ni.deleteForward(t,{unit:"word"})),{at:o});case"insertLineBreak":return h((()=>ni.insertSoftBreak(t)),{at:o});case"insertParagraph":return h((()=>ni.insertBreak(t)),{at:o});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("DataTransfer"===(null==(c=i)?void 0:c.constructor.name))return h((()=>As.insertData(t,i)),{at:o});var N=null!=i?i:"";if(is.get(t)&&(N=N.replace("\ufeff","")),"insertText"===r&&/.*\n.*\n$/.test(N)&&(N=N.slice(0,-1)),N.includes("\n"))return h((()=>{var e=N.split("\n");e.forEach(((n,r)=>{n&&ni.insertText(t,n),r!==e.length-1&&ni.insertSoftBreak(t)}))}),{at:o});if(Po.equals(o.anchor.path,o.focus.path)){var[_,M]=Uo.edges(o),L={start:_.offset,end:M.offset,text:N};if(N&&l&&"insertCompositionText"===r){var I=l.start+l.text.search(/\S|$/);L.start+L.text.search(/\S|$/)===I+1&&L.end===l.start+l.text.length?(L.start-=1,l=null,D()):l=!1}else l="insertText"===r&&(null===l?L:!(!l||!Uo.isCollapsed(o)||l.end+l.text.length!==_.offset)&&_s(_s({},l),{},{text:l.text+N}));if(d)return void p(_.path,L)}return h((()=>ni.insertText(t,N)),{at:o})}}},handleKeyDown:e=>{g()||(f(!0),setTimeout(f))},handleDomMutations:e=>{var n;g()||v()||e.some((n=>Bs(t,n,e)))&&(null===(n=cs.get(t))||void 0===n||n())},handleInput:()=>{!v()&&g()||d()}}}var Ls=Vu?s:l;var Is=["node"];function zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ws={subtree:!0,childList:!0,characterData:!0},Vs=Pu?e=>{var{node:t}=e,n=Bu(e,Is);if(!Pu)return null;var r,o=Ou(),i=(r=u(!1),l((()=>(r.current=!0,()=>{r.current=!1})),[]),r.current),[a]=f((()=>Ms(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zs(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({editor:o},n))));return function(e,t,n){var[r]=f((()=>new MutationObserver(t)));Ls((()=>{r.takeRecords()})),l((()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return r.observe(e.current,n),()=>r.disconnect()}),[r,e,n])}(t,a.handleDomMutations,Ws),os.set(o,a.scheduleFlush),i&&a.flush(),a}:()=>null,qs=["anchor","focus"],Hs=["anchor","focus"],Us=(e,t)=>{var n,r,o=Bu(e,qs),i=Bu(t,Hs);return e[ds]===t[ds]&&(n=o,r=i,Object.keys(n).length===Object.keys(r).length&&Object.keys(n).every((e=>r.hasOwnProperty(e)&&n[e]===r[e])))};function Ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var $s=e=>{var{isLast:t,leaf:n,parent:r,text:i}=e,a=Ou(),u=As.findPath(a,i),s=Po.parent(u),l=Boolean(n[fs]);return a.isVoid(r)?o.createElement(Zs,{length:Go.string(r).length}):""!==n.text||r.children[r.children.length-1]!==i||a.isInline(r)||""!==ni.string(a,s)?""===n.text?o.createElement(Zs,{isMarkPlaceholder:l}):t&&"\n"===n.text.slice(-1)?o.createElement(Ys,{isTrailing:!0,text:n.text}):o.createElement(Ys,{text:n.text}):o.createElement(Zs,{isLineBreak:!0,isMarkPlaceholder:l})},Ys=e=>{var{text:t,isTrailing:n=!1}=e,r=u(null),i=()=>"".concat(null!=t?t:"").concat(n?"\n":""),[a]=f(i);return Ls((()=>{var e=i();r.current&&r.current.textContent!==e&&(r.current.textContent=e)})),o.createElement(Xs,{ref:r},a)},Xs=p(g(((e,t)=>o.createElement("span",{"data-slate-string":!0,ref:t},e.children)))),Zs=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=e,i={"data-slate-zero-width":n?"n":"z","data-slate-length":t};return r&&(i["data-slate-mark-placeholder"]=!0),o.createElement("span",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ks(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},i),Pu&&n?null:"\ufeff",n?o.createElement("br",null):null)};function Gs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Js(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gs(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qs=Pu?300:0;function el(e){e.current&&(clearTimeout(e.current),e.current=null)}var tl=e=>{var{leaf:t,isLast:n,text:r,parent:i,renderPlaceholder:a,renderLeaf:s=(e=>o.createElement(rl,Js({},e)))}=e,c=Ou(),p=u(null),h=u(null),[v,g]=f(!1),m=u(null),D=d((e=>{if(function(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}(p,null==e),null==e){var n;Yu.delete(c),null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,null)}else{if(Yu.set(c,e),!p.current){var r=window.ResizeObserver||lu;p.current=new r((()=>{var n;null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,e)}))}p.current.observe(e),h.current=e}}),[h,t,c]),b=o.createElement($s,{isLast:n,leaf:t,parent:i,text:r}),C=Boolean(t[ds]);if(l((()=>(C?m.current||(m.current=setTimeout((()=>{g(!0),m.current=null}),Qs)):(el(m),g(!1)),()=>el(m))),[C,g]),C&&v){var y={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:Tu?"inherit":void 0},contentEditable:!1,ref:D}};b=o.createElement(o.Fragment,null,a(y),b)}return s({attributes:{"data-slate-leaf":!0},children:b,leaf:t,text:r})},nl=o.memo(tl,((e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&hi.equals(t.leaf,e.leaf)&&t.leaf[ds]===e.leaf[ds])),rl=e=>{var{attributes:t,children:n}=e;return o.createElement("span",Js({},t),n)},ol=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:i,renderLeaf:a,text:s}=e,l=Ou(),c=u(null),f=hi.decorations(s,t),p=As.findKey(l,s),h=[],v=0;v<f.length;v++){var g=f[v];h.push(o.createElement(nl,{isLast:n&&v===f.length-1,key:"".concat(p.id,"-").concat(v),renderPlaceholder:i,leaf:g,text:s,parent:r,renderLeaf:a}))}var m=d((e=>{var t=Ju.get(l);e?(null==t||t.set(p,e),Zu.set(s,e),Xu.set(e,s)):(null==t||t.delete(p),Zu.delete(s),c.current&&Xu.delete(c.current)),c.current=e}),[c,l,p,s]);return o.createElement("span",{"data-slate-node":"text",ref:m},h)},il=o.memo(ol,((e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&((e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],o=t[n];if(r.anchor.offset!==o.anchor.offset||r.focus.offset!==o.focus.offset||!Us(r,o))return!1}return!0})(t.decorations,e.decorations)));function al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ul(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?al(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sl=e=>{var{decorations:t,element:n,renderElement:r=(e=>o.createElement(cl,ul({},e))),renderPlaceholder:i,renderLeaf:a,selection:u}=e,s=Ou(),l=vl(),c=s.isInline(n),f=As.findKey(s,n),p=d((e=>{var t=Ju.get(s);e?(null==t||t.set(f,e),Zu.set(n,e),Xu.set(e,n)):(null==t||t.delete(f),Zu.delete(n))}),[s,f,n]),h=pl({decorations:t,node:n,renderElement:r,renderPlaceholder:i,renderLeaf:a,selection:u}),v={"data-slate-node":"element",ref:p};if(c&&(v["data-slate-inline"]=!0),!c&&ni.hasInlines(s,n)){var g=Go.string(n),m=Sn(g);"rtl"===m&&(v.dir=m)}if(ni.isVoid(s,n)){v["data-slate-void"]=!0,!l&&c&&(v.contentEditable=!1);var D=c?"span":"div",[[b]]=Go.texts(n);h=o.createElement(D,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},o.createElement(il,{renderPlaceholder:i,decorations:[],isLast:!1,parent:n,text:b})),Hu.set(b,0),Uu.set(b,n)}return r({attributes:v,children:h,element:n})},ll=o.memo(sl,((e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&((e,t)=>{if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],o=t[n];if(!Uo.equals(r,o)||!Us(r,o))return!1}return!0})(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&Uo.equals(e.selection,t.selection)))),cl=e=>{var{attributes:t,children:n,element:r}=e,i=Ou().isInline(r)?"span":"div";return o.createElement(i,ul(ul({},t),{},{style:{position:"relative"}}),n)},dl=i((()=>[])),fl=i(!1),pl=e=>{for(var{decorations:t,node:n,renderElement:r,renderPlaceholder:i,renderLeaf:u,selection:s}=e,l=a(dl),c=Ou(),d=As.findPath(c,n),f=[],p=$o.isElement(n)&&!c.isInline(n)&&ni.hasInlines(c,n),h=0;h<n.children.length;h++){var v=d.concat(h),g=n.children[h],m=As.findKey(c,g),D=ni.range(c,v),b=s&&Uo.intersection(D,s),C=l([g,v]);for(var y of t){var w=Uo.intersection(y,D);w&&C.push(w)}$o.isElement(g)?f.push(o.createElement(fl.Provider,{key:"provider-".concat(m.id),value:!!b},o.createElement(ll,{decorations:C,element:g,key:m.id,renderElement:r,renderPlaceholder:i,renderLeaf:u,selection:b}))):f.push(o.createElement(il,{decorations:C,key:m.id,isLast:p&&h===n.children.length-1,parent:n,renderPlaceholder:i,renderLeaf:u,text:g})),Hu.set(g,h),Uu.set(g,n)}return f},hl=i(!1),vl=()=>a(hl),gl=i(null);var ml={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},Dl={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"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"},bl={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Cl=e=>{var t=ml[e],n=Dl[e],r=bl[e],o=t&&yu(t),i=n&&yu(n),a=r&&yu(r);return e=>!(!o||!o(e))||(!!(ju&&i&&i(e))||!(ju||!a||!a(e)))},yl={isBold:Cl("bold"),isCompose:Cl("compose"),isMoveBackward:Cl("moveBackward"),isMoveForward:Cl("moveForward"),isDeleteBackward:Cl("deleteBackward"),isDeleteForward:Cl("deleteForward"),isDeleteLineBackward:Cl("deleteLineBackward"),isDeleteLineForward:Cl("deleteLineForward"),isDeleteWordBackward:Cl("deleteWordBackward"),isDeleteWordForward:Cl("deleteWordForward"),isExtendBackward:Cl("extendBackward"),isExtendForward:Cl("extendForward"),isExtendLineBackward:Cl("extendLineBackward"),isExtendLineForward:Cl("extendLineForward"),isItalic:Cl("italic"),isMoveLineBackward:Cl("moveLineBackward"),isMoveLineForward:Cl("moveLineForward"),isMoveWordBackward:Cl("moveWordBackward"),isMoveWordForward:Cl("moveWordForward"),isRedo:Cl("redo"),isSoftBreak:Cl("insertSoftBreak"),isSplitBlock:Cl("splitBlock"),isTransposeCharacter:Cl("transposeCharacter"),isUndo:Cl("undo")},wl={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Bl extends v{constructor(){super(...arguments),Au(this,"context",null),Au(this,"manager",null),Au(this,"mutationObserver",null)}observe(){var e,{node:t}=this.props;if(!t.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");null===(e=this.mutationObserver)||void 0===e||e.observe(t.current,wl)}componentDidMount(){var{receivedUserInput:e}=this.props,t=this.context;this.manager=((e,t)=>{var n=[],r=()=>{n=[]};return{registerMutations:r=>{if(t.current){var o=r.filter((t=>Bs(e,t,r)));n.push(...o)}},restoreDOM:function(){n.length>0&&(n.reverse().forEach((e=>{"characterData"!==e.type&&(e.removedNodes.forEach((t=>{e.target.insertBefore(t,e.nextSibling)})),e.addedNodes.forEach((t=>{e.target.removeChild(t)})))})),r())},clear:r}})(t,e),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var e,t,n,r,o=null===(e=this.mutationObserver)||void 0===e?void 0:e.takeRecords();null!=o&&o.length&&(null===(r=this.manager)||void 0===r||r.registerMutations(o));return null===(t=this.mutationObserver)||void 0===t||t.disconnect(),null===(n=this.manager)||void 0===n||n.restoreDOM(),null}componentDidUpdate(){var e;null===(e=this.manager)||void 0===e||e.clear(),this.observe()}componentWillUnmount(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect()}render(){return this.props.children}}Au(Bl,"contextType",Fu);var El=Pu?Bl:e=>{var{children:t}=e;return o.createElement(o.Fragment,null,t)},xl=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],Al=["text"];function Fl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fl(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kl=e=>o.createElement(o.Fragment,null,pl(e)),Sl=e=>{var t=d((e=>o.createElement(jl,Ol({},e))),[]),{autoFocus:n,decorate:r=Pl,onDOMBeforeInput:i,placeholder:s,readOnly:p=!1,renderElement:v,renderLeaf:g,renderPlaceholder:m=t,scrollSelectionIntoView:D=Rl,style:b={},as:C="div",disableDefaultStyles:y=!1}=e,w=Bu(e,xl),B=(()=>{var e=a(gl);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t})(),[E,x]=f(!1),A=u(null),F=u([]),[O,k]=f(),{onUserInput:S,receivedUserInput:j}=function(){var e=Ou(),t=u(!1),n=u(0),r=d((()=>{if(!t.current){t.current=!0;var r=As.getWindow(e);r.cancelAnimationFrame(n.current),n.current=r.requestAnimationFrame((()=>{t.current=!1}))}}),[e]);return l((()=>()=>cancelAnimationFrame(n.current)),[]),{receivedUserInput:t,onUserInput:r}}(),[,P]=h((e=>e+1),0);cs.set(B,P),Qu.set(B,p);var R=c((()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1})),[]);l((()=>{A.current&&n&&A.current.focus()}),[n]);var T=u(),N=c((()=>Cr((()=>{var e=T.current;if((Pu||!As.isComposing(B))&&(!R.isUpdatingSelection||null!=e&&e.isFlushing())&&!R.isDraggingInternally){var t=As.findDocumentOrShadowRoot(B),{activeElement:n}=t,r=As.toDOMNode(B,B),o=t.getSelection();if(n===r?(R.latestElement=n,es.set(B,!0)):es.delete(B),!o)return Ki.deselect(B);var{anchorNode:i,focusNode:a}=o,u=As.hasEditableTarget(B,i)||As.isTargetInsideNonReadonlyVoid(B,i),s=As.hasEditableTarget(B,a)||As.isTargetInsideNonReadonlyVoid(B,a);if(u&&s){var l=As.toSlateRange(B,o,{exactMatch:!1,suppressThrow:!0});l&&(As.isComposing(B)||null!=e&&e.hasPendingChanges()||null!=e&&e.isFlushing()?null==e||e.handleUserSelect(l):Ki.select(B,l))}!p||u&&s||Ki.deselect(B)}}),100)),[B,p,R]),_=c((()=>mr(N,0)),[N]);T.current=Vs({node:A,onDOMSelectionChange:N,scheduleOnDOMSelectionChange:_}),Ls((()=>{var e,t,n;A.current&&(n=hs(A.current))?(Ku.set(B,n),$u.set(B,A.current),Zu.set(B,A.current),Xu.set(A.current,B)):Zu.delete(B);var{selection:r}=B,o=As.findDocumentOrShadowRoot(B).getSelection();if(o&&As.isFocused(B)&&(null===(e=T.current)||void 0===e||!e.hasPendingAction())){var i=e=>{var t="None"!==o.type;if(r||t){var n,i=o.focusNode;if(Ru&&o.rangeCount>1){var a=o.getRangeAt(0),u=o.getRangeAt(o.rangeCount-1);n=a.startContainer===i?u.endContainer:a.startContainer}else n=o.anchorNode;var s=$u.get(B),l=!1;if(s.contains(n)&&s.contains(i)&&(l=!0),t&&l&&r&&!e){var c=As.toSlateRange(B,o,{exactMatch:!0,suppressThrow:!0});if(c&&Uo.equals(c,r)){var d;if(!R.hasMarkPlaceholder)return;if(null!==(d=n)&&void 0!==d&&null!==(d=d.parentElement)&&void 0!==d&&d.hasAttribute("data-slate-mark-placeholder"))return}}if(!r||As.hasRange(B,r)){R.isUpdatingSelection=!0;var f=r&&As.toDOMRange(B,r);return f?(As.isComposing(B)&&!Pu?o.collapseToEnd():Uo.isBackward(r)?o.setBaseAndExtent(f.endContainer,f.endOffset,f.startContainer,f.startOffset):o.setBaseAndExtent(f.startContainer,f.startOffset,f.endContainer,f.endOffset),D(B,f)):o.removeAllRanges(),f}B.selection=As.toSlateRange(B,o,{exactMatch:!1,suppressThrow:!0})}};o.rangeCount<=1&&i();var a="action"===(null===(t=T.current)||void 0===t?void 0:t.isFlushing());if(Pu&&a){var u=null,s=requestAnimationFrame((()=>{if(a){var e=e=>{try{As.toDOMNode(B,B).focus(),i(e)}catch(e){}};e(),u=setTimeout((()=>{e(!0),R.isUpdatingSelection=!1}))}}));return()=>{cancelAnimationFrame(s),u&&clearTimeout(u)}}setTimeout((()=>{R.isUpdatingSelection=!1}))}}));var M=d((e=>{if(S(),!p&&As.hasEditableTarget(B,e.target)&&!_l(e,i)){var t;if(T.current)return T.current.handleDOMBeforeInput(e);_.flush(),N.flush();var{selection:n}=B,{inputType:r}=e,o=e.dataTransfer||e.data||void 0,a="insertCompositionText"===r||"deleteCompositionText"===r;if(a&&As.isComposing(B))return;var u=!1;if("insertText"===r&&n&&Uo.isCollapsed(n)&&e.data&&1===e.data.length&&/[a-z ]/i.test(e.data)&&0!==n.anchor.offset){var s,l;u=!0,B.marks&&(u=!1);var{anchor:c}=n,[d,f]=As.toDOMPoint(B,c),h=null===(s=d.parentElement)||void 0===s?void 0:s.closest("a"),v=As.getWindow(B);if(u&&h&&As.hasDOMNode(B,h)){var g,m=null==v?void 0:v.document.createTreeWalker(h,NodeFilter.SHOW_TEXT).lastChild();m===d&&(null===(g=m.textContent)||void 0===g?void 0:g.length)===f&&(u=!1)}if(u&&d.parentElement&&"pre"===(null==v||null===(l=v.getComputedStyle(d.parentElement))||void 0===l?void 0:l.whiteSpace)){var D=ni.above(B,{at:c.path,match:e=>$o.isElement(e)&&ni.isBlock(B,e)});D&&Go.string(D[0]).includes("\t")&&(u=!1)}}if(!r.startsWith("delete")||r.startsWith("deleteBy")){var[b]=e.getTargetRanges();if(b){var C=As.toSlateRange(B,b,{exactMatch:!1,suppressThrow:!1});if(!n||!Uo.equals(n,C)){u=!1;var y=!a&&B.selection&&ni.rangeRef(B,B.selection);Ki.select(B,C),y&&ns.set(B,y)}}}if(a)return;if(u||e.preventDefault(),n&&Uo.isExpanded(n)&&r.startsWith("delete")){var w=r.endsWith("Backward")?"backward":"forward";return void ni.deleteFragment(B,{direction:w})}switch(r){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":ni.deleteFragment(B);break;case"deleteContent":case"deleteContentForward":ni.deleteForward(B);break;case"deleteContentBackward":ni.deleteBackward(B);break;case"deleteEntireSoftLine":ni.deleteBackward(B,{unit:"line"}),ni.deleteForward(B,{unit:"line"});break;case"deleteHardLineBackward":ni.deleteBackward(B,{unit:"block"});break;case"deleteSoftLineBackward":ni.deleteBackward(B,{unit:"line"});break;case"deleteHardLineForward":ni.deleteForward(B,{unit:"block"});break;case"deleteSoftLineForward":ni.deleteForward(B,{unit:"line"});break;case"deleteWordBackward":ni.deleteBackward(B,{unit:"word"});break;case"deleteWordForward":ni.deleteForward(B,{unit:"word"});break;case"insertLineBreak":ni.insertSoftBreak(B);break;case"insertParagraph":ni.insertBreak(B);break;case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":"insertFromComposition"===r&&As.isComposing(B)&&(x(!1),ts.set(B,!1)),"DataTransfer"===(null==o?void 0:o.constructor.name)?As.insertData(B,o):"string"==typeof o&&(u?F.current.push((()=>ni.insertText(B,o))):ni.insertText(B,o))}var E=null===(t=ns.get(B))||void 0===t?void 0:t.unref();ns.delete(B),!E||B.selection&&Uo.equals(B.selection,E)||Ki.select(B,E)}}),[B,N,S,i,p,_]),L=d((e=>{null==e?(N.cancel(),_.cancel(),$u.delete(B),Zu.delete(B),A.current&&qu&&A.current.removeEventListener("beforeinput",M)):qu&&e.addEventListener("beforeinput",M),A.current=e}),[N,_,B,M]);Ls((()=>{var e=As.getWindow(B);return e.document.addEventListener("selectionchange",_),()=>{e.document.removeEventListener("selectionchange",_)}}),[_]);var I=r([B,[]]),z=s&&1===B.children.length&&1===Array.from(Go.texts(B)).length&&""===Go.string(B)&&!E,W=d((e=>{var t;e&&z?k(null===(t=e.getBoundingClientRect())||void 0===t?void 0:t.height):k(void 0)}),[z]);if(z){var V=ni.start(B,[]);I.push({[ds]:!0,placeholder:s,onPlaceholderResize:W,anchor:V,focus:V})}var{marks:q}=B;if(R.hasMarkPlaceholder=!1,B.selection&&Uo.isCollapsed(B.selection)&&q){var{anchor:H}=B.selection,U=Go.leaf(B,H.path),K=Bu(U,Al);if(!hi.equals(U,q,{loose:!0})){R.hasMarkPlaceholder=!0;var $=Object.fromEntries(Object.keys(K).map((e=>[e,null])));I.push(Ol(Ol(Ol({[fs]:!0},$),q),{},{anchor:H,focus:H}))}}return l((()=>{setTimeout((()=>{var{selection:e}=B;if(e){var{anchor:t}=e,n=Go.leaf(B,t.path);if(q&&!hi.equals(n,q,{loose:!0}))return void is.set(B,q)}is.delete(B)}))})),o.createElement(hl.Provider,{value:p},o.createElement(dl.Provider,{value:r},o.createElement(El,{node:A,receivedUserInput:j},o.createElement(C,Ol(Ol({role:p?void 0:"textbox","aria-multiline":!p||void 0},w),{},{spellCheck:!(!qu&&Vu)&&w.spellCheck,autoCorrect:qu||!Vu?w.autoCorrect:"false",autoCapitalize:qu||!Vu?w.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!p,zindex:-1,suppressContentEditableWarning:!0,ref:L,style:Ol(Ol({},y?{}:Ol({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},O?{minHeight:O}:{})),b),onBeforeInput:d((e=>{if(!qu&&!p&&!Tl(e,w.onBeforeInput)&&As.hasSelectableTarget(B,e.target)&&(e.preventDefault(),!As.isComposing(B))){var t=e.data;ni.insertText(B,t)}}),[w.onBeforeInput,B,p]),onInput:d((e=>{if(!Tl(e,w.onInput))if(T.current)T.current.handleInput();else{for(var t of F.current)t();F.current=[]}}),[w.onInput]),onBlur:d((e=>{if(!p&&!R.isUpdatingSelection&&As.hasSelectableTarget(B,e.target)&&!Tl(e,w.onBlur)){var t=As.findDocumentOrShadowRoot(B);if(R.latestElement!==t.activeElement){var{relatedTarget:n}=e;if(!(n===As.toDOMNode(B,B)||vs(n)&&n.hasAttribute("data-slate-spacer"))){if(null!=n&&gs(n)&&As.hasDOMNode(B,n)){var r=As.toSlateNode(B,n);if($o.isElement(r)&&!B.isVoid(r))return}if(Tu){var o=t.getSelection();null==o||o.removeAllRanges()}es.delete(B)}}}}),[p,R.isUpdatingSelection,R.latestElement,B,w.onBlur]),onClick:d((e=>{if(As.hasTarget(B,e.target)&&!Tl(e,w.onClick)&&gs(e.target)){var t=As.toSlateNode(B,e.target),n=As.findPath(B,t);if(!ni.hasPath(B,n)||Go.get(B,n)!==t)return;if(3===e.detail&&n.length>=1){var r=n;if(!$o.isElement(t)||!ni.isBlock(B,t)){var o,i=ni.above(B,{match:e=>$o.isElement(e)&&ni.isBlock(B,e),at:n});r=null!==(o=null==i?void 0:i[1])&&void 0!==o?o:n.slice(0,1)}var a=ni.range(B,r);return void Ki.select(B,a)}if(p)return;var u=ni.start(B,n),s=ni.end(B,n),l=ni.void(B,{at:u}),c=ni.void(B,{at:s});if(l&&c&&Po.equals(l[1],c[1])){var d=ni.range(B,u);Ki.select(B,d)}}}),[B,w.onClick,p]),onCompositionEnd:d((e=>{if(As.hasSelectableTarget(B,e.target)){var t;if(As.isComposing(B)&&Promise.resolve().then((()=>{x(!1),ts.set(B,!1)})),null===(t=T.current)||void 0===t||t.handleCompositionEnd(e),Tl(e,w.onCompositionEnd)||Pu)return;if(!Tu&&!Iu&&!Su&&!Wu&&!zu&&e.data){var n=is.get(B);is.delete(B),void 0!==n&&(as.set(B,B.marks),B.marks=n),ni.insertText(B,e.data);var r=as.get(B);as.delete(B),void 0!==r&&(B.marks=r)}}}),[w.onCompositionEnd,B]),onCompositionUpdate:d((e=>{As.hasSelectableTarget(B,e.target)&&!Tl(e,w.onCompositionUpdate)&&(As.isComposing(B)||(x(!0),ts.set(B,!0)))}),[w.onCompositionUpdate,B]),onCompositionStart:d((e=>{if(As.hasSelectableTarget(B,e.target)){var t;if(null===(t=T.current)||void 0===t||t.handleCompositionStart(e),Tl(e,w.onCompositionStart)||Pu)return;x(!0);var{selection:n}=B;if(n&&Uo.isExpanded(n))return void ni.deleteFragment(B)}}),[w.onCompositionStart,B]),onCopy:d((e=>{!As.hasSelectableTarget(B,e.target)||Tl(e,w.onCopy)||Nl(e)||(e.preventDefault(),As.setFragmentData(B,e.clipboardData,"copy"))}),[w.onCopy,B]),onCut:d((e=>{if(!p&&As.hasSelectableTarget(B,e.target)&&!Tl(e,w.onCut)&&!Nl(e)){e.preventDefault(),As.setFragmentData(B,e.clipboardData,"cut");var{selection:t}=B;if(t)if(Uo.isExpanded(t))ni.deleteFragment(B);else{var n=Go.parent(B,t.anchor.path);ni.isVoid(B,n)&&Ki.delete(B)}}}),[p,B,w.onCut]),onDragOver:d((e=>{if(As.hasTarget(B,e.target)&&!Tl(e,w.onDragOver)){var t=As.toSlateNode(B,e.target);$o.isElement(t)&&ni.isVoid(B,t)&&e.preventDefault()}}),[w.onDragOver,B]),onDragStart:d((e=>{if(!p&&As.hasTarget(B,e.target)&&!Tl(e,w.onDragStart)){var t=As.toSlateNode(B,e.target),n=As.findPath(B,t);if($o.isElement(t)&&ni.isVoid(B,t)||ni.void(B,{at:n,voids:!0})){var r=ni.range(B,n);Ki.select(B,r)}R.isDraggingInternally=!0,As.setFragmentData(B,e.dataTransfer,"drag")}}),[p,B,w.onDragStart,R]),onDrop:d((e=>{if(!p&&As.hasTarget(B,e.target)&&!Tl(e,w.onDrop)){e.preventDefault();var t=B.selection,n=As.findEventRange(B,e),r=e.dataTransfer;Ki.select(B,n),R.isDraggingInternally&&(!t||Uo.equals(t,n)||ni.void(B,{at:n,voids:!0})||Ki.delete(B,{at:t})),As.insertData(B,r),As.isFocused(B)||As.focus(B)}R.isDraggingInternally=!1}),[p,B,w.onDrop,R]),onDragEnd:d((e=>{!p&&R.isDraggingInternally&&w.onDragEnd&&As.hasTarget(B,e.target)&&w.onDragEnd(e),R.isDraggingInternally=!1}),[p,R,w,B]),onFocus:d((e=>{if(!p&&!R.isUpdatingSelection&&As.hasEditableTarget(B,e.target)&&!Tl(e,w.onFocus)){var t=As.toDOMNode(B,B),n=As.findDocumentOrShadowRoot(B);if(R.latestElement=n.activeElement,Ru&&e.target!==t)return void t.focus();es.set(B,!0)}}),[p,R,B,w.onFocus]),onKeyDown:d((e=>{if(!p&&As.hasEditableTarget(B,e.target)){var t;null===(t=T.current)||void 0===t||t.handleKeyDown(e);var{nativeEvent:n}=e;if(As.isComposing(B)&&!1===n.isComposing&&(ts.set(B,!1),x(!1)),Tl(e,w.onKeyDown)||As.isComposing(B))return;var{selection:r}=B,o=B.children[null!==r?r.focus.path[0]:0],i="rtl"===Sn(Go.string(o));if(yl.isRedo(n)){e.preventDefault();var a=B;return void("function"==typeof a.redo&&a.redo())}if(yl.isUndo(n)){e.preventDefault();var u=B;return void("function"==typeof u.undo&&u.undo())}if(yl.isMoveLineBackward(n))return e.preventDefault(),void Ki.move(B,{unit:"line",reverse:!0});if(yl.isMoveLineForward(n))return e.preventDefault(),void Ki.move(B,{unit:"line"});if(yl.isExtendLineBackward(n))return e.preventDefault(),void Ki.move(B,{unit:"line",edge:"focus",reverse:!0});if(yl.isExtendLineForward(n))return e.preventDefault(),void Ki.move(B,{unit:"line",edge:"focus"});if(yl.isMoveBackward(n))return e.preventDefault(),void(r&&Uo.isCollapsed(r)?Ki.move(B,{reverse:!i}):Ki.collapse(B,{edge:i?"end":"start"}));if(yl.isMoveForward(n))return e.preventDefault(),void(r&&Uo.isCollapsed(r)?Ki.move(B,{reverse:i}):Ki.collapse(B,{edge:i?"start":"end"}));if(yl.isMoveWordBackward(n))return e.preventDefault(),r&&Uo.isExpanded(r)&&Ki.collapse(B,{edge:"focus"}),void Ki.move(B,{unit:"word",reverse:!i});if(yl.isMoveWordForward(n))return e.preventDefault(),r&&Uo.isExpanded(r)&&Ki.collapse(B,{edge:"focus"}),void Ki.move(B,{unit:"word",reverse:i});if(qu){if((_u||Tu)&&r&&(yl.isDeleteBackward(n)||yl.isDeleteForward(n))&&Uo.isCollapsed(r)){var s=Go.parent(B,r.anchor.path);if($o.isElement(s)&&ni.isVoid(B,s)&&(ni.isInline(B,s)||ni.isBlock(B,s)))return e.preventDefault(),void ni.deleteBackward(B,{unit:"block"})}}else{if(yl.isBold(n)||yl.isItalic(n)||yl.isTransposeCharacter(n))return void e.preventDefault();if(yl.isSoftBreak(n))return e.preventDefault(),void ni.insertSoftBreak(B);if(yl.isSplitBlock(n))return e.preventDefault(),void ni.insertBreak(B);if(yl.isDeleteBackward(n))return e.preventDefault(),void(r&&Uo.isExpanded(r)?ni.deleteFragment(B,{direction:"backward"}):ni.deleteBackward(B));if(yl.isDeleteForward(n))return e.preventDefault(),void(r&&Uo.isExpanded(r)?ni.deleteFragment(B,{direction:"forward"}):ni.deleteForward(B));if(yl.isDeleteLineBackward(n))return e.preventDefault(),void(r&&Uo.isExpanded(r)?ni.deleteFragment(B,{direction:"backward"}):ni.deleteBackward(B,{unit:"line"}));if(yl.isDeleteLineForward(n))return e.preventDefault(),void(r&&Uo.isExpanded(r)?ni.deleteFragment(B,{direction:"forward"}):ni.deleteForward(B,{unit:"line"}));if(yl.isDeleteWordBackward(n))return e.preventDefault(),void(r&&Uo.isExpanded(r)?ni.deleteFragment(B,{direction:"backward"}):ni.deleteBackward(B,{unit:"word"}));if(yl.isDeleteWordForward(n))return e.preventDefault(),void(r&&Uo.isExpanded(r)?ni.deleteFragment(B,{direction:"forward"}):ni.deleteForward(B,{unit:"word"}))}}}),[p,B,w.onKeyDown]),onPaste:d((e=>{p||!As.hasEditableTarget(B,e.target)||Tl(e,w.onPaste)||(!qu||(e=>e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length)(e.nativeEvent)||Tu)&&(e.preventDefault(),As.insertData(B,e.clipboardData))}),[p,B,w.onPaste])}),o.createElement(kl,{decorations:I,node:B,renderElement:v,renderPlaceholder:m,renderLeaf:g,selection:B.selection})))))},jl=e=>{var{attributes:t,children:n}=e;return o.createElement("span",Ol({},t),n,Pu&&o.createElement("br",null))},Pl=()=>[],Rl=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&Uo.isCollapsed(e.selection))){var n=t.startContainer.parentElement;n.getBoundingClientRect=t.getBoundingClientRect.bind(t),Fr(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},Tl=(e,t)=>{if(!t)return!1;var n=t(e);return null!=n?n:e.isDefaultPrevented()||e.isPropagationStopped()},Nl=e=>gs(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),_l=(e,t)=>{if(!t)return!1;var n=t(e);return null!=n?n:e.defaultPrevented},Ml=i(!1),Ll=i({});var Il=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],zl=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:i,onValueChange:a,initialValue:s}=e,p=Bu(e,Il),[h,v]=o.useState((()=>{if(!Go.isNodeList(s))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(si.stringify(s)));if(!ni.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(si.stringify(t)));return t.children=s,Object.assign(t,p),{v:0,editor:t}})),{selectorContext:g,onChange:m}=function(e){var t=u([]).current,n=u({editor:e}).current,r=d((e=>{n.editor=e,t.forEach((t=>t(e)))}),[t,n]);return{selectorContext:c((()=>({getSlate:()=>n.editor,addEventListener:e=>(t.push(e),()=>{t.splice(t.indexOf(e),1)})})),[t,n]),onChange:r}}(t),D=d((e=>{var n;if(r&&r(t.children),"set_selection"===(null==e||null===(n=e.operation)||void 0===n?void 0:n.type))null==i||i(t.selection);else null==a||a(t.children);v((e=>({v:e.v+1,editor:t}))),m(t)}),[t,m,r,i,a]);l((()=>(rs.set(t,D),()=>{rs.set(t,(()=>{}))})),[t,D]);var[b,C]=f(As.isFocused(t));return l((()=>{C(As.isFocused(t))}),[t]),Ls((()=>{var e=()=>C(As.isFocused(t));return ku>=17?(document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",e)}):(document.addEventListener("focus",e,!0),document.addEventListener("blur",e,!0),()=>{document.removeEventListener("focus",e,!0),document.removeEventListener("blur",e,!0)})}),[]),o.createElement(Ll.Provider,{value:g},o.createElement(gl.Provider,{value:h},o.createElement(Fu.Provider,{value:h.editor},o.createElement(Ml.Provider,{value:b},n))))},Wl=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Vl=(e,t,n)=>{var r=As.toDOMRange(e,t).getBoundingClientRect(),o=As.toDOMRange(e,n).getBoundingClientRect();return Wl(r,o)&&Wl(o,r)};function ql(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ql(Object(n),!0).forEach((function(t){Au(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ql(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ul=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x-slate-fragment",n=e,{apply:r,onChange:o,deleteBackward:i,addMark:a,removeMark:u}=n;return Ju.set(n,new WeakMap),n.addMark=(e,t)=>{var r,o;null===(r=os.get(n))||void 0===r||r(),!is.get(n)&&null!==(o=us.get(n))&&void 0!==o&&o.length&&is.set(n,null),as.delete(n),a(e,t)},n.removeMark=e=>{var t;!is.get(n)&&null!==(t=us.get(n))&&void 0!==t&&t.length&&is.set(n,null),as.delete(n),u(e)},n.deleteBackward=e=>{if("line"!==e)return i(e);if(n.selection&&Uo.isCollapsed(n.selection)){var t=ni.above(n,{match:e=>$o.isElement(e)&&ni.isBlock(n,e),at:n.selection});if(t){var[,r]=t,o=ni.range(n,r,n.selection.anchor),a=((e,t)=>{var n=ni.range(e,Uo.end(t)),r=Array.from(ni.positions(e,{at:t})),o=0,i=r.length,a=Math.floor(i/2);if(Vl(e,ni.range(e,r[o]),n))return ni.range(e,r[o],n);if(r.length<2)return ni.range(e,r[r.length-1],n);for(;a!==r.length&&a!==o;)Vl(e,ni.range(e,r[a]),n)?i=a:o=a,a=Math.floor((o+i)/2);return ni.range(e,r[i],n)})(n,o);Uo.isCollapsed(a)||Ki.delete(n,{at:a})}}},n.apply=t=>{var o=[],i=[],a=us.get(n);if(null!=a&&a.length){var u=a.map((e=>function(e,t){var{path:n,diff:r,id:o}=e;switch(t.type){case"insert_text":return!Po.equals(t.path,n)||t.offset>=r.end?e:t.offset<=r.start?{diff:{start:t.text.length+r.start,end:t.text.length+r.end,text:r.text},id:o,path:n}:{diff:{start:r.start,end:r.end+t.text.length,text:r.text},id:o,path:n};case"remove_text":return!Po.equals(t.path,n)||t.offset>=r.end?e:t.offset+t.text.length<=r.start?{diff:{start:r.start-t.text.length,end:r.end-t.text.length,text:r.text},id:o,path:n}:{diff:{start:r.start,end:r.end-t.text.length,text:r.text},id:o,path:n};case"split_node":return!Po.equals(t.path,n)||t.position>=r.end?{diff:r,id:o,path:Po.transform(n,t,{affinity:"backward"})}:t.position>r.start?{diff:{start:r.start,end:Math.min(t.position,r.end),text:r.text},id:o,path:n}:{diff:{start:r.start-t.position,end:r.end-t.position,text:r.text},id:o,path:Po.transform(n,t,{affinity:"forward"})};case"merge_node":return Po.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:o,path:Po.transform(n,t)}:{diff:r,id:o,path:Po.transform(n,t)}}var i=Po.transform(n,t);return i?{diff:r,path:i,id:o}:null}(e,t))).filter(Boolean);us.set(n,u)}var s=ls.get(n);s&&ls.set(n,Ts(n,s,t));var l=ss.get(n);if(null!=l&&l.at){var c=ai.isPoint(null==l?void 0:l.at)?Rs(n,l.at,t):Ts(n,l.at,t);ss.set(n,c?Hl(Hl({},l),{},{at:c}):null)}switch(t.type){case"insert_text":case"remove_text":case"set_node":case"split_node":o.push(...Kl(n,t.path));break;case"set_selection":var d;null===(d=ns.get(n))||void 0===d||d.unref(),ns.delete(n);break;case"insert_node":case"remove_node":o.push(...Kl(n,Po.parent(t.path)));break;case"merge_node":var f=Po.previous(t.path);o.push(...Kl(n,f));break;case"move_node":var p,h=Po.common(Po.parent(t.path),Po.parent(t.newPath));o.push(...Kl(n,h)),Po.isBefore(t.path,t.newPath)?(o.push(...Kl(n,Po.parent(t.path))),p=t.newPath):(o.push(...Kl(n,Po.parent(t.newPath))),p=t.path);var v=Go.get(e,Po.parent(p)),g=As.findKey(n,v),m=ni.pathRef(n,Po.parent(p));i.push([m,g])}for(var[D,b]of(r(t),o)){var[C]=ni.node(n,D);Gu.set(C,b)}for(var[y,w]of i)if(y.current){var[B]=ni.node(n,y.current);Gu.set(B,w)}},n.setFragmentData=e=>{var{selection:r}=n;if(r){var[o,i]=Uo.edges(r),a=ni.void(n,{at:o.path}),u=ni.void(n,{at:i.path});if(!Uo.isCollapsed(r)||a){var s=As.toDOMRange(n,r),l=s.cloneContents(),c=l.childNodes[0];if(l.childNodes.forEach((e=>{e.textContent&&""!==e.textContent.trim()&&(c=e)})),u){var[d]=u,f=s.cloneRange(),p=As.toDOMNode(n,d);f.setEndAfter(p),l=f.cloneContents()}if(a&&(c=l.querySelector("[data-slate-spacer]")),Array.from(l.querySelectorAll("[data-slate-zero-width]")).forEach((e=>{var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""})),Ds(c)){var h=c.ownerDocument.createElement("span");h.style.whiteSpace="pre",h.appendChild(c),l.appendChild(h),c=h}var v=n.getFragment(),g=JSON.stringify(v),m=window.btoa(encodeURIComponent(g));c.setAttribute("data-slate-fragment",m),e.setData("application/".concat(t),m);var D=l.ownerDocument.createElement("div");return D.appendChild(l),D.setAttribute("hidden","true"),l.ownerDocument.body.appendChild(D),e.setData("text/html",D.innerHTML),e.setData("text/plain",ys(D)),l.ownerDocument.body.removeChild(D),e}}},n.insertData=e=>{n.insertFragmentData(e)||n.insertTextData(e)},n.insertFragmentData=e=>{var r=e.getData("application/".concat(t))||(e=>{var t=e.getData("text/html"),[,n]=t.match(ws)||[];return n})(e);if(r){var o=decodeURIComponent(window.atob(r)),i=JSON.parse(o);return n.insertFragment(i),!0}return!1},n.insertTextData=e=>{var t=e.getData("text/plain");if(t){var r=t.split(/\r\n|\r|\n/),o=!1;for(var i of r)o&&Ki.splitNodes(n,{always:!0}),n.insertText(i),o=!0;return!0}return!1},n.onChange=e=>{(ku<18?E.unstable_batchedUpdates:e=>e())((()=>{var t=rs.get(n);t&&t(e),o(e)}))},n},Kl=(e,t)=>{var n=[];for(var[r,o]of ni.levels(e,{at:t})){var i=As.findKey(e,r);n.push([o,i])}return n};function $l(e){return Zl(e)?(e.nodeName||"").toLowerCase():"#document"}function Yl(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Xl(e){var t;return null==(t=(Zl(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Zl(e){return e instanceof Node||e instanceof Yl(e).Node}function Gl(e){return e instanceof Element||e instanceof Yl(e).Element}function Jl(e){return e instanceof HTMLElement||e instanceof Yl(e).HTMLElement}function Ql(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Yl(e).ShadowRoot)}function ec(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ic(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function tc(e){return["table","td","th"].includes($l(e))}function nc(e){const t=rc(),n=ic(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function rc(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function oc(e){return["html","body","#document"].includes($l(e))}function ic(e){return Yl(e).getComputedStyle(e)}function ac(e){return Gl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function uc(e){if("html"===$l(e))return e;const t=e.assignedSlot||e.parentNode||Ql(e)&&e.host||Xl(e);return Ql(t)?t.host:t}function sc(e){const t=uc(e);return oc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jl(t)&&ec(t)?t:sc(t)}function lc(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=sc(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Yl(o);return i?t.concat(a,a.visualViewport||[],ec(o)?o:[],a.frameElement&&n?lc(a.frameElement):[]):t.concat(o,lc(o,[],n))}const cc=Math.min,dc=Math.max,fc=Math.round,pc=Math.floor,hc=e=>({x:e,y:e}),vc={left:"right",right:"left",bottom:"top",top:"bottom"},gc={start:"end",end:"start"};function mc(e,t,n){return dc(e,cc(t,n))}function Dc(e,t){return"function"==typeof e?e(t):e}function bc(e){return e.split("-")[0]}function Cc(e){return e.split("-")[1]}function yc(e){return"x"===e?"y":"x"}function wc(e){return"y"===e?"height":"width"}function Bc(e){return["top","bottom"].includes(bc(e))?"y":"x"}function Ec(e){return yc(Bc(e))}function xc(e){return e.replace(/start|end/g,(e=>gc[e]))}function Ac(e){return e.replace(/left|right|bottom|top/g,(e=>vc[e]))}function Fc(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Oc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function kc(e,t,n){let{reference:r,floating:o}=e;const i=Bc(t),a=Ec(t),u=wc(a),s=bc(t),l="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[u]/2-o[u]/2;let p;switch(s){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Cc(t)){case"start":p[a]-=f*(n&&l?-1:1);break;case"end":p[a]+=f*(n&&l?-1:1)}return p}async function Sc(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:u,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Dc(t,e),h=Fc(p),v=u[f?"floating"===d?"reference":"floating":d],g=Oc(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:l,rootBoundary:c,strategy:s})),m="floating"===d?{...a.floating,x:r,y:o}:a.reference,D=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),b=await(null==i.isElement?void 0:i.isElement(D))&&await(null==i.getScale?void 0:i.getScale(D))||{x:1,y:1},C=Oc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:m,offsetParent:D,strategy:s}):m);return{top:(g.top-C.top+h.top)/b.y,bottom:(C.bottom-g.bottom+h.bottom)/b.y,left:(g.left-C.left+h.left)/b.x,right:(C.right-g.right+h.right)/b.x}}function jc(e){const t=cc(...e.map((e=>e.left))),n=cc(...e.map((e=>e.top)));return{x:t,y:n,width:dc(...e.map((e=>e.right)))-t,height:dc(...e.map((e=>e.bottom)))-n}}const Pc=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:u}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=bc(n),u=Cc(n),s="y"===Bc(n),l=["left","top"].includes(a)?-1:1,c=i&&s?-1:1,d=Dc(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return u&&"number"==typeof h&&(p="end"===u?-1*h:h),s?{x:p*c,y:f*l}:{x:f*l,y:p*c}}(t,e);return a===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}};function Rc(e){const t=ic(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jl(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,u=fc(n)!==i||fc(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function Tc(e){return Gl(e)?e:e.contextElement}function Nc(e){const t=Tc(e);if(!Jl(t))return hc(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Rc(t);let a=(i?fc(n.width):n.width)/r,u=(i?fc(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),u&&Number.isFinite(u)||(u=1),{x:a,y:u}}const _c=hc(0);function Mc(e){const t=Yl(e);return rc()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_c}function Lc(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Tc(e);let a=hc(1);t&&(r?Gl(r)&&(a=Nc(r)):a=Nc(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Yl(e))&&t}(i,n,r)?Mc(i):hc(0);let s=(o.left+u.x)/a.x,l=(o.top+u.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=Yl(i),t=r&&Gl(r)?Yl(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=Nc(o),t=o.getBoundingClientRect(),r=ic(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,l*=e.y,c*=e.x,d*=e.y,s+=i,l+=a,n=Yl(o),o=n.frameElement}}return Oc({width:c,height:d,x:s,y:l})}const Ic=[":popover-open",":modal"];function zc(e){return Ic.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Wc(e){return Lc(Xl(e)).left+ac(e).scrollLeft}function Vc(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Yl(e),r=Xl(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,u=0,s=0;if(o){i=o.width,a=o.height;const e=rc();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:u,y:s}}(e,n);else if("document"===t)r=function(e){const t=Xl(e),n=ac(e),r=e.ownerDocument.body,o=dc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=dc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Wc(e);const u=-n.scrollTop;return"rtl"===ic(r).direction&&(a+=dc(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:u}}(Xl(e));else if(Gl(t))r=function(e,t){const n=Lc(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jl(e)?Nc(e):hc(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Mc(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Oc(r)}function qc(e,t){const n=uc(e);return!(n===t||!Gl(n)||oc(n))&&("fixed"===ic(n).position||qc(n,t))}function Hc(e,t,n){const r=Jl(t),o=Xl(t),i="fixed"===n,a=Lc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const s=hc(0);if(r||!r&&!i)if(("body"!==$l(t)||ec(o))&&(u=ac(t)),r){const e=Lc(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=Wc(o));return{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function Uc(e,t){return Jl(e)&&"fixed"!==ic(e).position?t?t(e):e.offsetParent:null}function Kc(e,t){const n=Yl(e);if(!Jl(e)||zc(e))return n;let r=Uc(e,t);for(;r&&tc(r)&&"static"===ic(r).position;)r=Uc(r,t);return r&&("html"===$l(r)||"body"===$l(r)&&"static"===ic(r).position&&!nc(r))?n:r||function(e){let t=uc(e);for(;Jl(t)&&!oc(t);){if(nc(t))return t;t=uc(t)}return null}(e)||n}const $c={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Xl(r),u=!!t&&zc(t.floating);if(r===a||u&&i)return n;let s={scrollLeft:0,scrollTop:0},l=hc(1);const c=hc(0),d=Jl(r);if((d||!d&&!i)&&(("body"!==$l(r)||ec(a))&&(s=ac(r)),Jl(r))){const e=Lc(r);l=Nc(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+c.x,y:n.y*l.y-s.scrollTop*l.y+c.y}},getDocumentElement:Xl,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=lc(e,[],!1).filter((e=>Gl(e)&&"body"!==$l(e))),o=null;const i="fixed"===ic(e).position;let a=i?uc(e):e;for(;Gl(a)&&!oc(a);){const t=ic(a),n=nc(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ec(a)&&!n&&qc(e,a))?r=r.filter((e=>e!==a)):o=t,a=uc(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],u=a[0],s=a.reduce(((e,n)=>{const r=Vc(t,n,o);return e.top=dc(r.top,e.top),e.right=cc(r.right,e.right),e.bottom=cc(r.bottom,e.bottom),e.left=dc(r.left,e.left),e}),Vc(t,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Kc,getElementRects:async function(e){const t=this.getOffsetParent||Kc,n=this.getDimensions;return{reference:Hc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Rc(e);return{width:t,height:n}},getScale:Nc,isElement:Gl,isRTL:function(e){return"rtl"===ic(e).direction}};function Yc(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,l=Tc(e),c=o||i?[...l?lc(l):[],...lc(t)]:[];c.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&u?function(e,t){let n,r=null;const o=Xl(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(u,s){void 0===u&&(u=!1),void 0===s&&(s=1),i();const{left:l,top:c,width:d,height:f}=e.getBoundingClientRect();if(u||t(),!d||!f)return;const p={rootMargin:-pc(c)+"px "+-pc(o.clientWidth-(l+d))+"px "+-pc(o.clientHeight-(c+f))+"px "+-pc(l)+"px",threshold:dc(0,cc(1,s))||1};let h=!0;function v(e){const t=e[0].intersectionRatio;if(t!==s){if(!h)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}h=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(l,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),l&&!s&&h.observe(l),h.observe(t));let v=s?Lc(e):null;return s&&function t(){const r=Lc(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(f)}}const Xc=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=Dc(e,t),l={x:n,y:r},c=await Sc(t,s),d=Bc(bc(o)),f=yc(d);let p=l[f],h=l[d];if(i){const e="y"===f?"bottom":"right";p=mc(p+c["y"===f?"top":"left"],p,p-c[e])}if(a){const e="y"===d?"bottom":"right";h=mc(h+c["y"===d?"top":"left"],h,h-c[e])}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},Zc=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:u,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...g}=Dc(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const m=bc(o),D=bc(u)===u,b=await(null==s.isRTL?void 0:s.isRTL(l.floating)),C=f||(D||!v?[Ac(u)]:function(e){const t=Ac(e);return[xc(e),t,xc(t)]}(u));f||"none"===h||C.push(...function(e,t,n,r){const o=Cc(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(bc(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(xc)))),i}(u,v,h,b));const y=[u,...C],w=await Sc(t,g),B=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&B.push(w[m]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Cc(e),o=Ec(e),i=wc(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Ac(a)),[a,Ac(a)]}(o,a,b);B.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:o,overflows:B}],!B.every((e=>e<=0))){var x,A;const e=((null==(x=i.flip)?void 0:x.index)||0)+1,t=y[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(A=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(p){case"bestFit":{var F;const e=null==(F=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:F[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},Gc=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:u=2,x:s,y:l}=Dc(e,t),c=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),d=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let r=null;for(let e=0;e<t.length;e++){const o=t[e];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map((e=>Oc(jc(e))))}(c),f=Oc(jc(c)),p=Fc(u);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=s&&null!=l)return d.find((e=>s>e.left-p.left&&s<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom))||f;if(d.length>=2){if("y"===Bc(n)){const e=d[0],t=d[d.length-1],r="top"===bc(n),o=e.top,i=t.bottom,a=r?e.left:t.left,u=r?e.right:t.right;return{top:o,bottom:i,left:a,right:u,width:u-a,height:i-o,x:a,y:o}}const e="left"===bc(n),t=dc(...d.map((e=>e.right))),r=cc(...d.map((e=>e.left))),o=d.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return f}},floating:r.floating,strategy:a});return o.reference.x!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Jc=(e,t,n)=>{const r=new Map,o={platform:$c,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,u=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=kc(l,r,s),f=r,p={},h=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:m,data:D,reset:b}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=m?m:d,p={...p,[i]:{...p[i],...D}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(l=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:d}=kc(l,f,s))),n=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Qc="undefined"!=typeof document?s:l;function ed(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!ed(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!ed(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function td(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nd(e,t){const n=td(e);return Math.round(t*n)/n}function rd(e){const t=r.useRef(e);return Qc((()=>{t.current=e})),t}
1
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import*as n from"react";import r,{createContext as i,useContext as a,useRef as l,useLayoutEffect as c,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as y,createElement as g}from"react";import*as v from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as E,DefaultElement as C,withReact as O}from"slate-react";import{Path as S,Editor as D,Element as _,Transforms as R,Range as j,Text as B,createEditor as A,Point as T}from"slate";class M{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const{renders:t,options:o}=e,n=Object.assign(Object.assign({},this.plugin.options),o),r=Object.assign({},this.plugin.elements);return t&&Object.keys(t).forEach((e=>{const o=r[e];o&&o.render&&(r[e].render=o=>t[e](o))})),new M(Object.assign(Object.assign({},this.plugin),{elements:r,options:n}))}}function L(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));return r?e.children[r]:null}const N={editor:{getBlock:()=>{},insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},toggleBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{}}},I=i(N),P=({children:t,editorState:o})=>{const n=l(N);return n.current={editor:o.editor},e(I.Provider,Object.assign({value:n.current},{children:t}))},z=()=>{const e=a(I);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},F=e=>z().children[e],U=e=>z().blocks[e],H=e=>z().plugins[e],V=()=>z().readOnly,K=e=>{var t;return null===(t=H(e))||void 0===t?void 0:t.options},W=({blockId:e,path:t})=>{var o;const n=z();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let r;return e&&(r=n.children[e]),t&&(r=L(n,{at:t})),(null===(o=n.selection)||void 0===o?void 0:o[0])===(null==r?void 0:r.meta.order)};var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},$={};!function(e){var t=Object.prototype.hasOwnProperty,o="~";function n(){}function r(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var l=new r(n,i||e,a),c=o?o+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],l]:e._events[c].push(l):(e._events[c]=l,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function l(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(o=!1)),l.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(o?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=o?o+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=new Array(i);r<i;r++)a[r]=n[r].fn;return a},l.prototype.listenerCount=function(e){var t=o?o+e:e,n=this._events[t];return n?n.fn?1:n.length:0},l.prototype.emit=function(e,t,n,r,i,a){var l=o?o+e:e;if(!this._events[l])return!1;var c,s,d=this._events[l],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,r),!0;case 5:return d.fn.call(d.context,t,n,r,i),!0;case 6:return d.fn.call(d.context,t,n,r,i,a),!0}for(s=1,c=new Array(u-1);s<u;s++)c[s-1]=arguments[s];d.fn.apply(d.context,c)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,n);break;case 4:d[s].fn.call(d[s].context,t,n,r);break;default:if(!c)for(f=1,c=new Array(u-1);f<u;f++)c[f-1]=arguments[f];d[s].fn.apply(d[s].context,c)}}return!0},l.prototype.on=function(e,t,o){return i(this,e,t,o,!1)},l.prototype.once=function(e,t,o){return i(this,e,t,o,!0)},l.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var l=this._events[i];if(l.fn)l.fn!==t||r&&!l.once||n&&l.context!==n||a(this,i);else{for(var c=0,s=[],d=l.length;c<d;c++)(l[c].fn!==t||r&&!l[c].once||n&&l[c].context!==n)&&s.push(l[c]);s.length?this._events[i]=1===s.length?s[0]:s:a(this,i)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=o,l.EventEmitter=l,e.exports=l}({get exports(){return $},set exports(e){$=e}});var X=$;function Z(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const q=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?Z():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},G=e=>({id:q(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),J=e=>({id:(null==e?void 0:e.id)||q(),value:(null==e?void 0:e.value)||[G()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const Q="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ee(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function te(e){return"nodeType"in e}function oe(e){var t,o;return e?ee(e)?e:te(e)&&null!=(t=null==(o=e.ownerDocument)?void 0:o.defaultView)?t:window:window}function ne(e){const{Document:t}=oe(e);return e instanceof t}function re(e){return!ee(e)&&e instanceof oe(e).HTMLElement}function ie(e){return e instanceof oe(e).SVGElement}function ae(e){return e?ee(e)?e.document:te(e)?ne(e)?e:re(e)||ie(e)?e.ownerDocument:document:document:document}const le=Q?c:s;function ce(e){const t=l(e);return le((()=>{t.current=e})),u((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}function se(e,t){void 0===t&&(t=[e]);const o=l(e);return le((()=>{o.current!==e&&(o.current=e)}),t),o}function de(e,t){const o=l();return d((()=>{const t=e(o.current);return o.current=t,t}),[...t])}function ue(e){const t=ce(e),o=l(null),n=u((e=>{e!==o.current&&(null==t||t(e,o.current)),o.current=e}),[]);return[o,n]}function fe(e){const t=l();return s((()=>{t.current=e}),[e]),t.current}let pe={};function he(e,t){return d((()=>{if(t)return t;const o=null==pe[e]?0:pe[e]+1;return pe[e]=o,e+"-"+o}),[e,t])}function ye(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>{const n=Object.entries(o);for(const[o,r]of n){const n=t[o];null!=n&&(t[o]=n+e*r)}return t}),{...t})}}const ge=ye(1),ve=ye(-1);function me(e){if(!e)return!1;const{KeyboardEvent:t}=oe(e.target);return t&&e instanceof t}function be(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=oe(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:o}=e.touches[0];return{x:t,y:o}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:o}=e.changedTouches[0];return{x:t,y:o}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const we=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:o}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:o}=e;return"scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return[we.Translate.toString(e),we.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:n}=e;return t+" "+o+"ms "+n}}}),xe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ke(e){return e.matches(xe)?e:e.querySelector(xe)}const Ee={display:"none"};function Ce(e){let{id:t,value:o}=e;return r.createElement("div",{id:t,style:Ee},o)}function Oe(e){let{id:t,announcement:o,ariaLiveType:n="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":n,"aria-atomic":!0},o)}const Se=i(null);const De={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},_e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was moved over droppable area "+o.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was dropped over droppable area "+o.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Re(e){let{announcements:t=_e,container:o,hiddenTextDescribedById:n,screenReaderInstructions:i=De}=e;const{announce:l,announcement:c}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=he("DndLiveRegion"),[h,y]=f(!1);if(s((()=>{y(!0)}),[]),function(e){const t=a(Se);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:o}=e;l(t.onDragStart({active:o}))},onDragMove(e){let{active:o,over:n}=e;t.onDragMove&&l(t.onDragMove({active:o,over:n}))},onDragOver(e){let{active:o,over:n}=e;l(t.onDragOver({active:o,over:n}))},onDragEnd(e){let{active:o,over:n}=e;l(t.onDragEnd({active:o,over:n}))},onDragCancel(e){let{active:o,over:n}=e;l(t.onDragCancel({active:o,over:n}))}})),[l,t])),!h)return null;const g=r.createElement(r.Fragment,null,r.createElement(Ce,{id:n,value:i.draggable}),r.createElement(Oe,{id:p,announcement:c}));return o?b(g,o):g}var je;function Be(){}function Ae(e,t){return d((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(je||(je={}));const Te=Object.freeze({x:0,y:0});function Me(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Le(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return o-n}function Ne(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return n-o}function Ie(e){let{left:t,top:o,height:n,width:r}=e;return[{x:t,y:o},{x:t+r,y:o},{x:t,y:o+n},{x:t+r,y:o+n}]}function Pe(e,t){if(!e||0===e.length)return null;const[o]=e;return t?o[t]:o}function ze(e,t,o){return void 0===t&&(t=e.left),void 0===o&&(o=e.top),{x:t+.5*e.width,y:o+.5*e.height}}const Fe=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=ze(t,t.left,t.top),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Me(ze(n),r);i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(Le)};function Ue(e,t){const o=Math.max(t.top,e.top),n=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-n,l=i-o;if(n<r&&o<i){const o=t.width*t.height,n=e.width*e.height,r=a*l;return Number((r/(o+n-r)).toFixed(4))}return 0}const He=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=[];for(const e of n){const{id:n}=e,i=o.get(n);if(i){const o=Ue(i,t);o>0&&r.push({id:n,data:{droppableContainer:e,value:o}})}}return r.sort(Ne)};function Ve(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Te}function Ke(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>({...t,top:t.top+e*o.y,bottom:t.bottom+e*o.y,left:t.left+e*o.x,right:t.right+e*o.x})),{...t})}}const We=Ke(1);const Ye={ignoreTransform:!1};function $e(e,t){void 0===t&&(t=Ye);let o=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=oe(e).getComputedStyle(e);t&&(o=function(e,t,o){const n=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!n)return e;const{scaleX:r,scaleY:i,x:a,y:l}=n,c=e.left-a-(1-r)*parseFloat(o),s=e.top-l-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),d=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(o,t,n))}const{top:n,left:r,width:i,height:a,bottom:l,right:c}=o;return{top:n,left:r,width:i,height:a,bottom:l,right:c}}function Xe(e){return $e(e,{ignoreTransform:!0})}function Ze(e,t){const o=[];return e?function n(r){if(null!=t&&o.length>=t)return o;if(!r)return o;if(ne(r)&&null!=r.scrollingElement&&!o.includes(r.scrollingElement))return o.push(r.scrollingElement),o;if(!re(r)||ie(r))return o;if(o.includes(r))return o;const i=oe(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=oe(e).getComputedStyle(e));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const n=t[e];return"string"==typeof n&&o.test(n)}))}(r,i)&&o.push(r),function(e,t){return void 0===t&&(t=oe(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?o:n(r.parentNode)}(e):o}function qe(e){const[t]=Ze(e,1);return null!=t?t:null}function Ge(e){return Q&&e?ee(e)?e:te(e)?ne(e)||e===ae(e).scrollingElement?window:re(e)?e:null:null:null}function Je(e){return ee(e)?e.scrollX:e.scrollLeft}function Qe(e){return ee(e)?e.scrollY:e.scrollTop}function et(e){return{x:Je(e),y:Qe(e)}}var tt;function ot(e){return!(!Q||!e)&&e===document.scrollingElement}function nt(e){const t={x:0,y:0},o=ot(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-o.width,y:e.scrollHeight-o.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(tt||(tt={}));const rt={x:.2,y:.2};function it(e,t,o,n,r){let{top:i,left:a,right:l,bottom:c}=o;void 0===n&&(n=10),void 0===r&&(r=rt);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=nt(e),p={x:0,y:0},h={x:0,y:0},y=t.height*r.y,g=t.width*r.x;return!s&&i<=t.top+y?(p.y=tt.Backward,h.y=n*Math.abs((t.top+y-i)/y)):!d&&c>=t.bottom-y&&(p.y=tt.Forward,h.y=n*Math.abs((t.bottom-y-c)/y)),!f&&l>=t.right-g?(p.x=tt.Forward,h.x=n*Math.abs((t.right-g-l)/g)):!u&&a<=t.left+g&&(p.x=tt.Backward,h.x=n*Math.abs((t.left+g-a)/g)),{direction:p,speed:h}}function at(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:o,right:n,bottom:r}=e.getBoundingClientRect();return{top:t,left:o,right:n,bottom:r,width:e.clientWidth,height:e.clientHeight}}function lt(e){return e.reduce(((e,t)=>ge(e,et(t))),Te)}const ct=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Je(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}]];class st{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Ze(t),n=lt(o);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of ct)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(o),a=n[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class dt{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,o){var n;null==(n=this.target)||n.addEventListener(e,t,o),this.listeners.push([e,t,o])}}function ut(e,t){const o=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(o**2+n**2)>t:"x"in t&&"y"in t?o>t.x&&n>t.y:"x"in t?o>t.x:"y"in t&&n>t.y}var ft,pt;function ht(e){e.preventDefault()}function yt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(ft||(ft={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(pt||(pt={}));const gt={start:[pt.Space,pt.Enter],cancel:[pt.Esc],end:[pt.Space,pt.Enter]},vt=(e,t)=>{let{currentCoordinates:o}=t;switch(e.code){case pt.Right:return{...o,x:o.x+25};case pt.Left:return{...o,x:o.x-25};case pt.Down:return{...o,y:o.y+25};case pt.Up:return{...o,y:o.y-25}}};class mt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new dt(ae(t)),this.windowListeners=new dt(oe(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ft.Resize,this.handleCancel),this.windowListeners.add(ft.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(ft.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,o=e.node.current;o&&function(e,t){if(void 0===t&&(t=$e),!e)return;const{top:o,left:n,bottom:r,right:i}=t(e);qe(e)&&(r<=0||i<=0||o>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(o),t(Te)}handleKeyDown(e){if(me(e)){const{active:t,context:o,options:n}=this.props,{keyboardCodes:r=gt,coordinateGetter:i=vt,scrollBehavior:a="smooth"}=n,{code:l}=e;if(r.end.includes(l))return void this.handleEnd(e);if(r.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=o.current,s=c?{x:c.left,y:c.top}:Te;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:o.current,currentCoordinates:s});if(d){const t=ve(d,s),n={x:0,y:0},{scrollableAncestors:r}=o.current;for(const o of r){const r=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:u,minScroll:f}=nt(o),p=at(o),h={x:Math.min(r===pt.Right?p.right-p.width/2:p.right,Math.max(r===pt.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===pt.Down?p.bottom-p.height/2:p.bottom,Math.max(r===pt.Down?p.top:p.top+p.height/2,d.y))},y=r===pt.Right&&!l||r===pt.Left&&!c,g=r===pt.Down&&!s||r===pt.Up&&!i;if(y&&h.x!==d.x){const e=o.scrollLeft+t.x,i=r===pt.Right&&e<=u.x||r===pt.Left&&e>=f.x;if(i&&!t.y)return void o.scrollTo({left:e,behavior:a});n.x=i?o.scrollLeft-e:r===pt.Right?o.scrollLeft-u.x:o.scrollLeft-f.x,n.x&&o.scrollBy({left:-n.x,behavior:a});break}if(g&&h.y!==d.y){const e=o.scrollTop+t.y,i=r===pt.Down&&e<=u.y||r===pt.Up&&e>=f.y;if(i&&!t.x)return void o.scrollTo({top:e,behavior:a});n.y=i?o.scrollTop-e:r===pt.Down?o.scrollTop-u.y:o.scrollTop-f.y,n.y&&o.scrollBy({top:-n.y,behavior:a});break}}this.handleMove(e,ge(ve(d,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:o}=this.props;e.preventDefault(),o(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function bt(e){return Boolean(e&&"distance"in e)}function wt(e){return Boolean(e&&"delay"in e)}mt.activators=[{eventName:"onKeyDown",handler:(e,t,o)=>{let{keyboardCodes:n=gt,onActivation:r}=t,{active:i}=o;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class xt{constructor(e,t,o){var n;void 0===o&&(o=function(e){const{EventTarget:t}=oe(e);return e instanceof t?e:ae(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=ae(i),this.documentListeners=new dt(this.document),this.listeners=new dt(o),this.windowListeners=new dt(oe(i)),this.initialCoordinates=null!=(n=be(r))?n:Te,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:o}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(ft.Resize,this.handleCancel),this.windowListeners.add(ft.DragStart,ht),this.windowListeners.add(ft.VisibilityChange,this.handleCancel),this.windowListeners.add(ft.ContextMenu,ht),this.documentListeners.add(ft.Keydown,this.handleKeydown),t){if(null!=o&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(wt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(bt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ft.Click,yt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ft.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:o,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;const l=null!=(t=be(e))?t:Te,c=ve(n,l);if(!o&&a){if(bt(a)){if(null!=a.tolerance&&ut(c,a.tolerance))return this.handleCancel();if(ut(c,a.distance))return this.handleStart()}return wt(a)&&ut(c,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===pt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const kt={move:{name:"pointermove"},end:{name:"pointerup"}};class Et extends xt{constructor(e){const{event:t}=e,o=ae(t.target);super(e,kt,o)}}Et.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return!(!o.isPrimary||0!==o.button)&&(null==n||n({event:o}),!0)}}];const Ct={move:{name:"mousemove"},end:{name:"mouseup"}};var Ot;!function(e){e[e.RightClick=2]="RightClick"}(Ot||(Ot={}));(class extends xt{constructor(e){super(e,Ct,ae(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return o.button!==Ot.RightClick&&(null==n||n({event:o}),!0)}}];const St={move:{name:"touchmove"},end:{name:"touchend"}};var Dt,_t;function Rt(e){let{acceleration:t,activator:o=Dt.Pointer,canScroll:n,draggingRect:r,enabled:i,interval:a=5,order:c=_t.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:y,threshold:g}=e;const v=function(e){let{delta:t,disabled:o}=e;const n=fe(t);return de((e=>{if(o||!n||!e)return jt;const r={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[tt.Backward]:e.x[tt.Backward]||-1===r.x,[tt.Forward]:e.x[tt.Forward]||1===r.x},y:{[tt.Backward]:e.y[tt.Backward]||-1===r.y,[tt.Forward]:e.y[tt.Forward]||1===r.y}}}),[o,t,n])}({delta:y,disabled:!i}),[m,b]=function(){const e=l(null);return[u(((t,o)=>{e.current=setInterval(t,o)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=l({x:0,y:0}),x=l({x:0,y:0}),k=d((()=>{switch(o){case Dt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Dt.DraggableRect:return r}}),[o,r,f]),E=l(null),C=u((()=>{const e=E.current;if(!e)return;const t=w.current.x*x.current.x,o=w.current.y*x.current.y;e.scrollBy(t,o)}),[]),O=d((()=>c===_t.TreeOrder?[...p].reverse():p),[c,p]);s((()=>{if(i&&p.length&&k){for(const e of O){if(!1===(null==n?void 0:n(e)))continue;const o=p.indexOf(e),r=h[o];if(!r)continue;const{direction:i,speed:l}=it(e,r,k,t,g);for(const e of["x","y"])v[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return b(),E.current=e,m(C,a),w.current=l,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,C,n,b,i,a,JSON.stringify(k),JSON.stringify(v),m,p,O,h,JSON.stringify(g)])}(class extends xt{constructor(e){super(e,St)}static setup(){return window.addEventListener(St.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(St.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;const{touches:r}=o;return!(r.length>1)&&(null==n||n({event:o}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Dt||(Dt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(_t||(_t={}));const jt={x:{[tt.Backward]:!1,[tt.Forward]:!1},y:{[tt.Backward]:!1,[tt.Forward]:!1}};var Bt,At;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Bt||(Bt={})),function(e){e.Optimized="optimized"}(At||(At={}));const Tt=new Map;function Mt(e,t){return de((o=>e?o||("function"==typeof t?t(e):e):null),[t,e])}function Lt(e){let{callback:t,disabled:o}=e;const n=ce(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(n)}),[o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}function Nt(e){return new st($e(e),e)}function It(e,t,o){void 0===t&&(t=Nt);const[n,r]=h((function(n){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=n?n:o)?r:null;const i=t(e);if(JSON.stringify(n)===JSON.stringify(i))return n;return i}),null),i=function(e){let{callback:t,disabled:o}=e;const n=ce(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(n)}),[n,o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}({callback(t){if(e)for(const o of t){const{type:t,target:n}=o;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){r();break}}}}),a=Lt({callback:r});return le((()=>{r(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),n}const Pt=[];function zt(e,t){void 0===t&&(t=[]);const o=l(null);return s((()=>{o.current=null}),t),s((()=>{const t=e!==Te;t&&!o.current&&(o.current=e),!t&&o.current&&(o.current=null)}),[e]),o.current?ve(e,o.current):Te}function Ft(e){return d((()=>e?function(e){const t=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:t,bottom:o,width:t,height:o}}(e):null),[e])}const Ut=[];function Ht(e){let{measure:t}=e;const[o,n]=f(null),r=u((e=>{for(const{target:o}of e)if(re(o)){n((e=>{const n=t(o);return e?{...e,width:n.width,height:n.height}:n}));break}}),[t]),i=Lt({callback:r}),a=u((e=>{const o=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return re(t)?t:e}(e);null==i||i.disconnect(),o&&(null==i||i.observe(o)),n(o?t(o):null)}),[t,i]),[l,c]=ue(a);return d((()=>({nodeRef:l,rect:o,setRef:c})),[o,l,c])}const Vt=[{sensor:Et,options:{}},{sensor:mt,options:{}}],Kt={current:{}},Wt={draggable:{measure:Xe},droppable:{measure:Xe,strategy:Bt.WhileDragging,frequency:At.Optimized},dragOverlay:{measure:$e}};class Yt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,o;return null!=(t=null==(o=this.get(e))?void 0:o.node.current)?t:void 0}}const $t={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Yt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Be},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Wt,measureDroppableContainers:Be,windowRect:null,measuringScheduled:!1},Xt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Be,draggableNodes:new Map,over:null,measureDroppableContainers:Be}),Zt=i($t);function qt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Yt}}}function Gt(e,t){switch(t.type){case je.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case je.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case je.DragEnd:case je.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case je.RegisterDroppable:{const{element:o}=t,{id:n}=o,r=new Yt(e.droppable.containers);return r.set(n,o),{...e,droppable:{...e.droppable,containers:r}}}case je.SetDroppableDisabled:{const{id:o,key:n,disabled:r}=t,i=e.droppable.containers.get(o);if(!i||n!==i.key)return e;const a=new Yt(e.droppable.containers);return a.set(o,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case je.UnregisterDroppable:{const{id:o,key:n}=t,r=e.droppable.containers.get(o);if(!r||n!==r.key)return e;const i=new Yt(e.droppable.containers);return i.delete(o),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Jt(e){let{disabled:t}=e;const{active:o,activatorEvent:n,draggableNodes:r}=a(Xt),i=fe(n),l=fe(null==o?void 0:o.id);return s((()=>{if(!t&&!n&&i&&null!=l){if(!me(i))return;if(document.activeElement===i.target)return;const e=r.get(l);if(!e)return;const{activatorNode:t,node:o}=e;if(!t.current&&!o.current)return;requestAnimationFrame((()=>{for(const e of[t.current,o.current]){if(!e)continue;const t=ke(e);if(t){t.focus();break}}}))}}),[n,t,r,l,i]),null}const Qt=i({...Te,scaleX:1,scaleY:1});var eo;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(eo||(eo={}));const to=p((function(e){var t,o,n,i;let{id:a,accessibility:c,autoScroll:p=!0,children:y,sensors:g=Vt,collisionDetection:v=He,measuring:b,modifiers:w,...x}=e;const k=h(Gt,void 0,qt),[E,C]=k,[O,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:o,event:n}=t;e.forEach((e=>{var t;return null==(t=e[o])?void 0:t.call(e,n)}))}),[e]),t]}(),[D,_]=f(eo.Uninitialized),R=D===eo.Initialized,{draggable:{active:j,nodes:B,translate:A},droppable:{containers:T}}=E,M=j?B.get(j):null,L=l({initial:null,translated:null}),N=d((()=>{var e;return null!=j?{id:j,data:null!=(e=null==M?void 0:M.data)?e:Kt,rect:L}:null}),[j,M]),I=l(null),[P,z]=f(null),[F,U]=f(null),H=se(x,Object.values(x)),V=he("DndDescribedBy",a),K=d((()=>T.getEnabled()),[T]),W=d((()=>({draggable:{...Wt.draggable,...null==Y?void 0:Y.draggable},droppable:{...Wt.droppable,...null==Y?void 0:Y.droppable},dragOverlay:{...Wt.dragOverlay,...null==Y?void 0:Y.dragOverlay}})),[null==(Y=b)?void 0:Y.draggable,null==Y?void 0:Y.droppable,null==Y?void 0:Y.dragOverlay]);var Y;const{droppableRects:$,measureDroppableContainers:X,measuringScheduled:Z}=function(e,t){let{dragging:o,dependencies:n,config:r}=t;const[i,a]=f(null),{frequency:c,measure:d,strategy:p}=r,h=l(e),y=function(){switch(p){case Bt.Always:return!1;case Bt.BeforeDragging:return o;default:return!o}}(),g=se(y),v=u((function(e){void 0===e&&(e=[]),g.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),m=l(null),b=de((t=>{if(y&&!o)return Tt;if(!t||t===Tt||h.current!==e||null!=i){const t=new Map;for(let o of e){if(!o)continue;if(i&&i.length>0&&!i.includes(o.id)&&o.rect.current){t.set(o.id,o.rect.current);continue}const e=o.node.current,n=e?new st(d(e),e):null;o.rect.current=n,n&&t.set(o.id,n)}return t}return t}),[e,i,o,y,d]);return s((()=>{h.current=e}),[e]),s((()=>{y||v()}),[o,y]),s((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),s((()=>{y||"number"!=typeof c||null!==m.current||(m.current=setTimeout((()=>{v(),m.current=null}),c))}),[c,y,v,...n]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:null!=i}}(K,{dragging:R,dependencies:[A.x,A.y],config:W.droppable}),q=function(e,t){const o=null!==t?e.get(t):void 0,n=o?o.node.current:null;return de((e=>{var o;return null===t?null:null!=(o=null!=n?n:e)?o:null}),[n,t])}(B,j),G=d((()=>F?be(F):null),[F]),J=function(){const e=!1===(null==P?void 0:P.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,o=R&&!e&&!t;if("object"==typeof p)return{...p,enabled:o};return{enabled:o}}(),ee=function(e,t){return Mt(e,t)}(q,W.draggable.measure);!function(e){let{activeNode:t,measure:o,initialRect:n,config:r=!0}=e;const i=l(!1),{x:a,y:c}="boolean"==typeof r?{x:r,y:r}:r;le((()=>{if(!a&&!c||!t)return void(i.current=!1);if(i.current||!n)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=Ve(o(e),n);if(a||(r.x=0),c||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=qe(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,a,c,n,o])}({activeNode:j?B.get(j):null,config:J.layoutShiftCompensation,initialRect:ee,measure:W.draggable.measure});const te=It(q,W.draggable.measure,ee),ne=It(q?q.parentElement:null),re=l({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=T.getNodeFor(null==(t=re.current.over)?void 0:t.id),ae=Ht({measure:W.dragOverlay.measure}),ce=null!=(o=ae.nodeRef.current)?o:q,ue=R?null!=(n=ae.rect)?n:te:null,fe=Boolean(ae.nodeRef.current&&ae.rect),pe=Ve(ye=fe?null:te,Mt(ye));var ye;const ve=Ft(ce?oe(ce):null),me=function(e){const t=l(e),o=de((o=>e?o&&o!==Pt&&e&&t.current&&e.parentNode===t.current.parentNode?o:Ze(e):Pt),[e]);return s((()=>{t.current=e}),[e]),o}(R?null!=ie?ie:q:null),we=function(e,t){void 0===t&&(t=$e);const[o]=e,n=Ft(o?oe(o):null),[r,i]=h((function(){return e.length?e.map((e=>ot(e)?n:new st(t(e),e))):Ut}),Ut),a=Lt({callback:i});return e.length>0&&r===Ut&&i(),le((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),r}(me),xe=function(e,t){let{transform:o,...n}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...n})),o):o}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:F,active:N,activeNodeRect:te,containerNodeRect:ne,draggingNodeRect:ue,over:re.current.over,overlayNodeRect:ae.rect,scrollableAncestors:me,scrollableAncestorRects:we,windowRect:ve}),ke=G?ge(G,A):null,Ee=function(e){const[t,o]=f(null),n=l(e),r=u((e=>{const t=Ge(e.target);t&&o((e=>e?(e.set(t,et(t)),new Map(e)):null))}),[]);return s((()=>{const t=n.current;if(e!==t){i(t);const a=e.map((e=>{const t=Ge(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,et(t)]):null})).filter((e=>null!=e));o(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Ge(e);null==t||t.removeEventListener("scroll",r)}))}}),[r,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ge(e,t)),Te):lt(e):Te),[e,t])}(me),Ce=zt(Ee),Oe=zt(Ee,[te]),De=ge(xe,Ce),_e=ue?We(ue,xe):null,Be=N&&_e?v({active:N,collisionRect:_e,droppableRects:$,droppableContainers:K,pointerCoordinates:ke}):null,Ae=Pe(Be,"id"),[Me,Le]=f(null),Ne=function(e,t,o){return{...e,scaleX:t&&o?t.width/o.width:1,scaleY:t&&o?t.height/o.height:1}}(fe?xe:ge(xe,Oe),null!=(i=null==Me?void 0:Me.rect)?i:null,te),Ie=u(((e,t)=>{let{sensor:o,options:n}=t;if(null==I.current)return;const r=B.get(I.current);if(!r)return;const i=e.nativeEvent,a=new o({active:I.current,activeNode:r,event:i,options:n,context:re,onStart(e){const t=I.current;if(null==t)return;const o=B.get(t);if(!o)return;const{onDragStart:n}=H.current,r={active:{id:t,data:o.data,rect:L}};m((()=>{null==n||n(r),_(eo.Initializing),C({type:je.DragStart,initialCoordinates:e,active:t}),O({type:"onDragStart",event:r})}))},onMove(e){C({type:je.DragMove,coordinates:e})},onEnd:l(je.DragEnd),onCancel:l(je.DragCancel)});function l(e){return async function(){const{active:t,collisions:o,over:n,scrollAdjustedTranslate:r}=re.current;let a=null;if(t&&r){const{cancelDrop:l}=H.current;if(a={activatorEvent:i,active:t,collisions:o,delta:r,over:n},e===je.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=je.DragCancel)}}I.current=null,m((()=>{C({type:e}),_(eo.Uninitialized),Le(null),z(null),U(null);const t=e===je.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=H.current[t];null==e||e(a),O({type:t,event:a})}}))}}m((()=>{z(a),U(e.nativeEvent)}))}),[B]),ze=u(((e,t)=>(o,n)=>{const r=o.nativeEvent,i=B.get(n);if(null!==I.current||!i||r.dndKit||r.defaultPrevented)return;const a={active:i};!0===e(o,t.options,a)&&(r.dndKit={capturedBy:t.sensor},I.current=n,Ie(o,t))}),[B,Ie]),Fe=function(e,t){return d((()=>e.reduce(((e,o)=>{const{sensor:n}=o;return[...e,...n.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,o)})))]}),[])),[e,t])}(g,ze);!function(e){s((()=>{if(!Q)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(g),le((()=>{te&&D===eo.Initializing&&_(eo.Initialized)}),[te,D]),s((()=>{const{onDragMove:e}=H.current,{active:t,activatorEvent:o,collisions:n,over:r}=re.current;if(!t||!o)return;const i={active:t,activatorEvent:o,collisions:n,delta:{x:De.x,y:De.y},over:r};m((()=>{null==e||e(i),O({type:"onDragMove",event:i})}))}),[De.x,De.y]),s((()=>{const{active:e,activatorEvent:t,collisions:o,droppableContainers:n,scrollAdjustedTranslate:r}=re.current;if(!e||null==I.current||!t||!r)return;const{onDragOver:i}=H.current,a=n.get(Ae),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:o,delta:{x:r.x,y:r.y},over:l};m((()=>{Le(l),null==i||i(c),O({type:"onDragOver",event:c})}))}),[Ae]),le((()=>{re.current={activatorEvent:F,active:N,activeNode:q,collisionRect:_e,collisions:Be,droppableRects:$,draggableNodes:B,draggingNode:ce,draggingNodeRect:ue,droppableContainers:T,over:Me,scrollableAncestors:me,scrollAdjustedTranslate:De},L.current={initial:ue,translated:_e}}),[N,q,Be,_e,B,ce,ue,$,T,Me,me,De]),Rt({...J,delta:A,draggingRect:_e,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:we});const Ue=d((()=>({active:N,activeNode:q,activeNodeRect:te,activatorEvent:F,collisions:Be,containerNodeRect:ne,dragOverlay:ae,draggableNodes:B,droppableContainers:T,droppableRects:$,over:Me,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:we,measuringConfiguration:W,measuringScheduled:Z,windowRect:ve})),[N,q,te,F,Be,ne,ae,B,T,$,Me,X,me,we,W,Z,ve]),Ke=d((()=>({activatorEvent:F,activators:Fe,active:N,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:C,draggableNodes:B,over:Me,measureDroppableContainers:X})),[F,Fe,N,te,C,V,B,Me,X]);return r.createElement(Se.Provider,{value:S},r.createElement(Xt.Provider,{value:Ke},r.createElement(Zt.Provider,{value:Ue},r.createElement(Qt.Provider,{value:Ne},y)),r.createElement(Jt,{disabled:!1===(null==c?void 0:c.restoreFocus)})),r.createElement(Re,{...c,hiddenTextDescribedById:V}))})),oo=i(null),no="button",ro="Droppable";function io(e){let{id:t,data:o,disabled:n=!1,attributes:r}=e;const i=he(ro),{activators:l,activatorEvent:c,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=a(Xt),{role:y=no,roleDescription:g="draggable",tabIndex:v=0}=null!=r?r:{},m=(null==s?void 0:s.id)===t,b=a(m?Qt:oo),[w,x]=ue(),[k,E]=ue(),C=function(e,t){return d((()=>e.reduce(((e,o)=>{let{eventName:n,handler:r}=o;return e[n]=e=>{r(e,t)},e}),{})),[e,t])}(l,t),O=se(o);le((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:O}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:c,activeNodeRect:u,attributes:d((()=>({role:y,tabIndex:v,"aria-disabled":n,"aria-pressed":!(!m||y!==no)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[n,y,v,m,g,f.draggable]),isDragging:m,listeners:n?void 0:C,node:w,over:h,setNodeRef:x,setActivatorNodeRef:E,transform:b}}const ao="Droppable",lo={timeout:25};function co(e,t,o){const n=e.slice();return n.splice(o<0?n.length+o:o,0,n.splice(t,1)[0]),n}function so(e,t){return e.reduce(((e,o,n)=>{const r=t.get(o);return r&&(e[n]=r),e}),Array(e.length))}function uo(e){return null!==e&&e>=0}const fo=e=>{let{rects:t,activeIndex:o,overIndex:n,index:r}=e;const i=co(t,n,o),a=t[r],l=i[r];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},po={scaleX:1,scaleY:1},ho=e=>{var t;let{activeIndex:o,activeNodeRect:n,index:r,rects:i,overIndex:a}=e;const l=null!=(t=i[o])?t:n;if(!l)return null;if(r===o){const e=i[a];return e?{x:0,y:o<a?e.top+e.height-(l.top+l.height):e.top-l.top,...po}:null}const c=function(e,t,o){const n=e[t],r=e[t-1],i=e[t+1];if(!n)return 0;if(o<t)return r?n.top-(r.top+r.height):i?i.top-(n.top+n.height):0;return i?i.top-(n.top+n.height):r?n.top-(r.top+r.height):0}(i,r,o);return r>o&&r<=a?{x:0,y:-l.height-c,...po}:r<o&&r>=a?{x:0,y:l.height+c,...po}:{x:0,y:0,...po}};const yo="Sortable",go=r.createContext({activeIndex:-1,containerId:yo,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:fo,disabled:{draggable:!1,droppable:!1}});function vo(e){let{children:t,id:o,items:n,strategy:i=fo,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:y}=a(Zt),g=he(yo,o),v=Boolean(null!==f.rect),m=d((()=>n.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[n]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=l(m),E=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}(m,k.current),C=-1!==x&&-1===w||E,O=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);le((()=>{E&&b&&y(m)}),[E,m,b,y]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:g,disabled:O,disableTransforms:C,items:m,overIndex:x,useDragOverlay:v,sortedRects:so(m,p),strategy:i})),[w,g,O.draggable,O.droppable,C,m,x,p,v,i]);return r.createElement(go.Provider,{value:S},t)}const mo=e=>{let{id:t,items:o,activeIndex:n,overIndex:r}=e;return co(o,n,r).indexOf(t)},bo=e=>{let{containerId:t,isSorting:o,wasDragging:n,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!n)&&((l===i||r!==a)&&(!!o||a!==r&&t===c))},wo={duration:200,easing:"ease"},xo="transform",ko=we.Transition.toString({property:xo,duration:0,easing:"linear"}),Eo={roleDescription:"sortable"};function Co(e){let{animateLayoutChanges:t=bo,attributes:o,disabled:n,data:r,getNewIndex:i=mo,id:c,strategy:p,resizeObserverConfig:h,transition:y=wo}=e;const{items:g,containerId:v,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:E,strategy:C}=a(go),O=function(e,t){var o,n;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(o=null==e?void 0:e.draggable)?o:t.draggable,droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(n,b),S=g.indexOf(c),D=d((()=>({sortable:{containerId:v,index:S,items:g},...r})),[v,r,S,g]),_=d((()=>g.slice(g.indexOf(c))),[g,c]),{rect:R,node:j,isOver:B,setNodeRef:A}=function(e){let{data:t,disabled:o=!1,id:n,resizeObserverConfig:r}=e;const i=he(ao),{active:c,dispatch:d,over:f,measureDroppableContainers:p}=a(Xt),h=l({disabled:o}),y=l(!1),g=l(null),v=l(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...lo,...r},x=se(null!=b?b:n),k=Lt({callback:u((()=>{y.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),w)):y.current=!0}),[w]),disabled:m||!c}),E=u(((e,t)=>{k&&(t&&(k.unobserve(t),y.current=!1),e&&k.observe(e))}),[k]),[C,O]=ue(E),S=se(t);return s((()=>{k&&C.current&&(k.disconnect(),y.current=!1,k.observe(C.current))}),[C,k]),le((()=>(d({type:je.RegisterDroppable,element:{id:n,key:i,disabled:o,node:C,rect:g,data:S}}),()=>d({type:je.UnregisterDroppable,key:i,id:n}))),[n]),s((()=>{o!==h.current.disabled&&(d({type:je.SetDroppableDisabled,id:n,key:i,disabled:o}),h.current.disabled=o)}),[n,i,o,d]),{active:c,rect:g,isOver:(null==f?void 0:f.id)===n,node:C,over:f,setNodeRef:O}}({id:c,data:D,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...h}}),{active:T,activatorEvent:M,activeNodeRect:L,attributes:N,setNodeRef:I,listeners:P,isDragging:z,over:F,setActivatorNodeRef:U,transform:H}=io({id:c,data:D,attributes:{...Eo,...o},disabled:O.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,I),K=Boolean(T),W=K&&!w&&uo(m)&&uo(k),Y=!E&&z,$=Y&&W?H:null,X=W?null!=$?$:(null!=p?p:C)({rects:x,activeNodeRect:L,activeIndex:m,overIndex:k,index:S}):null,Z=uo(m)&&uo(k)?i({id:c,items:g,activeIndex:m,overIndex:k}):S,q=null==T?void 0:T.id,G=l({activeId:q,items:g,newIndex:Z,containerId:v}),J=g!==G.current.items,Q=t({active:T,containerId:v,isDragging:z,isSorting:K,id:c,index:S,items:g,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:y,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:o,node:n,rect:r}=e;const[i,a]=f(null),c=l(o);return le((()=>{if(!t&&o!==c.current&&n.current){const e=r.current;if(e){const t=$e(n.current,{ignoreTransform:!0}),o={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(o.x||o.y)&&a(o)}}o!==c.current&&(c.current=o)}),[t,o,n,r]),s((()=>{i&&a(null)}),[i]),i}({disabled:!Q,index:S,node:j,rect:R});return s((()=>{K&&G.current.newIndex!==Z&&(G.current.newIndex=Z),v!==G.current.containerId&&(G.current.containerId=v),g!==G.current.items&&(G.current.items=g)}),[K,Z,v,g]),s((()=>{if(q===G.current.activeId)return;if(q&&!G.current.activeId)return void(G.current.activeId=q);const e=setTimeout((()=>{G.current.activeId=q}),50);return()=>clearTimeout(e)}),[q]),{active:T,activeIndex:m,attributes:N,data:D,rect:R,index:S,newIndex:Z,items:g,isOver:B,isSorting:K,isDragging:z,listeners:P,node:j,overIndex:k,over:F,setNodeRef:V,setActivatorNodeRef:U,setDroppableNodeRef:A,setDraggableNodeRef:I,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return ko;if(Y&&!me(M)||!y)return;if(K||Q)return we.Transition.toString({...y,property:xo});return}()}}function Oo(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const So=[pt.Down,pt.Right,pt.Up,pt.Left],Do=(e,t)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(So.includes(e.code)){if(e.preventDefault(),!o||!n)return;const t=[];i.getEnabled().forEach((o=>{if(!o||null!=o&&o.disabled)return;const i=r.get(o.id);if(i)switch(e.code){case pt.Down:n.top<i.top&&t.push(o);break;case pt.Up:n.top>i.top&&t.push(o);break;case pt.Left:n.left>i.left&&t.push(o);break;case pt.Right:n.left<i.left&&t.push(o)}}));const c=(e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=Ie(t),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Ie(n),a=r.reduce(((e,t,n)=>e+Me(o[n],t)),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(Le)})({active:o,collisionRect:n,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let s=Pe(c,"id");if(s===(null==a?void 0:a.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(o.id),t=i.get(s),a=t?r.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){const o=Ze(c).some(((e,t)=>l[t]!==e)),r=_o(e,t),i=function(e,t){if(!Oo(e)||!Oo(t))return!1;if(!_o(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=o||!r?{x:0,y:0}:{x:i?n.width-a.width:0,y:i?n.height-a.height:0},d={x:a.left,y:a.top};return s.x&&s.y?d:ve(d,s)}}}};function _o(e,t){return!(!Oo(e)||!Oo(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var Ro;function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},jo.apply(this,arguments)}var Bo,Ao=function(e){return n.createElement("svg",jo({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Ro||(Ro=n.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},To.apply(this,arguments)}var Mo=function(e){return n.createElement("svg",To({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Bo||(Bo=n.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function Lo(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));if(r)return e.blockEditorsMap[r]}function No(e){return zo(e)?(e.nodeName||"").toLowerCase():"#document"}function Io(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Po(e){var t;return null==(t=(zo(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function zo(e){return e instanceof Node||e instanceof Io(e).Node}function Fo(e){return e instanceof Element||e instanceof Io(e).Element}function Uo(e){return e instanceof HTMLElement||e instanceof Io(e).HTMLElement}function Ho(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Io(e).ShadowRoot)}function Vo(e){const{overflow:t,overflowX:o,overflowY:n,display:r}=Xo(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(r)}function Ko(e){return["table","td","th"].includes(No(e))}function Wo(e){const t=Yo(),o=Xo(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function Yo(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function $o(e){return["html","body","#document"].includes(No(e))}function Xo(e){return Io(e).getComputedStyle(e)}function Zo(e){return Fo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function qo(e){if("html"===No(e))return e;const t=e.assignedSlot||e.parentNode||Ho(e)&&e.host||Po(e);return Ho(t)?t.host:t}function Go(e){const t=qo(e);return $o(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&Vo(t)?t:Go(t)}function Jo(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const r=Go(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=Io(r);return i?t.concat(a,a.visualViewport||[],Vo(r)?r:[],a.frameElement&&o?Jo(a.frameElement):[]):t.concat(r,Jo(r,[],o))}const Qo=Math.min,en=Math.max,tn=Math.round,on=Math.floor,nn=e=>({x:e,y:e}),rn={left:"right",right:"left",bottom:"top",top:"bottom"},an={start:"end",end:"start"};function ln(e,t,o){return en(e,Qo(t,o))}function cn(e,t){return"function"==typeof e?e(t):e}function sn(e){return e.split("-")[0]}function dn(e){return e.split("-")[1]}function un(e){return"x"===e?"y":"x"}function fn(e){return"y"===e?"height":"width"}function pn(e){return["top","bottom"].includes(sn(e))?"y":"x"}function hn(e){return un(pn(e))}function yn(e){return e.replace(/start|end/g,(e=>an[e]))}function gn(e){return e.replace(/left|right|bottom|top/g,(e=>rn[e]))}function vn(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function mn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function bn(e,t,o){let{reference:n,floating:r}=e;const i=pn(t),a=hn(t),l=fn(a),c=sn(t),s="y"===i,d=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2,f=n[l]/2-r[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-r.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-r.width,y:u};break;default:p={x:n.x,y:n.y}}switch(dn(t)){case"start":p[a]-=f*(o&&s?-1:1);break;case"end":p[a]+=f*(o&&s?-1:1)}return p}async function wn(e,t){var o;void 0===t&&(t={});const{x:n,y:r,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=cn(t,e),h=vn(p),y=l[f?"floating"===u?"reference":"floating":u],g=mn(await i.getClippingRect({element:null==(o=await(null==i.isElement?void 0:i.isElement(y)))||o?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:d,strategy:c})),v="floating"===u?{...a.floating,x:n,y:r}:a.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(m))&&await(null==i.getScale?void 0:i.getScale(m))||{x:1,y:1},w=mn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:m,strategy:c}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function xn(e){const t=Qo(...e.map((e=>e.left))),o=Qo(...e.map((e=>e.top)));return{x:t,y:o,width:en(...e.map((e=>e.right)))-t,height:en(...e.map((e=>e.bottom)))-o}}const kn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:r,y:i,placement:a,middlewareData:l}=t,c=await async function(e,t){const{placement:o,platform:n,elements:r}=e,i=await(null==n.isRTL?void 0:n.isRTL(r.floating)),a=sn(o),l=dn(o),c="y"===pn(o),s=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,u=cn(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),c?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return a===(null==(o=l.offset)?void 0:o.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}};function En(e){const t=Xo(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=Uo(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n,l=tn(o)!==i||tn(n)!==a;return l&&(o=i,n=a),{width:o,height:n,$:l}}function Cn(e){return Fo(e)?e:e.contextElement}function On(e){const t=Cn(e);if(!Uo(t))return nn(1);const o=t.getBoundingClientRect(),{width:n,height:r,$:i}=En(t);let a=(i?tn(o.width):o.width)/n,l=(i?tn(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const Sn=nn(0);function Dn(e){const t=Io(e);return Yo()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Sn}function _n(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),i=Cn(e);let a=nn(1);t&&(n?Fo(n)&&(a=On(n)):a=On(e));const l=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==Io(e))&&t}(i,o,n)?Dn(i):nn(0);let c=(r.left+l.x)/a.x,s=(r.top+l.y)/a.y,d=r.width/a.x,u=r.height/a.y;if(i){const e=Io(i),t=n&&Fo(n)?Io(n):n;let o=e,r=o.frameElement;for(;r&&n&&t!==o;){const e=On(r),t=r.getBoundingClientRect(),n=Xo(r),i=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,s*=e.y,d*=e.x,u*=e.y,c+=i,s+=a,o=Io(r),r=o.frameElement}}return mn({width:d,height:u,x:c,y:s})}const Rn=[":popover-open",":modal"];function jn(e){return Rn.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Bn(e){return _n(Po(e)).left+Zo(e).scrollLeft}function An(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=Io(e),n=Po(e),r=o.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(r){i=r.width,a=r.height;const e=Yo();(!e||e&&"fixed"===t)&&(l=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:l,y:c}}(e,o);else if("document"===t)n=function(e){const t=Po(e),o=Zo(e),n=e.ownerDocument.body,r=en(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=en(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-o.scrollLeft+Bn(e);const l=-o.scrollTop;return"rtl"===Xo(n).direction&&(a+=en(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:l}}(Po(e));else if(Fo(t))n=function(e,t){const o=_n(e,!0,"fixed"===t),n=o.top+e.clientTop,r=o.left+e.clientLeft,i=Uo(e)?On(e):nn(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:n*i.y}}(t,o);else{const o=Dn(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return mn(n)}function Tn(e,t){const o=qo(e);return!(o===t||!Fo(o)||$o(o))&&("fixed"===Xo(o).position||Tn(o,t))}function Mn(e,t,o){const n=Uo(t),r=Po(t),i="fixed"===o,a=_n(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=nn(0);if(n||!n&&!i)if(("body"!==No(t)||Vo(r))&&(l=Zo(t)),n){const e=_n(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&(c.x=Bn(r));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Ln(e,t){return Uo(e)&&"fixed"!==Xo(e).position?t?t(e):e.offsetParent:null}function Nn(e,t){const o=Io(e);if(!Uo(e)||jn(e))return o;let n=Ln(e,t);for(;n&&Ko(n)&&"static"===Xo(n).position;)n=Ln(n,t);return n&&("html"===No(n)||"body"===No(n)&&"static"===Xo(n).position&&!Wo(n))?o:n||function(e){let t=qo(e);for(;Uo(t)&&!$o(t);){if(Wo(t))return t;t=qo(t)}return null}(e)||o}const In={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e;const i="fixed"===r,a=Po(n),l=!!t&&jn(t.floating);if(n===a||l&&i)return o;let c={scrollLeft:0,scrollTop:0},s=nn(1);const d=nn(0),u=Uo(n);if((u||!u&&!i)&&(("body"!==No(n)||Vo(a))&&(c=Zo(n)),Uo(n))){const e=_n(n);s=On(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-c.scrollLeft*s.x+d.x,y:o.y*s.y-c.scrollTop*s.y+d.y}},getDocumentElement:Po,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e;const i=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let n=Jo(e,[],!1).filter((e=>Fo(e)&&"body"!==No(e))),r=null;const i="fixed"===Xo(e).position;let a=i?qo(e):e;for(;Fo(a)&&!$o(a);){const t=Xo(a),o=Wo(a);o||"fixed"!==t.position||(r=null),(i?!o&&!r:!o&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||Vo(a)&&!o&&Tn(e,a))?n=n.filter((e=>e!==a)):r=t,a=qo(a)}return t.set(e,n),n}(t,this._c):[].concat(o),n],a=i[0],l=i.reduce(((e,o)=>{const n=An(t,o,r);return e.top=en(n.top,e.top),e.right=Qo(n.right,e.right),e.bottom=Qo(n.bottom,e.bottom),e.left=en(n.left,e.left),e}),An(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Nn,getElementRects:async function(e){const t=this.getOffsetParent||Nn,o=this.getDimensions;return{reference:Mn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=En(e);return{width:t,height:o}},getScale:On,isElement:Fo,isRTL:function(e){return"rtl"===Xo(e).direction}};function Pn(e,t,o,n){void 0===n&&(n={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,s=Cn(e),d=r||i?[...s?Jo(s):[],...Jo(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",o,{passive:!0}),i&&e.addEventListener("resize",o)}));const u=s&&l?function(e,t){let o,n=null;const r=Po(e);function i(){var e;clearTimeout(o),null==(e=n)||e.disconnect(),n=null}return function a(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(l||t(),!u||!f)return;const p={rootMargin:-on(d)+"px "+-on(r.clientWidth-(s+u))+"px "+-on(r.clientHeight-(d+f))+"px "+-on(s)+"px",threshold:en(0,Qo(1,c))||1};let h=!0;function y(e){const t=e[0].intersectionRatio;if(t!==c){if(!h)return a();t?a(!1,t):o=setTimeout((()=>{a(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(y,{...p,root:r.ownerDocument})}catch(e){n=new IntersectionObserver(y,p)}n.observe(e)}(!0),i}(s,o):null;let f,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),o()})),s&&!c&&h.observe(s),h.observe(t));let y=c?_n(e):null;return c&&function t(){const n=_n(e);!y||n.x===y.x&&n.y===y.y&&n.width===y.width&&n.height===y.height||o();y=n,f=requestAnimationFrame(t)}(),o(),()=>{var e;d.forEach((e=>{r&&e.removeEventListener("scroll",o),i&&e.removeEventListener("resize",o)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(f)}}const zn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...c}=cn(e,t),s={x:o,y:n},d=await wn(t,c),u=pn(sn(r)),f=un(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=ln(p+d["y"===f?"top":"left"],p,p-d[e])}if(a){const e="y"===u?"bottom":"right";h=ln(h+d["y"===u?"top":"left"],h,h-d[e])}const y=l.fn({...t,[f]:p,[u]:h});return{...y,data:{x:y.x-o,y:y.y-n}}}}},Fn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...g}=cn(e,t);if(null!=(o=i.arrow)&&o.alignmentOffset)return{};const v=sn(r),m=sn(l)===l,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),w=f||(m||!y?[gn(l)]:function(e){const t=gn(e);return[yn(e),t,yn(t)]}(l));f||"none"===h||w.push(...function(e,t,o,n){const r=dn(e);let i=function(e,t,o){const n=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?r:n:t?n:r;case"left":case"right":return t?i:a;default:return[]}}(sn(e),"start"===o,n);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(yn)))),i}(l,y,h,b));const x=[l,...w],k=await wn(t,g),E=[];let C=(null==(n=i.flip)?void 0:n.overflows)||[];if(d&&E.push(k[v]),u){const e=function(e,t,o){void 0===o&&(o=!1);const n=dn(e),r=hn(e),i=fn(r);let a="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=gn(a)),[a,gn(a)]}(r,a,b);E.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:r,overflows:E}],!E.every((e=>e<=0))){var O,S;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let o=null==(S=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!o)switch(p){case"bestFit":{var D;const e=null==(D=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:D[0];e&&(o=e);break}case"initialPlacement":o=l}if(r!==o)return{reset:{placement:o}}}return{}}}},Un=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:n,rects:r,platform:i,strategy:a}=t,{padding:l=2,x:c,y:s}=cn(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(n.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let n=null;for(let e=0;e<t.length;e++){const r=t[e];!n||r.y-n.y>n.height/2?o.push([r]):o[o.length-1].push(r),n=r}return o.map((e=>mn(xn(e))))}(d),f=mn(xn(d)),p=vn(l);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=s)return u.find((e=>c>e.left-p.left&&c<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===pn(o)){const e=u[0],t=u[u.length-1],n="top"===sn(o),r=e.top,i=t.bottom,a=n?e.left:t.left,l=n?e.right:t.right;return{top:r,bottom:i,left:a,right:l,width:l-a,height:i-r,x:a,y:r}}const e="left"===sn(o),t=en(...u.map((e=>e.right))),n=Qo(...u.map((e=>e.left))),r=u.filter((o=>e?o.left===n:o.right===t)),i=r[0].top,a=r[r.length-1].bottom;return{top:i,bottom:a,left:n,right:t,width:t-n,height:a-i,x:n,y:i}}return f}},floating:n.floating,strategy:a});return r.reference.x!==h.reference.x||r.reference.y!==h.reference.y||r.reference.width!==h.reference.width||r.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Hn=(e,t,o)=>{const n=new Map,r={platform:In,...o},i={...r.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a}=o,l=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let s=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=bn(s,n,c),f=n,p={},h=0;for(let o=0;o<l.length;o++){const{name:i,fn:y}=l[o],{x:g,y:v,data:m,reset:b}=await y({x:d,y:u,initialPlacement:n,placement:f,strategy:r,middlewareData:p,rects:s,platform:a,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=bn(s,f,c))),o=-1)}return{x:d,y:u,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var Vn="undefined"!=typeof document?c:s;function Kn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let o,n,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(n=o;0!=n--;)if(!Kn(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),o=r.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=o;0!=n--;){const o=r[n];if(("_owner"!==o||!e.$$typeof)&&!Kn(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function Wn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yn(e,t){const o=Wn(e);return Math.round(t*o)/o}function $n(e){const t=n.useRef(e);return Vn((()=>{t.current=e})),t}
8
2
  /*!
9
3
  * tabbable 6.2.0
10
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
11
5
  */
12
- var od=["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(","),id="undefined"==typeof Element,ad=id?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ud=!id&&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},sd=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)},ld=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!sd(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{ad.call(a,od)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),c=!sd(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},cd=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},dd=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))&&!cd(e)?0:e.tabIndex},fd=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},pd=function(e){return"INPUT"===e.tagName},hd=function(e){return function(e){return pd(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ud(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)},vd=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},gd=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ad.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ad.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return vd(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,u=ud(e);if(a&&!a.shadowRoot&&!0===r(a))return vd(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&&ud(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=ud(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},md=function(e,t){return!(t.disabled||sd(t)||function(e){return pd(e)&&"hidden"===e.type}(t)||gd(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!!ad.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Dd=function(e,t){return!(hd(t)||dd(t)<0||!md(e,t))},bd=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Cd=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=dd(e);return n<0&&t&&!cd(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(fd).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},yd=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ld([e],t.includeContainer,{filter:Dd.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:bd}):function(e,t,n){if(sd(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(od));return t&&ad.call(e,od)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Dd.bind(null,t)),Cd(n)};const wd=r["useInsertionEffect".toString()]||(e=>e());var Bd="undefined"!=typeof document?s:l;function Ed(){return Ed=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},Ed.apply(this,arguments)}let xd=!1,Ad=0;const Fd=()=>"floating-ui-"+Ad++;const Od=r["useId".toString()]||function(){const[e,t]=r.useState((()=>xd?Fd():void 0));return Bd((()=>{null==e&&t(Fd())}),[]),r.useEffect((()=>{xd||(xd=!0)}),[]),e};const kd=r.createContext(null),Sd=r.createContext(null);function jd(e){return"data-floating-ui-"+e}const Pd=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Rd(e,t){const n=yd(e,Pd());"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 Td(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&&Ql(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Nd(e){yd(e,Pd()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function _d(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 Md={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 Ld(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Id=r.forwardRef((function(e,t){const[n,o]=r.useState();Bd((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Ld),()=>{document.removeEventListener("keydown",Ld)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[jd("focus-guard")]:"",style:Md};return r.createElement("span",Ed({},e,i))})),zd=r.createContext(null),Wd=jd("portal");function Vd(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=Od(),u=qd(),s=r.useRef(null);return Bd((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{s.current=null}))}),[o]),Bd((()=>{if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=a,n.setAttribute(Wd,""),e.appendChild(n),s.current=n,i(n)}),[t,a]),Bd((()=>{if(s.current)return;let e=n||(null==u?void 0:u.portalNode);e&&!Gl(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(Wd,""),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&&Td(e)){("focusin"===e.type?_d:Nd)(a)}}}),[a,i,null==u?void 0:u.modal]),r.createElement(zd.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:a,setFocusManagerState:s})),[i,a])},p&&a&&r.createElement(Id,{"data-type":"outside",ref:l,onFocus:e=>{if(Td(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=Rd(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:Md}),a&&A(t,a),p&&a&&r.createElement(Id,{"data-type":"outside",ref:c,onFocus:e=>{if(Td(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Rd(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 qd=()=>r.useContext(zd),Hd=new Set,Ud=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=Od();return Bd((()=>{if(!n)return;Hd.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()=>{Hd.delete(i),0===Hd.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,u)))}}),[i,n]),r.createElement("div",Ed({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Kd(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);ed(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))}),[]),C=r.useCallback((e=>{e!==x.current&&(x.current=e,D(e))}),[]),y=a||v,w=u||m,E=r.useRef(null),x=r.useRef(null),A=r.useRef(d),F=null!=l,O=rd(l),k=rd(i),S=r.useCallback((()=>{if(!E.current||!x.current)return;const e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),Jc(E.current,x.current,e).then((e=>{const t={...e,isPositioned:!0};j.current&&!ed(A.current,t)&&(A.current=t,B.flushSync((()=>{f(t)})))}))}),[p,t,n,k]);Qc((()=>{!1===c&&A.current.isPositioned&&(A.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[c]);const j=r.useRef(!1);Qc((()=>(j.current=!0,()=>{j.current=!1})),[]),Qc((()=>{if(y&&(E.current=y),w&&(x.current=w),y&&w){if(O.current)return O.current(y,w,S);S()}}),[y,w,S,O,F]);const P=r.useMemo((()=>({reference:E,floating:x,setReference:b,setFloating:C})),[b,C]),R=r.useMemo((()=>({reference:y,floating:w})),[y,w]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=nd(R.floating,d.x),r=nd(R.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...td(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(Sd),d=null!=((null==(f=r.useContext(kd))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return wd((()=>{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=Od(),D=r.useCallback((e=>{const t=Gl(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),b=r.useCallback((e=>{(Gl(e)||null===e)&&(h.current=e,u(e)),(Gl(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!Gl(e))&&l.refs.setReference(e)}),[l.refs]),C=r.useMemo((()=>({...l.refs,setReference:b,setPositionReference:D,domReference:h})),[l.refs,b,D]),y=r.useMemo((()=>({...l.elements,domReference:s})),[l.elements,s]),w=r.useMemo((()=>({...l,refs:C,elements:y,dataRef:v,nodeId:i,floatingId:m,events:g,open:n,onOpenChange:p})),[l,i,m,g,n,p,C,y]);return Bd((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===i));e&&(e.context=w)})),r.useMemo((()=>({...l,context:w,refs:C,elements:y})),[l,C,y,w])}var $d;function Yd(){return Yd=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},Yd.apply(this,arguments)}var Xd=function(e){return r.createElement("svg",Yd({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),$d||($d=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 Zd(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 Gd=["color"],Jd=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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.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"}))})),Qd=["color"],ef=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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 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"}))})),tf=["color"],nf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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:"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"}))})),rf=["color"],of=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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:"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"}))})),af=["color"],uf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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:"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"}))})),sf=["color"],lf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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:"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}))})),cf=["color"],df=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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.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"}))})),ff=["color"],pf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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:"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"}))})),hf=["color"],vf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(e,hf);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"}))})),gf=["color"],mf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(e,gf);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"}))})),Df=["color"],bf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(e,Df);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"}))})),Cf=["color"],yf=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Zd(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.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"}))})),wf=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()}},Bf={"text/plain":"Text","text/html":"Url",default:"Text"};var Ef=function(e,t){var n,r,o,i,a,u,s=!1;t||(t={}),n=t.debug||!1;try{if(o=wf(),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=Bf[t.format]||Bf.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 xf(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function Af(e){if(!e)return;const t=xf(e);return t?e[t]:void 0}const Ff=({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=Af(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(mf,{})})),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}))]}))}))}))},Of=({children:t})=>e("div",Object.assign({className:"flex flex-col"},{children:t})),kf=({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})),Sf=({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})),jf=({isOpen:n,onClose:r,refs:o,floatingStyles:i,children:a})=>{var u;const s=P(),[l,c]=f(!1),{refs:d,floatingStyles:p}=Kd({placement:"right",open:l,onOpenChange:c,middleware:[Gc(),Zc(),Xc(),Pc(10)],whileElementsMounted:Yc});if(!n)return null;const h=O(s,{at:s.selection}),v=Af(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(Vd,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Ud,Object.assign({lockScroll:!0,className:"z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(kf,{children:[t(Of,{children:[e(Sf,{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(bf,{className:"w-4 h-4 mr-2"}),"Delete"]}))}),e(Sf,{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(of,{className:"w-4 h-4 mr-2"}),"Duplicate"]}))}),!g&&t(Sf,{children:[l&&e(Vd,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Ud,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>c(!1)},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(Ff,{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(Xd,{className:"w-4 h-4 mr-2"}),"Turn into"]}))]}),e(Sf,{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=O(s);e&&Ef(`${window.location.origin}${window.location.pathname}#${e.id}`),r()}},{children:[e(pf,{className:"w-4 h-4 mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var Pf=Object.freeze({__proto__:null,BlockOptions:jf,BlockOptionsMenuContent:kf,BlockOptionsMenuGroup:Of,BlockOptionsMenuItem:Sf,BlockOptionsSeparator:({className:t})=>e("div",{className:`h-[1px] bg-[#37352f14] my-[4px] w-full ${t}`})});function Rf(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 Tf={actions:"vuZgncnq",hovered:"_8Eqjiv7m",actionButton:"WabGEp54",plusButton:"_0C8RpLmz"};function Nf(...e){return e.filter(Boolean).join(" ")}Rf(".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 _f=({block:n,editor:r,dragHandleProps:o,showActions:i,onChangeActiveBlock:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c}=Kd({placement:"right-start",open:u,onOpenChange:s,middleware:[Gc(),Zc(),Xc(),Pc()]}),{setActivatorNodeRef:d,attributes:p,listeners:h}=o;return t("div",Object.assign({contentEditable:!1,className:Nf(Tf.actions,i&&Tf.hovered,"yoopta-element-actions")},{children:[e("button",Object.assign({type:"button",onClick:()=>{const e=K({id:H()}),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0})},className:Nf(Tf.actionButton,Tf.plusButton,"yoopta-element-actions-plus")},{children:e(On,{})})),e("button",Object.assign({type:"button",className:Nf(Tf.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=kn(r,{at:[n.meta.order]});console.log("block",n),console.log("slate",t),r.focusBlock(n.id),t&&setTimeout((()=>{As.blur(t),As.deselect(t),Ki.deselect(t),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),s(!0)}),10)}},{children:e(An,{})})),e(jf,{isOpen:u,refs:l,floatingStyles:c,onClose:()=>s(!1)})]}))},Mf=({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}),C={transform:he.Translate.toString(h),transition:v,opacity:b?.7:1,marginLeft:20*r.meta.depth+"px"},y=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:C,"data-yoopta-block":!0,ref:d},{children:[e(_f,{block:r,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:l,listeners:c},showActions:w,onChangeActiveBlock:B}),e("div",Object.assign({className:Tf.content,style:{borderBottom:D&&!b?"2px solid #007aff":"none"}},{children:n})),y&&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 Lf(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;const If={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"},zf={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"},Wf={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Vf=e=>{const t=If[e],n=zf[e],r=Wf[e],o=t&&wu(t),i=n&&wu(n),a=r&&wu(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!a||!a(e)))},qf={isBold:Vf("bold"),isCompose:Vf("compose"),isArrowLeft:Vf("arrowLeft"),isArrowRight:Vf("arrowRight"),isArrowUp:Vf("arrowUp"),isArrowDown:Vf("arrowDown"),isDeleteBackward:Vf("deleteBackward"),isDeleteForward:Vf("deleteForward"),isDeleteLineBackward:Vf("deleteLineBackward"),isDeleteLineForward:Vf("deleteLineForward"),isDeleteWordBackward:Vf("deleteWordBackward"),isDeleteWordForward:Vf("deleteWordForward"),isExtendBackward:Vf("extendBackward"),isExtendForward:Vf("extendForward"),isExtendLineBackward:Vf("extendLineBackward"),isExtendLineForward:Vf("extendLineForward"),isItalic:Vf("italic"),isMoveLineBackward:Vf("moveLineBackward"),isMoveLineForward:Vf("moveLineForward"),isCtrlLeft:Vf("ctrlLeft"),isCtrlRight:Vf("ctrlRight"),isRedo:Vf("redo"),isShiftEnter:Vf("shiftEnter"),isEnter:Vf("enter"),isTransposeCharacter:Vf("transposeCharacter"),isUndo:Vf("undo"),isSpace:Vf("space"),isSelect:Vf("select"),isTab:Vf("tab"),isShiftTab:Vf("shiftTab"),isBackspace:Vf("backspace"),isCmdEnter:Vf("cmdEnter"),isCmd:Vf("cmd"),isEscape:Vf("escape"),isSlashCommand:Vf("slashCommand"),isShiftArrowUp:Vf("shiftArrowUp"),isShiftArrowDown:Vf("shiftArrowDown"),isKekceburek:Vf("kekCeburek")};const Hf={onKeyDown:function(e){return t=>{const n=kn(e,{at:e.selection});if(!n||!n.selection)return;const r=Po.parent(n.selection.anchor.path);if(qf.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(qf.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const o=ni.isStart(n,n.selection.anchor,r),i=ni.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const a=K({id:H()}),u=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:u,slate:n,focus:!0})}else if(qf.isBackspace(t)){if(t.isDefaultPrevented())return;const r=Po.parent(n.selection.anchor.path);if(ni.isStart(n,n.selection.anchor,r)){t.preventDefault();const o=ni.string(n,r),i=e.selection?e.selection[0]-1:0,a=kn(e,{at:[i]});let u;if(a&&(u=function(e,t){const[,n]=ni.last(e,t);return{path:n,offset:ni.string(e,n).length}}(a,r)),0===o.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:u});{if(Uo.isExpanded(n.selection))return Ki.delete(n,{at:n.selection});if(!a)return;if(0===ni.string(a,[0,0]).length)return e.deleteBlock({at:[i],focus:!0,focusAt:u});const t=Array.from(ni.nodes(n,{at:[0],match:e=>!ni.isEditor(e)&&(hi.isText(e)||ni.isInline(n,e)),mode:"highest"})),r=t.map((([e])=>e));return Ki.insertNodes(a,r,{at:ni.end(a,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:u})}}}else{if(qf.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=ni.first(n,[0]),[,o]=ni.last(n,[n.children.length-1]),i=ni.range(n,r,o),a=Uo.equals(n.selection,i);if(Uo.isExpanded(n.selection)&&a)return t.preventDefault(),As.blur(n),As.deselect(n),Ki.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(qf.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(qf.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(qf.isArrowUp(t)){if(t.isDefaultPrevented())return;const r=Po.parent(n.selection.anchor.path);if(ni.isStart(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]-1]:null,r=kn(e,{at:n}),o=O(e,{at:n});if(r&&o){const[,n]=ni.last(r,[0]),i={path:n,offset:ni.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(qf.isArrowDown(t)){const r=Po.parent(n.selection.anchor.path);if(ni.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=kn(e,{at:n}),i=O(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=ni.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(Uo.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&wu(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}};function Uf(e){try{return new URL(e),!0}catch(e){return!1}}const Kf=(e,t)=>{(e=>{const[t]=ni.nodes(e,{match:e=>!ni.isEditor(e)&&$o.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{Ki.unwrapNodes(e,{match:e=>!ni.isEditor(e)&&$o.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&Uo.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};r?Ki.insertNodes(e,o):(Ki.wrapNodes(e,o,{split:!0}),Ki.collapse(e,{edge:"end"}))},$f=i(void 0),Yf=({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($f.Provider,Object.assign({value:a},{children:t}))},Xf=({children:t,attributes:n,placeholder:r})=>{const o=a(fl),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))},Zf=({id:t,customEditor:r,elements:o,marks:i,events:s,options:l,placeholder:d="Type '/' for commands"})=>{const f=P(),p=R(t),h=u(p.value).current,v=p.type,{tools:g}=(()=>{const e=a($f);if(void 0===e)throw new Error("useTools must be used within a ToolsProvider");return e})(),m=c((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),D=c((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(i)),[i]),b=c((()=>{let e=f.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&&Uf(t)?Kf(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Uf(r)?Kf(e,r):t(n)},e})(e))})),e}),[]),C=c((()=>{if(!s)return{};const e={hotkeys:qf,currentBlock:p,defaultBlock:K({id:H()})},t={};return Object.keys(s).forEach((n=>{t[n]=function(t){if(s[n]){s[n](f,b,e)(t)}}})),t}),[s,f,p]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":v},{children:e(Gf,{id:t,slate:b,initialValue:h,onChange:e=>f.updateBlock(t,{value:e}),decorate:e=>{var t;const n=[],[r,o]=e,i=(null===(t=f.selection)||void 0===t?void 0:t[0])===p.meta.order;return b.selection&&i&&!ni.isEditor(r)&&""===ni.string(b,[o[0]])&&Uo.includes(b.selection,o)&&Uo.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n},renderLeaf:t=>{var n,r,o,i,a;let{children:u,leaf:s,attributes:l}=t;const c=Lf(s,["text"]),h=(null===(n=f.selection)||void 0===n?void 0:n[0])===p.meta.order;c&&Object.keys(c).forEach((e=>{const t=D[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(Xf,Object.assign({attributes:l,placeholder:v?d:void 0},{children:u}))},renderElement:r=>{const o=m[r.element.type];return o?e(o,Object.assign({},r,{blockId:t,options:l})):e(n,{})},eventHandlers:C,onKeyDown:e=>{var t;if(g.actionMenu){const t=g.actionMenu,{events:n}=t,r=Lf(t,["events"]);null==n||n.onKeyDown(f,b,r)(e)}null===(t=C.onKeyDown)||void 0===t||t.call(C,e),Hf.onKeyDown(f)(e)},onKeyUp:e=>{var t;if(g.actionMenu){const t=g.actionMenu,{events:n}=t,r=Lf(t,["events"]);null==n||n.onKeyUp(f,b,r)(e)}null===(t=null==C?void 0:C.onKeyUp)||void 0===t||t.call(C,e)},onFocus:e=>{var t;null===(t=null==C?void 0:C.onFocus)||void 0===t||t.call(C,e)},onMouseDown:e=>{var t,n;if((null===(t=f.selection)||void 0===t?void 0:t[0])!==p.meta.order&&f.setSelection([p.meta.order]),g.toolbar){const t=g.toolbar,{events:n}=t,r=Lf(t,["events"]);null==n||n.onMouseDown(f,b,r)(e)}null===(n=null==C?void 0:C.onMouseDown)||void 0===n||n.call(C,e)},onBlur:e=>{var t;e.preventDefault(),null===(t=null==C?void 0:C.onBlur)||void 0===t||t.call(C,e)},customEditor:r})}))},Gf=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,children:[]}):e(zl,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(Sl,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}`)));Gf.displayName="SlateEditorInstance";const Jf=({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:yn})),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)}),[])}),Qf=[],ep=({editor:t,marks:n})=>{const{sensors:r,handleDragEnd:o,handleDragStart:i}=Jf({editor:t}),a=Object.keys(t.children),u=c((()=>0===a.length?Qf: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(Mf,Object.assign({block:i,blockId:o},{children:e(Zf,{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(Xt,Object.assign({sensors:r,collisionDetection:Te,onDragStart:i,onDragEnd:o},{children:e(dn,Object.assign({items:u,strategy:sn},{children:s}))}))},tp=({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})},np=({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})},rp={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},op=({marks:n,className:r,autoFocus:o=!0,selectionBoxRoot:i})=>{const a=P(),s=u(null),c=tp({editor:a,yooptaEditorRef:s,root:i});let d=u(rp).current;console.log("editor.children",a.children),l((()=>{if(!o)return;const e=O(a,{at:[0]});e&&a.focusBlock(e.id,{waitExecution:!0})}),[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(qf.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(qf.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(qf.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=O(a),n=kn(a);if(!n||!n.selection||!t)return;const r=Po.parent(n.selection.anchor.path),i=ni.isStart(n,n.selection.focus,r);if(Uo.isExpanded(n.selection)&&i){const r=a.selection?[a.selection[0]-1]:[0],o=O(a,{at:r});t&&o&&(e.preventDefault(),As.blur(n),As.deselect(n),Ki.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(qf.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=O(a),n=kn(a);if(!n||!n.selection||!t)return;const r=Po.parent(n.selection.anchor.path),o=ni.isEnd(n,n.selection.focus,r);if(Uo.isExpanded(n.selection)&&o){const r=a.selection?[a.selection[0]+1]:[0],o=O(a,{at:r});t&&o&&(e.preventDefault(),As.blur(n),As.deselect(n),Ki.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=O(a,{at:[e]}),r=kn(a,{at:[e]});if(n&&r&&r.selection){const e=ni.string(r,r.selection.anchor.path),o=Po.parent(r.selection.anchor.path),[i]=ni.node(r,o);if($o.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({id:H()}),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(ep,{editor:a,marks:n}),e(np,{origin:c.origin,coords:c.coords,isOpen:c.selection})]}))},ip=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return l((()=>r(!0)),[]),n?e:t};var ap={isHistory:e=>kr(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||ei.isOperationList(e.redos[0]))&&(0===e.undos.length||ei.isOperationList(e.undos[0]))},up=new WeakMap,sp=new WeakMap,lp={isHistoryEditor:e=>ap.isHistory(e.history)&&ni.isEditor(e),isMerging:e=>sp.get(e),isSaving:e=>up.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=lp.isMerging(e);sp.set(e,!1),t(),sp.set(e,n)},withoutSaving(e,t){var n=lp.isSaving(e);up.set(e,!1),t(),up.set(e,n)}},cp=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];lp.withoutSaving(t,(()=>{ni.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];lp.withoutSaving(t,(()=>{ni.withoutNormalizing(t,(()=>{var e=r.map(ei.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=pp(e,u),l=lp.isSaving(t),c=lp.isMerging(t);if(null==l&&(l=fp(e)),l){if(null==c&&(c=null!=a&&(0!==r.length||(dp(e,u)||s))),a&&c)s&&a.pop(),a.push(e);else{var d=[e];i.push(d)}for(;i.length>100;)i.shift();hp(e)&&(o.redos=[])}n(e)},t},dp=(e,t)=>"set_selection"===e.type||(!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!Po.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!Po.equals(e.path,t.path))),fp=(e,t)=>"set_selection"!==e.type||null!=e.properties&&null!=e.newProperties,pp=(e,t)=>!(!t||"set_selection"!==e.type||"set_selection"!==t.type),hp=e=>"set_selection"!==e.type;function vp(e,t){const n=kn(e);if(!n)return!1;const r=ni.marks(n);return!!(null==r?void 0:r[t])}const gp=(e,t)=>{const{insertText:n}=t;return t.insertText=r=>{var o;const{selection:i}=t;if(" "===r&&i&&Uo.isCollapsed(i)){const{anchor:a}=i,u=ni.above(t,{match:e=>$o.isElement(e)&&ni.isBlock(t,e),mode:"lowest"});if(!u)return;const[,s]=u,l=ni.parent(t,s),[c]=l;if($o.isElement(c)&&!hi.isText(c.children[0]))return n(r);const d=u?s:[],f={anchor:a,focus:ni.start(t,d)},p=ni.string(t,f),h=null===(o=e.shortcuts)||void 0===o?void 0:o[p];if(!!h&&!h.isActive())return Ki.select(t,f),Ki.delete(t),void h.create({deleteText:!1})}n(r)},t};function mp(e,t,n){e.children=Co(e.children);let r=!1;const o=e.children[t];if(!o)throw Error(`Block with id ${t} not found`);n.id&&(o.id=n.id,r=!0),n.type&&(o.type=n.type,r=!0),n.meta&&(o.meta=n.meta,r=!0),n.value&&(o.value=n.value),e.children=yo(e.children),e.emit("block:update",{blockId:t,data:n}),r&&e.applyChanges()}function Dp(e,t,n){e.children=Co(e.children);const r=O(e,{at:e.selection});if(!r)throw new Error("Block from not found at current selection");const o=xf(e.blocks[r.type].elements);if(r.type===t)return void(e.children=yo(e.children));const i=kn(e,{at:[r.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${r.meta.order}`);const a=xf(e.blocks[t].elements);ni.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=>!ni.isEditor(e)&&$o.isElement(e);o&&(a=e=>!ni.isEditor(e)&&$o.isElement(e)&&e.type===o);const u=Po.parent(i),s=ni.nodes(e,{at:u,match:a,mode:"lowest"});if(s){const[e]=s;return e}}(i,{elementType:o});console.log({fromBlockRootElementType:o,node:n}),Ki.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>$o.isElement(e)&&!ni.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=yo(e.children),e.applyChanges()}))}function bp(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){e.children=Co(e.children),o.forEach((t=>{const n=O(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=yo(e.children),void e.applyChanges()}if(r||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=K({id:H()}),n=cp(gp(e,Ul(Ea())));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=Co(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=yo(e.children),e.applyChanges(),i){const n=e.selection?e.selection[0]-1:0,r=O(e,{at:[n]});r&&e.focusBlock(r.id,{focusAt:t.focusAt})}}function Cp(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=kn(e);if(!n)return null;const r=ni.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>vp(e,r),toggle:()=>function(e,t){const n=kn(e),r=vp(e,t);n&&(r?ni.removeMark(n,t):ni.addMark(n,t,!0),e.applyChanges())}(e,r),update:t=>function(e,t,n){const r=kn(e);console.log("update editor.selection",e.selection),console.log("text format slate.selection",r),r&&r.selection&&Uo.isExpanded(r.selection)&&(ni.addMark(r,t,n),e.applyChanges())}(e,r,t)}})),n}function yp(e,t){const n={};return t.forEach(((t,r)=>{var o;const i=Af(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=Lf(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=O(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{Dp(e,t)},create:n=>{!function(e,t,n){var r;e.children=Co(e.children);const o=O(e);if(!o)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==n?void 0:n.slate)||kn(e,{at:[null==o?void 0:o.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],u=xf(a.elements),s=a.elements[u];if(!s)return;const l=Object.assign({nodeType:(null===(r=s.props)||void 0===r?void 0:r.nodeType)||"block"},s.props),c=U({id:H(),type:u,props:l});Ki.setNodes(i,c,{at:[0,0],match:e=>$o.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&Ki.delete(i,{at:[0,0]});const d=K({id:o.id,type:a.type,meta:{order:o.meta.order,depth:o.meta.depth},value:[c]}),f=d.id;e.children[f]=d,e.blockEditorsMap[f]=i,e.children=yo(e.children),e.applyChanges(),(null==n?void 0:n.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{mp(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=kn(e,{at:[o.meta.order]});i?ni.withoutNormalizing(i,(()=>{const[t]=ni.nodes(i,{at:[0],match:e=>$o.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),Ki.setNodes(i,u,{at:[0],match:e=>$o.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges()})):console.warn("No slate found")}(e,t,n,r)},delete:t=>{bp(e,t)}}}})),n}function wp(e){return cp(gp(e,Ul(Ea())))}function Bp(){return Bp=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},Bp.apply(this,arguments)}function Ep(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 xp(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}\``)}]},Ap(r,...t)]}function Ap(...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 Fp(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function Op(...e){return d(Fp(...e),e)}const kp=g(((e,t)=>{const{children:n,...r}=e,o=D.toArray(n),i=o.find(Pp);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(Sp,Bp({},r,{ref:t}),b(e)?C(e,void 0,n):null)}return m(Sp,Bp({},r,{ref:t}),n)}));kp.displayName="Slot";const Sp=g(((e,t)=>{const{children:n,...r}=e;return b(n)?C(n,{...Rp(r,n.props),ref:t?Fp(t,n.ref):n.ref}):D.count(n)>1?D.only(null):null}));Sp.displayName="SlotClone";const jp=({children:e})=>m(y,null,e);function Pp(e){return b(e)&&e.type===jp}function Rp(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 Tp=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?s:()=>{},Np=r["useId".toString()]||(()=>{});let _p=0;const Mp=["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?kp:t;return l((()=>{window[Symbol.for("radix-ui")]=!0}),[]),m(i,Bp({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function Lp(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 Ip({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=f(e),[r]=n,o=u(r),i=Lp(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=Lp(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 zp=i(void 0);function Wp(e){const t=a(zp);return e||t||"ltr"}const Vp="rovingFocusGroup.onEntryFocus",qp={bubbles:!1,cancelable:!0},Hp="RovingFocusGroup",[Up,Kp,$p]=function(e){const t=e+"CollectionProvider",[n,r]=xp(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=Op(t,a(u,n).collectionRef);return o.createElement(kp,{ref:i},r)})),ItemSlot:o.forwardRef(((e,t)=>{const{scope:n,children:r,...i}=e,u=o.useRef(null),c=Op(t,u),d=a(s,n);return o.useEffect((()=>(d.itemMap.set(u,{ref:u,...i}),()=>{d.itemMap.delete(u)}))),o.createElement(kp,{[l]:"",ref:c},r)}))},function(t){const n=a(e+"CollectionConsumer",t);return o.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`));return Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[n.collectionRef,n.itemMap])},r]}(Hp),[Yp,Xp]=xp(Hp,[$p]),[Zp,Gp]=Yp(Hp),Jp=g(((e,t)=>m(Up.Provider,{scope:e.__scopeRovingFocusGroup},m(Up.Slot,{scope:e.__scopeRovingFocusGroup},m(Qp,Bp({},e,{ref:t})))))),Qp=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=Op(t,v),D=Wp(i),[b=null,C]=Ip({prop:a,defaultProp:s,onChange:c}),[y,w]=f(!1),B=Lp(p),E=Kp(n),x=u(!1),[A,F]=f(0);return l((()=>{const e=v.current;if(e)return e.addEventListener(Vp,B),()=>e.removeEventListener(Vp,B)}),[B]),m(Zp,{scope:n,orientation:r,dir:D,loop:o,currentTabStopId:b,onItemFocus:d((e=>C(e)),[C]),onItemShiftTab:d((()=>w(!0)),[]),onFocusableItemAdd:d((()=>F((e=>e+1))),[]),onFocusableItemRemove:d((()=>F((e=>e-1))),[])},m(Mp.div,Bp({tabIndex:y||0===A?-1:0,"data-orientation":r},h,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ep(e.onMouseDown,(()=>{x.current=!0})),onFocus:Ep(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(Vp,qp);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=E().filter((e=>e.focusable));nh([e.find((e=>e.active)),e.find((e=>e.id===b)),...e].filter(Boolean).map((e=>e.ref.current)))}}x.current=!1})),onBlur:Ep(e.onBlur,(()=>w(!1)))})))})),eh=g(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:a,...u}=e,s=function(e){const[t,n]=r.useState(Np());return Tp((()=>{e||n((e=>null!=e?e:String(_p++)))}),[e]),e||(t?`radix-${t}`:"")}(),c=a||s,d=Gp("RovingFocusGroupItem",n),f=d.currentTabStopId===c,p=Kp(n),{onFocusableItemAdd:h,onFocusableItemRemove:v}=d;return l((()=>{if(o)return h(),()=>v()}),[o,h,v]),m(Up.ItemSlot,{scope:n,id:c,focusable:o,active:i},m(Mp.span,Bp({tabIndex:f?0:-1,"data-orientation":d.orientation},u,{ref:t,onMouseDown:Ep(e.onMouseDown,(e=>{o?d.onItemFocus(c):e.preventDefault()})),onFocus:Ep(e.onFocus,(()=>d.onItemFocus(c))),onKeyDown:Ep(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:th[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((()=>nh(o)))}var n,r}))})))})),th={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nh(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const rh=Jp,oh=eh,ih="horizontal",ah=["horizontal","vertical"],uh=g(((e,t)=>{const{decorative:n,orientation:r=ih,...o}=e,i=sh(r)?r:ih,a=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return m(Mp.div,Bp({"data-orientation":i},a,o,{ref:t}))}));function sh(e){return ah.includes(e)}uh.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!sh(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 \`${ih}\`.`}(o,n)):null}};const lh=uh,ch=g(((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,u]=Ip({prop:n,onChange:o,defaultProp:r});return m(Mp.button,Bp({type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Ep(e.onClick,(()=>{e.disabled||u(!a)}))}))})),dh="ToggleGroup",[fh,ph]=xp(dh,[Xp]),hh=Xp(),vh=o.forwardRef(((e,t)=>{const{type:n,...r}=e;if("single"===n){const e=r;return o.createElement(Dh,Bp({},e,{ref:t}))}if("multiple"===n){const e=r;return o.createElement(bh,Bp({},e,{ref:t}))}throw new Error(`Missing prop \`type\` expected on \`${dh}\``)})),[gh,mh]=fh(dh),Dh=o.forwardRef(((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=(()=>{}),...a}=e,[u,s]=Ip({prop:n,defaultProp:r,onChange:i});return o.createElement(gh,{scope:e.__scopeToggleGroup,type:"single",value:u?[u]:[],onItemActivate:s,onItemDeactivate:o.useCallback((()=>s("")),[s])},o.createElement(wh,Bp({},a,{ref:t})))})),bh=o.forwardRef(((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=(()=>{}),...a}=e,[u=[],s]=Ip({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(gh,{scope:e.__scopeToggleGroup,type:"multiple",value:u,onItemActivate:l,onItemDeactivate:c},o.createElement(wh,Bp({},a,{ref:t})))})),[Ch,yh]=fh(dh),wh=o.forwardRef(((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:u,loop:s=!0,...l}=e,c=hh(n),d=Wp(u),f={role:"group",dir:d,...l};return o.createElement(Ch,{scope:n,rovingFocus:i,disabled:r},i?o.createElement(rh,Bp({asChild:!0},c,{orientation:a,dir:d,loop:s}),o.createElement(Mp.div,Bp({},f,{ref:t}))):o.createElement(Mp.div,Bp({},f,{ref:t})))})),Bh="ToggleGroupItem",Eh=o.forwardRef(((e,t)=>{const n=mh(Bh,e.__scopeToggleGroup),r=yh(Bh,e.__scopeToggleGroup),i=hh(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(oh,Bp({asChild:!0},i,{focusable:!u,active:a,ref:l}),o.createElement(xh,Bp({},s,{ref:t}))):o.createElement(xh,Bp({},s,{ref:t}))})),xh=o.forwardRef(((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,a=mh(Bh,n),u={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s="single"===a.type?u:void 0;return o.createElement(ch,Bp({},s,i,{ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}}))})),Ah=vh,Fh=Eh,Oh="Toolbar",[kh,Sh]=xp(Oh,[Xp,ph]),jh=Xp(),Ph=ph(),[Rh,Th]=kh(Oh),Nh=g(((e,t)=>{const{__scopeToolbar:n,orientation:r="horizontal",dir:o,loop:i=!0,...a}=e,u=jh(n),s=Wp(o);return m(Rh,{scope:n,orientation:r,dir:s},m(rh,Bp({asChild:!0},u,{orientation:r,dir:s,loop:i}),m(Mp.div,Bp({role:"toolbar","aria-orientation":r,dir:s},a,{ref:t}))))})),_h=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=Th("ToolbarSeparator",n);return m(lh,Bp({orientation:"horizontal"===o.orientation?"vertical":"horizontal"},r,{ref:t}))})),Mh=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=jh(n);return m(oh,Bp({asChild:!0},o,{focusable:!e.disabled}),m(Mp.button,Bp({type:"button"},r,{ref:t})))})),Lh=Nh,Ih=_h,zh=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=Th("ToolbarToggleGroup",n),i=Ph(n);return m(Ah,Bp({"data-orientation":o.orientation,dir:o.dir},i,r,{ref:t,rovingFocus:!1}))})),Wh=g(((e,t)=>{const{__scopeToolbar:n,...r}=e,o=Ph(n),i={__scopeToolbar:e.__scopeToolbar};return m(Mh,Bp({asChild:!0},i),m(Fh,Bp({},o,r,{ref:t})))})),Vh=[["Default","black"],["Gray","#787774"],["Brown","#976D57"],["Orange","#CC772F"],["Yellow","#C29243"],["Green","#548064"],["Blue","#477DA5"],["Purple","#A48BBE"],["Pink","#B35588"],["Red","#C4554D"]],qh=[["Default","unset"],["Gray","#F1F1EF"],["Brown","#F3EEEE"],["Orange","#F8ECDF"],["Yellow","#FAF3DD"],["Green","#EEF3ED"],["Blue","#E9F3F7"],["Purple","#F6F3F8"],["Pink","#F9F2F5"],["Red","#FAECEC"]],Hh={border:"1px solid #e3e3e3"},Uh=({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},Hh),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(Vd,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Ud,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(ef,{width:14,height:14})]})),e("div",Object.assign({className:"flex items-center"},{children:Vh.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(ef,{width:14,height:14})]})),e("div",Object.assign({className:"flex items-center"},{children:qh.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)))}))]}))}))}))}))},Kh=Ff,$h=({activeBlock:n,editor:r})=>{var o;const[i,a]=f(!1),[u,s]=f(!1),{refs:l,floatingStyles:c}=Kd({placement:"bottom-start",open:i,onOpenChange:a,middleware:[Gc(),Zc(),Xc(),Pc(10)],whileElementsMounted:Yc}),{refs:d,floatingStyles:p}=Kd({placement:"top-end",open:u,onOpenChange:s,middleware:[Gc(),Zc(),Xc(),Pc(10)],whileElementsMounted:Yc}),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(Lh,Object.assign({className:"bg-white flex z-50 p-[5px] rounded-md shadow-md border shadow-y-[4px]"},{children:[t(zh,Object.assign({className:"flex items-center",type:"single","aria-label":"Block formatting"},{children:[i&&e(Vd,Object.assign({root:document.getElementById("yoopta-editor")},{children:e(Ud,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>a(!1)},{children:e("div",Object.assign({style:c,ref:l.setFloating},{children:e(Kh,{actions:Object.keys(r.blocks),editor:r,selectedAction:m,onClose:()=>a(!1),empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),u&&e(Uh,{editor:r,floatingStyles:p,refs:d,onClose:()=>s(!1),highlightColors:g}),e(Wh,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(Ih,{className:"bg-[#dbd8e0] mx-[6px] my-0 w-[1px]"}),e(zh,Object.assign({className:"flex items-center",type:"single","aria-label":"Block formatting"},{children:e(Wh,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(Ih,{className:"bg-[#dbd8e0] mx-[6px] my-0 w-[1px]"}),t(zh,Object.assign({className:"flex items-center",type:"multiple","aria-label":"Text formatting"},{children:[r.formats.bold&&e(Wh,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(lf,{width:20,height:20})})),r.formats.italic&&e(Wh,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(df,{width:20,height:20})})),r.formats.underline&&e(Wh,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(yf,{width:20,height:20})})),r.formats.strike&&e(Wh,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(vf,{width:20,height:20})})),r.formats.code&&e(Wh,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(nf,{width:20,height:20})})),r.formats.highlight&&t(Wh,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?ef:Jd,{width:10})]}))]}))]}))},Yh=()=>{const t=P(),[n,r]=f(!1),{refs:o,floatingStyles:i}=Kd({placement:"top",open:n,onOpenChange:r,middleware:[Gc(),Zc(),Xc(),Pc(10)],whileElementsMounted:Yc}),a=Cr((()=>{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(Vd,Object.assign({root:document.getElementById("yoopta-editor")},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:e($h,{activeBlock:u,editor:t})}))}))},Xh=(e,t,n)=>!(!e||!(null==e?void 0:e[n]))&&e[n].toLowerCase().indexOf(t.toLowerCase())>-1,Zh=({trigger:t="/",render:n})=>{const r=P(),[o,i]=f(!1),{refs:a,floatingStyles:u,update:s}=Kd({placement:"bottom-start",open:o,onOpenChange:i,middleware:[Gc(),Zc(),Xc(),Pc(10)],whileElementsMounted:Yc}),c=Object.keys(r.blocks).sort(((e,t)=>r.blocks[e].order-r.blocks[t].order)),[d,p]=f(c[0]),[h,v]=f(c),g=()=>i(!1),m=({text:e})=>{const n=e.trim().replace(t,"");if(0===n.length||n===t)return v(c);v(c.filter((e=>((e,t)=>!t||Xh(e,t,"type")||Xh(e.options,t,"displayLabel"))(r.blocks[e],n))))};l((()=>{const e=document.getElementById("yoopta-editor");O(r,{at:r.selection});const t=t=>{const n=kn(r,{at:r.selection}),o=null==e?void 0:e.contains(t.target);if(!n||!n.selection||!o)return;const i=Po.parent(n.selection.anchor.path),a=ni.string(n,i);if(0===a.length)return g();m({text:a})},n=t=>{const n=kn(r,{at:r.selection}),u=null==e?void 0:e.contains(t.target);if(n&&n.selection&&u){if(qf.isSlashCommand(t)){const e=Po.parent(n.selection.anchor.path),t=ni.string(n,e);if(!ni.isStart(n,n.selection.anchor,n.selection.focus)||t.trim().length>0)return;const r=window.getSelection();if(!r)return;const o=r.getRangeAt(0),u=o.getBoundingClientRect();o&&(a.setReference({getBoundingClientRect:()=>u,getClientRects:()=>o.getClientRects()}),i(!0))}if(o)if(qf.isTab(t))t.preventDefault();else if(qf.isArrowUp(t))t.preventDefault();else if(qf.isArrowDown(t))t.preventDefault();else if(qf.isArrowLeft(t))t.preventDefault();else if(qf.isArrowRight(t))t.preventDefault();else{if(qf.isBackspace(t)){if(!n.selection)return;if(ni.isStart(n,n.selection.anchor,n.selection.focus))return g()}if(qf.isEscape(t))return t.preventDefault(),void g();qf.isEnter(t)&&t.preventDefault()}}};return o&&document.addEventListener("click",g),null==e||e.addEventListener("keydown",n),null==e||e.addEventListener("keyup",t),()=>{null==e||e.removeEventListener("keydown",n),null==e||e.removeEventListener("keyup",t),document.removeEventListener("click",g)}}),[h,o,r.selection,a]);const D=e=>{const t=e.currentTarget.getAttribute("data-action-menu-item-type");p(t)},b=0===h.length;if(l((()=>{s();let e=setTimeout((()=>{b&&g()}),3e3);return()=>clearTimeout(e)}),[h.length,o,a]),!o)return null;if(n){const t=e=>({onMouseEnter:D,selectedAction:d});return e(Vd,{children:e("div",Object.assign({className:"absolute z-[9999] m-0 left-0 top-0 right-auto bottom-auto",style:u,ref:a.setFloating},{children:n({getItemProps:t,actions:h,editor:r,onMouseEnter:D,selectedAction:d,onClose:g,empty:b})}))})}return e(Vd,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:u,ref:a.setFloating},{children:e(Ff,{actions:h,editor:r,onMouseEnter:D,selectedAction:d,onClose:g,empty:b})}))}))},Gh=(()=>{const e=H();return{[e]:K({id:e})}})(),Jh=new z,Qh=(e,t)=>Jh.on(e,t),ev=(e,t)=>Jh.once(e,t),tv=(e,t)=>Jh.off(e,t),nv=(e,t)=>Jh.emit(e,t);const rv=({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=Cp(n,o)),n.blocks=yp(n,p),n.children=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(r)?r:Gh,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const r=wp(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=Qh,n.once=ev,n.off=tv,n.emit=nv,{editor:n,version:0})));return e(ip,{children:e(j,Object.assign({editorState:h},{children:t(Yf,{children:[e(op,{marks:o,autoFocus:a,className:u,selectionBoxRoot:l}),e(Zh,{}),e(Yh,{})]})}))})},ov=Object.assign(Object.assign({},Pf),{ExtendedBlockActions:({className:r,style:o,onClick:i,children:a})=>{const[u,s]=f(!1),{refs:l,floatingStyles:c}=Kd({placement:"bottom-start",open:u,onOpenChange:s,middleware:[Gc(),Zc(),Xc(),Pc(10)],whileElementsMounted:Yc});return t(n,{children:[u&&e(jf,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(uf,{})}))]})}});function iv(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 av(e,t,n={}){const{focusAt:r,waitExecution:o=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=n,u=()=>{const o=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!o||!i)return;const u=function(e,t){if(ai.isPoint(t))return t;if(Po.isPath(t))return{path:t,offset:0};const[,n]=ni.first(e,[0]);return{path:n||[0,0],offset:0}}(o,r);Ki.select(o,u),As.focus(o),a&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};o?setTimeout((()=>u()),i):u()}function uv(e){return Array.from(new Set(e))}var sv={};!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]",C="[object Float32Array]",y="[object Float64Array]",w="[object Int8Array]",B="[object Int16Array]",E="[object Int32Array]",x="[object Uint8Array]",A="[object Uint8ClampedArray]",F="[object Uint16Array]",O="[object Uint32Array]",k=/\w*$/,S=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,P={};P[o]=P["[object Array]"]=P[D]=P[b]=P[i]=P[a]=P[C]=P[y]=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[O]=!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 $,Y=Array.prototype,X=Function.prototype,Z=Object.prototype,G=N["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=X.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=Y.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),Ce=qe(he),ye=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 Oe(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){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(!Xe(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),Xe(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 C:case y:case w:case B:case E:case x:case A:case F:case O: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,k.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 ke);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!(!Xe(e)||(t=e,J&&J in t))&&(Ye(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},Oe.prototype.clear=function(){this.__data__={hash:new Ae,map:new(he||Fe),string:new Ae}},Oe.prototype.delete=function(e){return Me(this,e).delete(e)},Oe.prototype.get=function(e){return Me(this,e).get(e)},Oe.prototype.has=function(e){return Me(this,e).has(e)},Oe.prototype.set=function(e,t){return Me(this,e).set(e,t),this},ke.prototype.clear=function(){this.__data__=new Fe},ke.prototype.delete=function(e){return this.__data__.delete(e)},ke.prototype.get=function(e){return this.__data__.get(e)},ke.prototype.has=function(e){return this.__data__.has(e)},ke.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 Oe(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 Ce:return l;case ye: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)&&!Ye(e)}var $e=de||function(){return!1};function Ye(e){var t=Xe(e)?te.call(e):"";return t==u||t==s}function Xe(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)}}({get exports(){return sv},set exports(e){sv=e}},sv);var lv=sv;function cv(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=O(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=Co(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):lv(a));var a;const u=wp(e);i.id=H(),i.meta.order=o.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=u;const s=i.id;e.children=yo(e.children),e.applyChanges(),r&&e.focusBlock(s,{waitExecution:!0})}function dv(e,t){As.blur(t),As.deselect(t),Ki.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const fv=()=>{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=Co(e.children);const{at:r=null,focus:o=!1,slate:i=null}=n,a=O(e),u=r,s={id:H(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let l=!1;if(i&&i.selection){const e=ni.string(i,i.selection.anchor.path);l=ni.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=wp(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=yo(e.children),e.applyChanges(),o&&e.focusBlock(l&&d?d:s.id)}(e,...t),deleteBlock:(...t)=>bp(e,...t),duplicateBlock:(...t)=>cv(e,...t),toggleBlock:(...t)=>Dp(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Co(e.children);const r=O(e);r&&(r.meta.depth=r.meta.depth+1,e.children=yo(e.children),e.applyChanges())}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Co(e.children);const r=O(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=yo(e.children),e.applyChanges())}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=Co(e.children);const[r]=n,o=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===r));console.log("blockInNewPosition meta",Object.assign({},i).meta.depth);const 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,o.meta.depth=i.meta.depth,e.children=yo(e.children),e.applyChanges()}(e,...t),focusBlock:(...t)=>av(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>mp(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:r=!0}=t,o=O(e);n&&n.selection&&o&&ni.withoutNormalizing(n,(()=>{e.children=Co(e.children);const t=Po.parent(n.selection.anchor.path);Ki.splitNodes(n,{at:n.selection,match:e=>$o.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=n.children.slice()[i];Ki.removeNodes(n,{at:[i],match:e=>$o.isElement(e),mode:"highest"});const u={id:H(),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=wp(e);e.blockEditorsMap[u.id]=s,e.children[u.id]=u,e.children=yo(e.children),e.applyChanges(),r&&e.focusBlock(u.id,{slate:s})}))}(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:r=!0}=n;e.selection=t,r&&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=uv(t)}else e.selectedBlocks=uv(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const r=null!==(n=t.slate)&&void 0!==n?n:kn(e);if(!r)return;const{waitExecution:o,waitExecutionMs:i}=t;o?setTimeout((()=>dv(e,r)),i):(dv(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 pv({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}Rf('/*! 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:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.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{qf as HOTKEYS,ov as UI,F as YooptaPlugin,K as buildBlockData,U as buildBlockElement,fv as createYooptaEditor,pv as createYooptaMark,rv as default,O as findPluginBlockBySelectionPath,iv as findPluginBlockByType,kn as findSlateBySelectionPath,H as generateId,R as useBlockData,M as useBlockSelected,T as useYooptaBlock,P as useYooptaEditor,N as useYooptaPlugin,_ as useYooptaPluginOptions};
6
+ var Xn=["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(","),Zn="undefined"==typeof Element,qn=Zn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gn=!Zn&&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},Jn=function e(t,o){var n;void 0===o&&(o=!0);var r=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===r||"true"===r||o&&t&&e(t.parentNode)},Qn=function e(t,o,n){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Jn(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{qn.call(a,Xn)&&n.filter(a)&&(o||!t.includes(a))&&r.push(a);var s=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),d=!Jn(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(s&&d){var u=e(!0===s?a.children:s.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},er=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tr=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!er(e)?0:e.tabIndex},or=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},nr=function(e){return"INPUT"===e.tagName},rr=function(e){return function(e){return nr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||Gn(e),n=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!r||r===e}(e)},ir=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},ar=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=qn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(qn.call(r,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return ir(e)}else{if("function"==typeof n){for(var i=e;e;){var a=e.parentElement,l=Gn(e);if(a&&!a.shadowRoot&&!0===n(a))return ir(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,o,n,r,i=e&&Gn(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(o=a)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&a;){var c,s,d;l=!(null===(s=a=null===(c=i=Gn(a))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},lr=function(e,t){return!(t.disabled||Jn(t)||function(e){return nr(e)&&"hidden"===e.type}(t)||ar(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var o=0;o<t.children.length;o++){var n=t.children.item(o);if("LEGEND"===n.tagName)return!!qn.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},cr=function(e,t){return!(rr(t)||tr(t)<0||!lr(e,t))},sr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},dr=function e(t){var o=[],n=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var o=tr(e);return o<0&&t&&!er(e)?0:o}(a,i),c=i?e(t.candidates):a;0===l?i?o.push.apply(o,c):o.push(a):n.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:c})})),n.sort(or).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},ur=function(e,t){var o;return o=(t=t||{}).getShadowRoot?Qn([e],t.includeContainer,{filter:cr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:sr}):function(e,t,o){if(Jn(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Xn));return t&&qn.call(e,Xn)&&n.unshift(e),n.filter(o)}(e,t.includeContainer,cr.bind(null,t)),dr(o)};const fr=n["useInsertionEffect".toString()]||(e=>e());var pr="undefined"!=typeof document?c:s;function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},hr.apply(this,arguments)}let yr=!1,gr=0;const vr=()=>"floating-ui-"+gr++;const mr=n["useId".toString()]||function(){const[e,t]=n.useState((()=>yr?vr():void 0));return pr((()=>{null==e&&t(vr())}),[]),n.useEffect((()=>{yr||(yr=!0)}),[]),e};const br=n.createContext(null),wr=n.createContext(null);function xr(e){return"data-floating-ui-"+e}function kr(e){const t=l(e);return pr((()=>{t.current=e})),t}const Er=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const o=ur(e,Er());"prev"===t&&o.reverse();const n=o.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(o=t)||null==(o=o.shadowRoot)?void 0:o.activeElement);){var o;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return o.slice(n+1)[0]}function Or(e,t){const o=t||e.currentTarget,n=e.relatedTarget;return!n||!function(e,t){if(!e||!t)return!1;const o=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(o&&Ho(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,n)}function Sr(e){ur(e,Er()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const _r={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Rr(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const jr=n.forwardRef((function(e,t){const[o,r]=n.useState();pr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",Rr),()=>{document.removeEventListener("keydown",Rr)})),[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[xr("focus-guard")]:"",style:_r};return n.createElement("span",hr({},e,i))})),Br=n.createContext(null),Ar=xr("portal");function Tr(e){let{children:t,id:o,root:r=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:o}=void 0===e?{}:e;const[r,i]=n.useState(null),a=mr(),l=Mr(),c=n.useRef(null);return pr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{c.current=null}))}),[r]),pr((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=a,o.setAttribute(Ar,""),e.appendChild(o),c.current=o,i(o)}),[t,a]),pr((()=>{if(c.current)return;let e=o||(null==l?void 0:l.portalNode);e&&!Fo(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const r=document.createElement("div");r.id=a,r.setAttribute(Ar,""),e=n||e,e.appendChild(r),c.current=r,i(r)}),[t,o,a,l]),r}({id:o,root:r}),[l,c]=n.useState(null),s=n.useRef(null),d=n.useRef(null),u=n.useRef(null),f=n.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!r&&!a);return n.useEffect((()=>{if(a&&i&&(null==l||!l.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Or(e)){("focusin"===e.type?Dr:Sr)(a)}}}),[a,i,null==l?void 0:l.modal]),n.createElement(Br.Provider,{value:n.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:c})),[i,a])},p&&a&&n.createElement(jr,{"data-type":"outside",ref:s,onFocus:e=>{if(Or(e,a)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&a&&n.createElement("span",{"aria-owns":a.id,style:_r}),a&&b(t,a),p&&a&&n.createElement(jr,{"data-type":"outside",ref:d,onFocus:e=>{if(Or(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const Mr=()=>n.useContext(Br),Lr=new Set,Nr=n.forwardRef((function(e,t){let{lockScroll:o=!1,...r}=e;const i=mr();return pr((()=>{if(!o)return;Lr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,o=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(o))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Lr.delete(i),0===Lr.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,l)))}}),[i,o]),n.createElement("div",hr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Ir(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:r,nodeId:i}=e,[a,l]=n.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||a,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=n.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=n.useState(r);Kn(p,r)||h(r);const[y,g]=n.useState(null),[m,b]=n.useState(null),w=n.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=n.useCallback((e=>{e!==O.current&&(O.current=e,b(e))}),[]),k=a||y,E=l||m,C=n.useRef(null),O=n.useRef(null),S=n.useRef(u),D=null!=s,_=$n(s),R=$n(i),j=n.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:t,strategy:o,middleware:p};R.current&&(e.platform=R.current),Hn(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Kn(S.current,t)&&(S.current=t,v.flushSync((()=>{f(t)})))}))}),[p,t,o,R]);Vn((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=n.useRef(!1);Vn((()=>(B.current=!0,()=>{B.current=!1})),[]),Vn((()=>{if(k&&(C.current=k),E&&(O.current=E),k&&E){if(_.current)return _.current(k,E,j);j()}}),[k,E,j,_,D]);const A=n.useMemo((()=>({reference:C,floating:O,setReference:w,setFloating:x})),[w,x]),T=n.useMemo((()=>({reference:k,floating:E})),[k,E]),M=n.useMemo((()=>{const e={position:o,left:0,top:0};if(!T.floating)return e;const t=Yn(T.floating,u.x),n=Yn(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Wn(T.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,c,T.floating,u.x,u.y]);return n.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=n.useContext(wr),u=null!=((null==(f=n.useContext(br))?void 0:f.id)||null);var f;const p=function(e){const t=n.useRef((()=>{}));return fr((()=>{t.current=e})),n.useCallback((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(y.current.openEvent=t),g.emit("openchange",{open:e,event:t,reason:o,nested:u}),null==r||r(e,t,o)})),h=n.useRef(null),y=n.useRef({}),g=n.useState((()=>function(){const e=new Map;return{emit(t,o){var n;null==(n=e.get(t))||n.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var n;e.set(t,(null==(n=e.get(t))?void 0:n.filter((e=>e!==o)))||[])}}}()))[0],m=mr(),b=n.useCallback((e=>{const t=Fo(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=n.useCallback((e=>{(Fo(e)||null===e)&&(h.current=e,l(e)),(Fo(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Fo(e))&&s.refs.setReference(e)}),[s.refs]),x=n.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=n.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),E=n.useMemo((()=>({...s,refs:x,elements:k,dataRef:y,nodeId:i,floatingId:m,events:g,open:o,onOpenChange:p})),[s,i,m,g,o,p,x,k]);return pr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),n.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const Pr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Fr(e,t){void 0===t&&(t={});const{open:o,elements:{floating:r}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[l,c]=n.useState(!1),[s,d]=n.useState("unmounted"),u=function(e,t){const[o,r]=n.useState(e);return e&&!o&&r(!0),n.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),o}(o,a);return pr((()=>{l&&!u&&d("unmounted")}),[l,u]),pr((()=>{if(r){if(o){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[o,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:o={opacity:0},open:r,close:i,common:a,duration:l=250}=t,c=e.placement,s=c.split("-")[0],d=n.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof l,f=(u?l:l.open)||0,p=(u?l:l.close)||0,[h,y]=n.useState((()=>({...zr(a,d),...zr(o,d)}))),{isMounted:g,status:v}=Fr(e,{duration:l}),m=kr(o),b=kr(r),w=kr(i),x=kr(a);return pr((()=>{const e=zr(m.current,d),t=zr(w.current,d),o=zr(x.current,d),n=zr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&y((t=>({transitionProperty:t.transitionProperty,...o,...e}))),"open"===v&&y({transitionProperty:Object.keys(n).map(Pr).join(","),transitionDuration:f+"ms",...o,...n}),"close"===v){const n=t||e;y({transitionProperty:Object.keys(n).map(Pr).join(","),transitionDuration:p+"ms",...o,...n})}}),[p,w,m,b,x,f,v,d]),{isMounted:g,styles:h}}var Hr;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Vr.apply(this,arguments)}var Kr=function(e){return n.createElement("svg",Vr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Hr||(Hr=n.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Wr(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}var Yr=["color"],$r=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Wr(e,Yr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Xr=["color"],Zr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Wr(e,Xr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),qr=["color"],Gr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Wr(e,qr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Jr=["color"],Qr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Wr(e,Jr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("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:n,fillRule:"evenodd",clipRule:"evenodd"}))})),ei=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));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||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ti={"text/plain":"Text","text/html":"Url",default:"Text"};var oi=function(e,t){var o,n,r,i,a,l,c=!1;t||(t={}),o=t.debug||!1;try{if(r=ei(),i=document.createRange(),a=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=ti[t.format]||ti.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){o&&console.error("unable to copy using execCommand: ",r),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){o&&console.error("unable to copy using clipboardData: ",r),o&&console.error("falling back to prompt"),n=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(n,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return c};function ni(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ri(e){if(!e)return;const t=ni(e);return t?e[t]:void 0}const ii=i(void 0),ai=({children:n,tools:r})=>{const i=V(),a=d((()=>r?Object.keys(r).reduce(((e,t)=>{var o;return Object.assign(Object.assign({},e),{[t]:null===(o=r[t])||void 0===o?void 0:o.render})}),{}):{}),[r]),l=d((()=>!r||i?null:Object.keys(r).map((t=>{var o,n,i;const a=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.tool,l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.render,c=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return a?e(a,Object.assign({render:l},c),t):null}))),[d]);return e(ii.Provider,Object.assign({value:a},{children:t(o,{children:[l,n]})}))},li=()=>{const e=a(ii);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e},ci=({children:t})=>e("div",Object.assign({className:"yoo-editor-flex yoo-editor-flex-col"},{children:t})),si=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoo-editor-bg-[#FFF] yoo-editor-relative yoo-editor-min-w-[200px] yoo-editor-w-auto yoo-editor-overflow-hidden yoo-editor-rounded-md yoo-editor-border yoo-editor-bg-popover yoo-editor-py-[6px] yoo-editor-px-0 yoo-editor-text-popover-foreground yoo-editor-shadow-md data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),di=({children:t})=>e("div",Object.assign({className:"yoo-editor-relative yoo-editor-flex yoo-editor-cursor-default yoo-editor-select-none yoo-editor-items-center yoo-editor-text-sm yoo-editor-outline-none yoo-editor-transition-colors focus:yoo-editor-bg-accent focus:yoo-editor-text-accent-foreground data-[disabled]:yoo-editor-pointer-events-none data-[disabled]:yoo-editor-opacity-50"},{children:t})),ui=({isOpen:o,onClose:n,refs:r,style:i,children:a})=>{var l,c;const s=z(),d=li(),[u,p]=f(!1),{refs:h,floatingStyles:y,context:g}=Ir({placement:"right",open:u,onOpenChange:p,middleware:[Un(),Fn(),zn(),kn(10)],whileElementsMounted:Pn}),{isMounted:v,styles:m}=Ur(g,{duration:100});if(!o)return null;const b=L(s,{at:s.selection}),w=ri(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(l=null==w?void 0:w.props)||void 0===l?void 0:l.nodeType),k=d.ActionMenu,E=Object.assign(Object.assign({},y),m);return e(Tr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Nr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:n},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(si,{children:[t(ci,{children:[e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),n()}},{children:[e(Qr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),n()}},{children:[e($r,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(di,{children:[v&&!!k&&e(Tr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Nr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:E,ref:h.setFloating},{children:e(k,{actions:Object.keys(s.blocks),editor:s,selectedAction:"",onClose:()=>{p(!1),n()},empty:!1,onMouseEnter:()=>{},mode:"toggle",view:"small"})}))}))})),t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Kr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(di,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=L(s);e&&(oi(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),n()}},{children:[e(Gr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var fi=Object.freeze({__proto__:null,BlockOptions:ui,BlockOptionsMenuContent:si,BlockOptionsMenuGroup:ci,BlockOptionsMenuItem:di,BlockOptionsSeparator:({className:t})=>e("div",{className:`yoo-editor-h-[1px] yoo-editor-bg-[#37352f14] yoo-editor-my-[4px] yoo-editor-w-full ${t}`})});const pi=({block:o,editor:n,dragHandleProps:r,showActions:i,onChangeActiveBlock:a})=>{const[l,c]=f(!1),{refs:s,floatingStyles:d,context:u}=Ir({placement:"right-start",open:l,onOpenChange:c,middleware:[Un(),Fn(),zn(),kn()]}),{isMounted:p,styles:h}=Ur(u,{duration:100}),{setActivatorNodeRef:y,attributes:g,listeners:v}=r,m=Object.assign(Object.assign({},d),h);return t("div",Object.assign({contentEditable:!1,"data-hovered-state":i,className:'yoo-editor-flex yoo-editor-absolute -yoo-editor-left-[50px] yoo-editor-top-[2px] yoo-editor-opacity-0 yoo-editor-transition-opacity yoopta-element-actions data-[hovered-state="true"]:yoo-editor-opacity-100'},{children:[e("button",Object.assign({type:"button",onClick:()=>{const e=J({id:q()}),t=[o.meta.order+1];n.setSelection([o.meta.order]),n.insertBlock(e,{at:t,focus:!0})},className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoo-editor-w-[24px] yoopta-element-actions-plus"},{children:e(Mo,{})})),e("button",Object.assign({type:"button",className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoopta-element-actions-drag",ref:e=>{y(e),s.setReference(e)}},g,v,{onClick:e=>{e.stopPropagation(),a(o.id);const t=Lo(n,{at:[o.meta.order]});n.focusBlock(o.id),t&&setTimeout((()=>{n.blocks[o.type].hasCustomEditor||(w.blur(t),w.deselect(t),R.deselect(t)),n.setBlockSelected([o.meta.order],{only:!0}),n.setSelection([o.meta.order]),c(!0)}),10)}},{children:e(Ao,{})})),e(ui,{isOpen:p,refs:s,style:m,onClose:()=>c(!1)})]}))},hi=({children:o,block:n,blockId:r})=>{var i;const a=z(),[l,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:y,isOver:g,isDragging:v}=Co({id:r,disabled:a.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:y,opacity:v?.7:1,marginLeft:20*n.meta.depth+"px"},b=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(n.meta.order),w=l===r,x={borderBottom:g&&!v?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoo-editor-relative yoo-editor-py-0 yoo-editor-px-[2px] yoo-editor-mt-[2px] yoo-editor-mb-[1px] yoo-editor-rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||c(r)},onMouseLeave:()=>{a.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":r},{children:[!a.readOnly&&e(pi,{block:n,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:o})),b&&!a.readOnly&&e("div",{className:"yoo-editor-absolute yoo-editor-left-0 yoo-editor-top-0 yoo-editor-bg-[#2383e224] yoo-editor-z-[90] yoo-editor-rounded yoo-editor-opacity-100 yoo-editor-h-full yoo-editor-w-full yoo-editor-pointer-events-none yoopta-selection-block"})]}))};function yi(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;var gi={};Object.defineProperty(gi,"__esModule",{value:!0});for(var vi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),mi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},bi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:vi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},wi={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},xi=1;xi<20;xi++)wi["f"+xi]=111+xi;function ki(e,t,o){t&&!("byKey"in t)&&(o=t,t=null),Array.isArray(e)||(e=[e]);var n=e.map((function(e){return Ei(e,t)})),r=function(e){return n.some((function(t){return Ci(t,e)}))};return null==o?r:r(o)}function Ei(e,t){var o=t&&t.byKey,n={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var a in mi)n[mi[a]]=!1;var l=!0,c=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Si(f),y=mi[h];if(f.length>1&&!y&&!bi[f]&&!wi[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&y||(o?n.key=h:n.which=Oi(f)),y&&(n[y]=!p||null)}}catch(e){c=!0,s=e}finally{try{!l&&u.return&&u.return()}finally{if(c)throw s}}return n}function Ci(e,t){for(var o in e){var n=e[o],r=void 0;if(null!=n&&((null!=(r="key"===o&&null!=t.key?t.key.toLowerCase():"which"===o?91===n&&93===t.which?91:t.which:t[o])||!1!==n)&&r!==n))return!1}return!0}function Oi(e){return e=Si(e),wi[e]||e.toUpperCase().charCodeAt(0)}function Si(e){return e=e.toLowerCase(),e=bi[e]||e}gi.default=ki,gi.isHotkey=ki,gi.isCodeHotkey=function(e,t){return ki(e,t)};var Di=gi.isKeyHotkey=function(e,t){return ki(e,{byKey:!0},t)};gi.parseHotkey=Ei,gi.compareHotkey=Ci,gi.toKeyCode=Oi,gi.toKeyName=Si;const _i={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",slashCommand:"/",kekCeburek:"mod+enter"},Ri={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},ji={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Bi=e=>{const t=_i[e],o=Ri[e],n=ji[e],r=t&&Di(t),i=o&&Di(o),a=n&&Di(n);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!a||!a(e)))},Ai={isBold:Bi("bold"),isCompose:Bi("compose"),isArrowLeft:Bi("arrowLeft"),isArrowRight:Bi("arrowRight"),isArrowUp:Bi("arrowUp"),isArrowDown:Bi("arrowDown"),isDeleteBackward:Bi("deleteBackward"),isDeleteForward:Bi("deleteForward"),isDeleteLineBackward:Bi("deleteLineBackward"),isDeleteLineForward:Bi("deleteLineForward"),isDeleteWordBackward:Bi("deleteWordBackward"),isDeleteWordForward:Bi("deleteWordForward"),isExtendBackward:Bi("extendBackward"),isExtendForward:Bi("extendForward"),isExtendLineBackward:Bi("extendLineBackward"),isExtendLineForward:Bi("extendLineForward"),isItalic:Bi("italic"),isMoveLineBackward:Bi("moveLineBackward"),isMoveLineForward:Bi("moveLineForward"),isCtrlLeft:Bi("ctrlLeft"),isCtrlRight:Bi("ctrlRight"),isRedo:Bi("redo"),isShiftEnter:Bi("shiftEnter"),isEnter:Bi("enter"),isTransposeCharacter:Bi("transposeCharacter"),isUndo:Bi("undo"),isSpace:Bi("space"),isSelect:Bi("select"),isTab:Bi("tab"),isShiftTab:Bi("shiftTab"),isBackspace:Bi("backspace"),isCmdEnter:Bi("cmdEnter"),isCmd:Bi("cmd"),isEscape:Bi("escape"),isSlashCommand:Bi("slashCommand"),isShiftArrowUp:Bi("shiftArrowUp"),isShiftArrowDown:Bi("shiftArrowDown"),isKekceburek:Bi("kekCeburek")};const Ti={onKeyDown:function(e){return t=>{const o=Lo(e,{at:e.selection});if(!o||!o.selection)return;const n=S.parent(o.selection.anchor.path);if(Ai.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void o.insertText("\n")}if(Ai.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=D.isStart(o,o.selection.anchor,n),i=D.isEnd(o,o.selection.anchor,n);if(!r&&!i)return void e.splitBlock({slate:o,focus:!0});const a=J({id:q()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:l,slate:o,focus:!0})}else if(Ai.isBackspace(t)){if(t.isDefaultPrevented())return;const n=L(e,{at:e.selection}),r=e.blocks[(null==n?void 0:n.type)||""],i=S.parent(o.selection.anchor.path);if(D.isStart(o,o.selection.anchor,i)){t.preventDefault();const n=D.string(o,i),a=e.selection?e.selection[0]-1:0,l=Lo(e,{at:[a]});let c;if(l&&!r.hasCustomEditor&&(c=function(e,t){const[,o]=D.last(e,t);return{path:o,offset:D.string(e,o).length}}(l,i)),0===n.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:c});{if(j.isExpanded(o.selection))return R.delete(o,{at:o.selection});if(!l)return;if(0===D.string(l,[0,0]).length)return e.deleteBlock({at:[a],focus:!0,focusAt:c});const t=Array.from(D.nodes(o,{at:[0],match:e=>!D.isEditor(e)&&(B.isText(e)||D.isInline(o,e)),mode:"highest"})).map((([e])=>e));return R.insertNodes(l,t,{at:D.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:c})}}}else{if(Ai.isSelect(t)){if(t.isDefaultPrevented())return;const[,n]=D.first(o,[0]),[,r]=D.last(o,[o.children.length-1]),i=D.range(o,n,r),a=j.equals(o.selection,i);if(j.isExpanded(o.selection)&&a)return t.preventDefault(),w.blur(o),w.deselect(o),R.deselect(o),void e.setBlockSelected([],{allSelected:!0})}if(Ai.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Ai.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Ai.isArrowUp(t)){if(t.isDefaultPrevented())return;const n=S.parent(o.selection.anchor.path);if(D.isStart(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]-1]:null,n=Lo(e,{at:o}),r=L(e,{at:o});if(n&&r){const[,o]=D.last(n,[0]),i={path:o,offset:D.string(n,o).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Ai.isArrowDown(t)){if(t.isDefaultPrevented())return;const n=S.parent(o.selection.anchor.path);if(D.isEnd(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]+1]:null,r=Lo(e,{at:o}),i=L(e,{at:o});if(r&&i){const o=function(e,t){const[,o]=D.first(e,t);return{path:o,offset:0}}(r,n);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:o,waitExecution:!1})}}}if(j.isExpanded(o.selection)){if(Object.values(e.formats).length>0)for(const o of Object.values(e.formats))if(o.hotkey&&Di(o.hotkey)(t)){t.preventDefault(),e.formats[o.type].toggle();break}}}}}},Mi=({children:t,attributes:o,placeholder:n})=>{const r=x(),i=Object.assign({},o);return r&&n&&(i["data-placeholder"]=n,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Li(e){try{return new URL(e),!0}catch(e){return!1}}const Ni=(e,t)=>{(e=>{const[t]=D.nodes(e,{match:e=>!D.isEditor(e)&&_.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{R.unwrapNodes(e,{match:e=>!D.isEditor(e)&&_.isElement(e)&&"link"===e.type})})(e);const{selection:o}=e,n=o&&j.isCollapsed(o),r={type:"link",children:n?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};n?R.insertNodes(e,r):(R.wrapNodes(e,r,{split:!0}),R.collapse(e,{edge:"end"}))};function Ii(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Pi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function zi(e,t,o){var n,r,i;if(3===o.nodeType){return null===(n=o.textContent)||void 0===n?void 0:n.replace(/[\t\n\r\f\v]+/g," ")}if(1!==o.nodeType)return null;if("BR"===o.nodeName)return"\n";const a=o;let l=Array.from(a.childNodes).map((o=>zi(e,t,o))).flat();if(Pi[o.nodeName]){return{[Pi[o.nodeName].type]:!0,text:null===(r=o.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(t[o.nodeName]){const n=t[o.nodeName],r=e.blocks[n.type],a=ni(r.elements)||"",c=r.elements[a],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:q(),type:a,children:s&&!r.hasCustomEditor?[{text:""}]:l.map(Fi),props:Object.assign({nodeType:"block"},c.props)};if(n.parse){const e=n.parse(o);if(e)if(_.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return J({id:q(),type:n.type,value:[d],meta:{order:0,depth:0}})}return l}function Fi(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Ii(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Ui={html:{deserialize:function(e,t){console.log("pasted html",t);const o=function(e){const t={};return Object.keys(e.plugins).forEach((o=>{const n=e.plugins[o],{parsers:r}=n;if(r){const{html:e}=r;if(e){const{deserialize:n}=e;if(n){const{nodeNames:e}=n;e&&e.forEach((e=>{t[e]={type:o,parse:n.parse}}))}}}})),t}(e);return zi(e,o,t).filter(Ii)},serialize:function(){}},markdown:{}},Hi=({id:t,customEditor:o,elements:n,marks:r,events:i,options:a,placeholder:c="Type '/' for commands"})=>{var s,f;const p=z(),h=F(t),y=l(h.value).current,g=h.type,v=d((()=>(e=>{const t={};return Object.keys(e).forEach((o=>t[o]=e[o].render)),t})(n)),[n]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),b=d((()=>{let e=p.blockEditorsMap[t];return Object.keys(n).forEach((t=>{var o;const r=null===(o=n[t].props)||void 0===o?void 0:o.nodeType,i="inline"===r,a="void"===r,l="inlineVoid"===r;l&&(e.markableVoid=e=>e.type===t),(a||l)&&(e.isVoid=e=>e.type===t),(i||l)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:o}=e;return e.insertText=t=>{t&&Li(t)?Ni(e,t):o(t)},e.insertData=o=>{const n=o.getData("text/plain");n&&Li(n)?Ni(e,n):t(o)},e})(e))})),e}),[]),w=d((()=>{if(!i||p.readOnly)return{};const e={hotkeys:Ai,currentBlock:h,defaultBlock:J({id:q()})},t={};return Object.keys(i).forEach((o=>{t[o]=function(t){if(i[o]){i[o](p,b,e)(t)}}})),t}),[i,p,h]),x=u((e=>p.updateBlock(t,{value:e})),[t]),k=u((o=>{const n=v[o.element.type];return n?e(n,Object.assign({},o,{blockId:t,HTMLAttributes:null==a?void 0:a.HTMLAttributes})):e(C,Object.assign({},o))}),[n]),E=u((t=>{var o,n,r,i,a;let{children:l,leaf:s,attributes:d}=t;const u=yi(s,["text"]),f=(null===(o=p.selection)||void 0===o?void 0:o[0])===h.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(l=t.render({children:l,leaf:s}))}));const y=!("void"===(null===(a=null===(i=null===(r=null===(n=t.children)||void 0===n?void 0:n.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&f&&s.withPlaceholder;return e(Mi,Object.assign({attributes:d,placeholder:y?c:void 0},{children:l}))}),[r]),O=u((e=>{var t;p.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),Ti.onKeyDown(p)(e))}),[w.onKeyDown,p.readOnly]),S=u((e=>{var t;p.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)}),[w.onKeyUp,p.readOnly]),_=u((e=>{var t,o;p.readOnly||((null===(t=p.selection)||void 0===t?void 0:t[0])!==h.meta.order&&p.setSelection([h.meta.order]),null===(o=null==w?void 0:w.onClick)||void 0===o||o.call(w,e))}),[w.onClick,p.readOnly,null===(s=p.selection)||void 0===s?void 0:s[0]]),R=u((e=>{var t;p.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))}),[w.onBlur,p.readOnly]),B=u((e=>{var t;p.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)}),[w.onFocus,p.readOnly]),A=u((e=>{var t;if(p.readOnly)return;null===(t=null==w?void 0:w.onPaste)||void 0===t||t.call(w,e);const o=e.clipboardData.getData("text/html"),n=(new DOMParser).parseFromString(o,"text/html");if(n.body.childNodes.length>0){const e=Ui.html.deserialize(p,n.body);if(e.length>0)return void p.insertBlocks(e,{at:p.selection,focus:!0})}}),[w.onPaste,p.readOnly]),T=u((e=>{var t;const o=[];if(p.readOnly)return o;const[n,r]=e,i=(null===(t=p.selection)||void 0===t?void 0:t[0])===h.meta.order;return b.selection&&i&&!D.isEditor(n)&&""===D.string(b,[r[0]])&&j.includes(b.selection,r)&&j.isCollapsed(b.selection)&&o.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),o}),[p.readOnly,null===(f=p.selection)||void 0===f?void 0:f[0]]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":g},{children:e(Vi,{id:t,slate:b,initialValue:y,onChange:x,decorate:T,renderLeaf:E,renderElement:k,eventHandlers:w,onKeyDown:O,onKeyUp:S,onFocus:B,onClick:_,onBlur:R,customEditor:o,readOnly:p.readOnly,onPaste:A})}))},Vi=p((({id:t,slate:o,initialValue:n,onChange:r,renderLeaf:i,renderElement:a,eventHandlers:l,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:y,readOnly:g})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:o,initialValue:n,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:a,renderLeaf:i,className:"focus-visible:yoo-editor-outline-none focus:yoo-editor-outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:y,onBlur:f,readOnly:g,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Vi.displayName="SlateEditorInstance";const Ki=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Ae(Et,{activationConstraint:{delay:100,tolerance:0}}),Ae(mt,{coordinateGetter:Do})),handleDragEnd:u((t=>{const{active:o,over:n}=t;if(o&&n&&o.id!==n.id){const t=e.children[n.id].meta.order;e.moveBlock(o.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),Wi=[],Yi=({editor:t,marks:n,placeholder:r})=>{const i=V(),{sensors:a,handleDragEnd:l,handleDragStart:c}=Ki({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Wi:s.sort(((e,o)=>t.children[e].meta.order-t.children[o].meta.order))),[s]),f=[];for(let o=0;o<u.length;o++){const i=u[o],a=t.children[i],l=t.plugins[a.type];a&&l?f.push(e(hi,Object.assign({block:a,blockId:i},{children:e(Hi,{type:a.type,id:i,marks:n,customEditor:l.customEditor,events:l.events,elements:l.elements,options:l.options,placeholder:r},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e(o,{children:f}):e(to,Object.assign({sensors:a,collisionDetection:Fe,onDragStart:c,onDragEnd:l},{children:e(vo,Object.assign({disabled:i,items:u,strategy:ho},{children:f}))}))},$i=({editor:e,yooptaEditorRef:t,root:o})=>{const[n,r]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var a;if(e.readOnly||!1===o)return;const l=null===(a=t.current)||void 0===a?void 0:a.contains(i.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||r({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!n.selection||e.readOnly||!1===o)return;r((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t)=>{const o=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((n,r)=>{if(!n)return;const i=n.getBoundingClientRect(),a=Math.min(e[1],t[1]),l=Math.min(e[0],t[0]),c=Math.max(e[1],t[1]),s=Math.max(e[0],t[0]);a<i.bottom&&c>i.top&&l<i.right&&s>i.left&&o.push(r)})),o})(n.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===o)return;const r=o&&"current"in o?o.current:o||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===(n=t.current)||void 0===n?void 0:n.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",i),r.addEventListener("mousemove",a),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,o,e.readOnly]);const c=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},Xi=({origin:t,coords:o,isOpen:n})=>{if(!n)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(o[1]-t[1]-1),width:Math.abs(o[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>o[1]&&t[0]>o[0]?"scaleY(-1) scaleX(-1)":t[1]>o[1]?"scaleY(-1)":t[0]>o[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})},Zi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},qi=({placeholder:o,marks:n,className:r,selectionBoxRoot:i,width:a,autoFocus:c=!0})=>{const d=z(),u=V(),f=l(null),p=$i({editor:d,yooptaEditorRef:f,root:i});let h=l(Zi).current;s((()=>{if(!c||u)return;const e=L(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.selectedBlocks,u]);const y=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},g=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},v=e=>{var t,o,n,r,i;if(!u){if(Ai.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Ai.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(o=d.selectedBlocks)||void 0===o?void 0:o.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void g();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void g()}if(Ai.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(r=d.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==h.startedIndexToSelect){const o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),o=Lo(d);if(!o||!o.selection||!t)return;const n=S.parent(o.selection.anchor.path),i=D.isStart(o,o.selection.focus,n);if(j.isExpanded(o.selection)&&i){const n=d.selection?[d.selection[0]-1]:[0],r=L(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),R.deselect(o),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Ai.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),o=Lo(d);if(!o||!o.selection||!t)return;const n=S.parent(o.selection.anchor.path),r=D.isEnd(o,o.selection.focus,n);if(j.isExpanded(o.selection)&&r){const n=d.selection?[d.selection[0]+1]:[0],r=L(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),R.deselect(o),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:a},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({id:"yoopta-editor",className:r,style:m,ref:f,onClick:e=>{u||(g(),(e=>{var t;const o=f.current;if(!o)return;const{bottom:n}=o.getBoundingClientRect(),r=n-parseInt(getComputedStyle(o).paddingBottom,10),i=J({id:q()});if(e.clientY>=r){const e=Object.keys(d.children).length-1,o=L(d,{at:[e]}),n=Lo(d,{at:[e]});if(o&&n&&n.selection){const e=D.string(n,n.selection.anchor.path),r=S.parent(n.selection.anchor.path),[a]=D.node(n,r);if(o.type===i.type&&_.isElement(a)&&"void"!==(null===(t=a.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(o.id,{slate:n})}const r=e+1;d.insertBlock(i,{at:[r],focus:!0})}})(e),y())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(g(),y())}},{children:[e(Yi,{editor:d,marks:n,placeholder:o}),!1!==i&&e(Xi,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},Gi=({children:e,fallback:t=null})=>{const[o,n]=f(!1);return s((()=>n(!0)),[]),o?e:t};var Ji=Symbol.for("immer-nothing"),Qi=Symbol.for("immer-draftable"),ea=Symbol.for("immer-state");function ta(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oa=Object.getPrototypeOf;function na(e){return!!e&&!!e[ea]}function ra(e){return!!e&&(aa(e)||Array.isArray(e)||!!e[Qi]||!!e.constructor?.[Qi]||ua(e)||fa(e))}var ia=Object.prototype.constructor.toString();function aa(e){if(!e||"object"!=typeof e)return!1;const t=oa(e);if(null===t)return!0;const o=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return o===Object||"function"==typeof o&&Function.toString.call(o)===ia}function la(e,t){0===ca(e)?Reflect.ownKeys(e).forEach((o=>{t(o,e[o],e)})):e.forEach(((o,n)=>t(n,o,e)))}function ca(e){const t=e[ea];return t?t.type_:Array.isArray(e)?1:ua(e)?2:fa(e)?3:0}function sa(e,t){return 2===ca(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function da(e,t,o){const n=ca(e);2===n?e.set(t,o):3===n?e.add(o):e[t]=o}function ua(e){return e instanceof Map}function fa(e){return e instanceof Set}function pa(e){return e.copy_||e.base_}function ha(e,t){if(ua(e))return new Map(e);if(fa(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&aa(e)){if(!oa(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const o=Object.getOwnPropertyDescriptors(e);delete o[ea];let n=Reflect.ownKeys(o);for(let t=0;t<n.length;t++){const r=n[t],i=o[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(o[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(oa(e),o)}function ya(e,t=!1){return va(e)||na(e)||!ra(e)||(ca(e)>1&&(e.set=e.add=e.clear=e.delete=ga),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>ya(t,!0)))),e}function ga(){ta(2)}function va(e){return Object.isFrozen(e)}var ma,ba={};function wa(e){const t=ba[e];return t||ta(0),t}function xa(){return ma}function ka(e,t){t&&(wa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ea(e){Ca(e),e.drafts_.forEach(Sa),e.drafts_=null}function Ca(e){e===ma&&(ma=e.parent_)}function Oa(e){return ma={drafts_:[],parent_:ma,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Sa(e){const t=e[ea];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Da(e,t){t.unfinalizedDrafts_=t.drafts_.length;const o=t.drafts_[0];return void 0!==e&&e!==o?(o[ea].modified_&&(Ea(t),ta(4)),ra(e)&&(e=_a(t,e),t.parent_||ja(t,e)),t.patches_&&wa("Patches").generateReplacementPatches_(o[ea].base_,e,t.patches_,t.inversePatches_)):e=_a(t,o,[]),Ea(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ji?e:void 0}function _a(e,t,o){if(va(t))return t;const n=t[ea];if(!n)return la(t,((r,i)=>Ra(e,n,t,r,i,o))),t;if(n.scope_!==e)return t;if(!n.modified_)return ja(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let r=t,i=!1;3===n.type_&&(r=new Set(t),t.clear(),i=!0),la(r,((r,a)=>Ra(e,n,t,r,a,o,i))),ja(e,t,!1),o&&e.patches_&&wa("Patches").generatePatches_(n,o,e.patches_,e.inversePatches_)}return n.copy_}function Ra(e,t,o,n,r,i,a){if(na(r)){const a=_a(e,r,i&&t&&3!==t.type_&&!sa(t.assigned_,n)?i.concat(n):void 0);if(da(o,n,a),!na(a))return;e.canAutoFreeze_=!1}else a&&o.add(r);if(ra(r)&&!va(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;_a(e,r),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(o,n)||ja(e,r)}}function ja(e,t,o=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ya(t,o)}var Ba={get(e,t){if(t===ea)return e;const o=pa(e);if(!sa(o,t))return function(e,t,o){const n=Ma(t,o);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,o,t);const n=o[t];return e.finalized_||!ra(n)?n:n===Ta(e.base_,t)?(Na(e),e.copy_[t]=Ia(n,e)):n},has:(e,t)=>t in pa(e),ownKeys:e=>Reflect.ownKeys(pa(e)),set(e,t,o){const n=Ma(pa(e),t);if(n?.set)return n.set.call(e.draft_,o),!0;if(!e.modified_){const n=Ta(pa(e),t),a=n?.[ea];if(a&&a.base_===o)return e.copy_[t]=o,e.assigned_[t]=!1,!0;if(((r=o)===(i=n)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==o||sa(e.base_,t)))return!0;Na(e),La(e)}var r,i;return e.copy_[t]===o&&(void 0!==o||t in e.copy_)||Number.isNaN(o)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=o,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ta(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Na(e),La(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const o=pa(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:o[t]}:n},defineProperty(){ta(11)},getPrototypeOf:e=>oa(e.base_),setPrototypeOf(){ta(12)}},Aa={};function Ta(e,t){const o=e[ea];return(o?pa(o):e)[t]}function Ma(e,t){if(!(t in e))return;let o=oa(e);for(;o;){const e=Object.getOwnPropertyDescriptor(o,t);if(e)return e;o=oa(o)}}function La(e){e.modified_||(e.modified_=!0,e.parent_&&La(e.parent_))}function Na(e){e.copy_||(e.copy_=ha(e.base_,e.scope_.immer_.useStrictShallowCopy_))}la(Ba,((e,t)=>{Aa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Aa.deleteProperty=function(e,t){return Aa.set.call(this,e,t,void 0)},Aa.set=function(e,t,o){return Ba.set.call(this,e[0],t,o,e[0])};function Ia(e,t){const o=ua(e)?wa("MapSet").proxyMap_(e,t):fa(e)?wa("MapSet").proxySet_(e,t):function(e,t){const o=Array.isArray(e),n={type_:o?1:0,scope_:t?t.scope_:xa(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=n,i=Ba;o&&(r=[n],i=Aa);const{revoke:a,proxy:l}=Proxy.revocable(r,i);return n.draft_=l,n.revoke_=a,l}(e,t);return(t?t.scope_:xa()).drafts_.push(o),o}function Pa(e){if(!ra(e)||va(e))return e;const t=e[ea];let o;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,o=ha(e,t.scope_.immer_.useStrictShallowCopy_)}else o=ha(e,!0);return la(o,((e,t)=>{da(o,e,Pa(t))})),t&&(t.finalized_=!1),o}var za=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,o)=>{if("function"==typeof e&&"function"!=typeof t){const o=t;t=e;const n=this;return function(e=o,...r){return n.produce(e,(e=>t.call(this,e,...r)))}}let n;if("function"!=typeof t&&ta(6),void 0!==o&&"function"!=typeof o&&ta(7),ra(e)){const r=Oa(this),i=Ia(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?Ea(r):Ca(r)}return ka(r,o),Da(n,r)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===Ji&&(n=void 0),this.autoFreeze_&&ya(n,!0),o){const t=[],r=[];wa("Patches").generateReplacementPatches_(e,n,t,r),o(t,r)}return n}ta(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...o)=>this.produceWithPatches(t,(t=>e(t,...o)));let o,n;return[this.produce(e,t,((e,t)=>{o=e,n=t})),o,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ra(e)||ta(8),na(e)&&(e=function(e){na(e)||ta(10);return Pa(e)}(e));const t=Oa(this),o=Ia(e,void 0);return o[ea].isManual_=!0,Ca(t),o}finishDraft(e,t){const o=e&&e[ea];o&&o.isManual_||ta(9);const{scope_:n}=o;return ka(n,t),Da(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let o;for(o=t.length-1;o>=0;o--){const n=t[o];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}o>-1&&(t=t.slice(o+1));const n=wa("Patches").applyPatches_;return na(e)?n(e,t):this.produce(e,(e=>n(e,t)))}};za.produce,za.produceWithPatches.bind(za),za.setAutoFreeze.bind(za),za.setUseStrictShallowCopy.bind(za),za.applyPatches.bind(za);var Fa=za.createDraft.bind(za),Ua=za.finishDraft.bind(za);function Ha(e,t){const o=Lo(e);if(!o)return!1;const n=D.marks(o);return!!(null==n?void 0:n[t])}const Va=(e,t)=>{const{insertText:o}=t;return t.insertText=n=>{var r;const{selection:i}=t;if(" "===n&&i&&j.isCollapsed(i)){const{anchor:a}=i,l=D.above(t,{match:e=>_.isElement(e)&&D.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,s=D.parent(t,c),[d]=s;if(_.isElement(d)&&!B.isText(d.children[0]))return o(n);const u=l?c:[],f={anchor:a,focus:D.start(t,u)},p=D.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return R.select(t,f),R.delete(t),void h.create({deleteText:!1})}o(n)},t};function Ka(e,t,o){e.children=Fa(e.children);let n=!1;const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);o.id&&(r.id=o.id,n=!0),o.type&&(r.type=o.type,n=!0),o.meta&&(r.meta=o.meta,n=!0),o.value&&(r.value=o.value),e.children=Ua(e.children),n&&e.applyChanges(),e.emit("change",e.children)}function Wa(e,t,o){e.children=Fa(e.children);const n=L(e,{at:e.selection});if(!n)throw new Error("Block from not found at current selection");const r=ni(e.blocks[n.type].elements);if(n.type===t)return void(e.children=Ua(e.children));const i=Lo(e,{at:[n.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${n.meta.order}`);const a=ni(e.blocks[t].elements);D.withoutNormalizing(i,(()=>{!function(e,t={}){var o;const{at:n,elementType:r}=t,i=n||(null===(o=e.selection)||void 0===o?void 0:o.anchor.path);if(!i)return;let a=e=>!D.isEditor(e)&&_.isElement(e);r&&(a=e=>!D.isEditor(e)&&_.isElement(e)&&e.type===r);const l=S.parent(i),c=D.nodes(e,{at:l,match:a,mode:"lowest"});if(c){const[e]=c}}(i,{elementType:r}),R.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>_.isElement(e)&&!D.isInline(i,e)});const o={id:n.id,type:t,meta:Object.assign(Object.assign({},n.meta),{order:n.meta.order}),value:i.children};e.blockEditorsMap[n.id]=i,e.children[n.id]=o,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children)}))}function Ya(e,t={}){const{at:o=e.selection,deleteAll:n=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=Fa(e.children),r.forEach((t=>{const o=L(e,{at:[t]});o&&(delete e.children[o.id],delete e.blockEditorsMap[o.id])}));return Object.keys(e.children).forEach(((t,o)=>{e.children[t].meta.order=o})),e.children=Ua(e.children),e.applyChanges(),void e.emit("change",e.children)}if(n||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=J({id:q()}),o=Za(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=o,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:o,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!o)return;e.children=Fa(e.children);const[a]=o,l=Object.keys(e.children),c=l.find((t=>e.children[t].meta.order===a));if(l.forEach((t=>{const o=e.children[t];o.meta.order>a&&(o.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),i){const o=e.selection?e.selection[0]-1:0,n=L(e,{at:[o]});n&&e.focusBlock(n.id,{focusAt:t.focusAt})}}function $a(e,t){const o={};return t.forEach((t=>{const n=t.type;o[n]={hotkey:t.hotkey,type:n,getValue:()=>function(e,t){const o=Lo(e);if(!o)return null;const n=D.marks(o);return null==n?void 0:n[t]}(e,n),isActive:()=>Ha(e,n),toggle:()=>function(e,t){const o=Lo(e),n=Ha(e,t);o&&(n?D.removeMark(o,t):D.addMark(o,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,n),update:t=>function(e,t,o){const n=Lo(e);n&&n.selection&&j.isExpanded(n.selection)&&(D.addMark(n,t,o),e.applyChanges(),e.emit("change",e.children))}(e,n,t)}})),o}function Xa(e,t){const o={};return t.forEach(((t,n)=>{var r;const i=ri(t.elements),a=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.nodeType;if(!("inline"===a||"inlineVoid"===a)){const n={};Object.keys(t.elements).forEach((e=>{const o=yi(t.elements[e],["render"]);n[e]=o}));const{display:r,placeholder:i,align:a,shortcuts:l}=t.options||{};o[t.type]={type:t.type,elements:n,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,align:a,shortcuts:l},isActive:()=>{const o=L(e,{at:e.selection});return(null==o?void 0:o.type)===t.type},toggle:(t,o)=>{Wa(e,t)},create:o=>{!function(e,t,o){var n;e.children=Fa(e.children);const r=L(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==o?void 0:o.slate)||Lo(e,{at:[null==r?void 0:r.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],l=ni(a.elements),c=a.elements[l];if(!c)return;const s=Object.assign({nodeType:(null===(n=c.props)||void 0===n?void 0:n.nodeType)||"block"},c.props),d=G({id:q(),type:l,props:s});R.setNodes(i,d,{at:[0,0],match:e=>_.isElement(e),mode:"highest"}),(null==o?void 0:o.deleteText)&&R.delete(i,{at:[0,0]});const u=J({id:r.id,type:a.type,meta:{order:r.meta.order,depth:r.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),(null==o?void 0:o.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,o)},update:(t,o)=>{Ka(e,t,o)},updateElement:(t,o,n)=>{!function(e,t,o,n){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=Lo(e,{at:[r.meta.order]});i?D.withoutNormalizing(i,(()=>{const[t]=D.nodes(i,{at:[0],match:e=>_.isElement(e)&&e.type===o}),r=null==t?void 0:t[0],a=(null==r?void 0:r.props)||{},l={props:Object.assign(Object.assign({},a),n)};R.setNodes(i,l,{at:[0],match:e=>_.isElement(e)&&e.type===o,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,o,n)},delete:t=>{Ya(e,t)}}}})),o}function Za(e){return Va(e,O(A()))}function qa({type:e,hotkey:t,render:o}){return{type:e,hotkey:t,render:o}}const Ga=qa({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),Ja=(()=>{const e=q();return{[e]:J({id:e})}})(),Qa=new X,el=(e,t)=>Qa.on(e,t),tl=(e,t)=>Qa.once(e,t),ol=(e,t)=>Qa.off(e,t),nl=(e,t)=>Qa.emit(e,t);const rl=({editor:o,value:n,marks:r,plugins:i,autoFocus:a,className:l,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:y})=>{const g=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=d((()=>r?[Ga,...r]:[Ga]),[r]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>(o.applyChanges=g,o.readOnly=h||!1,v&&(o.formats=$a(o,v)),o.blocks=Xa(o,m),o.children=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(n)?n:Ja,o.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((o=>{const n=Za(e);t[o]=n})),t}(o),o.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var o,n,r,i;e.options&&Array.isArray(null===(o=e.options)||void 0===o?void 0:o.shortcuts)&&(null===(n=e.options)||void 0===n?void 0:n.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((o=>{t[o]=e})))})),t}(o),o.plugins=function(e){const t={},o={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var n;const r=e.elements[t],i=null===(n=r.props)||void 0===n?void 0:n.nodeType;"inline"!==i&&"inlineVoid"!==i||(o[t]=r)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const n=Object.assign(Object.assign({},e.elements),o);t[e.type]=Object.assign(Object.assign({},e),{elements:n})}})),t}(m),o.on=el,o.once=tl,o.off=ol,o.emit=nl,{editor:o,version:0})));return e(Gi,{children:e(P,Object.assign({editorState:b},{children:t(ai,Object.assign({tools:c},{children:[e(qi,{placeholder:p,marks:v,autoFocus:a,className:l,selectionBoxRoot:s,width:y}),u]}))}))})},il=Object.assign(Object.assign({},fi),{ExtendedBlockActions:({className:n,style:r,onClick:i,children:a})=>{const l=V(),[c,s]=f(!1),{refs:d,floatingStyles:u,context:p}=Ir({placement:"bottom-start",open:c,onOpenChange:s,middleware:[Un(),Fn(),zn(),kn(10)],whileElementsMounted:Pn}),{isMounted:h,styles:y}=Ur(p,{duration:100}),g=Object.assign(Object.assign({},y),u);return l?null:t(o,{children:[h&&e(ui,Object.assign({isOpen:!0,onClose:()=>s(!1),refs:d,style:g},{children:a})),e("button",Object.assign({type:"button",ref:d.setReference,className:`yoo-editor-absolute yoo-editor-right-[8px] yoo-editor-top-[8px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-between yoo-editor-z-10 yoo-editor-opacity-1 yoo-editor-bg-[#eee] yoo-editor-w-[22px] yoo-editor-h-[22px] yoo-editor-transition-opacity yoo-editor-duration-150 yoo-editor-ease-in yoo-editor-border-none yoo-editor-cursor-pointer yoo-editor-rounded-[2px] yoo-editor-p-[0_4px] ${n||""} yoopta-extended-block-actions`,onClick:()=>{null==i||i(),s(!0)},style:c?Object.assign(Object.assign({},r),{opacity:1}):r},{children:e(Zr,{})}))]})}});function al(e,t){const o=Object.keys(e.children),{type:n}=t||{},r=o.find((t=>e.children[t].type===n));return r?e.children[r]:null}function ll(e,t,o={}){try{const{focusAt:n,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=o,l=()=>{const r=o.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(T.isPoint(t))return t;if(S.isPath(t))return{path:t,offset:0};const[,o]=D.first(e,[0]);return{path:o||[0,0],offset:0}}(r,n);R.select(r,e),w.focus(r)}a&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>l()),i):l()}catch(e){}}function cl(e){return Array.from(new Set(e))}var sl={};!function(e,t){var o="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",i="[object Boolean]",a="[object Date]",l="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",y="[object String]",g="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",O="[object Uint8Array]",S="[object Uint8ClampedArray]",D="[object Uint16Array]",_="[object Uint32Array]",R=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[a]=A[w]=A[x]=A[k]=A[E]=A[C]=A[s]=A[d]=A[u]=A[p]=A[h]=A[y]=A[g]=A[O]=A[S]=A[D]=A[_]=!0,A["[object Error]"]=A[l]=A[v]=!1;var T="object"==typeof Y&&Y&&Y.Object===Object&&Y,M="object"==typeof self&&self&&self.Object===Object&&self,L=T||M||Function("return this")(),N=t&&!t.nodeType&&t,I=N&&e&&!e.nodeType&&e,P=I&&I.exports===N;function z(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function U(e,t,o,n){var r=-1,i=e?e.length:0;for(n&&i&&(o=e[++r]);++r<i;)o=t(o,e[r],r,e);return o}function H(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,o=Array(e.size);return e.forEach((function(e,n){o[++t]=[n,e]})),o}function K(e,t){return function(o){return e(t(o))}}function W(e){var t=-1,o=Array(e.size);return e.forEach((function(e){o[++t]=e})),o}var $,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=L["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,oe=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=P?L.Buffer:void 0,re=L.Symbol,ie=L.Uint8Array,ae=K(Object.getPrototypeOf,Object),le=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=ne?ne.isBuffer:void 0,fe=K(Object.keys,Object),pe=Pe(L,"DataView"),he=Pe(L,"Map"),ye=Pe(L,"Promise"),ge=Pe(L,"Set"),ve=Pe(L,"WeakMap"),me=Pe(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ye),ke=Ve(ge),Ee=Ve(ve),Ce=re?re.prototype:void 0,Oe=Ce?Ce.valueOf:void 0;function Se(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function De(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function _e(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function Re(e){this.__data__=new De(e)}function je(e,t){var o=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var o=-1,n=Array(e);++o<e;)n[o]=t(o);return n}(e.length,String):[],n=o.length,i=!!n;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||Ue(a,n))||o.push(a);return o}function Be(e,t,o){var n=e[t];ee.call(e,t)&&Ke(n,o)&&(void 0!==o||t in e)||(e[t]=o)}function Ae(e,t){for(var o=e.length;o--;)if(Ke(e[o][0],t))return o;return-1}function Te(e,t,o,n,f,v,j){var B;if(n&&(B=v?n(e,f,v,j):n(e)),void 0!==B)return B;if(!Ze(e))return e;var T=We(e);if(T){if(B=function(e){var t=e.length,o=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(o.index=e.index,o.input=e.input);return o}(e),!t)return function(e,t){var o=-1,n=e.length;t||(t=Array(n));for(;++o<n;)t[o]=e[o];return t}(e,B)}else{var M=Fe(e),L=M==l||M==c;if($e(e))return function(e,t){if(t)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}(e,t);if(M==u||M==r||L&&!v){if(H(e))return v?e:{};if(B=function(e){return"function"!=typeof e.constructor||He(e)?{}:(t=ae(e),Ze(t)?le(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,ze(e),t)}(e,function(e,t){return e&&Ne(t,qe(t),e)}(B,e))}else{if(!A[M])return v?e:{};B=function(e,t,o,n){var r=e.constructor;switch(t){case m:return Le(e);case i:case a:return new r(+e);case b:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}(e,n);case w:case x:case k:case E:case C:case O:case S:case D:case _:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}(e,n);case s:return function(e,t,o){var n=t?o(V(e),!0):V(e);return U(n,z,new e.constructor)}(e,n,o);case d:case y:return new r(e);case p:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,o){var n=t?o(W(e),!0):W(e);return U(n,F,new e.constructor)}(e,n,o);case g:return l=e,Oe?Object(Oe.call(l)):{}}var l}(e,M,Te,t)}}j||(j=new Re);var N=j.get(e);if(N)return N;if(j.set(e,B),!T)var I=o?function(e){return function(e,t,o){var n=t(e);return We(e)?n:function(e,t){for(var o=-1,n=t.length,r=e.length;++o<n;)e[r+o]=t[o];return e}(n,o(e))}(e,qe,ze)}(e):qe(e);return function(e,t){for(var o=-1,n=e?e.length:0;++o<n&&!1!==t(e[o],o,e););}(I||e,(function(r,i){I&&(r=e[i=r]),Be(B,i,Te(r,t,o,n,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||H(e)?oe:j).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,o,n){o||(o={});for(var r=-1,i=t.length;++r<i;){var a=t[r],l=n?n(o[a],e[a],a,o,e):void 0;Be(o,a,void 0===l?e[a]:l)}return o}function Ie(e,t){var o,n,r=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?r["string"==typeof t?"string":"hash"]:r.map}function Pe(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(o)?o:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===o?void 0:n}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?o:t,this},De.prototype.clear=function(){this.__data__=[]},De.prototype.delete=function(e){var t=this.__data__,o=Ae(t,e);return!(o<0)&&(o==t.length-1?t.pop():se.call(t,o,1),!0)},De.prototype.get=function(e){var t=this.__data__,o=Ae(t,e);return o<0?void 0:t[o][1]},De.prototype.has=function(e){return Ae(this.__data__,e)>-1},De.prototype.set=function(e,t){var o=this.__data__,n=Ae(o,e);return n<0?o.push([e,t]):o[n][1]=t,this},_e.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||De),string:new Se}},_e.prototype.delete=function(e){return Ie(this,e).delete(e)},_e.prototype.get=function(e){return Ie(this,e).get(e)},_e.prototype.has=function(e){return Ie(this,e).has(e)},_e.prototype.set=function(e,t){return Ie(this,e).set(e,t),this},Re.prototype.clear=function(){this.__data__=new De},Re.prototype.delete=function(e){return this.__data__.delete(e)},Re.prototype.get=function(e){return this.__data__.get(e)},Re.prototype.has=function(e){return this.__data__.has(e)},Re.prototype.set=function(e,t){var o=this.__data__;if(o instanceof De){var n=o.__data__;if(!he||n.length<199)return n.push([e,t]),this;o=this.__data__=new _e(n)}return o.set(e,t),this};var ze=de?K(de,Object):function(){return[]},Fe=function(e){return te.call(e)};function Ue(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&Fe(new pe(new ArrayBuffer(1)))!=b||he&&Fe(new he)!=s||ye&&Fe(ye.resolve())!=f||ge&&Fe(new ge)!=h||ve&&Fe(new ve)!=v)&&(Fe=function(e){var t=te.call(e),o=t==u?e.constructor:void 0,n=o?Ve(o):void 0;if(n)switch(n){case be:return b;case we:return s;case xe:return f;case ke:return h;case Ee:return v}return t});var We=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=Ze(e)?te.call(e):"";return t==l||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!He(e))return fe(e);var t=[];for(var o in Object(e))ee.call(e,o)&&"constructor"!=o&&t.push(o);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}({get exports(){return sl},set exports(e){sl=e}},sl);var dl=sl;function ul(e,t={}){const{blockId:o,focus:n}=t;if(!o&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(o&&(r=e.children[o],!r))throw new Error(`Block not with blockId: ${o} found`);if(t.at&&(r=L(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=Fa(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(a=r,"function"==typeof window.structuredClone?window.structuredClone(a):dl(a));var a;const l=Za(e);i.id=q(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=l;const c=i.id;e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(c,{waitExecution:!0})}function fl(e,t){w.blur(t),w.deselect(t),R.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const pl=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,o={}){e.children=Fa(e.children);const{at:n=null,focus:r=!1,slate:i=null}=o,a=L(e),l=n,c={id:q(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=D.string(i,i.selection.anchor.path);s=D.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=Za(e);e.blockEditorsMap[c.id]=d,s&&a&&(c.meta.order=a.meta.order,a.meta.order+=1),e.children[c.id]=c;const u=null==a?void 0:a.id;e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,o={}){e.children=Fa(e.children);const{at:n,focus:r}=o;let i=n||[0];const a=L(e),l=Lo(e);let c=!1,s=!1;if(l&&l.selection){const t=S.parent(l.selection.anchor.path),o=D.string(l,t).trim(),n=D.isStart(l,l.selection.anchor,t);c=""===o&&n,s=!n||o.length>0,w.blur(l),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,o)=>{const n={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+o})};d.push(n.meta.order),e.children[n.id]=n;const r=Za(e);e.blockEditorsMap[n.id]=r})),a&&c){const t=a.meta.order;delete e.children[a.id],delete e.blockEditorsMap[a.id],Object.keys(e.children).forEach((o=>{const n=e.children[o];n.meta.order>t&&(n.meta.order-=1)}))}e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>Ya(e,...t),duplicateBlock:(...t)=>ul(e,...t),toggleBlock:(...t)=>Wa(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=Fa(e.children);const n=L(e);n&&(n.meta.depth=n.meta.depth+1,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=Fa(e.children);const n=L(e);n&&(n.meta.depth=0===n.meta.depth?0:n.meta.depth-1,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,o){e.children=Fa(e.children);const[n]=o,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===n)),a=r.meta.order<i.meta.order,l=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:l&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=n,r.meta.depth=i.meta.depth,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>ll(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>Ka(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:o,focus:n=!0}=t,r=L(e);o&&o.selection&&r&&D.withoutNormalizing(o,(()=>{e.children=Fa(e.children);const t=S.parent(o.selection.anchor.path);R.splitNodes(o,{at:o.selection,match:e=>_.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=o.children.slice()[i];R.removeNodes(o,{at:[i],match:e=>_.isElement(e),mode:"highest"});const l={id:q(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=Za(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=Ua(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,o={}){const{applyChanges:n=!0}=o;e.selection=t,n&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,o={}){const{only:n=!1,allSelected:r=!1}=o,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(n)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=cl(t)}else e.selectedBlocks=cl(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var o;const n=null!==(o=t.slate)&&void 0!==o?o:Lo(e);if(!n)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>fl(e,n)),i):(fl(e,n),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/#yoopta-editor *,#yoopta-editor :after,#yoopta-editor :before{border:0 solid #e5e7eb;box-sizing:border-box}#yoopta-editor :after,#yoopta-editor :before{--tw-content:""}#yoopta-editor,:host{-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}#yoopta-editor{line-height:inherit;margin:0}#yoopta-editor hr{border-top-width:1px;color:inherit;height:0}#yoopta-editor abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#yoopta-editor h1,#yoopta-editor h2,#yoopta-editor h3,#yoopta-editor h4,#yoopta-editor h5,#yoopta-editor h6{font-size:inherit;font-weight:inherit}#yoopta-editor a{color:inherit;text-decoration:inherit}#yoopta-editor b,#yoopta-editor strong{font-weight:bolder}#yoopta-editor code,#yoopta-editor kbd,#yoopta-editor pre,#yoopta-editor 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}#yoopta-editor small{font-size:80%}#yoopta-editor sub,#yoopta-editor sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#yoopta-editor sub{bottom:-.25em}#yoopta-editor sup{top:-.5em}#yoopta-editor table{border-collapse:collapse;border-color:inherit;text-indent:0}#yoopta-editor button,#yoopta-editor input,#yoopta-editor optgroup,#yoopta-editor select,#yoopta-editor 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}#yoopta-editor button,#yoopta-editor select{text-transform:none}#yoopta-editor [type=button],#yoopta-editor [type=reset],#yoopta-editor [type=submit],#yoopta-editor button{-webkit-appearance:button;background-color:transparent;background-image:none}#yoopta-editor :-moz-focusring{outline:auto}#yoopta-editor :-moz-ui-invalid{box-shadow:none}#yoopta-editor progress{vertical-align:baseline}#yoopta-editor ::-webkit-inner-spin-button,#yoopta-editor ::-webkit-outer-spin-button{height:auto}#yoopta-editor [type=search]{-webkit-appearance:textfield;outline-offset:-2px}#yoopta-editor ::-webkit-search-decoration{-webkit-appearance:none}#yoopta-editor ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}#yoopta-editor summary{display:list-item}#yoopta-editor blockquote,#yoopta-editor dd,#yoopta-editor dl,#yoopta-editor figure,#yoopta-editor h1,#yoopta-editor h2,#yoopta-editor h3,#yoopta-editor h4,#yoopta-editor h5,#yoopta-editor h6,#yoopta-editor hr,#yoopta-editor p,#yoopta-editor pre{margin:0}#yoopta-editor fieldset{margin:0;padding:0}#yoopta-editor legend{padding:0}#yoopta-editor menu,#yoopta-editor ol,#yoopta-editor ul{list-style:none;margin:0;padding:0}#yoopta-editor dialog{padding:0}#yoopta-editor textarea{resize:vertical}#yoopta-editor input::-moz-placeholder,#yoopta-editor textarea::-moz-placeholder{color:#9ca3af;opacity:1}#yoopta-editor input::placeholder,#yoopta-editor textarea::placeholder{color:#9ca3af;opacity:1}#yoopta-editor [role=button],#yoopta-editor button{cursor:pointer}#yoopta-editor :disabled{cursor:default}#yoopta-editor audio,#yoopta-editor canvas,#yoopta-editor embed,#yoopta-editor iframe,#yoopta-editor img,#yoopta-editor object,#yoopta-editor svg,#yoopta-editor video{display:block;vertical-align:middle}#yoopta-editor img,#yoopta-editor video{height:auto;max-width:100%}#yoopta-editor [hidden]{display:none}#yoopta-editor *,#yoopta-editor :after,#yoopta-editor :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: }#yoopta-editor ::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: }#yoopta-editor .yoo-editor-pointer-events-none{pointer-events:none}#yoopta-editor .yoo-editor-absolute{position:absolute}#yoopta-editor .yoo-editor-relative{position:relative}#yoopta-editor .-yoo-editor-left-\\[50px\\]{left:-50px}#yoopta-editor .yoo-editor-left-0{left:0}#yoopta-editor .yoo-editor-right-\\[8px\\]{right:8px}#yoopta-editor .yoo-editor-top-0{top:0}#yoopta-editor .yoo-editor-top-\\[2px\\]{top:2px}#yoopta-editor .yoo-editor-top-\\[8px\\]{top:8px}#yoopta-editor .yoo-editor-z-10{z-index:10}#yoopta-editor .yoo-editor-z-\\[100\\]{z-index:100}#yoopta-editor .yoo-editor-z-\\[90\\]{z-index:90}#yoopta-editor .yoo-editor-m-\\[0_1px\\]{margin:0 1px}#yoopta-editor .yoo-editor-mx-\\[4px\\]{margin-left:4px;margin-right:4px}#yoopta-editor .yoo-editor-my-\\[4px\\]{margin-bottom:4px;margin-top:4px}#yoopta-editor .yoo-editor-mb-\\[1px\\]{margin-bottom:1px}#yoopta-editor .yoo-editor-mr-2{margin-right:.5rem}#yoopta-editor .yoo-editor-mt-\\[2px\\]{margin-top:2px}#yoopta-editor .yoo-editor-flex{display:flex}#yoopta-editor .yoo-editor-h-4{height:1rem}#yoopta-editor .yoo-editor-h-\\[1px\\]{height:1px}#yoopta-editor .yoo-editor-h-\\[22px\\]{height:22px}#yoopta-editor .yoo-editor-h-\\[24px\\]{height:24px}#yoopta-editor .yoo-editor-h-full{height:100%}#yoopta-editor .yoo-editor-w-4{width:1rem}#yoopta-editor .yoo-editor-w-\\[18px\\]{width:18px}#yoopta-editor .yoo-editor-w-\\[22px\\]{width:22px}#yoopta-editor .yoo-editor-w-\\[24px\\]{width:24px}#yoopta-editor .yoo-editor-w-auto{width:auto}#yoopta-editor .yoo-editor-w-full{width:100%}#yoopta-editor .yoo-editor-min-w-\\[200px\\]{min-width:200px}#yoopta-editor .yoo-editor-cursor-default{cursor:default}#yoopta-editor .yoo-editor-cursor-pointer{cursor:pointer}#yoopta-editor .yoo-editor-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .yoo-editor-flex-col{flex-direction:column}#yoopta-editor .yoo-editor-items-center{align-items:center}#yoopta-editor .yoo-editor-justify-start{justify-content:flex-start}#yoopta-editor .yoo-editor-justify-center{justify-content:center}#yoopta-editor .yoo-editor-justify-between{justify-content:space-between}#yoopta-editor .yoo-editor-overflow-hidden{overflow:hidden}#yoopta-editor .yoo-editor-rounded{border-radius:.25rem}#yoopta-editor .yoo-editor-rounded-\\[2px\\]{border-radius:2px}#yoopta-editor .yoo-editor-rounded-\\[6px\\]{border-radius:6px}#yoopta-editor .yoo-editor-rounded-md{border-radius:.375rem}#yoopta-editor .yoo-editor-rounded-sm{border-radius:.125rem}#yoopta-editor .yoo-editor-border{border-width:1px}#yoopta-editor .yoo-editor-border-none{border-style:none}#yoopta-editor .yoo-editor-bg-\\[\\#2383e224\\]{background-color:#2383e224}#yoopta-editor .yoo-editor-bg-\\[\\#37352f14\\]{background-color:#37352f14}#yoopta-editor .yoo-editor-bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-inherit{background-color:inherit}#yoopta-editor .yoo-editor-bg-transparent{background-color:transparent}#yoopta-editor .yoo-editor-p-0{padding:0}#yoopta-editor .yoo-editor-p-\\[0_4px\\]{padding:0 4px}#yoopta-editor .yoo-editor-px-0{padding-left:0;padding-right:0}#yoopta-editor .yoo-editor-px-2{padding-left:.5rem;padding-right:.5rem}#yoopta-editor .yoo-editor-px-\\[2px\\]{padding-left:2px;padding-right:2px}#yoopta-editor .yoo-editor-py-0{padding-bottom:0;padding-top:0}#yoopta-editor .yoo-editor-py-1{padding-bottom:.25rem;padding-top:.25rem}#yoopta-editor .yoo-editor-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#yoopta-editor .yoo-editor-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}#yoopta-editor .yoo-editor-text-sm{font-size:.875rem;line-height:1.25rem}#yoopta-editor .yoo-editor-leading-\\[120\\%\\]{line-height:120%}#yoopta-editor .yoo-editor-text-\\[rgba\\(55\\,53\\,47\\,0\\.35\\)\\]{color:rgba(55,53,47,.35)}#yoopta-editor .yoo-editor-opacity-0{opacity:0}#yoopta-editor .yoo-editor-opacity-100{opacity:1}#yoopta-editor .yoo-editor-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#yoopta-editor .yoo-editor-outline-none{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .yoo-editor-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-duration-150{transition-duration:.15s}#yoopta-editor .yoo-editor-duration-\\[180ms\\]{transition-duration:.18s}#yoopta-editor .yoo-editor-ease-\\[cubic-bezier\\(0\\.4\\,0\\,0\\.2\\,1\\)\\]{transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}#yoopta-editor ::-moz-selection{background:#c6ddf8}#yoopta-editor ::selection{background:#c6ddf8}#yoopta-editor #yoopta-editor{height:auto;min-width:400px}#yoopta-editor .yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .hover\\:yoo-editor-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}#yoopta-editor .focus\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:focus,#yoopta-editor .hover\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:hover{background-color:rgba(55,54,47,.08)}#yoopta-editor .focus\\:yoo-editor-outline-none:focus{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .focus-visible\\:yoo-editor-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .active\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:active{background-color:rgba(55,54,47,.08)}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-pointer-events-none[data-disabled]{pointer-events:none}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-opacity-50[data-disabled]{opacity:.5}#yoopta-editor .data-\\[hovered-state\\=\\"true\\"\\]\\:yoo-editor-opacity-100[data-hovered-state=true]{opacity:1}');export{Ai as HOTKEYS,il as UI,M as YooptaPlugin,J as buildBlockData,G as buildBlockElement,pl as createYooptaEditor,qa as createYooptaMark,rl as default,L as findPluginBlockBySelectionPath,al as findPluginBlockByType,Lo as findSlateBySelectionPath,q as generateId,ri as getRootBlockElement,ni as getRootBlockElementType,F as useBlockData,W as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,H as useYooptaPlugin,K as useYooptaPluginOptions,V as useYooptaReadOnly,li as useYooptaTools};