From 9b226e7d39820aaa45196ef6ec1697b6e1404032 Mon Sep 17 00:00:00 2001
From: Dan Brown P;)$[P]=S[P++];return $},k)},7462:function(c,d,a){"use strict";var h=a(260),f=a(2092).some,p=h.aTypedArray,y=h.exportTypedArrayMethod;y("some",function(v){return f(p(this),v,arguments.length>1?arguments[1]:void 0)})},3824:function(c,d,a){"use strict";var h=a(260),f=h.aTypedArray,p=h.exportTypedArrayMethod,y=[].sort;p("sort",function(v){return y.call(f(this),v)})},5021:function(c,d,a){"use strict";var h=a(260),f=a(7466),p=a(1400),y=a(6707),g=h.aTypedArray,v=h.exportTypedArrayMethod;v("subarray",function(k,_){var w=g(this),F=w.length,S=p(k,F);return new(y(w,w.constructor))(w.buffer,w.byteOffset+S*w.BYTES_PER_ELEMENT,f((_===void 0?F:p(_,F))-S))})},2974:function(c,d,a){"use strict";var h=a(7854),f=a(260),p=a(7293),y=h.Int8Array,g=f.aTypedArray,v=f.exportTypedArrayMethod,b=[].toLocaleString,k=[].slice,_=!!y&&p(function(){b.call(new y(1))}),w=p(function(){return[1,2].toLocaleString()!=new y([1,2]).toLocaleString()})||!p(function(){y.prototype.toLocaleString.call([1,2])});v("toLocaleString",function(){return b.apply(_?k.call(g(this)):g(this),arguments)},w)},5016:function(c,d,a){"use strict";var h=a(260).exportTypedArrayMethod,f=a(7293),p=a(7854),y=p.Uint8Array,g=y&&y.prototype||{},v=[].toString,b=[].join;f(function(){v.call({})})&&(v=function(){return b.call(this)});var k=g.toString!=v;h("toString",v,k)},2472:function(c,d,a){var h=a(9843);h("Uint8",function(f){return function(y,g,v){return f(this,y,g,v)}})},4747:function(c,d,a){var h=a(7854),f=a(8324),p=a(8533),y=a(8880);for(var g in f){var v=h[g],b=v&&v.prototype;if(b&&b.forEach!==p)try{y(b,"forEach",p)}catch(k){b.forEach=p}}},3948:function(c,d,a){var h=a(7854),f=a(8324),p=a(6992),y=a(8880),g=a(5112),v=g("iterator"),b=g("toStringTag"),k=p.values;for(var _ in f){var w=h[_],F=w&&w.prototype;if(F){if(F[v]!==k)try{y(F,v,k)}catch(z){F[v]=k}if(F[b]||y(F,b,_),f[_]){for(var S in p)if(F[S]!==p[S])try{y(F,S,p[S])}catch(z){F[S]=p[S]}}}}},1637:function(c,d,a){"use strict";a(6992);var h=a(2109),f=a(5005),p=a(590),y=a(1320),g=a(2248),v=a(8003),b=a(4994),k=a(9909),_=a(5787),w=a(6656),F=a(9974),S=a(648),z=a(9670),P=a(111),H=a(30),$=a(9114),J=a(8554),K=a(1246),Y=a(5112),G=f("fetch"),q=f("Headers"),T=Y("iterator"),A="URLSearchParams",j=A+"Iterator",te=k.set,O=k.getterFor(A),L=k.getterFor(j),re=/\+/g,he=Array(4),U=function(Re){return he[Re-1]||(he[Re-1]=RegExp("((?:%[\\da-f]{2}){"+Re+"})","gi"))},M=function(Re){try{return decodeURIComponent(Re)}catch(Ie){return Re}},we=function(Re){var Ie=Re.replace(re," "),Be=4;try{return decodeURIComponent(Ie)}catch(Ge){for(;Be;)Ie=Ie.replace(U(Be--),M);return Ie}},Pe=/[!'()~]|%20/g,ye={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Ee=function(Re){return ye[Re]},ze=function(Re){return encodeURIComponent(Re).replace(Pe,Ee)},qe=function(Re,Ie){if(Ie)for(var Be=Ie.split("&"),Ge=0,He,Qe;Gee.options.maxHighlightLength&&Ke(e.doc.mode,o.state),m=zl(e,r,o);u&&(o.state=u),r.stateAfter=o.save(!u),r.styles=m.styles,m.classes?r.styleClasses=m.classes:r.styleClasses&&(r.styleClasses=null),s===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return r.styles}function Ei(e,r,s){var o=e.doc,u=e.display;if(!o.mode.startState)return new Vr(o,!0,r);var m=xy(e,r,s),x=m>o.first&&ae(o,m-1).stateAfter,E=x?Vr.fromSaved(o,x,m):new Vr(o,mt(o.mode),m);return o.iter(m,r,function(C){Ba(e,C.text,E);var D=E.line;C.stateAfter=D==r-1||D%5==0||D>=u.viewFrom&&D
2&&m.push((C.bottom+D.top)/2-s.top)}}m.push(s.bottom-s.top)}}function lu(e,r,s){if(e.line==r)return{map:e.measure.map,cache:e.measure.cache};for(var o=0;oe.options.maxHighlightLength&&Ve(e.doc.mode,o.state),m=Nl(e,r,o);u&&(o.state=u),r.stateAfter=o.save(!u),r.styles=m.styles,m.classes?r.styleClasses=m.classes:r.styleClasses&&(r.styleClasses=null),s===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return r.styles}function Ci(e,r,s){var o=e.doc,u=e.display;if(!o.mode.startState)return new Vr(o,!0,r);var m=wy(e,r,s),x=m>o.first&&se(o,m-1).stateAfter,E=x?Vr.fromSaved(o,x,m):new Vr(o,mt(o.mode),m);return o.iter(m,r,function(C){ja(e,C.text,E);var D=E.line;C.stateAfter=D==r-1||D%5==0||D>=u.viewFrom&&D
2&&m.push((C.bottom+D.top)/2-s.top)}}m.push(s.bottom-s.top)}}function uu(e,r,s){if(e.line==r)return{map:e.measure.map,cache:e.measure.cache};for(var o=0;o-1){r.state.draggingText(e),setTimeout(function(){return r.display.input.focus()},20);return}try{var V=e.dataTransfer.getData("Text");if(V){var Q;if(r.state.draggingText&&!r.state.draggingText.copy&&(Q=r.listSelections()),zo(r.doc,yn(s,s)),Q)for(var ce=0;ce","i")}function h(p,y){for(var g in p)for(var v=y[g]||(y[g]=[]),b=p[g],k=b.length-1;k>=0;k--)v.unshift(b[k])}function d(p,y){for(var g=0;g-1){r.state.draggingText(e),setTimeout(function(){return r.display.input.focus()},20);return}try{var V=e.dataTransfer.getData("Text");if(V){var Q;if(r.state.draggingText&&!r.state.draggingText.copy&&(Q=r.listSelections()),Bo(r.doc,bn(s,s)),Q)for(var fe=0;fe","i")}function h(p,y){for(var g in p)for(var v=y[g]||(y[g]=[]),b=p[g],k=b.length-1;k>=0;k--)v.unshift(b[k])}function f(p,y){for(var g=0;g=55296&&T<=56319&&G
>1,K+=S(K/Y);K>F*f>>1;q+=a)K=S(K/F);return S(q+(F+1)*K/(K+p))},J=function(K){var Y=[];K=P(K);var G=K.length,q=v,T=0,A=g,j,te;for(j=0;j
=_.length?{value:void 0,done:!0}:(F=h(_,w),k.index+=F.length,{value:F,done:!1})})},4723:function(c,d,a){"use strict";var h=a(7007),f=a(9670),p=a(7466),y=a(4488),g=a(1530),v=a(7651);h("match",1,function(b,k,_){return[function(F){var S=y(this),z=F==null?void 0:F[b];return z!==void 0?z.call(F,S):new RegExp(F)[b](String(S))},function(w){var F=_(k,w,this);if(F.done)return F.value;var S=f(w),z=String(this);if(!S.global)return v(S,z);var P=S.unicode;S.lastIndex=0;for(var H=[],$=0,J;(J=v(S,z))!==null;){var K=String(J[0]);H[$]=K,K===""&&(S.lastIndex=g(z,p(S.lastIndex),P)),$++}return $===0?null:H}]})},5306:function(c,d,a){"use strict";var h=a(7007),f=a(9670),p=a(7466),y=a(9958),g=a(4488),v=a(1530),b=a(647),k=a(7651),_=Math.max,w=Math.min,F=function(S){return S===void 0?S:String(S)};h("replace",2,function(S,z,P,H){var $=H.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,J=H.REPLACE_KEEPS_$0,K=$?"$":"$0";return[function(G,q){var T=g(this),A=G==null?void 0:G[S];return A!==void 0?A.call(G,T,q):z.call(String(T),G,q)},function(Y,G){if(!$&&J||typeof G=="string"&&G.indexOf(K)===-1){var q=P(z,Y,this,G);if(q.done)return q.value}var T=f(Y),A=String(this),j=typeof G=="function";j||(G=String(G));var te=T.global;if(te){var O=T.unicode;T.lastIndex=0}for(var L=[];;){var re=k(T,A);if(re===null||(L.push(re),!te))break;var he=String(re[0]);he===""&&(T.lastIndex=v(A,p(T.lastIndex),O))}for(var U="",M=0,we=0;we
>1,_=S-7,P=k-1,O=v[P--],H=O&127,U;for(O>>=7;_>0;H=H*256+v[P],P--,_-=8);for(U=H&(1<<-_)-1,H>>=-_,_+=b;_>0;U=U*256+v[P],P--,_-=8);if(H===0)H=1-F;else{if(H===w)return U?NaN:O?-1/0:1/0;U=U+a(2,b),H=H-F}return(O?-1:1)*U*a(2,H-b)};c.exports={pack:y,unpack:g}},8361:function(c,f,a){var h=a(7293),d=a(4326),p="".split;c.exports=h(function(){return!Object("z").propertyIsEnumerable(0)})?function(y){return d(y)=="String"?p.call(y,""):Object(y)}:Object},9587:function(c,f,a){var h=a(111),d=a(7674);c.exports=function(p,y,g){var v,b;return d&&typeof(v=y.constructor)=="function"&&v!==g&&h(b=v.prototype)&&b!==g.prototype&&d(p,b),p}},2788:function(c,f,a){var h=a(5465),d=Function.toString;typeof h.inspectSource!="function"&&(h.inspectSource=function(p){return d.call(p)}),c.exports=h.inspectSource},9909:function(c,f,a){var h=a(8536),d=a(7854),p=a(111),y=a(8880),g=a(6656),v=a(5465),b=a(6200),k=a(3501),S=d.WeakMap,w,F,_,P=function(K){return _(K)?F(K):w(K,{})},O=function(K){return function(q){var T;if(!p(q)||(T=F(q)).type!==K)throw TypeError("Incompatible receiver, "+K+" required");return T}};if(h){var H=v.state||(v.state=new S),U=H.get,J=H.has,G=H.set;w=function(K,q){return q.facade=K,G.call(H,K,q),q},F=function(K){return U.call(H,K)||{}},_=function(K){return J.call(H,K)}}else{var Y=b("state");k[Y]=!0,w=function(K,q){return q.facade=K,y(K,Y,q),q},F=function(K){return g(K,Y)?K[Y]:{}},_=function(K){return g(K,Y)}}c.exports={set:w,get:F,has:_,enforce:P,getterFor:O}},7659:function(c,f,a){var h=a(5112),d=a(7497),p=h("iterator"),y=Array.prototype;c.exports=function(g){return g!==void 0&&(d.Array===g||y[p]===g)}},3157:function(c,f,a){var h=a(4326);c.exports=Array.isArray||function(p){return h(p)=="Array"}},4705:function(c,f,a){var h=a(7293),d=/#|\.prototype\./,p=function(k,S){var w=g[y(k)];return w==b?!0:w==v?!1:typeof S=="function"?h(S):!!S},y=p.normalize=function(k){return String(k).replace(d,".").toLowerCase()},g=p.data={},v=p.NATIVE="N",b=p.POLYFILL="P";c.exports=p},111:function(c){c.exports=function(f){return typeof f=="object"?f!==null:typeof f=="function"}},1913:function(c){c.exports=!1},7850:function(c,f,a){var h=a(111),d=a(4326),p=a(5112),y=p("match");c.exports=function(g){var v;return h(g)&&((v=g[y])!==void 0?!!v:d(g)=="RegExp")}},9212:function(c,f,a){var h=a(9670);c.exports=function(d){var p=d.return;if(p!==void 0)return h(p.call(d)).value}},3383:function(c,f,a){"use strict";var h=a(7293),d=a(9518),p=a(8880),y=a(6656),g=a(5112),v=a(1913),b=g("iterator"),k=!1,S=function(){return this},w,F,_;[].keys&&(_=[].keys(),"next"in _?(F=d(d(_)),F!==Object.prototype&&(w=F)):k=!0);var P=w==null||h(function(){var O={};return w[b].call(O)!==O});P&&(w={}),(!v||P)&&!y(w,b)&&p(w,b,S),c.exports={IteratorPrototype:w,BUGGY_SAFARI_ITERATORS:k}},7497:function(c){c.exports={}},133:function(c,f,a){var h=a(7293);c.exports=!!Object.getOwnPropertySymbols&&!h(function(){return!String(Symbol())})},590:function(c,f,a){var h=a(7293),d=a(5112),p=a(1913),y=d("iterator");c.exports=!h(function(){var g=new URL("b?a=1&b=2&c=3","http://a"),v=g.searchParams,b="";return g.pathname="c%20d",v.forEach(function(k,S){v.delete("b"),b+=S+k}),p&&!g.toJSON||!v.sort||g.href!=="http://a/c%20d?a=1&c=3"||v.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!v[y]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||b!=="a1c3"||new URL("http://x",void 0).host!=="x"})},8536:function(c,f,a){var h=a(7854),d=a(2788),p=h.WeakMap;c.exports=typeof p=="function"&&/native code/.test(d(p))},1574:function(c,f,a){"use strict";var h=a(9781),d=a(7293),p=a(1956),y=a(5181),g=a(5296),v=a(7908),b=a(8361),k=Object.assign,S=Object.defineProperty;c.exports=!k||d(function(){if(h&&k({b:1},k(S({},"a",{enumerable:!0,get:function(){S(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var w={},F={},_=Symbol(),P="abcdefghijklmnopqrst";return w[_]=7,P.split("").forEach(function(O){F[O]=O}),k({},w)[_]!=7||p(k({},F)).join("")!=P})?function(F,_){for(var P=v(F),O=arguments.length,H=1,U=y.f,J=g.f;O>H;)for(var G=b(arguments[H++]),Y=U?p(G).concat(U(G)):p(G),K=Y.length,q=0,T;K>q;)T=Y[q++],(!h||J.call(G,T))&&(P[T]=G[T]);return P}:k},30:function(c,f,a){var h=a(9670),d=a(6048),p=a(748),y=a(3501),g=a(490),v=a(317),b=a(6200),k=">",S="<",w="prototype",F="script",_=b("IE_PROTO"),P=function(){},O=function(Y){return S+F+k+Y+S+"/"+F+k},H=function(Y){Y.write(O("")),Y.close();var K=Y.parentWindow.Object;return Y=null,K},U=function(){var Y=v("iframe"),K="java"+F+":",q;return Y.style.display="none",g.appendChild(Y),Y.src=String(K),q=Y.contentWindow.document,q.open(),q.write(O("document.F=Object")),q.close(),q.F},J,G=function(){try{J=document.domain&&new ActiveXObject("htmlfile")}catch(K){}G=J?H(J):U();for(var Y=p.length;Y--;)delete G[w][p[Y]];return G()};y[_]=!0,c.exports=Object.create||function(K,q){var T;return K!==null?(P[w]=h(K),T=new P,P[w]=null,T[_]=K):T=G(),q===void 0?T:d(T,q)}},6048:function(c,f,a){var h=a(9781),d=a(3070),p=a(9670),y=a(1956);c.exports=h?Object.defineProperties:function(v,b){p(v);for(var k=y(b),S=k.length,w=0,F;S>w;)d.f(v,F=k[w++],b[F]);return v}},3070:function(c,f,a){var h=a(9781),d=a(4664),p=a(9670),y=a(7593),g=Object.defineProperty;f.f=h?g:function(b,k,S){if(p(b),k=y(k,!0),p(S),d)try{return g(b,k,S)}catch(w){}if("get"in S||"set"in S)throw TypeError("Accessors not supported");return"value"in S&&(b[k]=S.value),b}},1236:function(c,f,a){var h=a(9781),d=a(5296),p=a(9114),y=a(5656),g=a(7593),v=a(6656),b=a(4664),k=Object.getOwnPropertyDescriptor;f.f=h?k:function(w,F){if(w=y(w),F=g(F,!0),b)try{return k(w,F)}catch(_){}if(v(w,F))return p(!d.f.call(w,F),w[F])}},8006:function(c,f,a){var h=a(6324),d=a(748),p=d.concat("length","prototype");f.f=Object.getOwnPropertyNames||function(g){return h(g,p)}},5181:function(c,f){f.f=Object.getOwnPropertySymbols},9518:function(c,f,a){var h=a(6656),d=a(7908),p=a(6200),y=a(8544),g=p("IE_PROTO"),v=Object.prototype;c.exports=y?Object.getPrototypeOf:function(b){return b=d(b),h(b,g)?b[g]:typeof b.constructor=="function"&&b instanceof b.constructor?b.constructor.prototype:b instanceof Object?v:null}},6324:function(c,f,a){var h=a(6656),d=a(5656),p=a(1318).indexOf,y=a(3501);c.exports=function(g,v){var b=d(g),k=0,S=[],w;for(w in b)!h(y,w)&&h(b,w)&&S.push(w);for(;v.length>k;)h(b,w=v[k++])&&(~p(S,w)||S.push(w));return S}},1956:function(c,f,a){var h=a(6324),d=a(748);c.exports=Object.keys||function(y){return h(y,d)}},5296:function(c,f){"use strict";var a={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,d=h&&!a.call({1:2},1);f.f=d?function(y){var g=h(this,y);return!!g&&g.enumerable}:a},7674:function(c,f,a){var h=a(9670),d=a(6077);c.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var p=!1,y={},g;try{g=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,g.call(y,[]),p=y instanceof Array}catch(v){}return function(b,k){return h(b),d(k),p?g.call(b,k):b.__proto__=k,b}}():void 0)},288:function(c,f,a){"use strict";var h=a(1694),d=a(648);c.exports=h?{}.toString:function(){return"[object "+d(this)+"]"}},3887:function(c,f,a){var h=a(5005),d=a(8006),p=a(5181),y=a(9670);c.exports=h("Reflect","ownKeys")||function(v){var b=d.f(y(v)),k=p.f;return k?b.concat(k(v)):b}},857:function(c,f,a){var h=a(7854);c.exports=h},2248:function(c,f,a){var h=a(1320);c.exports=function(d,p,y){for(var g in p)h(d,g,p[g],y);return d}},1320:function(c,f,a){var h=a(7854),d=a(8880),p=a(6656),y=a(3505),g=a(2788),v=a(9909),b=v.get,k=v.enforce,S=String(String).split("String");(c.exports=function(w,F,_,P){var O=P?!!P.unsafe:!1,H=P?!!P.enumerable:!1,U=P?!!P.noTargetGet:!1,J;if(typeof _=="function"&&(typeof F=="string"&&!p(_,"name")&&d(_,"name",F),J=k(_),J.source||(J.source=S.join(typeof F=="string"?F:""))),w===h){H?w[F]=_:y(F,_);return}else O?!U&&w[F]&&(H=!0):delete w[F];H?w[F]=_:d(w,F,_)})(Function.prototype,"toString",function(){return typeof this=="function"&&b(this).source||g(this)})},7651:function(c,f,a){var h=a(4326),d=a(2261);c.exports=function(p,y){var g=p.exec;if(typeof g=="function"){var v=g.call(p,y);if(typeof v!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return v}if(h(p)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return d.call(p,y)}},2261:function(c,f,a){"use strict";var h=a(7066),d=a(2999),p=RegExp.prototype.exec,y=String.prototype.replace,g=p,v=function(){var w=/a/,F=/b*/g;return p.call(w,"a"),p.call(F,"a"),w.lastIndex!==0||F.lastIndex!==0}(),b=d.UNSUPPORTED_Y||d.BROKEN_CARET,k=/()??/.exec("")[1]!==void 0,S=v||k||b;S&&(g=function(F){var _=this,P,O,H,U,J=b&&_.sticky,G=h.call(_),Y=_.source,K=0,q=F;return J&&(G=G.replace("y",""),G.indexOf("g")===-1&&(G+="g"),q=String(F).slice(_.lastIndex),_.lastIndex>0&&(!_.multiline||_.multiline&&F[_.lastIndex-1]!==`
+`)&&(Y="(?: "+Y+")",q=" "+q,K++),O=new RegExp("^(?:"+Y+")",G)),k&&(O=new RegExp("^"+Y+"$(?!\\s)",G)),v&&(P=_.lastIndex),H=p.call(J?O:_,q),J?H?(H.input=H.input.slice(K),H[0]=H[0].slice(K),H.index=_.lastIndex,_.lastIndex+=H[0].length):_.lastIndex=0:v&&H&&(_.lastIndex=_.global?H.index+H[0].length:P),k&&H&&H.length>1&&y.call(H[0],O,function(){for(U=1;U=55296&&T<=56319&&K
>1,G+=_(G/Y);G>F*d>>1;q+=a)G=_(G/F);return _(q+(F+1)*G/(G+p))},J=function(G){var Y=[];G=O(G);var K=G.length,q=v,T=0,A=g,$,te;for($=0;$
=S.length?{value:void 0,done:!0}:(F=h(S,w),k.index+=F.length,{value:F,done:!1})})},4723:function(c,f,a){"use strict";var h=a(7007),d=a(9670),p=a(7466),y=a(4488),g=a(1530),v=a(7651);h("match",1,function(b,k,S){return[function(F){var _=y(this),P=F==null?void 0:F[b];return P!==void 0?P.call(F,_):new RegExp(F)[b](String(_))},function(w){var F=S(k,w,this);if(F.done)return F.value;var _=d(w),P=String(this);if(!_.global)return v(_,P);var O=_.unicode;_.lastIndex=0;for(var H=[],U=0,J;(J=v(_,P))!==null;){var G=String(J[0]);H[U]=G,G===""&&(_.lastIndex=g(P,p(_.lastIndex),O)),U++}return U===0?null:H}]})},5306:function(c,f,a){"use strict";var h=a(7007),d=a(9670),p=a(7466),y=a(9958),g=a(4488),v=a(1530),b=a(647),k=a(7651),S=Math.max,w=Math.min,F=function(_){return _===void 0?_:String(_)};h("replace",2,function(_,P,O,H){var U=H.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,J=H.REPLACE_KEEPS_$0,G=U?"$":"$0";return[function(K,q){var T=g(this),A=K==null?void 0:K[_];return A!==void 0?A.call(K,T,q):P.call(String(T),K,q)},function(Y,K){if(!U&&J||typeof K=="string"&&K.indexOf(G)===-1){var q=O(P,Y,this,K);if(q.done)return q.value}var T=d(Y),A=String(this),$=typeof K=="function";$||(K=String(K));var te=T.global;if(te){var j=T.unicode;T.lastIndex=0}for(var N=[];;){var oe=k(T,A);if(oe===null||(N.push(oe),!te))break;var ae=String(oe[0]);ae===""&&(T.lastIndex=v(A,p(T.lastIndex),j))}for(var M="",L=0,ye=0;ye
{"use strict";var Pp=Ft().unescapeAll;Rp.exports=function(t,n,l){var c,d,a=0,h=n,f={ok:!1,pos:0,lines:0,str:""};if(t.charCodeAt(n)===60){for(n++;n {"use strict";var zp=Ft().unescapeAll;Np.exports=function(t,n,l){var c,f,a=0,h=n,d={ok:!1,pos:0,lines:0,str:""};if(t.charCodeAt(n)===60){for(n++;n ",J.map=g=[n,0],t.md.block.tokenize(t,n,v),J=t.push("blockquote_close","blockquote",-1),J.markup=">",t.lineMax=Y,t.parentType=F,g[1]=t.line,h=0;h y+p*d/2:f '," "+$n(i[t].content)+""};tn.code_block=function(i,t,n,l,c){var d=i[t];return"
-`};tn.fence=function(i,t,n,l,c){var d=i[t],a=d.info?ew(d.info).trim():"",h="",f="",p,y,g,v,b;return a&&(g=a.split(/(\s+)/g),h=g[0],f=g.slice(2).join("")),n.highlight?p=n.highlight(d.content,h,f)||$n(d.content):p=$n(d.content),p.indexOf(""+$n(i[t].content)+`
-`):""+p+`
-`};tn.image=function(i,t,n,l,c){var d=i[t];return d.attrs[d.attrIndex("alt")][1]=c.renderInlineAsText(d.children,n,l),c.renderToken(i,t,n)};tn.hardbreak=function(i,t,n){return n.xhtmlOut?`"+p+`
+Expect errors in decoding.`),Z=Z.replace(/[^A-Za-z0-9\+\/\=]/g,"");ce=this.KEY_STR.indexOf(Z.charAt(Oe++)),me=this.KEY_STR.indexOf(Z.charAt(Oe++)),ve=this.KEY_STR.indexOf(Z.charAt(Oe++)),Le=this.KEY_STR.indexOf(Z.charAt(Oe++)),R=ce<<2|me>>4,z=(me&15)<<4|ve>>2,ee=(ve&3)<<6|Le,Ee.push(R),ve!==64&&Ee.push(z),Le!==64&&Ee.push(ee),R=z=ee="",ce=me=ve=Le="",Oe"+$n(i[t].content)+""};rn.code_block=function(i,t,n,l,c){var f=i[t];return"
+`};rn.fence=function(i,t,n,l,c){var f=i[t],a=f.info?nw(f.info).trim():"",h="",d="",p,y,g,v,b;return a&&(g=a.split(/(\s+)/g),h=g[0],d=g.slice(2).join("")),n.highlight?p=n.highlight(f.content,h,d)||$n(f.content):p=$n(f.content),p.indexOf(""+$n(i[t].content)+`
+`):""+p+`
+`};rn.image=function(i,t,n,l,c){var f=i[t];return f.attrs[f.attrIndex("alt")][1]=c.renderInlineAsText(f.children,n,l),c.renderToken(i,t,n)};rn.hardbreak=function(i,t,n){return n.xhtmlOut?`"+p+`
`:`
-`};tn.softbreak=function(i,t,n){return n.breaks?n.xhtmlOut?`
+`};rn.softbreak=function(i,t,n){return n.breaks?n.xhtmlOut?`
`:`
`:`
-`};tn.text=function(i,t){return $n(i[t].content)};tn.html_block=function(i,t){return i[t].content};tn.html_inline=function(i,t){return i[t].content};function xi(){this.rules=J0({},tn)}xi.prototype.renderAttrs=function(t){var n,l,c;if(!t.attrs)return"";for(c="",n=0,l=t.attrs.length;n=q,S=[t.sCount[n]],t.sCount[n]=b-f,z=[t.tShift[n]],t.tShift[n]=G-t.bMarks[n],$=t.md.block.ruler.getRules("blockquote"),F=t.parentType,t.parentType="blockquote",v=n+1;v
=q,_.push(t.bsCount[v]),t.bsCount[v]=t.sCount[v]+1+(P?1:0),S.push(t.sCount[v]),t.sCount[v]=b-f,z.push(t.tShift[v]),t.tShift[v]=G-t.bMarks[v];continue}if(y)break;for(H=!1,h=0,p=$.length;h
=S)return!1;for(_=p,g=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),g.ok&&(w=t.md.normalizeLink(g.str),t.md.validateLink(w)?p=g.pos:w=""),_=p;p=S||t.src.charCodeAt(p)!==41)return t.pos=F,!1;p++}else{if(typeof t.env.references=="undefined")return!1;if(p=0?a=t.src.slice(_,p++):p=h+1):p=h+1,a||(a=t.src.slice(f,h)),y=t.env.references[Nw(a)],!y)return t.pos=F,!1;w=y.href,v=y.title}return n||(d=t.src.slice(f,h),t.md.inline.parse(d,t.md,t.env,k=[]),b=t.push("image","img",0),b.attrs=l=[["src",w],["alt",""]],b.children=k,b.content=d,v&&l.push(["title",v])),t.pos=p,t.posMax=S,!0}});var hg=Fe((M1,dg)=>{"use strict";var Bw=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,qw=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;dg.exports=function(t,n){var l,c,d,a,h,f,p=t.pos;if(t.src.charCodeAt(p)!==60)return!1;for(h=t.pos,f=t.posMax;;){if(++p>=f||(a=t.src.charCodeAt(p),a===60))return!1;if(a===62)break}return l=t.src.slice(h+1,p),qw.test(l)?(c=t.md.normalizeLink(l),t.md.validateLink(c)?(n||(d=t.push("link_open","a",1),d.attrs=[["href",c]],d.markup="autolink",d.info="auto",d=t.push("text","",0),d.content=t.md.normalizeLinkText(l),d=t.push("link_close","a",-1),d.markup="autolink",d.info="auto"),t.pos+=l.length+2,!0):!1):Bw.test(l)?(c=t.md.normalizeLink("mailto:"+l),t.md.validateLink(c)?(n||(d=t.push("link_open","a",1),d.attrs=[["href",c]],d.markup="autolink",d.info="auto",d=t.push("text","",0),d.content=t.md.normalizeLinkText(l),d=t.push("link_close","a",-1),d.markup="autolink",d.info="auto"),t.pos+=l.length+2,!0):!1):!1}});var mg=Fe((O1,pg)=>{"use strict";var jw=ml().HTML_TAG_RE;function $w(i){var t=i|32;return t>=97&&t<=122}pg.exports=function(t,n){var l,c,d,a,h=t.pos;return!t.md.options.html||(d=t.posMax,t.src.charCodeAt(h)!==60||h+2>=d)||(l=t.src.charCodeAt(h+1),l!==33&&l!==63&&l!==47&&!$w(l))||(c=t.src.slice(h).match(jw),!c)?!1:(n||(a=t.push("html_inline","",0),a.content=t.src.slice(h,h+c[0].length)),t.pos+=c[0].length,!0)}});var bg=Fe((P1,yg)=>{"use strict";var gg=ol(),Uw=Ft().has,Hw=Ft().isValidEntityCode,vg=Ft().fromCodePoint,Ww=/^((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Gw=/^&([a-z][a-z0-9]{1,31});/i;yg.exports=function(t,n){var l,c,d,a=t.pos,h=t.posMax;if(t.src.charCodeAt(a)!==38)return!1;if(a+1
{let d=c.target.closest(".sort-box-options [data-sort]");if(!d)return;c.preventDefault();let a=d.closest(".sort-box").querySelectorAll("ul"),h=d.getAttribute("data-sort");n=t===h?!n:!1;let f=Tf[h];n&&l.includes(h)&&(f=function(p,y){return 0-Tf[h](p,y)});for(let p of a)Array.from(p.children).filter(g=>g.matches("li")).sort(f).forEach(g=>{p.appendChild(g)});t=h,this.updateMapInput()})}bookSelect(t){if(this.elem.querySelector(`[data-type="book"][data-id="${t.id}"]`)!==null)return;let l=t.link+"/sort-item";window.$http.get(l).then(c=>{let d=document.createElement("div");d.innerHTML=c.data;let a=d.children[0];this.sortContainer.append(a),this.setupBookSortable(a)})}setupBookSortable(t){let n=[t.querySelector(".sort-list")];n.push(...t.querySelectorAll(".entity-list-item + ul"));let l={name:"book",pull:["book","chapter"],put:["book","chapter"]},c={name:"chapter",pull:["book","chapter"],put:function(d,a,h){return h.getAttribute("data-type")==="page"}};for(let d of n)new gi(d,{group:d.classList.contains("sort-list")?l:c,animation:150,fallbackOnBody:!0,swapThreshold:.65,onSort:this.updateMapInput.bind(this),dragClass:"bg-white",ghostClass:"primary-background-light",multiDrag:!0,multiDragKey:"CTRL",selectedClass:"sortable-selected"})}updateMapInput(){let t=this.buildEntityMap();this.input.value=JSON.stringify(t)}buildEntityMap(){let t=[],n=this.elem.querySelectorAll(".sort-list");for(let l of n){let c=l.closest('[data-type="book"]').getAttribute("data-id"),d=Array.from(l.children).filter(a=>a.matches('[data-type="page"], [data-type="chapter"]'));for(let a=0;a
/gi,`
-`);let c=i.textContent,d=t.createElement("div"),a=t.createElement("textarea");d.className="CodeMirrorContainer",d.setAttribute("data-lang",l),d.setAttribute("dir","ltr"),a.style.display="none",i.parentNode.replaceChild(d,i),d.appendChild(a),d.contentEditable=!1,a.textContent=c;let h=(0,jn.default)(function(f){d.appendChild(f)},{value:c,mode:xa(l,c),lineNumbers:!0,lineWrapping:!1,theme:wa(),readOnly:!0});return{wrap:d,editor:h}}function f0(i,t){let n=i.textContent;return(0,jn.default)(function(l){i.parentNode.insertBefore(l,i),i.style.display="none"},{value:n,mode:xa(t,n),lineNumbers:!0,lineWrapping:!1,theme:wa()})}function d0(i,t,n){i.setOption("mode",xa(t,n))}function h0(i,t){i.setValue(t),setTimeout(()=>{mh(i)},10)}function mh(i){i.refresh()}function p0(i){let n={value:i.textContent,mode:"markdown",lineNumbers:!0,lineWrapping:!0,theme:wa(),scrollPastEnd:!0};return window.$events.emitPublic(i,"editor-markdown-cm::pre-init",{config:n}),(0,jn.default)(function(l){i.parentNode.insertBefore(l,i),i.style.display="none"},n)}function m0(){return jn.default.keyMap.default==jn.default.keyMap.macDefault?"Cmd":"Ctrl"}var ur={highlight:s0,highlightWithin:l0,wysiwygView:c0,popupEditor:f0,setMode:d0,setContent:h0,updateLayout:mh,markdownEditor:p0,getMetaKey:m0};var gh=class{setup(){this.container=this.$refs.container,this.popup=this.$el,this.editorInput=this.$refs.editor,this.languageLinks=this.$manyRefs.languageLink,this.saveButton=this.$refs.saveButton,this.languageInput=this.$refs.languageInput,this.historyDropDown=this.$refs.historyDropDown,this.historyList=this.$refs.historyList,this.callback=null,this.editor=null,this.history={},this.historyKey="code_history",this.setupListeners()}setupListeners(){this.container.addEventListener("keydown",t=>{t.ctrlKey&&t.key==="Enter"&&this.save()}),Rt(this.languageLinks,t=>{let n=t.target.dataset.lang;this.languageInput.value=n,this.updateEditorMode(n)}),Qo(this.languageInput,t=>this.save()),Rt(this.saveButton,t=>this.save()),$t(this.historyList,"button","click",(t,n)=>{t.preventDefault();let l=n.dataset.time;this.editor&&this.editor.setValue(this.history[l])})}save(){this.callback&&this.callback(this.editor.getValue(),this.languageInput.value),this.hide()}open(t,n,l){this.languageInput.value=n,this.callback=l,this.show(),this.updateEditorMode(n),ur.setContent(this.editor,t)}show(){this.editor||(this.editor=ur.popupEditor(this.editorInput,this.languageInput.value)),this.loadHistory(),this.popup.components.popup.show(()=>{ur.updateLayout(this.editor),this.editor.focus()},()=>{this.addHistory()})}hide(){this.popup.components.popup.hide(),this.addHistory()}updateEditorMode(t){ur.setMode(this.editor,t,this.editor.getValue())}loadHistory(){this.history=JSON.parse(window.sessionStorage.getItem(this.historyKey)||"{}");let t=Object.keys(this.history).reverse();this.historyDropDown.classList.toggle("hidden",t.length===0),this.historyList.innerHTML=t.map(n=>{let l=new Date(parseInt(n)).toLocaleTimeString();return``}).join("")}addHistory(){if(!this.editor)return;let t=this.editor.getValue();if(!t)return;let n=Object.keys(this.history).pop();if(this.history[n]===t)return;this.history[String(Date.now())]=t;let l=JSON.stringify(this.history);window.sessionStorage.setItem(this.historyKey,l)}},vh=gh;var yh=class{constructor(t){ur.highlightWithin(t)}},bh=yh;var xh=class{constructor(t){this.elem=t,this.trigger=t.querySelector("[collapsible-trigger]"),this.content=t.querySelector("[collapsible-content]"),!!this.trigger&&(this.trigger.addEventListener("click",this.toggle.bind(this)),this.openIfContainsError())}open(){this.elem.classList.add("open"),this.trigger.setAttribute("aria-expanded","true"),yi(this.content,300)}close(){this.elem.classList.remove("open"),this.trigger.setAttribute("aria-expanded","false"),vi(this.content,300)}toggle(){this.elem.classList.contains("open")?this.close():this.open()}openIfContainsError(){this.content.querySelector(".text-neg.text-small")&&this.open()}},wh=xh;var kh=class{constructor(t){this.elem=t,this.checkbox=t.querySelector("input[type=checkbox]"),this.display=t.querySelector('[role="checkbox"]'),this.checkbox.addEventListener("change",this.stateChange.bind(this)),this.elem.addEventListener("keydown",this.onKeyDown.bind(this))}onKeyDown(t){(t.keyCode===32||t.keyCode===13)&&(t.preventDefault(),this.toggle())}toggle(){this.checkbox.checked=!this.checkbox.checked,this.checkbox.dispatchEvent(new Event("change")),this.stateChange()}stateChange(){let t=this.checkbox.checked?"true":"false";this.display.setAttribute("aria-checked",t)}},_h=kh;var Sh=class{constructor(t){this.elem=t,this.dealtWith=!1,t.addEventListener("toggle",this.onToggle.bind(this))}onToggle(){this.dealtWith||(ur.highlightWithin(this.elem),this.dealtWith=!0)}},Eh=Sh;var Ch=class{setup(){this.container=this.$el,this.menu=this.$refs.menu,this.toggle=this.$refs.toggle,this.moveMenu=this.$opts.moveMenu,this.bubbleEscapes=this.$opts.bubbleEscapes==="true",this.direction=document.dir==="rtl"?"right":"left",this.body=document.body,this.showing=!1,this.setupListeners(),this.hide=this.hide.bind(this)}show(t=null){this.hideAll(),this.menu.style.display="block",this.menu.classList.add("anim","menuIn"),this.toggle.setAttribute("aria-expanded","true"),this.moveMenu&&(this.rect=this.menu.getBoundingClientRect(),this.body.appendChild(this.menu),this.menu.style.position="fixed",this.direction==="right"?this.menu.style.right=`${this.rect.right-this.rect.width}px`:this.menu.style.left=`${this.rect.left}px`,this.menu.style.top=`${this.rect.top}px`,this.menu.style.width=`${this.rect.width}px`),this.menu.addEventListener("mouseleave",this.hide.bind(this)),window.addEventListener("click",c=>{this.menu.contains(c.target)||this.hide()});let n=this.menu.querySelector("input");n!==null&&n.focus(),this.showing=!0;let l=new Event("show");this.container.dispatchEvent(l),t&&t.stopPropagation()}hideAll(){for(let t of window.components.dropdown)t.hide()}hide(){this.menu.style.display="none",this.menu.classList.remove("anim","menuIn"),this.toggle.setAttribute("aria-expanded","false"),this.moveMenu&&(this.menu.style.position="",this.menu.style[this.direction]="",this.menu.style.top="",this.menu.style.width="",this.container.appendChild(this.menu)),this.showing=!1}getFocusable(){return Array.from(this.menu.querySelectorAll("[tabindex],[href],button,input:not([type=hidden])"))}focusNext(){let t=this.getFocusable(),l=t.indexOf(document.activeElement)+1;l>=t.length&&(l=0),t[l].focus()}focusPrevious(){let t=this.getFocusable(),l=t.indexOf(document.activeElement)-1;l<0&&(l=t.length-1),t[l].focus()}setupListeners(){this.container.addEventListener("click",n=>{Array.from(this.menu.querySelectorAll("a")).includes(n.target)&&this.hide()}),Rt(this.toggle,n=>{n.stopPropagation(),this.show(n),n instanceof KeyboardEvent&&this.focusNext()});let t=n=>{n.key==="ArrowDown"||n.key==="ArrowRight"?(this.focusNext(),n.preventDefault()):n.key==="ArrowUp"||n.key==="ArrowLeft"?(this.focusPrevious(),n.preventDefault()):n.key==="Escape"&&(this.hide(),this.toggle.focus(),this.bubbleEscapes||n.stopPropagation())};this.container.addEventListener("keydown",t),this.moveMenu&&this.menu.addEventListener("keydown",t),this.menu.addEventListener("keydown ",n=>{n.key==="Enter"&&(n.preventDefault(),n.stopPropagation(),this.hide())})}},Th=Ch;var Ah=class{setup(){this.elem=this.$el,this.searchInput=this.$refs.searchInput,this.loadingElem=this.$refs.loading,this.listContainerElem=this.$refs.listContainer,this.localSearchSelector=this.$opts.localSearchSelector,this.url=this.$opts.url,this.elem.addEventListener("show",this.onShow.bind(this)),this.searchInput.addEventListener("input",this.onSearch.bind(this)),this.runAjaxSearch=Jo(this.runAjaxSearch,300,!1)}onShow(){this.loadList()}onSearch(){let t=this.searchInput.value.toLowerCase().trim();this.localSearchSelector?this.runLocalSearch(t):(this.toggleLoading(!0),this.listContainerElem.innerHTML="",this.runAjaxSearch(t))}runAjaxSearch(t){this.loadList(t)}runLocalSearch(t){let n=this.listContainerElem.querySelectorAll(this.localSearchSelector);for(let l of n){let c=!t||l.textContent.toLowerCase().includes(t);l.style.display=c?"flex":"none",l.classList.toggle("hidden",!c)}}async loadList(t=""){this.listContainerElem.innerHTML="",this.toggleLoading(!0);try{let n=await window.$http.get(this.getAjaxUrl(t));this.listContainerElem.innerHTML=n.data}catch(n){console.error(n)}this.toggleLoading(!1),this.localSearchSelector&&this.onSearch()}getAjaxUrl(t=null){if(!t)return this.url;let n=this.url.includes("?")?"&":"?";return`${this.url}${n}search=${encodeURIComponent(t)}`}toggleLoading(t=!1){this.loadingElem.style.display=t?"block":"none"}},Lh=Ah;var Ih=_t(Dh());var Fh=class{setup(){this.container=this.$el,this.url=this.$opts.url,this.successMessage=this.$opts.successMessage,this.removeMessage=this.$opts.removeMessage,this.uploadLimitMessage=this.$opts.uploadLimitMessage,this.timeoutMessage=this.$opts.timeoutMessage;let t=this;this.dz=new Ih.default(this.container,{addRemoveLinks:!0,dictRemoveFile:this.removeMessage,timeout:Number(window.uploadTimeout)||6e4,maxFilesize:Number(window.uploadLimit)||256,url:this.url,withCredentials:!0,init(){this.dz=this,this.dz.on("sending",t.onSending.bind(t)),this.dz.on("success",t.onSuccess.bind(t)),this.dz.on("error",t.onError.bind(t))}})}onSending(t,n,l){let c=window.document.querySelector("meta[name=token]").getAttribute("content");l.append("_token",c),n.ontimeout=d=>{this.dz.emit("complete",t),this.dz.emit("error",t,this.timeoutMessage)}}onSuccess(t,n){this.$emit("success",{file:t,data:n}),this.successMessage&&window.$events.emit("success",this.successMessage),ga(t.previewElement,800,()=>{this.dz.removeFile(t)})}onError(t,n,l){this.$emit("error",{file:t,errorMessage:n,xhr:l});let c=d=>{let a=t.previewElement.querySelector("[data-dz-errormessage]");a.textContent=d};l&&l.status===413?c(this.uploadLimitMessage):n.file&&c(n.file)}removeAll(){this.dz.removeAllFiles(!0)}},Mh=Fh;var Oh=class{constructor(t){this.elem=t,this.buttons=t.querySelectorAll("[toolbox-tab-button]"),this.contentElements=t.querySelectorAll("[toolbox-tab-content]"),this.toggleButton=t.querySelector("[toolbox-toggle]"),this.toggleButton.addEventListener("click",this.toggle.bind(this)),this.elem.addEventListener("click",n=>{let l=n.target.closest("[toolbox-tab-button]");if(l===null)return;let c=l.getAttribute("toolbox-tab-button");this.setActiveTab(c,!0)}),this.setActiveTab(this.contentElements[0].getAttribute("toolbox-tab-content"))}toggle(){this.elem.classList.toggle("open");let t=this.elem.classList.contains("open")?"true":"false";this.toggleButton.setAttribute("aria-expanded",t)}setActiveTab(t,n=!1){for(let l=0,c=this.buttons.length;l`,g=t.dom.create("a",{target:"_blank",href:f.url},y);t.dom.replace(g,a)}).catch(f=>{t.dom.remove(a),window.$events.emit("error",n.imageUploadErrorText),console.log(f)})},10)}}async function Hk(i,t){if(i===null||i.type.indexOf("image")!==0)throw new Error("Not an image file");let n="png";if(i.name){let a=i.name.match(/\.(.+)$/);a.length>1&&(n=a[1])}let l="image-"+Date.now()+"."+n,c=new FormData;return c.append("file",i,l),c.append("uploaded_to",t.pageId),(await window.$http.post(window.baseUrl("/images/gallery"),c)).data}function Wk(i){for(let t=1;t<5;t++)i.shortcuts.add("meta+"+t,"",["FormatBlock",!1,"h"+(t+1)]);i.shortcuts.add("meta+5","",["FormatBlock",!1,"p"]),i.shortcuts.add("meta+d","",["FormatBlock",!1,"p"]),i.shortcuts.add("meta+6","",["FormatBlock",!1,"blockquote"]),i.shortcuts.add("meta+q","",["FormatBlock",!1,"blockquote"]),i.shortcuts.add("meta+7","",["codeeditor",!1,"pre"]),i.shortcuts.add("meta+e","",["codeeditor",!1,"pre"]),i.shortcuts.add("meta+8","",["FormatBlock",!1,"code"]),i.shortcuts.add("meta+shift+E","",["FormatBlock",!1,"code"]),i.shortcuts.add("meta+S","",()=>{window.$events.emit("editor-save-draft")}),i.shortcuts.add("meta+13","",()=>{window.$events.emit("editor-save-page")}),i.shortcuts.add("meta+9","",function(){let t=i.selection.getNode(),n=t?t.closest(".callout"):null,l=["info","success","warning","danger"],d=(l.findIndex(h=>n&&n.classList.contains(h))+1)%l.length,a=l[d];i.formatter.apply("callout"+a)})}function Gk(i){window.$http.get(window.baseUrl("/custom-head-content")).then(t=>{if(!t.data)return;let n=i.getDoc().querySelector("head");n.innerHTML+=t.data})}function Kk(){function i(l){return l.className==="CodeMirrorContainer"}function t(l){let c=l.selection.getNode();if(!i(c)){let h=l.selection.getNode().textContent;window.components.first("code-editor").open(h,"",(f,p)=>{let y=document.createElement("div");y.innerHTML=`
`,y.querySelector("code").innerText=f,l.formatter.toggle("pre");let g=l.selection.getNode();l.dom.setHTML(g,y.querySelector("pre").innerHTML),l.fire("SetContent"),l.focus()});return}let d=c.hasAttribute("data-lang")?c.getAttribute("data-lang"):"",a=c.querySelector("textarea").textContent;window.components.first("code-editor").open(a,d,(h,f)=>{let y=c.querySelector(".CodeMirror").CodeMirror;y&&(ur.setContent(y,h),ur.setMode(y,f,h));let g=c.querySelector("textarea");g&&(g.textContent=h),c.setAttribute("data-lang",f),l.focus()})}function n(l){let d=l.querySelector("textarea").textContent,a=l.getAttribute("data-lang");l.removeAttribute("contentEditable");let h=document.createElement("pre"),f=document.createElement("code");f.classList.add(`language-${a}`),f.textContent=d,h.appendChild(f),l.parentElement.replaceChild(h,l)}window.tinymce.PluginManager.add("codeeditor",function(l,c){let d=l.$;l.addButton("codeeditor",{text:"Code block",icon:!1,cmd:"codeeditor"}),l.addCommand("codeeditor",()=>{t(l)}),l.on("PreProcess",function(h){d("div.CodeMirrorContainer",h.node).each((f,p)=>{n(p)})}),l.on("dblclick",h=>{let f=l.selection.getNode();!i(f)||t(l)});function a(){d(".CodeMirrorContainer").filter((f,p)=>typeof p.querySelector(".CodeMirror").CodeMirror=="undefined").each((f,p)=>{n(p)}),d("body > pre").filter((f,p)=>p.contentEditable!=="false").each((f,p)=>{ur.wysiwygView(p)})}l.on("init",function(){l.undoManager.transact(function(){a()}),setTimeout(()=>{l.on("SetContent",()=>{setTimeout(a,100)})},200)})})}function Vk(i,t,n,l){let c=null,d=null;function a(g){return g.hasAttribute("drawio-diagram")}function h(g,v=null){c=g,d=v,window.ImageManager.show(function(b){if(v){let k=v.querySelector("img");c.dom.setAttrib(k,"src",b.url),c.dom.setAttrib(v,"drawio-diagram",b.id)}else{let k=``,h+="",f.tinyMCE.activeEditor.execCommand("mceInsertContent",!1,h)},"gallery")},paste_preprocess:function(n,l){l.content.indexOf('
{l();let p=new URL(window.location).searchParams.get("content-id");p&&c(p);let g=n.getContainer().querySelectorAll(".mce-btn");for(let v of g)v.addEventListener("touchstart",b=>{b.stopPropagation()});window.editor=n});function l(){let d=n.getContent();t.isDarkMode&&n.contentDocument.documentElement.classList.add("dark-mode"),window.$events.emit("editor-html-change",d)}function c(d){let p=n.dom.get(encodeURIComponent(d).replace(/!/g,"%21"));!p||(p.scrollIntoView(),n.selection.select(p,!0),n.selection.collapse(!1),n.focus())}Jk(n),window.$events.listen("editor-html-update",d=>{n.setContent(d),n.selection.select(n.getBody(),!0),n.selection.collapse(!1),l(d)}),Vk(n);let f,a;function h(d){return d&&!!(d.textContent||d.innerText)}n.on("dragstart",function(){let d=n.selection.getNode();d.nodeName==="IMG"&&(f=n.dom.getParent(d,".mceTemp"),!f&&d.parentNode.nodeName==="A"&&!h(d.parentNode)&&(f=d.parentNode)),d.hasAttribute("contenteditable")&&d.getAttribute("contenteditable")==="false"&&(a=d)}),n.on("drop",function(d){let p=n.dom,y=tinymce.dom.RangeUtils.getCaretRangeFromPoint(d.clientX,d.clientY,n.getDoc()),g=d.dataTransfer&&d.dataTransfer.getData("bookstack/template");g&&(d.preventDefault(),window.$http.get(`/templates/${g}`).then(v=>{n.selection.setRng(y),n.undoManager.transact(function(){n.execCommand("mceInsertContent",!1,v.data.html)})})),p.getParent(y.startContainer,".mceTemp")?d.preventDefault():f&&(d.preventDefault(),n.undoManager.transact(function(){n.selection.setRng(y),n.selection.setNode(f),p.remove(f)})),!d.isDefaultPrevented()&&a&&(d.preventDefault(),n.undoManager.transact(function(){let v=n.selection.getNode(),b=n.selection.getRng(),k=v.closest("body > *");b.startOffset>b.startContainer.length/2?n.$(k).after(a):n.$(k).before(a)})),d.isDefaultPrevented()||py(d,n,t),f=null}),n.addButton("image-insert",{title:"My title",icon:"image",tooltip:"Insert an image",onclick:function(){window.ImageManager.show(function(d){let p=``;p+=`
`,p+="",n.execCommand("mceInsertContent",!1,p)},"gallery")}}),n.on("paste",d=>py(d,n,t)),window.$events.emitPublic(t.elem,"editor-tinymce::setup",{editor:n})}}}},gy=my;var vy={"add-remove-rows":Vc,"ajax-delete-row":Xc,"ajax-form":Qc,attachments:ef,"attachments-list":rf,"auto-suggest":of,"back-to-top":sf,"book-sort":If,"chapter-toggle":Of,"code-editor":bh,"code-highlighter":wh,collapsible:_h,"custom-checkbox":Eh,"details-highlighter":Th,dropdown:Lh,"dropdown-search":Ih,dropzone:Ph,"editor-toolbox":zh,"entity-permissions-editor":Bh,"entity-search":jh,"entity-selector":Uh,"entity-selector-popup":Wh,"event-emit-select":Kh,"expand-toggle":Yh,"header-mobile-toggle":Zh,"homepage-control":Jh,"image-manager":tp,"image-picker":np,index:qa,"list-sort-control":op,"markdown-editor":_v,"new-user-password":Ev,notification:Tv,"optional-input":Lv,"page-comments":Iv,"page-display":Ov,"page-editor":zv,"page-picker":Bv,"permissions-table":jv,popup:Uv,"setting-app-color-picker":Wv,"setting-color-picker":Kv,"shelf-sort":Yv,sidebar:Zv,"sortable-list":Jv,"submit-on-change":ty,tabs:ny,"tag-manager":oy,"template-manager":sy,"toggle-switch":uy,"tri-layout":fy,"user-select":hy,"wysiwyg-editor":gy};window.components={};function e_(i,t){let n=t.querySelectorAll(`[${i}]`);for(let l=0,c=n.length;l