A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
publish changes
ammarahm-edceb49b88bd5d
diff --git a/apps/mobile/web.bundle/asset-manifest.json b/apps/mobile/web.bundle/asset-manifest.jsonindex 3f05d383f..6473e4f5b 100644--- a/apps/mobile/web.bundle/asset-manifest.json+++ b/apps/mobile/web.bundle/asset-manifest.json@@ -2,7 +2,7 @@"files": {"static/js/0.f9fcc7b4.chunk.js": "./static/js/0.f9fcc7b4.chunk.js","main.css": "./static/css/main.ccbe10ee.chunk.css",- "main.js": "./static/js/main.e08a2ce0.chunk.js",+ "main.js": "./static/js/main.3653d8a7.chunk.js","runtime-main.js": "./static/js/runtime-main.46e27fff.js","static/js/3.98236456.chunk.js": "./static/js/3.98236456.chunk.js","static/js/4.a8943a18.chunk.js": "./static/js/4.a8943a18.chunk.js",@@ -16,6 +16,6 @@"static/js/runtime-main.46e27fff.js","static/js/3.98236456.chunk.js","static/css/main.ccbe10ee.chunk.css",- "static/js/main.e08a2ce0.chunk.js"+ "static/js/main.3653d8a7.chunk.js"]}\ No newline at end of filediff --git a/apps/mobile/web.bundle/index.html b/apps/mobile/web.bundle/index.htmlindex d7f566264..02a04fab1 100644--- a/apps/mobile/web.bundle/index.html+++ b/apps/mobile/web.bundle/index.html@@ -1 +1 @@-<!doctype html><html style="height:100%" lang="en"><head><meta charset="utf-8"/><link rel="icon" href="favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="theme-color" content="#000000"/><link href="fonts.css" rel="stylesheet"/><style>body{height:100%;font-family:"Open Sans"}p{font-family:"Open Sans"}::selection{color:#fff;background-color:var(--nn_accent)}::placeholder{color:var(--nn_placeholder)}p.is-editor-empty:first-child::before{color:var(--nn_placeholder)!important}h1,h2,h3,h4,h5,h6{font-family:"Open Sans";color:var(--nn_heading)}#root{height:100%;caret-color:var(--nn_accent);display:flex}</style><meta name="description" content="Notesnook editor for mobile"/><link rel="manifest" href="manifest.json"/><title>Notesnook editor</title><link href="./static/css/main.ccbe10ee.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,a,i=t[0],c=t[1],f=t[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==o[c]&&(n=!1)}n&&(u.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={2:0},u=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{0:"f9fcc7b4",4:"a8943a18",5:"b52ad09f"}[e]+".chunk.js"}(e);var c=new Error;u=function(t){i.onerror=i.onload=null,clearTimeout(f);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,r[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="./",a.oe=function(e){throw console.error(e),e};var i=this.webpackJsonptiptap=this.webpackJsonptiptap||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var f=0;f<i.length;f++)t(i[f]);var l=c;r()}([])</script><script src="./static/js/3.98236456.chunk.js"></script><script src="./static/js/main.e08a2ce0.chunk.js"></script></body></html>\ No newline at end of file+<!doctype html><html style="height:100%" lang="en"><head><meta charset="utf-8"/><link rel="icon" href="favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="theme-color" content="#000000"/><link href="fonts.css" rel="stylesheet"/><style>body{height:100%;font-family:"Open Sans"}p{font-family:"Open Sans"}::selection{color:#fff;background-color:var(--nn_accent)}::placeholder{color:var(--nn_placeholder)}p.is-editor-empty:first-child::before{color:var(--nn_placeholder)!important}h1,h2,h3,h4,h5,h6{font-family:"Open Sans";color:var(--nn_heading)}#root{height:100%;caret-color:var(--nn_accent);display:flex}</style><meta name="description" content="Notesnook editor for mobile"/><link rel="manifest" href="manifest.json"/><title>Notesnook editor</title><link href="./static/css/main.ccbe10ee.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,a,i=t[0],c=t[1],f=t[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==o[c]&&(n=!1)}n&&(u.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={2:0},u=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{0:"f9fcc7b4",4:"a8943a18",5:"b52ad09f"}[e]+".chunk.js"}(e);var c=new Error;u=function(t){i.onerror=i.onload=null,clearTimeout(f);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,r[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="./",a.oe=function(e){throw console.error(e),e};var i=this.webpackJsonptiptap=this.webpackJsonptiptap||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var f=0;f<i.length;f++)t(i[f]);var l=c;r()}([])</script><script src="./static/js/3.98236456.chunk.js"></script><script src="./static/js/main.3653d8a7.chunk.js"></script></body></html>\ No newline at end of filediff --git a/apps/mobile/web.bundle/static/js/main.3653d8a7.chunk.js b/apps/mobile/web.bundle/static/js/main.3653d8a7.chunk.jsnew file mode 100644index 000000000..dda5b293d--- /dev/null+++ b/apps/mobile/web.bundle/static/js/main.3653d8a7.chunk.js@@ -0,0 +1 @@+(this.webpackJsonptiptap=this.webpackJsonptiptap||[]).push([[1],{126:function(e,t,n){"use strict";(function(e){var i=n(13),r=n(10),o=n(9),a=n(113),c=n(59),l=n(1),s=n(139),u=n(141),d=n(95),f=n(23),p=n(142),b=n(152),m=n(153),h=n(154),g=n(0),v=function(){var t,n,v=Object(u.a)(),j=Object(l.useState)(0),O=Object(o.a)(j,2),x=O[0],y=O[1],C=Object(d.a)((function(e){return e.colors})),k=Object(l.useState)({readonly:e.readonly||v.readonly,noHeader:e.noHeader||v.noHeader,noToolbar:e.noToolbar||v.noToolbar||e.readonly||v.readonly}),w=Object(o.a)(k,2),S=w[0],A=w[1],L=Object(l.useRef)(null),R=Object(l.useRef)(null),T=Object(l.useState)(!1),P=Object(o.a)(T,2),E=P[0],M=P[1],I=Object(a.useTheme)({accent:"green",scale:1,theme:null!==C&&void 0!==C&&C.night?"dark":"light"}),D=Object(a.useTheme)({accent:"green",scale:1,theme:null!==C&&void 0!==C&&C.night?"dark":"light"});D.space=[0,10,12,20],I.space=[0,10,12,18],I.space.small="10px",I.buttons.menuitem=Object(r.a)(Object(r.a)({},I.buttons.menuitem),{},{height:"50px",paddingX:"20px",borderBottomWidth:0}),I.iconSizes={big:20,medium:18,small:18},I.fontSizes=Object(r.a)(Object(r.a)({},I.fontSizes),{},{subBody:"0.8rem",body:"0.9rem"}),I.radii=Object(r.a)(Object(r.a)({},I.radii),{},{small:5}),I.buttons.menuitem=Object(r.a)(Object(r.a)({},I.buttons.menuitem),{},{px:5,height:"45px"}),Object(c.d)({claims:{premium:v.premium},onPermissionDenied:function(){post(f.a.pro)}});var z=Object(c.e)({onUpdate:function(t){var n=t.editor;e.editorController.contentChange(n)},onSelectionUpdate:function(t){e.editorController.selectionChange(t.editor)},onOpenAttachmentPicker:function(t,n){return e.editorController.openFilePicker(n),!0},onDownloadAttachment:function(t,n){return e.editorController.downloadAttachment(n),!0},theme:D,element:E&&L.current||void 0,editable:!S.readonly,editorProps:{editable:function(){return!S.readonly}},content:null===(t=e.editorController)||void 0===t||null===(n=t.content)||void 0===n?void 0:n.current,isMobile:!0},[E,S.readonly,x]),N=Object(s.a)(z,(function(){y((function(e){return e+1})),N.setTitlePlaceholder("Note title")})),H=Object(l.useRef)(N);return globalThis.editorController=N,globalThis.editor=z,Object(l.useEffect)((function(){A(Object(r.a)({},v))}),[v]),Object(l.useLayoutEffect)((function(){M(!0)}),[]),Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)("div",{style:{display:"flex",flex:1,flexDirection:"column",maxWidth:"100vw",marginBottom:"5px"},children:[Object(g.jsx)(p.a,{hasRedo:(null===z||void 0===z?void 0:z.can().redo())||!1,hasUndo:(null===z||void 0===z?void 0:z.can().undo())||!1,settings:v,noHeader:S.noHeader||!1}),Object(g.jsxs)("div",{onScroll:N.scroll,ref:R,style:{overflowY:"scroll",flexDirection:"column",height:"100%",flexGrow:1,flexShrink:1,display:"flex"},children:[S.noHeader?null:Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)(m.a,{}),Object(g.jsx)(h.a,{titlePlaceholder:N.titlePlaceholder,readonly:v.readonly,controller:H,title:N.title}),Object(g.jsx)(b.a,{container:R,editor:z})]}),Object(g.jsx)("div",{ref:L,style:{padding:12,paddingTop:0,color:null===C||void 0===C?void 0:C.pri,flex:1}}),Object(g.jsx)("div",{onDoubleClick:function(){var e,t,n=null===(e=globalThis.editor)||void 0===e?void 0:e.state.doc.content.size;n&&(null===(t=globalThis.editor)||void 0===t||t.chain().focus().insertContentAt(n-1,"<p></p>",{updateSelection:!0}).run())},style:{flexShrink:0,height:150,width:"100%"}})]}),S.noToolbar||!E?null:Object(g.jsx)(c.b,{sx:{pl:"10px",pt:"5px",minHeight:45},theme:I,editor:z,location:"bottom",tools:Object(i.a)(v.tools)})]})})};t.a=function(){return Object(g.jsx)(c.a,{children:Object(g.jsx)(v,{})})}}).call(this,n(51))},139:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(9),r=n(1),o=n(95),a=n(23);function c(t,n){var c=Object(r.useState)(""),l=Object(i.a)(c,2),s=l[0],u=l[1],d=Object(r.useState)("Note title"),f=Object(i.a)(d,2),p=f[0],b=f[1],m=Object(r.useRef)(null),h=Object(r.useRef)({selectionChange:null,change:null}),g=Object(r.useCallback)((function(e){}),[]),v=Object(r.useCallback)((function(e){var t;e&&(g(e),h.current.change=Object(a.d)((function(){m.current=e.getHTML(),Object(a.c)(a.a.content,m.current)}),300,null===(t=h.current)||void 0===t?void 0:t.change))}),[g]),j=Object(r.useCallback)((function(e){}),[]),O=Object(r.useCallback)((function(t){if(console.log(t),"{"===(null===t||void 0===t?void 0:t.data[0])){var i=JSON.parse(t.data),r=i.type,c=i.value;switch(e.sessionId=i.sessionId,r){case"native:html":m.current=c,n();break;case"native:theme":o.a.getState().setColors(i.value);break;case"native:title":u(c);break;case"native:titleplaceholder":b(c)}Object(a.c)(r)}}),[n]);Object(r.useEffect)((function(){if(Object(a.b)()){var e=navigator.vendor.match(/apple/i),t=document;return e&&(t=window),t.addEventListener("message",O),function(){t.removeEventListener("message",O)}}}),[O]);var x=Object(r.useCallback)((function(e){Object(a.c)(a.a.filepicker,e)}),[]),y=Object(r.useCallback)((function(e){alert("downloadAttachment"+e.hash),Object(a.c)(a.a.download,e)}),[]);return{contentChange:v,selectionChange:g,titleChange:function(e){Object(a.c)(a.a.title,e)},scroll:j,title:s,setTitle:u,titlePlaceholder:p,setTitlePlaceholder:b,openFilePicker:x,downloadAttachment:y,content:m,onUpdate:function(){n()}}}}).call(this,n(51))},141:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var i=n(9),r=n(10),o=n(59),a=n(1),c=localStorage.getItem("editorSettings"),l={fullscreen:!1,deviceMode:"mobile",premium:!1,tools:Object(o.c)().default,noToolbar:e.noToolbar,noHeader:e.noHeader,readonly:e.readonly};e.settingsController={update:function(t){var n=t;JSON.stringify(n)!==JSON.stringify(e.settingsController.previous)&&(e.settingsController.set&&e.settingsController.set(n),t?localStorage.setItem("editorSettings",JSON.stringify(n)):localStorage.removeItem("editorSettings"),settingsController.previous=Object(r.a)({},n))},previous:c?JSON.parse(c):Object(r.a)({},l)};var s=function(){var t=Object(a.useState)(Object(r.a)({},e.settingsController.previous)),n=Object(i.a)(t,2),o=n[0],c=n[1];return e.settingsController.set=c,o}}).call(this,n(51))},142:function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var i=n(143),r=n.n(i),o=n(144),a=n.n(o),c=n(145),l=n.n(c),s=n(146),u=n.n(s),d=n(147),f=n.n(d),p=n(148),b=n.n(p),m=n(149),h=n.n(m),g=n(150),v=n.n(g),j=(n(1),n(151)),O=n(23),x=n(56),y=n.n(x),C=n(0),k=function(e){var t=e.onPress,n=e.children,i=e.style,r=e.preventDefault,o=void 0===r||r;return Object(C.jsx)("button",{className:y.a.btn_header,style:i,onMouseDown:function(e){o&&e.preventDefault(),t()},children:n})};function w(e){var t=e.noHeader,n=e.settings,i=e.hasUndo,o=e.hasRedo,c=Object(j.a)();return Object(C.jsx)("div",{style:{display:"flex",alignItems:"center",height:"".concat(t?c.top:50+c.top,"px"),backgroundColor:"var(--nn_bg)",position:"sticky",width:"100vw"},children:t?null:Object(C.jsxs)("div",{style:{display:"flex",width:"100%",justifyContent:"space-between",flexDirection:"row",paddingTop:c.top,height:50,alignItems:"center"},children:["mobile"===n.deviceMode||n.fullscreen?Object(C.jsx)(k,{onPress:function(){post(O.a.back)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginLeft:6,width:40,height:40,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",position:"relative"},children:Object(C.jsx)(r.a,{size:27,style:{position:"absolute"},color:"var(--nn_pri)"})}):Object(C.jsx)("div",{}),Object(C.jsxs)("div",{style:{display:"flex",alignItems:"center",flexDirection:"row"},children:[Object(C.jsx)(k,{onPress:function(){var e;null===(e=editor)||void 0===e||e.commands.undo()},style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(f.a,{color:i?"var(--nn_pri)":"var(--nn_nav)",size:25,style:{position:"absolute"}})}),Object(C.jsx)(k,{onPress:function(){var e;null===(e=editor)||void 0===e||e.commands.redo()},style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(b.a,{color:o?"var(--nn_pri)":"var(--nn_nav)",size:25,style:{position:"absolute"}})}),!n.premium&&Object(C.jsx)(k,{onPress:function(){post(O.a.pro)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(l.a,{size:25,style:{position:"absolute"},color:"orange"})}),Object(C.jsx)(k,{onPress:function(){var e;null===(e=editor)||void 0===e||e.commands.startSearch()},style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(v.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})}),Object(C.jsx)(k,{onPress:function(){post(O.a.monograph)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(a.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})}),"mobile"===n.deviceMode||n.fullscreen?null:Object(C.jsx)(k,{onPress:function(){post(O.a.fullscreen)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(h.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})}),Object(C.jsx)(k,{onPress:function(){post(O.a.properties)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:12,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(u.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})})]})]})})}},151:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(9),r=n(1),o=localStorage.getItem("safeAreaInsets"),a=o?JSON.parse(o):{top:0,bottom:0,left:0,right:0};e.safeAreaController={update:function(e){safeAreaController.set&&safeAreaController.set(e),safeAreaController.previous=e,localStorage.setItem("safeAreaInsets",JSON.stringify(e))},reset:function(){safeAreaController.set&&safeAreaController.set(a)},previous:a};var c=function(){var t=Object(r.useState)(e.safeAreaController.previous),n=Object(i.a)(t,2),o=n[0],a=n[1];return e.safeAreaController.set=a,o}}).call(this,n(51))},152:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n(9),r=n(1),o=n.n(r),a=n(0);function c(e){var t,n,c=e.editor,l=e.container,s=Object(r.useState)({date:"",saved:""}),u=Object(i.a)(s,2),d=u[0],f=u[1],p=Object(r.useState)(!1),b=Object(i.a)(p,2),m=b[0],h=b[1],g=Object(r.useRef)(0),v=Object(r.useRef)(0),j=(null===c||void 0===c||null===(t=c.storage)||void 0===t||null===(n=t.characterCount)||void 0===n?void 0:n.words())+" words",O=Object(r.useRef)({set:f});globalThis.statusBar=O;var x=o.a.useCallback((function(e){var t=e.target.scrollTop;Date.now()-v.current<300||(t>g.current?h(!1):h(!0),v.current=Date.now(),g.current=t)}),[]);Object(r.useEffect)((function(){var e=l.current;return null===e||void 0===e||e.addEventListener("scroll",x),function(){null===e||void 0===e||e.removeEventListener("scroll",x)}}),[x,l]);var y={marginTop:0,marginBottom:0,fontSize:"12px",color:"var(--nn_icon)",marginRight:8};return Object(a.jsxs)("div",{style:{flexDirection:"row",display:"flex",height:m?20:15,paddingRight:12,paddingLeft:12,position:m?"sticky":"relative",top:0,backgroundColor:"var(--nn_bg)",zIndex:1},children:[Object(a.jsx)("p",{style:y,children:j}),Object(a.jsx)("p",{style:y,children:d.date}),Object(a.jsx)("p",{style:y,children:d.saved})]})}},153:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var i=n(9),r=n(1),o=n(23),a=n(56),c=n.n(a),l=n(0);function s(){var t=Object(r.useState)([]),n=Object(i.a)(t,2),a=n[0],s=n[1],u=Object(r.useRef)({setTags:s});e.editorTags=u;var d=function(){var e,t;null!==(e=editor)&&void 0!==e&&e.isFocused&&(editor.commands.blur(),null===(t=editorTitle.current)||void 0===t||t.blur());post(o.a.newtag)};return Object(l.jsxs)("div",{style:{padding:"0px 12px",display:"flex",alignItems:"center",marginTop:10},children:[Object(l.jsxs)("button",{className:c.a.btn,onMouseUp:function(e){e.preventDefault(),d()},onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(e){e.preventDefault(),d()},style:{borderWidth:0,backgroundColor:"var(--nn_nav)",marginRight:5,borderRadius:100,padding:"0px 10px",fontFamily:"Open Sans",display:"flex",alignItems:"center",height:"30px"},children:[0===a.length?Object(l.jsx)("p",{style:{marginRight:4,fontSize:13,color:"var(--nn_icon)",userSelect:"none"},children:"Add a tag"}):null,Object(l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"20",height:"20",viewBox:"0 0 24 24",children:Object(l.jsx)("path",{fill:"var(--nn_accent)",d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"})})]}),a.map((function(e){return Object(l.jsxs)("button",{className:c.a.btn,style:{borderWidth:0,backgroundColor:"var(--nn_nav)",marginRight:5,borderRadius:100,padding:"0px 10px",height:"30px",fontFamily:"Open Sans",fontSize:13,color:"var(--nn_icon)"},onMouseUp:function(t){t.preventDefault(),post(o.a.tag,e.title)},onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(t){t.preventDefault(),post(o.a.tag,e.title)},children:["#",e.alias]})}))]})}}).call(this,n(51))},154:function(e,t,n){"use strict";(function(e){var i=n(1),r=n.n(i),o=n(56),a=n.n(o),c=n(0);function l(t){var n=t.controller,r=t.title,o=t.titlePlaceholder,l=t.readonly,s=Object(i.useRef)(null),u=Object(i.useRef)(!0);return e.editorTitle=s,Object(i.useEffect)((function(){s.current&&(u.current=!1,s.current.value=r,u.current=!0)}),[r]),Object(c.jsx)("input",{ref:s,className:a.a.titleBar,contentEditable:!l,disabled:l,style:{height:50,fontSize:27,width:"100%",boxSizing:"border-box",borderWidth:0,paddingRight:12,paddingLeft:12,fontWeight:600,fontFamily:"Open Sans",backgroundColor:"transparent",color:"var(--nn_heading)"},onChange:function(e){var t;u.current&&(null===(t=n.current)||void 0===t||t.titleChange(e.target.value))},placeholder:o})}t.a=r.a.memo(l,(function(e,t){return e.title===t.title&&(e.titlePlaceholder===t.titlePlaceholder&&e.readonly===t.readonly)}))}).call(this,n(51))},164:function(e,t,n){},165:function(e,t,n){},197:function(e,t,n){},198:function(e,t,n){},199:function(e,t,n){},200:function(e,t,n){},201:function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),o=n(38),a=n.n(o),c=(n(164),n(165),n(126)),l=n(0);var s=function(){return Object(l.jsx)(c.a,{})},u=function(e){e&&e instanceof Function&&n.e(5).then(n.bind(null,210)).then((function(t){var n=t.getCLS,i=t.getFID,r=t.getFCP,o=t.getLCP,a=t.getTTFB;n(e),i(e),r(e),o(e),a(e)}))};n(197),n(198),n(199),n(200);a.a.render(Object(l.jsx)(r.a.StrictMode,{children:Object(l.jsx)(s,{})}),document.getElementById("root")),u()},23:function(e,t,n){"use strict";(function(e){n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var i=function(e,t,n){return n&&(clearTimeout(n),n=null),n=setTimeout(e,t)},r={selection:"editor-event:selection",content:"editor-event:content",title:"editor-event:title",scroll:"editor-event:scroll",history:"editor-event:history",newtag:"editor-event:newtag",tag:"editor-event:tag",filepicker:"editor-event:picker",download:"editor-event:download-attachment",logger:"native:logger",back:"editor-event:back",pro:"editor-event:pro",monograph:"editor-event:monograph",properties:"editor-event:properties",fullscreen:"editor-event:fullscreen"};function o(){return!!window.ReactNativeWebView}function a(t,n){o()?window.ReactNativeWebView.postMessage(JSON.stringify({type:r[t]||t,value:n,sessionId:e.sessionId})):console.log(t,n)}globalThis.logger=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var o=n.map((function(e){return"string"!==typeof e?JSON.stringify(e):e})).join(" ");a(r.logger,"[".concat(e,"]: ")+o)},globalThis.post=a}).call(this,n(51))},56:function(e,t,n){e.exports={btn:"styles_btn__19MaA",btn_header:"styles_btn_header__2xGXR",titleBar:"styles_titleBar__2hePW"}},59:function(e,t,n){"use strict";n.d(t,"e",(function(){return uo})),n.d(t,"b",(function(){return mi})),n.d(t,"d",(function(){return lo})),n.d(t,"a",(function(){return Q})),n.d(t,"c",(function(){return mn}));var i=n(101),r=n(102),o=n(103),a=n(112),c=n(104),l=n(105),s=n(106),u=n(4),d=n(52),f=u.b.create({name:"fontSize",defaultOptions:{types:["textStyle"],defaultFontSize:16},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:"".concat(this.options.defaultFontSize,"px"),parseHTML:function(e){return e.style.fontSize},renderHTML:function(e){return e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),p=u.b.create({name:"textDirection",defaultOptions:{types:["paragraph","heading"],defaultDirection:"ltr"},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{textDirection:{default:this.options.defaultDirection,parseHTML:function(e){return e.dir},renderHTML:function(e){return e.textDirection?{dir:e.textDirection}:{}}}}}]},addCommands:function(){var e=this;return{setTextDirection:function(t){return function(n){var i=n.commands;return e.options.types.every((function(e){return i.updateAttributes(e,{textDirection:t})}))}}}}}),b=n(107),m=n(83).a.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),h=n(92).a.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),g=n(108),v=n(109),j=n(110);function O(e,t,n){return{default:null,parseHTML:function(t){var i;return n?null===(i=t.style[e])||void 0===i?void 0:i.toString().replace(n,""):t.style[e]},renderHTML:function(i){return i[e]?{style:"".concat(t,": ").concat(i[e]).concat(n||"")}:{}}}}var x=n(127).a.extend({addAttributes:function(){var e;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{backgroundColor:O("backgroundColor","background-color"),color:O("color","color"),borderWidth:O("borderWidth","border-width","px"),borderStyle:O("borderStyle","border-style"),borderColor:O("borderColor","border-color")})}}),y=n(111),C=n(9),k=n(22),w=n(34),S=n(13),A=n(7),L=n(8),R=n(0),T=n(2),P=n(14),E=n(65),M=n(129),I=n.n(M)()((function(e,t){return{theme:void 0,isMobile:!1,openedPopups:{},setIsMobile:function(t){return e((function(e){e.isMobile=t}))},setTheme:function(t){return e((function(e){e.theme=t}))},toolbarLocation:"top",setToolbarLocation:function(t){return e((function(e){e.toolbarLocation=t}))},closePopup:function(t){return e((function(e){e.openedPopups=Object.assign(Object.assign({},e.openedPopups),Object(w.a)({},t,!1))}))},isPopupOpen:function(e){return!!t().openedPopups[e]},openPopup:function(t){return e((function(e){e.openedPopups=Object.assign(Object.assign({},e.openedPopups),Object(w.a)({},t.id,t))}))},closePopupGroup:function(t,n){return e((function(e){for(var i in e.openedPopups){var r=e.openedPopups[i];r&&r.group===t&&!n.includes(r.id)&&(e.openedPopups[i]=!1)}}))}}}));function D(){return I((function(e){return e.toolbarLocation}))}function z(){return I((function(e){return e.isMobile}))}var N=Object.defineProperty((function(){return I((function(e){return e.theme}))}),"theme",{get:function(){return I.getState().theme}});function H(e){var t=N();return Object(R.jsx)(E.a,Object.assign({theme:t||{}},{children:e.children}))}var B=function(){function e(t,n,i,r){var o=this;Object(A.a)(this,e),this.editor=n,this.getPos=i,this.options=r,this.isDragging=!1,this.handleRef=function(e){return o._handleRef(e)},this.portalProviderAPI=n.storage.portalProviderAPI,this.node=t}return Object(L.a)(e,[{key:"init",value:function(){var e=this;this.domRef=this.createDomRef(),this.domRef.ondragstart=function(t){return e.onDragStart(t)};var t=this.getContentDOM()||{dom:void 0,contentDOM:void 0},n=t.dom,i=t.contentDOM;return this.domRef&&n&&(this.domRef.appendChild(n),this.contentDOM=i||n,this.contentDOMWrapper=n||i),this.domRef.classList.add("".concat(this.node.type.name,"-view-content-wrap")),this.renderReactComponent((function(){return e.render(e.options.props,e.handleRef)})),this}},{key:"renderReactComponent",value:function(e){this.domRef&&e&&this.portalProviderAPI?this.portalProviderAPI.render(e,this.domRef):console.warn("Cannot render node view",this.editor.storage)}},{key:"createDomRef",value:function(){return this.options.wrapperFactory?this.options.wrapperFactory():this.node.isInline?document.createElement("span"):document.createElement("div")}},{key:"getContentDOM",value:function(){var e,t;if(this.options.contentDOMFactory){if(!0===this.options.contentDOMFactory){var n=document.createElement("div");return n.classList.add("".concat(this.node.type.name.toLowerCase(),"-content-wrapper")),n.style.whiteSpace="inherit",n.style.minWidth="20px",{dom:n}}return null===(t=(e=this.options).contentDOMFactory)||void 0===t?void 0:t.call(e)}}},{key:"_handleRef",value:function(e){var t=this.contentDOMWrapper||this.contentDOM;e&&t&&!e.contains(t)&&e.appendChild(t)}},{key:"render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return this.options.component?Object(R.jsx)(H,{children:Object(R.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,updateAttributes:function(t,n){return e.updateAttributes(t,e.getPos(),null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))}):null}},{key:"updateAttributes",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.editor.commands.command((function(o){var a=o.tr;return a.setNodeMarkup(t,void 0,Object.assign(Object.assign({},n.node.attrs),e)),a.setMeta("addToHistory",i),a.setMeta("preventUpdate",r),!0}))}},{key:"update",value:function(e,t,n){var i=this;return this.node.type===e.type&&(this.viewShouldUpdate(e)?(this.node=e,this.renderReactComponent((function(){return i.render(i.options.props,i.handleRef)})),!0):(this.node=e,!0))}},{key:"onDragStart",value:function(e){var t,n,i,r,o,a,c,l=this.editor.view,s=e.target,u=3===s.nodeType?null===(t=s.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):s.closest("[data-drag-handle]");if(this.dom&&!(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(s))&&u){var d=this.dom.querySelector("[data-drag-image]")||this.dom,f=0,p=0;if(d!==u){var b=d.getBoundingClientRect(),m=u.getBoundingClientRect(),h=null!==(i=e.offsetX)&&void 0!==i?i:null===(r=e.nativeEvent)||void 0===r?void 0:r.offsetX,g=null!==(o=e.offsetY)&&void 0!==o?o:null===(a=e.nativeEvent)||void 0===a?void 0:a.offsetY;f=m.x-b.x+h,p=m.y-b.y+g}var v=T.NodeSelection.create(l.state.doc,this.getPos()),j=l.state.tr.setSelection(v);l.dispatch(j),null===(c=e.dataTransfer)||void 0===c||c.setDragImage(d,f,p),function(e,t){if(!e.dataTransfer)return;var n=t.view,i=n.state.selection.content(),r=Object(P.d)(n,i),o=r.dom,a=r.text;e.dataTransfer.clearData(),e.dataTransfer.setData("Text",a),e.dataTransfer.setData("text/plain",a),e.dataTransfer.setData("text/html",o.innerHTML),e.dataTransfer.effectAllowed="copyMove",n.dragging={slice:i,move:!0}}(e,this.editor)}}},{key:"stopEvent",value:function(e){var t,n=this;if(!this.dom)return!1;var i=e.target;if(!(this.dom.contains(i)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(i))))return!1;var r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(i.tagName)||i.isContentEditable)&&!r)return!0;var o=this.editor.isEditable,a=this.isDragging,c=!!this.node.type.spec.draggable,l=T.NodeSelection.isSelectable(this.node),s="copy"===e.type,u="paste"===e.type,d="cut"===e.type,f="mousedown"===e.type,p=e.type.startsWith("drag");if(!c&&l&&p&&e.preventDefault(),c&&p&&!a)return e.preventDefault(),!1;if(c&&o&&!a&&f){var b=i.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",(function(){n.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(function(){n.isDragging=!1}),{once:!0}))}return!(a||r||s||u||d||f&&l)}},{key:"ignoreMutation",value:function(e){if(!this.dom||!this.contentDOM)return!0;if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&this.editor.isFocused&&[].concat(Object(S.a)(Array.from(e.addedNodes)),Object(S.a)(Array.from(e.removedNodes))).every((function(e){return e.isContentEditable})))return!1;return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}},{key:"viewShouldUpdate",value:function(e){return!this.options.shouldUpdate||this.options.shouldUpdate(this.node,e)}},{key:"setDomAttrs",value:function(e,t){Object.keys(e.attrs||{}).forEach((function(n){t.setAttribute(n,e.attrs[n])}))}},{key:"dom",get:function(){return this.domRef}},{key:"destroy",value:function(){this.domRef&&this.portalProviderAPI&&(this.portalProviderAPI.remove(this.domRef),this.domRef=void 0,this.contentDOM=void 0)}}]),e}();function F(e,t){return function(n){var i=n.node,r=n.getPos,o=n.editor;return new B(i,o,(function(){return"boolean"===typeof r?-1:r()}),Object.assign(Object.assign({},t),{component:e})).init()}}var _=n(33),V=n(15),W=n(16),U=n(1),q=n.n(U),$=n(38),J=n.n($);var G=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(){var e;return Object(A.a)(this,n),(e=t.call(this)).portals=new Map,e.setContext=function(t){e.context=t},e}return Object(L.a)(n,[{key:"render",value:function(e,t){this.portals.set(t,{children:e});var n=e();Object($.unstable_renderSubtreeIntoContainer)(this.context,n,t)}},{key:"forceUpdate",value:function(){}},{key:"remove",value:function(e){this.portals.delete(e);try{Object($.unmountComponentAtNode)(e)}catch(t){}}}]),n}(function(){function e(){Object(A.a)(this,e),this.listeners={}}return Object(L.a)(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t)}},{key:"off",value:function(e,t){this.listeners[e]&&this.listeners[e].has(t)&&this.listeners[e].delete(t)}},{key:"emit",value:function(e,t){this.listeners[e]&&this.listeners[e].forEach((function(e){return e(t)}))}},{key:"destroy",value:function(){this.listeners={}}}]),e}()),X=q.a.createContext(void 0);function K(){return Object(U.useContext)(X)}var Q=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(e){var i;return Object(A.a)(this,n),(i=t.call(this,e)).portalProviderAPI=new G,i}return Object(L.a)(n,[{key:"render",value:function(){return Object(R.jsxs)(X.Provider,Object.assign({value:this.portalProviderAPI},{children:[this.props.children,Object(R.jsx)(Y,{portalProviderAPI:this.portalProviderAPI})]}))}},{key:"componentDidUpdate",value:function(){this.portalProviderAPI.forceUpdate()}}]),n}(q.a.Component);Q.displayName="PortalProvider";var Y=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(e){var i;return Object(A.a)(this,n),(i=t.call(this,e)).handleUpdate=function(e){return i.setState({portals:e})},e.portalProviderAPI.setContext(Object(_.a)(i)),e.portalProviderAPI.on("update",i.handleUpdate),i.state={portals:new Map},i}return Object(L.a)(n,[{key:"render",value:function(){var e=this.state.portals;return Object(R.jsx)(R.Fragment,{children:Array.from(e.entries()).map((function(e){var t=Object(C.a)(e,2),n=t[0],i=t[1];return Object($.createPortal)(i,n)}))})}}]),n}(q.a.Component),Z=n(25),ee=n(19),te=function(){function e(){Object(A.a)(this,e),this.changeHandlers=[],this.changeHandlers=[]}return Object(L.a)(e,[{key:"subscribe",value:function(e){this.changeHandlers.push(e)}},{key:"unsubscribe",value:function(e){this.changeHandlers=this.changeHandlers.filter((function(t){return t!==e}))}},{key:"notifyNewSelection",value:function(e,t){this.changeHandlers.forEach((function(n){return n(e,t)}))}}]),e}(),ne=new T.PluginKey("reactNodeView"),ie=new T.Plugin({state:{init:function(){return new te},apply:function(e,t){return t}},key:ne,view:function(e){var t=ne.getState(e.state);return{update:function(e){var n=e.state.selection,i=n.from,r=n.to;t.notifyNewSelection(i,r)}}}}),re=u.b.create({name:"node-view-selection-notifier",addProseMirrorPlugins:function(){return[ie]}}),oe=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(e,i,r,o){var a;return Object(A.a)(this,n),(a=t.call(this,e,i,r,o)).pos=-1,a.isNodeInsideSelection=function(e,t,n,i){var r=a.getPositionsWithDefault(n,i);return n=r.pos,i=r.posEnd,"number"===typeof n&&"number"===typeof i&&(e<=n&&t>=i)},a.isSelectionInsideNode=function(e,t,n,i){var r=a.getPositionsWithDefault(n,i);return n=r.pos,i=r.posEnd,"number"===typeof n&&"number"===typeof i&&(n<e&&t<i)},a.isSelectedNode=function(e){if(e instanceof T.NodeSelection){var t=a.editor.view.state.selection,n=t.from,i=t.to;return e.node===a.node||a.pos===n&&a.posEnd===i&&e.node.eq(a.node)}return!1},a.insideSelection=function(){var e=a.editor.view.state.selection,t=e.from,n=e.to;return a.isSelectedNode(a.editor.view.state.selection)||a.isSelectionInsideNode(t,n)},a.nodeInsideSelection=function(){var e=a.editor.view.state.selection,t=e.from,n=e.to;return a.isSelectedNode(e)||a.isNodeInsideSelection(t,n)},a.onSelectionChange=function(){a.update(a.node,[],P.b.empty)},a.updatePos(),a.oldSelection=i.view.state.selection,a.selectionChangeState=ne.getState(a.editor.view.state),a.selectionChangeState.subscribe(a.onSelectionChange),a}return Object(L.a)(n,[{key:"render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(!this.options.component)return null;var i=this.editor.isEditable&&(this.insideSelection()||this.nodeInsideSelection());return Object(R.jsx)(H,{children:Object(R.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,selected:i,updateAttributes:function(t,n){return e.updateAttributes(t,e.pos,null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))})}},{key:"updatePos",value:function(){"boolean"!==typeof this.getPos&&(this.pos=this.getPos(),this.posEnd=this.pos+this.node.nodeSize)}},{key:"getPositionsWithDefault",value:function(e,t){return{pos:"number"!==typeof e?this.pos:e,posEnd:"number"!==typeof t?this.posEnd:t}}},{key:"viewShouldUpdate",value:function(e){if(Object(Z.a)(Object(ee.a)(n.prototype),"viewShouldUpdate",this).call(this,e))return!0;var t=this.editor.view.state.selection,i=this.oldSelection;this.oldSelection=t;var r=this.pos,o=this.posEnd;this.updatePos();var a=t.from,c=t.to,l=i.from,s=i.to;if(this.node.type.spec.selectable){var u=t instanceof T.NodeSelection&&t.from===this.pos,d=i instanceof T.NodeSelection&&i.from===this.pos;if(u&&!d||d&&!u)return!0}var f=this.isNodeInsideSelection(a,c)&&!this.isNodeInsideSelection(l,s),p=!this.isNodeInsideSelection(a,c)&&this.isNodeInsideSelection(l,s),b=this.isNodeInsideSelection(a,c,r,o)&&!this.isNodeInsideSelection(a,c);return!!(f||p||b)}},{key:"destroy",value:function(){this.selectionChangeState.unsubscribe(this.onSelectionChange),Object(Z.a)(Object(ee.a)(n.prototype),"destroy",this).call(this)}}]),n}(B);function ae(e,t){return function(n){var i=n.node,r=n.getPos,o=n.editor;return new oe(i,o,(function(){return"boolean"===typeof r?-1:r()}),Object.assign(Object.assign({},t),{component:e})).init()}}var ce=n(6),le=n(130),se=n.n(le),ue=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function de(e){var t=e.title,n=e.path,i=e.size,r=void 0===i?24:i,o=e.color,a=void 0===o?"icon":o,c=e.stroke,l=e.rotate,s=Object(E.b)(),u=(null===s||void 0===s?void 0:s.colors)?s.colors[a]:a;return Object(R.jsx)(se.a,{className:"icon",title:t,path:n,size:"".concat("string"===typeof r?(null===s||void 0===s?void 0:s.iconSizes[r])||24:r,"px"),style:{strokeWidth:c||"0px",stroke:u},color:u,spin:l})}function fe(e){var t=e.sx,n=e.title,i=e.color,r=e.size,o=e.stroke,a=e.rotate,c=e.path,l=ue(e,["sx","title","color","size","stroke","rotate","path"]);return Object(R.jsx)(ce.c,Object.assign({sx:Object.assign({flexShrink:0,justifyContent:"center",alignItems:"center"},t)},l,{children:Object(R.jsx)(de,{title:n,path:c,rotate:a,color:i,stroke:o,size:r})}))}var pe=n(11),be={bold:pe.D,italic:pe.N,underline:pe.Z,strikethrough:pe.U,code:pe.t,codeRemove:"M3.62109375 1.83837892 2.26318358 3.13037107 6.46289063 7.536621 1.9995117 12l6.0000003 6 1.40039025-1.400391L4.80029295 12l3.0292968-3.0292965 7.0283205 7.371093-.2578125.2578125L16.000488 18l.224121-.224121 4.3125 4.52490225 1.35791025-1.29492225-4.34326125-4.55712825L22.000488 12l-6-6-1.40039025 1.40039063L19.19970675 12l-3.016113 3.016113L9.156738 7.6435545l.24316425-.24316387L7.999512 6l-.2109375.2109375Z",alignCenter:pe.z,alignLeft:pe.B,alignRight:pe.C,alignJustify:pe.A,subscript:pe.V,superscript:pe.W,horizontalRule:pe.i,codeblock:pe.s,blockquote:pe.T,formatClear:pe.E,ltr:pe.X,rtl:pe.Y,numberedList:pe.S,bulletList:pe.Q,highlight:pe.G,textColor:pe.H,link:pe.gb,linkRemove:pe.fb,openLink:pe.mb,linkEdit:"m19 14 1.28 1.28c.22.21.22.56 0 .77l-1 1L17.23 15l1-1c.11-.11.25-.17.39-.17s.27.06.38.17m-.3 3.63-6.06 6.07h-2.06v-2.06l6.07-6.06zM7 7h4v2H7c-1.6568542 0-3 1.343146-3 3s1.3431458 3 3 3h4v2H7c-2.7614237 0-5-2.238576-5-5 0-2.7614237 2.2385763-5 5-5m10 0c2.761424 0 5 2.2385763 5 5h-2c0-1.656854-1.343146-3-3-3h-4V7h4m-9 4h8v2H8v-2",linkSettings:"M7 7h4v2H7c-1.6568542 0-3 1.343146-3 3s1.3431458 3 3 3h4v2H7c-2.7614237 0-5-2.238576-5-5 0-2.7614237 2.2385763-5 5-5m10 0c2.761424 0 5 2.2385763 5 5h-2c0-1.656854-1.343146-3-3-3h-4V7h4m-9 4h8v2H8v-2m15.119777 8.323608-1.07-.82c.02-.17.04-.33.04-.5 0-.17-.01-.33-.04-.5l1.06-.82c.09258-.07939.117526-.212463.06-.32l-1-1.73c-.06-.13-.19-.13-.33-.13l-1.22.5c-.28-.18-.54-.35-.85-.47l-.19-1.32c-.01-.12-.12-.21-.24-.21h-2c-.12 0-.23.09-.25.21l-.19 1.32c-.3.13-.59.29-.85.47l-1.24-.5c-.11 0-.24 0-.31.13l-1 1.73c-.06.11-.04.24.06.32l1.06.82c-.03989.33214-.03989.66786 0 1l-1.06.82c-.09258.07939-.117526.212462-.06.32l1 1.73c.06.13.19.13.31.13l1.24-.5c.26.18.54.35.85.47l.19 1.32c.02.12.12.21.25.21h2c.12 0 .23-.09.25-.21l.19-1.32c.3-.13.56-.29.84-.47l1.22.5c.14 0 .27 0 .34-.13l1-1.73c.05753-.107538.03258-.240607-.06-.32m-4.78.18c-.83 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.66 1.5-1.5 1.5z",url:pe.eb,image:pe.bb,imageSettings:pe.cb,colorClear:pe.db,check:pe.k,checkbox:pe.l,loading:pe.hb,more:pe.v,upload:pe.Hb,camera:pe.j,attachment:pe.h,table:pe.tb,rowProperties:pe.Cb,insertRowBelow:pe.Db,insertRowAbove:pe.Eb,moveRowDown:pe.b,moveRowUp:pe.e,deleteRow:pe.Fb,toggleHeaderRow:pe.ub,columnProperties:pe.zb,insertColumnRight:pe.wb,insertColumnLeft:pe.xb,moveColumnRight:pe.d,moveColumnLeft:pe.c,deleteColumn:pe.yb,cellProperties:pe.pb,cellBorderColor:"M4 24q-.825 0-1.412-.587Q2 22.825 2 22q0-.825.588-1.413Q3.175 20 4 20h16q.825 0 1.413.587Q22 21.175 22 22q0 .825-.587 1.413Q20.825 24 20 24Zm1-6q-.425 0-.713-.288Q4 17.425 4 17v-2.325q0-.2.075-.388q.075-.187.225-.337l8.75-8.75l3.75 3.75l-8.75 8.75q-.15.15-.337.225q-.188.075-.388.075Zm1-2h.9L14 8.95L13.05 8L6 15.1Zm11.925-8.15l-3.75-3.75l1.8-1.8q.275-.3.7-.288q.425.013.7.288l2.35 2.35q.275.275.275.688q0 .412-.275.712ZM6 16Z",backgroundColor:pe.F,borderColor:"M4 24q-.825 0-1.412-.587Q2 22.825 2 22q0-.825.588-1.413Q3.175 20 4 20h16q.825 0 1.413.587Q22 21.175 22 22q0 .825-.587 1.413Q20.825 24 20 24Zm1-6q-.425 0-.713-.288Q4 17.425 4 17v-2.325q0-.2.075-.388q.075-.187.225-.337l8.75-8.75l3.75 3.75l-8.75 8.75q-.15.15-.337.225q-.188.075-.388.075Zm1-2h.9L14 8.95L13.05 8L6 15.1Zm11.925-8.15l-3.75-3.75l1.8-1.8q.275-.3.7-.288q.425.013.7.288l2.35 2.35q.275.275.275.688q0 .412-.275.712ZM6 16Z",sortDesc:pe.sb,deleteTable:pe.Bb,mergeCells:pe.Ab,splitCells:pe.Gb,checklist:pe.R,dragHandle:pe.x,previousMatch:pe.g,nextMatch:pe.a,replaceOne:"m5.4 5.42 3.48 3.5 3.43-3.43-1.08-1.08-1.57 1.55V3.5a.8.8 0 0 1 .76-.81h2.35v-1.5h-2.35a2.29 2.29 0 0 0-2.28 2.3v2.5L6.48 4.33Zm10.3 2.77c.3.48.7.72 1.25.72.61 0 1.1-.26 1.45-.78.37-.51.55-1.2.55-2.05 0-.8-.15-1.41-.46-1.87a1.51 1.51 0 0 0-1.33-.68c-.63 0-1.11.3-1.45.9h-.02V1.19h-1.37v7.6h1.37v-.6Zm-.03-1.64v-.52c0-.39.09-.7.27-.93a.83.83 0 0 1 .69-.36.76.76 0 0 1 .67.36c.16.24.24.57.24 1 0 .5-.09.9-.26 1.18a.8.8 0 0 1-.73.42.76.76 0 0 1-.63-.33 1.32 1.32 0 0 1-.25-.82zm-1.35 12.82c-.4.23-.97.35-1.71.35-.87 0-1.58-.27-2.12-.82a2.9 2.9 0 0 1-.8-2.12c0-1 .28-1.8.86-2.37a3.12 3.12 0 0 1 2.31-.87c.67 0 1.16.1 1.46.28v1.54a1.95 1.95 0 0 0-1.23-.42c-.5 0-.9.15-1.2.46-.29.3-.43.72-.43 1.26 0 .52.14.93.42 1.23.28.3.67.44 1.16.44.43 0 .86-.14 1.28-.43zm-7.73-8.91L5.05 12v9.27l1.54 1.54h10.82l1.54-1.54V12l-1.54-1.54zm0 1.54h10.82v9.27H6.59Z",replaceAll:"M16.53 4.22c.22-.45.52-.68.92-.68.36 0 .64.17.83.52.2.34.3.81.3 1.4a3.1 3.1 0 0 1-.35 1.57c-.22.39-.53.59-.91.59-.35 0-.61-.19-.79-.55h-.01v.45h-.87V1.77h.87v2.45h.01zm-.02 1.6a1.14 1.14 0 0 0 .15.63c.1.17.24.25.4.25.2 0 .35-.1.46-.32a2 2 0 0 0 .17-.9c0-.32-.05-.57-.15-.75-.1-.18-.24-.27-.43-.27-.17 0-.32.09-.43.27a1.3 1.3 0 0 0-.17.7ZM5.6 11.56l-3.1-3.1.97-.97 1.47 1.46v-2.2A2.03 2.03 0 0 1 6.96 4.7h3.43v1.32H6.96a.72.72 0 0 0-.68.73l.01 2.19 1.39-1.38.96.96-3.04 3.04Zm7.65-4.04h.94v-2.5c0-1.18-.46-1.78-1.38-1.78-.2 0-.41.04-.66.1a2.11 2.11 0 0 0-.56.25v.97c.34-.3.71-.44 1.1-.44.38 0 .57.23.57.68l-.88.16c-.74.12-1.11.59-1.11 1.4 0 .38.09.7.27.92a.9.9 0 0 0 .74.35c.42 0 .74-.24.96-.7h.01zm0-1.98v.28a1.1 1.1 0 0 1-.17.64.54.54 0 0 1-.46.25.4.4 0 0 1-.32-.14.56.56 0 0 1-.11-.36c0-.33.16-.51.48-.57l.59-.1zM9.82 19.21h-.94v-.6h-.02c-.21.46-.53.7-.96.7a.9.9 0 0 1-.74-.35 1.47 1.47 0 0 1-.27-.92c0-.8.38-1.28 1.12-1.4l.87-.15c0-.46-.19-.69-.57-.69-.38 0-.75.15-1.1.45v-.98c.14-.09.33-.17.57-.24.24-.07.46-.1.66-.1.92 0 1.38.59 1.38 1.78zm-.94-1.7v-.29l-.58.1c-.33.06-.49.25-.49.57 0 .15.04.27.12.36a.4.4 0 0 0 .32.14.54.54 0 0 0 .46-.25c.11-.17.17-.38.17-.63zm4.24 1.8c.47 0 .83-.09 1.08-.26v-1.03a1.32 1.32 0 0 1-.8.3.9.9 0 0 1-.74-.31c-.17-.22-.26-.5-.26-.88s.1-.68.28-.9a.94.94 0 0 1 .75-.32c.28 0 .54.1.77.3v-1.1c-.19-.12-.5-.19-.91-.19-.61 0-1.1.2-1.47.62-.36.4-.54.97-.54 1.68 0 .61.17 1.11.5 1.5.35.4.8.59 1.34.59zM2.5 13.46 3.96 12h13.16l1.46 1.46v7.3l-1.46 1.47H3.96L2.5 20.77Zm1.46 0v7.3h13.16v-7.3Zm4.39-2.92L9.8 9.08h10.23l1.46 1.46v7.3l-1.46 1.47v-8.77z",replace:"M21 4.5000005V14.25a1.5000007 1.5000005 0 0 1-1.500007 1.500005h-8.999996v1.49999a.74999993.74999995 0 0 1-.459373.693747.79687482.79687478 0 0 1-.290624.056263.77812509.77812509 0 0 1-.534375-.215621l-2.25-2.25a.759375.759375 0 0 1 0-1.068763l2.25-2.25a.7875.7875 0 0 1 .824999-.159371.74999993.74999995 0 0 1 .459373.693745V14.25h8.999996V4.5000005H9.0000007v.7499997a.75000036.75000039 0 0 1-1.5000007 0v-.7499997A1.5000007 1.5000005 0 0 1 9.0000007 3H19.499993A1.5000007 1.5000005 0 0 1 21 4.5000005ZM15.750007 18.000005a.74999993.74999995 0 0 0-.750014.749995v.749995H4.5000007V9.7500002h9.0000063v1.5000048a.759375.759375 0 0 0 .459381.693745.79687482.79687478 0 0 0 .290612.05631.77812509.77812509 0 0 0 .534372-.215621l2.25-2.2500079a.759375.759375 0 0 0 0-1.06875l-2.25-2.25a.76875023.76875019 0 0 0-.824984-.1594227.74999993.74999995 0 0 0-.459381.6937502v1.4999978H4.5000007A1.5000007 1.5000005 0 0 0 3 9.7500002v9.7499948A1.5000007 1.5000005 0 0 0 4.5000007 21H14.999993A1.5000007 1.5000005 0 0 0 16.5 19.499995V18.75a.74999993.74999995 0 0 0-.749993-.749995z",attachmentSettings:"m24.0138 20.223188-1.07-.82c.02-.17.04-.33.04-.5 0-.17-.01-.33-.04-.5l1.06-.82c.09258-.07939.117526-.212463.06-.32l-1-1.73c-.06-.13-.19-.13-.33-.13l-1.22.5c-.28-.18-.54-.35-.85-.47l-.19-1.32c-.01-.12-.12-.21-.24-.21h-2c-.12 0-.23.09-.25.21l-.19 1.32c-.3.13-.59.29-.85.47l-1.24-.5c-.11 0-.24 0-.31.13l-1 1.73c-.06.11-.04.24.06.32l1.06.82c-.03989.33214-.03989.66786 0 1l-1.06.82c-.09258.07939-.117526.212463-.06.32l1 1.73c.06.13.19.13.31.13l1.24-.5c.26.18.54.35.85.47l.19 1.32c.02.12.12.21.25.21h2c.12 0 .23-.09.25-.21l.19-1.32c.3-.13.56-.29.84-.47l1.22.5c.14 0 .27 0 .34-.13l1-1.73c.05753-.107537.03258-.240606-.06-.32m-4.78.18c-.83 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.66 1.5-1.5 1.5zM16.61 13.5c-.8.35-1.5.86-2.07 1.5H9.5c-3.3333319 0-3.3333319-5 0-5H17v1.5H9.5c-.55 0-1 .45-1 1s.45 1 1 1h7.11m-13.11-1c0-2.21 1.79-4 4-4H18c2.434718-.00632 3.435847 3.121347 1.45 4.53.6.04 1.18.17 1.72.38.52-.67.83-1.5.83-2.41 0-2.21-1.79-4-4-4H7.5C4.46 7 2 9.46 2 12.5S4.46 18 7.5 18h5.59c.09-.53.25-1.03.46-1.5H7.5c-2.21 0-4-1.79-4-4",caseSensitive:pe.O,wholeWord:pe.P,regex:pe.qb,embed:pe.lb,embedSettings:pe.kb,palette:pe.nb,tableSettings:pe.vb,math:pe.ab,mathBlock:pe.ib,outlineList:pe.y,fontFamily:pe.I,fontSize:pe.J,heading:pe.K,indent:pe.M,outdent:pe.L,plus:pe.ob,minus:pe.jb,close:pe.r,delete:pe.u,download:pe.w,chevronDown:pe.m,chevronUp:pe.p,chevronRight:pe.o,chevronLeft:pe.n,circle:pe.q,arrowLeft:pe.f,resize:pe.rb,none:""},me=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},he=Object(U.forwardRef)((function(e,t){var n,i=e.sx,r=me(e,["sx"]),o=(null===(n=null===i||void 0===i?void 0:i[":hover"])||void 0===n?void 0:n.bg)||"hover",a=(null===i||void 0===i?void 0:i.bg)||"unset",c=Object(U.useRef)();Object(U.useEffect)((function(){if(c.current)return c.current.addEventListener("mousedown",l,{passive:!1,capture:!0}),function(){var e;null===(e=c.current)||void 0===e||e.removeEventListener("mousedown",l,{capture:!0})}}),[]);var l=Object(U.useCallback)((function(e){e.preventDefault()}),[]);return Object(R.jsx)(ce.b,Object.assign({},r,{sx:Object.assign(Object.assign({},i),{":hover":{bg:[a,o]},":active":{bg:o}}),ref:function(e){c.current=e,"function"===typeof t?t(e):t&&(t.current=e)},onClick:e.onClick}))})),ge=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},ve=q.a.memo((function(e){var t=e.id,n=e.icon,i=e.iconSize,r=e.iconColor,o=e.toggled,a=e.sx,c=e.buttonRef,l=e.variant,s=void 0===l?"normal":l,u=ge(e,["id","icon","iconSize","iconColor","toggled","sx","buttonRef","variant"]);return Object(R.jsx)(he,Object.assign({ref:c,tabIndex:-1,id:"tool-".concat(t||n),sx:Object.assign({flexShrink:0,p:"small"===s?"small":1,borderRadius:"small"===s?"small":"default",m:0,bg:o?"hover":"transparent",mr:"small"===s?0:1,":hover":{bg:"hover"},":last-of-type":{mr:0}},a),onMouseDown:function(e){return e.preventDefault()}},u,{children:Object(R.jsx)(fe,{path:be[n],color:r||"icon",size:i||("small"===s?"medium":"big")})}))}),(function(e,t){return e.toggled===t.toggled&&e.icon===t.icon&&JSON.stringify(e.sx)===JSON.stringify(t.sx)}));function je(e){var t=e.item,n=e.isFocused,i=e.onMouseEnter,r=e.onMouseLeave,o=e.onClick,a=t.title,c=t.key,l=t.icon,s=t.tooltip,u=t.isDisabled,d=t.isChecked,f=t.menu,p=t.modifier,b=t.styles,m=Object(U.useRef)(null),h="bottom"===D();return Object(R.jsx)(ce.c,Object.assign({as:"li",sx:{flexShrink:0,flexDirection:"column"},onMouseEnter:i,onMouseLeave:r},{children:Object(R.jsxs)(he,Object.assign({id:c,"data-test-id":"MenuButton-".concat(c),ref:m,tabIndex:-1,variant:"menuitem",title:s,disabled:u,onClick:o,sx:Object.assign(Object.assign({},b),{bg:n&&!h?"hover":"transparent",display:"flex",alignItems:"center",justifyContent:"space-between",":hover":{bg:h?"transparent":"hover"}})},{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{fontSize:"inherit",fontFamily:"inherit"}},{children:[l&&Object(R.jsx)(fe,{path:be[l],color:"text",size:"medium",sx:{mr:2}}),Object(R.jsx)(ce.e,Object.assign({as:"span",variant:"body",sx:{fontSize:"inherit",fontFamily:"inherit"}},{children:a}))]})),d||f||p?Object(R.jsxs)(ce.c,Object.assign({sx:{ml:4}},{children:[d&&Object(R.jsx)(fe,{path:be.check,size:"small"}),f&&Object(R.jsx)(fe,{path:be.chevronRight,size:"small"}),p&&Object(R.jsx)(ce.e,Object.assign({as:"span",sx:{fontFamily:"body",fontSize:"menu",color:"fontTertiary"}},{children:p}))]})):null]}),c)}))}function Oe(){return Object(R.jsx)(ce.a,{as:"li",sx:{width:"95%",height:"0.5px",bg:"border",my:2,alignSelf:"center"}})}var xe=n(87),ye=n.n(xe),Ce=n(205),ke=n(131),we=n(206),Se=n(207),Ae=Object(Ce.a)(ce.c),Le={type:"spring",stiffness:300,damping:30,mass:.2,duration:300};function Re(e){var t,n=e.isOpen,i=e.title,r=e.items,o=e.onClose,a=e.blocking,c=void 0===a||a,l=e.focusOnRender,s=void 0===l||l,u=e.draggable,d=void 0===u||u,f=e.children,p=N(),b=Object(U.useRef)(),m=Object(ke.a)(0),h=Object(we.a)(m,[0,(null===(t=b.current)||void 0===t?void 0:t.offsetHeight)||window.innerHeight],[1,0]),g=Object(Se.a)(),v=Object(U.useCallback)((function(){var e,t=(null===(e=b.current)||void 0===e?void 0:e.offsetHeight)||window.innerHeight;setTimeout((function(){null===o||void 0===o||o()}),Le.duration-50),g.start({transition:Le,y:t+100})}),[g,o,b.current]),j=Object(U.useCallback)((function(e){n&&(e.preventDefault(),v())}),[n,v]);return Object(U.useEffect)((function(){return window.addEventListener("handleBackPress",j),function(){window.removeEventListener("handleBackPress",j)}}),[j]),n?Object(R.jsx)(ye.a,Object.assign({contentRef:function(e){return b.current=e},className:"bottom-sheet-presenter",role:"menu",isOpen:n,appElement:document.body,shouldCloseOnEsc:c,shouldReturnFocusAfterClose:s,shouldCloseOnOverlayClick:c,shouldFocusAfterRender:s,ariaHideApp:c,preventScroll:c,onRequestClose:function(){return v()},portalClassName:"bottom-sheet-presenter-portal",onAfterOpen:function(){console.log("OPEGN!"),g.start({transition:Le,y:0})},overlayElement:function(e,t){return Object(R.jsxs)(ce.a,Object.assign({},e,{style:Object.assign(Object.assign({},e.style),{position:c?"fixed":"sticky",zIndex:1e3,backgroundColor:c?"unset":"transparent"}),tabIndex:-1},{children:[c&&Object(R.jsx)(Ce.a.div,{id:"action-sheet-overlay",style:{height:"100%",width:"100%",opacity:h,position:"absolute",backgroundColor:"var(--overlay)"},tabIndex:-1}),t]}))},contentElement:function(e,t){return Object(R.jsx)(ce.a,Object.assign({},e,{style:{},sx:{left:0,right:0,bottom:0,display:"flex",width:"auto",height:"fit-content",position:"fixed",backgroundColor:void 0,padding:0,zIndex:0,outline:0,isolation:"isolate"}},{children:t}))}},{children:Object(R.jsxs)(Ae,Object.assign({animate:g,style:{y:m},initial:{y:1e3},sx:{bg:"background",borderTopLeftRadius:15,borderTopRightRadius:15,boxShadow:(null===p||void 0===p?void 0:p.shadows.menu)||"none",flex:1,flexDirection:"column"}},{children:[d&&Object(R.jsx)(Ae,Object.assign({drag:"y",onDrag:function(e,t){var n=t.delta;m.set(Math.max(m.get()+n.y,0))},onDragEnd:function(e,t){if(t.velocity.y>=500)null===o||void 0===o||o();else{var n=30*b.current.offsetHeight/100;m.get()>=n?v():g.start({transition:Le,y:0})}},dragConstraints:{top:0,bottom:0},dragMomentum:!1,dragElastic:!1,sx:{bg:"transparent",alignItems:"center",justifyContent:"center",p:2}},{children:Object(R.jsx)(ce.a,{id:"pill",sx:{backgroundColor:"hover",width:60,height:8,borderRadius:100}})})),Object(R.jsx)(Te,Object.assign({items:r,title:i,onClose:o},{children:f}))]}))})):null}function Te(e){var t,n=e.title,i=e.items,r=e.onClose,o=e.children,a=function(e){var t=Object(U.useState)(e),n=Object(C.a)(t,2),i=n[0],r=n[1],o=Object(U.useState)(!1),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useRef)([e]);return{current:i,goBack:Object(U.useCallback)((function(){if(c){var e=s.current.pop();r(e),s.current.length<=1&&l(!1)}}),[c]),navigate:Object(U.useCallback)((function(e){console.log("NAVI",e),r((function(t){return t&&s.current.push(t),e})),l(!0)}),[]),canGoBack:c}}({title:n,items:i}),c=a.current,l=a.goBack,s=a.canGoBack,u=a.navigate;return Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column"}},{children:[s||(null===c||void 0===c?void 0:c.title)?Object(R.jsxs)(ce.c,Object.assign({id:"header",sx:{alignItems:"center",mx:0,mb:1}},{children:[s&&Object(R.jsx)(ce.b,Object.assign({variant:"icon",sx:{p:1,ml:1},onClick:l},{children:Object(R.jsx)(fe,{path:be.arrowLeft,size:"big"})})),(null===c||void 0===c?void 0:c.title)&&Object(R.jsx)(ce.e,Object.assign({variant:"title",sx:{ml:1,fontSize:"title"}},{children:null===c||void 0===c?void 0:c.title}))]})):null,o||(null===(t=null===c||void 0===c?void 0:c.items)||void 0===t?void 0:t.map((function(e){if(e.isHidden)return null;switch(e.type){case"separator":return Object(R.jsx)(Oe,{},e.key);case"button":return Object(R.jsx)(je,{item:e,onClick:function(t){e.menu?u(e.menu):e.onClick&&(null===r||void 0===r||r(),setTimeout((function(){var t;null===(t=e.onClick)||void 0===t||t.call(e)}),300))}},e.key);case"popup":return Object(R.jsx)(q.a.Fragment,{children:Object(R.jsx)(e.component,{onClick:r})},e.key)}})))]}))}var Pe={x:0,y:0,actualX:0,actualY:0};function Ee(e,t){var n=t||{},i=n.target,r=void 0===i?"mouse":i,o=n.isTargetAbsolute,a=void 0!==o&&o,c=n.location,l=void 0===c?void 0:c,s=n.yOffset,u=void 0===s?0:s,d=n.xOffset,f=void 0===d?0:d,p=n.align,b=void 0===p?"start":p,m=n.parent,h=void 0===m?document.body:m,g=n.yAnchor,v="mouse"===r?Pe:Me(r,a),j=v.x,O=v.y,x=v.width,y=v.height,C=v.actualX,k=v.actualY,w=e.offsetWidth,S=e.offsetHeight,A=h.clientWidth,L=h.clientHeight,R={top:0,left:0};if(A-C<w){var T=C-j;R.left=A-w,R.left-=T}else R.left=j;if(x&&"right"===l?R.left+=x:"left"===l&&(R.left-=w),R.top=k+S>L?L-S:O,y&&("below"===l?R.top+=y:"top"===l&&(R.top=O-S)),x&&"mouse"!==r&&"center"===b&&w>0?R.left-=(w-x)/2:x&&"mouse"!==r&&"end"===b&&w>0&&(R.left-=w-x),S>L-R.top&&(e.style.maxHeight="".concat(L-20,"px")),g){var P=Me(g,a);R.top=P.y-S}return R.top=a&&R.top<0?0:R.top,R.left=a&&R.left<0?0:R.left,R.top+="below"===l?u:-u,R.left+=f,R}function Me(e,t){var n=e.getBoundingClientRect(),i={x:e.offsetLeft,y:e.offsetTop,width:n.width,height:n.height,actualY:n.y,actualX:n.x};return t&&(i.x=i.actualX,i.y=i.actualY),i}function Ie(e,t,n){var i=Object(U.useState)(-1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useCallback)((function(t){var n=e[t];if(n){var i=document.getElementById(n.key);i&&i.scrollIntoView({behavior:"auto"})}}),[e]),f=Object(U.useCallback)((function(i){var r=function(t){return e[t]},o=function(t){var n,i;return e&&("separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||(null===(i=r(t))||void 0===i?void 0:i.isDisabled))},c=function(t){return t<e.length-1?++t:0},l=function(t){return t>0?--t:e.length-1},f=function(t){return e&&r(t).menu};a((function(e){var r=e;switch(i.key){case"ArrowUp":if(s)break;for(r=l(e);o(r);)r=l(r);break;case"ArrowDown":if(s)break;for(r=c(e);o(r);)r=c(r);break;case"ArrowRight":f(e)&&u(!0);break;case"ArrowLeft":!function(e){f(e)&&u(!1)}(e);break;case"Enter":t&&t(i);break;case"Escape":n&&n(i)}return r!==e&&d(r),r}))}),[e,s,d,t]);return Object(U.useEffect)((function(){return window.addEventListener("keydown",f),function(){window.removeEventListener("keydown",f)}}),[f]),{focusIndex:o,setFocusIndex:a,isSubmenuOpen:s,setIsSubmenuOpen:u}}function De(){return document.querySelector(".editor-toolbar")||void 0}function ze(){return document.getElementById("popup-container")||void 0}window.addEventListener("mousemove",(function(e){var t=function(e){var t=0,n=0;!e&&window.event&&(e=window.event);e.pageX||e.pageY?(t=e.pageX,n=e.pageY):(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);return{x:t,y:n,actualY:n,actualX:t}}(e),n=t.x,i=t.y,r=t.actualX,o=t.actualY;Pe.x=n,Pe.y=i,Pe.actualX=r,Pe.actualY=o}));var Ne=q.a.createContext(null),He=q.a.createContext(null),Be=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(){var e;return Object(A.a)(this,n),(e=t.apply(this,arguments)).popupContainer=null,e.state={popups:[]},e.openPopup=function(t,n){n&&e.setState((function(e){return{popups:[].concat(Object(S.a)(e.popups),[{id:t,popup:n}])}}))},e.closePopup=function(t){e.setState((function(e){var n=e.popups.findIndex((function(e){return e.id===t}));if(n<=-1)return e;var i=e.popups.slice();return i.splice(n,1),{popups:i}}))},e}return Object(L.a)(n,[{key:"render",value:function(){return Object(R.jsxs)(Ne.Provider,Object.assign({value:this},{children:[this.props.children,Object(R.jsxs)(He.Provider,Object.assign({value:this.props.editor},{children:[this.state.popups.map((function(e){var t=e.id,n=e.popup;return Object(R.jsx)(n,{id:t},t)})),Object(R.jsx)("div",{id:"popup-container"})]}))]}))}}]),n}(q.a.Component);var Fe=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function _e(e){var t=e.isOpen,n=e.position,i=e.onClose,r=e.blocking,o=void 0===r||r,a=e.focusOnRender,c=void 0===a||a,l=e.children,s=z(),u=Object(U.useRef)(),d=Object(U.useRef)(),f=Object(U.useCallback)((function(){if(u.current&&n){var e=u.current,t=Ee(e,n);e.style.top=t.top+"px",e.style.left=t.left+"px"}}),[n]);Object(U.useEffect)((function(){f()}),[n]),Object(U.useEffect)((function(){function e(){f()}return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var p=Object(U.useCallback)((function(){if(u.current&&t){var e=u.current.querySelector(".movable");if(e){var n=u.current,i={x:0,y:0};e.addEventListener("mousedown",(function(e){i.x=e.clientX-n.offsetLeft,i.y=e.clientY-n.offsetTop,window.addEventListener("mousemove",r)})),window.addEventListener("mouseup",o)}}function r(e){e.buttons||o();var t=e.clientY-i.y,r=e.clientX-i.x;requestAnimationFrame((function(){n.style.top=t+"px",n.style.left=r+"px"}))}function o(){window.removeEventListener("mousemove",r)}}),[t]),b=Object(U.useCallback)((function(){var e=u.current;if(e){var t=e.offsetHeight;d.current=new ResizeObserver((function(n){if(s)f();else{var i=e.getBoundingClientRect(),r=i.height,o=i.y;if(r-t>0){var a=document.body.clientHeight-20;o+r>a&&(e.style.top=a-r+"px")}t=r}})),d.current.observe(e,{box:"border-box"})}}),[s]);return Object(R.jsx)(ye.a,Object.assign({contentRef:function(e){return u.current=e},className:"popup-presenter",role:"menu",isOpen:t,appElement:document.body,shouldCloseOnEsc:!0,shouldReturnFocusAfterClose:!0,shouldCloseOnOverlayClick:!0,shouldFocusAfterRender:c,ariaHideApp:o,preventScroll:o,onRequestClose:i,portalClassName:"popup-presenter-portal",onAfterOpen:function(e){e&&n&&(f(),b(),p())},onAfterClose:function(){var e;return null===(e=d.current)||void 0===e?void 0:e.disconnect()},overlayElement:function(e,t){return Object(R.jsx)(ce.a,Object.assign({},e,{style:Object.assign(Object.assign({},e.style),{position:o?"fixed":"initial",zIndex:1e3,backgroundColor:o?"unset":"transparent"})},{children:t}))},contentElement:function(e,t){return Object(R.jsx)(ce.a,Object.assign({},e,{style:{},sx:{top:0,left:0,right:0,bottom:0,display:"flex",width:"fit-content",height:"fit-content",position:"fixed",backgroundColor:void 0,padding:0,zIndex:0,outline:0,isolation:"isolate"}},{children:t}))},style:{content:{},overlay:{zIndex:999,background:"transparent"}}},{children:l}))}function Ve(e){return e.isOpen?Object(R.jsx)(_e,Object.assign({},e)):null}function We(e){var t=e.id,n=(e.group,e.position),i=e.renderPopup,r=(e.isOpen,e.onClosed,e.autoCloseOnUnmount),o=Fe(e,["id","group","position","renderPopup","isOpen","onClosed","autoCloseOnUnmount"]),a=Object(U.useContext)(Ne),c=Ue(e),l=c.closePopup,s=c.isPopupOpen;return Object(U.useEffect)((function(){if(r)return function(){null===a||void 0===a||a.closePopup(t)}}),[r,t,a]),Object(U.useEffect)((function(){a&&s&&a.openPopup(t,(function(e){var t=e.id,r=I((function(e){return!!e.openedPopups[t]}));return Object(U.useEffect)((function(){r||a.closePopup(t)}),[r]),Object(R.jsx)(Ve,Object.assign({isOpen:r,onClose:function(){return l(t)},position:n,blocking:!0,focusOnRender:!0},o,{children:Object(R.jsx)(ce.a,Object.assign({sx:{boxShadow:"menu",borderRadius:"default",overflow:"hidden"}},{children:Object(R.jsx)(He.Consumer,{children:function(){return i((function(){return a.closePopup(t)}))}})}))}),t)}))}),[a,s]),null}function Ue(e){var t=e.group,n=e.isOpen,i=e.id,r=e.onClosed,o=I((function(e){return!!e.openedPopups[i]})),a=I((function(e){return e.openPopup})),c=I((function(e){return e.closePopup})),l=I((function(e){return e.closePopupGroup}));return I((function(e){return"bottom"===e.toolbarLocation}))&&(t="popup"),Object(U.useEffect)((function(){n?a({id:i,group:t}):c(i)}),[n,i,t,a,c]),Object(U.useEffect)((function(){o||null===r||void 0===r||r()}),[o]),Object(U.useEffect)((function(){o&&l(t,[i])}),[r,o,l,i,t]),Object(U.useEffect)((function(){n||c(i)}),[n,i,t,c]),{isPopupOpen:o,closePopup:c}}function qe(e){var t=e.popup,n=Fe(e,["popup"]);function i(){J.a.unmountComponentAtNode(ze())}return J.a.render(Object(R.jsx)(H,{children:Object(R.jsx)(et,Object.assign({isOpen:!0,position:{target:De(),isTargetAbsolute:!0,location:"below",align:"end",yOffset:10},blocking:!0,focusOnRender:!0},n,{onClose:function(){var e;i(),null===(e=n.onClose)||void 0===e||e.call(n)}},{children:t(i)}))}),ze()),i}var $e=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Je(e){var t=e.items,n=void 0===t?[]:t,i=(e.title,e.onClose),r=$e(e,["items","title","onClose"]),o=Object(U.useRef)(),a=Object(U.useCallback)((function(e,t){null===e||void 0===e||e.stopPropagation(),(null===t||void 0===t?void 0:t.onClick)&&t.onClick(),i&&i()}),[i]),c=Ie(n,(function(e){var t=n[l];t&&"button"===t.type&&a(e,t)}),(function(){return i()})),l=c.focusIndex,s=c.setFocusIndex,u=c.isSubmenuOpen,d=c.setIsSubmenuOpen,f=n[l],p=Object(U.useRef)(null);return Object(U.useEffect)((function(){var e=n[l];if(e&&p.current){var t=document.getElementById(e.key);if(t)if(u){var i=Ee(p.current,{target:t,location:"right"}),r=i.top,o=i.left;p.current.style.visibility="visible",p.current.style.top="".concat(r,"px"),p.current.style.left="".concat(o,"px")}else p.current.style.visibility="hidden"}}),[u,l,n]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Ge,Object.assign({},r,{children:n.map((function(e,t){if(e.isHidden)return null;switch(e.type){case"separator":return Object(R.jsx)(Oe,{},e.key);case"button":return Object(R.jsx)(je,{item:e,onClick:function(n){e.menu?(s(t),d(!0)):a(n,e)},isFocused:l===t,onMouseEnter:function(){e.isDisabled?s(-1):(o.current&&clearTimeout(o.current),s(t),d(!1),e.menu&&(o.current=setTimeout((function(){d(!0)}),500)))},onMouseLeave:function(){o.current&&clearTimeout(o.current)}},e.key);case"popup":return Object(R.jsx)(e.component,{onClick:function(e){return a(e)}})}}))})),"button"===(null===f||void 0===f?void 0:f.type)&&(null===f||void 0===f?void 0:f.menu)&&u&&Object(R.jsx)(ce.c,Object.assign({ref:p,style:{visibility:"hidden"},sx:{position:"absolute"}},{children:Object(R.jsx)(Je,{items:f.menu.items,onClose:i})}))]})}function Ge(e){var t=e.children,n=e.title,i=e.sx,r=$e(e,["children","title","sx"]);return Object(R.jsxs)(ce.a,Object.assign({className:"menuContainer",as:"ul",tabIndex:-1,sx:Object.assign({bg:"background",py:1,display:"flex",flexDirection:"column",position:"relative",listStyle:"none",padding:0,margin:0,borderRadius:"default",boxShadow:"menu",border:"1px solid var(--border)",minWidth:220},i)},r,{children:[n&&Object(R.jsx)(ce.e,Object.assign({sx:{fontFamily:"body",fontSize:"subtitle",color:"primary",py:"8px",px:3,borderBottom:"1px solid",borderBottomColor:"border",wordWrap:"break-word"}},{children:n})),t]}))}function Xe(e){var t=e.items,n=void 0===t?[]:t,i=$e(e,["items"]);return Object(R.jsx)(Ve,Object.assign({},i,{children:e.children?e.children:Object(R.jsx)(Je,Object.assign({items:n},i))}))}var Ke=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Qe(e){return z()?e.mobile||null:e.desktop||null}function Ye(e){return Object(R.jsx)(Qe,{desktop:Object(R.jsx)(R.Fragment,{children:e.children})})}function Ze(e){return Object(R.jsx)(Qe,{mobile:Object(R.jsx)(R.Fragment,{children:e.children})})}function et(e){var t=e.mobile,n=void 0===t?"menu":t,i=e.desktop,r=void 0===i?"menu":i,o=Ke(e,["mobile","desktop"]);return z()&&"sheet"===n?Object(R.jsx)(Re,Object.assign({},o)):"menu"===n||"menu"===r?Object(R.jsx)(Xe,Object.assign({},o)):e.isOpen?Object(R.jsx)(R.Fragment,{children:e.children}):null}function tt(e){var t=e.title,n=e.onClose,i=e.action,r=e.children;return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Ye,{children:Object(R.jsxs)(ce.c,Object.assign({sx:{overflow:"hidden",bg:"background",flexDirection:"column",borderRadius:"default",boxShadow:"menu",minWidth:200}},{children:[t&&Object(R.jsxs)(ce.c,Object.assign({className:"movable",sx:{justifyContent:"space-between",alignItems:"center",p:2}},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"title"},{children:t})),Object(R.jsx)(ce.b,Object.assign({variant:"tool",sx:{p:0,bg:"transparent"},onClick:n},{children:Object(R.jsx)(fe,{path:be.close,size:"big"})}))]})),r,t&&i&&Object(R.jsx)(ce.c,Object.assign({sx:{justifyContent:"end"},bg:"bgSecondary",p:1,px:2,mt:2},{children:Object(R.jsx)(ce.b,Object.assign({variant:"dialog",onClick:i.disabled||i.loading?void 0:i.onClick,disabled:i.disabled||i.loading},{children:i.loading?Object(R.jsx)(fe,{path:be.loading,rotate:!0,size:"medium"}):i.title}))}))]}))}),Object(R.jsxs)(Ze,{children:[r,i&&Object(R.jsx)(ce.b,Object.assign({variant:"primary",sx:{alignSelf:"stretch",mb:1,mt:2,mx:1,py:2},onClick:i.disabled||null===i||void 0===i?void 0:i.onClick,disabled:i.disabled},{children:i.loading?Object(R.jsx)(fe,{path:be.loading,rotate:!0,size:"medium"}):i.title}))]})]})}var nt=n(24),it=n(132),rt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function ot(e){var t=e.label,n=e.containerProps,i=e.sx,r=rt(e,["label","containerProps","sx"]);return Object(R.jsxs)(ce.c,Object.assign({},n,{sx:Object.assign(Object.assign({flex:1},null===n||void 0===n?void 0:n.sx),{outline:"1px solid var(--border)",p:2,borderRadius:"default",":focus-within":{outlineColor:"primary",outlineWidth:"1.8px"}})},{children:[Object(R.jsx)(nt.b,Object.assign({variant:"clean",sx:Object.assign(Object.assign({},i),{p:0})},r)),Object(R.jsx)(ce.e,Object.assign({variant:"body",sx:{flexShrink:0,color:"fontTertiary",borderLeft:"1px solid var(--border)",pl:1}},{children:t}))]}))}function at(e){return Object(R.jsx)(R.Fragment,{children:e.children})}function ct(e){var t=e.activeIndex,n=e.children,i=e.containerProps,r=e.onTabChanged,o=Object(U.useState)(t||0),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useMemo)((function(){return U.Children.map(n,(function(e){if(q.a.isValidElement(e))return{title:e.props.title,component:e}}))}),[n]);return Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column"}},{children:[Object(R.jsx)(ce.c,Object.assign({sx:{mb:1}},{children:null===s||void 0===s?void 0:s.map((function(e,t){return Object(R.jsx)(ce.b,Object.assign({sx:{flex:1,p:0,py:1,borderRadius:0,borderTopLeftRadius:"default",borderTopRightRadius:"default",bg:c===t?"bgSecondary":"transparent",fontWeight:c===t?"bold":"normal",color:"text",":last-of-type":{mr:0},borderBottom:"2px solid",borderBottomColor:c===t?"primary":"transparent",":hover":{bg:"hover"}},onClick:function(){l(t),null===r||void 0===r||r(t)}},{children:e.title}),t.toString())}))})),Object(R.jsx)(ce.c,Object.assign({},i,{children:s&&s[c].component}))]}))}function lt(e){var t=e.onClose,n=e.onSizeChanged,i=e.title,r=e.embed,o=Object(U.useState)((null===r||void 0===r?void 0:r.width)||300),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useState)((null===r||void 0===r?void 0:r.height)||150),u=Object(C.a)(s,2),d=u[0],f=u[1],p=Object(U.useState)((null===r||void 0===r?void 0:r.src)||""),b=Object(C.a)(p,2),m=b[0],h=b[1],g=Object(U.useState)("url"),v=Object(C.a)(g,2),j=v[0],O=v[1],x=Object(U.useState)(null),y=Object(C.a)(x,2),k=y[0],w=y[1],S=Object(U.useCallback)((function(e,t){var i=e?{width:e,height:e*(d/c)}:t?{width:t*(c/d),height:t}:{width:0,height:0};l(i.width),f(i.height),n&&n(i)}),[c,d]);return Object(R.jsx)(tt,Object.assign({title:i,onClose:function(){return t()},action:{title:"Save",onClick:function(){w(null);var e=m,n=c,i=d;if("code"===j){var r=(new DOMParser).parseFromString(m,"text/html");if(r.getElementsByTagName("iframe").length<=0)return w("Embed code must include an iframe.");var o=st(r,"src");if(!o)return w("Embed code must include an iframe with an src attribute.");e=o;var a=st(r,"width");a&&!isNaN(parseInt(a))&&(n=parseInt(a));var l=st(r,"height");l&&!isNaN(parseInt(l))&&(i=parseInt(l))}var s=Object(it.a)(e);s&&(e=s),t({height:i,width:n,src:e})}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",width:["auto",300]}},{children:[k&&Object(R.jsxs)(ce.e,Object.assign({variant:"error",sx:{bg:"errorBg",color:"error",p:1,borderRadius:"default"}},{children:["Error: ",k]})),Object(R.jsxs)(ct,Object.assign({activeIndex:0,containerProps:{sx:{mx:1,flexDirection:"column"}},onTabChanged:function(e){return O(0===e?"url":"code")}},{children:[Object(R.jsxs)(at,Object.assign({title:"From URL"},{children:[Object(R.jsx)(nt.b,{placeholder:"Enter embed source URL",value:m,autoFocus:!0,onChange:function(e){return h(e.target.value)},autoCapitalize:"none",sx:{fontSize:"body"}}),Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",mt:1}},{children:[Object(R.jsx)(ot,{containerProps:{sx:{mr:1}},label:"width",type:"number",placeholder:"Width",value:c,sx:{mr:1,fontSize:"body"},onChange:function(e){return S(e.target.valueAsNumber)}}),Object(R.jsx)(ot,{label:"height",type:"number",placeholder:"Height",value:d,sx:{fontSize:"body"},onChange:function(e){return S(void 0,e.target.valueAsNumber)}})]}))]})),Object(R.jsx)(at,Object.assign({title:"From code"},{children:Object(R.jsx)(nt.d,{autoFocus:!0,variant:"forms.input",sx:{fontSize:"subBody",fontFamily:"monospace"},minHeight:[200,100],onChange:function(e){return h(e.target.value)},placeholder:"Paste embed code here. Only iframes are supported."})}))]}))]}))}))}function st(e,t){var n=e.querySelector("[".concat(t,"]"));return n?n.getAttribute(t):null}function ut(e){var t=z(),n=!t,i=t?30:15,r=e.onInsertTable,o=Object(U.useState)({column:0,row:0}),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useState)({columns:10,rows:6}),u=Object(C.a)(s,2),d=u[0],f=u[1];return Object(U.useEffect)((function(){n&&f((function(e){var t=e.columns,n=e.rows,i=c.column,r=c.row,o=r===n-2||i===t-2,a=Number(r===n||r===n-2),l=Number(i===t||i===t-2);return{columns:o?Math.max(i+l,10):Math.min(e.columns+l,20),rows:o?Math.max(r+a,6):Math.min(e.rows+a,20)}}))}),[c,n]),Object(R.jsx)(tt,Object.assign({action:{title:c.column&&c.row?"Insert a ".concat(c.column," x ").concat(c.row," table"):"Please set a table size",disabled:!c.column||!c.row,onClick:function(){return r({columns:c.column,rows:c.row})}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{px:1,pt:1,flexDirection:"column",alignItems:"center"}},{children:[Object(R.jsx)(ce.a,Object.assign({sx:{display:"grid",gridTemplateColumns:"repeat(".concat(d.columns,", minmax(").concat(i,"px, 1fr))"),gap:"small",bg:"background",width:"100%"},onTouchMove:function(e){var t=e.touches.item(0),n=document.elementFromPoint(t.pageX,t.pageY);if(n){var i=n.dataset.index;i&&l(dt(parseInt(i),d))}}},{children:Array(d.columns*d.rows).fill(0).map((function(e,t){return Object(R.jsx)(ce.a,{"data-index":t,height:i||15,sx:{border:"1px solid var(--disabled)",borderRadius:"small",bg:ft(t,c,d)?"disabled":"transparent"},onTouchStart:function(){l(dt(t,d))},onMouseEnter:function(){l(dt(t,d))},onTouchEnd:function(e){e.preventDefault()},onClick:function(){r({columns:c.column,rows:c.row})}},t)}))})),Object(R.jsxs)(ce.c,Object.assign({sx:{display:["flex","none","none"],mt:1,alignItems:"center",justifyContent:"center"}},{children:[Object(R.jsx)(ot,{containerProps:{sx:{mr:1}},label:"columns",placeholder:"".concat(c.column," columns"),type:"number",value:c.column,onChange:function(e){l((function(t){return Object.assign(Object.assign({},t),{column:e.target.valueAsNumber||0})}))}}),Object(R.jsx)(ot,{label:"rows",placeholder:"".concat(c.row," rows"),type:"number",value:c.row,onChange:function(e){l((function(t){return Object.assign(Object.assign({},t),{row:e.target.valueAsNumber||0})}))}})]})),Object(R.jsxs)(ce.e,Object.assign({variant:"body",sx:{mt:1,display:["none","block","block"]}},{children:[c.column," x ",c.row]}))]}))}))}function dt(e,t){var n=e+1,i=n%t.columns,r=n/t.columns,o=Math.floor(r);return r=r===o?r:o+1,{column:i||t.columns,row:r}}function ft(e,t,n){var i=dt(e,n);return i.row<=t.row&&i.column<=t.column}var pt=n(28),bt=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function mt(e){var t=this,n=e.onInsert,i=e.onClose,r=Object(U.useState)(!1),o=Object(C.a)(r,2),a=o[0],c=o[1],l=Object(U.useState)(),s=Object(C.a)(l,2),u=s[0],d=s[1],f=Object(U.useState)(""),p=Object(C.a)(f,2),b=p[0],m=p[1];return Object(R.jsx)(tt,Object.assign({title:"Insert image from URL",onClose:i,action:{loading:a,title:"Insert image",disabled:!b,onClick:function(){return bt(t,void 0,void 0,Object(pt.a)().mark((function e(){var t,i,r,o,a;return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),d(void 0),e.prev=2,e.next=5,fetch(b);case 5:if((t=e.sent).ok){e.next=8;break}return e.abrupt("return",d("invalid status code ".concat(t.status)));case 8:if(i=t.headers.get("Content-Type"),r=t.headers.get("Content-Length"),i&&r&&"0"!==r&&i.startsWith("image/")){e.next=12;break}return e.abrupt("return",d("not an image"));case 12:return o=parseInt(r),e.t0=ht,e.next=16,t.blob();case 16:return e.t1=e.sent,e.next=19,(0,e.t0)(e.t1);case 19:a=e.sent,n({src:a,type:i,size:o}),e.next=26;break;case 23:e.prev=23,e.t2=e.catch(2),e.t2 instanceof Error&&d(e.t2.message);case 26:return e.prev=26,c(!1),e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[2,23,26,29]])})))}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{px:1,flexDirection:"column",width:["auto",350]}},{children:[Object(R.jsx)(nt.b,{type:"url",autoFocus:!0,placeholder:"Paste Image URL here",value:b,onChange:function(e){m(e.target.value),d(void 0)}}),u?Object(R.jsxs)(ce.e,Object.assign({variant:"error",sx:{bg:"errorBg",mt:1,p:1,borderRadius:"default"}},{children:["Failed to download image: ",u.toLowerCase(),"."]})):Object(R.jsx)(ce.e,Object.assign({variant:"subBody",sx:{bg:"shade",color:"primary",mt:1,p:1,borderRadius:"default"}},{children:"To protect your privacy, we will download the image & add it to your attachments."}))]}))}))}function ht(e){return new Promise((function(t,n){var i=new FileReader;i.onload=function(e){return t(i.result)},i.onerror=function(e){return n(i.error)},i.onabort=function(e){return n(new Error("Read aborted"))},i.readAsDataURL(e)}))}var gt=function(e){return{key:"hr",type:"button",title:"Horizontal rule",icon:"horizontalRule",isChecked:null===e||void 0===e?void 0:e.isActive("horizontalRule"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setHorizontalRule().run()}}},vt=function(e){return{key:"codeblock",type:"button",title:"Code block",icon:"codeblock",isChecked:null===e||void 0===e?void 0:e.isActive("codeBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleCodeBlock().run()}}},jt=function(e){return{key:"blockquote",type:"button",title:"Quote",icon:"blockquote",isChecked:null===e||void 0===e?void 0:e.isActive("blockQuote"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleBlockquote().run()}}},Ot=function(e){return{key:"math",type:"button",title:"Math & formulas",icon:"mathBlock",isChecked:null===e||void 0===e?void 0:e.isActive("mathBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().insertMathBlock().run()}}},xt=function(e,t){return{key:"image",type:"button",title:"Image",icon:"image",menu:{title:"Insert an image",items:[{key:"upload-from-disk",type:"button",title:"Upload from disk",icon:"upload",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("image").run()}},{key:"camera",type:"button",title:"Take a photo using camera",icon:"camera",isHidden:!t,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("camera").run()}},t?Lt(e):Rt(e)]}}},yt=function(e){return{key:"table",type:"button",title:"Table",icon:"table",menu:{title:"Insert a table",items:[{key:"table-size-selector",type:"popup",component:function(t){return Object(R.jsx)(ut,{onInsertTable:function(n){var i,r;null===(i=e.current)||void 0===i||i.chain().focus().insertTable({rows:n.rows,cols:n.columns}).run(),null===(r=t.onClick)||void 0===r||r.call(t)}})}}]}}},Ct=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",menu:{title:"Insert an embed",items:[{key:"embed-popup",type:"popup",component:function(t){var n=t.onClick;return Object(R.jsx)(lt,{title:"Insert embed",onClose:function(t){var i;if(!t)return null===n||void 0===n?void 0:n();null===(i=e.current)||void 0===i||i.chain().insertEmbed(t).run(),null===n||void 0===n||n()}})}}]}}},kt=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",onClick:function(){e&&qe({popup:function(t){return Object(R.jsx)(lt,{title:"Insert embed",onClose:function(n){var i;if(!n)return t();null===(i=e.current)||void 0===i||i.chain().insertEmbed(n).run(),t()}})}})}}},wt=function(e){return{key:"attachment",type:"button",title:"Attachment",icon:"attachment",isChecked:null===e||void 0===e?void 0:e.isActive("attachment"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("file").run()}}},St=function(e){return{key:"tasklist",type:"button",title:"Task list",icon:"checkbox",isChecked:null===e||void 0===e?void 0:e.isActive("taskList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleTaskList().run()}}},At=function(e){return{key:"outlinelist",type:"button",title:"Outline list",icon:"outlineList",isChecked:null===e||void 0===e?void 0:e.isActive("outlineList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleOutlineList().run()}}},Lt=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",menu:{title:"Attach image from URL",items:[{key:"attach-image",type:"popup",component:function(t){var n=t.onClick;return Object(R.jsx)(mt,{onInsert:function(t){var i;null===(i=e.requestPermission("insertImage"))||void 0===i||i.chain().focus().insertImage(t).run(),null===n||void 0===n||n()},onClose:function(){null===n||void 0===n||n()}})}}]}}},Rt=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",onClick:function(){qe({popup:function(t){return Object(R.jsx)(mt,{onInsert:function(n){var i;null===(i=e.requestPermission("insertImage"))||void 0===i||i.chain().focus().insertImage(n).run(),t()},onClose:t})}})}}};function Tt(e){var t=e.id,n=e.group,i=e.items,r=e.selectedItem,o=e.buttonRef,a=e.menuWidth,c=Object(U.useRef)(),l=Object(U.useState)(!1),s=Object(C.a)(l,2),u=s[0],d=s[1],f=D(),p=z(),b="bottom"===f,m=Ue({group:n,id:t,isOpen:u,onClosed:function(){return d(!1)}}),h=m.closePopup,g=m.isPopupOpen;return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsxs)(he,Object.assign({ref:function(e){c.current=e,o&&(o.current=e||void 0)},sx:{p:1,m:0,bg:g?"hover":"transparent",mr:1,display:"flex",alignItems:"center",":hover":{bg:"hover"},":last-of-type":{mr:0}},onClick:function(){return d((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()}},{children:["string"===typeof r?Object(R.jsx)(ce.e,Object.assign({sx:{fontSize:"subBody",mr:1,color:"text"}},{children:r})):r,Object(R.jsx)(fe,{path:b?be.chevronUp:be.chevronDown,size:"small",color:"text"})]})),Object(R.jsx)(Xe,{isOpen:g,items:i,onClose:function(){return h(t)},position:{target:b?De():c.current||"mouse",isTargetAbsolute:!0,location:b?"top":"below",align:"center",yOffset:5},blocking:!p,focusOnRender:!p,sx:{minWidth:a,maxWidth:b?"95vw":"auto",flexDirection:b?"row":"column",overflowX:b?"auto":"hidden",marginRight:b?"10px":0,display:"flex",alignItems:b?"center":"unset",mr:b?0:2}})]})}var Pt=q.a.memo((function(e){var t=e.title,n=e.onDecrease,i=e.onIncrease,r=e.onReset,o=e.value;return Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",mr:1,":last-of-type":{mr:0}}},{children:[Object(R.jsx)(ve,{toggled:!1,title:"Decrease ".concat(t),icon:"minus",variant:"small",onClick:n}),Object(R.jsx)(he,Object.assign({sx:{color:"text",bg:"transparent",px:0,fontSize:"subBody",mx:1,textAlign:"center",":hover":{bg:"transparent"}},onClick:r,title:"Reset ".concat(t)},{children:o})),Object(R.jsx)(ve,{toggled:!1,title:"Increase ".concat(t),icon:"plus",variant:"small",onClick:i})]}))}),(function(e,t){return e.value===t.value}));function Et(e){var t=Object(U.useRef)(e);return Object(U.useEffect)((function(){t.current=e}),[e]),t}var Mt={"Sans-serif":"Open Sans",Serif:"serif",Monospace:"monospace"};var It=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Dt(e){var t=e.editor,n=e.alignment,i=It(e,["editor","alignment"]),r=Et(n);return Object(R.jsx)(ve,Object.assign({},i,{onClick:function(){var e;null===(e=t.current)||void 0===e||e.chain().focus().setTextAlign(r.current).run()},toggled:!1}))}var zt=[1,2,3,4,5,6];var Nt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var Ht=q.a.memo((function(e){var t=e.children,n=(e.toggled,e.onOpen),i=Nt(e,["children","toggled","onOpen"]),r=Object(U.useRef)(null),o=D();return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsxs)(ce.c,Object.assign({ref:r,sx:{borderRadius:"default"}},{children:[Object(R.jsx)(ve,Object.assign({},i,{sx:{mr:0,":hover":{bg:"hover"}},toggled:!1})),Object(R.jsx)(he,Object.assign({sx:{flexShrink:0,p:0,m:0,px:"3px",bg:"bgSecondary",":hover":{bg:"hover"},":last-of-type":{mr:0}},onClick:n},{children:Object(R.jsx)(fe,{path:"bottom"===o?be.chevronUp:be.chevronDown,color:"text",size:"small",sx:{flexShrink:0}})}))]})),t]})}),(function(e,t){return e.toggled===t.toggled&&JSON.stringify(e.sx)===JSON.stringify(t.sx)}));function Bt(e,t){var n,i=e.state.selection.$anchor,r=e.state.doc.nodeAt(i.pos),o=t.includes((null===r||void 0===r?void 0:r.type.name)||"")?i.pos:null===(n=Object(u.i)((function(e){return t.includes(e.type.name)}))(e.state.selection))||void 0===n?void 0:n.pos;return o&&e.view.nodeDOM(o)||null}function Ft(e,t){var n,i=e.state.selection.$anchor,r=e.state.doc.nodeAt(i.pos),o=(null===r||void 0===r?void 0:r.type.name)===t?i.pos:null===(n=Object(u.i)((function(e){return e.type.name===t}))(e.state.selection))||void 0===n?void 0:n.pos;return o?e.state.doc.nodeAt(o):null}function _t(e,t){return e.marks.find((function(e){return e.type.name===t}))}function Vt(e){var t=e.selection,n=t.$from,i=t.from;return{node:e.doc.nodeAt(i)||void 0,from:i,to:i+n.node().nodeSize}}function Wt(e){var t=e.isActive("taskList"),n=e.isActive("outlineList");return e.isActive("bulletList")||e.isActive("orderedList")?"listItem":n?"outlineListItem":t?"taskItem":null}var Ut=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var qt=q.a.memo((function(e){var t=e.editor,n=e.onClick,i=(e.isActive,e.subTypes),r=e.type,o=Ut(e,["editor","onClick","isActive","subTypes","type"]),a="bottom"===D(),c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useRef)();return Object(R.jsx)(Ht,Object.assign({},o,{buttonRef:d,onClick:n,toggled:s,sx:{mr:0},onOpen:function(){return u((function(e){return!e}))}},{children:Object(R.jsx)(We,{isOpen:s,group:"lists",id:o.title,blocking:!1,focusOnRender:!1,position:{isTargetAbsolute:!0,target:a?De():d.current||"mouse",align:"center",location:a?"top":"below",yOffset:10},onClosed:function(){return u(!1)},renderPopup:function(){return Object(R.jsx)(ce.a,Object.assign({sx:{bg:"background",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",p:1}},{children:i.map((function(e){return Object(R.jsx)(ce.b,Object.assign({variant:"menuitem",sx:{width:80},onClick:function(){var n,i=null===(n=t.current)||void 0===n?void 0:n.chain().focus();if(i&&t.current)return function(e){var t=e.isActive("taskList"),n=e.isActive("outlineList"),i=e.isActive("bulletList")||e.isActive("orderedList");return t||n||i}(t.current)||(i="bulletList"===r?i.toggleBulletList():i.toggleOrderedList()),i.updateAttributes(r,{listType:e.type}).run()}},{children:Object(R.jsx)($t,{listStyleType:e.type})}),e.title)}))}))}})}))}),(function(e,t){return e.isActive===t.isActive}));function $t(e){var t=e.listStyleType;return Object(R.jsx)(ce.c,Object.assign({as:"ul",sx:{flexDirection:"column",flex:1,p:0,listStyleType:t},onMouseDown:function(e){return e.preventDefault()}},{children:[0,1,2].map((function(e){return Object(R.jsx)(ce.a,Object.assign({as:"li",sx:{display:"list-item",color:"text",fontSize:8,mb:"1px"}},{children:Object(R.jsx)(ce.c,Object.assign({sx:{alignItems:"center"}},{children:Object(R.jsx)(ce.a,{sx:{width:"100%",flexShrink:0,height:4,bg:"#cbcbcb",borderRadius:"small"}})}))}),e.toString())}))}))}var Jt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Gt(e){var t=e.editor,n=e.direction,i=Jt(e,["editor","direction"]),r=Et(n);return Object(R.jsx)(ve,Object.assign({},i,{onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setTextDirection(r.current).run()},toggled:!1}))}var Xt=n(69),Kt=n.n(Xt);var Qt={set:function(e,t){if(!t)return window.localStorage.removeItem(e);window.localStorage.setItem(e,JSON.stringify(t))},get:function(e,t){var n=window.localStorage.getItem(e);return n?function(e){if("undefined"===e||"null"===e)return;try{return JSON.parse(e)}catch(t){return e}}(n):t}};var Yt=n(133);var Zt=["#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#f44336"],en=[35,35,25];function tn(e){var t=e.colors,n=void 0===t?Zt:t,i=e.color,r=e.onClear,o=e.onChange,a=e.title,c=e.onClose,l=e.expanded,s=Object(U.useRef)(),u=Object(U.useState)(l||!1),d=Object(C.a)(u,2),f=d[0],p=d[1],b=Object(U.useState)(Kt()(i||n[0]).toHexString()),m=Object(C.a)(b,2),h=m[0],g=m[1],v=Kt()(h);Object(U.useEffect)((function(){s.current&&f&&s.current.focus({preventScroll:!0})}),[f]);var j=Object(U.useCallback)(function(e,t){var n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];n&&clearTimeout(n),n=setTimeout((function(){return e.apply(void 0,r)}),t)}}((function(e){o(e)}),500),[o]);return Object(R.jsxs)(ce.c,Object.assign({ref:s,tabIndex:-1,sx:{bg:"background",flexDirection:"column",".react-colorful":{width:"auto",height:150},".react-colorful__saturation":{borderRadius:["default",0]},width:["calc(100vw - 20px)",250]}},{children:[c&&Object(R.jsxs)(ce.a,Object.assign({sx:{display:["none","flex"],justifyContent:"space-between",p:2,pb:f?2:0,alignItems:"center"},onClick:c},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"title"},{children:a})),Object(R.jsx)(he,Object.assign({variant:"icon",sx:{p:0}},{children:Object(R.jsx)(fe,{path:be.close,size:"big"})}))]})),f?Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Yt.a,{onChange:function(e){g(e),j(e)},onTouchEnd:function(){return o(h)},onMouseUp:function(){return o(h)}}),Object(R.jsx)(nt.b,{variant:"clean",placeholder:"#000000",spellCheck:!1,sx:{my:2,p:0,borderRadius:0,fontSize:["title","title","body"],color:"fontTertiary",textAlign:"center",letterSpacing:1.5},value:h.toUpperCase(),maxLength:7,onChange:function(e){var t=e.target.value;t&&Kt()(t,{format:"hex"}).isValid()&&(g(t),o(t))}})]}):null,Object(R.jsxs)(ce.c,{children:[Object(R.jsxs)(ce.c,Object.assign({className:"hide-scrollbar",sx:{flex:1,p:1,overflowX:["auto","hidden"],flexWrap:["nowrap","wrap"]}},{children:[Object(R.jsx)(he,Object.assign({variant:"icon",sx:{flexShrink:0,width:en,height:en,borderRadius:50,boxShadow:"menu",p:0,ml:[2,2,1]},onClick:r},{children:Object(R.jsx)(fe,{path:be.colorClear,color:"text",size:15})})),Object(R.jsx)(he,Object.assign({variant:"secondary",sx:{flexShrink:0,bg:h,width:en,height:en,borderRadius:50,p:0,ml:[2,2,1],":hover":{bg:h}},onClick:function(){return p((function(e){return!e}))}},{children:Object(R.jsx)(fe,{path:be.palette,color:v.isDark()?"static":"icon",size:18})})),n.map((function(e){return Object(R.jsx)(he,{sx:{flex:"0 0 auto",bg:e,width:en,height:en,ml:[2,1,1],mb:[0,1,1],borderRadius:50,":hover":{bg:e}},onClick:function(){g(e),o(e)}},e)}))]})),c&&Object(R.jsx)(he,Object.assign({variant:"icon",sx:{display:["block","none"],px:2},onClick:c},{children:Object(R.jsx)(fe,{path:be.close,size:"big"})}))]})]}))}var nn=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function rn(e){e.editor;var t=e.onColorChange,n=e.getActiveColor,i=e.title,r=e.cacheKey,o=nn(e,["editor","onColorChange","getActiveColor","title","cacheKey"]),a=n()||Qt.get(r),c=Kt()(a),l="bottom"===D(),s=Object(U.useState)(!1),u=Object(C.a)(s,2),d=u[0],f=u[1];return Object(R.jsx)(Ht,Object.assign({},o,{iconColor:a&&c.isDark()?"static":"icon",sx:{mr:0,bg:a||"transparent",":hover":{bg:a?c.darken(5).toRgbString():"transparent"}},onOpen:function(){return f((function(e){return!e}))},toggled:d,onClick:function(){return t(a)}},{children:Object(R.jsx)(We,{isOpen:d,id:e.icon,group:"color",position:{isTargetAbsolute:!0,target:De(),align:l?"center":"end",location:l?"top":"below",yOffset:10},focusOnRender:!1,blocking:!1,renderPopup:function(e){return Object(R.jsx)(tn,{color:a,onClear:function(){t(),Qt.set(r,null)},onChange:function(e){t(e),Qt.set(r,e)},onClose:e,title:i})}})}))}var on=n(18);function an(e,t,n,i){return un(e,t,cn(t,n),cn(t,i))}function cn(e,t){for(var n=e.map,i=e.table,r=[],o=0;o<n.height;){var a=o*n.width+t;if(a>=n.map.length)break;var c=n.map[a],l=i.nodeAt(c);l&&(r.push({cell:l,pos:c}),o+=l.attrs.rowspan)}return r}function ln(e,t,n,i){return un(e,t,sn(t,n),sn(t,i))}function sn(e,t){for(var n=e.map,i=e.table,r=[],o=0,a=t*n.width;o<n.width&&!(a>=n.map.length);o++,a++){var c=n.map[a],l=i.nodeAt(c);l&&(r.push({cell:l,pos:c}),o+=l.attrs.colspan-1)}return r}function un(e,t,n,i){if(n.length===i.length){for(var r=e.mapping.maps.length,o=0;o<i.length;++o){var a=n[o],c=i[o],l=e.mapping.slice(r).map(t.tableStart+a.pos),s=l+a.cell.nodeSize,u=e.doc.slice(l,s),d=e.mapping.slice(r).map(t.tableStart+c.pos),f=d+c.cell.nodeSize,p=e.doc.slice(d,f);e.replace(d,f,u),s=(l=e.mapping.slice(r).map(t.tableStart+a.pos))+a.cell.nodeSize,e.replace(l,s,p)}return e}}function dn(e){var t=e.popupId,n=e.editor,i=e.tools,r=e.autoCloseOnUnmount,o="bottom"===D(),a=Object(U.useRef)(),c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1];return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{toggled:s,buttonRef:a,onClick:function(){return u((function(e){return!e}))}})),Object(R.jsx)(We,{isOpen:s,group:"toolbarGroup",id:t,onClosed:function(){return u(!1)},position:{isTargetAbsolute:!0,target:o?De():a.current||"mouse",align:"center",location:o?"top":"below",yOffset:10},autoCloseOnUnmount:r,focusOnRender:!1,blocking:!1,renderPopup:function(){return Object(R.jsx)(ni,{tools:i,editor:n,sx:{flex:1,p:"5px",boxShadow:"menu",bg:"background",borderRadius:"default",overflowX:"auto",maxWidth:"95vw"}})}})]})}function fn(e){return function(t){var n=e(t.editor);return Object(R.jsx)(ve,Object.assign({},t,{icon:n.icon||t.icon,toggled:n.isChecked||!1,title:n.title,onClick:n.onClick}))}}var pn={bold:{icon:"bold",title:"Bold"},italic:{icon:"italic",title:"Italic"},underline:{icon:"underline",title:"Underline"},strikethrough:{icon:"strikethrough",title:"Strikethrough"},addLink:{icon:"link",title:"Link"},editLink:{icon:"linkEdit",title:"Edit link",conditional:!0},removeLink:{icon:"linkRemove",title:"Remove link",conditional:!0},openLink:{icon:"openLink",title:"Open link",conditional:!0},linkSettings:{icon:"linkSettings",title:"Link settings",conditional:!0},code:{icon:"code",title:"Code"},codeRemove:{icon:"codeRemove",title:"Code",conditional:!0},clearformatting:{icon:"formatClear",title:"Clear all formatting"},subscript:{icon:"subscript",title:"Subscript"},superscript:{icon:"superscript",title:"Superscript"},insertBlock:{icon:"plus",title:"Insert",conditional:!0},bulletList:{icon:"bulletList",title:"Bullet list"},numberedList:{icon:"numberedList",title:"Numbered list"},fontFamily:{icon:"fontFamily",title:"Font family"},fontSize:{icon:"fontSize",title:"Font size"},headings:{icon:"heading",title:"Headings"},alignment:{icon:"alignCenter",title:"Alignment"},textDirection:{icon:"ltr",title:"Text direction"},highlight:{icon:"highlight",title:"Highlight"},textColor:{icon:"textColor",title:"Text color"},math:{icon:"math",title:"Math (inline)"},tableSettings:{icon:"tableSettings",title:"Table settings",conditional:!0},columnProperties:{icon:"columnProperties",title:"Column properties",conditional:!0},rowProperties:{icon:"rowProperties",title:"Row properties",conditional:!0},cellProperties:{icon:"cellProperties",title:"Cell properties",conditional:!0},insertColumnLeft:{icon:"insertColumnLeft",title:"Insert column left",conditional:!0},insertColumnRight:{icon:"insertColumnRight",title:"Insert column right",conditional:!0},moveColumnLeft:{icon:"moveColumnLeft",title:"Move column left",conditional:!0},moveColumnRight:{icon:"moveColumnRight",title:"Move column right",conditional:!0},deleteColumn:{icon:"deleteColumn",title:"Delete column",conditional:!0},splitCells:{icon:"splitCells",title:"Split cells",conditional:!0},mergeCells:{icon:"mergeCells",title:"Merge cells",conditional:!0},insertRowAbove:{icon:"insertRowAbove",title:"Insert row above",conditional:!0},insertRowBelow:{icon:"insertRowBelow",title:"Insert row below",conditional:!0},moveRowUp:{icon:"moveRowUp",title:"Move row up",conditional:!0},moveRowDown:{icon:"moveRowDown",title:"Move row down",conditional:!0},deleteRow:{icon:"deleteRow",title:"Delete row",conditional:!0},deleteTable:{icon:"deleteTable",title:"Delete table",conditional:!0},cellBackgroundColor:{icon:"backgroundColor",title:"Cell background color",conditional:!0},cellBorderColor:{icon:"cellBorderColor",title:"Cell border color",conditional:!0},cellTextColor:{icon:"textColor",title:"Cell text color",conditional:!0},cellBorderWidth:{icon:"none",title:"Cell border width",conditional:!0},imageSettings:{icon:"imageSettings",title:"Image settings",conditional:!0},imageAlignCenter:{icon:"alignCenter",title:"Align center",conditional:!0},imageAlignLeft:{icon:"alignLeft",title:"Align left",conditional:!0},imageAlignRight:{icon:"alignRight",title:"Align right",conditional:!0},imageProperties:{icon:"more",title:"Image properties",conditional:!0},attachmentSettings:{icon:"attachmentSettings",title:"Attachment settings",conditional:!0},downloadAttachment:{icon:"download",title:"Download attachment",conditional:!0},removeAttachment:{icon:"delete",title:"Remove attachment",conditional:!0},embedSettings:{icon:"embedSettings",title:"Embed settings",conditional:!0},embedAlignCenter:{icon:"alignCenter",title:"Align center",conditional:!0},embedAlignLeft:{icon:"alignLeft",title:"Align left",conditional:!0},embedAlignRight:{icon:"alignRight",title:"Align right",conditional:!0},embedProperties:{icon:"more",title:"Embed properties",conditional:!0},outdent:{icon:"outdent",title:"Lift list item"},indent:{icon:"indent",title:"Sink list item"}};function bn(e){return pn[e]}function mn(){return gn}var hn=[["insertBlock","tableSettings","imageSettings","embedSettings","attachmentSettings","linkSettings","codeRemove","outdent","indent"]],gn={default:[["bold","italic","underline",["strikethrough","code","subscript","superscript","highlight","textColor","math"]],["fontSize"],["headings","fontFamily"],["numberedList","bulletList"],["addLink"],["alignment","textDirection"],["clearformatting"]],minimal:[["bold","italic","underline","strikethrough","code"],["headings","addLink"],["clearformatting"]]};function vn(e){var t=e.editor,n=e.onClose,i=t.getAttributes("tableCell");return Object(R.jsx)(tt,Object.assign({title:"Cell properties",onClose:n},{children:Object(R.jsxs)(ct,Object.assign({activeIndex:0},{children:[Object(R.jsxs)(at,Object.assign({title:Object(R.jsx)(fe,{title:"Cell background color",path:be.backgroundColor,size:16})},{children:[Object(R.jsx)(ce.a,{mt:2}),Object(R.jsx)(tn,{expanded:!0,color:i.backgroundColor,onChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setCellAttribute("backgroundColor",e)},onClear:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("backgroundColor",void 0)}})]})),Object(R.jsxs)(at,Object.assign({title:Object(R.jsx)(fe,{title:"Cell text color",path:be.textColor,size:16})},{children:[Object(R.jsx)(ce.a,{mt:2}),Object(R.jsx)(tn,{expanded:!0,color:i.color,onChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setCellAttribute("color",e)},onClear:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("color",void 0)}})]})),Object(R.jsxs)(at,Object.assign({title:Object(R.jsx)(fe,{title:"Cell border color",path:be.cellBorderColor,size:16})},{children:[Object(R.jsx)(ce.a,{mt:2}),Object(R.jsx)(tn,{expanded:!0,color:i.borderColor,onChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setCellAttribute("borderColor",e)},onClear:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderColor",void 0)}})]}))]}))}))}function jn(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useMemo)((function(){return[Ln(t),Rn(t),Tn(t),Pn(t),En(t)]}),[]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{buttonRef:n,toggled:o,onClick:function(){return a(!0)}})),Object(R.jsx)(et,{title:"Row properties",mobile:"sheet",desktop:"menu",isOpen:o,onClose:function(){return a(!1)},position:{target:n.current,isTargetAbsolute:!0,location:"below",yOffset:5},items:c})]})}function On(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useMemo)((function(){return[xn(t),yn(t),Cn(t),kn(t),wn(t),{type:"separator",key:"cellSeperator"},An(t),Sn(t),In(t),{type:"separator",key:"tableSeperator"},Mn(t)]}),[]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{buttonRef:n,toggled:o,onClick:function(){return a(!0)}})),Object(R.jsx)(et,{title:"Table properties",mobile:"sheet",desktop:"menu",isOpen:o,onClose:function(){return a(!1)},position:{target:n.current,isTargetAbsolute:!0,location:"below",yOffset:5},items:c})]})}var xn=function(e){return Object.assign(Object.assign({},bn("insertColumnLeft")),{key:"addColumnLeft",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addColumnBefore().run()}})},yn=function(e){return Object.assign(Object.assign({},bn("insertColumnRight")),{key:"addColumnRight",type:"button",title:"Add column right",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addColumnAfter().run()},icon:"insertColumnRight"})},Cn=function(e){return Object.assign(Object.assign({},bn("moveColumnLeft")),{key:"moveColumnLeft",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(0!==n.left){var i=an(t,n,n.left,n.left-1);i&&e.view.dispatch(i)}}(e)}})},kn=function(e){return Object.assign(Object.assign({},bn("moveColumnRight")),{key:"moveColumnRight",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(n.right!==n.map.width){var i=an(t,n,n.left,n.left+1);i&&e.view.dispatch(i)}}(e)}})},wn=function(e){return Object.assign(Object.assign({},bn("deleteColumn")),{key:"deleteColumn",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().deleteColumn().run()}})},Sn=function(e){return Object.assign(Object.assign({},bn("splitCells")),{key:"splitCells",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().splitCell().run()}})},An=function(e){return Object.assign(Object.assign({},bn("mergeCells")),{key:"mergeCells",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().mergeCells().run()}})},Ln=function(e){return Object.assign(Object.assign({},bn("insertRowAbove")),{key:"insertRowAbove",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addRowBefore().run()}})},Rn=function(e){return Object.assign(Object.assign({},bn("insertRowBelow")),{key:"insertRowBelow",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addRowAfter().run()}})},Tn=function(e){return Object.assign(Object.assign({},bn("moveRowUp")),{key:"moveRowUp",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(0!==n.top){var i=ln(t,n,n.top,n.top-1);i&&e.view.dispatch(i)}}(e)}})},Pn=function(e){return Object.assign(Object.assign({},bn("moveRowDown")),{key:"moveRowDown",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(n.top+1!==n.map.height){var i=ln(t,n,n.top,n.top+1);i&&e.view.dispatch(i)}}(e)}})},En=function(e){return Object.assign(Object.assign({},bn("deleteRow")),{key:"deleteRow",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().deleteRow().run()}})},Mn=function(e){return Object.assign(Object.assign({},bn("deleteTable")),{key:"deleteTable",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().deleteTable().run()}})},In=function(e){return Object.assign(Object.assign({},bn("cellProperties")),{key:"cellProperties",type:"button",onClick:function(){qe({popup:function(t){return Object(R.jsx)(vn,{onClose:t,editor:e})}})}})},Dn=fn(xn),zn=fn(yn),Nn=fn(Cn),Hn=fn(kn),Bn=fn(wn),Fn=fn(Sn),_n=fn(An),Vn=fn(Ln),Wn=fn(Rn),Un=fn(Tn),qn=fn(Pn),$n=fn(En),Jn=fn(Mn);function Gn(e){var t=e.height,n=e.width,i=e.float,r=e.editor,o=e.onClose,a=Object(U.useCallback)((function(e,i){var o=e?{width:e,height:e*(t/n)}:i?{width:i*(n/t),height:i}:{width:0,height:0};r.chain().setImageSize(o).run()}),[n,t]);return Object(R.jsx)(tt,Object.assign({title:"Image properties",onClose:o},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{width:["auto",300],flexDirection:"column",p:1}},{children:[Object(R.jsx)(Ye,{children:Object(R.jsxs)(nt.c,Object.assign({variant:"text.body",sx:{justifyContent:"space-between",alignItems:"center"}},{children:["Float image",Object(R.jsx)(nt.a,{checked:i,onClick:function(){return r.chain().setImageAlignment({float:!i,align:"left"}).run()}})]}))}),Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",mt:2}},{children:[Object(R.jsx)(ot,{label:"width",type:"number",value:n,containerProps:{sx:{mr:1}},onChange:function(e){return a(e.target.valueAsNumber)}}),Object(R.jsx)(ot,{label:"height",type:"number",value:t,onChange:function(e){return a(void 0,e.target.valueAsNumber)}})]}))]}))}))}function Xn(e){var t=e.text,n=e.href,i=e.isEditing,r=void 0!==i&&i,o=e.onDone,a=e.onClose,c=Object(U.useState)(n||""),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useState)(t||""),f=Object(C.a)(d,2),p=f[0],b=f[1];return Object(R.jsx)(tt,Object.assign({title:r?"Edit link":"Insert link",onClose:a,action:{title:r?"Save edits":"Insert link",onClick:function(){return o({text:p,href:s})}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{p:1,flexDirection:"column",width:["auto",250]}},{children:[Object(R.jsx)(nt.b,{type:"text",placeholder:"Link text",value:p,onChange:function(e){return b(e.target.value)}}),Object(R.jsx)(nt.b,{type:"url",sx:{mt:1},autoFocus:!0,placeholder:"https://example.com/",value:s,onChange:function(e){return u(e.target.value)}})]}))}))}var Kn=n(41),Qn=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Yn(e){var t=e.editor,n=Et(e.selectedNode||Vt(t.state)),i=Object(U.useCallback)((function(e,i){var r=n.current,o=r.from,a=r.node,c=r.to;if(e&&t.current&&a){var l=_t(a,"link");l&&t.current.chain().command((function(t){var n=t.tr;return n.removeMark(o,c,l.type),n.addMark(o,c,l.type.create({href:e})),n.insertText(i||a.textContent,o,c),Object(Kn.setTextSelection)(n.mapping.map(o))(n),!0})).focus(void 0,{scrollIntoView:!0}).run()}}),[]);return Object(R.jsx)(Zn,Object.assign({},e,{isEditing:!0,onDone:i,onClick:function(){var e=n.current.node;if(e){var t=e.textContent,i=_t(e,"link");if(i)return{text:t,href:i.attrs.href}}}}))}function Zn(e){var t=e.isEditing,n=e.onClick,i=e.onDone,r=e.editor,o=Qn(e,["isEditing","onClick","onDone","editor"]),a=Object(U.useRef)(null),c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useState)(),f=Object(C.a)(d,2),p=f[0],b=f[1],m=Object(U.useState)(),h=Object(C.a)(m,2),g=h[0],v=h[1];return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},o,{buttonRef:a,onClick:function(){var e=n();if(e){var t=e.text,i=e.href;b(i),v(t),u(!0)}},toggled:s})),Object(R.jsx)(et,Object.assign({mobile:"sheet",desktop:"menu",position:{target:a.current||void 0,isTargetAbsolute:!0,location:"below",align:"center",yOffset:5},title:t?"Edit link":"Insert link",isOpen:s,items:[],onClose:function(){var e;u(!1),null===(e=r.current)||void 0===e||e.commands.focus()},focusOnRender:!1},{children:Object(R.jsx)(Xn,{href:p,text:g,isEditing:t,onClose:function(){return u(!1)},onDone:function(e){var t=e.href,n=e.text;i(t,n),u(!1)}})}))]})}var ei={bold:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("bold"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleBold().run()}}))},italic:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("italic"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleItalic().run()}}))},underline:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("underline"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleUnderline().run()}}))},strikethrough:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("strike"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleStrike().run()}}))},code:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("code"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleCode().run()}}))},codeRemove:function(e){var t=e.editor,n="bottom"===D();return t.isActive("code")&&n?Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().unsetMark("code").run()}})):null},subscript:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("subscript"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleSubscript().run()}}))},superscript:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("superscript"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleSuperscript().run()}}))},clearformatting:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().clearNodes().unsetAllMarks().unsetMark("link").run()}}))},addLink:function(e){var t=e.editor,n=e.editor.isActive("link"),i=Object(U.useCallback)((function(e,n){var i,r;if(e){var o=null===(i=t.current)||void 0===i?void 0:i.chain().focus();if(o){var a=!(null===(r=t.current)||void 0===r?void 0:r.state.selection.empty);o.extendMarkRange("link").toggleLink({href:e,target:"_blank"}).insertContent(n||e).focus(),a||(o=o.unsetMark("link").insertContent(" ")),o.run()}}}),[]);return n?Object(R.jsx)(Yn,Object.assign({},e)):Object(R.jsx)(Zn,Object.assign({},e,{onDone:i,onClick:function(){if(t.current){var e=t.current.state,n=e.selection,i=n.from,r=n.to;return{text:e.doc.textBetween(i,r)}}}}))},editLink:Yn,removeLink:function(e){var t=e.editor,n=e.selectedNode;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e,i;n&&(null===(e=t.current)||void 0===e||e.commands.setTextSelection(n.from)),null===(i=t.current)||void 0===i||i.chain().focus().unsetLink().run()}}))},linkSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("link")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"linkSettings",tools:["openLink","editLink","removeLink"]})):null},openLink:function(e){var t=e.editor,n=Et(e.selectedNode||Vt(t.state)).current.node,i=n?_t(n,"link"):null;if(!i)return null;var r=null===i||void 0===i?void 0:i.attrs.href;return Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center"}},{children:[Object(R.jsx)(ce.e,Object.assign({as:"a",href:r,target:"_blank",variant:"body",sx:{mr:1}},{children:r})),Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){return window.open(r,"_blank")}}))]}))},insertBlock:function(e){var t=e.editor,n=Object(U.useRef)(null),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=D(),l=z(),s=Object(U.useMemo)((function(){return[St(t),At(t),gt(t),vt(t),Ot(t),jt(t),xt(t,l),wt(t),l?Ct(t):kt(t),yt(t)]}),[l]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(he,Object.assign({ref:n,sx:{p:1,m:0,bg:o?"hover":"transparent",mr:1,display:"flex",alignItems:"center",":hover":{bg:"hover"},":last-of-type":{mr:0}},onMouseDown:function(e){return e.preventDefault()},onClick:function(){return a((function(e){return!e}))}},{children:Object(R.jsx)(fe,{path:be.plus,size:18,color:"primary"})})),Object(R.jsx)(et,{desktop:"menu",mobile:"sheet",title:"Choose a block to insert",isOpen:o,items:s,onClose:function(){return a(!1)},position:{target:n.current||void 0,isTargetAbsolute:!0,location:"bottom"===c?"top":"below",yOffset:5}})]})},numberedList:function(e){var t=e.editor,n=Object(U.useCallback)((function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleOrderedList().run()}),[]);return Object(R.jsx)(qt,Object.assign({},e,{type:"orderedList",isActive:t.isActive("orderedList"),onClick:n,subTypes:[{type:"decimal",title:"Decimal",items:["1","2","3"]},{type:"upper-alpha",title:"Upper alpha",items:["A","B","C"]},{type:"lower-alpha",title:"Lower alpha",items:["a","b","c"]},{type:"upper-roman",title:"Upper Roman",items:["I","II","III"]},{type:"lower-roman",title:"Lower Roman",items:["i","ii","iii"]},{type:"lower-greek",title:"Lower Greek",items:["\u03b1","\u03b2","\u03b3"]}]}))},bulletList:function(e){var t=e.editor,n=Object(U.useCallback)((function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleBulletList().run()}),[]);return Object(R.jsx)(qt,Object.assign({},e,{type:"bulletList",onClick:n,isActive:t.isActive("bulletList"),subTypes:[{type:"disc",title:"Decimal",items:["1","2","3"]},{type:"circle",title:"Upper alpha",items:["A","B","C"]},{type:"square",title:"Lower alpha",items:["a","b","c"]}]}))},fontSize:function(e){var t=e.editor,n=t.getAttributes("textStyle").fontSize||"16px",i=Et(parseInt(n.replace("px",""))),r=Object(U.useCallback)((function(){return Math.max(8,i.current-1)}),[]),o=Object(U.useCallback)((function(){return Math.min(120,i.current+1)}),[]);return Object(R.jsx)(Pt,{title:"font size",onDecrease:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setFontSize("".concat(r(),"px")).run()},onIncrease:function(){var e;null===(e=t.current)||void 0===e||e.chain().focus().setFontSize("".concat(o(),"px")).run()},onReset:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setFontSize("16px").run()},value:n})},fontFamily:function(e){var t,n,i=e.editor,r=(null===(n=null===(t=Object.entries(Mt).find((function(e){var t=Object(C.a)(e,2),n=(t[0],t[1]);return i.isActive("textStyle",{fontFamily:n})})))||void 0===t?void 0:t.map((function(e){return e})))||void 0===n?void 0:n.at(0))||"Sans-serif",o=Object(U.useMemo)((function(){return function(e,t){var n=[],i=function(i){var r=Mt[i];n.push({key:i,type:"button",title:i,isChecked:i===t,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setFontFamily(r).run()},styles:{fontFamily:r}})};for(var r in Mt)i(r);return n}(i,r)}),[r]);return Object(R.jsx)(Tt,{id:"fontFamily",group:"font",selectedItem:r,items:o,menuWidth:130})},headings:function(e){var t=e.editor,n=D(),i=zt.find((function(e){return t.isActive("heading",{level:e})})),r=Object(U.useMemo)((function(){return function(e,t,n){var i=zt.map((function(i){return{type:"button",key:"heading-".concat(i),title:"bottom"===t?"H".concat(i):"Heading ".concat(i),isChecked:i===n,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().updateAttributes("textStyle",{fontSize:null,fontStyle:null}).setHeading({level:i}).run()}}}));return[{key:"paragraph",type:"button",title:"Paragraph",isChecked:!n,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setParagraph().run()}}].concat(Object(S.a)(i))}(t,n,i)}),[i]);return Object(R.jsx)(Tt,{id:"headings",group:"headings",selectedItem:i?"Heading ".concat(i):"Paragraph",items:r,menuWidth:130})},alignment:function(e){var t=e.editor,n=Object.assign(Object.assign({},t.getAttributes("paragraph")),t.getAttributes("heading")).textAlign,i="left"===n?"center":"center"===n?"right":"right"===n?"justify":"left",r="center"===n?"alignCenter":"justify"===n?"alignJustify":"right"===n?"alignRight":"alignLeft";return Object(R.jsx)(Dt,Object.assign({alignment:i},e,{icon:r}))},textDirection:function(e){var t=e.editor,n=Object.assign(Object.assign({},t.getAttributes("paragraph")),t.getAttributes("heading")).textDirection,i="ltr"===n?"rtl":"ltr",r="ltr"===n?"ltr":"rtl";return Object(R.jsx)(Gt,Object.assign({direction:i},e,{icon:r}))},textColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"textColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("textStyle").color},title:"Text color",onColorChange:function(e){var n,i;return e?null===(n=t.current)||void 0===n?void 0:n.chain().focus().setColor(e).run():null===(i=t.current)||void 0===i?void 0:i.chain().focus().unsetColor().run()}}))},highlight:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"highlight",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("highlight").color},title:"Background color",onColorChange:function(e){var n,i;return e?null===(n=t.current)||void 0===n?void 0:n.chain().focus().toggleHighlight({color:e}).run():null===(i=t.current)||void 0===i?void 0:i.chain().focus().unsetHighlight().run()}}))},math:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().insertMathInline().run()}}))},imageSettings:function(e){var t,n,i=e.editor,r="bottom"===D();return i.isActive("image")&&r?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"imageSettings",tools:(null===(n=null===(t=Ft(i,"image"))||void 0===t?void 0:t.attrs)||void 0===n?void 0:n.float)?["imageAlignLeft","imageAlignRight","imageProperties"]:["imageAlignLeft","imageAlignCenter","imageAlignRight","imageProperties"]})):null},imageAlignCenter:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setImageAlignment({align:"center"}).run()}}))},imageAlignLeft:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setImageAlignment({align:"left"}).run()}}))},imageAlignRight:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setImageAlignment({align:"right"}).run()}}))},imageProperties:function(e){var t=e.editor,n=Object(U.useState)(!1),i=Object(C.a)(n,2),r=i[0],o=i[1],a=Object(U.useRef)(),c=Ft(t,"image"),l=(null===c||void 0===c?void 0:c.attrs)||{},s=l.float,u=l.align,d=l.width,f=l.height;return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({buttonRef:a,toggled:r},e,{onClick:function(){return o((function(e){return!e}))}})),Object(R.jsx)(et,Object.assign({isOpen:r,desktop:"menu",mobile:"sheet",onClose:function(){return o(!1)},blocking:!0,focusOnRender:!1,position:{target:a.current||"mouse",align:"start",location:"below",yOffset:10,isTargetAbsolute:!0}},{children:Object(R.jsx)(Gn,{editor:t,height:f,width:d,align:u,float:s,onClose:function(){return o(!1)}})}))]})},embedAlignCenter:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setEmbedAlignment({align:"center"}).run()}}))},embedAlignLeft:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setEmbedAlignment({align:"left"}).run()}}))},embedAlignRight:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setEmbedAlignment({align:"right"}).run()}}))},embedProperties:function(e){var t=e.editor,n=Object(U.useState)(!1),i=Object(C.a)(n,2),r=i[0],o=i[1],a=Object(U.useRef)(),c=Object(U.useMemo)((function(){return Ft(t,"embed")}),[]),l=(null===c||void 0===c?void 0:c.attrs)||{};return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({buttonRef:a,toggled:r},e,{onClick:function(){return o((function(e){return!e}))}})),Object(R.jsx)(et,Object.assign({isOpen:r,desktop:"menu",mobile:"sheet",onClose:function(){return o(!1)},blocking:!0,focusOnRender:!1,position:{target:a.current||"mouse",align:"start",location:"below",yOffset:10,isTargetAbsolute:!0}},{children:Object(R.jsx)(lt,{title:"Embed properties",onClose:function(e){var n,i;e?e.src!==l.src&&(null===(i=t.current)||void 0===i||i.commands.setEmbedSource(e.src)):null===(n=t.current)||void 0===n||n.commands.setEmbedSize(l),o(!1)},embed:l,onSizeChanged:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setEmbedSize(e)}})}))]})},embedSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("embed")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"embedSettings",tools:[]})):null},attachmentSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("attachment")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"attachmentSettings",tools:["downloadAttachment","removeAttachment"]})):null},downloadAttachment:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e,n=Ft(t,"attachment"),i=(null===n||void 0===n?void 0:n.attrs)||{};null===(e=t.current)||void 0===e||e.chain().focus().downloadAttachment(i).run()}}))},removeAttachment:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().removeAttachment().run()}}))},tableSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("table")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"tableSettings",tools:["insertColumnLeft","insertColumnRight","insertRowAbove","insertRowBelow","cellProperties","columnProperties","rowProperties","deleteRow","deleteColumn","deleteTable"]})):null},columnProperties:function(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useMemo)((function(){return[xn(t),yn(t),Cn(t),kn(t),wn(t)]}),[]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{buttonRef:n,toggled:o,onClick:function(){return a(!0)}})),Object(R.jsx)(et,{title:"Column properties",mobile:"sheet",desktop:"menu",isOpen:o,onClose:function(){return a(!1)},position:{target:n.current,isTargetAbsolute:!0,location:"below",yOffset:5},items:c})]})},rowProperties:jn,cellProperties:function(e){return Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(dn,Object.assign({},e,{popupId:"cellProperties",tools:["mergeCells","splitCells","cellBackgroundColor","cellTextColor","cellBorderColor","cellBorderWidth"]}))})},insertColumnLeft:Dn,insertColumnRight:zn,moveColumnLeft:Nn,moveColumnRight:Hn,deleteColumn:Bn,splitCells:Fn,mergeCells:_n,cellBackgroundColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"cellBackgroundColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("tableCell").backgroundColor},title:"Cell background color",onColorChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.chain().setCellAttribute("backgroundColor",e).run()}}))},cellBorderColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"cellBorderColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("tableCell").borderColor},title:"Cell border color",onColorChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.chain().focus().setCellAttribute("borderColor",e).run()}}))},cellTextColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"cellTextColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("tableCell").color},title:"Cell text color",onColorChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.chain().focus().setCellAttribute("color",e).run()}}))},cellBorderWidth:function(e){var t=e.editor,n=t.getAttributes("tableCell").borderWidth,i=n||1,r=Object(U.useCallback)((function(){return Math.max(1,i-1)}),[i]),o=Object(U.useCallback)((function(){return Math.min(10,i+1)}),[i]);return Object(R.jsxs)(ce.c,Object.assign({sx:{justifyContent:"center",alignItems:"center"}},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"subBody",sx:{mx:1}},{children:"Border width:"})),Object(R.jsx)(Pt,{title:"cell border width",onDecrease:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderWidth",r())},onIncrease:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderWidth",o())},onReset:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderWidth",1)},value:i+"px"})]}))},insertRowAbove:Vn,insertRowBelow:Wn,moveRowUp:Un,moveRowDown:qn,deleteRow:$n,deleteTable:Jn,outdent:function(e){var t=e.editor,n=Ut(e,["editor"]),i="bottom"===D(),r=Wt(t);return r&&i?Object(R.jsx)(ve,Object.assign({},n,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().liftListItem(r).run()}})):null},indent:function(e){var t=e.editor,n=Ut(e,["editor"]),i="bottom"===D(),r=Wt(t);return r&&i?Object(R.jsx)(ve,Object.assign({},n,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().sinkListItem(r).run()}})):null}};var ti=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function ni(e){var t=e.tools,n=e.editor,i=e.force,r=e.selectedNode,o=ti(e,["tools","editor","force","selectedNode"]);return Object(R.jsx)(ce.c,Object.assign({className:"toolbar-group"},o,{children:t.map((function(e){if(Array.isArray(e))return Object(R.jsx)(dn,{title:"More",icon:"more",popupId:e.join(""),tools:e,editor:n},"more-tools");var t=ei[e],o=bn(e);return Object(R.jsx)(t,Object.assign({editor:n,force:i,selectedNode:r},o),o.title)}))}))}function ii(e){var t=e.editor,n=e.node,i=e.selected,r=n.attrs,o=(r.hash,r.filename),a=r.size,c=r.progress,l=Object(U.useRef)();return Object(R.jsx)(R.Fragment,{children:Object(R.jsxs)(ce.a,Object.assign({ref:l,as:"span",contentEditable:!1,variant:"body",sx:{display:"inline-flex",position:"relative",justifyContent:"center",userSelect:"none",alignItems:"center",backgroundColor:"bgSecondary",px:1,borderRadius:"default",border:"1px solid var(--border)",cursor:"pointer",maxWidth:250,borderColor:i?"primary":"border",":hover":{bg:"hover"}},title:o},{children:[Object(R.jsx)(fe,{path:be.attachment,size:14}),Object(R.jsx)(ce.e,Object.assign({as:"span",sx:{ml:"small",fontSize:"body",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},{children:o})),Object(R.jsx)(ce.e,Object.assign({as:"span",sx:{ml:1,fontSize:"0.65rem",color:"fontTertiary",flexShrink:0}},{children:c?"".concat(c,"%"):ri(a)})),Object(R.jsx)(Ye,{children:i&&Object(R.jsx)(ni,{editor:t,tools:["removeAttachment","downloadAttachment"],sx:{boxShadow:"menu",borderRadius:"default",bg:"background",position:"absolute",top:-35}})})]}))})}function ri(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(0===e)return"0B";var n=1024,i=t<0?0:t,r=["B","K","M","G","T","P","E","Z","Y"],o=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,o)).toFixed(i))+r[o]}var oi=u.d.create({name:"attachment",content:"inline*",marks:"",inline:!0,atom:!0,addOptions:function(){return{HTMLAttributes:{},onDownloadAttachment:function(){return!1},onOpenAttachmentPicker:function(){return!1}}},group:function(){return"inline"},draggable:!0,addAttributes:function(){return{progress:{default:0,rendered:!1},hash:ai("hash"),filename:ai("filename"),type:ai("mime"),size:ai("size")}},parseHTML:function(){return[{tag:"span[data-hash]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Object(u.s)(this.options.HTMLAttributes,t)]},addNodeView:function(){return ae(ii,{shouldUpdate:function(e,t){var n=e.attrs,i=t.attrs;return n.progress!==i.progress}})},addCommands:function(){var e=this;return{insertAttachment:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},removeAttachment:function(){return function(e){var t=e.commands;e.tr;return t.deleteSelection()}},downloadAttachment:function(t){return function(n){var i=n.editor;return e.options.onDownloadAttachment(i,t)}},openAttachmentPicker:function(t){return function(n){var i=n.editor;return e.options.onOpenAttachmentPicker(i,t)}},setAttachmentProgress:function(t){return function(n){var i,r=n.state,o=n.tr,a=n.dispatch,c=t.hash,l=t.progress,s=(t.type,Object(u.g)(r.doc,(function(t){return(t.type.name===e.name||"image"===t.type.name)&&t.attrs.hash===c}))),d=Object(k.a)(s);try{for(d.s();!(i=d.n()).done;){var f=i.value;o.setNodeMarkup(f.pos,f.node.type,Object.assign(Object.assign({},f.node.attrs),{progress:100===l?null:l}))}}catch(p){d.e(p)}finally{d.f()}return o.setMeta("preventUpdate",!0),o.setMeta("addToHistory",!1),a&&a(o),!0}}}}});function ai(e,t){return{default:t,parseHTML:function(t){return t.dataset[e]},renderHTML:function(t){return t[e]?Object(w.a)({},"data-".concat(e),t[e]):{}}}}var ci=n(158);var li={a:function(e){var t=e.editor,n=e.selectedNode,i=n.node;return!(null===i||void 0===i?void 0:i.isText)||i.marks.length<=0||!i.marks.some((function(e){return"link"===e.type.name}))?null:Object(R.jsx)(ni,{force:!0,tools:["openLink","editLink","removeLink"],editor:t,selectedNode:n,sx:{bg:"background",boxShadow:"menu",borderRadius:"default",p:1}})}},si=Object.assign({},li);function ui(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useRef)();return Object(U.useEffect)((function(){function e(e){if(e.target&&e.target instanceof HTMLElement&&!e.target.classList.contains("ProseMirror")){var r=e.target;if(i.current){var o=!r.closest(".ProseMirror"),a=r.closest(".popup-presenter-portal"),c=i.current.element===r;if(a)return;if(o||!c)return console.log("HIDING",o,c,r),i.current.hide(),void(i.current=void 0)}clearTimeout(n.current),n.current=setTimeout((function(){var e=r.nodeName.toLowerCase(),n=si[e];if(n&&t.current){var o=t.current.view.posAtDOM(r,0),a=t.current.view.state.doc.nodeAt(o);if(a){var c=qe({popup:function(){return Object(R.jsx)(n,{editor:t,selectedNode:{node:a,from:o,to:o+a.nodeSize}})},blocking:!1,focusOnRender:!1,position:{target:r,align:"center",location:"top",isTargetAbsolute:!0}});i.current={element:r,hide:c}}}}),500,{})}}return window.addEventListener("mouseover",e),function(){window.removeEventListener("mouseover",e)}}),[]),null}function di(e){var t=e.editor,n=t.storage.searchreplace,i=n.selectedText,r=n.results,o=Object(U.useState)(!1),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useState)(!1),u=Object(C.a)(s,2),d=u[0],f=u[1],p=Object(U.useState)(!1),b=Object(C.a)(p,2),m=b[0],h=b[1],g=Object(U.useState)(!1),v=Object(C.a)(g,2),j=v[0],O=v[1],x=Object(U.useState)(!1),y=Object(C.a)(x,2),k=y[0],w=y[1],S=Object(U.useRef)(""),A=Object(U.useRef)(),L=Object(U.useCallback)((function(e){t.commands.search(e,{matchCase:m,enableRegex:k,matchWholeWord:j})}),[m,k,j]);return Object(U.useEffect)((function(){A.current&&L(A.current.value)}),[L,m,j,k]),Object(U.useEffect)((function(){if(i){if(A.current){var e=A.current;setTimeout((function(){e.value=i,e.focus()}),0)}L(i)}}),[i,L]),Object(R.jsx)(ce.c,Object.assign({sx:{p:1,bg:"background",flexDirection:"column",boxShadow:["none","menu"],borderRadius:[0,"default"]}},{children:Object(R.jsxs)(ce.c,{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",flex:1,width:["auto",300],mr:1}},{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{flex:1,position:"relative",alignItems:"center",outline:"1px solid var(--border)",borderRadius:"default",p:1,py:0,":focus-within":{outlineColor:"primary",outlineWidth:"1.8px"},":hover":{outlineColor:"primary"}}},{children:[Object(R.jsx)(nt.b,{variant:"clean",defaultValue:i,ref:A,autoFocus:!0,placeholder:"Find",sx:{p:0},onChange:function(e){L(e.target.value)}}),Object(R.jsxs)(ce.c,Object.assign({sx:{flexShrink:0,mr:0,alignItems:"center"}},{children:[Object(R.jsx)(ve,{sx:{mr:0},toggled:d,title:"Expand",id:"expand",icon:d?"chevronRight":"chevronLeft",onClick:function(){return f((function(e){return!e}))},iconSize:"medium"}),d&&Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,{sx:{mr:0},toggled:m,title:"Match case",id:"matchCase",icon:"caseSensitive",onClick:function(){return h((function(e){return!e}))},iconSize:"medium"}),Object(R.jsx)(ve,{sx:{mr:0},toggled:j,title:"Match whole word",id:"matchWholeWord",icon:"wholeWord",onClick:function(){return O((function(e){return!e}))},iconSize:"medium"}),Object(R.jsx)(ve,{sx:{mr:0},toggled:k,title:"Enable regex",id:"enableRegex",icon:"regex",onClick:function(){return w((function(e){return!e}))},iconSize:"medium"})]}),Object(R.jsxs)(ce.e,Object.assign({variant:"subBody",sx:{flexShrink:0,borderLeft:"1px solid var(--border)",color:"fontTertiary",px:1}},{children:[r?"".concat(r.length):"0",d?"":" results"]}))]}))]})),c&&Object(R.jsx)(nt.b,{sx:{mt:1,p:"7px"},placeholder:"Replace",onChange:function(e){return S.current=e.target.value}})]})),Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column"}},{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",height:"33.2px"}},{children:[Object(R.jsx)(ve,{toggled:c,title:"Toggle replace",id:"toggleReplace",icon:"replace",onClick:function(){return l((function(e){return!e}))},sx:{mr:0},iconSize:"big"}),Object(R.jsx)(ve,{toggled:!1,title:"Previous match",id:"previousMatch",icon:"previousMatch",onClick:function(){return t.commands.moveToPreviousResult()},sx:{mr:0},iconSize:"big"}),Object(R.jsx)(ve,{toggled:!1,title:"Next match",id:"nextMatch",icon:"nextMatch",onClick:function(){return t.commands.moveToNextResult()},sx:{mr:0},iconSize:"big"}),Object(R.jsx)(ve,{toggled:!1,title:"Close",id:"close",icon:"close",onClick:function(){return t.chain().focus().endSearch().run()},sx:{mr:0},iconSize:"big"})]})),c&&Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",height:"33.2px",mt:1}},{children:[Object(R.jsx)(ve,{toggled:!1,title:"Replace",id:"replace",icon:"replaceOne",onClick:function(){return t.commands.replace(S.current)},sx:{mr:0},iconSize:18}),Object(R.jsx)(ve,{toggled:!1,title:"Replace all",id:"replaceAll",icon:"replaceAll",onClick:function(){return t.commands.replaceAll(S.current)},sx:{mr:0},iconSize:18})]}))]}))]})}))}function fi(e){var t=e.editor,n=t.storage.searchreplace.isSearching;return Object(R.jsx)(et,Object.assign({mobile:"sheet",desktop:"menu",isOpen:n,onClose:function(){return t.commands.endSearch()},position:{target:De(),isTargetAbsolute:!0,location:"below",align:"end",yOffset:5},blocking:!1,focusOnRender:!1,draggable:!1},{children:Object(R.jsx)(di,{editor:t})}))}function pi(e){return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(fi,Object.assign({},e)),Object(R.jsx)(Ye,{children:Object(R.jsx)(ui,Object.assign({},e))})]})}var bi=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var mi=function(e){var t=e.editor,n=e.theme,i=e.location,r=e.tools,o=void 0===r?mn().default:r,a=e.sx,c=bi(e,["editor","theme","location","tools","sx"]),l=Object(U.useMemo)((function(){return[].concat(Object(S.a)(hn),Object(S.a)(o))}),[o]),s=z(),u=I((function(e){return e.setToolbarLocation}));return Object(U.useEffect)((function(){u(i)}),[i]),t?Object(R.jsx)(E.a,Object.assign({theme:n},{children:Object(R.jsx)(He.Provider,Object.assign({value:t},{children:Object(R.jsxs)(Be,Object.assign({editor:t},{children:[Object(R.jsx)(ce.c,Object.assign({className:"editor-toolbar",sx:Object.assign(Object.assign({},a),{flexWrap:s?"nowrap":"wrap",overflowX:s?"auto":"hidden"})},c,{children:l.map((function(e){return Object(R.jsx)(ni,{tools:e,editor:t,sx:{flexShrink:0,pr:2,mr:2,borderRight:"1px solid var(--border)",":last-of-type":{mr:0,pr:0,borderRight:"none"}}},e.join(""))}))})),Object(R.jsx)(pi,{editor:t})]}))}))})):null};function hi(e){var t=e.editor,n=e.selected,i=e.onResize,r=e.width,o=e.height,a=e.children;return Object(R.jsx)(ci.a,Object.assign({enable:{bottom:!1,left:!1,right:!1,top:!1,bottomLeft:!1,bottomRight:t.isEditable&&n,topLeft:!1,topRight:!1},size:{height:o||"auto",width:r||"auto"},maxWidth:"100%",minWidth:150,minHeight:150,handleComponent:{bottomRight:Object(R.jsx)(fe,{sx:{width:25,height:25,marginLeft:-17,marginTop:"3px",borderTopLeftRadius:"default",borderBottomRightRadius:"default"},path:be.resize,size:25,color:"primary"})},onResizeStop:function(e,t,n,r){try{i(n.clientWidth,n.clientHeight)}catch(o){}},lockAspectRatio:!0},{children:a}))}var gi=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function vi(e){var t=this,n=e.editor,i=e.updateAttributes,r=e.node,o=e.selected,a=z(),c=r.attrs,l=c.src,s=c.alt,u=c.title,d=c.width,f=c.height,p=c.align,b=c.float,m=Object(U.useRef)();return Object(U.useEffect)((function(){gi(t,void 0,void 0,Object(pt.a)().mark((function e(){return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m.current&&l){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ji(l);case 4:m.current.src=e.sent;case 5:case"end":return e.stop()}}),e)})))}),[l,m]),a&&(b=!1),Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(ce.a,Object.assign({sx:{display:b?"block":"flex",justifyContent:b?"stretch":"center"===p?"center":"left"===p?"start":"end",":hover .drag-handle, :active .drag-handle":{opacity:1}}},{children:Object(R.jsxs)(hi,Object.assign({editor:n,selected:o,width:d,height:f,onResize:function(e,t){i({width:e,height:t},{addToHistory:!0,preventUpdate:!1})}},{children:[Object(R.jsx)(Ye,{children:o&&Object(R.jsx)(ce.c,Object.assign({sx:{position:"relative",justifyContent:"end"}},{children:Object(R.jsx)(ce.c,Object.assign({sx:{position:"absolute",top:-40,mb:2,alignItems:"end"}},{children:Object(R.jsx)(ni,{editor:n,tools:["imageAlignLeft","imageAlignCenter","imageAlignRight","imageProperties"],sx:{boxShadow:"menu",borderRadius:"default",bg:"background"}})}))}))}),o&&Object(R.jsx)(fe,{className:"drag-handle","data-drag-handle":!0,draggable:!0,path:be.dragHandle,sx:{cursor:"grab",position:"absolute",top:2,left:2,zIndex:999}}),Object(R.jsx)(ce.d,Object.assign({"data-drag-image":!0,ref:m,alt:s,src:"/placeholder.svg",title:u,width:"100%",height:"100%",sx:{bg:"bgSecondary",border:o?"2px solid var(--primary)":"2px solid transparent",borderRadius:"default"}},e))]}))}))})}function ji(e){return gi(this,void 0,void 0,Object(pt.a)().mark((function t(){var n,i;return Object(pt.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.startsWith("data:image")){t.next=2;break}return t.abrupt("return",e);case 2:return t.next=4,fetch(e);case 4:return n=t.sent,t.next=7,n.blob();case 7:return i=t.sent,t.abrupt("return",URL.createObjectURL(i));case 9:case"end":return t.stop()}}),t)})))}var Oi=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,xi=u.d.create({name:"image",addOptions:function(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},float:ai("float",!1),align:ai("align","left"),hash:ai("hash"),filename:ai("filename"),type:ai("mime"),size:ai("size")}},parseHTML:function(){return[{tag:this.options.allowBase64?"img":'img:not([src^="data:"])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["img",Object(u.s)(this.options.HTMLAttributes,t)]},addNodeView:function(){return ae(vi)},addCommands:function(){var e=this;return{insertImage:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},setImageAlignment:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},setImageSize:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},updateImage:function(t){return function(n){var i=n.state,r=n.tr,o=n.dispatch,a=t.hash?{key:"hash",value:t.hash}:t.src?{key:"src",value:t.src}:null;if(!a)return!1;var c,l=Object(u.g)(i.doc,(function(t){return t.type.name===e.name&&t.attrs[a.key]===a.value})),s=Object(k.a)(l);try{for(s.s();!(c=s.n()).done;){var d=c.value;r.setNodeMarkup(d.pos,d.node.type,Object.assign(Object.assign({},d.node.attrs),t))}}catch(f){s.e(f)}finally{s.f()}return r.setMeta("preventUpdate",!0),r.setMeta("addToHistory",!1),o&&o(r),!0}}}},addInputRules:function(){return[Object(u.t)({find:Oi,type:this.type,getAttributes:function(e){var t=Object(C.a)(e,5),n=t[2];return{src:t[3],alt:n,title:t[4]}}})]}}),yi=n(134);function Ci(e,t,n){var i=e.state.selection,r=i.empty,o=i.$from;if(!r||!function(e,t,n){var i=n.selection.$from,r=t||n.schema.nodes[e],o=n.schema.nodes.paragraph;return Object(Kn.hasParentNodeOfType)(r)(n.selection)&&i.parent.type===o}(t,n,e.state)||0!==o.parentOffset||!function(e){var t=e.selection.$from;return!(t.depth>1)||(0===t.parentOffset||0===t.index(t.depth-1))}(e.state)||!e.can().liftListItem(n))return!1;var a=function(e,t){var n=Object(Kn.findParentNodeOfType)(e)(t.selection);return!!n&&!n.node.textContent.length}(n,e.state);if(a){if(ki(n,e.state)){var c=wi(n,e.state);return!!c&&e.commands.deleteNode(c.type)}return e.commands.deleteNode(n)}return ki(n,e.state)?e.commands.liftListItem(n):e.chain().joinBackward().joinBackward().run()}var ki=function(e,t){var n=Object(Kn.findParentNodeOfType)(e)(t.selection);if(!n)return!1;var i=n.pos,r=t.doc.resolve(i);return console.log("isFirstOfType",r),!r.nodeBefore},wi=function(e,t){var n,i=Object(Kn.findParentNodeOfType)(e)(t.selection);if(i){var r=i.pos,o=t.doc.resolve(r);if(o.parent.type.spec.group&&!((null===(n=o.parent.type.spec.group)||void 0===n?void 0:n.indexOf("list"))<=-1))return o.parent}};function Si(e){var t=e.editor,n=e.updateAttributes,i=(e.node,e.getPos),r=e.forwardRef,o=e.node.attrs.checked,a=z(),c=Object(U.useCallback)((function(){var e;if(!t.isEditable)return!1;n({checked:!o});var r=i(),a=null===(e=t.current)||void 0===e?void 0:e.state.doc.nodeAt(r);return!!a&&(t.commands.command((function(e){var t=e.tr;return function(e,t,n,i){var r,o=Object(u.g)(e,(function(e){return e.type.name===Ai.name})),a=Object(k.a)(o);try{for(a.s();!(r=a.n()).done;){var c=r.value.pos+i+1;t.setNodeMarkup(c,void 0,{checked:n})}}catch(l){a.e(l)}finally{a.f()}}(a,t,!o,r),!0})),!0)}),[t,i,o]);return Object(R.jsx)(R.Fragment,{children:Object(R.jsxs)(ce.c,Object.assign({"data-drag-image":!0,sx:{bg:"background",borderRadius:"default",":hover > .dragHandle":{opacity:t.isEditable?1:0}}},{children:[Object(R.jsx)(fe,{className:"dragHandle",draggable:"true","data-drag-handle":!0,path:be.dragHandle,sx:{opacity:[1,1,0],alignSelf:"start",mr:2,bg:"transparent",cursor:"grab",".icon:hover path":{fill:"var(--checked) !important"}},size:a?24:20}),Object(R.jsx)(fe,{path:o?be.check:"",stroke:"1px",sx:{border:"2px solid",borderColor:o?"checked":"icon",borderRadius:"default",alignSelf:"start",mr:2,p:"1px",cursor:t.isEditable?"pointer":"unset",":hover":{borderColor:"checked"},":hover .icon path":{fill:"var(--checked) !important"}},onMouseDown:function(e){e.preventDefault(),c()},onTouchEnd:function(e){e.preventDefault(),c()},color:o?"checked":"icon",size:a?16:14}),Object(R.jsx)(ce.e,{as:"div",ref:r,sx:{"> .taskitem-content-wrapper > p":{textDecorationLine:o?"line-through":"none",opacity:o?.8:1},flex:1}})]}))})}var Ai=n(135).a.extend({draggable:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(e){return e.classList.contains("checked")},renderHTML:function(e){return{class:e.checked?"checked":""}}}}},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["li",Object(u.s)(this.options.HTMLAttributes,t,{class:"checklist--item"}),0]},parseHTML:function(){return[{tag:"li",getAttrs:function(e){var t;return e instanceof Node&&e instanceof HTMLElement&&(!(!e.classList.contains("checklist--item")&&!(null===(t=e.parentElement)||void 0===t?void 0:t.classList.contains("checklist")))&&null)},priority:51}]},addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Backspace:function(e){return Ci(e.editor,t.name,t.type)}})},addNodeView:function(){return F(Si,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")},shouldUpdate:function(e,t){var n=e.attrs,i=t.attrs;return n.checked!==i.checked||n.collapsed!==i.collapsed}})}});function Li(e){var t=z(),n=e.editor,i=e.getPos,r=e.node,o=e.updateAttributes,a=e.forwardRef,c=Object(u.p)(Ai.name,n.schema),l=r.attrs,s=l.title,d=l.collapsed,f=Object(U.useState)({checked:0,total:0,percentage:0}),p=Object(C.a)(f,2),b=p[0],m=p[1],h=Object(U.useCallback)((function(){var e=n.state.doc.resolve(i());return Object(Kn.findParentNodeOfTypeClosestToPos)(e,c)}),[]),g=Object(U.useMemo)((function(){return!!h()}),[h]);return Object(U.useEffect)((function(){var e=h();if(e){var t=e.node,i=e.pos,r=function(e,t,n){var i,r=Object(u.g)(e,(function(e){return e.type.name===Ai.name})),o=Object(k.a)(r);try{for(o.s();!(i=o.n()).done;){var a=t+i.value.pos+1,c=n.nodeAt(a);if(!(null===c||void 0===c?void 0:c.attrs.checked))return!1}}catch(l){o.e(l)}finally{o.f()}return!0}(t,i,n.state.doc);t.attrs.checked!==r&&n.commands.command((function(e){return e.tr.setNodeMarkup(i,void 0,{checked:r}),!0}))}}),[r,r.childCount]),Object(U.useEffect)((function(){var e=Object(u.g)(r,(function(e){return e.type.name===Ai.name})),t=e.filter((function(e){return e.node.attrs.checked})).length,n=e.length,i=Math.round(t/n*100);m({checked:t,total:n,percentage:i})}),[g,r]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ce.c,Object.assign({sx:{flexDirection:"column",":hover > div > .toggleSublist":{opacity:1}}},{children:g?Object(R.jsxs)(ce.c,Object.assign({sx:{position:"absolute",top:0,right:0},contentEditable:!1},{children:[d&&Object(R.jsxs)(ce.e,Object.assign({variant:"body",sx:{color:"fontTertiary",mr:35}},{children:[b.checked,"/",b.total]})),Object(R.jsx)(fe,{className:"toggleSublist",path:d?be.chevronDown:be.chevronUp,sx:{opacity:t||d?1:0,position:"absolute",right:0,alignSelf:"start",mr:2,cursor:"pointer",".icon:hover path":{fill:"var(--checked) !important"}},size:t?24:20,onClick:function(){o({collapsed:!d},{addToHistory:!1,preventUpdate:!0})}})]})):Object(R.jsxs)(ce.c,Object.assign({sx:{position:"relative",bg:"bgSecondary",py:1,borderRadius:"default",mb:2,alignItems:"center",justifyContent:"end",overflow:"hidden"},contentEditable:!1},{children:[Object(R.jsx)(ce.a,{sx:{height:"100%",width:"".concat(b.percentage,"%"),position:"absolute",bg:"border",zIndex:0,left:0,transition:"width 250ms ease-out"}}),Object(R.jsx)(nt.b,{readOnly:!n.isEditable,value:s||"",variant:"clean",sx:{p:0,px:2,zIndex:1,color:"fontTertiary"},placeholder:"Untitled",onChange:function(e){o({title:e.target.value},{addToHistory:!0,preventUpdate:!1})}}),Object(R.jsxs)(ce.c,Object.assign({sx:{flexShrink:0,pr:2}},{children:[Object(R.jsx)(fe,{path:be.checkbox,size:15,color:"fontTertiary"}),Object(R.jsxs)(ce.e,Object.assign({variant:"body",sx:{ml:1,color:"fontTertiary"}},{children:[b.checked,"/",b.total]}))]}))]}))})),Object(R.jsx)(ce.e,{as:"div",ref:a,sx:{ul:{display:d?"none":"block",paddingInlineStart:0,marginBlockStart:g?10:0,marginBlockEnd:0,marginLeft:g?-35:0},li:{listStyleType:"none",position:"relative",marginBottom:[2,"7px"]}}})]})}var Ri=yi.a.extend({addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}},title:{default:null,keepOnSplit:!1,parseHTML:function(e){return e.dataset.title},renderHTML:function(e){return!e.title||e.nested?{}:{"data-title":e.title}}}}},parseHTML:function(){return[{tag:"ul",getAttrs:function(e){return e instanceof Node&&e instanceof HTMLElement&&(e.classList.contains("checklist")&&null)},priority:51}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Object(u.s)(this.options.HTMLAttributes,t,{class:"checklist"}),0]},addCommands:function(){var e=this;return{toggleTaskList:function(){return function(t){var n=t.editor,i=t.commands,r=t.state,o=t.tr,a=r.selection,c=a.$from,l=a.$to;i.toggleList(e.name,e.options.itemTypeName);var s={from:o.mapping.map(c.pos),to:o.mapping.map(l.pos)};return setTimeout((function(){return n.commands.setTextSelection(s)}),0),!0}}}},addNodeView:function(){var e=this;return F(Li,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}}),Ti=n(12);function Pi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new T.Plugin({view:function(t){return new Ei(t,e)}})}var Ei=function(){function e(t,n){var i=this;Object(A.a)(this,e),this.editorView=t,this.width=n.width||1,this.color=n.color||"black",this.class=n.class||"",this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var n=function(t){return i[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}return Object(L.a)(e,[{key:"destroy",value:function(){var e=this;this.handlers.forEach((function(t){var n=t.name,i=t.handler;return e.editorView.dom.removeEventListener(n,i)}))}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e&&this.element&&this.element.parentNode?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){if(this.cursorPos){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,i=t.nodeAfter;if(n||i){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(!r)return;var o=r.getBoundingClientRect(),a=n?o.bottom:o.top;if(n&&i){var c=this.editorView.nodeDOM(this.cursorPos);if(!c)return;a=(a+c.getBoundingClientRect().top)/2}e={left:o.left,right:o.right,top:a-this.width/2,bottom:a+this.width/2}}}if(!e){var l=this.editorView.coordsAtPos(this.cursorPos);e={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}var s,u,d=this.editorView.dom.offsetParent;if(!this.element&&d&&(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!d||d==document.body&&"static"==getComputedStyle(d).position)s=-pageXOffset,u=-pageYOffset;else{var f=d.getBoundingClientRect();s=f.left-d.scrollLeft,u=f.top-d.scrollTop}this.element&&(this.element.style.left=e.left-s+"px",this.element.style.top=e.top-u+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px")}}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout||void 0),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,r="function"==typeof i?i(this.editorView,t):i;if(t&&!r){var o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=Object(Ti.h)(this.editorView.state.doc,o,this.editorView.dragging.slice);if(!a)return this.setCursor(null);o=a}this.setCursor(o),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}]),e}(),Mi=u.b.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:null}},addProseMirrorPlugins:function(){return[Pi(this.options)]}}),Ii=function(e,t){return t(e.tr)};var Di=u.b.create({name:"searchreplace",addOptions:function(){return{searchResultClass:"search-result"}},addCommands:function(){var e=this;return{startSearch:function(){return function(t){var n=t.state;return e.storage.isSearching=!0,n.selection.empty||(e.storage.selectedText=n.doc.textBetween(n.selection.$from.pos,n.selection.$to.pos)),!0}},endSearch:function(){return function(t){var n=t.state,i=t.dispatch;return e.storage.isSearching=!1,e.storage.searchTerm="",Ii(n,i),!0}},search:function(t,n){return function(i){var r=i.state,o=i.dispatch;return e.storage.searchTerm=t,e.storage.enableRegex=(null===n||void 0===n?void 0:n.enableRegex)||!1,e.storage.matchCase=(null===n||void 0===n?void 0:n.matchCase)||!1,e.storage.matchWholeWord=(null===n||void 0===n?void 0:n.matchWholeWord)||!1,e.storage.results=[],Ii(r,o),!0}},moveToNextResult:function(){return function(t){var n=t.chain,i=e.storage,r=i.selectedIndex,o=i.results;if(!o||o.length<=0)return!1;var a=r+1;(isNaN(a)||a>=o.length)&&(a=0);var c=o[a],l=c.from,s=c.to;console.log("[moveToNextResult]",l,s);var u=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:s}).run();return u&&(e.storage.selectedIndex=a),u}},moveToPreviousResult:function(){return function(t){var n=t.chain,i=e.storage,r=i.selectedIndex,o=i.results;if(!o||o.length<=0)return!1;var a=r-1;(isNaN(a)||a<0)&&(a=o.length-1);var c=o[a],l=c.from,s=c.to,u=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:s}).run();return u&&(e.storage.selectedIndex=a),u}},replace:function(t){return function(n){var i=n.commands,r=n.tr,o=n.dispatch,a=e.storage,c=a.selectedIndex,l=a.results;if(!o||!l||l.length<=0)return!1;var s=void 0===c?0:c,u=l[s],d=u.from,f=u.to;if(r.insertText(t,d,f),s+1<l.length){var p=l[s+1],b=p.from,m=p.to,h=l[s+1]={from:r.mapping.map(b),to:r.mapping.map(m)};i.focus(),r.setSelection(new T.TextSelection(r.doc.resolve(h.from),r.doc.resolve(h.to)))}return o(r),l.splice(s,1),!0}},replaceAll:function(t){return function(n){n.state;var i=n.tr,r=n.dispatch;if(!r)return!1;var o=e.storage.results;return!(!r||!o||o.length<=0)&&(r(function(e,t,n){if(t.length){for(var i=n.mapping,r=0;r<t.length;r+=1){var o=t[r],a=o.from,c=o.to;if(n.insertText(e,a,c),r+1<t.length){var l=t[r+1],s=l.from,u=l.to;t[r+1]={from:i.map(s),to:i.map(u)}}}return n}}(t,o,i)),!0)}}}},addKeyboardShortcuts:function(){return{"Mod-f":function(e){return e.editor.commands.startSearch()},Escape:function(e){return e.editor.commands.endSearch()}}},addProseMirrorPlugins:function(){var e=this,t=new T.PluginKey("searchreplace");return[new T.Plugin({key:t,state:{init:function(){return P.b.empty},apply:function(t){var n=t.doc,i=t.docChanged,r=(t.setSelection,e.storage),o=r.searchTerm,a=r.enableRegex,c=r.matchCase,l=r.matchWholeWord,s=e.options.searchResultClass;if(i||o){var u=o?function(e,t){var n=t.enableRegex,i=t.matchCase,r=t.matchWholeWord?"\\b":"";return console.log(r),RegExp(r+(n?e:e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))+r,i?"gu":"gui")}(o,{enableRegex:a,matchCase:c,matchWholeWord:l}):void 0,d=function(e,t,n){if(!n)return{decorationSet:P.b.empty,results:[]};var i=[],r=[],o=0,a=[];null===e||void 0===e||e.descendants((function(e,t){e.isText?a[o]?a[o]={text:a[o].text+e.text,pos:a[o].pos}:a[o]={text:e.text||"",pos:t}:o+=1})),a=a.filter(Boolean);var c,l=Object(k.a)(a);try{for(l.s();!(c=l.n()).done;){var s,u=c.value,d=u.text,f=u.pos,p=d.matchAll(n),b=Object(k.a)(p);try{for(b.s();!(s=b.n()).done;){var m=s.value;if(""===m[0])break;void 0!==m.index&&r.push({from:f+m.index,to:f+m.index+m[0].length})}}catch(x){b.e(x)}finally{b.f()}}}catch(x){l.e(x)}finally{l.f()}for(var h=0,g=r;h<g.length;h++){var v=g[h],j=v.from,O=v.to;i.push(P.a.inline(j,O,{class:t}))}return{decorationSet:P.b.create(e,i),results:r}}(n,s,u),f=d.decorationSet,p=d.results;return e.storage.results=p,f}return P.b.empty}},props:{decorations:function(e){return t.getState(e)}}})]}});function zi(e){var t=e.editor,n=e.updateAttributes,i=e.selected,r=e.node,o=Object(U.useState)(!0),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useRef)(),u=r.attrs,d=u.src,f=u.width,p=u.height,b=u.align;return Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(ce.a,Object.assign({sx:{display:"flex",justifyContent:"center"===b?"center":"left"===b?"start":"end",position:"relative"}},{children:Object(R.jsxs)(hi,Object.assign({editor:t,selected:i,width:f,height:p,onResize:function(e,t){n({width:e,height:t},{addToHistory:!0,preventUpdate:!1})}},{children:[Object(R.jsxs)(ce.c,Object.assign({width:"100%",sx:{position:"relative",justifyContent:"end",p:"small",bg:t.isEditable?"bgSecondary":"transparent",borderTopLeftRadius:"default",borderTopRightRadius:"default",borderColor:i?"border":"bgSecondary",cursor:"pointer",":hover":{borderColor:"border"}}},{children:[Object(R.jsx)(fe,{path:be.dragHandle,size:"big"}),Object(R.jsx)(Ye,{children:i&&Object(R.jsx)(ce.c,Object.assign({sx:{position:"relative",justifyContent:"end"}},{children:Object(R.jsx)(ce.c,Object.assign({sx:{position:"absolute",top:-10,mb:2,alignItems:"end"}},{children:Object(R.jsx)(ni,{editor:t,tools:["embedAlignLeft","embedAlignCenter","embedAlignRight","embedProperties"],sx:{boxShadow:"menu",borderRadius:"default",bg:"background"}})}))}))})]})),Object(R.jsx)(ce.a,Object.assign({as:"iframe",ref:s,src:d,width:"100%",height:"100%",sx:{bg:"bgSecondary",border:i?"2px solid var(--primary)":"2px solid transparent",borderRadius:"default"},onLoad:function(){return l(!1)}},e)),c&&Object(R.jsx)(ce.c,Object.assign({sx:{position:"absolute",bottom:0,width:"100%",height:"calc(100% - 20px)",alignItems:"center",justifyContent:"center"}},{children:Object(R.jsx)(fe,{path:be.loading,rotate:!0,size:32,color:"disabled"})}))]}))}))})}var Ni=u.d.create({name:"embed",content:"",marks:"",draggable:!0,addOptions:function(){return{HTMLAttributes:{}}},group:function(){return"block"},addAttributes:function(){return{src:{default:null},width:{default:null},height:{default:null},align:{default:"left"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",Object(u.s)(this.options.HTMLAttributes,t)]},addNodeView:function(){return ae(zi)},addCommands:function(){var e=this;return{insertEmbed:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},setEmbedAlignment:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},setEmbedSize:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},setEmbedSource:function(t){return function(n){return n.commands.updateAttributes(e.name,{src:t})}}}}}),Hi=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))},Bi={};function Fi(e){return Hi(this,void 0,void 0,Object(pt.a)().mark((function t(){var n,i;return Object(pt.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Bi[e]){t.next=2;break}return t.abrupt("return",Bi[e]);case 2:return n="https://esm.sh/[email protected]/lang/".concat(e,".js?bundle=true"),t.next=5,_i(e,n);case 5:return i=t.sent,Bi[e]=i,t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})))}function _i(e,t){return Hi(this,void 0,void 0,Object(pt.a)().mark((function n(){return Object(pt.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n,i){var r="on".concat(e,"Loaded"),o=document.createElement("script");o.type="module",o.innerHTML='\n import LanguageDefinition from "'.concat(t,'";\n if (window["').concat(r,'"]) {\n window["').concat(r,'"](LanguageDefinition)\n }\n'),window[r]=function(e){o.remove(),window[r]=null,n(e)},document.head.appendChild(o)})));case 1:case"end":return n.stop()}}),n)})))}var Vi=n(76),Wi=n(78),Ui=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function qi(e){var t=e.editor,n=e.updateAttributes,i=e.node,r=e.forwardRef,o=null===i||void 0===i?void 0:i.attrs,a=o.language,c=o.indentLength,l=o.indentType,s=o.caretPosition,u=Object(U.useState)(!1),d=Object(C.a)(u,2),f=d[0],p=d[1],b=Object(U.useRef)(null),m=Wi.find((function(e){var t;return e.filename===a||(null===(t=e.alias)||void 0===t?void 0:t.some((function(e){return e===a})))}));return Object(U.useEffect)((function(){!function(){Ui(this,void 0,void 0,Object(pt.a)().mark((function e(){var t,i;return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a&&m&&!Bi[a]){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Fi(m.filename);case 4:if(t=e.sent){e.next=7;break}return e.abrupt("return");case 7:Vi.a.register(t),i=a===m.filename,n({language:m.filename},{preventUpdate:i,addToHistory:!1});case 10:case"end":return e.stop()}}),e)})))}()}),[a]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",borderRadius:"default",overflow:"hidden"}},{children:[Object(R.jsx)(ce.e,{ref:r,as:"pre",autoCorrect:"off",autoCapitalize:"none",sx:{"div, span.token, span.line-number-widget, span.line-number::before":{fontFamily:"monospace",fontSize:"code",whiteSpace:"pre !important",tabSize:1},position:"relative",lineHeight:"20px",bg:"codeBg",color:"static",overflowX:"auto",display:"flex",px:2,pt:2,pb:1},spellCheck:!1}),Object(R.jsxs)(ce.c,Object.assign({ref:b,contentEditable:!1,sx:{bg:"codeBg",alignItems:"center",justifyContent:"flex-end",borderTop:"1px solid var(--codeBorder)"}},{children:[s?Object(R.jsxs)(ce.e,Object.assign({variant:"subBody",sx:{mr:2,color:"codeFg"}},{children:["Line ",s.line,", Column ",s.column," ",s.selected?"(".concat(s.selected," selected)"):""]})):null,Object(R.jsx)(he,Object.assign({variant:"icon",sx:{p:1,mr:1,":hover":{bg:"codeSelection"}},title:"Toggle indentation mode",onClick:function(){t.commands.changeCodeBlockIndentation({type:"space"===l?"tab":"space",amount:c})}},{children:Object(R.jsxs)(ce.e,Object.assign({variant:"subBody",sx:{color:"codeFg"}},{children:["space"===l?"Spaces":"Tabs",": ",c]}))})),Object(R.jsx)(he,Object.assign({variant:"icon",sx:{p:1,mr:1,bg:f?"codeSelection":"transparent",":hover":{bg:"codeSelection"}},onClick:function(){p(!0)},title:"Change language"},{children:Object(R.jsx)(ce.e,Object.assign({variant:"subBody",spellCheck:!1,sx:{color:"codeFg"}},{children:(null===m||void 0===m?void 0:m.title)||"Plaintext"}))}))]}))]})),Object(R.jsx)(et,Object.assign({isOpen:f,onClose:function(){p(!1),t.commands.focus()},focusOnRender:!1,mobile:"sheet",desktop:"menu",position:{target:b.current||void 0,align:"end",isTargetAbsolute:!0,location:"top",yOffset:5},title:"Change code block language"},{children:Object(R.jsx)($i,{selectedLanguage:(null===m||void 0===m?void 0:m.filename)||"Plaintext",onLanguageSelected:function(e){n({language:e},{addToHistory:!0,preventUpdate:!1}),p(!1)},onClose:function(){return p(!1)}})}))]})}function $i(e){var t=e.onLanguageSelected,n=e.selectedLanguage,i=e.onClose,r=Object(U.useState)(Wi),o=Object(C.a)(r,2),a=o[0],c=o[1];return Object(R.jsx)(tt,Object.assign({title:"Select language",onClose:i},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",height:200,width:["auto",300],overflowY:"auto",bg:"background"}},{children:[Object(R.jsx)(nt.b,{onFocus:function(){console.log("EHLLO!")},autoFocus:!0,placeholder:"Search languages",sx:{width:"auto",position:"sticky",top:0,bg:"background",mx:2,p:"7px",zIndex:999},onChange:function(e){if(!e.target.value)return c(Wi);var t=e.target.value.toLowerCase();c(Wi.filter((function(e){var n;return e.title.toLowerCase().indexOf(t)>-1||(null===(n=e.alias)||void 0===n?void 0:n.some((function(e){return e.toLowerCase().indexOf(t)>-1})))})))}}),Object(R.jsx)(ce.c,Object.assign({sx:{flexDirection:"column",pt:1,mt:1}},{children:a.map((function(e){return Object(R.jsxs)(he,Object.assign({variant:"menuitem",sx:{textAlign:"left",py:1,display:"flex",justifyContent:"space-between",alignItems:"center"},onClick:function(){return t(e.filename)}},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"body"},{children:e.title})),n===e.filename?Object(R.jsx)(fe,{path:be.check,size:"small"}):e.alias?Object(R.jsx)(ce.e,Object.assign({variant:"subBody",sx:{fontSize:"10px"}},{children:e.alias.slice(0,3).join(", ")})):null]}),e.title)}))}))]}))}))}function Ji(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.reduce((function(e,n){if("comment"===n.type||"doctype"===n.type)return e;var i=Object(S.a)(t);return"element"===n.type&&n.properties?i.push.apply(i,Object(S.a)(n.properties.className)):i.push("token","text"),"element"===n.type?e.push.apply(e,Object(S.a)(Ji(n.children,i))):e.push({classes:i,text:n.value}),e}),[])}function Gi(e,t,n,i){var r=String(n).length,o={class:"line-number ".concat(i?"active":""),"data-line":String(t).padEnd(r," ")},a={line:t,active:i,total:n,from:e};return P.a.inline(e,e+1,o,a)}function Xi(e){var t=e.doc,n=e.name,i=e.defaultLanguage,r=e.caretPosition,o=[],a=Vi.a.listLanguages();return Object(u.g)(t,(function(e){return e.type.name===n})).forEach((function(e){var t,n=e.node.textContent,c=rr(n,e.pos),l=Object(k.a)(c||[]);try{for(l.s();!(t=l.n()).done;){var s=t.value,u=s.index+1,d=u===(null===r||void 0===r?void 0:r.line)&&s.from===(null===r||void 0===r?void 0:r.from),f=Gi(s.from,u,(null===c||void 0===c?void 0:c.length)||0,d);o.push(f)}}catch(h){l.e(h)}finally{l.f()}var p=e.node.attrs.language||i,b=a.includes(p)?Vi.a.highlight(n,p).children||[]:null;if(b){var m=e.pos+1;Ji(b).forEach((function(e){var t=m+e.text.length;if(e.classes.length){var n=P.a.inline(m,t,{class:e.classes.join(" ")});o.push(n)}m=t}))}})),P.b.create(t,o)}function Ki(e){var t=e.name,n=e.defaultLanguage,i=new T.PluginKey("highlighter");return new T.Plugin({key:i,state:{init:function(e,i){return Xi({doc:i.doc,name:t,defaultLanguage:n})},apply:function(e,i,r,o){var a=r.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=Object(u.g)(r.doc,(function(e){return e.type.name===t})),s=Object(u.g)(o.doc,(function(e){return e.type.name===t})),d=ir(o.selection);return e.docChanged&&([a,c].includes(t)||s.length!==l.length||e.steps.some((function(e){return void 0!==e.from&&void 0!==e.to&&l.some((function(t){return t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to}))})))?Xi({doc:e.doc,name:t,defaultLanguage:n,caretPosition:d}):(i=function(e,t,n){var i=t.find(void 0,void 0,(function(e){var t=e.line,i=e.active,r=e.from;return!!n&&(t===n.line&&r===n.from)||i}));if(!i.length)return t;var r=i.slice();t=t.remove(i);var o,a=[],c=Object(k.a)(r);try{for(c.s();!(o=c.n()).done;){var l=o.value,s=l.from,u=l.spec,d=u.line,f=u.total,p=d===(null===n||void 0===n?void 0:n.line),b=Gi(s,d,(null===n||void 0===n?void 0:n.total)||f,p);a.push(b)}}catch(m){c.e(m)}finally{c.f()}return t.add(e,a)}(e.doc,i,d),i.map(e.mapping,e.doc))}},props:{decorations:function(e){return i.getState(e)}},appendTransaction:function(e,n,i){var r=i.tr,o=!1,a=e.some((function(e){return e.docChanged})),c=(i.selection.$from.parent.type.name===t||n.selection.$from.parent.type.name===t)&&n.selection.$from.pos!==i.selection.$from.pos;return Object(u.g)(i.doc,(function(e){return e.type.name===t})).forEach((function(e){var t,n=e.node,l=e.pos,s=Object.assign({},n.attrs);if(a||!(null===(t=s.lines)||void 0===t?void 0:t.length)){var u=rr(n.textContent,l);s.lines=u.slice()}if(c){var d=ir(i.selection,a?rr(n.textContent,l):void 0);s.caretPosition=d}(a||c)&&(r.setNodeMarkup(l,n.type,s),o=!0)})),o?r:null}})}var Qi=n(136),Yi=n(157),Zi=n(91),er=/^```([a-z]+)?[\s\n]$/,tr=/^~~~([a-z]+)?[\s\n]$/,nr=u.d.create({name:"codeblock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{caretPosition:{default:void 0,rendered:!1},lines:{default:[],rendered:!1},indentType:{default:"space",parseHTML:function(e){return e.dataset.indentType},renderHTML:function(e){return e.indentType?{"data-indent-type":e.indentType}:{}}},indentLength:{default:2,parseHTML:function(e){return e.dataset.indentLength},renderHTML:function(e){return e.indentLength?{"data-indent-length":e.indentLength}:{}}},language:{default:null,parseHTML:function(t){var n,i=e.options.languageClassPrefix,r=[].concat(Object(S.a)(t.classList||[]),Object(S.a)((null===(n=null===t||void 0===t?void 0:t.firstElementChild)||void 0===n?void 0:n.classList)||[])).filter((function(e){return e.startsWith(i)})).map((function(e){return e.replace(i,"")}))[0];return r||null},renderHTML:function(e){return e.language?{class:"language-".concat(e.language)}:{}}}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["pre",Object(u.s)(this.options.HTMLAttributes,t),["code",{},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){return n.commands.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){var i=n.commands;return console.log("TOGGLING!"),i.toggleNode(e.name,"paragraph",t)}},changeCodeBlockIndentation:function(t){return function(n){var i=n.editor,r=n.tr,o=n.commands,a=i.state.selection.$from;if(a.parent.type!==e.type)return!1;var c,l=a.parent.attrs.lines,s=Object(k.a)(l);try{for(s.s();!(c=s.n()).done;){var u=c.value,d=u.text(),f=d.length-d.trimStart().length;if(f){var p=f,b=lr({type:t.type,amount:p});r.insertText(b,r.mapping.map(u.from),r.mapping.map(u.from+f))}}}catch(m){s.e(m)}finally{s.f()}return o.updateAttributes(e.type,{indentType:t.type,indentLength:t.amount}),!0}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},"Mod-a":function(t){var n=t.editor,i=e.editor.state.selection.$anchor;if(i.parent.type.name!==e.name)return!1;var r=Object(u.j)(i,(function(t){return t.type.name===e.type.name}));return!!r&&n.commands.setTextSelection({from:r.pos+1,to:r.pos+r.node.nodeSize-1})},Backspace:function(){var t=e.editor.state.selection,n=t.empty,i=t.$anchor,r=i.parent,o=e.editor.state.doc.nodeAt(i.pos+1),a=function(t){return t&&t.type.name===e.name},c=1===i.pos;return!!n&&(c||a(r)&&!r.textContent.length?e.editor.commands.deleteNode(e.type):!(!o||!a(o)||o.textContent.length)&&e.editor.commands.command((function(e){return e.tr.delete(i.pos+1,i.pos+1+o.nodeSize),!0})))},Enter:function(t){var n=t.editor,i=n.state.selection,r=i.$from;if(!i.empty||r.parent.type!==e.type)return!1;var o=ar(r.parent);return e.options.exitOnTripleEnter&&function(e,t){var n=t.parentOffset===t.parent.nodeSize-2,i=t.parent.textContent.endsWith("\n\n");if(!n||!i)return!1;return e.chain().command((function(e){return e.tr.delete(t.pos-2,t.pos),!0})).exitCode().run()}(n,r)||function(e,t,n){var i=function(e,t){var n=function(e,t){return e.find((function(e){return t>=e.from&&t<=e.to}))}(e.parent.attrs.lines,e.pos);if(!n)return!1;var i=n.text(),r=i.length-i.trimStart().length;return{newline:"\n",indentation:lr({amount:r,type:t.type})}}(t,n)||{},r=i.indentation,o=i.newline;return!!o&&e.chain().insertContent("".concat(o).concat(r),{parseOptions:{preserveWhitespace:"full"}}).focus().run()}(n,r,o)},ArrowUp:function(t){var n=t.editor;if(!e.options.exitOnArrowUp)return!1;var i=n.state.selection,r=i.$anchor;return!(!i.empty||r.parent.type!==e.type)&&(!(1!==r.pos)&&n.commands.insertContentAt(0,"<p></p>"))},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var i=n.state,r=i.selection,o=i.doc,a=r.$from;if(!r.empty||a.parent.type!==e.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var c=a.after();return void 0!==c&&(o.nodeAt(c)?(n.commands.setNodeSelection(a.before()),!1):n.commands.exitCode())},"Shift-Tab":function(t){var n=t.editor,i=n.state.selection,r=i.$from;if(r.parent.type!==e.type)return!1;var o=ar(r.parent),a=lr(o),c=or(r.parent.attrs.lines,i);return n.chain().command((function(e){return sr(e.tr,(function(e){var t,n=Object(k.a)(c);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.text(a.length)===a&&e.delete(e.mapping.map(i.from),e.mapping.map(i.from+o.amount))}}catch(r){n.e(r)}finally{n.f()}}))})).run()},Tab:function(t){var n=t.editor,i=n.state.selection,r=i.$from;if(r.parent.type!==e.type)return!1;var o=or(r.parent.attrs.lines,i);return n.chain().command((function(e){return sr(e.tr,(function(e){var t=lr(ar(r.parent));if(1===o.length)return e.insertText(t,r.pos);var n,i=Object(k.a)(o);try{for(i.s();!(n=i.n()).done;){var a=n.value;e.insertText(t,e.mapping.map(a.from))}}catch(c){i.e(c)}finally{i.f()}}))})).run()}}},addInputRules:function(){return[Object(u.v)({find:er,type:this.type,getAttributes:function(e){return{language:e[1]}}}),Object(u.v)({find:tr,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new T.Plugin({key:new T.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;var i=n.clipboardData.getData("text/plain"),r=n.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,a=null===o||void 0===o?void 0:o.mode;if(!i||!a)return!1;var c=function(e,t){var n=t||Object(Qi.a)(e),i=n.amount,r=n.type,o=void 0===r?"space":r,a=Object(Yi.a)(e,i,{includeEmptyLines:!1,indent:"space"===o?" ":"\t"});return{code:Object(Zi.a)(a),amount:i,type:o}}(i,ar(t.state.selection.$from.parent)),l=t.state.tr;return e.editor.isActive(e.type.name)||l.replaceSelectionWith(e.type.create({language:a,indentType:c.type,indentLength:c.amount})),l.insertText(c.code.replace(/\r\n?/g,"\n")),l.setMeta("paste",!0),t.dispatch(l),!0}}}),Ki({name:this.name,defaultLanguage:"txt"})]},addNodeView:function(){return F(qi,{contentDOMFactory:function(){var e=document.createElement("div");return e.classList.add("node-content-wrapper"),e.style.whiteSpace="inherit",e.style.minWidth="20px",{dom:e}},shouldUpdate:function(e,t){var n=e.attrs,i=t.attrs;return function(e,t){return void 0===t||(null===e||void 0===e?void 0:e.column)!==(null===t||void 0===t?void 0:t.column)||(null===e||void 0===e?void 0:e.line)!==(null===t||void 0===t?void 0:t.line)}(n.caretPosition,i.caretPosition)||n.language!==i.language||n.indentType!==i.indentType}})}});function ir(e,t){var n=e.$from,i=e.$to,r=e.$head;if(n.parent.type.name===nr.name){t=t||(n.parent.attrs.lines||[]);var o,a=Object(k.a)(t);try{for(a.s();!(o=a.n()).done;){var c=o.value;if(r.pos>=c.from&&r.pos<=c.to){var l=c.length+1;return{line:c.index+1,column:l-(c.to-r.pos),selected:i.pos-n.pos,total:t.length,from:c.from}}}}catch(s){a.e(s)}finally{a.f()}}}function rr(e,t){for(var n=[],i=0,r=t+1,o=0,a=function(){var t=e.indexOf("\n",i);t<=-1&&(t=e.length);var a=t-i,c=r+a,l=i;n.push({index:o,length:a,from:r,to:c,text:function(t){return e.slice(l,t?l+t:l+a)}}),r=c+1,i=t+1,++o};i<=e.length;)a();return n}function or(e,t){var n=t.$from,i=t.$to;return e.filter((function(e){return cr(e.from,n.pos,i.pos)||cr(e.to,n.pos,i.pos)||cr(n.pos,e.from,e.to)}))}function ar(e){if(e.type.name===nr.name){var t=e.attrs,n=t.indentType,i=t.indentLength;return{type:n,amount:parseInt(i)}}}function cr(e,t,n){return e>=t&&e<=n}function lr(e){return("space"===e.type?" ":"\t").repeat(e.amount)}function sr(e,t){var n=e.selection,i=n.$anchor,r=n.$head;return t(e),e.setSelection(new T.TextSelection(e.doc.resolve(e.mapping.map(i.pos)),e.doc.resolve(e.mapping.map(r.pos)))),!0}var ur=n(84).a.extend({addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Backspace:function(e){return Ci(e.editor,t.name,t.type)}})}});function dr(e){var t,n,i=e.editor,r=(e.updateAttributes,e.node),o=e.getPos,a=e.forwardRef,c=z(),l=(null===(t=r.lastChild)||void 0===t?void 0:t.type.name)===hr.name,s=l&&(null===(n=r.lastChild)||void 0===n?void 0:n.attrs.collapsed),d=function(){var e=Object(u.g)(r,(function(e){return e.type.name===hr.name})),t=Object(C.a)(e,1)[0];if(t){var n=t.pos;i.commands.toggleOutlineCollapse(n+o()+1,!s)}};return Object(R.jsxs)(ce.c,{children:[Object(R.jsxs)(ce.c,Object.assign({className:"outline",sx:{flexDirection:"column",alignItems:"center",mt:c?"0px":"3px"}},{children:[l?Object(R.jsx)(fe,{path:s?be.chevronRight:be.chevronDown,title:s?"Click to uncollapse list":"Click to collapse list",sx:{cursor:"pointer",transition:"all .2s ease-in-out",":hover":{transform:["unset","scale(1.3)"]},":active":{transform:["scale(1.3)","unset"]},".icon:hover path":{fill:"var(--checked) !important"}},size:c?24:18,onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(e){e.preventDefault(),d()},onClick:d}):Object(R.jsx)(fe,{path:be.circle,size:c?24:18,sx:{transform:"scale(0.4)"}}),l&&!s&&Object(R.jsx)(ce.a,{sx:{flex:1,width:1,mt:2,backgroundColor:"border",borderRadius:50,flexShrink:0,cursor:"pointer",transition:"all .2s ease-in-out",":hover":{backgroundColor:"fontTertiary",width:4}},contentEditable:!1})]})),Object(R.jsx)(ce.e,{ref:a,sx:{pl:1,listStyleType:"none",flex:1}})]})}var fr=u.d.create({name:"outlineListItem",addOptions:function(){return{HTMLAttributes:{}}},content:"heading* paragraph block*",defining:!0,parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]')}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Object(u.s)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addKeyboardShortcuts:function(){var e=this;return{"Mod-Space":function(t){var n=function(e,t){var n,i,r=e.state.selection.$from,o=Object(Kn.findParentNodeOfTypeClosestToPos)(r,t);if(!o)return!1;var a=Object(u.g)(o.node,(function(e){return e.type.name===hr.name})),c=Object(C.a)(a,1)[0];if(!c)return!1;var l=(null===(n=null===c||void 0===c?void 0:c.node)||void 0===n?void 0:n.type.name)===hr.name,s=null===(i=null===c||void 0===c?void 0:c.node)||void 0===i?void 0:i.attrs.collapsed,d=o.pos+c.pos+1;return{isCollapsed:s,isNested:l,subListPos:d}}(t.editor,e.type);if(!n)return!1;var i=n.isCollapsed,r=n.subListPos;return e.editor.commands.toggleOutlineCollapse(r,!i)},Enter:function(t){t.editor;return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)},Backspace:function(t){return Ci(t.editor,e.name,e.type)}}},addCommands:function(){return{toggleOutlineCollapse:function(e,t){return function(n){return n.tr.setNodeMarkup(e,void 0,{collapsed:t}),!0}}}},addNodeView:function(){return F(dr,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")}})}});function pr(e){var t=e.editor,n=e.getPos,i=e.node,r=(e.updateAttributes,e.forwardRef),o=i.attrs.collapsed,a=Object(U.useMemo)((function(){var e;return(null===(e=t.state.doc.resolve(n()).parent)||void 0===e?void 0:e.type.name)===fr.name}),[]);return Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(ce.e,{className:"outline-list",as:"div",ref:r,sx:{ul:{display:o?"none":"block",paddingInlineStart:0,paddingLeft:0,marginBlockStart:a?5:0,marginBlockEnd:0},li:{listStyleType:"none"}}})})}var br=/^\s*(-o)\s$/,mr="outlineListItem",hr=u.d.create({name:"outlineList",addOptions:function(){return{HTMLAttributes:{}}},addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}}}},group:"block list",content:"".concat(mr,"+"),parseHTML:function(){return[{tag:'ul[data-type="'.concat(this.name,'"]'),priority:52}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Object(u.s)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands:function(){var e=this;return{toggleOutlineList:function(){return function(t){return t.commands.toggleList(e.name,mr)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-O":function(){return e.editor.commands.toggleOutlineList()}}},addInputRules:function(){return[Object(u.w)({find:br,type:this.type})]},addNodeView:function(){var e=this;return F(pr,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}});function gr(e){var t=e.editor,n=e.node,i=e.forwardRef,r=Object(U.useRef)(null),o=Object(U.useRef)(),a=t.isActive("table");return Object(U.useEffect)((function(){r.current&&o.current&&Object(on.s)(n,r.current,o.current,50)}),[n]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Ye,{children:a&&Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(jr,{editor:t,table:o.current}),Object(R.jsx)(Or,{editor:t,table:o.current})]})}),Object(R.jsx)("div",Object.assign({className:"tableWrapper"},{children:Object(R.jsx)("table",Object.assign({ref:function(e){null===i||void 0===i||i(e),o.current=e||void 0}},{children:Object(R.jsx)("colgroup",{ref:r})}))}))]})}function vr(e){return function(t){Object(V.a)(i,t);var n=Object(W.a)(i);function i(t,r){var o,a;return Object(A.a)(this,i),a=n.call(this,t,e,(function(){return 0}),{component:gr,shouldUpdate:function(e,t){return e.type===t.type},contentDOMFactory:function(){return{dom:document.createElement("tbody")}},wrapperFactory:function(){var e=document.createElement("div");return e.style.position="relative",e}}),Object(Z.a)((o=Object(_.a)(a),Object(ee.a)(i.prototype)),"init",o).call(o),a}return Object(L.a)(i)}(oe)}function jr(e){var t=e.editor,n=Object(U.useRef)(null);return Object(U.useEffect)((function(){if(n.current){var e=Bt(t,["tableRow"]);if(e){var i=Ee(n.current,{location:"left",target:e,align:"start",xOffset:-5,yOffset:-3});n.current.style.top="".concat(i.top,"px"),n.current.style.left="".concat(i.left,"px")}}}),[t.state.selection,n.current]),Object(R.jsxs)(ce.c,Object.assign({ref:n,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(R.jsx)(jn,Object.assign({},bn("rowProperties"),{icon:"more",variant:"small",editor:t})),Object(R.jsx)(Wn,Object.assign({},bn("insertRowBelow"),{editor:t,variant:"small"}))]}))}function Or(e){var t=e.editor,n=e.table,i=Object(U.useRef)(null);return Object(U.useEffect)((function(){if(i.current&&n){var e=Bt(t,["tableCell","tableHeader"]);if(e){var r=Ee(i.current,{location:"top",align:"center",target:e,yAnchor:n,yOffset:2});i.current.style.left="".concat(r.left,"px"),i.current.style.top="".concat(r.top,"px")}}}),[t.state.selection,i.current,n]),Object(R.jsxs)(ce.c,Object.assign({ref:i,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(R.jsx)(On,{editor:t,title:"tableProperties",icon:"more",variant:"small"}),Object(R.jsx)(zn,Object.assign({},bn("insertColumnRight"),{editor:t,variant:"small",icon:"plus"}))]}))}var xr=n(138).a.extend({addProseMirrorPlugins:function(){var e=this.options.resizable&&this.editor.isEditable;return[].concat(Object(S.a)(e?[Object(on.f)({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:vr(this.editor),lastColumnResizable:this.options.lastColumnResizable})]:[]),[Object(on.p)({allowTableNodeSelection:this.options.allowTableNodeSelection})])}}),yr=n(156),Cr=n(155),kr=u.b.create({name:"codemarkPlugin",addProseMirrorPlugins:function(){return Object(Cr.a)({markType:this.editor.schema.marks.code})}}),wr=n(55),Sr=n(47),Ar=n(26);function Lr(e,t,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(r,o){var a=e.state,c=a.selection,l=c.to,s=c.from,u=r.selection,d=u.to,f=u.from;if(i&&d!==f)return!1;var p=t>0?d:f;if(n){var b=r.doc.nodeSize-2;if(t>0&&p<b)return!1;if(t<0&&p>0)return!1}if(o){var m=t>0?l:s;e.dispatch(a.tr.setSelection(T.TextSelection.create(a.doc,m))),e.focus()}return!0}}var Rr=function(){function e(t,n,i,r,o,a){var c=this;Object(A.a)(this,e),this.options=r,this._node=t,this._outerView=n,this._getPos=i,this._mathPluginKey=o,this.cursorSide="start",this._isEditing=!1,this._tagName=r.tagName||this._node.type.name.replace("_","-"),this.dom=document.createElement(this._tagName),r.className&&this.dom.classList.add(r.className),this.dom.classList.add("math-node"),this._mathRenderElt=document.createElement("span"),this._mathRenderElt.textContent="",this._mathRenderElt.classList.add("math-render"),this.dom.appendChild(this._mathRenderElt),this._mathSrcElt=document.createElement("span"),this._mathSrcElt.classList.add("math-src"),this.dom.appendChild(this._mathSrcElt),this.dom.addEventListener("click",(function(){return c.ensureFocus()})),this.renderMath()}return Object(L.a)(e,[{key:"destroy",value:function(){this.closeEditor(!1),this._mathRenderElt&&(this._mathRenderElt.remove(),delete this._mathRenderElt),this._mathSrcElt&&(this._mathSrcElt.remove(),delete this._mathSrcElt),this.dom.remove()}},{key:"ensureFocus",value:function(){this._innerView&&this._outerView.hasFocus()&&this._innerView.focus()}},{key:"update",value:function(e,t,n){if(!e.sameMarkup(this._node))return!1;if(this._node=e,this._innerView){var i=this._innerView.state,r=e.content.findDiffStart(i.doc.content);if(null!=r){var o=e.content.findDiffEnd(i.doc.content);if(o){var a=o.a,c=o.b,l=r-Math.min(a,c);l>0&&(a+=l,c+=l),this._innerView.dispatch(i.tr.replace(r,c,e.slice(r,a)).setMeta("fromOutside",!0))}}}return this._isEditing||this.renderMath(),!0}},{key:"updateCursorPos",value:function(e){var t=this._getPos(),n=this._node.nodeSize;e.selection.from<t+n&&t<e.selection.to||(this.cursorSide=t<e.selection.from?"end":"start")}},{key:"selectNode",value:function(){this._outerView.editable&&(this.dom.classList.add("ProseMirror-selectednode"),this._isEditing||this.openEditor())}},{key:"deselectNode",value:function(){this.dom.classList.remove("ProseMirror-selectednode"),this._isEditing&&this.closeEditor()}},{key:"stopEvent",value:function(e){return void 0!==this._innerView&&void 0!==e.target&&this._innerView.dom.contains(e.target)}},{key:"ignoreMutation",value:function(){return!0}},{key:"renderMath",value:function(){if(this._mathRenderElt){var e=this._node.content.content,t="";if(e.length>0&&null!==e[0].textContent&&(t=e[0].textContent.trim()),t.length<1)for(this.dom.classList.add("empty-math");this._mathRenderElt.firstChild;)this._mathRenderElt.firstChild.remove();else{this.dom.classList.remove("empty-math");try{this.options.renderer(t,this._mathRenderElt),this._mathRenderElt.classList.remove("parse-error"),this.dom.setAttribute("title","")}catch(n){n instanceof Error&&(console.error(n),this._mathRenderElt.classList.add("parse-error"),this.dom.setAttribute("title",n.toString()))}}}}},{key:"dispatchInner",value:function(e){if(this._innerView){var t=this._innerView.state.applyTransaction(e),n=t.state,i=t.transactions;if(this._innerView.updateState(n),!e.getMeta("fromOutside")){for(var r=this._outerView.state.tr,o=Ti.d.offset(this._getPos()+1),a=0;a<i.length;a++)for(var c=i[a].steps,l=0;l<c.length;l++){var s=c[l].map(o);if(!s)throw Error("step discarded!");r.step(s)}r.docChanged&&this._outerView.dispatch(r)}}}},{key:"openEditor",value:function(){var e,t=this;if(this._innerView)throw Error("inner view should not exist!");if(!this._mathSrcElt)throw new Error("_mathSrcElt does not exist!");this._innerView=new P.c(this._mathSrcElt,{state:T.EditorState.create({doc:this._node,plugins:[Object(Sr.b)({Tab:function(e,t){return t&&t(e.tr.insertText("\t")),!0},Backspace:Object(Ar.a)(Ar.c,(function(e,n,i){return!!e.selection.empty&&(!(t._node.textContent.length>0)&&(t._outerView.dispatch(t._outerView.state.tr.insertText("")),t._outerView.focus(),!0))})),Enter:Object(Ar.a)(Ar.i,Lr(this._outerView,1,!1)),"Ctrl-Enter":Lr(this._outerView,1,!1),ArrowLeft:Lr(this._outerView,-1,!0),ArrowRight:Lr(this._outerView,1,!0),ArrowUp:Lr(this._outerView,-1,!0),ArrowDown:Lr(this._outerView,1,!0)})]}),dispatchTransaction:this.dispatchInner.bind(this)});var n=this._innerView.state;this._innerView.focus();var i=null===(e=this._mathPluginKey.getState(this._outerView.state))||void 0===e?void 0:e.prevCursorPos;null!==i&&void 0!==i||console.error("[prosemirror-math] Error: Unable to fetch math plugin state from key.");var r=(null!==i&&void 0!==i?i:0)<=this._getPos()?0:this._node.nodeSize-2;setTimeout((function(){t._innerView&&(t._innerView.focus(),t._innerView.dispatch(n.tr.setSelection(T.TextSelection.create(n.doc,r))))})),this._isEditing=!0}},{key:"closeEditor",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._innerView&&(this._innerView.destroy(),this._innerView=void 0),e&&this.renderMath(),this._isEditing=!1}}]),e}(),Tr=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function Pr(){return Tr(this,void 0,void 0,Object(pt.a)().mark((function e(){var t,i;return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e(0).then(n.t.bind(null,208,7));case 2:return t=e.sent,i=t.default,e.next=6,Promise.all([n.e(0),n.e(4)]).then(n.bind(null,209));case 6:return e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))}var Er={inline:function(e,t){Pr().then((function(n){n.render(e,t,{displayMode:!1,globalGroup:!0,throwOnError:!1})}))},block:function(e,t){Pr().then((function(n){n.render(e,t,{displayMode:!0,globalGroup:!0,throwOnError:!1})}))}},Mr=new T.PluginKey("prosemirror-math");function Ir(e){return function(t,n,i){var r=Mr.getState(n.state);if(!r)throw new Error("no math plugin!");var o=r.activeNodeViews,a=new Rr(t,n,i,{className:e?"math-inline":"math-block",renderer:e?Er.inline:Er.block,tagName:e?"span":"div"},Mr,(function(){o.splice(o.indexOf(a))}));return o.push(a),a}}var Dr={key:Mr,state:{init:function(e,t){return{macros:{},activeNodeViews:[],prevCursorPos:0}},apply:function(e,t,n,i){var r=i.selection.from,o=n.selection.from;return{activeNodeViews:t.activeNodeViews,macros:t.macros,prevCursorPos:o!==r?o:t.prevCursorPos}}},props:{nodeViews:{mathInline:Ir(!0),mathBlock:Ir(!1)}}},zr=new T.Plugin(Dr),Nr=n(5);function Hr(e,t){return Nr.Fragment.from(t.text(e))}function Br(e){var t,n=e.querySelector("img.mwe-math-fallback-image-inline[alt]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alt"))&&void 0!==t&&t}function Fr(e){var t,n=e.querySelector("math[alttext]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alttext"))&&void 0!==t&&t}function _r(e){var t,n=e.querySelector("math annotation[encoding='application/x-tex'");return null!==(t=null===n||void 0===n?void 0:n.textContent)&&void 0!==t&&t}function Vr(e){var t=function(e,t){var n,i=Object(k.a)(t);try{for(i.s();!(n=i.n()).done;){var r=(0,n.value)(e);if(!1!==r)return r}}catch(o){i.e(o)}finally{i.f()}return!1}(e,[Br,Fr,_r]);return t}var Wr=[{tag:"span",getAttrs:function(e){return!!e.classList.contains("mwe-math-element")&&null},getContent:function(e,t){return Hr(Vr(e)||"\\text{\\color{red}(paste error)}",t)}}],Ur=[{tag:"dl",getAttrs:function(e){var t=e;if(1!==t.childElementCount)return!1;var n=t.firstChild;return"DD"===n.tagName&&(1===n.childElementCount&&(!!n.firstChild.classList.contains("mwe-math-element")&&null))},getContent:function(e,t){return Hr(Vr(e)||"\\text{\\color{red}(paste error)}",t)}}];[{tag:"math-inline"}].concat(Object(S.a)(Wr)),[{tag:"math-display"}].concat(Object(S.a)(Ur));var qr=/\$\$(.+)\$\$/,$r=(function(){try{new RegExp("(?<!\\\\)\\$(.+)(?<!\\\\)\\$")}catch(e){return qr}}(),/\$\$\$\s+$/);var Jr=function(e){var t=e.selection,n=t.from,i=(t.to,e.selection.content().content),r=[];return i.descendants((function(e,t,i){return"text"!=e.type.name&&(!e.type.name.startsWith("math_")||(r.push({start:Math.max(n+t-1,0),end:n+t+e.nodeSize-1}),!1))})),P.b.create(e.doc,r.map((function(e){var t=e.start,n=e.end;return P.a.node(t,n,{class:"math-select"})})))},Gr=new T.Plugin({state:{init:function(e,t){return Jr(t)},apply:function(e,t,n,i){return e.selection&&e.selectionSet?Jr(e):n}},props:{decorations:function(e){return Gr.getState(e)}}});new(function(){function e(t,n){Object(A.a)(this,e),this.nodes=Object.assign(Object.assign({},null===n||void 0===n?void 0:n.nodes),t.nodes),this.marks=Object.assign(Object.assign({},null===n||void 0===n?void 0:n.marks),t.marks)}return Object(L.a)(e,[{key:"serializeFragment",value:function(e){var t=this,n="\n\n",i="",r=!0,o=e.size;return e.nodesBetween(0,o,(function(e,a){var c,l=t.serializeNode(e);if(null!==l)return i+=l,!1;e.isText?(i+=(null===(c=e.text)||void 0===c?void 0:c.slice(Math.max(0,a)-a,o-a))||"",r=!1):(e.isLeaf,!r&&e.isBlock&&(i+=n,r=!0))}),0),i}},{key:"serializeSlice",value:function(e){return this.serializeFragment(e.content)}},{key:"serializeNode",value:function(e){var t=this.nodes[e.type.name];return void 0!==t?t(e):null}}]),e}())({nodes:{math_inline:function(e){return"$".concat(e.textContent,"$")},math_display:function(e){return"\n\n$$\n".concat(e.textContent,"\n$$")}}});var Xr=u.d.create({name:"mathInline",group:"inline math",content:"text*",inline:!0,atom:!0,code:!0,parseHTML:function(){return[{tag:"span[class*='math-inline']"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Object(u.s)({class:"math-inline math-node"},t),0]},addCommands:function(){var e=this;return{insertMathInline:function(){return function(t){var n=t.chain,i=t.tr.selection.$from;return n().insertContent({type:e.name,attrs:{}}).setNodeSelection(i.pos).run()}}}},addProseMirrorPlugins:function(){var e,t,n,i=Object(wr.b)({rules:[(e=qr,t=this.type,new wr.a(e,(function(e,i,r,o){var a=e.doc.resolve(r),c=a.index(),l=e.doc.resolve(o),s=n instanceof Function?n(i):n;return a.parent.canReplaceWith(c,l.index(),t)?e.tr.replaceRangeWith(r,o,t.create(s,t.schema.text(i[1]))):null})))]});return[zr,i]}}),Kr=u.d.create({name:"mathBlock",group:"block math",content:"text*",atom:!0,code:!0,parseHTML:function(){return[{tag:"div[class*='math-block']"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["div",Object(u.s)({class:"math-block math-node"},t),0]},addCommands:function(){var e=this;return{insertMathBlock:function(){return function(t){var n=t.state,i=t.dispatch,r=t.view;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(n,i){var r=n.selection,o=r.$from,a=r.empty,c=o.index();if(!a&&!o.parent.canReplaceWith(c,c,e))return!1;if(i){var l=e.create({},t?n.schema.text(t):null),s=n.tr.replaceSelectionWith(l);i(s=a?s.setSelection(T.TextSelection.create(s.doc,o.pos+1)):s.setSelection(T.NodeSelection.create(s.doc,o.pos)))}return!0}}(e.type)(n,i,r)}}}},addProseMirrorPlugins:function(){var e,t,n;return[Object(wr.b)({rules:[(e=$r,t=this.type,new wr.a(e,(function(e,i,r,o){var a=e.doc.resolve(r),c=n instanceof Function?n(i):n;if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t))return null;var l=e.tr.delete(r,o).setBlockType(r,r,t,c);return l.setSelection(T.NodeSelection.create(l.doc,l.mapping.map(a.pos-1)))})))]})]}}),Qr=void 0,Yr=u.b.create({name:"keepinview",onCreate:function(){var e=this;Qr=function(){Zr(e.editor)},window.addEventListener("resize",Qr)},onDestroy:function(){Qr&&(window.removeEventListener("resize",Qr),Qr=void 0)},addKeyboardShortcuts:function(){return{Enter:function(e){var t=e.editor;return setTimeout((function(){Zr(t)})),!1}}}});function Zr(e){var t=e.state.selection.$from,n=Object(u.u)(e.view,t.pos,t.pos+1).top;if(window.innerHeight-n<100){var i=e.view.domAtPos(t.pos).node;if(i.nodeType===Node.TEXT_NODE&&i.parentNode&&(i=i.parentNode),i instanceof HTMLElement){var r=eo(i);r?r.scrollBy({top:100,behavior:"smooth"}):i.scrollIntoView({behavior:"smooth",block:"center"})}}}var eo=function(e){if(e){for(var t=e.parentElement;t;){var n=t.style,i=n.overflow,r=n.overflowY;if(to(i)||to(r))return t;t=t.parentElement}return document.documentElement}};function to(e){return e.split(" ").every((function(e){return"auto"===e||"scroll"===e}))}var no=new T.PluginKey("selection-persist-key"),io=u.b.create({name:"selection-persist",addProseMirrorPlugins:function(){var e=!1;return[new T.Plugin({key:no,props:{decorations:function(e){return no.getState(e)}},state:{init:function(){return P.b.empty},apply:function(t,n,i,r){var o=!!t.getMeta("blur");!!t.getMeta("focus")&&(e=!1,!0),o&&(e=!0,!1);var a=i.selection,c=a.from,l=a.to;return e?P.b.create(t.doc,[P.a.inline(c,l,{style:"background-color: var(--dimPrimary)"})]):P.b.empty}}})]}}),ro=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(){return Object(A.a)(this,n),t.apply(this,arguments)}return Object(L.a)(n,[{key:"requestPermission",value:function(e){var t=new CustomEvent("permissionrequest",{detail:{id:e},cancelable:!0});if(window.dispatchEvent(t))return this.current}}]),n}(u.a);function oo(){var e=Object(U.useState)(0),t=Object(C.a)(e,2)[1];return function(){return t((function(e){return e+1}))}}var ao=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(U.useState)(null),i=Object(C.a)(n,2),r=i[0],o=i[1],a=oo(),c=Object(U.useRef)(r);return Object(U.useEffect)((function(){var t=!0,n=new ro(e);return o(n),n.on("transaction",(function(){requestAnimationFrame((function(){requestAnimationFrame((function(){t&&a()}))}))})),function(){n.destroy(),t=!1}}),t),Object(U.useEffect)((function(){c.current=r,r&&(r.current||Object.defineProperty(r,"current",{get:function(){return c.current}}))}),[r]),Object(U.useEffect)((function(){function e(e){if(null===r||void 0===r?void 0:r.view.dragging)return e.preventDefault(),!0}return null===r||void 0===r||r.view.dom.addEventListener("dragenter",e),function(){null===r||void 0===r||r.view.dom.removeEventListener("dragenter",e)}}),[null===r||void 0===r?void 0:r.view.dom]),r},co={premium:["insertImage"]};function lo(e){var t=e.claims,n=e.onPermissionDenied;Object(U.useEffect)((function(){function e(e){var i=e.detail.id;for(var r in co){var o=r;if(!(co[o].indexOf(i)<=-1)&&!t[o]){n(o,i),e.preventDefault();break}}e.preventDefault()}return window.addEventListener("permissionrequest",e),function(){window.removeEventListener("permissionrequest",e)}}),[t,n])}var so=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};P.c.prototype.updateState=function(e){this.docView&&this.updateStateInner(e,this.state.plugins!=e.plugins)};var uo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.theme,u=e.isMobile,O=e.onDownloadAttachment,C=e.onOpenAttachmentPicker,k=e.onBeforeCreate,w=so(e,["theme","isMobile","onDownloadAttachment","onOpenAttachmentPicker","onBeforeCreate"]),S=K(),A=I((function(e){return e.setIsMobile})),L=I((function(e){return e.setTheme}));Object(U.useEffect)((function(){A(u||!1),L(n)}),[u,n]);var R=Object(U.useMemo)((function(){return{extensions:[re,Di,d.a,a.a.configure({dropcursor:!1,codeBlock:!1,listItem:!1,orderedList:!1,bulletList:!1,history:{depth:200,newGroupDelay:1e3}}),Mi.configure({class:"drop-cursor"}),i.a,o.a,l.a,s.a,f,p,b.a,m,h,Ai.configure({nested:!0}),Ri,yr.a.configure({openOnClick:!u}),xr.configure({resizable:!0,allowTableNodeSelection:!0,cellMinWidth:50}),j.a,x,y.a,g.a.configure({multicolor:!0}),nr,v.a,c.a.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"],defaultAlignment:"left"}),r.a.configure({placeholder:"Start writing your note..."}),xi,Ni,oi.configure({onDownloadAttachment:O,onOpenAttachmentPicker:C}),fr,hr,ur,kr,Xr,Kr,Yr,io],onBeforeCreate:function(e){var t=e.editor;t.storage.portalProviderAPI=S,k&&k({editor:t})},injectCSS:!1}}),[O,C,S,k]),T=ao(Object.assign(Object.assign({},R),w),t);return T}},78:function(e){e.exports=JSON.parse('[{"filename":"markup","title":"Markup","alias":["html","xml","svg","mathml","ssml","atom","rss"]},{"filename":"css","title":"CSS"},{"filename":"clike","title":"C-like"},{"filename":"javascript","title":"JavaScript","alias":["js"]},{"filename":"abap","title":"ABAP"},{"filename":"abnf","title":"ABNF"},{"filename":"actionscript","title":"ActionScript"},{"filename":"ada","title":"Ada"},{"filename":"agda","title":"Agda"},{"filename":"al","title":"AL"},{"filename":"antlr4","title":"ANTLR4","alias":["g4"]},{"filename":"apacheconf","title":"Apache Configuration"},{"filename":"apex","title":"Apex"},{"filename":"apl","title":"APL"},{"filename":"applescript","title":"AppleScript"},{"filename":"aql","title":"AQL"},{"filename":"arduino","title":"Arduino","alias":["ino"]},{"filename":"arff","title":"ARFF"},{"filename":"armasm","title":"ARM Assembly","alias":["arm-asm"]},{"filename":"arturo","title":"Arturo","alias":["art"]},{"filename":"asciidoc","title":"AsciiDoc","alias":["adoc"]},{"filename":"aspnet","title":"ASP.NET (C#)"},{"filename":"asm6502","title":"6502 Assembly"},{"filename":"asmatmel","title":"Atmel AVR Assembly"},{"filename":"autohotkey","title":"AutoHotkey"},{"filename":"autoit","title":"AutoIt"},{"filename":"avisynth","title":"AviSynth","alias":["avs"]},{"filename":"avro-idl","title":"Avro IDL","alias":["avdl"]},{"filename":"awk","title":"AWK","alias":["gawk"]},{"filename":"bash","title":"Bash","alias":["shell"]},{"filename":"basic","title":"BASIC"},{"filename":"batch","title":"Batch"},{"filename":"bbcode","title":"BBcode","alias":["shortcode"]},{"filename":"bicep","title":"Bicep"},{"filename":"birb","title":"Birb"},{"filename":"bison","title":"Bison"},{"filename":"bnf","title":"BNF","alias":["rbnf"]},{"filename":"brainfuck","title":"Brainfuck"},{"filename":"brightscript","title":"BrightScript"},{"filename":"bro","title":"Bro"},{"filename":"bsl","title":"BSL (1C:Enterprise)","alias":["oscript"]},{"filename":"c","title":"C"},{"filename":"csharp","title":"C#","alias":["cs","dotnet"]},{"filename":"cpp","title":"C++"},{"filename":"cfscript","title":"CFScript","alias":["cfc"]},{"filename":"chaiscript","title":"ChaiScript"},{"filename":"cil","title":"CIL"},{"filename":"clojure","title":"Clojure"},{"filename":"cmake","title":"CMake"},{"filename":"cobol","title":"COBOL"},{"filename":"coffeescript","title":"CoffeeScript","alias":["coffee"]},{"filename":"concurnas","title":"Concurnas","alias":["conc"]},{"filename":"csp","title":"Content-Security-Policy"},{"filename":"cooklang","title":"Cooklang"},{"filename":"coq","title":"Coq"},{"filename":"crystal","title":"Crystal"},{"filename":"css-extras","title":"CSS Extras"},{"filename":"csv","title":"CSV"},{"filename":"cue","title":"CUE"},{"filename":"cypher","title":"Cypher"},{"filename":"d","title":"D"},{"filename":"dart","title":"Dart"},{"filename":"dataweave","title":"DataWeave"},{"filename":"dax","title":"DAX"},{"filename":"dhall","title":"Dhall"},{"filename":"diff","title":"Diff"},{"filename":"django","title":"Django/Jinja2","alias":["jinja2"]},{"filename":"dns-zone-file","title":"DNS zone file","alias":["dns-zone"]},{"filename":"docker","title":"Docker","alias":["dockerfile"]},{"filename":"dot","title":"DOT (Graphviz)","alias":["gv"]},{"filename":"ebnf","title":"EBNF"},{"filename":"editorconfig","title":"EditorConfig"},{"filename":"eiffel","title":"Eiffel"},{"filename":"ejs","title":"EJS","alias":["eta"]},{"filename":"elixir","title":"Elixir"},{"filename":"elm","title":"Elm"},{"filename":"etlua","title":"Embedded Lua templating"},{"filename":"erb","title":"ERB"},{"filename":"erlang","title":"Erlang"},{"filename":"excel-formula","title":"Excel Formula","alias":["xlsx","xls"]},{"filename":"fsharp","title":"F#"},{"filename":"factor","title":"Factor"},{"filename":"false","title":"False"},{"filename":"firestore-security-rules","title":"Firestore security rules"},{"filename":"flow","title":"Flow"},{"filename":"fortran","title":"Fortran"},{"filename":"ftl","title":"FreeMarker Template Language"},{"filename":"gml","title":"GameMaker Language","alias":["gamemakerlanguage"]},{"filename":"gap","title":"GAP (CAS)"},{"filename":"gcode","title":"G-code"},{"filename":"gdscript","title":"GDScript"},{"filename":"gedcom","title":"GEDCOM"},{"filename":"gettext","title":"gettext","alias":["po"]},{"filename":"gherkin","title":"Gherkin"},{"filename":"git","title":"Git"},{"filename":"glsl","title":"GLSL"},{"filename":"gn","title":"GN","alias":["gni"]},{"filename":"linker-script","title":"GNU Linker Script","alias":["ld"]},{"filename":"go","title":"Go"},{"filename":"go-module","title":"Go module","alias":["go-mod"]},{"filename":"gradle","title":"Gradle"},{"filename":"graphql","title":"GraphQL"},{"filename":"groovy","title":"Groovy"},{"filename":"haml","title":"Haml"},{"filename":"handlebars","title":"Handlebars","alias":["hbs","mustache"]},{"filename":"haskell","title":"Haskell","alias":["hs"]},{"filename":"haxe","title":"Haxe"},{"filename":"hcl","title":"HCL"},{"filename":"hlsl","title":"HLSL"},{"filename":"hoon","title":"Hoon"},{"filename":"http","title":"HTTP"},{"filename":"hpkp","title":"HTTP Public-Key-Pins"},{"filename":"hsts","title":"HTTP Strict-Transport-Security"},{"filename":"ichigojam","title":"IchigoJam"},{"filename":"icon","title":"Icon"},{"filename":"icu-message-format","title":"ICU Message Format"},{"filename":"idris","title":"Idris","alias":["idr"]},{"filename":"ignore","title":".ignore","alias":["gitignore","hgignore","npmignore"]},{"filename":"inform7","title":"Inform 7"},{"filename":"ini","title":"Ini"},{"filename":"io","title":"Io"},{"filename":"j","title":"J"},{"filename":"java","title":"Java"},{"filename":"javadoc","title":"JavaDoc"},{"filename":"javadoclike","title":"JavaDoc-like"},{"filename":"javastacktrace","title":"Java stack trace"},{"filename":"jexl","title":"Jexl"},{"filename":"jolie","title":"Jolie"},{"filename":"jq","title":"JQ"},{"filename":"jsdoc","title":"JSDoc"},{"filename":"js-extras","title":"JS Extras"},{"filename":"json","title":"JSON","alias":["webmanifest"]},{"filename":"json5","title":"JSON5"},{"filename":"jsonp","title":"JSONP"},{"filename":"jsstacktrace","title":"JS stack trace"},{"filename":"js-templates","title":"JS Templates"},{"filename":"julia","title":"Julia"},{"filename":"keepalived","title":"Keepalived Configure"},{"filename":"keyman","title":"Keyman"},{"filename":"kotlin","title":"Kotlin","alias":["kt","kts"]},{"filename":"kumir","title":"KuMir (\u041a\u0443\u041c\u0438\u0440)","alias":["kum"]},{"filename":"kusto","title":"Kusto"},{"filename":"latex","title":"LaTeX","alias":["tex","context"]},{"filename":"latte","title":"Latte"},{"filename":"less","title":"Less"},{"filename":"lilypond","title":"LilyPond","alias":["ly"]},{"filename":"liquid","title":"Liquid"},{"filename":"lisp","title":"Lisp","alias":["emacs","elisp","emacs-lisp"]},{"filename":"livescript","title":"LiveScript"},{"filename":"llvm","title":"LLVM IR"},{"filename":"log","title":"Log file"},{"filename":"lolcode","title":"LOLCODE"},{"filename":"lua","title":"Lua"},{"filename":"magma","title":"Magma (CAS)"},{"filename":"makefile","title":"Makefile"},{"filename":"markdown","title":"Markdown","alias":["md"]},{"filename":"markup-templating","title":"Markup templating"},{"filename":"mata","title":"Mata"},{"filename":"matlab","title":"MATLAB"},{"filename":"maxscript","title":"MAXScript"},{"filename":"mel","title":"MEL"},{"filename":"mermaid","title":"Mermaid"},{"filename":"mizar","title":"Mizar"},{"filename":"mongodb","title":"MongoDB"},{"filename":"monkey","title":"Monkey"},{"filename":"moonscript","title":"MoonScript","alias":["moon"]},{"filename":"n1ql","title":"N1QL"},{"filename":"n4js","title":"N4JS","alias":["n4jsd"]},{"filename":"nand2tetris-hdl","title":"Nand To Tetris HDL"},{"filename":"naniscript","title":"Naninovel Script","alias":["nani"]},{"filename":"nasm","title":"NASM"},{"filename":"neon","title":"NEON"},{"filename":"nevod","title":"Nevod"},{"filename":"nginx","title":"nginx"},{"filename":"nim","title":"Nim"},{"filename":"nix","title":"Nix"},{"filename":"nsis","title":"NSIS"},{"filename":"objectivec","title":"Objective-C","alias":["objc"]},{"filename":"ocaml","title":"OCaml"},{"filename":"odin","title":"Odin"},{"filename":"opencl","title":"OpenCL"},{"filename":"openqasm","title":"OpenQasm","alias":["qasm"]},{"filename":"oz","title":"Oz"},{"filename":"parigp","title":"PARI/GP"},{"filename":"parser","title":"Parser"},{"filename":"pascal","title":"Pascal","alias":["objectpascal"]},{"filename":"pascaligo","title":"Pascaligo"},{"filename":"psl","title":"PATROL Scripting Language"},{"filename":"pcaxis","title":"PC-Axis","alias":["px"]},{"filename":"peoplecode","title":"PeopleCode","alias":["pcode"]},{"filename":"perl","title":"Perl"},{"filename":"php","title":"PHP"},{"filename":"phpdoc","title":"PHPDoc"},{"filename":"php-extras","title":"PHP Extras"},{"filename":"plant-uml","title":"PlantUML","alias":["plantuml"]},{"filename":"plsql","title":"PL/SQL"},{"filename":"powerquery","title":"PowerQuery","alias":["pq","mscript"]},{"filename":"powershell","title":"PowerShell"},{"filename":"processing","title":"Processing"},{"filename":"prolog","title":"Prolog"},{"filename":"promql","title":"PromQL"},{"filename":"properties","title":".properties"},{"filename":"protobuf","title":"Protocol Buffers"},{"filename":"pug","title":"Pug"},{"filename":"puppet","title":"Puppet"},{"filename":"pure","title":"Pure"},{"filename":"purebasic","title":"PureBasic","alias":["pbfasm"]},{"filename":"purescript","title":"PureScript","alias":["purs"]},{"filename":"python","title":"Python","alias":["py"]},{"filename":"qsharp","title":"Q#","alias":["qs"]},{"filename":"q","title":"Q (kdb+ database)"},{"filename":"qml","title":"QML"},{"filename":"qore","title":"Qore"},{"filename":"r","title":"R"},{"filename":"racket","title":"Racket","alias":["rkt"]},{"filename":"cshtml","title":"Razor C#","alias":["razor"]},{"filename":"jsx","title":"React JSX"},{"filename":"tsx","title":"React TSX"},{"filename":"reason","title":"Reason"},{"filename":"regex","title":"Regex"},{"filename":"rego","title":"Rego"},{"filename":"renpy","title":"Ren\'py","alias":["rpy"]},{"filename":"rescript","title":"ReScript","alias":["res"]},{"filename":"rest","title":"reST (reStructuredText)"},{"filename":"rip","title":"Rip"},{"filename":"roboconf","title":"Roboconf"},{"filename":"robotframework","title":"Robot Framework","alias":["robot"]},{"filename":"ruby","title":"Ruby","alias":["rb"]},{"filename":"rust","title":"Rust"},{"filename":"sas","title":"SAS"},{"filename":"sass","title":"Sass (Sass)"},{"filename":"scss","title":"Sass (Scss)"},{"filename":"scala","title":"Scala"},{"filename":"scheme","title":"Scheme"},{"filename":"shell-session","title":"Shell session","alias":["sh-session","shellsession"]},{"filename":"smali","title":"Smali"},{"filename":"smalltalk","title":"Smalltalk"},{"filename":"smarty","title":"Smarty"},{"filename":"sml","title":"SML","alias":["smlnj"]},{"filename":"solidity","title":"Solidity (Ethereum)","alias":["sol"]},{"filename":"solution-file","title":"Solution file","alias":["sln"]},{"filename":"soy","title":"Soy (Closure Template)"},{"filename":"sparql","title":"SPARQL","alias":["rq"]},{"filename":"splunk-spl","title":"Splunk SPL"},{"filename":"sqf","title":"SQF: Status Quo Function (Arma 3)"},{"filename":"sql","title":"SQL"},{"filename":"squirrel","title":"Squirrel"},{"filename":"stan","title":"Stan"},{"filename":"stata","title":"Stata Ado"},{"filename":"iecst","title":"Structured Text (IEC 61131-3)"},{"filename":"stylus","title":"Stylus"},{"filename":"supercollider","title":"SuperCollider","alias":["sclang"]},{"filename":"swift","title":"Swift"},{"filename":"systemd","title":"Systemd configuration file"},{"filename":"t4-templating","title":"T4 templating"},{"filename":"t4-cs","title":"T4 Text Templates (C#)","alias":["t4"]},{"filename":"t4-vb","title":"T4 Text Templates (VB)"},{"filename":"tap","title":"TAP"},{"filename":"tcl","title":"Tcl"},{"filename":"tt2","title":"Template Toolkit 2"},{"filename":"textile","title":"Textile"},{"filename":"toml","title":"TOML"},{"filename":"tremor","title":"Tremor","alias":["trickle","troy"]},{"filename":"turtle","title":"Turtle","alias":["trig"]},{"filename":"twig","title":"Twig"},{"filename":"typescript","title":"TypeScript","alias":["ts"]},{"filename":"typoscript","title":"TypoScript","alias":["tsconfig"]},{"filename":"unrealscript","title":"UnrealScript","alias":["uscript","uc"]},{"filename":"uorazor","title":"UO Razor Script"},{"filename":"uri","title":"URI","alias":["url"]},{"filename":"v","title":"V"},{"filename":"vala","title":"Vala"},{"filename":"vbnet","title":"VB.Net"},{"filename":"velocity","title":"Velocity"},{"filename":"verilog","title":"Verilog"},{"filename":"vhdl","title":"VHDL"},{"filename":"vim","title":"vim"},{"filename":"visual-basic","title":"Visual Basic","alias":["vb","vba"]},{"filename":"warpscript","title":"WarpScript"},{"filename":"wasm","title":"WebAssembly"},{"filename":"web-idl","title":"Web IDL","alias":["webidl"]},{"filename":"wgsl","title":"WGSL"},{"filename":"wiki","title":"Wiki markup"},{"filename":"wolfram","title":"Wolfram language","alias":["mathematica","nb","wl"]},{"filename":"wren","title":"Wren"},{"filename":"xeora","title":"Xeora","alias":["xeoracube"]},{"filename":"xml-doc","title":"XML doc (.net)"},{"filename":"xojo","title":"Xojo (REALbasic)"},{"filename":"xquery","title":"XQuery"},{"filename":"yaml","title":"YAML","alias":["yml"]},{"filename":"yang","title":"YANG"},{"filename":"zig","title":"Zig"}]')},95:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(140),r=n.n(i),o=n(22);function a(e){var t=document.getElementById("variables-nn"),n=document.getElementsByTagName("head")[0];t&&n.removeChild(t);var i=document.createElement("style");i.type="text/css",i.id="variables-nn",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),n.insertBefore(i,function(){var e,t=Object(o.a)(document.getElementsByTagName("style"));try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.innerHTML.includes("#root"))return n}}catch(i){t.e(i)}finally{t.f()}}())}function c(e){var t=":root {";for(var n in e)t+="--nn_".concat(n,": ").concat(e[n],";");return t+"}"}var l={accent:"#008837",shade:"#00883712",fg:"#008837",normal:"black",icon:"gray",transGray:"#00000010",errorBg:"#FFB6C1",errorText:"#ff6961",successBg:"#DFF2BF",successText:"#4F8A10",warningBg:"#FF990020",warningText:"#FF9900",red:"#f44336",orange:"#FF9800",yellow:"#FFD600",green:"#4CAF50",blue:"#2196F3",purple:"#673AB7",gray:"#9E9E9E",discord:"#5865F2",night:!1,bg:"#ffffff",navbg:"#f7f7f7",nav:"#f7f7f7",pri:"#424242",sec:"white",light:"#ffffff",input:"transparent",heading:"#212121",border:"#E8E8E8",placeholder:"#a9a9a9"};a(c(l));var s=r()((function(e,t){return{colors:l,setColors:function(t){a(c(t)),e({colors:t})}}}))}},[[201,2,3]]]);\ No newline at end of filediff --git a/apps/mobile/web.bundle/static/js/main.e08a2ce0.chunk.js b/apps/mobile/web.bundle/static/js/main.e08a2ce0.chunk.jsdeleted file mode 100644index dbcfa0bc6..000000000--- a/apps/mobile/web.bundle/static/js/main.e08a2ce0.chunk.js+++ /dev/null@@ -1 +0,0 @@-(this.webpackJsonptiptap=this.webpackJsonptiptap||[]).push([[1],{126:function(e,t,n){"use strict";(function(e){var i=n(13),r=n(10),o=n(9),a=n(113),c=n(59),l=n(1),s=n(139),u=n(141),d=n(95),f=n(23),p=n(142),b=n(152),m=n(153),h=n(154),g=n(0),v=function(){var t,n,v=Object(u.a)(),j=Object(l.useState)(0),O=Object(o.a)(j,2),x=O[0],y=O[1],C=Object(d.a)((function(e){return e.colors})),k=Object(l.useState)({readonly:e.readonly||v.readonly,noHeader:e.noHeader||v.noHeader,noToolbar:e.noToolbar||v.noToolbar||e.readonly||v.readonly}),w=Object(o.a)(k,2),S=w[0],A=w[1],L=Object(l.useRef)(null),R=Object(l.useRef)(null),T=Object(l.useState)(!1),P=Object(o.a)(T,2),E=P[0],M=P[1],I=Object(a.useTheme)({accent:"green",scale:1,theme:null!==C&&void 0!==C&&C.night?"dark":"light"}),D=Object(a.useTheme)({accent:"green",scale:1,theme:null!==C&&void 0!==C&&C.night?"dark":"light"});D.space=[0,10,12,20],I.space=[0,10,12,18],I.space.small="10px",I.buttons.menuitem=Object(r.a)(Object(r.a)({},I.buttons.menuitem),{},{height:"50px",paddingX:"20px",borderBottomWidth:0}),I.iconSizes={big:20,medium:18,small:18},I.fontSizes=Object(r.a)(Object(r.a)({},I.fontSizes),{},{subBody:"0.8rem",body:"0.9rem"}),I.radii=Object(r.a)(Object(r.a)({},I.radii),{},{small:5}),I.buttons.menuitem=Object(r.a)(Object(r.a)({},I.buttons.menuitem),{},{px:5,height:"45px"}),Object(c.d)({claims:{premium:v.premium},onPermissionDenied:function(){post(f.a.pro)}});var z=Object(c.e)({onUpdate:function(t){var n=t.editor;e.editorController.contentChange(n)},onSelectionUpdate:function(t){e.editorController.selectionChange(t.editor)},onOpenAttachmentPicker:function(t,n){return e.editorController.openFilePicker(n),!0},onDownloadAttachment:function(t,n){return e.editorController.downloadAttachment(n),!0},theme:D,element:E&&L.current||void 0,editable:!S.readonly,editorProps:{editable:function(){return!S.readonly}},content:null===(t=e.editorController)||void 0===t||null===(n=t.content)||void 0===n?void 0:n.current,isMobile:!0},[E,S.readonly,x]),N=Object(s.a)(z,(function(){y((function(e){return e+1})),N.setTitlePlaceholder("Note title")})),H=Object(l.useRef)(N);return globalThis.editorController=N,globalThis.editor=z,Object(l.useLayoutEffect)((function(){A(Object(r.a)({},v)),M(!0)}),[v]),Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)("div",{style:{display:"flex",flex:1,flexDirection:"column",maxWidth:"100vw",marginBottom:"5px"},children:[Object(g.jsx)(p.a,{hasRedo:(null===z||void 0===z?void 0:z.can().redo())||!1,hasUndo:(null===z||void 0===z?void 0:z.can().undo())||!1,settings:v,noHeader:S.noHeader||!1}),Object(g.jsxs)("div",{onScroll:N.scroll,ref:R,style:{overflowY:"scroll",flexDirection:"column",height:"100%",flexGrow:1,flexShrink:1,display:"flex"},children:[S.noHeader?null:Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)(m.a,{}),Object(g.jsx)(h.a,{titlePlaceholder:N.titlePlaceholder,readonly:v.readonly,controller:H,title:N.title}),Object(g.jsx)(b.a,{container:R,editor:z})]}),Object(g.jsx)("div",{ref:L,style:{padding:12,paddingTop:0,color:null===C||void 0===C?void 0:C.pri,flex:1}}),Object(g.jsx)("div",{onDoubleClick:function(){var e,t,n=null===(e=globalThis.editor)||void 0===e?void 0:e.state.doc.content.size;n&&(null===(t=globalThis.editor)||void 0===t||t.chain().focus().insertContentAt(n-1,"<p></p>",{updateSelection:!0}).run())},style:{flexShrink:0,height:150,width:"100%"}})]}),S.noToolbar||!E?null:Object(g.jsx)(c.b,{sx:{pl:"10px",pt:"5px",minHeight:45},theme:I,editor:z,location:"bottom",tools:Object(i.a)(v.tools)})]})})};t.a=function(){return Object(g.jsx)(c.a,{children:Object(g.jsx)(v,{})})}}).call(this,n(51))},139:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(9),r=n(1),o=n(95),a=n(23);function c(t,n){var c=Object(r.useState)(""),l=Object(i.a)(c,2),s=l[0],u=l[1],d=Object(r.useState)("Note title"),f=Object(i.a)(d,2),p=f[0],b=f[1],m=Object(r.useRef)(null),h=Object(r.useRef)({selectionChange:null,change:null}),g=Object(r.useCallback)((function(e){}),[]),v=Object(r.useCallback)((function(e){var t;e&&(g(e),h.current.change=Object(a.d)((function(){m.current=e.getHTML(),Object(a.c)(a.a.content,m.current)}),300,null===(t=h.current)||void 0===t?void 0:t.change))}),[g]),j=Object(r.useCallback)((function(e){}),[]),O=Object(r.useCallback)((function(t){if(console.log(t),"{"===(null===t||void 0===t?void 0:t.data[0])){var i=JSON.parse(t.data),r=i.type,c=i.value;switch(e.sessionId=i.sessionId,r){case"native:html":m.current=c,n();break;case"native:theme":o.a.getState().setColors(i.value);break;case"native:title":u(c);break;case"native:titleplaceholder":b(c)}Object(a.c)(r)}}),[n]);Object(r.useEffect)((function(){if(Object(a.b)()){var e=navigator.vendor.match(/apple/i),t=document;return e&&(t=window),t.addEventListener("message",O),function(){t.removeEventListener("message",O)}}}),[O]);var x=Object(r.useCallback)((function(e){Object(a.c)(a.a.filepicker,e)}),[]),y=Object(r.useCallback)((function(e){alert("downloadAttachment"+e.hash),Object(a.c)(a.a.download,e)}),[]);return{contentChange:v,selectionChange:g,titleChange:function(e){Object(a.c)(a.a.title,e)},scroll:j,title:s,setTitle:u,titlePlaceholder:p,setTitlePlaceholder:b,openFilePicker:x,downloadAttachment:y,content:m,onUpdate:function(){n()}}}}).call(this,n(51))},141:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var i=n(9),r=n(10),o=n(59),a=n(1),c=localStorage.getItem("editorSettings"),l={fullscreen:!1,deviceMode:"mobile",premium:!1,tools:Object(o.c)().default,noToolbar:e.noToolbar,noHeader:e.noHeader,readonly:e.readonly};e.settingsController={update:function(t){var n=t;JSON.stringify(n)!==JSON.stringify(e.settingsController.previous)&&(e.settingsController.set&&e.settingsController.set(n),t?localStorage.setItem("editorSettings",JSON.stringify(n)):localStorage.removeItem("editorSettings"),settingsController.previous=Object(r.a)({},n))},previous:c?JSON.parse(c):Object(r.a)({},l)};var s=function(){var t=Object(a.useState)(Object(r.a)({},e.settingsController.previous)),n=Object(i.a)(t,2),o=n[0],c=n[1];return e.settingsController.set=c,o}}).call(this,n(51))},142:function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var i=n(143),r=n.n(i),o=n(144),a=n.n(o),c=n(145),l=n.n(c),s=n(146),u=n.n(s),d=n(147),f=n.n(d),p=n(148),b=n.n(p),m=n(149),h=n.n(m),g=n(150),v=n.n(g),j=(n(1),n(151)),O=n(23),x=n(56),y=n.n(x),C=n(0),k=function(e){var t=e.onPress,n=e.children,i=e.style,r=e.preventDefault,o=void 0===r||r;return Object(C.jsx)("button",{className:y.a.btn_header,style:i,onMouseDown:function(e){o&&e.preventDefault(),t()},children:n})};function w(e){var t=e.noHeader,n=e.settings,i=e.hasUndo,o=e.hasRedo,c=Object(j.a)();return Object(C.jsx)("div",{style:{display:"flex",alignItems:"center",height:"".concat(t?c.top:50+c.top,"px"),backgroundColor:"var(--nn_bg)",position:"sticky",width:"100vw"},children:t?null:Object(C.jsxs)("div",{style:{display:"flex",width:"100%",justifyContent:"space-between",flexDirection:"row",paddingTop:c.top,height:50,alignItems:"center"},children:["mobile"===n.deviceMode||n.fullscreen?Object(C.jsx)(k,{onPress:function(){post(O.a.back)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginLeft:6,width:40,height:40,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",position:"relative"},children:Object(C.jsx)(r.a,{size:27,style:{position:"absolute"},color:"var(--nn_pri)"})}):Object(C.jsx)("div",{}),Object(C.jsxs)("div",{style:{display:"flex",alignItems:"center",flexDirection:"row"},children:[Object(C.jsx)(k,{onPress:function(){var e;null===(e=editor)||void 0===e||e.commands.undo()},style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(f.a,{color:i?"var(--nn_pri)":"var(--nn_nav)",size:25,style:{position:"absolute"}})}),Object(C.jsx)(k,{onPress:function(){var e;null===(e=editor)||void 0===e||e.commands.redo()},style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(b.a,{color:o?"var(--nn_pri)":"var(--nn_nav)",size:25,style:{position:"absolute"}})}),!n.premium&&Object(C.jsx)(k,{onPress:function(){post(O.a.pro)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(l.a,{size:25,style:{position:"absolute"},color:"orange"})}),Object(C.jsx)(k,{onPress:function(){var e;null===(e=editor)||void 0===e||e.commands.startSearch()},style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(v.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})}),Object(C.jsx)(k,{onPress:function(){post(O.a.monograph)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(a.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})}),"mobile"===n.deviceMode||n.fullscreen?null:Object(C.jsx)(k,{onPress:function(){post(O.a.fullscreen)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:10,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(h.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})}),Object(C.jsx)(k,{onPress:function(){post(O.a.properties)},preventDefault:!1,style:{borderWidth:0,borderRadius:100,color:"var(--nn_icon)",marginRight:12,width:39,height:39,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:Object(C.jsx)(u.a,{size:25,style:{position:"absolute"},color:"var(--nn_pri)"})})]})]})})}},151:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var i=n(9),r=n(1),o=localStorage.getItem("safeAreaInsets"),a=o?JSON.parse(o):{top:0,bottom:0,left:0,right:0};e.safeAreaController={update:function(e){safeAreaController.set&&safeAreaController.set(e),safeAreaController.previous=e,localStorage.setItem("safeAreaInsets",JSON.stringify(e))},reset:function(){safeAreaController.set&&safeAreaController.set(a)},previous:a};var c=function(){var t=Object(r.useState)(e.safeAreaController.previous),n=Object(i.a)(t,2),o=n[0],a=n[1];return e.safeAreaController.set=a,o}}).call(this,n(51))},152:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n(9),r=n(1),o=n.n(r),a=n(0);function c(e){var t,n,c=e.editor,l=e.container,s=Object(r.useState)({date:"",saved:""}),u=Object(i.a)(s,2),d=u[0],f=u[1],p=Object(r.useState)(!1),b=Object(i.a)(p,2),m=b[0],h=b[1],g=Object(r.useRef)(0),v=Object(r.useRef)(0),j=(null===c||void 0===c||null===(t=c.storage)||void 0===t||null===(n=t.characterCount)||void 0===n?void 0:n.words())+" words",O=Object(r.useRef)({set:f});globalThis.statusBar=O;var x=o.a.useCallback((function(e){var t=e.target.scrollTop;Date.now()-v.current<300||(t>g.current?h(!1):h(!0),v.current=Date.now(),g.current=t)}),[]);Object(r.useEffect)((function(){var e=l.current;return null===e||void 0===e||e.addEventListener("scroll",x),function(){null===e||void 0===e||e.removeEventListener("scroll",x)}}),[x,l]);var y={marginTop:0,marginBottom:0,fontSize:"12px",color:"var(--nn_icon)",marginRight:8};return Object(a.jsxs)("div",{style:{flexDirection:"row",display:"flex",height:m?20:15,paddingRight:12,paddingLeft:12,position:m?"sticky":"relative",top:0,backgroundColor:"var(--nn_bg)",zIndex:1},children:[Object(a.jsx)("p",{style:y,children:j}),Object(a.jsx)("p",{style:y,children:d.date}),Object(a.jsx)("p",{style:y,children:d.saved})]})}},153:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var i=n(9),r=n(1),o=n(23),a=n(56),c=n.n(a),l=n(0);function s(){var t=Object(r.useState)([]),n=Object(i.a)(t,2),a=n[0],s=n[1],u=Object(r.useRef)({setTags:s});e.editorTags=u;var d=function(){var e,t;null!==(e=editor)&&void 0!==e&&e.isFocused&&(editor.commands.blur(),null===(t=editorTitle.current)||void 0===t||t.blur());post(o.a.newtag)};return Object(l.jsxs)("div",{style:{padding:"0px 12px",display:"flex",alignItems:"center",marginTop:10},children:[Object(l.jsxs)("button",{className:c.a.btn,onMouseUp:function(e){e.preventDefault(),d()},onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(e){e.preventDefault(),d()},style:{borderWidth:0,backgroundColor:"var(--nn_nav)",marginRight:5,borderRadius:100,padding:"0px 10px",fontFamily:"Open Sans",display:"flex",alignItems:"center",height:"30px"},children:[0===a.length?Object(l.jsx)("p",{style:{marginRight:4,fontSize:13,color:"var(--nn_icon)",userSelect:"none"},children:"Add a tag"}):null,Object(l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"20",height:"20",viewBox:"0 0 24 24",children:Object(l.jsx)("path",{fill:"var(--nn_accent)",d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"})})]}),a.map((function(e){return Object(l.jsxs)("button",{className:c.a.btn,style:{borderWidth:0,backgroundColor:"var(--nn_nav)",marginRight:5,borderRadius:100,padding:"0px 10px",height:"30px",fontFamily:"Open Sans",fontSize:13,color:"var(--nn_icon)"},onMouseUp:function(t){t.preventDefault(),post(o.a.tag,e.title)},onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(t){t.preventDefault(),post(o.a.tag,e.title)},children:["#",e.alias]})}))]})}}).call(this,n(51))},154:function(e,t,n){"use strict";(function(e){var i=n(1),r=n.n(i),o=n(56),a=n.n(o),c=n(0);function l(t){var n=t.controller,r=t.title,o=t.titlePlaceholder,l=t.readonly,s=Object(i.useRef)(null),u=Object(i.useRef)(!0);return e.editorTitle=s,Object(i.useEffect)((function(){s.current&&(u.current=!1,s.current.value=r,u.current=!0)}),[r]),Object(c.jsx)("input",{ref:s,className:a.a.titleBar,contentEditable:!l,disabled:l,style:{height:50,fontSize:27,width:"100%",boxSizing:"border-box",borderWidth:0,paddingRight:12,paddingLeft:12,fontWeight:600,fontFamily:"Open Sans",backgroundColor:"transparent",color:"var(--nn_heading)"},onChange:function(e){var t;u.current&&(null===(t=n.current)||void 0===t||t.titleChange(e.target.value))},placeholder:o})}t.a=r.a.memo(l,(function(e,t){return e.title===t.title&&(e.titlePlaceholder===t.titlePlaceholder&&e.readonly===t.readonly)}))}).call(this,n(51))},164:function(e,t,n){},165:function(e,t,n){},197:function(e,t,n){},198:function(e,t,n){},199:function(e,t,n){},200:function(e,t,n){},201:function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),o=n(38),a=n.n(o),c=(n(164),n(165),n(126)),l=n(0);var s=function(){return Object(l.jsx)(c.a,{})},u=function(e){e&&e instanceof Function&&n.e(5).then(n.bind(null,210)).then((function(t){var n=t.getCLS,i=t.getFID,r=t.getFCP,o=t.getLCP,a=t.getTTFB;n(e),i(e),r(e),o(e),a(e)}))};n(197),n(198),n(199),n(200);a.a.render(Object(l.jsx)(r.a.StrictMode,{children:Object(l.jsx)(s,{})}),document.getElementById("root")),u()},23:function(e,t,n){"use strict";(function(e){n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var i=function(e,t,n){return n&&(clearTimeout(n),n=null),n=setTimeout(e,t)},r={selection:"editor-event:selection",content:"editor-event:content",title:"editor-event:title",scroll:"editor-event:scroll",history:"editor-event:history",newtag:"editor-event:newtag",tag:"editor-event:tag",filepicker:"editor-event:picker",download:"editor-event:download-attachment",logger:"native:logger",back:"editor-event:back",pro:"editor-event:pro",monograph:"editor-event:monograph",properties:"editor-event:properties",fullscreen:"editor-event:fullscreen"};function o(){return!!window.ReactNativeWebView}function a(t,n){o()?window.ReactNativeWebView.postMessage(JSON.stringify({type:r[t]||t,value:n,sessionId:e.sessionId})):console.log(t,n)}globalThis.logger=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var o=n.map((function(e){return"string"!==typeof e?JSON.stringify(e):e})).join(" ");a(r.logger,"[".concat(e,"]: ")+o)},globalThis.post=a}).call(this,n(51))},56:function(e,t,n){e.exports={btn:"styles_btn__19MaA",btn_header:"styles_btn_header__2xGXR",titleBar:"styles_titleBar__2hePW"}},59:function(e,t,n){"use strict";n.d(t,"e",(function(){return uo})),n.d(t,"b",(function(){return mi})),n.d(t,"d",(function(){return lo})),n.d(t,"a",(function(){return Q})),n.d(t,"c",(function(){return mn}));var i=n(101),r=n(102),o=n(103),a=n(112),c=n(104),l=n(105),s=n(106),u=n(4),d=n(52),f=u.b.create({name:"fontSize",defaultOptions:{types:["textStyle"],defaultFontSize:16},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:"".concat(this.options.defaultFontSize,"px"),parseHTML:function(e){return e.style.fontSize},renderHTML:function(e){return e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),p=u.b.create({name:"textDirection",defaultOptions:{types:["paragraph","heading"],defaultDirection:"ltr"},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{textDirection:{default:this.options.defaultDirection,parseHTML:function(e){return e.dir},renderHTML:function(e){return e.textDirection?{dir:e.textDirection}:{}}}}}]},addCommands:function(){var e=this;return{setTextDirection:function(t){return function(n){var i=n.commands;return e.options.types.every((function(e){return i.updateAttributes(e,{textDirection:t})}))}}}}}),b=n(107),m=n(83).a.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),h=n(92).a.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),g=n(108),v=n(109),j=n(110);function O(e,t,n){return{default:null,parseHTML:function(t){var i;return n?null===(i=t.style[e])||void 0===i?void 0:i.toString().replace(n,""):t.style[e]},renderHTML:function(i){return i[e]?{style:"".concat(t,": ").concat(i[e]).concat(n||"")}:{}}}}var x=n(127).a.extend({addAttributes:function(){var e;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{backgroundColor:O("backgroundColor","background-color"),color:O("color","color"),borderWidth:O("borderWidth","border-width","px"),borderStyle:O("borderStyle","border-style"),borderColor:O("borderColor","border-color")})}}),y=n(111),C=n(9),k=n(22),w=n(34),S=n(13),A=n(7),L=n(8),R=n(0),T=n(2),P=n(14),E=n(65),M=n(129),I=n.n(M)()((function(e,t){return{theme:void 0,isMobile:!1,openedPopups:{},setIsMobile:function(t){return e((function(e){e.isMobile=t}))},setTheme:function(t){return e((function(e){e.theme=t}))},toolbarLocation:"top",setToolbarLocation:function(t){return e((function(e){e.toolbarLocation=t}))},closePopup:function(t){return e((function(e){e.openedPopups=Object.assign(Object.assign({},e.openedPopups),Object(w.a)({},t,!1))}))},isPopupOpen:function(e){return!!t().openedPopups[e]},openPopup:function(t){return e((function(e){e.openedPopups=Object.assign(Object.assign({},e.openedPopups),Object(w.a)({},t.id,t))}))},closePopupGroup:function(t,n){return e((function(e){for(var i in e.openedPopups){var r=e.openedPopups[i];r&&r.group===t&&!n.includes(r.id)&&(e.openedPopups[i]=!1)}}))}}}));function D(){return I((function(e){return e.toolbarLocation}))}function z(){return I((function(e){return e.isMobile}))}var N=Object.defineProperty((function(){return I((function(e){return e.theme}))}),"theme",{get:function(){return I.getState().theme}});function H(e){var t=N();return Object(R.jsx)(E.a,Object.assign({theme:t||{}},{children:e.children}))}var B=function(){function e(t,n,i,r){var o=this;Object(A.a)(this,e),this.editor=n,this.getPos=i,this.options=r,this.isDragging=!1,this.handleRef=function(e){return o._handleRef(e)},this.portalProviderAPI=n.storage.portalProviderAPI,this.node=t}return Object(L.a)(e,[{key:"init",value:function(){var e=this;this.domRef=this.createDomRef(),this.domRef.ondragstart=function(t){return e.onDragStart(t)};var t=this.getContentDOM()||{dom:void 0,contentDOM:void 0},n=t.dom,i=t.contentDOM;return this.domRef&&n&&(this.domRef.appendChild(n),this.contentDOM=i||n,this.contentDOMWrapper=n||i),this.domRef.classList.add("".concat(this.node.type.name,"-view-content-wrap")),this.renderReactComponent((function(){return e.render(e.options.props,e.handleRef)})),this}},{key:"renderReactComponent",value:function(e){this.domRef&&e&&this.portalProviderAPI?this.portalProviderAPI.render(e,this.domRef):console.warn("Cannot render node view",this.editor.storage)}},{key:"createDomRef",value:function(){return this.options.wrapperFactory?this.options.wrapperFactory():this.node.isInline?document.createElement("span"):document.createElement("div")}},{key:"getContentDOM",value:function(){var e,t;if(this.options.contentDOMFactory){if(!0===this.options.contentDOMFactory){var n=document.createElement("div");return n.classList.add("".concat(this.node.type.name.toLowerCase(),"-content-wrapper")),n.style.whiteSpace="inherit",n.style.minWidth="20px",{dom:n}}return null===(t=(e=this.options).contentDOMFactory)||void 0===t?void 0:t.call(e)}}},{key:"_handleRef",value:function(e){var t=this.contentDOMWrapper||this.contentDOM;e&&t&&!e.contains(t)&&e.appendChild(t)}},{key:"render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return this.options.component?Object(R.jsx)(H,{children:Object(R.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,updateAttributes:function(t,n){return e.updateAttributes(t,e.getPos(),null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))}):null}},{key:"updateAttributes",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.editor.commands.command((function(o){var a=o.tr;return a.setNodeMarkup(t,void 0,Object.assign(Object.assign({},n.node.attrs),e)),a.setMeta("addToHistory",i),a.setMeta("preventUpdate",r),!0}))}},{key:"update",value:function(e,t,n){var i=this;return this.node.type===e.type&&(this.viewShouldUpdate(e)?(this.node=e,this.renderReactComponent((function(){return i.render(i.options.props,i.handleRef)})),!0):(this.node=e,!0))}},{key:"onDragStart",value:function(e){var t,n,i,r,o,a,c,l=this.editor.view,s=e.target,u=3===s.nodeType?null===(t=s.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):s.closest("[data-drag-handle]");if(this.dom&&!(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(s))&&u){var d=this.dom.querySelector("[data-drag-image]")||this.dom,f=0,p=0;if(d!==u){var b=d.getBoundingClientRect(),m=u.getBoundingClientRect(),h=null!==(i=e.offsetX)&&void 0!==i?i:null===(r=e.nativeEvent)||void 0===r?void 0:r.offsetX,g=null!==(o=e.offsetY)&&void 0!==o?o:null===(a=e.nativeEvent)||void 0===a?void 0:a.offsetY;f=m.x-b.x+h,p=m.y-b.y+g}var v=T.NodeSelection.create(l.state.doc,this.getPos()),j=l.state.tr.setSelection(v);l.dispatch(j),null===(c=e.dataTransfer)||void 0===c||c.setDragImage(d,f,p),function(e,t){if(!e.dataTransfer)return;var n=t.view,i=n.state.selection.content(),r=Object(P.d)(n,i),o=r.dom,a=r.text;e.dataTransfer.clearData(),e.dataTransfer.setData("Text",a),e.dataTransfer.setData("text/plain",a),e.dataTransfer.setData("text/html",o.innerHTML),e.dataTransfer.effectAllowed="copyMove",n.dragging={slice:i,move:!0}}(e,this.editor)}}},{key:"stopEvent",value:function(e){var t,n=this;if(!this.dom)return!1;var i=e.target;if(!(this.dom.contains(i)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(i))))return!1;var r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(i.tagName)||i.isContentEditable)&&!r)return!0;var o=this.editor.isEditable,a=this.isDragging,c=!!this.node.type.spec.draggable,l=T.NodeSelection.isSelectable(this.node),s="copy"===e.type,u="paste"===e.type,d="cut"===e.type,f="mousedown"===e.type,p=e.type.startsWith("drag");if(!c&&l&&p&&e.preventDefault(),c&&p&&!a)return e.preventDefault(),!1;if(c&&o&&!a&&f){var b=i.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",(function(){n.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(function(){n.isDragging=!1}),{once:!0}))}return!(a||r||s||u||d||f&&l)}},{key:"ignoreMutation",value:function(e){if(!this.dom||!this.contentDOM)return!0;if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&this.editor.isFocused&&[].concat(Object(S.a)(Array.from(e.addedNodes)),Object(S.a)(Array.from(e.removedNodes))).every((function(e){return e.isContentEditable})))return!1;return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}},{key:"viewShouldUpdate",value:function(e){return!this.options.shouldUpdate||this.options.shouldUpdate(this.node,e)}},{key:"setDomAttrs",value:function(e,t){Object.keys(e.attrs||{}).forEach((function(n){t.setAttribute(n,e.attrs[n])}))}},{key:"dom",get:function(){return this.domRef}},{key:"destroy",value:function(){this.domRef&&this.portalProviderAPI&&(this.portalProviderAPI.remove(this.domRef),this.domRef=void 0,this.contentDOM=void 0)}}]),e}();function F(e,t){return function(n){var i=n.node,r=n.getPos,o=n.editor;return new B(i,o,(function(){return"boolean"===typeof r?-1:r()}),Object.assign(Object.assign({},t),{component:e})).init()}}var _=n(33),V=n(15),W=n(16),U=n(1),q=n.n(U),$=n(38),J=n.n($);var G=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(){var e;return Object(A.a)(this,n),(e=t.call(this)).portals=new Map,e.setContext=function(t){e.context=t},e}return Object(L.a)(n,[{key:"render",value:function(e,t){this.portals.set(t,{children:e});var n=e();Object($.unstable_renderSubtreeIntoContainer)(this.context,n,t)}},{key:"forceUpdate",value:function(){}},{key:"remove",value:function(e){this.portals.delete(e);try{Object($.unmountComponentAtNode)(e)}catch(t){}}}]),n}(function(){function e(){Object(A.a)(this,e),this.listeners={}}return Object(L.a)(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t)}},{key:"off",value:function(e,t){this.listeners[e]&&this.listeners[e].has(t)&&this.listeners[e].delete(t)}},{key:"emit",value:function(e,t){this.listeners[e]&&this.listeners[e].forEach((function(e){return e(t)}))}},{key:"destroy",value:function(){this.listeners={}}}]),e}()),X=q.a.createContext(void 0);function K(){return Object(U.useContext)(X)}var Q=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(e){var i;return Object(A.a)(this,n),(i=t.call(this,e)).portalProviderAPI=new G,i}return Object(L.a)(n,[{key:"render",value:function(){return Object(R.jsxs)(X.Provider,Object.assign({value:this.portalProviderAPI},{children:[this.props.children,Object(R.jsx)(Y,{portalProviderAPI:this.portalProviderAPI})]}))}},{key:"componentDidUpdate",value:function(){this.portalProviderAPI.forceUpdate()}}]),n}(q.a.Component);Q.displayName="PortalProvider";var Y=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(e){var i;return Object(A.a)(this,n),(i=t.call(this,e)).handleUpdate=function(e){return i.setState({portals:e})},e.portalProviderAPI.setContext(Object(_.a)(i)),e.portalProviderAPI.on("update",i.handleUpdate),i.state={portals:new Map},i}return Object(L.a)(n,[{key:"render",value:function(){var e=this.state.portals;return Object(R.jsx)(R.Fragment,{children:Array.from(e.entries()).map((function(e){var t=Object(C.a)(e,2),n=t[0],i=t[1];return Object($.createPortal)(i,n)}))})}}]),n}(q.a.Component),Z=n(25),ee=n(19),te=function(){function e(){Object(A.a)(this,e),this.changeHandlers=[],this.changeHandlers=[]}return Object(L.a)(e,[{key:"subscribe",value:function(e){this.changeHandlers.push(e)}},{key:"unsubscribe",value:function(e){this.changeHandlers=this.changeHandlers.filter((function(t){return t!==e}))}},{key:"notifyNewSelection",value:function(e,t){this.changeHandlers.forEach((function(n){return n(e,t)}))}}]),e}(),ne=new T.PluginKey("reactNodeView"),ie=new T.Plugin({state:{init:function(){return new te},apply:function(e,t){return t}},key:ne,view:function(e){var t=ne.getState(e.state);return{update:function(e){var n=e.state.selection,i=n.from,r=n.to;t.notifyNewSelection(i,r)}}}}),re=u.b.create({name:"node-view-selection-notifier",addProseMirrorPlugins:function(){return[ie]}}),oe=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(e,i,r,o){var a;return Object(A.a)(this,n),(a=t.call(this,e,i,r,o)).pos=-1,a.isNodeInsideSelection=function(e,t,n,i){var r=a.getPositionsWithDefault(n,i);return n=r.pos,i=r.posEnd,"number"===typeof n&&"number"===typeof i&&(e<=n&&t>=i)},a.isSelectionInsideNode=function(e,t,n,i){var r=a.getPositionsWithDefault(n,i);return n=r.pos,i=r.posEnd,"number"===typeof n&&"number"===typeof i&&(n<e&&t<i)},a.isSelectedNode=function(e){if(e instanceof T.NodeSelection){var t=a.editor.view.state.selection,n=t.from,i=t.to;return e.node===a.node||a.pos===n&&a.posEnd===i&&e.node.eq(a.node)}return!1},a.insideSelection=function(){var e=a.editor.view.state.selection,t=e.from,n=e.to;return a.isSelectedNode(a.editor.view.state.selection)||a.isSelectionInsideNode(t,n)},a.nodeInsideSelection=function(){var e=a.editor.view.state.selection,t=e.from,n=e.to;return a.isSelectedNode(e)||a.isNodeInsideSelection(t,n)},a.onSelectionChange=function(){a.update(a.node,[],P.b.empty)},a.updatePos(),a.oldSelection=i.view.state.selection,a.selectionChangeState=ne.getState(a.editor.view.state),a.selectionChangeState.subscribe(a.onSelectionChange),a}return Object(L.a)(n,[{key:"render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(!this.options.component)return null;var i=this.editor.isEditable&&(this.insideSelection()||this.nodeInsideSelection());return Object(R.jsx)(H,{children:Object(R.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,selected:i,updateAttributes:function(t,n){return e.updateAttributes(t,e.pos,null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))})}},{key:"updatePos",value:function(){"boolean"!==typeof this.getPos&&(this.pos=this.getPos(),this.posEnd=this.pos+this.node.nodeSize)}},{key:"getPositionsWithDefault",value:function(e,t){return{pos:"number"!==typeof e?this.pos:e,posEnd:"number"!==typeof t?this.posEnd:t}}},{key:"viewShouldUpdate",value:function(e){if(Object(Z.a)(Object(ee.a)(n.prototype),"viewShouldUpdate",this).call(this,e))return!0;var t=this.editor.view.state.selection,i=this.oldSelection;this.oldSelection=t;var r=this.pos,o=this.posEnd;this.updatePos();var a=t.from,c=t.to,l=i.from,s=i.to;if(this.node.type.spec.selectable){var u=t instanceof T.NodeSelection&&t.from===this.pos,d=i instanceof T.NodeSelection&&i.from===this.pos;if(u&&!d||d&&!u)return!0}var f=this.isNodeInsideSelection(a,c)&&!this.isNodeInsideSelection(l,s),p=!this.isNodeInsideSelection(a,c)&&this.isNodeInsideSelection(l,s),b=this.isNodeInsideSelection(a,c,r,o)&&!this.isNodeInsideSelection(a,c);return!!(f||p||b)}},{key:"destroy",value:function(){this.selectionChangeState.unsubscribe(this.onSelectionChange),Object(Z.a)(Object(ee.a)(n.prototype),"destroy",this).call(this)}}]),n}(B);function ae(e,t){return function(n){var i=n.node,r=n.getPos,o=n.editor;return new oe(i,o,(function(){return"boolean"===typeof r?-1:r()}),Object.assign(Object.assign({},t),{component:e})).init()}}var ce=n(6),le=n(130),se=n.n(le),ue=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function de(e){var t=e.title,n=e.path,i=e.size,r=void 0===i?24:i,o=e.color,a=void 0===o?"icon":o,c=e.stroke,l=e.rotate,s=Object(E.b)(),u=(null===s||void 0===s?void 0:s.colors)?s.colors[a]:a;return Object(R.jsx)(se.a,{className:"icon",title:t,path:n,size:"".concat("string"===typeof r?(null===s||void 0===s?void 0:s.iconSizes[r])||24:r,"px"),style:{strokeWidth:c||"0px",stroke:u},color:u,spin:l})}function fe(e){var t=e.sx,n=e.title,i=e.color,r=e.size,o=e.stroke,a=e.rotate,c=e.path,l=ue(e,["sx","title","color","size","stroke","rotate","path"]);return Object(R.jsx)(ce.c,Object.assign({sx:Object.assign({flexShrink:0,justifyContent:"center",alignItems:"center"},t)},l,{children:Object(R.jsx)(de,{title:n,path:c,rotate:a,color:i,stroke:o,size:r})}))}var pe=n(11),be={bold:pe.D,italic:pe.N,underline:pe.Z,strikethrough:pe.U,code:pe.t,codeRemove:"M3.62109375 1.83837892 2.26318358 3.13037107 6.46289063 7.536621 1.9995117 12l6.0000003 6 1.40039025-1.400391L4.80029295 12l3.0292968-3.0292965 7.0283205 7.371093-.2578125.2578125L16.000488 18l.224121-.224121 4.3125 4.52490225 1.35791025-1.29492225-4.34326125-4.55712825L22.000488 12l-6-6-1.40039025 1.40039063L19.19970675 12l-3.016113 3.016113L9.156738 7.6435545l.24316425-.24316387L7.999512 6l-.2109375.2109375Z",alignCenter:pe.z,alignLeft:pe.B,alignRight:pe.C,alignJustify:pe.A,subscript:pe.V,superscript:pe.W,horizontalRule:pe.i,codeblock:pe.s,blockquote:pe.T,formatClear:pe.E,ltr:pe.X,rtl:pe.Y,numberedList:pe.S,bulletList:pe.Q,highlight:pe.G,textColor:pe.H,link:pe.gb,linkRemove:pe.fb,openLink:pe.mb,linkEdit:"m19 14 1.28 1.28c.22.21.22.56 0 .77l-1 1L17.23 15l1-1c.11-.11.25-.17.39-.17s.27.06.38.17m-.3 3.63-6.06 6.07h-2.06v-2.06l6.07-6.06zM7 7h4v2H7c-1.6568542 0-3 1.343146-3 3s1.3431458 3 3 3h4v2H7c-2.7614237 0-5-2.238576-5-5 0-2.7614237 2.2385763-5 5-5m10 0c2.761424 0 5 2.2385763 5 5h-2c0-1.656854-1.343146-3-3-3h-4V7h4m-9 4h8v2H8v-2",linkSettings:"M7 7h4v2H7c-1.6568542 0-3 1.343146-3 3s1.3431458 3 3 3h4v2H7c-2.7614237 0-5-2.238576-5-5 0-2.7614237 2.2385763-5 5-5m10 0c2.761424 0 5 2.2385763 5 5h-2c0-1.656854-1.343146-3-3-3h-4V7h4m-9 4h8v2H8v-2m15.119777 8.323608-1.07-.82c.02-.17.04-.33.04-.5 0-.17-.01-.33-.04-.5l1.06-.82c.09258-.07939.117526-.212463.06-.32l-1-1.73c-.06-.13-.19-.13-.33-.13l-1.22.5c-.28-.18-.54-.35-.85-.47l-.19-1.32c-.01-.12-.12-.21-.24-.21h-2c-.12 0-.23.09-.25.21l-.19 1.32c-.3.13-.59.29-.85.47l-1.24-.5c-.11 0-.24 0-.31.13l-1 1.73c-.06.11-.04.24.06.32l1.06.82c-.03989.33214-.03989.66786 0 1l-1.06.82c-.09258.07939-.117526.212462-.06.32l1 1.73c.06.13.19.13.31.13l1.24-.5c.26.18.54.35.85.47l.19 1.32c.02.12.12.21.25.21h2c.12 0 .23-.09.25-.21l.19-1.32c.3-.13.56-.29.84-.47l1.22.5c.14 0 .27 0 .34-.13l1-1.73c.05753-.107538.03258-.240607-.06-.32m-4.78.18c-.83 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.66 1.5-1.5 1.5z",url:pe.eb,image:pe.bb,imageSettings:pe.cb,colorClear:pe.db,check:pe.k,checkbox:pe.l,loading:pe.hb,more:pe.v,upload:pe.Hb,camera:pe.j,attachment:pe.h,table:pe.tb,rowProperties:pe.Cb,insertRowBelow:pe.Db,insertRowAbove:pe.Eb,moveRowDown:pe.b,moveRowUp:pe.e,deleteRow:pe.Fb,toggleHeaderRow:pe.ub,columnProperties:pe.zb,insertColumnRight:pe.wb,insertColumnLeft:pe.xb,moveColumnRight:pe.d,moveColumnLeft:pe.c,deleteColumn:pe.yb,cellProperties:pe.pb,cellBorderColor:"M4 24q-.825 0-1.412-.587Q2 22.825 2 22q0-.825.588-1.413Q3.175 20 4 20h16q.825 0 1.413.587Q22 21.175 22 22q0 .825-.587 1.413Q20.825 24 20 24Zm1-6q-.425 0-.713-.288Q4 17.425 4 17v-2.325q0-.2.075-.388q.075-.187.225-.337l8.75-8.75l3.75 3.75l-8.75 8.75q-.15.15-.337.225q-.188.075-.388.075Zm1-2h.9L14 8.95L13.05 8L6 15.1Zm11.925-8.15l-3.75-3.75l1.8-1.8q.275-.3.7-.288q.425.013.7.288l2.35 2.35q.275.275.275.688q0 .412-.275.712ZM6 16Z",backgroundColor:pe.F,borderColor:"M4 24q-.825 0-1.412-.587Q2 22.825 2 22q0-.825.588-1.413Q3.175 20 4 20h16q.825 0 1.413.587Q22 21.175 22 22q0 .825-.587 1.413Q20.825 24 20 24Zm1-6q-.425 0-.713-.288Q4 17.425 4 17v-2.325q0-.2.075-.388q.075-.187.225-.337l8.75-8.75l3.75 3.75l-8.75 8.75q-.15.15-.337.225q-.188.075-.388.075Zm1-2h.9L14 8.95L13.05 8L6 15.1Zm11.925-8.15l-3.75-3.75l1.8-1.8q.275-.3.7-.288q.425.013.7.288l2.35 2.35q.275.275.275.688q0 .412-.275.712ZM6 16Z",sortDesc:pe.sb,deleteTable:pe.Bb,mergeCells:pe.Ab,splitCells:pe.Gb,checklist:pe.R,dragHandle:pe.x,previousMatch:pe.g,nextMatch:pe.a,replaceOne:"m5.4 5.42 3.48 3.5 3.43-3.43-1.08-1.08-1.57 1.55V3.5a.8.8 0 0 1 .76-.81h2.35v-1.5h-2.35a2.29 2.29 0 0 0-2.28 2.3v2.5L6.48 4.33Zm10.3 2.77c.3.48.7.72 1.25.72.61 0 1.1-.26 1.45-.78.37-.51.55-1.2.55-2.05 0-.8-.15-1.41-.46-1.87a1.51 1.51 0 0 0-1.33-.68c-.63 0-1.11.3-1.45.9h-.02V1.19h-1.37v7.6h1.37v-.6Zm-.03-1.64v-.52c0-.39.09-.7.27-.93a.83.83 0 0 1 .69-.36.76.76 0 0 1 .67.36c.16.24.24.57.24 1 0 .5-.09.9-.26 1.18a.8.8 0 0 1-.73.42.76.76 0 0 1-.63-.33 1.32 1.32 0 0 1-.25-.82zm-1.35 12.82c-.4.23-.97.35-1.71.35-.87 0-1.58-.27-2.12-.82a2.9 2.9 0 0 1-.8-2.12c0-1 .28-1.8.86-2.37a3.12 3.12 0 0 1 2.31-.87c.67 0 1.16.1 1.46.28v1.54a1.95 1.95 0 0 0-1.23-.42c-.5 0-.9.15-1.2.46-.29.3-.43.72-.43 1.26 0 .52.14.93.42 1.23.28.3.67.44 1.16.44.43 0 .86-.14 1.28-.43zm-7.73-8.91L5.05 12v9.27l1.54 1.54h10.82l1.54-1.54V12l-1.54-1.54zm0 1.54h10.82v9.27H6.59Z",replaceAll:"M16.53 4.22c.22-.45.52-.68.92-.68.36 0 .64.17.83.52.2.34.3.81.3 1.4a3.1 3.1 0 0 1-.35 1.57c-.22.39-.53.59-.91.59-.35 0-.61-.19-.79-.55h-.01v.45h-.87V1.77h.87v2.45h.01zm-.02 1.6a1.14 1.14 0 0 0 .15.63c.1.17.24.25.4.25.2 0 .35-.1.46-.32a2 2 0 0 0 .17-.9c0-.32-.05-.57-.15-.75-.1-.18-.24-.27-.43-.27-.17 0-.32.09-.43.27a1.3 1.3 0 0 0-.17.7ZM5.6 11.56l-3.1-3.1.97-.97 1.47 1.46v-2.2A2.03 2.03 0 0 1 6.96 4.7h3.43v1.32H6.96a.72.72 0 0 0-.68.73l.01 2.19 1.39-1.38.96.96-3.04 3.04Zm7.65-4.04h.94v-2.5c0-1.18-.46-1.78-1.38-1.78-.2 0-.41.04-.66.1a2.11 2.11 0 0 0-.56.25v.97c.34-.3.71-.44 1.1-.44.38 0 .57.23.57.68l-.88.16c-.74.12-1.11.59-1.11 1.4 0 .38.09.7.27.92a.9.9 0 0 0 .74.35c.42 0 .74-.24.96-.7h.01zm0-1.98v.28a1.1 1.1 0 0 1-.17.64.54.54 0 0 1-.46.25.4.4 0 0 1-.32-.14.56.56 0 0 1-.11-.36c0-.33.16-.51.48-.57l.59-.1zM9.82 19.21h-.94v-.6h-.02c-.21.46-.53.7-.96.7a.9.9 0 0 1-.74-.35 1.47 1.47 0 0 1-.27-.92c0-.8.38-1.28 1.12-1.4l.87-.15c0-.46-.19-.69-.57-.69-.38 0-.75.15-1.1.45v-.98c.14-.09.33-.17.57-.24.24-.07.46-.1.66-.1.92 0 1.38.59 1.38 1.78zm-.94-1.7v-.29l-.58.1c-.33.06-.49.25-.49.57 0 .15.04.27.12.36a.4.4 0 0 0 .32.14.54.54 0 0 0 .46-.25c.11-.17.17-.38.17-.63zm4.24 1.8c.47 0 .83-.09 1.08-.26v-1.03a1.32 1.32 0 0 1-.8.3.9.9 0 0 1-.74-.31c-.17-.22-.26-.5-.26-.88s.1-.68.28-.9a.94.94 0 0 1 .75-.32c.28 0 .54.1.77.3v-1.1c-.19-.12-.5-.19-.91-.19-.61 0-1.1.2-1.47.62-.36.4-.54.97-.54 1.68 0 .61.17 1.11.5 1.5.35.4.8.59 1.34.59zM2.5 13.46 3.96 12h13.16l1.46 1.46v7.3l-1.46 1.47H3.96L2.5 20.77Zm1.46 0v7.3h13.16v-7.3Zm4.39-2.92L9.8 9.08h10.23l1.46 1.46v7.3l-1.46 1.47v-8.77z",replace:"M21 4.5000005V14.25a1.5000007 1.5000005 0 0 1-1.500007 1.500005h-8.999996v1.49999a.74999993.74999995 0 0 1-.459373.693747.79687482.79687478 0 0 1-.290624.056263.77812509.77812509 0 0 1-.534375-.215621l-2.25-2.25a.759375.759375 0 0 1 0-1.068763l2.25-2.25a.7875.7875 0 0 1 .824999-.159371.74999993.74999995 0 0 1 .459373.693745V14.25h8.999996V4.5000005H9.0000007v.7499997a.75000036.75000039 0 0 1-1.5000007 0v-.7499997A1.5000007 1.5000005 0 0 1 9.0000007 3H19.499993A1.5000007 1.5000005 0 0 1 21 4.5000005ZM15.750007 18.000005a.74999993.74999995 0 0 0-.750014.749995v.749995H4.5000007V9.7500002h9.0000063v1.5000048a.759375.759375 0 0 0 .459381.693745.79687482.79687478 0 0 0 .290612.05631.77812509.77812509 0 0 0 .534372-.215621l2.25-2.2500079a.759375.759375 0 0 0 0-1.06875l-2.25-2.25a.76875023.76875019 0 0 0-.824984-.1594227.74999993.74999995 0 0 0-.459381.6937502v1.4999978H4.5000007A1.5000007 1.5000005 0 0 0 3 9.7500002v9.7499948A1.5000007 1.5000005 0 0 0 4.5000007 21H14.999993A1.5000007 1.5000005 0 0 0 16.5 19.499995V18.75a.74999993.74999995 0 0 0-.749993-.749995z",attachmentSettings:"m24.0138 20.223188-1.07-.82c.02-.17.04-.33.04-.5 0-.17-.01-.33-.04-.5l1.06-.82c.09258-.07939.117526-.212463.06-.32l-1-1.73c-.06-.13-.19-.13-.33-.13l-1.22.5c-.28-.18-.54-.35-.85-.47l-.19-1.32c-.01-.12-.12-.21-.24-.21h-2c-.12 0-.23.09-.25.21l-.19 1.32c-.3.13-.59.29-.85.47l-1.24-.5c-.11 0-.24 0-.31.13l-1 1.73c-.06.11-.04.24.06.32l1.06.82c-.03989.33214-.03989.66786 0 1l-1.06.82c-.09258.07939-.117526.212463-.06.32l1 1.73c.06.13.19.13.31.13l1.24-.5c.26.18.54.35.85.47l.19 1.32c.02.12.12.21.25.21h2c.12 0 .23-.09.25-.21l.19-1.32c.3-.13.56-.29.84-.47l1.22.5c.14 0 .27 0 .34-.13l1-1.73c.05753-.107537.03258-.240606-.06-.32m-4.78.18c-.83 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.66 1.5-1.5 1.5zM16.61 13.5c-.8.35-1.5.86-2.07 1.5H9.5c-3.3333319 0-3.3333319-5 0-5H17v1.5H9.5c-.55 0-1 .45-1 1s.45 1 1 1h7.11m-13.11-1c0-2.21 1.79-4 4-4H18c2.434718-.00632 3.435847 3.121347 1.45 4.53.6.04 1.18.17 1.72.38.52-.67.83-1.5.83-2.41 0-2.21-1.79-4-4-4H7.5C4.46 7 2 9.46 2 12.5S4.46 18 7.5 18h5.59c.09-.53.25-1.03.46-1.5H7.5c-2.21 0-4-1.79-4-4",caseSensitive:pe.O,wholeWord:pe.P,regex:pe.qb,embed:pe.lb,embedSettings:pe.kb,palette:pe.nb,tableSettings:pe.vb,math:pe.ab,mathBlock:pe.ib,outlineList:pe.y,fontFamily:pe.I,fontSize:pe.J,heading:pe.K,indent:pe.M,outdent:pe.L,plus:pe.ob,minus:pe.jb,close:pe.r,delete:pe.u,download:pe.w,chevronDown:pe.m,chevronUp:pe.p,chevronRight:pe.o,chevronLeft:pe.n,circle:pe.q,arrowLeft:pe.f,resize:pe.rb,none:""},me=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},he=Object(U.forwardRef)((function(e,t){var n,i=e.sx,r=me(e,["sx"]),o=(null===(n=null===i||void 0===i?void 0:i[":hover"])||void 0===n?void 0:n.bg)||"hover",a=(null===i||void 0===i?void 0:i.bg)||"unset",c=Object(U.useRef)();Object(U.useEffect)((function(){if(c.current)return c.current.addEventListener("mousedown",l,{passive:!1,capture:!0}),function(){var e;null===(e=c.current)||void 0===e||e.removeEventListener("mousedown",l,{capture:!0})}}),[]);var l=Object(U.useCallback)((function(e){e.preventDefault()}),[]);return Object(R.jsx)(ce.b,Object.assign({},r,{sx:Object.assign(Object.assign({},i),{":hover":{bg:[a,o]},":active":{bg:o}}),ref:function(e){c.current=e,"function"===typeof t?t(e):t&&(t.current=e)},onClick:e.onClick}))})),ge=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},ve=q.a.memo((function(e){var t=e.id,n=e.icon,i=e.iconSize,r=e.iconColor,o=e.toggled,a=e.sx,c=e.buttonRef,l=e.variant,s=void 0===l?"normal":l,u=ge(e,["id","icon","iconSize","iconColor","toggled","sx","buttonRef","variant"]);return Object(R.jsx)(he,Object.assign({ref:c,tabIndex:-1,id:"tool-".concat(t||n),sx:Object.assign({flexShrink:0,p:"small"===s?"small":1,borderRadius:"small"===s?"small":"default",m:0,bg:o?"hover":"transparent",mr:"small"===s?0:1,":hover":{bg:"hover"},":last-of-type":{mr:0}},a),onMouseDown:function(e){return e.preventDefault()}},u,{children:Object(R.jsx)(fe,{path:be[n],color:r||"icon",size:i||("small"===s?"medium":"big")})}))}),(function(e,t){return e.toggled===t.toggled&&e.icon===t.icon&&JSON.stringify(e.sx)===JSON.stringify(t.sx)}));function je(e){var t=e.item,n=e.isFocused,i=e.onMouseEnter,r=e.onMouseLeave,o=e.onClick,a=t.title,c=t.key,l=t.icon,s=t.tooltip,u=t.isDisabled,d=t.isChecked,f=t.menu,p=t.modifier,b=t.styles,m=Object(U.useRef)(null),h="bottom"===D();return Object(R.jsx)(ce.c,Object.assign({as:"li",sx:{flexShrink:0,flexDirection:"column"},onMouseEnter:i,onMouseLeave:r},{children:Object(R.jsxs)(he,Object.assign({id:c,"data-test-id":"MenuButton-".concat(c),ref:m,tabIndex:-1,variant:"menuitem",title:s,disabled:u,onClick:o,sx:Object.assign(Object.assign({},b),{bg:n&&!h?"hover":"transparent",display:"flex",alignItems:"center",justifyContent:"space-between",":hover":{bg:h?"transparent":"hover"}})},{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{fontSize:"inherit",fontFamily:"inherit"}},{children:[l&&Object(R.jsx)(fe,{path:be[l],color:"text",size:"medium",sx:{mr:2}}),Object(R.jsx)(ce.e,Object.assign({as:"span",variant:"body",sx:{fontSize:"inherit",fontFamily:"inherit"}},{children:a}))]})),d||f||p?Object(R.jsxs)(ce.c,Object.assign({sx:{ml:4}},{children:[d&&Object(R.jsx)(fe,{path:be.check,size:"small"}),f&&Object(R.jsx)(fe,{path:be.chevronRight,size:"small"}),p&&Object(R.jsx)(ce.e,Object.assign({as:"span",sx:{fontFamily:"body",fontSize:"menu",color:"fontTertiary"}},{children:p}))]})):null]}),c)}))}function Oe(){return Object(R.jsx)(ce.a,{as:"li",sx:{width:"95%",height:"0.5px",bg:"border",my:2,alignSelf:"center"}})}var xe=n(87),ye=n.n(xe),Ce=n(205),ke=n(131),we=n(206),Se=n(207),Ae=Object(Ce.a)(ce.c),Le={type:"spring",stiffness:300,damping:30,mass:.2,duration:300};function Re(e){var t,n=e.isOpen,i=e.title,r=e.items,o=e.onClose,a=e.blocking,c=void 0===a||a,l=e.focusOnRender,s=void 0===l||l,u=e.draggable,d=void 0===u||u,f=e.children,p=N(),b=Object(U.useRef)(),m=Object(ke.a)(0),h=Object(we.a)(m,[0,(null===(t=b.current)||void 0===t?void 0:t.offsetHeight)||window.innerHeight],[1,0]),g=Object(Se.a)(),v=Object(U.useCallback)((function(){var e,t=(null===(e=b.current)||void 0===e?void 0:e.offsetHeight)||window.innerHeight;setTimeout((function(){null===o||void 0===o||o()}),Le.duration-50),g.start({transition:Le,y:t+100})}),[g,o,b.current]),j=Object(U.useCallback)((function(e){n&&(e.preventDefault(),v())}),[n,v]);return Object(U.useEffect)((function(){return window.addEventListener("handleBackPress",j),function(){window.removeEventListener("handleBackPress",j)}}),[j]),n?Object(R.jsx)(ye.a,Object.assign({contentRef:function(e){return b.current=e},className:"bottom-sheet-presenter",role:"menu",isOpen:n,appElement:document.body,shouldCloseOnEsc:c,shouldReturnFocusAfterClose:s,shouldCloseOnOverlayClick:c,shouldFocusAfterRender:s,ariaHideApp:c,preventScroll:c,onRequestClose:function(){return v()},portalClassName:"bottom-sheet-presenter-portal",onAfterOpen:function(){console.log("OPEGN!"),g.start({transition:Le,y:0})},overlayElement:function(e,t){return Object(R.jsxs)(ce.a,Object.assign({},e,{style:Object.assign(Object.assign({},e.style),{position:c?"fixed":"sticky",zIndex:1e3,backgroundColor:c?"unset":"transparent"}),tabIndex:-1},{children:[c&&Object(R.jsx)(Ce.a.div,{id:"action-sheet-overlay",style:{height:"100%",width:"100%",opacity:h,position:"absolute",backgroundColor:"var(--overlay)"},tabIndex:-1}),t]}))},contentElement:function(e,t){return Object(R.jsx)(ce.a,Object.assign({},e,{style:{},sx:{left:0,right:0,bottom:0,display:"flex",width:"auto",height:"fit-content",position:"fixed",backgroundColor:void 0,padding:0,zIndex:0,outline:0,isolation:"isolate"}},{children:t}))}},{children:Object(R.jsxs)(Ae,Object.assign({animate:g,style:{y:m},initial:{y:1e3},sx:{bg:"background",borderTopLeftRadius:15,borderTopRightRadius:15,boxShadow:(null===p||void 0===p?void 0:p.shadows.menu)||"none",flex:1,flexDirection:"column"}},{children:[d&&Object(R.jsx)(Ae,Object.assign({drag:"y",onDrag:function(e,t){var n=t.delta;m.set(Math.max(m.get()+n.y,0))},onDragEnd:function(e,t){if(t.velocity.y>=500)null===o||void 0===o||o();else{var n=30*b.current.offsetHeight/100;m.get()>=n?v():g.start({transition:Le,y:0})}},dragConstraints:{top:0,bottom:0},dragMomentum:!1,dragElastic:!1,sx:{bg:"transparent",alignItems:"center",justifyContent:"center",p:2}},{children:Object(R.jsx)(ce.a,{id:"pill",sx:{backgroundColor:"hover",width:60,height:8,borderRadius:100}})})),Object(R.jsx)(Te,Object.assign({items:r,title:i,onClose:o},{children:f}))]}))})):null}function Te(e){var t,n=e.title,i=e.items,r=e.onClose,o=e.children,a=function(e){var t=Object(U.useState)(e),n=Object(C.a)(t,2),i=n[0],r=n[1],o=Object(U.useState)(!1),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useRef)([e]);return{current:i,goBack:Object(U.useCallback)((function(){if(c){var e=s.current.pop();r(e),s.current.length<=1&&l(!1)}}),[c]),navigate:Object(U.useCallback)((function(e){console.log("NAVI",e),r((function(t){return t&&s.current.push(t),e})),l(!0)}),[]),canGoBack:c}}({title:n,items:i}),c=a.current,l=a.goBack,s=a.canGoBack,u=a.navigate;return Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column"}},{children:[s||(null===c||void 0===c?void 0:c.title)?Object(R.jsxs)(ce.c,Object.assign({id:"header",sx:{alignItems:"center",mx:0,mb:1}},{children:[s&&Object(R.jsx)(ce.b,Object.assign({variant:"icon",sx:{p:1,ml:1},onClick:l},{children:Object(R.jsx)(fe,{path:be.arrowLeft,size:"big"})})),(null===c||void 0===c?void 0:c.title)&&Object(R.jsx)(ce.e,Object.assign({variant:"title",sx:{ml:1,fontSize:"title"}},{children:null===c||void 0===c?void 0:c.title}))]})):null,o||(null===(t=null===c||void 0===c?void 0:c.items)||void 0===t?void 0:t.map((function(e){if(e.isHidden)return null;switch(e.type){case"separator":return Object(R.jsx)(Oe,{},e.key);case"button":return Object(R.jsx)(je,{item:e,onClick:function(t){e.menu?u(e.menu):e.onClick&&(null===r||void 0===r||r(),setTimeout((function(){var t;null===(t=e.onClick)||void 0===t||t.call(e)}),300))}},e.key);case"popup":return Object(R.jsx)(q.a.Fragment,{children:Object(R.jsx)(e.component,{onClick:r})},e.key)}})))]}))}var Pe={x:0,y:0,actualX:0,actualY:0};function Ee(e,t){var n=t||{},i=n.target,r=void 0===i?"mouse":i,o=n.isTargetAbsolute,a=void 0!==o&&o,c=n.location,l=void 0===c?void 0:c,s=n.yOffset,u=void 0===s?0:s,d=n.xOffset,f=void 0===d?0:d,p=n.align,b=void 0===p?"start":p,m=n.parent,h=void 0===m?document.body:m,g=n.yAnchor,v="mouse"===r?Pe:Me(r,a),j=v.x,O=v.y,x=v.width,y=v.height,C=v.actualX,k=v.actualY,w=e.offsetWidth,S=e.offsetHeight,A=h.clientWidth,L=h.clientHeight,R={top:0,left:0};if(A-C<w){var T=C-j;R.left=A-w,R.left-=T}else R.left=j;if(x&&"right"===l?R.left+=x:"left"===l&&(R.left-=w),R.top=k+S>L?L-S:O,y&&("below"===l?R.top+=y:"top"===l&&(R.top=O-S)),x&&"mouse"!==r&&"center"===b&&w>0?R.left-=(w-x)/2:x&&"mouse"!==r&&"end"===b&&w>0&&(R.left-=w-x),S>L-R.top&&(e.style.maxHeight="".concat(L-20,"px")),g){var P=Me(g,a);R.top=P.y-S}return R.top=a&&R.top<0?0:R.top,R.left=a&&R.left<0?0:R.left,R.top+="below"===l?u:-u,R.left+=f,R}function Me(e,t){var n=e.getBoundingClientRect(),i={x:e.offsetLeft,y:e.offsetTop,width:n.width,height:n.height,actualY:n.y,actualX:n.x};return t&&(i.x=i.actualX,i.y=i.actualY),i}function Ie(e,t,n){var i=Object(U.useState)(-1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useCallback)((function(t){var n=e[t];if(n){var i=document.getElementById(n.key);i&&i.scrollIntoView({behavior:"auto"})}}),[e]),f=Object(U.useCallback)((function(i){var r=function(t){return e[t]},o=function(t){var n,i;return e&&("separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||(null===(i=r(t))||void 0===i?void 0:i.isDisabled))},c=function(t){return t<e.length-1?++t:0},l=function(t){return t>0?--t:e.length-1},f=function(t){return e&&r(t).menu};a((function(e){var r=e;switch(i.key){case"ArrowUp":if(s)break;for(r=l(e);o(r);)r=l(r);break;case"ArrowDown":if(s)break;for(r=c(e);o(r);)r=c(r);break;case"ArrowRight":f(e)&&u(!0);break;case"ArrowLeft":!function(e){f(e)&&u(!1)}(e);break;case"Enter":t&&t(i);break;case"Escape":n&&n(i)}return r!==e&&d(r),r}))}),[e,s,d,t]);return Object(U.useEffect)((function(){return window.addEventListener("keydown",f),function(){window.removeEventListener("keydown",f)}}),[f]),{focusIndex:o,setFocusIndex:a,isSubmenuOpen:s,setIsSubmenuOpen:u}}function De(){return document.querySelector(".editor-toolbar")||void 0}function ze(){return document.getElementById("popup-container")||void 0}window.addEventListener("mousemove",(function(e){var t=function(e){var t=0,n=0;!e&&window.event&&(e=window.event);e.pageX||e.pageY?(t=e.pageX,n=e.pageY):(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);return{x:t,y:n,actualY:n,actualX:t}}(e),n=t.x,i=t.y,r=t.actualX,o=t.actualY;Pe.x=n,Pe.y=i,Pe.actualX=r,Pe.actualY=o}));var Ne=q.a.createContext(null),He=q.a.createContext(null),Be=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(){var e;return Object(A.a)(this,n),(e=t.apply(this,arguments)).popupContainer=null,e.state={popups:[]},e.openPopup=function(t,n){n&&e.setState((function(e){return{popups:[].concat(Object(S.a)(e.popups),[{id:t,popup:n}])}}))},e.closePopup=function(t){e.setState((function(e){var n=e.popups.findIndex((function(e){return e.id===t}));if(n<=-1)return e;var i=e.popups.slice();return i.splice(n,1),{popups:i}}))},e}return Object(L.a)(n,[{key:"render",value:function(){return Object(R.jsxs)(Ne.Provider,Object.assign({value:this},{children:[this.props.children,Object(R.jsxs)(He.Provider,Object.assign({value:this.props.editor},{children:[this.state.popups.map((function(e){var t=e.id,n=e.popup;return Object(R.jsx)(n,{id:t},t)})),Object(R.jsx)("div",{id:"popup-container"})]}))]}))}}]),n}(q.a.Component);var Fe=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function _e(e){var t=e.isOpen,n=e.position,i=e.onClose,r=e.blocking,o=void 0===r||r,a=e.focusOnRender,c=void 0===a||a,l=e.children,s=z(),u=Object(U.useRef)(),d=Object(U.useRef)(),f=Object(U.useCallback)((function(){if(u.current&&n){var e=u.current,t=Ee(e,n);e.style.top=t.top+"px",e.style.left=t.left+"px"}}),[n]);Object(U.useEffect)((function(){f()}),[n]),Object(U.useEffect)((function(){function e(){f()}return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var p=Object(U.useCallback)((function(){if(u.current&&t){var e=u.current.querySelector(".movable");if(e){var n=u.current,i={x:0,y:0};e.addEventListener("mousedown",(function(e){i.x=e.clientX-n.offsetLeft,i.y=e.clientY-n.offsetTop,window.addEventListener("mousemove",r)})),window.addEventListener("mouseup",o)}}function r(e){e.buttons||o();var t=e.clientY-i.y,r=e.clientX-i.x;requestAnimationFrame((function(){n.style.top=t+"px",n.style.left=r+"px"}))}function o(){window.removeEventListener("mousemove",r)}}),[t]),b=Object(U.useCallback)((function(){var e=u.current;if(e){var t=e.offsetHeight;d.current=new ResizeObserver((function(n){if(s)f();else{var i=e.getBoundingClientRect(),r=i.height,o=i.y;if(r-t>0){var a=document.body.clientHeight-20;o+r>a&&(e.style.top=a-r+"px")}t=r}})),d.current.observe(e,{box:"border-box"})}}),[s]);return Object(R.jsx)(ye.a,Object.assign({contentRef:function(e){return u.current=e},className:"popup-presenter",role:"menu",isOpen:t,appElement:document.body,shouldCloseOnEsc:!0,shouldReturnFocusAfterClose:!0,shouldCloseOnOverlayClick:!0,shouldFocusAfterRender:c,ariaHideApp:o,preventScroll:o,onRequestClose:i,portalClassName:"popup-presenter-portal",onAfterOpen:function(e){e&&n&&(f(),b(),p())},onAfterClose:function(){var e;return null===(e=d.current)||void 0===e?void 0:e.disconnect()},overlayElement:function(e,t){return Object(R.jsx)(ce.a,Object.assign({},e,{style:Object.assign(Object.assign({},e.style),{position:o?"fixed":"initial",zIndex:1e3,backgroundColor:o?"unset":"transparent"})},{children:t}))},contentElement:function(e,t){return Object(R.jsx)(ce.a,Object.assign({},e,{style:{},sx:{top:0,left:0,right:0,bottom:0,display:"flex",width:"fit-content",height:"fit-content",position:"fixed",backgroundColor:void 0,padding:0,zIndex:0,outline:0,isolation:"isolate"}},{children:t}))},style:{content:{},overlay:{zIndex:999,background:"transparent"}}},{children:l}))}function Ve(e){return e.isOpen?Object(R.jsx)(_e,Object.assign({},e)):null}function We(e){var t=e.id,n=(e.group,e.position),i=e.renderPopup,r=(e.isOpen,e.onClosed,e.autoCloseOnUnmount),o=Fe(e,["id","group","position","renderPopup","isOpen","onClosed","autoCloseOnUnmount"]),a=Object(U.useContext)(Ne),c=Ue(e),l=c.closePopup,s=c.isPopupOpen;return Object(U.useEffect)((function(){if(r)return function(){null===a||void 0===a||a.closePopup(t)}}),[r,t,a]),Object(U.useEffect)((function(){a&&s&&a.openPopup(t,(function(e){var t=e.id,r=I((function(e){return!!e.openedPopups[t]}));return Object(U.useEffect)((function(){r||a.closePopup(t)}),[r]),Object(R.jsx)(Ve,Object.assign({isOpen:r,onClose:function(){return l(t)},position:n,blocking:!0,focusOnRender:!0},o,{children:Object(R.jsx)(ce.a,Object.assign({sx:{boxShadow:"menu",borderRadius:"default",overflow:"hidden"}},{children:Object(R.jsx)(He.Consumer,{children:function(){return i((function(){return a.closePopup(t)}))}})}))}),t)}))}),[a,s]),null}function Ue(e){var t=e.group,n=e.isOpen,i=e.id,r=e.onClosed,o=I((function(e){return!!e.openedPopups[i]})),a=I((function(e){return e.openPopup})),c=I((function(e){return e.closePopup})),l=I((function(e){return e.closePopupGroup}));return I((function(e){return"bottom"===e.toolbarLocation}))&&(t="popup"),Object(U.useEffect)((function(){n?a({id:i,group:t}):c(i)}),[n,i,t,a,c]),Object(U.useEffect)((function(){o||null===r||void 0===r||r()}),[o]),Object(U.useEffect)((function(){o&&l(t,[i])}),[r,o,l,i,t]),Object(U.useEffect)((function(){n||c(i)}),[n,i,t,c]),{isPopupOpen:o,closePopup:c}}function qe(e){var t=e.popup,n=Fe(e,["popup"]);function i(){J.a.unmountComponentAtNode(ze())}return J.a.render(Object(R.jsx)(H,{children:Object(R.jsx)(et,Object.assign({isOpen:!0,position:{target:De(),isTargetAbsolute:!0,location:"below",align:"end",yOffset:10},blocking:!0,focusOnRender:!0},n,{onClose:function(){var e;i(),null===(e=n.onClose)||void 0===e||e.call(n)}},{children:t(i)}))}),ze()),i}var $e=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Je(e){var t=e.items,n=void 0===t?[]:t,i=(e.title,e.onClose),r=$e(e,["items","title","onClose"]),o=Object(U.useRef)(),a=Object(U.useCallback)((function(e,t){null===e||void 0===e||e.stopPropagation(),(null===t||void 0===t?void 0:t.onClick)&&t.onClick(),i&&i()}),[i]),c=Ie(n,(function(e){var t=n[l];t&&"button"===t.type&&a(e,t)}),(function(){return i()})),l=c.focusIndex,s=c.setFocusIndex,u=c.isSubmenuOpen,d=c.setIsSubmenuOpen,f=n[l],p=Object(U.useRef)(null);return Object(U.useEffect)((function(){var e=n[l];if(e&&p.current){var t=document.getElementById(e.key);if(t)if(u){var i=Ee(p.current,{target:t,location:"right"}),r=i.top,o=i.left;p.current.style.visibility="visible",p.current.style.top="".concat(r,"px"),p.current.style.left="".concat(o,"px")}else p.current.style.visibility="hidden"}}),[u,l,n]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Ge,Object.assign({},r,{children:n.map((function(e,t){if(e.isHidden)return null;switch(e.type){case"separator":return Object(R.jsx)(Oe,{},e.key);case"button":return Object(R.jsx)(je,{item:e,onClick:function(n){e.menu?(s(t),d(!0)):a(n,e)},isFocused:l===t,onMouseEnter:function(){e.isDisabled?s(-1):(o.current&&clearTimeout(o.current),s(t),d(!1),e.menu&&(o.current=setTimeout((function(){d(!0)}),500)))},onMouseLeave:function(){o.current&&clearTimeout(o.current)}},e.key);case"popup":return Object(R.jsx)(e.component,{onClick:function(e){return a(e)}})}}))})),"button"===(null===f||void 0===f?void 0:f.type)&&(null===f||void 0===f?void 0:f.menu)&&u&&Object(R.jsx)(ce.c,Object.assign({ref:p,style:{visibility:"hidden"},sx:{position:"absolute"}},{children:Object(R.jsx)(Je,{items:f.menu.items,onClose:i})}))]})}function Ge(e){var t=e.children,n=e.title,i=e.sx,r=$e(e,["children","title","sx"]);return Object(R.jsxs)(ce.a,Object.assign({className:"menuContainer",as:"ul",tabIndex:-1,sx:Object.assign({bg:"background",py:1,display:"flex",flexDirection:"column",position:"relative",listStyle:"none",padding:0,margin:0,borderRadius:"default",boxShadow:"menu",border:"1px solid var(--border)",minWidth:220},i)},r,{children:[n&&Object(R.jsx)(ce.e,Object.assign({sx:{fontFamily:"body",fontSize:"subtitle",color:"primary",py:"8px",px:3,borderBottom:"1px solid",borderBottomColor:"border",wordWrap:"break-word"}},{children:n})),t]}))}function Xe(e){var t=e.items,n=void 0===t?[]:t,i=$e(e,["items"]);return Object(R.jsx)(Ve,Object.assign({},i,{children:e.children?e.children:Object(R.jsx)(Je,Object.assign({items:n},i))}))}var Ke=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Qe(e){return z()?e.mobile||null:e.desktop||null}function Ye(e){return Object(R.jsx)(Qe,{desktop:Object(R.jsx)(R.Fragment,{children:e.children})})}function Ze(e){return Object(R.jsx)(Qe,{mobile:Object(R.jsx)(R.Fragment,{children:e.children})})}function et(e){var t=e.mobile,n=void 0===t?"menu":t,i=e.desktop,r=void 0===i?"menu":i,o=Ke(e,["mobile","desktop"]);return z()&&"sheet"===n?Object(R.jsx)(Re,Object.assign({},o)):"menu"===n||"menu"===r?Object(R.jsx)(Xe,Object.assign({},o)):e.isOpen?Object(R.jsx)(R.Fragment,{children:e.children}):null}function tt(e){var t=e.title,n=e.onClose,i=e.action,r=e.children;return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Ye,{children:Object(R.jsxs)(ce.c,Object.assign({sx:{overflow:"hidden",bg:"background",flexDirection:"column",borderRadius:"default",boxShadow:"menu",minWidth:200}},{children:[t&&Object(R.jsxs)(ce.c,Object.assign({className:"movable",sx:{justifyContent:"space-between",alignItems:"center",p:2}},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"title"},{children:t})),Object(R.jsx)(ce.b,Object.assign({variant:"tool",sx:{p:0,bg:"transparent"},onClick:n},{children:Object(R.jsx)(fe,{path:be.close,size:"big"})}))]})),r,t&&i&&Object(R.jsx)(ce.c,Object.assign({sx:{justifyContent:"end"},bg:"bgSecondary",p:1,px:2,mt:2},{children:Object(R.jsx)(ce.b,Object.assign({variant:"dialog",onClick:i.disabled||i.loading?void 0:i.onClick,disabled:i.disabled||i.loading},{children:i.loading?Object(R.jsx)(fe,{path:be.loading,rotate:!0,size:"medium"}):i.title}))}))]}))}),Object(R.jsxs)(Ze,{children:[r,i&&Object(R.jsx)(ce.b,Object.assign({variant:"primary",sx:{alignSelf:"stretch",mb:1,mt:2,mx:1,py:2},onClick:i.disabled||null===i||void 0===i?void 0:i.onClick,disabled:i.disabled},{children:i.loading?Object(R.jsx)(fe,{path:be.loading,rotate:!0,size:"medium"}):i.title}))]})]})}var nt=n(24),it=n(132),rt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function ot(e){var t=e.label,n=e.containerProps,i=e.sx,r=rt(e,["label","containerProps","sx"]);return Object(R.jsxs)(ce.c,Object.assign({},n,{sx:Object.assign(Object.assign({flex:1},null===n||void 0===n?void 0:n.sx),{outline:"1px solid var(--border)",p:2,borderRadius:"default",":focus-within":{outlineColor:"primary",outlineWidth:"1.8px"}})},{children:[Object(R.jsx)(nt.b,Object.assign({variant:"clean",sx:Object.assign(Object.assign({},i),{p:0})},r)),Object(R.jsx)(ce.e,Object.assign({variant:"body",sx:{flexShrink:0,color:"fontTertiary",borderLeft:"1px solid var(--border)",pl:1}},{children:t}))]}))}function at(e){return Object(R.jsx)(R.Fragment,{children:e.children})}function ct(e){var t=e.activeIndex,n=e.children,i=e.containerProps,r=e.onTabChanged,o=Object(U.useState)(t||0),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useMemo)((function(){return U.Children.map(n,(function(e){if(q.a.isValidElement(e))return{title:e.props.title,component:e}}))}),[n]);return Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column"}},{children:[Object(R.jsx)(ce.c,Object.assign({sx:{mb:1}},{children:null===s||void 0===s?void 0:s.map((function(e,t){return Object(R.jsx)(ce.b,Object.assign({sx:{flex:1,p:0,py:1,borderRadius:0,borderTopLeftRadius:"default",borderTopRightRadius:"default",bg:c===t?"bgSecondary":"transparent",fontWeight:c===t?"bold":"normal",color:"text",":last-of-type":{mr:0},borderBottom:"2px solid",borderBottomColor:c===t?"primary":"transparent",":hover":{bg:"hover"}},onClick:function(){l(t),null===r||void 0===r||r(t)}},{children:e.title}),t.toString())}))})),Object(R.jsx)(ce.c,Object.assign({},i,{children:s&&s[c].component}))]}))}function lt(e){var t=e.onClose,n=e.onSizeChanged,i=e.title,r=e.embed,o=Object(U.useState)((null===r||void 0===r?void 0:r.width)||300),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useState)((null===r||void 0===r?void 0:r.height)||150),u=Object(C.a)(s,2),d=u[0],f=u[1],p=Object(U.useState)((null===r||void 0===r?void 0:r.src)||""),b=Object(C.a)(p,2),m=b[0],h=b[1],g=Object(U.useState)("url"),v=Object(C.a)(g,2),j=v[0],O=v[1],x=Object(U.useState)(null),y=Object(C.a)(x,2),k=y[0],w=y[1],S=Object(U.useCallback)((function(e,t){var i=e?{width:e,height:e*(d/c)}:t?{width:t*(c/d),height:t}:{width:0,height:0};l(i.width),f(i.height),n&&n(i)}),[c,d]);return Object(R.jsx)(tt,Object.assign({title:i,onClose:function(){return t()},action:{title:"Save",onClick:function(){w(null);var e=m,n=c,i=d;if("code"===j){var r=(new DOMParser).parseFromString(m,"text/html");if(r.getElementsByTagName("iframe").length<=0)return w("Embed code must include an iframe.");var o=st(r,"src");if(!o)return w("Embed code must include an iframe with an src attribute.");e=o;var a=st(r,"width");a&&!isNaN(parseInt(a))&&(n=parseInt(a));var l=st(r,"height");l&&!isNaN(parseInt(l))&&(i=parseInt(l))}var s=Object(it.a)(e);s&&(e=s),t({height:i,width:n,src:e})}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",width:["auto",300]}},{children:[k&&Object(R.jsxs)(ce.e,Object.assign({variant:"error",sx:{bg:"errorBg",color:"error",p:1,borderRadius:"default"}},{children:["Error: ",k]})),Object(R.jsxs)(ct,Object.assign({activeIndex:0,containerProps:{sx:{mx:1,flexDirection:"column"}},onTabChanged:function(e){return O(0===e?"url":"code")}},{children:[Object(R.jsxs)(at,Object.assign({title:"From URL"},{children:[Object(R.jsx)(nt.b,{placeholder:"Enter embed source URL",value:m,autoFocus:!0,onChange:function(e){return h(e.target.value)},autoCapitalize:"none",sx:{fontSize:"body"}}),Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",mt:1}},{children:[Object(R.jsx)(ot,{containerProps:{sx:{mr:1}},label:"width",type:"number",placeholder:"Width",value:c,sx:{mr:1,fontSize:"body"},onChange:function(e){return S(e.target.valueAsNumber)}}),Object(R.jsx)(ot,{label:"height",type:"number",placeholder:"Height",value:d,sx:{fontSize:"body"},onChange:function(e){return S(void 0,e.target.valueAsNumber)}})]}))]})),Object(R.jsx)(at,Object.assign({title:"From code"},{children:Object(R.jsx)(nt.d,{autoFocus:!0,variant:"forms.input",sx:{fontSize:"subBody",fontFamily:"monospace"},minHeight:[200,100],onChange:function(e){return h(e.target.value)},placeholder:"Paste embed code here. Only iframes are supported."})}))]}))]}))}))}function st(e,t){var n=e.querySelector("[".concat(t,"]"));return n?n.getAttribute(t):null}function ut(e){var t=z(),n=!t,i=t?30:15,r=e.onInsertTable,o=Object(U.useState)({column:0,row:0}),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useState)({columns:10,rows:6}),u=Object(C.a)(s,2),d=u[0],f=u[1];return Object(U.useEffect)((function(){n&&f((function(e){var t=e.columns,n=e.rows,i=c.column,r=c.row,o=r===n-2||i===t-2,a=Number(r===n||r===n-2),l=Number(i===t||i===t-2);return{columns:o?Math.max(i+l,10):Math.min(e.columns+l,20),rows:o?Math.max(r+a,6):Math.min(e.rows+a,20)}}))}),[c,n]),Object(R.jsx)(tt,Object.assign({action:{title:c.column&&c.row?"Insert a ".concat(c.column," x ").concat(c.row," table"):"Please set a table size",disabled:!c.column||!c.row,onClick:function(){return r({columns:c.column,rows:c.row})}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{px:1,pt:1,flexDirection:"column",alignItems:"center"}},{children:[Object(R.jsx)(ce.a,Object.assign({sx:{display:"grid",gridTemplateColumns:"repeat(".concat(d.columns,", minmax(").concat(i,"px, 1fr))"),gap:"small",bg:"background",width:"100%"},onTouchMove:function(e){var t=e.touches.item(0),n=document.elementFromPoint(t.pageX,t.pageY);if(n){var i=n.dataset.index;i&&l(dt(parseInt(i),d))}}},{children:Array(d.columns*d.rows).fill(0).map((function(e,t){return Object(R.jsx)(ce.a,{"data-index":t,height:i||15,sx:{border:"1px solid var(--disabled)",borderRadius:"small",bg:ft(t,c,d)?"disabled":"transparent"},onTouchStart:function(){l(dt(t,d))},onMouseEnter:function(){l(dt(t,d))},onTouchEnd:function(e){e.preventDefault()},onClick:function(){r({columns:c.column,rows:c.row})}},t)}))})),Object(R.jsxs)(ce.c,Object.assign({sx:{display:["flex","none","none"],mt:1,alignItems:"center",justifyContent:"center"}},{children:[Object(R.jsx)(ot,{containerProps:{sx:{mr:1}},label:"columns",placeholder:"".concat(c.column," columns"),type:"number",value:c.column,onChange:function(e){l((function(t){return Object.assign(Object.assign({},t),{column:e.target.valueAsNumber||0})}))}}),Object(R.jsx)(ot,{label:"rows",placeholder:"".concat(c.row," rows"),type:"number",value:c.row,onChange:function(e){l((function(t){return Object.assign(Object.assign({},t),{row:e.target.valueAsNumber||0})}))}})]})),Object(R.jsxs)(ce.e,Object.assign({variant:"body",sx:{mt:1,display:["none","block","block"]}},{children:[c.column," x ",c.row]}))]}))}))}function dt(e,t){var n=e+1,i=n%t.columns,r=n/t.columns,o=Math.floor(r);return r=r===o?r:o+1,{column:i||t.columns,row:r}}function ft(e,t,n){var i=dt(e,n);return i.row<=t.row&&i.column<=t.column}var pt=n(28),bt=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function mt(e){var t=this,n=e.onInsert,i=e.onClose,r=Object(U.useState)(!1),o=Object(C.a)(r,2),a=o[0],c=o[1],l=Object(U.useState)(),s=Object(C.a)(l,2),u=s[0],d=s[1],f=Object(U.useState)(""),p=Object(C.a)(f,2),b=p[0],m=p[1];return Object(R.jsx)(tt,Object.assign({title:"Insert image from URL",onClose:i,action:{loading:a,title:"Insert image",disabled:!b,onClick:function(){return bt(t,void 0,void 0,Object(pt.a)().mark((function e(){var t,i,r,o,a;return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),d(void 0),e.prev=2,e.next=5,fetch(b);case 5:if((t=e.sent).ok){e.next=8;break}return e.abrupt("return",d("invalid status code ".concat(t.status)));case 8:if(i=t.headers.get("Content-Type"),r=t.headers.get("Content-Length"),i&&r&&"0"!==r&&i.startsWith("image/")){e.next=12;break}return e.abrupt("return",d("not an image"));case 12:return o=parseInt(r),e.t0=ht,e.next=16,t.blob();case 16:return e.t1=e.sent,e.next=19,(0,e.t0)(e.t1);case 19:a=e.sent,n({src:a,type:i,size:o}),e.next=26;break;case 23:e.prev=23,e.t2=e.catch(2),e.t2 instanceof Error&&d(e.t2.message);case 26:return e.prev=26,c(!1),e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[2,23,26,29]])})))}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{px:1,flexDirection:"column",width:["auto",350]}},{children:[Object(R.jsx)(nt.b,{type:"url",autoFocus:!0,placeholder:"Paste Image URL here",value:b,onChange:function(e){m(e.target.value),d(void 0)}}),u?Object(R.jsxs)(ce.e,Object.assign({variant:"error",sx:{bg:"errorBg",mt:1,p:1,borderRadius:"default"}},{children:["Failed to download image: ",u.toLowerCase(),"."]})):Object(R.jsx)(ce.e,Object.assign({variant:"subBody",sx:{bg:"shade",color:"primary",mt:1,p:1,borderRadius:"default"}},{children:"To protect your privacy, we will download the image & add it to your attachments."}))]}))}))}function ht(e){return new Promise((function(t,n){var i=new FileReader;i.onload=function(e){return t(i.result)},i.onerror=function(e){return n(i.error)},i.onabort=function(e){return n(new Error("Read aborted"))},i.readAsDataURL(e)}))}var gt=function(e){return{key:"hr",type:"button",title:"Horizontal rule",icon:"horizontalRule",isChecked:null===e||void 0===e?void 0:e.isActive("horizontalRule"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setHorizontalRule().run()}}},vt=function(e){return{key:"codeblock",type:"button",title:"Code block",icon:"codeblock",isChecked:null===e||void 0===e?void 0:e.isActive("codeBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleCodeBlock().run()}}},jt=function(e){return{key:"blockquote",type:"button",title:"Quote",icon:"blockquote",isChecked:null===e||void 0===e?void 0:e.isActive("blockQuote"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleBlockquote().run()}}},Ot=function(e){return{key:"math",type:"button",title:"Math & formulas",icon:"mathBlock",isChecked:null===e||void 0===e?void 0:e.isActive("mathBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().insertMathBlock().run()}}},xt=function(e,t){return{key:"image",type:"button",title:"Image",icon:"image",menu:{title:"Insert an image",items:[{key:"upload-from-disk",type:"button",title:"Upload from disk",icon:"upload",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("image").run()}},{key:"camera",type:"button",title:"Take a photo using camera",icon:"camera",isHidden:!t,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("camera").run()}},t?Lt(e):Rt(e)]}}},yt=function(e){return{key:"table",type:"button",title:"Table",icon:"table",menu:{title:"Insert a table",items:[{key:"table-size-selector",type:"popup",component:function(t){return Object(R.jsx)(ut,{onInsertTable:function(n){var i,r;null===(i=e.current)||void 0===i||i.chain().focus().insertTable({rows:n.rows,cols:n.columns}).run(),null===(r=t.onClick)||void 0===r||r.call(t)}})}}]}}},Ct=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",menu:{title:"Insert an embed",items:[{key:"embed-popup",type:"popup",component:function(t){var n=t.onClick;return Object(R.jsx)(lt,{title:"Insert embed",onClose:function(t){var i;if(!t)return null===n||void 0===n?void 0:n();null===(i=e.current)||void 0===i||i.chain().insertEmbed(t).run(),null===n||void 0===n||n()}})}}]}}},kt=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",onClick:function(){e&&qe({popup:function(t){return Object(R.jsx)(lt,{title:"Insert embed",onClose:function(n){var i;if(!n)return t();null===(i=e.current)||void 0===i||i.chain().insertEmbed(n).run(),t()}})}})}}},wt=function(e){return{key:"attachment",type:"button",title:"Attachment",icon:"attachment",isChecked:null===e||void 0===e?void 0:e.isActive("attachment"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("file").run()}}},St=function(e){return{key:"tasklist",type:"button",title:"Task list",icon:"checkbox",isChecked:null===e||void 0===e?void 0:e.isActive("taskList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleTaskList().run()}}},At=function(e){return{key:"outlinelist",type:"button",title:"Outline list",icon:"outlineList",isChecked:null===e||void 0===e?void 0:e.isActive("outlineList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleOutlineList().run()}}},Lt=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",menu:{title:"Attach image from URL",items:[{key:"attach-image",type:"popup",component:function(t){var n=t.onClick;return Object(R.jsx)(mt,{onInsert:function(t){var i;null===(i=e.requestPermission("insertImage"))||void 0===i||i.chain().focus().insertImage(t).run(),null===n||void 0===n||n()},onClose:function(){null===n||void 0===n||n()}})}}]}}},Rt=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",onClick:function(){qe({popup:function(t){return Object(R.jsx)(mt,{onInsert:function(n){var i;null===(i=e.requestPermission("insertImage"))||void 0===i||i.chain().focus().insertImage(n).run(),t()},onClose:t})}})}}};function Tt(e){var t=e.id,n=e.group,i=e.items,r=e.selectedItem,o=e.buttonRef,a=e.menuWidth,c=Object(U.useRef)(),l=Object(U.useState)(!1),s=Object(C.a)(l,2),u=s[0],d=s[1],f=D(),p=z(),b="bottom"===f,m=Ue({group:n,id:t,isOpen:u,onClosed:function(){return d(!1)}}),h=m.closePopup,g=m.isPopupOpen;return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsxs)(he,Object.assign({ref:function(e){c.current=e,o&&(o.current=e||void 0)},sx:{p:1,m:0,bg:g?"hover":"transparent",mr:1,display:"flex",alignItems:"center",":hover":{bg:"hover"},":last-of-type":{mr:0}},onClick:function(){return d((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()}},{children:["string"===typeof r?Object(R.jsx)(ce.e,Object.assign({sx:{fontSize:"subBody",mr:1,color:"text"}},{children:r})):r,Object(R.jsx)(fe,{path:b?be.chevronUp:be.chevronDown,size:"small",color:"text"})]})),Object(R.jsx)(Xe,{isOpen:g,items:i,onClose:function(){return h(t)},position:{target:b?De():c.current||"mouse",isTargetAbsolute:!0,location:b?"top":"below",align:"center",yOffset:5},blocking:!p,focusOnRender:!p,sx:{minWidth:a,maxWidth:b?"95vw":"auto",flexDirection:b?"row":"column",overflowX:b?"auto":"hidden",marginRight:b?"10px":0,display:"flex",alignItems:b?"center":"unset",mr:b?0:2}})]})}var Pt=q.a.memo((function(e){var t=e.title,n=e.onDecrease,i=e.onIncrease,r=e.onReset,o=e.value;return Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",mr:1,":last-of-type":{mr:0}}},{children:[Object(R.jsx)(ve,{toggled:!1,title:"Decrease ".concat(t),icon:"minus",variant:"small",onClick:n}),Object(R.jsx)(he,Object.assign({sx:{color:"text",bg:"transparent",px:0,fontSize:"subBody",mx:1,textAlign:"center",":hover":{bg:"transparent"}},onClick:r,title:"Reset ".concat(t)},{children:o})),Object(R.jsx)(ve,{toggled:!1,title:"Increase ".concat(t),icon:"plus",variant:"small",onClick:i})]}))}),(function(e,t){return e.value===t.value}));function Et(e){var t=Object(U.useRef)(e);return Object(U.useEffect)((function(){t.current=e}),[e]),t}var Mt={"Sans-serif":"Open Sans",Serif:"serif",Monospace:"monospace"};var It=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Dt(e){var t=e.editor,n=e.alignment,i=It(e,["editor","alignment"]),r=Et(n);return Object(R.jsx)(ve,Object.assign({},i,{onClick:function(){var e;null===(e=t.current)||void 0===e||e.chain().focus().setTextAlign(r.current).run()},toggled:!1}))}var zt=[1,2,3,4,5,6];var Nt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var Ht=q.a.memo((function(e){var t=e.children,n=(e.toggled,e.onOpen),i=Nt(e,["children","toggled","onOpen"]),r=Object(U.useRef)(null),o=D();return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsxs)(ce.c,Object.assign({ref:r,sx:{borderRadius:"default"}},{children:[Object(R.jsx)(ve,Object.assign({},i,{sx:{mr:0,":hover":{bg:"hover"}},toggled:!1})),Object(R.jsx)(he,Object.assign({sx:{flexShrink:0,p:0,m:0,px:"3px",bg:"bgSecondary",":hover":{bg:"hover"},":last-of-type":{mr:0}},onClick:n},{children:Object(R.jsx)(fe,{path:"bottom"===o?be.chevronUp:be.chevronDown,color:"text",size:"small",sx:{flexShrink:0}})}))]})),t]})}),(function(e,t){return e.toggled===t.toggled&&JSON.stringify(e.sx)===JSON.stringify(t.sx)}));function Bt(e,t){var n,i=e.state.selection.$anchor,r=e.state.doc.nodeAt(i.pos),o=t.includes((null===r||void 0===r?void 0:r.type.name)||"")?i.pos:null===(n=Object(u.i)((function(e){return t.includes(e.type.name)}))(e.state.selection))||void 0===n?void 0:n.pos;return o&&e.view.nodeDOM(o)||null}function Ft(e,t){var n,i=e.state.selection.$anchor,r=e.state.doc.nodeAt(i.pos),o=(null===r||void 0===r?void 0:r.type.name)===t?i.pos:null===(n=Object(u.i)((function(e){return e.type.name===t}))(e.state.selection))||void 0===n?void 0:n.pos;return o?e.state.doc.nodeAt(o):null}function _t(e,t){return e.marks.find((function(e){return e.type.name===t}))}function Vt(e){var t=e.selection,n=t.$from,i=t.from;return{node:e.doc.nodeAt(i)||void 0,from:i,to:i+n.node().nodeSize}}function Wt(e){var t=e.isActive("taskList"),n=e.isActive("outlineList");return e.isActive("bulletList")||e.isActive("orderedList")?"listItem":n?"outlineListItem":t?"taskItem":null}var Ut=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var qt=q.a.memo((function(e){var t=e.editor,n=e.onClick,i=(e.isActive,e.subTypes),r=e.type,o=Ut(e,["editor","onClick","isActive","subTypes","type"]),a="bottom"===D(),c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useRef)();return Object(R.jsx)(Ht,Object.assign({},o,{buttonRef:d,onClick:n,toggled:s,sx:{mr:0},onOpen:function(){return u((function(e){return!e}))}},{children:Object(R.jsx)(We,{isOpen:s,group:"lists",id:o.title,blocking:!1,focusOnRender:!1,position:{isTargetAbsolute:!0,target:a?De():d.current||"mouse",align:"center",location:a?"top":"below",yOffset:10},onClosed:function(){return u(!1)},renderPopup:function(){return Object(R.jsx)(ce.a,Object.assign({sx:{bg:"background",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",p:1}},{children:i.map((function(e){return Object(R.jsx)(ce.b,Object.assign({variant:"menuitem",sx:{width:80},onClick:function(){var n,i=null===(n=t.current)||void 0===n?void 0:n.chain().focus();if(i&&t.current)return function(e){var t=e.isActive("taskList"),n=e.isActive("outlineList"),i=e.isActive("bulletList")||e.isActive("orderedList");return t||n||i}(t.current)||(i="bulletList"===r?i.toggleBulletList():i.toggleOrderedList()),i.updateAttributes(r,{listType:e.type}).run()}},{children:Object(R.jsx)($t,{listStyleType:e.type})}),e.title)}))}))}})}))}),(function(e,t){return e.isActive===t.isActive}));function $t(e){var t=e.listStyleType;return Object(R.jsx)(ce.c,Object.assign({as:"ul",sx:{flexDirection:"column",flex:1,p:0,listStyleType:t},onMouseDown:function(e){return e.preventDefault()}},{children:[0,1,2].map((function(e){return Object(R.jsx)(ce.a,Object.assign({as:"li",sx:{display:"list-item",color:"text",fontSize:8,mb:"1px"}},{children:Object(R.jsx)(ce.c,Object.assign({sx:{alignItems:"center"}},{children:Object(R.jsx)(ce.a,{sx:{width:"100%",flexShrink:0,height:4,bg:"#cbcbcb",borderRadius:"small"}})}))}),e.toString())}))}))}var Jt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Gt(e){var t=e.editor,n=e.direction,i=Jt(e,["editor","direction"]),r=Et(n);return Object(R.jsx)(ve,Object.assign({},i,{onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setTextDirection(r.current).run()},toggled:!1}))}var Xt=n(69),Kt=n.n(Xt);var Qt={set:function(e,t){if(!t)return window.localStorage.removeItem(e);window.localStorage.setItem(e,JSON.stringify(t))},get:function(e,t){var n=window.localStorage.getItem(e);return n?function(e){if("undefined"===e||"null"===e)return;try{return JSON.parse(e)}catch(t){return e}}(n):t}};var Yt=n(133);var Zt=["#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#f44336"],en=[35,35,25];function tn(e){var t=e.colors,n=void 0===t?Zt:t,i=e.color,r=e.onClear,o=e.onChange,a=e.title,c=e.onClose,l=e.expanded,s=Object(U.useRef)(),u=Object(U.useState)(l||!1),d=Object(C.a)(u,2),f=d[0],p=d[1],b=Object(U.useState)(Kt()(i||n[0]).toHexString()),m=Object(C.a)(b,2),h=m[0],g=m[1],v=Kt()(h);Object(U.useEffect)((function(){s.current&&f&&s.current.focus({preventScroll:!0})}),[f]);var j=Object(U.useCallback)(function(e,t){var n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];n&&clearTimeout(n),n=setTimeout((function(){return e.apply(void 0,r)}),t)}}((function(e){o(e)}),500),[o]);return Object(R.jsxs)(ce.c,Object.assign({ref:s,tabIndex:-1,sx:{bg:"background",flexDirection:"column",".react-colorful":{width:"auto",height:150},".react-colorful__saturation":{borderRadius:["default",0]},width:["calc(100vw - 20px)",250]}},{children:[c&&Object(R.jsxs)(ce.a,Object.assign({sx:{display:["none","flex"],justifyContent:"space-between",p:2,pb:f?2:0,alignItems:"center"},onClick:c},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"title"},{children:a})),Object(R.jsx)(he,Object.assign({variant:"icon",sx:{p:0}},{children:Object(R.jsx)(fe,{path:be.close,size:"big"})}))]})),f?Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Yt.a,{onChange:function(e){g(e),j(e)},onTouchEnd:function(){return o(h)},onMouseUp:function(){return o(h)}}),Object(R.jsx)(nt.b,{variant:"clean",placeholder:"#000000",spellCheck:!1,sx:{my:2,p:0,borderRadius:0,fontSize:["title","title","body"],color:"fontTertiary",textAlign:"center",letterSpacing:1.5},value:h.toUpperCase(),maxLength:7,onChange:function(e){var t=e.target.value;t&&Kt()(t,{format:"hex"}).isValid()&&(g(t),o(t))}})]}):null,Object(R.jsxs)(ce.c,{children:[Object(R.jsxs)(ce.c,Object.assign({className:"hide-scrollbar",sx:{flex:1,p:1,overflowX:["auto","hidden"],flexWrap:["nowrap","wrap"]}},{children:[Object(R.jsx)(he,Object.assign({variant:"icon",sx:{flexShrink:0,width:en,height:en,borderRadius:50,boxShadow:"menu",p:0,ml:[2,2,1]},onClick:r},{children:Object(R.jsx)(fe,{path:be.colorClear,color:"text",size:15})})),Object(R.jsx)(he,Object.assign({variant:"secondary",sx:{flexShrink:0,bg:h,width:en,height:en,borderRadius:50,p:0,ml:[2,2,1],":hover":{bg:h}},onClick:function(){return p((function(e){return!e}))}},{children:Object(R.jsx)(fe,{path:be.palette,color:v.isDark()?"static":"icon",size:18})})),n.map((function(e){return Object(R.jsx)(he,{sx:{flex:"0 0 auto",bg:e,width:en,height:en,ml:[2,1,1],mb:[0,1,1],borderRadius:50,":hover":{bg:e}},onClick:function(){g(e),o(e)}},e)}))]})),c&&Object(R.jsx)(he,Object.assign({variant:"icon",sx:{display:["block","none"],px:2},onClick:c},{children:Object(R.jsx)(fe,{path:be.close,size:"big"})}))]})]}))}var nn=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function rn(e){e.editor;var t=e.onColorChange,n=e.getActiveColor,i=e.title,r=e.cacheKey,o=nn(e,["editor","onColorChange","getActiveColor","title","cacheKey"]),a=n()||Qt.get(r),c=Kt()(a),l="bottom"===D(),s=Object(U.useState)(!1),u=Object(C.a)(s,2),d=u[0],f=u[1];return Object(R.jsx)(Ht,Object.assign({},o,{iconColor:a&&c.isDark()?"static":"icon",sx:{mr:0,bg:a||"transparent",":hover":{bg:a?c.darken(5).toRgbString():"transparent"}},onOpen:function(){return f((function(e){return!e}))},toggled:d,onClick:function(){return t(a)}},{children:Object(R.jsx)(We,{isOpen:d,id:e.icon,group:"color",position:{isTargetAbsolute:!0,target:De(),align:l?"center":"end",location:l?"top":"below",yOffset:10},focusOnRender:!1,blocking:!1,renderPopup:function(e){return Object(R.jsx)(tn,{color:a,onClear:function(){t(),Qt.set(r,null)},onChange:function(e){t(e),Qt.set(r,e)},onClose:e,title:i})}})}))}var on=n(18);function an(e,t,n,i){return un(e,t,cn(t,n),cn(t,i))}function cn(e,t){for(var n=e.map,i=e.table,r=[],o=0;o<n.height;){var a=o*n.width+t;if(a>=n.map.length)break;var c=n.map[a],l=i.nodeAt(c);l&&(r.push({cell:l,pos:c}),o+=l.attrs.rowspan)}return r}function ln(e,t,n,i){return un(e,t,sn(t,n),sn(t,i))}function sn(e,t){for(var n=e.map,i=e.table,r=[],o=0,a=t*n.width;o<n.width&&!(a>=n.map.length);o++,a++){var c=n.map[a],l=i.nodeAt(c);l&&(r.push({cell:l,pos:c}),o+=l.attrs.colspan-1)}return r}function un(e,t,n,i){if(n.length===i.length){for(var r=e.mapping.maps.length,o=0;o<i.length;++o){var a=n[o],c=i[o],l=e.mapping.slice(r).map(t.tableStart+a.pos),s=l+a.cell.nodeSize,u=e.doc.slice(l,s),d=e.mapping.slice(r).map(t.tableStart+c.pos),f=d+c.cell.nodeSize,p=e.doc.slice(d,f);e.replace(d,f,u),s=(l=e.mapping.slice(r).map(t.tableStart+a.pos))+a.cell.nodeSize,e.replace(l,s,p)}return e}}function dn(e){var t=e.popupId,n=e.editor,i=e.tools,r=e.autoCloseOnUnmount,o="bottom"===D(),a=Object(U.useRef)(),c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1];return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{toggled:s,buttonRef:a,onClick:function(){return u((function(e){return!e}))}})),Object(R.jsx)(We,{isOpen:s,group:"toolbarGroup",id:t,onClosed:function(){return u(!1)},position:{isTargetAbsolute:!0,target:o?De():a.current||"mouse",align:"center",location:o?"top":"below",yOffset:10},autoCloseOnUnmount:r,focusOnRender:!1,blocking:!1,renderPopup:function(){return Object(R.jsx)(ni,{tools:i,editor:n,sx:{flex:1,p:"5px",boxShadow:"menu",bg:"background",borderRadius:"default",overflowX:"auto",maxWidth:"95vw"}})}})]})}function fn(e){return function(t){var n=e(t.editor);return Object(R.jsx)(ve,Object.assign({},t,{icon:n.icon||t.icon,toggled:n.isChecked||!1,title:n.title,onClick:n.onClick}))}}var pn={bold:{icon:"bold",title:"Bold"},italic:{icon:"italic",title:"Italic"},underline:{icon:"underline",title:"Underline"},strikethrough:{icon:"strikethrough",title:"Strikethrough"},addLink:{icon:"link",title:"Link"},editLink:{icon:"linkEdit",title:"Edit link",conditional:!0},removeLink:{icon:"linkRemove",title:"Remove link",conditional:!0},openLink:{icon:"openLink",title:"Open link",conditional:!0},linkSettings:{icon:"linkSettings",title:"Link settings",conditional:!0},code:{icon:"code",title:"Code"},codeRemove:{icon:"codeRemove",title:"Code",conditional:!0},clearformatting:{icon:"formatClear",title:"Clear all formatting"},subscript:{icon:"subscript",title:"Subscript"},superscript:{icon:"superscript",title:"Superscript"},insertBlock:{icon:"plus",title:"Insert",conditional:!0},bulletList:{icon:"bulletList",title:"Bullet list"},numberedList:{icon:"numberedList",title:"Numbered list"},fontFamily:{icon:"fontFamily",title:"Font family"},fontSize:{icon:"fontSize",title:"Font size"},headings:{icon:"heading",title:"Headings"},alignment:{icon:"alignCenter",title:"Alignment"},textDirection:{icon:"ltr",title:"Text direction"},highlight:{icon:"highlight",title:"Highlight"},textColor:{icon:"textColor",title:"Text color"},math:{icon:"math",title:"Math (inline)"},tableSettings:{icon:"tableSettings",title:"Table settings",conditional:!0},columnProperties:{icon:"columnProperties",title:"Column properties",conditional:!0},rowProperties:{icon:"rowProperties",title:"Row properties",conditional:!0},cellProperties:{icon:"cellProperties",title:"Cell properties",conditional:!0},insertColumnLeft:{icon:"insertColumnLeft",title:"Insert column left",conditional:!0},insertColumnRight:{icon:"insertColumnRight",title:"Insert column right",conditional:!0},moveColumnLeft:{icon:"moveColumnLeft",title:"Move column left",conditional:!0},moveColumnRight:{icon:"moveColumnRight",title:"Move column right",conditional:!0},deleteColumn:{icon:"deleteColumn",title:"Delete column",conditional:!0},splitCells:{icon:"splitCells",title:"Split cells",conditional:!0},mergeCells:{icon:"mergeCells",title:"Merge cells",conditional:!0},insertRowAbove:{icon:"insertRowAbove",title:"Insert row above",conditional:!0},insertRowBelow:{icon:"insertRowBelow",title:"Insert row below",conditional:!0},moveRowUp:{icon:"moveRowUp",title:"Move row up",conditional:!0},moveRowDown:{icon:"moveRowDown",title:"Move row down",conditional:!0},deleteRow:{icon:"deleteRow",title:"Delete row",conditional:!0},deleteTable:{icon:"deleteTable",title:"Delete table",conditional:!0},cellBackgroundColor:{icon:"backgroundColor",title:"Cell background color",conditional:!0},cellBorderColor:{icon:"cellBorderColor",title:"Cell border color",conditional:!0},cellTextColor:{icon:"textColor",title:"Cell text color",conditional:!0},cellBorderWidth:{icon:"none",title:"Cell border width",conditional:!0},imageSettings:{icon:"imageSettings",title:"Image settings",conditional:!0},imageAlignCenter:{icon:"alignCenter",title:"Align center",conditional:!0},imageAlignLeft:{icon:"alignLeft",title:"Align left",conditional:!0},imageAlignRight:{icon:"alignRight",title:"Align right",conditional:!0},imageProperties:{icon:"more",title:"Image properties",conditional:!0},attachmentSettings:{icon:"attachmentSettings",title:"Attachment settings",conditional:!0},downloadAttachment:{icon:"download",title:"Download attachment",conditional:!0},removeAttachment:{icon:"delete",title:"Remove attachment",conditional:!0},embedSettings:{icon:"embedSettings",title:"Embed settings",conditional:!0},embedAlignCenter:{icon:"alignCenter",title:"Align center",conditional:!0},embedAlignLeft:{icon:"alignLeft",title:"Align left",conditional:!0},embedAlignRight:{icon:"alignRight",title:"Align right",conditional:!0},embedProperties:{icon:"more",title:"Embed properties",conditional:!0},outdent:{icon:"outdent",title:"Lift list item"},indent:{icon:"indent",title:"Sink list item"}};function bn(e){return pn[e]}function mn(){return gn}var hn=[["insertBlock","tableSettings","imageSettings","embedSettings","attachmentSettings","linkSettings","codeRemove","outdent","indent"]],gn={default:[["bold","italic","underline",["strikethrough","code","subscript","superscript","highlight","textColor","math"]],["fontSize"],["headings","fontFamily"],["numberedList","bulletList"],["addLink"],["alignment","textDirection"],["clearformatting"]],minimal:[["bold","italic","underline","strikethrough","code"],["headings","addLink"],["clearformatting"]]};function vn(e){var t=e.editor,n=e.onClose,i=t.getAttributes("tableCell");return Object(R.jsx)(tt,Object.assign({title:"Cell properties",onClose:n},{children:Object(R.jsxs)(ct,Object.assign({activeIndex:0},{children:[Object(R.jsxs)(at,Object.assign({title:Object(R.jsx)(fe,{title:"Cell background color",path:be.backgroundColor,size:16})},{children:[Object(R.jsx)(ce.a,{mt:2}),Object(R.jsx)(tn,{expanded:!0,color:i.backgroundColor,onChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setCellAttribute("backgroundColor",e)},onClear:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("backgroundColor",void 0)}})]})),Object(R.jsxs)(at,Object.assign({title:Object(R.jsx)(fe,{title:"Cell text color",path:be.textColor,size:16})},{children:[Object(R.jsx)(ce.a,{mt:2}),Object(R.jsx)(tn,{expanded:!0,color:i.color,onChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setCellAttribute("color",e)},onClear:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("color",void 0)}})]})),Object(R.jsxs)(at,Object.assign({title:Object(R.jsx)(fe,{title:"Cell border color",path:be.cellBorderColor,size:16})},{children:[Object(R.jsx)(ce.a,{mt:2}),Object(R.jsx)(tn,{expanded:!0,color:i.borderColor,onChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setCellAttribute("borderColor",e)},onClear:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderColor",void 0)}})]}))]}))}))}function jn(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useMemo)((function(){return[Ln(t),Rn(t),Tn(t),Pn(t),En(t)]}),[]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{buttonRef:n,toggled:o,onClick:function(){return a(!0)}})),Object(R.jsx)(et,{title:"Row properties",mobile:"sheet",desktop:"menu",isOpen:o,onClose:function(){return a(!1)},position:{target:n.current,isTargetAbsolute:!0,location:"below",yOffset:5},items:c})]})}function On(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useMemo)((function(){return[xn(t),yn(t),Cn(t),kn(t),wn(t),{type:"separator",key:"cellSeperator"},An(t),Sn(t),In(t),{type:"separator",key:"tableSeperator"},Mn(t)]}),[]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{buttonRef:n,toggled:o,onClick:function(){return a(!0)}})),Object(R.jsx)(et,{title:"Table properties",mobile:"sheet",desktop:"menu",isOpen:o,onClose:function(){return a(!1)},position:{target:n.current,isTargetAbsolute:!0,location:"below",yOffset:5},items:c})]})}var xn=function(e){return Object.assign(Object.assign({},bn("insertColumnLeft")),{key:"addColumnLeft",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addColumnBefore().run()}})},yn=function(e){return Object.assign(Object.assign({},bn("insertColumnRight")),{key:"addColumnRight",type:"button",title:"Add column right",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addColumnAfter().run()},icon:"insertColumnRight"})},Cn=function(e){return Object.assign(Object.assign({},bn("moveColumnLeft")),{key:"moveColumnLeft",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(0!==n.left){var i=an(t,n,n.left,n.left-1);i&&e.view.dispatch(i)}}(e)}})},kn=function(e){return Object.assign(Object.assign({},bn("moveColumnRight")),{key:"moveColumnRight",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(n.right!==n.map.width){var i=an(t,n,n.left,n.left+1);i&&e.view.dispatch(i)}}(e)}})},wn=function(e){return Object.assign(Object.assign({},bn("deleteColumn")),{key:"deleteColumn",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().deleteColumn().run()}})},Sn=function(e){return Object.assign(Object.assign({},bn("splitCells")),{key:"splitCells",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().splitCell().run()}})},An=function(e){return Object.assign(Object.assign({},bn("mergeCells")),{key:"mergeCells",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().mergeCells().run()}})},Ln=function(e){return Object.assign(Object.assign({},bn("insertRowAbove")),{key:"insertRowAbove",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addRowBefore().run()}})},Rn=function(e){return Object.assign(Object.assign({},bn("insertRowBelow")),{key:"insertRowBelow",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().addRowAfter().run()}})},Tn=function(e){return Object.assign(Object.assign({},bn("moveRowUp")),{key:"moveRowUp",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(0!==n.top){var i=ln(t,n,n.top,n.top-1);i&&e.view.dispatch(i)}}(e)}})},Pn=function(e){return Object.assign(Object.assign({},bn("moveRowDown")),{key:"moveRowDown",type:"button",onClick:function(){return function(e){var t=e.state.tr,n=Object(on.m)(e.state);if(n.top+1!==n.map.height){var i=ln(t,n,n.top,n.top+1);i&&e.view.dispatch(i)}}(e)}})},En=function(e){return Object.assign(Object.assign({},bn("deleteRow")),{key:"deleteRow",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().deleteRow().run()}})},Mn=function(e){return Object.assign(Object.assign({},bn("deleteTable")),{key:"deleteTable",type:"button",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().deleteTable().run()}})},In=function(e){return Object.assign(Object.assign({},bn("cellProperties")),{key:"cellProperties",type:"button",onClick:function(){qe({popup:function(t){return Object(R.jsx)(vn,{onClose:t,editor:e})}})}})},Dn=fn(xn),zn=fn(yn),Nn=fn(Cn),Hn=fn(kn),Bn=fn(wn),Fn=fn(Sn),_n=fn(An),Vn=fn(Ln),Wn=fn(Rn),Un=fn(Tn),qn=fn(Pn),$n=fn(En),Jn=fn(Mn);function Gn(e){var t=e.height,n=e.width,i=e.float,r=e.editor,o=e.onClose,a=Object(U.useCallback)((function(e,i){var o=e?{width:e,height:e*(t/n)}:i?{width:i*(n/t),height:i}:{width:0,height:0};r.chain().setImageSize(o).run()}),[n,t]);return Object(R.jsx)(tt,Object.assign({title:"Image properties",onClose:o},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{width:["auto",300],flexDirection:"column",p:1}},{children:[Object(R.jsx)(Ye,{children:Object(R.jsxs)(nt.c,Object.assign({variant:"text.body",sx:{justifyContent:"space-between",alignItems:"center"}},{children:["Float image",Object(R.jsx)(nt.a,{checked:i,onClick:function(){return r.chain().setImageAlignment({float:!i,align:"left"}).run()}})]}))}),Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",mt:2}},{children:[Object(R.jsx)(ot,{label:"width",type:"number",value:n,containerProps:{sx:{mr:1}},onChange:function(e){return a(e.target.valueAsNumber)}}),Object(R.jsx)(ot,{label:"height",type:"number",value:t,onChange:function(e){return a(void 0,e.target.valueAsNumber)}})]}))]}))}))}function Xn(e){var t=e.text,n=e.href,i=e.isEditing,r=void 0!==i&&i,o=e.onDone,a=e.onClose,c=Object(U.useState)(n||""),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useState)(t||""),f=Object(C.a)(d,2),p=f[0],b=f[1];return Object(R.jsx)(tt,Object.assign({title:r?"Edit link":"Insert link",onClose:a,action:{title:r?"Save edits":"Insert link",onClick:function(){return o({text:p,href:s})}}},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{p:1,flexDirection:"column",width:["auto",250]}},{children:[Object(R.jsx)(nt.b,{type:"text",placeholder:"Link text",value:p,onChange:function(e){return b(e.target.value)}}),Object(R.jsx)(nt.b,{type:"url",sx:{mt:1},autoFocus:!0,placeholder:"https://example.com/",value:s,onChange:function(e){return u(e.target.value)}})]}))}))}var Kn=n(41),Qn=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function Yn(e){var t=e.editor,n=Et(e.selectedNode||Vt(t.state)),i=Object(U.useCallback)((function(e,i){var r=n.current,o=r.from,a=r.node,c=r.to;if(e&&t.current&&a){var l=_t(a,"link");l&&t.current.chain().command((function(t){var n=t.tr;return n.removeMark(o,c,l.type),n.addMark(o,c,l.type.create({href:e})),n.insertText(i||a.textContent,o,c),Object(Kn.setTextSelection)(n.mapping.map(o))(n),!0})).focus(void 0,{scrollIntoView:!0}).run()}}),[]);return Object(R.jsx)(Zn,Object.assign({},e,{isEditing:!0,onDone:i,onClick:function(){var e=n.current.node;if(e){var t=e.textContent,i=_t(e,"link");if(i)return{text:t,href:i.attrs.href}}}}))}function Zn(e){var t=e.isEditing,n=e.onClick,i=e.onDone,r=e.editor,o=Qn(e,["isEditing","onClick","onDone","editor"]),a=Object(U.useRef)(null),c=Object(U.useState)(!1),l=Object(C.a)(c,2),s=l[0],u=l[1],d=Object(U.useState)(),f=Object(C.a)(d,2),p=f[0],b=f[1],m=Object(U.useState)(),h=Object(C.a)(m,2),g=h[0],v=h[1];return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},o,{buttonRef:a,onClick:function(){var e=n();if(e){var t=e.text,i=e.href;b(i),v(t),u(!0)}},toggled:s})),Object(R.jsx)(et,Object.assign({mobile:"sheet",desktop:"menu",position:{target:a.current||void 0,isTargetAbsolute:!0,location:"below",align:"center",yOffset:5},title:t?"Edit link":"Insert link",isOpen:s,items:[],onClose:function(){var e;u(!1),null===(e=r.current)||void 0===e||e.commands.focus()},focusOnRender:!1},{children:Object(R.jsx)(Xn,{href:p,text:g,isEditing:t,onClose:function(){return u(!1)},onDone:function(e){var t=e.href,n=e.text;i(t,n),u(!1)}})}))]})}var ei={bold:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("bold"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleBold().run()}}))},italic:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("italic"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleItalic().run()}}))},underline:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("underline"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleUnderline().run()}}))},strikethrough:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("strike"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleStrike().run()}}))},code:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("code"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleCode().run()}}))},codeRemove:function(e){var t=e.editor,n="bottom"===D();return t.isActive("code")&&n?Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().unsetMark("code").run()}})):null},subscript:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("subscript"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleSubscript().run()}}))},superscript:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:t.isActive("superscript"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleSuperscript().run()}}))},clearformatting:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().clearNodes().unsetAllMarks().unsetMark("link").run()}}))},addLink:function(e){var t=e.editor,n=e.editor.isActive("link"),i=Object(U.useCallback)((function(e,n){var i,r;if(e){var o=null===(i=t.current)||void 0===i?void 0:i.chain().focus();if(o){var a=!(null===(r=t.current)||void 0===r?void 0:r.state.selection.empty);o.extendMarkRange("link").toggleLink({href:e,target:"_blank"}).insertContent(n||e).focus(),a||(o=o.unsetMark("link").insertContent(" ")),o.run()}}}),[]);return n?Object(R.jsx)(Yn,Object.assign({},e)):Object(R.jsx)(Zn,Object.assign({},e,{onDone:i,onClick:function(){if(t.current){var e=t.current.state,n=e.selection,i=n.from,r=n.to;return{text:e.doc.textBetween(i,r)}}}}))},editLink:Yn,removeLink:function(e){var t=e.editor,n=e.selectedNode;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e,i;n&&(null===(e=t.current)||void 0===e||e.commands.setTextSelection(n.from)),null===(i=t.current)||void 0===i||i.chain().focus().unsetLink().run()}}))},linkSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("link")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"linkSettings",tools:["openLink","editLink","removeLink"]})):null},openLink:function(e){var t=e.editor,n=Et(e.selectedNode||Vt(t.state)).current.node,i=n?_t(n,"link"):null;if(!i)return null;var r=null===i||void 0===i?void 0:i.attrs.href;return Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center"}},{children:[Object(R.jsx)(ce.e,Object.assign({as:"a",href:r,target:"_blank",variant:"body",sx:{mr:1}},{children:r})),Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){return window.open(r,"_blank")}}))]}))},insertBlock:function(e){var t=e.editor,n=Object(U.useRef)(null),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=D(),l=z(),s=Object(U.useMemo)((function(){return[St(t),At(t),gt(t),vt(t),Ot(t),jt(t),xt(t,l),wt(t),l?Ct(t):kt(t),yt(t)]}),[l]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(he,Object.assign({ref:n,sx:{p:1,m:0,bg:o?"hover":"transparent",mr:1,display:"flex",alignItems:"center",":hover":{bg:"hover"},":last-of-type":{mr:0}},onMouseDown:function(e){return e.preventDefault()},onClick:function(){return a((function(e){return!e}))}},{children:Object(R.jsx)(fe,{path:be.plus,size:18,color:"primary"})})),Object(R.jsx)(et,{desktop:"menu",mobile:"sheet",title:"Choose a block to insert",isOpen:o,items:s,onClose:function(){return a(!1)},position:{target:n.current||void 0,isTargetAbsolute:!0,location:"bottom"===c?"top":"below",yOffset:5}})]})},numberedList:function(e){var t=e.editor,n=Object(U.useCallback)((function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleOrderedList().run()}),[]);return Object(R.jsx)(qt,Object.assign({},e,{type:"orderedList",isActive:t.isActive("orderedList"),onClick:n,subTypes:[{type:"decimal",title:"Decimal",items:["1","2","3"]},{type:"upper-alpha",title:"Upper alpha",items:["A","B","C"]},{type:"lower-alpha",title:"Lower alpha",items:["a","b","c"]},{type:"upper-roman",title:"Upper Roman",items:["I","II","III"]},{type:"lower-roman",title:"Lower Roman",items:["i","ii","iii"]},{type:"lower-greek",title:"Lower Greek",items:["\u03b1","\u03b2","\u03b3"]}]}))},bulletList:function(e){var t=e.editor,n=Object(U.useCallback)((function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().toggleBulletList().run()}),[]);return Object(R.jsx)(qt,Object.assign({},e,{type:"bulletList",onClick:n,isActive:t.isActive("bulletList"),subTypes:[{type:"disc",title:"Decimal",items:["1","2","3"]},{type:"circle",title:"Upper alpha",items:["A","B","C"]},{type:"square",title:"Lower alpha",items:["a","b","c"]}]}))},fontSize:function(e){var t=e.editor,n=t.getAttributes("textStyle").fontSize||"16px",i=Et(parseInt(n.replace("px",""))),r=Object(U.useCallback)((function(){return Math.max(8,i.current-1)}),[]),o=Object(U.useCallback)((function(){return Math.min(120,i.current+1)}),[]);return Object(R.jsx)(Pt,{title:"font size",onDecrease:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setFontSize("".concat(r(),"px")).run()},onIncrease:function(){var e;null===(e=t.current)||void 0===e||e.chain().focus().setFontSize("".concat(o(),"px")).run()},onReset:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setFontSize("16px").run()},value:n})},fontFamily:function(e){var t,n,i=e.editor,r=(null===(n=null===(t=Object.entries(Mt).find((function(e){var t=Object(C.a)(e,2),n=(t[0],t[1]);return i.isActive("textStyle",{fontFamily:n})})))||void 0===t?void 0:t.map((function(e){return e})))||void 0===n?void 0:n.at(0))||"Sans-serif",o=Object(U.useMemo)((function(){return function(e,t){var n=[],i=function(i){var r=Mt[i];n.push({key:i,type:"button",title:i,isChecked:i===t,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setFontFamily(r).run()},styles:{fontFamily:r}})};for(var r in Mt)i(r);return n}(i,r)}),[r]);return Object(R.jsx)(Tt,{id:"fontFamily",group:"font",selectedItem:r,items:o,menuWidth:130})},headings:function(e){var t=e.editor,n=D(),i=zt.find((function(e){return t.isActive("heading",{level:e})})),r=Object(U.useMemo)((function(){return function(e,t,n){var i=zt.map((function(i){return{type:"button",key:"heading-".concat(i),title:"bottom"===t?"H".concat(i):"Heading ".concat(i),isChecked:i===n,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().updateAttributes("textStyle",{fontSize:null,fontStyle:null}).setHeading({level:i}).run()}}}));return[{key:"paragraph",type:"button",title:"Paragraph",isChecked:!n,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setParagraph().run()}}].concat(Object(S.a)(i))}(t,n,i)}),[i]);return Object(R.jsx)(Tt,{id:"headings",group:"headings",selectedItem:i?"Heading ".concat(i):"Paragraph",items:r,menuWidth:130})},alignment:function(e){var t=e.editor,n=Object.assign(Object.assign({},t.getAttributes("paragraph")),t.getAttributes("heading")).textAlign,i="left"===n?"center":"center"===n?"right":"right"===n?"justify":"left",r="center"===n?"alignCenter":"justify"===n?"alignJustify":"right"===n?"alignRight":"alignLeft";return Object(R.jsx)(Dt,Object.assign({alignment:i},e,{icon:r}))},textDirection:function(e){var t=e.editor,n=Object.assign(Object.assign({},t.getAttributes("paragraph")),t.getAttributes("heading")).textDirection,i="ltr"===n?"rtl":"ltr",r="ltr"===n?"ltr":"rtl";return Object(R.jsx)(Gt,Object.assign({direction:i},e,{icon:r}))},textColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"textColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("textStyle").color},title:"Text color",onColorChange:function(e){var n,i;return e?null===(n=t.current)||void 0===n?void 0:n.chain().focus().setColor(e).run():null===(i=t.current)||void 0===i?void 0:i.chain().focus().unsetColor().run()}}))},highlight:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"highlight",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("highlight").color},title:"Background color",onColorChange:function(e){var n,i;return e?null===(n=t.current)||void 0===n?void 0:n.chain().focus().toggleHighlight({color:e}).run():null===(i=t.current)||void 0===i?void 0:i.chain().focus().unsetHighlight().run()}}))},math:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().insertMathInline().run()}}))},imageSettings:function(e){var t,n,i=e.editor,r="bottom"===D();return i.isActive("image")&&r?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"imageSettings",tools:(null===(n=null===(t=Ft(i,"image"))||void 0===t?void 0:t.attrs)||void 0===n?void 0:n.float)?["imageAlignLeft","imageAlignRight","imageProperties"]:["imageAlignLeft","imageAlignCenter","imageAlignRight","imageProperties"]})):null},imageAlignCenter:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setImageAlignment({align:"center"}).run()}}))},imageAlignLeft:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setImageAlignment({align:"left"}).run()}}))},imageAlignRight:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setImageAlignment({align:"right"}).run()}}))},imageProperties:function(e){var t=e.editor,n=Object(U.useState)(!1),i=Object(C.a)(n,2),r=i[0],o=i[1],a=Object(U.useRef)(),c=Ft(t,"image"),l=(null===c||void 0===c?void 0:c.attrs)||{},s=l.float,u=l.align,d=l.width,f=l.height;return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({buttonRef:a,toggled:r},e,{onClick:function(){return o((function(e){return!e}))}})),Object(R.jsx)(et,Object.assign({isOpen:r,desktop:"menu",mobile:"sheet",onClose:function(){return o(!1)},blocking:!0,focusOnRender:!1,position:{target:a.current||"mouse",align:"start",location:"below",yOffset:10,isTargetAbsolute:!0}},{children:Object(R.jsx)(Gn,{editor:t,height:f,width:d,align:u,float:s,onClose:function(){return o(!1)}})}))]})},embedAlignCenter:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setEmbedAlignment({align:"center"}).run()}}))},embedAlignLeft:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setEmbedAlignment({align:"left"}).run()}}))},embedAlignRight:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().setEmbedAlignment({align:"right"}).run()}}))},embedProperties:function(e){var t=e.editor,n=Object(U.useState)(!1),i=Object(C.a)(n,2),r=i[0],o=i[1],a=Object(U.useRef)(),c=Object(U.useMemo)((function(){return Ft(t,"embed")}),[]),l=(null===c||void 0===c?void 0:c.attrs)||{};return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({buttonRef:a,toggled:r},e,{onClick:function(){return o((function(e){return!e}))}})),Object(R.jsx)(et,Object.assign({isOpen:r,desktop:"menu",mobile:"sheet",onClose:function(){return o(!1)},blocking:!0,focusOnRender:!1,position:{target:a.current||"mouse",align:"start",location:"below",yOffset:10,isTargetAbsolute:!0}},{children:Object(R.jsx)(lt,{title:"Embed properties",onClose:function(e){var n,i;e?e.src!==l.src&&(null===(i=t.current)||void 0===i||i.commands.setEmbedSource(e.src)):null===(n=t.current)||void 0===n||n.commands.setEmbedSize(l),o(!1)},embed:l,onSizeChanged:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.commands.setEmbedSize(e)}})}))]})},embedSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("embed")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"embedSettings",tools:[]})):null},attachmentSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("attachment")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"attachmentSettings",tools:["downloadAttachment","removeAttachment"]})):null},downloadAttachment:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e,n=Ft(t,"attachment"),i=(null===n||void 0===n?void 0:n.attrs)||{};null===(e=t.current)||void 0===e||e.chain().focus().downloadAttachment(i).run()}}))},removeAttachment:function(e){var t=e.editor;return Object(R.jsx)(ve,Object.assign({},e,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().removeAttachment().run()}}))},tableSettings:function(e){var t=e.editor,n="bottom"===D();return t.isActive("table")&&n?Object(R.jsx)(dn,Object.assign({},e,{autoCloseOnUnmount:!0,popupId:"tableSettings",tools:["insertColumnLeft","insertColumnRight","insertRowAbove","insertRowBelow","cellProperties","columnProperties","rowProperties","deleteRow","deleteColumn","deleteTable"]})):null},columnProperties:function(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useState)(!1),r=Object(C.a)(i,2),o=r[0],a=r[1],c=Object(U.useMemo)((function(){return[xn(t),yn(t),Cn(t),kn(t),wn(t)]}),[]);return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,Object.assign({},e,{buttonRef:n,toggled:o,onClick:function(){return a(!0)}})),Object(R.jsx)(et,{title:"Column properties",mobile:"sheet",desktop:"menu",isOpen:o,onClose:function(){return a(!1)},position:{target:n.current,isTargetAbsolute:!0,location:"below",yOffset:5},items:c})]})},rowProperties:jn,cellProperties:function(e){return Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(dn,Object.assign({},e,{popupId:"cellProperties",tools:["mergeCells","splitCells","cellBackgroundColor","cellTextColor","cellBorderColor","cellBorderWidth"]}))})},insertColumnLeft:Dn,insertColumnRight:zn,moveColumnLeft:Nn,moveColumnRight:Hn,deleteColumn:Bn,splitCells:Fn,mergeCells:_n,cellBackgroundColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"cellBackgroundColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("tableCell").backgroundColor},title:"Cell background color",onColorChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.chain().setCellAttribute("backgroundColor",e).run()}}))},cellBorderColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"cellBorderColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("tableCell").borderColor},title:"Cell border color",onColorChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.chain().focus().setCellAttribute("borderColor",e).run()}}))},cellTextColor:function(e){var t=e.editor;return Object(R.jsx)(rn,Object.assign({},e,{cacheKey:"cellTextColor",getActiveColor:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.getAttributes("tableCell").color},title:"Cell text color",onColorChange:function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.chain().focus().setCellAttribute("color",e).run()}}))},cellBorderWidth:function(e){var t=e.editor,n=t.getAttributes("tableCell").borderWidth,i=n||1,r=Object(U.useCallback)((function(){return Math.max(1,i-1)}),[i]),o=Object(U.useCallback)((function(){return Math.min(10,i+1)}),[i]);return Object(R.jsxs)(ce.c,Object.assign({sx:{justifyContent:"center",alignItems:"center"}},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"subBody",sx:{mx:1}},{children:"Border width:"})),Object(R.jsx)(Pt,{title:"cell border width",onDecrease:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderWidth",r())},onIncrease:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderWidth",o())},onReset:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.commands.setCellAttribute("borderWidth",1)},value:i+"px"})]}))},insertRowAbove:Vn,insertRowBelow:Wn,moveRowUp:Un,moveRowDown:qn,deleteRow:$n,deleteTable:Jn,outdent:function(e){var t=e.editor,n=Ut(e,["editor"]),i="bottom"===D(),r=Wt(t);return r&&i?Object(R.jsx)(ve,Object.assign({},n,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().liftListItem(r).run()}})):null},indent:function(e){var t=e.editor,n=Ut(e,["editor"]),i="bottom"===D(),r=Wt(t);return r&&i?Object(R.jsx)(ve,Object.assign({},n,{toggled:!1,onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.chain().focus().sinkListItem(r).run()}})):null}};var ti=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function ni(e){var t=e.tools,n=e.editor,i=e.force,r=e.selectedNode,o=ti(e,["tools","editor","force","selectedNode"]);return Object(R.jsx)(ce.c,Object.assign({className:"toolbar-group"},o,{children:t.map((function(e){if(Array.isArray(e))return Object(R.jsx)(dn,{title:"More",icon:"more",popupId:e.join(""),tools:e,editor:n},"more-tools");var t=ei[e],o=bn(e);return Object(R.jsx)(t,Object.assign({editor:n,force:i,selectedNode:r},o),o.title)}))}))}function ii(e){var t=e.editor,n=e.node,i=e.selected,r=n.attrs,o=(r.hash,r.filename),a=r.size,c=r.progress,l=Object(U.useRef)();return Object(R.jsx)(R.Fragment,{children:Object(R.jsxs)(ce.a,Object.assign({ref:l,as:"span",contentEditable:!1,variant:"body",sx:{display:"inline-flex",position:"relative",justifyContent:"center",userSelect:"none",alignItems:"center",backgroundColor:"bgSecondary",px:1,borderRadius:"default",border:"1px solid var(--border)",cursor:"pointer",maxWidth:250,borderColor:i?"primary":"border",":hover":{bg:"hover"}},title:o},{children:[Object(R.jsx)(fe,{path:be.attachment,size:14}),Object(R.jsx)(ce.e,Object.assign({as:"span",sx:{ml:"small",fontSize:"body",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},{children:o})),Object(R.jsx)(ce.e,Object.assign({as:"span",sx:{ml:1,fontSize:"0.65rem",color:"fontTertiary",flexShrink:0}},{children:c?"".concat(c,"%"):ri(a)})),Object(R.jsx)(Ye,{children:i&&Object(R.jsx)(ni,{editor:t,tools:["removeAttachment","downloadAttachment"],sx:{boxShadow:"menu",borderRadius:"default",bg:"background",position:"absolute",top:-35}})})]}))})}function ri(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(0===e)return"0B";var n=1024,i=t<0?0:t,r=["B","K","M","G","T","P","E","Z","Y"],o=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,o)).toFixed(i))+r[o]}var oi=u.d.create({name:"attachment",content:"inline*",marks:"",inline:!0,atom:!0,addOptions:function(){return{HTMLAttributes:{},onDownloadAttachment:function(){return!1},onOpenAttachmentPicker:function(){return!1}}},group:function(){return"inline"},draggable:!0,addAttributes:function(){return{progress:{default:0,rendered:!1},hash:ai("hash"),filename:ai("filename"),type:ai("mime"),size:ai("size")}},parseHTML:function(){return[{tag:"span[data-hash]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Object(u.s)(this.options.HTMLAttributes,t)]},addNodeView:function(){return ae(ii,{shouldUpdate:function(e,t){var n=e.attrs,i=t.attrs;return n.progress!==i.progress}})},addCommands:function(){var e=this;return{insertAttachment:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},removeAttachment:function(){return function(e){var t=e.commands;e.tr;return t.deleteSelection()}},downloadAttachment:function(t){return function(n){var i=n.editor;return e.options.onDownloadAttachment(i,t)}},openAttachmentPicker:function(t){return function(n){var i=n.editor;return e.options.onOpenAttachmentPicker(i,t)}},setAttachmentProgress:function(t){return function(n){var i,r=n.state,o=n.tr,a=n.dispatch,c=t.hash,l=t.progress,s=(t.type,Object(u.g)(r.doc,(function(t){return(t.type.name===e.name||"image"===t.type.name)&&t.attrs.hash===c}))),d=Object(k.a)(s);try{for(d.s();!(i=d.n()).done;){var f=i.value;o.setNodeMarkup(f.pos,f.node.type,Object.assign(Object.assign({},f.node.attrs),{progress:100===l?null:l}))}}catch(p){d.e(p)}finally{d.f()}return o.setMeta("preventUpdate",!0),o.setMeta("addToHistory",!1),a&&a(o),!0}}}}});function ai(e,t){return{default:t,parseHTML:function(t){return t.dataset[e]},renderHTML:function(t){return t[e]?Object(w.a)({},"data-".concat(e),t[e]):{}}}}var ci=n(158);var li={a:function(e){var t=e.editor,n=e.selectedNode,i=n.node;return!(null===i||void 0===i?void 0:i.isText)||i.marks.length<=0||!i.marks.some((function(e){return"link"===e.type.name}))?null:Object(R.jsx)(ni,{force:!0,tools:["openLink","editLink","removeLink"],editor:t,selectedNode:n,sx:{bg:"background",boxShadow:"menu",borderRadius:"default",p:1}})}},si=Object.assign({},li);function ui(e){var t=e.editor,n=Object(U.useRef)(),i=Object(U.useRef)();return Object(U.useEffect)((function(){function e(e){if(e.target&&e.target instanceof HTMLElement&&!e.target.classList.contains("ProseMirror")){var r=e.target;if(i.current){var o=!r.closest(".ProseMirror"),a=r.closest(".popup-presenter-portal"),c=i.current.element===r;if(a)return;if(o||!c)return console.log("HIDING",o,c,r),i.current.hide(),void(i.current=void 0)}clearTimeout(n.current),n.current=setTimeout((function(){var e=r.nodeName.toLowerCase(),n=si[e];if(n&&t.current){var o=t.current.view.posAtDOM(r,0),a=t.current.view.state.doc.nodeAt(o);if(a){var c=qe({popup:function(){return Object(R.jsx)(n,{editor:t,selectedNode:{node:a,from:o,to:o+a.nodeSize}})},blocking:!1,focusOnRender:!1,position:{target:r,align:"center",location:"top",isTargetAbsolute:!0}});i.current={element:r,hide:c}}}}),500,{})}}return window.addEventListener("mouseover",e),function(){window.removeEventListener("mouseover",e)}}),[]),null}function di(e){var t=e.editor,n=t.storage.searchreplace,i=n.selectedText,r=n.results,o=Object(U.useState)(!1),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useState)(!1),u=Object(C.a)(s,2),d=u[0],f=u[1],p=Object(U.useState)(!1),b=Object(C.a)(p,2),m=b[0],h=b[1],g=Object(U.useState)(!1),v=Object(C.a)(g,2),j=v[0],O=v[1],x=Object(U.useState)(!1),y=Object(C.a)(x,2),k=y[0],w=y[1],S=Object(U.useRef)(""),A=Object(U.useRef)(),L=Object(U.useCallback)((function(e){t.commands.search(e,{matchCase:m,enableRegex:k,matchWholeWord:j})}),[m,k,j]);return Object(U.useEffect)((function(){A.current&&L(A.current.value)}),[L,m,j,k]),Object(U.useEffect)((function(){if(i){if(A.current){var e=A.current;setTimeout((function(){e.value=i,e.focus()}),0)}L(i)}}),[i,L]),Object(R.jsx)(ce.c,Object.assign({sx:{p:1,bg:"background",flexDirection:"column",boxShadow:["none","menu"],borderRadius:[0,"default"]}},{children:Object(R.jsxs)(ce.c,{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",flex:1,width:["auto",300],mr:1}},{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{flex:1,position:"relative",alignItems:"center",outline:"1px solid var(--border)",borderRadius:"default",p:1,py:0,":focus-within":{outlineColor:"primary",outlineWidth:"1.8px"},":hover":{outlineColor:"primary"}}},{children:[Object(R.jsx)(nt.b,{variant:"clean",defaultValue:i,ref:A,autoFocus:!0,placeholder:"Find",sx:{p:0},onChange:function(e){L(e.target.value)}}),Object(R.jsxs)(ce.c,Object.assign({sx:{flexShrink:0,mr:0,alignItems:"center"}},{children:[Object(R.jsx)(ve,{sx:{mr:0},toggled:d,title:"Expand",id:"expand",icon:d?"chevronRight":"chevronLeft",onClick:function(){return f((function(e){return!e}))},iconSize:"medium"}),d&&Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ve,{sx:{mr:0},toggled:m,title:"Match case",id:"matchCase",icon:"caseSensitive",onClick:function(){return h((function(e){return!e}))},iconSize:"medium"}),Object(R.jsx)(ve,{sx:{mr:0},toggled:j,title:"Match whole word",id:"matchWholeWord",icon:"wholeWord",onClick:function(){return O((function(e){return!e}))},iconSize:"medium"}),Object(R.jsx)(ve,{sx:{mr:0},toggled:k,title:"Enable regex",id:"enableRegex",icon:"regex",onClick:function(){return w((function(e){return!e}))},iconSize:"medium"})]}),Object(R.jsxs)(ce.e,Object.assign({variant:"subBody",sx:{flexShrink:0,borderLeft:"1px solid var(--border)",color:"fontTertiary",px:1}},{children:[r?"".concat(r.length):"0",d?"":" results"]}))]}))]})),c&&Object(R.jsx)(nt.b,{sx:{mt:1,p:"7px"},placeholder:"Replace",onChange:function(e){return S.current=e.target.value}})]})),Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column"}},{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",height:"33.2px"}},{children:[Object(R.jsx)(ve,{toggled:c,title:"Toggle replace",id:"toggleReplace",icon:"replace",onClick:function(){return l((function(e){return!e}))},sx:{mr:0},iconSize:"big"}),Object(R.jsx)(ve,{toggled:!1,title:"Previous match",id:"previousMatch",icon:"previousMatch",onClick:function(){return t.commands.moveToPreviousResult()},sx:{mr:0},iconSize:"big"}),Object(R.jsx)(ve,{toggled:!1,title:"Next match",id:"nextMatch",icon:"nextMatch",onClick:function(){return t.commands.moveToNextResult()},sx:{mr:0},iconSize:"big"}),Object(R.jsx)(ve,{toggled:!1,title:"Close",id:"close",icon:"close",onClick:function(){return t.chain().focus().endSearch().run()},sx:{mr:0},iconSize:"big"})]})),c&&Object(R.jsxs)(ce.c,Object.assign({sx:{alignItems:"center",height:"33.2px",mt:1}},{children:[Object(R.jsx)(ve,{toggled:!1,title:"Replace",id:"replace",icon:"replaceOne",onClick:function(){return t.commands.replace(S.current)},sx:{mr:0},iconSize:18}),Object(R.jsx)(ve,{toggled:!1,title:"Replace all",id:"replaceAll",icon:"replaceAll",onClick:function(){return t.commands.replaceAll(S.current)},sx:{mr:0},iconSize:18})]}))]}))]})}))}function fi(e){var t=e.editor,n=t.storage.searchreplace.isSearching;return Object(R.jsx)(et,Object.assign({mobile:"sheet",desktop:"menu",isOpen:n,onClose:function(){return t.commands.endSearch()},position:{target:De(),isTargetAbsolute:!0,location:"below",align:"end",yOffset:5},blocking:!1,focusOnRender:!1,draggable:!1},{children:Object(R.jsx)(di,{editor:t})}))}function pi(e){return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(fi,Object.assign({},e)),Object(R.jsx)(Ye,{children:Object(R.jsx)(ui,Object.assign({},e))})]})}var bi=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};var mi=function(e){var t=e.editor,n=e.theme,i=e.location,r=e.tools,o=void 0===r?mn().default:r,a=e.sx,c=bi(e,["editor","theme","location","tools","sx"]),l=Object(U.useMemo)((function(){return[].concat(Object(S.a)(hn),Object(S.a)(o))}),[o]),s=z(),u=I((function(e){return e.setToolbarLocation}));return Object(U.useEffect)((function(){u(i)}),[i]),t?Object(R.jsx)(E.a,Object.assign({theme:n},{children:Object(R.jsx)(He.Provider,Object.assign({value:t},{children:Object(R.jsxs)(Be,Object.assign({editor:t},{children:[Object(R.jsx)(ce.c,Object.assign({className:"editor-toolbar",sx:Object.assign(Object.assign({},a),{flexWrap:s?"nowrap":"wrap",overflowX:s?"auto":"hidden"})},c,{children:l.map((function(e){return Object(R.jsx)(ni,{tools:e,editor:t,sx:{flexShrink:0,pr:2,mr:2,borderRight:"1px solid var(--border)",":last-of-type":{mr:0,pr:0,borderRight:"none"}}},e.join(""))}))})),Object(R.jsx)(pi,{editor:t})]}))}))})):null};function hi(e){var t=e.editor,n=e.selected,i=e.onResize,r=e.width,o=e.height,a=e.children;return Object(R.jsx)(ci.a,Object.assign({enable:{bottom:!1,left:!1,right:!1,top:!1,bottomLeft:!1,bottomRight:t.isEditable&&n,topLeft:!1,topRight:!1},size:{height:o||"auto",width:r||"auto"},maxWidth:"100%",minWidth:150,minHeight:150,handleComponent:{bottomRight:Object(R.jsx)(fe,{sx:{width:25,height:25,marginLeft:-17,marginTop:"3px",borderTopLeftRadius:"default",borderBottomRightRadius:"default"},path:be.resize,size:25,color:"primary"})},onResizeStop:function(e,t,n,r){try{i(n.clientWidth,n.clientHeight)}catch(o){}},lockAspectRatio:!0},{children:a}))}var gi=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function vi(e){var t=this,n=e.editor,i=e.updateAttributes,r=e.node,o=e.selected,a=z(),c=r.attrs,l=c.src,s=c.alt,u=c.title,d=c.width,f=c.height,p=c.align,b=c.float,m=Object(U.useRef)();return Object(U.useEffect)((function(){gi(t,void 0,void 0,Object(pt.a)().mark((function e(){return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m.current&&l){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ji(l);case 4:m.current.src=e.sent;case 5:case"end":return e.stop()}}),e)})))}),[l,m]),a&&(b=!1),Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(ce.a,Object.assign({sx:{display:b?"block":"flex",justifyContent:b?"stretch":"center"===p?"center":"left"===p?"start":"end",":hover .drag-handle, :active .drag-handle":{opacity:1}}},{children:Object(R.jsxs)(hi,Object.assign({editor:n,selected:o,width:d,height:f,onResize:function(e,t){i({width:e,height:t},{addToHistory:!0,preventUpdate:!1})}},{children:[Object(R.jsx)(Ye,{children:o&&Object(R.jsx)(ce.c,Object.assign({sx:{position:"relative",justifyContent:"end"}},{children:Object(R.jsx)(ce.c,Object.assign({sx:{position:"absolute",top:-40,mb:2,alignItems:"end"}},{children:Object(R.jsx)(ni,{editor:n,tools:["imageAlignLeft","imageAlignCenter","imageAlignRight","imageProperties"],sx:{boxShadow:"menu",borderRadius:"default",bg:"background"}})}))}))}),o&&Object(R.jsx)(fe,{className:"drag-handle","data-drag-handle":!0,draggable:!0,path:be.dragHandle,sx:{cursor:"grab",position:"absolute",top:2,left:2,zIndex:999}}),Object(R.jsx)(ce.d,Object.assign({"data-drag-image":!0,ref:m,alt:s,src:"/placeholder.svg",title:u,width:"100%",height:"100%",sx:{bg:"bgSecondary",border:o?"2px solid var(--primary)":"2px solid transparent",borderRadius:"default"}},e))]}))}))})}function ji(e){return gi(this,void 0,void 0,Object(pt.a)().mark((function t(){var n,i;return Object(pt.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.startsWith("data:image")){t.next=2;break}return t.abrupt("return",e);case 2:return t.next=4,fetch(e);case 4:return n=t.sent,t.next=7,n.blob();case 7:return i=t.sent,t.abrupt("return",URL.createObjectURL(i));case 9:case"end":return t.stop()}}),t)})))}var Oi=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,xi=u.d.create({name:"image",addOptions:function(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},float:ai("float",!1),align:ai("align","left"),hash:ai("hash"),filename:ai("filename"),type:ai("mime"),size:ai("size")}},parseHTML:function(){return[{tag:this.options.allowBase64?"img":'img:not([src^="data:"])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["img",Object(u.s)(this.options.HTMLAttributes,t)]},addNodeView:function(){return ae(vi)},addCommands:function(){var e=this;return{insertImage:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},setImageAlignment:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},setImageSize:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},updateImage:function(t){return function(n){var i=n.state,r=n.tr,o=n.dispatch,a=t.hash?{key:"hash",value:t.hash}:t.src?{key:"src",value:t.src}:null;if(!a)return!1;var c,l=Object(u.g)(i.doc,(function(t){return t.type.name===e.name&&t.attrs[a.key]===a.value})),s=Object(k.a)(l);try{for(s.s();!(c=s.n()).done;){var d=c.value;r.setNodeMarkup(d.pos,d.node.type,Object.assign(Object.assign({},d.node.attrs),t))}}catch(f){s.e(f)}finally{s.f()}return r.setMeta("preventUpdate",!0),r.setMeta("addToHistory",!1),o&&o(r),!0}}}},addInputRules:function(){return[Object(u.t)({find:Oi,type:this.type,getAttributes:function(e){var t=Object(C.a)(e,5),n=t[2];return{src:t[3],alt:n,title:t[4]}}})]}}),yi=n(134);function Ci(e,t,n){var i=e.state.selection,r=i.empty,o=i.$from;if(!r||!function(e,t,n){var i=n.selection.$from,r=t||n.schema.nodes[e],o=n.schema.nodes.paragraph;return Object(Kn.hasParentNodeOfType)(r)(n.selection)&&i.parent.type===o}(t,n,e.state)||0!==o.parentOffset||!function(e){var t=e.selection.$from;return!(t.depth>1)||(0===t.parentOffset||0===t.index(t.depth-1))}(e.state)||!e.can().liftListItem(n))return!1;var a=function(e,t){var n=Object(Kn.findParentNodeOfType)(e)(t.selection);return!!n&&!n.node.textContent.length}(n,e.state);if(a){if(ki(n,e.state)){var c=wi(n,e.state);return!!c&&e.commands.deleteNode(c.type)}return e.commands.deleteNode(n)}return ki(n,e.state)?e.commands.liftListItem(n):e.chain().joinBackward().joinBackward().run()}var ki=function(e,t){var n=Object(Kn.findParentNodeOfType)(e)(t.selection);if(!n)return!1;var i=n.pos,r=t.doc.resolve(i);return console.log("isFirstOfType",r),!r.nodeBefore},wi=function(e,t){var n,i=Object(Kn.findParentNodeOfType)(e)(t.selection);if(i){var r=i.pos,o=t.doc.resolve(r);if(o.parent.type.spec.group&&!((null===(n=o.parent.type.spec.group)||void 0===n?void 0:n.indexOf("list"))<=-1))return o.parent}};function Si(e){var t=e.editor,n=e.updateAttributes,i=(e.node,e.getPos),r=e.forwardRef,o=e.node.attrs.checked,a=z(),c=Object(U.useCallback)((function(){var e;if(!t.isEditable)return!1;n({checked:!o});var r=i(),a=null===(e=t.current)||void 0===e?void 0:e.state.doc.nodeAt(r);return!!a&&(t.commands.command((function(e){var t=e.tr;return function(e,t,n,i){var r,o=Object(u.g)(e,(function(e){return e.type.name===Ai.name})),a=Object(k.a)(o);try{for(a.s();!(r=a.n()).done;){var c=r.value.pos+i+1;t.setNodeMarkup(c,void 0,{checked:n})}}catch(l){a.e(l)}finally{a.f()}}(a,t,!o,r),!0})),!0)}),[t,i,o]);return Object(R.jsx)(R.Fragment,{children:Object(R.jsxs)(ce.c,Object.assign({"data-drag-image":!0,sx:{bg:"background",borderRadius:"default",":hover > .dragHandle":{opacity:t.isEditable?1:0}}},{children:[Object(R.jsx)(fe,{className:"dragHandle",draggable:"true","data-drag-handle":!0,path:be.dragHandle,sx:{opacity:[1,1,0],alignSelf:"start",mr:2,bg:"transparent",cursor:"grab",".icon:hover path":{fill:"var(--checked) !important"}},size:a?24:20}),Object(R.jsx)(fe,{path:o?be.check:"",stroke:"1px",sx:{border:"2px solid",borderColor:o?"checked":"icon",borderRadius:"default",alignSelf:"start",mr:2,p:"1px",cursor:t.isEditable?"pointer":"unset",":hover":{borderColor:"checked"},":hover .icon path":{fill:"var(--checked) !important"}},onMouseDown:function(e){e.preventDefault(),c()},onTouchEnd:function(e){e.preventDefault(),c()},color:o?"checked":"icon",size:a?16:14}),Object(R.jsx)(ce.e,{as:"div",ref:r,sx:{"> .taskitem-content-wrapper > p":{textDecorationLine:o?"line-through":"none",opacity:o?.8:1},flex:1}})]}))})}var Ai=n(135).a.extend({draggable:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(e){return e.classList.contains("checked")},renderHTML:function(e){return{class:e.checked?"checked":""}}}}},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["li",Object(u.s)(this.options.HTMLAttributes,t,{class:"checklist--item"}),0]},parseHTML:function(){return[{tag:"li",getAttrs:function(e){var t;return e instanceof Node&&e instanceof HTMLElement&&(!(!e.classList.contains("checklist--item")&&!(null===(t=e.parentElement)||void 0===t?void 0:t.classList.contains("checklist")))&&null)},priority:51}]},addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Backspace:function(e){return Ci(e.editor,t.name,t.type)}})},addNodeView:function(){return F(Si,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")},shouldUpdate:function(e,t){var n=e.attrs,i=t.attrs;return n.checked!==i.checked||n.collapsed!==i.collapsed}})}});function Li(e){var t=z(),n=e.editor,i=e.getPos,r=e.node,o=e.updateAttributes,a=e.forwardRef,c=Object(u.p)(Ai.name,n.schema),l=r.attrs,s=l.title,d=l.collapsed,f=Object(U.useState)({checked:0,total:0,percentage:0}),p=Object(C.a)(f,2),b=p[0],m=p[1],h=Object(U.useCallback)((function(){var e=n.state.doc.resolve(i());return Object(Kn.findParentNodeOfTypeClosestToPos)(e,c)}),[]),g=Object(U.useMemo)((function(){return!!h()}),[h]);return Object(U.useEffect)((function(){var e=h();if(e){var t=e.node,i=e.pos,r=function(e,t,n){var i,r=Object(u.g)(e,(function(e){return e.type.name===Ai.name})),o=Object(k.a)(r);try{for(o.s();!(i=o.n()).done;){var a=t+i.value.pos+1,c=n.nodeAt(a);if(!(null===c||void 0===c?void 0:c.attrs.checked))return!1}}catch(l){o.e(l)}finally{o.f()}return!0}(t,i,n.state.doc);t.attrs.checked!==r&&n.commands.command((function(e){return e.tr.setNodeMarkup(i,void 0,{checked:r}),!0}))}}),[r,r.childCount]),Object(U.useEffect)((function(){var e=Object(u.g)(r,(function(e){return e.type.name===Ai.name})),t=e.filter((function(e){return e.node.attrs.checked})).length,n=e.length,i=Math.round(t/n*100);m({checked:t,total:n,percentage:i})}),[g,r]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(ce.c,Object.assign({sx:{flexDirection:"column",":hover > div > .toggleSublist":{opacity:1}}},{children:g?Object(R.jsxs)(ce.c,Object.assign({sx:{position:"absolute",top:0,right:0},contentEditable:!1},{children:[d&&Object(R.jsxs)(ce.e,Object.assign({variant:"body",sx:{color:"fontTertiary",mr:35}},{children:[b.checked,"/",b.total]})),Object(R.jsx)(fe,{className:"toggleSublist",path:d?be.chevronDown:be.chevronUp,sx:{opacity:t||d?1:0,position:"absolute",right:0,alignSelf:"start",mr:2,cursor:"pointer",".icon:hover path":{fill:"var(--checked) !important"}},size:t?24:20,onClick:function(){o({collapsed:!d},{addToHistory:!1,preventUpdate:!0})}})]})):Object(R.jsxs)(ce.c,Object.assign({sx:{position:"relative",bg:"bgSecondary",py:1,borderRadius:"default",mb:2,alignItems:"center",justifyContent:"end",overflow:"hidden"},contentEditable:!1},{children:[Object(R.jsx)(ce.a,{sx:{height:"100%",width:"".concat(b.percentage,"%"),position:"absolute",bg:"border",zIndex:0,left:0,transition:"width 250ms ease-out"}}),Object(R.jsx)(nt.b,{readOnly:!n.isEditable,value:s||"",variant:"clean",sx:{p:0,px:2,zIndex:1,color:"fontTertiary"},placeholder:"Untitled",onChange:function(e){o({title:e.target.value},{addToHistory:!0,preventUpdate:!1})}}),Object(R.jsxs)(ce.c,Object.assign({sx:{flexShrink:0,pr:2}},{children:[Object(R.jsx)(fe,{path:be.checkbox,size:15,color:"fontTertiary"}),Object(R.jsxs)(ce.e,Object.assign({variant:"body",sx:{ml:1,color:"fontTertiary"}},{children:[b.checked,"/",b.total]}))]}))]}))})),Object(R.jsx)(ce.e,{as:"div",ref:a,sx:{ul:{display:d?"none":"block",paddingInlineStart:0,marginBlockStart:g?10:0,marginBlockEnd:0,marginLeft:g?-35:0},li:{listStyleType:"none",position:"relative",marginBottom:[2,"7px"]}}})]})}var Ri=yi.a.extend({addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}},title:{default:null,keepOnSplit:!1,parseHTML:function(e){return e.dataset.title},renderHTML:function(e){return!e.title||e.nested?{}:{"data-title":e.title}}}}},parseHTML:function(){return[{tag:"ul",getAttrs:function(e){return e instanceof Node&&e instanceof HTMLElement&&(e.classList.contains("checklist")&&null)},priority:51}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Object(u.s)(this.options.HTMLAttributes,t,{class:"checklist"}),0]},addCommands:function(){var e=this;return{toggleTaskList:function(){return function(t){var n=t.editor,i=t.commands,r=t.state,o=t.tr,a=r.selection,c=a.$from,l=a.$to;i.toggleList(e.name,e.options.itemTypeName);var s={from:o.mapping.map(c.pos),to:o.mapping.map(l.pos)};return setTimeout((function(){return n.commands.setTextSelection(s)}),0),!0}}}},addNodeView:function(){var e=this;return F(Li,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}}),Ti=n(12);function Pi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new T.Plugin({view:function(t){return new Ei(t,e)}})}var Ei=function(){function e(t,n){var i=this;Object(A.a)(this,e),this.editorView=t,this.width=n.width||1,this.color=n.color||"black",this.class=n.class||"",this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var n=function(t){return i[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}return Object(L.a)(e,[{key:"destroy",value:function(){var e=this;this.handlers.forEach((function(t){var n=t.name,i=t.handler;return e.editorView.dom.removeEventListener(n,i)}))}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e&&this.element&&this.element.parentNode?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){if(this.cursorPos){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,i=t.nodeAfter;if(n||i){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(!r)return;var o=r.getBoundingClientRect(),a=n?o.bottom:o.top;if(n&&i){var c=this.editorView.nodeDOM(this.cursorPos);if(!c)return;a=(a+c.getBoundingClientRect().top)/2}e={left:o.left,right:o.right,top:a-this.width/2,bottom:a+this.width/2}}}if(!e){var l=this.editorView.coordsAtPos(this.cursorPos);e={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}var s,u,d=this.editorView.dom.offsetParent;if(!this.element&&d&&(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!d||d==document.body&&"static"==getComputedStyle(d).position)s=-pageXOffset,u=-pageYOffset;else{var f=d.getBoundingClientRect();s=f.left-d.scrollLeft,u=f.top-d.scrollTop}this.element&&(this.element.style.left=e.left-s+"px",this.element.style.top=e.top-u+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px")}}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout||void 0),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,r="function"==typeof i?i(this.editorView,t):i;if(t&&!r){var o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=Object(Ti.h)(this.editorView.state.doc,o,this.editorView.dragging.slice);if(!a)return this.setCursor(null);o=a}this.setCursor(o),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}]),e}(),Mi=u.b.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:null}},addProseMirrorPlugins:function(){return[Pi(this.options)]}}),Ii=function(e,t){return t(e.tr)};var Di=u.b.create({name:"searchreplace",addOptions:function(){return{searchResultClass:"search-result"}},addCommands:function(){var e=this;return{startSearch:function(){return function(t){var n=t.state;return e.storage.isSearching=!0,n.selection.empty||(e.storage.selectedText=n.doc.textBetween(n.selection.$from.pos,n.selection.$to.pos)),!0}},endSearch:function(){return function(t){var n=t.state,i=t.dispatch;return e.storage.isSearching=!1,e.storage.searchTerm="",Ii(n,i),!0}},search:function(t,n){return function(i){var r=i.state,o=i.dispatch;return e.storage.searchTerm=t,e.storage.enableRegex=(null===n||void 0===n?void 0:n.enableRegex)||!1,e.storage.matchCase=(null===n||void 0===n?void 0:n.matchCase)||!1,e.storage.matchWholeWord=(null===n||void 0===n?void 0:n.matchWholeWord)||!1,e.storage.results=[],Ii(r,o),!0}},moveToNextResult:function(){return function(t){var n=t.chain,i=e.storage,r=i.selectedIndex,o=i.results;if(!o||o.length<=0)return!1;var a=r+1;(isNaN(a)||a>=o.length)&&(a=0);var c=o[a],l=c.from,s=c.to;console.log("[moveToNextResult]",l,s);var u=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:s}).run();return u&&(e.storage.selectedIndex=a),u}},moveToPreviousResult:function(){return function(t){var n=t.chain,i=e.storage,r=i.selectedIndex,o=i.results;if(!o||o.length<=0)return!1;var a=r-1;(isNaN(a)||a<0)&&(a=o.length-1);var c=o[a],l=c.from,s=c.to,u=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:s}).run();return u&&(e.storage.selectedIndex=a),u}},replace:function(t){return function(n){var i=n.commands,r=n.tr,o=n.dispatch,a=e.storage,c=a.selectedIndex,l=a.results;if(!o||!l||l.length<=0)return!1;var s=void 0===c?0:c,u=l[s],d=u.from,f=u.to;if(r.insertText(t,d,f),s+1<l.length){var p=l[s+1],b=p.from,m=p.to,h=l[s+1]={from:r.mapping.map(b),to:r.mapping.map(m)};i.focus(),r.setSelection(new T.TextSelection(r.doc.resolve(h.from),r.doc.resolve(h.to)))}return o(r),l.splice(s,1),!0}},replaceAll:function(t){return function(n){n.state;var i=n.tr,r=n.dispatch;if(!r)return!1;var o=e.storage.results;return!(!r||!o||o.length<=0)&&(r(function(e,t,n){if(t.length){for(var i=n.mapping,r=0;r<t.length;r+=1){var o=t[r],a=o.from,c=o.to;if(n.insertText(e,a,c),r+1<t.length){var l=t[r+1],s=l.from,u=l.to;t[r+1]={from:i.map(s),to:i.map(u)}}}return n}}(t,o,i)),!0)}}}},addKeyboardShortcuts:function(){return{"Mod-f":function(e){return e.editor.commands.startSearch()},Escape:function(e){return e.editor.commands.endSearch()}}},addProseMirrorPlugins:function(){var e=this,t=new T.PluginKey("searchreplace");return[new T.Plugin({key:t,state:{init:function(){return P.b.empty},apply:function(t){var n=t.doc,i=t.docChanged,r=(t.setSelection,e.storage),o=r.searchTerm,a=r.enableRegex,c=r.matchCase,l=r.matchWholeWord,s=e.options.searchResultClass;if(i||o){var u=o?function(e,t){var n=t.enableRegex,i=t.matchCase,r=t.matchWholeWord?"\\b":"";return console.log(r),RegExp(r+(n?e:e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"))+r,i?"gu":"gui")}(o,{enableRegex:a,matchCase:c,matchWholeWord:l}):void 0,d=function(e,t,n){if(!n)return{decorationSet:P.b.empty,results:[]};var i=[],r=[],o=0,a=[];null===e||void 0===e||e.descendants((function(e,t){e.isText?a[o]?a[o]={text:a[o].text+e.text,pos:a[o].pos}:a[o]={text:e.text||"",pos:t}:o+=1})),a=a.filter(Boolean);var c,l=Object(k.a)(a);try{for(l.s();!(c=l.n()).done;){var s,u=c.value,d=u.text,f=u.pos,p=d.matchAll(n),b=Object(k.a)(p);try{for(b.s();!(s=b.n()).done;){var m=s.value;if(""===m[0])break;void 0!==m.index&&r.push({from:f+m.index,to:f+m.index+m[0].length})}}catch(x){b.e(x)}finally{b.f()}}}catch(x){l.e(x)}finally{l.f()}for(var h=0,g=r;h<g.length;h++){var v=g[h],j=v.from,O=v.to;i.push(P.a.inline(j,O,{class:t}))}return{decorationSet:P.b.create(e,i),results:r}}(n,s,u),f=d.decorationSet,p=d.results;return e.storage.results=p,f}return P.b.empty}},props:{decorations:function(e){return t.getState(e)}}})]}});function zi(e){var t=e.editor,n=e.updateAttributes,i=e.selected,r=e.node,o=Object(U.useState)(!0),a=Object(C.a)(o,2),c=a[0],l=a[1],s=Object(U.useRef)(),u=r.attrs,d=u.src,f=u.width,p=u.height,b=u.align;return Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(ce.a,Object.assign({sx:{display:"flex",justifyContent:"center"===b?"center":"left"===b?"start":"end",position:"relative"}},{children:Object(R.jsxs)(hi,Object.assign({editor:t,selected:i,width:f,height:p,onResize:function(e,t){n({width:e,height:t},{addToHistory:!0,preventUpdate:!1})}},{children:[Object(R.jsxs)(ce.c,Object.assign({width:"100%",sx:{position:"relative",justifyContent:"end",p:"small",bg:t.isEditable?"bgSecondary":"transparent",borderTopLeftRadius:"default",borderTopRightRadius:"default",borderColor:i?"border":"bgSecondary",cursor:"pointer",":hover":{borderColor:"border"}}},{children:[Object(R.jsx)(fe,{path:be.dragHandle,size:"big"}),Object(R.jsx)(Ye,{children:i&&Object(R.jsx)(ce.c,Object.assign({sx:{position:"relative",justifyContent:"end"}},{children:Object(R.jsx)(ce.c,Object.assign({sx:{position:"absolute",top:-10,mb:2,alignItems:"end"}},{children:Object(R.jsx)(ni,{editor:t,tools:["embedAlignLeft","embedAlignCenter","embedAlignRight","embedProperties"],sx:{boxShadow:"menu",borderRadius:"default",bg:"background"}})}))}))})]})),Object(R.jsx)(ce.a,Object.assign({as:"iframe",ref:s,src:d,width:"100%",height:"100%",sx:{bg:"bgSecondary",border:i?"2px solid var(--primary)":"2px solid transparent",borderRadius:"default"},onLoad:function(){return l(!1)}},e)),c&&Object(R.jsx)(ce.c,Object.assign({sx:{position:"absolute",bottom:0,width:"100%",height:"calc(100% - 20px)",alignItems:"center",justifyContent:"center"}},{children:Object(R.jsx)(fe,{path:be.loading,rotate:!0,size:32,color:"disabled"})}))]}))}))})}var Ni=u.d.create({name:"embed",content:"",marks:"",draggable:!0,addOptions:function(){return{HTMLAttributes:{}}},group:function(){return"block"},addAttributes:function(){return{src:{default:null},width:{default:null},height:{default:null},align:{default:"left"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",Object(u.s)(this.options.HTMLAttributes,t)]},addNodeView:function(){return ae(zi)},addCommands:function(){var e=this;return{insertEmbed:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},setEmbedAlignment:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},setEmbedSize:function(t){return function(n){return n.commands.updateAttributes(e.name,Object.assign({},t))}},setEmbedSource:function(t){return function(n){return n.commands.updateAttributes(e.name,{src:t})}}}}}),Hi=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))},Bi={};function Fi(e){return Hi(this,void 0,void 0,Object(pt.a)().mark((function t(){var n,i;return Object(pt.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Bi[e]){t.next=2;break}return t.abrupt("return",Bi[e]);case 2:return n="https://esm.sh/[email protected]/lang/".concat(e,".js?bundle=true"),t.next=5,_i(e,n);case 5:return i=t.sent,Bi[e]=i,t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})))}function _i(e,t){return Hi(this,void 0,void 0,Object(pt.a)().mark((function n(){return Object(pt.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n,i){var r="on".concat(e,"Loaded"),o=document.createElement("script");o.type="module",o.innerHTML='\n import LanguageDefinition from "'.concat(t,'";\n if (window["').concat(r,'"]) {\n window["').concat(r,'"](LanguageDefinition)\n }\n'),window[r]=function(e){o.remove(),window[r]=null,n(e)},document.head.appendChild(o)})));case 1:case"end":return n.stop()}}),n)})))}var Vi=n(76),Wi=n(78),Ui=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function qi(e){var t=e.editor,n=e.updateAttributes,i=e.node,r=e.forwardRef,o=null===i||void 0===i?void 0:i.attrs,a=o.language,c=o.indentLength,l=o.indentType,s=o.caretPosition,u=Object(U.useState)(!1),d=Object(C.a)(u,2),f=d[0],p=d[1],b=Object(U.useRef)(null),m=Wi.find((function(e){var t;return e.filename===a||(null===(t=e.alias)||void 0===t?void 0:t.some((function(e){return e===a})))}));return Object(U.useEffect)((function(){!function(){Ui(this,void 0,void 0,Object(pt.a)().mark((function e(){var t,i;return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a&&m&&!Bi[a]){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Fi(m.filename);case 4:if(t=e.sent){e.next=7;break}return e.abrupt("return");case 7:Vi.a.register(t),i=a===m.filename,n({language:m.filename},{preventUpdate:i,addToHistory:!1});case 10:case"end":return e.stop()}}),e)})))}()}),[a]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",borderRadius:"default",overflow:"hidden"}},{children:[Object(R.jsx)(ce.e,{ref:r,as:"pre",autoCorrect:"off",autoCapitalize:"none",sx:{"div, span.token, span.line-number-widget, span.line-number::before":{fontFamily:"monospace",fontSize:"code",whiteSpace:"pre !important",tabSize:1},position:"relative",lineHeight:"20px",bg:"codeBg",color:"static",overflowX:"auto",display:"flex",px:2,pt:2,pb:1},spellCheck:!1}),Object(R.jsxs)(ce.c,Object.assign({ref:b,contentEditable:!1,sx:{bg:"codeBg",alignItems:"center",justifyContent:"flex-end",borderTop:"1px solid var(--codeBorder)"}},{children:[s?Object(R.jsxs)(ce.e,Object.assign({variant:"subBody",sx:{mr:2,color:"codeFg"}},{children:["Line ",s.line,", Column ",s.column," ",s.selected?"(".concat(s.selected," selected)"):""]})):null,Object(R.jsx)(he,Object.assign({variant:"icon",sx:{p:1,mr:1,":hover":{bg:"codeSelection"}},title:"Toggle indentation mode",onClick:function(){t.commands.changeCodeBlockIndentation({type:"space"===l?"tab":"space",amount:c})}},{children:Object(R.jsxs)(ce.e,Object.assign({variant:"subBody",sx:{color:"codeFg"}},{children:["space"===l?"Spaces":"Tabs",": ",c]}))})),Object(R.jsx)(he,Object.assign({variant:"icon",sx:{p:1,mr:1,bg:f?"codeSelection":"transparent",":hover":{bg:"codeSelection"}},onClick:function(){p(!0)},title:"Change language"},{children:Object(R.jsx)(ce.e,Object.assign({variant:"subBody",spellCheck:!1,sx:{color:"codeFg"}},{children:(null===m||void 0===m?void 0:m.title)||"Plaintext"}))}))]}))]})),Object(R.jsx)(et,Object.assign({isOpen:f,onClose:function(){p(!1),t.commands.focus()},focusOnRender:!1,mobile:"sheet",desktop:"menu",position:{target:b.current||void 0,align:"end",isTargetAbsolute:!0,location:"top",yOffset:5},title:"Change code block language"},{children:Object(R.jsx)($i,{selectedLanguage:(null===m||void 0===m?void 0:m.filename)||"Plaintext",onLanguageSelected:function(e){n({language:e},{addToHistory:!0,preventUpdate:!1}),p(!1)},onClose:function(){return p(!1)}})}))]})}function $i(e){var t=e.onLanguageSelected,n=e.selectedLanguage,i=e.onClose,r=Object(U.useState)(Wi),o=Object(C.a)(r,2),a=o[0],c=o[1];return Object(R.jsx)(tt,Object.assign({title:"Select language",onClose:i},{children:Object(R.jsxs)(ce.c,Object.assign({sx:{flexDirection:"column",height:200,width:["auto",300],overflowY:"auto",bg:"background"}},{children:[Object(R.jsx)(nt.b,{onFocus:function(){console.log("EHLLO!")},autoFocus:!0,placeholder:"Search languages",sx:{width:"auto",position:"sticky",top:0,bg:"background",mx:2,p:"7px",zIndex:999},onChange:function(e){if(!e.target.value)return c(Wi);var t=e.target.value.toLowerCase();c(Wi.filter((function(e){var n;return e.title.toLowerCase().indexOf(t)>-1||(null===(n=e.alias)||void 0===n?void 0:n.some((function(e){return e.toLowerCase().indexOf(t)>-1})))})))}}),Object(R.jsx)(ce.c,Object.assign({sx:{flexDirection:"column",pt:1,mt:1}},{children:a.map((function(e){return Object(R.jsxs)(he,Object.assign({variant:"menuitem",sx:{textAlign:"left",py:1,display:"flex",justifyContent:"space-between",alignItems:"center"},onClick:function(){return t(e.filename)}},{children:[Object(R.jsx)(ce.e,Object.assign({variant:"body"},{children:e.title})),n===e.filename?Object(R.jsx)(fe,{path:be.check,size:"small"}):e.alias?Object(R.jsx)(ce.e,Object.assign({variant:"subBody",sx:{fontSize:"10px"}},{children:e.alias.slice(0,3).join(", ")})):null]}),e.title)}))}))]}))}))}function Ji(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.reduce((function(e,n){if("comment"===n.type||"doctype"===n.type)return e;var i=Object(S.a)(t);return"element"===n.type&&n.properties?i.push.apply(i,Object(S.a)(n.properties.className)):i.push("token","text"),"element"===n.type?e.push.apply(e,Object(S.a)(Ji(n.children,i))):e.push({classes:i,text:n.value}),e}),[])}function Gi(e,t,n,i){var r=String(n).length,o={class:"line-number ".concat(i?"active":""),"data-line":String(t).padEnd(r," ")},a={line:t,active:i,total:n,from:e};return P.a.inline(e,e+1,o,a)}function Xi(e){var t=e.doc,n=e.name,i=e.defaultLanguage,r=e.caretPosition,o=[],a=Vi.a.listLanguages();return Object(u.g)(t,(function(e){return e.type.name===n})).forEach((function(e){var t,n=e.node.textContent,c=rr(n,e.pos),l=Object(k.a)(c||[]);try{for(l.s();!(t=l.n()).done;){var s=t.value,u=s.index+1,d=u===(null===r||void 0===r?void 0:r.line)&&s.from===(null===r||void 0===r?void 0:r.from),f=Gi(s.from,u,(null===c||void 0===c?void 0:c.length)||0,d);o.push(f)}}catch(h){l.e(h)}finally{l.f()}var p=e.node.attrs.language||i,b=a.includes(p)?Vi.a.highlight(n,p).children||[]:null;if(b){var m=e.pos+1;Ji(b).forEach((function(e){var t=m+e.text.length;if(e.classes.length){var n=P.a.inline(m,t,{class:e.classes.join(" ")});o.push(n)}m=t}))}})),P.b.create(t,o)}function Ki(e){var t=e.name,n=e.defaultLanguage,i=new T.PluginKey("highlighter");return new T.Plugin({key:i,state:{init:function(e,i){return Xi({doc:i.doc,name:t,defaultLanguage:n})},apply:function(e,i,r,o){var a=r.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=Object(u.g)(r.doc,(function(e){return e.type.name===t})),s=Object(u.g)(o.doc,(function(e){return e.type.name===t})),d=ir(o.selection);return e.docChanged&&([a,c].includes(t)||s.length!==l.length||e.steps.some((function(e){return void 0!==e.from&&void 0!==e.to&&l.some((function(t){return t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to}))})))?Xi({doc:e.doc,name:t,defaultLanguage:n,caretPosition:d}):(i=function(e,t,n){var i=t.find(void 0,void 0,(function(e){var t=e.line,i=e.active,r=e.from;return!!n&&(t===n.line&&r===n.from)||i}));if(!i.length)return t;var r=i.slice();t=t.remove(i);var o,a=[],c=Object(k.a)(r);try{for(c.s();!(o=c.n()).done;){var l=o.value,s=l.from,u=l.spec,d=u.line,f=u.total,p=d===(null===n||void 0===n?void 0:n.line),b=Gi(s,d,(null===n||void 0===n?void 0:n.total)||f,p);a.push(b)}}catch(m){c.e(m)}finally{c.f()}return t.add(e,a)}(e.doc,i,d),i.map(e.mapping,e.doc))}},props:{decorations:function(e){return i.getState(e)}},appendTransaction:function(e,n,i){var r=i.tr,o=!1,a=e.some((function(e){return e.docChanged})),c=(i.selection.$from.parent.type.name===t||n.selection.$from.parent.type.name===t)&&n.selection.$from.pos!==i.selection.$from.pos;return Object(u.g)(i.doc,(function(e){return e.type.name===t})).forEach((function(e){var t,n=e.node,l=e.pos,s=Object.assign({},n.attrs);if(a||!(null===(t=s.lines)||void 0===t?void 0:t.length)){var u=rr(n.textContent,l);s.lines=u.slice()}if(c){var d=ir(i.selection,a?rr(n.textContent,l):void 0);s.caretPosition=d}(a||c)&&(r.setNodeMarkup(l,n.type,s),o=!0)})),o?r:null}})}var Qi=n(136),Yi=n(157),Zi=n(91),er=/^```([a-z]+)?[\s\n]$/,tr=/^~~~([a-z]+)?[\s\n]$/,nr=u.d.create({name:"codeblock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{caretPosition:{default:void 0,rendered:!1},lines:{default:[],rendered:!1},indentType:{default:"space",parseHTML:function(e){return e.dataset.indentType},renderHTML:function(e){return e.indentType?{"data-indent-type":e.indentType}:{}}},indentLength:{default:2,parseHTML:function(e){return e.dataset.indentLength},renderHTML:function(e){return e.indentLength?{"data-indent-length":e.indentLength}:{}}},language:{default:null,parseHTML:function(t){var n,i=e.options.languageClassPrefix,r=[].concat(Object(S.a)(t.classList||[]),Object(S.a)((null===(n=null===t||void 0===t?void 0:t.firstElementChild)||void 0===n?void 0:n.classList)||[])).filter((function(e){return e.startsWith(i)})).map((function(e){return e.replace(i,"")}))[0];return r||null},renderHTML:function(e){return e.language?{class:"language-".concat(e.language)}:{}}}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["pre",Object(u.s)(this.options.HTMLAttributes,t),["code",{},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){return n.commands.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){var i=n.commands;return console.log("TOGGLING!"),i.toggleNode(e.name,"paragraph",t)}},changeCodeBlockIndentation:function(t){return function(n){var i=n.editor,r=n.tr,o=n.commands,a=i.state.selection.$from;if(a.parent.type!==e.type)return!1;var c,l=a.parent.attrs.lines,s=Object(k.a)(l);try{for(s.s();!(c=s.n()).done;){var u=c.value,d=u.text(),f=d.length-d.trimStart().length;if(f){var p=f,b=lr({type:t.type,amount:p});r.insertText(b,r.mapping.map(u.from),r.mapping.map(u.from+f))}}}catch(m){s.e(m)}finally{s.f()}return o.updateAttributes(e.type,{indentType:t.type,indentLength:t.amount}),!0}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},"Mod-a":function(t){var n=t.editor,i=e.editor.state.selection.$anchor;if(i.parent.type.name!==e.name)return!1;var r=Object(u.j)(i,(function(t){return t.type.name===e.type.name}));return!!r&&n.commands.setTextSelection({from:r.pos+1,to:r.pos+r.node.nodeSize-1})},Backspace:function(){var t=e.editor.state.selection,n=t.empty,i=t.$anchor,r=i.parent,o=e.editor.state.doc.nodeAt(i.pos+1),a=function(t){return t&&t.type.name===e.name},c=1===i.pos;return!!n&&(c||a(r)&&!r.textContent.length?e.editor.commands.deleteNode(e.type):!(!o||!a(o)||o.textContent.length)&&e.editor.commands.command((function(e){return e.tr.delete(i.pos+1,i.pos+1+o.nodeSize),!0})))},Enter:function(t){var n=t.editor,i=n.state.selection,r=i.$from;if(!i.empty||r.parent.type!==e.type)return!1;var o=ar(r.parent);return e.options.exitOnTripleEnter&&function(e,t){var n=t.parentOffset===t.parent.nodeSize-2,i=t.parent.textContent.endsWith("\n\n");if(!n||!i)return!1;return e.chain().command((function(e){return e.tr.delete(t.pos-2,t.pos),!0})).exitCode().run()}(n,r)||function(e,t,n){var i=function(e,t){var n=function(e,t){return e.find((function(e){return t>=e.from&&t<=e.to}))}(e.parent.attrs.lines,e.pos);if(!n)return!1;var i=n.text(),r=i.length-i.trimStart().length;return{newline:"\n",indentation:lr({amount:r,type:t.type})}}(t,n)||{},r=i.indentation,o=i.newline;return!!o&&e.chain().insertContent("".concat(o).concat(r),{parseOptions:{preserveWhitespace:"full"}}).focus().run()}(n,r,o)},ArrowUp:function(t){var n=t.editor;if(!e.options.exitOnArrowUp)return!1;var i=n.state.selection,r=i.$anchor;return!(!i.empty||r.parent.type!==e.type)&&(!(1!==r.pos)&&n.commands.insertContentAt(0,"<p></p>"))},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var i=n.state,r=i.selection,o=i.doc,a=r.$from;if(!r.empty||a.parent.type!==e.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var c=a.after();return void 0!==c&&(o.nodeAt(c)?(n.commands.setNodeSelection(a.before()),!1):n.commands.exitCode())},"Shift-Tab":function(t){var n=t.editor,i=n.state.selection,r=i.$from;if(r.parent.type!==e.type)return!1;var o=ar(r.parent),a=lr(o),c=or(r.parent.attrs.lines,i);return n.chain().command((function(e){return sr(e.tr,(function(e){var t,n=Object(k.a)(c);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.text(a.length)===a&&e.delete(e.mapping.map(i.from),e.mapping.map(i.from+o.amount))}}catch(r){n.e(r)}finally{n.f()}}))})).run()},Tab:function(t){var n=t.editor,i=n.state.selection,r=i.$from;if(r.parent.type!==e.type)return!1;var o=or(r.parent.attrs.lines,i);return n.chain().command((function(e){return sr(e.tr,(function(e){var t=lr(ar(r.parent));if(1===o.length)return e.insertText(t,r.pos);var n,i=Object(k.a)(o);try{for(i.s();!(n=i.n()).done;){var a=n.value;e.insertText(t,e.mapping.map(a.from))}}catch(c){i.e(c)}finally{i.f()}}))})).run()}}},addInputRules:function(){return[Object(u.v)({find:er,type:this.type,getAttributes:function(e){return{language:e[1]}}}),Object(u.v)({find:tr,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new T.Plugin({key:new T.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;var i=n.clipboardData.getData("text/plain"),r=n.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,a=null===o||void 0===o?void 0:o.mode;if(!i||!a)return!1;var c=function(e,t){var n=t||Object(Qi.a)(e),i=n.amount,r=n.type,o=void 0===r?"space":r,a=Object(Yi.a)(e,i,{includeEmptyLines:!1,indent:"space"===o?" ":"\t"});return{code:Object(Zi.a)(a),amount:i,type:o}}(i,ar(t.state.selection.$from.parent)),l=t.state.tr;return e.editor.isActive(e.type.name)||l.replaceSelectionWith(e.type.create({language:a,indentType:c.type,indentLength:c.amount})),l.insertText(c.code.replace(/\r\n?/g,"\n")),l.setMeta("paste",!0),t.dispatch(l),!0}}}),Ki({name:this.name,defaultLanguage:"txt"})]},addNodeView:function(){return F(qi,{contentDOMFactory:function(){var e=document.createElement("div");return e.classList.add("node-content-wrapper"),e.style.whiteSpace="inherit",e.style.minWidth="20px",{dom:e}},shouldUpdate:function(e,t){var n=e.attrs,i=t.attrs;return function(e,t){return void 0===t||(null===e||void 0===e?void 0:e.column)!==(null===t||void 0===t?void 0:t.column)||(null===e||void 0===e?void 0:e.line)!==(null===t||void 0===t?void 0:t.line)}(n.caretPosition,i.caretPosition)||n.language!==i.language||n.indentType!==i.indentType}})}});function ir(e,t){var n=e.$from,i=e.$to,r=e.$head;if(n.parent.type.name===nr.name){t=t||(n.parent.attrs.lines||[]);var o,a=Object(k.a)(t);try{for(a.s();!(o=a.n()).done;){var c=o.value;if(r.pos>=c.from&&r.pos<=c.to){var l=c.length+1;return{line:c.index+1,column:l-(c.to-r.pos),selected:i.pos-n.pos,total:t.length,from:c.from}}}}catch(s){a.e(s)}finally{a.f()}}}function rr(e,t){for(var n=[],i=0,r=t+1,o=0,a=function(){var t=e.indexOf("\n",i);t<=-1&&(t=e.length);var a=t-i,c=r+a,l=i;n.push({index:o,length:a,from:r,to:c,text:function(t){return e.slice(l,t?l+t:l+a)}}),r=c+1,i=t+1,++o};i<=e.length;)a();return n}function or(e,t){var n=t.$from,i=t.$to;return e.filter((function(e){return cr(e.from,n.pos,i.pos)||cr(e.to,n.pos,i.pos)||cr(n.pos,e.from,e.to)}))}function ar(e){if(e.type.name===nr.name){var t=e.attrs,n=t.indentType,i=t.indentLength;return{type:n,amount:parseInt(i)}}}function cr(e,t,n){return e>=t&&e<=n}function lr(e){return("space"===e.type?" ":"\t").repeat(e.amount)}function sr(e,t){var n=e.selection,i=n.$anchor,r=n.$head;return t(e),e.setSelection(new T.TextSelection(e.doc.resolve(e.mapping.map(i.pos)),e.doc.resolve(e.mapping.map(r.pos)))),!0}var ur=n(84).a.extend({addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Backspace:function(e){return Ci(e.editor,t.name,t.type)}})}});function dr(e){var t,n,i=e.editor,r=(e.updateAttributes,e.node),o=e.getPos,a=e.forwardRef,c=z(),l=(null===(t=r.lastChild)||void 0===t?void 0:t.type.name)===hr.name,s=l&&(null===(n=r.lastChild)||void 0===n?void 0:n.attrs.collapsed),d=function(){var e=Object(u.g)(r,(function(e){return e.type.name===hr.name})),t=Object(C.a)(e,1)[0];if(t){var n=t.pos;i.commands.toggleOutlineCollapse(n+o()+1,!s)}};return Object(R.jsxs)(ce.c,{children:[Object(R.jsxs)(ce.c,Object.assign({className:"outline",sx:{flexDirection:"column",alignItems:"center",mt:c?"0px":"3px"}},{children:[l?Object(R.jsx)(fe,{path:s?be.chevronRight:be.chevronDown,title:s?"Click to uncollapse list":"Click to collapse list",sx:{cursor:"pointer",transition:"all .2s ease-in-out",":hover":{transform:["unset","scale(1.3)"]},":active":{transform:["scale(1.3)","unset"]},".icon:hover path":{fill:"var(--checked) !important"}},size:c?24:18,onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(e){e.preventDefault(),d()},onClick:d}):Object(R.jsx)(fe,{path:be.circle,size:c?24:18,sx:{transform:"scale(0.4)"}}),l&&!s&&Object(R.jsx)(ce.a,{sx:{flex:1,width:1,mt:2,backgroundColor:"border",borderRadius:50,flexShrink:0,cursor:"pointer",transition:"all .2s ease-in-out",":hover":{backgroundColor:"fontTertiary",width:4}},contentEditable:!1})]})),Object(R.jsx)(ce.e,{ref:a,sx:{pl:1,listStyleType:"none",flex:1}})]})}var fr=u.d.create({name:"outlineListItem",addOptions:function(){return{HTMLAttributes:{}}},content:"heading* paragraph block*",defining:!0,parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]')}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Object(u.s)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addKeyboardShortcuts:function(){var e=this;return{"Mod-Space":function(t){var n=function(e,t){var n,i,r=e.state.selection.$from,o=Object(Kn.findParentNodeOfTypeClosestToPos)(r,t);if(!o)return!1;var a=Object(u.g)(o.node,(function(e){return e.type.name===hr.name})),c=Object(C.a)(a,1)[0];if(!c)return!1;var l=(null===(n=null===c||void 0===c?void 0:c.node)||void 0===n?void 0:n.type.name)===hr.name,s=null===(i=null===c||void 0===c?void 0:c.node)||void 0===i?void 0:i.attrs.collapsed,d=o.pos+c.pos+1;return{isCollapsed:s,isNested:l,subListPos:d}}(t.editor,e.type);if(!n)return!1;var i=n.isCollapsed,r=n.subListPos;return e.editor.commands.toggleOutlineCollapse(r,!i)},Enter:function(t){t.editor;return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)},Backspace:function(t){return Ci(t.editor,e.name,e.type)}}},addCommands:function(){return{toggleOutlineCollapse:function(e,t){return function(n){return n.tr.setNodeMarkup(e,void 0,{collapsed:t}),!0}}}},addNodeView:function(){return F(dr,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")}})}});function pr(e){var t=e.editor,n=e.getPos,i=e.node,r=(e.updateAttributes,e.forwardRef),o=i.attrs.collapsed,a=Object(U.useMemo)((function(){var e;return(null===(e=t.state.doc.resolve(n()).parent)||void 0===e?void 0:e.type.name)===fr.name}),[]);return Object(R.jsx)(R.Fragment,{children:Object(R.jsx)(ce.e,{className:"outline-list",as:"div",ref:r,sx:{ul:{display:o?"none":"block",paddingInlineStart:0,paddingLeft:0,marginBlockStart:a?5:0,marginBlockEnd:0},li:{listStyleType:"none"}}})})}var br=/^\s*(-o)\s$/,mr="outlineListItem",hr=u.d.create({name:"outlineList",addOptions:function(){return{HTMLAttributes:{}}},addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}}}},group:"block list",content:"".concat(mr,"+"),parseHTML:function(){return[{tag:'ul[data-type="'.concat(this.name,'"]'),priority:52}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Object(u.s)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands:function(){var e=this;return{toggleOutlineList:function(){return function(t){return t.commands.toggleList(e.name,mr)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-O":function(){return e.editor.commands.toggleOutlineList()}}},addInputRules:function(){return[Object(u.w)({find:br,type:this.type})]},addNodeView:function(){var e=this;return F(pr,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}});function gr(e){var t=e.editor,n=e.node,i=e.forwardRef,r=Object(U.useRef)(null),o=Object(U.useRef)(),a=t.isActive("table");return Object(U.useEffect)((function(){r.current&&o.current&&Object(on.s)(n,r.current,o.current,50)}),[n]),Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(Ye,{children:a&&Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(jr,{editor:t,table:o.current}),Object(R.jsx)(Or,{editor:t,table:o.current})]})}),Object(R.jsx)("div",Object.assign({className:"tableWrapper"},{children:Object(R.jsx)("table",Object.assign({ref:function(e){null===i||void 0===i||i(e),o.current=e||void 0}},{children:Object(R.jsx)("colgroup",{ref:r})}))}))]})}function vr(e){return function(t){Object(V.a)(i,t);var n=Object(W.a)(i);function i(t,r){var o,a;return Object(A.a)(this,i),a=n.call(this,t,e,(function(){return 0}),{component:gr,shouldUpdate:function(e,t){return e.type===t.type},contentDOMFactory:function(){return{dom:document.createElement("tbody")}},wrapperFactory:function(){var e=document.createElement("div");return e.style.position="relative",e}}),Object(Z.a)((o=Object(_.a)(a),Object(ee.a)(i.prototype)),"init",o).call(o),a}return Object(L.a)(i)}(oe)}function jr(e){var t=e.editor,n=Object(U.useRef)(null);return Object(U.useEffect)((function(){if(n.current){var e=Bt(t,["tableRow"]);if(e){var i=Ee(n.current,{location:"left",target:e,align:"start",xOffset:-5,yOffset:-3});n.current.style.top="".concat(i.top,"px"),n.current.style.left="".concat(i.left,"px")}}}),[t.state.selection,n.current]),Object(R.jsxs)(ce.c,Object.assign({ref:n,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(R.jsx)(jn,Object.assign({},bn("rowProperties"),{icon:"more",variant:"small",editor:t})),Object(R.jsx)(Wn,Object.assign({},bn("insertRowBelow"),{editor:t,variant:"small"}))]}))}function Or(e){var t=e.editor,n=e.table,i=Object(U.useRef)(null);return Object(U.useEffect)((function(){if(i.current&&n){var e=Bt(t,["tableCell","tableHeader"]);if(e){var r=Ee(i.current,{location:"top",align:"center",target:e,yAnchor:n,yOffset:2});i.current.style.left="".concat(r.left,"px"),i.current.style.top="".concat(r.top,"px")}}}),[t.state.selection,i.current,n]),Object(R.jsxs)(ce.c,Object.assign({ref:i,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(R.jsx)(On,{editor:t,title:"tableProperties",icon:"more",variant:"small"}),Object(R.jsx)(zn,Object.assign({},bn("insertColumnRight"),{editor:t,variant:"small",icon:"plus"}))]}))}var xr=n(138).a.extend({addProseMirrorPlugins:function(){var e=this.options.resizable&&this.editor.isEditable;return[].concat(Object(S.a)(e?[Object(on.f)({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:vr(this.editor),lastColumnResizable:this.options.lastColumnResizable})]:[]),[Object(on.p)({allowTableNodeSelection:this.options.allowTableNodeSelection})])}}),yr=n(156),Cr=n(155),kr=u.b.create({name:"codemarkPlugin",addProseMirrorPlugins:function(){return Object(Cr.a)({markType:this.editor.schema.marks.code})}}),wr=n(55),Sr=n(47),Ar=n(26);function Lr(e,t,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return function(r,o){var a=e.state,c=a.selection,l=c.to,s=c.from,u=r.selection,d=u.to,f=u.from;if(i&&d!==f)return!1;var p=t>0?d:f;if(n){var b=r.doc.nodeSize-2;if(t>0&&p<b)return!1;if(t<0&&p>0)return!1}if(o){var m=t>0?l:s;e.dispatch(a.tr.setSelection(T.TextSelection.create(a.doc,m))),e.focus()}return!0}}var Rr=function(){function e(t,n,i,r,o,a){var c=this;Object(A.a)(this,e),this.options=r,this._node=t,this._outerView=n,this._getPos=i,this._mathPluginKey=o,this.cursorSide="start",this._isEditing=!1,this._tagName=r.tagName||this._node.type.name.replace("_","-"),this.dom=document.createElement(this._tagName),r.className&&this.dom.classList.add(r.className),this.dom.classList.add("math-node"),this._mathRenderElt=document.createElement("span"),this._mathRenderElt.textContent="",this._mathRenderElt.classList.add("math-render"),this.dom.appendChild(this._mathRenderElt),this._mathSrcElt=document.createElement("span"),this._mathSrcElt.classList.add("math-src"),this.dom.appendChild(this._mathSrcElt),this.dom.addEventListener("click",(function(){return c.ensureFocus()})),this.renderMath()}return Object(L.a)(e,[{key:"destroy",value:function(){this.closeEditor(!1),this._mathRenderElt&&(this._mathRenderElt.remove(),delete this._mathRenderElt),this._mathSrcElt&&(this._mathSrcElt.remove(),delete this._mathSrcElt),this.dom.remove()}},{key:"ensureFocus",value:function(){this._innerView&&this._outerView.hasFocus()&&this._innerView.focus()}},{key:"update",value:function(e,t,n){if(!e.sameMarkup(this._node))return!1;if(this._node=e,this._innerView){var i=this._innerView.state,r=e.content.findDiffStart(i.doc.content);if(null!=r){var o=e.content.findDiffEnd(i.doc.content);if(o){var a=o.a,c=o.b,l=r-Math.min(a,c);l>0&&(a+=l,c+=l),this._innerView.dispatch(i.tr.replace(r,c,e.slice(r,a)).setMeta("fromOutside",!0))}}}return this._isEditing||this.renderMath(),!0}},{key:"updateCursorPos",value:function(e){var t=this._getPos(),n=this._node.nodeSize;e.selection.from<t+n&&t<e.selection.to||(this.cursorSide=t<e.selection.from?"end":"start")}},{key:"selectNode",value:function(){this._outerView.editable&&(this.dom.classList.add("ProseMirror-selectednode"),this._isEditing||this.openEditor())}},{key:"deselectNode",value:function(){this.dom.classList.remove("ProseMirror-selectednode"),this._isEditing&&this.closeEditor()}},{key:"stopEvent",value:function(e){return void 0!==this._innerView&&void 0!==e.target&&this._innerView.dom.contains(e.target)}},{key:"ignoreMutation",value:function(){return!0}},{key:"renderMath",value:function(){if(this._mathRenderElt){var e=this._node.content.content,t="";if(e.length>0&&null!==e[0].textContent&&(t=e[0].textContent.trim()),t.length<1)for(this.dom.classList.add("empty-math");this._mathRenderElt.firstChild;)this._mathRenderElt.firstChild.remove();else{this.dom.classList.remove("empty-math");try{this.options.renderer(t,this._mathRenderElt),this._mathRenderElt.classList.remove("parse-error"),this.dom.setAttribute("title","")}catch(n){n instanceof Error&&(console.error(n),this._mathRenderElt.classList.add("parse-error"),this.dom.setAttribute("title",n.toString()))}}}}},{key:"dispatchInner",value:function(e){if(this._innerView){var t=this._innerView.state.applyTransaction(e),n=t.state,i=t.transactions;if(this._innerView.updateState(n),!e.getMeta("fromOutside")){for(var r=this._outerView.state.tr,o=Ti.d.offset(this._getPos()+1),a=0;a<i.length;a++)for(var c=i[a].steps,l=0;l<c.length;l++){var s=c[l].map(o);if(!s)throw Error("step discarded!");r.step(s)}r.docChanged&&this._outerView.dispatch(r)}}}},{key:"openEditor",value:function(){var e,t=this;if(this._innerView)throw Error("inner view should not exist!");if(!this._mathSrcElt)throw new Error("_mathSrcElt does not exist!");this._innerView=new P.c(this._mathSrcElt,{state:T.EditorState.create({doc:this._node,plugins:[Object(Sr.b)({Tab:function(e,t){return t&&t(e.tr.insertText("\t")),!0},Backspace:Object(Ar.a)(Ar.c,(function(e,n,i){return!!e.selection.empty&&(!(t._node.textContent.length>0)&&(t._outerView.dispatch(t._outerView.state.tr.insertText("")),t._outerView.focus(),!0))})),Enter:Object(Ar.a)(Ar.i,Lr(this._outerView,1,!1)),"Ctrl-Enter":Lr(this._outerView,1,!1),ArrowLeft:Lr(this._outerView,-1,!0),ArrowRight:Lr(this._outerView,1,!0),ArrowUp:Lr(this._outerView,-1,!0),ArrowDown:Lr(this._outerView,1,!0)})]}),dispatchTransaction:this.dispatchInner.bind(this)});var n=this._innerView.state;this._innerView.focus();var i=null===(e=this._mathPluginKey.getState(this._outerView.state))||void 0===e?void 0:e.prevCursorPos;null!==i&&void 0!==i||console.error("[prosemirror-math] Error: Unable to fetch math plugin state from key.");var r=(null!==i&&void 0!==i?i:0)<=this._getPos()?0:this._node.nodeSize-2;setTimeout((function(){t._innerView&&(t._innerView.focus(),t._innerView.dispatch(n.tr.setSelection(T.TextSelection.create(n.doc,r))))})),this._isEditing=!0}},{key:"closeEditor",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._innerView&&(this._innerView.destroy(),this._innerView=void 0),e&&this.renderMath(),this._isEditing=!1}}]),e}(),Tr=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(t){o(t)}}function c(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}l((i=i.apply(e,t||[])).next())}))};function Pr(){return Tr(this,void 0,void 0,Object(pt.a)().mark((function e(){var t,i;return Object(pt.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e(0).then(n.t.bind(null,208,7));case 2:return t=e.sent,i=t.default,e.next=6,Promise.all([n.e(0),n.e(4)]).then(n.bind(null,209));case 6:return e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))}var Er={inline:function(e,t){Pr().then((function(n){n.render(e,t,{displayMode:!1,globalGroup:!0,throwOnError:!1})}))},block:function(e,t){Pr().then((function(n){n.render(e,t,{displayMode:!0,globalGroup:!0,throwOnError:!1})}))}},Mr=new T.PluginKey("prosemirror-math");function Ir(e){return function(t,n,i){var r=Mr.getState(n.state);if(!r)throw new Error("no math plugin!");var o=r.activeNodeViews,a=new Rr(t,n,i,{className:e?"math-inline":"math-block",renderer:e?Er.inline:Er.block,tagName:e?"span":"div"},Mr,(function(){o.splice(o.indexOf(a))}));return o.push(a),a}}var Dr={key:Mr,state:{init:function(e,t){return{macros:{},activeNodeViews:[],prevCursorPos:0}},apply:function(e,t,n,i){var r=i.selection.from,o=n.selection.from;return{activeNodeViews:t.activeNodeViews,macros:t.macros,prevCursorPos:o!==r?o:t.prevCursorPos}}},props:{nodeViews:{mathInline:Ir(!0),mathBlock:Ir(!1)}}},zr=new T.Plugin(Dr),Nr=n(5);function Hr(e,t){return Nr.Fragment.from(t.text(e))}function Br(e){var t,n=e.querySelector("img.mwe-math-fallback-image-inline[alt]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alt"))&&void 0!==t&&t}function Fr(e){var t,n=e.querySelector("math[alttext]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alttext"))&&void 0!==t&&t}function _r(e){var t,n=e.querySelector("math annotation[encoding='application/x-tex'");return null!==(t=null===n||void 0===n?void 0:n.textContent)&&void 0!==t&&t}function Vr(e){var t=function(e,t){var n,i=Object(k.a)(t);try{for(i.s();!(n=i.n()).done;){var r=(0,n.value)(e);if(!1!==r)return r}}catch(o){i.e(o)}finally{i.f()}return!1}(e,[Br,Fr,_r]);return t}var Wr=[{tag:"span",getAttrs:function(e){return!!e.classList.contains("mwe-math-element")&&null},getContent:function(e,t){return Hr(Vr(e)||"\\text{\\color{red}(paste error)}",t)}}],Ur=[{tag:"dl",getAttrs:function(e){var t=e;if(1!==t.childElementCount)return!1;var n=t.firstChild;return"DD"===n.tagName&&(1===n.childElementCount&&(!!n.firstChild.classList.contains("mwe-math-element")&&null))},getContent:function(e,t){return Hr(Vr(e)||"\\text{\\color{red}(paste error)}",t)}}];[{tag:"math-inline"}].concat(Object(S.a)(Wr)),[{tag:"math-display"}].concat(Object(S.a)(Ur));var qr=/\$\$(.+)\$\$/,$r=(function(){try{new RegExp("(?<!\\\\)\\$(.+)(?<!\\\\)\\$")}catch(e){return qr}}(),/\$\$\$\s+$/);var Jr=function(e){var t=e.selection,n=t.from,i=(t.to,e.selection.content().content),r=[];return i.descendants((function(e,t,i){return"text"!=e.type.name&&(!e.type.name.startsWith("math_")||(r.push({start:Math.max(n+t-1,0),end:n+t+e.nodeSize-1}),!1))})),P.b.create(e.doc,r.map((function(e){var t=e.start,n=e.end;return P.a.node(t,n,{class:"math-select"})})))},Gr=new T.Plugin({state:{init:function(e,t){return Jr(t)},apply:function(e,t,n,i){return e.selection&&e.selectionSet?Jr(e):n}},props:{decorations:function(e){return Gr.getState(e)}}});new(function(){function e(t,n){Object(A.a)(this,e),this.nodes=Object.assign(Object.assign({},null===n||void 0===n?void 0:n.nodes),t.nodes),this.marks=Object.assign(Object.assign({},null===n||void 0===n?void 0:n.marks),t.marks)}return Object(L.a)(e,[{key:"serializeFragment",value:function(e){var t=this,n="\n\n",i="",r=!0,o=e.size;return e.nodesBetween(0,o,(function(e,a){var c,l=t.serializeNode(e);if(null!==l)return i+=l,!1;e.isText?(i+=(null===(c=e.text)||void 0===c?void 0:c.slice(Math.max(0,a)-a,o-a))||"",r=!1):(e.isLeaf,!r&&e.isBlock&&(i+=n,r=!0))}),0),i}},{key:"serializeSlice",value:function(e){return this.serializeFragment(e.content)}},{key:"serializeNode",value:function(e){var t=this.nodes[e.type.name];return void 0!==t?t(e):null}}]),e}())({nodes:{math_inline:function(e){return"$".concat(e.textContent,"$")},math_display:function(e){return"\n\n$$\n".concat(e.textContent,"\n$$")}}});var Xr=u.d.create({name:"mathInline",group:"inline math",content:"text*",inline:!0,atom:!0,code:!0,parseHTML:function(){return[{tag:"span[class*='math-inline']"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Object(u.s)({class:"math-inline math-node"},t),0]},addCommands:function(){var e=this;return{insertMathInline:function(){return function(t){var n=t.chain,i=t.tr.selection.$from;return n().insertContent({type:e.name,attrs:{}}).setNodeSelection(i.pos).run()}}}},addProseMirrorPlugins:function(){var e,t,n,i=Object(wr.b)({rules:[(e=qr,t=this.type,new wr.a(e,(function(e,i,r,o){var a=e.doc.resolve(r),c=a.index(),l=e.doc.resolve(o),s=n instanceof Function?n(i):n;return a.parent.canReplaceWith(c,l.index(),t)?e.tr.replaceRangeWith(r,o,t.create(s,t.schema.text(i[1]))):null})))]});return[zr,i]}}),Kr=u.d.create({name:"mathBlock",group:"block math",content:"text*",atom:!0,code:!0,parseHTML:function(){return[{tag:"div[class*='math-block']"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["div",Object(u.s)({class:"math-block math-node"},t),0]},addCommands:function(){var e=this;return{insertMathBlock:function(){return function(t){var n=t.state,i=t.dispatch,r=t.view;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(n,i){var r=n.selection,o=r.$from,a=r.empty,c=o.index();if(!a&&!o.parent.canReplaceWith(c,c,e))return!1;if(i){var l=e.create({},t?n.schema.text(t):null),s=n.tr.replaceSelectionWith(l);i(s=a?s.setSelection(T.TextSelection.create(s.doc,o.pos+1)):s.setSelection(T.NodeSelection.create(s.doc,o.pos)))}return!0}}(e.type)(n,i,r)}}}},addProseMirrorPlugins:function(){var e,t,n;return[Object(wr.b)({rules:[(e=$r,t=this.type,new wr.a(e,(function(e,i,r,o){var a=e.doc.resolve(r),c=n instanceof Function?n(i):n;if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t))return null;var l=e.tr.delete(r,o).setBlockType(r,r,t,c);return l.setSelection(T.NodeSelection.create(l.doc,l.mapping.map(a.pos-1)))})))]})]}}),Qr=void 0,Yr=u.b.create({name:"keepinview",onCreate:function(){var e=this;Qr=function(){Zr(e.editor)},window.addEventListener("resize",Qr)},onDestroy:function(){Qr&&(window.removeEventListener("resize",Qr),Qr=void 0)},addKeyboardShortcuts:function(){return{Enter:function(e){var t=e.editor;return setTimeout((function(){Zr(t)})),!1}}}});function Zr(e){var t=e.state.selection.$from,n=Object(u.u)(e.view,t.pos,t.pos+1).top;if(window.innerHeight-n<100){var i=e.view.domAtPos(t.pos).node;if(i.nodeType===Node.TEXT_NODE&&i.parentNode&&(i=i.parentNode),i instanceof HTMLElement){var r=eo(i);r?r.scrollBy({top:100,behavior:"smooth"}):i.scrollIntoView({behavior:"smooth",block:"center"})}}}var eo=function(e){if(e){for(var t=e.parentElement;t;){var n=t.style,i=n.overflow,r=n.overflowY;if(to(i)||to(r))return t;t=t.parentElement}return document.documentElement}};function to(e){return e.split(" ").every((function(e){return"auto"===e||"scroll"===e}))}var no=new T.PluginKey("selection-persist-key"),io=u.b.create({name:"selection-persist",addProseMirrorPlugins:function(){var e=!1;return[new T.Plugin({key:no,props:{decorations:function(e){return no.getState(e)}},state:{init:function(){return P.b.empty},apply:function(t,n,i,r){var o=!!t.getMeta("blur");!!t.getMeta("focus")&&(e=!1,!0),o&&(e=!0,!1);var a=i.selection,c=a.from,l=a.to;return e?P.b.create(t.doc,[P.a.inline(c,l,{style:"background-color: var(--dimPrimary)"})]):P.b.empty}}})]}}),ro=function(e){Object(V.a)(n,e);var t=Object(W.a)(n);function n(){return Object(A.a)(this,n),t.apply(this,arguments)}return Object(L.a)(n,[{key:"requestPermission",value:function(e){var t=new CustomEvent("permissionrequest",{detail:{id:e},cancelable:!0});if(window.dispatchEvent(t))return this.current}}]),n}(u.a);function oo(){var e=Object(U.useState)(0),t=Object(C.a)(e,2)[1];return function(){return t((function(e){return e+1}))}}var ao=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(U.useState)(null),i=Object(C.a)(n,2),r=i[0],o=i[1],a=oo(),c=Object(U.useRef)(r);return Object(U.useEffect)((function(){var t=!0,n=new ro(e);return o(n),n.on("transaction",(function(){requestAnimationFrame((function(){requestAnimationFrame((function(){t&&a()}))}))})),function(){n.destroy(),t=!1}}),t),Object(U.useEffect)((function(){c.current=r,r&&(r.current||Object.defineProperty(r,"current",{get:function(){return c.current}}))}),[r]),Object(U.useEffect)((function(){function e(e){if(null===r||void 0===r?void 0:r.view.dragging)return e.preventDefault(),!0}return null===r||void 0===r||r.view.dom.addEventListener("dragenter",e),function(){null===r||void 0===r||r.view.dom.removeEventListener("dragenter",e)}}),[null===r||void 0===r?void 0:r.view.dom]),r},co={premium:["insertImage"]};function lo(e){var t=e.claims,n=e.onPermissionDenied;Object(U.useEffect)((function(){function e(e){var i=e.detail.id;for(var r in co){var o=r;if(!(co[o].indexOf(i)<=-1)&&!t[o]){n(o,i),e.preventDefault();break}}e.preventDefault()}return window.addEventListener("permissionrequest",e),function(){window.removeEventListener("permissionrequest",e)}}),[t,n])}var so=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};P.c.prototype.updateState=function(e){this.docView&&this.updateStateInner(e,this.state.plugins!=e.plugins)};var uo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.theme,u=e.isMobile,O=e.onDownloadAttachment,C=e.onOpenAttachmentPicker,k=e.onBeforeCreate,w=so(e,["theme","isMobile","onDownloadAttachment","onOpenAttachmentPicker","onBeforeCreate"]),S=K(),A=I((function(e){return e.setIsMobile})),L=I((function(e){return e.setTheme}));Object(U.useEffect)((function(){A(u||!1),L(n)}),[u,n]);var R=Object(U.useMemo)((function(){return{extensions:[re,Di,d.a,a.a.configure({dropcursor:!1,codeBlock:!1,listItem:!1,orderedList:!1,bulletList:!1,history:{depth:200,newGroupDelay:1e3}}),Mi.configure({class:"drop-cursor"}),i.a,o.a,l.a,s.a,f,p,b.a,m,h,Ai.configure({nested:!0}),Ri,yr.a.configure({openOnClick:!u}),xr.configure({resizable:!0,allowTableNodeSelection:!0,cellMinWidth:50}),j.a,x,y.a,g.a.configure({multicolor:!0}),nr,v.a,c.a.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"],defaultAlignment:"left"}),r.a.configure({placeholder:"Start writing your note..."}),xi,Ni,oi.configure({onDownloadAttachment:O,onOpenAttachmentPicker:C}),fr,hr,ur,kr,Xr,Kr,Yr,io],onBeforeCreate:function(e){var t=e.editor;t.storage.portalProviderAPI=S,k&&k({editor:t})},injectCSS:!1}}),[O,C,S,k]),T=ao(Object.assign(Object.assign({},R),w),t);return T}},78:function(e){e.exports=JSON.parse('[{"filename":"markup","title":"Markup","alias":["html","xml","svg","mathml","ssml","atom","rss"]},{"filename":"css","title":"CSS"},{"filename":"clike","title":"C-like"},{"filename":"javascript","title":"JavaScript","alias":["js"]},{"filename":"abap","title":"ABAP"},{"filename":"abnf","title":"ABNF"},{"filename":"actionscript","title":"ActionScript"},{"filename":"ada","title":"Ada"},{"filename":"agda","title":"Agda"},{"filename":"al","title":"AL"},{"filename":"antlr4","title":"ANTLR4","alias":["g4"]},{"filename":"apacheconf","title":"Apache Configuration"},{"filename":"apex","title":"Apex"},{"filename":"apl","title":"APL"},{"filename":"applescript","title":"AppleScript"},{"filename":"aql","title":"AQL"},{"filename":"arduino","title":"Arduino","alias":["ino"]},{"filename":"arff","title":"ARFF"},{"filename":"armasm","title":"ARM Assembly","alias":["arm-asm"]},{"filename":"arturo","title":"Arturo","alias":["art"]},{"filename":"asciidoc","title":"AsciiDoc","alias":["adoc"]},{"filename":"aspnet","title":"ASP.NET (C#)"},{"filename":"asm6502","title":"6502 Assembly"},{"filename":"asmatmel","title":"Atmel AVR Assembly"},{"filename":"autohotkey","title":"AutoHotkey"},{"filename":"autoit","title":"AutoIt"},{"filename":"avisynth","title":"AviSynth","alias":["avs"]},{"filename":"avro-idl","title":"Avro IDL","alias":["avdl"]},{"filename":"awk","title":"AWK","alias":["gawk"]},{"filename":"bash","title":"Bash","alias":["shell"]},{"filename":"basic","title":"BASIC"},{"filename":"batch","title":"Batch"},{"filename":"bbcode","title":"BBcode","alias":["shortcode"]},{"filename":"bicep","title":"Bicep"},{"filename":"birb","title":"Birb"},{"filename":"bison","title":"Bison"},{"filename":"bnf","title":"BNF","alias":["rbnf"]},{"filename":"brainfuck","title":"Brainfuck"},{"filename":"brightscript","title":"BrightScript"},{"filename":"bro","title":"Bro"},{"filename":"bsl","title":"BSL (1C:Enterprise)","alias":["oscript"]},{"filename":"c","title":"C"},{"filename":"csharp","title":"C#","alias":["cs","dotnet"]},{"filename":"cpp","title":"C++"},{"filename":"cfscript","title":"CFScript","alias":["cfc"]},{"filename":"chaiscript","title":"ChaiScript"},{"filename":"cil","title":"CIL"},{"filename":"clojure","title":"Clojure"},{"filename":"cmake","title":"CMake"},{"filename":"cobol","title":"COBOL"},{"filename":"coffeescript","title":"CoffeeScript","alias":["coffee"]},{"filename":"concurnas","title":"Concurnas","alias":["conc"]},{"filename":"csp","title":"Content-Security-Policy"},{"filename":"cooklang","title":"Cooklang"},{"filename":"coq","title":"Coq"},{"filename":"crystal","title":"Crystal"},{"filename":"css-extras","title":"CSS Extras"},{"filename":"csv","title":"CSV"},{"filename":"cue","title":"CUE"},{"filename":"cypher","title":"Cypher"},{"filename":"d","title":"D"},{"filename":"dart","title":"Dart"},{"filename":"dataweave","title":"DataWeave"},{"filename":"dax","title":"DAX"},{"filename":"dhall","title":"Dhall"},{"filename":"diff","title":"Diff"},{"filename":"django","title":"Django/Jinja2","alias":["jinja2"]},{"filename":"dns-zone-file","title":"DNS zone file","alias":["dns-zone"]},{"filename":"docker","title":"Docker","alias":["dockerfile"]},{"filename":"dot","title":"DOT (Graphviz)","alias":["gv"]},{"filename":"ebnf","title":"EBNF"},{"filename":"editorconfig","title":"EditorConfig"},{"filename":"eiffel","title":"Eiffel"},{"filename":"ejs","title":"EJS","alias":["eta"]},{"filename":"elixir","title":"Elixir"},{"filename":"elm","title":"Elm"},{"filename":"etlua","title":"Embedded Lua templating"},{"filename":"erb","title":"ERB"},{"filename":"erlang","title":"Erlang"},{"filename":"excel-formula","title":"Excel Formula","alias":["xlsx","xls"]},{"filename":"fsharp","title":"F#"},{"filename":"factor","title":"Factor"},{"filename":"false","title":"False"},{"filename":"firestore-security-rules","title":"Firestore security rules"},{"filename":"flow","title":"Flow"},{"filename":"fortran","title":"Fortran"},{"filename":"ftl","title":"FreeMarker Template Language"},{"filename":"gml","title":"GameMaker Language","alias":["gamemakerlanguage"]},{"filename":"gap","title":"GAP (CAS)"},{"filename":"gcode","title":"G-code"},{"filename":"gdscript","title":"GDScript"},{"filename":"gedcom","title":"GEDCOM"},{"filename":"gettext","title":"gettext","alias":["po"]},{"filename":"gherkin","title":"Gherkin"},{"filename":"git","title":"Git"},{"filename":"glsl","title":"GLSL"},{"filename":"gn","title":"GN","alias":["gni"]},{"filename":"linker-script","title":"GNU Linker Script","alias":["ld"]},{"filename":"go","title":"Go"},{"filename":"go-module","title":"Go module","alias":["go-mod"]},{"filename":"gradle","title":"Gradle"},{"filename":"graphql","title":"GraphQL"},{"filename":"groovy","title":"Groovy"},{"filename":"haml","title":"Haml"},{"filename":"handlebars","title":"Handlebars","alias":["hbs","mustache"]},{"filename":"haskell","title":"Haskell","alias":["hs"]},{"filename":"haxe","title":"Haxe"},{"filename":"hcl","title":"HCL"},{"filename":"hlsl","title":"HLSL"},{"filename":"hoon","title":"Hoon"},{"filename":"http","title":"HTTP"},{"filename":"hpkp","title":"HTTP Public-Key-Pins"},{"filename":"hsts","title":"HTTP Strict-Transport-Security"},{"filename":"ichigojam","title":"IchigoJam"},{"filename":"icon","title":"Icon"},{"filename":"icu-message-format","title":"ICU Message Format"},{"filename":"idris","title":"Idris","alias":["idr"]},{"filename":"ignore","title":".ignore","alias":["gitignore","hgignore","npmignore"]},{"filename":"inform7","title":"Inform 7"},{"filename":"ini","title":"Ini"},{"filename":"io","title":"Io"},{"filename":"j","title":"J"},{"filename":"java","title":"Java"},{"filename":"javadoc","title":"JavaDoc"},{"filename":"javadoclike","title":"JavaDoc-like"},{"filename":"javastacktrace","title":"Java stack trace"},{"filename":"jexl","title":"Jexl"},{"filename":"jolie","title":"Jolie"},{"filename":"jq","title":"JQ"},{"filename":"jsdoc","title":"JSDoc"},{"filename":"js-extras","title":"JS Extras"},{"filename":"json","title":"JSON","alias":["webmanifest"]},{"filename":"json5","title":"JSON5"},{"filename":"jsonp","title":"JSONP"},{"filename":"jsstacktrace","title":"JS stack trace"},{"filename":"js-templates","title":"JS Templates"},{"filename":"julia","title":"Julia"},{"filename":"keepalived","title":"Keepalived Configure"},{"filename":"keyman","title":"Keyman"},{"filename":"kotlin","title":"Kotlin","alias":["kt","kts"]},{"filename":"kumir","title":"KuMir (\u041a\u0443\u041c\u0438\u0440)","alias":["kum"]},{"filename":"kusto","title":"Kusto"},{"filename":"latex","title":"LaTeX","alias":["tex","context"]},{"filename":"latte","title":"Latte"},{"filename":"less","title":"Less"},{"filename":"lilypond","title":"LilyPond","alias":["ly"]},{"filename":"liquid","title":"Liquid"},{"filename":"lisp","title":"Lisp","alias":["emacs","elisp","emacs-lisp"]},{"filename":"livescript","title":"LiveScript"},{"filename":"llvm","title":"LLVM IR"},{"filename":"log","title":"Log file"},{"filename":"lolcode","title":"LOLCODE"},{"filename":"lua","title":"Lua"},{"filename":"magma","title":"Magma (CAS)"},{"filename":"makefile","title":"Makefile"},{"filename":"markdown","title":"Markdown","alias":["md"]},{"filename":"markup-templating","title":"Markup templating"},{"filename":"mata","title":"Mata"},{"filename":"matlab","title":"MATLAB"},{"filename":"maxscript","title":"MAXScript"},{"filename":"mel","title":"MEL"},{"filename":"mermaid","title":"Mermaid"},{"filename":"mizar","title":"Mizar"},{"filename":"mongodb","title":"MongoDB"},{"filename":"monkey","title":"Monkey"},{"filename":"moonscript","title":"MoonScript","alias":["moon"]},{"filename":"n1ql","title":"N1QL"},{"filename":"n4js","title":"N4JS","alias":["n4jsd"]},{"filename":"nand2tetris-hdl","title":"Nand To Tetris HDL"},{"filename":"naniscript","title":"Naninovel Script","alias":["nani"]},{"filename":"nasm","title":"NASM"},{"filename":"neon","title":"NEON"},{"filename":"nevod","title":"Nevod"},{"filename":"nginx","title":"nginx"},{"filename":"nim","title":"Nim"},{"filename":"nix","title":"Nix"},{"filename":"nsis","title":"NSIS"},{"filename":"objectivec","title":"Objective-C","alias":["objc"]},{"filename":"ocaml","title":"OCaml"},{"filename":"odin","title":"Odin"},{"filename":"opencl","title":"OpenCL"},{"filename":"openqasm","title":"OpenQasm","alias":["qasm"]},{"filename":"oz","title":"Oz"},{"filename":"parigp","title":"PARI/GP"},{"filename":"parser","title":"Parser"},{"filename":"pascal","title":"Pascal","alias":["objectpascal"]},{"filename":"pascaligo","title":"Pascaligo"},{"filename":"psl","title":"PATROL Scripting Language"},{"filename":"pcaxis","title":"PC-Axis","alias":["px"]},{"filename":"peoplecode","title":"PeopleCode","alias":["pcode"]},{"filename":"perl","title":"Perl"},{"filename":"php","title":"PHP"},{"filename":"phpdoc","title":"PHPDoc"},{"filename":"php-extras","title":"PHP Extras"},{"filename":"plant-uml","title":"PlantUML","alias":["plantuml"]},{"filename":"plsql","title":"PL/SQL"},{"filename":"powerquery","title":"PowerQuery","alias":["pq","mscript"]},{"filename":"powershell","title":"PowerShell"},{"filename":"processing","title":"Processing"},{"filename":"prolog","title":"Prolog"},{"filename":"promql","title":"PromQL"},{"filename":"properties","title":".properties"},{"filename":"protobuf","title":"Protocol Buffers"},{"filename":"pug","title":"Pug"},{"filename":"puppet","title":"Puppet"},{"filename":"pure","title":"Pure"},{"filename":"purebasic","title":"PureBasic","alias":["pbfasm"]},{"filename":"purescript","title":"PureScript","alias":["purs"]},{"filename":"python","title":"Python","alias":["py"]},{"filename":"qsharp","title":"Q#","alias":["qs"]},{"filename":"q","title":"Q (kdb+ database)"},{"filename":"qml","title":"QML"},{"filename":"qore","title":"Qore"},{"filename":"r","title":"R"},{"filename":"racket","title":"Racket","alias":["rkt"]},{"filename":"cshtml","title":"Razor C#","alias":["razor"]},{"filename":"jsx","title":"React JSX"},{"filename":"tsx","title":"React TSX"},{"filename":"reason","title":"Reason"},{"filename":"regex","title":"Regex"},{"filename":"rego","title":"Rego"},{"filename":"renpy","title":"Ren\'py","alias":["rpy"]},{"filename":"rescript","title":"ReScript","alias":["res"]},{"filename":"rest","title":"reST (reStructuredText)"},{"filename":"rip","title":"Rip"},{"filename":"roboconf","title":"Roboconf"},{"filename":"robotframework","title":"Robot Framework","alias":["robot"]},{"filename":"ruby","title":"Ruby","alias":["rb"]},{"filename":"rust","title":"Rust"},{"filename":"sas","title":"SAS"},{"filename":"sass","title":"Sass (Sass)"},{"filename":"scss","title":"Sass (Scss)"},{"filename":"scala","title":"Scala"},{"filename":"scheme","title":"Scheme"},{"filename":"shell-session","title":"Shell session","alias":["sh-session","shellsession"]},{"filename":"smali","title":"Smali"},{"filename":"smalltalk","title":"Smalltalk"},{"filename":"smarty","title":"Smarty"},{"filename":"sml","title":"SML","alias":["smlnj"]},{"filename":"solidity","title":"Solidity (Ethereum)","alias":["sol"]},{"filename":"solution-file","title":"Solution file","alias":["sln"]},{"filename":"soy","title":"Soy (Closure Template)"},{"filename":"sparql","title":"SPARQL","alias":["rq"]},{"filename":"splunk-spl","title":"Splunk SPL"},{"filename":"sqf","title":"SQF: Status Quo Function (Arma 3)"},{"filename":"sql","title":"SQL"},{"filename":"squirrel","title":"Squirrel"},{"filename":"stan","title":"Stan"},{"filename":"stata","title":"Stata Ado"},{"filename":"iecst","title":"Structured Text (IEC 61131-3)"},{"filename":"stylus","title":"Stylus"},{"filename":"supercollider","title":"SuperCollider","alias":["sclang"]},{"filename":"swift","title":"Swift"},{"filename":"systemd","title":"Systemd configuration file"},{"filename":"t4-templating","title":"T4 templating"},{"filename":"t4-cs","title":"T4 Text Templates (C#)","alias":["t4"]},{"filename":"t4-vb","title":"T4 Text Templates (VB)"},{"filename":"tap","title":"TAP"},{"filename":"tcl","title":"Tcl"},{"filename":"tt2","title":"Template Toolkit 2"},{"filename":"textile","title":"Textile"},{"filename":"toml","title":"TOML"},{"filename":"tremor","title":"Tremor","alias":["trickle","troy"]},{"filename":"turtle","title":"Turtle","alias":["trig"]},{"filename":"twig","title":"Twig"},{"filename":"typescript","title":"TypeScript","alias":["ts"]},{"filename":"typoscript","title":"TypoScript","alias":["tsconfig"]},{"filename":"unrealscript","title":"UnrealScript","alias":["uscript","uc"]},{"filename":"uorazor","title":"UO Razor Script"},{"filename":"uri","title":"URI","alias":["url"]},{"filename":"v","title":"V"},{"filename":"vala","title":"Vala"},{"filename":"vbnet","title":"VB.Net"},{"filename":"velocity","title":"Velocity"},{"filename":"verilog","title":"Verilog"},{"filename":"vhdl","title":"VHDL"},{"filename":"vim","title":"vim"},{"filename":"visual-basic","title":"Visual Basic","alias":["vb","vba"]},{"filename":"warpscript","title":"WarpScript"},{"filename":"wasm","title":"WebAssembly"},{"filename":"web-idl","title":"Web IDL","alias":["webidl"]},{"filename":"wgsl","title":"WGSL"},{"filename":"wiki","title":"Wiki markup"},{"filename":"wolfram","title":"Wolfram language","alias":["mathematica","nb","wl"]},{"filename":"wren","title":"Wren"},{"filename":"xeora","title":"Xeora","alias":["xeoracube"]},{"filename":"xml-doc","title":"XML doc (.net)"},{"filename":"xojo","title":"Xojo (REALbasic)"},{"filename":"xquery","title":"XQuery"},{"filename":"yaml","title":"YAML","alias":["yml"]},{"filename":"yang","title":"YANG"},{"filename":"zig","title":"Zig"}]')},95:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(140),r=n.n(i),o=n(22);function a(e){var t=document.getElementById("variables-nn"),n=document.getElementsByTagName("head")[0];t&&n.removeChild(t);var i=document.createElement("style");i.type="text/css",i.id="variables-nn",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),n.insertBefore(i,function(){var e,t=Object(o.a)(document.getElementsByTagName("style"));try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.innerHTML.includes("#root"))return n}}catch(i){t.e(i)}finally{t.f()}}())}function c(e){var t=":root {";for(var n in e)t+="--nn_".concat(n,": ").concat(e[n],";");return t+"}"}var l={accent:"#008837",shade:"#00883712",fg:"#008837",normal:"black",icon:"gray",transGray:"#00000010",errorBg:"#FFB6C1",errorText:"#ff6961",successBg:"#DFF2BF",successText:"#4F8A10",warningBg:"#FF990020",warningText:"#FF9900",red:"#f44336",orange:"#FF9800",yellow:"#FFD600",green:"#4CAF50",blue:"#2196F3",purple:"#673AB7",gray:"#9E9E9E",discord:"#5865F2",night:!1,bg:"#ffffff",navbg:"#f7f7f7",nav:"#f7f7f7",pri:"#424242",sec:"white",light:"#ffffff",input:"transparent",heading:"#212121",border:"#E8E8E8",placeholder:"#a9a9a9"};a(c(l));var s=r()((function(e,t){return{colors:l,setColors:function(t){a(c(t)),e({colors:t})}}}))}},[[201,2,3]]]);\ No newline at end of file