@bigbinary/neeto-editor 0.3.18 → 0.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/index.js +1 -1
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -73,4 +73,4 @@ function _c(e,t){if(!e)throw new Error(t)}const dc=Object(p.createContext)(null)
73
73
  *
74
74
  * Licensed under the MIT license.
75
75
  */
76
- var bg="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Eg(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){i(window.event)}))}function yg(e,t){for(var i=t.slice(0,t.length-1),a=0;a<i.length;a++)i[a]=e[i[a].toLowerCase()];return i}function Dg(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),i=t.lastIndexOf("");i>=0;)t[i-1]+=",",t.splice(i,1),i=t.lastIndexOf("");return t}for(var vg={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":bg?173:189,"=":bg?61:187,";":bg?59:186,"'":222,"[":219,"]":221,"\\":220},kg={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Sg={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},wg={16:!1,18:!1,17:!1,91:!1},Cg={},xg=1;xg<20;xg++)vg["f".concat(xg)]=111+xg;var Tg=[],Og="all",Ng=[],Ag=function(e){return vg[e.toLowerCase()]||kg[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Rg(e){Og=e||"all"}function Mg(){return Og||"all"}var Ig=function(e){var t=e.key,i=e.scope,a=e.method,n=e.splitKey,r=void 0===n?"+":n;Dg(t).forEach((function(e){var t=e.split(r),n=t.length,o=t[n-1],s="*"===o?"*":Ag(o);if(Cg[s]){i||(i=Mg());var l=n>1?yg(kg,t):[];Cg[s]=Cg[s].map((function(e){return(!a||e.method===a)&&e.scope===i&&function(e,t){for(var i=e.length>=t.length?e:t,a=e.length>=t.length?t:e,n=!0,r=0;r<i.length;r++)-1===a.indexOf(i[r])&&(n=!1);return n}(e.mods,l)?{}:e}))}}))};function Bg(e,t,i){var a;if(t.scope===i||"all"===t.scope){for(var n in a=t.mods.length>0,wg)Object.prototype.hasOwnProperty.call(wg,n)&&(!wg[n]&&t.mods.indexOf(+n)>-1||wg[n]&&-1===t.mods.indexOf(+n))&&(a=!1);(0!==t.mods.length||wg[16]||wg[18]||wg[17]||wg[91])&&!a&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Lg(e){var t=Cg["*"],i=e.keyCode||e.which||e.charCode;if(Pg.filter.call(this,e)){if(93!==i&&224!==i||(i=91),-1===Tg.indexOf(i)&&229!==i&&Tg.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var i=Sg[t];e[t]&&-1===Tg.indexOf(i)?Tg.push(i):!e[t]&&Tg.indexOf(i)>-1?Tg.splice(Tg.indexOf(i),1):"metaKey"===t&&e[t]&&3===Tg.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Tg=Tg.slice(Tg.indexOf(i))))})),i in wg){for(var a in wg[i]=!0,kg)kg[a]===i&&(Pg[a]=!0);if(!t)return}for(var n in wg)Object.prototype.hasOwnProperty.call(wg,n)&&(wg[n]=e[Sg[n]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Tg.indexOf(17)&&Tg.push(17),-1===Tg.indexOf(18)&&Tg.push(18),wg[17]=!0,wg[18]=!0);var r=Mg();if(t)for(var o=0;o<t.length;o++)t[o].scope===r&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&Bg(e,t[o],r);if(i in Cg)for(var s=0;s<Cg[i].length;s++)if(("keydown"===e.type&&Cg[i][s].keydown||"keyup"===e.type&&Cg[i][s].keyup)&&Cg[i][s].key){for(var l=Cg[i][s],u=l.splitKey,_=l.key.split(u),d=[],c=0;c<_.length;c++)d.push(Ag(_[c]));d.sort().join("")===Tg.sort().join("")&&Bg(e,l,r)}}}function Pg(e,t,i){Tg=[];var a=Dg(e),n=[],r="all",o=document,s=0,l=!1,u=!0,_="+";for(void 0===i&&"function"==typeof t&&(i=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(r=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(_=t.splitKey)),"string"==typeof t&&(r=t);s<a.length;s++)n=[],(e=a[s].split(_)).length>1&&(n=yg(kg,e)),(e="*"===(e=e[e.length-1])?"*":Ag(e))in Cg||(Cg[e]=[]),Cg[e].push({keyup:l,keydown:u,scope:r,mods:n,shortcut:a[s],method:i,key:a[s],splitKey:_});void 0!==o&&!function(e){return Ng.indexOf(e)>-1}(o)&&window&&(Ng.push(o),Eg(o,"keydown",(function(e){Lg(e)})),Eg(window,"focus",(function(){Tg=[]})),Eg(o,"keyup",(function(e){Lg(e),function(e){var t=e.keyCode||e.which||e.charCode,i=Tg.indexOf(t);if(i>=0&&Tg.splice(i,1),e.key&&"meta"===e.key.toLowerCase()&&Tg.splice(0,Tg.length),93!==t&&224!==t||(t=91),t in wg)for(var a in wg[t]=!1,kg)kg[a]===t&&(Pg[a]=!1)}(e)})))}var jg={setScope:Rg,getScope:Mg,deleteScope:function(e,t){var i,a;for(var n in e||(e=Mg()),Cg)if(Object.prototype.hasOwnProperty.call(Cg,n))for(i=Cg[n],a=0;a<i.length;)i[a].scope===e?i.splice(a,1):a++;Mg()===e&&Rg(t||"all")},getPressedKeyCodes:function(){return Tg.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=Ag(e)),-1!==Tg.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,i=t.tagName,a=!0;return!t.isContentEditable&&("INPUT"!==i&&"TEXTAREA"!==i&&"SELECT"!==i||t.readOnly)||(a=!1),a},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&Ig(e)}));else if("object"==typeof e)e.key&&Ig(e);else if("string"==typeof e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];var n=i[0],r=i[1];"function"==typeof n&&(r=n,n=""),Ig({key:e,scope:n,method:r,splitKey:"+"})}}else Object.keys(Cg).forEach((function(e){return delete Cg[e]}))}};for(var qg in jg)Object.prototype.hasOwnProperty.call(jg,qg)&&(Pg[qg]=jg[qg]);if("undefined"!=typeof window){var Ug=window.hotkeys;Pg.noConflict=function(e){return e&&window.hotkeys===Pg&&(window.hotkeys=Ug),Pg},window.hotkeys=Pg}var zg=Pg;zg.filter=function(){return!0};var Gg=function(e,t){var i=e.target,a=i&&i.tagName;return Boolean(a&&t&&t.includes(a))};function Hg(e,t,i,a){i instanceof Array&&(a=i,i=void 0);var n=i||{},r=n.enableOnTags,o=n.filter,s=n.keyup,l=n.keydown,u=n.filterPreventDefault,_=void 0===u||u,d=n.enabled,c=void 0===d||d,g=n.enableOnContentEditable,f=void 0!==g&&g,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,i){var a;return o&&!o(e)?!_:!!(Gg(e,["INPUT","TEXTAREA","SELECT"])&&!Gg(e,r)||null!=(a=e.target)&&a.isContentEditable&&!f)||(null===h.current||document.activeElement===h.current)&&(t(e,i),!0)}),a?[h,r,o].concat(a):[h,r,o]);return Object(p.useEffect)((function(){if(c)return s&&!0!==l&&(i.keydown=!1),zg(e,i||{},m),function(){return zg.unbind(e,m)};zg.unbind(e,m)}),[m,e,c]),h}zg.isPressed;var Yg=function(e,t){Object(p.useEffect)((function(){var i=function(i){e.current&&!e.current.contains(i.target)&&t(i)};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),function(){document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}),[e,t])},Vg=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function Wg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function $g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wg(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Wg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Kg=function(){},Qg=Object(p.forwardRef)((function(e,t){e.icon;var i=e.label,a=e.isOpen,n=e.onVisible,r=void 0===n?Kg:n,o=e.onClose,s=void 0===o?Kg:o,l=e.ulProps,_=e.position,c=e.children,f=e.className,F=(e.buttonStyle,e.buttonProps),E=e.customTarget,y=(e.disabled,e.closeOnEsc),D=void 0===y||y,v=e.closeOnSelect,k=void 0===v||v,S=e.closeOnOutsideClick,w=void 0===S||S,C=e.dropdownModifiers,x=void 0===C?[]:C,T=h()(e,Vg),O=Object(p.useRef)(),N=E(),A=!(null==a),R=Object(p.useState)(!1),M=g()(R,2),I=M[0],B=M[1],L=Object(p.useState)(null),P=g()(L,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=g()(U,2),G=z[0],H=z[1],Y=function(e,t,i){void 0===i&&(i={});var a=p.useRef(null),n={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||pg},r=p.useState({styles:{popper:{position:n.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=r[0],s=r[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,i=Object.keys(t.elements);s({styles:fg(i.map((function(e){return[e,t.styles[e]||{}]}))),attributes:fg(i.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:n.onFirstUpdate,placement:n.placement,strategy:n.strategy,modifiers:[].concat(n.modifiers,[l,{name:"applyStyles",enabled:!1}])};return gg()(a.current,e)?a.current||e:(a.current=e,e)}),[n.onFirstUpdate,n.placement,n.strategy,n.modifiers,l]),_=p.useRef();return hg((function(){_.current&&_.current.setOptions(u)}),[u]),hg((function(){if(null!=e&&null!=t){var a=(i.createPopper||wl)(e,t,u);return _.current=a,function(){a.destroy(),_.current=null}}}),[e,t,i.createPopper]),{state:_.current?_.current.state:null,styles:o.styles,attributes:o.attributes,update:_.current?_.current.update:null,forceUpdate:_.current?_.current.forceUpdate:null}}(j,G,{placement:_||"bottom-end",modifiers:x}),V=Y.styles,W=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:I}}));var $=function(){A||B(!1),s()},K=function(){!A&&B(!I)};return D&&Hg("esc",$),w&&Yg(O,$),A||(F=$g($g({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&B(a)}),[a]),Object(p.useEffect)((function(){I&&r()}),[I]),m.a.createElement("div",u()({ref:O,className:b()("ne-dropdown__wrapper",d()({},f,f))},T),E?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,i,m.a.createElement(Fg,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:H,onClick:function(){k&&$()},"data-cy":"neeto-editor-".concat(ic(i),"-dropdown-container")},l,{style:$g($g({display:"block"},V.offset),V.popper)},W.popper),c))})),Zg=function(e){var t=e.editor;return m.a.createElement(Qg,{customTarget:function(){return m.a.createElement(ng,{icon:dg,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var i,a=e.label,n=e.value;return m.a.createElement("li",{onClick:function(){return e=n,t.chain().focus().toggleHeading({level:e}).run();var e},key:n,className:b()({active:(i=n,t.isActive("heading",{level:i}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(a)},a)})))};function Xg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Jg(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Xg(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var ef=function(e){var t=e.onClickVariable,i=e.variables,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=[];return e.forEach((function(e){var a=e.category_key,n=e.category_label,r=e.variables;if(a&&r){var o=r.map((function(e){return Jg(Jg({},e),{},{category_key:a})}));i.push({label:n,variables:o})}else t.push(e)})),t.length&&i.push({label:i.length?"Others":null,variables:t}),i}(i);return i&&i.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},a.map((function(e,i){var a=e.label,n=e.variables;return m.a.createElement(tf,{key:i,index:i,title:a,variables:n,onClickItem:t})}))):null},tf=function(e){var t=e.index,i=e.title,a=e.variables,n=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},i&&m.a.createElement("h6",null,i),m.a.createElement("div",{className:"neeto-editor-variables-row"},a.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return n(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},af=["color"],nf=function(e){var t=e.editor,i=e.variables;return i&&i.length?m.a.createElement(Qg,{customTarget:function(){return m.a.createElement(ng,{icon:function(e){e.color;var t=h()(e,af);return m.a.createElement(lg,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(ef,{onClickVariable:function(e){var i=e.category_key,a=e.key,n=i?"".concat(i,".").concat(a):a;t.chain().focus().setVariable({label:n}).run()},variables:i})):null},rf=["size","color","strokeWidth"];function of(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,rf);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M17 21H12C10.22 21 8.47991 20.4722 6.99987 19.4832C5.51983 18.4943 4.36628 17.0887 3.68509 15.4442C3.0039 13.7996 2.82567 11.99 3.17294 10.2442C3.5202 8.49836 4.37737 6.89472 5.63604 5.63604C6.89472 4.37737 8.49836 3.5202 10.2442 3.17294C11.99 2.82567 13.7996 3.0039 15.4442 3.68509C17.0887 4.36628 18.4943 5.51983 19.4832 6.99987C20.4722 8.47991 21 10.22 21 12V13.5C21 14.163 20.7366 14.7989 20.2678 15.2678C19.7989 15.7366 19.163 16 18.5 16C17.837 16 17.2011 15.7366 16.7322 15.2678C16.2634 14.7989 16 14.163 16 13.5V12C16 10.9391 15.5786 9.92172 14.8284 9.17158C14.0783 8.42143 13.0609 8 12 8V8C11.2089 8 10.4355 8.2346 9.77772 8.67413C9.11993 9.11365 8.60724 9.73837 8.30449 10.4693C8.00174 11.2002 7.92252 12.0044 8.07686 12.7804C8.2312 13.5563 8.61217 14.269 9.17158 14.8284C9.73099 15.3878 10.4437 15.7688 11.2196 15.9231C11.9956 16.0775 12.7998 15.9983 13.5307 15.6955C14.2616 15.3928 14.8864 14.8801 15.3259 14.2223C15.7654 13.5645 16 12.7911 16 12",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}of.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},of.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var sf=["size","user","isSquare","status","onClick","className"],lf={small:24,medium:32,large:40,xlarge:64},uf=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function _f(e){var t,i,a=e.size,n=e.user,r=e.isSquare,o=e.status,s=e.onClick,l=e.className,_=h()(e,sf),d=Object(p.useState)(!1),c=g()(d,2),f=c[0],F=c[1],E=n.name,y=void 0===E?"":E,D=n.imageUrl,v="medium"===a,k="large"===a,S="xlarge"===a,w=(t=y.trim().split(" ")).reduce((function(e,i,a){return 0!==a&&a!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),C={height:lf[a],width:lf[a],backgroundColor:(i=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),uf[i%65%uf.length]||uf[0])},x=b()("ne-avatar",{"ne-avatar--medium":v,"ne-avatar--large":k,"ne-avatar--xlarge":S,"ne-avatar--round":!r,hidden:!f}),T=b()("ne-avatar__text",{"ne-avatar__text-medium":v,"ne-avatar__text-large":k,"ne-avatar__text-xlarge":S}),O=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":v,"ne-avatar__status-large":k,"ne-avatar__status-xlarge":S,"ne-avatar__status-square":r}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:O})},A=function(){return m.a.createElement("span",{className:T},w)},R=w&&!D&&!f;return m.a.createElement("div",u()({onClick:s,style:C,className:b()("ne-avatar--container",{"ne-avatar--container-round":!r},l)},_),m.a.createElement(N,null),R?m.a.createElement(A,null):m.a.createElement("img",{className:x,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:D,alt:"avatar-".concat(w)}))}_f.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},_f.propTypes={size:tg.a.oneOf(Object.keys(lf)),user:tg.a.shape({imageUrl:tg.a.string,name:tg.a.string}),isSquare:tg.a.bool,onClick:tg.a.func,status:tg.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:tg.a.string};var df=_f,cf=function(e){var t=e.editor,i=e.mentions,a=e.showImageInMention,n=Object(p.useRef)();return i&&i.length?m.a.createElement(Qg,{ref:n,customTarget:function(){var e;return m.a.createElement(ng,{icon:of,iconActive:null===(e=n.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},i.map((function(e){var i="string"==typeof e?e:e.label,n="string"==typeof e?"":e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:i,onClick:function(){return t.commands.setMention(i)},type:"button","data-cy":"neeto-editor-mention-option-".concat(e.label)},a&&m.a.createElement(df,{size:"small",user:{name:i,imageUrl:n}}),m.a.createElement("p",null,i))})))):null},gf=["size","color","strokeWidth"];function ff(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,gf);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M11.009 11.249H12.159V15.499",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M11 15.4986H13.3093",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M12.1 8.24587C12.1 8.29532 12.0853 8.34365 12.0579 8.38477C12.0304 8.42588 11.9914 8.45792 11.9457 8.47684C11.9 8.49576 11.8497 8.50071 11.8012 8.49107C11.7527 8.48142 11.7082 8.45761 11.6732 8.42265C11.6383 8.38769 11.6145 8.34314 11.6048 8.29464C11.5952 8.24615 11.6001 8.19588 11.619 8.1502C11.638 8.10452 11.67 8.06548 11.7111 8.03801C11.7522 8.01053 11.8006 7.99587 11.85 7.99587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M11.85 7.99587C11.9163 7.99587 11.9799 8.02221 12.0268 8.0691C12.0737 8.11598 12.1 8.17957 12.1 8.24587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M16 2.99862H8C5.23858 2.99862 3 5.2372 3 7.99862V15.9986C3 18.76 5.23858 20.9986 8 20.9986H16C18.7614 20.9986 21 18.76 21 15.9986V7.99862C21 5.2372 18.7614 2.99862 16 2.99862Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}ff.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},ff.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var hf=["children","className","required","helpIconProps"],pf=["onClick","icon","tooltipProps","className"],mf=function(e){var t=e.children,i=e.className,a=void 0===i?"":i,n=e.required,r=void 0!==n&&n,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,hf),_=s||{},c=_.onClick,g=_.icon,f=_.tooltipProps,p=_.className,F=h()(_,pf),E=g||ff;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",a)},l),t,r&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(xd,u()({},f,{disabled:!f}),m.a.createElement("span",{className:b()("ml-1",d()({},p,p)),onClick:c},m.a.createElement(E,u()({size:16},F)))))},Ff=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],bf=Object(p.forwardRef)((function(e,t){var i=e.id,a=e.size,n=void 0===a?"small":a,r=e.type,o=void 0===r?"text":r,s=e.label,l=e.error,_=void 0===l?null:l,d=e.suffix,c=void 0===d?null:d,g=e.prefix,f=void 0===g?null:g,p=e.disabled,F=void 0!==p&&p,E=e.helpText,y=void 0===E?"":E,D=e.className,v=void 0===D?"":D,k=e.nakedInput,S=void 0!==k&&k,w=e.contentSize,C=void 0===w?null:w,x=e.required,T=void 0!==x&&x,O=h()(e,Ff);return m.a.createElement("div",{className:b()(["ne-input__wrapper",v])},s&&m.a.createElement(mf,{required:T,"data-cy":"neeto-editor-".concat(ic(s),"-input-label"),htmlFor:i},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!S,"ne-input--error":!!_,"ne-input--disabled":!!F,"ne-input--small":"small"===n})},f&&m.a.createElement("div",{className:"ne-input__prefix"},f),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:C,required:T,"aria-invalid":!!_,"data-cy":"".concat(ic(s),"-input-field")},O)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!_&&m.a.createElement("p",{"data-cy":"".concat(ic(s),"-input-error"),className:"ne-input__error"},_),y&&m.a.createElement("p",{className:"ne-input__help-text"},y))}));bf.displayName="Input";var Ef=bf,yf=function(e){var t=e.editor,i=Object(p.useRef)(),a=Object(p.useRef)(),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(""),u=g()(l,2),_=u[0],d=u[1],c=t.isActive("link"),f=function(){d(t.getAttributes("link").href||"")},h=function(){var e;qc.test(_)?(t.chain().focus().setLink({href:_}).run(),null===(e=i.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(Qg,{ref:i,onVisible:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(ng,{icon:sd,iconActive:c,onClick:f,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(Ef,{ref:a,name:"url",value:_,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return d(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(jc,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),c&&m.a.createElement(jc,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},Df=["size","color","strokeWidth"];function vf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Df);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M12 3C7.037 3 3 7.037 3 12C3 16.963 7.037 21 12 21C16.963 21 21 16.962 21 12C21 7.038 16.962 3 12 3Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M15.5006 15.688C15.5006 15.688 14.1876 17 12.0006 17C9.81263 17 8.50063 15.688 8.50063 15.688M15.3286 9.5C15.1906 9.5 15.0786 9.612 15.0796 9.75C15.0796 9.888 15.1916 10 15.3296 10C15.4676 10 15.5796 9.888 15.5796 9.75C15.5796 9.612 15.4676 9.5 15.3286 9.5ZM8.63963 9.5C8.50163 9.5 8.38963 9.612 8.39063 9.75C8.39063 9.888 8.50263 10 8.64063 10C8.77863 10 8.89063 9.888 8.89063 9.75C8.89063 9.612 8.77863 9.5 8.63963 9.5Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}vf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},vf.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var kf=i(20),Sf=i.n(kf),wf=i(21),Cf=i.n(wf),xf=i(14),Tf=i.n(xf),Of=i(22),Nf=i.n(Of),Af=i(23),Rf=i.n(Af),Mf=i(17),If=i.n(Mf),Bf=i(31),Lf=i(9),Pf=i.n(Lf),jf=i(10),qf=i.n(jf),Uf=i(46),zf=i.n(Uf),Gf={name:"a",unified:"b",non_qualified:"c",has_img_apple:"d",has_img_google:"e",has_img_twitter:"f",has_img_facebook:"h",keywords:"j",sheet:"k",emoticons:"l",text:"m",short_names:"n",added_in:"o"},Hf=function(e){var t=[],i=function(e,i){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(i?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return i(e.short_names,!0),i(e.name,!0),i(e.keywords,!1),i(e.emoticons,!1),t.join(",")},Yf=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var a in Gf)i[a]=i[Gf[a]],delete i[Gf[a]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=Hf(i)}},Vf=String.fromCodePoint||function(){var e,t,i=16384,a=[],n=-1,r=arguments.length;if(!r)return"";for(var o="";++n<r;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?a.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,a.push(e,t)),(n+1===r||a.length>i)&&(o+=String.fromCharCode.apply(null,a),a.length=0)}return o},Wf=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,$f=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Kf(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return Vf.apply(null,t)}function Qf(e){var t=e.name,i=e.short_names,a=e.skin_tone,n=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,_=e.id||i[0],d=":".concat(_,":");return s?{id:_,name:t,short_names:i,colons:d,emoticons:r,custom:s,customCategory:l,imageUrl:u}:(a&&(d+=":skin-tone-".concat(a,":")),{id:_,name:t,short_names:i,colons:d,emoticons:r,unified:o.toLowerCase(),skin:a||(n?1:null),native:Kf(o)})}function Zf(){return Qf(Xf.apply(void 0,arguments))}function Xf(e,t,i,a){var n={};if("string"==typeof e){var r=e.match(Wf);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),a.aliases.hasOwnProperty(e)&&(e=a.aliases[e]),!a.emojis.hasOwnProperty(e))return null;n=a.emojis[e]}else e.id&&(a.aliases.hasOwnProperty(e.id)&&(e.id=a.aliases[e.id]),a.emojis.hasOwnProperty(e.id)&&(n=a.emojis[e.id],t||(t=e.skin)));if(Object.keys(n).length||((n=e).custom=!0,n.search||(n.search=Hf(e))),n.emoticons||(n.emoticons=[]),n.variations||(n.variations=[]),n.skin_variations&&t>1){n=JSON.parse(JSON.stringify(n));var o=$f[t-1],s=n.skin_variations[o];if(s&&(!s.variations&&n.variations&&delete n.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in n.skin_tone=t,s){var u=s[l];n[l]=u}}return n.variations&&n.variations.length&&((n=JSON.parse(JSON.stringify(n))).unified=n.variations.shift()),n}function Jf(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function eh(e,t){var i=Jf(e),a=Jf(t);return i.filter((function(e){return a.indexOf(e)>=0}))}function th(e,t){var i={};for(var a in e){var n=e[a],r=n;t.hasOwnProperty(a)&&(r=t[a]),"object"===zf()(r)&&(r=th(n,r)),i[a]=r}return i}var ih,ah,nh="emoji-mart",rh="undefined"!=typeof window&&"localStorage"in window;function oh(e,t){if(ah)ah(e,t);else{if(!rh)return;try{window.localStorage["".concat(nh,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var sh={update:function(e){for(var t in e){oh(t,e[t])}},set:oh,get:function(e){if(ih)return ih(e);if(rh)try{var t=window.localStorage["".concat(nh,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){nh=e},setHandlers:function(e){e||(e={}),ih=e.getter,ah=e.setter}},lh=function(){function e(t,i){Pf()(this,e),t.compressed&&Yf(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return qf()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],a=i.short_names,n=i.emoticons,r=i.skin_variations,o=a[0];if(n&&n.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Zf({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Zf(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var a=i.id||i.short_names[0];delete e[a],delete t.emojis[a]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var a=e.id||e.short_names[0];a&&!t[a]&&(t[a]=Xf(e,null,null,i.data),i.emojis[a]=Zf(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.emojisToShowFilter,n=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=sh.get("skin")||1;n||(n=75),r||(r=[]),o||(o=[]);var _=null,d=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var c=e.toLowerCase().split(/[\s|,|\-|_]+/),g=[];if(c.length>2&&(c=[c[0],c[1]]),(r.length||o.length)&&(d={},this.data.categories.forEach((function(e){var i=!r||!r.length||r.indexOf(e.id)>-1,a=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!a&&e.emojis.forEach((function(e){return d[e]=t.data.emojis[e]}))})),l.length)){var f=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;f&&!h&&this.addCustomToPool(l,d)}_=(g=c.map((function(e){for(var i=d,a=t.index,n=0,r=0;r<e.length;r++){var o=e[r];n++,a[o]||(a[o]={}),(a=a[o]).results||function(){var r={};for(var o in a.results=[],a.pool={},i){var s=i[o],l=s.search,_=e.substr(0,n),d=l.indexOf(_);if(-1!=d){var c=d+1;_==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?a.results.push(t.emojis[o][u]):a.results.push(t.emojis[o]),a.pool[o]=s,r[o]=c}}a.results.sort((function(e,t){var i=r[e.id],a=r[t.id];return i==a?e.id.localeCompare(t.id):i-a}))}(),i=a.pool}return a.results})).filter((function(e){return e}))).length>1?eh.apply(null,g):g.length?g[0]:[]}return _&&(a&&(_=_.filter((function(e){return a(d[e.id])}))),_&&_.length>n&&(_=_.slice(0,n))),_}}]),e}(),uh=new lh(Bf);var _h,dh,ch={search:function(){return uh.search.apply(uh,arguments)},emojis:uh.emojis,emoticons:uh.emoticons},gh=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],fh={};function hh(){dh=!0,_h=sh.get("frequently")}var ph={add:function(e){dh||hh();var t=e.id;_h||(_h=fh),_h[t]||(_h[t]=0),_h[t]+=1,sh.set("last",t),sh.set("frequently",_h)},get:function(e){if(dh||hh(),!_h){fh={};for(var t=[],i=0;i<e;i++)fh[gh[i]]=e-i,t.push(gh[i]);return t}var a=4*e,n=[];for(var r in _h)_h.hasOwnProperty(r)&&n.push(r);var o=n.sort((function(e,t){return _h[e]-_h[t]})).reverse().slice(0,a),s=sh.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},mh=i(15),Fh=i.n(mh),bh=i(25),Eh=i.n(bh),yh=i(11),Dh=i.n(yh),vh=i(12),kh=i.n(vh),Sh=i(13),wh=i.n(Sh),Ch=i(7),xh=i.n(Ch),Th={activity:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"}))},custom:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},m.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"})))},flags:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"}))},foods:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"}))},nature:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),m.a.createElement("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"}))},objects:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),m.a.createElement("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"}))},people:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),m.a.createElement("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"}))},places:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),m.a.createElement("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"}))},recent:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}))},symbols:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},Oh={search:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"}))},delete:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},Nh={data:tg.a.object.isRequired,onOver:tg.a.func,onLeave:tg.a.func,onClick:tg.a.func,fallback:tg.a.func,backgroundImageFn:tg.a.func,native:tg.a.bool,forceSize:tg.a.bool,tooltip:tg.a.bool,useButton:tg.a.bool,skin:tg.a.oneOf([1,2,3,4,5,6]),sheetSize:tg.a.oneOf([16,20,32,64]),sheetColumns:tg.a.number,sheetRows:tg.a.number,set:tg.a.oneOf(["apple","google","twitter","facebook"]),size:tg.a.number.isRequired,emoji:tg.a.oneOfType([tg.a.string,tg.a.object]).isRequired},Ah={onClick:tg.a.func,onSelect:tg.a.func,onSkinChange:tg.a.func,perLine:tg.a.number,emojiSize:tg.a.number,i18n:tg.a.object,style:tg.a.object,title:tg.a.string,emoji:tg.a.string,color:tg.a.string,set:Nh.set,skin:Nh.skin,native:tg.a.bool,backgroundImageFn:Nh.backgroundImageFn,sheetSize:Nh.sheetSize,emojisToShowFilter:tg.a.func,showPreview:tg.a.bool,showSkinTones:tg.a.bool,emojiTooltip:Nh.tooltip,useButton:Nh.useButton,theme:tg.a.oneOf(["auto","light","dark"]),include:tg.a.arrayOf(tg.a.string),exclude:tg.a.arrayOf(tg.a.string),recent:tg.a.arrayOf(tg.a.string),autoFocus:tg.a.bool,enableFrequentEmojiSort:tg.a.bool,custom:tg.a.arrayOf(tg.a.shape({name:tg.a.string.isRequired,short_names:tg.a.arrayOf(tg.a.string).isRequired,emoticons:tg.a.arrayOf(tg.a.string),keywords:tg.a.arrayOf(tg.a.string),imageUrl:tg.a.string,spriteUrl:tg.a.string,sheet_x:tg.a.number,sheet_y:tg.a.number,size:tg.a.number,sheetColumns:tg.a.number,sheetRows:tg.a.number})),skinEmoji:tg.a.string,notFound:tg.a.func,notFoundEmoji:tg.a.string,icons:tg.a.object},Rh=function(e){function t(e){var i;Pf()(this,t),i=Dh()(this,kh()(t).call(this,e));var a=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:a.name},i.handleClick=i.handleClick.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,a=i.categories;(0,i.onAnchorClick)(a[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,a=t.color,n=t.i18n,r=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":n.categorieslabel},i.map((function(t,i){var s=t.id,l=t.name,u=t.anchor,_=l==o;if(!1===u)return null;var d=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":n.categories[d],title:n.categories[d],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(_?"emoji-mart-anchor-selected":""),style:{color:_?a:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[d]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:a}}))})))}}]),t}(m.a.PureComponent);Rh.propTypes={categories:tg.a.array,onAnchorClick:tg.a.func,icons:tg.a.object},Rh.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var Mh={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},Ih={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:Mh.set,theme:"light",skin:null,defaultSkin:Mh.skin,native:Mh.native,sheetSize:Mh.sheetSize,backgroundImageFn:Mh.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:Mh.tooltip,useButton:Mh.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function Bh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Lh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Bh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Bh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Ph=function(e){return Xf(e.emoji,e.skin,e.set,e.data)},jh=function(e){var t=Ph(e),i=t.sheet_x,a=t.sheet_y,n=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(n*i,"% ").concat(r*a,"%")},qh=function(e){return Zf(e.emoji,e.skin,e.set,e.data)},Uh=function(e){return!isNaN(e-parseFloat(e))},zh=function e(t){for(var i in t.data.compressed&&Yf(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var a=Ph(t);if(!a)return t.fallback?t.fallback(null,t):null;var n=a.unified,r=a.custom,o=a.short_names,s=a.imageUrl,l={},u=t.children,_="emoji-mart-emoji",d=n&&Kf(n),c=[d].concat(o).filter(Boolean).join(", "),g=null;if(!n&&!r)return t.fallback?t.fallback(a,t):null;if(t.tooltip&&(g=o[0]),t.native&&n)_+=" emoji-mart-emoji-native",l={fontSize:t.size},u=d,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(r)_+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=a.spriteUrl?Lh({},l,{backgroundImage:"url(".concat(a.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:jh(t)}):Lh({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==a["has_img_".concat(t.set)]||a["has_img_".concat(t.set)]))return t.fallback?t.fallback(a,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:jh(t)}}var f={name:"span",props:{}};return t.onClick&&t.useButton&&(f.name="button",f.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var a=e[i];Uh(a)&&(a+="px"),t.style[i]=a}return t.getAttribute("style")}(l),"<".concat(f.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(_,"'>").concat(u||"","</").concat(f.name,">")):m.a.createElement(f.name,Eh()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(qh(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(qh(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(qh(t),e)}(e,t)},"aria-label":c,title:g,className:_},f.props),m.a.createElement("span",{style:l},u))};zh.propTypes=Lh({},Nh,{data:tg.a.object.isRequired}),zh.defaultProps=Mh;var Gh=zh;function Hh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var Yh=function(e){function t(){return Pf()(this,t),Dh()(this,kh()(t).apply(this,arguments))}return wh()(t,e),qf()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,a=e.i18n,n=e.notFound,r=e.notFoundEmoji;return n&&n()||m.a.createElement("div",{className:"emoji-mart-no-results"},Gh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Hh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Hh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({data:t},i,{size:38,emoji:r,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},a.notfound))}}]),t}(m.a.PureComponent);function Vh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}Yh.propTypes={notFound:tg.a.func.isRequired,emojiProps:tg.a.object.isRequired};var Wh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(xh()(i)),i.setLabelRef=i.setLabelRef.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,a=i.name,n=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,_=l.size,d=l.set,c=e.perLine,g=e.native,f=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,E=!1;return"Recent"==a&&n!=c&&(E=!0),"Search"==a&&(E=!(s==h)),u==m&&_==F&&r==g&&d==b&&o==f||(E=!0),E}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,a=t.height,n=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-n+e.scrollTop,this.maxMargin=0==a?0:a-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,a=t.emojis,n=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=n||ph.get(r);if(s.length&&(a=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!Xf(t,null,null,e.data)}))),0===a.length&&s.length>0)return null}return a&&(a=a.slice(0)),a}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,a=t.name,n=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),_={},d={},c={};u||(c={display:"none"}),n||(_={height:28},d={position:"absolute"});var g=o.categories[i]||a;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:c},m.a.createElement("div",{style:_,"data-name":a,className:"emoji-mart-category-label"},m.a.createElement("span",{style:d,ref:this.setLabelRef,"aria-hidden":!0},g)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},Gh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),u&&!u.length&&m.a.createElement(Yh,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(m.a.Component);Wh.propTypes={emojis:tg.a.array,hasStickyPosition:tg.a.bool,name:tg.a.string.isRequired,native:tg.a.bool.isRequired,perLine:tg.a.number.isRequired,emojiProps:tg.a.object.isRequired,recent:tg.a.arrayOf(tg.a.string),notFound:tg.a.func,notFoundEmoji:tg.a.string.isRequired},Wh.defaultProps={emojis:[],hasStickyPosition:!0};var $h=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).state={opened:!1},i}return wh()(t,e),qf()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),i=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&i(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);$h.propTypes={onChange:tg.a.func,skin:tg.a.number.isRequired},$h.defaultProps={onChange:function(){}};var Kh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).handleClick=i.handleClick.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,a=e.data,n=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},Gh({emoji:n,data:a,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}($h);Kh.propTypes={onChange:tg.a.func,skin:tg.a.number.isRequired,emojiProps:tg.a.object.isRequired,skinTone:tg.a.number,skinEmoji:tg.a.string.isRequired,i18n:tg.a.object},Kh.defaultProps={onChange:function(){},skinTone:null};var Qh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).handleClick=i.handleClick.bind(xh()(i)),i.handleKeyDown=i.handleKeyDown.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,a=this.state.opened,n=[],r=1;r<=6;r++){var o=r===t,s=a||o;n.push(m.a.createElement("span",Eh()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},a?{role:"menuitem"}:{}),m.a.createElement("span",Eh()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!a}:{},a?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(a?" opened":""),"aria-label":i.skintext},m.a.createElement("div",a?{role:"menubar"}:{},n))}}]),t}($h);function Zh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Xh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Zh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Zh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}Qh.propTypes={onChange:tg.a.func,skin:tg.a.number.isRequired,i18n:tg.a.object},Qh.defaultProps={onChange:function(){}};var Jh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return wh()(t,e),qf()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,a=t.skinsProps,n=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=Xf(e,null,null,this.data),_=u.emoticons,d=[],c=[];return(void 0===_?[]:_).forEach((function(e){d.indexOf(e.toLowerCase())>=0||(d.push(e.toLowerCase()),c.push(e))})),m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},Gh(Xh({key:e.id,emoji:e,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},c.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&Gh(Xh({emoji:o,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},r)),n&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(a.skinEmoji?" custom":"")},a.skinEmoji?m.a.createElement(Kh,{skin:a.skin,emojiProps:i,data:this.data,skinEmoji:a.skinEmoji,i18n:s,onChange:a.onChange}):m.a.createElement(Qh,{skin:a.skin,i18n:s,onChange:a.onChange})))}}]),t}(m.a.PureComponent);Jh.propTypes={showSkinTones:tg.a.bool,title:tg.a.string.isRequired,emoji:tg.a.string.isRequired,emojiProps:tg.a.object.isRequired,skinsProps:tg.a.object.isRequired},Jh.defaultProps={showSkinTones:!0,onChange:function(){}};var ep=0,tp=function(e){function t(e){var i,a,n,r;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).state={icon:Oh.search,isSearching:!1,id:++ep},i.data=e.data,i.emojiIndex=new lh(i.data),i.setRef=i.setRef.bind(xh()(i)),i.clear=i.clear.bind(xh()(i)),i.handleKeyUp=i.handleKeyUp.bind(xh()(i)),i.handleChange=(a=i.handleChange.bind(xh()(i)),n="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,n((function(){r=!1,a()})))}),i}return wh()(t,e),qf()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:Oh.search,isSearching:!1}):this.setState({icon:Oh.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,a=this.state,n=a.icon,r=a.isSearching,o=a.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},n()))}}]),t}(m.a.PureComponent);function ip(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function ap(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ip(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ip(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}tp.propTypes={onSearch:tg.a.func,maxResults:tg.a.number,emojisToShowFilter:tg.a.func,autoFocus:tg.a.bool},tp.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var np={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},rp=function(e){function t(e){var i;Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).CUSTOM=[],i.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},i.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&Yf(e.data),i.data=e.data,i.i18n=th(np,e.i18n),i.icons=th(a,e.icons),i.state={firstRender:!0},i.categories=[];var n=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],a=ap({},e,{id:e.short_names[0],custom:!0});t.emojis.push(a),i.CUSTOM.push(a)})),n=n.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&n.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<n.length;s++){var l=n[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,_=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!_)if(e.emojisToShowFilter){for(var d=[],c=l.emojis,g=0;g<c.length;g++){var f=c[g];e.emojisToShowFilter(i.data.emojis[f]||f)&&d.push(f)}if(d.length){var h={emojis:d,name:l.name,id:l.id};i.categories.push(h)}}else i.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(i.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(i.RECENT_CATEGORY.id)>-1;return p&&!m&&(i.hideRecent=!1,i.categories.unshift(i.RECENT_CATEGORY)),i.categories[0]&&(i.categories[0].first=!0),i.categories.unshift(i.SEARCH_CATEGORY),i.setAnchorsRef=i.setAnchorsRef.bind(xh()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(xh()(i)),i.setSearchRef=i.setSearchRef.bind(xh()(i)),i.handleSearch=i.handleSearch.bind(xh()(i)),i.setScrollRef=i.setScrollRef.bind(xh()(i)),i.handleScroll=i.handleScroll.bind(xh()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(xh()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(xh()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(xh()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(xh()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(xh()(i)),i.setPreviewRef=i.setPreviewRef.bind(xh()(i)),i.handleSkinChange=i.handleSkinChange.bind(xh()(i)),i.handleKeyDown=i.handleKeyDown.bind(xh()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?Ih.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?Ih.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||ph.add(e);var i=this.categoryRefs["category-1"];if(i){var a=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),a!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),a=0,n=0,r=this.categories.length;n<r;n++){var o=i?this.categories.length-1-n:n,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!a||l.top<a)&&l.top>0&&(a=l.top),u&&!e&&(e=s)}}t<a?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var _=this.anchors,d=e.name;_.state.selected!=d&&_.setState({selected:d})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,i=this.categories.length;t<i;t++){var a=this.categoryRefs["category-".concat(t)];if(a&&"Search"!=a.props.name){var n=e?"none":"inherit";a.updateDisplay(n)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,a=this.categoryRefs["category-".concat(t)],n=this.scroll;this.anchors;i=function(){if(a){var t=a.top;e.first?t=0:t+=1,n.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),sh.update(t),i(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var i;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(i=Zf(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var a=this.scroll;this.scrollHeight=a.scrollHeight,this.clientHeight=a.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,a=t.emojiSize,n=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,_=t.emoji,d=t.color,c=t.native,g=t.backgroundImageFn,f=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,E=t.include,y=t.exclude,D=t.recent,v=t.autoFocus,k=t.skinEmoji,S=t.notFound,w=t.notFoundEmoji,C=i*(a+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),x=this.getPreferredTheme(),T=this.props.skin||this.state.skin||sh.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:ap({width:C},l),className:"emoji-mart emoji-mart-".concat(x),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Rh,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:d,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(tp,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:f,include:E,exclude:y,custom:this.CUSTOM,autoFocus:v}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Wh,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?D:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:T,size:a,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:S,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Jh,{ref:this.setPreviewRef,data:this.data,title:u,emoji:_,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:T,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:k},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function op(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}rp.propTypes=ap({},Ah,{data:tg.a.object.isRequired}),rp.defaultProps=ap({},Ih);var sp=function(e){function t(){return Pf()(this,t),Dh()(this,kh()(t).apply(this,arguments))}return wh()(t,e),qf()(t,[{key:"render",value:function(){return m.a.createElement(rp,Eh()({},this.props,this.state))}}]),t}(m.a.PureComponent);function lp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function up(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?lp(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):lp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}sp.propTypes=Ah,sp.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?op(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):op(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},Ih,{data:Bf});var _p=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return Gh(up({},t))};_p.propTypes=Nh,_p.defaultProps=up({},Mh,{data:Bf});var dp=i(49),cp={insert:"head",singleton:!1},gp=(r()(dp.a,cp),dp.a.locals,i(88));function fp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var hp=function(e){Nf()(i,e);var t=fp(i);function i(){var e;Sf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),d()(Tf()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),d()(Tf()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return Cf()(i,[{key:"render",value:function(){return m.a.createElement(rp,{style:{maxWidth:"100%"},data:gp,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),i}(m.a.Component);hp.defaultProps={editor:{},range:{}},hp.propTypes={editor:tg.a.object.isRequired,range:tg.a.object};var pp=hp,mp=function(e){var t=e.editor,i=Object(p.useRef)();return m.a.createElement(Qg,{ref:i,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(ng,{icon:vf,iconActive:null==i||null===(e=i.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(pp,{editor:t}))},Fp=function(e){var t=e.editor,i=e.variables,a=e.setImageUploadVisible,n=e.options,r=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:J_,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:td,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:ad,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:rd,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:dd,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return n.includes(e.optionName)})),l=[{Icon:Wc,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:ud,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:Kc,command:function(){return a(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return n.includes(e.optionName)})),u=[{Icon:Zc,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Jc,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return n.includes(e.optionName)})),_=n.includes("font-color"),d=n.includes("font-size"),c=n.includes("emoji"),g=n.includes("link"),f=function(e,t){var i=e.Icon,a=e.command,n=e.active,r=e.optionName;return m.a.createElement(ng,{key:t,icon:i,iconActive:n,onClick:a,tooltipProps:{content:tc(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},d&&m.a.createElement(Zg,{editor:t}),s.map(f),_&&m.a.createElement(ug,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),c&&m.a.createElement(mp,{editor:t}),g&&m.a.createElement(yf,{editor:t}),l.map(f),u.map(f),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(nf,{editor:t,variables:i}),m.a.createElement(cf,{editor:t,mentions:r,showImageInMention:o})))},bp=function(e){var t=e.children,i=e.className,a=void 0===i?"root-portal":i,n=e.el,r=void 0===n?"div":n,o=document.getElementsByClassName(a)[0];return o||(o=document.createElement(r)).classList.add(a),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Su.a.createPortal(t,o)},Ep=["children","className"],yp=function(e){var t=e.children,i=e.className,a=h()(e,Ep);return m.a.createElement("div",u()({className:b()("ne-backdrop",d()({},i,i))},a),t)},Dp=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],vp=function(){},kp="xs",Sp="sm",wp="md",Cp=function(e){var t=e.size,i=void 0===t?"sm":t,a=e.isOpen,n=void 0!==a&&a,r=e.onClose,o=void 0===r?vp:r,s=e.loading,l=void 0!==s&&s,_=e.children,c=e.className,g=void 0===c?"":c,f=e.closeOnEsc,F=void 0===f||f,E=e.closeButton,y=void 0===E||E,D=e.backdropClassName,v=void 0===D?"":D,k=e.closeOnOutsideClick,S=void 0===k||k,w=h()(e,Dp),C=Object(p.useRef)();return S&&Yg(C,o),F&&Hg("esc",o),m.a.createElement(bp,{className:"ne-portal"},n&&m.a.createElement(yp,{key:"modal-backdrop",className:b()("ne-modal__backdrop",v)},m.a.createElement("div",u()({ref:C,key:"modal-wrapper",className:b()("ne-modal__wrapper",d()({"ne-modal__wrapper--xs":i===kp,"ne-modal__wrapper--sm":i===Sp,"ne-modal__wrapper--md":i===wp},g,g))},w),y&&m.a.createElement(jc,{style:"text",icon:rc,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):_)))},xp=["children","size","noUnderline","className"],Tp=["active","className","children","icon","onClick","activeClassName"],Op=function(){},Np="large",Ap=function(e){var t=e.children,i=e.size,a=e.noUnderline,n=e.className,r=void 0===n?"":n,o=h()(e,xp);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":i===Np},{"ne-tab__wrapper--underline-none":a},[r]),"data-cy":"tab-container"},o),t)};Ap.Item=function(e){var t=e.active,i=e.className,a=void 0===i?"":i,n=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?Op:s,_=e.activeClassName,d=void 0===_?"":_,c=h()(e,Tp),g="button",f="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return d&&(g=xc),m.a.createElement(g,u()({className:b()(["ne-tab flex items-center justify-center select-none",a],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(f,{className:"ne-tab__icon"}),n)};var Rp=Ap,Mp=function(e){var t,i=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),a=g()(i,2),n=a[0],r=a[1];return[n,function(e){return r(e.key)}]},Ip=function(e){var t=e.buttonLabel,i=void 0===t?"Submit":t,a=e.placeholder,n=e.onSubmit,r=e.className,o=Object(p.useState)(""),s=g()(o,2),l=s[0],u=s[1],_=Object(p.useState)(""),c=g()(_,2),f=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",d()({},r,r))},m.a.createElement(Ef,{name:"url",value:l,placeholder:a,onFocus:function(){return h("")},error:f,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(jc,{size:"large",label:i,onClick:function(e){e.preventDefault(),qc.test(l)?n(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},Bp=i(19),Lp=i.n(Bp),Pp=(i(60),i(72),i(73)),jp=i.n(Pp),qp=(i(74),i(75),i(76),i(77)),Up=i.n(qp),zp=i(89),Gp=i.n(zp),Hp=function(e){var t,i=e.uppy,a=Object(p.useState)(0),n=g()(a,2),r=n[0],o=n[1];Object(p.useEffect)((function(){i.on("progress",o)}),[i]);var s="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=i.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(jc,{icon:rc,onClick:function(){return i.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))};function Yp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var Vp={allowMultipleUploads:!1,autoProceed:!0,debug:!0},Wp={formData:!0,fieldName:"blob"},$p=function(e){var t=e.endpoint,i=void 0===t?"/api/v1/direct_uploads/image_upload":t,a=e.onSuccess,n=Object(p.useState)(!1),r=g()(n,2),o=r[0],s=r[1],l=Up()((function(){return new Lp.a(Vp).use(Gp.a,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Yp(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Yp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({endpoint:i},Wp)).on("upload",(function(){return s(!0)})).on("upload-success",(function(e,t){return a(t.body.imageURL)})).on("cancel-all",(function(){return s(!1)})).on("complete",(function(){return s(!1)}))}));return o?m.a.createElement(Hp,{uppy:l}):m.a.createElement(jp.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: 5MB",locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:l,"data-cy":"neeto-editor-image-local-uploader"})},Kp=i(50),Qp=i.n(Kp),Zp=i(90),Xp=i.n(Zp),Jp=i(51),em=i.n(Jp),tm=i(91),im=i.n(tm),am=i(92),nm=i.n(am),rm={FONT_COLOR:"font-color",FONT_SIZE:"font-size",BOLD:"bold",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"strike",BLOCKQUOTE:"block-quote",CODE_BLOCK:"code-block",LINK:"link",LIST_BULLETS:"bullet-list",LIST_ORDERED:"ordered-list",IMAGE_UPLOAD:"image-upload",VIDEO_EMBED:"video-embed",EMOJI:"emoji",DIVIDER:"divider",MENTION:"mention"},om=function(e){var t=e.pageNo,i=e.query,a=e.apiKey;return nm.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(a)},params:{page:t,per_page:30,order_by:"popular",query:i}})},sm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,i=Object(p.useState)(e),a=g()(i,2),n=a[0],r=a[1];return Object(p.useEffect)((function(){var i=setTimeout((function(){r(e)}),t);return function(){clearTimeout(i)}}),[e]),n},lm=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},um=function(e){var t=e.onSubmit,i=e.unsplashApiKey,a=Object(p.useRef)(null),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(!1),u=g()(l,2),_=u[0],d=u[1],c=Object(p.useState)([]),f=g()(c,2),h=f[0],F=f[1],b=Object(p.useState)(1),E=g()(b,2),y=E[0],D=E[1],v=Object(p.useState)(!0),k=g()(v,2),S=k[0],w=k[1],C=Object(p.useState)(!1),x=g()(C,2),T=x[0],O=x[1],N=sm(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=Xp()(em.a.mark((function e(t){var a,n,r,o;return em.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,O(!0),d(!1),e.next=5,om({page:t,query:N,apiKey:i});case 5:a=e.sent,n=a.data,r=n.results,o=n.total_pages,F(1===t?r:[].concat(Qp()(h),Qp()(r))),D(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),d(!0);case 15:return e.prev=15,O(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(Ef,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),_&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!_&&!T&&ac(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!_&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(im.a,{ref:a,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:S,loadMore:function(){!T&&S&&y>1&&A(y)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(lm,{key:0})},h&&h.map((function(e,i){return m.a.createElement("div",{key:i,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(i)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(i)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!S&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},_m=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],dm=function(e){var t=e.editor,i=e.imageUploadUrl,a=e.isVisible,n=e.setIsVisible,r=e.unsplashApiKey,o=e.isUnsplashImageUploadActive,s=Mp(_m),l=g()(s,2),u=l[0],_=l[1],d=function(e){t.chain().focus().setImage({src:e}).run(),n(!1)},c={local:function(){return m.a.createElement($p,{endpoint:i,onSuccess:d})},link:function(){return m.a.createElement(Ip,{onSubmit:d,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(um,{unsplashApiKey:r,onSubmit:d})}}[u];return m.a.createElement(Cp,{isOpen:a,onClose:function(){return n(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(Rp,null,_m.filter((function(e){return"unsplash"!==e.key||o})).map((function(e){return m.a.createElement(Rp.Item,{key:e.key,active:u===e.key,onClick:function(){return _(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(c,null))))},cm=i(38),gm=i.n(cm),fm=i(93);function hm(e,t){return Array(t+1).join(e)}var pm=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function mm(e){return ym(e,pm)}var Fm=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function bm(e){return ym(e,Fm)}var Em=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function ym(e,t){return t.indexOf(e.nodeName)>=0}function Dm(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var vm={};function km(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Sm(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function wm(e,t,i){for(var a=0;a<e.length;a++){var n=e[a];if(Cm(n,t,i))return n}}function Cm(e,t,i){var a=e.filter;if("string"==typeof a){if(a===t.nodeName.toLowerCase())return!0}else if(Array.isArray(a)){if(a.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof a)throw new TypeError("`filter` needs to be a string, array, or function");if(a.call(e,t,i))return!0}}function xm(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Tm(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}vm.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},vm.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},vm.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var a=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&a<3?"\n\n"+e+"\n"+hm(1===a?"=":"-",e.length)+"\n\n":"\n\n"+hm("#",a)+" "+e+"\n\n"}},vm.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},vm.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},vm.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var a=i.bulletListMarker+" ",n=t.parentNode;if("OL"===n.nodeName){var r=n.getAttribute("start"),o=Array.prototype.indexOf.call(n.children,t);a=(r?Number(r)+o:o+1)+". "}return a+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},vm.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},vm.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var a,n=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,o=i.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");a=l.exec(r);)a[0].length>=s&&(s=a[0].length+1);var u=hm(o,s);return"\n\n"+u+n+"\n"+r.replace(/\n$/,"")+"\n"+u+"\n\n"}},vm.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},vm.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href"),a=km(t.getAttribute("title"));return a&&(a=' "'+a+'"'),"["+e+"]("+i+a+")"}},vm.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var a,n,r=t.getAttribute("href"),o=km(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":a="["+e+"][]",n="["+e+"]: "+r+o;break;case"shortcut":a="["+e+"]",n="["+e+"]: "+r+o;break;default:var s=this.references.length+1;a="["+e+"]["+s+"]",n="["+s+"]: "+r+o}return this.references.push(n),a},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},vm.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},vm.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},vm.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",a=e.match(/`+/gm)||[];-1!==a.indexOf(i);)i+="`";return i+t+e+t+i}},vm.image={filter:"img",replacement:function(e,t){var i=km(t.getAttribute("alt")),a=t.getAttribute("src")||"",n=km(t.getAttribute("title"));return a?"!["+i+"]("+a+(n?' "'+n+'"':"")+")":""}},Sm.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=wm(this.array,e,this.options))||(t=wm(this._keep,e,this.options))||(t=wm(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var Om="undefined"!=typeof window?window:{};var Nm,Am,Rm=function(){var e=Om.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?Om.DOMParser:(Nm=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?Nm.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:Nm.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},Nm);function Mm(e,t){var i;"string"==typeof e?i=(Am=Am||new Rm).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,a=e.isVoid,n=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!n(t)){for(var r=null,o=!1,s=null,l=Tm(s,t,n);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=xm(l);continue}l.data=u,r=l}else{if(1!==l.nodeType){l=xm(l);continue}i(l)||"BR"===l.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,o=!1):a(l)||n(l)?(r=null,o=!0):r&&(o=!1)}var _=Tm(s,l,n);s=l,l=_}r&&(r.data=r.data.replace(/ $/,""),r.data||xm(r))}}({element:i,isBlock:mm,isVoid:bm,isPre:t.preformattedCode?Im:null}),i}function Im(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function Bm(e,t){return e.isBlock=mm(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!bm(e)&&!function(e){return ym(e,Em)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Dm(e,Fm)}(e)&&!function(e){return Dm(e,Em)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(a=e.textContent,n=a.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:n[1],leadingAscii:n[2],leadingNonAscii:n[3],trailing:n[4],trailingNonAscii:n[5],trailingAscii:n[6]});var a,n;i.leadingAscii&&Lm("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&Lm("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function Lm(e,t,i){var a,n,r;return"left"===e?(a=t.previousSibling,n=/ $/):(a=t.nextSibling,n=/^ /),a&&(3===a.nodeType?r=n.test(a.nodeValue):i.preformattedCode&&"CODE"===a.nodeName?r=!1:1!==a.nodeType||mm(a)||(r=n.test(a.textContent))),r}var Pm=Array.prototype.reduce,jm=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function qm(e){if(!(this instanceof qm))return new qm(e);var t={rules:vm,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}({},t,e),this.rules=new Sm(this.options)}function Um(e){var t=this;return Pm.call(e.childNodes,(function(e,i){var a="";return 3===(i=new Bm(i,t.options)).nodeType?a=i.isCode?i.nodeValue:t.escape(i.nodeValue):1===i.nodeType&&(a=Gm.call(t,i)),Hm(e,a)}),"")}function zm(e){var t=this;return this.rules.forEach((function(i){"function"==typeof i.append&&(e=Hm(e,i.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Gm(e){var t=this.rules.forNode(e),i=Um.call(this,e),a=e.flankingWhitespace;return(a.leading||a.trailing)&&(i=i.trim()),a.leading+t.replacement(i,e,this.options)+a.trailing}function Hm(e,t){var i=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),a=t.replace(/^\n*/,""),n=Math.max(e.length-i.length,t.length-a.length);return i+"\n\n".substring(0,n)+a}qm.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=Um.call(this,new Mm(e,this.options));return zm.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return jm.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Ym=qm,Vm=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=fm.marked.parse(e,{sanitize:!1});return t=(t=(t=(t=t.replaceAll(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/!\[(.*?)\]\((.*?)\)/g,(function(e,t,i){return'<img src="'.concat(i,'" alt="').concat(t,'">')}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),gm.a.sanitize(t,{ADD_TAGS:["iframe"]})},Wm=["editor","className","style","strategy","onChange","onSubmit","initialValue"],$m=function(e){var t=e.editor,i=e.className,a=e.style,n=e.strategy,r=e.onChange,o=e.onSubmit,s=e.initialValue,l=h()(e,Wm),_=Object(p.useState)((function(){return e=(null==t?void 0:t.getHTML())||s,(i=new Ym({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}})).keep(["iframe"]),i.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),i.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),i.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),i.turndown(e);var e,i})),c=g()(_,2),f=c[0],F=c[1],E=Object(p.useRef)(),y=Object(p.useRef)(f);Object(p.useEffect)((function(){y.current=f}),[f]),Object(p.useEffect)((function(){return document.addEventListener("keydown",D),function(){null==t||t.commands.setContent(Vm(y.current)),document.removeEventListener("keydown",D)}}),[]),Object(p.useLayoutEffect)((function(){E.current.style=a,"flexible"===n&&(E.current.style.height=E.current.scrollHeight+2+"px")}),[f]);var D=function(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null==o||o(Vm(y.current)),E.current.blur())};return m.a.createElement("textarea",u()({ref:E,value:f,onChange:function(e){F(e.target.value),null==r||r(Vm(e.target.value))},className:b()("ProseMirror neeto-editor-markdown",d()({},i,i)),"data-cy":"neeto-editor-markdown-editor"},l))};const Km=/^\s*>\s$/,Qm=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[bs({find:Km,type:this.type})]}}),Zm=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Xm=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Jm=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,tF=gs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ps({find:Zm,type:this.type}),ps({find:Jm,type:this.type})]},addPasteRules(){return[Es({find:Xm,type:this.type}),Es({find:eF,type:this.type})]}}),iF=/^\s*([-+*])\s$/,aF=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[bs({find:iF,type:this.type})]}}),nF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,rF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,oF=gs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ps({find:nF,type:this.type})]},addPasteRules(){return[Es({find:rF,type:this.type})]}}),sF=/^```(?<language>[a-z]*)?[\s\n]$/,lF=/^~~~(?<language>[a-z]*)?[\s\n]$/,uF=cs.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,a=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return a||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:sF,type:this.type,getAttributes:({groups:e})=>e}),ms({find:lF,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Rt({key:new Bt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),a=t.clipboardData.getData("vscode-editor-data"),n=a?JSON.parse(a):void 0,r=null==n?void 0:n.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(i.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var _F=cs.create({name:"doc",topNode:!0,content:"block+"});var dF=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var a=function(e){return i[t](e)};return e.dom.addEventListener(t,a),{name:t,handler:a}}))};dF.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,a=t.handler;return e.editorView.dom.removeEventListener(i,a)}))},dF.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},dF.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},dF.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,a=t.nodeAfter;if(i||a){var n=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?n.bottom:n.top;i&&a&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:n.left,right:n.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.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),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var _=u.getBoundingClientRect();s=_.left-u.scrollLeft,l=_.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},dF.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},dF.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Je(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},dF.prototype.dragend=function(){this.scheduleRemoval(20)},dF.prototype.drop=function(){this.scheduleRemoval(20)},dF.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const cF=mr.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Rt({view:function(t){return new dF(t,e)}}))];var e}});var gF=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));return t.valid(n)?new t(n):e.near(n)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(i.pos))},t.prototype.getBookmark=function(){return new fF(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var a=e.node(t).child(i-1);;a=a.lastChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),a=e.node(t);if(i!=a.childCount)for(var n=a.child(i);;n=n.firstChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var a=t.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock},t.findFrom=function(e,i,a){e:for(;;){if(!a&&t.valid(e))return e;for(var n=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;n+=i;var l=e.doc.resolve(n);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!bt.isSelectable(r)){e=e.doc.resolve(n+r.nodeSize*i),a=!1;continue e}break}r=u,n+=i;var _=e.doc.resolve(n);if(t.valid(_))return _}return null}},t}(ft);gF.prototype.visible=!1,ft.jsonID("gapcursor",gF);var fF=function(e){this.pos=e};fF.prototype.map=function(e){return new fF(e.map(this.pos))},fF.prototype.resolve=function(e){var t=e.resolve(this.pos);return gF.valid(t)?new gF(t):ft.near(t)};var hF=dr({ArrowLeft:pF("horiz",-1),ArrowRight:pF("horiz",1),ArrowUp:pF("vert",-1),ArrowDown:pF("vert",1)});function pF(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,a,n){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof mt){if(!n.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=gF.findFrom(o,t,s);return!!l&&(a&&a(e.tr.setSelection(new gF(l))),!0)}}function mF(e,t,i){if(!e.editable)return!1;var a=e.state.doc.resolve(t);if(!gF.valid(a))return!1;var n=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(n>-1&&bt.isSelectable(e.state.doc.nodeAt(n)))&&(e.dispatch(e.state.tr.setSelection(new gF(a))),!0)}function FF(e){if(!(e.selection instanceof gF))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Mn.create(e.doc,[On.widget(e.selection.head,t,{key:"gapcursor"})])}const bF=mr.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Rt({props:{decorations:FF,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&gF.valid(i))return new gF(i)},handleClick:mF,handleKeyDown:hF}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=hr(pr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),EF=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",ns(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:a})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:n}=a.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>n.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),yF=cs.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:"h"+e,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return["h"+(this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]),ns(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode("heading",e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode("heading","paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,["Mod-Alt-"+t]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>ms({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var DF=function(){};DF.prototype.append=function(e){return e.length?(e=DF.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},DF.prototype.prepend=function(e){return e.length?DF.from(e).append(this):this},DF.prototype.appendInner=function(e){return new kF(this,e)},DF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?DF.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},DF.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},DF.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},DF.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var a=[];return this.forEach((function(t,i){return a.push(e(t,i))}),t,i),a},DF.from=function(e){return e instanceof DF?e:e&&e.length?new vF(e):DF.empty};var vF=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,a){for(var n=t;n<i;n++)if(!1===e(this.values[n],a+n))return!1},t.prototype.forEachInvertedInner=function(e,t,i,a){for(var n=t-1;n>=i;n--)if(!1===e(this.values[n],a+n))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}(DF);DF.empty=new vF([]);var kF=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,a){var n=this.left.length;return!(t<n&&!1===this.left.forEachInner(e,t,Math.min(i,n),a))&&(!(i>n&&!1===this.right.forEachInner(e,Math.max(t-n,0),Math.min(this.length,i)-n,a+n))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,a){var n=this.left.length;return!(t>n&&!1===this.right.forEachInvertedInner(e,t-n,Math.max(i,n)-n,a+n))&&(!(i<n&&!1===this.left.forEachInvertedInner(e,Math.min(t,n),i,a))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(DF),SF=DF,wF=function(e,t){this.items=e,this.eventCount=t};wF.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var a,n,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(a=this.remapping(r,this.items.length),n=a.maps.length);var o,s,l=e.tr,u=[],_=[];return this.items.forEach((function(e,t){if(!e.step)return a||(a=i.remapping(r,t+1),n=a.maps.length),n--,void _.push(e);if(a){_.push(new CF(e.map));var d,c=e.step.map(a.slice(n));c&&l.maybeStep(c).doc&&(d=l.mapping.maps[l.mapping.maps.length-1],u.push(new CF(d,null,null,u.length+_.length))),n--,d&&a.appendMap(d,n)}else l.maybeStep(e.step);return e.selection?(o=a?e.selection.map(a.slice(n)):e.selection,s=new wF(i.items.slice(0,r).append(_.reverse().concat(u)),i.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},wF.prototype.addTransform=function(e,t,i,a){for(var n=[],r=this.eventCount,o=this.items,s=!a&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,_=e.steps[l].invert(e.docs[l]),d=new CF(e.mapping.maps[l],_,t);(u=s&&s.merge(d))&&(d=u,l?n.pop():o=o.slice(0,o.length-1)),n.push(d),t&&(r++,t=null),a||(s=d)}var c,g,f,h=r-i.depth;return h>TF&&(g=h,(c=o).forEach((function(e,t){if(e.selection&&0==g--)return f=t,!1})),o=c.slice(f),r-=h),new wF(o.append(n),r)},wF.prototype.remapping=function(e,t){var i=new Ie;return this.items.forEach((function(t,a){var n=null!=t.mirrorOffset&&a-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,n)}),e,t),i},wF.prototype.addMaps=function(e){return 0==this.eventCount?this:new wF(this.items.append(e.map((function(e){return new CF(e)}))),this.eventCount)},wF.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],a=Math.max(0,this.items.length-t),n=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),a);var s=t;this.items.forEach((function(t){var a=n.getMirror(--s);if(null!=a){r=Math.min(r,a);var l=n.maps[a];if(t.step){var u=e.steps[a].invert(e.docs[a]),_=t.selection&&t.selection.map(n.slice(s+1,a));_&&o++,i.push(new CF(l,u,_))}else i.push(new CF(l))}}),a);for(var l=[],u=t;u<r;u++)l.push(new CF(n.maps[u]));var _=this.items.slice(0,a).append(l).append(i),d=new wF(_,o);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-i.length)),d},wF.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},wF.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,a=[],n=0;return this.items.forEach((function(r,o){if(o>=e)a.push(r),r.selection&&n++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&n++;var _,d=new CF(l.invert(),s,u),c=a.length-1;(_=a.length&&a[c].merge(d))?a[c]=_:a.push(d)}}else r.map&&i--}),this.items.length,0),new wF(SF.from(a.reverse()),n)},wF.empty=new wF(SF.empty,0);var CF=function(e,t,i,a){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=a};CF.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new CF(t.getMap().invert(),t,this.selection)}};var xF=function(e,t,i,a){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=a},TF=20;function OF(e){var t=[];return e.forEach((function(e,i,a,n){return t.push(a,n)})),t}function NF(e,t){if(!e)return null;for(var i=[],a=0;a<e.length;a+=2){var n=t.map(e[a],1),r=t.map(e[a+1],-1);n<=r&&i.push(n,r)}return i}function AF(e,t,i,a){var n=IF(t),r=BF.get(t).spec.config,o=(a?e.undone:e.done).popEvent(t,n);if(o){var s=o.selection.resolve(o.transform.doc),l=(a?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,n),u=new xF(a?l:o.remaining,a?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(BF,{redo:a,historyState:u}).scrollIntoView())}}var RF=!1,MF=null;function IF(e){var t=e.plugins;if(MF!=t){RF=!1,MF=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){RF=!0;break}}return RF}var BF=new Bt("history"),LF=new Bt("closeHistory");function PF(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Rt({key:BF,state:{init:function(){return new xF(wF.empty,wF.empty,null,0)},apply:function(t,i,a){return function(e,t,i,a){var n,r=i.getMeta(BF);if(r)return r.historyState;i.getMeta(LF)&&(e=new xF(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(BF))return o.getMeta(BF).redo?new xF(e.done.addTransform(i,null,a,IF(t)),e.undone,OF(i.mapping.maps[i.steps.length-1]),e.prevTime):new xF(e.done,e.undone.addTransform(i,null,a,IF(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(n=i.getMeta("rebased"))?new xF(e.done.rebased(i,n),e.undone.rebased(i,n),NF(e.prevRanges,i.mapping),e.prevTime):new xF(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),NF(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-a.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,a){for(var n=0;n<t.length;n+=2)e<=t[n+1]&&a>=t[n]&&(i=!0)})),i}(i,e.prevRanges)),l=o?NF(e.prevRanges,i.mapping):OF(i.mapping.maps[i.steps.length-1]);return new xF(e.done.addTransform(i,s?t.selection.getBookmark():null,a,IF(t)),wF.empty,l,i.time)}(i,a,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?jF(e.state,e.dispatch):"historyRedo"==t.inputType&&qF(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function jF(e,t){var i=BF.getState(e);return!(!i||0==i.done.eventCount)&&(t&&AF(i,e,t,!1),!0)}function qF(e,t){var i=BF.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&AF(i,e,t,!0),!0)}const UF=mr.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>jF(e,t),redo:()=>({state:e,dispatch:t})=>qF(e,t)}),addProseMirrorPlugins(){return[PF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),zF=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:a,$anchor:n}=i,r=n.parent.isTextblock&&!n.parent.type.spec.code&&!n.parent.textContent;if(!a||!r||!t)return!0;const o=n.before(),s=n.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:a}=e.selection.$from,n=a+1;if(!e.doc.nodeAt(n)){const a=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();a&&(e.insert(n,a),e.setSelection(mt.create(e.doc,n)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[fs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,HF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,YF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,VF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,WF=gs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ps({find:GF,type:this.type}),ps({find:YF,type:this.type})]},addPasteRules(){return[Es({find:HF,type:this.type}),Es({find:VF,type:this.type})]}}),$F=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",ns(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),KF=/^(\d+)\.\s$/,QF=cs.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...i}=e;return 1===t?["ol",ns(this.options.HTMLAttributes,i),0]:["ol",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[bs({find:KF,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),ZF=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),XF=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,JF=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,eb=gs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ps({find:XF,type:this.type})]},addPasteRules(){return[Es({find:JF,type:this.type})]}});var tb=cs.create({name:"text",group:"inline"});const ib=mr.create({name:"starterKit",addExtensions(){var e,t,i,a,n,r,o,s,l,u,_,d,c,g,f,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(Qm.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(tF.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(aF.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(oF.configure(null===(a=this.options)||void 0===a?void 0:a.code)),!1!==this.options.codeBlock&&F.push(uF.configure(null===(n=this.options)||void 0===n?void 0:n.codeBlock)),!1!==this.options.document&&F.push(_F.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(cF.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(bF.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(EF.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(yF.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(UF.configure(null===(_=this.options)||void 0===_?void 0:_.history)),!1!==this.options.horizontalRule&&F.push(zF.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&F.push(WF.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push($F.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&F.push(QF.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&F.push(ZF.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(eb.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(tb.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),ab=Fs({find:/--$/,replace:"—"}),nb=Fs({find:/\.\.\.$/,replace:"…"}),rb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),ob=Fs({find:/"$/,replace:"”"}),sb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),lb=Fs({find:/'$/,replace:"’"}),ub=Fs({find:/<-$/,replace:"←"}),_b=Fs({find:/->$/,replace:"→"}),db=Fs({find:/\(c\)$/,replace:"©"}),cb=Fs({find:/\(tm\)$/,replace:"™"}),gb=Fs({find:/\(r\)$/,replace:"®"}),fb=Fs({find:/1\/2$/,replace:"½"}),hb=Fs({find:/\+\/-$/,replace:"±"}),pb=Fs({find:/!=$/,replace:"≠"}),mb=Fs({find:/<<$/,replace:"«"}),Fb=Fs({find:/>>$/,replace:"»"}),bb=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Eb=Fs({find:/\^2$/,replace:"²"}),yb=Fs({find:/\^3$/,replace:"³"}),Db=Fs({find:/1\/4$/,replace:"¼"}),vb=Fs({find:/3\/4$/,replace:"¾"}),kb=mr.create({name:"typography",addInputRules:()=>[ab,nb,rb,ob,sb,lb,ub,_b,db,cb,gb,fb,hb,pb,mb,Fb,bb,Eb,yb,Db,vb]}),Sb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,wb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Cb=gs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setHighlight:e=>({commands:t})=>t.setMark("highlight",e),toggleHighlight:e=>({commands:t})=>t.toggleMark("highlight",e),unsetHighlight:()=>({commands:e})=>e.unsetMark("highlight")}),addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ps({find:Sb,type:this.type})]},addPasteRules(){return[Es({find:wb,type:this.type})]}});var xb=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var i=0;i<e.length;i++)this.size+=e[i].nodeSize},Tb={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};xb.prototype.nodesBetween=function(e,t,i,a,n){void 0===a&&(a=0);for(var r=0,o=0;o<t;r++){var s=this.content[r],l=o+s.nodeSize;if(l>e&&!1!==i(s,a+o,n,r)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),i,a+u)}o=l}},xb.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},xb.prototype.textBetween=function(e,t,i,a){var n="",r=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(n+=o.text.slice(Math.max(e,s)-s,t-s),r=!i):o.isLeaf&&a?(n+="function"==typeof a?a(o):a,r=!i):!r&&o.isBlock&&(n+=i,r=!0)}),0),n},xb.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,i=e.firstChild,a=this.content.slice(),n=0;for(t.isText&&t.sameMarkup(i)&&(a[a.length-1]=t.withText(t.text+i.text),n=1);n<e.content.length;n++)a.push(e.content[n]);return new xb(a,this.size+e.size)},xb.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var i=[],a=0;if(t>e)for(var n=0,r=0;r<t;n++){var o=this.content[n],s=r+o.nodeSize;s>e&&((r<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-r),Math.min(o.text.length,t-r)):o.cut(Math.max(0,e-r-1),Math.min(o.content.size,t-r-1))),i.push(o),a+=o.nodeSize),r=s}return new xb(i,a)},xb.prototype.cutByIndex=function(e,t){return e==t?xb.empty:0==e&&t==this.content.length?this:new xb(this.content.slice(e,t))},xb.prototype.replaceChild=function(e,t){var i=this.content[e];if(i==t)return this;var a=this.content.slice(),n=this.size+t.nodeSize-i.nodeSize;return a[e]=t,new xb(a,n)},xb.prototype.addToStart=function(e){return new xb([e].concat(this.content),this.size+e.nodeSize)},xb.prototype.addToEnd=function(e){return new xb(this.content.concat(e),this.size+e.nodeSize)},xb.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},Tb.firstChild.get=function(){return this.content.length?this.content[0]:null},Tb.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},Tb.childCount.get=function(){return this.content.length},xb.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},xb.prototype.maybeChild=function(e){return this.content[e]},xb.prototype.forEach=function(e){for(var t=0,i=0;t<this.content.length;t++){var a=this.content[t];e(a,i,t),i+=a.nodeSize}},xb.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,i,a){for(var n=0;;n++){if(n==t.childCount||n==i.childCount)return t.childCount==i.childCount?null:a;var r=t.child(n),o=i.child(n);if(r!=o){if(!r.sameMarkup(o))return a;if(r.isText&&r.text!=o.text){for(var s=0;r.text[s]==o.text[s];s++)a++;return a}if(r.content.size||o.content.size){var l=e(r.content,o.content,a+1);if(null!=l)return l}a+=r.nodeSize}else a+=r.nodeSize}}(this,e,t)},xb.prototype.findDiffEnd=function(e,t,i){return void 0===t&&(t=this.size),void 0===i&&(i=e.size),function e(t,i,a,n){for(var r=t.childCount,o=i.childCount;;){if(0==r||0==o)return r==o?null:{a:a,b:n};var s=t.child(--r),l=i.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:a,b:n};if(s.isText&&s.text!=l.text){for(var _=0,d=Math.min(s.text.length,l.text.length);_<d&&s.text[s.text.length-_-1]==l.text[l.text.length-_-1];)_++,a--,n--;return{a:a,b:n}}if(s.content.size||l.content.size){var c=e(s.content,l.content,a-1,n-1);if(c)return c}a-=u,n-=u}else a-=u,n-=u}}(this,e,t,i)},xb.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return Nb(0,e);if(e==this.size)return Nb(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var i=0,a=0;;i++){var n=a+this.child(i).nodeSize;if(n>=e)return n==e||t>0?Nb(i+1,n):Nb(i,a);a=n}},xb.prototype.toString=function(){return"<"+this.toStringInner()+">"},xb.prototype.toStringInner=function(){return this.content.join(", ")},xb.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},xb.fromJSON=function(e,t){if(!t)return xb.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new xb(t.map(e.nodeFromJSON))},xb.fromArray=function(e){if(!e.length)return xb.empty;for(var t,i=0,a=0;a<e.length;a++){var n=e[a];i+=n.nodeSize,a&&n.isText&&e[a-1].sameMarkup(n)?(t||(t=e.slice(0,a)),t[t.length-1]=n.withText(t[t.length-1].text+n.text)):t&&t.push(n)}return new xb(t||e,i)},xb.from=function(e){if(!e)return xb.empty;if(e instanceof xb)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new xb([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(xb.prototype,Tb);var Ob={index:0,offset:0};function Nb(e,t){return Ob.index=e,Ob.offset=t,Ob}function Ab(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var i=Array.isArray(e);if(Array.isArray(t)!=i)return!1;if(i){if(e.length!=t.length)return!1;for(var a=0;a<e.length;a++)if(!Ab(e[a],t[a]))return!1}else{for(var n in e)if(!(n in t)||!Ab(e[n],t[n]))return!1;for(var r in t)if(!(r in e))return!1}return!0}xb.empty=new xb([],0);var Rb=function(e,t){this.type=e,this.attrs=t};function Mb(e){var t=Error.call(this,e);return t.__proto__=Mb.prototype,t}Rb.prototype.addToSet=function(e){for(var t,i=!1,a=0;a<e.length;a++){var n=e[a];if(this.eq(n))return e;if(this.type.excludes(n.type))t||(t=e.slice(0,a));else{if(n.type.excludes(this.type))return e;!i&&n.type.rank>this.type.rank&&(t||(t=e.slice(0,a)),t.push(this),i=!0),t&&t.push(n)}}return t||(t=e.slice()),i||t.push(this),t},Rb.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},Rb.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},Rb.prototype.eq=function(e){return this==e||this.type==e.type&&Ab(this.attrs,e.attrs)},Rb.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},Rb.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var i=e.marks[t.type];if(!i)throw new RangeError("There is no mark type "+t.type+" in this schema");return i.create(t.attrs)},Rb.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0},Rb.setFrom=function(e){if(!e||0==e.length)return Rb.none;if(e instanceof Rb)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},Rb.none=[],Mb.prototype=Object.create(Error.prototype),Mb.prototype.constructor=Mb,Mb.prototype.name="ReplaceError";var Ib=function(e,t,i){this.content=e,this.openStart=t,this.openEnd=i},Bb={size:{configurable:!0}};function Lb(e,t,i){if(i.openStart>e.depth)throw new Mb("Inserted content deeper than insertion position");if(e.depth-i.openStart!=t.depth-i.openEnd)throw new Mb("Inconsistent open depths");return function e(t,i,a,n){var r=t.index(n),o=t.node(n);if(r==i.index(n)&&n<t.depth-a.openStart){var s=e(t,i,a,n+1);return o.copy(o.content.replaceChild(r,s))}if(a.content.size){if(a.openStart||a.openEnd||t.depth!=n||i.depth!=n){var l=function(e,t){for(var i=t.depth-e.openStart,a=t.node(i).copy(e.content),n=i-1;n>=0;n--)a=t.node(n).copy(xb.from(a));return{start:a.resolveNoCache(e.openStart+i),end:a.resolveNoCache(a.content.size-e.openEnd-i)}}(a,t),u=l.start,_=l.end;return zb(o,function e(t,i,a,n,r){var o=t.depth>r&&jb(t,i,r+1),s=n.depth>r&&jb(a,n,r+1),l=[];Ub(null,t,r,l),o&&s&&i.index(r)==a.index(r)?(Pb(o,s),qb(zb(o,e(t,i,a,n,r+1)),l)):(o&&qb(zb(o,Gb(t,i,r+1)),l),Ub(i,a,r,l),s&&qb(zb(s,Gb(a,n,r+1)),l));return Ub(n,null,r,l),new xb(l)}(t,u,_,i,n))}var d=t.parent,c=d.content;return zb(d,c.cut(0,t.parentOffset).append(a.content).append(c.cut(i.parentOffset)))}return zb(o,Gb(t,i,n))}(e,t,i,0)}function Pb(e,t){if(!t.type.compatibleContent(e.type))throw new Mb("Cannot join "+t.type.name+" onto "+e.type.name)}function jb(e,t,i){var a=e.node(i);return Pb(a,t.node(i)),a}function qb(e,t){var i=t.length-1;i>=0&&e.isText&&e.sameMarkup(t[i])?t[i]=e.withText(t[i].text+e.text):t.push(e)}function Ub(e,t,i,a){var n=(t||e).node(i),r=0,o=t?t.index(i):n.childCount;e&&(r=e.index(i),e.depth>i?r++:e.textOffset&&(qb(e.nodeAfter,a),r++));for(var s=r;s<o;s++)qb(n.child(s),a);t&&t.depth==i&&t.textOffset&&qb(t.nodeBefore,a)}function zb(e,t){if(!e.type.validContent(t))throw new Mb("Invalid content for node "+e.type.name);return e.copy(t)}function Gb(e,t,i){var a=[];(Ub(null,e,i,a),e.depth>i)&&qb(zb(jb(e,t,i+1),Gb(e,t,i+1)),a);return Ub(t,null,i,a),new xb(a)}Bb.size.get=function(){return this.content.size-this.openStart-this.openEnd},Ib.prototype.insertAt=function(e,t){var i=function e(t,i,a,n){var r=t.findIndex(i),o=r.index,s=r.offset,l=t.maybeChild(o);if(s==i||l.isText)return n&&!n.canReplace(o,o,a)?null:t.cut(0,i).append(a).append(t.cut(i));var u=e(l.content,i-s-1,a);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return i&&new Ib(i,this.openStart,this.openEnd)},Ib.prototype.removeBetween=function(e,t){return new Ib(function e(t,i,a){var n=t.findIndex(i),r=n.index,o=n.offset,s=t.maybeChild(r),l=t.findIndex(a),u=l.index,_=l.offset;if(o==i||s.isText){if(_!=a&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,i).append(t.cut(a))}if(r!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e(s.content,i-o-1,a-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},Ib.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},Ib.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},Ib.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},Ib.fromJSON=function(e,t){if(!t)return Ib.empty;var i=t.openStart||0,a=t.openEnd||0;if("number"!=typeof i||"number"!=typeof a)throw new RangeError("Invalid input for Slice.fromJSON");return new Ib(xb.fromJSON(e,t.content),i,a)},Ib.maxOpen=function(e,t){void 0===t&&(t=!0);for(var i=0,a=0,n=e.firstChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.firstChild)i++;for(var r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)a++;return new Ib(e,i,a)},Object.defineProperties(Ib.prototype,Bb),Ib.empty=new Ib(xb.empty,0,0);var Hb=function(e,t,i){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=i},Yb={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};Hb.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Yb.parent.get=function(){return this.node(this.depth)},Yb.doc.get=function(){return this.node(0)},Hb.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},Hb.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},Hb.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},Hb.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},Hb.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},Hb.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},Hb.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},Yb.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Yb.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var i=this.pos-this.path[this.path.length-1],a=e.child(t);return i?e.child(t).cut(i):a},Yb.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},Hb.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var i=this.path[3*t],a=0==t?0:this.path[3*t-1]+1,n=0;n<e;n++)a+=i.child(n).nodeSize;return a},Hb.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return Rb.none;if(this.textOffset)return e.child(t).marks;var i=e.maybeChild(t-1),a=e.maybeChild(t);if(!i){var n=i;i=a,a=n}for(var r=i.marks,o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||a&&r[o].isInSet(a.marks)||(r=r[o--].removeFromSet(r));return r},Hb.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var i=t.marks,a=e.parent.maybeChild(e.index()),n=0;n<i.length;n++)!1!==i[n].type.spec.inclusive||a&&i[n].isInSet(a.marks)||(i=i[n--].removeFromSet(i));return i},Hb.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},Hb.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Kb(this,e,i)},Hb.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},Hb.prototype.max=function(e){return e.pos>this.pos?e:this},Hb.prototype.min=function(e){return e.pos<this.pos?e:this},Hb.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},Hb.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var i=[],a=0,n=t,r=e;;){var o=r.content.findIndex(n),s=o.index,l=o.offset,u=n-l;if(i.push(r,s,a+l),!u)break;if((r=r.child(s)).isText)break;n=u-1,a+=l+1}return new Hb(t,i,n)},Hb.resolveCached=function(e,t){for(var i=0;i<Vb.length;i++){var a=Vb[i];if(a.pos==t&&a.doc==e)return a}var n=Vb[Wb]=Hb.resolve(e,t);return Wb=(Wb+1)%$b,n},Object.defineProperties(Hb.prototype,Yb);var Vb=[],Wb=0,$b=12,Kb=function(e,t,i){this.$from=e,this.$to=t,this.depth=i},Qb={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};Qb.start.get=function(){return this.$from.before(this.depth+1)},Qb.end.get=function(){return this.$to.after(this.depth+1)},Qb.parent.get=function(){return this.$from.node(this.depth)},Qb.startIndex.get=function(){return this.$from.index(this.depth)},Qb.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(Kb.prototype,Qb);var Zb=Object.create(null),Xb=function(e,t,i,a){this.type=e,this.attrs=t,this.content=i||xb.empty,this.marks=a||Rb.none},Jb={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};Jb.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},Jb.childCount.get=function(){return this.content.childCount},Xb.prototype.child=function(e){return this.content.child(e)},Xb.prototype.maybeChild=function(e){return this.content.maybeChild(e)},Xb.prototype.forEach=function(e){this.content.forEach(e)},Xb.prototype.nodesBetween=function(e,t,i,a){void 0===a&&(a=0),this.content.nodesBetween(e,t,i,a,this)},Xb.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},Jb.textContent.get=function(){return this.textBetween(0,this.content.size,"")},Xb.prototype.textBetween=function(e,t,i,a){return this.content.textBetween(e,t,i,a)},Jb.firstChild.get=function(){return this.content.firstChild},Jb.lastChild.get=function(){return this.content.lastChild},Xb.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},Xb.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},Xb.prototype.hasMarkup=function(e,t,i){return this.type==e&&Ab(this.attrs,t||e.defaultAttrs||Zb)&&Rb.sameSet(this.marks,i||Rb.none)},Xb.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},Xb.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},Xb.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},Xb.prototype.slice=function(e,t,i){if(void 0===t&&(t=this.content.size),void 0===i&&(i=!1),e==t)return Ib.empty;var a=this.resolve(e),n=this.resolve(t),r=i?0:a.sharedDepth(t),o=a.start(r),s=a.node(r).content.cut(a.pos-o,n.pos-o);return new Ib(s,a.depth-r,n.depth-r)},Xb.prototype.replace=function(e,t,i){return Lb(this.resolve(e),this.resolve(t),i)},Xb.prototype.nodeAt=function(e){for(var t=this;;){var i=t.content.findIndex(e),a=i.index,n=i.offset;if(!(t=t.maybeChild(a)))return null;if(n==e||t.isText)return t;e-=n+1}},Xb.prototype.childAfter=function(e){var t=this.content.findIndex(e),i=t.index,a=t.offset;return{node:this.content.maybeChild(i),index:i,offset:a}},Xb.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),i=t.index,a=t.offset;if(a<e)return{node:this.content.child(i),index:i,offset:a};var n=this.content.child(i-1);return{node:n,index:i-1,offset:a-n.nodeSize}},Xb.prototype.resolve=function(e){return Hb.resolveCached(this,e)},Xb.prototype.resolveNoCache=function(e){return Hb.resolve(this,e)},Xb.prototype.rangeHasMark=function(e,t,i){var a=!1;return t>e&&this.nodesBetween(e,t,(function(e){return i.isInSet(e.marks)&&(a=!0),!a})),a},Jb.isBlock.get=function(){return this.type.isBlock},Jb.isTextblock.get=function(){return this.type.isTextblock},Jb.inlineContent.get=function(){return this.type.inlineContent},Jb.isInline.get=function(){return this.type.isInline},Jb.isText.get=function(){return this.type.isText},Jb.isLeaf.get=function(){return this.type.isLeaf},Jb.isAtom.get=function(){return this.type.isAtom},Xb.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var i=e.length-1;i>=0;i--)t=e[i].type.name+"("+t+")";return t}(this.marks,e)},Xb.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},Xb.prototype.canReplace=function(e,t,i,a,n){void 0===i&&(i=xb.empty),void 0===a&&(a=0),void 0===n&&(n=i.childCount);var r=this.contentMatchAt(e).matchFragment(i,a,n),o=r&&r.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=a;s<n;s++)if(!this.type.allowsMarks(i.child(s).marks))return!1;return!0},Xb.prototype.canReplaceWith=function(e,t,i,a){if(a&&!this.type.allowsMarks(a))return!1;var n=this.contentMatchAt(e).matchType(i),r=n&&n.matchFragment(this.content,t);return!!r&&r.validEnd},Xb.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},Xb.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var e=Rb.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Rb.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(e){return e.type.name})));this.content.forEach((function(e){return e.check()}))},Xb.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},Xb.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var i=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}var a=xb.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,a,i)},Object.defineProperties(Xb.prototype,Jb);var eE=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},tE={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};eE.parse=function(e,t){var i=new iE(e,t);if(null==i.next)return eE.empty;var a=nE(i);i.next&&i.err("Unexpected trailing text");var n=function(e){var t=Object.create(null);return function i(a){var n=[];a.forEach((function(t){e[t].forEach((function(t){var i=t.term,a=t.to;if(i){var r=n.indexOf(i),o=r>-1&&n[r+1];_E(e,a).forEach((function(e){o||n.push(i,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var r=t[a.join(",")]=new eE(a.indexOf(e.length-1)>-1),o=0;o<n.length;o+=2){var s=n[o+1].sort(uE);r.next.push(n[o],t[s.join(",")]||i(s))}return r}(_E(e,0))}(function(e){var t=[[]];return n(function e(t,r){if("choice"==t.type)return t.exprs.reduce((function(t,i){return t.concat(e(i,r))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],r);if(o==t.exprs.length-1)return s;n(s,r=i())}else{if("star"==t.type){var l=i();return a(r,l),n(e(t.expr,l),l),[a(l)]}if("plus"==t.type){var u=i();return n(e(t.expr,r),u),n(e(t.expr,u),u),[a(u)]}if("opt"==t.type)return[a(r)].concat(e(t.expr,r));if("range"==t.type){for(var _=r,d=0;d<t.min;d++){var c=i();n(e(t.expr,_),c),_=c}if(-1==t.max)n(e(t.expr,_),_);else for(var g=t.min;g<t.max;g++){var f=i();a(_,f),n(e(t.expr,_),f),_=f}return[a(_)]}if("name"==t.type)return[a(r,null,t.value)]}}(e,0),i()),t;function i(){return t.push([])-1}function a(e,i,a){var n={term:a,to:i};return t[e].push(n),n}function n(e,t){e.forEach((function(e){return e.to=t}))}}(a));return function(e,t){for(var i=0,a=[e];i<a.length;i++){for(var n=a[i],r=!n.validEnd,o=[],s=0;s<n.next.length;s+=2){var l=n.next[s],u=n.next[s+1];o.push(l.name),!r||l.isText||l.hasRequiredAttrs()||(r=!1),-1==a.indexOf(u)&&a.push(u)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(n,i),n},eE.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},eE.prototype.matchFragment=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.childCount);for(var a=this,n=t;a&&n<i;n++)a=a.matchType(e.child(n).type);return a},tE.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},tE.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},eE.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var i=0;i<e.next.length;i+=2)if(this.next[t]==e.next[i])return!0;return!1},eE.prototype.fillBefore=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=0);var a=[this];return function n(r,o){var s=r.matchFragment(e,i);if(s&&(!t||s.validEnd))return xb.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<r.next.length;l+=2){var u=r.next[l],_=r.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==a.indexOf(_)){a.push(_);var d=n(_,o.concat(u));if(d)return d}}}(this,[])},eE.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var i=this.computeWrapping(e);return this.wrapCache.push(e,i),i},eE.prototype.computeWrapping=function(e){for(var t=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var a=i.shift(),n=a.match;if(n.matchType(e)){for(var r=[],o=a;o.type;o=o.via)r.push(o.type);return r.reverse()}for(var s=0;s<n.next.length;s+=2){var l=n.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||a.type&&!n.next[s+1].validEnd||(i.push({match:l.contentMatch,type:l,via:a}),t[l.name]=!0)}}},tE.edgeCount.get=function(){return this.next.length>>1},eE.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},eE.prototype.toString=function(){var e=[];return function t(i){e.push(i);for(var a=1;a<i.next.length;a+=2)-1==e.indexOf(i.next[a])&&t(i.next[a])}(this),e.map((function(t,i){for(var a=i+(t.validEnd?"*":" ")+" ",n=0;n<t.next.length;n+=2)a+=(n?", ":"")+t.next[n].name+"->"+e.indexOf(t.next[n+1]);return a})).join("\n")},Object.defineProperties(eE.prototype,tE),eE.empty=new eE(!0);var iE=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},aE={next:{configurable:!0}};function nE(e){var t=[];do{t.push(rE(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function rE(e){var t=[];do{t.push(oE(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function oE(e){for(var t=function(e){if(e.eat("(")){var t=nE(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var i=function(e,t){var i=e.nodeTypes,a=i[t];if(a)return[a];var n=[];for(var r in i){var o=i[r];o.groups.indexOf(t)>-1&&n.push(o)}0==n.length&&e.err("No node type or group '"+t+"' found");return n}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=lE(e,t)}return t}function sE(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function lE(e,t){var i=sE(e),a=i;return e.eat(",")&&(a="}"!=e.next?sE(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:i,max:a,expr:t}}function uE(e,t){return t-e}function _E(e,t){var i=[];return function t(a){var n=e[a];if(1==n.length&&!n[0].term)return t(n[0].to);i.push(a);for(var r=0;r<n.length;r++){var o=n[r],s=o.term,l=o.to;s||-1!=i.indexOf(l)||t(l)}}(t),i.sort(uE)}function dE(e){var t=Object.create(null);for(var i in e){var a=e[i];if(!a.hasDefault)return null;t[i]=a.default}return t}function cE(e,t){var i=Object.create(null);for(var a in e){var n=t&&t[a];if(void 0===n){var r=e[a];if(!r.hasDefault)throw new RangeError("No value supplied for attribute "+a);n=r.default}i[a]=n}return i}function gE(e){var t=Object.create(null);if(e)for(var i in e)t[i]=new pE(e[i]);return t}aE.next.get=function(){return this.tokens[this.pos]},iE.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},iE.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(iE.prototype,aE);var fE=function(e,t,i){this.name=e,this.schema=t,this.spec=i,this.groups=i.group?i.group.split(" "):[],this.attrs=gE(i.attrs),this.defaultAttrs=dE(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==e),this.isText="text"==e},hE={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};hE.isInline.get=function(){return!this.isBlock},hE.isTextblock.get=function(){return this.isBlock&&this.inlineContent},hE.isLeaf.get=function(){return this.contentMatch==eE.empty},hE.isAtom.get=function(){return this.isLeaf||this.spec.atom},fE.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},fE.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},fE.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:cE(this.attrs,e)},fE.prototype.create=function(e,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xb(this,this.computeAttrs(e),xb.from(t),Rb.setFrom(i))},fE.prototype.createChecked=function(e,t,i){if(t=xb.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Xb(this,this.computeAttrs(e),t,Rb.setFrom(i))},fE.prototype.createAndFill=function(e,t,i){if(e=this.computeAttrs(e),(t=xb.from(t)).size){var a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}var n=this.contentMatch.matchFragment(t).fillBefore(xb.empty,!0);return n?new Xb(this,e,t.append(n),Rb.setFrom(i)):null},fE.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0},fE.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},fE.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},fE.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:Rb.empty:e},fE.compile=function(e,t){var i=Object.create(null);e.forEach((function(e,a){return i[e]=new fE(e,t,a)}));var a=t.spec.topNode||"doc";if(!i[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var n in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i},Object.defineProperties(fE.prototype,hE);var pE=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},mE={isRequired:{configurable:!0}};mE.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(pE.prototype,mE);var FE=function(e,t,i,a){this.name=e,this.schema=i,this.spec=a,this.attrs=gE(a.attrs),this.rank=t,this.excluded=null;var n=dE(this.attrs);this.instance=n&&new Rb(this,n)};FE.prototype.create=function(e){return!e&&this.instance?this.instance:new Rb(this,cE(this.attrs,e))},FE.compile=function(e,t){var i=Object.create(null),a=0;return e.forEach((function(e,n){return i[e]=new FE(e,a++,t,n)})),i},FE.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e},FE.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},FE.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var bE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},EE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},yE={ol:!0,ul:!0};function DE(e){return(e?1:0)|("full"===e?2:0)}var vE=function(e,t,i,a,n,r,o){this.type=e,this.attrs=t,this.solid=n,this.match=r||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=i,this.activeMarks=Rb.none,this.pendingMarks=a,this.stashMarks=[]};vE.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(xb.from(e));if(!t){var i,a=this.type.contentMatch;return(i=a.findWrapping(e.type))?(this.match=a,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},vE.prototype.finish=function(e){if(!(1&this.options)){var t,i=this.content[this.content.length-1];i&&i.isText&&(t=/[ \t\r\n\u000c]+$/.exec(i.text))&&(i.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length)))}var a=xb.from(this.content);return!e&&this.match&&(a=a.append(this.match.fillBefore(xb.empty,!0))),this.type?this.type.create(this.attrs,a,this.marks):a},vE.prototype.popFromStashMark=function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},vE.prototype.applyPending=function(e){for(var t=0,i=this.pendingMarks;t<i.length;t++){var a=i[t];(this.type?this.type.allowsMarkType(a.type):wE(a.type,e))&&!a.isInSet(this.activeMarks)&&(this.activeMarks=a.addToSet(this.activeMarks),this.pendingMarks=a.removeFromSet(this.pendingMarks))}},vE.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!bE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var kE=function(e,t,i){this.parser=e,this.options=t,this.isOpen=i;var a,n=t.topNode,r=DE(t.preserveWhitespace)|(i?4:0);a=n?new vE(n.type,n.attrs,Rb.none,Rb.none,!0,t.topMatch||n.type.contentMatch,r):new vE(i?null:e.schema.topNodeType,null,Rb.none,Rb.none,!0,null,r),this.nodes=[a],this.open=0,this.find=t.findPositions,this.needsBlock=!1},SE={top:{configurable:!0},currentPos:{configurable:!0}};function wE(e,t){var i=t.schema.nodes,a=function(a){var n=i[a];if(n.allowsMarkType(e)){var r=[],o=function(e){r.push(e);for(var i=0;i<e.edgeCount;i++){var a=e.edge(i),n=a.type,s=a.next;if(n==t)return!0;if(r.indexOf(s)<0&&o(s))return!0}};return o(n.contentMatch)?{v:!0}:void 0}};for(var n in i){var r=a(n);if(r)return r.v}}SE.top.get=function(){return this.nodes[this.open]},kE.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),i=t?this.readStyles(function(e){var t,i=/\s*([\w-]+)\s*:\s*([^;]+)/g,a=[];for(;t=i.exec(e);)a.push(t[1],t[2].trim());return a}(t)):null,a=this.top;if(null!=i)for(var n=0;n<i.length;n++)this.addPendingMark(i[n]);if(this.addElement(e),null!=i)for(var r=0;r<i.length;r++)this.removePendingMark(i[r],a)}},kE.prototype.addTextNode=function(e){var t=e.nodeValue,i=this.top;if(2&i.options||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&i.options)t=2&i.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var a=i.content[i.content.length-1],n=e.previousSibling;(!a||n&&"BR"==n.nodeName||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},kE.prototype.addElement=function(e,t){var i,a=e.nodeName.toLowerCase();yE.hasOwnProperty(a)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,i=null;t;t=t.nextSibling){var a=1==t.nodeType?t.nodeName.toLowerCase():null;a&&yE.hasOwnProperty(a)&&i?(i.appendChild(t),t=i):"li"==a?i=t:a&&(i=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(n?n.ignore:EE.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e);else if(!n||n.skip||n.closeParent){n&&n.closeParent?this.open=Math.max(0,this.open-1):n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,s=this.needsBlock;if(bE.hasOwnProperty(a))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,n,!1===n.consuming?i:null)},kE.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},kE.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},kE.prototype.readStyles=function(e){var t=Rb.none;e:for(var i=0;i<e.length;i+=2)for(var a=null;;){var n=this.parser.matchStyle(e[i],e[i+1],this,a);if(!n)continue e;if(n.ignore)return null;if(t=this.parser.schema.marks[n.mark].create(n.attrs).addToSet(t),!1!==n.consuming)break;a=n}return t},kE.prototype.addElementByRule=function(e,t,i){var a,n,r,o=this;t.node?(n=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(n.create(t.attrs))||this.leafFallback(e):a=this.enter(n,t.attrs,t.preserveWhitespace):(r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r));var s=this.top;if(n&&n.isLeaf)this.findInside(e);else if(i)this.addElement(e,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,a)}a&&(this.sync(s),this.open--),r&&this.removePendingMark(r,s)},kE.prototype.addAll=function(e,t,i,a){for(var n=i||0,r=i?e.childNodes[i]:e.firstChild,o=null==a?null:e.childNodes[a];r!=o;r=r.nextSibling,++n)this.findAtPoint(e,n),this.addDOM(r),t&&bE.hasOwnProperty(r.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,n)},kE.prototype.findPlace=function(e){for(var t,i,a=this.open;a>=0;a--){var n=this.nodes[a],r=n.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,i=n,!r.length))break;if(n.solid)break}if(!t)return!1;this.sync(i);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},kE.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var i=this.top;i.applyPending(e.type),i.match&&(i.match=i.match.matchType(e.type));for(var a=i.activeMarks,n=0;n<e.marks.length;n++)i.type&&!i.type.allowsMarkType(e.marks[n].type)||(a=e.marks[n].addToSet(a));return i.content.push(e.mark(a)),!0}return!1},kE.prototype.enter=function(e,t,i){var a=this.findPlace(e.create(t));return a&&this.enterInner(e,t,!0,i),a},kE.prototype.enterInner=function(e,t,i,a){this.closeExtra();var n=this.top;n.applyPending(e),n.match=n.match&&n.match.matchType(e,t);var r=null==a?-5&n.options:DE(a);4&n.options&&0==n.content.length&&(r|=4),this.nodes.push(new vE(e,t,n.activeMarks,n.pendingMarks,i,null,r)),this.open++},kE.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},kE.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},kE.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},SE.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var i=this.nodes[t].content,a=i.length-1;a>=0;a--)e+=i[a].nodeSize;t&&e++}return e},kE.prototype.findAtPoint=function(e,t){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)},kE.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},kE.prototype.findAround=function(e,t,i){if(e!=t&&this.find)for(var a=0;a<this.find.length;a++){if(null==this.find[a].pos&&1==e.nodeType&&e.contains(this.find[a].node))t.compareDocumentPosition(this.find[a].node)&(i?2:4)&&(this.find[a].pos=this.currentPos)}},kE.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},kE.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var i=e.split("/"),a=this.options.context,n=!(this.isOpen||a&&a.parent.type!=this.nodes[0].type),r=-(a?a.depth+1:0)+(n?0:1),o=function(e,s){for(;e>=0;e--){var l=i[e];if(""==l){if(e==i.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&n?t.nodes[s].type:a&&s>=r?a.node(s-r).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(i.length-1,this.open)},kE.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var a in this.parser.schema.nodes){var n=this.parser.schema.nodes[a];if(n.isTextblock&&n.defaultAttrs)return n}},kE.prototype.addPendingMark=function(e){var t=function(e,t){for(var i=0;i<t.length;i++)if(e.eq(t[i]))return t[i]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},kE.prototype.removePendingMark=function(e,t){for(var i=this.open;i>=0;i--){var a=this.nodes[i];if(a.pendingMarks.lastIndexOf(e)>-1)a.pendingMarks=e.removeFromSet(a.pendingMarks);else{a.activeMarks=e.removeFromSet(a.activeMarks);var n=a.popFromStashMark(e);n&&a.type&&a.type.allowsMarkType(n.type)&&(a.activeMarks=n.addToSet(a.activeMarks))}if(a==t)break}},Object.defineProperties(kE.prototype,SE);var CE=Math.pow(2,16);function xE(e){return 65535&e}var TE=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),this.pos=e,this.deleted=t,this.recover=i},OE=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};OE.prototype.recover=function(e){var t=0,i=xE(e);if(!this.inverted)for(var a=0;a<i;a++)t+=this.ranges[3*a+2]-this.ranges[3*a+1];return this.ranges[3*i]+t+function(e){return(e-(65535&e))/CE}(e)},OE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},OE.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},OE.prototype._map=function(e,t,i){for(var a=0,n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?a:0);if(s>e)break;var l=this.ranges[o+n],u=this.ranges[o+r],_=s+l;if(e<=_){var d=s+a+((l?e==s?-1:e==_?1:t:t)<0?0:u);if(i)return d;var c=e==(t<0?s:_)?null:o/3+(e-s)*CE;return new TE(d,t<0?e!=s:e!=_,c)}a+=u-l}return i?e+a:new TE(e+a)},OE.prototype.touches=function(e,t){for(var i=0,a=xE(t),n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+n];if(e<=s+l&&o==3*a)return!0;i+=this.ranges[o+r]-l}return!1},OE.prototype.forEach=function(e){for(var t=this.inverted?2:1,i=this.inverted?1:2,a=0,n=0;a<this.ranges.length;a+=3){var r=this.ranges[a],o=r-(this.inverted?n:0),s=r+(this.inverted?0:n),l=this.ranges[a+t],u=this.ranges[a+i];e(o,o+l,s,s+u),n+=u-l}},OE.prototype.invert=function(){return new OE(this.ranges,!this.inverted)},OE.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},OE.offset=function(e){return 0==e?OE.empty:new OE(e<0?[0,-e,0]:[0,0,e])},OE.empty=new OE([]);var NE=function(e,t,i,a){this.maps=e||[],this.from=i||0,this.to=null==a?this.maps.length:a,this.mirror=t};function AE(e){var t=Error.call(this,e);return t.__proto__=AE.prototype,t}NE.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new NE(this.maps,this.mirror,e,t)},NE.prototype.copy=function(){return new NE(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},NE.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},NE.prototype.appendMapping=function(e){for(var t=0,i=this.maps.length;t<e.maps.length;t++){var a=e.getMirror(t);this.appendMap(e.maps[t],null!=a&&a<t?i+a:null)}},NE.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},NE.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},NE.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,i=this.maps.length+e.maps.length;t>=0;t--){var a=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=a&&a>t?i-a-1:null)}},NE.prototype.invert=function(){var e=new NE;return e.appendMappingInverted(this),e},NE.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var i=this.from;i<this.to;i++)e=this.maps[i].map(e,t);return e},NE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},NE.prototype._map=function(e,t,i){for(var a=!1,n=this.from;n<this.to;n++){var r=this.maps[n].mapResult(e,t);if(null!=r.recover){var o=this.getMirror(n);if(null!=o&&o>n&&o<this.to){n=o,e=this.maps[o].recover(r.recover);continue}}r.deleted&&(a=!0),e=r.pos}return i?e:new TE(e,a)},AE.prototype=Object.create(Error.prototype),AE.prototype.constructor=AE,AE.prototype.name="TransformError";var RE=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new NE},ME={before:{configurable:!0},docChanged:{configurable:!0}};function IE(){throw new Error("Override me")}ME.before.get=function(){return this.docs.length?this.docs[0]:this.doc},RE.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new AE(t.failed);return this},RE.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},ME.docChanged.get=function(){return this.steps.length>0},RE.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(RE.prototype,ME);var BE=Object.create(null),LE=function(){};LE.prototype.apply=function(e){return IE()},LE.prototype.getMap=function(){return OE.empty},LE.prototype.invert=function(e){return IE()},LE.prototype.map=function(e){return IE()},LE.prototype.merge=function(e){return null},LE.prototype.toJSON=function(){return IE()},LE.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=BE[t.stepType];if(!i)throw new RangeError("No step type "+t.stepType+" defined");return i.fromJSON(e,t)},LE.jsonID=function(e,t){if(e in BE)throw new RangeError("Duplicate use of step JSON ID "+e);return BE[e]=t,t.prototype.jsonID=e,t};var PE=function(e,t){this.doc=e,this.failed=t};PE.ok=function(e){return new PE(e,null)},PE.fail=function(e){return new PE(null,e)},PE.fromReplace=function(e,t,i,a){try{return PE.ok(e.replace(t,i,a))}catch(e){if(e instanceof Mb)return PE.fail(e.message);throw e}};var jE=function(e){function t(t,i,a,n){e.call(this),this.from=t,this.to=i,this.slice=a,this.structure=!!n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&UE(e,this.from,this.to)?PE.fail("Structure replace would overwrite content"):PE.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new OE([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted?null:new t(i.pos,Math.max(i.pos,a.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var i=this.slice.size+e.slice.size==0?Ib.empty:new Ib(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,i,this.structure)}var a=this.slice.size+e.slice.size==0?Ib.empty:new Ib(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),a,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(i.from,i.to,Ib.fromJSON(e,i.slice),!!i.structure)},t}(LE);LE.jsonID("replace",jE);var qE=function(e){function t(t,i,a,n,r,o,s){e.call(this),this.from=t,this.to=i,this.gapFrom=a,this.gapTo=n,this.slice=r,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(UE(e,this.from,this.gapFrom)||UE(e,this.gapTo,this.to)))return PE.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return PE.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,t.content);return i?PE.fromReplace(e,this.from,this.to,i):PE.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new OE([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var i=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+i,this.from+this.insert,this.from+this.insert+i,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1),n=e.map(this.gapFrom,-1),r=e.map(this.gapTo,1);return i.deleted&&a.deleted||n<i.pos||r>a.pos?null:new t(i.pos,a.pos,n,r,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to||"number"!=typeof i.gapFrom||"number"!=typeof i.gapTo||"number"!=typeof i.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(i.from,i.to,i.gapFrom,i.gapTo,Ib.fromJSON(e,i.slice),i.insert,!!i.structure)},t}(LE);function UE(e,t,i){for(var a=e.resolve(t),n=i-t,r=a.depth;n>0&&r>0&&a.indexAfter(r)==a.node(r).childCount;)r--,n--;if(n>0)for(var o=a.node(r).maybeChild(a.indexAfter(r));n>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,n--}return!1}function zE(e,t,i){for(var a=[],n=0;n<e.childCount;n++){var r=e.child(n);r.content.size&&(r=r.copy(zE(r.content,t,r))),r.isInline&&(r=t(r,i,n)),a.push(r)}return xb.fromArray(a)}LE.jsonID("replaceAround",qE),RE.prototype.lift=function(e,t){for(var i=e.$from,a=e.$to,n=e.depth,r=i.before(n+1),o=a.after(n+1),s=r,l=o,u=xb.empty,_=0,d=n,c=!1;d>t;d--)c||i.index(d)>0?(c=!0,u=xb.from(i.node(d).copy(u)),_++):s--;for(var g=xb.empty,f=0,h=n,p=!1;h>t;h--)p||a.after(h+1)<a.end(h)?(p=!0,g=xb.from(a.node(h).copy(g)),f++):l++;return this.step(new qE(s,l,r,o,new Ib(u.append(g),_,f),u.size-_,!0))},RE.prototype.wrap=function(e,t){for(var i=xb.empty,a=t.length-1;a>=0;a--)i=xb.from(t[a].type.create(t[a].attrs,i));var n=e.start,r=e.end;return this.step(new qE(n,r,n,r,new Ib(i,0,0),t.length,!0))},RE.prototype.setBlockType=function(e,t,i,a){var n=this;if(void 0===t&&(t=e),!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var r=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(i,a)&&function(e,t,i){var a=e.resolve(t),n=a.index();return a.parent.canReplaceWith(n,n+1,i)}(n.doc,n.mapping.slice(r).map(t),i)){n.clearIncompatible(n.mapping.slice(r).map(t,1),i);var o=n.mapping.slice(r),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return n.step(new qE(s,l,s+1,l-1,new Ib(xb.from(i.create(a,null,e.marks)),0,0),1,!0)),!1}})),this},RE.prototype.setNodeMarkup=function(e,t,i,a){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at given position");t||(t=n.type);var r=t.create(i,null,a||n.marks);if(n.isLeaf)return this.replaceWith(e,e+n.nodeSize,r);if(!t.validContent(n.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new qE(e,e+n.nodeSize,e+1,e+n.nodeSize-1,new Ib(xb.from(r),0,0),1,!0))},RE.prototype.split=function(e,t,i){void 0===t&&(t=1);for(var a=this.doc.resolve(e),n=xb.empty,r=xb.empty,o=a.depth,s=a.depth-t,l=t-1;o>s;o--,l--){n=xb.from(a.node(o).copy(n));var u=i&&i[l];r=xb.from(u?u.type.create(u.attrs,r):a.node(o).copy(r))}return this.step(new jE(e,e,new Ib(n.append(r),t,t),!0))},RE.prototype.join=function(e,t){void 0===t&&(t=1);var i=new jE(e-t,e+t,Ib.empty,!0);return this.step(i)};var GE=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=e.resolve(this.from),n=a.node(a.sharedDepth(this.to)),r=new Ib(zE(i.content,(function(e,i){return e.isAtom&&i.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),n),i.openStart,i.openEnd);return PE.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new HE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(LE);LE.jsonID("addMark",GE);var HE=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=new Ib(zE(i.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),i.openStart,i.openEnd);return PE.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new GE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(LE);function YE(e,t,i){return!i.openStart&&!i.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),i.content)}LE.jsonID("removeMark",HE),RE.prototype.addMark=function(e,t,i){var a=this,n=[],r=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(a,l,u){if(a.isInline){var _=a.marks;if(!i.isInSet(_)&&u.type.allowsMarkType(i.type)){for(var d=Math.max(l,e),c=Math.min(l+a.nodeSize,t),g=i.addToSet(_),f=0;f<_.length;f++)_[f].isInSet(g)||(o&&o.to==d&&o.mark.eq(_[f])?o.to=c:n.push(o=new HE(d,c,_[f])));s&&s.to==d?s.to=c:r.push(s=new GE(d,c,i))}}})),n.forEach((function(e){return a.step(e)})),r.forEach((function(e){return a.step(e)})),this},RE.prototype.removeMark=function(e,t,i){var a=this;void 0===i&&(i=null);var n=[],r=0;return this.doc.nodesBetween(e,t,(function(a,o){if(a.isInline){r++;var s=null;if(i instanceof FE)for(var l,u=a.marks;l=i.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else i?i.isInSet(a.marks)&&(s=[i]):s=a.marks;if(s&&s.length)for(var _=Math.min(o+a.nodeSize,t),d=0;d<s.length;d++){for(var c=s[d],g=void 0,f=0;f<n.length;f++){var h=n[f];h.step==r-1&&c.eq(n[f].style)&&(g=h)}g?(g.to=_,g.step=r):n.push({style:c,from:Math.max(o,e),to:_,step:r})}}})),n.forEach((function(e){return a.step(new HE(e.from,e.to,e.style))})),this},RE.prototype.clearIncompatible=function(e,t,i){void 0===i&&(i=t.contentMatch);for(var a=this.doc.nodeAt(e),n=[],r=e+1,o=0;o<a.childCount;o++){var s=a.child(o),l=r+s.nodeSize,u=i.matchType(s.type,s.attrs);if(u){i=u;for(var _=0;_<s.marks.length;_++)t.allowsMarkType(s.marks[_].type)||this.step(new HE(r,l,s.marks[_]))}else n.push(new jE(r,l,Ib.empty));r=l}if(!i.validEnd){var d=i.fillBefore(xb.empty,!0);this.replace(r,r,new Ib(d,0,0))}for(var c=n.length-1;c>=0;c--)this.step(n[c]);return this},RE.prototype.replace=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=Ib.empty);var a=function(e,t,i,a){if(void 0===i&&(i=t),void 0===a&&(a=Ib.empty),t==i&&!a.size)return null;var n=e.resolve(t),r=e.resolve(i);return YE(n,r,a)?new jE(t,i,a):new VE(n,r,a).fit()}(this.doc,e,t,i);return a&&this.step(a),this},RE.prototype.replaceWith=function(e,t,i){return this.replace(e,t,new Ib(xb.from(i),0,0))},RE.prototype.delete=function(e,t){return this.replace(e,t,Ib.empty)},RE.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var VE=function(e,t,i){this.$to=t,this.$from=e,this.unplaced=i,this.frontier=[];for(var a=0;a<=e.depth;a++){var n=e.node(a);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(a))})}this.placed=xb.empty;for(var r=e.depth;r>0;r--)this.placed=xb.from(e.node(r).copy(this.placed))},WE={depth:{configurable:!0}};function $E(e,t,i){return 0==t?e.cutByIndex(i):e.replaceChild(0,e.firstChild.copy($E(e.firstChild.content,t-1,i)))}function KE(e,t,i){return 0==t?e.append(i):e.replaceChild(e.childCount-1,e.lastChild.copy(KE(e.lastChild.content,t-1,i)))}function QE(e,t){for(var i=0;i<t;i++)e=e.firstChild.content;return e}function ZE(e,t,i){if(t<=0)return e;var a=e.content;return t>1&&(a=a.replaceChild(0,ZE(a.firstChild,t-1,1==a.childCount?i-1:0))),t>0&&(a=e.type.contentMatch.fillBefore(a).append(a),i<=0&&(a=a.append(e.type.contentMatch.matchFragment(a).fillBefore(xb.empty,!0)))),e.copy(a)}function XE(e,t,i,a,n){var r=e.node(t),o=n?e.indexAfter(t):e.index(t);if(o==r.childCount&&!i.compatibleContent(r.type))return null;var s=a.fillBefore(r.content,!0,o);return s&&!function(e,t,i){for(var a=i;a<t.childCount;a++)if(!e.allowsMarks(t.child(a).marks))return!0;return!1}(i,r.content,o)?s:null}function JE(e,t,i,a,n){if(t<i){var r=e.firstChild;e=e.replaceChild(0,r.copy(JE(r.content,t+1,i,a,r)))}if(t>a){var o=n.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(xb.empty,!0))}return e}function ey(e,t){for(var i=[],a=Math.min(e.depth,t.depth);a>=0;a--){var n=e.start(a);if(n<e.pos-(e.depth-a)||t.end(a)>t.pos+(t.depth-a)||e.node(a).type.spec.isolating||t.node(a).type.spec.isolating)break;(n==t.start(a)||a==e.depth&&a==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&a&&t.start(a-1)==n-1)&&i.push(a)}return i}WE.depth.get=function(){return this.frontier.length-1},VE.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),i=this.placed.size-this.depth-this.$from.depth,a=this.$from,n=this.close(t<0?this.$to:a.doc.resolve(t));if(!n)return null;for(var r=this.placed,o=a.depth,s=n.depth;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;var l=new Ib(r,o,s);return t>-1?new qE(a.pos,t,this.$to.pos,this.$to.end(),l,i):l.size||a.pos!=this.$to.pos?new jE(a.pos,n.pos,l):void 0},VE.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var i=void 0,a=(t?(i=QE(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,n=this.depth;n>=0;n--){var r=this.frontier[n],o=r.type,s=r.match,l=void 0,u=void 0;if(1==e&&(a?s.matchType(a.type)||(u=s.fillBefore(xb.from(a),!1)):o.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:n,parent:i,inject:u};if(2==e&&a&&(l=s.findWrapping(a.type)))return{sliceDepth:t,frontierDepth:n,parent:i,wrap:l};if(i&&s.matchType(i.type))break}},VE.prototype.openMore=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=QE(t,i);return!(!n.childCount||n.firstChild.isLeaf)&&(this.unplaced=new Ib(t,i+1,Math.max(a,n.size+i>=t.size-a?i+1:0)),!0)},VE.prototype.dropNode=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=QE(t,i);if(n.childCount<=1&&i>0){var r=t.size-i<=i+n.size;this.unplaced=new Ib($E(t,i-1,1),i-1,r?i-1:a)}else this.unplaced=new Ib($E(t,i,1),i,a)},VE.prototype.placeNodes=function(e){for(var t=e.sliceDepth,i=e.frontierDepth,a=e.parent,n=e.inject,r=e.wrap;this.depth>i;)this.closeFrontierNode();if(r)for(var o=0;o<r.length;o++)this.openFrontierNode(r[o]);var s=this.unplaced,l=a?a.content:s.content,u=s.openStart-t,_=0,d=[],c=this.frontier[i],g=c.match,f=c.type;if(n){for(var h=0;h<n.childCount;h++)d.push(n.child(h));g=g.matchFragment(n)}for(var p=l.size+t-(s.content.size-s.openEnd);_<l.childCount;){var m=l.child(_),F=g.matchType(m.type);if(!F)break;(++_>1||0==u||m.content.size)&&(g=F,d.push(ZE(m.mark(f.allowedMarks(m.marks)),1==_?u:0,_==l.childCount?p:-1)))}var b=_==l.childCount;b||(p=-1),this.placed=KE(this.placed,i,xb.from(d)),this.frontier[i].match=g,b&&p<0&&a&&a.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,y=l;E<p;E++){var D=y.lastChild;this.frontier.push({type:D.type,match:D.contentMatchAt(D.childCount)}),y=D.content}this.unplaced=b?0==t?Ib.empty:new Ib($E(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new Ib($E(s.content,t,_),s.openStart,s.openEnd)},VE.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!XE(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var i=this.$to.depth,a=this.$to.after(i);i>1&&a==this.$to.end(--i);)++a;return a},VE.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var i=this.frontier[t],a=i.match,n=i.type,r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=XE(e,t,n,a,r);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,_=XE(e,s,l.type,u,!0);if(!_||_.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}},VE.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=KE(this.placed,t.depth,t.fit)),e=t.move;for(var i=t.depth+1;i<=e.depth;i++){var a=e.node(i),n=a.type.contentMatch.fillBefore(a.content,!0,e.index(i));this.openFrontierNode(a.type,a.attrs,n)}return e},VE.prototype.openFrontierNode=function(e,t,i){var a=this.frontier[this.depth];a.match=a.match.matchType(e),this.placed=KE(this.placed,this.depth,xb.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})},VE.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(xb.empty,!0);e.childCount&&(this.placed=KE(this.placed,this.frontier.length,e))},Object.defineProperties(VE.prototype,WE),RE.prototype.replaceRange=function(e,t,i){if(!i.size)return this.deleteRange(e,t);var a=this.doc.resolve(e),n=this.doc.resolve(t);if(YE(a,n,i))return this.step(new jE(e,t,i));var r=ey(a,this.doc.resolve(t));0==r[r.length-1]&&r.pop();var o=-(a.depth+1);r.unshift(o);for(var s=a.depth,l=a.pos-1;s>0;s--,l--){var u=a.node(s).type.spec;if(u.defining||u.isolating)break;r.indexOf(s)>-1?o=s:a.before(s)==l&&r.splice(1,0,-s)}for(var _=r.indexOf(o),d=[],c=i.openStart,g=i.content,f=0;;f++){var h=g.firstChild;if(d.push(h),f==i.openStart)break;g=h.content}c>0&&d[c-1].type.spec.defining&&a.node(_).type!=d[c-1].type?c-=1:c>=2&&d[c-1].isTextblock&&d[c-2].type.spec.defining&&a.node(_).type!=d[c-2].type&&(c-=2);for(var p=i.openStart;p>=0;p--){var m=(p+c+1)%(i.openStart+1),F=d[m];if(F)for(var b=0;b<r.length;b++){var E=r[(b+_)%r.length],y=!0;E<0&&(y=!1,E=-E);var D=a.node(E-1),v=a.index(E-1);if(D.canReplaceWith(v,v,F.type,F.marks))return this.replace(a.before(E),y?n.after(E):t,new Ib(JE(i.content,0,i.openStart,m),m,i.openEnd))}}for(var k=this.steps.length,S=r.length-1;S>=0&&(this.replace(e,t,i),!(this.steps.length>k));S--){var w=r[S];w<0||(e=a.before(w),t=n.after(w))}return this},RE.prototype.replaceRangeWith=function(e,t,i){if(!i.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var a=function(e,t,i){var a=e.resolve(t);if(a.parent.canReplaceWith(a.index(),a.index(),i))return t;if(0==a.parentOffset)for(var n=a.depth-1;n>=0;n--){var r=a.index(n);if(a.node(n).canReplaceWith(r,r,i))return a.before(n+1);if(r>0)return null}if(a.parentOffset==a.parent.content.size)for(var o=a.depth-1;o>=0;o--){var s=a.indexAfter(o);if(a.node(o).canReplaceWith(s,s,i))return a.after(o+1);if(s<a.node(o).childCount)return null}}(this.doc,e,i.type);null!=a&&(e=t=a)}return this.replaceRange(e,t,new Ib(xb.from(i),0,0))},RE.prototype.deleteRange=function(e,t){for(var i=this.doc.resolve(e),a=this.doc.resolve(t),n=ey(i,a),r=0;r<n.length;r++){var o=n[r],s=r==n.length-1;if(s&&0==o||i.node(o).type.contentMatch.validEnd)return this.delete(i.start(o),a.end(o));if(o>0&&(s||i.node(o-1).canReplace(i.index(o-1),a.indexAfter(o-1))))return this.delete(i.before(o),a.after(o))}for(var l=1;l<=i.depth&&l<=a.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&a.end(l)-t!=a.depth-l)return this.delete(i.before(l),t);return this.delete(e,t)};var ty=Object.create(null),iy=function(e,t,i){this.ranges=i||[new ny(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},ay={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ay.anchor.get=function(){return this.$anchor.pos},ay.head.get=function(){return this.$head.pos},ay.from.get=function(){return this.$from.pos},ay.to.get=function(){return this.$to.pos},ay.$from.get=function(){return this.ranges[0].$from},ay.$to.get=function(){return this.ranges[0].$to},ay.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},iy.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},iy.prototype.replace=function(e,t){void 0===t&&(t=Ib.empty);for(var i=t.content.lastChild,a=null,n=0;n<t.openEnd;n++)a=i,i=i.lastChild;for(var r=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,_=l.$to,d=e.mapping.slice(r);e.replaceRange(d.map(u.pos),d.map(_.pos),s?Ib.empty:t),0==s&&cy(e,r,(i?i.isInline:a&&a.isTextblock)?-1:1)}},iy.prototype.replaceWith=function(e,t){for(var i=e.steps.length,a=this.ranges,n=0;n<a.length;n++){var r=a[n],o=r.$from,s=r.$to,l=e.mapping.slice(i),u=l.map(o.pos),_=l.map(s.pos);n?e.deleteRange(u,_):(e.replaceRangeWith(u,_,t),cy(e,i,t.isInline?-1:1))}},iy.findFrom=function(e,t,i){var a=e.parent.inlineContent?new ry(e):dy(e.node(0),e.parent,e.pos,e.index(),t,i);if(a)return a;for(var n=e.depth-1;n>=0;n--){var r=t<0?dy(e.node(0),e.node(n),e.before(n+1),e.index(n),t,i):dy(e.node(0),e.node(n),e.after(n+1),e.index(n)+1,t,i);if(r)return r}},iy.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new uy(e.node(0))},iy.atStart=function(e){return dy(e,e,0,0,1)||new uy(e)},iy.atEnd=function(e){return dy(e,e,e.content.size,e.childCount,-1)||new uy(e)},iy.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=ty[t.type];if(!i)throw new RangeError("No selection type "+t.type+" defined");return i.fromJSON(e,t)},iy.jsonID=function(e,t){if(e in ty)throw new RangeError("Duplicate use of selection JSON ID "+e);return ty[e]=t,t.prototype.jsonID=e,t},iy.prototype.getBookmark=function(){return ry.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(iy.prototype,ay),iy.prototype.visible=!0;var ny=function(e,t){this.$from=e,this.$to=t},ry=function(e){function t(t,i){void 0===i&&(i=t),e.call(this,t,i)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={$cursor:{configurable:!0}};return i.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));if(!n.parent.inlineContent)return e.near(n);var r=i.resolve(a.map(this.anchor));return new t(r.parent.inlineContent?r:n,n)},t.prototype.replace=function(t,i){if(void 0===i&&(i=Ib.empty),e.prototype.replace.call(this,t,i),i==Ib.empty){var a=this.$from.marksAcross(this.$to);a&&t.ensureMarks(a)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new oy(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.anchor||"number"!=typeof i.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(i.anchor),e.resolve(i.head))},t.create=function(e,t,i){void 0===i&&(i=t);var a=e.resolve(t);return new this(a,i==t?a:e.resolve(i))},t.between=function(i,a,n){var r=i.pos-a.pos;if(n&&!r||(n=r>=0?1:-1),!a.parent.inlineContent){var o=e.findFrom(a,n,!0)||e.findFrom(a,-n,!0);if(!o)return e.near(a,n);a=o.$head}return i.parent.inlineContent||(0==r||(i=(e.findFrom(i,-n,!0)||e.findFrom(i,n,!0)).$anchor).pos<a.pos!=r<0)&&(i=a),new t(i,a)},Object.defineProperties(t.prototype,i),t}(iy);iy.jsonID("text",ry);var oy=function(e,t){this.anchor=e,this.head=t};oy.prototype.map=function(e){return new oy(e.map(this.anchor),e.map(this.head))},oy.prototype.resolve=function(e){return ry.between(e.resolve(this.anchor),e.resolve(this.head))};var sy=function(e){function t(t){var i=t.nodeAfter,a=t.node(0).resolve(t.pos+i.nodeSize);e.call(this,t,a),this.node=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=a.mapResult(this.anchor),r=n.deleted,o=n.pos,s=i.resolve(o);return r?e.near(s):new t(s)},t.prototype.content=function(){return new Ib(xb.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new ly(this.anchor)},t.fromJSON=function(e,i){if("number"!=typeof i.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(i.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(iy);sy.prototype.visible=!1,iy.jsonID("node",sy);var ly=function(e){this.anchor=e};ly.prototype.map=function(e){var t=e.mapResult(this.anchor),i=t.deleted,a=t.pos;return i?new oy(a,a):new ly(a)},ly.prototype.resolve=function(e){var t=e.resolve(this.anchor),i=t.nodeAfter;return i&&sy.isSelectable(i)?new sy(t):iy.near(t)};var uy=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,i){if(void 0===i&&(i=Ib.empty),i==Ib.empty){t.delete(0,t.doc.content.size);var a=e.atStart(t.doc);a.eq(t.selection)||t.setSelection(a)}else e.prototype.replace.call(this,t,i)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return _y},t}(iy);iy.jsonID("all",uy);var _y={map:function(){return this},resolve:function(e){return new uy(e)}};function dy(e,t,i,a,n,r){if(t.inlineContent)return ry.create(e,i);for(var o=a-(n>0?0:1);n>0?o<t.childCount:o>=0;o+=n){var s=t.child(o);if(s.isAtom){if(!r&&sy.isSelectable(s))return sy.create(e,i-(n<0?s.nodeSize:0))}else{var l=dy(e,s,i+n,n<0?s.childCount:0,n,r);if(l)return l}i+=s.nodeSize*n}}function cy(e,t,i){var a=e.steps.length-1;if(!(a<t)){var n,r=e.steps[a];if(r instanceof jE||r instanceof qE)e.mapping.maps[a].forEach((function(e,t,i,a){null==n&&(n=a)})),e.setSelection(iy.near(e.doc.resolve(n),i))}}var gy=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return i.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},i.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return Rb.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},i.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,i){e.prototype.addStep.call(this,t,i),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var i=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Rb.none))),i.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,i){void 0===i&&(i=t);var a=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(a.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,i);var n=this.storedMarks;if(!n){var r=this.doc.resolve(t);n=i==t?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,a.text(e,n)),this.selection.empty||this.setSelection(iy.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},i.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},i.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,i),t}(RE);function fy(e,t){return t&&e?e.bind(t):e}var hy=function(e,t,i){this.name=e,this.init=fy(t.init,i),this.apply=fy(t.apply,i)},py=[new hy("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new hy("selection",{init:function(e,t){return e.selection||iy.atStart(t.doc)},apply:function(e){return e.selection}}),new hy("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,i,a){return a.selection.$cursor?e.storedMarks:null}}),new hy("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],my=function(e,t){var i=this;this.schema=e,this.fields=py.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(i.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");i.plugins.push(e),i.pluginsByKey[e.key]=e,e.spec.state&&i.fields.push(new hy(e.key,e.spec.state,e))}))},Fy=function(e){this.config=e},by={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};by.schema.get=function(){return this.config.schema},by.plugins.get=function(){return this.config.plugins},Fy.prototype.apply=function(e){return this.applyTransaction(e).state},Fy.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var i=0;i<this.config.plugins.length;i++)if(i!=t){var a=this.config.plugins[i];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,e,this))return!1}return!0},Fy.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],i=this.applyInner(e),a=null;;){for(var n=!1,r=0;r<this.config.plugins.length;r++){var o=this.config.plugins[r];if(o.spec.appendTransaction){var s=a?a[r].n:0,l=a?a[r].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,i);if(u&&i.filterTransaction(u,r)){if(u.setMeta("appendedTransaction",e),!a){a=[];for(var _=0;_<this.config.plugins.length;_++)a.push(_<r?{state:i,n:t.length}:{state:this,n:0})}t.push(u),i=i.applyInner(u),n=!0}a&&(a[r]={state:i,n:t.length})}}if(!n)return{state:i,transactions:t}}},Fy.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new Fy(this.config),i=this.config.fields,a=0;a<i.length;a++){var n=i[a];t[n.name]=n.apply(e,this[n.name],this,t)}for(var r=0;r<Ey.length;r++)Ey[r](this,e,t);return t},by.tr.get=function(){return new gy(this)},Fy.create=function(e){for(var t=new my(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Fy(t),a=0;a<t.fields.length;a++)i[t.fields[a].name]=t.fields[a].init(e,i);return i},Fy.prototype.reconfigure=function(e){for(var t=new my(this.schema,e.plugins),i=t.fields,a=new Fy(t),n=0;n<i.length;n++){var r=i[n].name;a[r]=this.hasOwnProperty(r)?this[r]:i[n].init(e,a)}return a},Fy.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var i in e){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var a=e[i],n=a.spec.state;n&&n.toJSON&&(t[i]=n.toJSON.call(a,this[a.key]))}return t},Fy.fromJSON=function(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var a=new my(e.schema,e.plugins),n=new Fy(a);return a.fields.forEach((function(a){if("doc"==a.name)n.doc=Xb.fromJSON(e.schema,t.doc);else if("selection"==a.name)n.selection=iy.fromJSON(n.doc,t.selection);else if("storedMarks"==a.name)t.storedMarks&&(n.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(var r in i){var o=i[r],s=o.spec.state;if(o.key==a.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(n[a.name]=s.fromJSON.call(o,e,t[r],n))}n[a.name]=a.init(e,n)}})),n},Fy.addApplyListener=function(e){Ey.push(e)},Fy.removeApplyListener=function(e){var t=Ey.indexOf(e);t>-1&&Ey.splice(t,1)},Object.defineProperties(Fy.prototype,by);var Ey=[];var yy=function(e){this.props={},e.props&&function e(t,i,a){for(var n in t){var r=t[n];r instanceof Function?r=r.bind(i):"handleDOMEvents"==n&&(r=e(r,i,{})),a[n]=r}return a}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:vy("plugin")};yy.prototype.getState=function(e){return e[this.key]};var Dy=Object.create(null);function vy(e){return e in Dy?e+"$"+ ++Dy[e]:(Dy[e]=0,e+"$")}var ky=function(e){void 0===e&&(e="key"),this.key=vy(e)};ky.prototype.get=function(e){return e.config.pluginsByKey[this.key]},ky.prototype.getState=function(e){return e[this.key]};const Sy=mr.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new yy({key:new ky("characterCount"),filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||0===i||null==i)return!0;const a=this.storage.characters({node:t.doc}),n=this.storage.characters({node:e.doc});if(n<=i)return!0;if(a>i&&n>i&&n<=a)return!0;if(a>i&&n>i&&n>a)return!1;if(!e.getMeta("paste"))return!1;const r=e.selection.$head.pos,o=r-(n-i),s=r;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>i)}})]}});var wy=i(52);const Cy=gs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[Es({find:e=>Object(wy.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Rt({key:new Bt("handleClickLink"),props:{handleClick:(e,t,i)=>{var a;const n=this.editor.getAttributes("link");return!(!(null===(a=i.target)||void 0===a?void 0:a.closest("a"))||!n.href)&&(window.open(n.href,n.target),!0)}}})),this.options.linkOnPaste&&e.push(new Rt({key:new Bt("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:a}=e,{selection:n}=a,{empty:r}=n;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(wy.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),xy=gs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",ns(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=po(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),Ty=mr.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var Oy=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Rt({key:new Bt("eventHandler"),props:{handleClick:function(t,i){var a=t.state,n=a.doc.lastChild,r=a.doc.resolve(i).nodeBefore;if(n&&r){var o=n.eq(r),s=n.isInline,l=["paragraph","text"].includes(n.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}}),Ny=yF.extend({name:"title",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return[{tag:"h1"}]},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["h1",ns(this.options.HTMLAttributes,t),0]}});const Ay=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,Ry=cs.create({name:"image",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:e}){return["img",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[fs({find:Ay,type:this.type,getAttributes:e=>{const[,,t,i,a]=e;return{src:i,alt:t,title:a}}})]}});function My(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Iy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?My(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):My(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var By=Ry.extend({name:"image",addAttributes:function(){return Iy(Iy({},Ry.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var a,n,r,o=i.tr,s=i.commands;return"image"==(null===(a=o.selection)||void 0===a||null===(n=a.node)||void 0===n||null===(r=n.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return i.class=" image-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,["img",ns(this.options.HTMLAttributes,i)]}});const Ly=gs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});const Py=new Bt("suggestion");function jy({pluginKey:e=Py,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const _=null===(a=this.key)||void 0===a?void 0:a.getState(i),d=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}var qy=function(e){var t=e.wrapperRef,i=e.index;if(t.current&&!(i>=t.current.children.length)){var a=t.current,n=a.children[i],r=n.clientHeight+8,o=a.scrollTop;n.offsetTop+r>o+a.clientHeight?o=n.offsetTop-a.clientHeight+r:o>n.offsetTop&&(o=n.offsetTop-8),t.current.scrollTop=o}};function Uy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var zy=function(e){Nf()(i,e);var t=Uy(i);function i(e){var a;return Sf()(this,i),a=t.call(this,e),d()(Tf()(a),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(a.upHandler(),!0):"ArrowDown"===t.key?(a.downHandler(),!0):"Enter"===t.key&&(a.enterHandler(),!0)})),d()(Tf()(a),"upHandler",(function(){a.setState({selectedIndex:(a.state.selectedIndex+a.props.items.length-1)%a.props.items.length})})),d()(Tf()(a),"downHandler",(function(){a.setState({selectedIndex:(a.state.selectedIndex+1)%a.props.items.length})})),d()(Tf()(a),"enterHandler",(function(){a.selectItem(a.state.selectedIndex)})),d()(Tf()(a),"selectItem",(function(e){var t=a.props.items[e];if(t&&ac(t.items)){var i=a.props,n=i.editor,r=i.range;t.command({editor:n,range:r})}})),a.state={selectedIndex:0},a.menuRef=m.a.createRef(),a}return Cf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),qy({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.props.items;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},t.map((function(t,a){var n=ac(t.items),r=m.a.createElement(Gy,{key:t.title,item:t,index:a,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(a)}});return n?r:m.a.createElement(wd,{key:t.title,interactive:!0,placement:"right",hideOnClick:!1,content:m.a.createElement(i,u()({},e.props,{items:t.items})),onCreate:function(e){return e.popper.style.width="max-content"}},r)})))}}]),i}(m.a.Component),Gy=Object(p.forwardRef)((function(e,t){var i=e.item,a=e.selectedIndex,n=e.index,r=e.selectItem,o=i.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:n===a}),onClick:function(){return r(n)},ref:t,"data-cy":"neeto-editor-command-list-item-".concat(n)},o&&m.a.createElement(o,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,i.title),m.a.createElement("p",null,i.description)))})),Hy=zy,Yy=["size","color","strokeWidth"];function Vy(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Yy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M13 4.5H20M13 9.5H20M4 14.5H20M4 19.5H20M9 9.5L6.5 4.5L4 9.5M4.5 8.5H6.5H8.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Vy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Vy.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Wy=["size","color","strokeWidth"];function $y(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Wy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M5 6V18M13 6V18M5 12H13M18.5 18V13L17.25 14.25M20 18H17",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}$y.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},$y.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Ky=["size","color","strokeWidth"];function Qy(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Ky);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M17 14C17 13.7348 17.1054 13.4804 17.2929 13.2929C17.4804 13.1054 17.7348 13 18 13H18.6145C18.8723 13 19.1237 13.0811 19.3329 13.2319C19.542 13.3827 19.6985 13.5955 19.78 13.8401C19.8471 14.0414 19.8609 14.2566 19.8202 14.4648C19.7794 14.673 19.6854 14.8671 19.5473 15.0281L17 18H20M5 6V18M13 6V18M5 12H13",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Qy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Qy.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Zy=["size","color","strokeWidth"];function Xy(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Zy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M20.667 20.125H3.33301M20.667 14.708H3.33301M20.667 9.292H16.334M20.667 3.875H16.334M9.29201 6.042H12C12.299 6.042 12.542 6.285 12.542 6.584V8.75C12.542 9.049 12.299 9.292 12 9.292H9.83301C9.53401 9.292 9.29101 9.049 9.29101 8.75L9.29201 6.042ZM9.29201 6.042C9.29201 3.875 9.69801 3.515 10.917 2.792M3.33301 6.042H6.04101C6.34001 6.042 6.58301 6.285 6.58301 6.584V8.75C6.58301 9.049 6.34001 9.292 6.04101 9.292H3.87501C3.57601 9.292 3.33301 9.049 3.33301 8.75V6.042ZM3.33301 6.042C3.33301 3.875 3.73901 3.515 4.95801 2.792",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Xy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Xy.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Jy=["size","color","strokeWidth"];function eD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Jy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M17 12H7",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}eD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},eD.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var tD=["size","color","strokeWidth"];function iD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,tD);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M15.375 13.097L19.17 16.151C19.906 16.744 21 16.22 21 15.275V8.725C21 7.78 19.906 7.256 19.17 7.849L15.375 10.903M13.125 17.75H5.25C4.007 17.75 3 16.743 3 15.5V8.5C3 7.257 4.007 6.25 5.25 6.25H13.125C14.368 6.25 15.375 7.257 15.375 8.5V15.5C15.375 16.743 14.368 17.75 13.125 17.75Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}iD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},iD.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var aD={PARAGRAPH:{optionName:rm.FONT_SIZE,title:"Paragraph",description:"Add a plain text block.",Icon:Vy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},H1:{optionName:rm.FONT_SIZE,title:"H1",description:"Add a big heading.",Icon:$y,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},H2:{optionName:rm.FONT_SIZE,title:"H2",description:"Add a sub-heading.",Icon:Qy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},LIST_ORDERED:{optionName:rm.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:Jc,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},LIST_BULLETS:{optionName:rm.LIST_BULLETS,title:"Bulleted list",description:"Add an list bullets.",Icon:Zc,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},BLOCKQUOTE:{optionName:rm.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:Xy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},IMAGE:{optionName:rm.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:Kc,command:function(e){var t=e.editor,i=e.range;return t.chain().focus().deleteRange(i).run()}},CODE:{optionName:rm.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:ud,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},EMOJI:{optionName:rm.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:vf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}},DIVIDER:{optionName:rm.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:eD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setHorizontalRule().run()}},VIDEO:{optionName:rm.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:iD,command:function(e){var t,i=e.editor,a=e.range,n=prompt("Please enter Youtube/Vimeo embed URL."),r=(t=n.match(Uc))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(zc);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(n);r?i.chain().focus().deleteRange(a).setExternalVideo({src:r}).run():i.chain().focus().deleteRange(a).insertContent("#invalid").run()}},MENTION:{optionName:rm.MENTION,title:"Mention",description:"Mention a user.",Icon:of,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("@").run()}},NO_RESULT:{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}};function nD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function rD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?nD(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):nD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var oD=new Bt("commands"),sD=function(e){var t=e.setImageUploadVisible,i=e.mentions,a=e.addonCommands,n=e.options,r=[aD.PARAGRAPH,aD.H1,aD.H2,aD.LIST_ORDERED,aD.LIST_BULLETS,aD.BLOCKQUOTE,rD(rD({},aD.IMAGE),{},{command:function(){var e;t(!0),(e=aD.IMAGE).command.apply(e,arguments)}}),aD.CODE,aD.EMOJI,aD.DIVIDER,aD.VIDEO];return ac(i)||r.push(aD.MENTION),ac(n)||(r=r.filter((function(e){var t=e.optionName;return n.includes(t)}))),ac(a)||(r=r.concat(a)),mr.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:oD,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var t=e.query,i=r.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return ac(i)?[aD.NO_RESULT]:i},render:function(){var e,t;return{onStart:function(i){e=new Tu(Hy,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[jy(rD({editor:this.editor},this.options.suggestion))]}})},lD={};function uD(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||uD(i)})),e}var _D=uD,dD=uD;_D.default=dD;class cD{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function gD(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function fD(e,...t){const i=Object.create(null);for(const t in e)i[t]=e[t];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const hD=e=>!!e.kind;class pD{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=gD(e)}openNode(e){if(!hD(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){hD(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class mD{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{mD._collapse(e)}))}}class FD extends mD{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new pD(this,this.options).value()}finalize(){return!0}}function bD(e){return e?"string"==typeof e?e:e.source:null}const ED=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const yD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",DD={begin:"\\\\[\\s\\S]",relevance:0},vD={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[DD]},kD={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[DD]},SD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},wD=function(e,t,i={}){const a=fD({className:"comment",begin:e,end:t,contains:[]},i);return a.contains.push(SD),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},CD=wD("//","$"),xD=wD("/\\*","\\*/"),TD=wD("#","$"),OD={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},ND={className:"number",begin:yD,relevance:0},AD={className:"number",begin:"\\b(0b[01]+)",relevance:0},RD={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},MD={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[DD,{begin:/\[/,end:/\]/,relevance:0,contains:[DD]}]}]},ID={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},BD={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},LD={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var PD=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:yD,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>bD(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),fD({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:DD,APOS_STRING_MODE:vD,QUOTE_STRING_MODE:kD,PHRASAL_WORDS_MODE:SD,COMMENT:wD,C_LINE_COMMENT_MODE:CD,C_BLOCK_COMMENT_MODE:xD,HASH_COMMENT_MODE:TD,NUMBER_MODE:OD,C_NUMBER_MODE:ND,BINARY_NUMBER_MODE:AD,CSS_NUMBER_MODE:RD,REGEXP_MODE:MD,TITLE_MODE:ID,UNDERSCORE_TITLE_MODE:BD,METHOD_GUARD:LD,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function jD(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function qD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=jD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function UD(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>bD(e)).join("|")+")"}(...e.illegal))}function zD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function GD(e,t){void 0===e.relevance&&(e.relevance=1)}const HD=["of","and","for","in","not","or","if","then","parent","list","value"];function YD(e,t){return t?Number(t):function(e){return HD.includes(e.toLowerCase())}(e)?0:1}function VD(e,{plugins:t}){function i(t,i){return new RegExp(bD(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let a=bD(e),n="";for(;a.length>0;){const e=ED.exec(a);if(!e){n+=a;break}n+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?n+="\\"+String(Number(e[1])+t):(n+=e[0],"("===e[0]&&i++)}return n}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),a=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,a)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new a;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=fD(e.classNameAliases||{}),function t(a,r){const o=a;if(a.isCompiled)return o;[zD].forEach(e=>e(a,r)),e.compilerExtensions.forEach(e=>e(a,r)),a.__beforeBegin=null,[qD,UD,GD].forEach(e=>e(a,r)),a.isCompiled=!0;let s=null;if("object"==typeof a.keywords&&(s=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=function e(t,i,a="keyword"){const n={};return"string"==typeof t?r(a,t.split(" ")):Array.isArray(t)?r(a,t):Object.keys(t).forEach((function(a){Object.assign(n,e(t[a],i,a))})),n;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");n[i[0]]=[e,YD(i[0],i[1])]}))}}(a.keywords,e.case_insensitive)),a.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||a.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(a.begin||(a.begin=/\B|\b/),o.beginRe=i(a.begin),a.endSameAsBegin&&(a.end=a.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(o.endRe=i(a.end)),o.terminatorEnd=bD(a.end)||"",a.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(a.end?"|":"")+r.terminatorEnd)),a.illegal&&(o.illegalRe=i(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return fD(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return fD(e,{starts:e.starts?fD(e.starts):null});if(Object.isFrozen(e))return fD(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){t(e,o)})),a.starts&&t(a.starts,r),o.matcher=function(e){const t=new n;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function WD(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,gD(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const $D={"after:highlightElement":({el:e,result:t,text:i})=>{const a=QD(e);if(!a.length)return;const n=document.createElement("div");n.innerHTML=t.value,t.value=function(e,t,i){let a=0,n="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){n+="<"+KD(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+gD(e.value)+'"'})).join("")+">"}function l(e){n+="</"+KD(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(n+=gD(i.substring(a,t[0].offset)),a=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===a);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return n+gD(i.substr(a))}(a,QD(n),i)}};function KD(e){return e.nodeName.toLowerCase()}function QD(e){const t=[];return function e(i,a){for(let n=i.firstChild;n;n=n.nextSibling)3===n.nodeType?a+=n.nodeValue.length:1===n.nodeType&&(t.push({event:"start",offset:a,node:n}),a=e(n,a),KD(n).match(/br|hr|img|input/)||t.push({event:"stop",offset:a,node:n}));return a}(e,0),t}const ZD={},XD=e=>{console.error(e)},JD=(e,...t)=>{console.log("WARN: "+e,...t)},ev=(e,t)=>{ZD[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ZD[`${e}/${t}`]=!0)},tv=gD,iv=fD,av=Symbol("nomatch");var nv=function(e){const t=Object.create(null),i=Object.create(null),a=[];let n=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:FD};function u(e){return l.noHighlightRe.test(e)}function _(e,t,i,a){let n="",r="";"object"==typeof t?(n=e,i=t.ignoreIllegals,r=t.language,a=void 0):(ev("10.7.0","highlight(lang, code, ...args) has been deprecated."),ev("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,n=t);const o={code:n,language:r};v("before:highlight",o);const s=o.result?o.result:d(o.language,o.code,i,a);return s.code=o.code,v("after:highlight",s),s}function d(e,i,r,s){function u(e,t){const i=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,i)&&e.keywords[i]}function _(){null!=v.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof v.subLanguage){if(!t[v.subLanguage])return void S.addText(w);e=d(v.subLanguage,w,!0,k[v.subLanguage]),k[v.subLanguage]=e.top}else e=c(w,v.subLanguage.length?v.subLanguage:null);v.relevance>0&&(C+=e.relevance),S.addSublanguage(e.emitter,e.language)}():function(){if(!v.keywords)return void S.addText(w);let e=0;v.keywordPatternRe.lastIndex=0;let t=v.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const a=u(v,t);if(a){const[e,n]=a;if(S.addText(i),i="",C+=n,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;S.addKeyword(t[0],i)}}else i+=t[0];e=v.keywordPatternRe.lastIndex,t=v.keywordPatternRe.exec(w)}i+=w.substr(e),S.addText(i)}(),w=""}function g(e){return e.className&&S.openNode(b.classNameAliases[e.className]||e.className),v=Object.create(e,{parent:{value:v}}),v}function f(e){return 0===v.matcher.regexIndex?(w+=e[0],1):(O=!0,0)}function h(e){const t=e[0],i=e.rule,a=new cD(i),n=[i.__beforeBegin,i["on:begin"]];for(const i of n)if(i&&(i(e,a),a.isMatchIgnored))return f(t);return i&&i.endSameAsBegin&&(i.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),i.skip?w+=t:(i.excludeBegin&&(w+=t),_(),i.returnBegin||i.excludeBegin||(w=t)),g(i),i.returnBegin?0:t.length}function p(e){const t=e[0],a=i.substr(e.index),n=function e(t,i,a){let n=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,a);if(n){if(t["on:end"]){const e=new cD(t);t["on:end"](i,e),e.isMatchIgnored&&(n=!1)}if(n){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,a)}(v,e,a);if(!n)return av;const r=v;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),_(),r.excludeEnd&&(w=t));do{v.className&&S.closeNode(),v.skip||v.subLanguage||(C+=v.relevance),v=v.parent}while(v!==n.parent);return n.starts&&(n.endSameAsBegin&&(n.starts.endRe=n.endRe),g(n.starts)),r.returnEnd?0:t.length}let m={};function F(t,a){const o=a&&a[0];if(w+=t,null==o)return _(),0;if("begin"===m.type&&"end"===a.type&&m.index===a.index&&""===o){if(w+=i.slice(a.index,a.index+1),!n){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=a,"begin"===a.type)return h(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(v.className||"<unnamed>")+'"');throw e.mode=v,e}if("end"===a.type){const e=p(a);if(e!==av)return e}if("illegal"===a.type&&""===o)return 1;if(T>1e5&&T>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=E(e);if(!b)throw XD(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const y=VD(b,{plugins:a});let D="",v=s||y;const k={},S=new l.__emitter(l);!function(){const e=[];for(let t=v;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>S.openNode(e))}();let w="",C=0,x=0,T=0,O=!1;try{for(v.matcher.considerAll();;){T++,O?O=!1:v.matcher.considerAll(),v.matcher.lastIndex=x;const e=v.matcher.exec(i);if(!e)break;const t=F(i.substring(x,e.index),e);x=e.index+t}return F(i.substr(x)),S.closeAllNodes(),S.finalize(),D=S.toHTML(),{relevance:Math.floor(C),value:D,language:e,illegal:!1,emitter:S,top:v}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(x-100,x+100),mode:t.mode},sofar:D,relevance:0,value:tv(i),emitter:S};if(n)return{illegal:!1,relevance:0,value:tv(i),emitter:S,language:e,top:v,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const a=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:tv(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),n=i.filter(E).filter(D).map(t=>d(t,e,!1));n.unshift(a);const r=n.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;if(E(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,_=o;return _.second_best=u,_}const g={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const a=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=E(i[1]);return t||(JD(o.replace("{}",i[1])),JD("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||E(e))}(e);if(u(a))return;v("before:highlightElement",{el:e,language:a}),t=e;const n=t.textContent,r=a?_(n,{language:a,ignoreIllegals:!0}):c(n);v("after:highlightElement",{el:e,result:r,text:n}),e.innerHTML=r.value,function(e,t,a){const n=t?i[t]:a;e.classList.add("hljs"),n&&e.classList.add(n)}(e,a,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,ev("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function E(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function y(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function D(e){const t=E(e);return t&&!t.disableAutodetect}function v(e,t){const i=e;a.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:_,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return ev("10.2.0","fixMarkup will be removed entirely in v11.0"),ev("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(r,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return ev("10.7.0","highlightBlock will be removed entirely in v12.0"),ev("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(ev("10.3.0","'useBR' will be removed entirely in v11.0"),ev("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=iv(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){ev("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,a){let r=null;try{r=a(e)}catch(e){if(XD("Language definition for '{}' could not be registered.".replace("{}",i)),!n)throw e;XD(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=a.bind(null,e),r.aliases&&y(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:y,requireLanguage:function(e){ev("10.4.0","requireLanguage will be removed entirely in v11."),ev("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=E(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:D,inherit:iv,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),a.push(e)},vuePlugin:WD(e).VuePlugin}),e.debugMode=function(){n=!1},e.safeMode=function(){n=!0},e.versionString="10.7.3";for(const e in PD)"object"==typeof PD[e]&&_D(PD[e]);return Object.assign(e,PD),e.addPlugin(g),e.addPlugin($D),e.addPlugin(h),e}({}),rv={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,a,n,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",_=!1,d=!1,c=function(){return o[r++]},g=function(){for(var i="";/\d/.test(e[s]);)i+=e[s++],t=e[s];return i.length>0?parseInt(i):null};s<l;++s)if(t=e[s],_)switch(_=!1,"."==t?(d=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(d=!0,t=e[s+=2]):d=!0,n=g(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":a=String(parseFloat(c()).toFixed(n||6)),u+=d?a:a.replace(/^0/,"");break;case"j":u+=JSON.stringify(c());break;case"o":u+="0"+parseInt(c(),10).toString(8);break;case"s":u+=c();break;case"x":u+="0x"+parseInt(c(),10).toString(16);break;case"X":u+="0x"+parseInt(c(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?_=!0:u+=t;return u}(t=e.exports=i).format=i,t.vsprintf=function(e,t){return i.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(i.apply(null,arguments))})}()}(rv);var ov=rv.exports,sv=uv(Error),lv=sv;function uv(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=ov.apply(null,arguments)),new e(t)}}sv.eval=uv(EvalError),sv.range=uv(RangeError),sv.reference=uv(ReferenceError),sv.syntax=uv(SyntaxError),sv.type=uv(TypeError),sv.uri=uv(URIError),sv.create=uv;var _v=nv,dv=lv;lD.highlight=cv,lD.highlightAuto=function(e,t){var i=t||{},a=i.subset||_v.listLanguages();i.prefix;var n,r,o,s,l=a.length,u=-1;if("string"!=typeof e)throw dv("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++u<l;)s=a[u],_v.getLanguage(s)&&((o=cv(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o));r.language&&(n.secondBest=r);return n},lD.registerLanguage=function(e,t){_v.registerLanguage(e,t)},lD.listLanguages=function(){return _v.listLanguages()},lD.registerAlias=function(e,t){var i,a=e;t&&((a={})[e]=t);for(i in a)_v.registerAliases(a[i],{languageName:i})},gv.prototype.addText=function(e){var t,i,a=this.stack;if(""===e)return;t=a[a.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},gv.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},gv.prototype.addSublanguage=function(e,t){var i=this.stack,a=i[i.length-1],n=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:n}:n;a.children=a.children.concat(r)},gv.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,a=t[t.length-1],n={type:"element",tagName:"span",properties:{className:[i]},children:[]};a.children.push(n),t.push(n)},gv.prototype.closeNode=function(){this.stack.pop()},gv.prototype.closeAllNodes=fv,gv.prototype.finalize=fv,gv.prototype.toHTML=function(){return""};function cv(e,t,i){var a,n=_v.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw dv("Expected `string` for name, got `%s`",e);if(!_v.getLanguage(e))throw dv("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw dv("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),_v.configure({__emitter:gv,classPrefix:r}),a=_v.highlight(t,{language:e,ignoreIllegals:!0}),_v.configure(n||{}),a.errorRaised)throw a.errorRaised;return{relevance:a.relevance,language:a.language,value:a.emitter.rootNode.children}}function gv(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function fv(){}function hv(e){return e.value||e.children||[]}function pv({doc:e,name:t,lowlight:i}){const a=[];return ys(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:n}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const a=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,a):{text:t.value,classes:a}}).flat()})(n&&r.includes(n)?hv(i.highlight(n,e.node.textContent)):hv(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const n=On.inline(t,i,{class:e.classes.join(" ")});a.push(n)}t=i})}),Mn.create(e,a)}function mv({name:e,lowlight:t}){return new Rt({key:new Bt("lowlight"),state:{init:(i,{doc:a})=>pv({doc:a,name:e,lowlight:t}),apply:(i,a,n,r)=>{const o=n.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=ys(n.doc,t=>t.type.name===e),u=ys(r.doc,t=>t.type.name===e);return i.docChanged&&([o,s].includes(e)||u.length!==l.length||i.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?pv({doc:i.doc,name:e,lowlight:t}):a.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const Fv=uF.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:lD}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],mv({name:this.name,lowlight:this.options.lowlight})]}});function bv(){return m.a.createElement(Lu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Ev=i(94),yv=i.n(Ev),Dv=Fv.extend({addNodeView:function(){return new Ru(bv)}}).configure({lowlight:yv.a}),vv=function(e){var t=e.items,i=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(ef,{variables:t,onClickVariable:function(e){var t=e.category_key,a=e.key,n=t?"".concat(t,".").concat(a):a;i({label:n,id:n})}}))};function kv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Sv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?kv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):kv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var wv=new Bt("variables"),Cv=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,i=e.node;return"".concat(t.charOpen).concat(i.attrs.label||i.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return["span",ns({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,a=t.state,n=!1,r=a.selection,o=r.empty,s=r.anchor;return!!o&&(a.doc.nodesBetween(s-1,s,(function(t,a){if(t.type.name===e.name)return n=!0,i.insertText("",a,a+t.nodeSize),!1})),n)}))}}},addProseMirrorPlugins:function(){return[jy(Sv({editor:this.editor},this.options.suggestion))]}}),xv={char:"{{",startOfLine:!1,pluginKey:wv,command:function(e){var t=e.editor,i=e.range,a=e.props;t.chain().focus().deleteRange(i).setVariable(a).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(vv,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Tv=function(e){var t=e.suggestion,i=void 0===t?{}:t;return Cv.configure({suggestion:Sv(Sv({},xv),i)})},Ov=i(24),Nv=i.n(Ov),Av=i(95),Rv=i.n(Av),Mv=function(e){var t=Nv()(e);return"string"===t||"funtion"===t?e:Rv()(e)?function(t){var i=t.node.type.name;return e[i]}:""},Iv=mr.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Rt({props:{decorations:function(t){var i=t.doc,a=t.selection,n=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=a.anchor,o=[];if(n)return i.descendants((function(t,i){var a=r>=i&&r<=i+t.nodeSize,n=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((a||!e.options.showOnlyCurrent)&&!s&&n){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=On.node(i,i+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:i}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Mn.create(i,o)}}})]}});const Bv=new Bt("suggestion");function Lv({pluginKey:e=Bv,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const _=null===(a=this.key)||void 0===a?void 0:a.getState(i),d=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}const Pv=new Bt("mention"),jv=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var i;return`${e.suggestion.char}${null!==(i=t.attrs.label)&&void 0!==i?i:t.attrs.id}`},suggestion:{char:"@",pluginKey:Pv,command:({editor:e,range:t,props:i})=>{var a;const n=e.view.state.selection.$to.nodeAfter;(null===(a=null==n?void 0:n.text)||void 0===a?void 0:a.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),a=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(a)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",ns({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:a}=t,{empty:n,anchor:r}=a;return!!n&&(t.doc.nodesBetween(r-1,r,(t,a)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",a,a+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[Lv({editor:this.editor,...this.options.suggestion})]}});function qv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var Uv=function(e){Nf()(i,e);var t=qv(i);function i(e){var a;return Sf()(this,i),a=t.call(this,e),d()(Tf()(a),"selectItem",(function(e){var t=a.props,i=t.items,n=t.command,r=i[e];r&&n({label:r.label,id:r.key})})),d()(Tf()(a),"upHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),d()(Tf()(a),"downHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),d()(Tf()(a),"enterHandler",(function(){var e=a.state.selectedIndex;a.selectItem(e)})),d()(Tf()(a),"onKeyDown",(function(e){var t=e.event,i={ArrowUp:a.upHandler,ArrowDown:a.downHandler,Enter:a.enterHandler};return!!i.hasOwnProperty(t.key)&&(i[t.key](),!0)})),a.state={selectedIndex:0},a.mentionRef=m.a.createRef(),a}return Cf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),qy({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return 0===i.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},i.map((function(i,a){var n=i.label,r=i.imageUrl,o=i.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:a===t}),key:n,onClick:function(){return e.selectItem(a)},type:"button","data-cy":"neeto-editor-mention-list-".concat(n)},o&&m.a.createElement(df,{user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))}}]),i}(m.a.Component);function zv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Gv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?zv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):zv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Hv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.showImage,a=void 0!==i&&i,n=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===Nv()(e)&&(t=Gv({},e)),t.showImage=a,t}));return function(e){var t=e.query;return n.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))}},Yv=["suggestion"];function Vv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Wv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var $v={render:function(){var e,t;return{onStart:function(i){e=new Tu(Uv,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var a;return"Escape"===i.event.key?(t[0].hide(),!0):null===(a=e.ref)||void 0===a?void 0:a.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},Kv=jv.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),Qv=function(e){var t=e.suggestion,i=void 0===t?{}:t,a=h()(e,Yv);return Kv.configure(Wv(Wv({},a),{},{suggestion:Wv(Wv({},$v),i)}))};function Zv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Xv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Zv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Zv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Jv=cs.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",ns(this.options.HTMLAttributes,Xv(Xv({},t),{},{class:"video-wrapper"}))]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}});function ek(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var tk=function(e){Nf()(i,e);var t=ek(i);function i(){var e;Sf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),d()(Tf()(e),"state",{selectedIndex:0,emojiSuggestions:ch.search(e.props.query||"smile").slice(0,5)}),d()(Tf()(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var a;if(ac(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(a=ch.search(e.props.query))||void 0===a?void 0:a[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),d()(Tf()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return Cf()(i,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:ch.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":i===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),i}(m.a.Component);function ik(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function ak(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ik(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ik(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var nk=new Bt("emoji-suggestion"),rk=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:nk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(tk,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[jy(ak({editor:this.editor},this.options.suggestion))]}});function ok(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function sk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ok(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ok(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var lk=new Bt("emoji-picker"),uk=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:lk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(pp,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[jy(sk({editor:this.editor},this.options.suggestion))]}}),_k=function(e){return function(e){var t=e.handleSubmit;return mr.create({addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}}}})}({handleSubmit:e.handleSubmit})};var dk=function(e){var t,i,a,n,r,o,s=e.editor,l=e.limit,u=e.strategy;if("hidden"===u)return null;var _="limit"===u&&l;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},_?"".concat(l-(null==s||null===(t=s.storage)||void 0===t||null===(i=t.characterCount)||void 0===i?void 0:i.characters())," characters remaining"):"".concat(null==s||null===(a=s.storage)||void 0===a||null===(n=a.characterCount)||void 0===n?void 0:n.characters()," characters, ").concat(null==s||null===(r=s.storage)||void 0===r||null===(o=r.characterCount)||void 0===o?void 0:o.words()," words"))},ck=[rm.FONT_COLOR,rm.FONT_SIZE,rm.BOLD,rm.ITALIC,rm.UNDERLINE,rm.STRIKETHROUGH,rm.LINK,rm.LIST_BULLETS,rm.LIST_ORDERED],gk=function(e){var t=e.heightStrategy,i={},a=21*e.rows+26;return"flexible"===t?i["min-height"]=a+"px":i.height=a+"px",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:";";return Object.entries(e).reduce((function(e,i){var a=g()(i,2),n=a[0],r=a[1];return e+"".concat(n,":").concat(r).concat(t)}),"")}(i)},fk=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],hk=function(e,t){var i=e.forceTitle,a=void 0!==i&&i,n=e.titleError,r=void 0!==n&&n,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,_=void 0===l?[]:l,c=e.addonCommands,f=e.markdownMode,F=void 0!==f&&f,E=e.className,y=e.uploadEndpoint,D=e.initialValue,v=void 0===D?"":D,k=e.onChange,S=void 0===k?function(){}:k,w=e.menuType,C=void 0===w?"fixed":w,x=e.variables,T=e.mentions,O=e.showImageInMention,N=void 0!==O&&O,A=e.placeholder,R=void 0===A?a?{title:"Untitled"}:null:A,M=e.extensions,I=e.contentClassName,B=e.characterLimit,L=e.editorSecrets,P=e.rows,j=void 0===P?6:P,q=e.autoFocus,U=void 0!==q&&q,z=e.onSubmit,G=e.heightStrategy,H=void 0===G?"fixed":G,Y=e.characterCountStrategy,V=void 0===Y?"hidden":Y,W=h()(e,fk),$=Object(p.useState)(!1),K=g()($,2),Q=K[0],Z=K[1],X="fixed"===C,J="bubble"===C,ee=!s,te=function(e){if(e){if("string"==typeof e&&e.length)return!0;if("object"===Nv()(e)&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1}(R),ie=!te&&ee,ae=_.includes("image-upload-unsplash"),ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=t.includeImageUpload,a=e.map((function(e){return e.toLowerCase()}));return i&&a.push(rm.IMAGE_UPLOAD),[].concat(ck,a)}(_,{includeImageUpload:ae}),re=function(e){var t=e.forceTitle,i=e.placeholder,a=e.extensions,n=e.mentions,r=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,_=e.addonCommands,d=e.characterLimit,c=e.onSubmit,g=[Ny,Oy.extend({content:t?"title block*":"block+"}),ib.configure({document:!1,codeBlock:!1}),Ly,kb,xy,Cb,Dv,By,cF,Jv,Cy,Ty,Iv.configure({placeholder:Mv(i)}),rk,uk,Sy.configure({limit:d}),_k({handleSubmit:c})];return o&&g.push(sD({setImageUploadVisible:l,options:u,addonCommands:_,mentions:n})),ac(n)||g.push(Qv({suggestion:{items:Hv(n.sort((function(e,t){var i="string"==typeof e?e:e.label,a="string"==typeof t?t:t.label;return i.localeCompare(a)})),{showImage:s})}})),ac(r)||g.push(Tv({suggestion:{items:function(){return r}}})),ac(a)||(g=g.concat(a)),g}({contentClassName:I,forceTitle:a,placeholder:R,extensions:M,mentions:T,variables:x,isSlashCommandsActive:ee,showImageInMention:N,setImageUploadVisible:Z,options:ne,addonCommands:c,characterLimit:B,onSubmit:z}),oe=b()("neeto-editor",d()({"slash-active":ie,"fixed-menu-active border":X,"bubble-menu-active":J,"force-title":a,"force-title--error":r,"placeholder-active":te},E,E)),se=gk({heightStrategy:H,rows:j}),le=xu({extensions:re,content:v,injectCSS:!1,autofocus:U&&"end",editorProps:{attributes:{class:oe,style:se}},onUpdate:function(e){var t=e.editor;return S(t.getHTML())}});return m.a.useImperativeHandle(t,(function(){return{editor:le}})),m.a.createElement("div",{className:"neeto-editor-wrapper"},X&&m.a.createElement(Fp,{editor:le,variables:x,setImageUploadVisible:Z,options:ne,mentions:T,showImageInMention:N}),J&&m.a.createElement(Hc,{editor:le,options:ne}),m.a.createElement(dm,{isVisible:Q,setIsVisible:Z,editor:le,imageUploadUrl:y,isUnsplashImageUploadActive:ae,unsplashApiKey:null==L?void 0:L.unsplash}),F&&m.a.createElement($m,u()({editor:le,strategy:H,style:se,className:oe,onChange:S,onSubmit:z,initialValue:v},W)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Bu,u()({editor:le},W))),m.a.createElement(dk,{editor:le,limit:B,strategy:V}))},pk=m.a.forwardRef(hk),mk=i(96),Fk=i.n(mk);var bk=["content","className"],Ek=function(e){var t=e.content,i=void 0===t?"":t,a=e.className,n=h()(e,bk);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){Fk.a.highlightElement(e)}))}),[i]),m.a.createElement("div",u()({className:b()("neeto-editor-content",d()({},a,a)),dangerouslySetInnerHTML:{__html:gm.a.sanitize(i)},"data-cy":"neeto-editor-content"},n))}}])}));
76
+ var bg="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Eg(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){i(window.event)}))}function yg(e,t){for(var i=t.slice(0,t.length-1),a=0;a<i.length;a++)i[a]=e[i[a].toLowerCase()];return i}function Dg(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),i=t.lastIndexOf("");i>=0;)t[i-1]+=",",t.splice(i,1),i=t.lastIndexOf("");return t}for(var vg={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":bg?173:189,"=":bg?61:187,";":bg?59:186,"'":222,"[":219,"]":221,"\\":220},kg={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Sg={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},wg={16:!1,18:!1,17:!1,91:!1},Cg={},xg=1;xg<20;xg++)vg["f".concat(xg)]=111+xg;var Tg=[],Og="all",Ng=[],Ag=function(e){return vg[e.toLowerCase()]||kg[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Rg(e){Og=e||"all"}function Mg(){return Og||"all"}var Ig=function(e){var t=e.key,i=e.scope,a=e.method,n=e.splitKey,r=void 0===n?"+":n;Dg(t).forEach((function(e){var t=e.split(r),n=t.length,o=t[n-1],s="*"===o?"*":Ag(o);if(Cg[s]){i||(i=Mg());var l=n>1?yg(kg,t):[];Cg[s]=Cg[s].map((function(e){return(!a||e.method===a)&&e.scope===i&&function(e,t){for(var i=e.length>=t.length?e:t,a=e.length>=t.length?t:e,n=!0,r=0;r<i.length;r++)-1===a.indexOf(i[r])&&(n=!1);return n}(e.mods,l)?{}:e}))}}))};function Bg(e,t,i){var a;if(t.scope===i||"all"===t.scope){for(var n in a=t.mods.length>0,wg)Object.prototype.hasOwnProperty.call(wg,n)&&(!wg[n]&&t.mods.indexOf(+n)>-1||wg[n]&&-1===t.mods.indexOf(+n))&&(a=!1);(0!==t.mods.length||wg[16]||wg[18]||wg[17]||wg[91])&&!a&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Lg(e){var t=Cg["*"],i=e.keyCode||e.which||e.charCode;if(Pg.filter.call(this,e)){if(93!==i&&224!==i||(i=91),-1===Tg.indexOf(i)&&229!==i&&Tg.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var i=Sg[t];e[t]&&-1===Tg.indexOf(i)?Tg.push(i):!e[t]&&Tg.indexOf(i)>-1?Tg.splice(Tg.indexOf(i),1):"metaKey"===t&&e[t]&&3===Tg.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Tg=Tg.slice(Tg.indexOf(i))))})),i in wg){for(var a in wg[i]=!0,kg)kg[a]===i&&(Pg[a]=!0);if(!t)return}for(var n in wg)Object.prototype.hasOwnProperty.call(wg,n)&&(wg[n]=e[Sg[n]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Tg.indexOf(17)&&Tg.push(17),-1===Tg.indexOf(18)&&Tg.push(18),wg[17]=!0,wg[18]=!0);var r=Mg();if(t)for(var o=0;o<t.length;o++)t[o].scope===r&&("keydown"===e.type&&t[o].keydown||"keyup"===e.type&&t[o].keyup)&&Bg(e,t[o],r);if(i in Cg)for(var s=0;s<Cg[i].length;s++)if(("keydown"===e.type&&Cg[i][s].keydown||"keyup"===e.type&&Cg[i][s].keyup)&&Cg[i][s].key){for(var l=Cg[i][s],u=l.splitKey,_=l.key.split(u),d=[],c=0;c<_.length;c++)d.push(Ag(_[c]));d.sort().join("")===Tg.sort().join("")&&Bg(e,l,r)}}}function Pg(e,t,i){Tg=[];var a=Dg(e),n=[],r="all",o=document,s=0,l=!1,u=!0,_="+";for(void 0===i&&"function"==typeof t&&(i=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(r=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"==typeof t.splitKey&&(_=t.splitKey)),"string"==typeof t&&(r=t);s<a.length;s++)n=[],(e=a[s].split(_)).length>1&&(n=yg(kg,e)),(e="*"===(e=e[e.length-1])?"*":Ag(e))in Cg||(Cg[e]=[]),Cg[e].push({keyup:l,keydown:u,scope:r,mods:n,shortcut:a[s],method:i,key:a[s],splitKey:_});void 0!==o&&!function(e){return Ng.indexOf(e)>-1}(o)&&window&&(Ng.push(o),Eg(o,"keydown",(function(e){Lg(e)})),Eg(window,"focus",(function(){Tg=[]})),Eg(o,"keyup",(function(e){Lg(e),function(e){var t=e.keyCode||e.which||e.charCode,i=Tg.indexOf(t);if(i>=0&&Tg.splice(i,1),e.key&&"meta"===e.key.toLowerCase()&&Tg.splice(0,Tg.length),93!==t&&224!==t||(t=91),t in wg)for(var a in wg[t]=!1,kg)kg[a]===t&&(Pg[a]=!1)}(e)})))}var jg={setScope:Rg,getScope:Mg,deleteScope:function(e,t){var i,a;for(var n in e||(e=Mg()),Cg)if(Object.prototype.hasOwnProperty.call(Cg,n))for(i=Cg[n],a=0;a<i.length;)i[a].scope===e?i.splice(a,1):a++;Mg()===e&&Rg(t||"all")},getPressedKeyCodes:function(){return Tg.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=Ag(e)),-1!==Tg.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,i=t.tagName,a=!0;return!t.isContentEditable&&("INPUT"!==i&&"TEXTAREA"!==i&&"SELECT"!==i||t.readOnly)||(a=!1),a},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&Ig(e)}));else if("object"==typeof e)e.key&&Ig(e);else if("string"==typeof e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];var n=i[0],r=i[1];"function"==typeof n&&(r=n,n=""),Ig({key:e,scope:n,method:r,splitKey:"+"})}}else Object.keys(Cg).forEach((function(e){return delete Cg[e]}))}};for(var qg in jg)Object.prototype.hasOwnProperty.call(jg,qg)&&(Pg[qg]=jg[qg]);if("undefined"!=typeof window){var Ug=window.hotkeys;Pg.noConflict=function(e){return e&&window.hotkeys===Pg&&(window.hotkeys=Ug),Pg},window.hotkeys=Pg}var zg=Pg;zg.filter=function(){return!0};var Gg=function(e,t){var i=e.target,a=i&&i.tagName;return Boolean(a&&t&&t.includes(a))};function Hg(e,t,i,a){i instanceof Array&&(a=i,i=void 0);var n=i||{},r=n.enableOnTags,o=n.filter,s=n.keyup,l=n.keydown,u=n.filterPreventDefault,_=void 0===u||u,d=n.enabled,c=void 0===d||d,g=n.enableOnContentEditable,f=void 0!==g&&g,h=Object(p.useRef)(null),m=Object(p.useCallback)((function(e,i){var a;return o&&!o(e)?!_:!!(Gg(e,["INPUT","TEXTAREA","SELECT"])&&!Gg(e,r)||null!=(a=e.target)&&a.isContentEditable&&!f)||(null===h.current||document.activeElement===h.current)&&(t(e,i),!0)}),a?[h,r,o].concat(a):[h,r,o]);return Object(p.useEffect)((function(){if(c)return s&&!0!==l&&(i.keydown=!1),zg(e,i||{},m),function(){return zg.unbind(e,m)};zg.unbind(e,m)}),[m,e,c]),h}zg.isPressed;var Yg=function(e,t){Object(p.useEffect)((function(){var i=function(i){e.current&&!e.current.contains(i.target)&&t(i)};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),function(){document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}}),[e,t])},Vg=["icon","label","isOpen","onVisible","onClose","ulProps","position","children","className","buttonStyle","buttonProps","customTarget","disabled","closeOnEsc","closeOnSelect","closeOnOutsideClick","dropdownModifiers"];function Wg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function $g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Wg(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Wg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Kg=function(){},Qg=Object(p.forwardRef)((function(e,t){e.icon;var i=e.label,a=e.isOpen,n=e.onVisible,r=void 0===n?Kg:n,o=e.onClose,s=void 0===o?Kg:o,l=e.ulProps,_=e.position,c=e.children,f=e.className,F=(e.buttonStyle,e.buttonProps),E=e.customTarget,y=(e.disabled,e.closeOnEsc),D=void 0===y||y,v=e.closeOnSelect,k=void 0===v||v,S=e.closeOnOutsideClick,w=void 0===S||S,C=e.dropdownModifiers,x=void 0===C?[]:C,T=h()(e,Vg),O=Object(p.useRef)(),N=E(),A=!(null==a),R=Object(p.useState)(!1),M=g()(R,2),I=M[0],B=M[1],L=Object(p.useState)(null),P=g()(L,2),j=P[0],q=P[1],U=Object(p.useState)(null),z=g()(U,2),G=z[0],H=z[1],Y=function(e,t,i){void 0===i&&(i={});var a=p.useRef(null),n={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||pg},r=p.useState({styles:{popper:{position:n.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=r[0],s=r[1],l=p.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,i=Object.keys(t.elements);s({styles:fg(i.map((function(e){return[e,t.styles[e]||{}]}))),attributes:fg(i.map((function(e){return[e,t.attributes[e]]})))})},requires:["computeStyles"]}}),[]),u=p.useMemo((function(){var e={onFirstUpdate:n.onFirstUpdate,placement:n.placement,strategy:n.strategy,modifiers:[].concat(n.modifiers,[l,{name:"applyStyles",enabled:!1}])};return gg()(a.current,e)?a.current||e:(a.current=e,e)}),[n.onFirstUpdate,n.placement,n.strategy,n.modifiers,l]),_=p.useRef();return hg((function(){_.current&&_.current.setOptions(u)}),[u]),hg((function(){if(null!=e&&null!=t){var a=(i.createPopper||wl)(e,t,u);return _.current=a,function(){a.destroy(),_.current=null}}}),[e,t,i.createPopper]),{state:_.current?_.current.state:null,styles:o.styles,attributes:o.attributes,update:_.current?_.current.update:null,forceUpdate:_.current?_.current.forceUpdate:null}}(j,G,{placement:_||"bottom-end",modifiers:x}),V=Y.styles,W=Y.attributes;Object(p.useImperativeHandle)(t,(function(){return{close:function(){return B(!1)},visible:I}}));var $=function(){A||B(!1),s()},K=function(){!A&&B(!I)};return D&&Hg("esc",$),w&&Yg(O,$),A||(F=$g($g({},F),{},{onClick:function(){K()}})),Object(p.useEffect)((function(){A&&B(a)}),[a]),Object(p.useEffect)((function(){I&&r()}),[I]),m.a.createElement("div",u()({ref:O,className:b()("ne-dropdown__wrapper",d()({},f,f))},T),E?m.a.createElement("div",{ref:q,onClick:K},N):m.a.createElement("div",null,i,m.a.createElement(Fg,null)),I&&m.a.createElement("ul",u()({className:"ne-dropdown__popup",ref:H,onClick:function(){k&&$()},"data-cy":"neeto-editor-".concat(ic(i),"-dropdown-container")},l,{style:$g($g({display:"block"},V.offset),V.popper)},W.popper),c))})),Zg=function(e){var t=e.editor;return m.a.createElement(Qg,{customTarget:function(){return m.a.createElement(ng,{icon:dg,iconActive:t.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"})},className:"neeto-editor-font-size-wrapper",placement:"bottom"},[{label:"H1",value:1},{label:"H2",value:2},{label:"H3",value:3}].map((function(e){var i,a=e.label,n=e.value;return m.a.createElement("li",{onClick:function(){return e=n,t.chain().focus().toggleHeading({level:e}).run();var e},key:n,className:b()({active:(i=n,t.isActive("heading",{level:i}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(a)},a)})))};function Xg(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Jg(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Xg(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xg(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var ef=function(e){var t=e.onClickVariable,i=e.variables,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=[];return e.forEach((function(e){var a=e.category_key,n=e.category_label,r=e.variables;if(a&&r){var o=r.map((function(e){return Jg(Jg({},e),{},{category_key:a})}));i.push({label:n,variables:o})}else t.push(e)})),t.length&&i.push({label:i.length?"Others":null,variables:t}),i}(i);return i&&i.length?m.a.createElement("div",{className:"neeto-editor-variables-list"},a.map((function(e,i){var a=e.label,n=e.variables;return m.a.createElement(tf,{key:i,index:i,title:a,variables:n,onClickItem:t})}))):null},tf=function(e){var t=e.index,i=e.title,a=e.variables,n=e.onClickItem;return m.a.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(t)},i&&m.a.createElement("h6",null,i),m.a.createElement("div",{className:"neeto-editor-variables-row"},a.map((function(e){return m.a.createElement("button",{type:"button",onClick:function(){return n(e)},key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)}))))},af=["color"],nf=function(e){var t=e.editor,i=e.variables;return i&&i.length?m.a.createElement(Qg,{customTarget:function(){return m.a.createElement(ng,{icon:function(e){e.color;var t=h()(e,af);return m.a.createElement(lg,t)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})}},m.a.createElement(ef,{onClickVariable:function(e){var i=e.category_key,a=e.key,n=i?"".concat(i,".").concat(a):a;t.chain().focus().setVariable({label:n}).run()},variables:i})):null},rf=["size","color","strokeWidth"];function of(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,rf);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M17 21H12C10.22 21 8.47991 20.4722 6.99987 19.4832C5.51983 18.4943 4.36628 17.0887 3.68509 15.4442C3.0039 13.7996 2.82567 11.99 3.17294 10.2442C3.5202 8.49836 4.37737 6.89472 5.63604 5.63604C6.89472 4.37737 8.49836 3.5202 10.2442 3.17294C11.99 2.82567 13.7996 3.0039 15.4442 3.68509C17.0887 4.36628 18.4943 5.51983 19.4832 6.99987C20.4722 8.47991 21 10.22 21 12V13.5C21 14.163 20.7366 14.7989 20.2678 15.2678C19.7989 15.7366 19.163 16 18.5 16C17.837 16 17.2011 15.7366 16.7322 15.2678C16.2634 14.7989 16 14.163 16 13.5V12C16 10.9391 15.5786 9.92172 14.8284 9.17158C14.0783 8.42143 13.0609 8 12 8V8C11.2089 8 10.4355 8.2346 9.77772 8.67413C9.11993 9.11365 8.60724 9.73837 8.30449 10.4693C8.00174 11.2002 7.92252 12.0044 8.07686 12.7804C8.2312 13.5563 8.61217 14.269 9.17158 14.8284C9.73099 15.3878 10.4437 15.7688 11.2196 15.9231C11.9956 16.0775 12.7998 15.9983 13.5307 15.6955C14.2616 15.3928 14.8864 14.8801 15.3259 14.2223C15.7654 13.5645 16 12.7911 16 12",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}of.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},of.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var sf=["size","user","isSquare","status","onClick","className"],lf={small:24,medium:32,large:40,xlarge:64},uf=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"];function _f(e){var t,i,a=e.size,n=e.user,r=e.isSquare,o=e.status,s=e.onClick,l=e.className,_=h()(e,sf),d=Object(p.useState)(!1),c=g()(d,2),f=c[0],F=c[1],E=n.name,y=void 0===E?"":E,D=n.imageUrl,v="medium"===a,k="large"===a,S="xlarge"===a,w=(t=y.trim().split(" ")).reduce((function(e,i,a){return 0!==a&&a!==t.length-1||(e="".concat(e).concat(i.charAt(0).toUpperCase())),e}),""),C={height:lf[a],width:lf[a],backgroundColor:(i=(w.charCodeAt(0)||0)+(w.charCodeAt(1)||0),uf[i%65%uf.length]||uf[0])},x=b()("ne-avatar",{"ne-avatar--medium":v,"ne-avatar--large":k,"ne-avatar--xlarge":S,"ne-avatar--round":!r,hidden:!f}),T=b()("ne-avatar__text",{"ne-avatar__text-medium":v,"ne-avatar__text-large":k,"ne-avatar__text-xlarge":S}),O=b()("ne-avatar__status","".concat(o),{"ne-avatar__status-medium":v,"ne-avatar__status-large":k,"ne-avatar__status-xlarge":S,"ne-avatar__status-square":r}),N=function(){return null==o?m.a.Fragment:m.a.createElement("span",{className:O})},A=function(){return m.a.createElement("span",{className:T},w)},R=w&&!D&&!f;return m.a.createElement("div",u()({onClick:s,style:C,className:b()("ne-avatar--container",{"ne-avatar--container-round":!r},l)},_),m.a.createElement(N,null),R?m.a.createElement(A,null):m.a.createElement("img",{className:x,onLoad:function(){return F(!0)},onError:function(){return F(!1)},src:D,alt:"avatar-".concat(w)}))}_f.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:function(){},status:null},_f.propTypes={size:tg.a.oneOf(Object.keys(lf)),user:tg.a.shape({imageUrl:tg.a.string,name:tg.a.string}),isSquare:tg.a.bool,onClick:tg.a.func,status:tg.a.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:tg.a.string};var df=_f,cf=function(e){var t=e.editor,i=e.mentions,a=e.showImageInMention,n=Object(p.useRef)();return i&&i.length?m.a.createElement(Qg,{ref:n,customTarget:function(){var e;return m.a.createElement(ng,{icon:of,iconActive:null===(e=n.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},m.a.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},i.map((function(e){var i="string"==typeof e?e:e.label,n="string"==typeof e?"":e.imageUrl;return m.a.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:i,onClick:function(){return t.commands.setMention(i)},type:"button","data-cy":"neeto-editor-mention-option-".concat(e.label)},a&&m.a.createElement(df,{size:"small",user:{name:i,imageUrl:n}}),m.a.createElement("p",null,i))})))):null},gf=["size","color","strokeWidth"];function ff(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,gf);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M11.009 11.249H12.159V15.499",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M11 15.4986H13.3093",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M12.1 8.24587C12.1 8.29532 12.0853 8.34365 12.0579 8.38477C12.0304 8.42588 11.9914 8.45792 11.9457 8.47684C11.9 8.49576 11.8497 8.50071 11.8012 8.49107C11.7527 8.48142 11.7082 8.45761 11.6732 8.42265C11.6383 8.38769 11.6145 8.34314 11.6048 8.29464C11.5952 8.24615 11.6001 8.19588 11.619 8.1502C11.638 8.10452 11.67 8.06548 11.7111 8.03801C11.7522 8.01053 11.8006 7.99587 11.85 7.99587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M11.85 7.99587C11.9163 7.99587 11.9799 8.02221 12.0268 8.0691C12.0737 8.11598 12.1 8.17957 12.1 8.24587",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M16 2.99862H8C5.23858 2.99862 3 5.2372 3 7.99862V15.9986C3 18.76 5.23858 20.9986 8 20.9986H16C18.7614 20.9986 21 18.76 21 15.9986V7.99862C21 5.2372 18.7614 2.99862 16 2.99862Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}ff.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},ff.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var hf=["children","className","required","helpIconProps"],pf=["onClick","icon","tooltipProps","className"],mf=function(e){var t=e.children,i=e.className,a=void 0===i?"":i,n=e.required,r=void 0!==n&&n,o=e.helpIconProps,s=void 0===o?null:o,l=h()(e,hf),_=s||{},c=_.onClick,g=_.icon,f=_.tooltipProps,p=_.className,F=h()(_,pf),E=g||ff;return m.a.createElement("label",u()({className:b()("ne-label flex items-center",a)},l),t,r&&m.a.createElement("span",{"aria-hidden":!0},"*"),s&&m.a.createElement(xd,u()({},f,{disabled:!f}),m.a.createElement("span",{className:b()("ml-1",d()({},p,p)),onClick:c},m.a.createElement(E,u()({size:16},F)))))},Ff=["id","size","type","label","error","suffix","prefix","disabled","helpText","className","nakedInput","contentSize","required"],bf=Object(p.forwardRef)((function(e,t){var i=e.id,a=e.size,n=void 0===a?"small":a,r=e.type,o=void 0===r?"text":r,s=e.label,l=e.error,_=void 0===l?null:l,d=e.suffix,c=void 0===d?null:d,g=e.prefix,f=void 0===g?null:g,p=e.disabled,F=void 0!==p&&p,E=e.helpText,y=void 0===E?"":E,D=e.className,v=void 0===D?"":D,k=e.nakedInput,S=void 0!==k&&k,w=e.contentSize,C=void 0===w?null:w,x=e.required,T=void 0!==x&&x,O=h()(e,Ff);return m.a.createElement("div",{className:b()(["ne-input__wrapper",v])},s&&m.a.createElement(mf,{required:T,"data-cy":"neeto-editor-".concat(ic(s),"-input-label"),htmlFor:i},s),m.a.createElement("div",{className:b()("ne-input",{"ne-input--naked":!!S,"ne-input--error":!!_,"ne-input--disabled":!!F,"ne-input--small":"small"===n})},f&&m.a.createElement("div",{className:"ne-input__prefix"},f),m.a.createElement("input",u()({ref:t,type:o,disabled:F,size:C,required:T,"aria-invalid":!!_,"data-cy":"".concat(ic(s),"-input-field")},O)),c&&m.a.createElement("div",{className:"ne-input__suffix"},c)),!!_&&m.a.createElement("p",{"data-cy":"".concat(ic(s),"-input-error"),className:"ne-input__error"},_),y&&m.a.createElement("p",{className:"ne-input__help-text"},y))}));bf.displayName="Input";var Ef=bf,yf=function(e){var t=e.editor,i=Object(p.useRef)(),a=Object(p.useRef)(),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(""),u=g()(l,2),_=u[0],d=u[1],c=t.isActive("link"),f=function(){d(t.getAttributes("link").href||"")},h=function(){var e;qc.test(_)?(t.chain().focus().setLink({href:_}).run(),null===(e=i.current)||void 0===e||e.close()):s("Please enter a valid url")};return m.a.createElement(Qg,{ref:i,onVisible:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:function(){return m.a.createElement(ng,{icon:sd,iconActive:c,onClick:f,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"})},className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},m.a.createElement("div",{onKeyDown:function(e){"Escape"===e.key?i.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},m.a.createElement(Ef,{ref:a,name:"url",value:_,placeholder:"Paste URL",onFocus:function(){return s("")},error:o,onChange:function(e){var t=e.target.value;return d(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),m.a.createElement(jc,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),c&&m.a.createElement(jc,{label:"Unlink",onClick:function(){var e;t.chain().focus().unsetLink().run(),null===(e=i.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},Df=["size","color","strokeWidth"];function vf(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Df);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M12 3C7.037 3 3 7.037 3 12C3 16.963 7.037 21 12 21C16.963 21 21 16.962 21 12C21 7.038 16.962 3 12 3Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}),v_.createElement("path",{d:"M15.5006 15.688C15.5006 15.688 14.1876 17 12.0006 17C9.81263 17 8.50063 15.688 8.50063 15.688M15.3286 9.5C15.1906 9.5 15.0786 9.612 15.0796 9.75C15.0796 9.888 15.1916 10 15.3296 10C15.4676 10 15.5796 9.888 15.5796 9.75C15.5796 9.612 15.4676 9.5 15.3286 9.5ZM8.63963 9.5C8.50163 9.5 8.38963 9.612 8.39063 9.75C8.39063 9.888 8.50263 10 8.64063 10C8.77863 10 8.89063 9.888 8.89063 9.75C8.89063 9.612 8.77863 9.5 8.63963 9.5Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}vf.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},vf.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var kf=i(20),Sf=i.n(kf),wf=i(21),Cf=i.n(wf),xf=i(14),Tf=i.n(xf),Of=i(22),Nf=i.n(Of),Af=i(23),Rf=i.n(Af),Mf=i(17),If=i.n(Mf),Bf=i(31),Lf=i(9),Pf=i.n(Lf),jf=i(10),qf=i.n(jf),Uf=i(46),zf=i.n(Uf),Gf={name:"a",unified:"b",non_qualified:"c",has_img_apple:"d",has_img_google:"e",has_img_twitter:"f",has_img_facebook:"h",keywords:"j",sheet:"k",emoticons:"l",text:"m",short_names:"n",added_in:"o"},Hf=function(e){var t=[],i=function(e,i){e&&(Array.isArray(e)?e:[e]).forEach((function(e){(i?e.split(/[-|_|\s]+/):[e]).forEach((function(e){e=e.toLowerCase(),-1==t.indexOf(e)&&t.push(e)}))}))};return i(e.short_names,!0),i(e.name,!0),i(e.keywords,!1),i(e.emoticons,!1),t.join(",")},Yf=function(e){for(var t in e.compressed=!1,e.emojis){var i=e.emojis[t];for(var a in Gf)i[a]=i[Gf[a]],delete i[Gf[a]];i.short_names||(i.short_names=[]),i.short_names.unshift(t),i.sheet_x=i.sheet[0],i.sheet_y=i.sheet[1],delete i.sheet,i.text||(i.text=""),i.added_in||(i.added_in=6),i.added_in=i.added_in.toFixed(1),i.search=Hf(i)}},Vf=String.fromCodePoint||function(){var e,t,i=16384,a=[],n=-1,r=arguments.length;if(!r)return"";for(var o="";++n<r;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||Math.floor(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?a.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,a.push(e,t)),(n+1===r||a.length>i)&&(o+=String.fromCharCode.apply(null,a),a.length=0)}return o},Wf=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/,$f=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function Kf(e){var t=e.split("-").map((function(e){return"0x".concat(e)}));return Vf.apply(null,t)}function Qf(e){var t=e.name,i=e.short_names,a=e.skin_tone,n=e.skin_variations,r=e.emoticons,o=e.unified,s=e.custom,l=e.customCategory,u=e.imageUrl,_=e.id||i[0],d=":".concat(_,":");return s?{id:_,name:t,short_names:i,colons:d,emoticons:r,custom:s,customCategory:l,imageUrl:u}:(a&&(d+=":skin-tone-".concat(a,":")),{id:_,name:t,short_names:i,colons:d,emoticons:r,unified:o.toLowerCase(),skin:a||(n?1:null),native:Kf(o)})}function Zf(){return Qf(Xf.apply(void 0,arguments))}function Xf(e,t,i,a){var n={};if("string"==typeof e){var r=e.match(Wf);if(r&&(e=r[1],r[2]&&(t=parseInt(r[2],10))),a.aliases.hasOwnProperty(e)&&(e=a.aliases[e]),!a.emojis.hasOwnProperty(e))return null;n=a.emojis[e]}else e.id&&(a.aliases.hasOwnProperty(e.id)&&(e.id=a.aliases[e.id]),a.emojis.hasOwnProperty(e.id)&&(n=a.emojis[e.id],t||(t=e.skin)));if(Object.keys(n).length||((n=e).custom=!0,n.search||(n.search=Hf(e))),n.emoticons||(n.emoticons=[]),n.variations||(n.variations=[]),n.skin_variations&&t>1){n=JSON.parse(JSON.stringify(n));var o=$f[t-1],s=n.skin_variations[o];if(s&&(!s.variations&&n.variations&&delete n.variations,i&&(null==s["has_img_".concat(i)]||s["has_img_".concat(i)])||!i))for(var l in n.skin_tone=t,s){var u=s[l];n[l]=u}}return n.variations&&n.variations.length&&((n=JSON.parse(JSON.stringify(n))).unified=n.variations.shift()),n}function Jf(e){return e.reduce((function(e,t){return-1===e.indexOf(t)&&e.push(t),e}),[])}function eh(e,t){var i=Jf(e),a=Jf(t);return i.filter((function(e){return a.indexOf(e)>=0}))}function th(e,t){var i={};for(var a in e){var n=e[a],r=n;t.hasOwnProperty(a)&&(r=t[a]),"object"===zf()(r)&&(r=th(n,r)),i[a]=r}return i}var ih,ah,nh="emoji-mart",rh="undefined"!=typeof window&&"localStorage"in window;function oh(e,t){if(ah)ah(e,t);else{if(!rh)return;try{window.localStorage["".concat(nh,".").concat(e)]=JSON.stringify(t)}catch(e){}}}var sh={update:function(e){for(var t in e){oh(t,e[t])}},set:oh,get:function(e){if(ih)return ih(e);if(rh)try{var t=window.localStorage["".concat(nh,".").concat(e)];if(t)return JSON.parse(t)}catch(e){return}},setNamespace:function(e){nh=e},setHandlers:function(e){e||(e={}),ih=e.getter,ah=e.setter}},lh=function(){function e(t,i){Pf()(this,e),t.compressed&&Yf(t),this.data=t||{},this.set=i||null,this.originalPool={},this.index={},this.emojis={},this.emoticons={},this.customEmojisList=[],this.buildIndex()}return qf()(e,[{key:"buildIndex",value:function(){var e=this,t=function(t){var i=e.data.emojis[t],a=i.short_names,n=i.emoticons,r=i.skin_variations,o=a[0];if(n&&n.forEach((function(t){e.emoticons[t]||(e.emoticons[t]=o)})),r){e.emojis[o]={};for(var s=1;s<=6;s++)e.emojis[o][s]=Zf({id:o,skin:s},s,e.set,e.data)}else e.emojis[o]=Zf(o,null,e.set,e.data);e.originalPool[o]=i};for(var i in this.data.emojis)t(i)}},{key:"clearCustomEmojis",value:function(e){var t=this;this.customEmojisList.forEach((function(i){var a=i.id||i.short_names[0];delete e[a],delete t.emojis[a]}))}},{key:"addCustomToPool",value:function(e,t){var i=this;this.customEmojisList.length&&this.clearCustomEmojis(t),e.forEach((function(e){var a=e.id||e.short_names[0];a&&!t[a]&&(t[a]=Xf(e,null,null,i.data),i.emojis[a]=Zf(e,null,null,i.data))})),this.customEmojisList=e,this.index={}}},{key:"search",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.emojisToShowFilter,n=i.maxResults,r=i.include,o=i.exclude,s=i.custom,l=void 0===s?[]:s;this.customEmojisList!=l&&this.addCustomToPool(l,this.originalPool);var u=sh.get("skin")||1;n||(n=75),r||(r=[]),o||(o=[]);var _=null,d=this.originalPool;if(e.length){if("-"==e||"-1"==e)return[this.emojis[-1][u]];var c=e.toLowerCase().split(/[\s|,|\-|_]+/),g=[];if(c.length>2&&(c=[c[0],c[1]]),(r.length||o.length)&&(d={},this.data.categories.forEach((function(e){var i=!r||!r.length||r.indexOf(e.id)>-1,a=!(!o||!o.length)&&o.indexOf(e.id)>-1;i&&!a&&e.emojis.forEach((function(e){return d[e]=t.data.emojis[e]}))})),l.length)){var f=!r||!r.length||r.indexOf("custom")>-1,h=!(!o||!o.length)&&o.indexOf("custom")>-1;f&&!h&&this.addCustomToPool(l,d)}_=(g=c.map((function(e){for(var i=d,a=t.index,n=0,r=0;r<e.length;r++){var o=e[r];n++,a[o]||(a[o]={}),(a=a[o]).results||function(){var r={};for(var o in a.results=[],a.pool={},i){var s=i[o],l=s.search,_=e.substr(0,n),d=l.indexOf(_);if(-1!=d){var c=d+1;_==o&&(c=0),t.emojis[o]&&t.emojis[o][u]?a.results.push(t.emojis[o][u]):a.results.push(t.emojis[o]),a.pool[o]=s,r[o]=c}}a.results.sort((function(e,t){var i=r[e.id],a=r[t.id];return i==a?e.id.localeCompare(t.id):i-a}))}(),i=a.pool}return a.results})).filter((function(e){return e}))).length>1?eh.apply(null,g):g.length?g[0]:[]}return _&&(a&&(_=_.filter((function(e){return a(d[e.id])}))),_&&_.length>n&&(_=_.slice(0,n))),_}}]),e}(),uh=new lh(Bf);var _h,dh,ch={search:function(){return uh.search.apply(uh,arguments)},emojis:uh.emojis,emoticons:uh.emoticons},gh=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart","poop"],fh={};function hh(){dh=!0,_h=sh.get("frequently")}var ph={add:function(e){dh||hh();var t=e.id;_h||(_h=fh),_h[t]||(_h[t]=0),_h[t]+=1,sh.set("last",t),sh.set("frequently",_h)},get:function(e){if(dh||hh(),!_h){fh={};for(var t=[],i=0;i<e;i++)fh[gh[i]]=e-i,t.push(gh[i]);return t}var a=4*e,n=[];for(var r in _h)_h.hasOwnProperty(r)&&n.push(r);var o=n.sort((function(e,t){return _h[e]-_h[t]})).reverse().slice(0,a),s=sh.get("last");return s&&-1==o.indexOf(s)&&(o.pop(),o.push(s)),o}},mh=i(15),Fh=i.n(mh),bh=i(25),Eh=i.n(bh),yh=i(11),Dh=i.n(yh),vh=i(12),kh=i.n(vh),Sh=i(13),wh=i.n(Sh),Ch=i(7),xh=i.n(Ch),Th={activity:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"}))},custom:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("g",{transform:"translate(2.000000, 1.000000)"},m.a.createElement("rect",{id:"Rectangle",x:"8",y:"0",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"}),m.a.createElement("rect",{id:"Rectangle",transform:"translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) ",x:"8.343",y:"0.049",width:"3",height:"21",rx:"1.5"})))},flags:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"}))},foods:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"}))},nature:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),m.a.createElement("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"}))},objects:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),m.a.createElement("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"}))},people:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),m.a.createElement("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"}))},places:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),m.a.createElement("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"}))},recent:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),m.a.createElement("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}))},symbols:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},m.a.createElement("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"}))}},Oh={search:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"}))},delete:function(){return m.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 20 20",opacity:"0.5"},m.a.createElement("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"}))}},Nh={data:tg.a.object.isRequired,onOver:tg.a.func,onLeave:tg.a.func,onClick:tg.a.func,fallback:tg.a.func,backgroundImageFn:tg.a.func,native:tg.a.bool,forceSize:tg.a.bool,tooltip:tg.a.bool,useButton:tg.a.bool,skin:tg.a.oneOf([1,2,3,4,5,6]),sheetSize:tg.a.oneOf([16,20,32,64]),sheetColumns:tg.a.number,sheetRows:tg.a.number,set:tg.a.oneOf(["apple","google","twitter","facebook"]),size:tg.a.number.isRequired,emoji:tg.a.oneOfType([tg.a.string,tg.a.object]).isRequired},Ah={onClick:tg.a.func,onSelect:tg.a.func,onSkinChange:tg.a.func,perLine:tg.a.number,emojiSize:tg.a.number,i18n:tg.a.object,style:tg.a.object,title:tg.a.string,emoji:tg.a.string,color:tg.a.string,set:Nh.set,skin:Nh.skin,native:tg.a.bool,backgroundImageFn:Nh.backgroundImageFn,sheetSize:Nh.sheetSize,emojisToShowFilter:tg.a.func,showPreview:tg.a.bool,showSkinTones:tg.a.bool,emojiTooltip:Nh.tooltip,useButton:Nh.useButton,theme:tg.a.oneOf(["auto","light","dark"]),include:tg.a.arrayOf(tg.a.string),exclude:tg.a.arrayOf(tg.a.string),recent:tg.a.arrayOf(tg.a.string),autoFocus:tg.a.bool,enableFrequentEmojiSort:tg.a.bool,custom:tg.a.arrayOf(tg.a.shape({name:tg.a.string.isRequired,short_names:tg.a.arrayOf(tg.a.string).isRequired,emoticons:tg.a.arrayOf(tg.a.string),keywords:tg.a.arrayOf(tg.a.string),imageUrl:tg.a.string,spriteUrl:tg.a.string,sheet_x:tg.a.number,sheet_y:tg.a.number,size:tg.a.number,sheetColumns:tg.a.number,sheetRows:tg.a.number})),skinEmoji:tg.a.string,notFound:tg.a.func,notFoundEmoji:tg.a.string,icons:tg.a.object},Rh=function(e){function t(e){var i;Pf()(this,t),i=Dh()(this,kh()(t).call(this,e));var a=e.categories.filter((function(e){return e.first}))[0];return i.state={selected:a.name},i.handleClick=i.handleClick.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"handleClick",value:function(e){var t=e.currentTarget.getAttribute("data-index"),i=this.props,a=i.categories;(0,i.onAnchorClick)(a[t],t)}},{key:"render",value:function(){var e=this,t=this.props,i=t.categories,a=t.color,n=t.i18n,r=t.icons,o=this.state.selected;return m.a.createElement("nav",{className:"emoji-mart-anchors","aria-label":n.categorieslabel},i.map((function(t,i){var s=t.id,l=t.name,u=t.anchor,_=l==o;if(!1===u)return null;var d=s.startsWith("custom-")?"custom":s;return m.a.createElement("button",{key:s,"aria-label":n.categories[d],title:n.categories[d],"data-index":i,type:"button",onClick:e.handleClick,className:"emoji-mart-anchor ".concat(_?"emoji-mart-anchor-selected":""),style:{color:_?a:null}},m.a.createElement("div",{className:"emoji-mart-anchor-icon"},r.categories[d]()),m.a.createElement("span",{className:"emoji-mart-anchor-bar",style:{backgroundColor:a}}))})))}}]),t}(m.a.PureComponent);Rh.propTypes={categories:tg.a.array,onAnchorClick:tg.a.func,icons:tg.a.object},Rh.defaultProps={categories:[],onAnchorClick:function(){},icons:{}};var Mh={skin:1,set:"apple",sheetSize:64,sheetColumns:57,sheetRows:57,native:!1,forceSize:!1,tooltip:!1,useButton:!0,backgroundImageFn:function(e,t){return"https://unpkg.com/emoji-datasource-".concat(e,"@").concat("5.0.1","/img/").concat(e,"/sheets-256/").concat(t,".png")}},Ih={onClick:function(){},onSelect:function(){},onSkinChange:function(){},emojiSize:24,perLine:9,i18n:{},style:{},title:"Emoji Mart™",emoji:"department_store",color:"#ae65c5",set:Mh.set,theme:"light",skin:null,defaultSkin:Mh.skin,native:Mh.native,sheetSize:Mh.sheetSize,backgroundImageFn:Mh.backgroundImageFn,emojisToShowFilter:null,showPreview:!0,showSkinTones:!0,emojiTooltip:Mh.tooltip,useButton:Mh.useButton,autoFocus:!1,enableFrequentEmojiSort:!1,custom:[],skinEmoji:"",notFound:function(){},notFoundEmoji:"sleuth_or_spy",icons:{}};function Bh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Lh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Bh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Bh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Ph=function(e){return Xf(e.emoji,e.skin,e.set,e.data)},jh=function(e){var t=Ph(e),i=t.sheet_x,a=t.sheet_y,n=100/(e.sheetColumns-1),r=100/(e.sheetRows-1);return"".concat(n*i,"% ").concat(r*a,"%")},qh=function(e){return Zf(e.emoji,e.skin,e.set,e.data)},Uh=function(e){return!isNaN(e-parseFloat(e))},zh=function e(t){for(var i in t.data.compressed&&Yf(t.data),e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);var a=Ph(t);if(!a)return t.fallback?t.fallback(null,t):null;var n=a.unified,r=a.custom,o=a.short_names,s=a.imageUrl,l={},u=t.children,_="emoji-mart-emoji",d=n&&Kf(n),c=[d].concat(o).filter(Boolean).join(", "),g=null;if(!n&&!r)return t.fallback?t.fallback(a,t):null;if(t.tooltip&&(g=o[0]),t.native&&n)_+=" emoji-mart-emoji-native",l={fontSize:t.size},u=d,t.forceSize&&(l.display="inline-block",l.width=t.size,l.height=t.size,l.wordBreak="keep-all");else if(r)_+=" emoji-mart-emoji-custom",l={width:t.size,height:t.size,display:"inline-block"},l=a.spriteUrl?Lh({},l,{backgroundImage:"url(".concat(a.spriteUrl,")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:jh(t)}):Lh({},l,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"});else{if(!(null==a["has_img_".concat(t.set)]||a["has_img_".concat(t.set)]))return t.fallback?t.fallback(a,t):null;l={width:t.size,height:t.size,display:"inline-block",backgroundImage:"url(".concat(t.backgroundImageFn(t.set,t.sheetSize),")"),backgroundSize:"".concat(100*t.sheetColumns,"% ").concat(100*t.sheetRows,"%"),backgroundPosition:jh(t)}}var f={name:"span",props:{}};return t.onClick&&t.useButton&&(f.name="button",f.props={type:"button"}),t.html?(l=function(e){var t=document.createElement("div");for(var i in e){var a=e[i];Uh(a)&&(a+="px"),t.style[i]=a}return t.getAttribute("style")}(l),"<".concat(f.name," style='").concat(l,"' aria-label='").concat(c,"' ").concat(g?"title='".concat(g,"'"):""," class='").concat(_,"'>").concat(u||"","</").concat(f.name,">")):m.a.createElement(f.name,Eh()({onClick:function(e){return function(e,t){t.onClick&&(0,t.onClick)(qh(t),e)}(e,t)},onMouseEnter:function(e){return function(e,t){t.onOver&&(0,t.onOver)(qh(t),e)}(e,t)},onMouseLeave:function(e){return function(e,t){t.onLeave&&(0,t.onLeave)(qh(t),e)}(e,t)},"aria-label":c,title:g,className:_},f.props),m.a.createElement("span",{style:l},u))};zh.propTypes=Lh({},Nh,{data:tg.a.object.isRequired}),zh.defaultProps=Mh;var Gh=zh;function Hh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var Yh=function(e){function t(){return Pf()(this,t),Dh()(this,kh()(t).apply(this,arguments))}return wh()(t,e),qf()(t,[{key:"render",value:function(){var e=this.props,t=e.data,i=e.emojiProps,a=e.i18n,n=e.notFound,r=e.notFoundEmoji;return n&&n()||m.a.createElement("div",{className:"emoji-mart-no-results"},Gh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Hh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Hh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({data:t},i,{size:38,emoji:r,onOver:null,onLeave:null,onClick:null})),m.a.createElement("div",{className:"emoji-mart-no-results-label"},a.notfound))}}]),t}(m.a.PureComponent);function Vh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}Yh.propTypes={notFound:tg.a.func.isRequired,emojiProps:tg.a.object.isRequired};var Wh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).data=e.data,i.setContainerRef=i.setContainerRef.bind(xh()(i)),i.setLabelRef=i.setLabelRef.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"componentDidMount",value:function(){this.margin=0,this.minMargin=0,this.memoizeSize()}},{key:"shouldComponentUpdate",value:function(e,t){var i=this.props,a=i.name,n=i.perLine,r=i.native,o=i.hasStickyPosition,s=i.emojis,l=i.emojiProps,u=l.skin,_=l.size,d=l.set,c=e.perLine,g=e.native,f=e.hasStickyPosition,h=e.emojis,p=e.emojiProps,m=p.skin,F=p.size,b=p.set,E=!1;return"Recent"==a&&n!=c&&(E=!0),"Search"==a&&(E=!(s==h)),u==m&&_==F&&r==g&&d==b&&o==f||(E=!0),E}},{key:"memoizeSize",value:function(){if(!this.container)return this.top=0,void(this.maxMargin=0);var e=this.container.parentElement,t=this.container.getBoundingClientRect(),i=t.top,a=t.height,n=e.getBoundingClientRect().top,r=this.label.getBoundingClientRect().height;this.top=i-n+e.scrollTop,this.maxMargin=0==a?0:a-r}},{key:"handleScroll",value:function(e){var t=e-this.top;if((t=(t=t<this.minMargin?this.minMargin:t)>this.maxMargin?this.maxMargin:t)!=this.margin)return this.props.hasStickyPosition||(this.label.style.top="".concat(t,"px")),this.margin=t,!0}},{key:"getEmojis",value:function(){var e=this,t=this.props,i=t.name,a=t.emojis,n=t.recent,r=t.perLine;if("Recent"==i){var o=this.props.custom,s=n||ph.get(r);if(s.length&&(a=s.map((function(e){var t=o.filter((function(t){return t.id===e}))[0];return t||e})).filter((function(t){return!!Xf(t,null,null,e.data)}))),0===a.length&&s.length>0)return null}return a&&(a=a.slice(0)),a}},{key:"updateDisplay",value:function(e){this.getEmojis()&&this.container&&(this.container.style.display=e)}},{key:"setContainerRef",value:function(e){this.container=e}},{key:"setLabelRef",value:function(e){this.label=e}},{key:"render",value:function(){var e=this,t=this.props,i=t.id,a=t.name,n=t.hasStickyPosition,r=t.emojiProps,o=t.i18n,s=t.notFound,l=t.notFoundEmoji,u=this.getEmojis(),_={},d={},c={};u||(c={display:"none"}),n||(_={height:28},d={position:"absolute"});var g=o.categories[i]||a;return m.a.createElement("section",{ref:this.setContainerRef,className:"emoji-mart-category","aria-label":g,style:c},m.a.createElement("div",{style:_,"data-name":a,className:"emoji-mart-category-label"},m.a.createElement("span",{style:d,ref:this.setLabelRef,"aria-hidden":!0},g)),m.a.createElement("ul",{className:"emoji-mart-category-list"},u&&u.map((function(t){return m.a.createElement("li",{key:t.short_names&&t.short_names.join("_")||t},Gh(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({emoji:t,data:e.data},r)))}))),u&&!u.length&&m.a.createElement(Yh,{i18n:o,notFound:s,notFoundEmoji:l,data:this.data,emojiProps:r}))}}]),t}(m.a.Component);Wh.propTypes={emojis:tg.a.array,hasStickyPosition:tg.a.bool,name:tg.a.string.isRequired,native:tg.a.bool.isRequired,perLine:tg.a.number.isRequired,emojiProps:tg.a.object.isRequired,recent:tg.a.arrayOf(tg.a.string),notFound:tg.a.func,notFoundEmoji:tg.a.string.isRequired},Wh.defaultProps={emojis:[],hasStickyPosition:!0};var $h=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).state={opened:!1},i}return wh()(t,e),qf()(t,[{key:"handleClick",value:function(e){var t=parseInt(e.currentTarget.getAttribute("data-skin")),i=this.props.onChange;this.state.opened?(this.setState({opened:!1}),t!=this.props.skin&&i(t)):this.setState({opened:!0})}},{key:"render",value:function(){return null}}]),t}(m.a.PureComponent);$h.propTypes={onChange:tg.a.func,skin:tg.a.number.isRequired},$h.defaultProps={onChange:function(){}};var Kh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).handleClick=i.handleClick.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.emojiProps,a=e.data,n=e.skinEmoji,r=e.i18n,o=this.state.opened,s=[],l=1;l<=6;l++){var u=l===t;s.push(m.a.createElement("span",{key:"skin-tone-".concat(l),className:"emoji-mart-skin-swatch custom".concat(u?" selected":"")},m.a.createElement("span",{onClick:this.handleClick,"data-skin":l,className:"emoji-mart-skin-tone-".concat(l)},Gh({emoji:n,data:a,skin:l,backgroundImageFn:i.backgroundImageFn,native:i.native,set:i.set,sheetSize:i.sheetSize,size:23}))))}return m.a.createElement("div",{className:"emoji-mart-skin-swatches custom".concat(o?" opened":"")},m.a.createElement("div",{className:"emoji-mart-skin-text".concat(o?" opened":"")},r.skintext),s)}}]),t}($h);Kh.propTypes={onChange:tg.a.func,skin:tg.a.number.isRequired,emojiProps:tg.a.object.isRequired,skinTone:tg.a.number,skinEmoji:tg.a.string.isRequired,i18n:tg.a.object},Kh.defaultProps={onChange:function(){},skinTone:null};var Qh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).handleClick=i.handleClick.bind(xh()(i)),i.handleKeyDown=i.handleKeyDown.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"handleKeyDown",value:function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),this.handleClick(e))}},{key:"render",value:function(){for(var e=this.props,t=e.skin,i=e.i18n,a=this.state.opened,n=[],r=1;r<=6;r++){var o=r===t,s=a||o;n.push(m.a.createElement("span",Eh()({key:"skin-tone-".concat(r),className:"emoji-mart-skin-swatch".concat(o?" selected":""),"aria-label":i.skintones[r],"aria-hidden":!s},a?{role:"menuitem"}:{}),m.a.createElement("span",Eh()({onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button"},o?{"aria-haspopup":!0,"aria-expanded":!!a}:{},a?{"aria-pressed":!!o}:{},{tabIndex:s?"0":"","aria-label":i.skintones[r],title:i.skintones[r],"data-skin":r,className:"emoji-mart-skin emoji-mart-skin-tone-".concat(r)}))))}return m.a.createElement("section",{className:"emoji-mart-skin-swatches".concat(a?" opened":""),"aria-label":i.skintext},m.a.createElement("div",a?{role:"menubar"}:{},n))}}]),t}($h);function Zh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Xh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Zh(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Zh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}Qh.propTypes={onChange:tg.a.func,skin:tg.a.number.isRequired,i18n:tg.a.object},Qh.defaultProps={onChange:function(){}};var Jh=function(e){function t(e){var i;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).data=e.data,i.state={emoji:null},i}return wh()(t,e),qf()(t,[{key:"render",value:function(){var e=this.state.emoji,t=this.props,i=t.emojiProps,a=t.skinsProps,n=t.showSkinTones,r=t.title,o=t.emoji,s=t.i18n,l=t.showPreview;if(e&&l){var u=Xf(e,null,null,this.data),_=u.emoticons,d=[],c=[];return(void 0===_?[]:_).forEach((function(e){d.indexOf(e.toLowerCase())>=0||(d.push(e.toLowerCase()),c.push(e))})),m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},Gh(Xh({key:e.id,emoji:e,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("div",{className:"emoji-mart-preview-name"},e.name),m.a.createElement("div",{className:"emoji-mart-preview-shortnames"},u.short_names.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-shortname"},":",e,":")}))),m.a.createElement("div",{className:"emoji-mart-preview-emoticons"},c.map((function(e){return m.a.createElement("span",{key:e,className:"emoji-mart-preview-emoticon"},e)})))))}return m.a.createElement("div",{className:"emoji-mart-preview"},m.a.createElement("div",{className:"emoji-mart-preview-emoji","aria-hidden":"true"},o&&o.length&&Gh(Xh({emoji:o,data:this.data},i))),m.a.createElement("div",{className:"emoji-mart-preview-data","aria-hidden":"true"},m.a.createElement("span",{className:"emoji-mart-title-label"},r)),n&&m.a.createElement("div",{className:"emoji-mart-preview-skins".concat(a.skinEmoji?" custom":"")},a.skinEmoji?m.a.createElement(Kh,{skin:a.skin,emojiProps:i,data:this.data,skinEmoji:a.skinEmoji,i18n:s,onChange:a.onChange}):m.a.createElement(Qh,{skin:a.skin,i18n:s,onChange:a.onChange})))}}]),t}(m.a.PureComponent);Jh.propTypes={showSkinTones:tg.a.bool,title:tg.a.string.isRequired,emoji:tg.a.string.isRequired,emojiProps:tg.a.object.isRequired,skinsProps:tg.a.object.isRequired},Jh.defaultProps={showSkinTones:!0,onChange:function(){}};var ep=0,tp=function(e){function t(e){var i,a,n,r;return Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).state={icon:Oh.search,isSearching:!1,id:++ep},i.data=e.data,i.emojiIndex=new lh(i.data),i.setRef=i.setRef.bind(xh()(i)),i.clear=i.clear.bind(xh()(i)),i.handleKeyUp=i.handleKeyUp.bind(xh()(i)),i.handleChange=(a=i.handleChange.bind(xh()(i)),n="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout,r=!1,function(){r||(r=!0,n((function(){r=!1,a()})))}),i}return wh()(t,e),qf()(t,[{key:"componentDidMount",value:function(){this.input&&this.input.value&&this.search(this.input.value)}},{key:"search",value:function(e){""==e?this.setState({icon:Oh.search,isSearching:!1}):this.setState({icon:Oh.delete,isSearching:!0}),this.props.onSearch(this.emojiIndex.search(e,{emojisToShowFilter:this.props.emojisToShowFilter,maxResults:this.props.maxResults,include:this.props.include,exclude:this.props.exclude,custom:this.props.custom}))}},{key:"clear",value:function(){""!=this.input.value&&(this.input.value="",this.input.focus(),this.search(""))}},{key:"handleChange",value:function(){this.input&&this.search(this.input.value)}},{key:"handleKeyUp",value:function(e){13===e.keyCode&&this.clear()}},{key:"setRef",value:function(e){this.input=e}},{key:"render",value:function(){var e=this.props,t=e.i18n,i=e.autoFocus,a=this.state,n=a.icon,r=a.isSearching,o=a.id,s="emoji-mart-search-".concat(o);return m.a.createElement("section",{className:"emoji-mart-search","aria-label":t.search},m.a.createElement("input",{id:s,ref:this.setRef,type:"search",onChange:this.handleChange,placeholder:t.search,autoFocus:i}),m.a.createElement("label",{className:"emoji-mart-sr-only",htmlFor:s},t.search),m.a.createElement("button",{className:"emoji-mart-search-icon",onClick:this.clear,onKeyUp:this.handleKeyUp,"aria-label":t.clear,disabled:!r},n()))}}]),t}(m.a.PureComponent);function ip(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function ap(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ip(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ip(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}tp.propTypes={onSearch:tg.a.func,maxResults:tg.a.number,emojisToShowFilter:tg.a.func,autoFocus:tg.a.bool},tp.defaultProps={onSearch:function(){},maxResults:75,emojisToShowFilter:null,autoFocus:!1};var np={search:"Search",clear:"Clear",notfound:"No Emoji Found",skintext:"Choose your default skin tone",categories:{search:"Search Results",recent:"Frequently Used",people:"Smileys & People",nature:"Animals & Nature",foods:"Food & Drink",activity:"Activity",places:"Travel & Places",objects:"Objects",symbols:"Symbols",flags:"Flags",custom:"Custom"},categorieslabel:"Emoji categories",skintones:{1:"Default Skin Tone",2:"Light Skin Tone",3:"Medium-Light Skin Tone",4:"Medium Skin Tone",5:"Medium-Dark Skin Tone",6:"Dark Skin Tone"}},rp=function(e){function t(e){var i;Pf()(this,t),(i=Dh()(this,kh()(t).call(this,e))).CUSTOM=[],i.RECENT_CATEGORY={id:"recent",name:"Recent",emojis:null},i.SEARCH_CATEGORY={id:"search",name:"Search",emojis:null,anchor:!1},e.data.compressed&&Yf(e.data),i.data=e.data,i.i18n=th(np,e.i18n),i.icons=th(a,e.icons),i.state={firstRender:!0},i.categories=[];var n=[].concat(i.data.categories);if(e.custom.length>0){var r={},o=0;e.custom.forEach((function(e){r[e.customCategory]||(r[e.customCategory]={id:e.customCategory?"custom-".concat(e.customCategory):"custom",name:e.customCategory||"Custom",emojis:[],anchor:0===o},o++);var t=r[e.customCategory],a=ap({},e,{id:e.short_names[0],custom:!0});t.emojis.push(a),i.CUSTOM.push(a)})),n=n.concat(Object.keys(r).map((function(e){return r[e]})))}i.hideRecent=!0,null!=e.include&&n.sort((function(t,i){return e.include.indexOf(t.id)>e.include.indexOf(i.id)?1:-1}));for(var s=0;s<n.length;s++){var l=n[s],u=!e.include||!e.include.length||e.include.indexOf(l.id)>-1,_=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(l.id)>-1;if(u&&!_)if(e.emojisToShowFilter){for(var d=[],c=l.emojis,g=0;g<c.length;g++){var f=c[g];e.emojisToShowFilter(i.data.emojis[f]||f)&&d.push(f)}if(d.length){var h={emojis:d,name:l.name,id:l.id};i.categories.push(h)}}else i.categories.push(l)}var p=!e.include||!e.include.length||e.include.indexOf(i.RECENT_CATEGORY.id)>-1,m=!(!e.exclude||!e.exclude.length)&&e.exclude.indexOf(i.RECENT_CATEGORY.id)>-1;return p&&!m&&(i.hideRecent=!1,i.categories.unshift(i.RECENT_CATEGORY)),i.categories[0]&&(i.categories[0].first=!0),i.categories.unshift(i.SEARCH_CATEGORY),i.setAnchorsRef=i.setAnchorsRef.bind(xh()(i)),i.handleAnchorClick=i.handleAnchorClick.bind(xh()(i)),i.setSearchRef=i.setSearchRef.bind(xh()(i)),i.handleSearch=i.handleSearch.bind(xh()(i)),i.setScrollRef=i.setScrollRef.bind(xh()(i)),i.handleScroll=i.handleScroll.bind(xh()(i)),i.handleScrollPaint=i.handleScrollPaint.bind(xh()(i)),i.handleEmojiOver=i.handleEmojiOver.bind(xh()(i)),i.handleEmojiLeave=i.handleEmojiLeave.bind(xh()(i)),i.handleEmojiClick=i.handleEmojiClick.bind(xh()(i)),i.handleEmojiSelect=i.handleEmojiSelect.bind(xh()(i)),i.setPreviewRef=i.setPreviewRef.bind(xh()(i)),i.handleSkinChange=i.handleSkinChange.bind(xh()(i)),i.handleKeyDown=i.handleKeyDown.bind(xh()(i)),i.handleDarkMatchMediaChange=i.handleDarkMatchMediaChange.bind(xh()(i)),i}return wh()(t,e),qf()(t,[{key:"componentDidMount",value:function(){var e=this;this.state.firstRender&&(this.testStickyPosition(),this.firstRenderTimeout=setTimeout((function(){e.setState({firstRender:!1})}),60))}},{key:"componentDidUpdate",value:function(){this.updateCategoriesSize(),this.handleScroll()}},{key:"componentWillUnmount",value:function(){this.SEARCH_CATEGORY.emojis=null,clearTimeout(this.leaveTimeout),clearTimeout(this.firstRenderTimeout),this.darkMatchMedia&&this.darkMatchMedia.removeListener(this.handleDarkMatchMediaChange)}},{key:"testStickyPosition",value:function(){var e=document.createElement("div");["","-webkit-","-ms-","-moz-","-o-"].forEach((function(t){return e.style.position="".concat(t,"sticky")})),this.hasStickyPosition=!!e.style.position.length}},{key:"getPreferredTheme",value:function(){return"auto"!=this.props.theme?this.props.theme:this.state.theme?this.state.theme:"function"!=typeof matchMedia?Ih.theme:(this.darkMatchMedia||(this.darkMatchMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMatchMedia.addListener(this.handleDarkMatchMediaChange)),this.darkMatchMedia.media.match(/^not/)?Ih.theme:this.darkMatchMedia.matches?"dark":"light")}},{key:"handleDarkMatchMediaChange",value:function(){this.setState({theme:this.darkMatchMedia.matches?"dark":"light"})}},{key:"handleEmojiOver",value:function(e){var t=this.preview;if(t){var i=this.CUSTOM.filter((function(t){return t.id===e.id}))[0];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a]);t.setState({emoji:e}),clearTimeout(this.leaveTimeout)}}},{key:"handleEmojiLeave",value:function(e){var t=this.preview;t&&(this.leaveTimeout=setTimeout((function(){t.setState({emoji:null})}),16))}},{key:"handleEmojiClick",value:function(e,t){this.props.onClick(e,t),this.handleEmojiSelect(e)}},{key:"handleEmojiSelect",value:function(e){var t=this;this.props.onSelect(e),this.hideRecent||this.props.recent||ph.add(e);var i=this.categoryRefs["category-1"];if(i){var a=i.maxMargin;this.props.enableFrequentEmojiSort&&i.forceUpdate(),requestAnimationFrame((function(){t.scroll&&(i.memoizeSize(),a!=i.maxMargin&&(t.updateCategoriesSize(),t.handleScrollPaint(),t.SEARCH_CATEGORY.emojis&&i.updateDisplay("none")))}))}}},{key:"handleScroll",value:function(){this.waitingForPaint||(this.waitingForPaint=!0,requestAnimationFrame(this.handleScrollPaint))}},{key:"handleScrollPaint",value:function(){if(this.waitingForPaint=!1,this.scroll){var e=null;if(this.SEARCH_CATEGORY.emojis)e=this.SEARCH_CATEGORY;else{for(var t=this.scroll.scrollTop,i=t>(this.scrollTop||0),a=0,n=0,r=this.categories.length;n<r;n++){var o=i?this.categories.length-1-n:n,s=this.categories[o],l=this.categoryRefs["category-".concat(o)];if(l){var u=l.handleScroll(t);(!a||l.top<a)&&l.top>0&&(a=l.top),u&&!e&&(e=s)}}t<a?e=this.categories.filter((function(e){return!(!1===e.anchor)}))[0]:t+this.clientHeight>=this.scrollHeight&&(e=this.categories[this.categories.length-1])}if(e){var _=this.anchors,d=e.name;_.state.selected!=d&&_.setState({selected:d})}this.scrollTop=t}}},{key:"handleSearch",value:function(e){this.SEARCH_CATEGORY.emojis=e;for(var t=0,i=this.categories.length;t<i;t++){var a=this.categoryRefs["category-".concat(t)];if(a&&"Search"!=a.props.name){var n=e?"none":"inherit";a.updateDisplay(n)}}this.forceUpdate(),this.scroll&&(this.scroll.scrollTop=0),this.handleScroll()}},{key:"handleAnchorClick",value:function(e,t){var i,a=this.categoryRefs["category-".concat(t)],n=this.scroll;this.anchors;i=function(){if(a){var t=a.top;e.first?t=0:t+=1,n.scrollTop=t}},this.SEARCH_CATEGORY.emojis?(this.handleSearch(null),this.search.clear(),requestAnimationFrame(i)):i()}},{key:"handleSkinChange",value:function(e){var t={skin:e},i=this.props.onSkinChange;this.setState(t),sh.update(t),i(e)}},{key:"handleKeyDown",value:function(e){var t=!1;switch(e.keyCode){case 13:var i;this.SEARCH_CATEGORY.emojis&&this.SEARCH_CATEGORY.emojis.length&&(i=Zf(this.SEARCH_CATEGORY.emojis[0],this.state.skin,this.props.set,this.props.data))&&(this.handleEmojiSelect(i),t=!0)}t&&e.preventDefault()}},{key:"updateCategoriesSize",value:function(){for(var e=0,t=this.categories.length;e<t;e++){var i=this.categoryRefs["category-".concat(e)];i&&i.memoizeSize()}if(this.scroll){var a=this.scroll;this.scrollHeight=a.scrollHeight,this.clientHeight=a.clientHeight}}},{key:"getCategories",value:function(){return this.state.firstRender?this.categories.slice(0,3):this.categories}},{key:"setAnchorsRef",value:function(e){this.anchors=e}},{key:"setSearchRef",value:function(e){this.search=e}},{key:"setPreviewRef",value:function(e){this.preview=e}},{key:"setScrollRef",value:function(e){this.scroll=e}},{key:"setCategoryRef",value:function(e,t){this.categoryRefs||(this.categoryRefs={}),this.categoryRefs[e]=t}},{key:"render",value:function(){var e=this,t=this.props,i=t.perLine,a=t.emojiSize,n=t.set,r=t.sheetSize,o=t.sheetColumns,s=t.sheetRows,l=t.style,u=t.title,_=t.emoji,d=t.color,c=t.native,g=t.backgroundImageFn,f=t.emojisToShowFilter,h=t.showPreview,p=t.showSkinTones,F=t.emojiTooltip,b=t.useButton,E=t.include,y=t.exclude,D=t.recent,v=t.autoFocus,k=t.skinEmoji,S=t.notFound,w=t.notFoundEmoji,C=i*(a+12)+12+2+function(){if("undefined"==typeof document)return 0;var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.overflow="scroll",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}(),x=this.getPreferredTheme(),T=this.props.skin||this.state.skin||sh.get("skin")||this.props.defaultSkin;return m.a.createElement("section",{style:ap({width:C},l),className:"emoji-mart emoji-mart-".concat(x),"aria-label":u,onKeyDown:this.handleKeyDown},m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Rh,{ref:this.setAnchorsRef,data:this.data,i18n:this.i18n,color:d,categories:this.categories,onAnchorClick:this.handleAnchorClick,icons:this.icons})),m.a.createElement(tp,{ref:this.setSearchRef,onSearch:this.handleSearch,data:this.data,i18n:this.i18n,emojisToShowFilter:f,include:E,exclude:y,custom:this.CUSTOM,autoFocus:v}),m.a.createElement("div",{ref:this.setScrollRef,className:"emoji-mart-scroll",onScroll:this.handleScroll},this.getCategories().map((function(t,l){return m.a.createElement(Wh,{ref:e.setCategoryRef.bind(e,"category-".concat(l)),key:t.name,id:t.id,name:t.name,emojis:t.emojis,perLine:i,native:c,hasStickyPosition:e.hasStickyPosition,data:e.data,i18n:e.i18n,recent:t.id==e.RECENT_CATEGORY.id?D:void 0,custom:t.id==e.RECENT_CATEGORY.id?e.CUSTOM:void 0,emojiProps:{native:c,skin:T,size:a,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,forceSize:c,tooltip:F,backgroundImageFn:g,useButton:b,onOver:e.handleEmojiOver,onLeave:e.handleEmojiLeave,onClick:e.handleEmojiClick},notFound:S,notFoundEmoji:w})}))),(h||p)&&m.a.createElement("div",{className:"emoji-mart-bar"},m.a.createElement(Jh,{ref:this.setPreviewRef,data:this.data,title:u,emoji:_,showSkinTones:p,showPreview:h,emojiProps:{native:c,size:38,skin:T,set:n,sheetSize:r,sheetColumns:o,sheetRows:s,backgroundImageFn:g},skinsProps:{skin:T,onChange:this.handleSkinChange,skinEmoji:k},i18n:this.i18n})))}}]),t}(m.a.PureComponent);function op(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}rp.propTypes=ap({},Ah,{data:tg.a.object.isRequired}),rp.defaultProps=ap({},Ih);var sp=function(e){function t(){return Pf()(this,t),Dh()(this,kh()(t).apply(this,arguments))}return wh()(t,e),qf()(t,[{key:"render",value:function(){return m.a.createElement(rp,Eh()({},this.props,this.state))}}]),t}(m.a.PureComponent);function lp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function up(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?lp(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):lp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}sp.propTypes=Ah,sp.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?op(Object(i),!0).forEach((function(t){Fh()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):op(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},Ih,{data:Bf});var _p=function e(t){for(var i in e.defaultProps)null==t[i]&&null!=e.defaultProps[i]&&(t[i]=e.defaultProps[i]);return Gh(up({},t))};_p.propTypes=Nh,_p.defaultProps=up({},Mh,{data:Bf});var dp=i(49),cp={insert:"head",singleton:!1},gp=(r()(dp.a,cp),dp.a.locals,i(88));function fp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var hp=function(e){Nf()(i,e);var t=fp(i);function i(){var e;Sf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),d()(Tf()(e),"onKeyDown",(function(t){return"Escape"===t.event.key&&(e.props.editor.chain().focus().deleteRange(e.props.range).run(),!0)})),d()(Tf()(e),"handleSelect",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(t).run()})),e}return Cf()(i,[{key:"render",value:function(){return m.a.createElement(rp,{style:{maxWidth:"100%"},data:gp,theme:"light",native:!0,set:"apple",showPreview:!1,showSkinTones:!1,onSelect:this.handleSelect,"data-cy":"neeto-editor-emoji-picker"})}}]),i}(m.a.Component);hp.defaultProps={editor:{},range:{}},hp.propTypes={editor:tg.a.object.isRequired,range:tg.a.object};var pp=hp,mp=function(e){var t=e.editor,i=Object(p.useRef)();return m.a.createElement(Qg,{ref:i,closeOnSelect:!1,customTarget:function(){var e;return m.a.createElement(ng,{icon:vf,iconActive:null==i||null===(e=i.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},m.a.createElement(pp,{editor:t}))},Fp=function(e){var t=e.editor,i=e.variables,a=e.setImageUploadVisible,n=e.options,r=e.mentions,o=e.showImageInMention;if(!t)return null;var s=[{Icon:J_,command:function(){return t.chain().focus().toggleBold().run()},active:t.isActive("bold"),optionName:"bold"},{Icon:td,command:function(){return t.chain().focus().toggleItalic().run()},active:t.isActive("italic"),optionName:"italic"},{Icon:ad,command:function(){return t.chain().focus().toggleUnderline().run()},active:t.isActive("underline"),optionName:"underline"},{Icon:rd,command:function(){return t.chain().focus().toggleStrike().run()},active:t.isActive("strike"),optionName:"strike"},{Icon:dd,command:function(){return t.chain().focus().toggleHighlight().run()},active:t.isActive("highlight"),optionName:"highlight"}].filter((function(e){return n.includes(e.optionName)})),l=[{Icon:Wc,command:function(){return t.chain().focus().toggleBlockquote().run()},active:t.isActive("blockquote"),optionName:"block-quote"},{Icon:ud,command:function(){return t.chain().focus().toggleCodeBlock().run()},active:t.isActive("codeBlock"),optionName:"code-block"},{Icon:Kc,command:function(){return a(!0)},active:t.isActive("imageUpload"),optionName:"image-upload"}].filter((function(e){return n.includes(e.optionName)})),u=[{Icon:Zc,command:function(){return t.chain().focus().toggleBulletList().run()},active:t.isActive("bulletList"),optionName:"bullet-list"},{Icon:Jc,command:function(){return t.chain().focus().toggleOrderedList().run()},active:t.isActive("orderedList"),optionName:"ordered-list"}].filter((function(e){return n.includes(e.optionName)})),_=n.includes("font-color"),d=n.includes("font-size"),c=n.includes("emoji"),g=n.includes("link"),f=function(e,t){var i=e.Icon,a=e.command,n=e.active,r=e.optionName;return m.a.createElement(ng,{key:t,icon:i,iconActive:n,onClick:a,tooltipProps:{content:tc(r),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(r,"-option")})};return m.a.createElement("div",{className:"neeto-editor-fixed-menu"},d&&m.a.createElement(Zg,{editor:t}),s.map(f),_&&m.a.createElement(ug,{color:t.getAttributes("textStyle").color,onChange:function(e){return t.chain().focus().setColor(e).run()}}),c&&m.a.createElement(mp,{editor:t}),g&&m.a.createElement(yf,{editor:t}),l.map(f),u.map(f),m.a.createElement("div",{className:"neeto-editor-fixed-menu-addons"},m.a.createElement(nf,{editor:t,variables:i}),m.a.createElement(cf,{editor:t,mentions:r,showImageInMention:o})))},bp=function(e){var t=e.children,i=e.className,a=void 0===i?"root-portal":i,n=e.el,r=void 0===n?"div":n,o=document.getElementsByClassName(a)[0];return o||(o=document.createElement(r)).classList.add(a),m.a.useEffect((function(){document.body.appendChild(o)}),[]),Su.a.createPortal(t,o)},Ep=["children","className"],yp=function(e){var t=e.children,i=e.className,a=h()(e,Ep);return m.a.createElement("div",u()({className:b()("ne-backdrop",d()({},i,i))},a),t)},Dp=["size","isOpen","onClose","loading","children","className","closeOnEsc","closeButton","backdropClassName","closeOnOutsideClick"],vp=function(){},kp="xs",Sp="sm",wp="md",Cp=function(e){var t=e.size,i=void 0===t?"sm":t,a=e.isOpen,n=void 0!==a&&a,r=e.onClose,o=void 0===r?vp:r,s=e.loading,l=void 0!==s&&s,_=e.children,c=e.className,g=void 0===c?"":c,f=e.closeOnEsc,F=void 0===f||f,E=e.closeButton,y=void 0===E||E,D=e.backdropClassName,v=void 0===D?"":D,k=e.closeOnOutsideClick,S=void 0===k||k,w=h()(e,Dp),C=Object(p.useRef)();return S&&Yg(C,o),F&&Hg("esc",o),m.a.createElement(bp,{className:"ne-portal"},n&&m.a.createElement(yp,{key:"modal-backdrop",className:b()("ne-modal__backdrop",v)},m.a.createElement("div",u()({ref:C,key:"modal-wrapper",className:b()("ne-modal__wrapper",d()({"ne-modal__wrapper--xs":i===kp,"ne-modal__wrapper--sm":i===Sp,"ne-modal__wrapper--md":i===wp},g,g))},w),y&&m.a.createElement(jc,{style:"text",icon:rc,className:"ne-modal__close",onClick:o}),l?m.a.createElement(m.a.Fragment,null):_)))},xp=["children","size","noUnderline","className"],Tp=["active","className","children","icon","onClick","activeClassName"],Op=function(){},Np="large",Ap=function(e){var t=e.children,i=e.size,a=e.noUnderline,n=e.className,r=void 0===n?"":n,o=h()(e,xp);return m.a.createElement("div",u()({className:b()({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":i===Np},{"ne-tab__wrapper--underline-none":a},[r]),"data-cy":"tab-container"},o),t)};Ap.Item=function(e){var t=e.active,i=e.className,a=void 0===i?"":i,n=e.children,r=e.icon,o=void 0===r?null:r,s=e.onClick,l=void 0===s?Op:s,_=e.activeClassName,d=void 0===_?"":_,c=h()(e,Tp),g="button",f="string"==typeof o?function(){return m.a.createElement("i",{className:o,"data-cy":"tab-item-icon"})}:o||m.a.Fragment;return d&&(g=xc),m.a.createElement(g,u()({className:b()(["ne-tab flex items-center justify-center select-none",a],{active:t}),onClick:l,"data-cy":"tab-item"},c),o&&m.a.createElement(f,{className:"ne-tab__icon"}),n)};var Rp=Ap,Mp=function(e){var t,i=Object(p.useState)(null===(t=e[0])||void 0===t?void 0:t.key),a=g()(i,2),n=a[0],r=a[1];return[n,function(e){return r(e.key)}]},Ip=function(e){var t=e.buttonLabel,i=void 0===t?"Submit":t,a=e.placeholder,n=e.onSubmit,r=e.className,o=Object(p.useState)(""),s=g()(o,2),l=s[0],u=s[1],_=Object(p.useState)(""),c=g()(_,2),f=c[0],h=c[1];return m.a.createElement("div",{className:b()("neeto-editor-url-form__wrapper",d()({},r,r))},m.a.createElement(Ef,{name:"url",value:l,placeholder:a,onFocus:function(){return h("")},error:f,onChange:function(e){var t=e.target.value;return u(t)},"data-cy":"neeto-editor-image-upload-url-input"}),m.a.createElement(jc,{size:"large",label:i,onClick:function(e){e.preventDefault(),qc.test(l)?n(l):h("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},Bp=i(19),Lp=i.n(Bp),Pp=(i(60),i(72),i(73)),jp=i.n(Pp),qp=(i(74),i(75),i(76),i(77)),Up=i.n(qp),zp=i(89),Gp=i.n(zp),Hp=function(e){var t,i=e.uppy,a=Object(p.useState)(0),n=g()(a,2),r=n[0],o=n[1];Object(p.useEffect)((function(){i.on("progress",o)}),[i]);var s="".concat(r,"%");return m.a.createElement("div",{className:"neeto-editor-image-uploader__progress"},m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),m.a.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(t=i.getFiles()[0])||void 0===t?void 0:t.name),m.a.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},m.a.createElement("div",{className:"neeto-editor-progress-bar__percent"},m.a.createElement("p",null,s),m.a.createElement(jc,{icon:rc,onClick:function(){return i.cancelAll()},size:"small",style:"text"})),m.a.createElement("div",{className:"neeto-editor-progress-bar__indicator"},m.a.createElement("div",{style:{width:s},className:"neeto-editor-progress-bar__indicator-inner"}))))};function Yp(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}var Vp={allowMultipleUploads:!1,autoProceed:!0,debug:!0},Wp={formData:!0,fieldName:"blob"},$p=function(e){var t=e.endpoint,i=void 0===t?"/api/v1/direct_uploads/image_upload":t,a=e.onSuccess,n=Object(p.useState)(!1),r=g()(n,2),o=r[0],s=r[1],l=Up()((function(){return new Lp.a(Vp).use(Gp.a,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Yp(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Yp(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({endpoint:i},Wp)).on("upload",(function(){return s(!0)})).on("upload-success",(function(e,t){return a(t.body.imageURL)})).on("cancel-all",(function(){return s(!1)})).on("complete",(function(){return s(!1)}))}));return o?m.a.createElement(Hp,{uppy:l}):m.a.createElement(jp.a,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: 5MB",locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:l,"data-cy":"neeto-editor-image-local-uploader"})},Kp=i(50),Qp=i.n(Kp),Zp=i(90),Xp=i.n(Zp),Jp=i(51),em=i.n(Jp),tm=i(91),im=i.n(tm),am=i(92),nm=i.n(am),rm={FONT_COLOR:"font-color",FONT_SIZE:"font-size",BOLD:"bold",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"strike",BLOCKQUOTE:"block-quote",CODE_BLOCK:"code-block",LINK:"link",LIST_BULLETS:"bullet-list",LIST_ORDERED:"ordered-list",IMAGE_UPLOAD:"image-upload",VIDEO_EMBED:"video-embed",EMOJI:"emoji",DIVIDER:"divider",MENTION:"mention"},om=function(e){var t=e.pageNo,i=e.query,a=e.apiKey;return nm.a.get("https://api.unsplash.com/search/photos",{headers:{Authorization:"Client-ID ".concat(a)},params:{page:t,per_page:30,order_by:"popular",query:i}})},sm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,i=Object(p.useState)(e),a=g()(i,2),n=a[0],r=a[1];return Object(p.useEffect)((function(){var i=setTimeout((function(){r(e)}),t);return function(){clearTimeout(i)}}),[e]),n},lm=function(){return m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__loader"},m.a.createElement("span",{className:"neeto-editor-unsplash-gallery__spinner-icon"}))},um=function(e){var t=e.onSubmit,i=e.unsplashApiKey,a=Object(p.useRef)(null),n=Object(p.useState)(""),r=g()(n,2),o=r[0],s=r[1],l=Object(p.useState)(!1),u=g()(l,2),_=u[0],d=u[1],c=Object(p.useState)([]),f=g()(c,2),h=f[0],F=f[1],b=Object(p.useState)(1),E=g()(b,2),y=E[0],D=E[1],v=Object(p.useState)(!0),k=g()(v,2),S=k[0],w=k[1],C=Object(p.useState)(!1),x=g()(C,2),T=x[0],O=x[1],N=sm(o||"latest");Object(p.useEffect)((function(){A(1)}),[N]);var A=function(){var e=Xp()(em.a.mark((function e(t){var a,n,r,o;return em.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,O(!0),d(!1),e.next=5,om({page:t,query:N,apiKey:i});case 5:a=e.sent,n=a.data,r=n.results,o=n.total_pages,F(1===t?r:[].concat(Qp()(h),Qp()(r))),D(t+1),w(t<o),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),d(!0);case 15:return e.prev=15,O(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("div",{className:"neeto-editor-unsplash-wrapper"},m.a.createElement(Ef,{name:"text",value:o,placeholder:"Search Unsplash",onChange:function(e){var t=e.target.value;s(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),_&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!_&&!T&&ac(h)&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!_&&m.a.createElement("div",{className:"neeto-editor-unsplash-container"},m.a.createElement(im.a,{ref:a,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:S,loadMore:function(){!T&&S&&y>1&&A(y)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:m.a.createElement(lm,{key:0})},h&&h.map((function(e,i){return m.a.createElement("div",{key:i,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(i)},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},m.a.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(i)},m.a.createElement("img",{src:e.urls.regular,onClick:function(){return t(e.urls.small)}}),m.a.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))}))),!S&&m.a.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},_m=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}],dm=function(e){var t=e.editor,i=e.imageUploadUrl,a=e.isVisible,n=e.setIsVisible,r=e.unsplashApiKey,o=e.isUnsplashImageUploadActive,s=Mp(_m),l=g()(s,2),u=l[0],_=l[1],d=function(e){t.chain().focus().setImage({src:e}).run(),n(!1)},c={local:function(){return m.a.createElement($p,{endpoint:i,onSuccess:d})},link:function(){return m.a.createElement(Ip,{onSubmit:d,buttonLabel:"Upload Image",placeholder:"Paste the image link"})},unsplash:function(){return m.a.createElement(um,{unsplashApiKey:r,onSubmit:d})}}[u];return m.a.createElement(Cp,{isOpen:a,onClose:function(){return n(!1)},closeButton:!1},m.a.createElement("div",{className:"neeto-editor-image-uploader"},m.a.createElement(Rp,null,_m.filter((function(e){return"unsplash"!==e.key||o})).map((function(e){return m.a.createElement(Rp.Item,{key:e.key,active:u===e.key,onClick:function(){return _(e)}},e.title)}))),m.a.createElement("div",{className:"neeto-editor-image-uploader__content"},m.a.createElement(c,null))))},cm=i(38),gm=i.n(cm),fm=i(93);function hm(e,t){return Array(t+1).join(e)}var pm=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function mm(e){return ym(e,pm)}var Fm=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function bm(e){return ym(e,Fm)}var Em=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function ym(e,t){return t.indexOf(e.nodeName)>=0}function Dm(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var vm={};function km(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Sm(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function wm(e,t,i){for(var a=0;a<e.length;a++){var n=e[a];if(Cm(n,t,i))return n}}function Cm(e,t,i){var a=e.filter;if("string"==typeof a){if(a===t.nodeName.toLowerCase())return!0}else if(Array.isArray(a)){if(a.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof a)throw new TypeError("`filter` needs to be a string, array, or function");if(a.call(e,t,i))return!0}}function xm(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Tm(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}vm.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},vm.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},vm.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var a=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&a<3?"\n\n"+e+"\n"+hm(1===a?"=":"-",e.length)+"\n\n":"\n\n"+hm("#",a)+" "+e+"\n\n"}},vm.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},vm.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},vm.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var a=i.bulletListMarker+" ",n=t.parentNode;if("OL"===n.nodeName){var r=n.getAttribute("start"),o=Array.prototype.indexOf.call(n.children,t);a=(r?Number(r)+o:o+1)+". "}return a+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},vm.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},vm.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var a,n=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,o=i.fence.charAt(0),s=3,l=new RegExp("^"+o+"{3,}","gm");a=l.exec(r);)a[0].length>=s&&(s=a[0].length+1);var u=hm(o,s);return"\n\n"+u+n+"\n"+r.replace(/\n$/,"")+"\n"+u+"\n\n"}},vm.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},vm.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href"),a=km(t.getAttribute("title"));return a&&(a=' "'+a+'"'),"["+e+"]("+i+a+")"}},vm.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var a,n,r=t.getAttribute("href"),o=km(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":a="["+e+"][]",n="["+e+"]: "+r+o;break;case"shortcut":a="["+e+"]",n="["+e+"]: "+r+o;break;default:var s=this.references.length+1;a="["+e+"]["+s+"]",n="["+s+"]: "+r+o}return this.references.push(n),a},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},vm.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},vm.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},vm.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",a=e.match(/`+/gm)||[];-1!==a.indexOf(i);)i+="`";return i+t+e+t+i}},vm.image={filter:"img",replacement:function(e,t){var i=km(t.getAttribute("alt")),a=t.getAttribute("src")||"",n=km(t.getAttribute("title"));return a?"!["+i+"]("+a+(n?' "'+n+'"':"")+")":""}},Sm.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=wm(this.array,e,this.options))||(t=wm(this._keep,e,this.options))||(t=wm(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var Om="undefined"!=typeof window?window:{};var Nm,Am,Rm=function(){var e=Om.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?Om.DOMParser:(Nm=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?Nm.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:Nm.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},Nm);function Mm(e,t){var i;"string"==typeof e?i=(Am=Am||new Rm).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,a=e.isVoid,n=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!n(t)){for(var r=null,o=!1,s=null,l=Tm(s,t,n);l!==t;){if(3===l.nodeType||4===l.nodeType){var u=l.data.replace(/[ \r\n\t]+/g," ");if(r&&!/ $/.test(r.data)||o||" "!==u[0]||(u=u.substr(1)),!u){l=xm(l);continue}l.data=u,r=l}else{if(1!==l.nodeType){l=xm(l);continue}i(l)||"BR"===l.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,o=!1):a(l)||n(l)?(r=null,o=!0):r&&(o=!1)}var _=Tm(s,l,n);s=l,l=_}r&&(r.data=r.data.replace(/ $/,""),r.data||xm(r))}}({element:i,isBlock:mm,isVoid:bm,isPre:t.preformattedCode?Im:null}),i}function Im(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function Bm(e,t){return e.isBlock=mm(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!bm(e)&&!function(e){return ym(e,Em)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Dm(e,Fm)}(e)&&!function(e){return Dm(e,Em)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(a=e.textContent,n=a.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/),{leading:n[1],leadingAscii:n[2],leadingNonAscii:n[3],trailing:n[4],trailingNonAscii:n[5],trailingAscii:n[6]});var a,n;i.leadingAscii&&Lm("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&Lm("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function Lm(e,t,i){var a,n,r;return"left"===e?(a=t.previousSibling,n=/ $/):(a=t.nextSibling,n=/^ /),a&&(3===a.nodeType?r=n.test(a.nodeValue):i.preformattedCode&&"CODE"===a.nodeName?r=!1:1!==a.nodeType||mm(a)||(r=n.test(a.textContent))),r}var Pm=Array.prototype.reduce,jm=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function qm(e){if(!(this instanceof qm))return new qm(e);var t={rules:vm,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}({},t,e),this.rules=new Sm(this.options)}function Um(e){var t=this;return Pm.call(e.childNodes,(function(e,i){var a="";return 3===(i=new Bm(i,t.options)).nodeType?a=i.isCode?i.nodeValue:t.escape(i.nodeValue):1===i.nodeType&&(a=Gm.call(t,i)),Hm(e,a)}),"")}function zm(e){var t=this;return this.rules.forEach((function(i){"function"==typeof i.append&&(e=Hm(e,i.append(t.options)))})),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function Gm(e){var t=this.rules.forNode(e),i=Um.call(this,e),a=e.flankingWhitespace;return(a.leading||a.trailing)&&(i=i.trim()),a.leading+t.replacement(i,e,this.options)+a.trailing}function Hm(e,t){var i=function(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),a=t.replace(/^\n*/,""),n=Math.max(e.length-i.length,t.length-a.length);return i+"\n\n".substring(0,n)+a}qm.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=Um.call(this,new Mm(e,this.options));return zm.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return jm.reduce((function(e,t){return e.replace(t[0],t[1])}),e)}};var Ym=qm,Vm=function(e){e=e.replaceAll(/^\\$/gm,"<p></p>");var t=fm.marked.parse(e,{sanitize:!1});return t=(t=(t=(t=t.replaceAll(/<p><img[^>]*><\/p>/g,(function(e){return e.replace(/<\/?p>/g,"")}))).replaceAll(/!\[(.*?)\]\((.*?)\)/g,(function(e,t,i){return'<img src="'.concat(i,'" alt="').concat(t,'">')}))).replaceAll(/==([^=]+)==/g,"<mark>$1</mark>")).replaceAll(/--([^-]+)--/g,"<u>$1</u>"),gm.a.sanitize(t,{ADD_TAGS:["iframe"]})},Wm=["editor","className","style","strategy","onChange","onSubmit","initialValue"],$m=function(e){var t=e.editor,i=e.className,a=e.style,n=e.strategy,r=e.onChange,o=e.onSubmit,s=e.initialValue,l=h()(e,Wm),_=Object(p.useState)((function(){return e=(null==t?void 0:t.getHTML())||s,(i=new Ym({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:function(e,t){return t.isBlock?"\\\n":""}})).keep(["iframe"]),i.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~".concat(e,"~")}}),i.addRule("highlight",{filter:["mark"],replacement:function(e){return"==".concat(e,"==")}}),i.addRule("underline",{filter:["u"],replacement:function(e){return"--".concat(e,"--")}}),i.turndown(e);var e,i})),c=g()(_,2),f=c[0],F=c[1],E=Object(p.useRef)(),y=Object(p.useRef)(f);Object(p.useEffect)((function(){y.current=f}),[f]),Object(p.useEffect)((function(){return document.addEventListener("keydown",D),function(){null==t||t.commands.setContent(Vm(y.current)),document.removeEventListener("keydown",D)}}),[]),Object(p.useLayoutEffect)((function(){E.current.style=a,"flexible"===n&&(E.current.style.height=E.current.scrollHeight+2+"px")}),[f]);var D=function(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(null==o||o(Vm(y.current)),E.current.blur())};return m.a.createElement("textarea",u()({ref:E,value:f,onChange:function(e){F(e.target.value),null==r||r(Vm(e.target.value))},className:b()("ProseMirror neeto-editor-markdown",d()({},i,i)),"data-cy":"neeto-editor-markdown-editor"},l))};const Km=/^\s*>\s$/,Qm=cs.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[bs({find:Km,type:this.type})]}}),Zm=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Xm=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Jm=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eF=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,tF=gs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ps({find:Zm,type:this.type}),ps({find:Jm,type:this.type})]},addPasteRules(){return[Es({find:Xm,type:this.type}),Es({find:eF,type:this.type})]}}),iF=/^\s*([-+*])\s$/,aF=cs.create({name:"bulletList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[bs({find:iF,type:this.type})]}}),nF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,rF=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,oF=gs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ps({find:nF,type:this.type})]},addPasteRules(){return[Es({find:rF,type:this.type})]}}),sF=/^```(?<language>[a-z]*)?[\s\n]$/,lF=/^~~~(?<language>[a-z]*)?[\s\n]$/,uF=cs.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:i}=this.options,a=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return a||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands:()=>({setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!i&&t.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[ms({find:sF,type:this.type,getAttributes:({groups:e})=>e}),ms({find:lF,type:this.type,getAttributes:({groups:e})=>e})]},addProseMirrorPlugins(){return[new Rt({key:new Bt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const i=t.clipboardData.getData("text/plain"),a=t.clipboardData.getData("vscode-editor-data"),n=a?JSON.parse(a):void 0,r=null==n?void 0:n.mode;if(!i||!r)return!1;const{tr:o}=e.state;return o.replaceSelectionWith(this.type.create({language:r})),o.setSelection(mt.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(i.replace(/\r\n?/g,"\n")),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}});var _F=cs.create({name:"doc",topNode:!0,content:"block+"});var dF=function(e,t){var i=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var a=function(e){return i[t](e)};return e.dom.addEventListener(t,a),{name:t,handler:a}}))};dF.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var i=t.name,a=t.handler;return e.editorView.dom.removeEventListener(i,a)}))},dF.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},dF.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},dF.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var i=t.nodeBefore,a=t.nodeAfter;if(i||a){var n=this.editorView.nodeDOM(this.cursorPos-(i?i.nodeSize:0)).getBoundingClientRect(),r=i?n.bottom:n.top;i&&a&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:n.left,right:n.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var o=this.editorView.coordsAtPos(this.cursorPos);e={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.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),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var _=u.getBoundingClientRect();s=_.left-u.scrollLeft,l=_.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},dF.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},dF.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Je(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},dF.prototype.dragend=function(){this.scheduleRemoval(20)},dF.prototype.drop=function(){this.scheduleRemoval(20)},dF.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};const cF=mr.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[(e=this.options,void 0===e&&(e={}),new Rt({view:function(t){return new dF(t,e)}}))];var e}});var gF=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));return t.valid(n)?new t(n):e.near(n)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(i.pos))},t.prototype.getBookmark=function(){return new fF(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var i=e.index(t);if(0!=i)for(var a=e.node(t).child(i-1);;a=a.lastChild){if(0==a.childCount&&!a.inlineContent||a.isAtom||a.type.spec.isolating)return!0;if(a.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var i=e.indexAfter(t),a=e.node(t);if(i!=a.childCount)for(var n=a.child(i);;n=n.firstChild){if(0==n.childCount&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}(e))return!1;var i=t.type.spec.allowGapCursor;if(null!=i)return i;var a=t.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock},t.findFrom=function(e,i,a){e:for(;;){if(!a&&t.valid(e))return e;for(var n=e.pos,r=null,o=e.depth;;o--){var s=e.node(o);if(i>0?e.indexAfter(o)<s.childCount:e.index(o)>0){r=s.child(i>0?e.indexAfter(o):e.index(o)-1);break}if(0==o)return null;n+=i;var l=e.doc.resolve(n);if(t.valid(l))return l}for(;;){var u=i>0?r.firstChild:r.lastChild;if(!u){if(r.isAtom&&!r.isText&&!bt.isSelectable(r)){e=e.doc.resolve(n+r.nodeSize*i),a=!1;continue e}break}r=u,n+=i;var _=e.doc.resolve(n);if(t.valid(_))return _}return null}},t}(ft);gF.prototype.visible=!1,ft.jsonID("gapcursor",gF);var fF=function(e){this.pos=e};fF.prototype.map=function(e){return new fF(e.map(this.pos))},fF.prototype.resolve=function(e){var t=e.resolve(this.pos);return gF.valid(t)?new gF(t):ft.near(t)};var hF=dr({ArrowLeft:pF("horiz",-1),ArrowRight:pF("horiz",1),ArrowUp:pF("vert",-1),ArrowDown:pF("vert",1)});function pF(e,t){var i="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,a,n){var r=e.selection,o=t>0?r.$to:r.$from,s=r.empty;if(r instanceof mt){if(!n.endOfTextblock(i)||0==o.depth)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}var l=gF.findFrom(o,t,s);return!!l&&(a&&a(e.tr.setSelection(new gF(l))),!0)}}function mF(e,t,i){if(!e.editable)return!1;var a=e.state.doc.resolve(t);if(!gF.valid(a))return!1;var n=e.posAtCoords({left:i.clientX,top:i.clientY}).inside;return!(n>-1&&bt.isSelectable(e.state.doc.nodeAt(n)))&&(e.dispatch(e.state.tr.setSelection(new gF(a))),!0)}function FF(e){if(!(e.selection instanceof gF))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Mn.create(e.doc,[On.widget(e.selection.head,t,{key:"gapcursor"})])}const bF=mr.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Rt({props:{decorations:FF,createSelectionBetween:function(e,t,i){if(t.pos==i.pos&&gF.valid(i))return new gF(i)},handleClick:mF,handleKeyDown:hF}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=hr(pr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),EF=cs.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",ns(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:i,editor:a})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{keepMarks:e}=this.options,{splittableMarks:n}=a.extensionManager,r=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();return t().insertContent({type:this.name}).command(({tr:t,dispatch:i})=>{if(i&&r&&e){const e=r.filter(e=>n.includes(e.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),yF=cs.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:"h"+e,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return["h"+(this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]),ns(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode("heading",e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode("heading","paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,["Mod-Alt-"+t]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>ms({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var DF=function(){};DF.prototype.append=function(e){return e.length?(e=DF.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},DF.prototype.prepend=function(e){return e.length?DF.from(e).append(this):this},DF.prototype.appendInner=function(e){return new kF(this,e)},DF.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?DF.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},DF.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},DF.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)},DF.prototype.map=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length);var a=[];return this.forEach((function(t,i){return a.push(e(t,i))}),t,i),a},DF.from=function(e){return e instanceof DF?e:e&&e.length?new vF(e):DF.empty};var vF=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,i){return 0==e&&i==this.length?this:new t(this.values.slice(e,i))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,i,a){for(var n=t;n<i;n++)if(!1===e(this.values[n],a+n))return!1},t.prototype.forEachInvertedInner=function(e,t,i,a){for(var n=t-1;n>=i;n--)if(!1===e(this.values[n],a+n))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},i.length.get=function(){return this.values.length},i.depth.get=function(){return 0},Object.defineProperties(t.prototype,i),t}(DF);DF.empty=new vF([]);var kF=function(e){function t(t,i){e.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,i,a){var n=this.left.length;return!(t<n&&!1===this.left.forEachInner(e,t,Math.min(i,n),a))&&(!(i>n&&!1===this.right.forEachInner(e,Math.max(t-n,0),Math.min(this.length,i)-n,a+n))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,i,a){var n=this.left.length;return!(t>n&&!1===this.right.forEachInvertedInner(e,t-n,Math.max(i,n)-n,a+n))&&(!(i<n&&!1===this.left.forEachInvertedInner(e,Math.min(t,n),i,a))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var i=this.left.length;return t<=i?this.left.slice(e,t):e>=i?this.right.slice(e-i,t-i):this.left.slice(e,i).append(this.right.slice(0,t-i))},t.prototype.leafAppend=function(e){var i=this.right.leafAppend(e);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(e){var i=this.left.leafPrepend(e);if(i)return new t(i,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(DF),SF=DF,wF=function(e,t){this.items=e,this.eventCount=t};wF.prototype.popEvent=function(e,t){var i=this;if(0==this.eventCount)return null;for(var a,n,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(a=this.remapping(r,this.items.length),n=a.maps.length);var o,s,l=e.tr,u=[],_=[];return this.items.forEach((function(e,t){if(!e.step)return a||(a=i.remapping(r,t+1),n=a.maps.length),n--,void _.push(e);if(a){_.push(new CF(e.map));var d,c=e.step.map(a.slice(n));c&&l.maybeStep(c).doc&&(d=l.mapping.maps[l.mapping.maps.length-1],u.push(new CF(d,null,null,u.length+_.length))),n--,d&&a.appendMap(d,n)}else l.maybeStep(e.step);return e.selection?(o=a?e.selection.map(a.slice(n)):e.selection,s=new wF(i.items.slice(0,r).append(_.reverse().concat(u)),i.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:o}},wF.prototype.addTransform=function(e,t,i,a){for(var n=[],r=this.eventCount,o=this.items,s=!a&&o.length?o.get(o.length-1):null,l=0;l<e.steps.length;l++){var u,_=e.steps[l].invert(e.docs[l]),d=new CF(e.mapping.maps[l],_,t);(u=s&&s.merge(d))&&(d=u,l?n.pop():o=o.slice(0,o.length-1)),n.push(d),t&&(r++,t=null),a||(s=d)}var c,g,f,h=r-i.depth;return h>TF&&(g=h,(c=o).forEach((function(e,t){if(e.selection&&0==g--)return f=t,!1})),o=c.slice(f),r-=h),new wF(o.append(n),r)},wF.prototype.remapping=function(e,t){var i=new Ie;return this.items.forEach((function(t,a){var n=null!=t.mirrorOffset&&a-t.mirrorOffset>=e?i.maps.length-t.mirrorOffset:null;i.appendMap(t.map,n)}),e,t),i},wF.prototype.addMaps=function(e){return 0==this.eventCount?this:new wF(this.items.append(e.map((function(e){return new CF(e)}))),this.eventCount)},wF.prototype.rebased=function(e,t){if(!this.eventCount)return this;var i=[],a=Math.max(0,this.items.length-t),n=e.mapping,r=e.steps.length,o=this.eventCount;this.items.forEach((function(e){e.selection&&o--}),a);var s=t;this.items.forEach((function(t){var a=n.getMirror(--s);if(null!=a){r=Math.min(r,a);var l=n.maps[a];if(t.step){var u=e.steps[a].invert(e.docs[a]),_=t.selection&&t.selection.map(n.slice(s+1,a));_&&o++,i.push(new CF(l,u,_))}else i.push(new CF(l))}}),a);for(var l=[],u=t;u<r;u++)l.push(new CF(n.maps[u]));var _=this.items.slice(0,a).append(l).append(i),d=new wF(_,o);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-i.length)),d},wF.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},wF.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),i=t.maps.length,a=[],n=0;return this.items.forEach((function(r,o){if(o>=e)a.push(r),r.selection&&n++;else if(r.step){var s=r.step.map(t.slice(i)),l=s&&s.getMap();if(i--,l&&t.appendMap(l,i),s){var u=r.selection&&r.selection.map(t.slice(i));u&&n++;var _,d=new CF(l.invert(),s,u),c=a.length-1;(_=a.length&&a[c].merge(d))?a[c]=_:a.push(d)}}else r.map&&i--}),this.items.length,0),new wF(SF.from(a.reverse()),n)},wF.empty=new wF(SF.empty,0);var CF=function(e,t,i,a){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=a};CF.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new CF(t.getMap().invert(),t,this.selection)}};var xF=function(e,t,i,a){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=a},TF=20;function OF(e){var t=[];return e.forEach((function(e,i,a,n){return t.push(a,n)})),t}function NF(e,t){if(!e)return null;for(var i=[],a=0;a<e.length;a+=2){var n=t.map(e[a],1),r=t.map(e[a+1],-1);n<=r&&i.push(n,r)}return i}function AF(e,t,i,a){var n=IF(t),r=BF.get(t).spec.config,o=(a?e.undone:e.done).popEvent(t,n);if(o){var s=o.selection.resolve(o.transform.doc),l=(a?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,n),u=new xF(a?l:o.remaining,a?o.remaining:l,null,0);i(o.transform.setSelection(s).setMeta(BF,{redo:a,historyState:u}).scrollIntoView())}}var RF=!1,MF=null;function IF(e){var t=e.plugins;if(MF!=t){RF=!1,MF=t;for(var i=0;i<t.length;i++)if(t[i].spec.historyPreserveItems){RF=!0;break}}return RF}var BF=new Bt("history"),LF=new Bt("closeHistory");function PF(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new Rt({key:BF,state:{init:function(){return new xF(wF.empty,wF.empty,null,0)},apply:function(t,i,a){return function(e,t,i,a){var n,r=i.getMeta(BF);if(r)return r.historyState;i.getMeta(LF)&&(e=new xF(e.done,e.undone,null,0));var o=i.getMeta("appendedTransaction");if(0==i.steps.length)return e;if(o&&o.getMeta(BF))return o.getMeta(BF).redo?new xF(e.done.addTransform(i,null,a,IF(t)),e.undone,OF(i.mapping.maps[i.steps.length-1]),e.prevTime):new xF(e.done,e.undone.addTransform(i,null,a,IF(t)),null,e.prevTime);if(!1===i.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(n=i.getMeta("rebased"))?new xF(e.done.rebased(i,n),e.undone.rebased(i,n),NF(e.prevRanges,i.mapping),e.prevTime):new xF(e.done.addMaps(i.mapping.maps),e.undone.addMaps(i.mapping.maps),NF(e.prevRanges,i.mapping),e.prevTime);var s=0==e.prevTime||!o&&(e.prevTime<(i.time||0)-a.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var i=!1;return e.mapping.maps[0].forEach((function(e,a){for(var n=0;n<t.length;n+=2)e<=t[n+1]&&a>=t[n]&&(i=!0)})),i}(i,e.prevRanges)),l=o?NF(e.prevRanges,i.mapping):OF(i.mapping.maps[i.steps.length-1]);return new xF(e.done.addTransform(i,s?t.selection.getBookmark():null,a,IF(t)),wF.empty,l,i.time)}(i,a,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var i="historyUndo"==t.inputType?jF(e.state,e.dispatch):"historyRedo"==t.inputType&&qF(e.state,e.dispatch);return i&&t.preventDefault(),i}}}})}function jF(e,t){var i=BF.getState(e);return!(!i||0==i.done.eventCount)&&(t&&AF(i,e,t,!1),!0)}function qF(e,t){var i=BF.getState(e);return!(!i||0==i.undone.eventCount)&&(t&&AF(i,e,t,!0),!0)}const UF=mr.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>jF(e,t),redo:()=>({state:e,dispatch:t})=>qF(e,t)}),addProseMirrorPlugins(){return[PF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),zF=cs.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:e,dispatch:t})=>{const{selection:i}=e,{empty:a,$anchor:n}=i,r=n.parent.isTextblock&&!n.parent.type.spec.code&&!n.parent.textContent;if(!a||!r||!t)return!0;const o=n.before(),s=n.start();return e.deleteRange(o,s),e.setSelection(mt.create(e.doc,o)),!0}).insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var i;if(t){const{parent:t,pos:a}=e.selection.$from,n=a+1;if(!e.doc.nodeAt(n)){const a=null===(i=t.type.contentMatch.defaultType)||void 0===i?void 0:i.create();a&&(e.insert(n,a),e.setSelection(mt.create(e.doc,n)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[fs({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,HF=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,YF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,VF=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,WF=gs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ps({find:GF,type:this.type}),ps({find:YF,type:this.type})]},addPasteRules(){return[Es({find:HF,type:this.type}),Es({find:VF,type:this.type})]}}),$F=cs.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",ns(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),KF=/^(\d+)\.\s$/,QF=cs.create({name:"orderedList",addOptions:()=>({HTMLAttributes:{}}),group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...i}=e;return 1===t?["ol",ns(this.options.HTMLAttributes,i),0]:["ol",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[bs({find:KF,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),ZF=cs.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setParagraph:()=>({commands:e})=>e.setNode("paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),XF=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,JF=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,eb=gs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ps({find:XF,type:this.type})]},addPasteRules(){return[Es({find:JF,type:this.type})]}});var tb=cs.create({name:"text",group:"inline"});const ib=mr.create({name:"starterKit",addExtensions(){var e,t,i,a,n,r,o,s,l,u,_,d,c,g,f,h,p,m;const F=[];return!1!==this.options.blockquote&&F.push(Qm.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&F.push(tF.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&F.push(aF.configure(null===(i=this.options)||void 0===i?void 0:i.bulletList)),!1!==this.options.code&&F.push(oF.configure(null===(a=this.options)||void 0===a?void 0:a.code)),!1!==this.options.codeBlock&&F.push(uF.configure(null===(n=this.options)||void 0===n?void 0:n.codeBlock)),!1!==this.options.document&&F.push(_F.configure(null===(r=this.options)||void 0===r?void 0:r.document)),!1!==this.options.dropcursor&&F.push(cF.configure(null===(o=this.options)||void 0===o?void 0:o.dropcursor)),!1!==this.options.gapcursor&&F.push(bF.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&F.push(EF.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&F.push(yF.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&F.push(UF.configure(null===(_=this.options)||void 0===_?void 0:_.history)),!1!==this.options.horizontalRule&&F.push(zF.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&F.push(WF.configure(null===(c=this.options)||void 0===c?void 0:c.italic)),!1!==this.options.listItem&&F.push($F.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&F.push(QF.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&F.push(ZF.configure(null===(h=this.options)||void 0===h?void 0:h.paragraph)),!1!==this.options.strike&&F.push(eb.configure(null===(p=this.options)||void 0===p?void 0:p.strike)),!1!==this.options.text&&F.push(tb.configure(null===(m=this.options)||void 0===m?void 0:m.text)),F}}),ab=Fs({find:/--$/,replace:"—"}),nb=Fs({find:/\.\.\.$/,replace:"…"}),rb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),ob=Fs({find:/"$/,replace:"”"}),sb=Fs({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),lb=Fs({find:/'$/,replace:"’"}),ub=Fs({find:/<-$/,replace:"←"}),_b=Fs({find:/->$/,replace:"→"}),db=Fs({find:/\(c\)$/,replace:"©"}),cb=Fs({find:/\(tm\)$/,replace:"™"}),gb=Fs({find:/\(r\)$/,replace:"®"}),fb=Fs({find:/1\/2$/,replace:"½"}),hb=Fs({find:/\+\/-$/,replace:"±"}),pb=Fs({find:/!=$/,replace:"≠"}),mb=Fs({find:/<<$/,replace:"«"}),Fb=Fs({find:/>>$/,replace:"»"}),bb=Fs({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),Eb=Fs({find:/\^2$/,replace:"²"}),yb=Fs({find:/\^3$/,replace:"³"}),Db=Fs({find:/1\/4$/,replace:"¼"}),vb=Fs({find:/3\/4$/,replace:"¾"}),kb=mr.create({name:"typography",addInputRules:()=>[ab,nb,rb,ob,sb,lb,ub,_b,db,cb,gb,fb,hb,pb,mb,Fb,bb,Eb,yb,Db,vb]}),Sb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))$/,wb=/(?:^|\s)((?:==)((?:[^~]+))(?:==))/g,Cb=gs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:"background-color: "+e.color}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setHighlight:e=>({commands:t})=>t.setMark("highlight",e),toggleHighlight:e=>({commands:t})=>t.toggleMark("highlight",e),unsetHighlight:()=>({commands:e})=>e.unsetMark("highlight")}),addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[ps({find:Sb,type:this.type})]},addPasteRules(){return[Es({find:wb,type:this.type})]}});var xb=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var i=0;i<e.length;i++)this.size+=e[i].nodeSize},Tb={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};xb.prototype.nodesBetween=function(e,t,i,a,n){void 0===a&&(a=0);for(var r=0,o=0;o<t;r++){var s=this.content[r],l=o+s.nodeSize;if(l>e&&!1!==i(s,a+o,n,r)&&s.content.size){var u=o+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),i,a+u)}o=l}},xb.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},xb.prototype.textBetween=function(e,t,i,a){var n="",r=!0;return this.nodesBetween(e,t,(function(o,s){o.isText?(n+=o.text.slice(Math.max(e,s)-s,t-s),r=!i):o.isLeaf&&a?(n+="function"==typeof a?a(o):a,r=!i):!r&&o.isBlock&&(n+=i,r=!0)}),0),n},xb.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,i=e.firstChild,a=this.content.slice(),n=0;for(t.isText&&t.sameMarkup(i)&&(a[a.length-1]=t.withText(t.text+i.text),n=1);n<e.content.length;n++)a.push(e.content[n]);return new xb(a,this.size+e.size)},xb.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var i=[],a=0;if(t>e)for(var n=0,r=0;r<t;n++){var o=this.content[n],s=r+o.nodeSize;s>e&&((r<e||s>t)&&(o=o.isText?o.cut(Math.max(0,e-r),Math.min(o.text.length,t-r)):o.cut(Math.max(0,e-r-1),Math.min(o.content.size,t-r-1))),i.push(o),a+=o.nodeSize),r=s}return new xb(i,a)},xb.prototype.cutByIndex=function(e,t){return e==t?xb.empty:0==e&&t==this.content.length?this:new xb(this.content.slice(e,t))},xb.prototype.replaceChild=function(e,t){var i=this.content[e];if(i==t)return this;var a=this.content.slice(),n=this.size+t.nodeSize-i.nodeSize;return a[e]=t,new xb(a,n)},xb.prototype.addToStart=function(e){return new xb([e].concat(this.content),this.size+e.nodeSize)},xb.prototype.addToEnd=function(e){return new xb(this.content.concat(e),this.size+e.nodeSize)},xb.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},Tb.firstChild.get=function(){return this.content.length?this.content[0]:null},Tb.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},Tb.childCount.get=function(){return this.content.length},xb.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},xb.prototype.maybeChild=function(e){return this.content[e]},xb.prototype.forEach=function(e){for(var t=0,i=0;t<this.content.length;t++){var a=this.content[t];e(a,i,t),i+=a.nodeSize}},xb.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,i,a){for(var n=0;;n++){if(n==t.childCount||n==i.childCount)return t.childCount==i.childCount?null:a;var r=t.child(n),o=i.child(n);if(r!=o){if(!r.sameMarkup(o))return a;if(r.isText&&r.text!=o.text){for(var s=0;r.text[s]==o.text[s];s++)a++;return a}if(r.content.size||o.content.size){var l=e(r.content,o.content,a+1);if(null!=l)return l}a+=r.nodeSize}else a+=r.nodeSize}}(this,e,t)},xb.prototype.findDiffEnd=function(e,t,i){return void 0===t&&(t=this.size),void 0===i&&(i=e.size),function e(t,i,a,n){for(var r=t.childCount,o=i.childCount;;){if(0==r||0==o)return r==o?null:{a:a,b:n};var s=t.child(--r),l=i.child(--o),u=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:a,b:n};if(s.isText&&s.text!=l.text){for(var _=0,d=Math.min(s.text.length,l.text.length);_<d&&s.text[s.text.length-_-1]==l.text[l.text.length-_-1];)_++,a--,n--;return{a:a,b:n}}if(s.content.size||l.content.size){var c=e(s.content,l.content,a-1,n-1);if(c)return c}a-=u,n-=u}else a-=u,n-=u}}(this,e,t,i)},xb.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return Nb(0,e);if(e==this.size)return Nb(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var i=0,a=0;;i++){var n=a+this.child(i).nodeSize;if(n>=e)return n==e||t>0?Nb(i+1,n):Nb(i,a);a=n}},xb.prototype.toString=function(){return"<"+this.toStringInner()+">"},xb.prototype.toStringInner=function(){return this.content.join(", ")},xb.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},xb.fromJSON=function(e,t){if(!t)return xb.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new xb(t.map(e.nodeFromJSON))},xb.fromArray=function(e){if(!e.length)return xb.empty;for(var t,i=0,a=0;a<e.length;a++){var n=e[a];i+=n.nodeSize,a&&n.isText&&e[a-1].sameMarkup(n)?(t||(t=e.slice(0,a)),t[t.length-1]=n.withText(t[t.length-1].text+n.text)):t&&t.push(n)}return new xb(t||e,i)},xb.from=function(e){if(!e)return xb.empty;if(e instanceof xb)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new xb([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(xb.prototype,Tb);var Ob={index:0,offset:0};function Nb(e,t){return Ob.index=e,Ob.offset=t,Ob}function Ab(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var i=Array.isArray(e);if(Array.isArray(t)!=i)return!1;if(i){if(e.length!=t.length)return!1;for(var a=0;a<e.length;a++)if(!Ab(e[a],t[a]))return!1}else{for(var n in e)if(!(n in t)||!Ab(e[n],t[n]))return!1;for(var r in t)if(!(r in e))return!1}return!0}xb.empty=new xb([],0);var Rb=function(e,t){this.type=e,this.attrs=t};function Mb(e){var t=Error.call(this,e);return t.__proto__=Mb.prototype,t}Rb.prototype.addToSet=function(e){for(var t,i=!1,a=0;a<e.length;a++){var n=e[a];if(this.eq(n))return e;if(this.type.excludes(n.type))t||(t=e.slice(0,a));else{if(n.type.excludes(this.type))return e;!i&&n.type.rank>this.type.rank&&(t||(t=e.slice(0,a)),t.push(this),i=!0),t&&t.push(n)}}return t||(t=e.slice()),i||t.push(this),t},Rb.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},Rb.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},Rb.prototype.eq=function(e){return this==e||this.type==e.type&&Ab(this.attrs,e.attrs)},Rb.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},Rb.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var i=e.marks[t.type];if(!i)throw new RangeError("There is no mark type "+t.type+" in this schema");return i.create(t.attrs)},Rb.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0},Rb.setFrom=function(e){if(!e||0==e.length)return Rb.none;if(e instanceof Rb)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},Rb.none=[],Mb.prototype=Object.create(Error.prototype),Mb.prototype.constructor=Mb,Mb.prototype.name="ReplaceError";var Ib=function(e,t,i){this.content=e,this.openStart=t,this.openEnd=i},Bb={size:{configurable:!0}};function Lb(e,t,i){if(i.openStart>e.depth)throw new Mb("Inserted content deeper than insertion position");if(e.depth-i.openStart!=t.depth-i.openEnd)throw new Mb("Inconsistent open depths");return function e(t,i,a,n){var r=t.index(n),o=t.node(n);if(r==i.index(n)&&n<t.depth-a.openStart){var s=e(t,i,a,n+1);return o.copy(o.content.replaceChild(r,s))}if(a.content.size){if(a.openStart||a.openEnd||t.depth!=n||i.depth!=n){var l=function(e,t){for(var i=t.depth-e.openStart,a=t.node(i).copy(e.content),n=i-1;n>=0;n--)a=t.node(n).copy(xb.from(a));return{start:a.resolveNoCache(e.openStart+i),end:a.resolveNoCache(a.content.size-e.openEnd-i)}}(a,t),u=l.start,_=l.end;return zb(o,function e(t,i,a,n,r){var o=t.depth>r&&jb(t,i,r+1),s=n.depth>r&&jb(a,n,r+1),l=[];Ub(null,t,r,l),o&&s&&i.index(r)==a.index(r)?(Pb(o,s),qb(zb(o,e(t,i,a,n,r+1)),l)):(o&&qb(zb(o,Gb(t,i,r+1)),l),Ub(i,a,r,l),s&&qb(zb(s,Gb(a,n,r+1)),l));return Ub(n,null,r,l),new xb(l)}(t,u,_,i,n))}var d=t.parent,c=d.content;return zb(d,c.cut(0,t.parentOffset).append(a.content).append(c.cut(i.parentOffset)))}return zb(o,Gb(t,i,n))}(e,t,i,0)}function Pb(e,t){if(!t.type.compatibleContent(e.type))throw new Mb("Cannot join "+t.type.name+" onto "+e.type.name)}function jb(e,t,i){var a=e.node(i);return Pb(a,t.node(i)),a}function qb(e,t){var i=t.length-1;i>=0&&e.isText&&e.sameMarkup(t[i])?t[i]=e.withText(t[i].text+e.text):t.push(e)}function Ub(e,t,i,a){var n=(t||e).node(i),r=0,o=t?t.index(i):n.childCount;e&&(r=e.index(i),e.depth>i?r++:e.textOffset&&(qb(e.nodeAfter,a),r++));for(var s=r;s<o;s++)qb(n.child(s),a);t&&t.depth==i&&t.textOffset&&qb(t.nodeBefore,a)}function zb(e,t){if(!e.type.validContent(t))throw new Mb("Invalid content for node "+e.type.name);return e.copy(t)}function Gb(e,t,i){var a=[];(Ub(null,e,i,a),e.depth>i)&&qb(zb(jb(e,t,i+1),Gb(e,t,i+1)),a);return Ub(t,null,i,a),new xb(a)}Bb.size.get=function(){return this.content.size-this.openStart-this.openEnd},Ib.prototype.insertAt=function(e,t){var i=function e(t,i,a,n){var r=t.findIndex(i),o=r.index,s=r.offset,l=t.maybeChild(o);if(s==i||l.isText)return n&&!n.canReplace(o,o,a)?null:t.cut(0,i).append(a).append(t.cut(i));var u=e(l.content,i-s-1,a);return u&&t.replaceChild(o,l.copy(u))}(this.content,e+this.openStart,t,null);return i&&new Ib(i,this.openStart,this.openEnd)},Ib.prototype.removeBetween=function(e,t){return new Ib(function e(t,i,a){var n=t.findIndex(i),r=n.index,o=n.offset,s=t.maybeChild(r),l=t.findIndex(a),u=l.index,_=l.offset;if(o==i||s.isText){if(_!=a&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,i).append(t.cut(a))}if(r!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e(s.content,i-o-1,a-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},Ib.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},Ib.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},Ib.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},Ib.fromJSON=function(e,t){if(!t)return Ib.empty;var i=t.openStart||0,a=t.openEnd||0;if("number"!=typeof i||"number"!=typeof a)throw new RangeError("Invalid input for Slice.fromJSON");return new Ib(xb.fromJSON(e,t.content),i,a)},Ib.maxOpen=function(e,t){void 0===t&&(t=!0);for(var i=0,a=0,n=e.firstChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.firstChild)i++;for(var r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)a++;return new Ib(e,i,a)},Object.defineProperties(Ib.prototype,Bb),Ib.empty=new Ib(xb.empty,0,0);var Hb=function(e,t,i){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=i},Yb={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};Hb.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},Yb.parent.get=function(){return this.node(this.depth)},Yb.doc.get=function(){return this.node(0)},Hb.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},Hb.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},Hb.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},Hb.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},Hb.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},Hb.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},Hb.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},Yb.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Yb.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var i=this.pos-this.path[this.path.length-1],a=e.child(t);return i?e.child(t).cut(i):a},Yb.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},Hb.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var i=this.path[3*t],a=0==t?0:this.path[3*t-1]+1,n=0;n<e;n++)a+=i.child(n).nodeSize;return a},Hb.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return Rb.none;if(this.textOffset)return e.child(t).marks;var i=e.maybeChild(t-1),a=e.maybeChild(t);if(!i){var n=i;i=a,a=n}for(var r=i.marks,o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||a&&r[o].isInSet(a.marks)||(r=r[o--].removeFromSet(r));return r},Hb.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var i=t.marks,a=e.parent.maybeChild(e.index()),n=0;n<i.length;n++)!1!==i[n].type.spec.inclusive||a&&i[n].isInSet(a.marks)||(i=i[n--].removeFromSet(i));return i},Hb.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},Hb.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Kb(this,e,i)},Hb.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},Hb.prototype.max=function(e){return e.pos>this.pos?e:this},Hb.prototype.min=function(e){return e.pos<this.pos?e:this},Hb.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},Hb.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var i=[],a=0,n=t,r=e;;){var o=r.content.findIndex(n),s=o.index,l=o.offset,u=n-l;if(i.push(r,s,a+l),!u)break;if((r=r.child(s)).isText)break;n=u-1,a+=l+1}return new Hb(t,i,n)},Hb.resolveCached=function(e,t){for(var i=0;i<Vb.length;i++){var a=Vb[i];if(a.pos==t&&a.doc==e)return a}var n=Vb[Wb]=Hb.resolve(e,t);return Wb=(Wb+1)%$b,n},Object.defineProperties(Hb.prototype,Yb);var Vb=[],Wb=0,$b=12,Kb=function(e,t,i){this.$from=e,this.$to=t,this.depth=i},Qb={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};Qb.start.get=function(){return this.$from.before(this.depth+1)},Qb.end.get=function(){return this.$to.after(this.depth+1)},Qb.parent.get=function(){return this.$from.node(this.depth)},Qb.startIndex.get=function(){return this.$from.index(this.depth)},Qb.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(Kb.prototype,Qb);var Zb=Object.create(null),Xb=function(e,t,i,a){this.type=e,this.attrs=t,this.content=i||xb.empty,this.marks=a||Rb.none},Jb={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};Jb.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},Jb.childCount.get=function(){return this.content.childCount},Xb.prototype.child=function(e){return this.content.child(e)},Xb.prototype.maybeChild=function(e){return this.content.maybeChild(e)},Xb.prototype.forEach=function(e){this.content.forEach(e)},Xb.prototype.nodesBetween=function(e,t,i,a){void 0===a&&(a=0),this.content.nodesBetween(e,t,i,a,this)},Xb.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},Jb.textContent.get=function(){return this.textBetween(0,this.content.size,"")},Xb.prototype.textBetween=function(e,t,i,a){return this.content.textBetween(e,t,i,a)},Jb.firstChild.get=function(){return this.content.firstChild},Jb.lastChild.get=function(){return this.content.lastChild},Xb.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},Xb.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},Xb.prototype.hasMarkup=function(e,t,i){return this.type==e&&Ab(this.attrs,t||e.defaultAttrs||Zb)&&Rb.sameSet(this.marks,i||Rb.none)},Xb.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},Xb.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},Xb.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},Xb.prototype.slice=function(e,t,i){if(void 0===t&&(t=this.content.size),void 0===i&&(i=!1),e==t)return Ib.empty;var a=this.resolve(e),n=this.resolve(t),r=i?0:a.sharedDepth(t),o=a.start(r),s=a.node(r).content.cut(a.pos-o,n.pos-o);return new Ib(s,a.depth-r,n.depth-r)},Xb.prototype.replace=function(e,t,i){return Lb(this.resolve(e),this.resolve(t),i)},Xb.prototype.nodeAt=function(e){for(var t=this;;){var i=t.content.findIndex(e),a=i.index,n=i.offset;if(!(t=t.maybeChild(a)))return null;if(n==e||t.isText)return t;e-=n+1}},Xb.prototype.childAfter=function(e){var t=this.content.findIndex(e),i=t.index,a=t.offset;return{node:this.content.maybeChild(i),index:i,offset:a}},Xb.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),i=t.index,a=t.offset;if(a<e)return{node:this.content.child(i),index:i,offset:a};var n=this.content.child(i-1);return{node:n,index:i-1,offset:a-n.nodeSize}},Xb.prototype.resolve=function(e){return Hb.resolveCached(this,e)},Xb.prototype.resolveNoCache=function(e){return Hb.resolve(this,e)},Xb.prototype.rangeHasMark=function(e,t,i){var a=!1;return t>e&&this.nodesBetween(e,t,(function(e){return i.isInSet(e.marks)&&(a=!0),!a})),a},Jb.isBlock.get=function(){return this.type.isBlock},Jb.isTextblock.get=function(){return this.type.isTextblock},Jb.inlineContent.get=function(){return this.type.inlineContent},Jb.isInline.get=function(){return this.type.isInline},Jb.isText.get=function(){return this.type.isText},Jb.isLeaf.get=function(){return this.type.isLeaf},Jb.isAtom.get=function(){return this.type.isAtom},Xb.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(var i=e.length-1;i>=0;i--)t=e[i].type.name+"("+t+")";return t}(this.marks,e)},Xb.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},Xb.prototype.canReplace=function(e,t,i,a,n){void 0===i&&(i=xb.empty),void 0===a&&(a=0),void 0===n&&(n=i.childCount);var r=this.contentMatchAt(e).matchFragment(i,a,n),o=r&&r.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(var s=a;s<n;s++)if(!this.type.allowsMarks(i.child(s).marks))return!1;return!0},Xb.prototype.canReplaceWith=function(e,t,i,a){if(a&&!this.type.allowsMarks(a))return!1;var n=this.contentMatchAt(e).matchType(i),r=n&&n.matchFragment(this.content,t);return!!r&&r.validEnd},Xb.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},Xb.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var e=Rb.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Rb.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(e){return e.type.name})));this.content.forEach((function(e){return e.check()}))},Xb.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},Xb.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var i=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}var a=xb.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,a,i)},Object.defineProperties(Xb.prototype,Jb);var eE=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},tE={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};eE.parse=function(e,t){var i=new iE(e,t);if(null==i.next)return eE.empty;var a=nE(i);i.next&&i.err("Unexpected trailing text");var n=function(e){var t=Object.create(null);return function i(a){var n=[];a.forEach((function(t){e[t].forEach((function(t){var i=t.term,a=t.to;if(i){var r=n.indexOf(i),o=r>-1&&n[r+1];_E(e,a).forEach((function(e){o||n.push(i,o=[]),-1==o.indexOf(e)&&o.push(e)}))}}))}));for(var r=t[a.join(",")]=new eE(a.indexOf(e.length-1)>-1),o=0;o<n.length;o+=2){var s=n[o+1].sort(uE);r.next.push(n[o],t[s.join(",")]||i(s))}return r}(_E(e,0))}(function(e){var t=[[]];return n(function e(t,r){if("choice"==t.type)return t.exprs.reduce((function(t,i){return t.concat(e(i,r))}),[]);if("seq"==t.type)for(var o=0;;o++){var s=e(t.exprs[o],r);if(o==t.exprs.length-1)return s;n(s,r=i())}else{if("star"==t.type){var l=i();return a(r,l),n(e(t.expr,l),l),[a(l)]}if("plus"==t.type){var u=i();return n(e(t.expr,r),u),n(e(t.expr,u),u),[a(u)]}if("opt"==t.type)return[a(r)].concat(e(t.expr,r));if("range"==t.type){for(var _=r,d=0;d<t.min;d++){var c=i();n(e(t.expr,_),c),_=c}if(-1==t.max)n(e(t.expr,_),_);else for(var g=t.min;g<t.max;g++){var f=i();a(_,f),n(e(t.expr,_),f),_=f}return[a(_)]}if("name"==t.type)return[a(r,null,t.value)]}}(e,0),i()),t;function i(){return t.push([])-1}function a(e,i,a){var n={term:a,to:i};return t[e].push(n),n}function n(e,t){e.forEach((function(e){return e.to=t}))}}(a));return function(e,t){for(var i=0,a=[e];i<a.length;i++){for(var n=a[i],r=!n.validEnd,o=[],s=0;s<n.next.length;s+=2){var l=n.next[s],u=n.next[s+1];o.push(l.name),!r||l.isText||l.hasRequiredAttrs()||(r=!1),-1==a.indexOf(u)&&a.push(u)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(n,i),n},eE.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},eE.prototype.matchFragment=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.childCount);for(var a=this,n=t;a&&n<i;n++)a=a.matchType(e.child(n).type);return a},tE.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},tE.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},eE.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var i=0;i<e.next.length;i+=2)if(this.next[t]==e.next[i])return!0;return!1},eE.prototype.fillBefore=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=0);var a=[this];return function n(r,o){var s=r.matchFragment(e,i);if(s&&(!t||s.validEnd))return xb.from(o.map((function(e){return e.createAndFill()})));for(var l=0;l<r.next.length;l+=2){var u=r.next[l],_=r.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==a.indexOf(_)){a.push(_);var d=n(_,o.concat(u));if(d)return d}}}(this,[])},eE.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var i=this.computeWrapping(e);return this.wrapCache.push(e,i),i},eE.prototype.computeWrapping=function(e){for(var t=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var a=i.shift(),n=a.match;if(n.matchType(e)){for(var r=[],o=a;o.type;o=o.via)r.push(o.type);return r.reverse()}for(var s=0;s<n.next.length;s+=2){var l=n.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||a.type&&!n.next[s+1].validEnd||(i.push({match:l.contentMatch,type:l,via:a}),t[l.name]=!0)}}},tE.edgeCount.get=function(){return this.next.length>>1},eE.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},eE.prototype.toString=function(){var e=[];return function t(i){e.push(i);for(var a=1;a<i.next.length;a+=2)-1==e.indexOf(i.next[a])&&t(i.next[a])}(this),e.map((function(t,i){for(var a=i+(t.validEnd?"*":" ")+" ",n=0;n<t.next.length;n+=2)a+=(n?", ":"")+t.next[n].name+"->"+e.indexOf(t.next[n+1]);return a})).join("\n")},Object.defineProperties(eE.prototype,tE),eE.empty=new eE(!0);var iE=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},aE={next:{configurable:!0}};function nE(e){var t=[];do{t.push(rE(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function rE(e){var t=[];do{t.push(oE(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function oE(e){for(var t=function(e){if(e.eat("(")){var t=nE(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var i=function(e,t){var i=e.nodeTypes,a=i[t];if(a)return[a];var n=[];for(var r in i){var o=i[r];o.groups.indexOf(t)>-1&&n.push(o)}0==n.length&&e.err("No node type or group '"+t+"' found");return n}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=lE(e,t)}return t}function sE(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function lE(e,t){var i=sE(e),a=i;return e.eat(",")&&(a="}"!=e.next?sE(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:i,max:a,expr:t}}function uE(e,t){return t-e}function _E(e,t){var i=[];return function t(a){var n=e[a];if(1==n.length&&!n[0].term)return t(n[0].to);i.push(a);for(var r=0;r<n.length;r++){var o=n[r],s=o.term,l=o.to;s||-1!=i.indexOf(l)||t(l)}}(t),i.sort(uE)}function dE(e){var t=Object.create(null);for(var i in e){var a=e[i];if(!a.hasDefault)return null;t[i]=a.default}return t}function cE(e,t){var i=Object.create(null);for(var a in e){var n=t&&t[a];if(void 0===n){var r=e[a];if(!r.hasDefault)throw new RangeError("No value supplied for attribute "+a);n=r.default}i[a]=n}return i}function gE(e){var t=Object.create(null);if(e)for(var i in e)t[i]=new pE(e[i]);return t}aE.next.get=function(){return this.tokens[this.pos]},iE.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},iE.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(iE.prototype,aE);var fE=function(e,t,i){this.name=e,this.schema=t,this.spec=i,this.groups=i.group?i.group.split(" "):[],this.attrs=gE(i.attrs),this.defaultAttrs=dE(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==e),this.isText="text"==e},hE={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};hE.isInline.get=function(){return!this.isBlock},hE.isTextblock.get=function(){return this.isBlock&&this.inlineContent},hE.isLeaf.get=function(){return this.contentMatch==eE.empty},hE.isAtom.get=function(){return this.isLeaf||this.spec.atom},fE.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},fE.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},fE.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:cE(this.attrs,e)},fE.prototype.create=function(e,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xb(this,this.computeAttrs(e),xb.from(t),Rb.setFrom(i))},fE.prototype.createChecked=function(e,t,i){if(t=xb.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Xb(this,this.computeAttrs(e),t,Rb.setFrom(i))},fE.prototype.createAndFill=function(e,t,i){if(e=this.computeAttrs(e),(t=xb.from(t)).size){var a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}var n=this.contentMatch.matchFragment(t).fillBefore(xb.empty,!0);return n?new Xb(this,e,t.append(n),Rb.setFrom(i)):null},fE.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0},fE.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},fE.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},fE.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:Rb.empty:e},fE.compile=function(e,t){var i=Object.create(null);e.forEach((function(e,a){return i[e]=new fE(e,t,a)}));var a=t.spec.topNode||"doc";if(!i[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var n in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i},Object.defineProperties(fE.prototype,hE);var pE=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},mE={isRequired:{configurable:!0}};mE.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(pE.prototype,mE);var FE=function(e,t,i,a){this.name=e,this.schema=i,this.spec=a,this.attrs=gE(a.attrs),this.rank=t,this.excluded=null;var n=dE(this.attrs);this.instance=n&&new Rb(this,n)};FE.prototype.create=function(e){return!e&&this.instance?this.instance:new Rb(this,cE(this.attrs,e))},FE.compile=function(e,t){var i=Object.create(null),a=0;return e.forEach((function(e,n){return i[e]=new FE(e,a++,t,n)})),i},FE.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e},FE.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},FE.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var bE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},EE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},yE={ol:!0,ul:!0};function DE(e){return(e?1:0)|("full"===e?2:0)}var vE=function(e,t,i,a,n,r,o){this.type=e,this.attrs=t,this.solid=n,this.match=r||(4&o?null:e.contentMatch),this.options=o,this.content=[],this.marks=i,this.activeMarks=Rb.none,this.pendingMarks=a,this.stashMarks=[]};vE.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(xb.from(e));if(!t){var i,a=this.type.contentMatch;return(i=a.findWrapping(e.type))?(this.match=a,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},vE.prototype.finish=function(e){if(!(1&this.options)){var t,i=this.content[this.content.length-1];i&&i.isText&&(t=/[ \t\r\n\u000c]+$/.exec(i.text))&&(i.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-t[0].length)))}var a=xb.from(this.content);return!e&&this.match&&(a=a.append(this.match.fillBefore(xb.empty,!0))),this.type?this.type.create(this.attrs,a,this.marks):a},vE.prototype.popFromStashMark=function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},vE.prototype.applyPending=function(e){for(var t=0,i=this.pendingMarks;t<i.length;t++){var a=i[t];(this.type?this.type.allowsMarkType(a.type):wE(a.type,e))&&!a.isInSet(this.activeMarks)&&(this.activeMarks=a.addToSet(this.activeMarks),this.pendingMarks=a.removeFromSet(this.pendingMarks))}},vE.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!bE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var kE=function(e,t,i){this.parser=e,this.options=t,this.isOpen=i;var a,n=t.topNode,r=DE(t.preserveWhitespace)|(i?4:0);a=n?new vE(n.type,n.attrs,Rb.none,Rb.none,!0,t.topMatch||n.type.contentMatch,r):new vE(i?null:e.schema.topNodeType,null,Rb.none,Rb.none,!0,null,r),this.nodes=[a],this.open=0,this.find=t.findPositions,this.needsBlock=!1},SE={top:{configurable:!0},currentPos:{configurable:!0}};function wE(e,t){var i=t.schema.nodes,a=function(a){var n=i[a];if(n.allowsMarkType(e)){var r=[],o=function(e){r.push(e);for(var i=0;i<e.edgeCount;i++){var a=e.edge(i),n=a.type,s=a.next;if(n==t)return!0;if(r.indexOf(s)<0&&o(s))return!0}};return o(n.contentMatch)?{v:!0}:void 0}};for(var n in i){var r=a(n);if(r)return r.v}}SE.top.get=function(){return this.nodes[this.open]},kE.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),i=t?this.readStyles(function(e){var t,i=/\s*([\w-]+)\s*:\s*([^;]+)/g,a=[];for(;t=i.exec(e);)a.push(t[1],t[2].trim());return a}(t)):null,a=this.top;if(null!=i)for(var n=0;n<i.length;n++)this.addPendingMark(i[n]);if(this.addElement(e),null!=i)for(var r=0;r<i.length;r++)this.removePendingMark(i[r],a)}},kE.prototype.addTextNode=function(e){var t=e.nodeValue,i=this.top;if(2&i.options||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&i.options)t=2&i.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var a=i.content[i.content.length-1],n=e.previousSibling;(!a||n&&"BR"==n.nodeName||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},kE.prototype.addElement=function(e,t){var i,a=e.nodeName.toLowerCase();yE.hasOwnProperty(a)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,i=null;t;t=t.nextSibling){var a=1==t.nodeType?t.nodeName.toLowerCase():null;a&&yE.hasOwnProperty(a)&&i?(i.appendChild(t),t=i):"li"==a?i=t:a&&(i=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(n?n.ignore:EE.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e);else if(!n||n.skip||n.closeParent){n&&n.closeParent?this.open=Math.max(0,this.open-1):n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,s=this.needsBlock;if(bE.hasOwnProperty(a))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=s}else this.addElementByRule(e,n,!1===n.consuming?i:null)},kE.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},kE.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},kE.prototype.readStyles=function(e){var t=Rb.none;e:for(var i=0;i<e.length;i+=2)for(var a=null;;){var n=this.parser.matchStyle(e[i],e[i+1],this,a);if(!n)continue e;if(n.ignore)return null;if(t=this.parser.schema.marks[n.mark].create(n.attrs).addToSet(t),!1!==n.consuming)break;a=n}return t},kE.prototype.addElementByRule=function(e,t,i){var a,n,r,o=this;t.node?(n=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(n.create(t.attrs))||this.leafFallback(e):a=this.enter(n,t.attrs,t.preserveWhitespace):(r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r));var s=this.top;if(n&&n.isLeaf)this.findInside(e);else if(i)this.addElement(e,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return o.insertNode(e)}));else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,a)}a&&(this.sync(s),this.open--),r&&this.removePendingMark(r,s)},kE.prototype.addAll=function(e,t,i,a){for(var n=i||0,r=i?e.childNodes[i]:e.firstChild,o=null==a?null:e.childNodes[a];r!=o;r=r.nextSibling,++n)this.findAtPoint(e,n),this.addDOM(r),t&&bE.hasOwnProperty(r.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,n)},kE.prototype.findPlace=function(e){for(var t,i,a=this.open;a>=0;a--){var n=this.nodes[a],r=n.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,i=n,!r.length))break;if(n.solid)break}if(!t)return!1;this.sync(i);for(var o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0},kE.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var i=this.top;i.applyPending(e.type),i.match&&(i.match=i.match.matchType(e.type));for(var a=i.activeMarks,n=0;n<e.marks.length;n++)i.type&&!i.type.allowsMarkType(e.marks[n].type)||(a=e.marks[n].addToSet(a));return i.content.push(e.mark(a)),!0}return!1},kE.prototype.enter=function(e,t,i){var a=this.findPlace(e.create(t));return a&&this.enterInner(e,t,!0,i),a},kE.prototype.enterInner=function(e,t,i,a){this.closeExtra();var n=this.top;n.applyPending(e),n.match=n.match&&n.match.matchType(e,t);var r=null==a?-5&n.options:DE(a);4&n.options&&0==n.content.length&&(r|=4),this.nodes.push(new vE(e,t,n.activeMarks,n.pendingMarks,i,null,r)),this.open++},kE.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},kE.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},kE.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},SE.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var i=this.nodes[t].content,a=i.length-1;a>=0;a--)e+=i[a].nodeSize;t&&e++}return e},kE.prototype.findAtPoint=function(e,t){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)},kE.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},kE.prototype.findAround=function(e,t,i){if(e!=t&&this.find)for(var a=0;a<this.find.length;a++){if(null==this.find[a].pos&&1==e.nodeType&&e.contains(this.find[a].node))t.compareDocumentPosition(this.find[a].node)&(i?2:4)&&(this.find[a].pos=this.currentPos)}},kE.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},kE.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var i=e.split("/"),a=this.options.context,n=!(this.isOpen||a&&a.parent.type!=this.nodes[0].type),r=-(a?a.depth+1:0)+(n?0:1),o=function(e,s){for(;e>=0;e--){var l=i[e];if(""==l){if(e==i.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}var u=s>0||0==s&&n?t.nodes[s].type:a&&s>=r?a.node(s-r).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0};return o(i.length-1,this.open)},kE.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var a in this.parser.schema.nodes){var n=this.parser.schema.nodes[a];if(n.isTextblock&&n.defaultAttrs)return n}},kE.prototype.addPendingMark=function(e){var t=function(e,t){for(var i=0;i<t.length;i++)if(e.eq(t[i]))return t[i]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},kE.prototype.removePendingMark=function(e,t){for(var i=this.open;i>=0;i--){var a=this.nodes[i];if(a.pendingMarks.lastIndexOf(e)>-1)a.pendingMarks=e.removeFromSet(a.pendingMarks);else{a.activeMarks=e.removeFromSet(a.activeMarks);var n=a.popFromStashMark(e);n&&a.type&&a.type.allowsMarkType(n.type)&&(a.activeMarks=n.addToSet(a.activeMarks))}if(a==t)break}},Object.defineProperties(kE.prototype,SE);var CE=Math.pow(2,16);function xE(e){return 65535&e}var TE=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),this.pos=e,this.deleted=t,this.recover=i},OE=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};OE.prototype.recover=function(e){var t=0,i=xE(e);if(!this.inverted)for(var a=0;a<i;a++)t+=this.ranges[3*a+2]-this.ranges[3*a+1];return this.ranges[3*i]+t+function(e){return(e-(65535&e))/CE}(e)},OE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},OE.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},OE.prototype._map=function(e,t,i){for(var a=0,n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?a:0);if(s>e)break;var l=this.ranges[o+n],u=this.ranges[o+r],_=s+l;if(e<=_){var d=s+a+((l?e==s?-1:e==_?1:t:t)<0?0:u);if(i)return d;var c=e==(t<0?s:_)?null:o/3+(e-s)*CE;return new TE(d,t<0?e!=s:e!=_,c)}a+=u-l}return i?e+a:new TE(e+a)},OE.prototype.touches=function(e,t){for(var i=0,a=xE(t),n=this.inverted?2:1,r=this.inverted?1:2,o=0;o<this.ranges.length;o+=3){var s=this.ranges[o]-(this.inverted?i:0);if(s>e)break;var l=this.ranges[o+n];if(e<=s+l&&o==3*a)return!0;i+=this.ranges[o+r]-l}return!1},OE.prototype.forEach=function(e){for(var t=this.inverted?2:1,i=this.inverted?1:2,a=0,n=0;a<this.ranges.length;a+=3){var r=this.ranges[a],o=r-(this.inverted?n:0),s=r+(this.inverted?0:n),l=this.ranges[a+t],u=this.ranges[a+i];e(o,o+l,s,s+u),n+=u-l}},OE.prototype.invert=function(){return new OE(this.ranges,!this.inverted)},OE.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},OE.offset=function(e){return 0==e?OE.empty:new OE(e<0?[0,-e,0]:[0,0,e])},OE.empty=new OE([]);var NE=function(e,t,i,a){this.maps=e||[],this.from=i||0,this.to=null==a?this.maps.length:a,this.mirror=t};function AE(e){var t=Error.call(this,e);return t.__proto__=AE.prototype,t}NE.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new NE(this.maps,this.mirror,e,t)},NE.prototype.copy=function(){return new NE(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},NE.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},NE.prototype.appendMapping=function(e){for(var t=0,i=this.maps.length;t<e.maps.length;t++){var a=e.getMirror(t);this.appendMap(e.maps[t],null!=a&&a<t?i+a:null)}},NE.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},NE.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},NE.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,i=this.maps.length+e.maps.length;t>=0;t--){var a=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=a&&a>t?i-a-1:null)}},NE.prototype.invert=function(){var e=new NE;return e.appendMappingInverted(this),e},NE.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var i=this.from;i<this.to;i++)e=this.maps[i].map(e,t);return e},NE.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},NE.prototype._map=function(e,t,i){for(var a=!1,n=this.from;n<this.to;n++){var r=this.maps[n].mapResult(e,t);if(null!=r.recover){var o=this.getMirror(n);if(null!=o&&o>n&&o<this.to){n=o,e=this.maps[o].recover(r.recover);continue}}r.deleted&&(a=!0),e=r.pos}return i?e:new TE(e,a)},AE.prototype=Object.create(Error.prototype),AE.prototype.constructor=AE,AE.prototype.name="TransformError";var RE=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new NE},ME={before:{configurable:!0},docChanged:{configurable:!0}};function IE(){throw new Error("Override me")}ME.before.get=function(){return this.docs.length?this.docs[0]:this.doc},RE.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new AE(t.failed);return this},RE.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},ME.docChanged.get=function(){return this.steps.length>0},RE.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(RE.prototype,ME);var BE=Object.create(null),LE=function(){};LE.prototype.apply=function(e){return IE()},LE.prototype.getMap=function(){return OE.empty},LE.prototype.invert=function(e){return IE()},LE.prototype.map=function(e){return IE()},LE.prototype.merge=function(e){return null},LE.prototype.toJSON=function(){return IE()},LE.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=BE[t.stepType];if(!i)throw new RangeError("No step type "+t.stepType+" defined");return i.fromJSON(e,t)},LE.jsonID=function(e,t){if(e in BE)throw new RangeError("Duplicate use of step JSON ID "+e);return BE[e]=t,t.prototype.jsonID=e,t};var PE=function(e,t){this.doc=e,this.failed=t};PE.ok=function(e){return new PE(e,null)},PE.fail=function(e){return new PE(null,e)},PE.fromReplace=function(e,t,i,a){try{return PE.ok(e.replace(t,i,a))}catch(e){if(e instanceof Mb)return PE.fail(e.message);throw e}};var jE=function(e){function t(t,i,a,n){e.call(this),this.from=t,this.to=i,this.slice=a,this.structure=!!n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&UE(e,this.from,this.to)?PE.fail("Structure replace would overwrite content"):PE.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new OE([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted?null:new t(i.pos,Math.max(i.pos,a.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var i=this.slice.size+e.slice.size==0?Ib.empty:new Ib(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,i,this.structure)}var a=this.slice.size+e.slice.size==0?Ib.empty:new Ib(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),a,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(i.from,i.to,Ib.fromJSON(e,i.slice),!!i.structure)},t}(LE);LE.jsonID("replace",jE);var qE=function(e){function t(t,i,a,n,r,o,s){e.call(this),this.from=t,this.to=i,this.gapFrom=a,this.gapTo=n,this.slice=r,this.insert=o,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(UE(e,this.from,this.gapFrom)||UE(e,this.gapTo,this.to)))return PE.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return PE.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,t.content);return i?PE.fromReplace(e,this.from,this.to,i):PE.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new OE([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var i=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+i,this.from+this.insert,this.from+this.insert+i,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1),n=e.map(this.gapFrom,-1),r=e.map(this.gapTo,1);return i.deleted&&a.deleted||n<i.pos||r>a.pos?null:new t(i.pos,a.pos,n,r,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to||"number"!=typeof i.gapFrom||"number"!=typeof i.gapTo||"number"!=typeof i.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(i.from,i.to,i.gapFrom,i.gapTo,Ib.fromJSON(e,i.slice),i.insert,!!i.structure)},t}(LE);function UE(e,t,i){for(var a=e.resolve(t),n=i-t,r=a.depth;n>0&&r>0&&a.indexAfter(r)==a.node(r).childCount;)r--,n--;if(n>0)for(var o=a.node(r).maybeChild(a.indexAfter(r));n>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,n--}return!1}function zE(e,t,i){for(var a=[],n=0;n<e.childCount;n++){var r=e.child(n);r.content.size&&(r=r.copy(zE(r.content,t,r))),r.isInline&&(r=t(r,i,n)),a.push(r)}return xb.fromArray(a)}LE.jsonID("replaceAround",qE),RE.prototype.lift=function(e,t){for(var i=e.$from,a=e.$to,n=e.depth,r=i.before(n+1),o=a.after(n+1),s=r,l=o,u=xb.empty,_=0,d=n,c=!1;d>t;d--)c||i.index(d)>0?(c=!0,u=xb.from(i.node(d).copy(u)),_++):s--;for(var g=xb.empty,f=0,h=n,p=!1;h>t;h--)p||a.after(h+1)<a.end(h)?(p=!0,g=xb.from(a.node(h).copy(g)),f++):l++;return this.step(new qE(s,l,r,o,new Ib(u.append(g),_,f),u.size-_,!0))},RE.prototype.wrap=function(e,t){for(var i=xb.empty,a=t.length-1;a>=0;a--)i=xb.from(t[a].type.create(t[a].attrs,i));var n=e.start,r=e.end;return this.step(new qE(n,r,n,r,new Ib(i,0,0),t.length,!0))},RE.prototype.setBlockType=function(e,t,i,a){var n=this;if(void 0===t&&(t=e),!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var r=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(i,a)&&function(e,t,i){var a=e.resolve(t),n=a.index();return a.parent.canReplaceWith(n,n+1,i)}(n.doc,n.mapping.slice(r).map(t),i)){n.clearIncompatible(n.mapping.slice(r).map(t,1),i);var o=n.mapping.slice(r),s=o.map(t,1),l=o.map(t+e.nodeSize,1);return n.step(new qE(s,l,s+1,l-1,new Ib(xb.from(i.create(a,null,e.marks)),0,0),1,!0)),!1}})),this},RE.prototype.setNodeMarkup=function(e,t,i,a){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at given position");t||(t=n.type);var r=t.create(i,null,a||n.marks);if(n.isLeaf)return this.replaceWith(e,e+n.nodeSize,r);if(!t.validContent(n.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new qE(e,e+n.nodeSize,e+1,e+n.nodeSize-1,new Ib(xb.from(r),0,0),1,!0))},RE.prototype.split=function(e,t,i){void 0===t&&(t=1);for(var a=this.doc.resolve(e),n=xb.empty,r=xb.empty,o=a.depth,s=a.depth-t,l=t-1;o>s;o--,l--){n=xb.from(a.node(o).copy(n));var u=i&&i[l];r=xb.from(u?u.type.create(u.attrs,r):a.node(o).copy(r))}return this.step(new jE(e,e,new Ib(n.append(r),t,t),!0))},RE.prototype.join=function(e,t){void 0===t&&(t=1);var i=new jE(e-t,e+t,Ib.empty,!0);return this.step(i)};var GE=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=e.resolve(this.from),n=a.node(a.sharedDepth(this.to)),r=new Ib(zE(i.content,(function(e,i){return e.isAtom&&i.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),n),i.openStart,i.openEnd);return PE.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new HE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(LE);LE.jsonID("addMark",GE);var HE=function(e){function t(t,i,a){e.call(this),this.from=t,this.to=i,this.mark=a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,i=e.slice(this.from,this.to),a=new Ib(zE(i.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),i.openStart,i.openEnd);return PE.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new GE(this.from,this.to,this.mark)},t.prototype.map=function(e){var i=e.mapResult(this.from,1),a=e.mapResult(this.to,-1);return i.deleted&&a.deleted||i.pos>=a.pos?null:new t(i.pos,a.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,i){if("number"!=typeof i.from||"number"!=typeof i.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(i.from,i.to,e.markFromJSON(i.mark))},t}(LE);function YE(e,t,i){return!i.openStart&&!i.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),i.content)}LE.jsonID("removeMark",HE),RE.prototype.addMark=function(e,t,i){var a=this,n=[],r=[],o=null,s=null;return this.doc.nodesBetween(e,t,(function(a,l,u){if(a.isInline){var _=a.marks;if(!i.isInSet(_)&&u.type.allowsMarkType(i.type)){for(var d=Math.max(l,e),c=Math.min(l+a.nodeSize,t),g=i.addToSet(_),f=0;f<_.length;f++)_[f].isInSet(g)||(o&&o.to==d&&o.mark.eq(_[f])?o.to=c:n.push(o=new HE(d,c,_[f])));s&&s.to==d?s.to=c:r.push(s=new GE(d,c,i))}}})),n.forEach((function(e){return a.step(e)})),r.forEach((function(e){return a.step(e)})),this},RE.prototype.removeMark=function(e,t,i){var a=this;void 0===i&&(i=null);var n=[],r=0;return this.doc.nodesBetween(e,t,(function(a,o){if(a.isInline){r++;var s=null;if(i instanceof FE)for(var l,u=a.marks;l=i.isInSet(u);)(s||(s=[])).push(l),u=l.removeFromSet(u);else i?i.isInSet(a.marks)&&(s=[i]):s=a.marks;if(s&&s.length)for(var _=Math.min(o+a.nodeSize,t),d=0;d<s.length;d++){for(var c=s[d],g=void 0,f=0;f<n.length;f++){var h=n[f];h.step==r-1&&c.eq(n[f].style)&&(g=h)}g?(g.to=_,g.step=r):n.push({style:c,from:Math.max(o,e),to:_,step:r})}}})),n.forEach((function(e){return a.step(new HE(e.from,e.to,e.style))})),this},RE.prototype.clearIncompatible=function(e,t,i){void 0===i&&(i=t.contentMatch);for(var a=this.doc.nodeAt(e),n=[],r=e+1,o=0;o<a.childCount;o++){var s=a.child(o),l=r+s.nodeSize,u=i.matchType(s.type,s.attrs);if(u){i=u;for(var _=0;_<s.marks.length;_++)t.allowsMarkType(s.marks[_].type)||this.step(new HE(r,l,s.marks[_]))}else n.push(new jE(r,l,Ib.empty));r=l}if(!i.validEnd){var d=i.fillBefore(xb.empty,!0);this.replace(r,r,new Ib(d,0,0))}for(var c=n.length-1;c>=0;c--)this.step(n[c]);return this},RE.prototype.replace=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=Ib.empty);var a=function(e,t,i,a){if(void 0===i&&(i=t),void 0===a&&(a=Ib.empty),t==i&&!a.size)return null;var n=e.resolve(t),r=e.resolve(i);return YE(n,r,a)?new jE(t,i,a):new VE(n,r,a).fit()}(this.doc,e,t,i);return a&&this.step(a),this},RE.prototype.replaceWith=function(e,t,i){return this.replace(e,t,new Ib(xb.from(i),0,0))},RE.prototype.delete=function(e,t){return this.replace(e,t,Ib.empty)},RE.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var VE=function(e,t,i){this.$to=t,this.$from=e,this.unplaced=i,this.frontier=[];for(var a=0;a<=e.depth;a++){var n=e.node(a);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(a))})}this.placed=xb.empty;for(var r=e.depth;r>0;r--)this.placed=xb.from(e.node(r).copy(this.placed))},WE={depth:{configurable:!0}};function $E(e,t,i){return 0==t?e.cutByIndex(i):e.replaceChild(0,e.firstChild.copy($E(e.firstChild.content,t-1,i)))}function KE(e,t,i){return 0==t?e.append(i):e.replaceChild(e.childCount-1,e.lastChild.copy(KE(e.lastChild.content,t-1,i)))}function QE(e,t){for(var i=0;i<t;i++)e=e.firstChild.content;return e}function ZE(e,t,i){if(t<=0)return e;var a=e.content;return t>1&&(a=a.replaceChild(0,ZE(a.firstChild,t-1,1==a.childCount?i-1:0))),t>0&&(a=e.type.contentMatch.fillBefore(a).append(a),i<=0&&(a=a.append(e.type.contentMatch.matchFragment(a).fillBefore(xb.empty,!0)))),e.copy(a)}function XE(e,t,i,a,n){var r=e.node(t),o=n?e.indexAfter(t):e.index(t);if(o==r.childCount&&!i.compatibleContent(r.type))return null;var s=a.fillBefore(r.content,!0,o);return s&&!function(e,t,i){for(var a=i;a<t.childCount;a++)if(!e.allowsMarks(t.child(a).marks))return!0;return!1}(i,r.content,o)?s:null}function JE(e,t,i,a,n){if(t<i){var r=e.firstChild;e=e.replaceChild(0,r.copy(JE(r.content,t+1,i,a,r)))}if(t>a){var o=n.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(xb.empty,!0))}return e}function ey(e,t){for(var i=[],a=Math.min(e.depth,t.depth);a>=0;a--){var n=e.start(a);if(n<e.pos-(e.depth-a)||t.end(a)>t.pos+(t.depth-a)||e.node(a).type.spec.isolating||t.node(a).type.spec.isolating)break;(n==t.start(a)||a==e.depth&&a==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&a&&t.start(a-1)==n-1)&&i.push(a)}return i}WE.depth.get=function(){return this.frontier.length-1},VE.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),i=this.placed.size-this.depth-this.$from.depth,a=this.$from,n=this.close(t<0?this.$to:a.doc.resolve(t));if(!n)return null;for(var r=this.placed,o=a.depth,s=n.depth;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;var l=new Ib(r,o,s);return t>-1?new qE(a.pos,t,this.$to.pos,this.$to.end(),l,i):l.size||a.pos!=this.$to.pos?new jE(a.pos,n.pos,l):void 0},VE.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var i=void 0,a=(t?(i=QE(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,n=this.depth;n>=0;n--){var r=this.frontier[n],o=r.type,s=r.match,l=void 0,u=void 0;if(1==e&&(a?s.matchType(a.type)||(u=s.fillBefore(xb.from(a),!1)):o.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:n,parent:i,inject:u};if(2==e&&a&&(l=s.findWrapping(a.type)))return{sliceDepth:t,frontierDepth:n,parent:i,wrap:l};if(i&&s.matchType(i.type))break}},VE.prototype.openMore=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=QE(t,i);return!(!n.childCount||n.firstChild.isLeaf)&&(this.unplaced=new Ib(t,i+1,Math.max(a,n.size+i>=t.size-a?i+1:0)),!0)},VE.prototype.dropNode=function(){var e=this.unplaced,t=e.content,i=e.openStart,a=e.openEnd,n=QE(t,i);if(n.childCount<=1&&i>0){var r=t.size-i<=i+n.size;this.unplaced=new Ib($E(t,i-1,1),i-1,r?i-1:a)}else this.unplaced=new Ib($E(t,i,1),i,a)},VE.prototype.placeNodes=function(e){for(var t=e.sliceDepth,i=e.frontierDepth,a=e.parent,n=e.inject,r=e.wrap;this.depth>i;)this.closeFrontierNode();if(r)for(var o=0;o<r.length;o++)this.openFrontierNode(r[o]);var s=this.unplaced,l=a?a.content:s.content,u=s.openStart-t,_=0,d=[],c=this.frontier[i],g=c.match,f=c.type;if(n){for(var h=0;h<n.childCount;h++)d.push(n.child(h));g=g.matchFragment(n)}for(var p=l.size+t-(s.content.size-s.openEnd);_<l.childCount;){var m=l.child(_),F=g.matchType(m.type);if(!F)break;(++_>1||0==u||m.content.size)&&(g=F,d.push(ZE(m.mark(f.allowedMarks(m.marks)),1==_?u:0,_==l.childCount?p:-1)))}var b=_==l.childCount;b||(p=-1),this.placed=KE(this.placed,i,xb.from(d)),this.frontier[i].match=g,b&&p<0&&a&&a.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,y=l;E<p;E++){var D=y.lastChild;this.frontier.push({type:D.type,match:D.contentMatchAt(D.childCount)}),y=D.content}this.unplaced=b?0==t?Ib.empty:new Ib($E(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new Ib($E(s.content,t,_),s.openStart,s.openEnd)},VE.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!XE(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var i=this.$to.depth,a=this.$to.after(i);i>1&&a==this.$to.end(--i);)++a;return a},VE.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var i=this.frontier[t],a=i.match,n=i.type,r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=XE(e,t,n,a,r);if(o){for(var s=t-1;s>=0;s--){var l=this.frontier[s],u=l.match,_=XE(e,s,l.type,u,!0);if(!_||_.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}},VE.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=KE(this.placed,t.depth,t.fit)),e=t.move;for(var i=t.depth+1;i<=e.depth;i++){var a=e.node(i),n=a.type.contentMatch.fillBefore(a.content,!0,e.index(i));this.openFrontierNode(a.type,a.attrs,n)}return e},VE.prototype.openFrontierNode=function(e,t,i){var a=this.frontier[this.depth];a.match=a.match.matchType(e),this.placed=KE(this.placed,this.depth,xb.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})},VE.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(xb.empty,!0);e.childCount&&(this.placed=KE(this.placed,this.frontier.length,e))},Object.defineProperties(VE.prototype,WE),RE.prototype.replaceRange=function(e,t,i){if(!i.size)return this.deleteRange(e,t);var a=this.doc.resolve(e),n=this.doc.resolve(t);if(YE(a,n,i))return this.step(new jE(e,t,i));var r=ey(a,this.doc.resolve(t));0==r[r.length-1]&&r.pop();var o=-(a.depth+1);r.unshift(o);for(var s=a.depth,l=a.pos-1;s>0;s--,l--){var u=a.node(s).type.spec;if(u.defining||u.isolating)break;r.indexOf(s)>-1?o=s:a.before(s)==l&&r.splice(1,0,-s)}for(var _=r.indexOf(o),d=[],c=i.openStart,g=i.content,f=0;;f++){var h=g.firstChild;if(d.push(h),f==i.openStart)break;g=h.content}c>0&&d[c-1].type.spec.defining&&a.node(_).type!=d[c-1].type?c-=1:c>=2&&d[c-1].isTextblock&&d[c-2].type.spec.defining&&a.node(_).type!=d[c-2].type&&(c-=2);for(var p=i.openStart;p>=0;p--){var m=(p+c+1)%(i.openStart+1),F=d[m];if(F)for(var b=0;b<r.length;b++){var E=r[(b+_)%r.length],y=!0;E<0&&(y=!1,E=-E);var D=a.node(E-1),v=a.index(E-1);if(D.canReplaceWith(v,v,F.type,F.marks))return this.replace(a.before(E),y?n.after(E):t,new Ib(JE(i.content,0,i.openStart,m),m,i.openEnd))}}for(var k=this.steps.length,S=r.length-1;S>=0&&(this.replace(e,t,i),!(this.steps.length>k));S--){var w=r[S];w<0||(e=a.before(w),t=n.after(w))}return this},RE.prototype.replaceRangeWith=function(e,t,i){if(!i.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var a=function(e,t,i){var a=e.resolve(t);if(a.parent.canReplaceWith(a.index(),a.index(),i))return t;if(0==a.parentOffset)for(var n=a.depth-1;n>=0;n--){var r=a.index(n);if(a.node(n).canReplaceWith(r,r,i))return a.before(n+1);if(r>0)return null}if(a.parentOffset==a.parent.content.size)for(var o=a.depth-1;o>=0;o--){var s=a.indexAfter(o);if(a.node(o).canReplaceWith(s,s,i))return a.after(o+1);if(s<a.node(o).childCount)return null}}(this.doc,e,i.type);null!=a&&(e=t=a)}return this.replaceRange(e,t,new Ib(xb.from(i),0,0))},RE.prototype.deleteRange=function(e,t){for(var i=this.doc.resolve(e),a=this.doc.resolve(t),n=ey(i,a),r=0;r<n.length;r++){var o=n[r],s=r==n.length-1;if(s&&0==o||i.node(o).type.contentMatch.validEnd)return this.delete(i.start(o),a.end(o));if(o>0&&(s||i.node(o-1).canReplace(i.index(o-1),a.indexAfter(o-1))))return this.delete(i.before(o),a.after(o))}for(var l=1;l<=i.depth&&l<=a.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&a.end(l)-t!=a.depth-l)return this.delete(i.before(l),t);return this.delete(e,t)};var ty=Object.create(null),iy=function(e,t,i){this.ranges=i||[new ny(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},ay={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ay.anchor.get=function(){return this.$anchor.pos},ay.head.get=function(){return this.$head.pos},ay.from.get=function(){return this.$from.pos},ay.to.get=function(){return this.$to.pos},ay.$from.get=function(){return this.ranges[0].$from},ay.$to.get=function(){return this.ranges[0].$to},ay.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},iy.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},iy.prototype.replace=function(e,t){void 0===t&&(t=Ib.empty);for(var i=t.content.lastChild,a=null,n=0;n<t.openEnd;n++)a=i,i=i.lastChild;for(var r=e.steps.length,o=this.ranges,s=0;s<o.length;s++){var l=o[s],u=l.$from,_=l.$to,d=e.mapping.slice(r);e.replaceRange(d.map(u.pos),d.map(_.pos),s?Ib.empty:t),0==s&&cy(e,r,(i?i.isInline:a&&a.isTextblock)?-1:1)}},iy.prototype.replaceWith=function(e,t){for(var i=e.steps.length,a=this.ranges,n=0;n<a.length;n++){var r=a[n],o=r.$from,s=r.$to,l=e.mapping.slice(i),u=l.map(o.pos),_=l.map(s.pos);n?e.deleteRange(u,_):(e.replaceRangeWith(u,_,t),cy(e,i,t.isInline?-1:1))}},iy.findFrom=function(e,t,i){var a=e.parent.inlineContent?new ry(e):dy(e.node(0),e.parent,e.pos,e.index(),t,i);if(a)return a;for(var n=e.depth-1;n>=0;n--){var r=t<0?dy(e.node(0),e.node(n),e.before(n+1),e.index(n),t,i):dy(e.node(0),e.node(n),e.after(n+1),e.index(n)+1,t,i);if(r)return r}},iy.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new uy(e.node(0))},iy.atStart=function(e){return dy(e,e,0,0,1)||new uy(e)},iy.atEnd=function(e){return dy(e,e,e.content.size,e.childCount,-1)||new uy(e)},iy.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=ty[t.type];if(!i)throw new RangeError("No selection type "+t.type+" defined");return i.fromJSON(e,t)},iy.jsonID=function(e,t){if(e in ty)throw new RangeError("Duplicate use of selection JSON ID "+e);return ty[e]=t,t.prototype.jsonID=e,t},iy.prototype.getBookmark=function(){return ry.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(iy.prototype,ay),iy.prototype.visible=!0;var ny=function(e,t){this.$from=e,this.$to=t},ry=function(e){function t(t,i){void 0===i&&(i=t),e.call(this,t,i)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={$cursor:{configurable:!0}};return i.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(i,a){var n=i.resolve(a.map(this.head));if(!n.parent.inlineContent)return e.near(n);var r=i.resolve(a.map(this.anchor));return new t(r.parent.inlineContent?r:n,n)},t.prototype.replace=function(t,i){if(void 0===i&&(i=Ib.empty),e.prototype.replace.call(this,t,i),i==Ib.empty){var a=this.$from.marksAcross(this.$to);a&&t.ensureMarks(a)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new oy(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,i){if("number"!=typeof i.anchor||"number"!=typeof i.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(i.anchor),e.resolve(i.head))},t.create=function(e,t,i){void 0===i&&(i=t);var a=e.resolve(t);return new this(a,i==t?a:e.resolve(i))},t.between=function(i,a,n){var r=i.pos-a.pos;if(n&&!r||(n=r>=0?1:-1),!a.parent.inlineContent){var o=e.findFrom(a,n,!0)||e.findFrom(a,-n,!0);if(!o)return e.near(a,n);a=o.$head}return i.parent.inlineContent||(0==r||(i=(e.findFrom(i,-n,!0)||e.findFrom(i,n,!0)).$anchor).pos<a.pos!=r<0)&&(i=a),new t(i,a)},Object.defineProperties(t.prototype,i),t}(iy);iy.jsonID("text",ry);var oy=function(e,t){this.anchor=e,this.head=t};oy.prototype.map=function(e){return new oy(e.map(this.anchor),e.map(this.head))},oy.prototype.resolve=function(e){return ry.between(e.resolve(this.anchor),e.resolve(this.head))};var sy=function(e){function t(t){var i=t.nodeAfter,a=t.node(0).resolve(t.pos+i.nodeSize);e.call(this,t,a),this.node=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(i,a){var n=a.mapResult(this.anchor),r=n.deleted,o=n.pos,s=i.resolve(o);return r?e.near(s):new t(s)},t.prototype.content=function(){return new Ib(xb.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new ly(this.anchor)},t.fromJSON=function(e,i){if("number"!=typeof i.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(i.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(iy);sy.prototype.visible=!1,iy.jsonID("node",sy);var ly=function(e){this.anchor=e};ly.prototype.map=function(e){var t=e.mapResult(this.anchor),i=t.deleted,a=t.pos;return i?new oy(a,a):new ly(a)},ly.prototype.resolve=function(e){var t=e.resolve(this.anchor),i=t.nodeAfter;return i&&sy.isSelectable(i)?new sy(t):iy.near(t)};var uy=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,i){if(void 0===i&&(i=Ib.empty),i==Ib.empty){t.delete(0,t.doc.content.size);var a=e.atStart(t.doc);a.eq(t.selection)||t.setSelection(a)}else e.prototype.replace.call(this,t,i)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return _y},t}(iy);iy.jsonID("all",uy);var _y={map:function(){return this},resolve:function(e){return new uy(e)}};function dy(e,t,i,a,n,r){if(t.inlineContent)return ry.create(e,i);for(var o=a-(n>0?0:1);n>0?o<t.childCount:o>=0;o+=n){var s=t.child(o);if(s.isAtom){if(!r&&sy.isSelectable(s))return sy.create(e,i-(n<0?s.nodeSize:0))}else{var l=dy(e,s,i+n,n<0?s.childCount:0,n,r);if(l)return l}i+=s.nodeSize*n}}function cy(e,t,i){var a=e.steps.length-1;if(!(a<t)){var n,r=e.steps[a];if(r instanceof jE||r instanceof qE)e.mapping.maps[a].forEach((function(e,t,i,a){null==n&&(n=a)})),e.setSelection(iy.near(e.doc.resolve(n),i))}}var gy=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return i.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},i.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return Rb.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},i.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,i){e.prototype.addStep.call(this,t,i),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var i=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Rb.none))),i.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,i){void 0===i&&(i=t);var a=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(a.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,i);var n=this.storedMarks;if(!n){var r=this.doc.resolve(t);n=i==t?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,a.text(e,n)),this.selection.empty||this.setSelection(iy.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},i.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},i.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,i),t}(RE);function fy(e,t){return t&&e?e.bind(t):e}var hy=function(e,t,i){this.name=e,this.init=fy(t.init,i),this.apply=fy(t.apply,i)},py=[new hy("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new hy("selection",{init:function(e,t){return e.selection||iy.atStart(t.doc)},apply:function(e){return e.selection}}),new hy("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,i,a){return a.selection.$cursor?e.storedMarks:null}}),new hy("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],my=function(e,t){var i=this;this.schema=e,this.fields=py.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(i.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");i.plugins.push(e),i.pluginsByKey[e.key]=e,e.spec.state&&i.fields.push(new hy(e.key,e.spec.state,e))}))},Fy=function(e){this.config=e},by={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};by.schema.get=function(){return this.config.schema},by.plugins.get=function(){return this.config.plugins},Fy.prototype.apply=function(e){return this.applyTransaction(e).state},Fy.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var i=0;i<this.config.plugins.length;i++)if(i!=t){var a=this.config.plugins[i];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,e,this))return!1}return!0},Fy.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],i=this.applyInner(e),a=null;;){for(var n=!1,r=0;r<this.config.plugins.length;r++){var o=this.config.plugins[r];if(o.spec.appendTransaction){var s=a?a[r].n:0,l=a?a[r].state:this,u=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,l,i);if(u&&i.filterTransaction(u,r)){if(u.setMeta("appendedTransaction",e),!a){a=[];for(var _=0;_<this.config.plugins.length;_++)a.push(_<r?{state:i,n:t.length}:{state:this,n:0})}t.push(u),i=i.applyInner(u),n=!0}a&&(a[r]={state:i,n:t.length})}}if(!n)return{state:i,transactions:t}}},Fy.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new Fy(this.config),i=this.config.fields,a=0;a<i.length;a++){var n=i[a];t[n.name]=n.apply(e,this[n.name],this,t)}for(var r=0;r<Ey.length;r++)Ey[r](this,e,t);return t},by.tr.get=function(){return new gy(this)},Fy.create=function(e){for(var t=new my(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Fy(t),a=0;a<t.fields.length;a++)i[t.fields[a].name]=t.fields[a].init(e,i);return i},Fy.prototype.reconfigure=function(e){for(var t=new my(this.schema,e.plugins),i=t.fields,a=new Fy(t),n=0;n<i.length;n++){var r=i[n].name;a[r]=this.hasOwnProperty(r)?this[r]:i[n].init(e,a)}return a},Fy.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var i in e){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var a=e[i],n=a.spec.state;n&&n.toJSON&&(t[i]=n.toJSON.call(a,this[a.key]))}return t},Fy.fromJSON=function(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var a=new my(e.schema,e.plugins),n=new Fy(a);return a.fields.forEach((function(a){if("doc"==a.name)n.doc=Xb.fromJSON(e.schema,t.doc);else if("selection"==a.name)n.selection=iy.fromJSON(n.doc,t.selection);else if("storedMarks"==a.name)t.storedMarks&&(n.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(var r in i){var o=i[r],s=o.spec.state;if(o.key==a.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(n[a.name]=s.fromJSON.call(o,e,t[r],n))}n[a.name]=a.init(e,n)}})),n},Fy.addApplyListener=function(e){Ey.push(e)},Fy.removeApplyListener=function(e){var t=Ey.indexOf(e);t>-1&&Ey.splice(t,1)},Object.defineProperties(Fy.prototype,by);var Ey=[];var yy=function(e){this.props={},e.props&&function e(t,i,a){for(var n in t){var r=t[n];r instanceof Function?r=r.bind(i):"handleDOMEvents"==n&&(r=e(r,i,{})),a[n]=r}return a}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:vy("plugin")};yy.prototype.getState=function(e){return e[this.key]};var Dy=Object.create(null);function vy(e){return e in Dy?e+"$"+ ++Dy[e]:(Dy[e]=0,e+"$")}var ky=function(e){void 0===e&&(e="key"),this.key=vy(e)};ky.prototype.get=function(e){return e.config.pluginsByKey[this.key]},ky.prototype.getState=function(e){return e[this.key]};const Sy=mr.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter(e=>""!==e).length}},addProseMirrorPlugins(){return[new yy({key:new ky("characterCount"),filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||0===i||null==i)return!0;const a=this.storage.characters({node:t.doc}),n=this.storage.characters({node:e.doc});if(n<=i)return!0;if(a>i&&n>i&&n<=a)return!0;if(a>i&&n>i&&n>a)return!1;if(!e.getMeta("paste"))return!1;const r=e.selection.$head.pos,o=r-(n-i),s=r;e.deleteRange(o,s);return!(this.storage.characters({node:e.doc})>i)}})]}});var wy=i(52);const Cy=gs.create({name:"link",priority:1e3,inclusive:!1,addOptions:()=>({openOnClick:!0,linkOnPaste:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"}}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target}}},parseHTML:()=>[{tag:"a[href]"}],renderHTML({HTMLAttributes:e}){return["a",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setLink:e=>({commands:t})=>t.setMark("link",e),toggleLink:e=>({commands:t})=>t.toggleMark("link",e,{extendEmptyMarkRange:!0}),unsetLink:()=>({commands:e})=>e.unsetMark("link",{extendEmptyMarkRange:!0})}),addPasteRules(){return[Es({find:e=>Object(wy.find)(e).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.openOnClick&&e.push(new Rt({key:new Bt("handleClickLink"),props:{handleClick:(e,t,i)=>{var a;const n=this.editor.getAttributes("link");return!(!(null===(a=i.target)||void 0===a?void 0:a.closest("a"))||!n.href)&&(window.open(n.href,n.target),!0)}}})),this.options.linkOnPaste&&e.push(new Rt({key:new Bt("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{state:a}=e,{selection:n}=a,{empty:r}=n;if(r)return!1;let o="";i.content.forEach(e=>{o+=e.textContent});const s=Object(wy.find)(o).find(e=>e.isLink&&e.value===o);return!(!o||!s)&&(this.editor.commands.setMark(this.type,{href:s.href}),!0)}}})),e}}),xy=gs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",ns(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const i=po(e,this.type);return!!Object.entries(i).some(([,e])=>!!e)||t.unsetMark("textStyle")}}}}),Ty=mr.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color.replace(/['"]+/g,""),renderHTML:e=>e.color?{style:"color: "+e.color}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});var Oy=cs.create({name:"doc",topNode:!0,content:"block+"}).extend({content:"root",addProseMirrorPlugins:function(){var e=this.editor;return[new Rt({key:new Bt("eventHandler"),props:{handleClick:function(t,i){var a=t.state,n=a.doc.lastChild,r=a.doc.resolve(i).nodeBefore;if(n&&r){var o=n.eq(r),s=n.isInline,l=["paragraph","text"].includes(n.type.name);!o||s||l||e.commands.insertContentAt(i,{type:"paragraph",content:""})}}}})]}}),Ny=yF.extend({name:"title",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return[{tag:"h1"}]},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["h1",ns(this.options.HTMLAttributes,t),0]}});const Ay=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/,Ry=cs.create({name:"image",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:e}){return["img",ns(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[fs({find:Ay,type:this.type,getAttributes:e=>{const[,,t,i,a]=e;return{src:i,alt:t,title:a}}})]}});function My(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Iy(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?My(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):My(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var By=Ry.extend({name:"image",addAttributes:function(){return Iy(Iy({},Ry.config.addAttributes()),{},{size:{default:"small",rendered:!1},float:{default:"none",rendered:!1}})},addCommands:function(){var e=this;return{setImage:function(t){return function(i){var a,n,r,o=i.tr,s=i.commands;return"image"==(null===(a=o.selection)||void 0===a||null===(n=a.node)||void 0===n||null===(r=n.type)||void 0===r?void 0:r.name)?s.updateAttributes("image",t):s.insertContent({type:e.name,attrs:t})}}}},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return i.class=" image-"+t.attrs.size,i.class+=" image-float-"+t.attrs.float,["img",ns(this.options.HTMLAttributes,i)]}});const Ly=gs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",ns(this.options.HTMLAttributes,e),0]},addCommands:()=>({setUnderline:()=>({commands:e})=>e.setMark("underline"),toggleUnderline:()=>({commands:e})=>e.toggleMark("underline"),unsetUnderline:()=>({commands:e})=>e.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});const Py=new Bt("suggestion");function jy({pluginKey:e=Py,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const _=null===(a=this.key)||void 0===a?void 0:a.getState(i),d=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}var qy=function(e){var t=e.wrapperRef,i=e.index;if(t.current&&!(i>=t.current.children.length)){var a=t.current,n=a.children[i],r=n.clientHeight+8,o=a.scrollTop;n.offsetTop+r>o+a.clientHeight?o=n.offsetTop-a.clientHeight+r:o>n.offsetTop&&(o=n.offsetTop-8),t.current.scrollTop=o}};function Uy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var zy=function(e){Nf()(i,e);var t=Uy(i);function i(e){var a;return Sf()(this,i),a=t.call(this,e),d()(Tf()(a),"onKeyDown",(function(e){var t=e.event;return"ArrowUp"===t.key?(a.upHandler(),!0):"ArrowDown"===t.key?(a.downHandler(),!0):"Enter"===t.key&&(a.enterHandler(),!0)})),d()(Tf()(a),"upHandler",(function(){a.setState({selectedIndex:(a.state.selectedIndex+a.props.items.length-1)%a.props.items.length})})),d()(Tf()(a),"downHandler",(function(){a.setState({selectedIndex:(a.state.selectedIndex+1)%a.props.items.length})})),d()(Tf()(a),"enterHandler",(function(){a.selectItem(a.state.selectedIndex)})),d()(Tf()(a),"selectItem",(function(e){var t=a.props.items[e];if(t&&ac(t.items)){var i=a.props,n=i.editor,r=i.range;t.command({editor:n,range:r})}})),a.state={selectedIndex:0},a.menuRef=m.a.createRef(),a}return Cf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),qy({wrapperRef:this.menuRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.props.items;return m.a.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},t.map((function(t,a){var n=ac(t.items),r=m.a.createElement(Gy,{key:t.title,item:t,index:a,selectedIndex:e.state.selectedIndex,selectItem:function(){return e.selectItem(a)}});return n?r:m.a.createElement(wd,{key:t.title,interactive:!0,placement:"right",hideOnClick:!1,content:m.a.createElement(i,u()({},e.props,{items:t.items})),onCreate:function(e){return e.popper.style.width="max-content"}},r)})))}}]),i}(m.a.Component),Gy=Object(p.forwardRef)((function(e,t){var i=e.item,a=e.selectedIndex,n=e.index,r=e.selectItem,o=i.Icon;return m.a.createElement("div",{className:b()("neeto-editor-slash-commands__item",{active:n===a}),onClick:function(){return r(n)},ref:t,"data-cy":"neeto-editor-command-list-item-".concat(n)},o&&m.a.createElement(o,{size:20}),m.a.createElement("div",{className:"neeto-editor-slash-commands__item-content"},m.a.createElement("h5",null,i.title),m.a.createElement("p",null,i.description)))})),Hy=zy,Yy=["size","color","strokeWidth"];function Vy(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Yy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M13 4.5H20M13 9.5H20M4 14.5H20M4 19.5H20M9 9.5L6.5 4.5L4 9.5M4.5 8.5H6.5H8.5",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Vy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Vy.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Wy=["size","color","strokeWidth"];function $y(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Wy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M5 6V18M13 6V18M5 12H13M18.5 18V13L17.25 14.25M20 18H17",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}$y.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},$y.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Ky=["size","color","strokeWidth"];function Qy(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Ky);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M17 14C17 13.7348 17.1054 13.4804 17.2929 13.2929C17.4804 13.1054 17.7348 13 18 13H18.6145C18.8723 13 19.1237 13.0811 19.3329 13.2319C19.542 13.3827 19.6985 13.5955 19.78 13.8401C19.8471 14.0414 19.8609 14.2566 19.8202 14.4648C19.7794 14.673 19.6854 14.8671 19.5473 15.0281L17 18H20M5 6V18M13 6V18M5 12H13",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Qy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Qy.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Zy=["size","color","strokeWidth"];function Xy(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Zy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M20.667 20.125H3.33301M20.667 14.708H3.33301M20.667 9.292H16.334M20.667 3.875H16.334M9.29201 6.042H12C12.299 6.042 12.542 6.285 12.542 6.584V8.75C12.542 9.049 12.299 9.292 12 9.292H9.83301C9.53401 9.292 9.29101 9.049 9.29101 8.75L9.29201 6.042ZM9.29201 6.042C9.29201 3.875 9.69801 3.515 10.917 2.792M3.33301 6.042H6.04101C6.34001 6.042 6.58301 6.285 6.58301 6.584V8.75C6.58301 9.049 6.34001 9.292 6.04101 9.292H3.87501C3.57601 9.292 3.33301 9.049 3.33301 8.75V6.042ZM3.33301 6.042C3.33301 3.875 3.73901 3.515 4.95801 2.792",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}Xy.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},Xy.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var Jy=["size","color","strokeWidth"];function eD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,Jy);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M17 12H7",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}eD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},eD.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var tD=["size","color","strokeWidth"];function iD(e){var t=e.size,i=e.color,a=e.strokeWidth,n=qu(e,tD);return v_.createElement("svg",ju({viewBox:"0 0 24 24",fill:"none",height:t,width:t},n),v_.createElement("path",{d:"M15.375 13.097L19.17 16.151C19.906 16.744 21 16.22 21 15.275V8.725C21 7.78 19.906 7.256 19.17 7.849L15.375 10.903M13.125 17.75H5.25C4.007 17.75 3 16.743 3 15.5V8.5C3 7.257 4.007 6.25 5.25 6.25H13.125C14.368 6.25 15.375 7.257 15.375 8.5V15.5C15.375 16.743 14.368 17.75 13.125 17.75Z",stroke:i,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round"}))}iD.defaultProps={color:"currentColor",size:24,strokeWidth:"1.5"},iD.propTypes={color:Z_.string,size:Z_.oneOfType([Z_.string,Z_.number]),strokeWidth:Z_.oneOfType([Z_.string,Z_.number])};var aD={PARAGRAPH:{optionName:rm.FONT_SIZE,title:"Paragraph",description:"Add a plain text block.",Icon:Vy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("paragraph").run()}},H1:{optionName:rm.FONT_SIZE,title:"H1",description:"Add a big heading.",Icon:$y,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:1}).run()}},H2:{optionName:rm.FONT_SIZE,title:"H2",description:"Add a sub-heading.",Icon:Qy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setNode("heading",{level:2}).run()}},LIST_ORDERED:{optionName:rm.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:Jc,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleOrderedList().run()}},LIST_BULLETS:{optionName:rm.LIST_BULLETS,title:"Bulleted list",description:"Add an list bullets.",Icon:Zc,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBulletList().run()}},BLOCKQUOTE:{optionName:rm.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:Xy,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleBlockquote().run()}},IMAGE:{optionName:rm.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:Kc,command:function(e){var t=e.editor,i=e.range;return t.chain().focus().deleteRange(i).run()}},CODE:{optionName:rm.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:ud,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).toggleCodeBlock().run()}},EMOJI:{optionName:rm.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:vf,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("::").run()}},DIVIDER:{optionName:rm.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:eD,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).setHorizontalRule().run()}},VIDEO:{optionName:rm.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:iD,command:function(e){var t,i=e.editor,a=e.range,n=prompt("Please enter Youtube/Vimeo embed URL."),r=(t=n.match(Uc))&&"https://www.youtube.com/embed/".concat(t[5])||function(e){var t=e.match(zc);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])}(n);r?i.chain().focus().deleteRange(a).setExternalVideo({src:r}).run():i.chain().focus().deleteRange(a).insertContent("#invalid").run()}},MENTION:{optionName:rm.MENTION,title:"Mention",description:"Mention a user.",Icon:of,command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).insertContent("@").run()}},NO_RESULT:{title:"No results",command:function(e){var t=e.editor,i=e.range;t.chain().focus().deleteRange(i).run()}}};function nD(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function rD(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?nD(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):nD(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var oD=new Bt("commands"),sD=function(e){var t=e.setImageUploadVisible,i=e.mentions,a=e.addonCommands,n=e.options,r=[aD.PARAGRAPH,aD.H1,aD.H2,aD.LIST_ORDERED,aD.LIST_BULLETS,aD.BLOCKQUOTE,rD(rD({},aD.IMAGE),{},{command:function(){var e;t(!0),(e=aD.IMAGE).command.apply(e,arguments)}}),aD.CODE,aD.EMOJI,aD.DIVIDER,aD.VIDEO];return ac(i)||r.push(aD.MENTION),ac(n)||(r=r.filter((function(e){var t=e.optionName;return n.includes(t)}))),ac(a)||(r=r.concat(a)),mr.create({addOptions:function(){return{HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:oD,command:function(e){var t=e.editor,i=e.range;e.props.command({editor:t,range:i})},items:function(e){var t=e.query,i=r.filter((function(e){return e.title.toLowerCase().includes(t.toLowerCase())}));return ac(i)?[aD.NO_RESULT]:i},render:function(){var e,t;return{onStart:function(i){e=new Tu(Hy,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t&&t[0].destroy(),e&&e.destroy()}}}}}},addProseMirrorPlugins:function(){return[jy(rD({editor:this.editor},this.options.suggestion))]}})},lD={};function uD(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var i=e[t];"object"!=typeof i||Object.isFrozen(i)||uD(i)})),e}var _D=uD,dD=uD;_D.default=dD;class cD{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function gD(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function fD(e,...t){const i=Object.create(null);for(const t in e)i[t]=e[t];return t.forEach((function(e){for(const t in e)i[t]=e[t]})),i}const hD=e=>!!e.kind;class pD{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=gD(e)}openNode(e){if(!hD(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){hD(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class mD{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{mD._collapse(e)}))}}class FD extends mD{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new pD(this,this.options).value()}finalize(){return!0}}function bD(e){return e?"string"==typeof e?e:e.source:null}const ED=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const yD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",DD={begin:"\\\\[\\s\\S]",relevance:0},vD={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[DD]},kD={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[DD]},SD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},wD=function(e,t,i={}){const a=fD({className:"comment",begin:e,end:t,contains:[]},i);return a.contains.push(SD),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},CD=wD("//","$"),xD=wD("/\\*","\\*/"),TD=wD("#","$"),OD={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},ND={className:"number",begin:yD,relevance:0},AD={className:"number",begin:"\\b(0b[01]+)",relevance:0},RD={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},MD={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[DD,{begin:/\[/,end:/\]/,relevance:0,contains:[DD]}]}]},ID={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},BD={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},LD={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var PD=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:yD,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>bD(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),fD({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:DD,APOS_STRING_MODE:vD,QUOTE_STRING_MODE:kD,PHRASAL_WORDS_MODE:SD,COMMENT:wD,C_LINE_COMMENT_MODE:CD,C_BLOCK_COMMENT_MODE:xD,HASH_COMMENT_MODE:TD,NUMBER_MODE:OD,C_NUMBER_MODE:ND,BINARY_NUMBER_MODE:AD,CSS_NUMBER_MODE:RD,REGEXP_MODE:MD,TITLE_MODE:ID,UNDERSCORE_TITLE_MODE:BD,METHOD_GUARD:LD,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function jD(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function qD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=jD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function UD(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>bD(e)).join("|")+")"}(...e.illegal))}function zD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function GD(e,t){void 0===e.relevance&&(e.relevance=1)}const HD=["of","and","for","in","not","or","if","then","parent","list","value"];function YD(e,t){return t?Number(t):function(e){return HD.includes(e.toLowerCase())}(e)?0:1}function VD(e,{plugins:t}){function i(t,i){return new RegExp(bD(t),"m"+(e.case_insensitive?"i":"")+(i?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=i(function(e,t="|"){let i=0;return e.map(e=>{i+=1;const t=i;let a=bD(e),n="";for(;a.length>0;){const e=ED.exec(a);if(!e){n+=a;break}n+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?n+="\\"+String(Number(e[1])+t):(n+=e[0],"("===e[0]&&i++)}return n}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex((e,t)=>t>0&&void 0!==e),a=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,a)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new a;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=fD(e.classNameAliases||{}),function t(a,r){const o=a;if(a.isCompiled)return o;[zD].forEach(e=>e(a,r)),e.compilerExtensions.forEach(e=>e(a,r)),a.__beforeBegin=null,[qD,UD,GD].forEach(e=>e(a,r)),a.isCompiled=!0;let s=null;if("object"==typeof a.keywords&&(s=a.keywords.$pattern,delete a.keywords.$pattern),a.keywords&&(a.keywords=function e(t,i,a="keyword"){const n={};return"string"==typeof t?r(a,t.split(" ")):Array.isArray(t)?r(a,t):Object.keys(t).forEach((function(a){Object.assign(n,e(t[a],i,a))})),n;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const i=t.split("|");n[i[0]]=[e,YD(i[0],i[1])]}))}}(a.keywords,e.case_insensitive)),a.lexemes&&s)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return s=s||a.lexemes||/\w+/,o.keywordPatternRe=i(s,!0),r&&(a.begin||(a.begin=/\B|\b/),o.beginRe=i(a.begin),a.endSameAsBegin&&(a.end=a.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(o.endRe=i(a.end)),o.terminatorEnd=bD(a.end)||"",a.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(a.end?"|":"")+r.terminatorEnd)),a.illegal&&(o.illegalRe=i(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return fD(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return fD(e,{starts:e.starts?fD(e.starts):null});if(Object.isFrozen(e))return fD(e);return e}("self"===e?a:e)}))),a.contains.forEach((function(e){t(e,o)})),a.starts&&t(a.starts,r),o.matcher=function(e){const t=new n;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function WD(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,gD(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const $D={"after:highlightElement":({el:e,result:t,text:i})=>{const a=QD(e);if(!a.length)return;const n=document.createElement("div");n.innerHTML=t.value,t.value=function(e,t,i){let a=0,n="";const r=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){n+="<"+KD(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+gD(e.value)+'"'})).join("")+">"}function l(e){n+="</"+KD(e)+">"}function u(e){("start"===e.event?s:l)(e.node)}for(;e.length||t.length;){let t=o();if(n+=gD(i.substring(a,t[0].offset)),a=t[0].offset,t===e){r.reverse().forEach(l);do{u(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===a);r.reverse().forEach(s)}else"start"===t[0].event?r.push(t[0].node):r.pop(),u(t.splice(0,1)[0])}return n+gD(i.substr(a))}(a,QD(n),i)}};function KD(e){return e.nodeName.toLowerCase()}function QD(e){const t=[];return function e(i,a){for(let n=i.firstChild;n;n=n.nextSibling)3===n.nodeType?a+=n.nodeValue.length:1===n.nodeType&&(t.push({event:"start",offset:a,node:n}),a=e(n,a),KD(n).match(/br|hr|img|input/)||t.push({event:"stop",offset:a,node:n}));return a}(e,0),t}const ZD={},XD=e=>{console.error(e)},JD=(e,...t)=>{console.log("WARN: "+e,...t)},ev=(e,t)=>{ZD[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ZD[`${e}/${t}`]=!0)},tv=gD,iv=fD,av=Symbol("nomatch");var nv=function(e){const t=Object.create(null),i=Object.create(null),a=[];let n=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:FD};function u(e){return l.noHighlightRe.test(e)}function _(e,t,i,a){let n="",r="";"object"==typeof t?(n=e,i=t.ignoreIllegals,r=t.language,a=void 0):(ev("10.7.0","highlight(lang, code, ...args) has been deprecated."),ev("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,n=t);const o={code:n,language:r};v("before:highlight",o);const s=o.result?o.result:d(o.language,o.code,i,a);return s.code=o.code,v("after:highlight",s),s}function d(e,i,r,s){function u(e,t){const i=b.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,i)&&e.keywords[i]}function _(){null!=v.subLanguage?function(){if(""===w)return;let e=null;if("string"==typeof v.subLanguage){if(!t[v.subLanguage])return void S.addText(w);e=d(v.subLanguage,w,!0,k[v.subLanguage]),k[v.subLanguage]=e.top}else e=c(w,v.subLanguage.length?v.subLanguage:null);v.relevance>0&&(C+=e.relevance),S.addSublanguage(e.emitter,e.language)}():function(){if(!v.keywords)return void S.addText(w);let e=0;v.keywordPatternRe.lastIndex=0;let t=v.keywordPatternRe.exec(w),i="";for(;t;){i+=w.substring(e,t.index);const a=u(v,t);if(a){const[e,n]=a;if(S.addText(i),i="",C+=n,e.startsWith("_"))i+=t[0];else{const i=b.classNameAliases[e]||e;S.addKeyword(t[0],i)}}else i+=t[0];e=v.keywordPatternRe.lastIndex,t=v.keywordPatternRe.exec(w)}i+=w.substr(e),S.addText(i)}(),w=""}function g(e){return e.className&&S.openNode(b.classNameAliases[e.className]||e.className),v=Object.create(e,{parent:{value:v}}),v}function f(e){return 0===v.matcher.regexIndex?(w+=e[0],1):(O=!0,0)}function h(e){const t=e[0],i=e.rule,a=new cD(i),n=[i.__beforeBegin,i["on:begin"]];for(const i of n)if(i&&(i(e,a),a.isMatchIgnored))return f(t);return i&&i.endSameAsBegin&&(i.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),i.skip?w+=t:(i.excludeBegin&&(w+=t),_(),i.returnBegin||i.excludeBegin||(w=t)),g(i),i.returnBegin?0:t.length}function p(e){const t=e[0],a=i.substr(e.index),n=function e(t,i,a){let n=function(e,t){const i=e&&e.exec(t);return i&&0===i.index}(t.endRe,a);if(n){if(t["on:end"]){const e=new cD(t);t["on:end"](i,e),e.isMatchIgnored&&(n=!1)}if(n){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,a)}(v,e,a);if(!n)return av;const r=v;r.skip?w+=t:(r.returnEnd||r.excludeEnd||(w+=t),_(),r.excludeEnd&&(w=t));do{v.className&&S.closeNode(),v.skip||v.subLanguage||(C+=v.relevance),v=v.parent}while(v!==n.parent);return n.starts&&(n.endSameAsBegin&&(n.starts.endRe=n.endRe),g(n.starts)),r.returnEnd?0:t.length}let m={};function F(t,a){const o=a&&a[0];if(w+=t,null==o)return _(),0;if("begin"===m.type&&"end"===a.type&&m.index===a.index&&""===o){if(w+=i.slice(a.index,a.index+1),!n){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=m.rule,t}return 1}if(m=a,"begin"===a.type)return h(a);if("illegal"===a.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(v.className||"<unnamed>")+'"');throw e.mode=v,e}if("end"===a.type){const e=p(a);if(e!==av)return e}if("illegal"===a.type&&""===o)return 1;if(T>1e5&&T>3*a.index){throw new Error("potential infinite loop, way more iterations than matches")}return w+=o,o.length}const b=E(e);if(!b)throw XD(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const y=VD(b,{plugins:a});let D="",v=s||y;const k={},S=new l.__emitter(l);!function(){const e=[];for(let t=v;t!==b;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>S.openNode(e))}();let w="",C=0,x=0,T=0,O=!1;try{for(v.matcher.considerAll();;){T++,O?O=!1:v.matcher.considerAll(),v.matcher.lastIndex=x;const e=v.matcher.exec(i);if(!e)break;const t=F(i.substring(x,e.index),e);x=e.index+t}return F(i.substr(x)),S.closeAllNodes(),S.finalize(),D=S.toHTML(),{relevance:Math.floor(C),value:D,language:e,illegal:!1,emitter:S,top:v}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(x-100,x+100),mode:t.mode},sofar:D,relevance:0,value:tv(i),emitter:S};if(n)return{illegal:!1,relevance:0,value:tv(i),emitter:S,language:e,top:v,errorRaised:t};throw t}}function c(e,i){i=i||l.languages||Object.keys(t);const a=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:tv(e),illegal:!1,top:s};return t.emitter.addText(e),t}(e),n=i.filter(E).filter(D).map(t=>d(t,e,!1));n.unshift(a);const r=n.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;if(E(t.language).supersetOf===e.language)return-1}return 0}),[o,u]=r,_=o;return _.second_best=u,_}const g={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},f=/^(<[^>]+>|\t)+/gm,h={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(f,e=>e.replace(/\t/g,l.tabReplace)))}};function p(e){let t=null;const a=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=l.languageDetectRe.exec(t);if(i){const t=E(i[1]);return t||(JD(o.replace("{}",i[1])),JD("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||E(e))}(e);if(u(a))return;v("before:highlightElement",{el:e,language:a}),t=e;const n=t.textContent,r=a?_(n,{language:a,ignoreIllegals:!0}):c(n);v("after:highlightElement",{el:e,result:r,text:n}),e.innerHTML=r.value,function(e,t,a){const n=t?i[t]:a;e.classList.add("hljs"),n&&e.classList.add(n)}(e,a,r.language),e.result={language:r.language,re:r.relevance,relavance:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance,relavance:r.second_best.relevance})}const m=()=>{if(m.called)return;m.called=!0,ev("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(p)};let F=!1;function b(){if("loading"===document.readyState)return void(F=!0);document.querySelectorAll("pre code").forEach(p)}function E(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function y(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function D(e){const t=E(e);return t&&!t.disableAutodetect}function v(e,t){const i=e;a.forEach((function(e){e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){F&&b()}),!1),Object.assign(e,{highlight:_,highlightAuto:c,highlightAll:b,fixMarkup:function(e){return ev("10.2.0","fixMarkup will be removed entirely in v11.0"),ev("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(r,e=>"\n"===e?l.useBR?"<br>":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:p,highlightBlock:function(e){return ev("10.7.0","highlightBlock will be removed entirely in v12.0"),ev("10.7.0","Please use highlightElement now."),p(e)},configure:function(e){e.useBR&&(ev("10.3.0","'useBR' will be removed entirely in v11.0"),ev("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=iv(l,e)},initHighlighting:m,initHighlightingOnLoad:function(){ev("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),F=!0},registerLanguage:function(i,a){let r=null;try{r=a(e)}catch(e){if(XD("Language definition for '{}' could not be registered.".replace("{}",i)),!n)throw e;XD(e),r=s}r.name||(r.name=i),t[i]=r,r.rawDefinition=a.bind(null,e),r.aliases&&y(r.aliases,{languageName:i})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:y,requireLanguage:function(e){ev("10.4.0","requireLanguage will be removed entirely in v11."),ev("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=E(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:D,inherit:iv,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),a.push(e)},vuePlugin:WD(e).VuePlugin}),e.debugMode=function(){n=!1},e.safeMode=function(){n=!0},e.versionString="10.7.3";for(const e in PD)"object"==typeof PD[e]&&_D(PD[e]);return Object.assign(e,PD),e.addPlugin(g),e.addPlugin($D),e.addPlugin(h),e}({}),rv={exports:{}};!function(e){!function(){var t;function i(e){for(var t,i,a,n,r=1,o=[].slice.call(arguments),s=0,l=e.length,u="",_=!1,d=!1,c=function(){return o[r++]},g=function(){for(var i="";/\d/.test(e[s]);)i+=e[s++],t=e[s];return i.length>0?parseInt(i):null};s<l;++s)if(t=e[s],_)switch(_=!1,"."==t?(d=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(d=!0,t=e[s+=2]):d=!0,n=g(),t){case"b":u+=parseInt(c(),10).toString(2);break;case"c":u+="string"==typeof(i=c())||i instanceof String?i:String.fromCharCode(parseInt(i,10));break;case"d":u+=parseInt(c(),10);break;case"f":a=String(parseFloat(c()).toFixed(n||6)),u+=d?a:a.replace(/^0/,"");break;case"j":u+=JSON.stringify(c());break;case"o":u+="0"+parseInt(c(),10).toString(8);break;case"s":u+=c();break;case"x":u+="0x"+parseInt(c(),10).toString(16);break;case"X":u+="0x"+parseInt(c(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?_=!0:u+=t;return u}(t=e.exports=i).format=i,t.vsprintf=function(e,t){return i.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(i.apply(null,arguments))})}()}(rv);var ov=rv.exports,sv=uv(Error),lv=sv;function uv(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=ov.apply(null,arguments)),new e(t)}}sv.eval=uv(EvalError),sv.range=uv(RangeError),sv.reference=uv(ReferenceError),sv.syntax=uv(SyntaxError),sv.type=uv(TypeError),sv.uri=uv(URIError),sv.create=uv;var _v=nv,dv=lv;lD.highlight=cv,lD.highlightAuto=function(e,t){var i=t||{},a=i.subset||_v.listLanguages();i.prefix;var n,r,o,s,l=a.length,u=-1;if("string"!=typeof e)throw dv("Expected `string` for value, got `%s`",e);r={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++u<l;)s=a[u],_v.getLanguage(s)&&((o=cv(s,e,t)).language=s,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o));r.language&&(n.secondBest=r);return n},lD.registerLanguage=function(e,t){_v.registerLanguage(e,t)},lD.listLanguages=function(){return _v.listLanguages()},lD.registerAlias=function(e,t){var i,a=e;t&&((a={})[e]=t);for(i in a)_v.registerAliases(a[i],{languageName:i})},gv.prototype.addText=function(e){var t,i,a=this.stack;if(""===e)return;t=a[a.length-1],(i=t.children[t.children.length-1])&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})},gv.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},gv.prototype.addSublanguage=function(e,t){var i=this.stack,a=i[i.length-1],n=e.rootNode.children,r=t?{type:"element",tagName:"span",properties:{className:[t]},children:n}:n;a.children=a.children.concat(r)},gv.prototype.openNode=function(e){var t=this.stack,i=this.options.classPrefix+e,a=t[t.length-1],n={type:"element",tagName:"span",properties:{className:[i]},children:[]};a.children.push(n),t.push(n)},gv.prototype.closeNode=function(){this.stack.pop()},gv.prototype.closeAllNodes=fv,gv.prototype.finalize=fv,gv.prototype.toHTML=function(){return""};function cv(e,t,i){var a,n=_v.configure({}),r=(i||{}).prefix;if("string"!=typeof e)throw dv("Expected `string` for name, got `%s`",e);if(!_v.getLanguage(e))throw dv("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw dv("Expected `string` for value, got `%s`",t);if(null==r&&(r="hljs-"),_v.configure({__emitter:gv,classPrefix:r}),a=_v.highlight(t,{language:e,ignoreIllegals:!0}),_v.configure(n||{}),a.errorRaised)throw a.errorRaised;return{relevance:a.relevance,language:a.language,value:a.emitter.rootNode.children}}function gv(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function fv(){}function hv(e){return e.value||e.children||[]}function pv({doc:e,name:t,lowlight:i}){const a=[];return ys(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1;const{language:n}=e.node.attrs,r=i.listLanguages();(function e(t,i=[]){return t.map(t=>{const a=[...i,...t.properties?t.properties.className:[]];return t.children?e(t.children,a):{text:t.value,classes:a}}).flat()})(n&&r.includes(n)?hv(i.highlight(n,e.node.textContent)):hv(i.highlightAuto(e.node.textContent))).forEach(e=>{const i=t+e.text.length;if(e.classes.length){const n=On.inline(t,i,{class:e.classes.join(" ")});a.push(n)}t=i})}),Mn.create(e,a)}function mv({name:e,lowlight:t}){return new Rt({key:new Bt("lowlight"),state:{init:(i,{doc:a})=>pv({doc:a,name:e,lowlight:t}),apply:(i,a,n,r)=>{const o=n.selection.$head.parent.type.name,s=r.selection.$head.parent.type.name,l=ys(n.doc,t=>t.type.name===e),u=ys(r.doc,t=>t.type.name===e);return i.docChanged&&([o,s].includes(e)||u.length!==l.length||i.steps.some(e=>void 0!==e.from&&void 0!==e.to&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?pv({doc:i.doc,name:e,lowlight:t}):a.map(i.mapping,i.doc)}},props:{decorations(e){return this.getState(e)}}})}const Fv=uF.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:lD}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],mv({name:this.name,lowlight:this.options.lowlight})]}});function bv(){return m.a.createElement(Lu,{"data-cy":"neeto-editor-code-block"},m.a.createElement("pre",null,m.a.createElement(Pu,{as:"code"})))}var Ev=i(94),yv=i.n(Ev),Dv=Fv.extend({addNodeView:function(){return new Ru(bv)}}).configure({lowlight:yv.a}),vv=function(e){var t=e.items,i=e.command;return m.a.createElement("div",{className:"neeto-editor-variables-suggestion"},m.a.createElement(ef,{variables:t,onClickVariable:function(e){var t=e.category_key,a=e.key,n=t?"".concat(t,".").concat(a):a;i({label:n,id:n})}}))};function kv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Sv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?kv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):kv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var wv=new Bt("variables"),Cv=cs.create({name:"variable",addOptions:function(){return{HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel:function(e){var t=e.options,i=e.node;return"".concat(t.charOpen).concat(i.attrs.label||i.attrs.id).concat(t.charClose)},suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:"span[data-variable]"}]},renderHTML:function(e){var t=e.node,i=e.HTMLAttributes;return["span",ns({"data-variable":""},this.options.HTMLAttributes,i),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addCommands:function(){var e=this;return{setVariable:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:t},{type:"text",text:" "}]).run()}}}},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var i=t.tr,a=t.state,n=!1,r=a.selection,o=r.empty,s=r.anchor;return!!o&&(a.doc.nodesBetween(s-1,s,(function(t,a){if(t.type.name===e.name)return n=!0,i.insertText("",a,a+t.nodeSize),!1})),n)}))}}},addProseMirrorPlugins:function(){return[jy(Sv({editor:this.editor},this.options.suggestion))]}}),xv={char:"{{",startOfLine:!1,pluginKey:wv,command:function(e){var t=e.editor,i=e.range,a=e.props;t.chain().focus().deleteRange(i).setVariable(a).run()},items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(vv,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onExit:function(){t[0].destroy(),e.destroy()}}}},Tv=function(e){var t=e.suggestion,i=void 0===t?{}:t;return Cv.configure({suggestion:Sv(Sv({},xv),i)})},Ov=i(24),Nv=i.n(Ov),Av=i(95),Rv=i.n(Av),Mv=function(e){var t=Nv()(e);return"string"===t||"funtion"===t?e:Rv()(e)?function(t){var i=t.node.type.name;return e[i]}:""},Iv=mr.create({name:"placeholder",addOptions:function(){return{excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Rt({props:{decorations:function(t){var i=t.doc,a=t.selection,n=e.editor.isEditable||!e.options.showOnlyWhenEditable,r=a.anchor,o=[];if(n)return i.descendants((function(t,i){var a=r>=i&&r<=i+t.nodeSize,n=!t.isLeaf&&!t.childCount,s=e.options.excludeNodeTypes.includes(t.type.name);if((a||!e.options.showOnlyCurrent)&&!s&&n){var l=[e.options.emptyNodeClass];e.editor.isEmpty&&l.push(e.options.emptyEditorClass);var u=On.node(i,i+t.nodeSize,{class:l.join(" "),"data-placeholder":"function"==typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:i}):e.options.placeholder});o.push(u)}return e.options.includeChildren})),Mn.create(i,o)}}})]}});const Bv=new Bt("suggestion");function Lv({pluginKey:e=Bv,editor:t,char:i="@",allowSpaces:a=!1,prefixSpace:n=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=(()=>null),items:u=(()=>[]),render:_=(()=>({})),allow:d=(()=>!0)}){const c=null==_?void 0:_();return new Rt({key:e,view(){return{update:async(e,i)=>{var a,n,r,o,s;const _=null===(a=this.key)||void 0===a?void 0:a.getState(i),d=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),g=_.active&&d.active&&_.range.from!==d.range.from,f=!_.active&&d.active,h=_.active&&!d.active,p=f||g,m=!f&&!h&&_.query!==d.query&&!g,F=h||g;if(!p&&!m&&!F)return;const b=F&&!p?_:d,E=document.querySelector(`[data-decoration-id="${b.decorationId}"]`),y={editor:t,range:b.range,query:b.query,text:b.text,items:m||p?await u({editor:t,query:b.query}):[],command:e=>{l({editor:t,range:b.range,props:e})},decorationNode:E,clientRect:E?()=>{var e;const{decorationId:i}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state);return document.querySelector(`[data-decoration-id="${i}"]`).getBoundingClientRect()}:null};F&&(null===(r=null==c?void 0:c.onExit)||void 0===r||r.call(c,y)),m&&(null===(o=null==c?void 0:c.onUpdate)||void 0===o||o.call(c,y)),p&&(null===(s=null==c?void 0:c.onStart)||void 0===s||s.call(c,y))}}},state:{init:()=>({active:!1,range:{},query:null,text:null,composing:!1}),apply(e,o){const{composing:s}=t.view,{selection:l}=e,{empty:u,from:_}=l,c={...o};if(c.composing=s,u||t.view.composing){!(_<o.range.from||_>o.range.to)||s||o.composing||(c.active=!1);const e=function(e){const{char:t,allowSpaces:i,prefixSpace:a,startOfLine:n,$position:r}=e,o=t.split("").map(e=>"\\"+e).join(""),s=new RegExp(`\\s${o}$`),l=n?"^":"",u=i?new RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),_=r.depth<=0?0:r.before(),d=r.pos,c=r.doc.textBetween(_,d,"\0","\0"),g=Array.from(c.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;const f=g.input.slice(Math.max(0,g.index-1),g.index),h=/^[\s\0]?$/.test(f);if(a&&!h)return null;const p=g.index+r.start();let m=p+g[0].length;return i&&s.test(c.slice(m-1,m+1))&&(g[0]+=" ",m+=1),p<r.pos&&m>=r.pos?{range:{from:p,to:m},query:g[0].slice(t.length),text:g[0]}:null}({char:i,allowSpaces:a,prefixSpace:n,startOfLine:r,$position:l.$from}),u="id_"+Math.floor(4294967295*Math.random());e&&d({editor:t,range:e.range})?(c.active=!0,c.decorationId=o.decorationId?o.decorationId:u,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range={},c.query=null,c.text=null),c}},props:{handleKeyDown(e,t){var i;const{active:a,range:n}=this.getState(e.state);return a&&(null===(i=null==c?void 0:c.onKeyDown)||void 0===i?void 0:i.call(c,{view:e,event:t,range:n}))||!1},decorations(e){const{active:t,range:i,decorationId:a}=this.getState(e);return t?Mn.create(e.doc,[On.inline(i.from,i.to,{nodeName:o,class:s,"data-decoration-id":a})]):null}}})}const Pv=new Bt("mention"),jv=cs.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var i;return`${e.suggestion.char}${null!==(i=t.attrs.label)&&void 0!==i?i:t.attrs.id}`},suggestion:{char:"@",pluginKey:Pv,command:({editor:e,range:t,props:i})=>{var a;const n=e.view.state.selection.$to.nodeAfter;(null===(a=null==n?void 0:n.text)||void 0===a?void 0:a.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:i},{type:"text",text:" "}]).run()},allow:({editor:e,range:t})=>{const i=e.state.doc.resolve(t.from),a=e.schema.nodes[this.name];return!!i.parent.type.contentMatch.matchType(a)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-mention]"}],renderHTML({node:e,HTMLAttributes:t}){return["span",ns({"data-mention":""},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let i=!1;const{selection:a}=t,{empty:n,anchor:r}=a;return!!n&&(t.doc.nodesBetween(r-1,r,(t,a)=>{if(t.type.name===this.name)return i=!0,e.insertText(this.options.suggestion.char||"",a,a+t.nodeSize),!1}),i)})}},addProseMirrorPlugins(){return[Lv({editor:this.editor,...this.options.suggestion})]}});function qv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var Uv=function(e){Nf()(i,e);var t=qv(i);function i(e){var a;return Sf()(this,i),a=t.call(this,e),d()(Tf()(a),"selectItem",(function(e){var t=a.props,i=t.items,n=t.command,r=i[e];r&&n({label:r.label,id:r.key})})),d()(Tf()(a),"upHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+e.length-1)%e.length}}))})),d()(Tf()(a),"downHandler",(function(){var e=a.props.items;a.setState((function(t){return{selectedIndex:(t.selectedIndex+1)%e.length}}))})),d()(Tf()(a),"enterHandler",(function(){var e=a.state.selectedIndex;a.selectItem(e)})),d()(Tf()(a),"onKeyDown",(function(e){var t=e.event,i={ArrowUp:a.upHandler,ArrowDown:a.downHandler,Enter:a.enterHandler};return!!i.hasOwnProperty(t.key)&&(i[t.key](),!0)})),a.state={selectedIndex:0},a.mentionRef=m.a.createRef(),a}return Cf()(i,[{key:"componentDidUpdate",value:function(e){this.props.items!==e.items&&this.setState({selectedIndex:0}),qy({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}},{key:"render",value:function(){var e=this,t=this.state.selectedIndex,i=this.props.items;return 0===i.length?m.a.createElement("div",{className:"neeto-editor-mentions__wrapper"},m.a.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):m.a.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},i.map((function(i,a){var n=i.label,r=i.imageUrl,o=i.showImage;return m.a.createElement("button",{className:b()("neeto-editor-mentions__item",{active:a===t}),key:n,onClick:function(){return e.selectItem(a)},type:"button","data-cy":"neeto-editor-mention-list-".concat(n)},o&&m.a.createElement(df,{user:{name:n,imageUrl:r}}),m.a.createElement("p",null,n))})))}}]),i}(m.a.Component);function zv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Gv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?zv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):zv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Hv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.showImage,a=void 0!==i&&i,n=e.map((function(e){var t;return"string"==typeof e?t={key:e,label:e}:"object"===Nv()(e)&&(t=Gv({},e)),t.showImage=a,t}));return function(e){var t=e.query;return n.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())}))}},Yv=["suggestion"];function Vv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Wv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Vv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var $v={render:function(){var e,t;return{onStart:function(i){e=new Tu(Uv,{props:i,editor:i.editor}),t=bu("body",{getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(i){var a;return"Escape"===i.event.key?(t[0].hide(),!0):null===(a=e.ref)||void 0===a?void 0:a.onKeyDown(i)},onExit:function(){t[0].destroy(),e.destroy()}}}},Kv=jv.extend({addCommands:function(){var e=this;return{setMention:function(t){return function(i){(0,i.chain)().focus().insertContent([{type:e.name,attrs:{id:t,label:t}},{type:"text",text:" "}]).run()}}}}}),Qv=function(e){var t=e.suggestion,i=void 0===t?{}:t,a=h()(e,Yv);return Kv.configure(Wv(Wv({},a),{},{suggestion:Wv(Wv({},$v),i)}))};function Zv(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function Xv(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Zv(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Zv(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var Jv=cs.create({name:"external-video",addOptions:function(){return{inline:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}},parseHTML:function(){return[{tag:"iframe[src]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["iframe",ns(this.options.HTMLAttributes,Xv(Xv({},t),{},{class:"video-wrapper"}))]},addCommands:function(){var e=this;return{setExternalVideo:function(t){return function(i){return i.commands.insertContent({type:e.name,attrs:t})}}}}});function ek(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,a=If()(e);if(t){var n=If()(this).constructor;i=Reflect.construct(a,arguments,n)}else i=a.apply(this,arguments);return Rf()(this,i)}}var tk=function(e){Nf()(i,e);var t=ek(i);function i(){var e;Sf()(this,i);for(var a=arguments.length,n=new Array(a),r=0;r<a;r++)n[r]=arguments[r];return e=t.call.apply(t,[this].concat(n)),d()(Tf()(e),"state",{selectedIndex:0,emojiSuggestions:ch.search(e.props.query||"smile").slice(0,5)}),d()(Tf()(e),"onKeyDown",(function(t){var i=t.event;if("ArrowLeft"===i.key||"ArrowDown"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+e.state.emojiSuggestions.length-1)%e.state.emojiSuggestions.length}),!0;if("ArrowRight"===i.key||"ArrowUp"===i.key)return e.setState({selectedIndex:(e.state.selectedIndex+1)%e.state.emojiSuggestions.length}),!0;if("Enter"===i.key)return e.selectItem(e.state.selectedIndex),!0;if(" "===i.key){var a;if(ac(e.props.query))e.props.editor.chain().focus().insertContent(" ").run();else e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(null===(a=ch.search(e.props.query))||void 0===a?void 0:a[0]).run();return!0}return"Escape"===i.key&&(e.props.editor.chain().focus().insertContent(" ").run(),!0)})),d()(Tf()(e),"selectItem",(function(t){e.props.editor.chain().focus().deleteRange(e.props.range).setEmoji(e.state.emojiSuggestions[t]).run()})),e}return Cf()(i,[{key:"componentDidUpdate",value:function(e){this.props.query!==e.query&&this.setState({emojiSuggestions:ch.search(this.props.query||"smile").slice(0,5)})}},{key:"render",value:function(){var e=this;return m.a.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map((function(t,i){return m.a.createElement("div",{key:t.id,onClick:function(){return e.selectItem(i)},className:b()("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":i===e.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(t.id)},t.native)})):m.a.createElement("p",null,"No results"))}}]),i}(m.a.Component);function ik(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function ak(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ik(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ik(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var nk=new Bt("emoji-suggestion"),rk=cs.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:":",startOfLine:!1,pluginKey:nk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(tk,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate:function(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addCommands:function(){return{setEmoji:function(e){return function(t){(0,t.chain)().focus().insertContent("".concat((null==e?void 0:e.native)||""," ")).run()}}}},addProseMirrorPlugins:function(){return[jy(ak({editor:this.editor},this.options.suggestion))]}});function ok(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function sk(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ok(Object(i),!0).forEach((function(t){d()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ok(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var lk=new Bt("emoji-picker"),uk=cs.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:function(){return{suggestion:{char:"::",startOfLine:!1,pluginKey:lk,items:function(){return[]},render:function(){var e,t;return{onStart:function(i){e=new Tu(pp,{props:i,editor:i.editor}),t=bu("body",{theme:"light",getReferenceClientRect:i.clientRect,appendTo:function(){return document.body},content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown:function(t){var i;return null===(i=e.ref)||void 0===i?void 0:i.onKeyDown(t)},onExit:function(){t[0].destroy(),e.destroy()}}}}}},addProseMirrorPlugins:function(){return[jy(sk({editor:this.editor},this.options.suggestion))]}}),_k=function(e){return function(e){var t=e.handleSubmit;return mr.create({addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return null==t||t(e.editor.getHTML()),e.editor.commands.blur(),!0}}}})}({handleSubmit:e.handleSubmit})};var dk=function(e){var t,i,a,n,r,o,s=e.editor,l=e.limit,u=e.strategy;if("hidden"===u)return null;var _="limit"===u&&l;return m.a.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},_?"".concat(l-(null==s||null===(t=s.storage)||void 0===t||null===(i=t.characterCount)||void 0===i?void 0:i.characters())," characters remaining"):"".concat(null==s||null===(a=s.storage)||void 0===a||null===(n=a.characterCount)||void 0===n?void 0:n.characters()," characters, ").concat(null==s||null===(r=s.storage)||void 0===r||null===(o=r.characterCount)||void 0===o?void 0:o.words()," words"))},ck=[rm.FONT_COLOR,rm.FONT_SIZE,rm.BOLD,rm.ITALIC,rm.UNDERLINE,rm.STRIKETHROUGH,rm.LINK,rm.LIST_BULLETS,rm.LIST_ORDERED],gk=function(e){var t=e.heightStrategy,i={},a=21*e.rows+26;return"flexible"===t?i["min-height"]=a+"px":i.height=a+"px",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:";";return Object.entries(e).reduce((function(e,i){var a=g()(i,2),n=a[0],r=a[1];return e+"".concat(n,":").concat(r).concat(t)}),"")}(i)},fk=["forceTitle","titleError","hideSlashCommands","addons","addonCommands","markdownMode","className","uploadEndpoint","initialValue","onChange","menuType","variables","mentions","showImageInMention","placeholder","extensions","contentClassName","characterLimit","editorSecrets","rows","autoFocus","onSubmit","heightStrategy","characterCountStrategy"],hk=function(e,t){var i=e.forceTitle,a=void 0!==i&&i,n=e.titleError,r=void 0!==n&&n,o=e.hideSlashCommands,s=void 0!==o&&o,l=e.addons,_=void 0===l?[]:l,c=e.addonCommands,f=e.markdownMode,F=void 0!==f&&f,E=e.className,y=e.uploadEndpoint,D=e.initialValue,v=void 0===D?"":D,k=e.onChange,S=void 0===k?function(){}:k,w=e.menuType,C=void 0===w?"fixed":w,x=e.variables,T=e.mentions,O=e.showImageInMention,N=void 0!==O&&O,A=e.placeholder,R=void 0===A?a?{title:"Untitled"}:null:A,M=e.extensions,I=e.contentClassName,B=e.characterLimit,L=e.editorSecrets,P=e.rows,j=void 0===P?6:P,q=e.autoFocus,U=void 0!==q&&q,z=e.onSubmit,G=e.heightStrategy,H=void 0===G?"fixed":G,Y=e.characterCountStrategy,V=void 0===Y?"hidden":Y,W=h()(e,fk),$=Object(p.useState)(!1),K=g()($,2),Q=K[0],Z=K[1],X="fixed"===C,J="bubble"===C,ee=!s,te=function(e){if(e){if("string"==typeof e&&e.length)return!0;if("object"===Nv()(e)&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1}(R),ie=!te&&ee,ae=_.includes("image-upload-unsplash"),ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=t.includeImageUpload,a=e.map((function(e){return e.toLowerCase()}));return i&&a.push(rm.IMAGE_UPLOAD),[].concat(ck,a)}(_,{includeImageUpload:ae}),re=function(e){var t=e.forceTitle,i=e.placeholder,a=e.extensions,n=e.mentions,r=e.variables,o=e.isSlashCommandsActive,s=e.showImageInMention,l=e.setImageUploadVisible,u=e.options,_=e.addonCommands,d=e.characterLimit,c=e.onSubmit,g=[Ny,Oy.extend({content:t?"title block*":"block+"}),ib.configure({document:!1,codeBlock:!1}),Ly,kb,xy,Cb,Dv,By,cF,Jv,Cy,Ty,Iv.configure({placeholder:Mv(i)}),rk,uk,Sy.configure({limit:d}),_k({handleSubmit:c})];return o&&g.push(sD({setImageUploadVisible:l,options:u,addonCommands:_,mentions:n})),ac(n)||g.push(Qv({suggestion:{items:Hv(n.sort((function(e,t){var i="string"==typeof e?e:e.label,a="string"==typeof t?t:t.label;return i.localeCompare(a)})),{showImage:s})}})),ac(r)||g.push(Tv({suggestion:{items:function(){return r}}})),ac(a)||(g=g.concat(a)),g}({contentClassName:I,forceTitle:a,placeholder:R,extensions:M,mentions:T,variables:x,isSlashCommandsActive:ee,showImageInMention:N,setImageUploadVisible:Z,options:ne,addonCommands:c,characterLimit:B,onSubmit:z}),oe=b()("neeto-editor",d()({"slash-active":ie,"fixed-menu-active border":X,"bubble-menu-active":J,"force-title":a,"force-title--error":r,"placeholder-active":te},E,E)),se=gk({heightStrategy:H,rows:j}),le=xu({extensions:re,content:v,injectCSS:!1,autofocus:U&&"end",editorProps:{attributes:{class:oe,style:se}},onUpdate:function(e){var t=e.editor;return S(t.getHTML())}});return m.a.useImperativeHandle(t,(function(){return{editor:le}})),m.a.createElement("div",{className:"neeto-editor-wrapper"},X&&m.a.createElement(Fp,{editor:le,variables:x,setImageUploadVisible:Z,options:ne,mentions:T,showImageInMention:N}),J&&m.a.createElement(Hc,{editor:le,options:ne}),m.a.createElement(dm,{isVisible:Q,setIsVisible:Z,editor:le,imageUploadUrl:y,isUnsplashImageUploadActive:ae,unsplashApiKey:null==L?void 0:L.unsplash}),F&&m.a.createElement($m,u()({editor:le,strategy:H,style:se,className:oe,onChange:S,onSubmit:z,initialValue:v},W)),m.a.createElement("div",{className:b()({"neeto-editor-content--hidden":F})},m.a.createElement(Bu,u()({editor:le},W))),m.a.createElement(dk,{editor:le,limit:B,strategy:V}))},pk=m.a.forwardRef(hk),mk=i(96),Fk=i.n(mk);var bk=["content","className"],Ek=function(e){var t=e.content,i=void 0===t?"":t,a=e.className,n=h()(e,bk);return Object(p.useEffect)((function(){document.querySelectorAll("div.".concat("neeto-editor-content"," pre code")).forEach((function(e){Fk.a.highlightElement(e)}))}),[i]),m.a.createElement("div",u()({className:b()("neeto-editor-content",d()({},a,a)),dangerouslySetInnerHTML:{__html:gm.a.sanitize(i,{ADD_ATTR:["target"]})},"data-cy":"neeto-editor-content"},n))}}])}));