2023-12-29 20:16:07 +08:00
var Bu = Object . create ; var _e = Object . defineProperty ; var Pu = Object . getOwnPropertyDescriptor ; var Ou = Object . getOwnPropertyNames ; var Ru = Object . getPrototypeOf , Nu = Object . prototype . hasOwnProperty ; var zu = ( n , t , e ) => t in n ? _e ( n , t , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : e } ) : n [ t ] = e ; var Hu = ( n , t ) => ( ) => ( n && ( t = n ( n = 0 ) ) , t ) ; var _ = ( n , t ) => ( ) => ( t || n ( ( t = { exports : { } } ) . exports , t ) , t . exports ) , Se = ( n , t ) => { for ( var e in t ) _e ( n , e , { get : t [ e ] , enumerable : ! 0 } ) } , Wo = ( n , t , e , i ) => { if ( t && typeof t == "object" || typeof t == "function" ) for ( let r of Ou ( t ) ) ! Nu . call ( n , r ) && r !== e && _e ( n , r , { get : ( ) => t [ r ] , enumerable : ! ( i = Pu ( t , r ) ) || i . enumerable } ) ; return n } ; var Go = ( n , t , e ) => ( e = n != null ? Bu ( Ru ( n ) ) : { } , Wo ( t || ! n || ! n . _ _esModule ? _e ( e , "default" , { value : n , enumerable : ! 0 } ) : e , n ) ) , Uu = n => Wo ( _e ( { } , "__esModule" , { value : ! 0 } ) , n ) ; var at = ( n , t , e ) => ( zu ( n , typeof t != "symbol" ? t + "" : t , e ) , e ) , ju = ( n , t , e ) => { if ( ! t . has ( n ) ) throw TypeError ( "Cannot " + e ) } ; var ot = ( n , t , e ) => { if ( t . has ( n ) ) throw TypeError ( "Cannot add the same private member more than once" ) ; t instanceof WeakSet ? t . add ( n ) : t . set ( n , e ) } ; var L = ( n , t , e ) => ( ju ( n , t , "access private method" ) , e ) ; var Fs = _ ( ( Ib , zh ) => { zh . exports = { Aacute : "\xC1" , aacute : "\xE1" , Abreve : "\u0102" , abreve : "\u0103" , ac : "\u223E" , acd : "\u223F" , acE : "\u223E\u0333" , Acirc : "\xC2" , acirc : "\xE2" , acute : "\xB4" , Acy : "\u0410" , acy : "\u0430" , AElig : "\xC6" , aelig : "\xE6" , af : "\u2061" , Afr : "\u{1D504}" , afr : "\u{1D51E}" , Agrave : "\xC0" , agrave : "\xE0" , alefsym : "\u2135" , aleph : "\u2135" , Alpha : "\u0391" , alpha : "\u03B1" , Amacr : "\u0100" , amacr : "\u0101" , amalg : "\u2A3F" , amp : "&" , AMP : "&" , andand : "\u2A55" , And : "\u2A53" , and : "\u2227" , andd : "\u2A5C" , andslope : "\u2A58" , andv : "\u2A5A" , ang : "\u2220" , ange : "\u29A4" , angle : "\u2220" , angmsdaa : "\u29A8" , angmsdab : "\u29A9" , angmsdac : "\u29AA" , angmsdad : "\u29AB" , angmsdae : "\u29AC" , angmsdaf : "\u29AD" , angmsdag : "\u29AE" , angmsdah : "\u29AF" , angmsd : "\u2221" , angrt : "\u221F" , angrtvb : "\u22BE" , angrtvbd : "\u299D" , angsph : "\u2222" , angst : "\xC5" , angzarr : "\u237C" , Aogon : "\u0104" , aogon : "\u0105" , Aopf : "\u{1D538}" , aopf : "\u{1D552}" , apacir : "\u2A6F" , ap : "\u2248" , apE : "\u2A70" , ape : "\u224A" , apid : "\u224B" , apos : "'" , ApplyFunction : "\u2061" , approx : "\u2248" , approxeq : "\u224A" , Aring : "\xC5" , aring : "\xE5" , Ascr : "\u{1D49C}" , ascr : "\u{1D4B6}" , Assign : "\u2254" , ast : "*" , asymp : "\u2248" , asympeq : "\u224D" , Atilde : "\xC3" , atilde : "\xE3" , Auml : "\xC4" , auml : "\xE4" , awconint : "\u2233" , awint : "\u2A11" , backcong : "\u224C" , backepsilon : "\u03F6" , backprime : "\u2035" , backsim : "\u223D" , backsimeq : "\u22CD" , Backslash : "\u2216" , Barv : "\u2AE7" , barvee : "\u22BD" , barwed : "\u2305" , Barwed : "\u2306" , barwedge : "\u2305" , bbrk : "\u23B5" , bbrktbrk : "\u23B6" , bcong : "\u224C" , Bcy : "\u0411" , bcy : "\u0431" , bdquo : "\u201E" , becaus : "\u2235" , because : "\u2235" , Because : "\u2235" , bemptyv : "\u29B0" , bepsi : "\u03F6" , bernou : "\u212C" , Bernoullis : "\u212C" , Beta : "\u0392" , beta : "\u03B2" , beth : "\u2136" , between : "\u226C" , Bfr : "\u{1D505}" , bfr : "\u{1D51F}" , bigcap : "\u22C2" , bigcirc : "\u25EF" , bigcup : "\u22C3" , bigodot : "\u2A00" , bigoplus : "\u2A01" , bigotimes : "\u2A02" , bigsqcup : "\u2A06" , bigstar : "\u2605" , bigtriangledown : "\u25BD" , bigtriangleup : "\u25B3" , biguplus : "\u2A04" , bigvee : "\u22C1" , bigwedge : "\u22C0" , bkarow : "\u290D" , blacklozenge : "\u29EB" , blacksquare : "\u25AA" , blacktriangle : "\u25B4" , blacktriangledown : "\u25BE" , blacktriangleleft : "\u25C2" , blacktriangleright : "\u25B8" , blank : "\u2423" , blk12 : "\u2592" , blk14 : "\u2591" , blk34 : "\u2593" , block : "\u2588" , bne : "=\u20E5" , bnequiv : "\u2261\u20E5" , bNot : "\u2AED" , bnot : "\u2310" , Bopf : "\u{1D539}" , bopf : "\u{1D553}" , bot : "\u22A5" , bottom : "\u22A5" , bowtie : "\u22C8" , boxbox : "\u29C9" , boxdl : "\u2510" , boxdL : "\u2555" , boxDl : "\u2556" , boxDL : "\u2557" , boxdr : "\u250C" , boxdR : "\u2552" , boxDr : "\u2553" , boxDR : "\u2554" , boxh : "\u2500" , boxH : "\u2550" , boxhd : "\u252C" , boxHd : "\u2564" , boxhD : "\u2565" , boxHD : "\u2566" , boxhu : "\u2534" , boxHu : "\u2567" , boxhU : "\u2568" , boxHU : "\u2569" , boxminus : "\u229F" , boxplus : "\u229E" , boxtimes : "\u22A0" , boxul : "\u2518" , boxuL : "\u255B" , boxUl : "\u255C" , boxUL : "\u255D" , boxur : "\u2514" , boxuR : "\u2558" , boxUr : "\u2559" , boxUR : "\u255A" , boxv : "\u2502" , boxV : "\u2551" , boxvh : "\u253C" , boxvH : "\u256A" , boxVh : "\u256B" , boxVH : "\u256C" , boxvl : "\u2524" , boxvL : "\u2561" , boxVl : "\u2562" , boxVL : "\u2563" , boxvr : "\u251C" , boxvR : "\u255E" , boxVr : "\u255F" , boxVR : "\u2560" , bprime : "\u2035" , breve : "\u02D8" , Breve : "\u02D8" , brvb
` ,nexist:" \u 2204",nexists:" \u 2204",Nfr:" \u {1D511}",nfr:" \u {1D52B}",ngE:" \u 2267 \u 0338",nge:" \u 2271",ngeq:" \u 2271",ngeqq:" \u 2267 \u 0338",ngeqslant:" \u 2A7E \u 0338",nges:" \u 2A7E \u 0338",nGg:" \u 22D9 \u 0338",ngsim:" \u 2275",nGt:" \u 226B \u 20D2",ngt:" \u 226F",ngtr:" \u 226F",nGtv:" \u 226B \u 0338",nharr:" \u 21AE",nhArr:" \u 21CE",nhpar:" \u 2AF2",ni:" \u 220B",nis:" \u 22FC",nisd:" \u 22FA",niv:" \u 220B",NJcy:" \u 040A",njcy:" \u 045A",nlarr:" \u 219A",nlArr:" \u 21CD",nldr:" \u 2025",nlE:" \u 2266 \u 0338",nle:" \u 2270",nleftarrow:" \u 219A",nLeftarrow:" \u 21CD",nleftrightarrow:" \u 21AE",nLeftrightarrow:" \u 21CE",nleq:" \u 2270",nleqq:" \u 2266 \u 0338",nleqslant:" \u 2A7D \u 0338",nles:" \u 2A7D \u 0338",nless:" \u 226E",nLl:" \u 22D8 \u 0338",nlsim:" \u 2274",nLt:" \u 226A \u 20D2",nlt:" \u 226E",nltri:" \u 22EA",nltrie:" \u 22EC",nLtv:" \u 226A \u 0338",nmid:" \u 2224",NoBreak:" \u 2060",NonBreakingSpace:" \x A0",nopf:" \u {1D55F}",Nopf:" \u 2115",Not:" \u 2AEC",not:" \x AC",NotCongruent:" \u 2262",NotCupCap:" \u 226D",NotDoubleVerticalBar:" \u 2226",NotElement:" \u 2209",NotEqual:" \u 2260",NotEqualTilde:" \u 2242 \u 0338",NotExists:" \u 2204",NotGreater:" \u 226F",NotGreaterEqual:" \u 2271",NotGreaterFullEqual:" \u 2267 \u 0338",NotGreaterGreater:" \u 226B \u 0338",NotGreaterLess:" \u 2279",NotGreaterSlantEqual:" \u 2A7E \u 0338",NotGreaterTilde:" \u 2275",NotHumpDownHump:" \u 224E \u 0338",NotHumpEqual:" \u 224F \u 0338",notin:" \u 2209",notindot:" \u 22F5 \u 0338",notinE:" \u 22F9 \u 0338",notinva:" \u 2209",notinvb:" \u 22F7",notinvc:" \u 22F6",NotLeftTriangleBar:" \u 29CF \u 0338",NotLeftTriangle:" \u 22EA",NotLeftTriangleEqual:" \u 22EC",NotLess:" \u 226E",NotLessEqual:" \u 2270",NotLessGreater:" \u 2278",NotLessLess:" \u 226A \u 0338",NotLessSlantEqual:" \u 2A7D \u 0338",NotLessTilde:" \u 2274",NotNestedGreaterGreater:" \u 2AA2 \u 0338",NotNestedLessLess:" \u 2AA1 \u 0338",notni:" \u 220C",notniva:" \u 220C",notnivb:" \u 22FE",notnivc:" \u 22FD",NotPrecedes:" \u 2280",NotPrecedesEqual:" \u 2AAF \u 0338",NotPrecedesSlantEqual:" \u 22E0",NotReverseElement:" \u 220C",NotRightTriangleBar:" \u 29D0 \u 0338",NotRightTriangle:" \u 22EB",NotRightTriangleEqual:" \u 22ED",NotSquareSubset:" \u 228F \u 0338",NotSquareSubsetEqual:" \u 22E2",NotSquareSuperset:" \u 2290 \u 0338",NotSquareSupersetEqual:" \u 22E3",NotSubset:" \u 2282 \u 20D2",NotSubsetEqual:" \u 2288",NotSucceeds:" \u 2281",NotSucceedsEqual:" \u 2AB0 \u 0338",NotSucceedsSlantEqual:" \u 22E1",NotSucceedsTilde:" \u 227F \u 0338",NotSuperset:" \u 2283 \u 20D2",NotSupersetEqual:" \u 2289",NotTilde:" \u 2241",NotTildeEqual:" \u 2244",NotTildeFullEqual:" \u 2247",NotTildeTilde:" \u 2249",NotVerticalBar:" \u 2224",nparallel:" \u 2226",npar:" \u 2226",nparsl:" \u 2AFD \u 20E5",npart:" \u 2202 \u 0338",npolint:" \u 2A14",npr:" \u 2280",nprcue:" \u 22E0",nprec:" \u 2280",npreceq:" \u 2AAF \u 0338",npre:" \u 2AAF \u 0338",nrarrc:" \u 2933 \u 0338",nrarr:" \u 219B",nrArr:" \u 21CF",nrarrw:" \u 219D \u 0338",nrightarrow:" \u 219B",nRightarrow:" \u 21CF",nrtri:" \u 22EB",nrtrie:" \u 22ED",nsc:" \u 2281",nsccue:" \u 22E1",nsce:" \u 2AB0 \u 0338",Nscr:" \u {1D4A9}",nscr:" \u {1D4C3}",nshortmid:" \u 2224",nshortparallel:" \u 2226",nsim:" \u 2241",nsime:" \u 2244",nsimeq:" \u 2244",nsmid:" \u 2224",nspar:" \u 2226",nsqsube:" \u 22E2",nsqsupe:" \u 22E3",nsub:" \u 2284",nsubE:" \u 2AC5 \u 0338",nsube:" \u 2288",nsubset:" \u 2282 \u 20D2",nsubseteq:" \u 2288",nsubseteqq:" \u 2AC5 \u 0338",nsucc:" \u 2281",nsucceq:" \u 2AB0 \u 0338",nsup:" \u 2285",nsupE:" \u 2AC6 \u 0338",nsupe:" \u 2289",nsupset:" \u 2283 \u 20D2",nsupseteq:" \u 2289",nsupseteqq:" \u 2AC6 \u 0338",ntgl:" \u 2279",Ntilde:" \x D1",ntilde:" \x F1",ntlg:" \u 2278",ntriangleleft:" \u 22EA",ntrianglelefteq:" \u 22EC",ntriangleright:" \u 22EB",ntrianglerighteq:" \u 22ED",Nu:" \u 039D",nu:" \u 03BD",num:"#",numero:" \u 2116",numsp:" \u 2007",nvap:" \u 224D \u 20D2",nvdash:" \u 22AC",nvDash:" \u 22AD",nVdash:" \u 22AE",nVDash:" \u 22AF",nvge:" \u 2265 \u 20D2",nvgt:"> \u 20D2",nvHarr:" \u 2904",nvinfin:" \u 29DE",nvlArr:" \u 2902",nvle:" \u 2264 \u 20D2",nvlt:"< \u 20D2",nvltrie:" \u 22B4 \u 20D2",nvrArr:" \u 2903",nvrtrie:" \u 22B5 \u 20D2",nvsim:" \u 223C \u 20D2",nwarhk:" \u 2923",nwarr:" \u 2196",nwArr:" \u 21D6",nwarrow:" \u 2196",nwnear:" \u 2927",Oacute:" \x D3",oacute:" \x F3",oast:" \u 229B",Ocirc:" \x D4",ocirc:" \x F4",ocir:" \u 229A",Ocy:" \u 041E",ocy:" \u 043E",odash:" \u 229D",Odblac:" \u 0150",odblac:" \u 0151",odiv:" \u 2A38",odot:" \u 2299",odsold:" \u 29BC",OElig:" \u 0152",oelig:" \u 01
` ," "],Kh=["{","}","|"," \\ ","^"," ` "].concat(Gh),Zh=[" '"].concat(Kh),Vs=["%","/","?",";","#"].concat(Zh),Ws=["/","?","#"],Xh=255,Gs=/^[+a-z0-9A-Z_-]{0,63}$/,Yh=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ks={javascript:!0,"javascript:":!0},Zs={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Jh(n,t){if(n&&n instanceof li)return n;var e=new li;return e.parse(n,t),e}li.prototype.parse=function(n,t){var e,i,r,o,s,a=n;if(a=a.trim(),!t&&n.split("#").length===1){var l=Wh.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var c=jh.exec(a);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,a=a.substr(c.length)),(t||c||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=a.substr(0,2)==="//",s&&!(c&&Ks[c])&&(a=a.substr(2),this.slashes=!0)),!Ks[c]&&(s||c&&!Zs[c])){var u=-1;for(e=0;e<Ws.length;e++)o=a.indexOf(Ws[e]),o!==-1&&(u===-1||o<u)&&(u=o);var h,d;for(u===-1?d=a.lastIndexOf("@"):d=a.lastIndexOf("@",u),d!==-1&&(h=a.slice(0,d),a=a.slice(d+1),this.auth=h),u=-1,e=0;e<Vs.length;e++)o=a.indexOf(Vs[e]),o!==-1&&(u===-1||o<u)&&(u=o);u===-1&&(u=a.length),a[u-1]===":"&&u--;var f=a.slice(0,u);a=a.slice(u),this.parseHost(f),this.hostname=this.hostname||"";var p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){var m=this.hostname.split(/\./);for(e=0,i=m.length;e<i;e++){var w=m[e];if(w&&!w.match(Gs)){for(var v="",b=0,k=w.length;b<k;b++)w.charCodeAt(b)>127?v+="x":v+=w[b];if(!v.match(Gs)){var x=m.slice(0,e),E=m.slice(e+1),y=w.match(Yh);y&&(x.push(y[1]),E.unshift(y[2])),E.length&&(a=E.join(".")+a),this.hostname=x.join(".");break}}}}this.hostname.length>Xh&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var A=a.indexOf("#");A!==-1&&(this.hash=a.substr(A),a=a.slice(0,A));var D=a.indexOf("?");return D!==-1&&(this.search=a.substr(D),a=a.slice(0,D)),a&&(this.pathname=a),Zs[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};li.prototype.parseHost=function(n){var t=Vh.exec(n);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),n=n.substr(0,n.length-t.length)),n&&(this.hostname=n)};Xs.exports=Jh});var Kr=_((Rb,Ke)=>{"use strict";Ke.exports.encode=Rs();Ke.exports.decode=Hs();Ke.exports.format=js();Ke.exports.parse=Ys()});var Zr=_((Nb,Js)=>{Js.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/});var Xr=_((zb,Qs)=>{Qs.exports=/[\0-\x1F\x7F-\x9F]/});var ea=_((Hb,ta)=>{ta.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/});var Yr=_((Ub,na)=>{na.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/});var ia=_(ge=>{"use strict";ge.Any=Zr();ge.Cc=Xr();ge.Cf=ea();ge.P=oi();ge.Z=Yr()});var N=_(Q=>{"use strict";function Qh(n){return Object.prototype.toString.call(n)}function td(n){return Qh(n)==="[object String]"}var ed=Object.prototype.hasOwnProperty;function oa(n,t){return ed.call(n,t)}function nd(n){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(e){if(e){if(typeof e!="object")throw new TypeError(e+"must be object");Object.keys(e).forEach(function(i){n[i]=e[i]})}}),n}function id(n,t,e){return[].concat(n.slice(0,t),e,n.slice(t+1))}function sa(n){return!(n>=55296&&n<=57343||n>=64976&&n<=65007||(n&65535)===65535||(n&65535)===65534||n>=0&&n<=8||n===11||n>=14&&n<=31||n>=127&&n<=159||n>1114111)}function aa(n){if(n>65535){n-=65536;var t=55296+(n>>10),e=56320+(n&1023);return String.fromCharCode(t,e)}return String.fromCharCode(n)}var la=/\\([!"#$%&' ( ) * + , \ - . \ / : ; <= > ? @ [ \ \ \ ] ^ _ ` {|}~])/g,rd=/&([a-z#][a-z0-9]{1,31});/gi,od=new RegExp(la.source+"|"+rd.source,"gi"),sd=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8})) $ /i,ra=Gr();function ad(n,t){var e;return oa(ra,t)?ra[t]:t.charCodeAt(0)===35&&sd.test(t)&&(e=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10),sa(e))?aa(e):n}function ld(n){return n.indexOf(" \\ ")<0?n:n.replace(la," $ 1")}function cd(n){return n.indexOf(" \\ "
` };Dt.fence=function(n,t,e,i,r){var o=n[t],s=o.info?_d(o.info).trim():"",a="",l="",c,u,h,d,f;return s&&(h=s.split(/( \s +)/g),a=h[0],l=h.slice(2).join("")),e.highlight?c=e.highlight(o.content,a,l)||Jt(o.content):c=Jt(o.content),c.indexOf("<pre")===0?c+ `
2023-10-30 20:14:53 +08:00
` :s?(u=o.attrIndex("class"),d=o.attrs?o.attrs.slice():[],u<0?d.push(["class",e.langPrefix+a]):(d[u]=d[u].slice(),d[u][1]+=" "+e.langPrefix+a),f={attrs:d},"<pre><code"+r.renderAttrs(f)+">"+c+ ` < / c o d e > < / p r e >
2023-05-03 18:05:33 +08:00
` ):"<pre><code"+r.renderAttrs(o)+">"+c+ ` < / c o d e > < / p r e >
2023-10-30 20:14:53 +08:00
` };Dt.image=function(n,t,e,i,r){var o=n[t];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,e,i),r.renderToken(n,t,e)};Dt.hardbreak=function(n,t,e){return e.xhtmlOut? ` < br / >
2020-09-20 17:33:18 +08:00
` : ` < br >
2023-10-30 20:14:53 +08:00
` };Dt.softbreak=function(n,t,e){return e.breaks?e.xhtmlOut? ` < br / >
2020-09-20 17:33:18 +08:00
` : ` < br >
` : `
2023-12-29 20:16:07 +08:00
` };Dt.text=function(n,t){return Jt(n[t].content)};Dt.html_block=function(n,t){return n[t].content};Dt.html_inline=function(n,t){return n[t].content};function be(){this.rules=Ed({},Dt)}be.prototype.renderAttrs=function(t){var e,i,r;if(!t.attrs)return"";for(r="",e=0,i=t.attrs.length;e<i;e++)r+=" "+Jt(t.attrs[e][0])+'="'+Jt(t.attrs[e][1])+'"';return r};be.prototype.renderToken=function(t,e,i){var r,o="",s=!1,a=t[e];return a.hidden?"":(a.block&&a.nesting!==-1&&e&&t[e-1].hidden&&(o+= `
2023-10-30 20:14:53 +08:00
` ),o+=(a.nesting===-1?"</":"<")+a.tag,o+=this.renderAttrs(a),a.nesting===0&&i.xhtmlOut&&(o+=" /"),a.block&&(s=!0,a.nesting===1&&e+1<t.length&&(r=t[e+1],(r.type==="inline"||r.hidden||r.nesting===-1&&r.tag===a.tag)&&(s=!1))),o+=s? ` >
` :">",o)};be.prototype.renderInline=function(n,t,e){for(var i,r="",o=this.rules,s=0,a=n.length;s<a;s++)i=n[s].type,typeof o[i]<"u"?r+=o[i](n,s,t,e,this):r+=this.renderToken(n,s,t);return r};be.prototype.renderInlineAsText=function(n,t,e){for(var i="",r=0,o=n.length;r<o;r++)n[r].type==="text"?i+=n[r].content:n[r].type==="image"?i+=this.renderInlineAsText(n[r].children,t,e):n[r].type==="softbreak"&&(i+= `
2023-12-29 20:16:07 +08:00
` );return i};be.prototype.render=function(n,t,e){var i,r,o,s="",a=this.rules;for(i=0,r=n.length;i<r;i++)o=n[i].type,o==="inline"?s+=this.renderInline(n[i].children,t,e):typeof a[o]<"u"?s+=a[o](n,i,t,e,this):s+=this.renderToken(n,i,t,e);return s};ba.exports=be});var ui=_((Yb,wa)=>{"use strict";function Ct(){this.__rules__=[],this.__cache__=null}Ct.prototype.__find__=function(n){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===n)return t;return-1};Ct.prototype.__compile__=function(){var n=this,t=[""];n.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(i){t.indexOf(i)<0&&t.push(i)})}),n.__cache__={},t.forEach(function(e){n.__cache__[e]=[],n.__rules__.forEach(function(i){i.enabled&&(e&&i.alt.indexOf(e)<0||n.__cache__[e].push(i.fn))})})};Ct.prototype.at=function(n,t,e){var i=this.__find__(n),r=e||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__[i].fn=t,this.__rules__[i].alt=r.alt||[],this.__cache__=null};Ct.prototype.before=function(n,t,e,i){var r=this.__find__(n),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null};Ct.prototype.after=function(n,t,e,i){var r=this.__find__(n),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null};Ct.prototype.push=function(n,t,e){var i=e||{};this.__rules__.push({name:n,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null};Ct.prototype.enable=function(n,t){Array.isArray(n)||(n=[n]);var e=[];return n.forEach(function(i){var r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,e.push(i)},this),this.__cache__=null,e};Ct.prototype.enableOnly=function(n,t){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(n,t)};Ct.prototype.disable=function(n,t){Array.isArray(n)||(n=[n]);var e=[];return n.forEach(function(i){var r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,e.push(i)},this),this.__cache__=null,e};Ct.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]};wa.exports=Ct});var xa=_((Jb,ya)=>{"use strict";var Sd=/ \r \n ?| \n /g,Ad=/ \0 /g;ya.exports=function(t){var e;e=t.src.replace(Sd, `
` ),e=e.replace(Ad," \u FFFD"),t.src=e}});var Ca=_((Qb,ka)=>{"use strict";ka.exports=function(t){var e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}});var _a=_((tv,Ea)=>{"use strict";Ea.exports=function(t){var e=t.tokens,i,r,o;for(r=0,o=e.length;r<o;r++)i=e[r],i.type==="inline"&&t.md.inline.parse(i.content,t.md,t.env,i.children)}});var Aa=_((ev,Sa)=>{"use strict";var Dd=N().arrayReplaceAt;function Ld(n){return/^<a[> \s ]/i.test(n)}function Td(n){return/^< \/ a \s *>/i.test(n)}Sa.exports=function(t){var e,i,r,o,s,a,l,c,u,h,d,f,p,m,w,v,b=t.tokens,k;if(t.md.options.linkify){for(i=0,r=b.length;i<r;i++)if(!(b[i].type!=="inline"||!t.md.linkify.pretest(b[i].content)))for(o=b[i].children,p=0,e=o.length-1;e>=0;e--){if(a=o[e],a.type==="link_close"){for(e--;o[e].level!==a.level&&o[e].type!=="link_open";)e--;continue}if(a.type==="html_inline"&&(Ld(a.content)&&p>0&&p--,Td(a.content)&&p++),!(p>0)&&a.type==="text"&&t.md.linkify.test(a.content)){for(u=a.content,k=t.md.linkify.match(u),l=[],f=a.level,d=0,k.length>0&&k[0].index===0&&e>0&&o[e-1].type==="text_special"&&(k=k.slice(1)),c=0;c<k.length;c++)m=k[c].url,w=t.md.normalizeLink(m),t.md.validateLink(w)&&(v=k[c].text,k[c].schema?k[c].schema==="mailto:"&&!/^mailto:/i.test(v)?v=t.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):v=t.md.normalizeLinkText(v):v=t.md.normalizeLinkText("http://"+v).replace(/^http: \/ \/ /,""),h=k[c].index,h>d&&(s=new t.Token("text","",0),s.content=u.slice(d,h),s.level=f,l.push(s)),s=new t.Token("link_open","a",1),s.attrs=[["href",w]],s.level=f++,s.markup="linkify",s.info="auto",l.push(s),s=new t.Token("text","",0),s.content=v,s.level=f,l.push(s),s=new t.Token("link_close","a",-1),s.level=--f,s.markup="linkify",s.info="auto",l.push(s),d=k[c].lastIndex);d<u.length&&(s=new t.Token("text","",0),s.content=u.slice(d),s.level=f,l.push(s)),b[i].children=o=Dd(o,e,l)}}}}});var Ta=_((nv,La)=>{"use strict";var Da=/ \+ -| \. \. | \? \? \? \? |!!!!|,,|--/, $ d=/ \( (c|tm|r) \) /i,Id=/ \( (c|tm|r) \) /ig,Md={c:" \x A9",r:" \x AE",tm:" \u 2122"};function Fd(n,t){return Md[t.toLowerCase()]}function qd(n){var t,e,i=0;for(t=n.length-1;t>=0;t--)e=n[t],e.type==="text"&&!i&&(e.content=e.content.replace(Id,Fd)),e.type==="link_open"&&e.info==="auto"&&i--,e.type==="link_close"&&e.info==="auto"&&i++}function Bd(n){var t,e,i=0;for(t=n.length-1;t>=0;t--)e=n[t],e.type==="text"&&!i&&Da.test(e.content)&&(e.content=e.content.replace(/ \+ -/g," \x B1").replace(/ \. {2,}/g," \u 2026").replace(/([?!])…/g," $ 1..").replace(/([?!]){4,}/g," $ 1 $ 1 $ 1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]| $ )/mg," $ 1 \u 2014").replace(/(^| \s )--(?= \s | $ )/mg," $ 1 \u 2013").replace(/(^|[^- \s ])--(?=[^- \s ]| $ )/mg," $ 1 \u 2013")),e.type==="link_open"&&e.info==="auto"&&i--,e.type==="link_close"&&e.info==="auto"&&i++}La.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&( $ d.test(t.tokens[e].content)&&qd(t.tokens[e].children),Da.test(t.tokens[e].content)&&Bd(t.tokens[e].children))}});var Pa=_((iv,Ba)=>{"use strict";var $ a=N().isWhiteSpace,Ia=N().isPunctChar,Ma=N().isMdAsciiPunct,Pd=/['"]/,Fa=/['"]/g,qa=" \u 2019";function hi(n,t,e){return n.slice(0,t)+e+n.slice(t+1)}function Od(n,t){var e,i,r,o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y;for(x=[],e=0;e<n.length;e++){for(i=n[e],l=n[e].level,b=x.length-1;b>=0&&!(x[b].level<=l);b--);if(x.length=b+1,i.type==="text"){r=i.content,s=0,a=r.length;t:for(;s<a&&(Fa.lastIndex=s,o=Fa.exec(r),!!o);){if(w=v=!0,s=o.index+1,k=o[0]==="'",u=32,o.index-1>=0)u=r.charCodeAt(o.index-1);else for(b=e-1;b>=0&&!(n[b].type==="softbreak"||n[b].type==="hardbreak");b--)if(n[b].content){u=n[b].content.charCodeAt(n[b].content.length-1);break}if(h=32,s<a)h=r.charCodeAt(s);else for(b=e+1;b<n.length&&!(n[b].type==="softbreak"||n[b].type==="hardbreak");b++)if(n[b].content){h=n[b].content.charCodeAt(0);break}if(d=Ma(u)||Ia(String.fromCharCode(u)),f=Ma(h)||Ia(String.fromCharCode(h)),p= $ a(u),m= $ a(h),m?w=!1:f&&(p||d||(w=!1)),p?v=!1:d&&(m||f||(v=!1)),h===34&&o[0]==='"'&&u>=48&&u<=57&&(v=w=!1),w&&v&&(w=
` ,s.map=[e,t.line],!0}});var Ja=_((uv,Ya)=>{"use strict";Ya.exports=function(t,e,i,r){var o,s,a,l,c,u,h,d=!1,f=t.bMarks[e]+t.tShift[e],p=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||f+3>p||(o=t.src.charCodeAt(f),o!==126&&o!==96)||(c=f,f=t.skipChars(f,o),s=f-c,s<3)||(h=t.src.slice(c,f),a=t.src.slice(f,p),o===96&&a.indexOf(String.fromCharCode(o))>=0))return!1;if(r)return!0;for(l=e;l++,!(l>=i||(f=c=t.bMarks[l]+t.tShift[l],p=t.eMarks[l],f<p&&t.sCount[l]<t.blkIndent));)if(t.src.charCodeAt(f)===o&&!(t.sCount[l]-t.blkIndent>=4)&&(f=t.skipChars(f,o),!(f-c<s)&&(f=t.skipSpaces(f),!(f<p)))){d=!0;break}return s=t.sCount[e],t.line=l+(d?1:0),u=t.push("fence","code",0),u.info=a,u.content=t.getLines(e+1,l,s,!0),u.markup=h,u.map=[e,t.line],!0}});var tl=_((hv,Qa)=>{"use strict";var zd=N().isSpace;Qa.exports=function(t,e,i,r){var o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y,A,D,M=t.lineMax,T=t.bMarks[e]+t.tShift[e],P=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(T)!==62)return!1;if(r)return!0;for(p=[],m=[],b=[],k=[],y=t.md.block.ruler.getRules("blockquote"),v=t.parentType,t.parentType="blockquote",d=e;d<i&&(D=t.sCount[d]<t.blkIndent,T=t.bMarks[d]+t.tShift[d],P=t.eMarks[d],!(T>=P));d++){if(t.src.charCodeAt(T++)===62&&!D){for(l=t.sCount[d]+1,t.src.charCodeAt(T)===32?(T++,l++,o=!1,x=!0):t.src.charCodeAt(T)===9?(x=!0,(t.bsCount[d]+l)%4===3?(T++,l++,o=!1):o=!0):x=!1,f=l,p.push(t.bMarks[d]),t.bMarks[d]=T;T<P&&(s=t.src.charCodeAt(T),zd(s));){s===9?f+=4-(f+t.bsCount[d]+(o?1:0))%4:f++;T++}u=T>=P,m.push(t.bsCount[d]),t.bsCount[d]=t.sCount[d]+1+(x?1:0),b.push(t.sCount[d]),t.sCount[d]=f-l,k.push(t.tShift[d]),t.tShift[d]=T-t.bMarks[d];continue}if(u)break;for(E=!1,a=0,c=y.length;a<c;a++)if(y[a](t,d,i,!0)){E=!0;break}if(E){t.lineMax=d,t.blkIndent!==0&&(p.push(t.bMarks[d]),m.push(t.bsCount[d]),k.push(t.tShift[d]),b.push(t.sCount[d]),t.sCount[d]-=t.blkIndent);break}p.push(t.bMarks[d]),m.push(t.bsCount[d]),k.push(t.tShift[d]),b.push(t.sCount[d]),t.sCount[d]=-1}for(w=t.blkIndent,t.blkIndent=0,A=t.push("blockquote_open","blockquote",1),A.markup=">",A.map=h=[e,0],t.md.block.tokenize(t,e,d),A=t.push("blockquote_close","blockquote",-1),A.markup=">",t.lineMax=M,t.parentType=v,h[1]=t.line,a=0;a<k.length;a++)t.bMarks[a+e]=p[a],t.tShift[a+e]=k[a],t.sCount[a+e]=b[a],t.bsCount[a+e]=m[a];return t.blkIndent=w,!0}});var nl=_((dv,el)=>{"use strict";var Hd=N().isSpace;el.exports=function(t,e,i,r){var o,s,a,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||(o=t.src.charCodeAt(c++),o!==42&&o!==45&&o!==95))return!1;for(s=1;c<u;){if(a=t.src.charCodeAt(c++),a!==o&&!Hd(a))return!1;a===o&&s++}return s<3?!1:(r||(t.line=e+1,l=t.push("hr","hr",0),l.map=[e,t.line],l.markup=Array(s+1).join(String.fromCharCode(o))),!0)}});var al=_((pv,sl)=>{"use strict";var ol=N().isSpace;function il(n,t){var e,i,r,o;return i=n.bMarks[t]+n.tShift[t],r=n.eMarks[t],e=n.src.charCodeAt(i++),e!==42&&e!==45&&e!==43||i<r&&(o=n.src.charCodeAt(i),!ol(o))?-1:i}function rl(n,t){var e,i=n.bMarks[t]+n.tShift[t],r=i,o=n.eMarks[t];if(r+1>=o||(e=n.src.charCodeAt(r++),e<48||e>57))return-1;for(;;){if(r>=o)return-1;if(e=n.src.charCodeAt(r++),e>=48&&e<=57){if(r-i>=10)return-1;continue}if(e===41||e===46)break;return-1}return r<o&&(e=n.src.charCodeAt(r),!ol(e))?-1:r}function Ud(n,t){var e,i,r=n.level+2;for(e=t+2,i=n.tokens.length-2;e<i;e++)n.tokens[e].level===r&&n.tokens[e].type==="paragraph_open"&&(n.tokens[e+2].hidden=!0,n.tokens[e].hidden=!0,e+=2)}sl.exports=function(t,e,i,r){var o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y,A,D,M,T,P,H,U,et,W, $ =e,Ot=!1,Rt=!0;if(t.sCount[ $ ]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[ $ ]-t.listIndent>=4&&t.sCount[ $ ]<t.blkIndent)return!1;if(r&&t.parentType==="paragraph"&&t.sCount[ $ ]>=t.blkIndent&&(Ot=!0),(T=rl(t, $ ))>=0){if(h=!0,H=t.bMarks[ $ ]+t.tShift[ $ ],v=Number(t.src.slice(H,T-1)),Ot&&v!==1)return!1}else if((T=il(t, $ ))>=0)h=!1;else return!1;if(Ot&&t.skipSpaces(T)>=t.eMarks[ $ ])return!1;if(r)return!0;for(w=t.src.charCodeAt(T-1),m=t.tokens.length,h?(W=t.push("ordered_list_open","ol",1),v!==1&&(W.attrs=[["start",v]])):W=t.push("bullet_list_open","ul",1),W.map=p=[ $ ,0],W.markup=S
2024-01-24 18:37:20 +08:00
` );dr(t)}}function Xu(n){n.status&&n.status>=400&&n.data&&n.data.message&&dr(n.data.message)}var fr={};Se(fr,{HttpError:()=>sn,createXMLHttpRequest:()=>Ju,delete:()=>ih,get:()=>Qu,patch:()=>nh,post:()=>th,put:()=>eh});async function Yu(n){if(n.status===204)return null;let e=(n.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return e==="javascript"||e==="json"?n.json():n.text()}var sn=class extends Error{constructor(t,e){super(t.statusText),this.data=e,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};function Ju(n,t,e={}){let i=document.querySelector("meta[name=token]").getAttribute("content"),r=new XMLHttpRequest;for(let[o,s]of Object.entries(e))r.addEventListener(o,s.bind(r));return r.open(n,t),r.withCredentials=!0,r.setRequestHeader("X-CSRF-TOKEN",i),r}async function Ko(n,t={}){let e=n;if(e.startsWith("http")||(e=window.baseUrl(e)),t.params){let l=new URL(e);for(let c of Object.keys(t.params)){let u=t.params[c];typeof u<"u"&&u!==null&&l.searchParams.set(c,u)}e=l.toString()}let i=document.querySelector("meta[name=token]").getAttribute("content"),r={...t,credentials:"same-origin"};r.headers={...r.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":i};let o=await fetch(e,r),s=await Yu(o),a={data:s,headers:o.headers,redirected:o.redirected,status:o.status,statusText:o.statusText,url:o.url,original:o};if(!o.ok)throw new sn(o,s);return a}async function an(n,t,e=null){let i={method:n,body:e};return typeof e=="object"&&!(e instanceof FormData)&&(i.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},i.body=JSON.stringify(e)),e instanceof FormData&&n!=="post"&&(e.append("_method",n),i.method="post"),Ko(t,i)}async function Qu(n,t={}){return Ko(n,{method:"GET",params:t})}async function th(n,t=null){return an("POST",n,t)}async function eh(n,t=null){return an("PUT",n,t)}async function nh(n,t=null){return an("PATCH",n,t)}async function ih(n,t=null){return an("DELETE",n,t)}var mr=class{constructor(){this.store=new Map,this.parseTranslations()}parseTranslations(){let t=document.querySelectorAll('meta[name="translation"]');for(let e of t){let i=e.getAttribute("key"),r=e.getAttribute("value");this.store.set(i,r)}}get(t,e){let i=this.getTransText(t);return this.performReplacements(i,e)}getPlural(t,e,i){let r=this.getTransText(t);return this.parsePlural(r,e,i)}parsePlural(t,e,i){let r=t.split("|"),o=/^{([0-9]+)}/,s=/^ \[ ([0-9]+),([0-9*]+)]/,a=null;for(let l of r){let c=l.match(o);if(c!==null&&Number(c[1])===e){a=l.replace(o,"").trim();break}let u=l.match(s);if(u!==null&&Number(u[1])<=e&&(u[2]==="*"||Number(u[2])>=e)){a=l.replace(s,"").trim();break}}return a===null&&r.length>1&&(a=e===1?r[0]:r[1]),a===null&&(a=r[0]),this.performReplacements(a,i)}getTransText(t){let e=this.store.get(t);return e===void 0&&console.warn( ` Translation with key "${t}" does not exist ` ),e}performReplacements(t,e){if(!e)return t;let i=t.match(/:( \S +)/g);if(i===null)return t;let r=t;return i.forEach(o=>{let s=o.substring(1);typeof e[s]>"u"||(r=r.replace(o,e[s]))}),r}},Zo=mr;var yr={};Se(yr,{first:()=>ah,firstOnElement:()=>ch,get:()=>lh,init:()=>vr,register:()=>wr});function gr(n){let t=i=>i.slice(0,1).toUpperCase()+i.slice(1),e=n.split("-");return e[0]+e.slice(1).map(t).join("")}function Xo(n){return n.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}var Ae={},Yo={},br=new WeakMap;function rh(n,t){let e={},i={},r= ` $ { n } @ ` ,o= ` [ refs *= "${r}" ] ` ,s=[...t.querySelectorAll(o)];t.matches(o)&&s.push(t);for(let a of s){let l=a.getAttribute("refs").split(" ").filter(c=>c.startsWith(r)).map(c=>c.replace(r,"")).map(gr);for(let c of l)e[c]=a,typeof i[c]>"u"&&(i[c]=[]),i[c].push(a)}return{refs:e,manyRefs:i}}function oh(n,t){let e={},i= ` option : $ { n } : ` ;for(let{name:r,value:o}of t.attributes)if(r.startsWith(i)){let s=r.replace(i,"");e[gr(s)]=o||""}return e}function sh(n,t){let e=Yo[n];if(e===void 0)return;let i;try{i=new e,i. $ name=n,i. $ el=t;let o=rh(n,t);i. $ refs=o.refs,i. $ manyRefs=o.manyRefs,i. $ opts=oh(n,t),i.setup()}catch(o){console.error("Failed to cre
In order to be iterable , non - array objects must have a [ Symbol . iterator ] ( ) method . ` )}var vh="1.15.1";function It(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var Mt=It(/(?:Trident.*rv[ :]?11 \. |msie|iemobile|Windows Phone)/i),je=It(/Edge/i),os=It(/firefox/i),Re=It(/safari/i)&&!It(/chrome/i)&&!It(/android/i),ms=It(/iP(ad|od|hone)/i),gs=It(/chrome/i)&&It(/android/i),bs={capture:!1,passive:!1};function O(n,t,e){n.addEventListener(t,e,!Mt&&bs)}function B(n,t,e){n.removeEventListener(t,e,!Mt&&bs)}function Dn(n,t){if(t){if(t[0]===">"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function wh(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function xt(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&Dn(n,t):Dn(n,t))||i&&n===e)return n;if(n===e)break}while(n=wh(n))}return null}var ss=/ \s +/g;function Y(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(ss," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(ss," ")}}function S(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Xt(n,t){var e="";if(typeof n=="string")e=n;else do{var i=S(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(e)}function vs(n,t,e){if(n){var i=n.getElementsByTagName(t),r=0,o=i.length;if(e)for(;r<o;r++)e(i[r],r);return i}return[]}function St(){var n=document.scrollingElement;return n||document.documentElement}function j(n,t,e,i,r){if(!(!n.getBoundingClientRect&&n!==window)){var o,s,a,l,c,u,h;if(n!==window&&n.parentNode&&n!==St()?(o=n.getBoundingClientRect(),s=o.top,a=o.left,l=o.bottom,c=o.right,u=o.height,h=o.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(t||e)&&n!==window&&(r=r||n.parentNode,!Mt))do if(r&&r.getBoundingClientRect&&(S(r,"transform")!=="none"||e&&S(r,"position")!=="static")){var d=r.getBoundingClientRect();s-=d.top+parseInt(S(r,"border-top-width")),a-=d.left+parseInt(S(r,"border-left-width")),l=s+o.height,c=a+o.width;break}while(r=r.parentNode);if(i&&n!==window){var f=Xt(r||n),p=f&&f.a,m=f&&f.d;f&&(s/=m,a/=p,h/=p,u/=m,l=s+u,c=a+h)}return{top:s,left:a,bottom:l,right:c,width:h,height:u}}}function ws(n){var t=j(n),e=parseInt(S(n,"padding-left")),i=parseInt(S(n,"padding-top")),r=parseInt(S(n,"padding-right")),o=parseInt(S(n,"padding-bottom"));return t.top+=i+parseInt(S(n,"border-top-width")),t.left+=e+parseInt(S(n,"border-left-width")),t.width=n.clientWidth-e-r,t.height=n.clientHeight-i-o,t.bottom=t.top+t.height,t.right=t.left+t.width,t}function as(n,t,e){for(var i=jt(n,!0),r=j(n)[t];i;){var o=j(i)[e],s=void 0;if(e==="top"||e==="left"?s=r>=o:s=r<=o,!s)return i;if(i===St())break;i=jt(i,!1)}return!1}function pe(n,t,e,i){for(var r=0,o=0,s=n.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==I.ghost&&(i||s[o]!==I.dragged)&&xt(s[o],e.draggable,n,!1)){if(r===t)return s[o];r++}o++}return null}function Hr(n,t){for(var e=n.lastElementChild;e&&(e===I.ghost||S(e,"display")==="none"||t&&!Dn(e,t));)e=e.previousElementSibling;return e||null}function J(n,t){var e=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==I.clone&&(!t||Dn(n,t))&&e++;return e}function ls(n){var t=0,e=0,i=St();if(n)do{var r=Xt(n),o=r.a,s=r.d;t+=n.scrollLeft*o,e+=n.scrollTop*s}while(n!==i&&(n=n.parentNode));return[t,e]}function yh(n,t){for(var e in n)if(n.hasOwnProperty(e)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===n[e][i])return Number(e)}return-1}function jt(n,t){if(!n||!n.getBoundingClientRect)return St
2023-05-03 18:05:33 +08:00
` ).map(u=>u.indexOf( ` drawio - diagram = "${r}" ` )!==-1?l:u).join( `
2023-12-29 20:16:07 +08:00
` );L(this,ke,Ai).call(this,c,i),ee()}catch(a){throw this.handleDrawingUploadError(a),new Error( ` Failed to save image with error : $ { a } ` )}})}handleDrawingUploadError(t){t.status===413?window. $ events.emit("error",this.editor.config.text.serverUploadLimit):window. $ events.emit("error",this.editor.config.text.imageUploadError),console.error(t)}fullScreen(){let{container:t}=this.editor.config,e=t.classList.contains("fullscreen");t.classList.toggle("fullscreen",!e),document.body.classList.toggle("markdown-fullscreen",!e)}scrollToText(t){if(!t)return;let e=this.editor.cm.state.doc,i=1,r=-1;for(let s of e.iterLines()){if(s.includes(t)){r=i;break}i+=1}if(r===-1)return;let o=e.line(r);L(this,Ti,tu).call(this,o.from,o.to,!0),this.focus()}focus(){this.editor.cm.hasFocus||this.editor.cm.focus()}insertContent(t){L(this,Pt,ne).call(this,t,t.length)}prependContent(t){t=L(this,nn,No).call(this,t);let i=L(this,rt,ht).call(this).from+t.length+1;L(this,dt,vt).call(this,0,0, ` $ { t }
` ,i),this.focus()}appendContent(t){t=L(this,nn,No).call(this,t),L(this,dt,vt).call(this,this.editor.cm.state.doc.length, `
$ { t } ` ),this.focus()}replaceContent(t){L(this,ke,Ai).call(this,t)}replaceLineStart(t){let e=L(this,rt,ht).call(this),i=this.editor.cm.state.doc.lineAt(e.from),r=i.text,o=r.split(" ")[0];if(o===t){let c=r.replace( ` $ { t } ` ,""),u=e.from+(c.length-r.length);L(this,dt,vt).call(this,i.from,i.to,c,u);return}let s=r;/^[#> ` ] / . test ( o ) ? s = r . replace ( o , t ) . trim ( ) : t !== "" && ( s = ` ${ t } ${ r } ` ) ; let l = e . from + ( s . length - r . length ) ; L ( this , dt , vt ) . call ( this , i . from , i . to , s , l ) } wrapSelection ( t , e ) { let i = L ( this , rt , ht ) . call ( this ) , r = L ( this , Wt , ye ) . call ( this , i ) ; if ( ! r ) { L ( this , Ce , Di ) . call ( this , t , e ) ; return } let o = r , s ; r . startsWith ( t ) && r . endsWith ( e ) ? ( o = r . slice ( t . length , r . length - e . length ) , s = i . extend ( i . from , i . to - ( t . length + e . length ) ) ) : ( o = ` ${ t } ${ r } ${ e } ` , s = i . extend ( i . from , i . to + ( t . length + e . length ) ) ) , L ( this , dt , vt ) . call ( this , i . from , i . to , o , s . anchor , s . head ) } replaceLineStartForOrderedList ( ) { let t = L ( this , rt , ht ) . call ( this ) , e = this . editor . cm . state . doc . lineAt ( t . from ) , r = this . editor . cm . state . doc . line ( e . number - 1 ) . text . match ( /^(\s*)(\d)([).])\s/ ) || [ ] , o = ( Number ( r [ 2 ] ) || 0 ) + 1 , s = r [ 1 ] || "" , a = r [ 3 ] || "." , l = ` ${ s } ${ o } ${ a } ` ; return this . replaceLineStart ( l ) } cycleCalloutTypeAtSelection ( ) { let t = L ( this , rt , ht ) . call ( this ) , e = this . editor . cm . state . doc . lineAt ( t . from ) , i = [ "info" , "success" , "warning" , "danger" ] , r = i . join ( "|" ) , s = new RegExp ( ` class="(( ${ r } ) \\ s+callout|callout \\ s+( ${ r } ))" ` , "i" ) . exec ( e . text ) , a = ( s ? s [ 2 ] || s [ 3 ] : "" ) . toLowerCase ( ) ; if ( a === i [ i . length - 1 ] ) L ( this , Ce , Di ) . call ( this , ` <p class="callout ${ i [ i . length - 1 ] } "> ` , "</p>" ) ; else if ( a === "" ) L ( this , Ce , Di ) . call ( this , '<p class="callout info">' , "</p>" ) ; else { let l = i . indexOf ( a ) + 1 , c = i [ l ] , u = e . text . replace ( s [ 0 ] , s [ 0 ] . replace ( a , c ) ) , h = u . length - e . text . length ; L ( this , dt , vt ) . call ( this , e . from , e . to , u , t . anchor + h , t . head + h ) } } syncDisplayPosition ( t ) { let e = t . target ; if ( Math . abs ( e . scrollHeight - e . clientHeight - e . scrollTop ) < 1 ) { this . editor . display . scrollToIndex ( - 1 ) ; return } let r = this . editor . cm . lineBlockAtHeight ( e . scrollTop ) , o = this . editor . cm . state . sliceDoc ( 0 , r . from ) , l = new DOMParser ( ) . parseFromString ( this . editor . markdown . render ( o ) , "text/html" ) . documentElement . querySelectorAll ( "body > *" ) ; this . editor . display . scrollToIndex ( l . length ) } async insertTemplate ( t , e , i ) { let r = this . editor . cm . posAtCoords ( { x : e , y : i } , ! 1 ) , { data : o } = await window . $http . get ( ` /templates/ ${ t } ` ) , s = o . markdown || o . html ; L ( this , dt , vt ) . call ( this , r , r , s , r ) } insertClipboardImages ( t , e , i ) { let r = this . editor . cm . posAtCoords ( { x : e , y : i } , ! 1 ) ; for ( let o of t ) this . uploadImage ( o , r ) } async uploadImage ( t , e = null ) { if ( t === null || t . type . indexOf ( "image" ) !== 0 ) return ; let i = "png" ; if ( e === null && ( e = L ( this , rt , ht ) . call ( this ) . from ) , t . name ) { let c = t . name . match ( /\.(.+)$/ ) ; c . length > 1 && ( i = c [ 1 ] ) } let r = ` image- ${ Math . random ( ) . toString ( 16 ) . slice ( 2 ) } ` , s = `  } ) ` ; L ( this , dt , vt ) . call ( this , e , e , s , e ) ; let a = ` image- ${ Date . now ( ) } . ${ i } ` , l = new FormData ; l . append ( "file" , t , a ) , l . append ( "uploaded_to" , this . editor . config . pageId ) ; try { let { data : c } = await window . $http . post ( "/images/gallery" , l ) , u = ` []( ${ c . url } ) ` ; L ( this , rn , zo ) . call ( this , s , u ) } catch ( c ) { window . $events . error ( c ? . data ? . message || this . editor . config . text . imageUploadError ) , L ( this , rn , zo ) . call ( this , s , "" ) , console . error ( c ) } } } ; en = new WeakSet , Ro = function ( t , e ) { let i = ` <div drawio-diagram=" ${ t . id } "><img src=" ${ t . url } "></div> ` ; L ( this , Pt , ne ) . call ( this , i , i . length , e ) } , xe = new WeakSet , Si = function ( ) { return this . editor . cm . state . doc . toString ( ) } , ke = new WeakSet , Ai = function ( t , e = null ) { e = e || L ( this , rt , ht ) . call ( this ) ; let i = this . editor . cm . state . toText ( t ) , r = Math . min ( e . from , i . length ) ; L ( this , dt , vt ) . call ( this , 0 , this . editor . cm . state . doc . length , t , r ) , this . focus ( ) } , Pt = new WeakSet , ne = function ( t , e = 0 , i = null ) { i = i || this . editor . cm . state . selection . main ; let r = i . from + e ; L ( this , dt , vt ) . call ( this , i . from , i . to , t , r ) , this . focus ( ) } , Wt = new WeakSet , ye = function ( t = null ) { return t = t || L ( this , rt , ht ) . call ( this ) , this . editor . cm . state . sliceDoc ( t . from , t . to ) } , rt = new WeakSet , ht = function ( ) { return this . editor . cm . state . selection . main } , nn = new WeakSet , No = function ( t ) { return t . replace ( /\r\n|\r/g , `
` )},rn=new WeakSet,zo=function(t,e){let i=L(this,xe,Si).call(this).replace(t,e);L(this,ke,Ai).call(this,i)},Ce=new WeakSet,Di=function(t,e){let i=L(this,rt,ht).call(this),r=this.editor.cm.state.doc.lineAt(i.from),o=r.text,s,a=0;o.startsWith(t)&&o.endsWith(e)?(s=o.slice(t.length,o.length-e.length),a=-t.length):(s= ` $ { t } $ { o } $ { e } ` ,a=t.length),L(this,dt,vt).call(this,r.from,r.to,s,i.from+a)},dt=new WeakSet,vt=function(t,e=null,i=null,r=null,o=null){let s={changes:{from:t,to:e,insert:i}};r&&(s.selection={anchor:r},o&&(s.selection.head=o)),this.editor.cm.dispatch(s)},Ti=new WeakSet,tu=function(t,e,i=!1){this.editor.cm.dispatch({selection:{anchor:t,head:e},scrollIntoView:i})};var $ i=class{constructor(t){this.settingMap={scrollSync:!0,showPreview:!0,editorWidth:50},this.changeListeners={},this.loadFromLocalStorage(),this.applyToInputs(t),this.listenToInputChanges(t)}applyToInputs(t){for(let e of t){let i=e.getAttribute("name").replace("md-","");e.checked=this.settingMap[i]}}listenToInputChanges(t){for(let e of t)e.addEventListener("change",()=>{let i=e.getAttribute("name").replace("md-","");this.set(i,e.checked)})}loadFromLocalStorage(){let t=window.localStorage.getItem("md-editor-settings");if(!t)return;let e=JSON.parse(t);for(let[i,r]of Object.entries(e))r!==null&&this.settingMap[i]!==void 0&&(this.settingMap[i]=r)}set(t,e){this.settingMap[t]=e,window.localStorage.setItem("md-editor-settings",JSON.stringify(this.settingMap));for(let i of this.changeListeners[t]||[])i(e)}get(t){return this.settingMap[t]||null}onChange(t,e){let i=this.changeListeners[t]||[];i.push(e),this.changeListeners[t]=i}};function Ii({html:n,markdown:t}){return t||n}function eu(n){window. $ events.listen("editor::replace",t=>{let e=Ii(t);n.actions.replaceContent(e)}),window. $ events.listen("editor::append",t=>{let e=Ii(t);n.actions.appendContent(e)}),window. $ events.listen("editor::prepend",t=>{let e=Ii(t);n.actions.prependContent(e)}),window. $ events.listen("editor::insert",t=>{let e=Ii(t);n.actions.insertContent(e)}),window. $ events.listen("editor::focus",()=>{n.actions.focus()})}function Hf(n){let t={};return t["Shift-Mod-i"]=()=>n.actions.insertImage(),t["Mod-s"]=()=>window. $ events.emit("editor-save-draft"),t["Mod-Enter"]=()=>window. $ events.emit("editor-save-page"),t["Shift-Mod-k"]=()=>n.actions.showLinkSelector(),t["Mod-k"]=()=>n.actions.insertLink(),t["Mod-1"]=()=>n.actions.replaceLineStart("##"),t["Mod-2"]=()=>n.actions.replaceLineStart("###"),t["Mod-3"]=()=>n.actions.replaceLineStart("####"),t["Mod-4"]=()=>n.actions.replaceLineStart("#####"),t["Mod-5"]=()=>n.actions.replaceLineStart(""),t["Mod-d"]=()=>n.actions.replaceLineStart(""),t["Mod-6"]=()=>n.actions.replaceLineStart(">"),t["Mod-q"]=()=>n.actions.replaceLineStart(">"),t["Mod-7"]=()=>n.actions.wrapSelection(" \n ` ` ` \ n "," \ n ` ` ` "),t["Mod-8"]=()=>n.actions.wrapSelection(" ` "," ` "),t["Shift-Mod-e"]=()=>n.actions.wrapSelection(" ` "," ` "),t["Mod-9"]=()=>n.actions.cycleCalloutTypeAtSelection(),t["Mod-p"]=()=>n.actions.replaceLineStart("-"),t["Mod-o"]=()=>n.actions.replaceLineStartForOrderedList(),t}function nu(n){let t=Hf(n),e=[],i=r=>()=>(r(),!0);for(let[r,o]of Object.entries(t))e.push({key:r,run:i(o),preventDefault:!0});return e}async function iu(n){let t=await window.importVersioned("code");function e(a){a.docChanged&&n.actions.updateAndRender()}let i=Nt(n.actions.syncDisplayPosition.bind(n.actions),100,!1),r=n.settings.get("scrollSync");n.settings.onChange("scrollSync",a=>{r=a});let o={scroll:a=>r&&i(a),drop:a=>{let l=a.dataTransfer.getData("bookstack/template");l&&(a.preventDefault(),n.actions.insertTemplate(l,a.pageX,a.pageY));let u=new Ft(a.dataTransfer).getImages();u.length>0&&(a.stopPropagation(),a.preventDefault(),n.actions.insertClipboardImages(u,a.pageX,a.pageY))},paste:a=>{let l=new Ft(a.clipboardData||a.dataTransfer);if(!l.hasItems()||l.containsTabularData())return;let c=l.getImages();for(let u of c)n.actions.uploadImage(u)}},s=t.markdownEditor(n.config.inputEl,e,o,nu(n));return window.mdEditorView=s,s}async function ru(n){let t={config:n,markdown:new wi,settings:new $ i(n.settingInputs)};return t.ac
2024-01-24 18:37:20 +08:00
` ).length;this. $ refs.input.style.height= ` $ { t * 20 + 40 } px ` }async update(t){t.preventDefault();let e=this.showLoading();this.form.toggleAttribute("hidden",!0);let i={text:this.input.value,parent_id:this.parentId||null};try{let r=await window. $ http.put( ` / comment / $ { this . commentId } ` ,i),o=_t(r.data);this.container.replaceWith(o),window. $ events.success(this.updatedText)}catch(r){console.error(r),window. $ events.showValidationErrors(r),this.form.toggleAttribute("hidden",!1),e.remove()}}async delete(){this.showLoading(),await window. $ http.delete( ` / comment / $ { this . commentId } ` ),this.container.closest(".comment-branch").remove(),window. $ events.success(this.deletedText),this. $ emit("delete")}showLoading(){let t=ae();return t.classList.add("px-l"),this.container.append(t),t}};var Oi=class extends g{setup(){this.elem=this. $ el,this.pageId=Number(this. $ opts.pageId),this.container=this. $ refs.commentContainer,this.commentCountBar=this. $ refs.commentCountBar,this.commentsTitle=this. $ refs.commentsTitle,this.addButtonContainer=this. $ refs.addButtonContainer,this.replyToRow=this. $ refs.replyToRow,this.formContainer=this. $ refs.formContainer,this.form=this. $ refs.form,this.formInput=this. $ refs.formInput,this.formReplyLink=this. $ refs.formReplyLink,this.addCommentButton=this. $ refs.addCommentButton,this.hideFormButton=this. $ refs.hideFormButton,this.removeReplyToButton=this. $ refs.removeReplyToButton,this.createdText=this. $ opts.createdText,this.countText=this. $ opts.countText,this.parentId=null,this.formReplyText=this.formReplyLink?.textContent||"",this.setupListeners()}setupListeners(){this.elem.addEventListener("page-comment-delete",()=>{this.updateCount(),this.hideForm()}),this.elem.addEventListener("page-comment-reply",t=>{this.setReply(t.detail.id,t.detail.element)}),this.form&&(this.removeReplyToButton.addEventListener("click",this.removeReplyTo.bind(this)),this.hideFormButton.addEventListener("click",this.hideForm.bind(this)),this.addCommentButton.addEventListener("click",this.showForm.bind(this)),this.form.addEventListener("submit",this.saveComment.bind(this)))}saveComment(t){t.preventDefault(),t.stopPropagation();let e=ae();e.classList.add("px-l"),this.form.after(e),this.form.toggleAttribute("hidden",!0);let r={text:this.formInput.value,parent_id:this.parentId||null};window. $ http.post( ` / comment / $ { this . pageId } ` ,r).then(o=>{let s=_t(o.data);this.formContainer.after(s),window. $ events.success(this.createdText),this.hideForm(),this.updateCount()}).catch(o=>{this.form.toggleAttribute("hidden",!1),window. $ events.showValidationErrors(o)}),this.form.toggleAttribute("hidden",!1),e.remove()}updateCount(){let t=this.getCommentCount();this.commentsTitle.textContent=window.trans_plural(this.countText,t,{count:t})}resetForm(){this.formInput.value="",this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer)}showForm(){this.formContainer.toggleAttribute("hidden",!1),this.addButtonContainer.toggleAttribute("hidden",!0),this.formContainer.scrollIntoView({behavior:"smooth",block:"nearest"}),setTimeout(()=>{this.formInput.focus()},100)}hideForm(){this.resetForm(),this.formContainer.toggleAttribute("hidden",!0),this.getCommentCount()>0?this.elem.append(this.addButtonContainer):this.commentCountBar.append(this.addButtonContainer),this.addButtonContainer.toggleAttribute("hidden",!1)}getCommentCount(){return this.container.querySelectorAll('[component="page-comment"]').length}setReply(t,e){e.closest(".comment-branch").querySelector(".comment-branch-children").append(this.formContainer),this.showForm(),this.parentId=t,this.replyToRow.toggleAttribute("hidden",!1),this.formReplyLink.textContent=this.formReplyText.replace("1234",this.parentId),this.formReplyLink.href= ` # comment$ { this . parentId } ` }removeReplyTo(){this.parentId=null,this.replyToRow.toggleAttribute("hidden",!0),this.container.append(this.formContainer),this.showForm()}};function Uf(n,t){xr( ` # page - navigation a [ href = "#${n}" ] ` ,e=>{e.closest("li").classList.toggle("current-heading",t)})}function jf(n){for(let t of n){let e=t.intersectionRatio===1;Uf(t.target.id,e)}}function V
2023-12-29 20:16:07 +08:00
` ,e.replace(i)}})}function sm(n){n.parser.addNodeFilter("div",t=>{for(let e of t){let i=e.attr("id")||"",r=e.attr("class")||"";(i==="pointer"||r.includes("pointer"))&&e.remove()}})}function fu(n){om(n),sm(n)}function mu(n){return n.tagName.toLowerCase()==="code-block"}function bu(n,t,e,i){let r=window. $ components.first("code-editor"),o=n.selection.getBookmark();r.open(t,e,(s,a)=>{i(s,a),n.focus(),n.selection.moveToBookmark(o)},()=>{n.focus(),n.selection.moveToBookmark(o)})}function gu(n,t){bu(n,t.getContent(),t.getLanguage(),(e,i)=>{t.setContent(e,i)})}function am(n){let t=n.getDoc(),e=t.defaultView;class i extends e.HTMLElement{constructor(){super();at(this,"editor",null);this.attachShadow({mode:"open"});let s=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(s).map(c=>c.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let s=c=>(c.split(" ").filter(h=>h.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return s(l.className)||a&&s(a.className)||""}setContent(s,a){this.editor&&(this.editor.setContent(s),this.editor.setMode(a,s));let l=this.querySelector("pre");l||(l=t.createElement("pre"),this.append(l)),l.innerHTML="";let c=t.createElement("code");l.append(c),c.innerText=s,c.className= ` language - $ { a } ` }getContent(){let s=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=s.innerHTML.replace(/ \u feff/g,"");let l=a.querySelectorAll("br");for(let c of l)c.replaceWith( `
2023-05-03 18:05:33 +08:00
` );return a.textContent}connectedCallback(){let s=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),c=a.split( `
2024-01-24 18:37:20 +08:00
` ).length*19.2+18+24;this.style.height= ` $ { c } px ` ;let u=this.shadowRoot.querySelector(".CodeMirrorContainer"),h=d=>{this.editor=d.wysiwygView(u,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(d=>{let f=Date.now()-s<20?20:0;setTimeout(()=>h(d),f)})}cleanChildContent(){let s=this.querySelector("pre");if(s)for(let a of s.childNodes)a.nodeName==="#text"&&a.textContent===" \u FEFF"&&a.remove()}}e.customElements.define("code-block",i)}function lm(n){n.ui.registry.addIcon("codeblock",'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5Z"/><path d="M11.103 15.423c.277.277.277.738 0 .922a.692.692 0 0 1-1.106 0l-4.057-3.78a.738.738 0 0 1 0-1.107l4.057-3.872c.276-.277.83-.277 1.106 0a.724.724 0 0 1 0 1.014L7.6 12.012ZM12.897 8.577c-.245-.312-.2-.675.08-.955.28-.281.727-.27 1.027.033l4.057 3.78a.738.738 0 0 1 0 1.107l-4.057 3.872c-.277.277-.83.277-1.107 0a.724.724 0 0 1 0-1.014l3.504-3.412z"/></svg>'),n.ui.registry.addButton("codeeditor",{tooltip:"Insert code block",icon:"codeblock",onAction(){n.execCommand("codeeditor")}}),n.ui.registry.addButton("editcodeeditor",{tooltip:"Edit code block",icon:"edit-block",onAction(){n.execCommand("codeeditor")}}),n.addCommand("codeeditor",()=>{let t=n.selection.getNode(),e=t.ownerDocument;if(mu(t))gu(n,t);else{let i=n.selection.getContent({format:"text"});bu(n,i,"",(r,o)=>{let s=e.createElement("pre"),a=e.createElement("code");a.classList.add( ` language - $ { o } ` ),a.innerText=r,s.append(a),n.insertContent(s.outerHTML)})}}),n.on("dblclick",()=>{let t=n.selection.getNode();mu(t)&&gu(n,t)}),n.on("PreInit",()=>{n.parser.addNodeFilter("pre",t=>{for(let e of t){let i=window.tinymce.html.Node.create("code-block",{contenteditable:"false"}),r=e.getAll("span");for(let o of r)o.unwrap();e.attr("style",null),e.wrap(i)}}),n.parser.addNodeFilter("code-block",t=>{for(let e of t)e.attr("contenteditable","false")}),n.serializer.addNodeFilter("code-block",t=>{for(let e of t)e.unwrap()})}),n.ui.registry.addContextToolbar("codeeditor",{predicate(t){return t.nodeName.toLowerCase()==="code-block"},items:"editcodeeditor",position:"node",scope:"node"}),n.on("PreInit",()=>{am(n)})}function vu(){return lm}var pt=null,oe=null,re={};function Ho(n){return n.hasAttribute("drawio-diagram")}function cm(n,t=null){pt=n,oe=t,window. $ components.first("image-manager").show(i=>{if(t){let r=t.querySelector("img");pt.undoManager.transact(()=>{pt.dom.setAttrib(r,"src",i.url),pt.dom.setAttrib(t,"drawio-diagram",i.id)})}else{let r= ` < div drawio - diagram = "${i.id}" contenteditable = "false" > < img src = "${i.url}" > < / d i v > ` ; p t . i n s e r t C o n t e n t ( r ) } } , " d r a w i o " ) } a s y n c f u n c t i o n u m ( n ) { l e t t = w i n d o w . b a s e U r l ( " / l o a d i n g . g i f " ) , e = o = > { o . s t a t u s = = = 4 1 3 ? w i n d o w . $ e v e n t s . e m i t ( " e r r o r " , r e . t r a n s l a t i o n s . s e r v e r U p l o a d L i m i t T e x t ) : w i n d o w . $ e v e n t s . e m i t ( " e r r o r " , r e . t r a n s l a t i o n s . i m a g e U p l o a d E r r o r T e x t ) , c o n s o l e . e r r o r ( o ) } ; i f ( o e ) { e e ( ) ; l e t o = o e . q u e r y S e l e c t o r ( " i m g " ) ; t r y { l e t s = a w a i t O o ( n , r e . p a g e I d ) ; p t . u n d o M a n a g e r . t r a n s a c t ( ( ) = > { p t . d o m . s e t A t t r i b ( o , " s r c " , s . u r l ) , p t . d o m . s e t A t t r i b ( o e , " d r a w i o - d i a g r a m " , s . i d ) } ) } c a t c h ( s ) { t h r o w e ( s ) , n e w E r r o r ( ` F a i l e d t o s a v e i m a g e w i t h e r r o r : $ { s } ` ) } r e t u r n } a w a i t i s ( 5 ) ; l e t i = ` d r a w i n g - $ { M a t h . r a n d o m ( ) . t o S t r i n g ( 1 6 ) . s l i c e ( 2 ) } ` , r = ` d r a w i n g - w r a p - $ { M a t h . r a n d o m ( ) . t o S t r i n g ( 1 6 ) . s l i c e ( 2 ) } ` ; p t . i n s e r t C o n t e n t ( ` < d i v d r a w i o - d i a g r a m c o n t e n t e d i t a b l e = " f a l s e " i d = " $ { r } " > < i m g s r c = " $ { t } " i d = " $ { i } " > < / d i v > ` ) , e e ( ) ; t r y { l e t o = a w a i t O o ( n , r e . p a g e I d ) ; p t . u n d o M a n a g e r . t r a n s a c t ( ( ) = > { p t . d o m . s e t A t t r i b ( i , " s r c " , o . u r l ) , p t . d o m . s e t A t t r i b ( r , " d r a w i o - d i a g r a m " , o . i d ) } ) } c a t c h ( o ) { t h r o w p t . d o m . r e m o v e ( r ) , e ( o ) , n e w E r r o r ( ` F a i l e d t o s a v e i m a g e w i t h e r r o r : $ { o } ` ) } } f u n c t i o n h m ( ) { i f ( ! o e ) r e t u r n P r o m i s e . r e s o l v e ( " " ) ; l e t n = o e . g e t A t t r i b u t e ( " d r a w i o - d i a g r a m " ) ; r e t u r n _ i ( n ) } f u n c t i o n w u ( n , t = n u l l ) { p t = n , o e = t , t n ( r e . d r a w i o U r l , h m , u m ) } f u n c t i o n d m ( n ) { n . a d d C o m m a n d ( " d r a w i o " , ( ) = > { l e t t = n . s e l e c t i o n . g e t N o d e ( ) ; w u ( n , H o ( t ) ? t : n u l l ) } ) , n . u i . r e g i s t r y . a d d I c o n ( " d i a g r a m " , ` < s v g w i d t h = " 2 4 " h e i g h t = " 2 4 " f i l l = " $ { r e . d a r k M o d e ? " # B B B " : " # 0 0 0 0 0 0 " } " x m l n s = " h t t p : / / w w w . w 3 . o r g / 2 0 0 0 / s v g " > < p a t h d = " M 2 0 . 7 1 6 7 . 6 3 9 V 2 . 8 4 5 h - 4 . 7 9 4 v 1 . 5 9 8 h - 7 . 9 9 V 2 . 8 4 5 H 3 . 1 3 8 v 4 .
2023-10-30 20:14:53 +08:00
` ),t=n.findIndex(i=>i.trim()==="<!-- Start: custom user content -->"),e=n.findIndex(i=>i.trim()==="<!-- End: custom user content -->");return t===-1||e===-1?"":n.slice(t+1,e).join( `
2023-12-29 20:16:07 +08:00
` )}function Im(n){return function(e){function i(){n.darkMode&&e.contentDocument.documentElement.classList.add("dark-mode"),window. $ events.emit("editor-html-change","")}e.on("ExecCommand change input NodeChange ObjectResized",i),au(e),uu(e,n),e.on("init",()=>{i(),lu(e),window.editor=e,su(e)}),e.on("PreInit",()=>{fu(e)}),Du(e),window. $ events.emitPublic(n.containerElement,"editor-tinymce::setup",{editor:e}),e.ui.registry.addButton("inlinecode",{tooltip:"Inline code",icon:"sourcecode",onAction(){e.execCommand("mceToggleFormat",!1,"code")}})}}function $ u(n){return `
2022-02-26 20:01:44 +08:00
html , body , html . dark - mode {
2023-08-30 19:38:48 +08:00
background : $ { n . darkMode ? "#222" : "#fff" } ;
2022-02-26 20:01:44 +08:00
}
body {
padding - left : 15 px ! important ;
padding - right : 15 px ! important ;
height : initial ! important ;
margin : 0 ! important ;
margin - left : auto ! important ;
margin - right : auto ! important ;
overflow - y : hidden ! important ;
} ` .trim().replace( `
2023-12-29 20:16:07 +08:00
` ,"")}function Iu(n){return window.tinymce.addI18n(n.language,n.translationMap),{width:"100%",height:"100%",selector:"#html-editor",cache_suffix: ` ? version = $ { document . querySelector ( 'script[src*="/dist/app.js"]' ) . getAttribute ( "src" ) . split ( "?version=" ) [ 1 ] } ` ,content_css:[window.baseUrl("/dist/styles.css")],branding:!1,skin:n.darkMode?"tinymce-5-dark":"tinymce-5",body_class:"page-content",browser_spellcheck:!0,relative_urls:!1,language:n.language,directionality:n.textDirection,remove_script_host:!1,document_base_url:window.baseUrl("/"),end_container_on_empty_block:!0,remove_trailing_brs:!1,statusbar:!1,menubar:!1,paste_data_images:!1,extended_valid_elements:"pre[*],svg[*],div[drawio-diagram],details[*],summary[*],div[*],li[class|checked|style]",automatic_uploads:!1,custom_elements:"doc-root,code-block",valid_children:["-div[p|h1|h2|h3|h4|h5|h6|blockquote|code-block]","+div[pre|img]","-doc-root[doc-root|#text]","-li[details]","+code-block[pre]","+doc-root[p|h1|h2|h3|h4|h5|h6|blockquote|code-block|div|hr]"].join(","),plugins: $ m(n),contextmenu:!1,toolbar:hu(n),content_style: $ u(n),style_formats:Dm,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:Lm,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:Tm,file_picker_callback:Lu,paste_preprocess(e,i){let{content:r}=i;r.indexOf('<img src="file://')!==-1&&(i.content="")},init_instance_callback(e){let i=e.getDoc().querySelector("head");i.innerHTML+=Tu()},setup(e){pu(e),du(e),Im(n)(e)}}}function Mu(n){window.tinymce.addI18n(n.language,n.translationMap);let t=document.querySelector('script[src*="/dist/app.js"]').getAttribute("src").split("?version=")[1];return{width:"100%",height:"185px",target:n.containerElement,cache_suffix: ` ? version = $ { t } ` ,content_css:[window.baseUrl("/dist/styles.css")],branding:!1,skin:n.darkMode?"tinymce-5-dark":"tinymce-5",body_class:"wysiwyg-input",browser_spellcheck:!0,relative_urls:!1,language:n.language,directionality:n.textDirection,remove_script_host:!1,document_base_url:window.baseUrl("/"),end_container_on_empty_block:!0,remove_trailing_brs:!1,statusbar:!1,menubar:!1,plugins:"link autolink lists",contextmenu:!1,toolbar:"bold italic link bullist numlist",content_style: $ u(n),file_picker_types:"file",file_picker_callback:Lu,init_instance_callback(e){let i=e.getDoc().querySelector("head");i.innerHTML+=Tu(),e.contentDocument.documentElement.classList.toggle("dark-mode",n.darkMode)}}}var cr=class extends g{setup(){this.elem=this. $ el,this.tinyMceConfig=Iu({language:this. $ opts.language,containerElement:this.elem,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this. $ opts.textDirection,drawioUrl:this.getDrawIoUrl(),pageId:Number(this. $ opts.pageId),translations:{imageUploadErrorText:this. $ opts.imageUploadErrorText,serverUploadLimitText:this. $ opts.serverUploadLimitText},translationMap:window.editor_translations}),window. $ events.emitPublic(this.elem,"editor-tinymce::pre-init",{config:this.tinyMceConfig}),window.tinymce.init(this.tinyMceConfig).then(t=>{this.editor=t[0]})}getDrawIoUrl(){let t=document.querySelector("[drawio-url]");return t?t.getAttribute("drawio-url"):""}getContent(){return{html:this.editor.getContent()}}};var ur=class extends g{setup(){this.elem=this. $ el;let t=Mu({language:this. $ opts.language,containerElement:this.elem,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.textDirection,translations:{imageUploadErrorText:this. $ opts.imageUploadErrorText,serverUploadLimitText:this. $ opts.serverUploadLimitText},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.editor=e[0]})}};window.baseUrl=function(t){let e=t,i=document.querySelector('meta[name="base-url"]').getAttribute("content");return i[i.length-1]==="/"&&(i=i.slice(0,i.length-1)),e[0]==="/"&&(e=e.slice(1)), ` $ { i } / $ { e } ` };window.importVersioned=function(t){let e=document.querySelector('link[href*="/dist/styles.css?version="]').href.split("?version=").pop();return import(window.baseUrl( ` dist / $ { t } . js ? version = $ { e } ` ))};window. $ http=fr;window. $ events=pr;var Ee=new Zo
2023-01-31 19:59:51 +08:00
/ * ! B u n d l e d l i c e n s e i n f o r m a t i o n :
sortablejs / modular / sortable . esm . js :
( * * !
2023-12-29 20:16:07 +08:00
* Sortable 1.15 . 1
2023-01-31 19:59:51 +08:00
* @ author RubaXa < trash @ rubaxa . org >
* @ author owenm < owen23355 @ gmail . com >
* @ license MIT
* )
* /
2020-09-20 17:33:18 +08:00
//# sourceMappingURL=app.js.map