diff --git a/public/dist/app.js b/public/dist/app.js
index 2efcfc8d1..c77001a2f 100644
--- a/public/dist/app.js
+++ b/public/dist/app.js
@@ -1,14 +1,14 @@
-var rd=Object.create;var zr=Object.defineProperty;var nd=Object.getOwnPropertyDescriptor;var id=Object.getOwnPropertyNames;var od=Object.getPrototypeOf,sd=Object.prototype.hasOwnProperty;var Ni=r=>zr(r,"__esModule",{value:!0});var ad=(r,e)=>()=>(r&&(e=r(r=0)),e);var ie=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ld=(r,e)=>{for(var t in e)zr(r,t,{get:e[t],enumerable:!0})},_i=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of id(e))!sd.call(r,o)&&(t||o!=="default")&&zr(r,o,{get:()=>e[o],enumerable:!(n=nd(e,o))||n.enumerable});return r},jr=(r,e)=>_i(Ni(zr(r!=null?rd(od(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),ud=(r=>(e,t)=>r&&r.get(e)||(t=_i(Ni({}),e,1),r&&r.set(e,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var Xo=ie((pn,Qn)=>{(function(e,t){if(typeof pn=="object"&&typeof Qn=="object")Qn.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var n=t();for(var o in n)(typeof pn=="object"?pn:e)[o]=n[o]}})(self,function(){return function(){var r={3099:function(o){o.exports=function(s){if(typeof s!="function")throw TypeError(String(s)+" is not a function");return s}},6077:function(o,s,i){var a=i(111);o.exports=function(l){if(!a(l)&&l!==null)throw TypeError("Can't set "+String(l)+" as a prototype");return l}},1223:function(o,s,i){var a=i(5112),l=i(30),u=i(3070),c=a("unscopables"),f=Array.prototype;f[c]==null&&u.f(f,c,{configurable:!0,value:l(null)}),o.exports=function(d){f[c][d]=!0}},1530:function(o,s,i){"use strict";var a=i(8710).charAt;o.exports=function(l,u,c){return u+(c?a(l,u).length:1)}},5787:function(o){o.exports=function(s,i,a){if(!(s instanceof i))throw TypeError("Incorrect "+(a?a+" ":"")+"invocation");return s}},9670:function(o,s,i){var a=i(111);o.exports=function(l){if(!a(l))throw TypeError(String(l)+" is not an object");return l}},4019:function(o){o.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},260:function(o,s,i){"use strict";var a=i(4019),l=i(9781),u=i(7854),c=i(111),f=i(6656),d=i(648),h=i(8880),m=i(1320),v=i(3070).f,y=i(9518),w=i(7674),x=i(5112),D=i(9711),I=u.Int8Array,N=I&&I.prototype,S=u.Uint8ClampedArray,M=S&&S.prototype,L=I&&y(I),R=N&&y(N),O=Object.prototype,F=O.isPrototypeOf,_=x("toStringTag"),j=D("TYPED_ARRAY_TAG"),H=a&&!!w&&d(u.opera)!=="Opera",te=!1,W,J={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},re={BigInt64Array:8,BigUint64Array:8},be=function(Se){if(!c(Se))return!1;var ke=d(Se);return ke==="DataView"||f(J,ke)||f(re,ke)},Ae=function(he){if(!c(he))return!1;var Se=d(he);return f(J,Se)||f(re,Se)},xe=function(he){if(Ae(he))return he;throw TypeError("Target is not a typed array")},Fe=function(he){if(w){if(F.call(L,he))return he}else for(var Se in J)if(f(J,W)){var ke=u[Se];if(ke&&(he===ke||F.call(ke,he)))return he}throw TypeError("Target is not a typed array constructor")},Re=function(he,Se,ke){if(!!l){if(ke)for(var Ie in J){var Oe=u[Ie];Oe&&f(Oe.prototype,he)&&delete Oe.prototype[he]}(!R[he]||ke)&&m(R,he,ke?Se:H&&N[he]||Se)}},_e=function(he,Se,ke){var Ie,Oe;if(!!l){if(w){if(ke)for(Ie in J)Oe=u[Ie],Oe&&f(Oe,he)&&delete Oe[he];if(!L[he]||ke)try{return m(L,he,ke?Se:H&&I[he]||Se)}catch{}else return}for(Ie in J)Oe=u[Ie],Oe&&(!Oe[he]||ke)&&m(Oe,he,Se)}};for(W in J)u[W]||(H=!1);if((!H||typeof L!="function"||L===Function.prototype)&&(L=function(){throw TypeError("Incorrect invocation")},H))for(W in J)u[W]&&w(u[W],L);if((!H||!R||R===O)&&(R=L.prototype,H))for(W in J)u[W]&&w(u[W].prototype,R);if(H&&y(M)!==R&&w(M,R),l&&!f(R,_)){te=!0,v(R,_,{get:function(){return c(this)?this[j]:void 0}});for(W in J)u[W]&&h(u[W],j,W)}o.exports={NATIVE_ARRAY_BUFFER_VIEWS:H,TYPED_ARRAY_TAG:te&&j,aTypedArray:xe,aTypedArrayConstructor:Fe,exportTypedArrayMethod:Re,exportTypedArrayStaticMethod:_e,isView:be,isTypedArray:Ae,TypedArray:L,TypedArrayPrototype:R}},3331:function(o,s,i){"use strict";var a=i(7854),l=i(9781),u=i(4019),c=i(8880),f=i(2248),d=i(7293),h=i(5787),m=i(9958),v=i(7466),y=i(7067),w=i(1179),x=i(9518),D=i(7674),I=i(8006).f,N=i(3070).f,S=i(1285),M=i(8003),L=i(9909),R=L.get,O=L.set,F="ArrayBuffer",_="DataView",j="prototype",H="Wrong length",te="Wrong index",W=a[F],J=W,re=a[_],be=re&&re[j],Ae=Object.prototype,xe=a.RangeError,Fe=w.pack,Re=w.unpack,_e=function(Q){return[Q&255]},he=function(Q){return[Q&255,Q>>8&255]},Se=function(Q){return[Q&255,Q>>8&255,Q>>16&255,Q>>24&255]},ke=function(Q){return Q[3]<<24|Q[2]<<16|Q[1]<<8|Q[0]},Ie=function(Q){return Fe(Q,23,4)},Oe=function(Q){return Fe(Q,52,8)},ot=function(Q,V){N(Q[j],V,{get:function(){return R(this)[V]}})},Ye=function(Q,V,ne,ce){var Be=y(ne),Ve=R(Q);if(Be+V>Ve.byteLength)throw xe(te);var st=R(Ve.buffer).bytes,et=Be+Ve.byteOffset,Te=st.slice(et,et+V);return ce?Te:Te.reverse()},Qe=function(Q,V,ne,ce,Be,Ve){var st=y(ne),et=R(Q);if(st+V>et.byteLength)throw xe(te);for(var Te=R(et.buffer).bytes,Ce=st+et.byteOffset,Mt=ce(+Be),dt=0;dt
1?g-1:0),P=1;P
1?g-1:0),P=1;P ',"1114111?f+="\uFFFD\uFFFD\uFFFD\uFFFD":(c-=65536,f+=String.fromCharCode(55296+(c>>10),56320+(c&1023))),o+=9;continue}f+="\uFFFD"}return f})}vn.defaultChars=";/?:@&=+$,#";vn.componentChars="";Fs.exports=vn});var Ps=ie((ig,Os)=>{"use strict";Os.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}});var zs=ie((og,Us)=>{"use strict";function yn(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Xd=/^([a-z0-9.+-]+:)/i,Zd=/:[0-9]*$/,Qd=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Jd=["<",">",'"',"`"," ","\r",`
-`," "],ef=["{","}","|","\\","^","`"].concat(Jd),tf=["'"].concat(ef),Ms=["%","/","?",";","#"].concat(tf),Ns=["/","?","#"],rf=255,_s=/^[+a-z0-9A-Z_-]{0,63}$/,nf=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Bs={javascript:!0,"javascript:":!0},$s={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function of(r,e){if(r&&r instanceof yn)return r;var t=new yn;return t.parse(r,e),t}yn.prototype.parse=function(r,e){var t,n,o,s,i,a=r;if(a=a.trim(),!e&&r.split("#").length===1){var l=Qd.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var u=Xd.exec(a);if(u&&(u=u[0],o=u.toLowerCase(),this.protocol=u,a=a.substr(u.length)),(e||u||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)==="//",i&&!(u&&Bs[u])&&(a=a.substr(2),this.slashes=!0)),!Bs[u]&&(i||u&&!$s[u])){var c=-1;for(t=0;t"+Jt(r[e].content)+"
"};Rt.code_block=function(r,e,t,n,o){var s=r[e];return"
-`};Rt.fence=function(r,e,t,n,o){var s=r[e],i=s.info?Rf(s.info).trim():"",a="",l="",u,c,f,d,h;return i&&(f=i.split(/(\s+)/g),a=f[0],l=f.slice(2).join("")),t.highlight?u=t.highlight(s.content,a,l)||Jt(s.content):u=Jt(s.content),u.indexOf(""+Jt(r[e].content)+`
>4,g=($&15)<<4|U>>2,C=(U&3)<<6|Y,G.push(p),U!==64&&G.push(g),Y!==64&&G.push(C),p=g=C="",P=$=U=Y="",Z
1114111?f+="\uFFFD\uFFFD\uFFFD\uFFFD":(c-=65536,f+=String.fromCharCode(55296+(c>>10),56320+(c&1023))),o+=9;continue}f+="\uFFFD"}return f})}vn.defaultChars=";/?:@&=+$,#";vn.componentChars="";Fs.exports=vn});var Ps=ie((hg,Os)=>{"use strict";Os.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}});var zs=ie((pg,Us)=>{"use strict";function yn(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Qd=/^([a-z0-9.+-]+:)/i,Jd=/:[0-9]*$/,ef=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,tf=["<",">",'"',"`"," ","\r",`
+`," "],rf=["{","}","|","\\","^","`"].concat(tf),nf=["'"].concat(rf),Ms=["%","/","?",";","#"].concat(nf),Ns=["/","?","#"],of=255,_s=/^[+a-z0-9A-Z_-]{0,63}$/,sf=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Bs={javascript:!0,"javascript:":!0},$s={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function af(r,e){if(r&&r instanceof yn)return r;var t=new yn;return t.parse(r,e),t}yn.prototype.parse=function(r,e){var t,n,o,s,i,a=r;if(a=a.trim(),!e&&r.split("#").length===1){var l=ef.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var u=Qd.exec(a);if(u&&(u=u[0],o=u.toLowerCase(),this.protocol=u,a=a.substr(u.length)),(e||u||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)==="//",i&&!(u&&Bs[u])&&(a=a.substr(2),this.slashes=!0)),!Bs[u]&&(i||u&&!$s[u])){var c=-1;for(t=0;t"+Jt(r[e].content)+"
"};Rt.code_block=function(r,e,t,n,o){var s=r[e];return"
+`};Rt.fence=function(r,e,t,n,o){var s=r[e],i=s.info?Pf(s.info).trim():"",a="",l="",u,c,f,d,h;return i&&(f=i.split(/(\s+)/g),a=f[0],l=f.slice(2).join("")),t.highlight?u=t.highlight(s.content,a,l)||Jt(s.content):u=Jt(s.content),u.indexOf(""+Jt(r[e].content)+`
`):""+u+`
`};Rt.image=function(r,e,t,n,o){var s=r[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,t,n),o.renderToken(r,e,t)};Rt.hardbreak=function(r,e,t){return t.xhtmlOut?`"+u+`
@@ -16,22 +16,24 @@ Expect errors in decoding.`),E=E.replace(/[^A-Za-z0-9\+\/\=]/g,"");P=this.KEY_ST
`};Rt.softbreak=function(r,e,t){return t.breaks?t.xhtmlOut?`
`:`
`:`
-`};Rt.text=function(r,e){return Jt(r[e].content)};Rt.html_block=function(r,e){return r[e].content};Rt.html_inline=function(r,e){return r[e].content};function mr(){this.rules=Ff({},Rt)}mr.prototype.renderAttrs=function(e){var t,n,o;if(!e.attrs)return"";for(o="",t=0,n=e.attrs.length;t{"use strict";var Mf=Ne().arrayReplaceAt;function Nf(r){return/^\s]/i.test(r)}function _f(r){return/^<\/a\s*>/i.test(r)}ga.exports=function(e){var t,n,o,s,i,a,l,u,c,f,d,h,m,v,y,w,x=e.tokens,D;if(!!e.md.options.linkify){for(n=0,o=x.length;n=4||e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]{"use strict";Sl.exports=function(e,t){var n,o,s,i,a,l,u,c,f=e.pos,d=e.src.charCodeAt(f);if(d!==96)return!1;for(n=f,f++,o=e.posMax;f=s:i=o<=s,!i)return n;if(n===Lt())break;n=Wt(n,!1)}return!1}function cr(r,e,t,n){for(var o=0,s=0,i=r.children;sn.right+o||r.clientX<=n.right&&r.clientY>n.bottom&&r.clientX>=n.left:r.clientX>n.right&&r.clientY>n.top||r.clientX<=n.right&&r.clientY>n.bottom+o}function jd(r,e,t,n,o,s,i,a){var l=n?r.clientY:r.clientX,u=n?t.height:t.width,c=n?t.top:t.left,f=n?t.bottom:t.right,d=!1;if(!i){if(a&&enc+u*s/2:l{"use strict";var _f=Ne().arrayReplaceAt;function Bf(r){return/^\s]/i.test(r)}function $f(r){return/^<\/a\s*>/i.test(r)}ga.exports=function(e){var t,n,o,s,i,a,l,u,c,f,d,h,m,v,y,w,x=e.tokens,D;if(!!e.md.options.linkify){for(n=0,o=x.length;n=4||e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]{"use strict";Sl.exports=function(e,t){var n,o,s,i,a,l,u,c,f=e.pos,d=e.src.charCodeAt(f);if(d!==96)return!1;for(n=f,f++,o=e.posMax;f
',"
")},e.setOption("extraKeys",o),e.on("change",(d,h)=>{this.updateAndRender()});let s=Sr(d=>{let h=d.getScrollInfo();if(h.top+h.clientHeight===h.height){this.onMarkdownScroll(-1);return}let v=d.lineAtHeight(h.top,"local"),y=d.getRange({line:0,ch:null},{line:v,ch:null}),D=new DOMParser().parseFromString(this.markdown.render(y),"text/html").documentElement.querySelectorAll("body > *");this.onMarkdownScroll(D.length)},100);e.on("scroll",d=>{s(d)}),e.on("paste",(d,h)=>{let m=new $r(h.clipboardData||h.dataTransfer);if(!m.hasItems()||m.containsTabularData())return;let v=m.getImages();for(let y of v)c(y)}),e.on("drop",(d,h)=>{let m=h.dataTransfer.getData("bookstack/template");if(m){let y=d.coordsChar({left:h.pageX,top:h.pageY});d.setCursor(y),h.preventDefault(),window.$http.get(`/templates/${m}`).then(w=>{let x=w.data.markdown||w.data.html;d.replaceSelection(x)})}let v=new $r(h.dataTransfer);if(v.hasItems()&&v.getImages().length>0){let y=d.coordsChar({left:h.pageX,top:h.pageY});d.setCursor(y),h.stopPropagation(),h.preventDefault();let w=v.getImages();for(let x of w)c(x)}});function i(d,h){let m=e.getValue(),v=e.listSelections();e.setValue(m.replace(d,h)),e.setSelections(v)}function a(d){let h=e.getCursor(),m=e.getLine(h.line),v=m.length,y=m.split(" ")[0];if(y===d){m=m.replace(`${d} `,""),e.replaceRange(m,{line:h.line,ch:0},{line:h.line,ch:v}),e.setCursor({line:h.line,ch:h.ch-(d.length+1)});return}let w=/^[#>`]/.test(y),x=0;w?(x=d.length-y.length,m=m.replace(y,d).trim()):d!==""&&(x=d.length+1,m=d+" "+m),e.replaceRange(m,{line:h.line,ch:0},{line:h.line,ch:v}),e.setCursor({line:h.line,ch:h.ch+x})}function l(d,h){let m=e.getCursor(),v=e.getLine(m.line),y=v.length,w=v;v.indexOf(d)===0&&v.slice(-h.length)===h?w=v.slice(d.length,v.length-h.length):w=`${d}${v}${h}`,e.replaceRange(w,{line:m.line,ch:0},{line:m.line,ch:y}),e.setCursor({line:m.line,ch:m.ch+d.length})}function u(d,h){let m=e.getSelection();if(m==="")return l(d,h);let v=m,y=0,w=0;m.indexOf(d)===0&&m.slice(-h.length)===h?(v=m.slice(d.length,m.length-h.length),w=-(h.length+d.length)):(v=`${d}${m}${h}`,w=d.length+h.length);let x=e.listSelections()[0];e.replaceSelection(v);let D=x.head.ch<=x.anchor.ch;x.head.ch+=D?y:w,x.anchor.ch+=D?w:y,e.setSelections([x])}function c(d){if(d===null||d.type.indexOf("image")!==0)return;let h="png";if(d.name){let N=d.name.match(/\.(.+)$/);N.length>1&&(h=N[1])}let m="image-"+Math.random().toString(16).slice(2),v=window.baseUrl(`/loading.gif#upload${m}`),y=e.getSelection(),w=``,x=e.getCursor();e.replaceSelection(w),e.setCursor({line:x.line,ch:x.ch+y.length+3});let D="image-"+Date.now()+"."+h,I=new FormData;I.append("file",d,D),I.append("uploaded_to",t.pageId),window.$http.post("/images/gallery",I).then(N=>{let S=`[](${N.data.url})`;i(w,S)}).catch(N=>{window.$events.emit("error",t.imageUploadErrorText),i(w,y),console.log(N)})}function f(){let d=e.getCursor("from"),h=e.getSelection()||"",m=`[${h}]()`;e.focus(),e.replaceSelection(m);let v=h===""?-3:-1;e.setCursor(d.line,d.ch+m.length+v)}this.updateAndRender()}actionInsertImage(){let e=this.cm.getCursor("from");window.ImageManager.show(t=>{let n=t.thumbs.display||t.url,o=this.cm.getSelection(),s="[]("+t.url+")";this.cm.focus(),this.cm.replaceSelection(s),this.cm.setCursor(e.line,e.ch+s.length)},"gallery")}actionShowImageManager(){let e=this.cm.getCursor("from");window.ImageManager.show(t=>{this.insertDrawing(t,e)},"drawio")}actionShowLinkSelector(){let e=this.cm.getCursor("from");window.EntitySelectorPopup.show(t=>{let o=`[${this.cm.getSelection()||t.name}](${t.link})`;this.cm.focus(),this.cm.replaceSelection(o),this.cm.setCursor(e.line,e.ch+o.length)})}getDrawioUrl(){let e=document.querySelector("[drawio-url]");return e?e.getAttribute("drawio-url"):!1}actionStartDrawing(){let e=this.getDrawioUrl();if(!e)return;let t=this.cm.getCursor("from");vt.show(e,()=>Promise.resolve(""),n=>{let o={image:n,uploaded_to:Number(this.pageId)};window.$http.post("/images/drawio",o).then(s=>{this.insertDrawing(s.data,t),vt.close()}).catch(s=>{this.handleDrawingUploadError(s)})})}insertDrawing(e,t){let n=`