From 16cd9dc0e23e386c563256fca857d3dbce5ec89e Mon Sep 17 00:00:00 2001 From: lexx Date: Tue, 24 Oct 2023 00:14:32 +0300 Subject: [PATCH] assets --- front/dist/assets/main.0c67ca48.js | 188 ++++++++++++++++++++++++++++ front/dist/assets/main.7f90168e.js | 188 ---------------------------- front/dist/manifest.json | 2 +- src/Views/layouts/channel.blade.php | 1 - 4 files changed, 189 insertions(+), 190 deletions(-) create mode 100644 front/dist/assets/main.0c67ca48.js delete mode 100644 front/dist/assets/main.7f90168e.js diff --git a/front/dist/assets/main.0c67ca48.js b/front/dist/assets/main.0c67ca48.js new file mode 100644 index 0000000..221325b --- /dev/null +++ b/front/dist/assets/main.0c67ca48.js @@ -0,0 +1,188 @@ +var RN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jye(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Lc={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(o,e){(function(){var t,s="4.17.21",a=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",d="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",b=500,y="__lodash_placeholder__",k=1,E=2,M=4,$=1,Q=2,F=1,U=2,K=4,L=8,te=16,ne=32,oe=64,Y=128,ye=256,_e=512,Le=30,ve="...",ue=800,ot=16,nt=1,mt=2,V=3,ht=1/0,We=9007199254740991,Ct=17976931348623157e292,yt=0/0,Re=4294967295,Je=Re-1,an=Re>>>1,Et=[["ary",Y],["bind",F],["bindKey",U],["curry",L],["curryRight",te],["flip",_e],["partial",ne],["partialRight",oe],["rearg",ye]],An="[object Arguments]",Xe="[object Array]",_t="[object AsyncFunction]",he="[object Boolean]",Zo="[object Date]",ao="[object DOMException]",wn="[object Error]",Co="[object Function]",Ho="[object GeneratorFunction]",wt="[object Map]",Wt="[object Number]",gt="[object Null]",Ne="[object Object]",Gt="[object Promise]",gn="[object Proxy]",Dt="[object RegExp]",Dn="[object Set]",zn="[object String]",ps="[object Symbol]",oo="[object Undefined]",Ss="[object WeakMap]",Mr="[object WeakSet]",Rs="[object ArrayBuffer]",er="[object DataView]",Xs="[object Float32Array]",wa="[object Float64Array]",ur="[object Int8Array]",$s="[object Int16Array]",jr="[object Int32Array]",$o="[object Uint8Array]",Mo="[object Uint8ClampedArray]",Rr="[object Uint16Array]",Ls="[object Uint32Array]",aa=/\b__p \+= '';/g,bs=/\b(__p \+=) '' \+/g,_a=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ln=/&(?:amp|lt|gt|quot|#39);/g,vs=/[&<>"']/g,Qi=RegExp(ln.source),He=RegExp(vs.source),et=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Vt=/<%=([\s\S]+?)%>/g,Xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uo=/^\w*$/,Oo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,un=/[\\^$.*+?()[\]{}|]/g,os=RegExp(un.source),To=/^\s+/,fs=/\s/,kr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lr=/\{\n\/\* \[wrapped with (.+)\] \*/,Vs=/,? & /,Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zi=/[()=,{}\[\]\/\s]/,Fa=/\\(\\)?/g,vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,je=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,Ut=/^\[object .+?Constructor\]$/,fo=/^0o[0-7]+$/i,Lo=/^(?:0|[1-9]\d*)$/,Go=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jr=/($^)/,at=/['\n\r\u2028\u2029\\]/g,Xo="\\ud800-\\udfff",Ni="\\u0300-\\u036f",la="\\ufe20-\\ufe2f",ma="\\u20d0-\\u20ff",gr=Ni+la+ma,Fc="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",tl="\\xac\\xb1\\xd7\\xf7",ga="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tr="\\u2000-\\u206f",Ar=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ki="A-Z\\xc0-\\xd6\\xd8-\\xde",gl="\\ufe0e\\ufe0f",kc=tl+ga+tr+Ar,nu="['\u2019]",ku="["+Xo+"]",yr="["+kc+"]",nl="["+gr+"]",xu="\\d+",ou="["+Fc+"]",Yl="["+Cc+"]",Aa="[^"+Xo+kc+xu+Fc+Cc+Ki+"]",Dr="\\ud83c[\\udffb-\\udfff]",Qm="(?:"+nl+"|"+Dr+")",kf="[^"+Xo+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",Qa="[\\ud800-\\udbff][\\udc00-\\udfff]",ca="["+Ki+"]",Ji="\\u200d",Tu="(?:"+Yl+"|"+Aa+")",Qc="(?:"+ca+"|"+Aa+")",Za="(?:"+nu+"(?:d|ll|m|re|s|t|ve))?",Zc="(?:"+nu+"(?:D|LL|M|RE|S|T|VE))?",xc=Qm+"?",Cd="["+gl+"]?",Uf="(?:"+Ji+"(?:"+[kf,xr,Qa].join("|")+")"+Cd+xc+")*",Eu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hc=Cd+xc+Uf,xf="(?:"+[ou,xr,Qa].join("|")+")"+Hc,su="(?:"+[kf+nl+"?",nl,xr,Qa,ku].join("|")+")",kd=RegExp(nu,"g"),Ee=RegExp(nl,"g"),tt=RegExp(Dr+"(?="+Dr+")|"+su+Hc,"g"),pt=RegExp([ca+"?"+Yl+"+"+Za+"(?="+[yr,ca,"$"].join("|")+")",Qc+"+"+Zc+"(?="+[yr,ca+Tu,"$"].join("|")+")",ca+"?"+Tu+"+"+Za,ca+"+"+Zc,Xl,Eu,xu,xf].join("|"),"g"),Nt=RegExp("["+Ji+Xo+gr+gl+"]"),On=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ro=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$r=-1,ys={};ys[Xs]=ys[wa]=ys[ur]=ys[$s]=ys[jr]=ys[$o]=ys[Mo]=ys[Rr]=ys[Ls]=!0,ys[An]=ys[Xe]=ys[Rs]=ys[he]=ys[er]=ys[Zo]=ys[wn]=ys[Co]=ys[wt]=ys[Wt]=ys[Ne]=ys[Dt]=ys[Dn]=ys[zn]=ys[Ss]=!1;var ls={};ls[An]=ls[Xe]=ls[Rs]=ls[er]=ls[he]=ls[Zo]=ls[Xs]=ls[wa]=ls[ur]=ls[$s]=ls[jr]=ls[wt]=ls[Wt]=ls[Ne]=ls[Dt]=ls[Dn]=ls[zn]=ls[ps]=ls[$o]=ls[Mo]=ls[Rr]=ls[Ls]=!0,ls[wn]=ls[Co]=ls[Ss]=!1;var Ai={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},js={"&":"&","<":"<",">":">",'"':""","'":"'"},Hi={"&":"&","<":"<",">":">",""":'"',"'":"'"},Au={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xd=parseFloat,Gn=parseInt,Zm=typeof RN=="object"&&RN&&RN.Object===Object&&RN,zi=typeof self=="object"&&self&&self.Object===Object&&self,me=Zm||zi||Function("return this")(),$e=e&&!e.nodeType&&e,Ue=$e&&!0&&o&&!o.nodeType&&o,Bt=Ue&&Ue.exports===$e,Ln=Bt&&Zm.process,es=function(){try{var bt=Ue&&Ue.require&&Ue.require("util").types;return bt||Ln&&Ln.binding&&Ln.binding("util")}catch{}}(),so=es&&es.isArrayBuffer,Oi=es&&es.isDate,hn=es&&es.isMap,qr=es&&es.isRegExp,Ll=es&&es.isSet,ea=es&&es.isTypedArray;function ri(bt,cn,rn){switch(rn.length){case 0:return bt.call(cn);case 1:return bt.call(cn,rn[0]);case 2:return bt.call(cn,rn[0],rn[1]);case 3:return bt.call(cn,rn[0],rn[1],rn[2])}return bt.apply(cn,rn)}function Tf(bt,cn,rn,Ao){for(var nr=-1,Yr=bt==null?0:bt.length;++nr-1}function Yf(bt,cn,rn){for(var Ao=-1,nr=bt==null?0:bt.length;++Ao-1;);return rn}function Gf(bt,cn){for(var rn=bt.length;rn--&&Ha(cn,bt[rn],0)>-1;);return rn}function eh(bt,cn){for(var rn=bt.length,Ao=0;rn--;)bt[rn]===cn&&++Ao;return Ao}var Zg=Qg(Ai),Hm=Qg(js);function Ql(bt){return"\\"+Au[bt]}function zm(bt,cn){return bt==null?t:bt[cn]}function sl(bt){return Nt.test(bt)}function Af(bt){return On.test(bt)}function jh(bt){for(var cn,rn=[];!(cn=bt.next()).done;)rn.push(cn.value);return rn}function Ju(bt){var cn=-1,rn=Array(bt.size);return bt.forEach(function(Ao,nr){rn[++cn]=[nr,Ao]}),rn}function qh(bt,cn){return function(rn){return bt(cn(rn))}}function zc(bt,cn){for(var rn=-1,Ao=bt.length,nr=0,Yr=[];++rn-1}function q1(S,A){var Z=this.__data__,le=Md(Z,S);return le<0?(++this.size,Z.push([S,A])):Z[le][1]=A,this}$u.prototype.clear=tf,$u.prototype.delete=n0,$u.prototype.get=o0,$u.prototype.has=s0,$u.prototype.set=q1;function td(S){var A=-1,Z=S==null?0:S.length;for(this.clear();++A=A?S:A)),S}function Es(S,A,Z,le,Ce,Ve){var ft,xt=A&k,Ht=A&E,bn=A&M;if(Z&&(ft=Ce?Z(S,le,Ce,Ve):Z(S)),ft!==t)return ft;if(!Ol(S))return S;var Zn=Sr(S);if(Zn){if(ft=Dy(S),!xt)return du(S,ft)}else{var Vn=El(S),Fo=Vn==Co||Vn==Ho;if(gg(S))return tg(S,xt);if(Vn==Ne||Vn==An||Fo&&!Ce){if(ft=Ht||Fo?{}:ro(S),!xt)return Ht?mh(S,K1(ft,S)):sg(S,nf(ft,S))}else{if(!ls[Vn])return Ce?S:{};ft=Py(S,Vn,xt)}}Ve||(Ve=new Ac);var ms=Ve.get(S);if(ms)return ms;Ve.set(S,ft),i1(S)?S.forEach(function(Zs){ft.add(Es(Zs,A,Z,Zs,S,Ve))}):Tn(S)&&S.forEach(function(Zs,gi){ft.set(gi,Es(Zs,A,Z,gi,S,Ve))});var Ns=bn?Ht?Si:lg:Ht?gf:oc,Hr=Zn?t:Ns(S);return ks(Hr||S,function(Zs,gi){Hr&&(gi=Zs,Zs=S[gi]),Xm(ft,gi,Es(Zs,A,Z,gi,S,Ve))}),ft}function Rd(S){var A=oc(S);return function(Z){return xl(Z,S,A)}}function xl(S,A,Z){var le=Z.length;if(S==null)return!le;for(S=yi(S);le--;){var Ce=Z[le],Ve=A[Ce],ft=S[Ce];if(ft===t&&!(Ce in S)||!Ve(ft))return!1}return!0}function of(S,A,Z){if(typeof S!="function")throw new Sa(f);return ap(function(){S.apply(t,Z)},A)}function Va(S,A,Z,le){var Ce=-1,Ve=Ii,ft=!0,xt=S.length,Ht=[],bn=A.length;if(!xt)return Ht;Z&&(A=pa(A,za(Z))),le?(Ve=Yf,ft=!1):A.length>=a&&(Ve=Vi,ft=!1,A=new lo(A));e:for(;++CeCe?0:Ce+Z),le=le===t||le>Ce?Ce:Xr(le),le<0&&(le+=Ce),le=Z>le?0:Jv(le);Z0&&Z(xt)?A>1?Wa(xt,A-1,Z,le,Ce):Xf(Ce,xt):le||(Ce[Ce.length]=xt)}return Ce}var qg=d0(),Wc=d0(!0);function nd(S,A){return S&&qg(S,A,oc)}function od(S,A){return S&&Wc(S,A,oc)}function Yp(S,A){return uc(A,function(Z){return hm(S[Z])})}function Hl(S,A){A=rm(A,S);for(var Z=0,le=A.length;S!=null&&ZA}function Jl(S,A){return S!=null&&ii.call(S,A)}function l0(S,A){return S!=null&&A in yi(S)}function jm(S,A,Z){return S>=Tr(A,Z)&&S=120&&Zn.length>=120)?new lo(ft&&Zn):t}Zn=S[0];var Vn=-1,Fo=xt[0];e:for(;++Vn-1;)xt!==S&&rh.call(xt,Ht,1),rh.call(S,Ht,1);return S}function sf(S,A){for(var Z=S?A.length:0,le=Z-1;Z--;){var Ce=A[Z];if(Z==le||Ce!==Ve){var Ve=Ce;lm(Ce)?rh.call(S,Ce,1):Nf(S,Ce)}}return S}function $f(S,A){return S+Ke(Bi()*(A-S+1))}function fh(S,A,Z,le){for(var Ce=-1,Ve=ho(Se((A-S)/(Z||1)),0),ft=rn(Ve);Ve--;)ft[le?Ve:++Ce]=S,S+=Z;return ft}function dh(S,A){var Z="";if(!S||A<1||A>We)return Z;do A%2&&(Z+=S),A=Ke(A/2),A&&(S+=S);while(A);return Z}function fr(S,A){return Iy(n_(S,A,pf),S+"")}function Gm(S){return Nu(pb(S))}function Km(S,A){var Z=pb(S);return Yc(Z,ba(A,0,Z.length))}function oa(S,A,Z,le){if(!Ol(S))return S;A=rm(A,S);for(var Ce=-1,Ve=A.length,ft=Ve-1,xt=S;xt!=null&&++CeCe?0:Ce+A),Z=Z>Ce?Ce:Z,Z<0&&(Z+=Ce),Ce=A>Z?0:Z-A>>>0,A>>>=0;for(var Ve=rn(Ce);++le>>1,ft=S[Ve];ft!==null&&!il(ft)&&(Z?ft<=A:ft=a){var bn=A?null:Ey(S);if(bn)return Gh(bn);ft=!1,Ce=Vi,Ht=new lo}else Ht=A?[]:xt;e:for(;++le=le?S:Ps(S,A,Z)}var $d=Vp||function(S){return me.clearTimeout(S)};function tg(S,A){if(A)return S.slice();var Z=S.length,le=X1?X1(Z):new S.constructor(Z);return S.copy(le),le}function ng(S){var A=new S.constructor(S.byteLength);return new em(A).set(new em(S)),A}function im(S,A){var Z=A?ng(S.buffer):S.buffer;return new S.constructor(Z,S.byteOffset,S.byteLength)}function rf(S){var A=new S.constructor(S.source,qe.exec(S));return A.lastIndex=S.lastIndex,A}function f0(S){return Jf?yi(Jf.call(S)):{}}function tb(S,A){var Z=A?ng(S.buffer):S.buffer;return new S.constructor(Z,S.byteOffset,S.length)}function e_(S,A){if(S!==A){var Z=S!==t,le=S===null,Ce=S===S,Ve=il(S),ft=A!==t,xt=A===null,Ht=A===A,bn=il(A);if(!xt&&!bn&&!Ve&&S>A||Ve&&ft&&Ht&&!xt&&!bn||le&&ft&&Ht||!Z&&Ht||!Ce)return 1;if(!le&&!Ve&&!bn&&S=xt)return Ht;var bn=Z[le];return Ht*(bn=="desc"?-1:1)}}return S.index-A.index}function Jg(S,A,Z,le){for(var Ce=-1,Ve=S.length,ft=Z.length,xt=-1,Ht=A.length,bn=ho(Ve-ft,0),Zn=rn(Ht+bn),Vn=!le;++xt1?Z[Ce-1]:t,ft=Ce>2?Z[2]:t;for(Ve=S.length>3&&typeof Ve=="function"?(Ce--,Ve):t,ft&&af(Z[0],Z[1],ft)&&(Ve=Ce<3?t:Ve,Ce=1),A=yi(A);++le-1?Ce[Ve?A[ft]:ft]:t}}function Iv(S){return Bd(function(A){var Z=A.length,le=Z,Ce=Ru.prototype.thru;for(S&&A.reverse();le--;){var Ve=A[le];if(typeof Ve!="function")throw new Sa(f);if(Ce&&!ft&&Fd(Ve)=="wrapper")var ft=new Ru([],!0)}for(le=ft?le:Z;++le1&&Ci.reverse(),Zn&&Htxt))return!1;var bn=Ve.get(S),Zn=Ve.get(A);if(bn&&Zn)return bn==A&&Zn==S;var Vn=-1,Fo=!0,ms=Z&Q?new lo:t;for(Ve.set(S,A),Ve.set(A,S);++Vn1?"& ":"")+A[le],A=A.join(Z>2?", ":" "),S.replace(kr,`{ +/* [wrapped with `+A+`] */ +`)}function My(S){return Sr(S)||dm(S)||!!(Ed&&S&&S[Ed])}function lm(S,A){var Z=typeof S;return A=A==null?We:A,!!A&&(Z=="number"||Z!="symbol"&&Lo.test(S))&&S>-1&&S%1==0&&S0){if(++A>=ue)return arguments[0]}else A=0;return S.apply(t,arguments)}}function Yc(S,A){var Z=-1,le=S.length,Ce=le-1;for(A=A===t?le:A;++Z1?S[A-1]:t;return Z=typeof Z=="function"?(S.pop(),Z):t,Wv(S,Z)});function fp(S){var A=Te(S);return A.__chain__=!0,A}function Jp(S,A){return A(S),S}function e1(S,A){return A(S)}var fg=Bd(function(S){var A=S.length,Z=A?S[0]:0,le=this.__wrapped__,Ce=function(Ve){return Ui(Ve,S)};return A>1||this.__actions__.length||!(le instanceof hi)||!lm(Z)?this.thru(Ce):(le=le.slice(Z,+Z+(A?1:0)),le.__actions__.push({func:e1,args:[Ce],thisArg:t}),new Ru(le,this.__chain__).thru(function(Ve){return A&&!Ve.length&&Ve.push(t),Ve}))});function Uv(){return fp(this)}function sa(){return new Ru(this.value(),this.__chain__)}function ff(){this.__values__===t&&(this.__values__=f2(this.value()));var S=this.__index__>=this.__values__.length,A=S?t:this.__values__[this.__index__++];return{done:S,value:A}}function ab(){return this}function ek(S){for(var A,Z=this;Z instanceof Yg;){var le=Zv(Z);le.__index__=0,le.__values__=t,A?Ce.__wrapped__=le:A=le;var Ce=le;Z=Z.__wrapped__}return Ce.__wrapped__=S,A}function Xy(){var S=this.__wrapped__;if(S instanceof hi){var A=S;return this.__actions__.length&&(A=new hi(this)),A=A.reverse(),A.__actions__.push({func:e1,args:[Ta],thisArg:t}),new Ru(A,this.__chain__)}return this.thru(Ta)}function tk(){return Gg(this.__wrapped__,this.__actions__)}var t1=Bu(function(S,A,Z){ii.call(S,Z)?++S[Z]:mi(S,Z,1)});function lb(S,A,Z){var le=Sr(S)?Di:nn;return Z&&af(S,A,Z)&&(A=t),le(S,Qs(A,3))}function ad(S,A){var Z=Sr(S)?uc:xa;return Z(S,Qs(A,3))}var jy=ig(Hv),m_=ig(Qy);function g_(S,A){return Wa(o1(S,A),1)}function nk(S,A){return Wa(o1(S,A),ht)}function p_(S,A,Z){return Z=Z===t?1:Xr(Z),Wa(o1(S,A),Z)}function k0(S,A){var Z=Sr(S)?ks:ka;return Z(S,Qs(A,3))}function x0(S,A){var Z=Sr(S)?ru:Up;return Z(S,Qs(A,3))}var b_=Bu(function(S,A,Z){ii.call(S,Z)?S[Z].push(A):mi(S,Z,[A])});function qy(S,A,Z,le){S=bu(S)?S:pb(S),Z=Z&&!le?Xr(Z):0;var Ce=S.length;return Z<0&&(Z=ho(Ce+Z,0)),Ff(S)?Z<=Ce&&S.indexOf(A,Z)>-1:!!Ce&&Ha(S,A,Z)>-1}var n1=fr(function(S,A,Z){var le=-1,Ce=typeof A=="function",Ve=bu(S)?rn(S.length):[];return ka(S,function(ft){Ve[++le]=Ce?ri(A,ft,Z):hc(ft,A,Z)}),Ve}),v_=Bu(function(S,A,Z){mi(S,Z,A)});function o1(S,A){var Z=Sr(S)?pa:lt;return Z(S,Qs(A,3))}function dg(S,A,Z,le){return S==null?[]:(Sr(A)||(A=A==null?[]:[A]),Z=le?t:Z,Sr(Z)||(Z=Z==null?[]:[Z]),_i(S,A,Z))}var Yv=Bu(function(S,A,Z){S[Z?0:1].push(A)},function(){return[[],[]]});function df(S,A,Z){var le=Sr(S)?pr:qf,Ce=arguments.length<3;return le(S,Qs(A,4),Z,Ce,ka)}function cb(S,A,Z){var le=Sr(S)?qu:qf,Ce=arguments.length<3;return le(S,Qs(A,4),Z,Ce,Up)}function qs(S,A){var Z=Sr(S)?uc:xa;return Z(S,Ch(Qs(A,3)))}function pu(S){var A=Sr(S)?Nu:Gm;return A(S)}function hg(S,A,Z){(Z?af(S,A,Z):A===t)?A=1:A=Xr(A);var le=Sr(S)?Wp:Km;return le(S,A)}function Gy(S){var A=Sr(S)?G1:Jm;return A(S)}function Yi(S){if(S==null)return 0;if(bu(S))return Ff(S)?Kf(S):S.length;var A=El(S);return A==wt||A==Dn?S.size:q(S).length}function Ky(S,A,Z){var le=Sr(S)?Gu:Fr;return Z&&af(S,A,Z)&&(A=t),le(S,Qs(A,3))}var mg=fr(function(S,A){if(S==null)return[];var Z=A.length;return Z>1&&af(S,A[0],A[1])?A=[]:Z>2&&af(A[0],A[1],A[2])&&(A=[A[0]]),_i(S,Wa(A,1),[])}),Oa=ee||function(){return me.Date.now()};function fm(S,A){if(typeof A!="function")throw new Sa(f);return S=Xr(S),function(){if(--S<1)return A.apply(this,arguments)}}function zt(S,A,Z){return A=Z?t:A,A=S&&A==null?S.length:A,Id(S,Y,t,t,t,t,A)}function T0(S,A){var Z;if(typeof A!="function")throw new Sa(f);return S=Xr(S),function(){return--S>0&&(Z=A.apply(this,arguments)),S<=1&&(A=t),Z}}var Jy=fr(function(S,A,Z){var le=F;if(Z.length){var Ce=zc(Z,hu(Jy));le|=ne}return Id(S,le,A,Z,Ce)}),E0=fr(function(S,A,Z){var le=F|U;if(Z.length){var Ce=zc(Z,hu(E0));le|=ne}return Id(A,le,S,Z,Ce)});function Sh(S,A,Z){A=Z?t:A;var le=Id(S,L,t,t,t,t,t,A);return le.placeholder=Sh.placeholder,le}function hf(S,A,Z){A=Z?t:A;var le=Id(S,te,t,t,t,t,t,A);return le.placeholder=hf.placeholder,le}function ub(S,A,Z){var le,Ce,Ve,ft,xt,Ht,bn=0,Zn=!1,Vn=!1,Fo=!0;if(typeof S!="function")throw new Sa(f);A=cd(A)||0,Ol(Z)&&(Zn=!!Z.leading,Vn="maxWait"in Z,Ve=Vn?ho(cd(Z.maxWait)||0,A):Ve,Fo="trailing"in Z?!!Z.trailing:Fo);function ms(Ea){var bm=le,ud=Ce;return le=Ce=t,bn=Ea,ft=S.apply(ud,bm),ft}function Ns(Ea){return bn=Ea,xt=ap(gi,A),Zn?ms(Ea):ft}function Hr(Ea){var bm=Ea-Ht,ud=Ea-bn,k2=A-bm;return Vn?Tr(k2,Ve-ud):k2}function Zs(Ea){var bm=Ea-Ht,ud=Ea-bn;return Ht===t||bm>=A||bm<0||Vn&&ud>=Ve}function gi(){var Ea=Oa();if(Zs(Ea))return Ci(Ea);xt=ap(gi,Hr(Ea))}function Ci(Ea){return xt=t,Fo&&le?ms(Ea):(le=Ce=t,ft)}function Ou(){xt!==t&&$d(xt),bn=0,le=Ht=Ce=xt=t}function Qu(){return xt===t?ft:Ci(Oa())}function Qf(){var Ea=Oa(),bm=Zs(Ea);if(le=arguments,Ce=this,Ht=Ea,bm){if(xt===t)return Ns(Ht);if(Vn)return $d(xt),xt=ap(gi,A),ms(Ht)}return xt===t&&(xt=ap(gi,A)),ft}return Qf.cancel=Ou,Qf.flush=Qu,Qf}var Xv=fr(function(S,A){return of(S,1,A)}),e2=fr(function(S,A,Z){return of(S,cd(A)||0,Z)});function jv(S){return Id(S,_e)}function A0(S,A){if(typeof S!="function"||A!=null&&typeof A!="function")throw new Sa(f);var Z=function(){var le=arguments,Ce=A?A.apply(this,le):le[0],Ve=Z.cache;if(Ve.has(Ce))return Ve.get(Ce);var ft=S.apply(this,le);return Z.cache=Ve.set(Ce,ft)||Ve,ft};return Z.cache=new(A0.Cache||td),Z}A0.Cache=td;function Ch(S){if(typeof S!="function")throw new Sa(f);return function(){var A=arguments;switch(A.length){case 0:return!S.call(this);case 1:return!S.call(this,A[0]);case 2:return!S.call(this,A[0],A[1]);case 3:return!S.call(this,A[0],A[1],A[2])}return!S.apply(this,A)}}function ld(S){return T0(2,S)}var Lu=Ra(function(S,A){A=A.length==1&&Sr(A[0])?pa(A[0],za(Qs())):pa(Wa(A,1),za(Qs()));var Z=A.length;return fr(function(le){for(var Ce=-1,Ve=Tr(le.length,Z);++Ce=A}),dm=Tt(function(){return arguments}())?Tt:function(S){return Pl(S)&&ii.call(S,"callee")&&!tm.call(S,"callee")},Sr=rn.isArray,w_=so?za(so):Dc;function bu(S){return S!=null&&r1(S.length)&&!hm(S)}function Dl(S){return Pl(S)&&bu(S)}function s2(S){return S===!0||S===!1||Pl(S)&&Ua(S)==he}var gg=Pn||gm,bc=Oi?za(Oi):au;function AE(S){return Pl(S)&&S.nodeType===1&&!fb(S)}function pg(S){if(S==null)return!0;if(bu(S)&&(Sr(S)||typeof S=="string"||typeof S.splice=="function"||gg(S)||Qd(S)||dm(S)))return!S.length;var A=El(S);if(A==wt||A==Dn)return!S.size;if(rp(S))return!q(S).length;for(var Z in S)if(ii.call(S,Z))return!1;return!0}function ok(S,A){return mc(S,A)}function sk(S,A,Z){Z=typeof Z=="function"?Z:t;var le=Z?Z(S,A):t;return le===t?mc(S,A,t,Z):!!le}function r2(S){if(!Pl(S))return!1;var A=Ua(S);return A==wn||A==ao||typeof S.message=="string"&&typeof S.name=="string"&&!fb(S)}function i2(S){return typeof S=="number"&&_n(S)}function hm(S){if(!Ol(S))return!1;var A=Ua(S);return A==Co||A==Ho||A==_t||A==gn}function a2(S){return typeof S=="number"&&S==Xr(S)}function r1(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=We}function Ol(S){var A=typeof S;return S!=null&&(A=="object"||A=="function")}function Pl(S){return S!=null&&typeof S=="object"}var Tn=hn?za(hn):Xa;function rk(S,A){return S===A||ja(S,A,bh(A))}function nc(S,A,Z){return Z=typeof Z=="function"?Z:t,ja(S,A,bh(A),Z)}function ik(S){return c2(S)&&S!=+S}function l2(S){if(Bf(S))throw new nr(l);return qm(S)}function no(S){return S===null}function Pc(S){return S==null}function c2(S){return typeof S=="number"||Pl(S)&&Ua(S)==Wt}function fb(S){if(!Pl(S)||Ua(S)!=Ne)return!1;var A=Wm(S);if(A===null)return!0;var Z=ii.call(A,"constructor")&&A.constructor;return typeof Z=="function"&&Z instanceof Z&&ef.call(Z)==Y1}var mf=qr?za(qr):lu;function Kv(S){return a2(S)&&S>=-We&&S<=We}var i1=Ll?za(Ll):c0;function Ff(S){return typeof S=="string"||!Sr(S)&&Pl(S)&&Ua(S)==zn}function il(S){return typeof S=="symbol"||Pl(S)&&Ua(S)==ps}var Qd=ea?za(ea):zo;function Zd(S){return S===t}function jc(S){return Pl(S)&&El(S)==Ss}function db(S){return Pl(S)&&Ua(S)==Mr}var u2=li(Ae),__=li(function(S,A){return S<=A});function f2(S){if(!S)return[];if(bu(S))return Ff(S)?jl(S):du(S);if(ai&&S[ai])return jh(S[ai]());var A=El(S),Z=A==wt?Ju:A==Dn?Gh:pb;return Z(S)}function kh(S){if(!S)return S===0?S:0;if(S=cd(S),S===ht||S===-ht){var A=S<0?-1:1;return A*Ct}return S===S?S:0}function Xr(S){var A=kh(S),Z=A%1;return A===A?Z?A-Z:A:0}function Jv(S){return S?ba(Xr(S),0,Re):0}function cd(S){if(typeof S=="number")return S;if(il(S))return yt;if(Ol(S)){var A=typeof S.valueOf=="function"?S.valueOf():S;S=Ol(A)?A+"":A}if(typeof S!="string")return S===0?S:+S;S=Fl(S);var Z=It.test(S);return Z||fo.test(S)?Gn(S.slice(2),Z?2:8):je.test(S)?yt:+S}function S_(S){return If(S,gf(S))}function C_(S){return S?ba(Xr(S),-We,We):S===0?S:0}function fa(S){return S==null?"":Gi(S)}var ak=Nd(function(S,A){if(rp(A)||bu(A)){If(A,oc(A),S);return}for(var Z in A)ii.call(A,Z)&&Xm(S,Z,A[Z])}),eO=Nd(function(S,A){If(A,gf(A),S)}),tO=Nd(function(S,A,Z,le){If(A,gf(A),S,le)}),k_=Nd(function(S,A,Z,le){If(A,oc(A),S,le)}),lk=Bd(Ui);function hb(S,A){var Z=Pf(S);return A==null?Z:nf(Z,A)}var x_=fr(function(S,A){S=yi(S);var Z=-1,le=A.length,Ce=le>2?A[2]:t;for(Ce&&af(A[0],A[1],Ce)&&(le=1);++Z1),Ve}),If(S,Si(S),Z),le&&(Z=Es(Z,k|E|M,UC));for(var Ce=A.length;Ce--;)Nf(Z,A[Ce]);return Z});function P_(S,A){return mp(S,Ch(Qs(A)))}var M_=Bd(function(S,A){return S==null?{}:or(S,A)});function mp(S,A){if(S==null)return{};var Z=pa(Si(S),function(le){return[le]});return A=Qs(A),_r(S,Z,function(le,Ce){return A(le,Ce[0])})}function mk(S,A,Z){A=rm(A,S);var le=-1,Ce=A.length;for(Ce||(Ce=1,S=t);++leA){var le=S;S=A,A=le}if(Z||S%1||A%1){var Ce=Bi();return Tr(S+Ce*(A-S+xd("1e-"+((Ce+"").length-1))),A)}return $f(S,A)}var N_=gh(function(S,A,Z){return A=A.toLowerCase(),S+(Z?xh(A):A)});function xh(S){return bb(fa(S).toLowerCase())}function $0(S){return S=fa(S),S&&S.replace(Go,Zg).replace(Ee,"")}function I_(S,A,Z){S=fa(S),A=Gi(A);var le=S.length;Z=Z===t?le:ba(Xr(Z),0,le);var Ce=Z;return Z-=A.length,Z>=0&&S.slice(Z,Ce)==A}function Th(S){return S=fa(S),S&&He.test(S)?S.replace(vs,Hm):S}function gp(S){return S=fa(S),S&&os.test(S)?S.replace(un,"\\$&"):S}var m2=gh(function(S,A,Z){return S+(Z?"-":"")+A.toLowerCase()}),B_=gh(function(S,A,Z){return S+(Z?" ":"")+A.toLowerCase()}),aO=$v("toLowerCase");function bk(S,A,Z){S=fa(S),A=Xr(A);var le=A?Kf(S):0;if(!A||le>=A)return S;var Ce=(A-le)/2;return tp(Ke(Ce),Z)+S+tp(Se(Ce),Z)}function L_(S,A,Z){S=fa(S),A=Xr(A);var le=A?Kf(S):0;return A&&le>>0,Z?(S=fa(S),S&&(typeof A=="string"||A!=null&&!mf(A))&&(A=Gi(A),!A&&sl(S))?hh(jl(S),0,Z):S.split(A,Z)):[]}var wk=gh(function(S,A,Z){return S+(Z?" ":"")+bb(A)});function _k(S,A,Z){return S=fa(S),Z=Z==null?0:ba(Xr(Z),0,S.length),A=Gi(A),S.slice(Z,Z+A.length)==A}function H_(S,A,Z){var le=Te.templateSettings;Z&&af(S,A,Z)&&(A=t),S=fa(S),A=tO({},A,le,t_);var Ce=tO({},A.imports,le.imports,t_),Ve=oc(Ce),ft=qi(Ce,Ve),xt,Ht,bn=0,Zn=A.interpolate||Jr,Vn="__p += '",Fo=nh((A.escape||Jr).source+"|"+Zn.source+"|"+(Zn===Vt?vi:Jr).source+"|"+(A.evaluate||Jr).source+"|$","g"),ms="//# sourceURL="+(ii.call(A,"sourceURL")?(A.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$r+"]")+` +`;S.replace(Fo,function(Zs,gi,Ci,Ou,Qu,Qf){return Ci||(Ci=Ou),Vn+=S.slice(bn,Qf).replace(at,Ql),gi&&(xt=!0,Vn+=`' + +__e(`+gi+`) + +'`),Qu&&(Ht=!0,Vn+=`'; +`+Qu+`; +__p += '`),Ci&&(Vn+=`' + +((__t = (`+Ci+`)) == null ? '' : __t) + +'`),bn=Qf+Zs.length,Zs}),Vn+=`'; +`;var Ns=ii.call(A,"variable")&&A.variable;if(!Ns)Vn=`with (obj) { +`+Vn+` +} +`;else if(Zi.test(Ns))throw new nr(d);Vn=(Ht?Vn.replace(aa,""):Vn).replace(bs,"$1").replace(_a,"$1;"),Vn="function("+(Ns||"obj")+`) { +`+(Ns?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(xt?", __e = _.escape":"")+(Ht?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Vn+`return __p +}`;var Hr=b2(function(){return Yr(Ve,ms+"return "+Vn).apply(t,ft)});if(Hr.source=Vn,r2(Hr))throw Hr;return Hr}function g2(S){return fa(S).toLowerCase()}function p2(S){return fa(S).toUpperCase()}function Sk(S,A,Z){if(S=fa(S),S&&(Z||A===t))return Fl(S);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=jl(A),Ve=fc(le,Ce),ft=Gf(le,Ce)+1;return hh(le,Ve,ft).join("")}function Ck(S,A,Z){if(S=fa(S),S&&(Z||A===t))return S.slice(0,Hg(S)+1);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=Gf(le,jl(A))+1;return hh(le,0,Ce).join("")}function lO(S,A,Z){if(S=fa(S),S&&(Z||A===t))return S.replace(To,"");if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=fc(le,jl(A));return hh(le,Ce).join("")}function z_(S,A){var Z=Le,le=ve;if(Ol(A)){var Ce="separator"in A?A.separator:Ce;Z="length"in A?Xr(A.length):Z,le="omission"in A?Gi(A.omission):le}S=fa(S);var Ve=S.length;if(sl(S)){var ft=jl(S);Ve=ft.length}if(Z>=Ve)return S;var xt=Z-Kf(le);if(xt<1)return le;var Ht=ft?hh(ft,0,xt).join(""):S.slice(0,xt);if(Ce===t)return Ht+le;if(ft&&(xt+=Ht.length-xt),mf(Ce)){if(S.slice(xt).search(Ce)){var bn,Zn=Ht;for(Ce.global||(Ce=nh(Ce.source,fa(qe.exec(Ce))+"g")),Ce.lastIndex=0;bn=Ce.exec(Zn);)var Vn=bn.index;Ht=Ht.slice(0,Vn===t?xt:Vn)}}else if(S.indexOf(Gi(Ce),xt)!=xt){var Fo=Ht.lastIndexOf(Ce);Fo>-1&&(Ht=Ht.slice(0,Fo))}return Ht+le}function cO(S){return S=fa(S),S&&Qi.test(S)?S.replace(ln,Ge):S}var N0=gh(function(S,A,Z){return S+(Z?" ":"")+A.toUpperCase()}),bb=$v("toUpperCase");function uO(S,A,Z){return S=fa(S),A=Z?t:A,A===t?Af(S)?zg(S):Jd(S):S.match(A)||[]}var b2=fr(function(S,A){try{return ri(S,t,A)}catch(Z){return r2(Z)?Z:new nr(Z)}}),V_=Bd(function(S,A){return ks(A,function(Z){Z=lf(Z),mi(S,Z,Jy(S[Z],S))}),S});function v2(S){var A=S==null?0:S.length,Z=Qs();return S=A?pa(S,function(le){if(typeof le[1]!="function")throw new Sa(f);return[Z(le[0]),le[1]]}):[],fr(function(le){for(var Ce=-1;++CeWe)return[];var Z=Re,le=Tr(S,Re);A=Qs(A),S-=Re;for(var Ce=Pr(le,A);++Z0||A<0)?new hi(Z):(S<0?Z=Z.takeRight(-S):S&&(Z=Z.drop(S)),A!==t&&(A=Xr(A),Z=A<0?Z.dropRight(-A):Z.take(A-S)),Z)},hi.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},hi.prototype.toArray=function(){return this.take(Re)},nd(hi.prototype,function(S,A){var Z=/^(?:filter|find|map|reject)|While$/.test(A),le=/^(?:head|last)$/.test(A),Ce=Te[le?"take"+(A=="last"?"Right":""):A],Ve=le||/^find/.test(A);!Ce||(Te.prototype[A]=function(){var ft=this.__wrapped__,xt=le?[1]:arguments,Ht=ft instanceof hi,bn=xt[0],Zn=Ht||Sr(ft),Vn=function(gi){var Ci=Ce.apply(Te,Xf([gi],xt));return le&&Fo?Ci[0]:Ci};Zn&&Z&&typeof bn=="function"&&bn.length!=1&&(Ht=Zn=!1);var Fo=this.__chain__,ms=!!this.__actions__.length,Ns=Ve&&!Fo,Hr=Ht&&!ms;if(!Ve&&Zn){ft=Hr?ft:new hi(this);var Zs=S.apply(ft,xt);return Zs.__actions__.push({func:e1,args:[Vn],thisArg:t}),new Ru(Zs,Fo)}return Ns&&Hr?S.apply(this,xt):(Zs=this.thru(Vn),Ns?le?Zs.value()[0]:Zs.value():Zs)})}),ks(["pop","push","shift","sort","splice","unshift"],function(S){var A=Td[S],Z=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",le=/^(?:pop|shift)$/.test(S);Te.prototype[S]=function(){var Ce=arguments;if(le&&!this.__chain__){var Ve=this.value();return A.apply(Sr(Ve)?Ve:[],Ce)}return this[Z](function(ft){return A.apply(Sr(ft)?ft:[],Ce)})}}),nd(hi.prototype,function(S,A){var Z=Te[A];if(Z){var le=Z.name+"";ii.call(na,le)||(na[le]=[]),na[le].push({name:A,func:Z})}}),na[sr(t,U).name]=[{name:"wrapper",func:t}],hi.prototype.clone=Pv,hi.prototype.reverse=j1,hi.prototype.value=t0,Te.prototype.at=fg,Te.prototype.chain=Uv,Te.prototype.commit=sa,Te.prototype.next=ff,Te.prototype.plant=ek,Te.prototype.reverse=Xy,Te.prototype.toJSON=Te.prototype.valueOf=Te.prototype.value=tk,Te.prototype.first=Te.prototype.head,ai&&(Te.prototype[ai]=ab),Te},Kh=U1();Ue?((Ue.exports=Kh)._=Kh,$e._=Kh):me._=Kh}).call(RN)})(Lc,Lc.exports);const qye=Lc.exports;var Vge={exports:{}},Yse={exports:{}},Wge=function(e,t){return function(){for(var a=new Array(arguments.length),l=0;l"u"}function Kye(o){return o!==null&&!xoe(o)&&o.constructor!==null&&!xoe(o.constructor)&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}function Uge(o){return FC.call(o)==="[object ArrayBuffer]"}function Jye(o){return FC.call(o)==="[object FormData]"}function e2e(o){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&Uge(o.buffer),e}function t2e(o){return typeof o=="string"}function n2e(o){return typeof o=="number"}function Yge(o){return o!==null&&typeof o=="object"}function wH(o){if(FC.call(o)!=="[object Object]")return!1;var e=Object.getPrototypeOf(o);return e===null||e===Object.prototype}function o2e(o){return FC.call(o)==="[object Date]"}function s2e(o){return FC.call(o)==="[object File]"}function r2e(o){return FC.call(o)==="[object Blob]"}function Xge(o){return FC.call(o)==="[object Function]"}function i2e(o){return Yge(o)&&Xge(o.pipe)}function a2e(o){return FC.call(o)==="[object URLSearchParams]"}function l2e(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function c2e(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function jse(o,e){if(!(o===null||typeof o>"u"))if(typeof o!="object"&&(o=[o]),Xse(o))for(var t=0,s=o.length;t"u"||(q4.isArray(h)?b=b+"[]":h=[h],q4.forEach(h,function(k){q4.isDate(k)?k=k.toISOString():q4.isObject(k)&&(k=JSON.stringify(k)),l.push(Hae(b)+"="+Hae(k))}))}),a=l.join("&")}if(a){var f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e},d2e=Zp;function zz(){this.handlers=[]}zz.prototype.use=function(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};zz.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};zz.prototype.forEach=function(e){d2e.forEach(this.handlers,function(s){s!==null&&e(s)})};var h2e=zz,m2e=Zp,g2e=function(e,t){m2e.forEach(e,function(a,l){l!==t&&l.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[l])})},qge=function(e,t,s,a,l){return e.config=t,s&&(e.code=s),e.request=a,e.response=l,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},Wte,zae;function Gge(){if(zae)return Wte;zae=1;var o=qge;return Wte=function(t,s,a,l,f){var d=new Error(t);return o(d,s,a,l,f)},Wte}var Ute,Vae;function p2e(){if(Vae)return Ute;Vae=1;var o=Gge();return Ute=function(t,s,a){var l=a.config.validateStatus;!a.status||!l||l(a.status)?t(a):s(o("Request failed with status code "+a.status,a.config,null,a.request,a))},Ute}var Yte,Wae;function b2e(){if(Wae)return Yte;Wae=1;var o=Zp;return Yte=o.isStandardBrowserEnv()?function(){return{write:function(s,a,l,f,d,h){var b=[];b.push(s+"="+encodeURIComponent(a)),o.isNumber(l)&&b.push("expires="+new Date(l).toGMTString()),o.isString(f)&&b.push("path="+f),o.isString(d)&&b.push("domain="+d),h===!0&&b.push("secure"),document.cookie=b.join("; ")},read:function(s){var a=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Yte}var Xte,Uae;function v2e(){return Uae||(Uae=1,Xte=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Xte}var jte,Yae;function O2e(){return Yae||(Yae=1,jte=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),jte}var qte,Xae;function y2e(){if(Xae)return qte;Xae=1;var o=v2e(),e=O2e();return qte=function(s,a){return s&&!o(a)?e(s,a):a},qte}var Gte,jae;function w2e(){if(jae)return Gte;jae=1;var o=Zp,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Gte=function(s){var a={},l,f,d;return s&&o.forEach(s.split(` +`),function(b){if(d=b.indexOf(":"),l=o.trim(b.substr(0,d)).toLowerCase(),f=o.trim(b.substr(d+1)),l){if(a[l]&&e.indexOf(l)>=0)return;l==="set-cookie"?a[l]=(a[l]?a[l]:[]).concat([f]):a[l]=a[l]?a[l]+", "+f:f}}),a},Gte}var Kte,qae;function _2e(){if(qae)return Kte;qae=1;var o=Zp;return Kte=o.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),a;function l(f){var d=f;return t&&(s.setAttribute("href",d),d=s.href),s.setAttribute("href",d),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return a=l(window.location.href),function(d){var h=o.isString(d)?l(d):d;return h.protocol===a.protocol&&h.host===a.host}}():function(){return function(){return!0}}(),Kte}var Jte,Gae;function Vz(){if(Gae)return Jte;Gae=1;function o(e){this.message=e}return o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,Jte=o,Jte}var ene,Kae;function Jae(){if(Kae)return ene;Kae=1;var o=Zp,e=p2e(),t=b2e(),s=jge,a=y2e(),l=w2e(),f=_2e(),d=Gge(),h=Wz(),b=Vz();return ene=function(k){return new Promise(function(M,$){var Q=k.data,F=k.headers,U=k.responseType,K;function L(){k.cancelToken&&k.cancelToken.unsubscribe(K),k.signal&&k.signal.removeEventListener("abort",K)}o.isFormData(Q)&&delete F["Content-Type"];var te=new XMLHttpRequest;if(k.auth){var ne=k.auth.username||"",oe=k.auth.password?unescape(encodeURIComponent(k.auth.password)):"";F.Authorization="Basic "+btoa(ne+":"+oe)}var Y=a(k.baseURL,k.url);te.open(k.method.toUpperCase(),s(Y,k.params,k.paramsSerializer),!0),te.timeout=k.timeout;function ye(){if(!!te){var Le="getAllResponseHeaders"in te?l(te.getAllResponseHeaders()):null,ve=!U||U==="text"||U==="json"?te.responseText:te.response,ue={data:ve,status:te.status,statusText:te.statusText,headers:Le,config:k,request:te};e(function(nt){M(nt),L()},function(nt){$(nt),L()},ue),te=null}}if("onloadend"in te?te.onloadend=ye:te.onreadystatechange=function(){!te||te.readyState!==4||te.status===0&&!(te.responseURL&&te.responseURL.indexOf("file:")===0)||setTimeout(ye)},te.onabort=function(){!te||($(d("Request aborted",k,"ECONNABORTED",te)),te=null)},te.onerror=function(){$(d("Network Error",k,null,te)),te=null},te.ontimeout=function(){var ve=k.timeout?"timeout of "+k.timeout+"ms exceeded":"timeout exceeded",ue=k.transitional||h.transitional;k.timeoutErrorMessage&&(ve=k.timeoutErrorMessage),$(d(ve,k,ue.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",te)),te=null},o.isStandardBrowserEnv()){var _e=(k.withCredentials||f(Y))&&k.xsrfCookieName?t.read(k.xsrfCookieName):void 0;_e&&(F[k.xsrfHeaderName]=_e)}"setRequestHeader"in te&&o.forEach(F,function(ve,ue){typeof Q>"u"&&ue.toLowerCase()==="content-type"?delete F[ue]:te.setRequestHeader(ue,ve)}),o.isUndefined(k.withCredentials)||(te.withCredentials=!!k.withCredentials),U&&U!=="json"&&(te.responseType=k.responseType),typeof k.onDownloadProgress=="function"&&te.addEventListener("progress",k.onDownloadProgress),typeof k.onUploadProgress=="function"&&te.upload&&te.upload.addEventListener("progress",k.onUploadProgress),(k.cancelToken||k.signal)&&(K=function(Le){!te||($(!Le||Le&&Le.type?new b("canceled"):Le),te.abort(),te=null)},k.cancelToken&&k.cancelToken.subscribe(K),k.signal&&(k.signal.aborted?K():k.signal.addEventListener("abort",K))),Q||(Q=null),te.send(Q)})},ene}var tne,ele;function Wz(){if(ele)return tne;ele=1;var o=Zp,e=g2e,t=qge,s={"Content-Type":"application/x-www-form-urlencoded"};function a(h,b){!o.isUndefined(h)&&o.isUndefined(h["Content-Type"])&&(h["Content-Type"]=b)}function l(){var h;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(h=Jae()),h}function f(h,b,y){if(o.isString(h))try{return(b||JSON.parse)(h),o.trim(h)}catch(k){if(k.name!=="SyntaxError")throw k}return(y||JSON.stringify)(h)}var d={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:l(),transformRequest:[function(b,y){return e(y,"Accept"),e(y,"Content-Type"),o.isFormData(b)||o.isArrayBuffer(b)||o.isBuffer(b)||o.isStream(b)||o.isFile(b)||o.isBlob(b)?b:o.isArrayBufferView(b)?b.buffer:o.isURLSearchParams(b)?(a(y,"application/x-www-form-urlencoded;charset=utf-8"),b.toString()):o.isObject(b)||y&&y["Content-Type"]==="application/json"?(a(y,"application/json"),f(b)):b}],transformResponse:[function(b){var y=this.transitional||d.transitional,k=y&&y.silentJSONParsing,E=y&&y.forcedJSONParsing,M=!k&&this.responseType==="json";if(M||E&&o.isString(b)&&b.length)try{return JSON.parse(b)}catch($){if(M)throw $.name==="SyntaxError"?t($,this,"E_JSON_PARSE"):$}return b}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(b){return b>=200&&b<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return o.forEach(["delete","get","head"],function(b){d.headers[b]={}}),o.forEach(["post","put","patch"],function(b){d.headers[b]=o.merge(s)}),tne=d,tne}var S2e=Zp,C2e=Wz(),k2e=function(e,t,s){var a=this||C2e;return S2e.forEach(s,function(f){e=f.call(a,e,t)}),e},nne,tle;function Kge(){return tle||(tle=1,nne=function(e){return!!(e&&e.__CANCEL__)}),nne}var nle=Zp,one=k2e,x2e=Kge(),T2e=Wz(),E2e=Vz();function sne(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new E2e("canceled")}var A2e=function(e){sne(e),e.headers=e.headers||{},e.data=one.call(e,e.data,e.headers,e.transformRequest),e.headers=nle.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),nle.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]});var t=e.adapter||T2e.adapter;return t(e).then(function(a){return sne(e),a.data=one.call(e,a.data,a.headers,e.transformResponse),a},function(a){return x2e(a)||(sne(e),a&&a.response&&(a.response.data=one.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)})},A1=Zp,Jge=function(e,t){t=t||{};var s={};function a(y,k){return A1.isPlainObject(y)&&A1.isPlainObject(k)?A1.merge(y,k):A1.isPlainObject(k)?A1.merge({},k):A1.isArray(k)?k.slice():k}function l(y){if(A1.isUndefined(t[y])){if(!A1.isUndefined(e[y]))return a(void 0,e[y])}else return a(e[y],t[y])}function f(y){if(!A1.isUndefined(t[y]))return a(void 0,t[y])}function d(y){if(A1.isUndefined(t[y])){if(!A1.isUndefined(e[y]))return a(void 0,e[y])}else return a(void 0,t[y])}function h(y){if(y in t)return a(e[y],t[y]);if(y in e)return a(void 0,e[y])}var b={url:f,method:f,data:f,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:h};return A1.forEach(Object.keys(e).concat(Object.keys(t)),function(k){var E=b[k]||l,M=E(k);A1.isUndefined(M)&&E!==h||(s[k]=M)}),s},rne,ole;function epe(){return ole||(ole=1,rne={version:"0.25.0"}),rne}var D2e=epe().version,qse={};["object","boolean","number","function","string","symbol"].forEach(function(o,e){qse[o]=function(s){return typeof s===o||"a"+(e<1?"n ":" ")+o}});var sle={};qse.transitional=function(e,t,s){function a(l,f){return"[Axios v"+D2e+"] Transitional option '"+l+"'"+f+(s?". "+s:"")}return function(l,f,d){if(e===!1)throw new Error(a(f," has been removed"+(t?" in "+t:"")));return t&&!sle[f]&&(sle[f]=!0,console.warn(a(f," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(l,f,d):!0}};function P2e(o,e,t){if(typeof o!="object")throw new TypeError("options must be an object");for(var s=Object.keys(o),a=s.length;a-- >0;){var l=s[a],f=e[l];if(f){var d=o[l],h=d===void 0||f(d,l,o);if(h!==!0)throw new TypeError("option "+l+" must be "+h);continue}if(t!==!0)throw Error("Unknown option "+l)}}var M2e={assertOptions:P2e,validators:qse},tpe=Zp,R2e=jge,rle=h2e,ile=A2e,Uz=Jge,npe=M2e,G4=npe.validators;function W6(o){this.defaults=o,this.interceptors={request:new rle,response:new rle}}W6.prototype.request=function(e,t){if(typeof e=="string"?(t=t||{},t.url=e):t=e||{},!t.url)throw new Error("Provided config url is not valid");t=Uz(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&npe.assertOptions(s,{silentJSONParsing:G4.transitional(G4.boolean),forcedJSONParsing:G4.transitional(G4.boolean),clarifyTimeoutError:G4.transitional(G4.boolean)},!1);var a=[],l=!0;this.interceptors.request.forEach(function(M){typeof M.runWhen=="function"&&M.runWhen(t)===!1||(l=l&&M.synchronous,a.unshift(M.fulfilled,M.rejected))});var f=[];this.interceptors.response.forEach(function(M){f.push(M.fulfilled,M.rejected)});var d;if(!l){var h=[ile,void 0];for(Array.prototype.unshift.apply(h,a),h=h.concat(f),d=Promise.resolve(t);h.length;)d=d.then(h.shift(),h.shift());return d}for(var b=t;a.length;){var y=a.shift(),k=a.shift();try{b=y(b)}catch(E){k(E);break}}try{d=ile(b)}catch(E){return Promise.reject(E)}for(;f.length;)d=d.then(f.shift(),f.shift());return d};W6.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=Uz(this.defaults,e),R2e(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};tpe.forEach(["delete","get","head","options"],function(e){W6.prototype[e]=function(t,s){return this.request(Uz(s||{},{method:e,url:t,data:(s||{}).data}))}});tpe.forEach(["post","put","patch"],function(e){W6.prototype[e]=function(t,s,a){return this.request(Uz(a||{},{method:e,url:t,data:s}))}});var $2e=W6,ine,ale;function N2e(){if(ale)return ine;ale=1;var o=Vz();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(f){s=f});var a=this;this.promise.then(function(l){if(!!a._listeners){var f,d=a._listeners.length;for(f=0;fo;function U6(o,e){for(const t in e)o[t]=e[t];return o}function rpe(o){return o()}function fle(){return Object.create(null)}function $i(o){o.forEach(rpe)}function Ub(o){return typeof o=="function"}function po(o,e){return o!=o?e==e:o!==e||o&&typeof o=="object"||typeof o=="function"}let $Z;function dle(o,e){return $Z||($Z=document.createElement("a")),$Z.href=e,o===$Z.href}function H2e(o){return Object.keys(o).length===0}function ipe(o,e,t,s){if(o){const a=ape(o,e,t,s);return o[0](a)}}function ape(o,e,t,s){return o[1]&&s?U6(t.ctx.slice(),o[1](s(e))):t.ctx}function lpe(o,e,t,s){if(o[2]&&s){const a=o[2](s(t));if(e.dirty===void 0)return a;if(typeof a=="object"){const l=[],f=Math.max(e.dirty.length,a.length);for(let d=0;d32){const e=[],t=o.ctx.length/32;for(let s=0;swindow.performance.now():()=>Date.now(),Gse=fpe?o=>requestAnimationFrame(o):pn;const pD=new Set;function hpe(o){pD.forEach(e=>{e.c(o)||(pD.delete(e),e.f())}),pD.size!==0&&Gse(hpe)}function mpe(o){let e;return pD.size===0&&Gse(hpe),{promise:new Promise(t=>{pD.add(e={c:o,f:t})}),abort(){pD.delete(e)}}}const z2e=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function j(o,e){o.appendChild(e)}function gpe(o){if(!o)return document;const e=o.getRootNode?o.getRootNode():o.ownerDocument;return e&&e.host?e:o.ownerDocument}function V2e(o){const e=re("style");return W2e(gpe(o),e),e.sheet}function W2e(o,e){return j(o.head||o,e),e.sheet}function Me(o,e,t){o.insertBefore(e,t||null)}function Pe(o){o.parentNode&&o.parentNode.removeChild(o)}function ia(o,e){for(let t=0;to.removeEventListener(e,t,s)}function ju(o){return function(e){return e.preventDefault(),o.call(this,e)}}function z(o,e,t){t==null?o.removeAttribute(e):o.getAttribute(e)!==t&&o.setAttribute(e,t)}function Kse(o){let e;return{p(...t){e=t,e.forEach(s=>o.push(s))},r(){e.forEach(t=>o.splice(o.indexOf(t),1))}}}function YH(o){return o===""?null:+o}function U2e(o){return Array.from(o.childNodes)}function Wn(o,e){e=""+e,o.data!==e&&(o.data=e)}function hr(o,e){o.value=e==null?"":e}function rs(o,e,t,s){t==null?o.style.removeProperty(e):o.style.setProperty(e,t,s?"important":"")}function NZ(o,e,t){for(let s=0;s>>0}function j2e(o,e){const t={stylesheet:V2e(e),rules:{}};return XH.set(o,t),t}function Eoe(o,e,t,s,a,l,f,d=0){const h=16.666/s;let b=`{ +`;for(let F=0;F<=1;F+=h){const U=e+(t-e)*l(F);b+=F*100+`%{${f(U,1-U)}} +`}const y=b+`100% {${f(t,1-t)}} +}`,k=`__svelte_${X2e(y)}_${d}`,E=gpe(o),{stylesheet:M,rules:$}=XH.get(E)||j2e(E,o);$[k]||($[k]=!0,M.insertRule(`@keyframes ${k} ${y}`,M.cssRules.length));const Q=o.style.animation||"";return o.style.animation=`${Q?`${Q}, `:""}${k} ${s}ms linear ${a}ms 1 both`,jH+=1,k}function vpe(o,e){const t=(o.style.animation||"").split(", "),s=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=t.length-s.length;a&&(o.style.animation=s.join(", "),jH-=a,jH||q2e())}function q2e(){Gse(()=>{jH||(XH.forEach(o=>{const{ownerNode:e}=o.stylesheet;e&&Pe(e)}),XH.clear())})}function Ope(o,e,t,s){if(!e)return pn;const a=o.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return pn;const{delay:l=0,duration:f=300,easing:d=spe,start:h=dpe()+l,end:b=h+f,tick:y=pn,css:k}=t(o,{from:e,to:a},s);let E=!0,M=!1,$;function Q(){k&&($=Eoe(o,0,1,f,l,d,k)),l||(M=!0)}function F(){k&&vpe(o,$),E=!1}return mpe(U=>{if(!M&&U>=h&&(M=!0),M&&U>=b&&(y(1,0),F()),!E)return!1;if(M){const K=U-h,L=0+1*d(K/f);y(L,1-L)}return!0}),Q(),y(0,1),F}function ype(o){const e=getComputedStyle(o);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:s}=e,a=o.getBoundingClientRect();o.style.position="absolute",o.style.width=t,o.style.height=s,G2e(o,a)}}function G2e(o,e){const t=o.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const s=getComputedStyle(o),a=s.transform==="none"?"":s.transform;o.style.transform=`${a} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let O6;function o6(o){O6=o}function UD(){if(!O6)throw new Error("Function called outside component initialization");return O6}function W1(o){UD().$$.on_mount.push(o)}function wpe(o){UD().$$.after_update.push(o)}function Jse(o){UD().$$.on_destroy.push(o)}function Hp(){const o=UD();return(e,t,{cancelable:s=!1}={})=>{const a=o.$$.callbacks[e];if(a){const l=bpe(e,t,{cancelable:s});return a.slice().forEach(f=>{f.call(o,l)}),!l.defaultPrevented}return!0}}function s6(o,e){return UD().$$.context.set(o,e),e}function si(o){return UD().$$.context.get(o)}function SH(o,e){const t=o.$$.callbacks[e.type];t&&t.slice().forEach(s=>s.call(this,e))}const rD=[],Uo=[];let bD=[];const Aoe=[],K2e=Promise.resolve();let Doe=!1;function J2e(){Doe||(Doe=!0,K2e.then(_pe))}function AC(o){bD.push(o)}function mr(o){Aoe.push(o)}const cne=new Set;let K4=0;function _pe(){if(K4!==0)return;const o=O6;do{try{for(;K4o.indexOf(s)===-1?e.push(s):t.push(s)),t.forEach(s=>s()),bD=e}let $N;function nwe(){return $N||($N=Promise.resolve(),$N.then(()=>{$N=null})),$N}function une(o,e,t){o.dispatchEvent(bpe(`${e?"intro":"outro"}${t}`))}const CH=new Set;let Lw;function wo(){Lw={r:0,c:[],p:Lw}}function _o(){Lw.r||$i(Lw.c),Lw=Lw.p}function xe(o,e){o&&o.i&&(CH.delete(o),o.i(e))}function Qe(o,e,t,s){if(o&&o.o){if(CH.has(o))return;CH.add(o),Lw.c.push(()=>{CH.delete(o),s&&(t&&o.d(1),s())}),o.o(e)}else s&&s()}const owe={duration:0};function qH(o,e,t,s){const a={direction:"both"};let l=e(o,t,a),f=s?0:1,d=null,h=null,b=null;function y(){b&&vpe(o,b)}function k(M,$){const Q=M.b-f;return $*=Math.abs(Q),{a:f,b:M.b,d:Q,duration:$,start:M.start,end:M.start+$,group:M.group}}function E(M){const{delay:$=0,duration:Q=300,easing:F=spe,tick:U=pn,css:K}=l||owe,L={start:dpe()+$,b:M};M||(L.group=Lw,Lw.r+=1),d||h?h=L:(K&&(y(),b=Eoe(o,f,M,Q,$,F,K)),M&&U(0,1),d=k(L,Q),AC(()=>une(o,M,"start")),mpe(te=>{if(h&&te>h.start&&(d=k(h,Q),h=null,une(o,d.b,"start"),K&&(y(),b=Eoe(o,f,d.b,d.duration,0,F,l.css))),d){if(te>=d.end)U(f=d.b,1-f),une(o,d.b,"end"),h||(d.b?y():--d.group.r||$i(d.group.c)),d=null;else if(te>=d.start){const ne=te-d.start;f=d.a+d.d*F(ne/d.duration),U(f,1-f)}}return!!(d||h)}))}return{run(M){Ub(l)?nwe().then(()=>{l=l(a),E(M)}):E(M)},end(){y(),d=h=null}}}function Y6(o,e){o.d(1),e.delete(o.key)}function xv(o,e){Qe(o,1,1,()=>{e.delete(o.key)})}function Spe(o,e){o.f(),xv(o,e)}function Xh(o,e,t,s,a,l,f,d,h,b,y,k){let E=o.length,M=l.length,$=E;const Q={};for(;$--;)Q[o[$].key]=$;const F=[],U=new Map,K=new Map,L=[];for($=M;$--;){const Y=k(a,l,$),ye=t(Y);let _e=f.get(ye);_e?s&&L.push(()=>_e.p(Y,e)):(_e=b(ye,Y),_e.c()),U.set(ye,F[$]=_e),ye in Q&&K.set(ye,Math.abs($-Q[ye]))}const te=new Set,ne=new Set;function oe(Y){xe(Y,1),Y.m(d,y),f.set(Y.key,Y),y=Y.first,M--}for(;E&&M;){const Y=F[M-1],ye=o[E-1],_e=Y.key,Le=ye.key;Y===ye?(y=Y.first,E--,M--):U.has(Le)?!f.has(_e)||te.has(_e)?oe(Y):ne.has(Le)?E--:K.get(_e)>K.get(Le)?(ne.add(_e),oe(Y)):(te.add(Le),E--):(h(ye,f),E--)}for(;E--;){const Y=o[E];U.has(Y.key)||h(Y,f)}for(;M;)oe(F[M-1]);return $i(L),F}function Yz(o,e){const t={},s={},a={$$scope:1};let l=o.length;for(;l--;){const f=o[l],d=e[l];if(d){for(const h in f)h in d||(s[h]=1);for(const h in d)a[h]||(t[h]=d[h],a[h]=1);o[l]=d}else for(const h in f)a[h]=1}for(const f in s)f in t||(t[f]=void 0);return t}function Xz(o){return typeof o=="object"&&o!==null?o:{}}function cr(o,e,t){const s=o.$$.props[e];s!==void 0&&(o.$$.bound[s]=t,t(o.$$.ctx[s]))}function tn(o){o&&o.c()}function Kt(o,e,t,s){const{fragment:a,after_update:l}=o.$$;a&&a.m(e,t),s||AC(()=>{const f=o.$$.on_mount.map(rpe).filter(Ub);o.$$.on_destroy?o.$$.on_destroy.push(...f):$i(f),o.$$.on_mount=[]}),l.forEach(AC)}function Jt(o,e){const t=o.$$;t.fragment!==null&&(twe(t.after_update),$i(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function swe(o,e){o.$$.dirty[0]===-1&&(rD.push(o),J2e(),o.$$.dirty.fill(0)),o.$$.dirty[e/31|0]|=1<{const $=M.length?M[0]:E;return b.ctx&&a(b.ctx[k],b.ctx[k]=$)&&(!b.skip_bound&&b.bound[k]&&b.bound[k]($),y&&swe(o,k)),E}):[],b.update(),y=!0,$i(b.before_update),b.fragment=s?s(b.ctx):!1,e.target){if(e.hydrate){const k=U2e(e.target);b.fragment&&b.fragment.l(k),k.forEach(Pe)}else b.fragment&&b.fragment.c();e.intro&&xe(o.$$.fragment),Kt(o,e.target,e.anchor,e.customElement),_pe()}o6(h)}class vo{$destroy(){Jt(this,1),this.$destroy=pn}$on(e,t){if(!Ub(t))return pn;const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(t),()=>{const a=s.indexOf(t);a!==-1&&s.splice(a,1)}}$set(e){this.$$set&&!H2e(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function gle(o){let e,t;return{c(){e=re("div"),t=Xt(o[0]),z(e,"class","alert alert-danger"),z(e,"role","alert")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&1&&Wn(t,s[0])},d(s){s&&Pe(e)}}}function rwe(o){let e,t=o[0]&&gle(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=gle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Pe(e)}}}function iwe(o,e,t){let{message:s=""}=e;return o.$$set=a=>{"message"in a&&t(0,s=a.message)},[s]}class X6 extends vo{constructor(e){super(),bo(this,e,iwe,rwe,po,{message:0})}}function awe(o){let e,t,s,a;return{c(){e=re("button"),t=re("span"),s=Ze(),a=Xt(o[0]),z(t,"class","spinner-border spinner-border-sm"),z(t,"role","status"),z(t,"aria-hidden","true"),z(e,"type","submit"),z(e,"class","btn btn-primary btn-spinner"),e.disabled=o[1]},m(l,f){Me(l,e,f),j(e,t),j(e,s),j(e,a)},p(l,[f]){f&1&&Wn(a,l[0]),f&2&&(e.disabled=l[1])},i:pn,o:pn,d(l){l&&Pe(e)}}}function lwe(o,e,t){let{label:s=""}=e,{disabled:a=!1}=e;return o.$$set=l=>{"label"in l&&t(0,s=l.label),"disabled"in l&&t(1,a=l.disabled)},[s,a]}class ED extends vo{constructor(e){super(),bo(this,e,lwe,awe,po,{label:0,disabled:1})}}function cwe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U,K,L;return t=new X6({props:{message:o[2]}}),F=new ED({props:{label:"Register"}}),{c(){e=re("div"),tn(t.$$.fragment),s=Ze(),a=re("form"),l=re("div"),f=re("label"),f.textContent="Name",d=Ze(),h=re("input"),b=Ze(),y=re("div"),k=re("label"),k.textContent="Email address",E=Ze(),M=re("input"),$=Ze(),Q=re("div"),tn(F.$$.fragment),z(f,"for","name"),z(f,"class","form-label"),z(h,"type","text"),z(h,"class","form-control"),z(h,"id","name"),z(l,"class","mb-3"),z(k,"for","email"),z(k,"class","form-label"),z(M,"type","email"),z(M,"class","form-control"),z(M,"id","email"),z(y,"class","mb-3"),z(Q,"class","text-center mt-5 d-block"),z(e,"class","wrapper-tiny")},m(te,ne){Me(te,e,ne),Kt(t,e,null),j(e,s),j(e,a),j(a,l),j(l,f),j(l,d),j(l,h),hr(h,o[1]),j(a,b),j(a,y),j(y,k),j(y,E),j(y,M),hr(M,o[0]),j(a,$),j(a,Q),Kt(F,Q,null),U=!0,K||(L=[vn(h,"input",o[4]),vn(M,"input",o[5]),vn(a,"submit",o[3])],K=!0)},p(te,[ne]){const oe={};ne&4&&(oe.message=te[2]),t.$set(oe),ne&2&&h.value!==te[1]&&hr(h,te[1]),ne&1&&M.value!==te[0]&&hr(M,te[0])},i(te){U||(xe(t.$$.fragment,te),xe(F.$$.fragment,te),U=!0)},o(te){Qe(t.$$.fragment,te),Qe(F.$$.fragment,te),U=!1},d(te){te&&Pe(e),Jt(t),Jt(F),K=!1,$i(L)}}}function uwe(o,e,t){const s=si("channel");let a="",{email:l=""}=e,f="";function d(y){y.preventDefault(),t(2,f=""),axios.post(s.lucentUrl+"/register",{name:a,email:l}).then(()=>{window.location=s.lucentUrl+"/login"}).catch(k=>{var E;t(2,f=(E=k.response)==null?void 0:E.data.error),console.log({errorMessage:f})})}function h(){a=this.value,t(1,a)}function b(){l=this.value,t(0,l)}return o.$$set=y=>{"email"in y&&t(0,l=y.email)},[l,a,f,d,h,b]}class fwe extends vo{constructor(e){super(),bo(this,e,uwe,cwe,po,{email:0})}}function dwe(o){let e,t,s,a,l,f,d,h,b,y,k;return h=new ED({props:{label:"Login"}}),{c(){e=re("form"),t=re("div"),s=re("label"),s.textContent="Email address",a=Ze(),l=re("input"),f=Ze(),d=re("div"),tn(h.$$.fragment),z(s,"for","emailaddress"),z(s,"class","form-label"),z(l,"type","email"),z(l,"class","form-control"),z(l,"id","emailaddress"),l.required=!0,z(t,"class","mb-3"),z(d,"class","text-center mt-5 d-block")},m(E,M){Me(E,e,M),j(e,t),j(t,s),j(t,a),j(t,l),hr(l,o[0]),j(e,f),j(e,d),Kt(h,d,null),b=!0,y||(k=[vn(l,"input",o[3]),vn(e,"submit",o[2])],y=!0)},p(E,M){M&1&&l.value!==E[0]&&hr(l,E[0])},i(E){b||(xe(h.$$.fragment,E),b=!0)},o(E){Qe(h.$$.fragment,E),b=!1},d(E){E&&Pe(e),Jt(h),y=!1,$i(k)}}}function hwe(o){let e,t;return{c(){e=re("div"),t=Xt(o[1]),z(e,"class","alert alert-info"),z(e,"role","alert")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&2&&Wn(t,s[1])},i:pn,o:pn,d(s){s&&Pe(e)}}}function mwe(o){let e,t,s,a;const l=[hwe,dwe],f=[];function d(h,b){return h[1]?0:1}return t=d(o),s=f[t]=l[t](o),{c(){e=re("div"),s.c(),z(e,"class","wrapper-tiny")},m(h,b){Me(h,e,b),f[t].m(e,null),a=!0},p(h,[b]){let y=t;t=d(h),t===y?f[t].p(h,b):(wo(),Qe(f[y],1,1,()=>{f[y]=null}),_o(),s=f[t],s?s.p(h,b):(s=f[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Qe(s),a=!1},d(h){h&&Pe(e),f[t].d()}}}function gwe(o,e,t){const s=si("channel");let a="",l="";function f(h){h.preventDefault(),axios.post(s.lucentUrl+"/login",{email:a}).then(b=>{console.log(b),t(1,l="You will receive an email with a login link")}).catch(b=>{})}function d(){a=this.value,t(0,a)}return[a,l,f,d]}class pwe extends vo{constructor(e){super(),bo(this,e,gwe,mwe,po,{})}}function Cpe(o){const e=o-1;return e*e*e+1}function kpe(o){return--o*o*o*o*o+1}function GH(o,{delay:e=0,duration:t=400,easing:s=Cpe,x:a=0,y:l=0,opacity:f=0}={}){const d=getComputedStyle(o),h=+d.opacity,b=d.transform==="none"?"":d.transform,y=h*(1-f),[k,E]=hle(a),[M,$]=hle(l);return{delay:e,duration:t,easing:s,css:(Q,F)=>` + transform: ${b} translate(${(1-Q)*k}${E}, ${(1-Q)*M}${$}); + opacity: ${h-y*F}`}}function ple(o){let e,t,s,a;return{c(){e=re("div"),t=Xt(o[1]),z(e,"class","lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center svelte-190ow44"),z(e,"role","alert")},m(l,f){Me(l,e,f),j(e,t),a=!0},p(l,f){(!a||f&2)&&Wn(t,l[1])},i(l){a||(AC(()=>{!a||(s||(s=qH(e,GH,{duration:500},!0)),s.run(1))}),a=!0)},o(l){s||(s=qH(e,GH,{duration:500},!1)),s.run(0),a=!1},d(l){l&&Pe(e),l&&s&&s.end()}}}function bwe(o){let e,t,s=o[0]&&ple(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[0]?s?(s.p(a,l),l&1&&xe(s,1)):(s=ple(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function vwe(o,e,t){let s,a;function l(f="Saved"){t(1,s=f),t(0,a=!0),setTimeout(function(){t(0,a=!1)},2e3)}return t(1,s="Saved"),t(0,a=!1),[a,s,l]}class ere extends vo{constructor(e){super(),bo(this,e,vwe,bwe,po,{show:2})}get show(){return this.$$.ctx[2]}}function Owe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q={};return e=new ere({props:Q}),o[4](e),k=new ED({props:{label:"Enter"}}),{c(){tn(e.$$.fragment),t=Ze(),s=re("div"),a=re("form"),l=re("div"),f=re("h3"),d=Xt("Login as "),h=Xt(o[0]),b=Ze(),y=re("div"),tn(k.$$.fragment),z(l,"class","mb-3 text-center"),z(y,"class","text-center mt-5 d-block"),z(s,"class","wrapper-tiny")},m(F,U){Kt(e,F,U),Me(F,t,U),Me(F,s,U),j(s,a),j(a,l),j(l,f),j(f,d),j(f,h),j(a,b),j(a,y),Kt(k,y,null),E=!0,M||($=vn(a,"submit",o[2]),M=!0)},p(F,[U]){const K={};e.$set(K),(!E||U&1)&&Wn(h,F[0])},i(F){E||(xe(e.$$.fragment,F),xe(k.$$.fragment,F),E=!0)},o(F){Qe(e.$$.fragment,F),Qe(k.$$.fragment,F),E=!1},d(F){o[4](null),Jt(e,F),F&&Pe(t),F&&Pe(s),Jt(k),M=!1,$()}}}function ywe(o,e,t){const s=si("channel");let{email:a}=e,{token:l}=e,f;function d(b){b.preventDefault(),axios.post(s.lucentUrl+"/verify",{email:a,token:l}).then(y=>{window.location=s.lucentUrl}).catch(y=>{})}function h(b){Uo[b?"unshift":"push"](()=>{f=b,t(1,f)})}return o.$$set=b=>{"email"in b&&t(0,a=b.email),"token"in b&&t(3,l=b.token)},[a,f,d,l,h]}class wwe extends vo{constructor(e){super(),bo(this,e,ywe,Owe,po,{email:0,token:3})}}function _we(o){let e,t,s;return{c(){e=re("div"),t=re("div"),s=Xt(o[2]),z(t,"class","avatar__letters"),z(e,"class","avatar"),z(e,"title",o[0]),rs(e,"background-color",o[3][o[4]]),rs(e,"height",o[1]+"px"),rs(e,"width",o[1]+"px"),rs(e,"font-size",o[1]/2+"px")},m(a,l){Me(a,e,l),j(e,t),j(t,s)},p(a,[l]){l&4&&Wn(s,a[2]),l&1&&z(e,"title",a[0]),l&2&&rs(e,"height",a[1]+"px"),l&2&&rs(e,"width",a[1]+"px"),l&2&&rs(e,"font-size",a[1]/2+"px")},i:pn,o:pn,d(a){a&&Pe(e)}}}function Swe(o,e,t){let{name:s}=e,{side:a=48}=e;const l=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let f="";s.split(" ").length>1?f=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[1].charAt(0).toUpperCase():f=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[0].charAt(1).toUpperCase();let h=(s.charCodeAt(1)+s.length)%19;return o.$$set=b=>{"name"in b&&t(0,s=b.name),"side"in b&&t(1,a=b.side)},[s,a,f,l,h]}class vy extends vo{constructor(e){super(),bo(this,e,Swe,_we,po,{name:0,side:1})}}function Cwe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U,K,L,te,ne,oe,Y,ye,_e,Le;t=new X6({props:{message:o[2]}});let ve={};return a=new ere({props:ve}),o[8](a),d=new vy({props:{name:o[4].name}}),M=new ED({props:{label:"Update"}}),L=new ED({props:{label:"Update"}}),{c(){e=re("div"),tn(t.$$.fragment),s=Ze(),tn(a.$$.fragment),l=Ze(),f=re("h3"),tn(d.$$.fragment),h=Ze(),b=re("form"),y=re("div"),k=re("input"),E=Ze(),tn(M.$$.fragment),$=Ze(),Q=re("form"),F=re("div"),U=re("input"),K=Ze(),tn(L.$$.fragment),te=Ze(),ne=re("div"),oe=re("a"),Y=Xt(`Logout from this + device`),z(f,"class","header-small mb-5"),z(k,"type","text"),z(k,"class","form-control"),z(k,"placeholder","Name"),k.required=!0,z(y,"class","input-group mb-3"),z(U,"type","email"),z(U,"class","form-control"),z(U,"placeholder","Email"),U.required=!0,z(F,"class","input-group mb-3"),z(oe,"class","list-group-item list-group-item-action"),z(oe,"href",o[5].lucentUrl+"/logout"),z(ne,"class","list-group"),z(e,"class","wrapper-tiny")},m(ue,ot){Me(ue,e,ot),Kt(t,e,null),j(e,s),Kt(a,e,null),j(e,l),j(e,f),Kt(d,f,null),j(e,h),j(e,b),j(b,y),j(y,k),hr(k,o[0]),j(y,E),Kt(M,y,null),j(e,$),j(e,Q),j(Q,F),j(F,U),hr(U,o[1]),j(F,K),Kt(L,F,null),j(e,te),j(e,ne),j(ne,oe),j(oe,Y),ye=!0,_e||(Le=[vn(k,"input",o[9]),vn(b,"submit",o[6]),vn(U,"input",o[10]),vn(Q,"submit",o[7])],_e=!0)},p(ue,[ot]){const nt={};ot&4&&(nt.message=ue[2]),t.$set(nt);const mt={};a.$set(mt),ot&1&&k.value!==ue[0]&&hr(k,ue[0]),ot&2&&U.value!==ue[1]&&hr(U,ue[1])},i(ue){ye||(xe(t.$$.fragment,ue),xe(a.$$.fragment,ue),xe(d.$$.fragment,ue),xe(M.$$.fragment,ue),xe(L.$$.fragment,ue),ye=!0)},o(ue){Qe(t.$$.fragment,ue),Qe(a.$$.fragment,ue),Qe(d.$$.fragment,ue),Qe(M.$$.fragment,ue),Qe(L.$$.fragment,ue),ye=!1},d(ue){ue&&Pe(e),Jt(t),o[8](null),Jt(a),Jt(d),Jt(M),Jt(L),_e=!1,$i(Le)}}}function kwe(o,e,t){const s=si("user"),a=si("channel");let l=s.name,f=s.email,d="",h;function b($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-name",{name:l}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function y($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-email",{email:f}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function k($){Uo[$?"unshift":"push"](()=>{h=$,t(3,h)})}function E(){l=this.value,t(0,l)}function M(){f=this.value,t(1,f)}return[l,f,d,h,s,a,b,y,k,E,M]}class xwe extends vo{constructor(e){super(),bo(this,e,kwe,Cwe,po,{})}}function Twe(o){let e,t,s,a=o[3].name+"",l,f,d,h,b,y;const k=[{title:o[0]},o[2]];var E=o[4][o[1]];function M($){let Q={};for(let F=0;F{Jt(U,1)}),_o()}E?(b=EC(E,M()),tn(b.$$.fragment),xe(b.$$.fragment,1),Kt(b,h,null)):b=null}else E&&b.$set(F)},i($){y||(b&&xe(b.$$.fragment,$),y=!0)},o($){b&&Qe(b.$$.fragment,$),y=!1},d($){$&&Pe(e),$&&Pe(d),$&&Pe(h),b&&Jt(b)}}}function Ewe(o,e,t){const s={register:fwe,login:pwe,verify:wwe,profile:xwe};let{title:a}=e,{view:l}=e,{user:f}=e,{data:d}=e,{channel:h}=e;return s6("channel",h),s6("user",f),o.$$set=b=>{"title"in b&&t(0,a=b.title),"view"in b&&t(1,l=b.view),"user"in b&&t(5,f=b.user),"data"in b&&t(2,d=b.data),"channel"in b&&t(3,h=b.channel)},[a,l,d,h,s,f]}class Awe extends vo{constructor(e){super(),bo(this,e,Ewe,Twe,po,{title:0,view:1,user:5,data:2,channel:3})}}function ble(o){let e,t;return{c(){e=re("span"),t=Xt(o[4]),z(e,"class","text-muted")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&16&&Wn(t,s[4])},d(s){s&&Pe(e)}}}function Dwe(o){let e,t,s=!1,a,l,f,d,h,b,y,k=o[4]&&ble(o);return h=Kse(o[7][0]),{c(){e=re("div"),t=re("input"),a=Ze(),l=re("label"),f=Xt(o[1]),d=Ze(),k&&k.c(),z(t,"class","form-check-input"),z(t,"type","radio"),t.__value=o[3],t.value=t.__value,z(t,"name",o[2]),z(t,"id",o[5]),z(l,"class","form-check-label"),z(l,"for",o[5]),z(e,"class","form-check"),h.p(t)},m(E,M){Me(E,e,M),j(e,t),t.checked=t.__value===o[0],j(e,a),j(e,l),j(l,f),j(e,d),k&&k.m(e,null),b||(y=vn(t,"change",o[6]),b=!0)},p(E,[M]){M&8&&(t.__value=E[3],t.value=t.__value,s=!0),M&4&&z(t,"name",E[2]),(s||M&1)&&(t.checked=t.__value===E[0]),M&2&&Wn(f,E[1]),E[4]?k?k.p(E,M):(k=ble(E),k.c(),k.m(e,null)):k&&(k.d(1),k=null)},i:pn,o:pn,d(E){E&&Pe(e),k&&k.d(),h.r(),b=!1,y()}}}function Pwe(o,e,t){let{label:s}=e,{name:a}=e,{group:l}=e,{value:f}=e,{help:d}=e,h=Lc.exports.uniqueId();const b=[[]];function y(){l=this.__value,t(0,l)}return o.$$set=k=>{"label"in k&&t(1,s=k.label),"name"in k&&t(2,a=k.name),"group"in k&&t(0,l=k.group),"value"in k&&t(3,f=k.value),"help"in k&&t(4,d=k.help)},[l,s,a,f,d,h,y,b]}class Mwe extends vo{constructor(e){super(),bo(this,e,Pwe,Dwe,po,{label:1,name:2,group:0,value:3,help:4})}}function vle(o,e,t){const s=o.slice();return s[7]=e[t],s}function Ole(o,e,t){const s=o.slice();return s[7]=e[t],s}function yle(o){let e,t=o[7]+"",s,a,l;function f(...d){return o[4](o[7],...d)}return{c(){e=re("button"),s=Xt(t),z(e,"class","dropdown-item text-capitalize")},m(d,h){Me(d,e,h),j(e,s),a||(l=vn(e,"click",f),a=!0)},p(d,h){o=d,h&2&&t!==(t=o[7]+"")&&Wn(s,t)},d(d){d&&Pe(e),a=!1,l()}}}function wle(o){let e=o[0].roles.includes(o[7]),t,s=e&&yle(o);return{c(){s&&s.c(),t=Bs()},m(a,l){s&&s.m(a,l),Me(a,t,l)},p(a,l){l&3&&(e=a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=yle(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&Pe(t)}}}function _le(o){let e,t=o[7]+"",s,a,l,f;function d(...h){return o[5](o[7],...h)}return{c(){e=re("button"),s=Xt(t),a=Ze(),z(e,"class","dropdown-item text-capitalize")},m(h,b){Me(h,e,b),j(e,s),j(e,a),l||(f=vn(e,"click",d),l=!0)},p(h,b){o=h,b&2&&t!==(t=o[7]+"")&&Wn(s,t)},d(h){h&&Pe(e),l=!1,f()}}}function Sle(o){let e=!o[0].roles.includes(o[7]),t,s=e&&_le(o);return{c(){s&&s.c(),t=Bs()},m(a,l){s&&s.m(a,l),Me(a,t,l)},p(a,l){l&3&&(e=!a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=_le(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&Pe(t)}}}function Rwe(o){var ht;let e,t,s,a,l,f,d,h=o[0].name+"",b,y,k=o[0].email+"",E,M,$,Q,F,U,K,L,te,ne,oe,Y,ye,_e,Le,ve,ue;s=new vy({props:{name:(ht=o[0].name)!=null?ht:"",side:32}});let ot=o[1],nt=[];for(let We=0;We',ye=Ze(),_e=re("h6"),_e.textContent="Add role",Le=Ze();for(let We=0;We{!ue||(ve||(ve=qH(e,GH,{duration:200},!0)),ve.run(1))}),ue=!0)},o(We){Qe(s.$$.fragment,We),ve||(ve=qH(e,GH,{duration:200},!1)),ve.run(0),ue=!1},d(We){We&&Pe(e),Jt(s),ia(nt,We),ia(V,We),We&&ve&&ve.end()}}}function $we(o,e,t){const s=Hp();let{member:a}=e,{roles:l}=e;function f(y,k){y.preventDefault();let E=a.roles.filter(M=>M!==k);s("update",{user:a.id,roles:E})}function d(y,k){y.preventDefault();let E=[...a.roles,k];console.log(a.roles),console.log(k),console.log(E),s("update",{user:a.id,roles:E})}const h=(y,k)=>f(k,y),b=(y,k)=>d(k,y);return o.$$set=y=>{"member"in y&&t(0,a=y.member),"roles"in y&&t(1,l=y.roles)},[a,l,f,d,h,b]}class Nwe extends vo{constructor(e){super(),bo(this,e,$we,Rwe,po,{member:0,roles:1})}}function Cle(o,e,t){const s=o.slice();return s[15]=e[t],s}function kle(o,e,t){const s=o.slice();return s[18]=e[t],s}function xle(o){let e,t,s;function a(f){o[13](f)}let l={value:o[18],name:"role",label:o[18]};return o[3]!==void 0&&(l.group=o[3]),e=new Mwe({props:l}),Uo.push(()=>cr(e,"group",a)),{c(){tn(e.$$.fragment)},m(f,d){Kt(e,f,d),s=!0},p(f,d){const h={};!t&&d&8&&(t=!0,h.group=f[3],mr(()=>t=!1)),e.$set(h)},i(f){s||(xe(e.$$.fragment,f),s=!0)},o(f){Qe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function Tle(o){let e,t;return e=new Nwe({props:{member:o[15],roles:o[6].roles}}),e.$on("update",o[9]),e.$on("reinvite",o[14]),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.member=s[15]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Iwe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U,K,L,te,ne,oe,Y,ye,_e,Le,ve,ue,ot,nt;l=new X6({props:{message:o[4]}});let mt={};d=new ere({props:mt}),o[10](d);let V=o[6].roles.filter(Ele),ht=[];for(let Je=0;JeQe(ht[Je],1,1,()=>{ht[Je]=null});Y=new ED({props:{label:"Invite"}});let Ct=o[0],yt=[];for(let Je=0;JeQe(yt[Je],1,1,()=>{yt[Je]=null});return{c(){e=re("div"),t=re("div"),s=re("h3"),s.textContent="Invite people",a=Ze(),tn(l.$$.fragment),f=Ze(),tn(d.$$.fragment),h=Ze(),b=re("form"),y=re("div"),k=re("label"),k.textContent="Invitee Name",E=Ze(),M=re("input"),$=Ze(),Q=re("div"),F=re("label"),F.textContent="Invitee Email Address",U=Ze(),K=re("input"),L=Ze(),te=re("div");for(let Je=0;Jeo!=="removed";function Bwe(o,e,t){const s=si("channel");let{users:a}=e,l,f,d,h="",b;function y(K){K.preventDefault(),k(l,f,d)}function k(K,L,te){t(4,h=""),axios.post(s.lucentUrl+"/members/invite",{name:K,email:L,roles:[te]}).then(ne=>{b.show("User was invited"),t(0,a=[...a,ne.data.user]),t(1,l=null),t(2,f=null),t(3,d=null)}).catch(ne=>{var oe,Y,ye;t(4,h=(ye=(Y=(oe=ne.response)==null?void 0:oe.data)==null?void 0:Y.error)!=null?ye:"")})}function E(K){K.preventDefault(),t(4,h=""),axios.post(s.lucentUrl+"/members/update",{id:K.detail.user,roles:K.detail.roles}).then(L=>{b.show("Users updated"),t(0,a=L.data.users)}).catch(L=>{var te,ne,oe;t(4,h=(oe=(ne=(te=L.response)==null?void 0:te.data)==null?void 0:ne.error)!=null?oe:"")})}function M(K){Uo[K?"unshift":"push"](()=>{b=K,t(5,b)})}function $(){l=this.value,t(1,l)}function Q(){f=this.value,t(2,f)}function F(K){d=K,t(3,d)}const U=K=>k(K.detail.email,K.detail.role);return o.$$set=K=>{"users"in K&&t(0,a=K.users)},[a,l,f,d,h,b,s,y,k,E,M,$,Q,F,U]}class Lwe extends vo{constructor(e){super(),bo(this,e,Bwe,Iwe,po,{users:0})}}function Fwe(o){let e,t,s;return{c(){e=re("div"),t=re("div"),s=Xt(o[0]),z(t,"class","header-normal"),z(e,"class","wrapper-normal ")},m(a,l){Me(a,e,l),j(e,t),j(t,s)},p(a,[l]){l&1&&Wn(s,a[0])},i:pn,o:pn,d(a){a&&Pe(e)}}}function Qwe(o,e,t){let{title:s}=e;return o.$$set=a=>{"title"in a&&t(0,s=a.title)},[s]}class Zwe extends vo{constructor(e){super(),bo(this,e,Qwe,Fwe,po,{title:0})}}function Hwe(o){let e,t=o[5].path+"";return{c(){e=ppe("svg"),z(e,"class","bi svelte-1coky4l"),z(e,"xmlns","http://www.w3.org/2000/svg"),z(e,"width",o[0]),z(e,"height",o[1]),z(e,"viewBox",o[5].viewBox),z(e,"aria-labelledby",o[2]),z(e,"role","presentation"),z(e,"stroke",o[4]),z(e,"fill",o[3])},m(s,a){Me(s,e,a),e.innerHTML=t},p(s,[a]){a&1&&z(e,"width",s[0]),a&2&&z(e,"height",s[1]),a&4&&z(e,"aria-labelledby",s[2]),a&16&&z(e,"stroke",s[4]),a&8&&z(e,"fill",s[3])},i:pn,o:pn,d(s){s&&Pe(e)}}}function zwe(o,e,t){const s={"trash-can":{path:'',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'',viewBox:"0 0 512 512"},ellipsis:{path:'',viewBox:"0 0 448 512"},"ellipsis-vertical":{path:'',viewBox:"0 0 128 512"},"angles-down":{path:'',viewBox:"0 0 384 512"},"angle-right":{path:'',viewBox:"0 0 256 512"},"photo-film":{path:'',viewBox:"0 0 640 512"},file:{path:'',viewBox:"0 0 384 512"},"circle-info":{path:'',viewBox:"0 0 512 512"},"table-columns":{path:'',viewBox:"0 0 512 512"},"arrow-down-a-z":{path:'',viewBox:"0 0 512 512"},"arrow-up-short-wide":{path:'',viewBox:"0 0 576 512"},"arrow-down-wide-short":{path:'',viewBox:"0 0 576 512"},filter:{path:'',viewBox:"0 0 512 512"},calendar:{path:'',viewBox:"0 0 448 512"},pencil:{path:'',viewBox:"0 0 512 512"},database:{path:'',viewBox:"0 0 448 512"},dice:{path:'',viewBox:"0 0 640 512"},"triangle-exclamation":{path:'',viewBox:"0 0 512 512"},eye:{path:'',viewBox:"0 0 576 512"},"circle-plus":{path:'',viewBox:"0 0 512 512"},"magnifying-glass":{path:'',viewBox:"0 0 512 512"},expand:{path:'',viewBox:"0 0 448 512"},compress:{path:'',viewBox:"0 0 448 512"},check:{path:'',viewBox:"0 0 448 512"}};let{width:a=16}=e,{height:l=16}=e,{icon:f=""}=e,{fill:d="currentColor"}=e,{stroke:h="currentColor"}=e,b=s[f];return o.$$set=y=>{"width"in y&&t(0,a=y.width),"height"in y&&t(1,l=y.height),"icon"in y&&t(2,f=y.icon),"fill"in y&&t(3,d=y.fill),"stroke"in y&&t(4,h=y.stroke)},[a,l,f,d,h,b]}class ml extends vo{constructor(e){super(),bo(this,e,zwe,Hwe,po,{width:0,height:1,icon:2,fill:3,stroke:4})}}/*! + * mustache.js - Logic-less {{mustache}} templates with JavaScript + * http://github.com/janl/mustache.js + */var Vwe=Object.prototype.toString,YD=Array.isArray||function(e){return Vwe.call(e)==="[object Array]"};function tre(o){return typeof o=="function"}function Wwe(o){return YD(o)?"array":typeof o}function fne(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ale(o,e){return o!=null&&typeof o=="object"&&e in o}function Uwe(o,e){return o!=null&&typeof o!="object"&&o.hasOwnProperty&&o.hasOwnProperty(e)}var Ywe=RegExp.prototype.test;function Xwe(o,e){return Ywe.call(o,e)}var jwe=/\S/;function qwe(o){return!Xwe(jwe,o)}var Gwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Kwe(o){return String(o).replace(/[&<>"'`=\/]/g,function(t){return Gwe[t]})}var Jwe=/\s*/,e_e=/\s+/,Dle=/\s*=/,t_e=/\s*\}/,n_e=/#|\^|\/|>|\{|&|=|!/;function o_e(o,e){if(!o)return[];var t=!1,s=[],a=[],l=[],f=!1,d=!1,h="",b=0;function y(){if(f&&!d)for(;l.length;)delete a[l.pop()];else l=[];f=!1,d=!1}var k,E,M;function $(ye){if(typeof ye=="string"&&(ye=ye.split(e_e,2)),!YD(ye)||ye.length!==2)throw new Error("Invalid tags: "+ye);k=new RegExp(fne(ye[0])+"\\s*"),E=new RegExp("\\s*"+fne(ye[1])),M=new RegExp("\\s*"+fne("}"+ye[1]))}$(e||Qp.tags);for(var Q=new j6(o),F,U,K,L,te,ne;!Q.eos();){if(F=Q.pos,K=Q.scanUntil(k),K)for(var oe=0,Y=K.length;oe"?te=[U,K,F,Q.pos,h,b,t]:te=[U,K,F,Q.pos],b++,a.push(te),U==="#"||U==="^")s.push(te);else if(U==="/"){if(ne=s.pop(),!ne)throw new Error('Unopened section "'+K+'" at '+F);if(ne[1]!==K)throw new Error('Unclosed section "'+ne[1]+'" at '+F)}else U==="name"||U==="{"||U==="&"?d=!0:U==="="&&$(K)}if(y(),ne=s.pop(),ne)throw new Error('Unclosed section "'+ne[1]+'" at '+Q.pos);return r_e(s_e(a))}function s_e(o){for(var e=[],t,s,a=0,l=o.length;a0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function j6(o){this.string=o,this.tail=o,this.pos=0}j6.prototype.eos=function(){return this.tail===""};j6.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var s=t[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s};j6.prototype.scanUntil=function(e){var t=this.tail.search(e),s;switch(t){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=s.length,s};function AD(o,e){this.view=o,this.cache={".":this.view},this.parent=e}AD.prototype.push=function(e){return new AD(e,this)};AD.prototype.lookup=function(e){var t=this.cache,s;if(t.hasOwnProperty(e))s=t[e];else{for(var a=this,l,f,d,h=!1;a;){if(e.indexOf(".")>0)for(l=a.view,f=e.split("."),d=0;l!=null&&d"?b=this.renderPartial(d,t,s,l):h==="&"?b=this.unescapedValue(d,t):h==="name"?b=this.escapedValue(d,t,l):h==="text"&&(b=this.rawValue(d)),b!==void 0&&(f+=b);return f};Fg.prototype.renderSection=function(e,t,s,a,l){var f=this,d="",h=t.lookup(e[1]);function b(E){return f.render(E,t,s,l)}if(!!h){if(YD(h))for(var y=0,k=h.length;y0||!s)&&(l[f]=a+l[f]);return l.join(` +`)};Fg.prototype.renderPartial=function(e,t,s,a){if(!!s){var l=this.getConfigTags(a),f=tre(s)?s(e[1]):s[e[1]];if(f!=null){var d=e[6],h=e[5],b=e[4],y=f;h==0&&b&&(y=this.indentPartial(f,b,d));var k=this.parse(y,l);return this.renderTokens(k,t,s,y,a)}}};Fg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Fg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Qp.escape,l=t.lookup(e[1]);if(l!=null)return typeof l=="number"&&a===Qp.escape?String(l):a(l)};Fg.prototype.rawValue=function(e){return e[1]};Fg.prototype.getConfigTags=function(e){return YD(e)?e:e&&typeof e=="object"?e.tags:void 0};Fg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!YD(e))return e.escape};var Qp={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(o){y6.templateCache=o},get templateCache(){return y6.templateCache}},y6=new Fg;Qp.clearCache=function(){return y6.clearCache()};Qp.parse=function(e,t){return y6.parse(e,t)};Qp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Wwe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return y6.render(e,t,s,a)};Qp.escape=Kwe;Qp.Scanner=j6;Qp.Context=AD;Qp.Writer=Fg;function KH(o){return KH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KH(o)}function hE(o){if(o===null||o===!0||o===!1)return NaN;var e=Number(o);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Sc(o,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function cc(o){Sc(1,arguments);var e=Object.prototype.toString.call(o);return o instanceof Date||KH(o)==="object"&&e==="[object Date]"?new Date(o.getTime()):typeof o=="number"||e==="[object Number]"?new Date(o):((typeof o=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function i_e(o,e){Sc(2,arguments);var t=cc(o).getTime(),s=hE(e);return new Date(t+s)}var a_e={};function q6(){return a_e}function Poe(o){var e=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return e.setUTCFullYear(o.getFullYear()),o.getTime()-e.getTime()}function kH(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function l_e(o){return Sc(1,arguments),o instanceof Date||KH(o)==="object"&&Object.prototype.toString.call(o)==="[object Date]"}function c_e(o){if(Sc(1,arguments),!l_e(o)&&typeof o!="number")return!1;var e=cc(o);return!isNaN(Number(e))}function u_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getFullYear()-s.getFullYear(),l=t.getMonth()-s.getMonth();return a*12+l}function f_e(o,e){return Sc(2,arguments),cc(o).getTime()-cc(e).getTime()}var Ple={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},d_e="trunc";function h_e(o){return o?Ple[o]:Ple[d_e]}function m_e(o){Sc(1,arguments);var e=cc(o);return e.setHours(23,59,59,999),e}function g_e(o){Sc(1,arguments);var e=cc(o),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function p_e(o){Sc(1,arguments);var e=cc(o);return m_e(e).getTime()===g_e(e).getTime()}function b_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=kH(t,s),l=Math.abs(u_e(t,s)),f;if(l<1)f=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*l);var d=kH(t,s)===-a;p_e(cc(o))&&l===1&&kH(o,s)===1&&(d=!1),f=a*(l-Number(d))}return f===0?0:f}function v_e(o,e,t){Sc(2,arguments);var s=f_e(o,e)/1e3;return h_e(t==null?void 0:t.roundingMethod)(s)}function O_e(o,e){Sc(2,arguments);var t=hE(e);return i_e(o,-t)}var y_e=864e5;function w_e(o){Sc(1,arguments);var e=cc(o),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),a=t-s;return Math.floor(a/y_e)+1}function JH(o){Sc(1,arguments);var e=1,t=cc(o),s=t.getUTCDay(),a=(s=a.getTime()?t+1:e.getTime()>=f.getTime()?t:t-1}function __e(o){Sc(1,arguments);var e=xpe(o),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var s=JH(t);return s}var S_e=6048e5;function C_e(o){Sc(1,arguments);var e=cc(o),t=JH(e).getTime()-__e(e).getTime();return Math.round(t/S_e)+1}function ez(o,e){var t,s,a,l,f,d,h,b;Sc(1,arguments);var y=q6(),k=hE((t=(s=(a=(l=e==null?void 0:e.weekStartsOn)!==null&&l!==void 0?l:e==null||(f=e.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&a!==void 0?a:y.weekStartsOn)!==null&&s!==void 0?s:(h=y.locale)===null||h===void 0||(b=h.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&t!==void 0?t:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var E=cc(o),M=E.getUTCDay(),$=(M=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=new Date(0);$.setUTCFullYear(k+1,0,M),$.setUTCHours(0,0,0,0);var Q=ez($,e),F=new Date(0);F.setUTCFullYear(k,0,M),F.setUTCHours(0,0,0,0);var U=ez(F,e);return y.getTime()>=Q.getTime()?k+1:y.getTime()>=U.getTime()?k:k-1}function k_e(o,e){var t,s,a,l,f,d,h,b;Sc(1,arguments);var y=q6(),k=hE((t=(s=(a=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(f=e.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:y.firstWeekContainsDate)!==null&&s!==void 0?s:(h=y.locale)===null||h===void 0||(b=h.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&t!==void 0?t:1),E=Tpe(o,e),M=new Date(0);M.setUTCFullYear(E,0,k),M.setUTCHours(0,0,0,0);var $=ez(M,e);return $}var x_e=6048e5;function T_e(o,e){Sc(1,arguments);var t=cc(o),s=ez(t,e).getTime()-k_e(t,e).getTime();return Math.round(s/x_e)+1}function Bl(o,e){for(var t=o<0?"-":"",s=Math.abs(o).toString();s.length0?s:1-s;return Bl(t==="yy"?a%100:a,t.length)},M:function(e,t){var s=e.getUTCMonth();return t==="M"?String(s+1):Bl(s+1,2)},d:function(e,t){return Bl(e.getUTCDate(),t.length)},a:function(e,t){var s=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(e,t){return Bl(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Bl(e.getUTCHours(),t.length)},m:function(e,t){return Bl(e.getUTCMinutes(),t.length)},s:function(e,t){return Bl(e.getUTCSeconds(),t.length)},S:function(e,t){var s=t.length,a=e.getUTCMilliseconds(),l=Math.floor(a*Math.pow(10,s-3));return Bl(l,t.length)}};const mC=E_e;var J4={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},A_e={G:function(e,t,s){var a=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return s.era(a,{width:"abbreviated"});case"GGGGG":return s.era(a,{width:"narrow"});case"GGGG":default:return s.era(a,{width:"wide"})}},y:function(e,t,s){if(t==="yo"){var a=e.getUTCFullYear(),l=a>0?a:1-a;return s.ordinalNumber(l,{unit:"year"})}return mC.y(e,t)},Y:function(e,t,s,a){var l=Tpe(e,a),f=l>0?l:1-l;if(t==="YY"){var d=f%100;return Bl(d,2)}return t==="Yo"?s.ordinalNumber(f,{unit:"year"}):Bl(f,t.length)},R:function(e,t){var s=xpe(e);return Bl(s,t.length)},u:function(e,t){var s=e.getUTCFullYear();return Bl(s,t.length)},Q:function(e,t,s){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Bl(a,2);case"Qo":return s.ordinalNumber(a,{unit:"quarter"});case"QQQ":return s.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,s){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Bl(a,2);case"qo":return s.ordinalNumber(a,{unit:"quarter"});case"qqq":return s.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,s){var a=e.getUTCMonth();switch(t){case"M":case"MM":return mC.M(e,t);case"Mo":return s.ordinalNumber(a+1,{unit:"month"});case"MMM":return s.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,s){var a=e.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return Bl(a+1,2);case"Lo":return s.ordinalNumber(a+1,{unit:"month"});case"LLL":return s.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,s,a){var l=T_e(e,a);return t==="wo"?s.ordinalNumber(l,{unit:"week"}):Bl(l,t.length)},I:function(e,t,s){var a=C_e(e);return t==="Io"?s.ordinalNumber(a,{unit:"week"}):Bl(a,t.length)},d:function(e,t,s){return t==="do"?s.ordinalNumber(e.getUTCDate(),{unit:"date"}):mC.d(e,t)},D:function(e,t,s){var a=w_e(e);return t==="Do"?s.ordinalNumber(a,{unit:"dayOfYear"}):Bl(a,t.length)},E:function(e,t,s){var a=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return s.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(a,{width:"short",context:"formatting"});case"EEEE":default:return s.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,s,a){var l=e.getUTCDay(),f=(l-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(f);case"ee":return Bl(f,2);case"eo":return s.ordinalNumber(f,{unit:"day"});case"eee":return s.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(l,{width:"short",context:"formatting"});case"eeee":default:return s.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,s,a){var l=e.getUTCDay(),f=(l-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(f);case"cc":return Bl(f,t.length);case"co":return s.ordinalNumber(f,{unit:"day"});case"ccc":return s.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(l,{width:"narrow",context:"standalone"});case"cccccc":return s.day(l,{width:"short",context:"standalone"});case"cccc":default:return s.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,s){var a=e.getUTCDay(),l=a===0?7:a;switch(t){case"i":return String(l);case"ii":return Bl(l,t.length);case"io":return s.ordinalNumber(l,{unit:"day"});case"iii":return s.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(a,{width:"short",context:"formatting"});case"iiii":default:return s.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,s){var a=e.getUTCHours(),l=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,s){var a=e.getUTCHours(),l;switch(a===12?l=J4.noon:a===0?l=J4.midnight:l=a/12>=1?"pm":"am",t){case"b":case"bb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,s){var a=e.getUTCHours(),l;switch(a>=17?l=J4.evening:a>=12?l=J4.afternoon:a>=4?l=J4.morning:l=J4.night,t){case"B":case"BB":case"BBB":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,s){if(t==="ho"){var a=e.getUTCHours()%12;return a===0&&(a=12),s.ordinalNumber(a,{unit:"hour"})}return mC.h(e,t)},H:function(e,t,s){return t==="Ho"?s.ordinalNumber(e.getUTCHours(),{unit:"hour"}):mC.H(e,t)},K:function(e,t,s){var a=e.getUTCHours()%12;return t==="Ko"?s.ordinalNumber(a,{unit:"hour"}):Bl(a,t.length)},k:function(e,t,s){var a=e.getUTCHours();return a===0&&(a=24),t==="ko"?s.ordinalNumber(a,{unit:"hour"}):Bl(a,t.length)},m:function(e,t,s){return t==="mo"?s.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):mC.m(e,t)},s:function(e,t,s){return t==="so"?s.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):mC.s(e,t)},S:function(e,t){return mC.S(e,t)},X:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();if(f===0)return"Z";switch(t){case"X":return Rle(f);case"XXXX":case"XX":return eE(f);case"XXXXX":case"XXX":default:return eE(f,":")}},x:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();switch(t){case"x":return Rle(f);case"xxxx":case"xx":return eE(f);case"xxxxx":case"xxx":default:return eE(f,":")}},O:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Mle(f,":");case"OOOO":default:return"GMT"+eE(f,":")}},z:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Mle(f,":");case"zzzz":default:return"GMT"+eE(f,":")}},t:function(e,t,s,a){var l=a._originalDate||e,f=Math.floor(l.getTime()/1e3);return Bl(f,t.length)},T:function(e,t,s,a){var l=a._originalDate||e,f=l.getTime();return Bl(f,t.length)}};function Mle(o,e){var t=o>0?"-":"+",s=Math.abs(o),a=Math.floor(s/60),l=s%60;if(l===0)return t+String(a);var f=e||"";return t+String(a)+f+Bl(l,2)}function Rle(o,e){if(o%60===0){var t=o>0?"-":"+";return t+Bl(Math.abs(o)/60,2)}return eE(o,e)}function eE(o,e){var t=e||"",s=o>0?"-":"+",a=Math.abs(o),l=Bl(Math.floor(a/60),2),f=Bl(a%60,2);return s+l+t+f}const D_e=A_e;var $le=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Epe=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},P_e=function(e,t){var s=e.match(/(P+)(p+)?/)||[],a=s[1],l=s[2];if(!l)return $le(e,t);var f;switch(a){case"P":f=t.dateTime({width:"short"});break;case"PP":f=t.dateTime({width:"medium"});break;case"PPP":f=t.dateTime({width:"long"});break;case"PPPP":default:f=t.dateTime({width:"full"});break}return f.replace("{{date}}",$le(a,t)).replace("{{time}}",Epe(l,t))},M_e={p:Epe,P:P_e};const R_e=M_e;var $_e=["D","DD"],N_e=["YY","YYYY"];function I_e(o){return $_e.indexOf(o)!==-1}function B_e(o){return N_e.indexOf(o)!==-1}function Nle(o,e,t){if(o==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var L_e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},F_e=function(e,t,s){var a,l=L_e[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",t.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+a:a+" ago":a};const Q_e=F_e;function dne(o){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):o.defaultWidth,s=o.formats[t]||o.formats[o.defaultWidth];return s}}var Z_e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},H_e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z_e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},V_e={date:dne({formats:Z_e,defaultWidth:"full"}),time:dne({formats:H_e,defaultWidth:"full"}),dateTime:dne({formats:z_e,defaultWidth:"full"})};const W_e=V_e;var U_e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Y_e=function(e,t,s,a){return U_e[e]};const X_e=Y_e;function NN(o){return function(e,t){var s=t!=null&&t.context?String(t.context):"standalone",a;if(s==="formatting"&&o.formattingValues){var l=o.defaultFormattingWidth||o.defaultWidth,f=t!=null&&t.width?String(t.width):l;a=o.formattingValues[f]||o.formattingValues[l]}else{var d=o.defaultWidth,h=t!=null&&t.width?String(t.width):o.defaultWidth;a=o.values[h]||o.values[d]}var b=o.argumentCallback?o.argumentCallback(e):e;return a[b]}}var j_e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},q_e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},G_e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},K_e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},J_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},eSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},tSe=function(e,t){var s=Number(e),a=s%100;if(a>20||a<10)switch(a%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},nSe={ordinalNumber:tSe,era:NN({values:j_e,defaultWidth:"wide"}),quarter:NN({values:q_e,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:NN({values:G_e,defaultWidth:"wide"}),day:NN({values:K_e,defaultWidth:"wide"}),dayPeriod:NN({values:J_e,defaultWidth:"wide",formattingValues:eSe,defaultFormattingWidth:"wide"})};const oSe=nSe;function IN(o){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.width,a=s&&o.matchPatterns[s]||o.matchPatterns[o.defaultMatchWidth],l=e.match(a);if(!l)return null;var f=l[0],d=s&&o.parsePatterns[s]||o.parsePatterns[o.defaultParseWidth],h=Array.isArray(d)?rSe(d,function(k){return k.test(f)}):sSe(d,function(k){return k.test(f)}),b;b=o.valueCallback?o.valueCallback(h):h,b=t.valueCallback?t.valueCallback(b):b;var y=e.slice(f.length);return{value:b,rest:y}}}function sSe(o,e){for(var t in o)if(o.hasOwnProperty(t)&&e(o[t]))return t}function rSe(o,e){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},s=e.match(o.matchPattern);if(!s)return null;var a=s[0],l=e.match(o.parsePattern);if(!l)return null;var f=o.valueCallback?o.valueCallback(l[0]):l[0];f=t.valueCallback?t.valueCallback(f):f;var d=e.slice(a.length);return{value:f,rest:d}}}var aSe=/^(\d+)(th|st|nd|rd)?/i,lSe=/\d+/i,cSe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},uSe={any:[/^b/i,/^(a|c)/i]},fSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dSe={any:[/1/i,/2/i,/3/i,/4/i]},hSe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},mSe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gSe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pSe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bSe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vSe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},OSe={ordinalNumber:iSe({matchPattern:aSe,parsePattern:lSe,valueCallback:function(e){return parseInt(e,10)}}),era:IN({matchPatterns:cSe,defaultMatchWidth:"wide",parsePatterns:uSe,defaultParseWidth:"any"}),quarter:IN({matchPatterns:fSe,defaultMatchWidth:"wide",parsePatterns:dSe,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:IN({matchPatterns:hSe,defaultMatchWidth:"wide",parsePatterns:mSe,defaultParseWidth:"any"}),day:IN({matchPatterns:gSe,defaultMatchWidth:"wide",parsePatterns:pSe,defaultParseWidth:"any"}),dayPeriod:IN({matchPatterns:bSe,defaultMatchWidth:"any",parsePatterns:vSe,defaultParseWidth:"any"})};const ySe=OSe;var wSe={code:"en-US",formatDistance:Q_e,formatLong:W_e,formatRelative:X_e,localize:oSe,match:ySe,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Ape=wSe;var _Se=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SSe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,CSe=/^'([^]*?)'?$/,kSe=/''/g,xSe=/[a-zA-Z]/;function Dpe(o,e,t){var s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U,K,L,te;Sc(2,arguments);var ne=String(e),oe=q6(),Y=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:oe.locale)!==null&&s!==void 0?s:Ape,ye=hE((l=(f=(d=(h=t==null?void 0:t.firstWeekContainsDate)!==null&&h!==void 0?h:t==null||(b=t.locale)===null||b===void 0||(y=b.options)===null||y===void 0?void 0:y.firstWeekContainsDate)!==null&&d!==void 0?d:oe.firstWeekContainsDate)!==null&&f!==void 0?f:(k=oe.locale)===null||k===void 0||(E=k.options)===null||E===void 0?void 0:E.firstWeekContainsDate)!==null&&l!==void 0?l:1);if(!(ye>=1&&ye<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var _e=hE((M=($=(Q=(F=t==null?void 0:t.weekStartsOn)!==null&&F!==void 0?F:t==null||(U=t.locale)===null||U===void 0||(K=U.options)===null||K===void 0?void 0:K.weekStartsOn)!==null&&Q!==void 0?Q:oe.weekStartsOn)!==null&&$!==void 0?$:(L=oe.locale)===null||L===void 0||(te=L.options)===null||te===void 0?void 0:te.weekStartsOn)!==null&&M!==void 0?M:0);if(!(_e>=0&&_e<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Y.localize)throw new RangeError("locale must contain localize property");if(!Y.formatLong)throw new RangeError("locale must contain formatLong property");var Le=cc(o);if(!c_e(Le))throw new RangeError("Invalid time value");var ve=Poe(Le),ue=O_e(Le,ve),ot={firstWeekContainsDate:ye,weekStartsOn:_e,locale:Y,_originalDate:Le},nt=ne.match(SSe).map(function(mt){var V=mt[0];if(V==="p"||V==="P"){var ht=R_e[V];return ht(mt,Y.formatLong)}return mt}).join("").match(_Se).map(function(mt){if(mt==="''")return"'";var V=mt[0];if(V==="'")return TSe(mt);var ht=D_e[V];if(ht)return!(t!=null&&t.useAdditionalWeekYearTokens)&&B_e(mt)&&Nle(mt,e,String(o)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&I_e(mt)&&Nle(mt,e,String(o)),ht(ue,mt,Y.localize,ot);if(V.match(xSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");return mt}).join("");return nt}function TSe(o){var e=o.match(CSe);return e?e[1].replace(kSe,"'"):o}function Ppe(o,e){if(o==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t]);return o}function ESe(o){return Ppe({},o)}var Ile=1440,ASe=2520,hne=43200,DSe=86400;function PSe(o,e,t){var s,a;Sc(2,arguments);var l=q6(),f=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:l.locale)!==null&&s!==void 0?s:Ape;if(!f.formatDistance)throw new RangeError("locale must contain formatDistance property");var d=kH(o,e);if(isNaN(d))throw new RangeError("Invalid time value");var h=Ppe(ESe(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:d}),b,y;d>0?(b=cc(e),y=cc(o)):(b=cc(o),y=cc(e));var k=v_e(y,b),E=(Poe(y)-Poe(b))/1e3,M=Math.round((k-E)/60),$;if(M<2)return t!=null&&t.includeSeconds?k<5?f.formatDistance("lessThanXSeconds",5,h):k<10?f.formatDistance("lessThanXSeconds",10,h):k<20?f.formatDistance("lessThanXSeconds",20,h):k<40?f.formatDistance("halfAMinute",0,h):k<60?f.formatDistance("lessThanXMinutes",1,h):f.formatDistance("xMinutes",1,h):M===0?f.formatDistance("lessThanXMinutes",1,h):f.formatDistance("xMinutes",M,h);if(M<45)return f.formatDistance("xMinutes",M,h);if(M<90)return f.formatDistance("aboutXHours",1,h);if(Mh.name===(e==null?void 0:e.schema));if(!(s!=null&&s.titleTemplate))return Qle(s,e);let a=e.data,f=Qp.parse(s.titleTemplate).filter(h=>h[0]=="name").map(h=>h[1]).filter(h=>{let b=s.fields.find(y=>y.name===h);return(b==null?void 0:b.info.name)==="reference"}).reduce((h,b)=>{let y=t.edges.find(E=>E.source===e.id&&E.field===b),k=t.records.find(E=>E.id===(y==null?void 0:y.target));return h[b]=wd(o,k,t),h},{});a={...a,...f};let d=Qp.render(s.titleTemplate,a);return!d||d===""?Qle(s,e):Rpe(d.slice(0,300))}function Qle(o,e){var t;return(o==null?void 0:o.type)==="files"?e._file.path:Rpe(e==null?void 0:e.data[(t=o.fields.filter(s=>s.info.name==="text")[0])==null?void 0:t.name]).slice(0,300)}function Zle(o){let e,t,s;return{c(){e=re("a"),t=Xt(o[1]),z(e,"href",s=o[3].lucentUrl+"/records/"+o[0].id),z(e,"class","text-decoration-none rounded py-1 px-2 d-inline-block svelte-nbbgyi"),z(e,"title",o[1]),rs(e,"border","2px solid "+(o[2].color?o[2].color:"#999"),1),rs(e,"white-space","nowrap")},m(a,l){Me(a,e,l),j(e,t)},p(a,l){l&2&&Wn(t,a[1]),l&1&&s!==(s=a[3].lucentUrl+"/records/"+a[0].id)&&z(e,"href",s),l&2&&z(e,"title",a[1]),l&4&&rs(e,"border","2px solid "+(a[2].color?a[2].color:"#999"),1)},d(a){a&&Pe(e)}}}function MSe(o){var s;let e,t=((s=o[0])==null?void 0:s.data)&&Zle(o);return{c(){t&&t.c(),e=Bs()},m(a,l){t&&t.m(a,l),Me(a,e,l)},p(a,[l]){var f;(f=a[0])!=null&&f.data?t?t.p(a,l):(t=Zle(a),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(a){t&&t.d(a),a&&Pe(e)}}}function RSe(o,e,t){let s,a;const l=si("channel");let{record:f}=e,{graph:d}=e;return o.$$set=h=>{"record"in h&&t(0,f=h.record),"graph"in h&&t(4,d=h.graph)},o.$$.update=()=>{o.$$.dirty&1&&t(2,s=l.schemas.find(h=>h.name===f.schema)),o.$$.dirty&17&&t(1,a=wd(l.schemas,f,d))},[f,a,s,l,d]}class G6 extends vo{constructor(e){super(),bo(this,e,RSe,MSe,po,{record:0,graph:4})}}function Hle(o,e,t){const s=o.slice();return s[2]=e[t],s[4]=t,s}function zle(o){let e,t,s=o[0].reverse(),a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;f0&&zle(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[0].length>0?s?(s.p(a,l),l&1&&xe(s,1)):(s=zle(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function ISe(o,e,t){let{managerRecords:s}=e,{graph:a}=e;return o.$$set=l=>{"managerRecords"in l&&t(0,s=l.managerRecords),"graph"in l&&t(1,a=l.graph)},[s,a]}class BSe extends vo{constructor(e){super(),bo(this,e,ISe,NSe,po,{managerRecords:0,graph:1})}}function LSe(o){let e;return{c(){e=Xt("New Record")},m(t,s){Me(t,e,s)},p:pn,d(t){t&&Pe(e)}}}function FSe(o){let e=wd(o[5].schemas,o[3],o[2])+"",t;return{c(){t=Xt(e)},m(s,a){Me(s,t,a)},p(s,a){a&12&&e!==(e=wd(s[5].schemas,s[3],s[2])+"")&&Wn(t,e)},d(s){s&&Pe(t)}}}function Wle(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U;s=new ml({props:{icon:"ellipsis"}});let K=!o[4]&&Ule(o);return{c(){e=re("div"),t=re("button"),tn(s.$$.fragment),a=Ze(),l=re("div"),f=re("h6"),f.textContent="Record Actions",d=Ze(),h=re("a"),b=Xt("Create new"),k=Ze(),K&&K.c(),E=Ze(),M=re("a"),$=Xt("Revisions"),z(t,"class","btn btn-link btn-sm"),z(t,"type","button"),z(t,"data-bs-toggle","dropdown"),z(t,"aria-expanded","false"),z(f,"class","dropdown-header"),z(h,"class","dropdown-item"),z(h,"href",y=o[5].lucentUrl+"/records/new?schema="+o[1].name),z(M,"class","dropdown-item"),z(M,"href",o[5].lucentUrl),z(l,"class","dropdown-menu"),z(e,"class","dropdown d-inline-block")},m(L,te){Me(L,e,te),j(e,t),Kt(s,t,null),j(e,a),j(e,l),j(l,f),j(l,d),j(l,h),j(h,b),j(l,k),K&&K.m(l,null),j(l,E),j(l,M),j(M,$),Q=!0,F||(U=vn(M,"click",ju(o[7])),F=!0)},p(L,te){(!Q||te&2&&y!==(y=L[5].lucentUrl+"/records/new?schema="+L[1].name))&&z(h,"href",y),L[4]?K&&(K.d(1),K=null):K?K.p(L,te):(K=Ule(L),K.c(),K.m(l,E))},i(L){Q||(xe(s.$$.fragment,L),Q=!0)},o(L){Qe(s.$$.fragment,L),Q=!1},d(L){L&&Pe(e),Jt(s),K&&K.d(),F=!1,U()}}}function Ule(o){let e,t,s,a;return{c(){e=re("a"),t=Xt("Clone"),z(e,"class","dropdown-item"),z(e,"href",o[5].lucentUrl)},m(l,f){Me(l,e,f),j(e,t),s||(a=vn(e,"click",o[6]),s=!0)},p:pn,d(l){l&&Pe(e),s=!1,a()}}}function QSe(o){let e,t,s=o[1].label.toUpperCase()+"",a,l,f,d,h,b;function y($,Q){return $[4]?LSe:FSe}let k=y(o),E=k(o),M=!o[4]&&Wle(o);return{c(){e=re("h3"),t=re("a"),a=Xt(s),f=Ze(),d=re("span"),E.c(),h=Ze(),M&&M.c(),z(t,"class","text-muted d-block text-decoration-none fs-6 mb-1"),z(t,"href",l=o[5].lucentUrl+"/content/"+o[1].name),z(d,"class","text-dark d-block"),z(e,"class","header-normal mt-5 mb-0")},m($,Q){Me($,e,Q),j(e,t),j(t,a),j(e,f),j(e,d),E.m(d,null),j(e,h),M&&M.m(e,null),b=!0},p($,[Q]){(!b||Q&2)&&s!==(s=$[1].label.toUpperCase()+"")&&Wn(a,s),(!b||Q&2&&l!==(l=$[5].lucentUrl+"/content/"+$[1].name))&&z(t,"href",l),k===(k=y($))&&E?E.p($,Q):(E.d(1),E=k($),E&&(E.c(),E.m(d,null))),$[4]?M&&(wo(),Qe(M,1,1,()=>{M=null}),_o()):M?(M.p($,Q),Q&16&&xe(M,1)):(M=Wle($),M.c(),xe(M,1),M.m(e,null))},i($){b||(xe(M),b=!0)},o($){Qe(M),b=!1},d($){$&&Pe(e),E.d(),M&&M.d()}}}function ZSe(o,e,t){const s=si("channel");let{schema:a}=e,{graph:l}=e,{record:f}=e,{isCreateMode:d}=e,{activeContentTab:h}=e;function b(k){k.preventDefault(),axios.post(s.lucentUrl+"/records/clone/"+f.id).then(E=>{window.location=s.lucentUrl+"/records/"+E.data.id}).catch(E=>{})}const y=k=>t(0,h="_info");return o.$$set=k=>{"schema"in k&&t(1,a=k.schema),"graph"in k&&t(2,l=k.graph),"record"in k&&t(3,f=k.record),"isCreateMode"in k&&t(4,d=k.isCreateMode),"activeContentTab"in k&&t(0,h=k.activeContentTab)},[h,a,l,f,d,s,b,y]}class HSe extends vo{constructor(e){super(),bo(this,e,ZSe,QSe,po,{schema:1,graph:2,record:3,isCreateMode:4,activeContentTab:0})}}function $pe(o){return Npe()[o]}function Npe(){return{published:{value:"published",text:"Published",bg:"success",color:"white"},trashed:{value:"trashed",text:"Trashed",bg:"danger",color:"white"},draft:{value:"draft",text:"Draft",bg:"warning",color:"dark"}}}function Yle(o,e,t){const s=o.slice();return s[10]=e[t],s}function Xle(o){let e,t=o[10].text+"",s,a,l,f;function d(...h){return o[9](o[10],...h)}return{c(){e=re("button"),s=Xt(t),a=Ze(),z(e,"type","button"),z(e,"class","dropdown-item my-2 rounded w-100 bg-"+o[10].bg+" text-"+o[10].color)},m(h,b){Me(h,e,b),j(e,s),j(e,a),l||(f=vn(e,"click",d),l=!0)},p(h,b){o=h},d(h){h&&Pe(e),l=!1,f()}}}function jle(o){let e,t=o[10].value!==o[0]&&Xle(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,a){s[10].value!==s[0]?t?t.p(s,a):(t=Xle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&Pe(e)}}}function zSe(o){let e,t,s;return{c(){e=re("a"),t=Xt("Preview"),z(e,"href",s=o[5].previewTargetUrl+"?schema="+o[2].name+"&id="+o[1].id),z(e,"target","_blank"),z(e,"class","btn btn-info ms-3")},m(a,l){Me(a,e,l),j(e,t)},p(a,l){l&6&&s!==(s=a[5].previewTargetUrl+"?schema="+a[2].name+"&id="+a[1].id)&&z(e,"href",s)},d(a){a&&Pe(e)}}}function VSe(o){let e,t,s,a=o[4].text+"",l,f,d,h,b,y,k,E,M,$,Q,F=o[6],U=[];for(let L=0;L{h=M,t(3,h)})}const E=(M,$)=>y($,M.value);return o.$$set=M=>{"status"in M&&t(0,l=M.status),"record"in M&&t(1,f=M.record),"schema"in M&&t(2,d=M.schema)},o.$$.update=()=>{o.$$.dirty&1&&t(4,s=$pe(l))},[l,f,d,h,s,a,b,y,k,E]}class Ipe extends vo{constructor(e){super(),bo(this,e,WSe,VSe,po,{status:0,record:1,schema:2})}}function qle(o){return o._file.mime==="image/svg+xml"?Moe(o):si("channel").filesUrl+`/thumbs/${o._file.path}`}function Moe(o){return si("channel").filesUrl+`/${o._file.path}`}function Gle(o){let e,t,s,a,l;const f=[YSe,USe],d=[];function h(b,y){return y&1&&(e=null),e==null&&(e=!!b[0]._file.mime.startsWith("image")),e?0:1}return t=h(o,-1),s=d[t]=f[t](o),{c(){s.c(),a=Bs()},m(b,y){d[t].m(b,y),Me(b,a,y),l=!0},p(b,y){let k=t;t=h(b,y),t===k?d[t].p(b,y):(wo(),Qe(d[k],1,1,()=>{d[k]=null}),_o(),s=d[t],s?s.p(b,y):(s=d[t]=f[t](b),s.c()),xe(s,1),s.m(a.parentNode,a))},i(b){l||(xe(s),l=!0)},o(b){Qe(s),l=!1},d(b){d[t].d(b),b&&Pe(a)}}}function USe(o){let e,t,s,a,l,f=o[0]._file.path.split(".").pop()+"",d,h,b,y;return t=new ml({props:{icon:"file",width:o[3],height:o[3]}}),{c(){e=re("a"),tn(t.$$.fragment),s=Ze(),a=re("span"),l=Xt("."),d=Xt(f),z(a,"class","ms-2"),rs(a,"font-size",o[4]+"px"),z(e,"href",h=o[5].lucentUrl+"/records/"+o[0].id),z(e,"title",b=o[0]._file.path),z(e,"class","btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center"),rs(e,"width",o[2]+"px"),rs(e,"height",o[2]+"px")},m(k,E){Me(k,e,E),Kt(t,e,null),j(e,s),j(e,a),j(a,l),j(a,d),y=!0},p(k,E){const M={};E&8&&(M.width=k[3]),E&8&&(M.height=k[3]),t.$set(M),(!y||E&1)&&f!==(f=k[0]._file.path.split(".").pop()+"")&&Wn(d,f),(!y||E&16)&&rs(a,"font-size",k[4]+"px"),(!y||E&1&&h!==(h=k[5].lucentUrl+"/records/"+k[0].id))&&z(e,"href",h),(!y||E&1&&b!==(b=k[0]._file.path))&&z(e,"title",b),(!y||E&4)&&rs(e,"width",k[2]+"px"),(!y||E&4)&&rs(e,"height",k[2]+"px")},i(k){y||(xe(t.$$.fragment,k),y=!0)},o(k){Qe(t.$$.fragment,k),y=!1},d(k){k&&Pe(e),Jt(t)}}}function YSe(o){let e,t,s,a,l,f;return{c(){e=re("a"),t=re("img"),z(t,"class","rounded w-100"),dle(t.src,s=qle(o[0]))||z(t,"src",s),z(t,"alt",a=o[0]._file.path),z(e,"href",l=o[5].lucentUrl+"/records/"+o[0].id),z(e,"title",f=o[0]._file.path),z(e,"class","d-flex align-items-center justify-content-center "),rs(e,"width",o[2]+"px"),rs(e,"height",o[2]+"px")},m(d,h){Me(d,e,h),j(e,t)},p(d,h){h&1&&!dle(t.src,s=qle(d[0]))&&z(t,"src",s),h&1&&a!==(a=d[0]._file.path)&&z(t,"alt",a),h&1&&l!==(l=d[5].lucentUrl+"/records/"+d[0].id)&&z(e,"href",l),h&1&&f!==(f=d[0]._file.path)&&z(e,"title",f),h&4&&rs(e,"width",d[2]+"px"),h&4&&rs(e,"height",d[2]+"px")},i:pn,o:pn,d(d){d&&Pe(e)}}}function Kle(o){let e,t=o[0]._file.path+"",s,a,l;return{c(){e=re("a"),s=Xt(t),z(e,"href",a=o[5].lucentUrl+"/records/"+o[0].id),z(e,"title",l=o[0]._file.path),z(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(f,d){Me(f,e,d),j(e,s)},p(f,d){d&1&&t!==(t=f[0]._file.path+"")&&Wn(s,t),d&1&&a!==(a=f[5].lucentUrl+"/records/"+f[0].id)&&z(e,"href",a),d&1&&l!==(l=f[0]._file.path)&&z(e,"title",l)},d(f){f&&Pe(e)}}}function XSe(o){let e,t,s,a=o[0]&&Gle(o),l=o[1]&&Kle(o);return{c(){a&&a.c(),e=Ze(),l&&l.c(),t=Bs()},m(f,d){a&&a.m(f,d),Me(f,e,d),l&&l.m(f,d),Me(f,t,d),s=!0},p(f,[d]){f[0]?a?(a.p(f,d),d&1&&xe(a,1)):(a=Gle(f),a.c(),xe(a,1),a.m(e.parentNode,e)):a&&(wo(),Qe(a,1,1,()=>{a=null}),_o()),f[1]?l?l.p(f,d):(l=Kle(f),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i(f){s||(xe(a),s=!0)},o(f){Qe(a),s=!1},d(f){a&&a.d(f),f&&Pe(e),l&&l.d(f),f&&Pe(t)}}}function jSe(o,e,t){let{record:s}=e;const a=si("channel");let{size:l="small"}=e,{showFilename:f=!1}=e,d,h,b;return l=="large"?(d=256,h=32,b="20"):l=="medium"?(d=128,h=12,b="17"):l=="small"?(d=64,h=12,b="15"):l=="tiny"&&(d=42,h=12,b="13"),o.$$set=y=>{"record"in y&&t(0,s=y.record),"size"in y&&t(6,l=y.size),"showFilename"in y&&t(1,f=y.showFilename)},[s,f,d,h,b,a,l]}class Xw extends vo{constructor(e){super(),bo(this,e,jSe,XSe,po,{record:0,size:6,showFilename:1})}}function Jle(o){let e,t,s,a,l,f,d,h,b,y,k=o[0]._file.path+"",E,M,$,Q,F,U,K=o[0]._file.originalName+"",L,te,ne,oe,Y,ye,_e=o[0]._file.mime+"",Le,ve,ue,ot,nt,mt,V,ht=(o[0]._file.size/1024).toFixed(1)+"",We,Ct,yt,Re,Je,an,Et,An=o[0]._file.checksum+"",Xe,_t,he,Zo,ao,wn,Co=o[0]._file.path+"",Ho,wt,Wt;s=new Xw({props:{record:o[0],size:"large"}});let gt=o[0]._file.width&&ece(o);return{c(){e=re("div"),t=re("div"),tn(s.$$.fragment),a=Ze(),l=re("div"),f=re("ul"),d=re("li"),h=re("span"),h.textContent="Filename",b=Ze(),y=re("span"),E=Xt(k),M=Ze(),$=re("li"),Q=re("span"),Q.textContent="Original name",F=Ze(),U=re("span"),L=Xt(K),te=Ze(),ne=re("li"),oe=re("span"),oe.textContent="Mime type",Y=Ze(),ye=re("span"),Le=Xt(_e),ve=Ze(),gt&>.c(),ue=Ze(),ot=re("li"),nt=re("span"),nt.textContent="File size",mt=Ze(),V=re("span"),We=Xt(ht),Ct=Xt("kB"),yt=Ze(),Re=re("li"),Je=re("span"),Je.textContent="Checksum",an=Ze(),Et=re("span"),Xe=Xt(An),_t=Ze(),he=re("li"),Zo=re("span"),Zo.textContent="Download",ao=Ze(),wn=re("a"),Ho=Xt(Co),z(t,"class","col"),rs(t,"max-width","276px"),z(h,"class","text-muted"),z(d,"class","list-group-item border-primary"),z(Q,"class","text-muted"),z($,"class","list-group-item border-primary"),z(oe,"class","text-muted"),z(ne,"class","list-group-item border-primary"),z(nt,"class","text-muted"),z(ot,"class","list-group-item border-primary"),z(Je,"class","text-muted"),z(Re,"class","list-group-item border-primary"),z(Zo,"class","text-muted"),z(wn,"href",wt=Moe(o[0])),z(he,"class","list-group-item border-primary"),z(f,"class","list-group svelte-1qb90xc"),z(l,"class","col"),z(e,"class","row mb-4")},m(Ne,Gt){Me(Ne,e,Gt),j(e,t),Kt(s,t,null),j(e,a),j(e,l),j(l,f),j(f,d),j(d,h),j(d,b),j(d,y),j(y,E),j(f,M),j(f,$),j($,Q),j($,F),j($,U),j(U,L),j(f,te),j(f,ne),j(ne,oe),j(ne,Y),j(ne,ye),j(ye,Le),j(f,ve),gt&>.m(f,null),j(f,ue),j(f,ot),j(ot,nt),j(ot,mt),j(ot,V),j(V,We),j(V,Ct),j(f,yt),j(f,Re),j(Re,Je),j(Re,an),j(Re,Et),j(Et,Xe),j(f,_t),j(f,he),j(he,Zo),j(he,ao),j(he,wn),j(wn,Ho),Wt=!0},p(Ne,Gt){const gn={};Gt&1&&(gn.record=Ne[0]),s.$set(gn),(!Wt||Gt&1)&&k!==(k=Ne[0]._file.path+"")&&Wn(E,k),(!Wt||Gt&1)&&K!==(K=Ne[0]._file.originalName+"")&&Wn(L,K),(!Wt||Gt&1)&&_e!==(_e=Ne[0]._file.mime+"")&&Wn(Le,_e),Ne[0]._file.width?gt?gt.p(Ne,Gt):(gt=ece(Ne),gt.c(),gt.m(f,ue)):gt&&(gt.d(1),gt=null),(!Wt||Gt&1)&&ht!==(ht=(Ne[0]._file.size/1024).toFixed(1)+"")&&Wn(We,ht),(!Wt||Gt&1)&&An!==(An=Ne[0]._file.checksum+"")&&Wn(Xe,An),(!Wt||Gt&1)&&Co!==(Co=Ne[0]._file.path+"")&&Wn(Ho,Co),(!Wt||Gt&1&&wt!==(wt=Moe(Ne[0])))&&z(wn,"href",wt)},i(Ne){Wt||(xe(s.$$.fragment,Ne),Wt=!0)},o(Ne){Qe(s.$$.fragment,Ne),Wt=!1},d(Ne){Ne&&Pe(e),Jt(s),gt&>.d()}}}function ece(o){let e,t,s,a,l=o[0]._file.width+"",f,d,h=o[0]._file.height+"",b;return{c(){e=re("li"),t=re("span"),t.textContent="Dimensions",s=Ze(),a=re("span"),f=Xt(l),d=Xt("x"),b=Xt(h),z(t,"class","text-muted"),z(e,"class","list-group-item border-primary")},m(y,k){Me(y,e,k),j(e,t),j(e,s),j(e,a),j(a,f),j(a,d),j(a,b)},p(y,k){k&1&&l!==(l=y[0]._file.width+"")&&Wn(f,l),k&1&&h!==(h=y[0]._file.height+"")&&Wn(b,h)},d(y){y&&Pe(e)}}}function qSe(o){let e,t,s=o[1].type==="files"&&Jle(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[1].type==="files"?s?(s.p(a,l),l&2&&xe(s,1)):(s=Jle(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function GSe(o,e,t){let{record:s}=e,{schema:a}=e;return o.$$set=l=>{"record"in l&&t(0,s=l.record),"schema"in l&&t(1,a=l.schema)},[s,a]}class Bpe extends vo{constructor(e){super(),bo(this,e,GSe,qSe,po,{record:0,schema:1})}}function tce(o,e,t){const s=o.slice();return s[9]=e[t],s}function nce(o){let e,t=o[1],s=[];for(let a=0;a1&&nce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,[a]){s[1].length>1?t?t.p(s,a):(t=nce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Pe(e)}}}function JSe(o,e,t){var E,M;let{schema:s}=e,{isCreateMode:a}=e,{active:l=""}=e,f=(M=(E=s.groups)==null?void 0:E.map($=>({label:$,name:$})))!=null?M:[],d={label:"Main",name:""},h={label:"Graph",name:"_graph"};a?f=[d,...f]:f=[d,...f,h];function b($){$.preventDefault(),t(0,l="_graph")}function y($,Q){$.preventDefault(),Q=="_graph"?b($):t(0,l=Q)}const k=($,Q)=>y(Q,$.name);return o.$$set=$=>{"schema"in $&&t(3,s=$.schema),"isCreateMode"in $&&t(4,a=$.isCreateMode),"active"in $&&t(0,l=$.active)},[l,f,y,s,a,k]}class Lpe extends vo{constructor(e){super(),bo(this,e,JSe,KSe,po,{schema:3,isCreateMode:4,active:0})}}function sce(o,e,t){const s=o.slice();return s[11]=e[t],s}function rce(o){let e=[],t=new Map,s,a=o[3];const l=d=>d[11].id;for(let d=0;d{axios.get("/records/suggestions",{params:{schema:l.optionsFrom,field:l.optionsField,value:d,ui:l.ui}}).then(Q=>{t(3,s=Q.data)}).catch(Q=>{console.log(Q)})},500);function b($,Q){$.preventDefault(),t(0,f=Q.data[l.optionsField]),t(1,d="")}const y=($,Q)=>b(Q,$),k=($,Q)=>b(Q,$),E=$=>{t(0,f=d),t(1,d="")},M=$=>{t(0,f=d),t(1,d="")};return o.$$set=$=>{"field"in $&&t(2,l=$.field),"value"in $&&t(0,f=$.value),"search"in $&&t(1,d=$.search)},t(3,s=[]),[f,d,l,s,a,b,h,y,k,E,M]}class qz extends vo{constructor(e){super(),bo(this,e,oCe,nCe,po,{field:2,value:0,search:1,update:6})}get update(){return this.$$.ctx[6]}}function lce(o,e,t){const s=o.slice();return s[11]=e[t][0],s[12]=e[t][1],s}function cce(o,e,t){const s=o.slice();return s[8]=e[t],s}function uce(o){let e,t;function s(f,d){return d&1&&(e=null),e==null&&(e=!!Array.isArray(f[0].selectOptions)),e?rCe:sCe}let a=s(o,-1),l=a(o);return{c(){l.c(),t=Bs()},m(f,d){l.m(f,d),Me(f,t,d)},p(f,d){a===(a=s(f,d))&&l?l.p(f,d):(l.d(1),l=a(f),l&&(l.c(),l.m(t.parentNode,t)))},d(f){l.d(f),f&&Pe(t)}}}function sCe(o){let e=[],t=new Map,s,a=Object.entries(o[0].selectOptions);const l=f=>f[11];for(let f=0;ff[8];for(let f=0;ff(E,k),h=(k,E)=>f(E,k),b=(k,E)=>f(E,k),y=(k,E)=>f(E,k);return o.$$set=k=>{"field"in k&&t(0,s=k.field),"value"in k&&t(2,a=k.value),"search"in k&&t(3,l=k.search)},[s,f,a,l,d,h,b,y]}class lCe extends vo{constructor(e){super(),bo(this,e,aCe,iCe,po,{field:0,value:2,search:3})}}function Lm(o,e){return o&&o[e]?o[e].message:null}function cCe(o){let e,t,s,a;return{c(){e=re("input"),z(e,"type","text"),z(e,"id",o[3]),z(e,"class","form-control"),z(e,"autocomplete","off"),e.readOnly=t=o[1].readonly&&!o[2],as(e,"is-invalid",o[7])},m(l,f){Me(l,e,f),hr(e,o[0]),s||(a=vn(e,"input",o[18]),s=!0)},p(l,f){f&8&&z(e,"id",l[3]),f&6&&t!==(t=l[1].readonly&&!l[2])&&(e.readOnly=t),f&1&&e.value!==l[0]&&hr(e,l[0]),f&128&&as(e,"is-invalid",l[7])},i:pn,o:pn,d(l){l&&Pe(e),s=!1,a()}}}function uCe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M;function $(K){o[15](K)}function Q(K){o[16](K)}let F={field:o[1]};o[0]!==void 0&&(F.value=o[0]),o[6]!==void 0&&(F.search=o[6]),f=new lCe({props:F}),Uo.push(()=>cr(f,"value",$)),Uo.push(()=>cr(f,"search",Q));let U=o[0]&&hce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("div"),tn(f.$$.fragment),b=Ze(),U&&U.c(),y=Bs(),z(t,"type","search"),z(t,"id",o[3]),z(t,"class","form-control dropdown-toggle"),z(t,"placeholder","Search for options"),z(t,"data-bs-toggle","dropdown"),z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],as(t,"is-invalid",o[7]),z(l,"class","dropdown-menu w-100"),z(e,"class","dropdown")},m(K,L){Me(K,e,L),j(e,t),hr(t,o[6]),j(e,a),j(e,l),Kt(f,l,null),Me(K,b,L),U&&U.m(K,L),Me(K,y,L),k=!0,E||(M=vn(t,"input",o[14]),E=!0)},p(K,L){(!k||L&8)&&z(t,"id",K[3]),(!k||L&6&&s!==(s=K[1].readonly&&!K[2]))&&(t.readOnly=s),L&64&&t.value!==K[6]&&hr(t,K[6]),(!k||L&128)&&as(t,"is-invalid",K[7]);const te={};L&2&&(te.field=K[1]),!d&&L&1&&(d=!0,te.value=K[0],mr(()=>d=!1)),!h&&L&64&&(h=!0,te.search=K[6],mr(()=>h=!1)),f.$set(te),K[0]?U?U.p(K,L):(U=hce(K),U.c(),U.m(y.parentNode,y)):U&&(U.d(1),U=null)},i(K){k||(xe(f.$$.fragment,K),k=!0)},o(K){Qe(f.$$.fragment,K),k=!1},d(K){K&&Pe(e),Jt(f),K&&Pe(b),U&&U.d(K),K&&Pe(y),E=!1,M()}}}function fCe(o){let e,t,s,a,l,f,d,h,b,y,k=o[1].optionsFrom&&mce(o),E=o[0]&&gce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("div"),k&&k.c(),f=Ze(),E&&E.c(),d=Bs(),z(t,"type","search"),z(t,"id",o[3]),z(t,"class","form-control dropdown-toggle"),z(t,"placeholder","Search for options"),z(t,"data-bs-toggle","dropdown"),z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],as(t,"is-invalid",o[7]),z(l,"class","dropdown-menu w-100"),z(e,"class","dropdown")},m(M,$){Me(M,e,$),j(e,t),hr(t,o[6]),j(e,a),j(e,l),k&&k.m(l,null),Me(M,f,$),E&&E.m(M,$),Me(M,d,$),h=!0,b||(y=[vn(t,"keyup",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),vn(t,"focus",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),vn(t,"input",o[9])],b=!0)},p(M,$){o=M,(!h||$&8)&&z(t,"id",o[3]),(!h||$&6&&s!==(s=o[1].readonly&&!o[2]))&&(t.readOnly=s),$&64&&t.value!==o[6]&&hr(t,o[6]),(!h||$&128)&&as(t,"is-invalid",o[7]),o[1].optionsFrom?k?(k.p(o,$),$&2&&xe(k,1)):(k=mce(o),k.c(),xe(k,1),k.m(l,null)):k&&(wo(),Qe(k,1,1,()=>{k=null}),_o()),o[0]?E?E.p(o,$):(E=gce(o),E.c(),E.m(d.parentNode,d)):E&&(E.d(1),E=null)},i(M){h||(xe(k),h=!0)},o(M){Qe(k),h=!1},d(M){M&&Pe(e),k&&k.d(),M&&Pe(f),E&&E.d(M),M&&Pe(d),b=!1,$i(y)}}}function hce(o){let e,t,s,a,l,f,d;function h(k,E){return E&2&&(s=null),s==null&&(s=!!Array.isArray(k[1].selectOptions)),s?hCe:dCe}let b=h(o,-1),y=b(o);return{c(){e=re("span"),t=re("div"),y.c(),a=Ze(),l=re("button"),z(l,"type","button"),z(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),z(l,"aria-label","Close"),z(t,"class","d-flex align-items-center "),z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(k,E){Me(k,e,E),j(e,t),y.m(t,null),j(t,a),j(t,l),f||(d=vn(l,"click",ju(o[17])),f=!0)},p(k,E){b===(b=h(k,E))&&y?y.p(k,E):(y.d(1),y=b(k),y&&(y.c(),y.m(t,a)))},d(k){k&&Pe(e),y.d(),f=!1,d()}}}function dCe(o){let e=o[1].selectOptions[o[0]]+"",t;return{c(){t=Xt(e)},m(s,a){Me(s,t,a)},p(s,a){a&3&&e!==(e=s[1].selectOptions[s[0]]+"")&&Wn(t,e)},d(s){s&&Pe(t)}}}function hCe(o){let e;return{c(){e=Xt(o[0])},m(t,s){Me(t,e,s)},p(t,s){s&1&&Wn(e,t[0])},d(t){t&&Pe(e)}}}function mce(o){let e,t,s,a;function l(h){o[11](h)}function f(h){o[12](h)}let d={field:o[1]};return o[0]!==void 0&&(d.value=o[0]),o[6]!==void 0&&(d.search=o[6]),e=new qz({props:d}),o[10](e),Uo.push(()=>cr(e,"value",l)),Uo.push(()=>cr(e,"search",f)),{c(){tn(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&2&&(y.field=h[1]),!t&&b&1&&(t=!0,y.value=h[0],mr(()=>t=!1)),!s&&b&64&&(s=!0,y.search=h[6],mr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Qe(e.$$.fragment,h),a=!1},d(h){o[10](null),Jt(e,h)}}}function gce(o){let e,t,s,a,l,f,d;return{c(){e=re("span"),t=re("div"),s=Xt(o[0]),a=Ze(),l=re("button"),z(l,"type","button"),z(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),z(l,"aria-label","Close"),z(t,"class","d-flex align-items-center "),z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(h,b){Me(h,e,b),j(e,t),j(t,s),j(t,a),j(t,l),f||(d=vn(l,"click",ju(o[13])),f=!0)},p(h,b){b&1&&Wn(s,h[0])},d(h){h&&Pe(e),f=!1,d()}}}function pce(o){let e,t;return{c(){e=re("div"),t=Xt(o[7]),z(e,"class","invalid-feedback d-block")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&128&&Wn(t,s[7])},d(s){s&&Pe(e)}}}function mCe(o){let e,t,s,a,l;const f=[fCe,uCe,cCe],d=[];function h(y,k){return y[5]?0:y[1].selectOptions?1:2}t=h(o),s=d[t]=f[t](o);let b=o[7]&&pce(o);return{c(){e=re("div"),s.c(),a=Ze(),b&&b.c(),z(e,"class","mb-0")},m(y,k){Me(y,e,k),d[t].m(e,null),j(e,a),b&&b.m(e,null),l=!0},p(y,[k]){let E=t;t=h(y),t===E?d[t].p(y,k):(wo(),Qe(d[E],1,1,()=>{d[E]=null}),_o(),s=d[t],s?s.p(y,k):(s=d[t]=f[t](y),s.c()),xe(s,1),s.m(e,a)),y[7]?b?b.p(y,k):(b=pce(y),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(y){l||(xe(s),l=!0)},o(y){Qe(s),l=!1},d(y){y&&Pe(e),d[t].d(),b&&b.d()}}}function gCe(o,e,t){let s,a,l,{field:f}=e,{value:d}=e,{isCreateMode:h}=e,{validationErrors:b}=e,{id:y}=e,k;function E(){a=this.value,t(6,a)}function M(oe){Uo[oe?"unshift":"push"](()=>{k=oe,t(4,k)})}function $(oe){d=oe,t(0,d)}function Q(oe){a=oe,t(6,a)}const F=oe=>t(0,d="");function U(){a=this.value,t(6,a)}function K(oe){d=oe,t(0,d)}function L(oe){a=oe,t(6,a)}const te=oe=>t(0,d="");function ne(){d=this.value,t(0,d)}return o.$$set=oe=>{"field"in oe&&t(1,f=oe.field),"value"in oe&&t(0,d=oe.value),"isCreateMode"in oe&&t(2,h=oe.isCreateMode),"validationErrors"in oe&&t(8,b=oe.validationErrors),"id"in oe&&t(3,y=oe.id)},o.$$.update=()=>{o.$$.dirty&258&&t(7,s=Lm(b,f.name)),o.$$.dirty&6&&t(5,l=f.optionsFrom&&!(f.readonly&&!h))},t(6,a=""),[d,f,h,y,k,l,a,s,b,E,M,$,Q,F,U,K,L,te,ne]}class Fpe extends vo{constructor(e){super(),bo(this,e,gCe,mCe,po,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function bce(o){let e,t;return{c(){e=re("div"),t=Xt(o[4]),z(e,"class","invalid-feedback d-block")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&16&&Wn(t,s[4])},d(s){s&&Pe(e)}}}function pCe(o){let e,t,s,a,l,f,d=o[4]&&bce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),d&&d.c(),z(t,"type","text"),z(t,"id",o[3]),z(t,"class","form-control"),z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],as(t,"is-invalid",o[4]),z(e,"class","mb-0")},m(h,b){Me(h,e,b),j(e,t),hr(t,o[0]),j(e,a),d&&d.m(e,null),l||(f=vn(t,"input",o[6]),l=!0)},p(h,[b]){b&8&&z(t,"id",h[3]),b&6&&s!==(s=h[1].readonly&&!h[2])&&(t.readOnly=s),b&1&&t.value!==h[0]&&hr(t,h[0]),b&16&&as(t,"is-invalid",h[4]),h[4]?d?d.p(h,b):(d=bce(h),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i:pn,o:pn,d(h){h&&Pe(e),d&&d.d(),l=!1,f()}}}function bCe(o,e,t){let s,{field:a}=e,{value:l}=e,{isCreateMode:f}=e,{validationErrors:d}=e,{id:h}=e;function b(){l=this.value,t(0,l)}return o.$$set=y=>{"field"in y&&t(1,a=y.field),"value"in y&&t(0,l=y.value),"isCreateMode"in y&&t(2,f=y.isCreateMode),"validationErrors"in y&&t(5,d=y.validationErrors),"id"in y&&t(3,h=y.id)},o.$$.update=()=>{o.$$.dirty&34&&t(4,s=Lm(d,a.name))},[l,a,f,h,s,d,b]}class Qpe extends vo{constructor(e){super(),bo(this,e,bCe,pCe,po,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function K6(o,e,t,s,a=""){let l=t.map(d=>({target:d.id,source:e.id,sourceSchema:e.schema,targetSchema:d.schema,field:s,rank:""})),f=o.edges;return a==="replace"&&(f=f.filter(d=>d.field!==field.name)),o.records=Lc.exports.uniqBy([...o.records,...t],d=>d.id),o.edges=Lc.exports.uniqBy([...f,...l],d=>d.source+d.target+d.field),o}function vCe(o){let e,t=o[0].text+"",s;return{c(){e=re("span"),s=Xt(t),z(e,"class","badge text-bg-"+o[0].bg),rs(e,"max-width","84px")},m(a,l){Me(a,e,l),j(e,s)},p:pn,i:pn,o:pn,d(a){a&&Pe(e)}}}function OCe(o,e,t){let{status:s}=e,a=$pe(s);return o.$$set=l=>{"status"in l&&t(1,s=l.status)},[a,s]}class nre extends vo{constructor(e){super(),bo(this,e,OCe,vCe,po,{status:1})}}function yCe(o){let e,t,s;return t=new Xw({props:{record:o[0],size:"small"}}),{c(){e=re("div"),tn(t.$$.fragment),rs(e,"max-width","94px"),rs(e,"margin-right","15px")},m(a,l){Me(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&1&&(f.record=a[0]),t.$set(f)},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),Jt(t)}}}function vce(o){let e,t;return e=new nre({props:{status:o[0].status}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.status=s[0].status),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Oce(o){let e,t,s,a,l,f;return s=new ml({props:{icon:"trash-can"}}),{c(){e=re("div"),t=re("button"),tn(s.$$.fragment),z(t,"class","trash-button text-dark btn btn-sm btn-link svelte-dof9cm"),z(e,"class","position-absolute end-0"),rs(e,"top","5px")},m(d,h){Me(d,e,h),j(e,t),Kt(s,t,null),a=!0,l||(f=vn(t,"click",o[6]),l=!0)},p:pn,i(d){a||(xe(s.$$.fragment,d),a=!0)},o(d){Qe(s.$$.fragment,d),a=!1},d(d){d&&Pe(e),Jt(s),l=!1,f()}}}function wCe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q=o[4].type==="files"&&yCe(o),F=o[0].status==="draft"&&vce(o),U=o[2]&&Oce(o);return{c(){var K;e=re("div"),t=re("div"),Q&&Q.c(),s=Ze(),a=re("div"),l=re("a"),f=Xt(o[5]),h=Ze(),b=re("small"),b.textContent=`${o[4].label}`,y=Ze(),k=re("small"),F&&F.c(),E=Ze(),U&&U.c(),z(l,"class","title-link m-0 fs-5 text-decoration-none text-dark d-block svelte-dof9cm"),z(l,"href",d=o[3].lucentUrl+"/records/"+o[0].id),z(l,"title",o[5]),z(b,"class","text-muted"),z(k,"class","text-muted"),z(a,"class","overflow-hidden"),z(t,"class","card-body d-flex"),z(e,"class",M="card mb-2 bg-light "+o[1]+" svelte-dof9cm"),rs(e,"border-color",(K=o[4].color)!=null?K:"#ccc"),rs(e,"border-width","1px")},m(K,L){Me(K,e,L),j(e,t),Q&&Q.m(t,null),j(t,s),j(t,a),j(a,l),j(l,f),j(a,h),j(a,b),j(a,y),j(a,k),F&&F.m(k,null),j(e,E),U&&U.m(e,null),$=!0},p(K,[L]){K[4].type==="files"&&Q.p(K,L),(!$||L&1&&d!==(d=K[3].lucentUrl+"/records/"+K[0].id))&&z(l,"href",d),K[0].status==="draft"?F?(F.p(K,L),L&1&&xe(F,1)):(F=vce(K),F.c(),xe(F,1),F.m(k,null)):F&&(wo(),Qe(F,1,1,()=>{F=null}),_o()),K[2]?U?(U.p(K,L),L&4&&xe(U,1)):(U=Oce(K),U.c(),xe(U,1),U.m(e,null)):U&&(wo(),Qe(U,1,1,()=>{U=null}),_o()),(!$||L&2&&M!==(M="card mb-2 bg-light "+K[1]+" svelte-dof9cm"))&&z(e,"class",M)},i(K){$||(xe(Q),xe(F),xe(U),$=!0)},o(K){Qe(Q),Qe(F),Qe(U),$=!1},d(K){K&&Pe(e),Q&&Q.d(),F&&F.d(),U&&U.d()}}}function _Ce(o,e,t){const s=Hp(),a=si("channel");let{graph:l}=e,{record:f}=e,{classes:d=""}=e,{hasDelete:h=!1}=e,b=a.schemas.find(E=>E.name===f.schema),y=wd(a.schemas,f,l);function k(E){E.preventDefault(),s("remove",f.id)}return o.$$set=E=>{"graph"in E&&t(7,l=E.graph),"record"in E&&t(0,f=E.record),"classes"in E&&t(1,d=E.classes),"hasDelete"in E&&t(2,h=E.hasDelete)},[f,d,h,a,b,y,k,l]}class J6 extends vo{constructor(e){super(),bo(this,e,_Ce,wCe,po,{graph:7,record:0,classes:1,hasDelete:2})}}function XD(o,e,t,s){var d,h;if(console.log(o),console.log(e),o===e)return t;let a=(d=t==null?void 0:t.filter(b=>b.field===s))!=null?d:[],l=(h=t==null?void 0:t.filter(b=>b.field!==s))!=null?h:[],f=a.splice(o,1)[0];return a.splice(e,0,f),[...l,...a]}function yce(o,e,t){const s=o.slice();return s[23]=e[t],s}function wce(o){let e,t,s,a;function l(h){o[13](h)}function f(h){o[14](h)}let d={field:o[23],schema:o[2],record:o[0],validationErrors:o[4],isCreateMode:o[3]};return o[0].data!==void 0&&(d.data=o[0].data),o[1]!==void 0&&(d.graph=o[1]),e=new DOe({props:d}),Uo.push(()=>cr(e,"data",l)),Uo.push(()=>cr(e,"graph",f)),{c(){tn(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&4&&(y.schema=h[2]),b&1&&(y.record=h[0]),b&16&&(y.validationErrors=h[4]),b&8&&(y.isCreateMode=h[3]),!t&&b&1&&(t=!0,y.data=h[0].data,mr(()=>t=!1)),!s&&b&2&&(s=!0,y.graph=h[1],mr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Qe(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function _ce(o,e){let t,s,a,l=e[5]===e[23].group&&wce(e);return{key:o,first:null,c(){t=Bs(),l&&l.c(),s=Bs(),this.first=t},m(f,d){Me(f,t,d),l&&l.m(f,d),Me(f,s,d),a=!0},p(f,d){e=f,e[5]===e[23].group?l?(l.p(e,d),d&32&&xe(l,1)):(l=wce(e),l.c(),xe(l,1),l.m(s.parentNode,s)):l&&(wo(),Qe(l,1,1,()=>{l=null}),_o())},i(f){a||(xe(l),a=!0)},o(f){Qe(l),a=!1},d(f){f&&Pe(t),l&&l.d(f),f&&Pe(s)}}}function Sce(o){let e,t,s;function a(f){o[15](f)}let l={schema:o[2]};return o[0].status!==void 0&&(l.status=o[0].status),e=new Ipe({props:l}),Uo.push(()=>cr(e,"status",a)),{c(){tn(e.$$.fragment)},m(f,d){Kt(e,f,d),s=!0},p(f,d){const h={};d&4&&(h.schema=f[2]),!t&&d&1&&(t=!0,h.status=f[0].status,mr(()=>t=!1)),e.$set(h)},i(f){s||(xe(e.$$.fragment,f),s=!0)},o(f){Qe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function SCe(o){let e,t,s,a,l,f;return{c(){e=re("button"),t=re("span"),s=Xt(` + Save`),z(t,"class","spinner-border spinner-border-sm"),z(t,"role","status"),z(t,"aria-hidden","true"),e.disabled=a=!o[6],z(e,"class","ms-2 btn btn-primary btn-spinner")},m(d,h){Me(d,e,h),j(e,t),j(e,s),l||(f=vn(e,"click",o[11]),l=!0)},p(d,h){h&64&&a!==(a=!d[6])&&(e.disabled=a)},d(d){d&&Pe(e),l=!1,f()}}}function CCe(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=` + Add`,z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Me(a,e,l),t||(s=vn(e,"click",o[11]),t=!0)},p:pn,d(a){a&&Pe(e),t=!1,s()}}}function kCe(o){let e,t,s,a,l,f,d,h,b,y=[],k=new Map,E,M,$,Q,F,U,K,L,te;t=new X6({props:{message:o[7]}});function ne(ot){o[12](ot)}let oe={schema:o[2],isCreateMode:o[3],record:o[0]};o[5]!==void 0&&(oe.active=o[5]),l=new Lpe({props:oe}),Uo.push(()=>cr(l,"active",ne)),h=new Bpe({props:{record:o[0],schema:o[2]}});let Y=o[8];const ye=ot=>ot[23].name;for(let ot=0;otf=!1)),l.$set(V);const ht={};nt&1&&(ht.record=ot[0]),nt&4&&(ht.schema=ot[2]),h.$set(ht),nt&319&&(Y=ot[8],wo(),y=Xh(y,nt,ye,1,ot,Y,k,a,xv,_ce,null,yce),_o()),ot[2].hasDrafts?_e?(_e.p(ot,nt),nt&4&&xe(_e,1)):(_e=Sce(ot),_e.c(),xe(_e,1),_e.m($,Q)):_e&&(wo(),Qe(_e,1,1,()=>{_e=null}),_o()),ve===(ve=Le(ot))&&ue?ue.p(ot,nt):(ue.d(1),ue=ve(ot),ue&&(ue.c(),ue.m($,F)))},i(ot){if(!K){xe(t.$$.fragment,ot),xe(l.$$.fragment,ot),xe(h.$$.fragment,ot);for(let nt=0;nt_e.name!=="id"),Q="_default";d.fields.reduce((_e,Le)=>{var ve;return Le.ui==="tab"?(Q=Le.name,_e):(_e[Q]=[...(ve=_e[Q])!=null?ve:[],Le.name],_e)},[]),W1(()=>{F()});function F(){k={data:JSON.parse(JSON.stringify(h.data)),schema:h.schema,status:h.status,_sys:JSON.parse(JSON.stringify(h._sys)),_file:JSON.parse(JSON.stringify(h._file)),edges:JSON.parse(JSON.stringify(b.edges))}}wpe(()=>{t(6,M=K())});function U(_e){return M?_e.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete _e.returnValue,"...")}function K(){return y?!1:!Lc.exports.isEqual(k,{data:h.data,schema:h.schema,status:h.status,_sys:h._sys,_file:h._file,edges:b.edges})}function L(_e){_e.preventDefault(),f("cancel")}function te(_e){return _e.preventDefault(),console.log("SAVE: Attempt"),t(4,s=null),t(7,a=""),new Promise(function(Le,ve){var ue,ot;if(!M&&!y){Le(null);return}if(!h){Le(null);return}t(1,b.edges=(ot=(ue=b.edges)==null?void 0:ue.filter(nt=>!nt._isTrashed&&nt.source===h.id))!=null?ot:[],b),axios.post(l.lucentUrl+"/records",{record:h,edges:b.edges,isCreateMode:y}).then(function(nt){console.log("SAVE: SAVED INLINE"),t(0,h=nt.data.records[0]),t(1,b=nt.data),y||F(),f("inlinesaved",{records:[h]}),Le(null)}).catch(function(nt){nt.response&&(typeof nt.response.data.error=="string"?t(7,a=nt.response.data.error):t(4,s=nt.response.data.error)),Le(null)})})}function ne(_e){E=_e,t(5,E)}function oe(_e){o.$$.not_equal(h.data,_e)&&(h.data=_e,t(0,h))}function Y(_e){b=_e,t(1,b)}function ye(_e){o.$$.not_equal(h.status,_e)&&(h.status=_e,t(0,h))}return o.$$set=_e=>{"schema"in _e&&t(2,d=_e.schema),"record"in _e&&t(0,h=_e.record),"graph"in _e&&t(1,b=_e.graph),"isCreateMode"in _e&&t(3,y=_e.isCreateMode)},o.$$.update=()=>{o.$$.dirty&16&&t(7,a=s?`Record submission failed. ${Object.entries(s).length} error(s)`:null)},t(4,s=null),[h,b,d,y,s,E,M,a,$,U,L,te,ne,oe,Y,ye]}class Zpe extends vo{constructor(e){super(),bo(this,e,xCe,kCe,po,{schema:2,record:0,graph:1,isCreateMode:3})}}function Cce(o,e,t){const s=o.slice();return s[19]=e[t],s}function kce(o,e,t){const s=o.slice();return s[22]=e[t],s}function xce(o){let e,t=o[22].label+"",s;return{c(){e=re("option"),s=Xt(t),e.__value=o[22],e.value=e.__value},m(a,l){Me(a,e,l),j(e,s)},p:pn,d(a){a&&Pe(e)}}}function Tce(o){let e,t=o[19].label+"",s,a;return{c(){e=re("option"),s=Xt(t),e.__value=a=o[19],e.value=e.__value},m(l,f){Me(l,e,f),j(e,s)},p(l,f){f&2&&t!==(t=l[19].label+"")&&Wn(s,t),f&2&&a!==(a=l[19])&&(e.__value=a,e.value=e.__value)},d(l){l&&Pe(e)}}}function TCe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U,K,L,te,ne,oe,Y,ye,_e,Le,ve,ue,ot,nt;a=new ml({props:{icon:"filter"}});let mt=o[5],V=[];for(let Ct=0;CtAdvanced filters',ye=Ze(),_e=re("form"),Le=re("div"),ve=re("input"),z(f,"class","ms-1"),z(s,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),z(s,"type","button"),z(s,"data-bs-toggle","dropdown"),z(s,"data-bs-auto-close","outside"),z(s,"aria-expanded","false"),z(y,"class","form-select"),o[0]===void 0&&AC(()=>o[13].call(y)),z(b,"class","px-3 py-1 d-flex align-items-center"),z(M,"class","form-select"),o[4]===void 0&&AC(()=>o[14].call(M)),z(E,"class","px-3 py-1 d-flex align-items-center"),z(F,"type","text"),z(F,"class","form-control"),z(Q,"class","px-3 py-1 d-flex align-items-center"),z(L,"class","btn btn-outline-primary"),z(L,"type","button"),z(K,"class","px-3 py-1 d-flex align-items-center"),z(ve,"type","search"),z(ve,"class","form-control"),z(ve,"placeholder","Advanced filters"),ve.required=!0,z(Le,"class","px-3 py-1 d-flex align-items-center"),z(h,"class","dropdown-menu"),rs(h,"width","300px"),z(t,"class","btn-group"),z(e,"class","mx-2 d-flex align-items-center")},m(Ct,yt){Me(Ct,e,yt),j(e,t),j(t,s),Kt(a,s,null),j(s,l),j(s,f),j(t,d),j(t,h),j(h,b),j(b,y);for(let Re=0;Reoe.files===!1));let M=[...f.fields,...E].filter(oe=>!["file","json","tab"].includes(oe.ui)),$,Q="";function F(oe){oe.preventDefault();let Y="";f.fields.find(Le=>Le.name===$.name)&&(Y="data.");let ye=`filter[${Y+$.name}_${a.name}]`;const _e=new URL(y!=null?y:window.location.href);_e.searchParams.set("skip","0"),_e.searchParams.set(ye,Q),b?l("refresh",_e):window.location=_e}function U(oe){var ve,ue;oe.preventDefault();let Y=(ve=k.split("=")[0])!=null?ve:"";if(!Y)return;let ye=`filter[${Y}]`,_e=(ue=k.split("=")[1])!=null?ue:"";if(!_e)return;const Le=new URL(y!=null?y:window.location.href);Le.searchParams.set("skip","0"),Le.searchParams.set(ye,_e),b?l("refresh",Le):window.location=Le}function K(){$=mle(this),t(0,$),t(5,M)}function L(){a=mle(this),t(4,a),t(1,s),t(10,h),t(0,$),t(1,s),t(10,h),t(0,$)}function te(){Q=this.value,t(3,Q)}function ne(){k=this.value,t(2,k)}return o.$$set=oe=>{"schema"in oe&&t(8,f=oe.schema),"systemFields"in oe&&t(9,d=oe.systemFields),"operators"in oe&&t(10,h=oe.operators),"inModal"in oe&&t(11,b=oe.inModal),"modalUrl"in oe&&t(12,y=oe.modalUrl)},o.$$.update=()=>{o.$$.dirty&1025&&t(1,s=h.filter(oe=>oe.uis.includes($==null?void 0:$.ui)||oe.uis[0]=="*")),o.$$.dirty&2&&t(4,a=s[0])},[$,s,k,Q,a,M,F,U,f,d,h,b,y,K,L,te,ne]}class ACe extends vo{constructor(e){super(),bo(this,e,ECe,TCe,po,{schema:8,systemFields:9,operators:10,inModal:11,modalUrl:12})}}function DCe(o){let e,t,s,a,l,f,d,h;return{c(){e=re("fieldset"),t=re("label"),s=Xt(`Upload file + `),a=re("span"),a.innerHTML='Loading...',l=Ze(),f=re("input"),z(a,"class","spinner-border spinner-border-sm"),z(a,"role","status"),z(a,"aria-hidden","true"),z(f,"class","form-control"),z(f,"type","file"),z(f,"id","formFile"),f.multiple=!0,z(f,"accept",PCe),f.disabled=o[0],f.hidden=!0,z(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=o[0]},m(b,y){Me(b,e,y),j(e,t),j(t,s),j(t,a),j(t,l),j(t,f),d||(h=vn(f,"input",o[1]),d=!0)},p(b,[y]){y&1&&(f.disabled=b[0]),y&1&&(e.disabled=b[0])},i:pn,o:pn,d(b){b&&Pe(e),d=!1,h()}}}let PCe="";function MCe(o,e,t){const s=Hp(),a=si("channel");let{schema:l}=e,f=[],d=!1;function h(b){t(0,d=!0),f=b.target.files?[...b.target.files]:[];let y=new FormData;y.append("schema",l.name),Array.from(f).forEach(function(k){y.append("files[]",k)}),s("beforeUpload",f),axios.post(a.lucentUrl+"/files/upload",y,{headers:{"Content-Type":"multipart/form-data"}}).then(k=>{k.data.error?s("uploadError",k.data.error):s("uploadComplete",k.data),t(0,d=!1)}).catch(k=>{t(0,d=!1),console.log(k.response.data)})}return o.$$set=b=>{"schema"in b&&t(2,l=b.schema)},[d,h,l]}class RCe extends vo{constructor(e){super(),bo(this,e,MCe,DCe,po,{schema:2})}}function Ece(o,e,t){const s=o.slice();return s[18]=e[t],s}function Ace(o,e,t){const s=o.slice();return s[18]=e[t],s}function $Ce(o){let e,t;return e=new ml({props:{icon:"arrow-up-short-wide"}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function NCe(o){let e,t;return e=new ml({props:{icon:"arrow-down-wide-short"}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Dce(o){let e,t,s,a,l,f,d,h,b,y,k,E=o[18].label+"",M,$,Q,F,U;a=new ml({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[10](o[18],...ne)}h=new ml({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[11](o[18],...ne)}function te(...ne){return o[12](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),tn(a.$$.fragment),f=Ze(),d=re("button"),tn(h.$$.fragment),y=Ze(),k=re("button"),M=Xt(E),$=Ze(),z(s,"title","Sort Ascending"),z(s,"class",l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),z(d,"title","Sort Descending"),z(d,"class",b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),z(k,"title","Sort Ascending"),z(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(k,"overflow","hidden"),z(t,"class","btn-group w-100"),z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Me(ne,e,oe),j(e,t),j(t,s),Kt(a,s,null),j(t,f),j(t,d),Kt(h,d,null),j(t,y),j(t,k),j(k,M),j(e,$),Q=!0,F||(U=[vn(s,"click",K),vn(d,"click",L),vn(k,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&11&&l!==(l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&z(s,"class",l),(!Q||oe&11&&b!==(b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&z(d,"class",b),(!Q||oe&8)&&E!==(E=o[18].label+"")&&Wn(M,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Qe(a.$$.fragment,ne),Qe(h.$$.fragment,ne),Q=!1},d(ne){ne&&Pe(e),Jt(a),Jt(h),F=!1,$i(U)}}}function Pce(o){let e,t,s,a,l,f,d,h,b,y,k,E=o[18].label+"",M,$,Q,F,U;a=new ml({props:{icon:"arrow-up-short-wide"}});function K(...ne){return o[13](o[18],...ne)}h=new ml({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[14](o[18],...ne)}function te(...ne){return o[15](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),tn(a.$$.fragment),f=Ze(),d=re("button"),tn(h.$$.fragment),y=Ze(),k=re("button"),M=Xt(E),$=Ze(),z(s,"title","Sort Ascending"),z(s,"class",l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")),z(d,"title","Sort Descending"),z(d,"class",b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")),z(k,"title","Sort Ascending"),z(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(k,"overflow","hidden"),z(t,"class","btn-group w-100"),z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Me(ne,e,oe),j(e,t),j(t,s),Kt(a,s,null),j(t,f),j(t,d),Kt(h,d,null),j(t,y),j(t,k),j(k,M),j(e,$),Q=!0,F||(U=[vn(s,"click",K),vn(d,"click",L),vn(k,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&5&&l!==(l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&z(s,"class",l),(!Q||oe&5&&b!==(b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&z(d,"class",b),(!Q||oe&4)&&E!==(E=o[18].label+"")&&Wn(M,E)},i(ne){Q||(xe(a.$$.fragment,ne),xe(h.$$.fragment,ne),Q=!0)},o(ne){Qe(a.$$.fragment,ne),Qe(h.$$.fragment,ne),Q=!1},d(ne){ne&&Pe(e),Jt(a),Jt(h),F=!1,$i(U)}}}function ICe(o){let e,t,s,a,l,f,d,h=o[1].label+"",b,y,k,E,M,$,Q,F,U;const K=[NCe,$Ce],L=[];function te(ve,ue){return ue&1&&(s=null),s==null&&(s=!!ve[0].startsWith("-")),s?0:1}a=te(o,-1),l=L[a]=K[a](o);let ne=o[3],oe=[];for(let ve=0;veQe(oe[ve],1,1,()=>{oe[ve]=null});let ye=o[2],_e=[];for(let ve=0;veQe(_e[ve],1,1,()=>{_e[ve]=null});return{c(){e=re("div"),t=re("button"),l.c(),f=Ze(),d=re("span"),b=Xt(h),y=Ze(),k=re("div"),E=re("div");for(let ve=0;ve{L[ot]=null}),_o(),l=L[a],l||(l=L[a]=K[a](ve),l.c()),xe(l,1),l.m(t,f)),(!U||ue&2)&&h!==(h=ve[1].label+"")&&Wn(b,h),ue&59){ne=ve[3];let nt;for(nt=0;ntye.name).includes(oe.name)?"":"data.";return E(Y+oe.name)}function $(ne,oe){ne.preventDefault();let Y=k.map(ye=>ye.name).includes(oe.name)?"":"data.";return E("-"+Y+oe.name)}const Q=(ne,oe)=>M(oe,ne),F=(ne,oe)=>$(oe,ne),U=(ne,oe)=>M(oe,ne),K=(ne,oe)=>M(oe,ne),L=(ne,oe)=>$(oe,ne),te=(ne,oe)=>M(oe,ne);return o.$$set=ne=>{"schema"in ne&&t(6,f=ne.schema),"sortParam"in ne&&t(0,d=ne.sortParam),"sortField"in ne&&t(1,h=ne.sortField),"inModal"in ne&&t(7,b=ne.inModal),"modalUrl"in ne&&t(8,y=ne.modalUrl),"systemFields"in ne&&t(9,k=ne.systemFields)},o.$$.update=()=>{o.$$.dirty&64&&t(3,s=f.fields.filter(ne=>!["reference","file","json","id","rich","markdown","block"].includes(ne.info.name))),o.$$.dirty&512&&t(2,a=k),o.$$.dirty&576&&f.type==="collection"&&t(2,a=k.filter(ne=>ne.files===!1))},[d,h,a,s,M,$,f,b,y,k,Q,F,U,K,L,te]}class LCe extends vo{constructor(e){super(),bo(this,e,BCe,ICe,po,{schema:6,sortParam:0,sortField:1,inModal:7,modalUrl:8,systemFields:9})}}function FCe(o){var M,$;let e,t,s,a,l=(($=(M=o[0].find(o[9]))==null?void 0:M.symbol)!=null?$:"")+"",f,d,h,b,y,k,E;return{c(){e=re("span"),t=re("div"),s=Xt(o[4]),a=Ze(),f=Xt(l),d=Ze(),h=Xt(o[2]),b=Ze(),y=re("button"),z(y,"type","button"),z(y,"class","btn-close btn-close ms-1"),z(y,"aria-label","Close"),z(t,"class","d-flex align-items-center justify-content-center"),z(e,"class","applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1 svelte-6qi3g8"),rs(e,"line-height","22px ")},m(Q,F){Me(Q,e,F),j(e,t),j(t,s),j(t,a),j(t,f),j(t,d),j(t,h),j(t,b),j(t,y),k||(E=vn(y,"click",o[10]),k=!0)},p(Q,[F]){var U,K;F&1&&l!==(l=((K=(U=Q[0].find(Q[9]))==null?void 0:U.symbol)!=null?K:"")+"")&&Wn(f,l),F&4&&Wn(h,Q[2])},i:pn,o:pn,d(Q){Q&&Pe(e),k=!1,E()}}}function QCe(o,e,t){var K,L;const s=Hp();let{schema:a}=e,{operators:l}=e,{key:f}=e,{value:d}=e,{inModal:h}=e,{modalUrl:b}=e,y=f.split("_"),k=(K=y[y.length-1])!=null?K:"eq",E=f.replace("_"+k,""),M=a.fields.find(te=>te.name===E),$=(L=M==null?void 0:M.label)!=null?L:E;function Q(te,ne){te.preventDefault();let oe=`filter[${ne}]`;const Y=new URL(b!=null?b:window.location.href);Y.searchParams.set("skip","0"),Y.searchParams.delete(oe),h?s("refresh",Y):window.location=Y}const F=te=>te.name===k,U=te=>Q(te,f);return o.$$set=te=>{"schema"in te&&t(6,a=te.schema),"operators"in te&&t(0,l=te.operators),"key"in te&&t(1,f=te.key),"value"in te&&t(2,d=te.value),"inModal"in te&&t(7,h=te.inModal),"modalUrl"in te&&t(8,b=te.modalUrl)},[l,f,d,k,$,Q,a,h,b,F,U]}class ZCe extends vo{constructor(e){super(),bo(this,e,QCe,FCe,po,{schema:6,operators:0,key:1,value:2,inModal:7,modalUrl:8})}}function Mce(o,e,t){const s=o.slice();return s[20]=e[t][0],s[21]=e[t][1],s}function HCe(o){let e,t,s;return t=new RCe({props:{schema:o[0]}}),t.$on("uploadComplete",o[12]),{c(){e=re("div"),tn(t.$$.fragment),z(e,"class","d-inline-block ms-1")},m(a,l){Me(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&1&&(f.schema=a[0]),t.$set(f)},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),Jt(t)}}}function zCe(o){let e,t=!o[5]&&o[7]&&Rce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,a){!s[5]&&s[7]?t?t.p(s,a):(t=Rce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Pe(e)}}}function Rce(o){let e,t,s;return{c(){e=re("a"),t=Xt("New Record"),z(e,"href",s=o[9].lucentUrl+"/records/new?schema="+o[0].name),z(e,"class","btn btn-sm btn-primary")},m(a,l){Me(a,e,l),j(e,t)},p(a,l){l&1&&s!==(s=a[9].lucentUrl+"/records/new?schema="+a[0].name)&&z(e,"href",s)},d(a){a&&Pe(e)}}}function $ce(o){let e,t,s,a,l,f;s=new ml({props:{icon:"ellipsis-vertical"}});function d(y,k){return y[4].status_in==="trashed"?WCe:VCe}let h=d(o),b=h(o);return{c(){e=re("div"),t=re("button"),tn(s.$$.fragment),a=Ze(),l=re("ul"),b.c(),z(t,"class","btn btn-link btn-sm"),z(t,"type","button"),z(t,"data-bs-toggle","dropdown"),z(t,"aria-expanded","false"),z(l,"class","dropdown-menu"),z(e,"class","dropdown d-inline-block")},m(y,k){Me(y,e,k),j(e,t),Kt(s,t,null),j(e,a),j(e,l),b.m(l,null),f=!0},p(y,k){h===(h=d(y))&&b?b.p(y,k):(b.d(1),b=h(y),b&&(b.c(),b.m(l,null)))},i(y){f||(xe(s.$$.fragment,y),f=!0)},o(y){Qe(s.$$.fragment,y),f=!1},d(y){y&&Pe(e),Jt(s),b.d()}}}function VCe(o){let e,t,s,a,l,f,d,h;return{c(){e=re("li"),t=re("a"),s=Xt("Export to CSV"),a=Ze(),l=re("li"),f=re("a"),d=Xt("View trashed records"),z(t,"class","dropdown-item"),z(t,"href",o[10]),z(f,"class","dropdown-item"),z(f,"href",h=o[9].lucentUrl+"/content/"+o[0].name+"?filter[status_in]=trashed")},m(b,y){Me(b,e,y),j(e,t),j(t,s),Me(b,a,y),Me(b,l,y),j(l,f),j(f,d)},p(b,y){y&1&&h!==(h=b[9].lucentUrl+"/content/"+b[0].name+"?filter[status_in]=trashed")&&z(f,"href",h)},d(b){b&&Pe(e),b&&Pe(a),b&&Pe(l)}}}function WCe(o){let e,t=o[7]&&Nce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,a){s[7]?t?t.p(s,a):(t=Nce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&Pe(e)}}}function Nce(o){let e,t,s,a;return{c(){e=re("li"),t=re("a"),s=Xt("Empty trash"),z(t,"class","dropdown-item"),z(t,"href",a=o[9].lucentUrl+"/content/"+o[0].name+"/emptyTrash")},m(l,f){Me(l,e,f),j(e,t),j(t,s)},p(l,f){f&1&&a!==(a=l[9].lucentUrl+"/content/"+l[0].name+"/emptyTrash")&&z(t,"href",a)},d(l){l&&Pe(e)}}}function Ice(o){let e,t,s=Object.entries(o[4]),a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;f0,F,U,K,L;s=new LCe({props:{schema:o[0],sortParam:o[1],sortField:o[2],systemFields:o[8],inModal:o[5],modalUrl:o[6]}}),s.$on("refresh",o[14]);function te(ve){o[15](ve)}let ne={systemFields:o[8],operators:o[3],filter:o[4],inModal:o[5],modalUrl:o[6]};o[0]!==void 0&&(ne.schema=o[0]),l=new ACe({props:ne}),Uo.push(()=>cr(l,"schema",te)),l.$on("refresh",o[16]);const oe=[zCe,HCe],Y=[];function ye(ve,ue){return ve[0].type==="collection"?0:1}k=ye(o),E=Y[k]=oe[k](o);let _e=!o[5]&&$ce(o),Le=Q&&Ice(o);return{c(){e=re("div"),t=re("div"),tn(s.$$.fragment),a=Ze(),tn(l.$$.fragment),d=Ze(),h=re("form"),h.innerHTML='',b=Ze(),y=re("div"),E.c(),M=Ze(),_e&&_e.c(),$=Ze(),Le&&Le.c(),F=Bs(),z(h,"method","GET"),z(t,"class","d-flex align-items-center"),z(y,"class","d-flex align-items-center "),z(e,"class","mb-3 d-flex align-items-center justify-content-between")},m(ve,ue){Me(ve,e,ue),j(e,t),Kt(s,t,null),j(t,a),Kt(l,t,null),j(t,d),j(t,h),j(e,b),j(e,y),Y[k].m(y,null),j(y,M),_e&&_e.m(y,null),Me(ve,$,ue),Le&&Le.m(ve,ue),Me(ve,F,ue),U=!0,K||(L=vn(h,"submit",o[11]),K=!0)},p(ve,[ue]){const ot={};ue&1&&(ot.schema=ve[0]),ue&2&&(ot.sortParam=ve[1]),ue&4&&(ot.sortField=ve[2]),ue&256&&(ot.systemFields=ve[8]),ue&32&&(ot.inModal=ve[5]),ue&64&&(ot.modalUrl=ve[6]),s.$set(ot);const nt={};ue&256&&(nt.systemFields=ve[8]),ue&8&&(nt.operators=ve[3]),ue&16&&(nt.filter=ve[4]),ue&32&&(nt.inModal=ve[5]),ue&64&&(nt.modalUrl=ve[6]),!f&&ue&1&&(f=!0,nt.schema=ve[0],mr(()=>f=!1)),l.$set(nt);let mt=k;k=ye(ve),k===mt?Y[k].p(ve,ue):(wo(),Qe(Y[mt],1,1,()=>{Y[mt]=null}),_o(),E=Y[k],E?E.p(ve,ue):(E=Y[k]=oe[k](ve),E.c()),xe(E,1),E.m(y,M)),ve[5]?_e&&(wo(),Qe(_e,1,1,()=>{_e=null}),_o()):_e?(_e.p(ve,ue),ue&32&&xe(_e,1)):(_e=$ce(ve),_e.c(),xe(_e,1),_e.m(y,null)),ue&16&&(Q=Object.entries(ve[4]).length>0),Q?Le?(Le.p(ve,ue),ue&16&&xe(Le,1)):(Le=Ice(ve),Le.c(),xe(Le,1),Le.m(F.parentNode,F)):Le&&(wo(),Qe(Le,1,1,()=>{Le=null}),_o())},i(ve){U||(xe(s.$$.fragment,ve),xe(l.$$.fragment,ve),xe(E),xe(_e),xe(Le),U=!0)},o(ve){Qe(s.$$.fragment,ve),Qe(l.$$.fragment,ve),Qe(E),Qe(_e),Qe(Le),U=!1},d(ve){ve&&Pe(e),Jt(s),Jt(l),Y[k].d(),_e&&_e.d(),ve&&Pe($),Le&&Le.d(ve),ve&&Pe(F),K=!1,L()}}}function YCe(o,e,t){const s=si("channel"),a=Hp();let{sortParam:l}=e,{sortField:f}=e,{schema:d}=e,{operators:h}=e,{filter:b}=e,{inModal:y}=e,{modalUrl:k}=e,{isWritable:E}=e,{records:M}=e,{systemFields:$=[]}=e,Q=new URL(window.location.href),F=Q.pathname+"/csv?"+Q.searchParams.toString();function U(Y){Y.preventDefault();const ye=new FormData(Y.target);let _e=ye.keys().next().value,Le=ye.values().next().value;const ve=new URL(k!=null?k:window.location.href);ve.searchParams.set("skip","0"),ve.searchParams.set(_e,Le),y?a("refresh",ve):window.location=ve}function K(Y){t(13,M=Y.detail)}function L(Y){SH.call(this,o,Y)}function te(Y){d=Y,t(0,d)}function ne(Y){SH.call(this,o,Y)}function oe(Y){SH.call(this,o,Y)}return o.$$set=Y=>{"sortParam"in Y&&t(1,l=Y.sortParam),"sortField"in Y&&t(2,f=Y.sortField),"schema"in Y&&t(0,d=Y.schema),"operators"in Y&&t(3,h=Y.operators),"filter"in Y&&t(4,b=Y.filter),"inModal"in Y&&t(5,y=Y.inModal),"modalUrl"in Y&&t(6,k=Y.modalUrl),"isWritable"in Y&&t(7,E=Y.isWritable),"records"in Y&&t(13,M=Y.records),"systemFields"in Y&&t(8,$=Y.systemFields)},[d,l,f,h,b,y,k,E,$,s,F,U,K,M,L,te,ne,oe]}class XCe extends vo{constructor(e){super(),bo(this,e,YCe,UCe,po,{sortParam:1,sortField:2,schema:0,operators:3,filter:4,inModal:5,modalUrl:6,isWritable:7,records:13,systemFields:8})}}function Lce(o,e,t){const s=o.slice();return s[9]=e[t],s}function jCe(o){let e,t=o[9]+"",s,a,l,f;function d(...h){return o[7](o[9],...h)}return{c(){e=re("a"),s=Xt(t),z(e,"class","page-link"),z(e,"href",a=o[2](o[9]))},m(h,b){Me(h,e,b),j(e,s),l||(f=vn(e,"click",d),l=!0)},p(h,b){o=h,b&1&&t!==(t=o[9]+"")&&Wn(s,t),b&1&&a!==(a=o[2](o[9]))&&z(e,"href",a)},d(h){h&&Pe(e),l=!1,f()}}}function qCe(o){let e,t=o[9]+"",s;return{c(){e=re("span"),s=Xt(t),z(e,"class","page-link active")},m(a,l){Me(a,e,l),j(e,s)},p(a,l){l&1&&t!==(t=a[9]+"")&&Wn(s,t)},d(a){a&&Pe(e)}}}function Fce(o){let e,t;function s(f,d){return f[1]==f[9]?qCe:jCe}let a=s(o),l=a(o);return{c(){e=re("li"),l.c(),t=Ze(),z(e,"class","page-item")},m(f,d){Me(f,e,d),l.m(e,null),j(e,t)},p(f,d){a===(a=s(f))&&l?l.p(f,d):(l.d(1),l=a(f),l&&(l.c(),l.m(e,t)))},d(f){f&&Pe(e),l.d()}}}function GCe(o){let e,t=o[0],s=[];for(let a=0;ay(M,E);return o.$$set=E=>{"pages"in E&&t(0,a=E.pages),"limit"in E&&t(4,l=E.limit),"currentPage"in E&&t(1,f=E.currentPage),"inModal"in E&&t(5,d=E.inModal),"modalUrl"in E&&t(6,h=E.modalUrl)},[a,f,b,y,l,d,h,k]}class JCe extends vo{constructor(e){super(),bo(this,e,KCe,GCe,po,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function Qce(o){let e,t,s,a,l,f,d,h,b,y;return a=new JCe({props:{pages:o[7],currentPage:o[6],limit:o[2],inModal:o[0],modalUrl:o[1]}}),a.$on("refresh",o[10]),{c(){e=re("li"),t=re("a"),t.textContent="First",s=Ze(),tn(a.$$.fragment),l=Ze(),f=re("li"),d=re("a"),d.textContent="Last",z(t,"href","/"),z(t,"class","page-link"),z(e,"class","page-item disabled"),as(e,"disabled",o[6]===1),z(d,"class","page-link"),z(d,"href","/"),as(d,"disabled",o[6]===o[5]),z(f,"class","page-item")},m(k,E){Me(k,e,E),j(e,t),Me(k,s,E),Kt(a,k,E),Me(k,l,E),Me(k,f,E),j(f,d),h=!0,b||(y=[vn(t,"click",o[9]),vn(d,"click",o[8])],b=!0)},p(k,E){(!h||E&64)&&as(e,"disabled",k[6]===1);const M={};E&128&&(M.pages=k[7]),E&64&&(M.currentPage=k[6]),E&4&&(M.limit=k[2]),E&1&&(M.inModal=k[0]),E&2&&(M.modalUrl=k[1]),a.$set(M),(!h||E&96)&&as(d,"disabled",k[6]===k[5])},i(k){h||(xe(a.$$.fragment,k),h=!0)},o(k){Qe(a.$$.fragment,k),h=!1},d(k){k&&Pe(e),k&&Pe(s),Jt(a,k),k&&Pe(l),k&&Pe(f),b=!1,$i(y)}}}function eke(o){let e,t,s,a,l,f,d=+o[3]+1+"",h,b,y,k=(+o[3]+o[2]>o[4]?o[4]:+o[3]+o[2])+"",E,M,$,Q,F,U,K=o[5]>1&&Qce(o);return{c(){e=re("nav"),t=re("ul"),K&&K.c(),s=Ze(),a=re("p"),l=Xt(`Showing + `),f=re("span"),h=Xt(d),b=Xt(` + to + `),y=re("span"),E=Xt(k),M=Xt(` + of + `),$=re("span"),Q=Xt(o[4]),F=Xt(` + total`),z(t,"class","pagination justify-content-center"),z(f,"class","font-medium"),z(y,"class","font-medium"),z($,"class","font-medium"),z(a,"class","text-muted text-center")},m(L,te){Me(L,e,te),j(e,t),K&&K.m(t,null),Me(L,s,te),Me(L,a,te),j(a,l),j(a,f),j(f,h),j(a,b),j(a,y),j(y,E),j(a,M),j(a,$),j($,Q),j(a,F),U=!0},p(L,[te]){L[5]>1?K?(K.p(L,te),te&32&&xe(K,1)):(K=Qce(L),K.c(),xe(K,1),K.m(t,null)):K&&(wo(),Qe(K,1,1,()=>{K=null}),_o()),(!U||te&8)&&d!==(d=+L[3]+1+"")&&Wn(h,d),(!U||te&28)&&k!==(k=(+L[3]+L[2]>L[4]?L[4]:+L[3]+L[2])+"")&&Wn(E,k),(!U||te&16)&&Wn(Q,L[4])},i(L){U||(xe(K),U=!0)},o(L){Qe(K),U=!1},d(L){L&&Pe(e),K&&K.d(),L&&Pe(s),L&&Pe(a)}}}function tke(o,e,t){let s,a,l;const f=Hp();let{inModal:d}=e,{modalUrl:h}=e,{limit:b}=e,{skip:y}=e,{total:k}=e;function E(F){F.preventDefault(),$(s)}function M(F){F.preventDefault(),$(1)}function $(F){const U=new URL(h!=null?h:window.location.href);let K=F*b-b;U.searchParams.set("skip",K),d?f("refresh",U):window.location=U}function Q(F){SH.call(this,o,F)}return o.$$set=F=>{"inModal"in F&&t(0,d=F.inModal),"modalUrl"in F&&t(1,h=F.modalUrl),"limit"in F&&t(2,b=F.limit),"skip"in F&&t(3,y=F.skip),"total"in F&&t(4,k=F.total)},o.$$.update=()=>{o.$$.dirty&20&&t(5,s=Math.ceil(k/b)),o.$$.dirty&12&&t(6,a=Math.ceil((y-1)/b)+1),o.$$.dirty&96&&t(7,l=Lc.exports.range(a-3,a+4).filter(F=>F>0&&F<=s))},[d,h,b,y,k,s,a,l,E,M,Q]}class nke extends vo{constructor(e){super(),bo(this,e,tke,eke,po,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function oke(o){let e,t,s;return{c(){e=re("button"),e.textContent="Move to trash",z(e,"type","button"),z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Me(a,e,l),t||(s=vn(e,"click",ju(o[9])),t=!0)},p:pn,d(a){a&&Pe(e),t=!1,s()}}}function ske(o){let e,t,s,a,l,f,d=o[1].hasDrafts&&Zce(o);return{c(){e=re("button"),e.textContent="Publish",t=Ze(),d&&d.c(),s=Ze(),a=re("button"),a.textContent="Delete forever",z(e,"type","button"),z(e,"class","btn btn-sm btn-outline-primary"),z(a,"type","button"),z(a,"class","btn btn-sm btn-outline-primary")},m(h,b){Me(h,e,b),Me(h,t,b),d&&d.m(h,b),Me(h,s,b),Me(h,a,b),l||(f=[vn(e,"click",ju(o[7])),vn(a,"click",ju(o[3]))],l=!0)},p(h,b){h[1].hasDrafts?d?d.p(h,b):(d=Zce(h),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},d(h){h&&Pe(e),h&&Pe(t),d&&d.d(h),h&&Pe(s),h&&Pe(a),l=!1,$i(f)}}}function Zce(o){let e,t,s;return{c(){e=re("button"),e.textContent="Make Draft",z(e,"type","button"),z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Me(a,e,l),t||(s=vn(e,"click",ju(o[8])),t=!0)},p:pn,d(a){a&&Pe(e),t=!1,s()}}}function rke(o){let e,t,s=o[0].length+"",a,l,f,d,h,b,y,k,E,M;function $(U,K){return U[2].status_in==="trashed"?ske:oke}let Q=$(o),F=Q(o);return{c(){e=re("div"),t=re("span"),a=Xt(s),l=Xt(" records selected"),f=Ze(),d=re("div"),h=re("button"),h.textContent="Publish",b=Ze(),y=re("button"),y.textContent="Make Draft",k=Ze(),F.c(),z(t,"class","me-2"),z(h,"type","button"),z(h,"class","btn btn-sm btn-outline-primary"),z(y,"type","button"),z(y,"class","btn btn-sm btn-outline-primary"),z(d,"class","btn-group "),z(d,"role","group"),z(d,"aria-label","Basic example"),z(e,"class","d-flex align-items-center mb-3")},m(U,K){Me(U,e,K),j(e,t),j(t,a),j(t,l),j(e,f),j(e,d),j(d,h),j(d,b),j(d,y),j(d,k),F.m(d,null),E||(M=[vn(h,"click",ju(o[5])),vn(y,"click",ju(o[6]))],E=!0)},p(U,[K]){K&1&&s!==(s=U[0].length+"")&&Wn(a,s),Q===(Q=$(U))&&F?F.p(U,K):(F.d(1),F=Q(U),F&&(F.c(),F.m(d,null)))},i:pn,o:pn,d(U){U&&Pe(e),F.d(),E=!1,$i(M)}}}function ike(o,e,t){const s=si("channel");let{selected:a}=e,{schema:l}=e,{filter:f}=e;function d($){$.preventDefault(),axios.post(s.lucentUrl+"/records/delete",{ids:a.map(Q=>Q.id)}).then(Q=>{window.location.reload()}).catch(Q=>{console.log(Q)})}function h($,Q){axios.post(s.lucentUrl+"/records/status/"+Q,{schemaName:l.name,records:a}).then(F=>{window.location.reload()}).catch(F=>{console.log(F)})}const b=$=>h($,"published"),y=$=>h($,"draft"),k=$=>h($,"published"),E=$=>h($,"draft"),M=$=>h($,"trashed");return o.$$set=$=>{"selected"in $&&t(0,a=$.selected),"schema"in $&&t(1,l=$.schema),"filter"in $&&t(2,f=$.filter)},[a,l,f,d,h,b,y,k,E,M]}class ake extends vo{constructor(e){super(),bo(this,e,ike,rke,po,{selected:0,schema:1,filter:2})}}function lke(o){let e;return{c(){e=Xt(o[0])},m(t,s){Me(t,e,s)},p(t,[s]){s&1&&Wn(e,t[0])},i:pn,o:pn,d(t){t&&Pe(e)}}}function cke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class uke extends vo{constructor(e){super(),bo(this,e,cke,lke,po,{value:0})}}function Hce(o){let e,t,s,a;return{c(){e=re("div"),t=re("span"),s=Ze(),a=Xt(o[0]),z(t,"class","color border border-2 svelte-78o2k4"),rs(t,"background",o[0]),z(e,"class","d-inline-flex")},m(l,f){Me(l,e,f),j(e,t),j(e,s),j(e,a)},p(l,f){f&1&&rs(t,"background",l[0]),f&1&&Wn(a,l[0])},d(l){l&&Pe(e)}}}function fke(o){let e,t=o[0]&&Hce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=Hce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Pe(e)}}}function dke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class hke extends vo{constructor(e){super(),bo(this,e,dke,fke,po,{value:0})}}function zce(o,e,t){const s=o.slice();return s[5]=e[t],s}function Vce(o){let e,t,s,a;return t=new G6({props:{schemas:o[0],graph:o[1],record:o[5]}}),{c(){e=re("span"),tn(t.$$.fragment),s=Ze(),z(e,"class","mr-3")},m(l,f){Me(l,e,f),Kt(t,e,null),j(e,s),a=!0},p(l,f){const d={};f&1&&(d.schemas=l[0]),f&2&&(d.graph=l[1]),f&4&&(d.record=l[5]),t.$set(d)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Qe(t.$$.fragment,l),a=!1},d(l){l&&Pe(e),Jt(t)}}}function mke(o){let e,t,s=o[2],a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;f{"record"in h&&t(3,a=h.record),"field"in h&&t(4,l=h.field),"schemas"in h&&t(0,f=h.schemas),"graph"in h&&t(1,d=h.graph)},o.$$.update=()=>{var h,b;o.$$.dirty&26&&t(2,s=(b=(h=d.edges)==null?void 0:h.filter(y=>y.field===l.name&&y.source===a.id).map(y=>d.records.find(k=>k.id===y.target)).filter(y=>!!y))!=null?b:[])},[f,d,s,a,l]}class Hpe extends vo{constructor(e){super(),bo(this,e,gke,mke,po,{record:3,field:4,schemas:0,graph:1})}}function pke(o){let e;return{c(){e=Xt(o[0])},m(t,s){Me(t,e,s)},p(t,[s]){s&1&&Wn(e,t[0])},i:pn,o:pn,d(t){t&&Pe(e)}}}function bke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class vke extends vo{constructor(e){super(),bo(this,e,bke,pke,po,{value:0})}}function Oke(o){let e,t;return{c(){e=re("div"),t=Xt(o[0]),z(e,"title",o[0]),z(e,"data-bs-toggle","tooltip"),z(e,"data-bs-placement","top"),z(e,"class","svelte-1ft053t")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&z(e,"title",s[0])},i:pn,o:pn,d(s){s&&Pe(e)}}}function yke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class mne extends vo{constructor(e){super(),bo(this,e,yke,Oke,po,{value:0})}}function wke(o){let e,t;return{c(){e=re("a"),t=Xt(o[0]),z(e,"href",o[0]),z(e,"target","_blank")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&z(e,"href",s[0])},i:pn,o:pn,d(s){s&&Pe(e)}}}function _ke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Ske extends vo{constructor(e){super(),bo(this,e,_ke,wke,po,{value:0})}}function Cke(o){let e,t=Ble(o[0])+"",s,a;return{c(){e=re("div"),s=Xt(t),z(e,"title",a=Lle(o[0])),z(e,"data-bs-toggle","tooltip"),z(e,"data-bs-placement","top")},m(l,f){Me(l,e,f),j(e,s)},p(l,[f]){f&1&&t!==(t=Ble(l[0])+"")&&Wn(s,t),f&1&&a!==(a=Lle(l[0]))&&z(e,"title",a)},i:pn,o:pn,d(l){l&&Pe(e)}}}function kke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Wce extends vo{constructor(e){super(),bo(this,e,kke,Cke,po,{value:0})}}function Uce(o,e,t){const s=o.slice();return s[4]=e[t],s}function Yce(o){let e,t,s,a;return t=new Xw({props:{record:o[4],size:"tiny"}}),{c(){e=re("div"),tn(t.$$.fragment),s=Ze(),z(e,"class","me-1")},m(l,f){Me(l,e,f),Kt(t,e,null),j(e,s),a=!0},p:pn,i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Qe(t.$$.fragment,l),a=!1},d(l){l&&Pe(e),Jt(t)}}}function xke(o){let e,t,s=o[0],a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;fh.field===a.name&&h.source===s.id).map(h=>l.records.find(b=>b.id===h.target));return console.log(f),o.$$set=h=>{"record"in h&&t(1,s=h.record),"field"in h&&t(2,a=h.field),"graph"in h&&t(3,l=h.graph)},[f,s,a,l]}class zpe extends vo{constructor(e){super(),bo(this,e,Tke,xke,po,{record:1,field:2,graph:3})}}function Eke(o){let e,t;return{c(){e=re("span"),t=Xt(o[0]),z(e,"class","badge rounded-pill bg-primary bg-opacity-75"),rs(e,"max-width","64px"),rs(e,"overflow","hidden"),rs(e,"white-space","nowrap"),rs(e,"text-overflow","ellipsis"),z(e,"title",o[0]),z(e,"data-bs-toggle","tooltip")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&z(e,"title",s[0])},i:pn,o:pn,d(s){s&&Pe(e)}}}function Ake(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Dke extends vo{constructor(e){super(),bo(this,e,Ake,Eke,po,{value:0})}}function Pke(o){let e,t;return{c(){e=re("div"),t=Xt(o[0]),z(e,"class","svelte-1ft053t")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0])},i:pn,o:pn,d(s){s&&Pe(e)}}}function Mke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Rke extends vo{constructor(e){super(),bo(this,e,Mke,Pke,po,{value:0})}}function $ke(o){let e,t,s;var a=o[4][o[0].info.name];function l(f){return{props:{value:f[2].data[f[0].name],record:f[2],graph:f[3],schema:f[1],field:f[0]}}}return a&&(e=EC(a,l(o))),{c(){e&&tn(e.$$.fragment),t=Bs()},m(f,d){e&&Kt(e,f,d),Me(f,t,d),s=!0},p(f,[d]){const h={};if(d&5&&(h.value=f[2].data[f[0].name]),d&4&&(h.record=f[2]),d&8&&(h.graph=f[3]),d&2&&(h.schema=f[1]),d&1&&(h.field=f[0]),d&1&&a!==(a=f[4][f[0].info.name])){if(e){wo();const b=e;Qe(b.$$.fragment,1,0,()=>{Jt(b,1)}),_o()}a?(e=EC(a,l(f)),tn(e.$$.fragment),xe(e.$$.fragment,1),Kt(e,t.parentNode,t)):e=null}else a&&e.$set(h)},i(f){s||(e&&xe(e.$$.fragment,f),s=!0)},o(f){e&&Qe(e.$$.fragment,f),s=!1},d(f){f&&Pe(t),e&&Jt(e,f)}}}function Nke(o,e,t){const s={text:mne,slug:mne,rich:Rke,textarea:mne,color:hke,checkbox:uke,reference:Hpe,number:vke,url:Ske,date:Wce,datetime:Wce,uuid:Dke,file:zpe};let{field:a}=e,{schema:l}=e,{record:f}=e,{graph:d}=e;return o.$$set=h=>{"field"in h&&t(0,a=h.field),"schema"in h&&t(1,l=h.schema),"record"in h&&t(2,f=h.record),"graph"in h&&t(3,d=h.graph)},[a,l,f,d,s]}class Vpe extends vo{constructor(e){super(),bo(this,e,Nke,$ke,po,{field:0,schema:1,record:2,graph:3})}}function Bp(o,e){var t,s;return o&&(s=(t=o.find(a=>a.id===e))==null?void 0:t.name)!=null?s:e}function Xce(o,e,t){const s=o.slice();return s[7]=e[t],s[9]=t,s}function jce(o){let e,t,s,a;return t=new Vpe({props:{record:o[3],schema:o[0],graph:o[2],field:o[7]}}),{c(){e=re("td"),tn(t.$$.fragment),z(e,"class",s="field-ui-"+o[7].info.name),as(e,"is-sort",o[7].name===o[5].name)},m(l,f){Me(l,e,f),Kt(t,e,null),a=!0},p(l,f){const d={};f&8&&(d.record=l[3]),f&1&&(d.schema=l[0]),f&4&&(d.graph=l[2]),f&64&&(d.field=l[7]),t.$set(d),(!a||f&64&&s!==(s="field-ui-"+l[7].info.name))&&z(e,"class",s),(!a||f&96)&&as(e,"is-sort",l[7].name===l[5].name)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Qe(t.$$.fragment,l),a=!1},d(l){l&&Pe(e),Jt(t)}}}function qce(o){let e,t,s;return t=new nre({props:{status:o[3].status}}),{c(){e=re("td"),tn(t.$$.fragment),z(e,"class","text-center"),as(e,"is-sort",o[4]=="-status"||o[4]=="status")},m(a,l){Me(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&8&&(f.status=a[3].status),t.$set(f),(!s||l&16)&&as(e,"is-sort",a[4]=="-status"||a[4]=="status")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),Jt(t)}}}function Gce(o){let e,t,s;return t=new vy({props:{name:Bp(o[1],o[3]._sys.createdBy),side:24}}),{c(){e=re("td"),tn(t.$$.fragment),z(e,"class","text-center"),as(e,"is-sort",o[4]=="-_sys.createdBy"||o[4]=="_sys.createdBy")},m(a,l){Me(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&10&&(f.name=Bp(a[1],a[3]._sys.createdBy)),t.$set(f),(!s||l&16)&&as(e,"is-sort",a[4]=="-_sys.createdBy"||a[4]=="_sys.createdBy")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),Jt(t)}}}function Kce(o){let e,t,s;return t=new vy({props:{name:Bp(o[1],o[3]._sys.updatedBy),side:24}}),{c(){e=re("td"),tn(t.$$.fragment),z(e,"class","text-center"),as(e,"is-sort",o[4]=="-_sys.updatedBy"||o[4]=="_sys.updatedBy")},m(a,l){Me(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&10&&(f.name=Bp(a[1],a[3]._sys.updatedBy)),t.$set(f),(!s||l&16)&&as(e,"is-sort",a[4]=="-_sys.updatedBy"||a[4]=="_sys.updatedBy")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Pe(e),Jt(t)}}}function Jce(o){let e,t=cy(o[3]._sys.createdAt)+"",s;return{c(){e=re("td"),s=Xt(t),as(e,"is-sort",o[4]=="-_sys.createdAt"||o[4]=="_sys.createdAt")},m(a,l){Me(a,e,l),j(e,s)},p(a,l){l&8&&t!==(t=cy(a[3]._sys.createdAt)+"")&&Wn(s,t),l&16&&as(e,"is-sort",a[4]=="-_sys.createdAt"||a[4]=="_sys.createdAt")},d(a){a&&Pe(e)}}}function eue(o){let e,t=cy(o[3]._sys.updatedAt)+"",s;return{c(){e=re("td"),s=Xt(t),as(e,"is-sort",o[4]=="-_sys.updatedAt"||o[4]=="_sys.updatedAt")},m(a,l){Me(a,e,l),j(e,s)},p(a,l){l&8&&t!==(t=cy(a[3]._sys.updatedAt)+"")&&Wn(s,t),l&16&&as(e,"is-sort",a[4]=="-_sys.updatedAt"||a[4]=="_sys.updatedAt")},d(a){a&&Pe(e)}}}function Ike(o){let e,t=o[0].visible.includes("status"),s,a=o[0].visible.includes("_sys.createdBy"),l,f=o[0].visible.includes("_sys.updatedBy"),d,h=o[0].visible.includes("_sys.createdAt"),b,y=o[0].visible.includes("_sys.updatedAt"),k,E,M=o[6],$=[];for(let ne=0;neQe($[ne],1,1,()=>{$[ne]=null});let F=t&&qce(o),U=a&&Gce(o),K=f&&Kce(o),L=h&&Jce(o),te=y&&eue(o);return{c(){for(let ne=0;ne<$.length;ne+=1)$[ne].c();e=Ze(),F&&F.c(),s=Ze(),U&&U.c(),l=Ze(),K&&K.c(),d=Ze(),L&&L.c(),b=Ze(),te&&te.c(),k=Bs()},m(ne,oe){for(let Y=0;Y<$.length;Y+=1)$[Y]&&$[Y].m(ne,oe);Me(ne,e,oe),F&&F.m(ne,oe),Me(ne,s,oe),U&&U.m(ne,oe),Me(ne,l,oe),K&&K.m(ne,oe),Me(ne,d,oe),L&&L.m(ne,oe),Me(ne,b,oe),te&&te.m(ne,oe),Me(ne,k,oe),E=!0},p(ne,[oe]){if(oe&109){M=ne[6];let Y;for(Y=0;Y{F=null}),_o()),oe&1&&(a=ne[0].visible.includes("_sys.createdBy")),a?U?(U.p(ne,oe),oe&1&&xe(U,1)):(U=Gce(ne),U.c(),xe(U,1),U.m(l.parentNode,l)):U&&(wo(),Qe(U,1,1,()=>{U=null}),_o()),oe&1&&(f=ne[0].visible.includes("_sys.updatedBy")),f?K?(K.p(ne,oe),oe&1&&xe(K,1)):(K=Kce(ne),K.c(),xe(K,1),K.m(d.parentNode,d)):K&&(wo(),Qe(K,1,1,()=>{K=null}),_o()),oe&1&&(h=ne[0].visible.includes("_sys.createdAt")),h?L?L.p(ne,oe):(L=Jce(ne),L.c(),L.m(b.parentNode,b)):L&&(L.d(1),L=null),oe&1&&(y=ne[0].visible.includes("_sys.updatedAt")),y?te?te.p(ne,oe):(te=eue(ne),te.c(),te.m(k.parentNode,k)):te&&(te.d(1),te=null)},i(ne){if(!E){for(let oe=0;oe{"schema"in y&&t(0,s=y.schema),"users"in y&&t(1,a=y.users),"graph"in y&&t(2,l=y.graph),"record"in y&&t(3,f=y.record),"sortParam"in y&&t(4,d=y.sortParam),"sortField"in y&&t(5,h=y.sortField),"visibleColumns"in y&&t(6,b=y.visibleColumns)},[s,a,l,f,d,h,b]}class Lke extends vo{constructor(e){super(),bo(this,e,Bke,Ike,po,{schema:0,users:1,graph:2,record:3,sortParam:4,sortField:5,visibleColumns:6})}}function tue(o,e,t){const s=o.slice();return s[17]=e[t],s}function nue(o,e,t){const s=o.slice();return s[20]=e[t],s}function oue(o,e,t){const s=o.slice();return s[23]=e[t],s}function sue(o){let e,t,s,a,l,f;return{c(){e=re("th"),t=re("input"),t.indeterminate=s=o[0].length>0&&o[0].length0&&d[0].lengthL[17].id;for(let L=0;L0}function F(te,ne){$.find(Y=>Y.id==ne.id)?t(0,$=$.filter(Y=>Y.id!==ne.id)):t(0,$=[...$,ne])}const U=te=>l.visible.includes(te.name),K=(te,ne)=>ne.id===te.id,L=(te,ne)=>F(ne,te);return o.$$set=te=>{"schema"in te&&t(1,l=te.schema),"users"in te&&t(2,f=te.users),"records"in te&&t(3,d=te.records),"graph"in te&&t(4,h=te.graph),"systemFields"in te&&t(5,b=te.systemFields),"sortParam"in te&&t(6,y=te.sortParam),"sortField"in te&&t(7,k=te.sortField),"inModal"in te&&t(8,E=te.inModal),"isWritable"in te&&t(9,M=te.isWritable),"selected"in te&&t(0,$=te.selected)},o.$$.update=()=>{o.$$.dirty&2&&t(10,s=l.fields.filter(te=>l.visible.includes(te.name)))},[$,l,f,d,h,b,y,k,E,M,s,a,Q,F,U,K,L]}class Zke extends vo{constructor(e){super(),bo(this,e,Qke,Fke,po,{schema:1,users:2,records:3,graph:4,systemFields:5,sortParam:6,sortField:7,inModal:8,isWritable:9,selected:0})}}function cue(o,e,t){const s=o.slice();return s[24]=e[t],s}function Hke(o){let e,t,s,a;function l(h){o[19](h)}function f(h){o[20](h)}let d={systemFields:o[13],sortParam:o[2],sortField:o[3],operators:o[4],filter:o[5],inModal:o[14],modalUrl:o[9],isWritable:o[15]};return o[0]!==void 0&&(d.schema=o[0]),o[1]!==void 0&&(d.records=o[1]),e=new XCe({props:d}),Uo.push(()=>cr(e,"schema",l)),Uo.push(()=>cr(e,"records",f)),e.$on("refresh",o[18]),{c(){tn(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&8192&&(y.systemFields=h[13]),b&4&&(y.sortParam=h[2]),b&8&&(y.sortField=h[3]),b&16&&(y.operators=h[4]),b&32&&(y.filter=h[5]),b&16384&&(y.inModal=h[14]),b&512&&(y.modalUrl=h[9]),b&32768&&(y.isWritable=h[15]),!t&&b&1&&(t=!0,y.schema=h[0],mr(()=>t=!1)),!s&&b&2&&(s=!0,y.records=h[1],mr(()=>s=!1)),e.$set(y)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Qe(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function zke(o){let e,t;return e=new ake({props:{schema:o[0],selected:o[10],inModal:o[14],filter:o[5]}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.schema=s[0]),a&1024&&(l.selected=s[10]),a&16384&&(l.inModal=s[14]),a&32&&(l.filter=s[5]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Vke(o){let e,t=[],s=new Map,a,l=o[1];const f=d=>d[24].id;for(let d=0;dcr(e,"selected",a)),{c(){tn(e.$$.fragment)},m(f,d){Kt(e,f,d),s=!0},p(f,d){const h={};d&2&&(h.records=f[1]),d&4096&&(h.graph=f[12]),d&1&&(h.schema=f[0]),d&4&&(h.sortParam=f[2]),d&8&&(h.sortField=f[3]),d&8192&&(h.systemFields=f[13]),d&16384&&(h.inModal=f[14]),d&2048&&(h.users=f[11]),d&32768&&(h.isWritable=f[15]),!t&&d&1024&&(t=!0,h.selected=f[10],mr(()=>t=!1)),e.$set(h)},i(f){s||(xe(e.$$.fragment,f),s=!0)},o(f){Qe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function uue(o){let e,t,s,a,l,f;function d(...b){return o[22](o[24],...b)}function h(...b){return o[23](o[24],...b)}return{c(){e=re("div"),t=re("input"),z(t,"class","form-check-input "),z(t,"type","checkbox"),t.checked=s=o[10].find(d),t.value=a=o[24],z(e,"class","form-check svelte-1xyvs2b")},m(b,y){Me(b,e,y),j(e,t),l||(f=vn(t,"change",h),l=!0)},p(b,y){o=b,y&1026&&s!==(s=o[10].find(d))&&(t.checked=s),y&2&&a!==(a=o[24])&&(t.value=a)},d(b){b&&Pe(e),l=!1,f()}}}function fue(o,e){let t,s,a,l,f,d,h,b=e[24]._file.path+"",y,k,E,M,$,Q=e[24]._file.mime+"",F,U,K,L=e[15]&&uue(e);return f=new Xw({props:{record:e[24],size:"medium"}}),{key:o,first:null,c(){t=re("div"),s=re("div"),L&&L.c(),a=Ze(),l=re("div"),tn(f.$$.fragment),d=Ze(),h=re("a"),y=Xt(b),M=Ze(),$=re("span"),F=Xt(Q),U=Ze(),z(l,"class","d-flex justify-content-center"),z(h,"href",k=e[16].lucentUrl+"/records/"+e[24].id),z(h,"title",E=e[24]._file.path),z(h,"class","d-block text-center overflow-hidden text-nowrap my-2 "),rs(h,"text-overflow","ellipsis"),rs(h,"font-size","13px"),rs(h,"color","#333"),z($,"class","lx-small-text text-muted d-block text-center"),z(s,"class","file-wrapper rounded p-2 mb-4 bg-light"),as(s,"selected",e[10].includes(e[24])),z(t,"class","col-6 col-md-4"),this.first=t},m(te,ne){Me(te,t,ne),j(t,s),L&&L.m(s,null),j(s,a),j(s,l),Kt(f,l,null),j(s,d),j(s,h),j(h,y),j(s,M),j(s,$),j($,F),j(t,U),K=!0},p(te,ne){e=te,e[15]?L?L.p(e,ne):(L=uue(e),L.c(),L.m(s,a)):L&&(L.d(1),L=null);const oe={};ne&2&&(oe.record=e[24]),f.$set(oe),(!K||ne&2)&&b!==(b=e[24]._file.path+"")&&Wn(y,b),(!K||ne&2&&k!==(k=e[16].lucentUrl+"/records/"+e[24].id))&&z(h,"href",k),(!K||ne&2&&E!==(E=e[24]._file.path))&&z(h,"title",E),(!K||ne&2)&&Q!==(Q=e[24]._file.mime+"")&&Wn(F,Q),(!K||ne&1026)&&as(s,"selected",e[10].includes(e[24]))},i(te){K||(xe(f.$$.fragment,te),K=!0)},o(te){Qe(f.$$.fragment,te),K=!1},d(te){te&&Pe(t),L&&L.d(),Jt(f)}}}function Uke(o){let e,t,s,a=o[0].label+"",l,f,d,h,b,y,k,E,M,$,Q;const F=[zke,Hke],U=[];function K(oe,Y){return oe[10].length>0&&!oe[14]&&oe[15]?0:1}d=K(o),h=U[d]=F[d](o);const L=[Wke,Vke],te=[];function ne(oe,Y){return oe[0].type==="collection"?0:1}return y=ne(o),k=te[y]=L[y](o),$=new nke({props:{limit:o[6],skip:o[7],total:o[8],inModal:o[14],modalUrl:o[9]}}),$.$on("refresh",o[18]),{c(){e=re("div"),t=re("div"),s=re("h3"),l=Xt(a),f=Ze(),h.c(),b=Ze(),k.c(),M=Ze(),tn($.$$.fragment),z(s,"class","header-normal mb-5 "),z(t,"class",E="lx-card mb-4 "+(o[14]?"mt-0":"mt-5")),z(e,"class","wrapper-large transparent ")},m(oe,Y){Me(oe,e,Y),j(e,t),j(t,s),j(s,l),j(t,f),U[d].m(t,null),j(t,b),te[y].m(t,null),j(e,M),Kt($,e,null),Q=!0},p(oe,[Y]){(!Q||Y&1)&&a!==(a=oe[0].label+"")&&Wn(l,a);let ye=d;d=K(oe),d===ye?U[d].p(oe,Y):(wo(),Qe(U[ye],1,1,()=>{U[ye]=null}),_o(),h=U[d],h?h.p(oe,Y):(h=U[d]=F[d](oe),h.c()),xe(h,1),h.m(t,b));let _e=y;y=ne(oe),y===_e?te[y].p(oe,Y):(wo(),Qe(te[_e],1,1,()=>{te[_e]=null}),_o(),k=te[y],k?k.p(oe,Y):(k=te[y]=L[y](oe),k.c()),xe(k,1),k.m(t,null)),(!Q||Y&16384&&E!==(E="lx-card mb-4 "+(oe[14]?"mt-0":"mt-5")))&&z(t,"class",E);const Le={};Y&64&&(Le.limit=oe[6]),Y&128&&(Le.skip=oe[7]),Y&256&&(Le.total=oe[8]),Y&16384&&(Le.inModal=oe[14]),Y&512&&(Le.modalUrl=oe[9]),$.$set(Le)},i(oe){Q||(xe(h),xe(k),xe($.$$.fragment,oe),Q=!0)},o(oe){Qe(h),Qe(k),Qe($.$$.fragment,oe),Q=!1},d(oe){oe&&Pe(e),U[d].d(),te[y].d(),Jt($)}}}function Yke(o,e,t){const s=si("channel");let{schema:a}=e,{users:l}=e,{records:f}=e,{graph:d}=e,{systemFields:h}=e,{sortParam:b}=e,{sortField:y}=e,{operators:k}=e,{filter:E}=e,{limit:M}=e,{skip:$}=e,{total:Q}=e,{inModal:F}=e,{modalUrl:U}=e,{selected:K=[]}=e,{isWritable:L=!1}=e;function te(ve,ue){K.find(nt=>nt.id===ue.id)?t(10,K=K.filter(nt=>nt.id!==ue.id)):t(10,K=[...K,ue])}function ne(ve){const ue=ve.detail;axios.get(ue).then(ot=>{t(1,f=ot.data.records),t(2,b=ot.data.sortParam),t(3,y=ot.data.sortField),t(4,k=ot.data.operators),t(5,E=ot.data.filter),t(7,$=ot.data.skip),t(6,M=ot.data.limit),t(8,Q=ot.data.total),t(9,U=ot.data.modalUrl)}).catch(ot=>{console.log(ot)})}function oe(ve){a=ve,t(0,a)}function Y(ve){f=ve,t(1,f)}function ye(ve){K=ve,t(10,K)}const _e=(ve,ue)=>ue.id===ve.id,Le=(ve,ue)=>te(ue,ve);return o.$$set=ve=>{"schema"in ve&&t(0,a=ve.schema),"users"in ve&&t(11,l=ve.users),"records"in ve&&t(1,f=ve.records),"graph"in ve&&t(12,d=ve.graph),"systemFields"in ve&&t(13,h=ve.systemFields),"sortParam"in ve&&t(2,b=ve.sortParam),"sortField"in ve&&t(3,y=ve.sortField),"operators"in ve&&t(4,k=ve.operators),"filter"in ve&&t(5,E=ve.filter),"limit"in ve&&t(6,M=ve.limit),"skip"in ve&&t(7,$=ve.skip),"total"in ve&&t(8,Q=ve.total),"inModal"in ve&&t(14,F=ve.inModal),"modalUrl"in ve&&t(9,U=ve.modalUrl),"selected"in ve&&t(10,K=ve.selected),"isWritable"in ve&&t(15,L=ve.isWritable)},[a,f,b,y,k,E,M,$,Q,U,K,l,d,h,F,L,s,te,ne,oe,Y,ye,_e,Le]}class Wpe extends vo{constructor(e){super(),bo(this,e,Yke,Uke,po,{schema:0,users:11,records:1,graph:12,systemFields:13,sortParam:2,sortField:3,operators:4,filter:5,limit:6,skip:7,total:8,inModal:14,modalUrl:9,selected:10,isWritable:15})}}function due(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U,K,L,te,ne,oe,Y=o[1].length>0&&hue(o);const ye=[o[2]];function _e(ve){o[8](ve)}let Le={};for(let ve=0;vecr(K,"selected",_e)),{c(){e=re("div"),t=re("div"),s=re("div"),a=re("div"),l=re("div"),f=re("button"),d=Xt("Insert"),b=Ze(),y=re("button"),k=Xt("Replace"),M=Ze(),Y&&Y.c(),$=Ze(),Q=re("button"),F=Ze(),U=re("div"),tn(K.$$.fragment),z(f,"type","button"),z(f,"class","btn btn-primary me-1"),f.disabled=h=o[1].length===0,z(y,"type","button"),z(y,"class","btn btn-outline-primary me-3"),y.disabled=E=o[1].length===0,z(l,"class","d-flex align-items-center"),z(Q,"type","button"),z(Q,"class","btn-close"),z(Q,"data-bs-dismiss","modal"),z(Q,"aria-label","Close"),z(a,"class","modal-header"),z(U,"class","modal-body"),z(s,"class","modal-content svelte-1mf5922"),z(t,"class","modal-dialog modal-dialog-centered modal-dialog-scrollable svelte-1mf5922"),z(e,"class","modal fade show"),z(e,"tabindex","-1"),z(e,"aria-modal","true"),z(e,"role","dialog"),rs(e,"background","rgba(100,100,100,.6)"),as(e,"d-block",o[0])},m(ve,ue){Me(ve,e,ue),j(e,t),j(t,s),j(s,a),j(a,l),j(l,f),j(f,d),j(l,b),j(l,y),j(y,k),j(l,M),Y&&Y.m(l,null),j(a,$),j(a,Q),j(s,F),j(s,U),Kt(K,U,null),te=!0,ne||(oe=[vn(f,"click",o[3]),vn(y,"click",o[4]),vn(Q,"click",ju(o[7]))],ne=!0)},p(ve,ue){(!te||ue&2&&h!==(h=ve[1].length===0))&&(f.disabled=h),(!te||ue&2&&E!==(E=ve[1].length===0))&&(y.disabled=E),ve[1].length>0?Y?Y.p(ve,ue):(Y=hue(ve),Y.c(),Y.m(l,null)):Y&&(Y.d(1),Y=null);const ot=ue&4?Yz(ye,[Xz(ve[2])]):{};!L&&ue&2&&(L=!0,ot.selected=ve[1],mr(()=>L=!1)),K.$set(ot),(!te||ue&1)&&as(e,"d-block",ve[0])},i(ve){te||(xe(K.$$.fragment,ve),te=!0)},o(ve){Qe(K.$$.fragment,ve),te=!1},d(ve){ve&&Pe(e),Y&&Y.d(),Jt(K),ne=!1,$i(oe)}}}function hue(o){let e,t=o[1].length+"",s,a;return{c(){e=re("span"),s=Xt(t),a=Xt(" records selected"),z(e,"class","")},m(l,f){Me(l,e,f),j(e,s),j(e,a)},p(l,f){f&2&&t!==(t=l[1].length+"")&&Wn(s,t)},d(l){l&&Pe(e)}}}function Xke(o){let e,t,s=o[2].schema&&due(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[2].schema?s?(s.p(a,l),l&4&&xe(s,1)):(s=due(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Pe(e)}}}function jke(o,e,t){let s;const a=Hp(),l=si("channel");let f=!1,d=[];function h(Q){t(0,f=!0),y(Q)}function b(){t(0,f=!1),t(1,d=[])}function y(Q){axios.get(l.lucentUrl+"/content/"+Q).then(F=>{t(2,s=F.data)}).catch(F=>console.log(F))}function k(Q){Q.preventDefault(),a("insert",{records:d,action:"insert"})}function E(Q){Q.preventDefault(),a("insert",{records:d,action:"replace"})}const M=Q=>t(0,f=!1);function $(Q){d=Q,t(1,d)}return t(2,s={}),[f,d,s,k,E,h,b,M,$]}class ore extends vo{constructor(e){super(),bo(this,e,jke,Xke,po,{open:5,close:6})}get open(){return this.$$.ctx[5]}get close(){return this.$$.ctx[6]}}function mue(o,e,t){const s=o.slice();return s[18]=e[t],s}function qke(o){let e,t,s,a,l,f,d,h,b;return f=new ml({props:{icon:"magnifying-glass"}}),{c(){e=re("div"),t=re("div"),s=re("button"),s.textContent="New",a=Ze(),l=re("button"),tn(f.$$.fragment),z(s,"class","btn btn-sm btn-primary"),z(l,"class","btn btn-sm btn-outline-primary"),z(t,"class","mb-2"),z(e,"class","pb-2 text-start")},m(y,k){Me(y,e,k),j(e,t),j(t,s),j(t,a),j(t,l),Kt(f,l,null),d=!0,h||(b=[vn(s,"click",o[12]),vn(l,"click",o[13])],h=!0)},p:pn,i(y){d||(xe(f.$$.fragment,y),d=!0)},o(y){Qe(f.$$.fragment,y),d=!1},d(y){y&&Pe(e),Jt(f),h=!1,$i(b)}}}function Gke(o){let e,t,s,a,l,f,d;t=new ml({props:{width:24,height:24,icon:"circle-plus"}});let h=o[4]&&gue(o);return{c(){e=re("button"),tn(t.$$.fragment),s=Ze(),h&&h.c(),a=Bs(),z(e,"type","button"),z(e,"class","btn btn-lg btn-link text-decoration-none inline-card-button svelte-1lp73xk"),as(e,"is-first",!o[1])},m(b,y){Me(b,e,y),Kt(t,e,null),Me(b,s,y),h&&h.m(b,y),Me(b,a,y),l=!0,f||(d=vn(e,"click",ju(o[9])),f=!0)},p(b,y){(!l||y&2)&&as(e,"is-first",!b[1]),b[4]?h?(h.p(b,y),y&16&&xe(h,1)):(h=gue(b),h.c(),xe(h,1),h.m(a.parentNode,a)):h&&(wo(),Qe(h,1,1,()=>{h=null}),_o())},i(b){l||(xe(t.$$.fragment,b),xe(h),l=!0)},o(b){Qe(t.$$.fragment,b),Qe(h),l=!1},d(b){b&&Pe(e),Jt(t),b&&Pe(s),h&&h.d(b),b&&Pe(a),f=!1,d()}}}function gue(o){let e,t,s=o[0],a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;f1?0:1}e=b(o),t=h[e]=d[e](o);let y=o[3]&&bue(o),k={};return l=new ore({props:k}),o[15](l),l.$on("insert",o[7]),{c(){t.c(),s=Ze(),y&&y.c(),a=Ze(),tn(l.$$.fragment)},m(E,M){h[e].m(E,M),Me(E,s,M),y&&y.m(E,M),Me(E,a,M),Kt(l,E,M),f=!0},p(E,[M]){let $=e;e=b(E),e===$?h[e].p(E,M):(wo(),Qe(h[$],1,1,()=>{h[$]=null}),_o(),t=h[e],t?t.p(E,M):(t=h[e]=d[e](E),t.c()),xe(t,1),t.m(s.parentNode,s)),E[3]?y?(y.p(E,M),M&8&&xe(y,1)):(y=bue(E),y.c(),xe(y,1),y.m(a.parentNode,a)):y&&(wo(),Qe(y,1,1,()=>{y=null}),_o());const Q={};l.$set(Q)},i(E){f||(xe(t),xe(y),xe(l.$$.fragment,E),f=!0)},o(E){Qe(t),Qe(y),Qe(l.$$.fragment,E),f=!1},d(E){h[e].d(E),E&&Pe(s),y&&y.d(E),E&&Pe(a),o[15](null),Jt(l,E)}}}function Jke(o,e,t){let s;const a=Hp(),l=si("channel");let{schemas:f}=e,{recordId:d}=e,h,b;function y(ne,oe){ne.preventDefault(),h.open(oe)}function k(ne){ne.preventDefault(),console.log("Save inline"),t(3,b=null),a("save",{records:ne.detail.records,after:d})}function E(ne){ne.preventDefault(),h.close(),t(4,s=!1),a("insert",{records:ne.detail.records,after:d})}function M(ne,oe){ne.preventDefault(),axios.get(l.lucentUrl+"/records/newInline?schema="+oe).then(Y=>{t(3,b=Y.data),t(4,s=!1)}).catch(Y=>{console.log(Y)})}const $=ne=>t(4,s=!s),Q=(ne,oe)=>M(oe,ne.name),F=(ne,oe)=>y(oe,ne.name),U=ne=>M(ne,f[0].name),K=ne=>y(ne,f[0].name),L=ne=>t(3,b=null);function te(ne){Uo[ne?"unshift":"push"](()=>{h=ne,t(2,h)})}return o.$$set=ne=>{"schemas"in ne&&t(0,f=ne.schemas),"recordId"in ne&&t(1,d=ne.recordId)},t(4,s=!1),[f,d,h,b,s,y,k,E,M,$,Q,F,U,K,L,te]}class eI extends vo{constructor(e){super(),bo(this,e,Jke,Kke,po,{schemas:0,recordId:1})}}/**! + * Sortable 1.15.0 + * @author RubaXa + * @author owenm + * @license MIT + */function vue(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,s)}return t}function Oy(o){for(var e=1;e=0)&&(t[a]=o[a]);return t}function nxe(o,e){if(o==null)return{};var t=txe(o,e),s,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(a=0;a=0)&&(!Object.prototype.propertyIsEnumerable.call(o,s)||(t[s]=o[s]))}return t}var oxe="1.15.0";function Fw(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var jw=Fw(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tI=Fw(/Edge/i),Oue=Fw(/firefox/i),r6=Fw(/safari/i)&&!Fw(/chrome/i)&&!Fw(/android/i),Upe=Fw(/iP(ad|od|hone)/i),Ype=Fw(/chrome/i)&&Fw(/android/i),Xpe={capture:!1,passive:!1};function dl(o,e,t){o.addEventListener(e,t,!jw&&Xpe)}function La(o,e,t){o.removeEventListener(e,t,!jw&&Xpe)}function tz(o,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function sxe(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function iy(o,e,t,s){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&tz(o,e):tz(o,e))||s&&o===t)return o;if(o===t)break}while(o=sxe(o))}return null}var yue=/\s+/g;function $1(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var s=(" "+o.className+" ").replace(yue," ").replace(" "+e+" "," ");o.className=(s+(t?" "+e:"")).replace(yue," ")}}function Vr(o,e,t){var s=o&&o.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(t=o.currentStyle),e===void 0?t:t[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=t+(typeof t=="string"?"":"px")}}function vD(o,e){var t="";if(typeof o=="string")t=o;else do{var s=Vr(o,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(o=o.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function jpe(o,e,t){if(o){var s=o.getElementsByTagName(e),a=0,l=s.length;if(t)for(;a=l:f=a<=l,!f)return s;if(s===hy())break;s=_C(s,!1)}return!1}function DD(o,e,t,s){for(var a=0,l=0,f=o.children;l2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,l=nxe(s,dxe);nI.pluginEvent.bind(Wr)(e,t,Oy({dragEl:Vo,parentEl:Xu,ghostEl:Ei,rootEl:eu,nextEl:tE,lastDownEl:TH,cloneEl:Su,cloneHidden:yC,dragStarted:XN,putSortable:zh,activeSortable:Wr.active,originalEvent:a,oldIndex:dD,oldDraggableIndex:a6,newIndex:I1,newDraggableIndex:bC,hideGhostForTarget:n1e,unhideGhostForTarget:o1e,cloneNowHidden:function(){yC=!0},cloneNowShown:function(){yC=!1},dispatchSortableEvent:function(d){Rg({sortable:t,name:d,originalEvent:a})}},l))};function Rg(o){fxe(Oy({putSortable:zh,cloneEl:Su,targetEl:Vo,rootEl:eu,oldIndex:dD,oldDraggableIndex:a6,newIndex:I1,newDraggableIndex:bC},o))}var Vo,Xu,Ei,eu,tE,TH,Su,yC,dD,I1,a6,bC,IZ,zh,iD=!1,nz=!1,oz=[],qT,wv,bne,vne,Sue,Cue,XN,tD,l6,c6=!1,BZ=!1,EH,Rm,One=[],Roe=!1,sz=[],Gz=typeof document<"u",LZ=Upe,kue=tI||jw?"cssFloat":"float",hxe=Gz&&!Ype&&!Upe&&"draggable"in document.createElement("div"),Jpe=function(){if(!!Gz){if(jw)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),e1e=function(e,t){var s=Vr(e),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),l=DD(e,0,t),f=DD(e,1,t),d=l&&Vr(l),h=f&&Vr(f),b=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+Od(l).width,y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+Od(f).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&d.float&&d.float!=="none"){var k=d.float==="left"?"left":"right";return f&&(h.clear==="both"||h.clear===k)?"vertical":"horizontal"}return l&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||b>=a&&s[kue]==="none"||f&&s[kue]==="none"&&b+y>a)?"vertical":"horizontal"},mxe=function(e,t,s){var a=s?e.left:e.top,l=s?e.right:e.bottom,f=s?e.width:e.height,d=s?t.left:t.top,h=s?t.right:t.bottom,b=s?t.width:t.height;return a===d||l===h||a+f/2===d+b/2},gxe=function(e,t){var s;return oz.some(function(a){var l=a[F1].options.emptyInsertThreshold;if(!(!l||sre(a))){var f=Od(a),d=e>=f.left-l&&e<=f.right+l,h=t>=f.top-l&&t<=f.bottom+l;if(d&&h)return s=a}}),s},t1e=function(e){function t(l,f){return function(d,h,b,y){var k=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(l==null&&(f||k))return!0;if(l==null||l===!1)return!1;if(f&&l==="clone")return l;if(typeof l=="function")return t(l(d,h,b,y),f)(d,h,b,y);var E=(f?d:h).options.group.name;return l===!0||typeof l=="string"&&l===E||l.join&&l.indexOf(E)>-1}}var s={},a=e.group;(!a||xH(a)!="object")&&(a={name:a}),s.name=a.name,s.checkPull=t(a.pull,!0),s.checkPut=t(a.put),s.revertClone=a.revertClone,e.group=s},n1e=function(){!Jpe&&Ei&&Vr(Ei,"display","none")},o1e=function(){!Jpe&&Ei&&Vr(Ei,"display","")};Gz&&!Ype&&document.addEventListener("click",function(o){if(nz)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),nz=!1,!1},!0);var GT=function(e){if(Vo){e=e.touches?e.touches[0]:e;var t=gxe(e.clientX,e.clientY);if(t){var s={};for(var a in e)e.hasOwnProperty(a)&&(s[a]=e[a]);s.target=s.rootEl=t,s.preventDefault=void 0,s.stopPropagation=void 0,t[F1]._onDragOver(s)}}},pxe=function(e){Vo&&Vo.parentNode[F1]._isOutsideThisEl(e.target)};function Wr(o,e){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=e=zw({},e),o[F1]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return e1e(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(f,d){f.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Wr.supportPointer!==!1&&"PointerEvent"in window&&!r6,emptyInsertThreshold:5};nI.initializePlugins(this,o,t);for(var s in t)!(s in e)&&(e[s]=t[s]);t1e(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:hxe,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?dl(o,"pointerdown",this._onTapStart):(dl(o,"mousedown",this._onTapStart),dl(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(dl(o,"dragover",this),dl(o,"dragenter",this)),oz.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),zw(this,lxe())}Wr.prototype={constructor:Wr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(tD=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,Vo):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,s=this.el,a=this.options,l=a.preventOnFilter,f=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,b=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,y=a.filter;if(Cxe(s),!Vo&&!(/mousedown|pointerdown/.test(f)&&e.button!==0||a.disabled)&&!b.isContentEditable&&!(!this.nativeDraggable&&r6&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=iy(h,a.draggable,s,!1),!(h&&h.animated)&&TH!==h)){if(dD=Lb(h),a6=Lb(h,a.draggable),typeof y=="function"){if(y.call(this,e,h,this)){Rg({sortable:t,rootEl:b,name:"filter",targetEl:h,toEl:s,fromEl:s}),Mp("filter",t,{evt:e}),l&&e.cancelable&&e.preventDefault();return}}else if(y&&(y=y.split(",").some(function(k){if(k=iy(b,k.trim(),s,!1),k)return Rg({sortable:t,rootEl:k,name:"filter",targetEl:h,fromEl:s,toEl:s}),Mp("filter",t,{evt:e}),!0}),y)){l&&e.cancelable&&e.preventDefault();return}a.handle&&!iy(b,a.handle,s,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,s){var a=this,l=a.el,f=a.options,d=l.ownerDocument,h;if(s&&!Vo&&s.parentNode===l){var b=Od(s);if(eu=l,Vo=s,Xu=Vo.parentNode,tE=Vo.nextSibling,TH=s,IZ=f.group,Wr.dragged=Vo,qT={target:Vo,clientX:(t||e).clientX,clientY:(t||e).clientY},Sue=qT.clientX-b.left,Cue=qT.clientY-b.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Vo.style["will-change"]="all",h=function(){if(Mp("delayEnded",a,{evt:e}),Wr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!Oue&&a.nativeDraggable&&(Vo.draggable=!0),a._triggerDragStart(e,t),Rg({sortable:a,name:"choose",originalEvent:e}),$1(Vo,f.chosenClass,!0)},f.ignore.split(",").forEach(function(y){jpe(Vo,y.trim(),yne)}),dl(d,"dragover",GT),dl(d,"mousemove",GT),dl(d,"touchmove",GT),dl(d,"mouseup",a._onDrop),dl(d,"touchend",a._onDrop),dl(d,"touchcancel",a._onDrop),Oue&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Vo.draggable=!0),Mp("delayStart",this,{evt:e}),f.delay&&(!f.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(tI||jw))){if(Wr.eventCanceled){this._onDrop();return}dl(d,"mouseup",a._disableDelayedDrag),dl(d,"touchend",a._disableDelayedDrag),dl(d,"touchcancel",a._disableDelayedDrag),dl(d,"mousemove",a._delayedDragTouchMoveHandler),dl(d,"touchmove",a._delayedDragTouchMoveHandler),f.supportPointer&&dl(d,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(h,f.delay)}else h()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Vo&&yne(Vo),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;La(e,"mouseup",this._disableDelayedDrag),La(e,"touchend",this._disableDelayedDrag),La(e,"touchcancel",this._disableDelayedDrag),La(e,"mousemove",this._delayedDragTouchMoveHandler),La(e,"touchmove",this._delayedDragTouchMoveHandler),La(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?dl(document,"pointermove",this._onTouchMove):t?dl(document,"touchmove",this._onTouchMove):dl(document,"mousemove",this._onTouchMove):(dl(Vo,"dragend",this),dl(eu,"dragstart",this._onDragStart));try{document.selection?AH(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(iD=!1,eu&&Vo){Mp("dragStarted",this,{evt:t}),this.nativeDraggable&&dl(document,"dragover",pxe);var s=this.options;!e&&$1(Vo,s.dragClass,!1),$1(Vo,s.ghostClass,!0),Wr.active=this,e&&this._appendGhost(),Rg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wv){this._lastX=wv.clientX,this._lastY=wv.clientY,n1e();for(var e=document.elementFromPoint(wv.clientX,wv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wv.clientX,wv.clientY),e!==t);)t=e;if(Vo.parentNode[F1]._isOutsideThisEl(e),t)do{if(t[F1]){var s=void 0;if(s=t[F1]._onDragOver({clientX:wv.clientX,clientY:wv.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);o1e()}},_onTouchMove:function(e){if(qT){var t=this.options,s=t.fallbackTolerance,a=t.fallbackOffset,l=e.touches?e.touches[0]:e,f=Ei&&vD(Ei,!0),d=Ei&&f&&f.a,h=Ei&&f&&f.d,b=LZ&&Rm&&_ue(Rm),y=(l.clientX-qT.clientX+a.x)/(d||1)+(b?b[0]-One[0]:0)/(d||1),k=(l.clientY-qT.clientY+a.y)/(h||1)+(b?b[1]-One[1]:0)/(h||1);if(!Wr.active&&!iD){if(s&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))=0&&(Rg({rootEl:Xu,name:"add",toEl:Xu,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"remove",toEl:Xu,originalEvent:e}),Rg({rootEl:Xu,name:"sort",toEl:Xu,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:Xu,originalEvent:e})),zh&&zh.save()):I1!==dD&&I1>=0&&(Rg({sortable:this,name:"update",toEl:Xu,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:Xu,originalEvent:e})),Wr.active&&((I1==null||I1===-1)&&(I1=dD,bC=a6),Rg({sortable:this,name:"end",toEl:Xu,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Mp("nulling",this),eu=Vo=Xu=Ei=tE=Su=TH=yC=qT=wv=XN=I1=bC=dD=a6=tD=l6=zh=IZ=Wr.dragged=Wr.ghost=Wr.clone=Wr.active=null,sz.forEach(function(e){e.checked=!0}),sz.length=bne=vne=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Vo&&(this._onDragOver(e),bxe(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,s=this.el.children,a=0,l=s.length,f=this.options;as.right+a||o.clientX<=s.right&&o.clientY>s.bottom&&o.clientX>=s.left:o.clientX>s.right&&o.clientY>s.top||o.clientX<=s.right&&o.clientY>s.bottom+a}function wxe(o,e,t,s,a,l,f,d){var h=s?o.clientY:o.clientX,b=s?t.height:t.width,y=s?t.top:t.left,k=s?t.bottom:t.right,E=!1;if(!f){if(d&&EHy+b*l/2:hk-EH)return-l6}else if(h>y+b*(1-a)/2&&hk-b*l/2)?h>y+b/2?1:-1:0}function _xe(o){return Lb(Vo){f[y]=null}),_o(),t=f[e],t?t.p(h,b):(t=f[e]=l[e](h),t.c()),xe(t,1),t.m(s.parentNode,s))},i(h){a||(xe(t),a=!0)},o(h){Qe(t),a=!1},d(h){f[e].d(h),h&&Pe(s)}}}function Axe(o,e,t){let{$$slots:s={},$$scope:a}=e,{sortableClass:l}=e,{isTable:f=!1}=e,{sortableInstance:d}=e;const h=Hp();let b;W1(()=>{let E={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onUpdate(M){h("update",{source:M.oldIndex,target:M.newIndex})},onMove(M){}};t(3,d=Wr.create(b,E))});function y(E){Uo[E?"unshift":"push"](()=>{b=E,t(2,b)})}function k(E){Uo[E?"unshift":"push"](()=>{b=E,t(2,b)})}return o.$$set=E=>{"sortableClass"in E&&t(0,l=E.sortableClass),"isTable"in E&&t(1,f=E.isTable),"sortableInstance"in E&&t(3,d=E.sortableInstance),"$$scope"in E&&t(4,a=E.$$scope)},[l,f,b,d,a,s,y,k]}class oI extends vo{constructor(e){super(),bo(this,e,Axe,Exe,po,{sortableClass:0,isTable:1,sortableInstance:3})}}function Tue(o,e,t){const s=o.slice();return s[11]=e[t],s}function Eue(o){let e,t;return{c(){e=re("div"),t=Xt(o[1]),z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&2&&Wn(t,s[1])},d(s){s&&Pe(e)}}}function Aue(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[Dxe]},$$scope:{ctx:o}}}),e.$on("update",o[4]),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&16385&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Due(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[3]),{key:o,first:null,c(){t=re("div"),tn(s.$$.fragment),a=Ze(),z(t,"class","col mb-3"),this.first=t},m(f,d){Me(f,t,d),Kt(s,t,null),j(t,a),l=!0},p(f,d){e=f;const h={};d&1&&(h.record=e[11]),s.$set(h)},i(f){l||(xe(s.$$.fragment,f),l=!0)},o(f){Qe(s.$$.fragment,f),l=!1},d(f){f&&Pe(t),Jt(s)}}}function Dxe(o){let e=[],t=new Map,s,a,l=o[0];const f=d=>d[11].id;for(let d=0;d0&&Aue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),tn(s.$$.fragment),a=Ze(),h&&h.c(),l=Bs(),z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Me(b,e,y),Me(b,t,y),Kt(s,t,null),Me(b,a,y),h&&h.m(b,y),Me(b,l,y),f=!0},p(b,[y]){b[1]?d?d.p(b,y):(d=Eue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),b[0].length>0?h?(h.p(b,y),y&1&&xe(h,1)):(h=Aue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(wo(),Qe(h,1,1,()=>{h=null}),_o())},i(b){f||(xe(s.$$.fragment,b),xe(h),f=!0)},o(b){Qe(s.$$.fragment,b),Qe(h),f=!1},d(b){d&&d.d(b),b&&Pe(e),b&&Pe(t),Jt(s),b&&Pe(a),h&&h.d(b),b&&Pe(l)}}}function Mxe(o,e,t){let s,a;const l=si("channel");let{record:f}=e,{field:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter($=>d.collections.includes($.name));function k($){$.preventDefault(),t(6,h.edges=h.edges.filter(Q=>!(Q.target===$.detail&&Q.field===d.name)),h)}function E($){t(6,h.edges=XD($.detail.source,$.detail.target,h.edges,d.name),h)}function M($){$.preventDefault(),t(6,h=K6(h,f,$.detail.records,d.name,$.detail.action))}return o.$$set=$=>{"record"in $&&t(7,f=$.record),"field"in $&&t(8,d=$.field),"graph"in $&&t(6,h=$.graph),"validationErrors"in $&&t(9,b=$.validationErrors)},o.$$.update=()=>{var $;o.$$.dirty&768&&t(1,s=Lm(b,d.name)),o.$$.dirty&448&&t(0,a=($=h.edges.filter(Q=>Q.field===d.name).map(Q=>h.records.find(F=>F.id==Q.target&&f.id==Q.source)).filter(Q=>!!(Q!=null&&Q.id)))!=null?$:[])},[a,s,y,k,E,M,h,f,d,b]}class Rxe extends vo{constructor(e){super(),bo(this,e,Mxe,Pxe,po,{record:7,field:8,graph:6,validationErrors:9})}}function Pue(o,e,t){const s=o.slice();return s[21]=e[t],s}function $xe(o){let e,t,s,a,l,f,d,h,b,y,k,E,M,$,Q,F,U,K,L,te,ne,oe,Y,ye,_e,Le,ve,ue,ot,nt;f=new ml({props:{icon:"pencil",width:12,height:12}});const mt=[Lxe,Bxe],V=[];function ht(Et,An){return Et[7]?0:1}b=ht(o),y=V[b]=mt[b](o),$=new ml({props:{icon:"ellipsis"}});let We=!o[1]&&Mue(o),Ct=!o[2]&&Rue(o),yt=o[8].type==="files"&&Fxe(o),Re=o[8].fields.filter(Nue),Je=[];for(let Et=0;EtQe(Je[Et],1,1,()=>{Je[Et]=null});return{c(){e=re("div"),t=re("div"),s=re("small"),s.textContent=`${o[8].label}`,a=Ze(),l=re("button"),tn(f.$$.fragment),d=Ze(),h=re("button"),y.c(),k=Ze(),E=re("div"),M=re("button"),tn($.$$.fragment),Q=Ze(),F=re("div"),U=re("a"),K=Xt("Edit in new tab"),te=Ze(),ne=re("button"),ne.textContent="Remove",oe=Ze(),Y=re("div"),We&&We.c(),ye=Ze(),Ct&&Ct.c(),_e=Ze(),Le=re("div"),yt&&yt.c(),ve=Ze();for(let Et=0;Et{V[Xe]=null}),_o(),y=V[b],y||(y=V[b]=mt[b](Et),y.c()),xe(y,1),y.m(h,null)),(!ue||An&1&&L!==(L="/records/"+Et[0].id))&&z(U,"href",L),Et[1]?We&&(wo(),Qe(We,1,1,()=>{We=null}),_o()):We?(We.p(Et,An),An&2&&xe(We,1)):(We=Mue(Et),We.c(),xe(We,1),We.m(Y,ye)),Et[2]?Ct&&(wo(),Qe(Ct,1,1,()=>{Ct=null}),_o()):Ct?(Ct.p(Et,An),An&4&&xe(Ct,1)):(Ct=Rue(Et),Ct.c(),xe(Ct,1),Ct.m(Y,null)),Et[8].type==="files"&&yt.p(Et,An),An&257){Re=Et[8].fields.filter(Nue);let _t;for(_t=0;_t{f[y]=null}),_o(),s=f[t],s?s.p(h,b):(s=f[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Qe(s),a=!1},d(h){h&&Pe(e),f[t].d()}}}const Nue=o=>!(o.trashed||["tab"].includes(o.ui)||["id"].includes(o.name));function Vxe(o,e,t){let s,a;const l=si("channel"),f=Hp();let{isFirst:d}=e,{isLast:h}=e,{toDelete:b=!1}=e,{record:y}=e,k,E,M=l.schemas.find(ye=>ye.name===y.schema);function $(ye){ye.preventDefault(),axios.get(l.lucentUrl+"/records/editInline/"+y.id).then(_e=>{t(0,y=_e.data),t(4,k=_e.data.record),t(5,E=_e.data.graph),t(6,s=!0)}).catch(_e=>{console.log(_e)})}function Q(ye){ye.preventDefault(),f("moveup")}function F(ye){ye.preventDefault(),f("movedn")}function U(ye){ye.preventDefault(),f("inlinesaved",ye.detail),t(6,s=!1)}function K(ye){ye.preventDefault(),f("remove",y.id)}function L(ye){ye.preventDefault(),f("trash",y.id)}function te(ye){ye.preventDefault(),f("undoremove",y.id)}function ne(ye){ye.preventDefault(),t(6,s=!1)}W1(()=>{t(6,s=!1)});function oe(ye){ye.preventDefault(),axios.post(l.lucentUrl+"/records/status/trashed",[y]).then(_e=>{f("remove",y.id)}).catch(_e=>{console.log(_e)})}const Y=ye=>t(7,a=!a);return o.$$set=ye=>{"isFirst"in ye&&t(1,d=ye.isFirst),"isLast"in ye&&t(2,h=ye.isLast),"toDelete"in ye&&t(3,b=ye.toDelete),"record"in ye&&t(0,y=ye.record)},t(6,s=!1),t(7,a=!1),[y,d,h,b,k,E,s,a,M,$,Q,F,U,K,L,te,ne,oe,Y]}class Wxe extends vo{constructor(e){super(),bo(this,e,Vxe,zxe,po,{isFirst:1,isLast:2,toDelete:3,record:0})}}function r1e(o,{from:e,to:t},s={}){const a=getComputedStyle(o),l=a.transform==="none"?"":a.transform,[f,d]=a.transformOrigin.split(" ").map(parseFloat),h=e.left+e.width*f/t.width-(t.left+f),b=e.top+e.height*d/t.height-(t.top+d),{delay:y=0,duration:k=M=>Math.sqrt(M)*120,easing:E=Cpe}=s;return{delay:y,duration:Ub(k)?k(Math.sqrt(h*h+b*b)):k,easing:E,css:(M,$)=>{const Q=$*h,F=$*b,U=M+$*e.width/t.width,K=M+$*e.height/t.height;return`transform: ${l} translate(${Q}px, ${F}px) scale(${U}, ${K});`}}}function Iue(o,e,t){const s=o.slice();return s[18]=e[t],s[19]=e,s[20]=t,s}function Bue(o){let e,t;return{c(){e=re("div"),t=Xt(o[3]),z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&8&&Wn(t,s[3])},d(s){s&&Pe(e)}}}function Lue(o){let e=[],t=new Map,s,a,l=o[2];const f=d=>d[18].id;for(let d=0;dcr(s,"record",E)),s.$on("inlinesaved",e[5]),s.$on("moveup",M),s.$on("movedn",$),s.$on("remove",e[6]),s.$on("undoremove",e[8]),s.$on("trash",e[7]),f=new eI({props:{field:e[1],recordId:e[18].id,schemas:e[4]}}),f.$on("insert",e[9]),f.$on("save",e[9]),{key:o,first:null,c(){t=re("div"),tn(s.$$.fragment),l=Ze(),tn(f.$$.fragment),d=Ze(),z(t,"class","inline-card-wrapper"),this.first=t},m(F,U){Me(F,t,U),Kt(s,t,null),j(t,l),Kt(f,t,null),j(t,d),y=!0},p(F,U){e=F;const K={};U&4&&(K.isFirst=e[20]===0),U&4&&(K.isLast=e[20]+1===e[2].length),U&7&&(K.toDelete=e[0].edges.find(k)._isTrashed),!a&&U&4&&(a=!0,K.record=e[18],mr(()=>a=!1)),s.$set(K);const L={};U&2&&(L.field=e[1]),U&4&&(L.recordId=e[18].id),f.$set(L)},r(){h=t.getBoundingClientRect()},f(){ype(t),b()},a(){b(),b=Ope(t,h,r1e,{delay:250,duration:250,easing:kpe})},i(F){y||(xe(s.$$.fragment,F),xe(f.$$.fragment,F),y=!0)},o(F){Qe(s.$$.fragment,F),Qe(f.$$.fragment,F),y=!1},d(F){F&&Pe(t),Jt(s),Jt(f)}}}function Uxe(o){let e,t,s,a,l,f,d=o[3]&&Bue(o);s=new eI({props:{field:o[1],recordId:null,schemas:o[4]}}),s.$on("insert",o[9]),s.$on("save",o[9]);let h=o[2].length>0&&Lue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),tn(s.$$.fragment),a=Ze(),h&&h.c(),l=Bs(),z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Me(b,e,y),Me(b,t,y),Kt(s,t,null),Me(b,a,y),h&&h.m(b,y),Me(b,l,y),f=!0},p(b,[y]){b[3]?d?d.p(b,y):(d=Bue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);const k={};y&2&&(k.field=b[1]),s.$set(k),b[2].length>0?h?(h.p(b,y),y&4&&xe(h,1)):(h=Lue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(wo(),Qe(h,1,1,()=>{h=null}),_o())},i(b){f||(xe(s.$$.fragment,b),xe(h),f=!0)},o(b){Qe(s.$$.fragment,b),Qe(h),f=!1},d(b){d&&d.d(b),b&&Pe(e),b&&Pe(t),Jt(s),b&&Pe(a),h&&h.d(b),b&&Pe(l)}}}function Yxe(o,e,t){let s,a;const l=si("channel");let{field:f}=e,{record:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter(ne=>f.collections.includes(ne.name));function k(ne){const oe=ne.detail.records[0];t(0,h.edges=h.edges.map(Y=>Y.source===oe.id?oe:Y),h)}function E(ne){ne.preventDefault(),t(0,h.edges=h.edges.filter(oe=>!(oe.target===ne.detail&&oe.field===f.name)),h)}function M(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===f.name&&(oe._isTrashed=!0),oe)),h)}function $(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===f.name&&delete oe._isTrashed,oe)),h)}function Q(ne){var ve;ne.preventDefault();const oe=ne.detail.records,Y=(ve=ne.detail.after)!=null?ve:null,ye=ne.detail.action;let _e=oe.map(ue=>({target:ue.id,source:d.id,sourceSchema:d.schema,targetSchema:ue.schema,field:f.name,rank:""})),Le=h.edges;if(ye==="replace"&&(Le=Le.filter(ue=>ue.field!==f.name)),t(0,h.records=Lc.exports.uniqBy([...h.records,...oe],ue=>ue.id),h),t(0,h.edges=Lc.exports.uniqBy([...Le,..._e],ue=>ue.target+ue.field),h),!Y)t(0,h.edges=Lc.exports.uniqBy([..._e,...Le],ue=>ue.target+ue.field),h);else{let ue=!1,ot=Le.reduce((nt,mt)=>(ue?nt.after.push(mt):nt.before.push(mt),ue===!1&&mt.target===Y&&(ue=!0),nt),{before:[],after:[]});t(0,h.edges=Lc.exports.uniqBy([...ot.before,..._e,...ot.after],nt=>nt.target+nt.field),h)}}function F(ne,oe,Y){t(0,h.edges=XD(oe,Y,h.edges,f.name),h)}const U=(ne,oe)=>oe.field===f.name&&oe.target===ne.id;function K(ne,oe,Y,ye){Y[ye]=ne,t(2,a),t(0,h),t(1,f),t(11,d)}const L=(ne,oe)=>F(oe,ne,ne-1),te=(ne,oe)=>F(oe,ne,ne+1);return o.$$set=ne=>{"field"in ne&&t(1,f=ne.field),"record"in ne&&t(11,d=ne.record),"graph"in ne&&t(0,h=ne.graph),"validationErrors"in ne&&t(12,b=ne.validationErrors)},o.$$.update=()=>{var ne;o.$$.dirty&4098&&t(3,s=Lm(b,f.name)),o.$$.dirty&2051&&t(2,a=(ne=h.edges.filter(oe=>oe.field===f.name).map(oe=>h.records.find(Y=>Y.id==oe.target&&d.id==oe.source)).filter(oe=>!!(oe!=null&&oe.id)))!=null?ne:[])},[h,f,a,s,y,k,E,M,$,Q,F,d,b,U,K,L,te]}class Xxe extends vo{constructor(e){super(),bo(this,e,Yxe,Uxe,po,{field:1,record:11,graph:0,validationErrors:12})}}function i1e(o,e,t=null){return t?o.reduce((s,a)=>(s.push(a),a.id===t&&s.push({meta:e,id:Fle(),value:null}),s),[]):[{meta:e,id:Fle(),value:null},...o]}function Que(o,e,t){const s=o.slice();return s[7]=e[t],s}function Zue(o){let e,t=o[1].fields,s=[];for(let a=0;at(2,s=!s),b=(y,k)=>d(k,y);return o.$$set=y=>{"blockId"in y&&t(0,a=y.blockId),"blockData"in y&&t(4,l=y.blockData),"blockSchema"in y&&t(1,f=y.blockSchema)},t(2,s=!1),[a,f,s,d,l,h,b]}class Gxe extends vo{constructor(e){super(),bo(this,e,qxe,jxe,po,{blockId:0,blockData:4,blockSchema:1})}}function Kxe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("input"),z(t,"type","text"),z(t,"id",s=o[0].id),z(t,"class","form-control"),z(t,"autocomplete","off"),z(e,"class","mb-0")},m(f,d){Me(f,e,d),j(e,t),hr(t,o[0].value),a||(l=vn(t,"input",o[1]),a=!0)},p(f,[d]){d&1&&s!==(s=f[0].id)&&z(t,"id",s),d&1&&t.value!==f[0].value&&hr(t,f[0].value)},i:pn,o:pn,d(f){f&&Pe(e),a=!1,l()}}}function Jxe(o,e,t){let{block:s}=e;function a(){s.value=this.value,t(0,s)}return o.$$set=l=>{"block"in l&&t(0,s=l.block)},[s,a]}class eTe extends vo{constructor(e){super(),bo(this,e,Jxe,Kxe,po,{block:0})}}function tTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("textarea"),z(t,"id",s=o[0].id),z(t,"class","form-control svelte-1er4ovm"),z(t,"autocomplete","off"),z(e,"class","mb-0")},m(f,d){Me(f,e,d),j(e,t),hr(t,o[0].value),o[3](t),a||(l=[vn(t,"input",o[2]),vn(t,"input",a1e)],a=!0)},p(f,[d]){d&1&&s!==(s=f[0].id)&&z(t,"id",s),d&1&&hr(t,f[0].value)},i:pn,o:pn,d(f){f&&Pe(e),o[3](null),a=!1,$i(l)}}}function a1e(o){let e;o.target?e=o.target:e=o,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function nTe(o,e,t){let{block:s}=e,a;W1(()=>{a1e(a)});function l(){s.value=this.value,t(0,s)}function f(d){Uo[d?"unshift":"push"](()=>{a=d,t(1,a)})}return o.$$set=d=>{"block"in d&&t(0,s=d.block)},[s,a,l,f]}class oTe extends vo{constructor(e){super(),bo(this,e,nTe,tTe,po,{block:0})}}var l1e={exports:{}};(function(o){(function(){var e=function(n){if(n===null)return"null";if(n===void 0)return"undefined";var i=typeof n;return i==="object"&&(Array.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="Array")?"array":i==="object"&&(String.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="String")?"string":i},t=function(n){return["undefined","boolean","number","string","function","xml","null"].indexOf(n)!==-1},s=function(n,i){var c=Array.prototype.slice.call(n);return c.sort(i)},a=function(n,i){return l(function(c,m){return n.eq(i(c),i(m))})},l=function(n){return{eq:n}},f=l(function(n,i){return n===i}),d=f,h=function(n){return l(function(i,c){if(i.length!==c.length)return!1;for(var m=i.length,p=0;p{var m;return c(n,i.prototype)?!0:((m=n.constructor)===null||m===void 0?void 0:m.name)===i.name},$=n=>{const i=typeof n;return n===null?"null":i==="object"&&Array.isArray(n)?"array":i==="object"&&M(n,String,(c,m)=>m.isPrototypeOf(c))?"string":i},Q=n=>i=>$(i)===n,F=n=>i=>typeof i===n,U=n=>i=>n===i,K=(n,i)=>te(n)&&M(n,i,(c,m)=>E(c)===m),L=Q("string"),te=Q("object"),ne=n=>K(n,Object),oe=Q("array"),Y=U(null),ye=F("boolean"),_e=U(void 0),Le=n=>n==null,ve=n=>!Le(n),ue=F("function"),ot=F("number"),nt=(n,i)=>{if(oe(n)){for(let c=0,m=n.length;c{},V=(n,i)=>(...c)=>n(i.apply(null,c)),ht=(n,i)=>c=>n(i(c)),We=n=>()=>n,Ct=n=>n,yt=(n,i)=>n===i;function Re(n,...i){return(...c)=>{const m=i.concat(c);return n.apply(null,m)}}const Je=n=>i=>!n(i),an=n=>()=>{throw new Error(n)},Et=n=>n(),An=n=>{n()},Xe=We(!1),_t=We(!0);class he{constructor(i,c){this.tag=i,this.value=c}static some(i){return new he(!0,i)}static none(){return he.singletonNone}fold(i,c){return this.tag?c(this.value):i()}isSome(){return this.tag}isNone(){return!this.tag}map(i){return this.tag?he.some(i(this.value)):he.none()}bind(i){return this.tag?i(this.value):he.none()}exists(i){return this.tag&&i(this.value)}forall(i){return!this.tag||i(this.value)}filter(i){return!this.tag||i(this.value)?this:he.none()}getOr(i){return this.tag?this.value:i}or(i){return this.tag?this:i}getOrThunk(i){return this.tag?this.value:i()}orThunk(i){return this.tag?this:i()}getOrDie(i){if(this.tag)return this.value;throw new Error(i!=null?i:"Called getOrDie on None")}static from(i){return ve(i)?he.some(i):he.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(i){this.tag&&i(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}he.singletonNone=new he(!1);const Zo=Array.prototype.slice,ao=Array.prototype.indexOf,wn=Array.prototype.push,Co=(n,i)=>ao.call(n,i),Ho=(n,i)=>{const c=Co(n,i);return c===-1?he.none():he.some(c)},wt=(n,i)=>Co(n,i)>-1,Wt=(n,i)=>{for(let c=0,m=n.length;c{const c=n.length,m=new Array(c);for(let p=0;p{for(let c=0,m=n.length;c{for(let c=n.length-1;c>=0;c--){const m=n[c];i(m,c)}},gn=(n,i)=>{const c=[],m=[];for(let p=0,w=n.length;p{const c=[];for(let m=0,p=n.length;m(Gt(n,(m,p)=>{c=i(c,m,p)}),c),zn=(n,i,c)=>(Ne(n,(m,p)=>{c=i(c,m,p)}),c),ps=(n,i,c)=>{for(let m=0,p=n.length;mps(n,i,Xe),Ss=(n,i)=>{for(let c=0,m=n.length;c{const i=[];for(let c=0,m=n.length;cMr(gt(n,i)),er=(n,i)=>{for(let c=0,m=n.length;c{const i=Zo.call(n,0);return i.reverse(),i},wa=(n,i)=>Dt(n,c=>!wt(i,c)),ur=(n,i)=>{const c={};for(let m=0,p=n.length;m{const c=Zo.call(n,0);return c.sort(i),c},jr=(n,i)=>i>=0&&ijr(n,0),Mo=n=>jr(n,n.length-1),Rr=ue(Array.from)?Array.from:n=>Zo.call(n),Ls=(n,i)=>{for(let c=0;c{const c=[],m=ue(i)?p=>Wt(c,w=>i(w,p)):p=>wt(c,p);for(let p=0,w=n.length;p{const c=bs(n);for(let m=0,p=c.length;mQi(n,(c,m)=>({k:m,v:i(c,m)})),Qi=(n,i)=>{const c={};return ln(n,(m,p)=>{const w=i(m,p);c[w.k]=w.v}),c},He=n=>(i,c)=>{n[c]=i},et=(n,i,c,m)=>{ln(n,(p,w)=>{(i(p,w)?c:m)(p,w)})},At=(n,i)=>{const c={},m={};return et(n,i,He(c),He(m)),{t:c,f:m}},Vt=(n,i)=>{const c={};return et(n,i,He(c),mt),c},Xn=(n,i)=>{const c=[];return ln(n,(m,p)=>{c.push(i(m,p))}),c},uo=n=>Xn(n,Ct),Oo=(n,i)=>un(n,i)?he.from(n[i]):he.none(),un=(n,i)=>_a.call(n,i),os=(n,i)=>un(n,i)&&n[i]!==void 0&&n[i]!==null,To=(n,i,c=k)=>y(c).eq(n,i),fs=n=>{const i={};return Ne(n,c=>{i[c]={}}),bs(i)},kr=n=>n.length!==void 0,Lr=Array.isArray,Vs=n=>{if(Lr(n))return n;{const i=[];for(let c=0,m=n.length;c{if(!n)return!1;if(c=c||n,kr(n)){for(let m=0,p=n.length;m{const c=[];return Ur(n,(m,p)=>{c.push(i(m,p,n))}),c},Fa=(n,i)=>{const c=[];return Ur(n,(m,p)=>{(!i||i(m,p,n))&&c.push(m)}),c},vi=(n,i)=>{if(n){for(let c=0,m=n.length;c{let p=_e(c)?n[0]:c;for(let w=0;w{for(let m=0,p=n.length;mn[n.length-1],Ut=n=>{let i=!1,c;return(...m)=>(i||(i=!0,c=n.apply(null,m)),c)},fo=(n,i,c,m)=>{const p=n.isiOS()&&/ipad/i.test(c)===!0,w=n.isiOS()&&!p,x=n.isiOS()||n.isAndroid(),R=x||m("(pointer:coarse)"),B=p||!w&&x&&m("(min-device-width:768px)"),G=w||x&&!B,ae=i.isSafari()&&n.isiOS()&&/safari/i.test(c)===!1,fe=!G&&!B&&!ae;return{isiPad:We(p),isiPhone:We(w),isTablet:We(B),isPhone:We(G),isTouch:We(R),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:We(ae),isDesktop:We(fe)}},Lo=(n,i)=>{for(let c=0;c{const c=Lo(n,i);if(!c)return{major:0,minor:0};const m=p=>Number(i.replace(c,"$"+p));return Xo(m(1),m(2))},Jr=(n,i)=>{const c=String(i).toLowerCase();return n.length===0?at():Go(n,c)},at=()=>Xo(0,0),Xo=(n,i)=>({major:n,minor:i}),Ni={nu:Xo,detect:Jr,unknown:at},la=(n,i)=>Ls(i.brands,c=>{const m=c.brand.toLowerCase();return oo(n,p=>{var w;return m===((w=p.brand)===null||w===void 0?void 0:w.toLowerCase())}).map(p=>({current:p.name,version:Ni.nu(parseInt(c.version,10),0)}))}),ma=(n,i)=>{const c=String(i).toLowerCase();return oo(n,m=>m.search(c))},gr=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Fc=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Cc=(n,i)=>n.substring(i),tl=(n,i,c)=>i===""||n.length>=i.length&&n.substr(c,c+i.length)===i,ga=(n,i)=>Ar(n,i)?Cc(n,i.length):n,tr=(n,i,c=0,m)=>{const p=n.indexOf(i,c);return p!==-1?_e(m)?!0:p+i.length<=m:!1},Ar=(n,i)=>tl(n,i,0),Ki=(n,i)=>tl(n,i,n.length-i.length),gl=n=>i=>i.replace(n,""),kc=gl(/^\s+|\s+$/g),nu=gl(/^\s+/g),ku=gl(/\s+$/g),yr=n=>n.length>0,nl=n=>!yr(n),xu=(n,i)=>i<=0?"":new Array(i+1).join(n),ou=(n,i=10)=>{const c=parseInt(n,i);return isNaN(c)?he.none():he.some(c)},Yl=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Aa=n=>i=>tr(i,n),Dr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:n=>tr(n,"edge/")&&tr(n,"chrome")&&tr(n,"safari")&&tr(n,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Yl],search:n=>tr(n,"chrome")&&!tr(n,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:n=>tr(n,"msie")||tr(n,"trident")},{name:"Opera",versionRegexes:[Yl,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Aa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Aa("firefox")},{name:"Safari",versionRegexes:[Yl,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(tr(n,"safari")||tr(n,"mobile/"))&&tr(n,"applewebkit")}],Qm=[{name:"Windows",search:Aa("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:n=>tr(n,"iphone")||tr(n,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Aa("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Aa("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Aa("linux"),versionRegexes:[]},{name:"Solaris",search:Aa("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Aa("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Aa("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],kf={browsers:We(Dr),oses:We(Qm)},xr="Edge",Qa="Chromium",ca="IE",Ji="Opera",Tu="Firefox",Qc="Safari",Za=()=>Zc({current:void 0,version:Ni.unknown()}),Zc=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isEdge:m(xr),isChromium:m(Qa),isIE:m(ca),isOpera:m(Ji),isFirefox:m(Tu),isSafari:m(Qc)}},xc={unknown:Za,nu:Zc,edge:We(xr),chromium:We(Qa),ie:We(ca),opera:We(Ji),firefox:We(Tu),safari:We(Qc)},Cd="Windows",Uf="iOS",Eu="Android",Xl="Linux",Hc="macOS",xf="Solaris",su="FreeBSD",kd="ChromeOS",Ee=()=>tt({current:void 0,version:Ni.unknown()}),tt=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isWindows:m(Cd),isiOS:m(Uf),isAndroid:m(Eu),isMacOS:m(Hc),isLinux:m(Xl),isSolaris:m(xf),isFreeBSD:m(su),isChromeOS:m(kd)}},pt={unknown:Ee,nu:tt,windows:We(Cd),ios:We(Uf),android:We(Eu),linux:We(Xl),macos:We(Hc),solaris:We(xf),freebsd:We(su),chromeos:We(kd)},On={detect:(n,i,c)=>{const m=kf.browsers(),p=kf.oses(),w=i.bind(B=>la(m,B)).orThunk(()=>gr(m,n)).fold(xc.unknown,xc.nu),x=Fc(p,n).fold(pt.unknown,pt.nu),R=fo(x,w,n,c);return{browser:w,os:x,deviceType:R}}},Ro=n=>window.matchMedia(n).matches;let $r=Ut(()=>On.detect(navigator.userAgent,he.from(navigator.userAgentData),Ro));const ys=()=>$r(),ls=navigator.userAgent,Ai=ys(),js=Ai.browser,Hi=Ai.os,Au=Ai.deviceType,xd=ls.indexOf("Windows Phone")!==-1,Gn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:js.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!js.isIE(),windowsPhone:xd,browser:{current:js.current,version:js.version,isChromium:js.isChromium,isEdge:js.isEdge,isFirefox:js.isFirefox,isIE:js.isIE,isOpera:js.isOpera,isSafari:js.isSafari},os:{current:Hi.current,version:Hi.version,isAndroid:Hi.isAndroid,isChromeOS:Hi.isChromeOS,isFreeBSD:Hi.isFreeBSD,isiOS:Hi.isiOS,isLinux:Hi.isLinux,isMacOS:Hi.isMacOS,isSolaris:Hi.isSolaris,isWindows:Hi.isWindows},deviceType:{isDesktop:Au.isDesktop,isiPad:Au.isiPad,isiPhone:Au.isiPhone,isPhone:Au.isPhone,isTablet:Au.isTablet,isTouch:Au.isTouch,isWebView:Au.isWebView}},Zm=/^\s*|\s*$/g,zi=n=>Le(n)?"":(""+n).replace(Zm,""),me=(n,i)=>i?i==="array"&&Lr(n)?!0:typeof n===i:n!==void 0,$e=(n,i,c={})=>{const m=L(n)?n.split(i||","):n||[];let p=m.length;for(;p--;)c[m[p]]={};return c},Ue=un,Bt=(n,...i)=>{for(let c=0;ci.call(m,p,w,c)===!1?!1:(Ln(p,i,c,m),!0)))},hn={trim:zi,isArray:Lr,is:me,toArray:Vs,makeMap:$e,each:Ur,map:Zi,grep:Fa,inArray:vi,hasOwn:Ue,extend:Bt,walk:Ln,resolve:(n,i=window)=>{const c=n.split(".");for(let m=0,p=c.length;moe(n)?n:n===""?[]:Zi(n.split(i||","),zi),_addCacheSuffix:n=>{const i=Gn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},qr=(n,i,c=yt)=>n.exists(m=>c(m,i)),Ll=(n,i,c=yt)=>ri(n,i,c).getOr(n.isNone()&&i.isNone()),ea=n=>{const i=[],c=m=>{i.push(m)};for(let m=0;mn.isSome()&&i.isSome()?he.some(c(n.getOrDie(),i.getOrDie())):he.none(),Tf=(n,i,c,m)=>n.isSome()&&i.isSome()&&c.isSome()?he.some(m(n.getOrDie(),i.getOrDie(),c.getOrDie())):he.none(),ks=(n,i)=>n?he.some(i):he.none(),ru=typeof window<"u"?window:Function("return this;")(),Di=(n,i)=>{let c=i!=null?i:ru;for(let m=0;m{const c=n.split(".");return Di(c,i)},Ii=(n,i)=>uc(n,i),Yf=(n,i)=>{const c=Ii(n,i);if(c==null)throw new Error(n+" not available on this browser");return c},pa=Object.getPrototypeOf,Xf=n=>Yf("HTMLElement",n),pr=n=>{const i=uc("ownerDocument.defaultView",n);return te(n)&&(Xf(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(pa(n).constructor.name))},qu=8,Gu=9,Tc=11,jf=1,Jd=3,ei=n=>n.dom.nodeName.toLowerCase(),ta=n=>n.dom.nodeType,Ha=n=>i=>ta(i)===n,Kb=n=>ta(n)===qu||ei(n)==="#comment",Pi=n=>kl(n)&&pr(n.dom),kl=Ha(jf),ol=Ha(Jd),Qg=Ha(Gu),qf=Ha(Tc),Ec=n=>i=>kl(i)&&ei(i)===n,Ef=(n,i,c)=>{if(L(c)||ye(c)||ot(c))n.setAttribute(i,c+"");else throw console.error("Invalid call to Attribute.set. Key ",i,":: Value ",c,":: Element ",n),new Error("Attribute value was not simple")},Pr=(n,i,c)=>{Ef(n.dom,i,c)},Ku=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{Ef(c,p,m)})},Fl=(n,i)=>{const c=n.dom.getAttribute(i);return c===null?void 0:c},za=(n,i)=>he.from(Fl(n,i)),qi=(n,i)=>{const c=n.dom;return c&&c.hasAttribute?c.hasAttribute(i):!1},Vi=(n,i)=>{n.dom.removeAttribute(i)},fc=n=>{const i=n.dom.attributes;return i==null||i.length===0},Gf=n=>zn(n.dom.attributes,(i,c)=>(i[c.name]=c.value,i),{}),eh=(n,i)=>{const c=Fl(n,i);return c===void 0||c===""?[]:c.split(" ")},Zg=(n,i,c)=>{const p=eh(n,i).concat([c]);return Pr(n,i,p.join(" ")),!0},Hm=(n,i,c)=>{const m=Dt(eh(n,i),p=>p!==c);return m.length>0?Pr(n,i,m.join(" ")):Vi(n,i),!1},Ql=n=>n.dom.classList!==void 0,zm=n=>eh(n,"class"),sl=(n,i)=>Zg(n,"class",i),Af=(n,i)=>Hm(n,"class",i),jh=(n,i)=>wt(zm(n),i)?Af(n,i):sl(n,i),Ju=(n,i)=>{Ql(n)?n.dom.classList.add(i):sl(n,i)},qh=n=>{(Ql(n)?n.dom.classList:zm(n)).length===0&&Vi(n,"class")},zc=(n,i)=>{Ql(n)?n.dom.classList.remove(i):Af(n,i),qh(n)},Gh=(n,i)=>{const c=Ql(n)?n.dom.classList.toggle(i):jh(n,i);return qh(n),c},Df=(n,i)=>Ql(n)&&n.dom.classList.contains(i),zp=(n,i)=>{const m=(i||document).createElement("div");if(m.innerHTML=n,!m.hasChildNodes()||m.childNodes.length>1){const p="HTML does not have a single root node";throw console.error(p,n),new Error(p)}return jl(m.childNodes[0])},Vm=(n,i)=>{const m=(i||document).createElement(n);return jl(m)},Kf=(n,i)=>{const m=(i||document).createTextNode(n);return jl(m)},jl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ge={fromHtml:zp,fromTag:Vm,fromText:Kf,fromDom:jl,fromPoint:(n,i,c)=>he.from(n.dom.elementFromPoint(i,c)).map(jl)},th=(n,i)=>{const c=[],m=w=>(c.push(w),i(w));let p=i(n);do p=p.bind(m);while(p.isSome());return c},Du=(n,i)=>{const c=n.dom;if(c.nodeType!==jf)return!1;{const m=c;if(m.matches!==void 0)return m.matches(i);if(m.msMatchesSelector!==void 0)return m.msMatchesSelector(i);if(m.webkitMatchesSelector!==void 0)return m.webkitMatchesSelector(i);if(m.mozMatchesSelector!==void 0)return m.mozMatchesSelector(i);throw new Error("Browser lacks native selectors")}},zg=n=>n.nodeType!==jf&&n.nodeType!==Gu&&n.nodeType!==Tc||n.childElementCount===0,U1=(n,i)=>{const c=i===void 0?document:i.dom;return zg(c)?[]:gt(c.querySelectorAll(n),Ge.fromDom)},Kh=(n,i)=>{const c=i===void 0?document:i.dom;return zg(c)?he.none():he.from(c.querySelector(n)).map(Ge.fromDom)},bt=(n,i)=>n.dom===i.dom,cn=(n,i)=>{const c=n.dom,m=i.dom;return c===m?!1:c.contains(m)},rn=n=>Ge.fromDom(n.dom.ownerDocument),Ao=n=>Qg(n)?n:rn(n),nr=n=>Ge.fromDom(Ao(n).dom.documentElement),Yr=n=>Ge.fromDom(Ao(n).dom.defaultView),fi=n=>he.from(n.dom.parentNode).map(Ge.fromDom),yi=n=>he.from(n.dom.parentElement).map(Ge.fromDom),nh=(n,i)=>{const c=ue(i)?i:Xe;let m=n.dom;const p=[];for(;m.parentNode!==null&&m.parentNode!==void 0;){const w=m.parentNode,x=Ge.fromDom(w);if(p.push(x),c(x)===!0)break;m=w}return p},Jb=n=>{const i=c=>Dt(c,m=>!bt(n,m));return fi(n).map(Da).map(i).getOr([])},Sa=n=>he.from(n.dom.previousSibling).map(Ge.fromDom),Td=n=>he.from(n.dom.nextSibling).map(Ge.fromDom),Vg=n=>Xs(th(n,Sa)),rl=n=>th(n,Td),Da=n=>gt(n.dom.childNodes,Ge.fromDom),ef=(n,i)=>{const c=n.dom.childNodes;return he.from(c[i]).map(Ge.fromDom)},ii=n=>ef(n,0),Pu=n=>ef(n,n.dom.childNodes.length-1),dc=n=>n.dom.childNodes.length,Jh=n=>n.dom.hasChildNodes(),Y1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ge.fromDom(i)},oh=n=>qf(n)&&ve(n.dom.host),Wg=ue(Element.prototype.attachShadow)&&ue(Node.prototype.getRootNode),sh=We(Wg),ql=Wg?n=>Ge.fromDom(n.dom.getRootNode()):Ao,em=n=>oh(n)?n:Y1(Ao(n)),X1=n=>oh(n)?n:Ge.fromDom(Ao(n).dom.body),Wm=n=>{const i=ql(n);return oh(i)?he.some(i):he.none()},Ug=n=>Ge.fromDom(n.dom.host),tm=n=>{if(sh()&&ve(n.target)){const i=Ge.fromDom(n.target);if(kl(i)&&rh(i)&&n.composed&&n.composedPath){const c=n.composedPath();if(c)return $o(c)}}return he.from(n.target)},rh=n=>ve(n.dom.shadowRoot),Ed=n=>{const i=ol(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const c=i.ownerDocument;return Wm(Ge.fromDom(i)).fold(()=>c.body.contains(i),ht(Ed,Ug))};var ai=(n,i,c,m,p)=>n(c,m)?he.some(c):ue(p)&&p(c)?he.none():i(c,m,p);const di=(n,i,c)=>{let m=n.dom;const p=ue(c)?c:Xe;for(;m.parentNode;){m=m.parentNode;const w=Ge.fromDom(m);if(i(w))return he.some(w);if(p(w))break}return he.none()},Zl=(n,i,c)=>ai((p,w)=>w(p),di,n,i,c),Vp=(n,i)=>{const c=n.dom;return c.parentNode?ee(Ge.fromDom(c.parentNode),m=>!bt(n,m)&&i(m)):he.none()},ee=(n,i)=>{const c=p=>i(Ge.fromDom(p));return oo(n.dom.childNodes,c).map(Ge.fromDom)},ce=(n,i)=>{const c=m=>{for(let p=0;pdi(n,m=>Du(m,i),c),Ke=(n,i)=>Kh(i,n),it=(n,i,c)=>ai((p,w)=>Du(p,w),Se,n,i,c),Pn=n=>it(n,"[contenteditable]"),_n=(n,i=!1)=>Ed(n)?n.dom.isContentEditable:Pn(n).fold(We(i),c=>Ko(c)==="true"),Ko=n=>n.dom.contentEditable,ss=n=>n.style!==void 0&&ue(n.style.getPropertyValue),ho=(n,i,c)=>{if(!L(c))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",c,":: Element ",n),new Error("CSS value must be a string: "+c);ss(n)&&n.style.setProperty(i,c)},Tr=(n,i)=>{ss(n)&&n.style.removeProperty(i)},Gl=(n,i,c)=>{const m=n.dom;ho(m,i,c)},ua=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{ho(c,p,m)})},Bi=(n,i)=>{const c=n.dom,p=window.getComputedStyle(c).getPropertyValue(i);return p===""&&!Ed(n)?Mu(c,i):p},Mu=(n,i)=>ss(n)?n.style.getPropertyValue(i):"",Pa=(n,i)=>{const c=n.dom,m=Mu(c,i);return he.from(m).filter(p=>p.length>0)},nm=n=>{const i={},c=n.dom;if(ss(c))for(let m=0;m{const c=n.dom;Tr(c,i),qr(za(n,"style").map(kc),"")&&Vi(n,"style")},Wi=n=>n.dom.offsetWidth,Ca=(n,i)=>{fi(n).each(m=>{m.dom.insertBefore(i.dom,n.dom)})},iu=(n,i)=>{Td(n).fold(()=>{fi(n).each(p=>{na(p,i)})},m=>{Ca(m,i)})},ih=(n,i)=>{ii(n).fold(()=>{na(n,i)},m=>{n.dom.insertBefore(i.dom,m.dom)})},na=(n,i)=>{n.dom.appendChild(i.dom)},e0=(n,i)=>{Ca(n,i),na(i,n)},Dv=(n,i)=>{Ne(i,(c,m)=>{const p=m===0?n:i[m-1];iu(p,c)})},ti=(n,i)=>{Ne(i,c=>{na(n,c)})},Ad=n=>{n.dom.textContent="",Ne(Da(n),i=>{wr(i)})},wr=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},Kl=n=>{const i=Da(n);i.length>0&&Dv(n,i),wr(n)},Jf=(n,i)=>{const m=(i||document).createElement("div");return m.innerHTML=n,Da(Ge.fromDom(m))},ah=n=>gt(n,Ge.fromDom),Te=n=>n.dom.innerHTML,Pf=(n,i)=>{const m=rn(n).dom,p=Ge.fromDom(m.createDocumentFragment()),w=Jf(i,m);ti(p,w),Ad(n),na(n,p)},Yg=n=>{const i=Ge.fromTag("div"),c=Ge.fromDom(n.dom.cloneNode(!0));return na(i,c),Te(i)},Ru=(n,i,c,m,p,w,x)=>({target:n,x:i,y:c,stop:m,prevent:p,kill:w,raw:x}),hi=n=>{const i=Ge.fromDom(tm(n).getOr(n.target)),c=()=>n.stopPropagation(),m=()=>n.preventDefault(),p=V(m,c);return Ru(i,n.clientX,n.clientY,c,m,p,n)},Pv=(n,i)=>c=>{n(c)&&i(hi(c))},j1=(n,i,c,m,p)=>{const w=Pv(c,m);return n.dom.addEventListener(i,w,p),{unbind:Re(ed,n,i,w,p)}},t0=(n,i,c,m)=>j1(n,i,c,m,!1),ed=(n,i,c,m)=>{n.dom.removeEventListener(i,c,m)},Ym=(n,i)=>({left:n,top:i,translate:(m,p)=>Ym(n+m,i+p)}),Xg=Ym,Mv=n=>{const i=n.getBoundingClientRect();return Xg(i.left,i.top)},Mf=(n,i)=>n!==void 0?n:i!==void 0?i:0,xy=n=>{const i=n.dom.ownerDocument,c=i.body,m=i.defaultView,p=i.documentElement;if(c===n.dom)return Xg(c.offsetLeft,c.offsetTop);const w=Mf(m==null?void 0:m.pageYOffset,p.scrollTop),x=Mf(m==null?void 0:m.pageXOffset,p.scrollLeft),R=Mf(p.clientTop,c.clientTop),B=Mf(p.clientLeft,c.clientLeft);return $u(n).translate(x-B,w-R)},$u=n=>{const i=n.dom,m=i.ownerDocument.body;return m===i?Xg(m.offsetLeft,m.offsetTop):Ed(n)?Mv(i):Xg(0,0)},tf=n=>{const i=n!==void 0?n.dom:document,c=i.body.scrollLeft||i.documentElement.scrollLeft,m=i.body.scrollTop||i.documentElement.scrollTop;return Xg(c,m)},n0=(n,i,c)=>{const p=(c!==void 0?c.dom:document).defaultView;p&&p.scrollTo(n,i)},o0=(n,i)=>{ys().browser.isSafari()&&ue(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},s0=n=>{const i=n===void 0?window:n;return ys().browser.isFirefox()?he.none():he.from(i.visualViewport)},q1=(n,i,c,m)=>({x:n,y:i,width:c,height:m,right:n+c,bottom:i+m}),td=n=>{const i=n===void 0?window:n,c=i.document,m=tf(Ge.fromDom(c));return s0(i).fold(()=>{const p=i.document.documentElement,w=p.clientWidth,x=p.clientHeight;return q1(m.left,m.top,w,x)},p=>q1(Math.max(p.pageLeft,m.left),Math.max(p.pageTop,m.top),p.width,p.height))},r0=(n,i)=>Dt(Da(n),i),i0=(n,i)=>{let c=[];return Ne(Da(n),m=>{i(m)&&(c=c.concat([m])),c=c.concat(i0(m,i))}),c},pl=(n,i)=>U1(i,n),Ty=(n,i,c)=>Se(n,i,c).isSome();class wi{constructor(i,c){this.node=i,this.rootNode=c,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(i){return this.node=this.findSibling(this.node,"firstChild","nextSibling",i),this.node}prev(i){return this.node=this.findSibling(this.node,"lastChild","previousSibling",i),this.node}prev2(i){return this.node=this.findPreviousNode(this.node,i),this.node}findSibling(i,c,m,p){if(i){if(!p&&i[c])return i[c];if(i!==this.rootNode){let w=i[m];if(w)return w;for(let x=i.parentNode;x&&x!==this.rootNode;x=x.parentNode)if(w=x[m],w)return w}}}findPreviousNode(i,c){if(i){const m=i.previousSibling;if(this.rootNode&&m===this.rootNode)return;if(m){if(!c){for(let w=m.lastChild;w;w=w.lastChild)if(!w.lastChild)return w}return m}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const lo=n=>i=>!!i&&i.nodeType===n,Dd=n=>!!n&&!Object.getPrototypeOf(n),Jn=lo(1),Ac=n=>{const i=n.toLowerCase();return c=>ve(c)&&c.nodeName.toLowerCase()===i},Rf=n=>{const i=n.map(c=>c.toLowerCase());return c=>{if(c&&c.nodeName){const m=c.nodeName.toLowerCase();return wt(i,m)}return!1}},lh=(n,i)=>{const c=i.toLowerCase().split(" ");return m=>{if(Jn(m)){const p=m.ownerDocument.defaultView;if(p)for(let w=0;wi=>Jn(i)&&i.hasAttribute(n),jg=(n,i)=>c=>Jn(c)&&c.getAttribute(n)===i,Pd=n=>Jn(n)&&n.hasAttribute("data-mce-bogus"),bl=n=>Jn(n)&&n.getAttribute("data-mce-bogus")==="all",Nu=n=>Jn(n)&&n.tagName==="TABLE",Wp=n=>i=>!!(Jn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),G1=Rf(["textarea","input"]),Sn=lo(3),Xm=lo(4),Md=lo(7),ch=lo(8),nf=lo(9),K1=lo(11),mi=Ac("br"),Ui=Ac("img"),ba=Wp("true"),Es=Wp("false"),Rd=Rf(["td","th"]),xl=Rf(["td","th","caption"]),of=Rf(["video","audio","object","embed"]),Va=Ac("li"),ka=Ac("details"),Up=Ac("summary"),nn="\uFEFF",Gr="\xA0",a0=n=>n===nn,xa=n=>n.replace(/\uFEFF/g,""),qg=((n,i)=>{const c=w=>{if(!n(w))throw new Error("Can only get "+i+" value of a "+i+" node");return m(w).getOr("")},m=w=>n(w)?he.from(w.dom.nodeValue):he.none();return{get:c,getOption:m,set:(w,x)=>{if(!n(w))throw new Error("Can only set raw "+i+" value of a "+i+" node");w.dom.nodeValue=x}}})(ol,"text"),Wc=n=>qg.get(n),nd=n=>qg.getOption(n),od=(n,i)=>qg.set(n,i),Yp=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],Hl=["td","th"],Er=["thead","tbody","tfoot"],Ua=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],uh=["h1","h2","h3","h4","h5","h6"],Jl=["li","dd","dt"],l0=["ul","ol","dl"],jm=["pre","script","textarea","style"],J1=["pre"].concat(uh),Ya=n=>{let i;return c=>(i=i||ur(n,_t),un(i,ei(c)))},hc=Ya(Yp),Tt=n=>ei(n)==="table",Dc=n=>kl(n)&&!hc(n),au=n=>kl(n)&&ei(n)==="br",mc=Ya(Ua),Iu=Ya(l0),Xa=Ya(Jl),ja=Ya(Er),qm=Ya(Hl),lu=Ya(jm),c0=Ya(J1),zo=n=>c0(n)||Dc(n),H=n=>{const i=[];let c=n.dom;for(;c;)i.push(Ge.fromDom(c)),c=c.lastChild;return i},q=n=>{const i=pl(n,"br"),c=Dt(H(n).slice(-1),au);i.length===c.length&&Ne(c,wr)},Oe=()=>{const n=Ge.fromTag("br");return Pr(n,"data-mce-bogus","1"),n},Ae=n=>{Ad(n),na(n,Oe())},lt=n=>{Pu(n).each(i=>{Sa(i).each(c=>{hc(n)&&au(i)&&hc(c)&&wr(i)})})},Ft=nn,Cn=a0,Bn=xa,Yo=Jn,ts=Sn,_i=n=>(ts(n)&&(n=n.parentNode),Yo(n)&&n.hasAttribute("data-mce-caret")),or=n=>ts(n)&&Cn(n.data),_r=n=>_i(n)||or(n),Uc=n=>n.firstChild!==n.lastChild||!mi(n.firstChild),cu=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft),w=n.parentNode;if(i){const x=n.previousSibling;if(ts(x)){if(_r(x))return x;if(fr(x))return x.splitText(x.data.length-1)}w==null||w.insertBefore(p,n)}else{const x=n.nextSibling;if(ts(x)){if(_r(x))return x;if(dh(x))return x.splitText(1),x}n.nextSibling?w==null||w.insertBefore(p,n.nextSibling):w==null||w.appendChild(p)}return p},sf=n=>{const i=n.container();return Sn(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&or(i.previousSibling):!1},$f=n=>{const i=n.container();return Sn(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&or(i.nextSibling):!1},fh=(n,i,c)=>{var m;const w=((m=i.ownerDocument)!==null&&m!==void 0?m:document).createElement(n);w.setAttribute("data-mce-caret",c?"before":"after"),w.setAttribute("data-mce-bogus","all"),w.appendChild(Oe().dom);const x=i.parentNode;return c?x==null||x.insertBefore(w,i):i.nextSibling?x==null||x.insertBefore(w,i.nextSibling):x==null||x.appendChild(w),w},dh=n=>ts(n)&&n.data[0]===Ft,fr=n=>ts(n)&&n.data[n.data.length-1]===Ft,Gm=n=>{var i;const c=n.getElementsByTagName("br"),m=c[c.length-1];Pd(m)&&((i=m.parentNode)===null||i===void 0||i.removeChild(m))},Km=n=>n&&n.hasAttribute("data-mce-caret")?(Gm(n),n.removeAttribute("data-mce-caret"),n.removeAttribute("data-mce-bogus"),n.removeAttribute("style"),n.removeAttribute("data-mce-style"),n.removeAttribute("_moz_abspos"),n):null,oa=n=>_i(n.startContainer),uu=ba,Xp=Es,Jm=mi,Ps=Sn,Fr=Rf(["script","style","textarea"]),Ma=Rf(["img","input","textarea","hr","iframe","video","audio","object","embed"]),gc=Rf(["table"]),eb=_r,Tl=n=>eb(n)?!1:Ps(n)?!Fr(n.parentNode):Ma(n)||Jm(n)||gc(n)||fu(n),Gi=n=>Jn(n)&&n.getAttribute("unselectable")==="true",fu=n=>!Gi(n)&&Xp(n),Nf=(n,i)=>{for(let c=n.parentNode;c&&c!==i;c=c.parentNode){if(fu(c))return!1;if(uu(c))return!0}return!0},Jw=n=>fu(n)?!zn(Rr(n.getElementsByTagName("*")),(i,c)=>i||uu(c),!1):!1,om=n=>Ma(n)||Jw(n),Gg=(n,i)=>Tl(n)&&Nf(n,i),sm=/^[ \t\r\n]*$/,eg=n=>sm.test(n),Kg=n=>{for(const i of n)if(!a0(i))return!1;return!0},u0=n=>" \f \v".indexOf(n)!==-1,rm=n=>n===` +`||n==="\r",Ra=(n,i)=>i=0?rm(n[i]):!1,hh=(n,i=4,c=!0,m=!0)=>{const p=xu(" ",i),w=n.replace(/\t/g,p);return zn(w,(R,B)=>u0(B)||B===Gr?R.pcIsSpace||R.str===""&&c||R.str.length===w.length-1&&m||Ra(w,R.str.length+1)?{pcIsSpace:!1,str:R.str+Gr}:{pcIsSpace:!0,str:R.str+" "}:{pcIsSpace:rm(B),str:R.str+B},{pcIsSpace:!1,str:""}).str},$d=(n,i)=>{const c=Ge.fromDom(i),m=Ge.fromDom(n);return Ty(m,"pre,code",Re(bt,c))},tg=(n,i)=>Sn(n)&&eg(n.data)&&!$d(n,i),ng=n=>Jn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),im=(n,i)=>Tl(n)&&!tg(n,i)||ng(n)||rf(n),rf=Vc("data-mce-bookmark"),f0=Vc("data-mce-bogus"),tb=jg("data-mce-bogus","all"),e_=(n,i)=>{let c=0;if(im(n,n))return!1;{let m=n.firstChild;if(!m)return!0;const p=new wi(m,n);do{if(i){if(tb(m)){m=p.next(!0);continue}if(f0(m)){m=p.next();continue}}if(mi(m)){c++,m=p.next();continue}if(im(m,n))return!1;m=p.next()}while(m);return c<=1}},$a=(n,i=!0)=>e_(n.dom,i),Jg="data-mce-block",og=n=>Dt(bs(n),i=>!/[A-Z]/.test(i)),du=n=>og(n).join(","),If=(n,i)=>ve(i.querySelector(n))?(i.setAttribute(Jg,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(Jg),!1),sg=(n,i)=>{const c=du(n.getTransparentElements()),m=du(n.getBlockElements());return Dt(i.querySelectorAll(c),p=>If(m,p))},mh=(n,i)=>{var c;const m=i?"lastChild":"firstChild";for(let p=n[m];p;p=p[m])if($a(Ge.fromDom(p))){(c=p.parentNode)===null||c===void 0||c.removeChild(p);return}},Bu=(n,i)=>{const c=document.createRange(),m=n.parentNode;if(m){c.setStartBefore(n),c.setEndBefore(i);const p=c.extractContents();mh(p,!0),c.setStartAfter(i),c.setEndAfter(n);const w=c.extractContents();mh(w,!1),$a(Ge.fromDom(p))||m.insertBefore(p,n),$a(Ge.fromDom(i))||m.insertBefore(i,n),$a(Ge.fromDom(w))||m.insertBefore(w,n),m.removeChild(n)}},Nd=(n,i,c)=>{const m=n.getBlockElements(),p=Ge.fromDom(i),w=R=>ei(R)in m,x=R=>bt(R,p);Ne(ah(c),R=>{di(R,w,x).each(B=>{const G=r0(R,ae=>w(ae)&&!n.isValidChild(ei(B),ei(ae)));if(G.length>0){const ae=yi(B);Ne(G,fe=>{di(fe,w,x).each(be=>{Bu(be.dom,fe.dom)})}),ae.each(fe=>sg(n,fe.dom))}})})},rg=(n,i,c)=>{Ne([...c,...ig(n,i)?[i]:[]],m=>Ne(pl(Ge.fromDom(m),m.nodeName.toLowerCase()),p=>{Iv(n,p.dom)&&Kl(p)}))},d0=(n,i)=>{const c=sg(n,i);Nd(n,i,c),rg(n,i,c)},Rv=(n,i)=>{if(Nv(n,i)){const c=du(n.getBlockElements());If(c,i)}},$v=(n,i,c)=>{const m=w=>bt(w,Ge.fromDom(i)),p=nh(Ge.fromDom(c),m);jr(p,p.length-2).filter(kl).fold(()=>d0(n,i),w=>d0(n,w.dom))},gh=n=>n.hasAttribute(Jg),ep=(n,i)=>un(n.getTransparentElements(),i),Nv=(n,i)=>Jn(i)&&ep(n,i.nodeName),ig=(n,i)=>Nv(n,i)&&gh(i),Iv=(n,i)=>Nv(n,i)&&!gh(i),sr=(n,i)=>i.type===1&&ep(n,i.name)&&L(i.attr(Jg)),Do=ys().browser,ph=n=>oo(n,kl),nb=n=>Do.isFirefox()&&ei(n)==="table"?ph(Da(n)).filter(i=>ei(i)==="caption").bind(i=>ph(rl(i)).map(c=>{const m=c.dom.offsetTop,p=i.dom.offsetTop,w=i.dom.offsetHeight;return m<=p?-w:0})).getOr(0):0,tp=(n,i)=>n.children&&wt(n.children,i),WC=(n,i,c)=>{let m=0,p=0;const w=n.ownerDocument;if(c=c||n,i){if(c===n&&i.getBoundingClientRect&&Bi(Ge.fromDom(n),"position")==="static"){const R=i.getBoundingClientRect();return m=R.left+(w.documentElement.scrollLeft||n.scrollLeft)-w.documentElement.clientLeft,p=R.top+(w.documentElement.scrollTop||n.scrollTop)-w.documentElement.clientTop,{x:m,y:p}}let x=i;for(;x&&x!==c&&x.nodeType&&!tp(x,c);){const R=x;m+=R.offsetLeft||0,p+=R.offsetTop||0,x=R.offsetParent}for(x=i.parentNode;x&&x!==c&&x.nodeType&&!tp(x,c);)m-=x.scrollLeft||0,p-=x.scrollTop||0,x=x.parentNode;p+=nb(Ge.fromDom(i))}return{x:m,y:p}},Bv=(n,i={})=>{let c=0;const m={},p=Ge.fromDom(n),w=Ao(p),x=De=>{i.referrerPolicy=De},R=De=>{i.contentCssCors=De},B=De=>{na(em(p),De)},G=De=>{const ze=em(p);Ke(ze,"#"+De).each(wr)},ae=De=>Oo(m,De).getOrThunk(()=>({id:"mce-u"+c++,passed:[],failed:[],count:0})),fe=De=>new Promise((ze,dt)=>{let vt;const St=hn._addCacheSuffix(De),Mt=ae(St);m[St]=Mt,Mt.count++;const dn=(Zt,yn)=>{Ne(Zt,An),Mt.status=yn,Mt.passed=[],Mt.failed=[],vt&&(vt.onload=null,vt.onerror=null,vt=null)},Hn=()=>dn(Mt.passed,2),Nn=()=>dn(Mt.failed,3);if(ze&&Mt.passed.push(ze),dt&&Mt.failed.push(dt),Mt.status===1)return;if(Mt.status===2){Hn();return}if(Mt.status===3){Nn();return}Mt.status=1;const Lt=Ge.fromTag("link",w.dom);Ku(Lt,{rel:"stylesheet",type:"text/css",id:Mt.id}),i.contentCssCors&&Pr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Pr(Lt,"referrerpolicy",i.referrerPolicy),vt=Lt.dom,vt.onload=Hn,vt.onerror=Nn,B(Lt),Pr(Lt,"href",St)}),be=De=>Promise.allSettled(gt(De,dt=>fe(dt).then(We(dt)))).then(dt=>{const vt=gn(dt,St=>St.status==="fulfilled");return vt.fail.length>0?Promise.reject(gt(vt.fail,St=>St.reason)):gt(vt.pass,St=>St.value)}),Be=De=>{const ze=hn._addCacheSuffix(De);Oo(m,ze).each(dt=>{--dt.count===0&&(delete m[ze],G(dt.id))})};return{load:fe,loadAll:be,unload:Be,unloadAll:De=>{Ne(De,ze=>{Be(ze)})},_setReferrerPolicy:x,_setContentCssCors:R}},Lv=(()=>{const n=new WeakMap;return{forElement:(c,m)=>{const w=ql(c).dom;return he.from(n.get(w)).getOrThunk(()=>{const x=Bv(w,m);return n.set(w,x),x})}}})(),ob=n=>n.nodeName.toLowerCase()==="span",Ey=(n,i)=>ve(n)&&(im(n,i)||Dc(Ge.fromDom(n))),on=(n,i)=>{const c=new wi(n,i).prev(!1),m=new wi(n,i).next(!1),p=_e(c)||Ey(c,i),w=_e(m)||Ey(m,i);return p&&w},Id=n=>ob(n)&&n.getAttribute("data-mce-type")==="bookmark",t_=(n,i)=>Sn(n)&&n.data.length>0&&on(n,i),h0=n=>Jn(n)?n.childNodes.length>0:!1,UC=n=>K1(n)||nf(n),ag=(n,i,c)=>{var m;const p=c||i;if(Jn(i)&&Id(i))return i;const w=i.childNodes;for(let x=w.length-1;x>=0;x--)ag(n,w[x],p);if(Jn(i)){const x=i.childNodes;x.length===1&&Id(x[0])&&((m=i.parentNode)===null||m===void 0||m.insertBefore(x[0],i))}return!UC(i)&&!im(i,p)&&!h0(i)&&!t_(i,p)&&n.remove(i),i},Ay=hn.makeMap,am=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Bd=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,lg=/[<>&\"\']/g,Si=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ld={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},Fd={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},hu={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qs=n=>{const i=Ge.fromTag("div").dom;return i.innerHTML=n,i.textContent||i.innerText||n},jp=(n,i)=>{const c={};if(n){const m=n.split(",");i=i||10;for(let p=0;pn.replace(i?am:Bd,c=>Fd[c]||c),YC=n=>(""+n).replace(lg,i=>Fd[i]||i),m0=(n,i)=>n.replace(i?am:Bd,c=>c.length>1?"&#"+((c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320)+65536)+";":Fd[c]||"&#"+c.charCodeAt(0)+";"),Fv=(n,i,c)=>{const m=c||bh;return n.replace(i?am:Bd,p=>Fd[p]||m[p]||p)},op={encodeRaw:np,encodeAllRaw:YC,encodeNumeric:m0,encodeNamed:Fv,getEncodeFunc:(n,i)=>{const c=jp(i)||bh,m=(x,R)=>x.replace(R?am:Bd,B=>Fd[B]!==void 0?Fd[B]:c[B]!==void 0?c[B]:B.length>1?"&#"+((B.charCodeAt(0)-55296)*1024+(B.charCodeAt(1)-56320)+65536)+";":"&#"+B.charCodeAt(0)+";"),p=(x,R)=>Fv(x,R,c),w=Ay(n.replace(/\+/g,","));return w.named&&w.numeric?m:w.named?i?p:Fv:w.numeric?m0:np},decode:n=>n.replace(Si,(i,c)=>c?(c.charAt(0).toLowerCase()==="x"?c=parseInt(c.substr(1),16):c=parseInt(c,10),c>65535?(c-=65536,String.fromCharCode(55296+(c>>10),56320+(c&1023))):Ld[c]||String.fromCharCode(c)):hu[i]||bh[i]||Qs(i))},Al=(n,i)=>(n=hn.trim(n),n?n.split(i||" "):[]),Dy=n=>new RegExp("^"+n.replace(/([?+*])/g,".$1")+"$"),ro=n=>{const i=/^(~)?(.+)$/;return Rs(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1]==="~",w=p?"span":"div",x=m[2];return[{inline:p,cloneName:w,name:x}]}else return[]})},Py=n=>{let i,c,m,p;if(i="id accesskey class dir lang style tabindex title role",c="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",m="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment",n!=="html4"){const w="a ins del canvas map";i+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",c+=" article aside details dialog figure main header footer hgroup section nav "+w,m+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"}return n!=="html5-strict"&&(i+=" xml:lang",m=[m,"acronym applet basefont big font strike tt"].join(" "),c=[c,"center dir isindex noframes"].join(" "),p=[c,m].join(" ")),p=p||[c,m].join(" "),{globalAttributes:i,blockContent:c,phrasingContent:m,flowContent:p}},XC=n=>{const{globalAttributes:i,phrasingContent:c,flowContent:m}=Py(n),p={},w=(R,B="",G="")=>{const ae=Al(G),fe=Al(R);let be=fe.length;for(;be--;){const Be=Al([i,B].join(" "));p[fe[be]]={attributes:ur(Be,We({})),attributesOrder:Be,children:ur(ae,We({}))}}},x=(R,B)=>{const G=Al(R),ae=Al(B);let fe=G.length;for(;fe--;){const be=p[G[fe]];for(let Be=0,Ye=ae.length;Be{w(G,"",c)}),Ne(Al("center dir isindex noframes"),G=>{w(G,"",m)})),w("html","manifest","head body"),w("head","","base command link meta noscript script style title"),w("title hr noscript br"),w("base","href target"),w("link","href rel media hreflang type sizes hreflang"),w("meta","name http-equiv content charset"),w("style","media type scoped"),w("script","src async defer type charset"),w("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",m),w("dd div","",m),w("address dt caption","",n==="html4"?c:m),w("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",c),w("blockquote","cite",m),w("ol","reversed start type","li"),w("ul","","li"),w("li","value",m),w("dl","","dt dd"),w("a","href target rel media hreflang type",n==="html4"?c:m),w("q","cite",c),w("ins del","cite datetime",m),w("img","src sizes srcset alt usemap ismap width height"),w("iframe","src name width height",m),w("embed","src type width height"),w("object","data type typemustmatch name usemap form width height",[m,"param"].join(" ")),w("param","name value"),w("map","name",[m,"area"].join(" ")),w("area","alt coords shape href target rel media hreflang type"),w("table","border","caption colgroup thead tfoot tbody tr"+(n==="html4"?" col":"")),w("colgroup","span","col"),w("col","span"),w("tbody thead tfoot","","tr"),w("tr","","td th"),w("td","colspan rowspan headers",m),w("th","colspan rowspan headers scope abbr",m),w("form","accept-charset action autocomplete enctype method name novalidate target",m),w("fieldset","disabled form name",[m,"legend"].join(" ")),w("label","form for",c),w("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),w("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",n==="html4"?m:c),w("select","disabled form multiple name required size","option optgroup"),w("optgroup","disabled label","option"),w("option","disabled label selected value"),w("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),w("menu","type label",[m,"li"].join(" ")),w("noscript","",m),n!=="html4"&&(w("wbr"),w("ruby","",[c,"rt rp"].join(" ")),w("figcaption","",m),w("mark rt rp summary bdi","",c),w("canvas","width height",m),w("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[m,"track source"].join(" ")),w("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[m,"track source"].join(" ")),w("picture","","img source"),w("source","src srcset type media sizes"),w("track","kind src srclang label default"),w("datalist","",[c,"option"].join(" ")),w("article section nav aside main header footer","",m),w("hgroup","","h1 h2 h3 h4 h5 h6"),w("figure","",[m,"figcaption"].join(" ")),w("time","datetime",c),w("dialog","open",m),w("command","type label icon disabled checked radiogroup command"),w("output","for form name",c),w("progress","value max",c),w("meter","value min max low high optimum",c),w("details","open",[m,"summary"].join(" ")),w("keygen","autofocus challenge disabled form keytype name")),n!=="html5-strict"&&(x("script","language xml:space"),x("style","xml:space"),x("object","declare classid code codebase codetype archive standby align border hspace vspace"),x("embed","align name hspace vspace"),x("param","valuetype type"),x("a","charset name rev shape coords"),x("br","clear"),x("applet","codebase archive code object alt name width height align hspace vspace"),x("img","name longdesc align border hspace vspace"),x("iframe","longdesc frameborder marginwidth marginheight scrolling align"),x("font basefont","size color face"),x("input","usemap align"),x("select"),x("textarea"),x("h1 h2 h3 h4 h5 h6 div p legend caption","align"),x("ul","type compact"),x("li","type"),x("ol dl menu dir","compact"),x("pre","width xml:space"),x("hr","align noshade size width"),x("isindex","prompt"),x("table","summary width frame rules cellspacing cellpadding align bgcolor"),x("col","width align char charoff valign"),x("colgroup","width align char charoff valign"),x("thead","align char charoff valign"),x("tr","align char charoff valign bgcolor"),x("th","axis align char charoff valign nowrap bgcolor width height"),x("form","accept"),x("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),x("tfoot","align char charoff valign"),x("tbody","align char charoff valign"),x("area","nohref"),x("body","background bgcolor text link vlink alink")),n!=="html4"&&(x("input button select textarea","autofocus"),x("input textarea","placeholder"),x("a","download"),x("link script img","crossorigin"),x("img","loading"),x("iframe","sandbox seamless allow allowfullscreen loading")),n!=="html4"&&Ne([p.video,p.audio],R=>{delete R.children.audio,delete R.children.video}),Ne(Al("a form meter progress dfn"),R=>{p[R]&&delete p[R].children[R]}),delete p.caption.children.table,delete p.script,p},My=n=>n==="-"?"remove":"add",lm=n=>{const i=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return Rs(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1],w=p?My(p):"replace",x=m[2],R=Al(m[3],"|");return[{operation:w,name:x,validChildren:R}]}else return[]})},af=(n,i)=>{const c=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,m=/[*?+]/,{attributes:p,attributesOrder:w}=i;return Ne(Al(n,"|"),x=>{const R=c.exec(x);if(R){const B={},G=R[1],ae=R[2].replace(/[\\:]:/g,":"),fe=R[3],be=R[4];if(G==="!"&&(i.attributesRequired=i.attributesRequired||[],i.attributesRequired.push(ae),B.required=!0),G==="-"){delete p[ae],w.splice(hn.inArray(w,ae),1);return}if(fe&&(fe==="="?(i.attributesDefault=i.attributesDefault||[],i.attributesDefault.push({name:ae,value:be}),B.defaultValue=be):fe==="~"?(i.attributesForced=i.attributesForced||[],i.attributesForced.push({name:ae,value:be}),B.forcedValue=be):fe==="<"&&(B.validValues=hn.makeMap(be,"?"))),m.test(ae)){const Be=B;i.attributePatterns=i.attributePatterns||[],Be.pattern=Dy(ae),i.attributePatterns.push(Be)}else p[ae]||w.push(ae),p[ae]=B}})},vh=(n,i)=>{ln(n.attributes,(c,m)=>{i.attributes[m]=c}),i.attributesOrder.push(...n.attributesOrder)},sp=(n,i)=>{const c=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return Rs(Al(i,","),m=>{const p=c.exec(m);if(p){const w=p[1],x=p[2],R=p[3],B=p[4],G=p[5],ae={attributes:{},attributesOrder:[]};if(n.each(fe=>vh(fe,ae)),w==="#"?ae.paddEmpty=!0:w==="-"&&(ae.removeEmpty=!0),B==="!"&&(ae.removeEmptyAttrs=!0),G&&af(G,ae),R&&(ae.outputName=x),x==="@")if(n.isNone())n=he.some(ae);else return[];return[R?{name:x,element:ae,aliasName:R}:{name:x,element:ae}]}else return[]})},Oh={},g0=hn.makeMap,Bf=hn.each,rp=hn.extend,Ry=hn.explode,qp=(n,i={})=>{const c=g0(n," ",g0(n.toUpperCase()," "));return rp(c,i)},sd=n=>qp("td th li dt dd figcaption caption details summary",n.getTextBlockElements()),$y=(n,i)=>{if(n){const c={};return L(n)&&(n={"*":n}),Bf(n,(m,p)=>{c[p]=c[p.toUpperCase()]=i==="map"?g0(m,/[, ]/):Ry(m,/[, ]/)}),c}else return},yh=(n={})=>{var i;const c={},m={};let p=[];const w={},x={},R=(co,Us,ci)=>{const Ka=n[co];if(Ka)return g0(Ka,/[, ]/,g0(Ka.toUpperCase(),/[, ]/));{let Ti=Oh[co];return Ti||(Ti=qp(Us,ci),Oh[co]=Ti),Ti}},B=(i=n.schema)!==null&&i!==void 0?i:"html5",G=XC(B);n.verify_html===!1&&(n.valid_elements="*[*]");const ae=$y(n.valid_styles),fe=$y(n.invalid_styles,"map"),be=$y(n.valid_classes,"map"),Be=R("whitespace_elements","pre script noscript style textarea video audio iframe object code"),Ye=R("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),De=R("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),ze=R("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),dt="td th iframe video audio object script code",vt=R("non_empty_elements",dt+" pre",De),St=R("move_caret_before_on_enter_elements",dt+" table",De),Mt=R("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),dn=R("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",Mt),Hn=R("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),Nn=R("transparent_elements","a ins del canvas map");Bf("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),co=>{x[co]=new RegExp("]*>","gi")});const Lt=co=>{const Us=he.from(c["@"]),ci=/[*?+]/;Ne(sp(Us,co!=null?co:""),({name:Ka,element:Ti,aliasName:$c})=>{if($c&&(c[$c]=Ti),ci.test(Ka)){const Fh=Ti;Fh.pattern=Dy(Ka),p.push(Fh)}else c[Ka]=Ti})},Zt=co=>{p=[],Ne(bs(c),Us=>{delete c[Us]}),Lt(co)},yn=co=>{delete Oh.text_block_elements,delete Oh.block_elements,Ne(ro(co!=null?co:""),({inline:Us,name:ci,cloneName:Ka})=>{if(m[ci]=m[Ka],w[ci]=Ka,vt[ci.toUpperCase()]={},vt[ci]={},Us||(dn[ci.toUpperCase()]={},dn[ci]={}),!c[ci]){let Ti=c[Ka];Ti=rp({},Ti),delete Ti.removeEmptyAttrs,delete Ti.removeEmpty,c[ci]=Ti}ln(m,(Ti,$c)=>{Ti[Ka]&&(m[$c]=Ti=rp({},m[$c]),Ti[ci]=Ti[Ka])})})},go=co=>{Ne(lm(co!=null?co:""),({operation:Us,name:ci,validChildren:Ka})=>{const Ti=Us==="replace"?{"#comment":{}}:m[ci];Ne(Ka,$c=>{Us==="remove"?delete Ti[$c]:Ti[$c]={}}),m[ci]=Ti})},Po=co=>{const Us=c[co];if(Us)return Us;let ci=p.length;for(;ci--;){const Ka=p[ci];if(Ka.pattern.test(co))return Ka}};n.valid_elements?(Zt(n.valid_elements),Bf(G,(co,Us)=>{m[Us]=co.children})):(Bf(G,(co,Us)=>{c[Us]={attributes:co.attributes,attributesOrder:co.attributesOrder},m[Us]=co.children}),Bf(Al("strong/b em/i"),co=>{const Us=Al(co,"/");c[Us[1]].outputName=Us[0]}),Bf(Hn,(co,Us)=>{c[Us]&&(n.padd_empty_block_inline_children&&(c[Us].paddInEmptyBlock=!0),c[Us].removeEmpty=!0)}),Bf(Al("ol ul blockquote a table tbody"),co=>{c[co]&&(c[co].removeEmpty=!0)}),Bf(Al("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),co=>{c[co]&&(c[co].paddEmpty=!0)}),Bf(Al("span"),co=>{c[co].removeEmptyAttrs=!0})),yn(n.custom_elements),go(n.valid_children),Lt(n.extended_valid_elements),go("+ol[ul|ol],+ul[ul|ol]"),Bf({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(co,Us)=>{c[Us]&&(c[Us].parentsRequired=Al(co))}),n.invalid_elements&&Bf(Ry(n.invalid_elements),co=>{c[co]&&delete c[co]}),Po("span")||Lt("span[!data-mce-type|*]");const Cs=We(ae),Ws=We(fe),Ir=We(be),pi=We(ze),ul=We(dn),Il=We(Mt),Oc=We(Hn),Mn=We(Object.seal(De)),eo=We(Ye),Cr=We(vt),Is=We(St),ko=We(Be),Rn=We(Nn),En=We(Object.seal(x)),jo=(co,Us)=>{const ci=m[co.toLowerCase()];return!!(ci&&ci[Us.toLowerCase()])},Ks=(co,Us)=>{const ci=Po(co);if(ci)if(Us){if(ci.attributes[Us])return!0;const Ka=ci.attributePatterns;if(Ka){let Ti=Ka.length;for(;Ti--;)if(Ka[Ti].pattern.test(Us))return!0}}else return!0;return!1},Kr=We(w);return{type:B,children:m,elements:c,getValidStyles:Cs,getValidClasses:Ir,getBlockElements:ul,getInvalidStyles:Ws,getVoidElements:Mn,getTextBlockElements:Il,getTextInlineElements:Oc,getBoolAttrs:pi,getElementRule:Po,getSelfClosingElements:eo,getNonEmptyElements:Cr,getMoveCaretBeforeOnEnterElements:Is,getWhitespaceElements:ko,getTransparentElements:Rn,getSpecialElements:En,isValidChild:jo,isValid:Ks,getCustomElements:Kr,addValidElements:Lt,setValidElements:Zt,addCustomElements:yn,addValidChildren:go}},Qv=(n={},i)=>{const c=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,m=/\s*([^:]+):\s*([^;]+);?/g,p=/\s+$/,w={};let x,R;const B=nn;i&&(x=i.getValidStyles(),R=i.getInvalidStyles());const G=(`\\" \\' \\; \\: ; : `+B).split(" ");for(let fe=0;fe{const be={};let Be=!1;const Ye=n.url_converter,De=n.url_converter_scope||ae,ze=(Lt,Zt,yn)=>{const go=be[Lt+"-top"+Zt];if(!go)return;const Po=be[Lt+"-right"+Zt];if(!Po)return;const Cs=be[Lt+"-bottom"+Zt];if(!Cs)return;const Ws=be[Lt+"-left"+Zt];if(!Ws)return;const Ir=[go,Po,Cs,Ws];let pi=Ir.length-1;for(;pi--&&Ir[pi]===Ir[pi+1];);pi>-1&&yn||(be[Lt+Zt]=pi===-1?Ir[0]:Ir.join(" "),delete be[Lt+"-top"+Zt],delete be[Lt+"-right"+Zt],delete be[Lt+"-bottom"+Zt],delete be[Lt+"-left"+Zt])},dt=Lt=>{const Zt=be[Lt];if(!Zt)return;const yn=Zt.indexOf(",")>-1?[Zt]:Zt.split(" ");let go=yn.length;for(;go--;)if(yn[go]!==yn[0])return!1;return be[Lt]=yn[0],!0},vt=(Lt,Zt,yn,go)=>{!dt(Zt)||!dt(yn)||!dt(go)||(be[Lt]=be[Zt]+" "+be[yn]+" "+be[go],delete be[Zt],delete be[yn],delete be[go])},St=Lt=>(Be=!0,w[Lt]),Mt=(Lt,Zt)=>(Be&&(Lt=Lt.replace(/\uFEFF[0-9]/g,yn=>w[yn])),Zt||(Lt=Lt.replace(/\\([\'\";:])/g,"$1")),Lt),dn=Lt=>String.fromCharCode(parseInt(Lt.slice(1),16)),Hn=Lt=>Lt.replace(/\\[0-9a-f]+/gi,dn),Nn=(Lt,Zt,yn,go,Po,Cs)=>{if(Po=Po||Cs,Po)return Po=Mt(Po),"'"+Po.replace(/\'/g,"\\'")+"'";if(Zt=Mt(Zt||yn||go||""),!n.allow_script_urls){const Ws=Zt.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(Ws)||!n.allow_svg_data_urls&&/^data:image\/svg/i.test(Ws))return""}return Ye&&(Zt=Ye.call(De,Zt,"style")),"url('"+Zt.replace(/\'/g,"\\'")+"')"};if(fe){fe=fe.replace(/[\u0000-\u001F]/g,""),fe=fe.replace(/\\[\"\';:\uFEFF]/g,St).replace(/\"[^\"]+\"|\'[^\']+\'/g,Zt=>Zt.replace(/[;:]/g,St));let Lt;for(;Lt=m.exec(fe);){m.lastIndex=Lt.index+Lt[0].length;let Zt=Lt[1].replace(p,"").toLowerCase(),yn=Lt[2].replace(p,"");if(Zt&&yn){if(Zt=Hn(Zt),yn=Hn(yn),Zt.indexOf(B)!==-1||Zt.indexOf('"')!==-1||!n.allow_script_urls&&(Zt==="behavior"||/expression\s*\(|\/\*|\*\//.test(yn)))continue;Zt==="font-weight"&&yn==="700"?yn="bold":(Zt==="color"||Zt==="background-color")&&(yn=yn.toLowerCase()),yn=yn.replace(c,Nn),be[Zt]=Be?Mt(yn,!0):yn}}ze("border","",!0),ze("border","-width"),ze("border","-color"),ze("border","-style"),ze("padding",""),ze("margin",""),vt("border","border-width","border-style","border-color"),be.border==="medium none"&&delete be.border,be["border-image"]==="none"&&delete be["border-image"]}return be},serialize:(fe,be)=>{let Be="";const Ye=(ze,dt)=>{const vt=dt[ze];if(vt)for(let St=0,Mt=vt.length;St0?" ":"")+dn+": "+Hn+";")}},De=(ze,dt)=>{if(!R||!dt)return!0;let vt=R["*"];return vt&&vt[ze]?!1:(vt=R[dt],!(vt&&vt[ze]))};return be&&x?(Ye("*",x),Ye(be,x)):ln(fe,(ze,dt)=>{ze&&De(dt,be)&&(Be+=(Be.length>0?" ":"")+dt+": "+ze+";")}),Be}};return ae},n_={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ny=n=>n instanceof Event||ue(n.initEvent),ip=n=>n.isDefaultPrevented===_t||n.isDefaultPrevented===Xe,Lf=n=>Le(n.preventDefault)||Ny(n),mu=(n,i)=>{const c=i!=null?i:{};for(const m in n)un(n_,m)||(c[m]=n[m]);return ve(n.composedPath)&&(c.composedPath=()=>n.composedPath()),c},ap=(n,i,c,m)=>{var p;const w=mu(i,m);return w.type=n,Le(w.target)&&(w.target=(p=w.srcElement)!==null&&p!==void 0?p:c),Lf(i)&&(w.preventDefault=()=>{w.defaultPrevented=!0,w.isDefaultPrevented=_t,ue(i.preventDefault)&&i.preventDefault()},w.stopPropagation=()=>{w.cancelBubble=!0,w.isPropagationStopped=_t,ue(i.stopPropagation)&&i.stopPropagation()},w.stopImmediatePropagation=()=>{w.isImmediatePropagationStopped=_t,w.stopPropagation()},ip(w)||(w.isDefaultPrevented=w.defaultPrevented===!0?_t:Xe,w.isPropagationStopped=w.cancelBubble===!0?_t:Xe,w.isImmediatePropagationStopped=Xe)),w},Iy="mce-data-",o_=/^(?:mouse|contextmenu)|click/,p0=(n,i,c,m)=>{n.addEventListener(i,c,m||!1)},Yc=(n,i,c,m)=>{n.removeEventListener(i,c,m||!1)},b0=n=>ve(n)&&o_.test(n.type),lf=(n,i)=>{const c=ap(n.type,n,document,i);if(b0(n)&&_e(n.pageX)&&!_e(n.clientX)){const m=c.target.ownerDocument||document,p=m.documentElement,w=m.body,x=c;x.pageX=n.clientX+(p&&p.scrollLeft||w&&w.scrollLeft||0)-(p&&p.clientLeft||w&&w.clientLeft||0),x.pageY=n.clientY+(p&&p.scrollTop||w&&w.scrollTop||0)-(p&&p.clientTop||w&&w.clientTop||0)}return c},lp=(n,i,c)=>{const m=n.document,p={type:"ready"};if(c.domLoaded){i(p);return}const w=()=>m.readyState==="complete"||m.readyState==="interactive"&&m.body,x=()=>{Yc(n,"DOMContentLoaded",x),Yc(n,"load",x),c.domLoaded||(c.domLoaded=!0,i(p)),n=null};w()?x():p0(n,"DOMContentLoaded",x),c.domLoaded||p0(n,"load",x)};class cm{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Iy+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(i,c,m,p){const w=this;let x;const R=window,B=be=>{w.executeHandlers(lf(be||R.event),G)};if(!i||Sn(i)||ch(i))return m;let G;i[w.expando]?G=i[w.expando]:(G=w.count++,i[w.expando]=G,w.events[G]={}),p=p||i;const ae=c.split(" ");let fe=ae.length;for(;fe--;){let be=ae[fe],Be=B,Ye=!1,De=!1;if(be==="DOMContentLoaded"&&(be="ready"),w.domLoaded&&be==="ready"&&i.readyState==="complete"){m.call(p,lf({type:be}));continue}!w.hasFocusIn&&(be==="focusin"||be==="focusout")&&(Ye=!0,De=be==="focusin"?"focus":"blur",Be=ze=>{const dt=lf(ze||R.event);dt.type=dt.type==="focus"?"focusin":"focusout",w.executeHandlers(dt,G)}),x=w.events[G][be],x?be==="ready"&&w.domLoaded?m(lf({type:be})):x.push({func:m,scope:p}):(w.events[G][be]=x=[{func:m,scope:p}],x.fakeName=De,x.capture=Ye,x.nativeHandler=Be,be==="ready"?lp(i,Be,w):p0(i,De||be,Be,Ye))}return i=x=null,m}unbind(i,c,m){if(!i||Sn(i)||ch(i))return this;const p=i[this.expando];if(p){let w=this.events[p];if(c){const x=c.split(" ");let R=x.length;for(;R--;){const B=x[R],G=w[B];if(G){if(m){let ae=G.length;for(;ae--;)if(G[ae].func===m){const fe=G.nativeHandler,be=G.fakeName,Be=G.capture,Ye=G.slice(0,ae).concat(G.slice(ae+1));Ye.nativeHandler=fe,Ye.fakeName=be,Ye.capture=Be,w[B]=Ye}}(!m||G.length===0)&&(delete w[B],Yc(i,G.fakeName||B,G.nativeHandler,G.capture))}}}else ln(w,(x,R)=>{Yc(i,x.fakeName||R,x.nativeHandler,x.capture)}),w={};for(const x in w)if(un(w,x))return this;delete this.events[p];try{delete i[this.expando]}catch{i[this.expando]=null}}return this}fire(i,c,m){return this.dispatch(i,c,m)}dispatch(i,c,m){if(!i||Sn(i)||ch(i))return this;const p=lf({type:c,target:i},m);do{const w=i[this.expando];w&&this.executeHandlers(p,w),i=i.parentNode||i.ownerDocument||i.defaultView||i.parentWindow}while(i&&!p.isPropagationStopped());return this}clean(i){if(!i||Sn(i)||ch(i))return this;if(i[this.expando]&&this.unbind(i),i.getElementsByTagName||(i=i.document),i&&i.getElementsByTagName){this.unbind(i);const c=i.getElementsByTagName("*");let m=c.length;for(;m--;)i=c[m],i[this.expando]&&this.unbind(i)}return this}destroy(){this.events={}}cancel(i){return i&&(i.preventDefault(),i.stopImmediatePropagation()),!1}executeHandlers(i,c){const m=this.events[c],p=m&&m[i.type];if(p)for(let w=0,x=p.length;w{Le(c)||c===""?Vi(n,i):Pr(n,i,c)},v0=n=>n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),sb=(n,i)=>{let c=0;if(n)for(let m=n.nodeType,p=n.previousSibling;p;p=p.previousSibling){const w=p.nodeType;i&&Sn(p)&&(w===m||!p.data.length)||(c++,m=w)}return c},Ly=(n,i)=>{const c=Fl(i,"style"),m=n.serialize(n.parse(c),ei(i));cp(i,Gp,m)},Fy=(n,i)=>ot(n)?un(By,i)?n+"":n+"px":n,r_=(n,i,c)=>{const m=v0(i);Le(c)||c===""?Um(n,m):Gl(n,m,Fy(c,m))},jC=(n,i,c)=>{const m=i.keep_values,p={set:(x,R,B)=>{const G=Ge.fromDom(x);ue(i.url_converter)&&ve(R)&&(R=i.url_converter.call(i.url_converter_scope||c(),String(R),B,x));const ae="data-mce-"+B;cp(G,ae,R),cp(G,B,R)},get:(x,R)=>{const B=Ge.fromDom(x);return Fl(B,"data-mce-"+R)||Fl(B,R)}},w={style:{set:(x,R)=>{const B=Ge.fromDom(x);m&&cp(B,Gp,R),Vi(B,"style"),L(R)&&ua(B,n.parse(R))},get:x=>{const R=Ge.fromDom(x),B=Fl(R,Gp)||Fl(R,"style");return n.serialize(n.parse(B),ei(R))}}};return m&&(w.href=w.src=p),w},Qr=(n,i={})=>{const c={},m=window,p={};let w=0;const x=!0,R=!0,B=Lv.forElement(Ge.fromDom(n),{contentCssCors:i.contentCssCors,referrerPolicy:i.referrerPolicy}),G=[],ae=i.schema?i.schema:yh({}),fe=Qv({url_converter:i.url_converter,url_converter_scope:i.url_converter_scope},i.schema),be=i.ownEvents?new cm:cm.Event,Be=ae.getBlockElements(),Ye=Rt=>L(Rt)?un(Be,Rt):Jn(Rt)&&(un(Be,Rt.nodeName)||ig(ae,Rt)),De=Rt=>Rt&&n&&L(Rt)?n.getElementById(Rt):Rt,ze=Rt=>{const $t=De(Rt);return ve($t)?Ge.fromDom($t):null},dt=(Rt,$t,$n="")=>{let xn;const Io=ze(Rt);if(ve(Io)&&kl(Io)){const br=Rw[$t];br&&br.get?xn=br.get(Io.dom,$t):xn=Fl(Io,$t)}return ve(xn)?xn:$n},vt=Rt=>{const $t=De(Rt);return Le($t)?[]:$t.attributes},St=(Rt,$t,$n)=>{eo(Rt,xn=>{if(Jn(xn)){const Io=Ge.fromDom(xn),br=$n===""?null:$n,ha=Fl(Io,$t),Nc=Rw[$t];Nc&&Nc.set?Nc.set(Io.dom,br,$t):cp(Io,$t,br),ha!==br&&i.onSetAttrib&&i.onSetAttrib({attrElm:Io.dom,attrName:$t,attrValue:br})}})},Mt=(Rt,$t)=>Rt.cloneNode($t),dn=()=>i.root_element||n.body,Hn=Rt=>{const $t=td(Rt);return{x:$t.x,y:$t.y,w:$t.width,h:$t.height}},Nn=(Rt,$t)=>WC(n.body,De(Rt),$t),Lt=(Rt,$t,$n)=>{eo(Rt,xn=>{const Io=Ge.fromDom(xn);r_(Io,$t,$n),i.update_styles&&Ly(fe,Io)})},Zt=(Rt,$t)=>{eo(Rt,$n=>{const xn=Ge.fromDom($n);ln($t,(Io,br)=>{r_(xn,br,Io)}),i.update_styles&&Ly(fe,xn)})},yn=(Rt,$t,$n)=>{const xn=De(Rt);if(!(Le(xn)||!Jn(xn)))return $n?Bi(Ge.fromDom(xn),v0($t)):($t=$t.replace(/-(\D)/g,(Io,br)=>br.toUpperCase()),$t==="float"&&($t="cssFloat"),xn.style?xn.style[$t]:void 0)},go=Rt=>{const $t=De(Rt);if(!$t)return{w:0,h:0};let $n=yn($t,"width"),xn=yn($t,"height");return(!$n||$n.indexOf("px")===-1)&&($n="0"),(!xn||xn.indexOf("px")===-1)&&(xn="0"),{w:parseInt($n,10)||$t.offsetWidth||$t.clientWidth,h:parseInt(xn,10)||$t.offsetHeight||$t.clientHeight}},Po=Rt=>{const $t=De(Rt),$n=Nn($t),xn=go($t);return{x:$n.x,y:$n.y,w:xn.w,h:xn.h}},Cs=(Rt,$t)=>{if(!Rt)return!1;const $n=oe(Rt)?Rt:[Rt];return Wt($n,xn=>Du(Ge.fromDom(xn),$t))},Ws=(Rt,$t,$n,xn)=>{const Io=[];let br=De(Rt);xn=xn===void 0;const ha=$n||(dn().nodeName!=="BODY"?dn().parentNode:null);if(L($t))if($t==="*")$t=Jn;else{const Nc=$t;$t=_u=>Cs(_u,Nc)}for(;br&&!(br===ha||Le(br.nodeType)||nf(br)||K1(br));){if(!$t||$t(br))if(xn)Io.push(br);else return[br];br=br.parentNode}return xn?Io:null},Ir=(Rt,$t,$n)=>{const xn=Ws(Rt,$t,$n,!1);return xn&&xn.length>0?xn[0]:null},pi=(Rt,$t,$n)=>{let xn=$t;if(Rt){L($t)&&(xn=Io=>Cs(Io,$t));for(let Io=Rt[$n];Io;Io=Io[$n])if(ue(xn)&&xn(Io))return Io}return null},ul=(Rt,$t)=>pi(Rt,$t,"nextSibling"),Il=(Rt,$t)=>pi(Rt,$t,"previousSibling"),Oc=Rt=>ue(Rt.querySelectorAll),Mn=(Rt,$t)=>{var $n,xn;const Io=(xn=($n=De($t))!==null&&$n!==void 0?$n:i.root_element)!==null&&xn!==void 0?xn:n;return Oc(Io)?Rr(Io.querySelectorAll(Rt)):[]},eo=function(Rt,$t,$n){const xn=$n!=null?$n:this;if(oe(Rt)){const Io=[];return Zv(Rt,(br,ha)=>{const Nc=De(br);Nc&&Io.push($t.call(xn,Nc,ha))}),Io}else{const Io=De(Rt);return Io?$t.call(xn,Io):!1}},Cr=(Rt,$t)=>{eo(Rt,$n=>{ln($t,(xn,Io)=>{St($n,Io,xn)})})},Is=(Rt,$t)=>{eo(Rt,$n=>{const xn=Ge.fromDom($n);Pf(xn,$t)})},ko=(Rt,$t,$n,xn,Io)=>eo(Rt,br=>{const ha=L($t)?n.createElement($t):$t;return ve($n)&&Cr(ha,$n),xn&&(!L(xn)&&xn.nodeType?ha.appendChild(xn):L(xn)&&Is(ha,xn)),Io?ha:br.appendChild(ha)}),Rn=(Rt,$t,$n)=>ko(n.createElement(Rt),Rt,$t,$n,!0),En=op.decode,jo=op.encodeAllRaw,Ks=(Rt,$t,$n="")=>{let xn="<"+Rt;for(const Io in $t)os($t,Io)&&(xn+=" "+Io+'="'+jo($t[Io])+'"');return nl($n)&&un(ae.getVoidElements(),Rt)?xn+" />":xn+">"+$n+""},Kr=Rt=>{const $t=n.createElement("div"),$n=n.createDocumentFragment();$n.appendChild($t),Rt&&($t.innerHTML=Rt);let xn;for(;xn=$t.firstChild;)$n.appendChild(xn);return $n.removeChild($t),$n},co=(Rt,$t)=>eo(Rt,$n=>{const xn=Ge.fromDom($n);return $t&&Ne(Da(xn),Io=>{ol(Io)&&Io.dom.length===0?wr(Io):Ca(xn,Io)}),wr(xn),xn.dom}),Us=Rt=>eo(Rt,$t=>{const $n=$t.attributes;for(let xn=$n.length-1;xn>=0;xn--)$t.removeAttributeNode($n.item(xn))}),ci=Rt=>fe.parse(Rt),Ka=(Rt,$t)=>fe.serialize(Rt,$t),Ti=Rt=>{if(E1!==Qr.DOM&&n===document){if(c[Rt])return;c[Rt]=!0}let $t=n.getElementById("mceDefaultStyles");if(!$t){$t=n.createElement("style"),$t.id="mceDefaultStyles",$t.type="text/css";const $n=n.head;$n.firstChild?$n.insertBefore($t,$n.firstChild):$n.appendChild($t)}$t.styleSheet?$t.styleSheet.cssText+=Rt:$t.appendChild(n.createTextNode(Rt))},$c=Rt=>{Rt||(Rt=""),Ne(Rt.split(","),$t=>{p[$t]=!0,B.load($t).catch(mt)})},Fh=(Rt,$t,$n)=>{eo(Rt,xn=>{if(Jn(xn)){const Io=Ge.fromDom(xn),br=$t.split(" ");Ne(br,ha=>{ve($n)?($n?Ju:zc)(Io,ha):Gh(Io,ha)})}})},qd=(Rt,$t)=>{Fh(Rt,$t,!0)},Dm=(Rt,$t)=>{Fh(Rt,$t,!1)},qO=(Rt,$t)=>{const $n=ze(Rt),xn=$t.split(" ");return ve($n)&&er(xn,Io=>Df($n,Io))},Pw=Rt=>{eo(Rt,$t=>Um(Ge.fromDom($t),"display"))},GO=Rt=>{eo(Rt,$t=>Gl(Ge.fromDom($t),"display","none"))},KO=Rt=>{const $t=ze(Rt);return ve($t)&&qr(Pa($t,"display"),"none")},Z4=Rt=>(Rt||"mce_")+w++,H4=Rt=>{const $t=ze(Rt);return ve($t)?Jn($t.dom)?$t.dom.outerHTML:Yg($t):""},z4=(Rt,$t)=>{eo(Rt,$n=>{Jn($n)&&($n.outerHTML=$t)})},FT=(Rt,$t)=>{const $n=De($t);return eo(Rt,xn=>{const Io=$n==null?void 0:$n.parentNode,br=$n==null?void 0:$n.nextSibling;return Io&&(br?Io.insertBefore(xn,br):Io.appendChild(xn)),xn})},QT=(Rt,$t,$n)=>eo($t,xn=>{var Io;const br=oe($t)?Rt.cloneNode(!0):Rt;return $n&&Zv(s_(xn.childNodes),ha=>{br.appendChild(ha)}),(Io=xn.parentNode)===null||Io===void 0||Io.replaceChild(br,xn),xn}),ZT=(Rt,$t)=>{if(Rt.nodeName!==$t.toUpperCase()){const $n=Rn($t);return Zv(vt(Rt),xn=>{St($n,xn.nodeName,dt(Rt,xn.nodeName))}),QT($n,Rt,!0),$n}else return Rt},cC=(Rt,$t)=>{let $n=Rt;for(;$n;){let xn=$t;for(;xn&&$n!==xn;)xn=xn.parentNode;if($n===xn)break;$n=$n.parentNode}return!$n&&Rt.ownerDocument?Rt.ownerDocument.documentElement:$n},T1=Rt=>{if(Jn(Rt)){const $t=Rt.nodeName.toLowerCase()==="a"&&!dt(Rt,"href")&&dt(Rt,"id");if(dt(Rt,"name")||dt(Rt,"data-mce-bookmark")||$t)return!0}return!1},uC=(Rt,$t,$n)=>{let xn=0;if(T1(Rt))return!1;const Io=Rt.firstChild;if(Io){const br=new wi(Io,Rt),ha=ae?ae.getWhitespaceElements():{},Nc=$t||(ae?ae.getNonEmptyElements():null);let _u=Io;do{if(Jn(_u)){const YT=_u.getAttribute("data-mce-bogus");if(YT){_u=br.next(YT==="all");continue}const XT=_u.nodeName.toLowerCase();if(Nc&&Nc[XT]){if(XT==="br"){xn++,_u=br.next();continue}return!1}if(T1(_u))return!1}if(ch(_u)||Sn(_u)&&!eg(_u.data)&&(!($n!=null&&$n.includeZwsp)||!Kg(_u.data))||Sn(_u)&&_u.parentNode&&ha[_u.parentNode.nodeName]&&eg(_u.data))return!1;_u=br.next()}while(_u)}return xn<=1},Mw=()=>n.createRange(),vv=(Rt,$t,$n)=>{let xn=Mw(),Io,br;if(Rt&&$t&&Rt.parentNode&&$t.parentNode){const ha=Rt.parentNode;return xn.setStart(ha,sb(Rt)),xn.setEnd($t.parentNode,sb($t)),Io=xn.extractContents(),xn=Mw(),xn.setStart($t.parentNode,sb($t)+1),xn.setEnd(ha,sb(Rt)+1),br=xn.extractContents(),ha.insertBefore(ag(E1,Io),Rt),$n?ha.insertBefore($n,Rt):ha.insertBefore($t,Rt),ha.insertBefore(ag(E1,br),Rt),co(Rt),$n||$t}else return},HT=(Rt,$t,$n,xn)=>{if(oe(Rt)){let Io=Rt.length;const br=[];for(;Io--;)br[Io]=HT(Rt[Io],$t,$n,xn);return br}else return i.collect&&(Rt===n||Rt===m)&&G.push([Rt,$t,$n,xn]),be.bind(Rt,$t,$n,xn||E1)},zT=(Rt,$t,$n)=>{if(oe(Rt)){let xn=Rt.length;const Io=[];for(;xn--;)Io[xn]=zT(Rt[xn],$t,$n);return Io}else{if(G.length>0&&(Rt===n||Rt===m)){let xn=G.length;for(;xn--;){const[Io,br,ha]=G[xn];Rt===Io&&(!$t||$t===br)&&(!$n||$n===ha)&&be.unbind(Io,br,ha)}}return be.unbind(Rt,$t,$n)}},Ib=(Rt,$t,$n)=>be.dispatch(Rt,$t,$n),Ov=(Rt,$t,$n)=>be.dispatch(Rt,$t,$n),VT=Rt=>{if(Rt&&Jn(Rt)){const $t=Rt.getAttribute("data-mce-contenteditable");return $t&&$t!=="inherit"?$t:Rt.contentEditable!=="inherit"?Rt.contentEditable:null}else return null},E1={doc:n,settings:i,win:m,files:p,stdMode:x,boxModel:R,styleSheetLoader:B,boundEvents:G,styles:fe,schema:ae,events:be,isBlock:Ye,root:null,clone:Mt,getRoot:dn,getViewPort:Hn,getRect:Po,getSize:go,getParent:Ir,getParents:Ws,get:De,getNext:ul,getPrev:Il,select:Mn,is:Cs,add:ko,create:Rn,createHTML:Ks,createFragment:Kr,remove:co,setStyle:Lt,getStyle:yn,setStyles:Zt,removeAllAttribs:Us,setAttrib:St,setAttribs:Cr,getAttrib:dt,getPos:Nn,parseStyle:ci,serializeStyle:Ka,addStyle:Ti,loadCSS:$c,addClass:qd,removeClass:Dm,hasClass:qO,toggleClass:Fh,show:Pw,hide:GO,isHidden:KO,uniqueId:Z4,setHTML:Is,getOuterHTML:H4,setOuterHTML:z4,decode:En,encode:jo,insertAfter:FT,replace:QT,rename:ZT,findCommonAncestor:cC,run:eo,getAttribs:vt,isEmpty:uC,createRng:Mw,nodeIndex:sb,split:vv,bind:HT,unbind:zT,fire:Ov,dispatch:Ib,getContentEditable:VT,getContentEditableParent:Rt=>{const $t=dn();let $n=null;for(let xn=Rt;xn&&xn!==$t&&($n=VT(xn),$n===null);xn=xn.parentNode);return $n},isEditable:Rt=>{if(ve(Rt)){const $t=Jn(Rt)?Rt:Rt.parentElement;return ve($t)&&_n(Ge.fromDom($t))}else return!1},destroy:()=>{if(G.length>0){let Rt=G.length;for(;Rt--;){const[$t,$n,xn]=G[Rt];be.unbind($t,$n,xn)}}ln(p,(Rt,$t)=>{B.unload($t),delete p[$t]})},isChildOf:(Rt,$t)=>Rt===$t||$t.contains(Rt),dumpRng:Rt=>"startContainer: "+Rt.startContainer.nodeName+", startOffset: "+Rt.startOffset+", endContainer: "+Rt.endContainer.nodeName+", endOffset: "+Rt.endOffset},Rw=jC(fe,i,We(E1));return E1};Qr.DOM=Qr(document),Qr.nodeIndex=sb;const Hv=Qr.DOM,Qy=0,Zy=1,O0=2,qC=3;class um{constructor(i={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=i}_setReferrerPolicy(i){this.settings.referrerPolicy=i}loadScript(i){return new Promise((c,m)=>{const p=Hv;let w;const x=()=>{p.remove(G),w&&(w.onerror=w.onload=w=null)},R=()=>{x(),c()},B=()=>{x(),m("Failed to load script: "+i)},G=p.uniqueId();w=document.createElement("script"),w.id=G,w.type="text/javascript",w.src=hn._addCacheSuffix(i),this.settings.referrerPolicy&&p.setAttrib(w,"referrerpolicy",this.settings.referrerPolicy),w.onload=R,w.onerror=B,(document.getElementsByTagName("head")[0]||document.body).appendChild(w)})}isDone(i){return this.states[i]===O0}markDone(i){this.states[i]=O0}add(i){const c=this;return c.queue.push(i),c.states[i]===void 0&&(c.states[i]=Qy),new Promise((p,w)=>{c.scriptLoadedCallbacks[i]||(c.scriptLoadedCallbacks[i]=[]),c.scriptLoadedCallbacks[i].push({resolve:p,reject:w})})}load(i){return this.add(i)}remove(i){delete this.states[i],delete this.scriptLoadedCallbacks[i]}loadQueue(){const i=this.queue;return this.queue=[],this.loadScripts(i)}loadScripts(i){const c=this,m=(B,G)=>{Oo(c.scriptLoadedCallbacks,G).each(ae=>{Ne(ae,fe=>fe[B](G))}),delete c.scriptLoadedCallbacks[G]},p=B=>{const G=Dt(B,ae=>ae.status==="rejected");return G.length>0?Promise.reject(Rs(G,({reason:ae})=>oe(ae)?ae:[ae])):Promise.resolve()},w=B=>Promise.allSettled(gt(B,G=>c.states[G]===O0?(m("resolve",G),Promise.resolve()):c.states[G]===qC?(m("reject",G),Promise.reject(G)):(c.states[G]=Zy,c.loadScript(G).then(()=>{c.states[G]=O0,m("resolve",G);const ae=c.queue;return ae.length>0?(c.queue=[],w(ae).then(p)):Promise.resolve()},()=>(c.states[G]=qC,m("reject",G),Promise.reject(G)))))),x=B=>(c.loading=!0,w(B).then(G=>{c.loading=!1;const ae=c.queueLoadedCallbacks.shift();return he.from(ae).each(An),p(G)})),R=fs(i);return c.loading?new Promise((B,G)=>{c.queueLoadedCallbacks.push(()=>{x(R).then(B,G)})}):x(R)}}um.ScriptLoader=new um;const qa=n=>{let i=n;return{get:()=>i,set:p=>{i=p}}},y0=(n,i)=>{const c=n.indexOf(i);return c!==-1&&n.indexOf(i,c+1)>c},rb=n=>te(n)&&un(n,"raw"),i_=n=>oe(n)&&n.length>1,w0={},Hy=qa("en"),Na=()=>Oo(w0,Hy.get()),rd={getData:()=>vs(w0,n=>({...n})),setCode:n=>{n&&Hy.set(n)},getCode:()=>Hy.get(),add:(n,i)=>{let c=w0[n];c||(w0[n]=c={});const m=gt(bs(i),p=>p.toLowerCase());ln(i,(p,w)=>{const x=w.toLowerCase();x!==w&&y0(m,x)?(un(i,x)||(c[x]=p),c[w]=p):c[x]=p})},translate:n=>{const i=Na().getOr({}),c=x=>ue(x)?Object.prototype.toString.call(x):m(x)?"":""+x,m=x=>x===""||x===null||x===void 0,p=x=>{const R=c(x);return un(i,R)?c(i[R]):Oo(i,R.toLowerCase()).map(c).getOr(R)},w=x=>x.replace(/{context:\w+}$/,"");if(m(n))return"";if(rb(n))return c(n.raw);if(i_(n)){const x=n.slice(1),R=p(n[0]).replace(/\{([0-9]+)\}/g,(B,G)=>un(x,G)?c(x[G]):B);return w(R)}return w(p(n))},isRtl:()=>Na().bind(n=>Oo(n,"_dir")).exists(n=>n==="rtl"),hasCode:n=>un(w0,n)},Ia=()=>{const n=[],i={},c={},m=[],p=(De,ze)=>{const dt=Dt(m,vt=>vt.name===De&&vt.state===ze);Ne(dt,vt=>vt.resolve())},w=De=>un(i,De),x=De=>un(c,De),R=De=>{if(c[De])return c[De].instance},B=(De,ze)=>{const dt=rd.getCode(),vt=","+(ze||"")+",";!dt||ze&&vt.indexOf(","+dt+",")===-1||um.ScriptLoader.add(i[De]+"/langs/"+dt+".js")},G=(De,ze)=>{Ia.languageLoad!==!1&&(w(De)?B(De,ze):Ye(De,"loaded").then(()=>B(De,ze)))},ae=(De,ze)=>(n.push(ze),c[De]={instance:ze},p(De,"added"),ze),fe=De=>{delete i[De],delete c[De]},be=(De,ze)=>L(ze)?L(De)?{prefix:"",resource:ze,suffix:""}:{prefix:De.prefix,resource:ze,suffix:De.suffix}:ze,Be=(De,ze)=>{if(i[De])return Promise.resolve();let dt=L(ze)?ze:ze.prefix+ze.resource+ze.suffix;dt.indexOf("/")!==0&&dt.indexOf("://")===-1&&(dt=Ia.baseURL+"/"+dt),i[De]=dt.substring(0,dt.lastIndexOf("/"));const vt=()=>(p(De,"loaded"),Promise.resolve());return c[De]?vt():um.ScriptLoader.add(dt).then(vt)},Ye=(De,ze="added")=>ze==="added"&&x(De)||ze==="loaded"&&w(De)?Promise.resolve():new Promise(dt=>{m.push({name:De,state:ze,resolve:dt})});return{items:n,urls:i,lookup:c,get:R,requireLangPack:G,add:ae,remove:fe,createUrl:be,load:Be,waitFor:Ye}};Ia.languageLoad=!0,Ia.baseURL="",Ia.PluginManager=Ia(),Ia.ThemeManager=Ia(),Ia.ModelManager=Ia();const Ta=n=>{const i=qa(he.none()),c=()=>i.get().each(n);return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:R=>{c(),i.set(he.some(R))}}},KC=n=>{const i=qa(he.none()),c=()=>i.get().each(R=>clearInterval(R));return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:R=>{c(),i.set(he.some(setInterval(R,n)))}}},_h=()=>{const n=Ta(mt);return{...n,on:c=>n.get().each(c)}},_0=(n,i)=>{let c=null;return{cancel:()=>{Y(c)||(clearTimeout(c),c=null)},throttle:(...w)=>{Y(c)&&(c=setTimeout(()=>{c=null,n.apply(null,w)},i))}}},zv=(n,i)=>{let c=null;const m=()=>{Y(c)||(clearTimeout(c),c=null)};return{cancel:m,throttle:(...w)=>{m(),c=setTimeout(()=>{c=null,n.apply(null,w)},i)}}},id=We("mce-annotation"),uf=We("data-mce-annotation"),Kp=We("data-mce-annotation-uid"),ib=We("data-mce-annotation-active"),S0=We("data-mce-annotation-classes"),C0=We("data-mce-annotation-attrs"),a_=n=>i=>bt(i,n),Vy=(n,i)=>{const c=n.selection.getRng(),m=Ge.fromDom(c.startContainer),p=Ge.fromDom(n.getBody()),w=i.fold(()=>"."+id(),B=>`[${uf()}="${B}"]`),x=ef(m,c.startOffset).getOr(m);return it(x,w,a_(p)).bind(B=>za(B,`${Kp()}`).bind(G=>za(B,`${uf()}`).map(ae=>{const fe=c_(n,G);return{uid:G,name:ae,elements:fe}})))},JC=n=>kl(n)&&Df(n,id()),l_=(n,i)=>qi(n,"data-mce-bogus")||Ty(n,'[data-mce-bogus="all"]',a_(i)),c_=(n,i)=>{const c=Ge.fromDom(n.getBody()),m=pl(c,`[${Kp()}="${i}"]`);return Dt(m,p=>!l_(p,c))},Wy=(n,i)=>{const c=Ge.fromDom(n.getBody()),m=pl(c,`[${uf()}="${i}"]`),p={};return Ne(m,w=>{if(!l_(w,c)){const x=Fl(w,Kp()),R=Oo(p,x).getOr([]);p[x]=R.concat([w])}}),p},u_=(n,i)=>{const c=qa({}),m=()=>({listeners:[],previous:_h()}),p=(fe,be)=>{w(fe,Be=>(be(Be),Be))},w=(fe,be)=>{const Be=c.get(),Ye=Oo(Be,fe).getOrThunk(m),De=be(Ye);Be[fe]=De,c.set(Be)},x=(fe,be,Be)=>{p(fe,Ye=>{Ne(Ye.listeners,De=>De(!0,fe,{uid:be,nodes:gt(Be,ze=>ze.dom)}))})},R=fe=>{p(fe,be=>{Ne(be.listeners,Be=>Be(!1,fe))})},B=(fe,be)=>{Ne(c_(n,fe),Be=>{be?Pr(Be,ib(),"true"):Vi(Be,ib())})},G=zv(()=>{const fe=$s(i.getNames());Ne(fe,be=>{w(be,Be=>{const Ye=Be.previous.get();return Vy(n,he.some(be)).fold(()=>{Ye.each(De=>{R(be),Be.previous.clear(),B(De,!1)})},({uid:De,name:ze,elements:dt})=>{qr(Ye,De)||(Ye.each(vt=>B(vt,!1)),x(ze,De,dt),Be.previous.set(De),B(De,!0))}),{previous:Be.previous,listeners:Be.listeners}})})},30);return n.on("remove",()=>{G.cancel()}),n.on("NodeChange",()=>{G.throttle()}),{addListener:(fe,be)=>{w(fe,Be=>({previous:Be.previous,listeners:Be.listeners.concat([be])}))}}},EE=(n,i)=>{const c=uf(),m=w=>he.from(w.attr(c)).bind(i.lookup),p=w=>{var x,R;w.attr(Kp(),null),w.attr(uf(),null),w.attr(ib(),null);const B=he.from(w.attr(C0())).map(be=>be.split(",")).getOr([]),G=he.from(w.attr(S0())).map(be=>be.split(",")).getOr([]);Ne(B,be=>w.attr(be,null));const ae=(R=(x=w.attr("class"))===null||x===void 0?void 0:x.split(" "))!==null&&R!==void 0?R:[],fe=wa(ae,[id()].concat(G));w.attr("class",fe.length>0?fe.join(" "):null),w.attr(S0(),null),w.attr(C0(),null)};n.serializer.addTempAttr(ib()),n.serializer.addAttributeFilter(c,w=>{for(const x of w)m(x).each(R=>{R.persistent===!1&&(x.name==="span"?x.unwrap():p(x))})})},Vv=()=>{const n={};return{register:(p,w)=>{n[p]={name:p,settings:w}},lookup:p=>Oo(n,p).map(w=>w.settings),getNames:()=>bs(n)}};let f_=0;const Li=n=>{const c=new Date().getTime(),m=Math.floor(Math.random()*1e9);return f_++,n+"_"+m+f_+String(c)},Wv=(n,i)=>{Ne(i,c=>{Ju(n,c)})},Uy=(n,i)=>{Ne(i,c=>{zc(n,c)})},d_=(n,i)=>Ge.fromDom(n.dom.cloneNode(i)),ug=n=>d_(n,!1),pc=n=>d_(n,!0),gu=(n,i)=>{const c=Ge.fromTag(i),m=Gf(n);return Ku(c,m),c},h_=(n,i)=>{const c=gu(n,i);iu(n,c);const m=Da(n);return ti(c,m),wr(n),c},Yy=(n,i,c=Xe)=>{const m=new wi(n,i),p=w=>{let x;do x=m[w]();while(x&&!Sn(x)&&!c(x));return he.from(x).filter(Sn)};return{current:()=>he.from(m.current()).filter(Sn),next:()=>p("next"),prev:()=>p("prev"),prev2:()=>p("prev2")}},up=(n,i)=>{const c=i||(x=>n.isBlock(x)||mi(x)||Es(x)),m=(x,R,B,G)=>{if(Sn(x)){const ae=G(x,R,x.data);if(ae!==-1)return he.some({container:x,offset:ae})}return B().bind(ae=>m(ae.container,ae.offset,B,G))};return{backwards:(x,R,B,G)=>{const ae=Yy(x,G!=null?G:n.getRoot(),c);return m(x,R,()=>ae.prev().map(fe=>({container:fe,offset:fe.length})),B).getOrNull()},forwards:(x,R,B,G)=>{const ae=Yy(x,G!=null?G:n.getRoot(),c);return m(x,R,()=>ae.next().map(fe=>({container:fe,offset:0})),B).getOrNull()}}},fp=Math.round,Jp=n=>n?{left:fp(n.left),top:fp(n.top),bottom:fp(n.bottom),right:fp(n.right),width:fp(n.width),height:fp(n.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},e1=(n,i)=>(n=Jp(n),i||(n.left=n.left+n.width),n.right=n.left,n.width=0,n),fg=(n,i)=>n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right,Uv=(n,i,c)=>n>=0&&n<=Math.min(i.height,c.height)/2,sa=(n,i)=>{const c=Math.min(i.height/2,n.height/2);return n.bottom-ci.bottom?!1:Uv(i.top-n.bottom,n,i)},ff=(n,i)=>n.top>i.bottom?!0:n.bottomi>=n.left&&i<=n.right&&c>=n.top&&c<=n.bottom,ek=n=>zn(n,(i,c)=>i.fold(()=>he.some(c),m=>{const p=Math.min(c.left,m.left),w=Math.min(c.top,m.top),x=Math.max(c.right,m.right),R=Math.max(c.bottom,m.bottom);return he.some({top:w,right:x,bottom:R,left:p,width:x-p,height:R-w})}),he.none()),Xy=(n,i,c)=>{const m=Math.max(Math.min(i,n.left+n.width),n.left),p=Math.max(Math.min(c,n.top+n.height),n.top);return Math.sqrt((i-m)*(i-m)+(c-p)*(c-p))},tk=(n,i)=>Math.max(0,Math.min(n.bottom,i.bottom)-Math.max(n.top,i.top)),t1=(n,i,c)=>Math.min(Math.max(n,i),c),lb=n=>{const i=n.startContainer,c=n.startOffset;return i===n.endContainer&&i.hasChildNodes()&&n.endOffset===c+1?i.childNodes[c]:null},ad=(n,i)=>{if(Jn(n)&&n.hasChildNodes()){const c=n.childNodes,m=t1(i,0,c.length-1);return c[m]}else return n},jy=(n,i)=>{if(!(i<0&&Jn(n)&&n.hasChildNodes()))return ad(n,i)},m_=new RegExp("[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2-\u09E3\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B57\u0B62-\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC-\u0CCD\u0CD5-\u0CD6\u0CE2-\u0CE3\u0D01\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62-\u0D63\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u200C-\u200D\u20D0-\u20DC\u20DD-\u20E0\u20E1\u20E2-\u20E4\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u302E-\u302F\u3099-\u309A\uA66F\uA670-\uA672\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E-\uFF9F]"),g_=n=>L(n)&&n.charCodeAt(0)>=768&&m_.test(n),nk=(...n)=>i=>{for(let c=0;ci=>{for(let c=0;cn?n.createRange():Qr.DOM.createRng(),qs=n=>L(n)&&/[\r\n\t ]/.test(n),pu=n=>!!n.setStart&&!!n.setEnd,hg=n=>{const i=n.startContainer,c=n.startOffset;if(qs(n.toString())&&v_(i.parentNode)&&Sn(i)){const m=i.data;if(qs(m[c-1])||qs(m[c+1]))return!0}return!1},Gy=n=>{const i=n.ownerDocument,c=cb(i),m=i.createTextNode(Gr),p=n.parentNode;p.insertBefore(m,n),c.setStart(m,0),c.setEnd(m,1);const w=Jp(c.getBoundingClientRect());return p.removeChild(m),w},Yi=n=>{const i=n.startContainer,c=n.endContainer,m=n.startOffset,p=n.endOffset;if(i===c&&Sn(c)&&m===0&&p===1){const w=n.cloneRange();return w.setEndAfter(c),mg(w)}else return null},Ky=n=>n.left===0&&n.right===0&&n.top===0&&n.bottom===0,mg=n=>{var i;let c;const m=n.getClientRects();return m.length>0?c=Jp(m[0]):c=Jp(n.getBoundingClientRect()),!pu(n)&&dg(n)&&Ky(c)?Gy(n):Ky(c)&&pu(n)&&(i=Yi(n))!==null&&i!==void 0?i:c},Oa=(n,i)=>{const c=e1(n,i);return c.width=1,c.right=c.left+1,c},fm=n=>{const i=[],c=x=>{x.height!==0&&(i.length>0&&fg(x,i[i.length-1])||i.push(x))},m=(x,R)=>{const B=cb(x.ownerDocument);if(R0&&(B.setStart(x,R-1),B.setEnd(x,R),hg(B)||c(Oa(mg(B),!1))),R{const m=()=>(o1(n),i===0),p=()=>o1(n)?i>=n.data.length:i>=n.childNodes.length,w=()=>{const ae=cb(n.ownerDocument);return ae.setStart(n,i),ae.setEnd(n,i),ae},x=()=>(c||(c=fm(zt(n,i))),c),R=()=>x().length>0,B=ae=>ae&&n===ae.container()&&i===ae.offset(),G=ae=>df(n,ae?i-1:i);return{container:We(n),offset:We(i),toRange:w,getClientRects:x,isVisible:R,isAtStart:m,isAtEnd:p,isEqual:B,getNode:G}};zt.fromRangeStart=n=>zt(n.startContainer,n.startOffset),zt.fromRangeEnd=n=>zt(n.endContainer,n.endOffset),zt.after=n=>zt(n.parentNode,Yv(n)+1),zt.before=n=>zt(n.parentNode,Yv(n)),zt.isAbove=(n,i)=>ri($o(i.getClientRects()),Mo(n.getClientRects()),sa).getOr(!1),zt.isBelow=(n,i)=>ri(Mo(i.getClientRects()),$o(n.getClientRects()),ff).getOr(!1),zt.isAtStart=n=>n?n.isAtStart():!1,zt.isAtEnd=n=>n?n.isAtEnd():!1,zt.isTextPosition=n=>n?Sn(n.container()):!1,zt.isElementPosition=n=>!zt.isTextPosition(n);const T0=(n,i)=>{Sn(i)&&i.data.length===0&&n.remove(i)},Jy=(n,i,c)=>{i.insertNode(c),T0(n,c.previousSibling),T0(n,c.nextSibling)},E0=(n,i,c)=>{const m=he.from(c.firstChild),p=he.from(c.lastChild);i.insertNode(c),m.each(w=>T0(n,w.previousSibling)),p.each(w=>T0(n,w.nextSibling))},Sh=(n,i,c)=>{K1(c)?E0(n,i,c):Jy(n,i,c)},hf=Sn,ub=Pd,Xv=Qr.nodeIndex,e2=n=>{const i=n.parentNode;return ub(i)?e2(i):i},jv=n=>n?qe(n.childNodes,(i,c)=>(ub(c)&&c.nodeName!=="BR"?i=i.concat(jv(c)):i.push(c),i),[]):[],A0=(n,i)=>{let c=n;for(;(c=c.previousSibling)&&hf(c);)i+=c.data.length;return i},Ch=n=>i=>n===i,ld=n=>{let i,c;i=jv(e2(n)),c=je(i,Ch(n),n),i=i.slice(0,c+1);const m=qe(i,(p,w,x)=>(hf(w)&&hf(i[x-1])&&p++,p),0);return i=Fa(i,Rf([n.nodeName])),c=je(i,Ch(n),n),c-m},Lu=n=>(hf(n)?"text()":n.nodeName.toLowerCase())+"["+ld(n)+"]",zl=(n,i,c)=>{const m=[];for(let p=i.parentNode;p&&p!==n&&!(c&&c(p));p=p.parentNode)m.push(p);return m},t2=(n,i)=>{let c=[],m=i.container(),p=i.offset(),w;if(hf(m))w=A0(m,p);else{const R=m.childNodes;p>=R.length?(w="after",p=R.length-1):w="before",m=R[p]}c.push(Lu(m));let x=zl(n,m);return x=Fa(x,Je(Pd)),c=c.concat(Zi(x,R=>Lu(R))),c.reverse().join("/")+","+w},dp=(n,i,c)=>{let m=jv(n);return m=Fa(m,(p,w)=>!hf(p)||!hf(m[w-1])),m=Fa(m,Rf([i])),m[c]},O_=(n,i)=>{let c=n,m=0;for(;hf(c);){const p=c.data.length;if(i>=m&&i<=m+p){n=c,i=i-m;break}if(!hf(c.nextSibling)){n=c,i=p;break}m+=p,c=c.nextSibling}return hf(n)&&i>n.data.length&&(i=n.data.length),zt(n,i)},D0=(n,i)=>{if(!i)return null;const c=i.split(","),m=c[0].split("/"),p=c.length>1?c[1]:"before",w=qe(m,(x,R)=>{const B=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(R);return B?(B[1]==="text()"&&(B[1]="#text"),dp(x,B[1],parseInt(B[2],10))):null},n);if(!w)return null;if(!hf(w)&&w.parentNode){let x;return p==="after"?x=Xv(w)+1:x=Xv(w),zt(w.parentNode,x)}return O_(w,parseInt(p,10))},s1=Es,n2=(n,i,c)=>{let m=n(i.data.slice(0,c)).length;for(let p=i.previousSibling;p&&Sn(p);p=p.previousSibling)m+=n(p.data).length;return m},qv=(n,i,c,m,p)=>{const w=p?m.startContainer:m.endContainer;let x=p?m.startOffset:m.endOffset;const R=[],B=n.getRoot();if(Sn(w))R.push(c?n2(i,w,x):x);else{let G=0;const ae=w.childNodes;x>=ae.length&&ae.length&&(G=1,x=Math.max(0,ae.length-1)),R.push(n.nodeIndex(ae[x],c)+G)}for(let G=w;G&&G!==B;G=G.parentNode)R.push(n.nodeIndex(G,c));return R},y_=(n,i,c,m)=>{const p=i.dom,w=qv(p,n,c,m,!0),x=i.isForward(),R=oa(m)?{isFakeCaret:!0}:{};if(i.isCollapsed())return{start:w,forward:x,...R};{const B=qv(p,n,c,m,!1);return{start:w,end:B,forward:x,...R}}},Gv=(n,i,c)=>{let m=0;return hn.each(n.select(i),p=>{if(p.getAttribute("data-mce-bogus")!=="all"){if(p===c)return!1;m++;return}}),m},o2=(n,i)=>{let c=i?n.startContainer:n.endContainer,m=i?n.startOffset:n.endOffset;if(Jn(c)&&c.nodeName==="TR"){const p=c.childNodes;c=p[Math.min(i?m:m-1,p.length-1)],c&&(m=i?0:c.childNodes.length,i?n.setStart(c,m):n.setEnd(c,m))}},vl=n=>(o2(n,!0),o2(n,!1),n),ec=(n,i)=>{if(Jn(n)&&(n=ad(n,i),s1(n)))return n;if(_r(n)){Sn(n)&&_i(n)&&(n=n.parentNode);let c=n.previousSibling;if(s1(c)||(c=n.nextSibling,s1(c)))return c}},Fu=n=>ec(n.startContainer,n.startOffset)||ec(n.endContainer,n.endOffset),Zr=(n,i,c)=>{const m=c.getNode(),p=c.getRng();if(m.nodeName==="IMG"||s1(m)){const x=m.nodeName;return{name:x,index:Gv(c.dom,x,m)}}const w=Fu(p);if(w){const x=w.tagName;return{name:x,index:Gv(c.dom,x,w)}}return y_(n,c,i,p)},tc=n=>{const i=n.getRng();return{start:t2(n.dom.getRoot(),zt.fromRangeStart(i)),end:t2(n.dom.getRoot(),zt.fromRangeEnd(i)),forward:n.isForward()}},Vl=n=>({rng:n.getRng(),forward:n.isForward()}),dm=(n,i,c)=>{const m={"data-mce-type":"bookmark",id:i,style:"overflow:hidden;line-height:0px"};return c?n.create("span",m,""):n.create("span",m)},Sr=(n,i)=>{const c=n.dom;let m=n.getRng();const p=c.uniqueId(),w=n.isCollapsed(),x=n.getNode(),R=x.nodeName,B=n.isForward();if(R==="IMG")return{name:R,index:Gv(c,R,x)};const G=vl(m.cloneRange());if(!w){G.collapse(!1);const fe=dm(c,p+"_end",i);Sh(c,G,fe)}m=vl(m),m.collapse(!0);const ae=dm(c,p+"_start",i);return Sh(c,m,ae),n.moveToBookmark({id:p,keep:!0,forward:B}),{id:p,forward:B}},w_=(n,i,c=!1)=>i===2?Zr(Bn,c,n):i===3?tc(n):i?Vl(n):Sr(n,!1),bu=Re(Zr,Ct,!0),Dl=n=>{const i=w=>w(n),c=We(n),m=()=>p,p={tag:!0,inner:n,fold:(w,x)=>x(n),isValue:_t,isError:Xe,map:w=>bc.value(w(n)),mapError:m,bind:i,exists:i,forall:i,getOr:c,or:m,getOrThunk:c,orThunk:m,getOrDie:c,each:w=>{w(n)},toOptional:()=>he.some(n)};return p},s2=n=>{const i=()=>c,c={tag:!1,inner:n,fold:(m,p)=>m(n),isValue:Xe,isError:_t,map:i,mapError:m=>bc.error(m(n)),bind:i,exists:Xe,forall:_t,getOr:Ct,or:Ct,getOrThunk:Et,orThunk:Et,getOrDie:an(String(n)),each:mt,toOptional:he.none};return c},bc={value:Dl,error:s2,fromOption:(n,i)=>n.fold(()=>s2(i),Dl)},pg={generate:n=>{if(!oe(n))throw new Error("cases must be an array");if(n.length===0)throw new Error("there must be at least one case");const i=[],c={};return Ne(n,(m,p)=>{const w=bs(m);if(w.length!==1)throw new Error("one and only one name per case");const x=w[0],R=m[x];if(c[x]!==void 0)throw new Error("duplicate key detected:"+x);if(x==="cata")throw new Error("cannot have a case named cata (sorry)");if(!oe(R))throw new Error("case arguments must be an array");i.push(x),c[x]=(...B)=>{const G=B.length;if(G!==R.length)throw new Error("Wrong number of arguments to case "+x+". Expected "+R.length+" ("+R+"), got "+G);return{fold:(...fe)=>{if(fe.length!==n.length)throw new Error("Wrong number of arguments to fold. Expected "+n.length+", got "+fe.length);return fe[p].apply(null,B)},match:fe=>{const be=bs(fe);if(i.length!==be.length)throw new Error("Wrong number of arguments to match. Expected: "+i.join(",")+` +Actual: `+be.join(","));if(!er(i,Ye=>wt(be,Ye)))throw new Error("Not all branches were specified when using match. Specified: "+be.join(", ")+` +Required: `+i.join(", "));return fe[x].apply(null,B)},log:fe=>{console.log(fe,{constructors:i,constructor:x,params:B})}}}}),c}};pg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ok=n=>{const i=[],c=[];return Ne(n,m=>{m.fold(p=>{i.push(p)},p=>{c.push(p)})}),{errors:i,values:c}},sk=n=>n.type==="inline-command"||n.type==="inline-format",r2=n=>n.type==="block-command"||n.type==="block-format",i2=n=>{const i=m=>bc.error({message:m,pattern:n}),c=(m,p,w)=>{if(n.format!==void 0){let x;if(oe(n.format)){if(!er(n.format,L))return i(m+" pattern has non-string items in the `format` array");x=n.format}else if(L(n.format))x=[n.format];else return i(m+" pattern has non-string `format` parameter");return bc.value(p(x))}else return n.cmd!==void 0?L(n.cmd)?bc.value(w(n.cmd,n.value)):i(m+" pattern has non-string `cmd` parameter"):i(m+" pattern is missing both `format` and `cmd` parameters")};if(!te(n))return i("Raw pattern is not an object");if(!L(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!L(n.end))return i("Inline pattern has non-string `end` parameter");if(n.start.length===0&&n.end.length===0)return i("Inline pattern has empty `start` and `end` parameters");let m=n.start,p=n.end;return p.length===0&&(p=m,m=""),c("Inline",w=>({type:"inline-format",start:m,end:p,format:w}),(w,x)=>({type:"inline-command",start:m,end:p,cmd:w,value:x}))}else return n.replacement!==void 0?L(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):bc.value({type:"inline-command",start:"",end:n.start,cmd:"mceInsertContent",value:n.replacement}):i("Replacement pattern has non-string `replacement` parameter"):n.start.length===0?i("Block pattern has empty `start` parameter"):c("Block",m=>({type:"block-format",start:n.start,format:m[0]}),(m,p)=>({type:"block-command",start:n.start,cmd:m,value:p}))},hm=n=>Dt(n,r2),a2=n=>Dt(n,sk),r1=(n,i)=>({inlinePatterns:a2(n),blockPatterns:hm(n),dynamicPatternsLookup:i}),Ol=n=>{const i=ok(gt(n,i2));return Ne(i.errors,c=>console.error(c.message,c.pattern)),i.values},Pl=n=>i=>{const c=n(i);return Ol(c)},Tn=ys().deviceType,rk=Tn.isTouch(),nc=Qr.DOM,ik=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return zn(i,(c,m)=>{const p=m.split("="),w=p[0],x=p.length>1?p[1]:w;return c[kc(w)]=kc(x),c},{})},l2=n=>K(n,RegExp),no=n=>i=>i.options.get(n),Pc=n=>L(n)||te(n),c2=(n,i="")=>c=>{const m=L(c);if(m)if(c.indexOf("=")!==-1){const p=ik(c);return{value:Oo(p,n.id).getOr(i),valid:m}}else return{value:c,valid:m};else return{valid:!1,message:"Must be a string."}},fb=n=>{const i=n.options.register;i("id",{processor:"string",default:n.id}),i("selector",{processor:"string"}),i("target",{processor:"object"}),i("suffix",{processor:"string"}),i("cache_suffix",{processor:"string"}),i("base_url",{processor:"string"}),i("referrer_policy",{processor:"string",default:""}),i("language_load",{processor:"boolean",default:!0}),i("inline",{processor:"boolean",default:!1}),i("iframe_attrs",{processor:"object",default:{}}),i("doctype",{processor:"string",default:""}),i("document_base_url",{processor:"string",default:n.documentBaseUrl}),i("body_id",{processor:c2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:c2(n),default:""}),i("content_security_policy",{processor:"string",default:""}),i("br_in_pre",{processor:"boolean",default:!0}),i("forced_root_block",{processor:c=>{const m=L(c)&&yr(c);return m?{value:c,valid:m}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),i("forced_root_block_attrs",{processor:"object",default:{}}),i("newline_behavior",{processor:c=>{const m=wt(["block","linebreak","invert","default"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),i("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),i("no_newline_selector",{processor:"string",default:""}),i("keep_styles",{processor:"boolean",default:!0}),i("end_container_on_empty_block",{processor:c=>ye(c)?{valid:!0,value:c}:L(c)?{valid:!0,value:c}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),i("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),i("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),i("font_size_classes",{processor:"string",default:""}),i("automatic_uploads",{processor:"boolean",default:!0}),i("images_reuse_filename",{processor:"boolean",default:!1}),i("images_replace_blob_uris",{processor:"boolean",default:!0}),i("icons",{processor:"string",default:""}),i("icons_url",{processor:"string",default:""}),i("images_upload_url",{processor:"string",default:""}),i("images_upload_base_path",{processor:"string",default:""}),i("images_upload_credentials",{processor:"boolean",default:!1}),i("images_upload_handler",{processor:"function"}),i("language",{processor:"string",default:"en"}),i("language_url",{processor:"string",default:""}),i("entity_encoding",{processor:"string",default:"named"}),i("indent",{processor:"boolean",default:!0}),i("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_use_margin",{processor:"boolean",default:!1}),i("indentation",{processor:"string",default:"40px"}),i("content_css",{processor:c=>{const m=c===!1||L(c)||nt(c,L);return m?L(c)?{value:gt(c.split(","),kc),valid:m}:oe(c)?{value:c,valid:m}:c===!1?{value:[],valid:m}:{value:c,valid:m}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:M_(n)?[]:["default"]}),i("content_style",{processor:"string"}),i("content_css_cors",{processor:"boolean",default:!1}),i("font_css",{processor:c=>{const m=L(c)||nt(c,L);return m?{value:oe(c)?c:gt(c.split(","),kc),valid:m}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),i("inline_boundaries",{processor:"boolean",default:!0}),i("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),i("object_resizing",{processor:c=>{const m=ye(c)||L(c);return m?c===!1||Tn.isiPhone()||Tn.isiPad()?{value:"",valid:m}:{value:c===!0?"table,img,figure.image,div,video,iframe":c,valid:m}:{valid:!1,message:"Must be boolean or a string"}},default:!rk}),i("resize_img_proportional",{processor:"boolean",default:!0}),i("event_root",{processor:"object"}),i("service_message",{processor:"string"}),i("theme",{processor:c=>c===!1||L(c)||ue(c),default:"silver"}),i("theme_url",{processor:"string"}),i("formats",{processor:"object"}),i("format_empty_lines",{processor:"boolean",default:!1}),i("format_noneditable_selector",{processor:"string",default:""}),i("preview_styles",{processor:c=>{const m=c===!1||L(c);return m?{value:c===!1?"":c,valid:m}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),i("custom_ui_selector",{processor:"string",default:""}),i("hidden_input",{processor:"boolean",default:!0}),i("submit_patch",{processor:"boolean",default:!0}),i("encoding",{processor:"string"}),i("add_form_submit_trigger",{processor:"boolean",default:!0}),i("add_unload_trigger",{processor:"boolean",default:!0}),i("custom_undo_redo_levels",{processor:"number",default:0}),i("disable_nodechange",{processor:"boolean",default:!1}),i("readonly",{processor:"boolean",default:!1}),i("editable_root",{processor:"boolean",default:!0}),i("plugins",{processor:"string[]",default:[]}),i("external_plugins",{processor:"object"}),i("forced_plugins",{processor:"string[]"}),i("model",{processor:"string",default:n.hasPlugin("rtc")?"plugin":"dom"}),i("model_url",{processor:"string"}),i("block_unsupported_drop",{processor:"boolean",default:!0}),i("visual",{processor:"boolean",default:!0}),i("visual_table_class",{processor:"string",default:"mce-item-table"}),i("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),i("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),i("setup",{processor:"function"}),i("init_instance_callback",{processor:"function"}),i("url_converter",{processor:"function",default:n.convertURL}),i("url_converter_scope",{processor:"object",default:n}),i("urlconverter_callback",{processor:"function"}),i("allow_conditional_comments",{processor:"boolean",default:!1}),i("allow_html_data_urls",{processor:"boolean",default:!1}),i("allow_svg_data_urls",{processor:"boolean"}),i("allow_html_in_named_anchor",{processor:"boolean",default:!1}),i("allow_script_urls",{processor:"boolean",default:!1}),i("allow_unsafe_link_target",{processor:"boolean",default:!1}),i("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),i("fix_list_elements",{processor:"boolean",default:!1}),i("preserve_cdata",{processor:"boolean",default:!1}),i("remove_trailing_brs",{processor:"boolean",default:!0}),i("pad_empty_with_br",{processor:"boolean",default:!1}),i("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),i("element_format",{processor:"string",default:"html"}),i("entities",{processor:"string"}),i("schema",{processor:"string",default:"html5"}),i("convert_urls",{processor:"boolean",default:!0}),i("relative_urls",{processor:"boolean",default:!0}),i("remove_script_host",{processor:"boolean",default:!0}),i("custom_elements",{processor:"string"}),i("extended_valid_elements",{processor:"string"}),i("invalid_elements",{processor:"string"}),i("invalid_styles",{processor:Pc}),i("valid_children",{processor:"string"}),i("valid_classes",{processor:Pc}),i("valid_elements",{processor:"string"}),i("valid_styles",{processor:Pc}),i("verify_html",{processor:"boolean",default:!0}),i("auto_focus",{processor:c=>L(c)||c===!0}),i("browser_spellcheck",{processor:"boolean",default:!1}),i("protect",{processor:"array"}),i("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),i("deprecation_warnings",{processor:"boolean",default:!0}),i("a11y_advanced_options",{processor:"boolean",default:!1}),i("api_key",{processor:"string"}),i("paste_block_drop",{processor:"boolean",default:!1}),i("paste_data_images",{processor:"boolean",default:!0}),i("paste_preprocess",{processor:"function"}),i("paste_postprocess",{processor:"function"}),i("paste_webkit_styles",{processor:"string",default:"none"}),i("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),i("paste_merge_formats",{processor:"boolean",default:!0}),i("smart_paste",{processor:"boolean",default:!0}),i("paste_as_text",{processor:"boolean",default:!1}),i("paste_tab_spaces",{processor:"number",default:4}),i("text_patterns",{processor:c=>nt(c,te)||c===!1?{value:Ol(c===!1?[]:c),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),i("text_patterns_lookup",{processor:c=>ue(c)?{value:Pl(c),valid:!0}:{valid:!1,message:"Must be a single function"},default:c=>[]}),i("noneditable_class",{processor:"string",default:"mceNonEditable"}),i("editable_class",{processor:"string",default:"mceEditable"}),i("noneditable_regexp",{processor:c=>nt(c,l2)?{value:c,valid:!0}:l2(c)?{value:[c],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),i("table_tab_navigation",{processor:"boolean",default:!0}),i("highlight_on_focus",{processor:"boolean",default:!1}),i("xss_sanitization",{processor:"boolean",default:!0}),i("details_initial_state",{processor:c=>{const m=wt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("details_serialized_state",{processor:c=>{const m=wt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("init_content_sync",{processor:"boolean",default:!1}),i("newdocument_content",{processor:"string",default:""}),n.on("ScriptsLoaded",()=>{i("directionality",{processor:"string",default:rd.isRtl()?"rtl":void 0}),i("placeholder",{processor:"string",default:nc.getAttrib(n.getElement(),"placeholder")})})},mf=no("iframe_attrs"),Kv=no("doctype"),i1=no("document_base_url"),Ff=no("body_id"),il=no("body_class"),Qd=no("content_security_policy"),Zd=no("br_in_pre"),jc=no("forced_root_block"),db=no("forced_root_block_attrs"),u2=no("newline_behavior"),__=no("br_newline_selector"),f2=no("no_newline_selector"),kh=no("keep_styles"),Xr=no("end_container_on_empty_block"),Jv=no("automatic_uploads"),cd=no("images_reuse_filename"),S_=no("images_replace_blob_uris"),C_=no("icons"),fa=no("icons_url"),ak=no("images_upload_url"),eO=no("images_upload_base_path"),tO=no("images_upload_credentials"),k_=no("images_upload_handler"),lk=no("content_css_cors"),hb=no("referrer_policy"),x_=no("language"),ck=no("language_url"),T_=no("indent_use_margin"),uk=no("indentation"),E_=no("content_css"),nO=no("content_style"),hp=no("font_css"),mb=no("directionality"),Xi=no("inline_boundaries_selector"),d2=no("object_resizing"),Mc=no("resize_img_proportional"),gb=no("placeholder"),al=no("event_root"),A_=no("service_message"),mm=no("theme"),fk=no("theme_url"),oc=no("model"),gf=no("model_url"),P0=no("inline_boundaries"),dk=no("formats"),hk=no("preview_styles"),D_=no("format_empty_lines"),M0=no("format_noneditable_selector"),P_=no("custom_ui_selector"),M_=no("inline"),mp=no("hidden_input"),mk=no("submit_patch"),gk=no("add_form_submit_trigger"),pk=no("add_unload_trigger"),h2=no("custom_undo_redo_levels"),oO=no("disable_nodechange"),bg=no("readonly"),R_=no("editable_root"),$_=no("content_css_cors"),sO=no("plugins"),pb=no("external_plugins"),vg=no("block_unsupported_drop"),rO=no("visual"),iO=no("visual_table_class"),R0=no("visual_anchor_class"),N_=no("iframe_aria_text"),xh=no("setup"),$0=no("init_instance_callback"),I_=no("urlconverter_callback"),Th=no("auto_focus"),gp=no("browser_spellcheck"),m2=no("protect"),B_=no("paste_block_drop"),aO=no("paste_data_images"),bk=no("paste_preprocess"),L_=no("paste_postprocess"),vk=no("newdocument_content"),Ok=no("paste_webkit_styles"),F_=no("paste_remove_styles_if_webkit"),Q_=no("paste_merge_formats"),Z_=no("smart_paste"),yk=no("paste_as_text"),wk=no("paste_tab_spaces"),_k=no("allow_html_data_urls"),H_=no("text_patterns"),g2=no("text_patterns_lookup"),p2=no("noneditable_class"),Sk=no("editable_class"),Ck=no("noneditable_regexp"),lO=no("preserve_cdata"),z_=no("highlight_on_focus"),cO=no("xss_sanitization"),N0=no("init_content_sync"),bb=n=>n.options.isSet("text_patterns_lookup"),uO=n=>hn.explode(n.options.get("font_size_style_values")),b2=n=>hn.explode(n.options.get("font_size_classes")),V_=n=>n.options.get("encoding")==="xml",v2=n=>hn.explode(n.options.get("images_file_types")),kk=no("table_tab_navigation"),fO=no("details_initial_state"),I0=no("details_serialized_state"),xk=Jn,dO=Sn,pf=n=>{const i=n.parentNode;i&&i.removeChild(n)},hO=n=>{const i=Bn(n);return{count:n.length-i.length,text:i}},W_=n=>{let i;for(;(i=n.data.lastIndexOf(Ft))!==-1;)n.deleteData(i,1)},mO=(n,i)=>(yl(n),i),Tk=(n,i)=>{const c=hO(n.data.substr(0,i.offset())),m=hO(n.data.substr(i.offset()));return(c.text+m.text).length>0?(W_(n),zt(n,i.offset()-c.count)):i},B0=(n,i)=>{const c=i.container(),m=Ho(Rr(c.childNodes),n).map(p=>pdO(n)&&i.container()===n?Tk(n,i):mO(n,i),Ek=(n,i)=>i.container()===n.parentNode?B0(n,i):mO(n,i),gO=(n,i)=>zt.isTextPosition(i)?O2(n,i):Ek(n,i),yl=n=>{xk(n)&&_r(n)&&(Uc(n)?n.removeAttribute("data-mce-caret"):pf(n)),dO(n)&&(W_(n),n.data.length===0&&pf(n))},Ak=Es,vb=of,Dk=Rd,Ob="*[contentEditable=false],video,audio,embed,object",y2=(n,i,c)=>{const m=e1(i.getBoundingClientRect(),c);let p,w;if(n.tagName==="BODY"){const R=n.ownerDocument.documentElement;p=n.scrollLeft||R.scrollLeft,w=n.scrollTop||R.scrollTop}else{const R=n.getBoundingClientRect();p=n.scrollLeft-R.left,w=n.scrollTop-R.top}m.left+=p,m.right+=p,m.top+=w,m.bottom+=w,m.width=1;let x=i.offsetWidth-i.clientWidth;return x>0&&(c&&(x*=-1),m.left+=x,m.right+=x),m},Pk=n=>{var i,c;const m=pl(Ge.fromDom(n),Ob);for(let p=0;p{const p=_h();let w,x;const R=jc(n),B=n.dom,G=(De,ze)=>{let dt;if(ae(),Dk(ze))return null;if(c(ze)){const vt=fh(R,ze,De),St=y2(i,ze,De);B.setStyle(vt,"top",St.top),x=vt;const Mt=B.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});B.setStyles(Mt,{...St}),B.add(i,Mt),p.set({caret:Mt,element:ze,before:De}),De&&B.addClass(Mt,"mce-visual-caret-before"),fe(),dt=ze.ownerDocument.createRange(),dt.setStart(vt,0),dt.setEnd(vt,0)}else return x=cu(ze,De),dt=ze.ownerDocument.createRange(),gm(x.nextSibling)?(dt.setStart(x,0),dt.setEnd(x,0)):(dt.setStart(x,1),dt.setEnd(x,1)),dt;return dt},ae=()=>{Pk(i),x&&(yl(x),x=null),p.on(De=>{B.remove(De.caret),p.clear()}),w&&(clearInterval(w),w=void 0)},fe=()=>{w=setInterval(()=>{p.on(De=>{m()?B.toggleClass(De.caret,"mce-visual-caret-hidden"):B.addClass(De.caret,"mce-visual-caret-hidden")})},500)};return{show:G,hide:ae,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{p.on(De=>{const ze=y2(i,De.element,De.before);B.setStyles(De.caret,{...ze})})},destroy:()=>clearInterval(w)}},L0=()=>Gn.browser.isFirefox(),gm=n=>Ak(n)||vb(n),yb=n=>(gm(n)||Nu(n)&&L0())&&yi(Ge.fromDom(n)).exists(_n),vu=ba,a1=Es,U_=of,Y_=lh("display","block table table-cell table-caption list-item"),w2=_r,_2=_i,S2=Jn,Rk=Sn,F0=Tl,pO=n=>n>0,pp=n=>n<0,Q0=(n,i)=>{let c;for(;c=n(i);)if(!_2(c))return c;return null},Eh=(n,i,c,m,p)=>{const w=new wi(n,m),x=a1(n)||_2(n);let R;if(pp(i)){if(x&&(R=Q0(w.prev.bind(w),!0),c(R)))return R;for(;R=Q0(w.prev.bind(w),p);)if(c(R))return R}if(pO(i)){if(x&&(R=Q0(w.next.bind(w),!0),c(R)))return R;for(;R=Q0(w.next.bind(w),p);)if(c(R))return R}return null},$k=(n,i)=>{const c=p=>vu(p.dom),m=p=>p.dom===i;return di(Ge.fromDom(n),c,m).map(p=>p.dom).getOr(i)},pm=(n,i)=>{for(;n&&n!==i;){if(Y_(n))return n;n=n.parentNode}return null},Hd=(n,i,c)=>pm(n.container(),c)===pm(i.container(),c),wb=(n,i)=>{if(!i)return he.none();const c=i.container(),m=i.offset();return S2(c)?he.from(c.childNodes[m+n]):he.none()},C2=(n,i)=>{var c;const p=((c=i.ownerDocument)!==null&&c!==void 0?c:document).createRange();return n?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)),p},_b=(n,i,c)=>pm(i,n)===pm(c,n),Og=(n,i,c)=>{const m=n?"previousSibling":"nextSibling";let p=c;for(;p&&p!==i;){let w=p[m];if(w&&w2(w)&&(w=w[m]),a1(w)||U_(w)){if(_b(i,w,p))return w;break}if(F0(w))break;p=p.parentNode}return null},S=Re(C2,!0),A=Re(C2,!1),Z=(n,i,c)=>{let m;const p=Re(Og,!0,i),w=Re(Og,!1,i),x=c.startContainer,R=c.startOffset;if(_i(x)){const B=Rk(x)?x.parentNode:x,G=B.getAttribute("data-mce-caret");if(G==="before"&&(m=B.nextSibling,yb(m)))return S(m);if(G==="after"&&(m=B.previousSibling,yb(m)))return A(m)}if(!c.collapsed)return c;if(Sn(x)){if(w2(x)){if(n===1){if(m=w(x),m)return S(m);if(m=p(x),m)return A(m)}if(n===-1){if(m=p(x),m)return A(m);if(m=w(x),m)return S(m)}return c}if(fr(x)&&R>=x.data.length-1)return n===1&&(m=w(x),m)?S(m):c;if(dh(x)&&R<=1)return n===-1&&(m=p(x),m)?A(m):c;if(R===x.data.length)return m=w(x),m?S(m):c;if(R===0)return m=p(x),m?A(m):c}return c},le=(n,i)=>wb(n?0:-1,i).filter(a1),Ce=(n,i,c)=>{const m=Z(n,i,c);return n===-1?zt.fromRangeStart(m):zt.fromRangeEnd(m)},Ve=n=>he.from(n.getNode()).map(Ge.fromDom),ft=n=>he.from(n.getNode(!0)).map(Ge.fromDom),xt=(n,i)=>{let c=i;for(;c=n(c);)if(c.isVisible())return c;return c},Ht=(n,i)=>{const c=Hd(n,i);return!c&&mi(n.getNode())?!0:c};var bn;(function(n){n[n.Backwards=-1]="Backwards",n[n.Forwards=1]="Forwards"})(bn||(bn={}));const Zn=Es,Vn=Sn,Fo=Jn,ms=mi,Ns=Tl,Hr=om,Zs=Gg,gi=(n,i)=>{const c=[];let m=n;for(;m&&m!==i;)c.push(m),m=m.parentNode;return c},Ci=(n,i)=>n.hasChildNodes()&&i{if(pO(n)){if(Ns(i.previousSibling)&&!Vn(i.previousSibling))return zt.before(i);if(Vn(i))return zt(i,0)}if(pp(n)){if(Ns(i.nextSibling)&&!Vn(i.nextSibling))return zt.after(i);if(Vn(i))return zt(i,i.data.length)}return pp(n)?ms(i)?zt.before(i):zt.after(i):zt.before(i)},Qu=(n,i)=>{const c=i.nextSibling;return c&&Ns(c)?Vn(c)?zt(c,0):zt.before(c):Qf(bn.Forwards,zt.after(i),n)},Qf=(n,i,c)=>{let m,p,w,x;if(!Fo(c)||!i)return null;if(i.isEqual(zt.after(c))&&c.lastChild){if(x=zt.after(c.lastChild),pp(n)&&Ns(c.lastChild)&&Fo(c.lastChild))return ms(c.lastChild)?zt.before(c.lastChild):x}else x=i;const R=x.container();let B=x.offset();if(Vn(R)){if(pp(n)&&B>0)return zt(R,--B);if(pO(n)&&B0&&(p=Ci(R,B-1),Ns(p)))return!Hr(p)&&(w=Eh(p,n,Zs,p),w)?Vn(w)?zt(w,w.data.length):zt.after(w):Vn(p)?zt(p,p.data.length):zt.before(p);if(pO(n)&&B({next:i=>Qf(bn.Forwards,i,n),prev:i=>Qf(bn.Backwards,i,n)}),bm=(n,i,c)=>{const m=n?zt.before(c):zt.after(c);return zd(n,i,m)},ud=n=>mi(n)?zt.before(n):zt.after(n),k2=n=>zt.isTextPosition(n)?n.offset()===0:Tl(n.getNode()),yu=n=>{if(zt.isTextPosition(n)){const i=n.container();return n.offset()===i.data.length}else return Tl(n.getNode(!0))},X_=(n,i)=>!zt.isTextPosition(n)&&!zt.isTextPosition(i)&&n.getNode()===i.getNode(!0),Z0=n=>!zt.isTextPosition(n)&&mi(n.getNode()),H0=(n,i,c)=>n?!X_(i,c)&&!Z0(i)&&yu(i)&&k2(c):!X_(c,i)&&k2(i)&&yu(c),zd=(n,i,c)=>{const m=Ea(i);return he.from(n?m.next(c):m.prev(c))},Sb=(n,i,c)=>zd(n,i,c).bind(m=>Hd(c,m,i)&&H0(n,c,m)?zd(n,i,m):he.some(m)),Nk=(n,i,c,m)=>Sb(n,i,c).bind(p=>m(p)?Nk(n,i,p,m):he.some(p)),bO=(n,i)=>{const c=n?i.firstChild:i.lastChild;return Sn(c)?he.some(zt(c,n?0:c.data.length)):c?Tl(c)?he.some(n?zt.before(c):ud(c)):bm(n,i,c):he.none()},Zf=Re(zd,!0),Zu=Re(zd,!1),ll=Re(bO,!0),Vd=Re(bO,!1),j_="_mce_caret",qc=n=>Jn(n)&&n.id===j_,Cb=(n,i)=>{let c=i;for(;c&&c!==n;){if(qc(c))return c;c=c.parentNode}return null},vO=n=>L(n.start),x2=n=>un(n,"rng"),Ik=n=>un(n,"id"),Bk=n=>un(n,"name"),l1=n=>hn.isArray(n.start),T2=n=>!Bk(n)&&ye(n.forward)?n.forward:!0,yg=(n,i)=>(Jn(i)&&n.isBlock(i)&&!i.innerHTML&&(i.innerHTML='
'),i),oP=(n,i)=>{const c=he.from(D0(n.getRoot(),i.start)),m=he.from(D0(n.getRoot(),i.end));return ri(c,m,(p,w)=>{const x=n.createRng();return x.setStart(p.container(),p.offset()),x.setEnd(w.container(),w.offset()),{range:x,forward:T2(i)}})},Lk=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft);n.appendChild(p),i.setStart(p,0),i.setEnd(p,0)},DE=n=>!n.hasChildNodes(),bI=(n,i)=>Vd(n).fold(Xe,c=>(i.setStart(c.container(),c.offset()),i.setEnd(c.container(),c.offset()),!0)),PE=(n,i,c)=>DE(i)&&Cb(n,i)?(Lk(i,c),!0):!1,ME=(n,i,c,m)=>{const p=c[i?"start":"end"],w=n.getRoot();if(p){let x=w,R=p[0];for(let B=p.length-1;x&&B>=1;B--){const G=x.childNodes;if(PE(w,x,m))return!0;if(p[B]>G.length-1)return PE(w,x,m)?!0:bI(x,m);x=G[p[B]]}Sn(x)&&(R=Math.min(p[0],x.data.length)),Jn(x)&&(R=Math.min(p[0],x.childNodes.length)),i?m.setStart(x,R):m.setEnd(x,R)}return!0},Fk=n=>Sn(n)&&n.data.length>0,Qk=(n,i,c)=>{const m=n.get(c.id+"_"+i),p=m==null?void 0:m.parentNode,w=c.keep;if(m&&p){let x,R;if(i==="start"?w?m.hasChildNodes()?(x=m.firstChild,R=1):Fk(m.nextSibling)?(x=m.nextSibling,R=0):Fk(m.previousSibling)?(x=m.previousSibling,R=m.previousSibling.data.length):(x=p,R=n.nodeIndex(m)+1):(x=p,R=n.nodeIndex(m)):w?m.hasChildNodes()?(x=m.firstChild,R=1):Fk(m.previousSibling)?(x=m.previousSibling,R=m.previousSibling.data.length):(x=p,R=n.nodeIndex(m)):(x=p,R=n.nodeIndex(m)),!w){const B=m.previousSibling,G=m.nextSibling;hn.each(hn.grep(m.childNodes),fe=>{Sn(fe)&&(fe.data=fe.data.replace(/\uFEFF/g,""))});let ae;for(;ae=n.get(c.id+"_"+i);)n.remove(ae,!0);if(Sn(G)&&Sn(B)&&!Gn.browser.isOpera()){const fe=B.data.length;B.appendData(G.data),n.remove(G),x=B,R=fe}}return he.some(zt(x,R))}else return he.none()},Zk=(n,i)=>{const c=n.createRng();return ME(n,!0,i,c)&&ME(n,!1,i,c)?he.some({range:c,forward:T2(i)}):he.none()},RE=(n,i)=>{const c=Qk(n,"start",i),m=Qk(n,"end",i);return ri(c,m.or(c),(p,w)=>{const x=n.createRng();return x.setStart(yg(n,p.container()),p.offset()),x.setEnd(yg(n,w.container()),w.offset()),{range:x,forward:T2(i)}})},$E=(n,i)=>he.from(n.select(i.name)[i.index]).map(c=>{const m=n.createRng();return m.selectNode(c),{range:m,forward:!0}}),NE=(n,i)=>{const c=n.dom;if(i){if(l1(i))return Zk(c,i);if(vO(i))return oP(c,i);if(Ik(i))return RE(c,i);if(Bk(i))return $E(c,i);if(x2(i))return he.some({range:i.rng,forward:T2(i)})}return he.none()},sP=(n,i,c)=>w_(n,i,c),rP=(n,i)=>{NE(n,i).each(({range:c,forward:m})=>{n.setRng(c,m)})},Wd=n=>Jn(n)&&n.tagName==="SPAN"&&n.getAttribute("data-mce-type")==="bookmark",Gs=(n=>i=>n===i)(Gr),Ah=n=>n!==""&&` \f +\r \v`.indexOf(n)!==-1,kb=n=>!Ah(n)&&!Gs(n)&&!a0(n),Hk=n=>({value:IE(n)}),IE=n=>ga(n,"#").toUpperCase(),OO=n=>{const i=n.toString(16);return(i.length===1?"0"+i:i).toUpperCase()},aP=n=>{const i=OO(n.red)+OO(n.green)+OO(n.blue);return Hk(i)},zk=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,q_=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,E2=(n,i,c,m)=>({red:n,green:i,blue:c,alpha:m}),lP=(n,i,c,m)=>{const p=parseInt(n,10),w=parseInt(i,10),x=parseInt(c,10),R=parseFloat(m);return E2(p,w,x,R)},Vk=n=>{if(n==="transparent")return he.some(E2(0,0,0,0));const i=zk.exec(n);if(i!==null)return he.some(lP(i[1],i[2],i[3],"1"));const c=q_.exec(n);return c!==null?he.some(lP(c[1],c[2],c[3],c[4])):he.none()},G_=n=>Vk(n).map(aP).map(i=>"#"+i.value).getOr(n),Wk=n=>{const i=[];if(n)for(let c=0;cRs(n,i=>{const c=lb(i);return c?[Ge.fromDom(c)]:[]}),BE=n=>Wk(n).length>1,Uk=n=>Dt(vI(n),qm),yO=n=>pl(n,"td[data-mce-selected],th[data-mce-selected]"),A2=(n,i)=>{const c=yO(i);return c.length>0?c:Uk(n)},xb=n=>A2(Wk(n.selection.getSel()),Ge.fromDom(n.getBody())),bp=(n,i)=>Se(n,"table",i),LE=n=>{const i=n.startContainer,c=n.startOffset;return Sn(i)?c===0?he.some(Ge.fromDom(i)):he.none():he.from(i.childNodes[c]).map(Ge.fromDom)},cP=n=>{const i=n.endContainer,c=n.endOffset;return Sn(i)?c===i.data.length?he.some(Ge.fromDom(i)):he.none():he.from(i.childNodes[c-1]).map(Ge.fromDom)},FE=n=>ii(n).fold(We([n]),i=>[n].concat(FE(i))),Yk=n=>Pu(n).fold(We([n]),i=>ei(i)==="br"?Sa(i).map(c=>[n].concat(Yk(c))).getOr([]):[n].concat(Yk(i))),wO=(n,i)=>ri(LE(i),cP(i),(c,m)=>{const p=oo(FE(n),Re(bt,c)),w=oo(Yk(n),Re(bt,m));return p.isSome()&&w.isSome()}).getOr(!1),Xk=(n,i,c,m)=>{const p=c,w=new wi(c,p),x=Vt(n.schema.getMoveCaretBeforeOnEnterElements(),(B,G)=>!wt(["td","th","table"],G.toLowerCase()));let R=c;do{if(Sn(R)&&hn.trim(R.data).length!==0){m?i.setStart(R,0):i.setEnd(R,R.data.length);return}if(x[R.nodeName]){m?i.setStartBefore(R):R.nodeName==="BR"?i.setEndBefore(R):i.setEndAfter(R);return}}while(R=m?w.next():w.prev());p.nodeName==="BODY"&&(m?i.setStart(p,0):i.setEnd(p,p.childNodes.length))},K_=n=>{const i=n.selection.getSel();return ve(i)&&i.rangeCount>0},jk=(n,i)=>{const c=xb(n);c.length>0?Ne(c,m=>{const p=m.dom,w=n.dom.createRng();w.setStartBefore(p),w.setEndAfter(p),i(w,!0)}):i(n.selection.getRng(),!1)},QE=(n,i,c)=>{const m=Sr(n,i);c(m),n.moveToBookmark(m)},D2=n=>ot(n==null?void 0:n.nodeType),qk=n=>Jn(n)&&!Wd(n)&&!qc(n)&&!Pd(n),uP=(n,i)=>{if(qk(i)&&!/^(TD|TH)$/.test(i.nodeName)){const c=n.getAttrib(i,"data-mce-selected"),m=parseInt(c,10);return!isNaN(m)&&m>0}else return!1},vm=n=>n.isContentEditable===!0,ZE=(n,i,c)=>{const{selection:m,dom:p}=n,w=m.getNode(),x=Es(w);QE(m,!0,()=>{i()}),x&&Es(w)&&p.isChildOf(w,n.getBody())?n.selection.select(w):c(m.getStart())&&fP(p,m)},fP=(n,i)=>{var c,m;const p=i.getRng(),{startContainer:w,startOffset:x}=p,R=i.getNode();if(!uP(n,R)&&Jn(w)){const B=w.childNodes,G=n.getRoot();let ae;if(x{if(n){const m=i?"nextSibling":"previousSibling";for(n=c?n:n[m];n;n=n[m])if(Jn(n)||!sc(n))return n}},Wl=(n,i)=>!!n.getTextBlockElements()[i.nodeName.toLowerCase()]||ig(n,i),Om=(n,i,c)=>n.schema.isValidChild(i,c),sc=(n,i=!1)=>{if(ve(n)&&Sn(n)){const c=i?n.data.replace(/ /g,"\xA0"):n.data;return eg(c)}else return!1},ym=n=>ve(n)&&Sn(n)&&n.length===0,HE=(n,i)=>{const c="[data-mce-cef-wrappable]",m=M0(n),p=nl(m)?c:`${c},${m}`;return Du(Ge.fromDom(i),p)},P2=(n,i)=>{const c=n.dom;return qk(i)&&c.getContentEditable(i)==="false"&&HE(n,i)&&c.select('[contenteditable="true"]',i).length===0},Dh=(n,i)=>ue(n)?n(i):(ve(i)&&(n=n.replace(/%(\w+)/g,(c,m)=>i[m]||c)),n),J_=(n,i)=>(n=n||"",i=i||"",n=""+(n.nodeName||n),i=""+(i.nodeName||i),n.toLowerCase()===i.toLowerCase()),M2=(n,i)=>{if(Le(n))return null;{let c=String(n);return(i==="color"||i==="backgroundColor")&&(c=G_(c)),i==="fontWeight"&&n===700&&(c="bold"),i==="fontFamily"&&(c=c.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),c}},R2=(n,i,c)=>{const m=n.getStyle(i,c);return M2(m,c)},Gk=(n,i)=>{let c;return n.getParent(i,m=>Jn(m)?(c=n.getStyle(m,"text-decoration"),!!c&&c!=="none"):!1),c},$2=(n,i,c)=>n.getParents(i,c,n.getRoot()),eS=(n,i,c)=>{const m=n.formatter.get(i);return ve(m)&&Wt(m,c)},Kk=(n,i)=>eS(n,i,m=>{const p=w=>ue(w)||w.length>1&&w.charAt(0)==="%";return Wt(["styles","attributes"],w=>Oo(m,w).exists(x=>{const R=oe(x)?x:uo(x);return Wt(R,p)}))}),dP=(n,i,c)=>{const m=["inline","block","selector","attributes","styles","classes"],p=w=>Vt(w,(x,R)=>Wt(m,B=>B===R));return eS(n,i,w=>{const x=p(w);return eS(n,c,R=>{const B=p(R);return To(x,B)})})},wm=n=>os(n,"block"),tS=n=>wm(n)&&n.wrapper===!0,N2=n=>wm(n)&&n.wrapper!==!0,fd=n=>os(n,"selector"),Ml=n=>os(n,"inline"),Jk=n=>fd(n)&&Ml(n)&&qr(Oo(n,"mixed"),!0),I2=n=>fd(n)&&n.expand!==!1&&!Ml(n),Ud=Wd,B2=$2,ex=sc,tx=Wl,hP=n=>mi(n)&&n.getAttribute("data-mce-bogus")&&!n.nextSibling,zE=(n,i)=>{let c=i;for(;c;){if(Jn(c)&&n.getContentEditable(c))return n.getContentEditable(c)==="false"?c:i;c=c.parentNode}return i},L2=(n,i,c,m)=>{const p=i.data;if(n){for(let w=c;w>0;w--)if(m(p.charAt(w-1)))return w}else for(let w=c;wL2(n,i,c,m=>Gs(m)||Ah(m)),mP=(n,i,c)=>L2(n,i,c,kb),Tb=(n,i,c,m,p,w)=>{let x;const R=n.getParent(c,n.isBlock)||i,B=(ae,fe,be)=>{const Be=up(n),Ye=p?Be.backwards:Be.forwards;return he.from(Ye(ae,fe,(De,ze)=>Ud(De.parentNode)?-1:(x=De,be(p,De,ze)),R))};return B(c,m,VE).bind(ae=>w?B(ae.container,ae.offset+(p?-1:0),mP):he.some(ae)).orThunk(()=>x?he.some({container:x,offset:p?0:x.length}):he.none())},Gc=(n,i,c,m,p)=>{const w=m[p];Sn(m)&&nl(m.data)&&w&&(m=w);const x=B2(n,m);for(let R=0;R{var p;let w=c;const x=n.getRoot(),R=i[0];if(wm(R)&&(w=R.wrapper?null:n.getParent(c,R.block,x)),!w){const B=(p=n.getParent(c,"LI,TD,TH"))!==null&&p!==void 0?p:x;w=n.getParent(Sn(c)?c.parentNode:c,G=>G!==x&&tx(n.schema,G),B)}if(w&&wm(R)&&R.wrapper&&(w=B2(n,w,"ul,ol").reverse()[0]||w),!w)for(w=c;w&&w[m]&&!n.isBlock(w[m])&&(w=w[m],!J_(w,"br")););return w||c},Yd=(n,i,c,m)=>{const p=c.parentNode;return ve(c[m])?!1:p===i||Le(p)||n.isBlock(p)?!0:Yd(n,i,p,m)},dd=(n,i,c,m,p)=>{let w=c;const x=p?"previousSibling":"nextSibling",R=n.getRoot();if(Sn(c)&&!ex(c)&&(p?m>0:mUd(n.parentNode)||Ud(n),z0=(n,i,c,m=!1)=>{let{startContainer:p,startOffset:w,endContainer:x,endOffset:R}=i;const B=c[0];return Jn(p)&&p.hasChildNodes()&&(p=ad(p,w),Sn(p)&&(w=0)),Jn(x)&&x.hasChildNodes()&&(x=ad(x,i.collapsed?R:R-1),Sn(x)&&(R=x.data.length)),p=zE(n,p),x=zE(n,x),nS(p)&&(p=Ud(p)?p:p.parentNode,i.collapsed?p=p.previousSibling||p:p=p.nextSibling||p,Sn(p)&&(w=i.collapsed?p.length:0)),nS(x)&&(x=Ud(x)?x:x.parentNode,i.collapsed?x=x.nextSibling||x:x=x.previousSibling||x,Sn(x)&&(R=i.collapsed?0:x.length)),i.collapsed&&(Tb(n,n.getRoot(),p,w,!0,m).each(({container:fe,offset:be})=>{p=fe,w=be}),Tb(n,n.getRoot(),x,R,!1,m).each(({container:fe,offset:be})=>{x=fe,R=be})),(Ml(B)||B.block_expand)&&((!Ml(B)||!Sn(p)||w===0)&&(p=dd(n,c,p,w,!0)),(!Ml(B)||!Sn(x)||R===x.data.length)&&(x=dd(n,c,x,R,!1))),I2(B)&&(p=Gc(n,c,i,p,"previousSibling"),x=Gc(n,c,i,x,"nextSibling")),(wm(B)||fd(B))&&(p=Ph(n,c,p,"previousSibling"),x=Ph(n,c,x,"nextSibling"),wm(B)&&(n.isBlock(p)||(p=dd(n,c,p,w,!0)),n.isBlock(x)||(x=dd(n,c,x,R,!1)))),Jn(p)&&p.parentNode&&(w=n.nodeIndex(p),p=p.parentNode),Jn(x)&&x.parentNode&&(R=n.nodeIndex(x)+1,x=x.parentNode),{startContainer:p,startOffset:w,endContainer:x,endOffset:R}},c1=(n,i,c)=>{var m;const p=i.startOffset,w=ad(i.startContainer,p),x=i.endOffset,R=ad(i.endContainer,x-1),B=ze=>{const dt=ze[0];Sn(dt)&&dt===w&&p>=dt.data.length&&ze.splice(0,1);const vt=ze[ze.length-1];return x===0&&ze.length>0&&vt===R&&Sn(vt)&&ze.splice(ze.length-1,1),ze},G=(ze,dt,vt)=>{const St=[];for(;ze&&ze!==vt;ze=ze[dt])St.push(ze);return St},ae=(ze,dt)=>n.getParent(ze,vt=>vt.parentNode===dt,dt),fe=(ze,dt,vt)=>{const St=vt?"nextSibling":"previousSibling";for(let Mt=ze,dn=Mt.parentNode;Mt&&Mt!==dt;Mt=dn){dn=Mt.parentNode;const Hn=G(Mt===ze?Mt:Mt[St],St);Hn.length&&(vt||Hn.reverse(),c(B(Hn)))}};if(w===R)return c(B([w]));const be=(m=n.findCommonAncestor(w,R))!==null&&m!==void 0?m:n.getRoot();if(n.isChildOf(w,R))return fe(w,be,!0);if(n.isChildOf(R,w))return fe(R,be);const Be=ae(w,be)||w,Ye=ae(R,be)||R;fe(w,Be,!0);const De=G(Be===w?Be:Be.nextSibling,"nextSibling",Ye===R?Ye.nextSibling:Ye);De.length&&c(B(De)),fe(R,Ye)},gP=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],nx=n=>ol(n)&&Wc(n)===Ft,pP=(n,i,c,m)=>fi(i).fold(()=>"skipping",p=>m==="br"||nx(i)?"valid":JC(i)?"existing":qc(i.dom)?"caret":Wt(gP,w=>Du(i,w))?"valid-block":!Om(n,c,m)||!Om(n,ei(p),c)?"invalid-child":"valid"),WE=(n,i)=>{const c=z0(n.dom,i,[{inline:"span"}]);i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset),n.selection.setRng(i)},UE=(n,i,c,m,p,w)=>{const{uid:x=i,...R}=c;Ju(n,id()),Pr(n,`${Kp()}`,x),Pr(n,`${uf()}`,m);const{attributes:B={},classes:G=[]}=p(x,R);if(Ku(n,B),Wv(n,G),w){G.length>0&&Pr(n,`${S0()}`,G.join(","));const ae=bs(B);ae.length>0&&Pr(n,`${C0()}`,ae.join(","))}},YE=n=>{zc(n,id()),Vi(n,`${Kp()}`),Vi(n,`${uf()}`),Vi(n,`${ib()}`);const i=za(n,`${C0()}`).map(m=>m.split(",")).getOr([]),c=za(n,`${S0()}`).map(m=>m.split(",")).getOr([]);Ne(i,m=>Vi(n,m)),Uy(n,c),Vi(n,`${S0()}`),Vi(n,`${C0()}`)},oS=(n,i,c,m,p)=>{const w=Ge.fromTag("span",n);return UE(w,i,c,m,p,!1),w},ox=(n,i,c,m,p,w)=>{const x=[],R=oS(n.getDoc(),c,w,m,p),B=_h(),G=()=>{B.clear()},ae=()=>B.get().getOrThunk(()=>{const Ye=ug(R);return x.push(Ye),B.set(Ye),Ye}),fe=Ye=>{Ne(Ye,be)},be=Ye=>{switch(pP(n,Ye,"span",ei(Ye))){case"invalid-child":{G();const ze=Da(Ye);fe(ze),G();break}case"valid-block":{G(),UE(Ye,c,w,m,p,!0);break}case"valid":{const ze=ae();e0(Ye,ze);break}}},Be=Ye=>{const De=gt(Ye,Ge.fromDom);fe(De)};return c1(n.dom,i,Ye=>{G(),Be(Ye)}),x},Mi=(n,i,c,m)=>{n.undoManager.transact(()=>{const p=n.selection,w=p.getRng(),x=xb(n).length>0,R=Li("mce-annotation");if(w.collapsed&&!x&&WE(n,w),p.getRng().collapsed&&!x){const B=oS(n.getDoc(),R,m,i,c.decorate);Pf(B,Gr),p.getRng().insertNode(B.dom),p.select(B.dom)}else QE(p,!1,()=>{jk(n,B=>{ox(n,B,R,i,c.decorate,m)})})})},u1=n=>{const i=Vv();EE(n,i);const c=u_(n,i),m=Ec("span"),p=w=>{Ne(w,x=>{m(x)?Kl(x):YE(x)})};return{register:(w,x)=>{i.register(w,x)},annotate:(w,x)=>{i.lookup(w).each(R=>{Mi(n,w,R,x)})},annotationChanged:(w,x)=>{c.addListener(w,x)},remove:w=>{Vy(n,he.some(w)).each(({elements:x})=>{const R=n.selection.getBookmark();p(x),n.selection.moveToBookmark(R)})},removeAll:w=>{const x=n.selection.getBookmark();ln(Wy(n,w),(R,B)=>{p(R)}),n.selection.moveToBookmark(x)},getAll:w=>{const x=Wy(n,w);return vs(x,R=>gt(R,B=>B.dom))}}},_O=n=>({getBookmark:Re(sP,n),moveToBookmark:Re(rP,n)});_O.isBookmarkNode=Wd;const sx=(n,i,c)=>c.collapsed?!1:Wt(c.getClientRects(),m=>ab(m,n,i)),XE=(n,i)=>n.dispatch("PreProcess",i),rx=(n,i)=>n.dispatch("PostProcess",i),jE=n=>{n.dispatch("remove")},sS=n=>{n.dispatch("detach")},bP=(n,i)=>{n.dispatch("SwitchMode",{mode:i})},vP=(n,i,c,m,p)=>{n.dispatch("ObjectResizeStart",{target:i,width:c,height:m,origin:p})},qE=(n,i,c,m,p)=>{n.dispatch("ObjectResized",{target:i,width:c,height:m,origin:p})},OP=n=>{n.dispatch("PreInit")},ix=n=>{n.dispatch("PostRender")},SO=n=>{n.dispatch("Init")},CO=(n,i)=>{n.dispatch("PlaceholderToggle",{state:i})},rS=(n,i,c)=>{n.dispatch(i,c)},GE=(n,i,c,m)=>{n.dispatch("FormatApply",{format:i,node:c,vars:m})},Mh=(n,i,c,m)=>{n.dispatch("FormatRemove",{format:i,node:c,vars:m})},Kc=(n,i)=>n.dispatch("BeforeSetContent",i),wu=(n,i)=>n.dispatch("SetContent",i),vp=(n,i)=>n.dispatch("BeforeGetContent",i),yP=(n,i)=>n.dispatch("GetContent",i),wP=(n,i)=>{n.dispatch("AutocompleterStart",i)},_P=(n,i)=>{n.dispatch("AutocompleterUpdate",i)},ir=n=>{n.dispatch("AutocompleterEnd")},SP=(n,i,c)=>n.dispatch("PastePreProcess",{content:i,internal:c}),KE=(n,i,c)=>n.dispatch("PastePostProcess",{node:i,internal:c}),iS=(n,i)=>n.dispatch("PastePlainTextToggle",{state:i}),CP=(n,i)=>n.dispatch("EditableRootStateChange",{state:i}),to={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:n=>n.shiftKey||n.ctrlKey||n.altKey||to.metaKeyPressed(n),metaKeyPressed:n=>Gn.os.isMacOS()||Gn.os.isiOS()?n.metaKey:n.ctrlKey&&!n.altKey},V0="data-mce-selected",kP="table,img,figure.image,hr,video,span.mce-preview-object,details",JE=Math.abs,aS=Math.round,F2={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},ax=n=>n.type==="longpress"||n.type.indexOf("touch")===0,lx=(n,i)=>{const c=i.dom,m=i.getDoc(),p=document,w=i.getBody();let x,R,B,G,ae,fe,be,Be,Ye,De,ze,dt,vt,St,Mt,dn,Hn;const Nn=En=>ve(En)&&(Ui(En)||c.is(En,"figure.image")),Lt=En=>of(En)||c.hasClass(En,"mce-preview-object"),Zt=(En,jo)=>{if(ax(En)){const Ks=En.touches[0];return Nn(En.target)&&!sx(Ks.clientX,Ks.clientY,jo)}else return Nn(En.target)&&!sx(En.clientX,En.clientY,jo)},yn=En=>{const jo=En.target;Zt(En,i.selection.getRng())&&!En.isDefaultPrevented()&&i.selection.select(jo)},go=En=>c.hasClass(En,"mce-preview-object")&&ve(En.firstElementChild)?[En,En.firstElementChild]:c.is(En,"figure.image")?[En.querySelector("img")]:[En],Po=En=>{const jo=d2(i);return!jo||En.getAttribute("data-mce-resize")==="false"||En===i.getBody()?!1:c.hasClass(En,"mce-preview-object")&&ve(En.firstElementChild)?Du(Ge.fromDom(En.firstElementChild),jo):Du(Ge.fromDom(En),jo)},Cs=En=>Lt(En)?c.create("img",{src:Gn.transparentSrc}):En.cloneNode(!0),Ws=(En,jo,Ks)=>{if(ve(Ks)){const Kr=go(En);Ne(Kr,co=>{co.style[jo]||!i.schema.isValid(co.nodeName.toLowerCase(),jo)?c.setStyle(co,jo,Ks):c.setAttrib(co,jo,""+Ks)})}},Ir=(En,jo,Ks)=>{Ws(En,"width",jo),Ws(En,"height",Ks)},pi=En=>{let jo,Ks,Kr,co,Us;jo=En.screenX-fe,Ks=En.screenY-be,St=jo*G[2]+De,Mt=Ks*G[3]+ze,St=St<5?5:St,Mt=Mt<5?5:Mt,(Nn(x)||Lt(x))&&Mc(i)!==!1?Kr=!to.modifierPressed(En):Kr=to.modifierPressed(En),Kr&&(JE(jo)>JE(Ks)?(Mt=aS(St*dt),St=aS(Mt/dt)):(St=aS(Mt/dt),Mt=aS(St*dt))),Ir(R,St,Mt),co=G.startPos.x+jo,Us=G.startPos.y+Ks,co=co>0?co:0,Us=Us>0?Us:0,c.setStyles(B,{left:co,top:Us,display:"block"}),B.innerHTML=St+" × "+Mt,G[2]<0&&R.clientWidth<=St&&c.setStyle(R,"left",Be+(De-St)),G[3]<0&&R.clientHeight<=Mt&&c.setStyle(R,"top",Ye+(ze-Mt)),jo=w.scrollWidth-dn,Ks=w.scrollHeight-Hn,jo+Ks!==0&&c.setStyles(B,{left:co-jo,top:Us-Ks}),vt||(vP(i,x,De,ze,"corner-"+G.name),vt=!0)},ul=()=>{const En=vt;vt=!1,En&&(Ws(x,"width",St),Ws(x,"height",Mt)),c.unbind(m,"mousemove",pi),c.unbind(m,"mouseup",ul),p!==m&&(c.unbind(p,"mousemove",pi),c.unbind(p,"mouseup",ul)),c.remove(R),c.remove(B),c.remove(ae),Il(x),En&&(qE(i,x,St,Mt,"corner-"+G.name),c.setAttrib(x,"style",c.getAttrib(x,"style"))),i.nodeChanged()},Il=En=>{Is();const jo=c.getPos(En,w),Ks=jo.x,Kr=jo.y,co=En.getBoundingClientRect(),Us=co.width||co.right-co.left,ci=co.height||co.bottom-co.top;x!==En&&(Mn(),x=En,St=Mt=0);const Ka=i.dispatch("ObjectSelected",{target:En});Po(En)&&!Ka.isDefaultPrevented()?ln(F2,(Ti,$c)=>{const Fh=Dm=>{const qO=go(x)[0];fe=Dm.screenX,be=Dm.screenY,De=qO.clientWidth,ze=qO.clientHeight,dt=ze/De,G=Ti,G.name=$c,G.startPos={x:Us*Ti[0]+Ks,y:ci*Ti[1]+Kr},dn=w.scrollWidth,Hn=w.scrollHeight,ae=c.add(w,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),c.setStyles(ae,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),R=Cs(x),c.addClass(R,"mce-clonedresizable"),c.setAttrib(R,"data-mce-bogus","all"),R.contentEditable="false",c.setStyles(R,{left:Ks,top:Kr,margin:0}),Ir(R,Us,ci),R.removeAttribute(V0),w.appendChild(R),c.bind(m,"mousemove",pi),c.bind(m,"mouseup",ul),p!==m&&(c.bind(p,"mousemove",pi),c.bind(p,"mouseup",ul)),B=c.add(w,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},De+" × "+ze)};let qd=c.get("mceResizeHandle"+$c);qd&&c.remove(qd),qd=c.add(w,"div",{id:"mceResizeHandle"+$c,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+$c+"-resize; margin:0; padding:0"}),c.bind(qd,"mousedown",Dm=>{Dm.stopImmediatePropagation(),Dm.preventDefault(),Fh(Dm)}),Ti.elm=qd,c.setStyles(qd,{left:Us*Ti[0]+Ks-qd.offsetWidth/2,top:ci*Ti[1]+Kr-qd.offsetHeight/2})}):Mn(!1)},Oc=_0(Il,0),Mn=(En=!0)=>{Oc.cancel(),Is(),x&&En&&x.removeAttribute(V0),ln(F2,(jo,Ks)=>{const Kr=c.get("mceResizeHandle"+Ks);Kr&&(c.unbind(Kr),c.remove(Kr))})},eo=(En,jo)=>c.isChildOf(En,jo),Cr=En=>{if(vt||i.removed||i.composing)return;const jo=En.type==="mousedown"?En.target:n.getNode(),Ks=it(Ge.fromDom(jo),kP).map(co=>co.dom).filter(co=>c.isEditable(co.parentElement)).getOrUndefined(),Kr=ve(Ks)?c.getAttrib(Ks,V0,"1"):"1";if(Ne(c.select(`img[${V0}],hr[${V0}]`),co=>{co.removeAttribute(V0)}),ve(Ks)&&eo(Ks,w)&&i.hasFocus()){ko();const co=n.getStart(!0);if(eo(co,Ks)&&eo(n.getEnd(!0),Ks)){c.setAttrib(Ks,V0,Kr),Oc.throttle(Ks);return}}Mn()},Is=()=>{ln(F2,En=>{En.elm&&(c.unbind(En.elm),delete En.elm)})},ko=()=>{try{i.getDoc().execCommand("enableObjectResizing",!1,"false")}catch{}};return i.on("init",()=>{ko(),i.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",Cr),i.on("keyup compositionend",En=>{x&&x.nodeName==="TABLE"&&Cr(En)}),i.on("hide blur",Mn),i.on("contextmenu longpress",yn,!0)}),i.on("remove",Is),{isResizable:Po,showResizeRect:Il,hideResizeRect:Mn,updateResizeRect:Cr,destroy:()=>{Oc.cancel(),x=R=ae=null}}},xP=(n,i)=>{i.fold(c=>{n.setStartBefore(c.dom)},(c,m)=>{n.setStart(c.dom,m)},c=>{n.setStartAfter(c.dom)})},OI=(n,i)=>{i.fold(c=>{n.setEndBefore(c.dom)},(c,m)=>{n.setEnd(c.dom,m)},c=>{n.setEndAfter(c.dom)})},eA=(n,i,c)=>{const m=n.document.createRange();return xP(m,i),OI(m,c),m},tA=(n,i,c,m,p)=>{const w=n.document.createRange();return w.setStart(i.dom,c),w.setEnd(m.dom,p),w},lS=pg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),TP=(n,i,c)=>i(Ge.fromDom(c.startContainer),c.startOffset,Ge.fromDom(c.endContainer),c.endOffset),Jo=(n,i)=>i.match({domRange:c=>({ltr:We(c),rtl:he.none}),relative:(c,m)=>({ltr:Ut(()=>eA(n,c,m)),rtl:Ut(()=>he.some(eA(n,m,c)))}),exact:(c,m,p,w)=>({ltr:Ut(()=>tA(n,c,m,p,w)),rtl:Ut(()=>he.some(tA(n,p,w,c,m)))})}),EP=(n,i)=>{const c=i.ltr();return c.collapsed?i.rtl().filter(p=>p.collapsed===!1).map(p=>lS.rtl(Ge.fromDom(p.endContainer),p.endOffset,Ge.fromDom(p.startContainer),p.startOffset)).getOrThunk(()=>TP(n,lS.ltr,c)):TP(n,lS.ltr,c)},AP=(n,i)=>{const c=Jo(n,i);return EP(n,c)};lS.ltr,lS.rtl;const Q2={create:(n,i,c,m)=>({start:n,soffset:i,finish:c,foffset:m})},cS=(n,i,c)=>{var m,p;return he.from((p=(m=n.dom).caretPositionFromPoint)===null||p===void 0?void 0:p.call(m,i,c)).bind(w=>{if(w.offsetNode===null)return he.none();const x=n.dom.createRange();return x.setStart(w.offsetNode,w.offset),x.collapse(),he.some(x)})},DP=(n,i,c)=>{var m,p;return he.from((p=(m=n.dom).caretRangeFromPoint)===null||p===void 0?void 0:p.call(m,i,c))},PP=(()=>document.caretPositionFromPoint?cS:document.caretRangeFromPoint?DP:he.none)(),MP=(n,i,c)=>{const m=Ge.fromDom(n.document);return PP(m,i,c).map(p=>Q2.create(Ge.fromDom(p.startContainer),p.startOffset,Ge.fromDom(p.endContainer),p.endOffset))},Z2=pg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),cx=(n,i,c,m)=>n.fold(i,c,m),nA=n=>n.fold(Ct,Ct,Ct),ux=Z2.before,fx=Z2.on,oA=Z2.after,f1={before:ux,on:fx,after:oA,cata:cx,getStart:nA},kO=pg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),dx=n=>kO.exact(n.start,n.soffset,n.finish,n.foffset),RP=n=>n.match({domRange:i=>Ge.fromDom(i.startContainer),relative:(i,c)=>f1.getStart(i),exact:(i,c,m,p)=>i}),$P=kO.domRange,Nr=kO.relative,hx=kO.exact,Op=n=>{const i=RP(n);return Yr(i)},yp=Q2.create,d1={domRange:$P,relative:Nr,exact:hx,exactFromRange:dx,getWin:Op,range:yp},Hu=(n,i)=>{const c=ei(n);return c==="input"?f1.after(n):wt(["br","img"],c)?i===0?f1.before(n):f1.after(n):f1.on(n,i)},uS=(n,i)=>{const c=n.fold(f1.before,Hu,f1.after),m=i.fold(f1.before,Hu,f1.after);return d1.relative(c,m)},xO=(n,i,c,m)=>{const p=Hu(n,i),w=Hu(c,m);return d1.relative(p,w)},fS=n=>n.match({domRange:i=>{const c=Ge.fromDom(i.startContainer),m=Ge.fromDom(i.endContainer);return xO(c,i.startOffset,m,i.endOffset)},relative:uS,exact:xO}),W0=(n,i)=>{const m=(i||document).createDocumentFragment();return Ne(n,p=>{m.appendChild(p.dom)}),Ge.fromDom(m)},NP=n=>{const i=d1.getWin(n).dom,c=(p,w,x,R)=>tA(i,p,w,x,R),m=fS(n);return AP(i,m).match({ltr:c,rtl:c})},wI=(n,i,c)=>MP(n,i,c),IP=(n,i,c)=>{const m=Yr(Ge.fromDom(c));return wI(m.dom,n,i).map(p=>{const w=c.createRange();return w.setStart(p.start.dom,p.soffset),w.setEnd(p.finish.dom,p.foffset),w}).getOrUndefined()},sA=(n,i)=>ve(n)&&ve(i)&&n.startContainer===i.startContainer&&n.startOffset===i.startOffset&&n.endContainer===i.endContainer&&n.endOffset===i.endOffset,ar=(n,i,c)=>{let m=n;for(;m&&m!==i;){if(c(m))return m;m=m.parentNode}return null},_m=(n,i,c)=>ar(n,i,c)!==null,TO=(n,i,c)=>_m(n,i,m=>m.nodeName===c),BP=(n,i)=>_r(n)&&!_m(n,i,qc),U0=(n,i,c)=>{const m=i.parentNode;if(m){const p=new wi(i,n.getParent(m,n.isBlock)||n.getRoot());let w;for(;w=p[c?"prev":"next"]();)if(mi(w))return!0}return!1},dr=(n,i)=>{var c;return((c=n.previousSibling)===null||c===void 0?void 0:c.nodeName)===i},LP=(n,i)=>{let c=i;for(;c&&c!==n;){if(Es(c))return!0;c=c.parentNode}return!1},dS=(n,i,c,m,p)=>{const w=n.getRoot(),x=n.schema.getNonEmptyElements(),R=p.parentNode;let B,G;if(!R)return he.none();const ae=n.getParent(R,n.isBlock)||w;if(m&&mi(p)&&i&&n.isEmpty(ae))return he.some(zt(R,n.nodeIndex(p)));const fe=new wi(p,ae);for(;G=fe[m?"prev":"next"]();){if(n.getContentEditableParent(G)==="false"||BP(G,w))return he.none();if(Sn(G)&&G.data.length>0)return TO(G,w,"A")?he.none():he.some(zt(G,m?G.data.length:0));if(n.isBlock(G)||x[G.nodeName.toLowerCase()])return he.none();B=G}return ch(B)?he.none():c&&B?he.some(zt(B,0)):he.none()},hS=(n,i,c,m)=>{const p=n.getRoot();let w,x=!1,R=c?m.startContainer:m.endContainer,B=c?m.startOffset:m.endOffset;const G=Jn(R)&&B===R.childNodes.length,ae=n.schema.getNonEmptyElements();let fe=c;if(_r(R))return he.none();if(Jn(R)&&B>R.childNodes.length-1&&(fe=!1),nf(R)&&(R=p,B=0),R===p){if(fe&&(w=R.childNodes[B>0?B-1:0],w&&(_r(w)||ae[w.nodeName]||Nu(w))))return he.none();if(R.hasChildNodes()){if(B=Math.min(!fe&&B>0?B-1:B,R.childNodes.length-1),R=R.childNodes[B],B=Sn(R)&&G?R.data.length:0,!i&&R===p.lastChild&&Nu(R)||LP(p,R)||_r(R))return he.none();if(R.hasChildNodes()&&!Nu(R)){w=R;const be=new wi(R,p);do{if(Es(w)||_r(w)){x=!1;break}if(Sn(w)&&w.data.length>0){B=fe?0:w.data.length,R=w,x=!0;break}if(ae[w.nodeName.toLowerCase()]&&!xl(w)){B=n.nodeIndex(w),R=w.parentNode,fe||B++,x=!0;break}}while(w=fe?be.next():be.prev())}}}return i&&(Sn(R)&&B===0&&dS(n,G,i,!0,R).each(be=>{R=be.container(),B=be.offset(),x=!0}),Jn(R)&&(w=R.childNodes[B],w||(w=R.childNodes[B-1]),w&&mi(w)&&!dr(w,"A")&&!U0(n,w,!1)&&!U0(n,w,!0)&&dS(n,G,i,!0,w).each(be=>{R=be.container(),B=be.offset(),x=!0}))),fe&&!i&&Sn(R)&&B===R.data.length&&dS(n,G,i,!1,R).each(be=>{R=be.container(),B=be.offset(),x=!0}),x&&R?he.some(zt(R,B)):he.none()},mS=(n,i)=>{const c=i.collapsed,m=i.cloneRange(),p=zt.fromRangeStart(i);return hS(n,c,!0,m).each(w=>{(!c||!zt.isAbove(p,w))&&m.setStart(w.container(),w.offset())}),c||hS(n,c,!1,m).each(w=>{m.setEnd(w.container(),w.offset())}),c&&m.collapse(!0),sA(i,m)?he.none():he.some(m)},h1=(n,i)=>n.splitText(i),wp=n=>{let i=n.startContainer,c=n.startOffset,m=n.endContainer,p=n.endOffset;if(i===m&&Sn(i)){if(c>0&&cc){p=p-c;const w=h1(m,p).previousSibling;i=m=w,p=w.data.length,c=0}else p=0}else if(Sn(i)&&c>0&&c0&&p({walk:(w,x)=>c1(n,w,x),split:wp,expand:(w,x={type:"word"})=>{if(x.type==="word"){const R=z0(n,w,[{inline:"span"}]),B=n.createRng();return B.setStart(R.startContainer,R.startOffset),B.setEnd(R.endContainer,R.endOffset),B}return w},normalize:w=>mS(n,w).fold(Xe,x=>(w.setStart(x.startContainer,x.startOffset),w.setEnd(x.endContainer,x.endOffset),!0))});O.compareRanges=sA,O.getCaretRangeFromPoint=IP,O.getSelectedNode=lb,O.getNode=ad;const D=((n,i)=>{const c=(R,B)=>{if(!ot(B)&&!B.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+B);const G=R.dom;ss(G)&&(G.style[n]=B+"px")},m=R=>{const B=i(R);if(B<=0||B===null){const G=Bi(R,n);return parseFloat(G)||0}return B},p=m,w=(R,B)=>zn(B,(G,ae)=>{const fe=Bi(R,ae),be=fe===void 0?0:parseInt(fe,10);return isNaN(be)?G:G+be},0);return{set:c,get:m,getOuter:p,aggregate:w,max:(R,B,G)=>{const ae=w(R,G);return B>ae?B-ae:0}}})("height",n=>{const i=n.dom;return Ed(n)?i.getBoundingClientRect().height:i.offsetHeight}),N=n=>D.get(n),X=()=>Ge.fromDom(document),se=(n,i)=>n.view(i).fold(We([]),m=>{const p=n.owner(m),w=se(n,p);return[m].concat(w)}),pe=(n,i)=>{const c=i.owner(n);return se(i,c)};var st=Object.freeze({__proto__:null,view:n=>{var i;return(n.dom===document?he.none():he.from((i=n.dom.defaultView)===null||i===void 0?void 0:i.frameElement)).map(Ge.fromDom)},owner:n=>Ao(n)});const kt=n=>{const i=X(),c=tf(i),m=pe(n,st),p=$u(n),w=Dn(m,(x,R)=>{const B=$u(R);return{left:x.left+B.left,top:x.top+B.top}},{left:0,top:0});return Xg(w.left+p.left+c.left,w.top+p.top+c.top)},fn=n=>ei(n)==="textarea",jn=(n,i)=>n.dispatch("ScrollIntoView",i).isDefaultPrevented(),Un=(n,i)=>{n.dispatch("AfterScrollIntoView",i)},sn=(n,i)=>{const c=Da(n);if(c.length===0||fn(n))return{element:n,offset:i};if(i{const c=xy(n),m=N(n);return{element:n,bottom:c.top+m,height:m,pos:c,cleanup:i}},en=(n,i)=>{const c=sn(n,i),m=Ge.fromHtml(''+Ft+"");return Ca(c.element,m),Yn(m,()=>wr(m))},mo=n=>Yn(Ge.fromDom(n),mt),cs=(n,i,c,m)=>{wl(n,(p,w)=>da(n,i,c,m),c)},Ds=(n,i,c,m,p)=>{const w={elm:m.element.dom,alignToTop:p};if(jn(n,w))return;const x=tf(i).top;c(n,i,x,m,p),Un(n,w)},da=(n,i,c,m)=>{const p=Ge.fromDom(n.getBody()),w=Ge.fromDom(n.getDoc());Wi(p);const x=en(Ge.fromDom(c.startContainer),c.startOffset);Ds(n,w,i,x,m),x.cleanup()},Rl=(n,i,c,m)=>{const p=Ge.fromDom(n.getDoc());Ds(n,p,c,mo(i),m)},wl=(n,i,c)=>{const m=c.startContainer,p=c.startOffset,w=c.endContainer,x=c.endOffset;i(Ge.fromDom(m),Ge.fromDom(w));const R=n.dom.createRng();R.setStart(m,p),R.setEnd(w,x),n.selection.setRng(c)},zu=(n,i,c,m,p)=>{const w=i.pos;if(m)n0(w.left,w.top,p);else{const x=w.top-c+i.height;n0(-n.getBody().getBoundingClientRect().left,x,p)}},Y0=(n,i,c,m,p,w)=>{const x=m+c,R=p.pos.top,B=p.bottom,G=B-R>=m;Rx?zu(n,p,m,G?w!==!1:w===!0,i):B>x&&!G&&zu(n,p,m,w===!0,i)},H2=(n,i,c,m,p)=>{const w=Yr(i).dom.innerHeight;Y0(n,i,c,w,m,p)},gS=(n,i,c,m,p)=>{const w=Yr(i).dom.innerHeight;Y0(n,i,c,w,m,p);const x=kt(m.element),R=td(window);x.topR.bottom&&o0(m.element,p===!0)},pS=(n,i,c)=>cs(n,H2,i,c),ki=(n,i,c)=>Rl(n,i,H2,c),Vu=(n,i,c)=>cs(n,gS,i,c),bf=(n,i,c)=>Rl(n,i,gS,c),Sm=(n,i,c)=>{(n.inline?ki:bf)(n,i,c)},vf=(n,i,c)=>{(n.inline?pS:Vu)(n,i,c)},X0=n=>n.dom.focus(),Wu=n=>{const i=ql(n).dom;return n.dom===i.activeElement},z2=(n=X())=>he.from(n.dom.activeElement).map(Ge.fromDom),V2=n=>z2(ql(n)).filter(i=>n.dom.contains(i.dom)),wg=(n,i)=>{const c=ol(i)?Wc(i).length:Da(i).length+1;return n>c?c:n<0?0:n},vc=n=>d1.range(n.start,wg(n.soffset,n.start),n.finish,wg(n.foffset,n.finish)),mx=(n,i)=>!Dd(i.dom)&&(cn(n,i)||bt(n,i)),rA=n=>i=>mx(n,i.start)&&mx(n,i.finish),iA=n=>n.inline||Gn.browser.isFirefox(),aA=n=>d1.range(Ge.fromDom(n.startContainer),n.startOffset,Ge.fromDom(n.endContainer),n.endOffset),FP=n=>{const i=n.getSelection();return(!i||i.rangeCount===0?he.none():he.from(i.getRangeAt(0))).map(aA)},gx=n=>{const i=Yr(n);return FP(i.dom).filter(rA(n))},QP=(n,i)=>he.from(i).filter(rA(n)).map(vc),W2=n=>{const i=document.createRange();try{return i.setStart(n.start.dom,n.soffset),i.setEnd(n.finish.dom,n.foffset),he.some(i)}catch{return he.none()}},ZP=n=>{const i=iA(n)?gx(Ge.fromDom(n.getBody())):he.none();n.bookmark=i.isSome()?i:n.bookmark},lA=n=>(n.bookmark?n.bookmark:he.none()).bind(c=>QP(Ge.fromDom(n.getBody()),c)).bind(W2),_I=n=>{lA(n).each(i=>n.selection.setRng(i))},SI={isEditorUIElement:n=>{const i=n.className.toString();return i.indexOf("tox-")!==-1||i.indexOf("mce-")!==-1}},_V=(n,i)=>(ot(i)||(i=0),setTimeout(n,i)),zP=(n,i)=>(ot(i)||(i=0),setInterval(n,i)),_g={setEditorTimeout:(n,i,c)=>_V(()=>{n.removed||i()},c),setEditorInterval:(n,i,c)=>{const m=zP(()=>{n.removed?clearInterval(m):i()},c);return m}},CI=n=>n.type==="nodechange"&&n.selectionChange,kI=(n,i)=>{const c=()=>{i.throttle()};Qr.DOM.bind(document,"mouseup",c),n.on("remove",()=>{Qr.DOM.unbind(document,"mouseup",c)})},xI=(n,i)=>{n.on("mouseup touchend",c=>{i.throttle()})},SV=(n,i)=>{xI(n,i),n.on("keyup NodeChange AfterSetSelectionRange",c=>{CI(c)||ZP(n)})},CV=n=>{const i=_0(()=>{ZP(n)},0);n.on("init",()=>{n.inline&&kI(n,i),SV(n,i)}),n.on("remove",()=>{i.cancel()})};let bS;const VP=Qr.DOM,cA=n=>Jn(n)&&SI.isEditorUIElement(n),uA=n=>{const i=n.classList;return i!==void 0?i.contains("tox-edit-area")||i.contains("tox-edit-area__iframe")||i.contains("mce-content-body"):!1},px=(n,i)=>{const c=P_(n);return VP.getParent(i,p=>cA(p)||(c?n.dom.is(p,c):!1))!==null},fA=n=>{try{const i=ql(Ge.fromDom(n.getElement()));return z2(i).fold(()=>document.body,c=>c.dom)}catch{return document.body}},TI=(n,i)=>{const c=i.editor;CV(c);const m=(p,w)=>{if(z_(p)&&p.inline!==!0){const x=Ge.fromDom(p.getContainer());w(x,"tox-edit-focus")}};c.on("focusin",()=>{const p=n.focusedEditor;uA(fA(c))&&m(c,Ju),p!==c&&(p&&p.dispatch("blur",{focusedEditor:c}),n.setActive(c),n.focusedEditor=c,c.dispatch("focus",{blurredEditor:p}),c.focus(!0))}),c.on("focusout",()=>{_g.setEditorTimeout(c,()=>{const p=n.focusedEditor;(!uA(fA(c))||p!==c)&&m(c,zc),!px(c,fA(c))&&p===c&&(c.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})}),bS||(bS=p=>{const w=n.activeEditor;w&&tm(p).each(x=>{const R=x;R.ownerDocument===document&&R!==document.body&&!px(w,R)&&n.focusedEditor===w&&(w.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})},VP.bind(document,"focusin",bS))},kV=(n,i)=>{n.focusedEditor===i.editor&&(n.focusedEditor=null),!n.activeEditor&&bS&&(VP.unbind(document,"focusin",bS),bS=null)},xV=n=>{n.on("AddEditor",Re(TI,n)),n.on("RemoveEditor",Re(kV,n))},TV=(n,i)=>n.dom.getParent(i,c=>n.dom.getContentEditable(c)==="true"),EV=n=>n.collapsed?he.from(ad(n.startContainer,n.startOffset)).map(Ge.fromDom):he.none(),AV=(n,i)=>EV(i).bind(c=>ja(c)?he.some(c):cn(n,c)?he.none():he.some(n)),EI=(n,i)=>{AV(Ge.fromDom(n.getBody()),i).bind(c=>ll(c.dom)).fold(()=>{n.selection.normalize()},c=>n.selection.setRng(c.toRange()))},WP=n=>{if(n.setActive)try{n.setActive()}catch{n.focus()}else n.focus()},DV=n=>Wu(n)||V2(n).isSome(),PV=n=>ve(n.iframeElement)&&Wu(Ge.fromDom(n.iframeElement)),MV=n=>{const i=n.getBody();return i&&DV(Ge.fromDom(i))},RV=n=>{const i=ql(Ge.fromDom(n.getElement()));return z2(i).filter(c=>!uA(c.dom)&&px(n,c.dom)).isSome()},U2=n=>n.inline?MV(n):PV(n),dA=n=>U2(n)||RV(n),AI=n=>{const i=n.selection,c=n.getBody();let m=i.getRng();n.quirks.refreshContentEditable(),ve(n.bookmark)&&!U2(n)&&lA(n).each(w=>{n.selection.setRng(w),m=w});const p=TV(n,i.getNode());if(p&&n.dom.isChildOf(p,c)){WP(p),EI(n,m),hA(n);return}n.inline||(Gn.browser.isOpera()||WP(c),n.getWin().focus()),(Gn.browser.isFirefox()||n.inline)&&(WP(c),EI(n,m)),hA(n)},hA=n=>n.editorManager.setActive(n),$V=(n,i)=>{n.removed||(i?hA(n):AI(n))},DI=(n,i,c,m,p)=>{const w=c?i.startContainer:i.endContainer,x=c?i.startOffset:i.endOffset;return he.from(w).map(Ge.fromDom).map(R=>!m||!i.collapsed?ef(R,p(R,x)).getOr(R):R).bind(R=>kl(R)?he.some(R):fi(R).filter(kl)).map(R=>R.dom).getOr(n)},PI=(n,i,c=!1)=>DI(n,i,!0,c,(m,p)=>Math.min(dc(m),p)),MI=(n,i,c=!1)=>DI(n,i,!1,c,(m,p)=>p>0?p-1:p),RI=(n,i)=>{const c=n;for(;n&&Sn(n)&&n.length===0;)n=i?n.nextSibling:n.previousSibling;return n||c},NV=(n,i)=>{if(!i)return n;let c=i.startContainer,m=i.endContainer;const p=i.startOffset,w=i.endOffset;let x=i.commonAncestorContainer;i.collapsed||(c===m&&w-p<2&&c.hasChildNodes()&&(x=c.childNodes[p]),Sn(c)&&Sn(m)&&(c.length===p?c=RI(c.nextSibling,!0):c=c.parentNode,w===0?m=RI(m.previousSibling,!1):m=m.parentNode,c&&c===m&&(x=c)));const R=Sn(x)?x.parentNode:x;return Jn(R)?R:n},$I=(n,i,c,m)=>{const p=[],w=n.getRoot(),x=n.getParent(c||PI(w,i,i.collapsed),n.isBlock),R=n.getParent(m||MI(w,i,i.collapsed),n.isBlock);if(x&&x!==w&&p.push(x),x&&R&&x!==R){let B;const G=new wi(x,w);for(;(B=G.next())&&B!==R;)n.isBlock(B)&&p.push(B)}return R&&x!==R&&R!==w&&p.push(R),p},IV=(n,i,c)=>he.from(i).bind(m=>he.from(m.parentNode).map(p=>{const w=n.nodeIndex(m),x=n.createRng();return x.setStart(p,w),x.setEnd(p,w+1),c&&(Xk(n,x,m,!0),Xk(n,x,m,!1)),x})),mA=(n,i)=>gt(i,c=>{const m=n.dispatch("GetSelectionRange",{range:c});return m.range!==c?m.range:c}),NI=n=>ei(n)==="img"?1:nd(n).fold(()=>Da(n).length,i=>i.length),BV=n=>nd(n).filter(i=>i.trim().length!==0||i.indexOf(Gr)>-1).isSome(),LV=n=>Pi(n)&&Fl(n,"contenteditable")==="false",FV=["img","br"],II=n=>BV(n)||wt(FV,ei(n))||LV(n),QV=n=>ce(n,II),ZV=n=>HV(n,II),HV=(n,i)=>{const c=m=>{const p=Da(m);for(let w=p.length-1;w>=0;w--){const x=p[w];if(i(x))return he.some(x);const R=c(x);if(R.isSome())return R}return he.none()};return c(n)},BI="[data-mce-autocompleter]",zV=(n,i)=>{if(LI(Ge.fromDom(n.getBody())).isNone()){const c=Ge.fromHtml('',n.getDoc());na(c,Ge.fromDom(i.extractContents())),i.insertNode(c.dom),fi(c).each(m=>m.dom.normalize()),ZV(c).map(m=>{n.selection.setCursorLocation(m.dom,NI(m))})}},VV=n=>it(n,BI),LI=n=>Ke(n,BI),WV=(n,i)=>LI(i).each(c=>{const m=n.selection.getBookmark();Kl(c),n.selection.moveToBookmark(m)}),UV={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},gA=(n,i,c)=>{const m=c?"lastChild":"firstChild",p=c?"prev":"next";if(n[m])return n[m];if(n!==i){let w=n[p];if(w)return w;for(let x=n.parent;x&&x!==i;x=x.parent)if(w=x[p],w)return w}},YV=n=>{var i;const c=(i=n.value)!==null&&i!==void 0?i:"";if(!eg(c))return!1;const m=n.parent;return!(m&&(m.name!=="span"||m.attr("style"))&&/^[ ]+$/.test(c))},FI=n=>{const i=n.name==="a"&&!n.attr("href")&&n.attr("id");return n.attr("name")||n.attr("id")&&!n.firstChild||n.attr("data-mce-bookmark")||i};class Xd{static create(i,c){const m=new Xd(i,UV[i]||1);return c&&ln(c,(p,w)=>{m.attr(w,p)}),m}constructor(i,c){this.name=i,this.type=c,c===1&&(this.attributes=[],this.attributes.map={})}replace(i){const c=this;return i.parent&&i.remove(),c.insert(i,c),c.remove(),c}attr(i,c){const m=this;if(!L(i))return ve(i)&&ln(i,(w,x)=>{m.attr(x,w)}),m;const p=m.attributes;if(p){if(c!==void 0){if(c===null){if(i in p.map){delete p.map[i];let w=p.length;for(;w--;)if(p[w].name===i)return p.splice(w,1),m}return m}if(i in p.map){let w=p.length;for(;w--;)if(p[w].name===i){p[w].value=c;break}}else p.push({name:i,value:c});return p.map[i]=c,m}return p.map[i]}}clone(){const i=this,c=new Xd(i.name,i.type),m=i.attributes;if(m){const p=[];p.map={};for(let w=0,x=m.length;w/^\s*\[if [\w\W]+\]>.*/.test(n.substr(i)),QI=(n,i,c=0)=>{const m=n.toLowerCase();if(m.indexOf("[if ",c)!==-1&&XV(m,c)){const p=m.indexOf("[endif]",c);return m.indexOf(">",p)}else if(i){const p=m.indexOf(">",c);return p!==-1?p:m.length}else{const p=/--!?>/g;p.lastIndex=c;const w=p.exec(n);return w?w.index+w[0].length:m.length}},No=(n,i,c)=>{const m=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,p=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,w=n.getVoidElements();let x=1,R=c;for(;x!==0;)for(m.lastIndex=R;;){const B=m.exec(i);if(B===null)return R;if(B[1]==="!"){Ar(B[2],"--")?R=QI(i,!1,B.index+3):R=QI(i,!0,B.index+1);break}else{p.lastIndex=m.lastIndex;const G=p.exec(i);if(Y(G)||G.index!==m.lastIndex)continue;B[1]==="/"?x-=1:un(w,B[2])||(x+=1),R=m.lastIndex+G[0].length;break}}return R},ZI=(n,i)=>{const c=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi");return i.replace(c,"")},UP=(n,i)=>{const c=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,m=n.schema;let p=ZI(n.getTempAttrs(),i);const w=m.getVoidElements();let x;for(;x=c.exec(p);){const R=c.lastIndex,B=x[0].length;let G;w[x[1]]?G=R:G=No(m,p,R),p=p.substring(0,R-B)+p.substring(G),c.lastIndex=R-B}return Bn(p)},jV=UP,pA=n=>{const i=pl(n,"[data-mce-bogus]");Ne(i,c=>{Fl(c,"data-mce-bogus")==="all"?wr(c):au(c)?(Ca(c,Ge.fromText(nn)),wr(c)):Kl(c)})},HI=n=>{const i=pl(n,"input");Ne(i,c=>{Vi(c,"name")})},qV=(n,i)=>{const c=jc(n),m=new RegExp(`^(<${c}[^>]*>( | |\\s|\xA0|
|)<\\/${c}>[\r +]*|
[\r +]*)$`);return i.replace(m,"")},GV=(n,i)=>{const c=n.getDoc(),m=ql(Ge.fromDom(n.getBody())),p=Ge.fromTag("div",c);Pr(p,"data-mce-bogus","all"),ua(p,{position:"fixed",left:"-9999999px",top:"0"}),Pf(p,i.innerHTML),pA(p),HI(p);const w=X1(m);na(w,p);const x=Bn(p.dom.innerText);return wr(p),x},KV=(n,i,c)=>{let m;return i.format==="raw"?m=hn.trim(jV(n.serializer,c.innerHTML)):i.format==="text"?m=GV(n,c):i.format==="tree"?m=n.serializer.serialize(c,i):m=qV(n,n.serializer.serialize(c,i)),i.format!=="text"&&!lu(Ge.fromDom(c))&&L(m)?hn.trim(m):m},JV=(n,i)=>he.from(n.getBody()).fold(We(i.format==="tree"?new Xd("body",11):""),c=>KV(n,i,c)),bx=hn.makeMap,YP=n=>{const i=[];n=n||{};const c=n.indent,m=bx(n.indent_before||""),p=bx(n.indent_after||""),w=op.getEncodeFunc(n.entity_encoding||"raw",n.entities),x=n.element_format!=="xhtml";return{start:(R,B,G)=>{if(c&&m[R]&&i.length>0){const ae=i[i.length-1];ae.length>0&&ae!==` +`&&i.push(` +`)}if(i.push("<",R),B)for(let ae=0,fe=B.length;ae0){const ae=i[i.length-1];ae.length>0&&ae!==` +`&&i.push(` +`)}},end:R=>{let B;i.push(""),c&&p[R]&&i.length>0&&(B=i[i.length-1],B.length>0&&B!==` +`&&i.push(` +`))},text:(R,B)=>{R.length>0&&(i[i.length]=B?R:w(R))},cdata:R=>{i.push("")},comment:R=>{i.push("")},pi:(R,B)=>{B?i.push(""):i.push(""),c&&i.push(` +`)},doctype:R=>{i.push("",c?` +`:"")},reset:()=>{i.length=0},getContent:()=>i.join("").replace(/\n$/,"")}},Y2=(n={},i=yh())=>{const c=YP(n);return n.validate="validate"in n?n.validate:!0,{serialize:p=>{const w=n.validate,x={3:B=>{var G;c.text((G=B.value)!==null&&G!==void 0?G:"",B.raw)},8:B=>{var G;c.comment((G=B.value)!==null&&G!==void 0?G:"")},7:B=>{c.pi(B.name,B.value)},10:B=>{var G;c.doctype((G=B.value)!==null&&G!==void 0?G:"")},4:B=>{var G;c.cdata((G=B.value)!==null&&G!==void 0?G:"")},11:B=>{let G=B;if(G=G.firstChild)do R(G);while(G=G.next)}};c.reset();const R=B=>{var G;const ae=x[B.type];if(ae)ae(B);else{const fe=B.name,be=fe in i.getVoidElements();let Be=B.attributes;if(w&&Be&&Be.length>1){const Ye=[];Ye.map={};const De=i.getElementRule(B.name);if(De){for(let ze=0,dt=De.attributesOrder.length;ze{zI.add(i)});const gs=["font","text-decoration","text-emphasis"],XP=(n,i)=>bs(n.parseStyle(n.getAttrib(i,"style"))),xs=n=>zI.has(n),VI=(n,i)=>er(XP(n,i),c=>!xs(c)),pie=n=>Dt(n,i=>Wt(gs,c=>Ar(i,c))),bie=(n,i,c)=>{const m=XP(n,i),p=XP(n,c),w=x=>{var R,B;const G=(R=n.getStyle(i,x))!==null&&R!==void 0?R:"",ae=(B=n.getStyle(c,x))!==null&&B!==void 0?B:"";return yr(G)&&yr(ae)&&G!==ae};return Wt(m,x=>{const R=B=>Wt(B,G=>G===x);if(!R(p)&&R(gs)){const B=pie(p);return Wt(B,w)}else return w(x)})},WI=(n,i,c)=>he.from(c.container()).filter(Sn).exists(m=>{const p=n?0:-1;return i(m.data.charAt(c.offset()+p))}),UI=Re(WI,!0,Ah),YI=Re(WI,!1,Ah),eW=n=>{const i=n.container();return Sn(i)&&(i.data.length===0||Cn(i.data)&&_O.isBookmarkNode(i.parentNode))},EO=(n,i)=>c=>wb(n?0:-1,c).filter(i).isSome(),ns=n=>Ui(n)&&Bi(Ge.fromDom(n),"display")==="block",XI=n=>Es(n)&&!bl(n),tW=EO(!0,ns),nW=EO(!1,ns),j0=EO(!0,of),vS=EO(!1,of),jI=EO(!0,Nu),qI=EO(!1,Nu),AO=EO(!0,XI),q0=EO(!1,XI),oW=n=>n.slice(0,-1),vie=(n,i,c)=>cn(i,n)?oW(nh(n,m=>c(m)||bt(m,i))):[],sW=(n,i)=>vie(n,i,Xe),G0=(n,i)=>[n].concat(sW(n,i)),jP=(n,i,c)=>Nk(n,i,c,eW),GI=(n,i)=>oo(G0(Ge.fromDom(i.container()),n),hc),KI=(n,i,c)=>jP(n,i.dom,c).forall(m=>GI(i,c).fold(()=>!Hd(m,c,i.dom),p=>!Hd(m,c,i.dom)&&cn(p,Ge.fromDom(m.container())))),qP=(n,i,c)=>GI(i,c).fold(()=>jP(n,i.dom,c).forall(m=>!Hd(m,c,i.dom)),m=>jP(n,m.dom,c).isNone()),GP=Re(qP,!1),Ms=Re(qP,!0),JI=Re(KI,!1),bA=Re(KI,!0),eB=n=>Ve(n).exists(au),vx=(n,i,c)=>{const m=Dt(G0(Ge.fromDom(c.container()),i),hc),p=$o(m).getOr(i);return zd(n,p.dom,c).filter(eB)},vA=(n,i)=>Ve(i).exists(au)||vx(!0,n,i).isSome(),OA=(n,i)=>ft(i).exists(au)||vx(!1,n,i).isSome(),tB=Re(vx,!1),rW=Re(vx,!0),KP=n=>zt.isTextPosition(n)&&!n.isAtStart()&&!n.isAtEnd(),nB=(n,i)=>{const c=Dt(G0(Ge.fromDom(i.container()),n),hc);return $o(c).getOr(n)},oB=(n,i)=>KP(i)?YI(i):YI(i)||Zu(nB(n,i).dom,i).exists(YI),sB=(n,i)=>KP(i)?UI(i):UI(i)||Zf(nB(n,i).dom,i).exists(UI),iW=n=>wt(["pre","pre-wrap"],n),JP=n=>Ve(n).bind(i=>Zl(i,kl)).exists(i=>iW(Bi(i,"white-space"))),aW=(n,i)=>Zu(n.dom,i).isNone(),lW=(n,i)=>Zf(n.dom,i).isNone(),cW=(n,i)=>aW(n,i)||lW(n,i)||GP(n,i)||Ms(n,i)||OA(n,i)||vA(n,i),e5=n=>ve(n)&&Es(n)&&Y_(n),yA=(n,i)=>c=>e5(new wi(c,n)[i]()),uW=(n,i)=>{const c=Zf(n.dom,i).getOr(i),m=yA(n.dom,"next");return i.isAtEnd()&&(m(i.container())||m(c.container()))},fW=(n,i)=>{const c=Zu(n.dom,i).getOr(i),m=yA(n.dom,"prev");return i.isAtStart()&&(m(i.container())||m(c.container()))},rB=(n,i)=>JP(i)?!1:cW(n,i)||oB(n,i)||sB(n,i),Ox=(n,i)=>JP(i)?!1:GP(n,i)||JI(n,i)||OA(n,i)||oB(n,i)||fW(n,i),dW=n=>{const i=n.container(),c=n.offset();return Sn(i)&&cJP(i)?!1:Ms(n,i)||bA(n,i)||vA(n,i)||sB(n,i)||uW(n,i),t5=(n,i)=>Ox(n,i)||yx(n,dW(i)),iB=(n,i)=>Gs(n.charAt(i)),n5=(n,i)=>Ah(n.charAt(i)),hW=n=>{const i=n.container();return Sn(i)&&tr(i.data,Gr)},mW=n=>{const i=n.split("");return gt(i,(c,m)=>Gs(c)&&m>0&&m{const m=i.data,p=zt(i,0);return!c&&iB(m,0)&&!t5(n,p)?(i.data=" "+m.slice(1),!0):c&&n5(m,0)&&Ox(n,p)?(i.data=Gr+m.slice(1),!0):!1},gW=n=>{const i=n.data,c=mW(i);return c!==i?(n.data=c,!0):!1},o5=(n,i,c)=>{const m=i.data,p=zt(i,m.length-1);return!c&&iB(m,m.length-1)&&!t5(n,p)?(i.data=m.slice(0,-1)+" ",!0):c&&n5(m,m.length-1)&&yx(n,p)?(i.data=m.slice(0,-1)+Gr,!0):!1},pW=(n,i)=>{const c=i.container();if(!Sn(c))return he.none();if(hW(i)){const m=DO(n,c,!1)||gW(c)||o5(n,c,!1);return ks(m,i)}else if(t5(n,i)){const m=DO(n,c,!0)||o5(n,c,!0);return ks(m,i)}else return he.none()},bW=n=>{const i=Ge.fromDom(n.getBody());n.selection.isCollapsed()&&pW(i,zt.fromRangeStart(n.selection.getRng())).each(c=>{n.selection.setRng(c.toRange())})},s5=(n,i,c)=>{if(c===0)return;const m=Ge.fromDom(n),p=di(m,hc).getOr(m),w=n.data.slice(i,i+c),x=i+c>=n.data.length&&yx(p,zt(n,n.data.length)),R=i===0&&Ox(p,zt(n,0));n.replaceData(i,c,hh(w,4,R,x))},wx=(n,i)=>{const c=n.data.slice(i),m=c.length-nu(c).length;s5(n,i,m)},wA=(n,i)=>{const c=n.data.slice(0,i),m=c.length-ku(c).length;s5(n,i-m,m)},_A=(n,i,c,m=!0)=>{const p=ku(n.data).length,w=m?n:i,x=m?i:n;return m?w.appendData(x.data):w.insertData(0,x.data),wr(Ge.fromDom(x)),c&&wx(w,p),w},hd=(n,i)=>{const c=n.container(),m=n.offset();return!zt.isTextPosition(n)&&c===i.parentNode&&m>zt.before(i).offset()},vW=(n,i)=>hd(i,n)?zt(i.container(),i.offset()-1):i,OW=n=>Sn(n)?zt(n,0):zt.before(n),yW=n=>Sn(n)?zt(n,n.data.length):zt.after(n),aB=n=>Tl(n.previousSibling)?he.some(yW(n.previousSibling)):n.previousSibling?Vd(n.previousSibling):he.none(),lB=n=>Tl(n.nextSibling)?he.some(OW(n.nextSibling)):n.nextSibling?ll(n.nextSibling):he.none(),X2=(n,i)=>he.from(i.previousSibling?i.previousSibling:i.parentNode).bind(c=>Zu(n,zt.before(c))).orThunk(()=>Zf(n,zt.after(i))),wW=(n,i)=>Zf(n,zt.after(i)).orThunk(()=>Zu(n,zt.before(i))),_W=(n,i)=>aB(i).orThunk(()=>lB(i)).orThunk(()=>X2(n,i)),Ba=(n,i)=>lB(i).orThunk(()=>aB(i)).orThunk(()=>wW(n,i)),SA=(n,i,c)=>n?Ba(i,c):_W(i,c),Oie=(n,i,c)=>SA(n,i,c).map(Re(vW,c)),Jc=(n,i,c)=>{c.fold(()=>{n.focus()},m=>{n.selection.setRng(m.toRange(),i)})},ni=n=>i=>i.dom===n,Cm=(n,i)=>i&&un(n.schema.getBlockElements(),ei(i)),SW=n=>{if($a(n)){const i=Ge.fromHtml('
');return Ad(n),na(n,i),he.some(zt.before(i.dom))}else return he.none()},cB=(n,i,c)=>{const m=Sa(n).filter(ol),p=Td(n).filter(ol);return wr(n),Tf(m,p,i,(w,x,R)=>{const B=w.dom,G=x.dom,ae=B.data.length;return _A(B,G,c),R.container()===G?zt(B,ae):R}).orThunk(()=>(c&&(m.each(w=>wA(w.dom,w.dom.length)),p.each(w=>wx(w.dom,0))),i))},r5=(n,i)=>un(n.schema.getTextInlineElements(),ei(i)),K0=(n,i,c,m=!0)=>{const p=Oie(i,n.getBody(),c.dom),w=di(c,Re(Cm,n),ni(n.getBody())),x=cB(c,p,r5(n,c));n.dom.isEmpty(n.getBody())?(n.setContent(""),n.selection.setCursorLocation()):w.bind(SW).fold(()=>{m&&Jc(n,i,x)},R=>{m&&Jc(n,i,he.some(R))})},uB=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,fB=n=>uB.test(n),j2=(n,i)=>Du(Ge.fromDom(i),Xi(n))&&!ig(n.schema,i)&&n.dom.isEditable(i),dB=n=>{var i;return Qr.DOM.getStyle(n,"direction",!0)==="rtl"||fB((i=n.textContent)!==null&&i!==void 0?i:"")},i5=(n,i,c)=>Dt(Qr.DOM.getParents(c.container(),"*",i),n),J0=(n,i,c)=>{const m=i5(n,i,c);return he.from(m[m.length-1])},_p=(n,i,c)=>{const m=pm(i,n),p=pm(c,n);return ve(m)&&m===p},CW=n=>sf(n)||$f(n),Sg=(n,i)=>{const c=i.container(),m=i.offset();return n?or(c)?Sn(c.nextSibling)?zt(c.nextSibling,0):zt.after(c):sf(i)?zt(c,m+1):i:or(c)?Sn(c.previousSibling)?zt(c.previousSibling,c.previousSibling.data.length):zt.before(c):$f(i)?zt(c,m-1):i},kW=Re(Sg,!0),CA=Re(Sg,!1),hB=(n,i)=>{const c=m=>m.stopImmediatePropagation();n.on("beforeinput input",c,!0),n.getDoc().execCommand(i),n.off("beforeinput input",c)},_x=n=>{n.execCommand("delete")},a5=n=>hB(n,"Delete"),OS=n=>hB(n,"ForwardDelete"),Cg=n=>i=>qr(fi(i),n,bt),Sx=n=>mc(n)||Xa(n),xi=(n,i)=>cn(n,i)?Zl(i,Sx,Cg(n)):he.none(),q2=(n,i=!0)=>{n.dom.isEmpty(n.getBody())&&n.setContent("",{no_selection:!i})},l5=(n,i,c)=>ri(ll(c),Vd(c),(m,p)=>{const w=Sg(!0,m),x=Sg(!1,p),R=Sg(!1,i);return n?Zf(c,R).exists(B=>B.isEqual(x)&&i.isEqual(w)):Zu(c,R).exists(B=>B.isEqual(w)&&i.isEqual(x))}).getOr(!0),c5=n=>(Kb(n)?Sa(n):Pu(n)).bind(c5).orThunk(()=>he.some(n)),kA=(n,i,c,m=!0)=>{var p;i.deleteContents();const w=c5(c).getOr(c),x=Ge.fromDom((p=n.dom.getParent(w.dom,n.dom.isBlock))!==null&&p!==void 0?p:c.dom);if(x.dom===n.getBody()?q2(n,m):$a(x)&&(Ae(x),m&&n.selection.setCursorLocation(x.dom,0)),!bt(c,x)){const R=qr(fi(x),c)?[]:Jb(x);Ne(R.concat(Da(c)),B=>{!bt(B,x)&&!cn(B,x)&&$a(B)&&wr(B)})}},u5=n=>i=>bt(n,i),Cx=n=>pl(n,"td,th"),f5=(n,i)=>{const c=G=>bp(Ge.fromDom(G),i),m=c(n.startContainer),p=c(n.endContainer),w=m.isSome(),x=p.isSome(),R=ri(m,p,bt).getOr(!1);return{startTable:m,endTable:p,isStartInTable:w,isEndInTable:x,isSameTable:R,isMultiTable:!R&&w&&x}},yS=(n,i)=>({start:n,end:i}),d5=(n,i,c)=>({rng:n,table:i,cells:c}),wS=pg.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),kx=(n,i)=>it(Ge.fromDom(n),"td,th",i),h5=n=>!bt(n.start,n.end),m5=(n,i)=>bp(n.start,i).bind(c=>bp(n.end,i).bind(m=>ks(bt(c,m),c))),mB=(n,i)=>!h5(n)&&m5(n,i).exists(c=>{const m=c.dom.rows;return m.length===1&&m[0].cells.length===1}),_S=(n,i)=>{const c=kx(n.startContainer,i),m=kx(n.endContainer,i);return ri(c,m,yS)},gB=n=>i=>bp(i,n).bind(c=>Mo(Cx(c)).map(m=>yS(i,m))),g5=n=>i=>bp(i,n).bind(c=>$o(Cx(c)).map(m=>yS(m,i))),p5=n=>i=>m5(i,n).map(c=>d5(i,c,Cx(c))),pB=(n,i,c,m)=>{if(c.collapsed||!n.forall(h5))return he.none();if(i.isSameTable){const p=n.bind(p5(m));return he.some({start:p,end:p})}else{const p=kx(c.startContainer,m),w=kx(c.endContainer,m),x=p.bind(gB(m)).bind(p5(m)),R=w.bind(g5(m)).bind(p5(m));return he.some({start:x,end:R})}},b5=(n,i)=>Ss(n,c=>bt(c,i)),xA=n=>ri(b5(n.cells,n.rng.start),b5(n.cells,n.rng.end),(i,c)=>n.cells.slice(i,c+1)),bB=(n,i,c)=>n.exists(m=>mB(m,c)&&wO(m.start,i)),xx=(n,i)=>{const{startTable:c,endTable:m}=i,p=n.cloneRange();return c.each(w=>p.setStartAfter(w.dom)),m.each(w=>p.setEndBefore(w.dom)),p},vB=(n,i,c,m)=>pB(n,i,c,m).bind(({start:p,end:w})=>p.or(w)).bind(p=>{const{isSameTable:w}=i,x=xA(p).getOr([]);if(w&&p.cells.length===x.length)return he.some(wS.fullTable(p.table));if(x.length>0){if(w)return he.some(wS.partialTable(x,he.none()));{const R=xx(c,i);return he.some(wS.partialTable(x,he.some({...i,rng:R})))}}else return he.none()}),OB=(n,i,c,m)=>pB(n,i,c,m).bind(({start:p,end:w})=>{const x=p.bind(xA).getOr([]),R=w.bind(xA).getOr([]);if(x.length>0&&R.length>0){const B=xx(c,i);return he.some(wS.multiTable(x,R,B))}else return he.none()}),yB=(n,i)=>{const c=u5(n),m=_S(i,c),p=f5(i,c);return bB(m,i,c)?m.map(w=>wS.singleCellTable(i,w.start)):p.isMultiTable?OB(m,p,i,c):vB(m,p,i,c)},v5=n=>Ne(n,i=>{Vi(i,"contenteditable"),Ae(i)}),wB=(n,i)=>he.from(n.dom.getParent(i,n.dom.isBlock)).map(Ge.fromDom),_B=(n,i,c)=>{c.each(m=>{i?wr(m):(Ae(m),n.selection.setCursorLocation(m.dom,0))})},TA=(n,i,c,m)=>{const p=c.cloneRange();m?(p.setStart(c.startContainer,c.startOffset),p.setEndAfter(i.dom.lastChild)):(p.setStartBefore(i.dom.firstChild),p.setEnd(c.endContainer,c.endOffset)),Tx(n,p,i,!1).each(w=>w())},O5=n=>{const i=xb(n),c=Ge.fromDom(n.selection.getNode());Rd(c.dom)&&$a(c)?n.selection.setCursorLocation(c.dom,0):n.selection.collapse(!0),i.length>1&&Wt(i,m=>bt(m,c))&&Pr(c,"data-mce-selected","1")},y5=(n,i,c)=>he.some(()=>{const m=n.selection.getRng(),p=c.bind(({rng:w,isStartInTable:x})=>{const R=wB(n,x?w.endContainer:w.startContainer);w.deleteContents(),_B(n,x,R.filter($a));const B=x?i[0]:i[i.length-1];return TA(n,B,m,x),$a(B)?he.none():he.some(x?i.slice(1):i.slice(0,-1))}).getOr(i);v5(p),O5(n)}),SB=(n,i,c,m)=>he.some(()=>{const p=n.selection.getRng(),w=i[0],x=c[c.length-1];TA(n,w,p,!0),TA(n,x,p,!1);const R=$a(w)?i:i.slice(1),B=$a(x)?c:c.slice(0,-1);v5(R.concat(B)),m.deleteContents(),O5(n)}),Tx=(n,i,c,m=!0)=>he.some(()=>{kA(n,i,c,m)}),CB=(n,i)=>he.some(()=>K0(n,!1,i)),kB=(n,i,c)=>yB(i,c).bind(m=>m.fold(Re(Tx,n),Re(CB,n),Re(y5,n),Re(SB,n))),xB=(n,i)=>Ex(n,i),TB=(n,i,c,m)=>SS(i,m).fold(()=>kB(n,i,c),p=>xB(n,p)),EB=(n,i,c)=>{const m=Ge.fromDom(n.getBody()),p=n.selection.getRng();return c.length!==0?y5(n,c,he.none()):TB(n,m,p,i)},EA=(n,i)=>oo(G0(i,n),qm),SS=(n,i)=>oo(G0(i,n),Ec("caption")),AB=(n,i,c,m,p)=>Sb(c,n.getBody(),p).bind(w=>EA(i,Ge.fromDom(w.getNode())).bind(x=>bt(x,m)?he.none():he.some(mt))),Ex=(n,i)=>he.some(()=>{Ae(i),n.selection.setCursorLocation(i.dom,0)}),AA=(n,i,c,m)=>ll(n.dom).bind(p=>Vd(n.dom).map(w=>i?c.isEqual(p)&&m.isEqual(w):c.isEqual(w)&&m.isEqual(p))).getOr(!0),w5=(n,i)=>Ex(n,i),Ax=(n,i,c)=>SS(n,Ge.fromDom(c.getNode())).fold(()=>he.some(mt),m=>ks(!bt(m,i),mt)),_5=(n,i,c,m,p)=>Sb(c,n.getBody(),p).fold(()=>he.some(mt),w=>AA(m,c,p,w)?w5(n,m):Ax(i,m,w)),DB=(n,i,c,m)=>{const p=zt.fromRangeStart(n.selection.getRng());return EA(c,m).bind(w=>$a(w)?Ex(n,w):AB(n,c,i,w,p))},CS=(n,i,c,m)=>{const p=zt.fromRangeStart(n.selection.getRng());return $a(m)?Ex(n,m):_5(n,c,i,m,p)},DA=(n,i)=>n?jI(i):qI(i),S5=(n,i)=>{const c=zt.fromRangeStart(n.selection.getRng());return DA(i,c)||zd(i,n.getBody(),c).exists(m=>DA(i,m))},Dx=(n,i,c)=>{const m=Ge.fromDom(n.getBody());return SS(m,c).fold(()=>DB(n,i,m,c).orThunk(()=>ks(S5(n,i),mt)),p=>CS(n,i,m,p))},Eb=(n,i)=>{const c=Ge.fromDom(n.selection.getStart(!0)),m=xb(n);return n.selection.isCollapsed()&&m.length===0?Dx(n,i,c):EB(n,c,m)},PO=(n,i)=>{let c=i;for(;c&&c!==n;){if(ba(c)||Es(c))return c;c=c.parentNode}return null},xW=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],PB=hn.each,PA=n=>{const i=n.dom,c=new Set(n.serializer.getTempAttrs()),m=(w,x)=>{if(w.nodeName!==x.nodeName||w.nodeType!==x.nodeType)return!1;const R=G=>{const ae={};return PB(i.getAttribs(G),fe=>{const be=fe.nodeName.toLowerCase();be!=="style"&&!p(be)&&(ae[be]=i.getAttrib(G,be))}),ae},B=(G,ae)=>{for(const fe in G)if(un(G,fe)){const be=ae[fe];if(_e(be)||G[fe]!==be)return!1;delete ae[fe]}for(const fe in ae)if(un(ae,fe))return!1;return!0};return Jn(w)&&Jn(x)&&(!B(R(w),R(x))||!B(i.parseStyle(i.getAttrib(w,"style")),i.parseStyle(i.getAttrib(x,"style"))))?!1:!Wd(w)&&!Wd(x)},p=w=>Wt(xW,x=>Ar(w,x))||c.has(w);return{compare:m,isAttributeInternal:p}},TW=(n,i)=>{let c=n;for(;c=c.walk();)i(c)},EW=(n,i,c,m)=>{const p=c.name;for(let w=0,x=n.length;w{const m={nodes:{},attributes:{}};return c.firstChild&&TW(c,p=>{EW(n,i,p,m)}),m},MA=(n,i)=>{const c=(m,p)=>{ln(m,w=>{const x=Rr(w.nodes);Ne(w.filter.callbacks,R=>{for(let B=x.length-1;B>=0;B--){const G=x[B];(!(p?G.attr(w.filter.name)!==void 0:G.name===w.filter.name)||Le(G.parent))&&x.splice(B,1)}x.length>0&&R(x,w.filter.name,i)})})};c(n.nodes,!1),c(n.attributes,!0)},Sp=(n,i,c,m={})=>{const p=AW(n,i,c);MA(p,m)},Px=(n,i,c,m)=>{if((n.pad_empty_with_br||i.insert)&&c(m)){const w=new Xd("br",1);i.insert&&w.attr("data-mce-bogus","1"),m.empty().append(w)}else m.empty().append(new Xd("#text",3)).value=Gr},RA=n=>{var i;return $A(n,"#text")&&((i=n==null?void 0:n.firstChild)===null||i===void 0?void 0:i.value)===Gr},$A=(n,i)=>{const c=n==null?void 0:n.firstChild;return ve(c)&&c===n.lastChild&&c.name===i},DW=(n,i)=>{const c=n.getElementRule(i.name);return(c==null?void 0:c.paddEmpty)===!0},kS=(n,i,c,m)=>m.isEmpty(i,c,p=>DW(n,p)),PW=(n,i)=>ve(n)&&(i(n)||n.name==="br"),MB=n=>{let i;for(let c=n;c;c=c.parent){const m=c.attr("contenteditable");if(m==="false")break;m==="true"&&(i=c)}return he.from(i)},Mx=(n,i,c=n.parent)=>{if(i.getSpecialElements()[n.name])n.empty().remove();else{const m=n.children();for(const p of m)c&&!i.isValidChild(c.name,p.name)&&Mx(p,i,c);n.unwrap()}},C5=(n,i,c,m=mt)=>{const p=i.getTextBlockElements(),w=i.getNonEmptyElements(),x=i.getWhitespaceElements(),R=hn.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),B=new Set,G=ae=>ae!==c&&!R[ae.name];for(let ae=0;ae1)if(i.isValidChild(be.name,fe.name)){De.reverse(),Be=De[0].clone(),m(Be);let ze=Be;for(let dt=0;dt0?(Ye=De[dt].clone(),m(Ye),ze.append(Ye)):Ye=ze;for(let vt=De[dt].firstChild;vt&&vt!==De[dt+1];){const St=vt.next;Ye.append(vt),vt=St}ze=Ye}kS(i,w,x,Be)?be.insert(fe,De[0],!0):(be.insert(Be,De[0],!0),be.insert(fe,Be)),be=De[0],(kS(i,w,x,be)||$A(be,"br"))&&be.empty().remove()}else Mx(fe,i);else if(fe.parent){if(fe.name==="li"){let ze=fe.prev;if(ze&&(ze.name==="ul"||ze.name==="ol")){ze.append(fe);continue}if(ze=fe.next,ze&&(ze.name==="ul"||ze.name==="ol")&&ze.firstChild){ze.insert(fe,ze.firstChild,!0);continue}const dt=new Xd("ul",1);m(dt),fe.wrap(dt);continue}if(i.isValidChild(fe.parent.name,"div")&&i.isValidChild("div",fe.name)){const ze=new Xd("div",1);m(ze),fe.wrap(ze)}else Mx(fe,i)}}},RB=(n,i)=>{let c=n;for(;c;){if(c.name===i)return!0;c=c.parent}return!1},$B=(n,i,c=i.parent)=>c&&n.children[i.name]&&!n.isValidChild(c.name,i.name)?!0:!!(c&&i.name==="a"&&RB(c,"a")),Rx=(n,i,c,m)=>{const p=document.createRange();return p.setStart(n,i),p.setEnd(c,m),p},NB=n=>{const i=zt.fromRangeStart(n),c=zt.fromRangeEnd(n),m=n.commonAncestorContainer;return zd(!1,m,c).map(p=>!Hd(i,c,m)&&Hd(i,p,m)?Rx(i.container(),i.offset(),p.container(),p.offset()):n).getOr(n)},k5=n=>n.collapsed?n:NB(n),IB=n=>ve(n.firstChild)&&n.firstChild===n.lastChild,MW=n=>n.name==="br"||n.value===Gr,RW=(n,i)=>n.getBlockElements()[i.name]&&IB(i)&&MW(i.firstChild),$W=(n,i)=>{const c=n.getNonEmptyElements();return ve(i)&&(i.isEmpty(c)||RW(n,i))},NW=(n,i)=>{let c=i.firstChild,m=i.lastChild;return c&&c.name==="meta"&&(c=c.next),m&&m.attr("id")==="mce_marker"&&(m=m.prev),$W(n,m)&&(m=m==null?void 0:m.prev),!c||c!==m?!1:c.name==="ul"||c.name==="ol"},IW=n=>{var i,c;const m=n.firstChild,p=n.lastChild;return m&&m.nodeName==="META"&&((i=m.parentNode)===null||i===void 0||i.removeChild(m)),p&&p.id==="mce_marker"&&((c=p.parentNode)===null||c===void 0||c.removeChild(p)),n},BB=(n,i,c)=>{const m=i.serialize(c),p=n.createFragment(m);return IW(p)},BW=n=>{var i;return Dt((i=n==null?void 0:n.childNodes)!==null&&i!==void 0?i:[],c=>c.nodeName==="LI")},x5=n=>n.data===Gr||mi(n),G2=n=>ve(n==null?void 0:n.firstChild)&&n.firstChild===n.lastChild&&x5(n.firstChild),LW=n=>!n.firstChild||G2(n),FW=n=>n.length>0&&LW(n[n.length-1])?n.slice(0,-1):n,xS=(n,i)=>{const c=n.getParent(i,n.isBlock);return c&&c.nodeName==="LI"?c:null},LB=(n,i)=>!!xS(n,i),FB=(n,i)=>{const c=i.cloneRange(),m=i.cloneRange();return c.setStartBefore(n),m.setEndAfter(n),[c.cloneContents(),m.cloneContents()]},QW=(n,i)=>{const c=zt.before(n),p=Ea(i).next(c);return p?p.toRange():null},T5=(n,i)=>{const c=zt.after(n),p=Ea(i).prev(c);return p?p.toRange():null},ZW=(n,i,c,m)=>{const p=FB(n,m),w=n.parentNode;return w&&(w.insertBefore(p[0],n),hn.each(i,x=>{w.insertBefore(x,n)}),w.insertBefore(p[1],n),w.removeChild(n)),T5(i[i.length-1],c)},K2=(n,i,c)=>{const m=n.parentNode;return m&&hn.each(i,p=>{m.insertBefore(p,n)}),QW(n,c)},QB=(n,i,c,m)=>(m.insertAfter(i.reverse(),n),T5(i[0],c)),ZB=(n,i,c,m)=>{const p=BB(i,n,m),w=xS(i,c.startContainer),x=FW(BW(p.firstChild)),R=1,B=2,G=i.getRoot(),ae=fe=>{const be=zt.fromRangeStart(c),Be=Ea(i.getRoot()),Ye=fe===R?Be.prev(be):Be.next(be),De=Ye==null?void 0:Ye.getNode();return De?xS(i,De)!==w:!0};return w?ae(R)?K2(w,x,G):ae(B)?QB(w,x,G,i):ZW(w,x,G,c):null},HB=["pre"],NA=(n,i,c,m)=>{var p;const w=i.firstChild,x=i.lastChild,R=x.attr("data-mce-type")==="bookmark"?x.prev:x,B=w===R,G=wt(HB,w.name);if(B&&G){const ae=w.attr("contenteditable")!=="false",fe=((p=n.getParent(c,n.isBlock))===null||p===void 0?void 0:p.nodeName.toLowerCase())===w.name,be=he.from(PO(m,c)).forall(ba);return ae&&fe&&be}else return!1},IA=Rd,HW=(n,i,c)=>{if(ve(c)){const m=n.getParent(i.endContainer,IA);return c===m&&wO(Ge.fromDom(c),i)}else return!1},zB=(n,i,c)=>{var m;if(c.getAttribute("data-mce-bogus")==="all")(m=c.parentNode)===null||m===void 0||m.insertBefore(n.dom.createFragment(i),c);else{const p=c.firstChild,w=c.lastChild;!p||p===w&&p.nodeName==="BR"?n.dom.setHTML(c,i):n.selection.setContent(i,{no_events:!0})}},zW=(n,i)=>{he.from(n.getParent(i,"td,th")).map(Ge.fromDom).each(lt)},VW=(n,i)=>{const c=n.schema.getTextInlineElements(),m=n.dom;if(i){const p=n.getBody(),w=PA(n);hn.each(m.select("*[data-mce-fragment]"),x=>{if(ve(c[x.nodeName.toLowerCase()])&&VI(m,x)){for(let B=x.parentElement;ve(B)&&B!==p&&!bie(m,x,B);B=B.parentElement)if(w.compare(B,x)){m.remove(x,!0);break}}})}},BA=n=>{let i=n;for(;i=i.walk();)i.type===1&&i.attr("data-mce-fragment","1")},VB=n=>{hn.each(n.getElementsByTagName("*"),i=>{i.removeAttribute("data-mce-fragment")})},E5=n=>!!n.getAttribute("data-mce-fragment"),WW=(n,i)=>ve(i)&&!n.schema.getVoidElements()[i.nodeName],UW=(n,i)=>{var c,m,p;let w;const x=n.dom,R=n.selection;if(!i)return;R.scrollIntoView(i);const B=PO(n.getBody(),i);if(B&&x.getContentEditable(B)==="false"){x.remove(i),R.select(B);return}let G=x.createRng();const ae=i.previousSibling;if(Sn(ae)){G.setStart(ae,(m=(c=ae.nodeValue)===null||c===void 0?void 0:c.length)!==null&&m!==void 0?m:0);const Be=i.nextSibling;Sn(Be)&&(ae.appendData(Be.data),(p=Be.parentNode)===null||p===void 0||p.removeChild(Be))}else G.setStartBefore(i),G.setEndBefore(i);const fe=Be=>{let Ye=zt.fromRangeStart(Be);return Ye=Ea(n.getBody()).next(Ye),Ye==null?void 0:Ye.toRange()},be=x.getParent(i,x.isBlock);if(x.remove(i),be&&x.isEmpty(be)){const Be=IA(be);Ad(Ge.fromDom(be)),G.setStart(be,0),G.setEnd(be,0),!Be&&!E5(be)&&(w=fe(G))?(G=w,x.remove(be)):x.add(be,x.create("br",Be?{}:{"data-mce-bogus":"1"}))}R.setRng(G)},WB=n=>{const i=n.dom,c=k5(n.selection.getRng());n.selection.setRng(c);const m=i.getParent(c.startContainer,IA);HW(i,c,m)?Tx(n,c,Ge.fromDom(m)):c.startContainer===c.endContainer&&c.endOffset-c.startOffset===1&&Sn(c.startContainer.childNodes[c.startOffset])?c.deleteContents():n.getDoc().execCommand("Delete",!1)},A5=n=>{for(let i=n;i;i=i.walk())if(i.attr("id")==="mce_marker")return he.some(i);return he.none()},UB=(n,i,c)=>{var m,p;const w=n.selection,x=n.dom,R=n.parser,B=c.merge,G=Y2({validate:!0},n.schema),ae='';i.indexOf("{$caret}")===-1&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,ae);let fe=w.getRng();const be=fe.startContainer,Be=n.getBody();be===Be&&w.isCollapsed()&&x.isBlock(Be.firstChild)&&WW(n,Be.firstChild)&&x.isEmpty(Be.firstChild)&&(fe=x.createRng(),fe.setStart(Be.firstChild,0),fe.setEnd(Be.firstChild,0),w.setRng(fe)),w.isCollapsed()||WB(n);const Ye=w.getNode(),De={context:Ye.nodeName.toLowerCase(),data:c.data,insert:!0},ze=R.parse(i,De);if(c.paste===!0&&NW(n.schema,ze)&&LB(x,Ye))return fe=ZB(G,x,w.getRng(),ze),fe&&w.setRng(fe),i;c.paste===!0&&NA(x,ze,Ye,n.getBody())&&((m=ze.firstChild)===null||m===void 0||m.unwrap()),BA(ze);let dt=ze.lastChild;if(dt&&dt.attr("id")==="mce_marker"){const vt=dt;for(dt=dt.prev;dt;dt=dt.walk(!0))if(dt.type===3||!x.isBlock(dt.name)){dt.parent&&n.schema.isValidChild(dt.parent.name,"span")&&dt.parent.insert(vt,dt,dt.name==="br");break}}if(n._selectionOverrides.showBlockCaretContainer(Ye),!De.invalid)i=G.serialize(ze),zB(n,i,Ye);else{n.selection.setContent(ae);let vt=w.getNode(),St;const Mt=n.getBody();for(nf(vt)?vt=St=Mt:St=vt;St&&St!==Mt;)vt=St,St=St.parentNode;i=vt===Mt?Mt.innerHTML:x.getOuterHTML(vt);const dn=R.parse(i),Hn=A5(dn),Nn=Hn.bind(MB).getOr(dn);Hn.each(go=>go.replace(ze));const Lt=ze.children(),Zt=(p=ze.parent)!==null&&p!==void 0?p:dn;ze.unwrap();const yn=Dt(Lt,go=>$B(n.schema,go,Zt));C5(yn,n.schema,Nn),Sp(R.getNodeFilters(),R.getAttributeFilters(),dn),i=G.serialize(dn),vt===Mt?x.setHTML(Mt,i):x.setOuterHTML(vt,i)}return VW(n,B),UW(n,x.get("mce_marker")),VB(n.getBody()),zW(x,w.getStart()),$v(n.schema,n.getBody(),w.getStart()),i},LA=n=>n instanceof Xd,YW=n=>{U2(n)&&ll(n.getBody()).each(i=>{const c=i.getNode(),m=Nu(c)?ll(c).getOr(i):i;n.selection.setRng(m.toRange())})},D5=(n,i,c)=>{n.dom.setHTML(n.getBody(),i),c!==!0&&YW(n)},FA=(n,i,c,m)=>{if(c.length===0||/^\s+$/.test(c)){const p='
';i.nodeName==="TABLE"?c=""+p+"":/^(UL|OL)$/.test(i.nodeName)&&(c="
  • "+p+"
  • ");const w=jc(n);return n.schema.isValidChild(i.nodeName.toLowerCase(),w.toLowerCase())?(c=p,c=n.dom.createHTML(w,db(n),c)):c||(c=p),D5(n,c,m.no_selection),{content:c,html:c}}else{m.format!=="raw"&&(c=Y2({validate:!1},n.schema).serialize(n.parser.parse(c,{isRootContent:!0,insert:!0})));const p=lu(Ge.fromDom(i))?c:hn.trim(c);return D5(n,p,m.no_selection),{content:p,html:p}}},ev=(n,i,c,m)=>{Sp(n.parser.getNodeFilters(),n.parser.getAttributeFilters(),c);const p=Y2({validate:!1},n.schema).serialize(c),w=lu(Ge.fromDom(i))?p:hn.trim(p);return D5(n,w,m.no_selection),{content:c,html:w}},XW=(n,i,c)=>he.from(n.getBody()).map(m=>LA(i)?ev(n,m,i,c):FA(n,m,i,c)).getOr({content:i,html:LA(c.content)?"":c.content}),P5=(n,i,c)=>di(n,i,c).isSome(),$l=(n,i)=>Vp(n,i).isSome(),QA=n=>ue(n)?n:Xe,M5=(n,i,c)=>{let m=n.dom;const p=QA(c);for(;m.parentNode;){m=m.parentNode;const w=Ge.fromDom(m),x=i(w);if(x.isSome())return x;if(p(w))break}return he.none()},m1=(n,i,c)=>{const m=i(n),p=QA(c);return m.orThunk(()=>p(n)?he.none():M5(n,i,p))},ZA=J_,R5=(n,i,c)=>{const m=n.formatter.get(c);if(m)for(let p=0;p{const w=n.dom.getRoot();if(i===w)return!1;const x=n.dom.getParent(i,R=>R5(n,R,c)?!0:R.parentNode===w||!!Rh(n,R,c,m,!0));return!!Rh(n,x,c,m,p)},HA=(n,i,c)=>Ml(c)&&ZA(i,c.inline)||wm(c)&&ZA(i,c.block)?!0:fd(c)?Jn(i)&&n.is(i,c.selector):!1,YB=(n,i,c,m,p,w)=>{const x=c[m],R=m==="attributes";if(ue(c.onmatch))return c.onmatch(i,c,m);if(x){if(kr(x)){for(let B=0;B{const w=n.formatter.get(c),x=n.dom;if(w&&Jn(i))for(let R=0;R{if(m)return J2(n,m,i,c,p);if(m=n.selection.getNode(),J2(n,m,i,c,p))return!0;const w=n.selection.getStart();return!!(w!==m&&J2(n,w,i,c,p))},ew=(n,i,c)=>{const m=[],p={},w=n.selection.getStart();return n.dom.getParent(w,x=>{for(let R=0;R{const c=p=>bt(p,Ge.fromDom(n.getBody())),m=(p,w)=>Rh(n,p.dom,w)?he.some(w):he.none();return he.from(n.selection.getStart(!0)).bind(p=>m1(Ge.fromDom(p),w=>Ls(i,x=>m(w,x)),c)).getOrNull()},MO=(n,i)=>{const c=n.formatter.get(i),m=n.dom;if(c&&n.selection.isEditable()){const p=n.selection.getStart(),w=$2(m,p);for(let x=c.length-1;x>=0;x--){const R=c[x];if(!fd(R))return!0;for(let B=w.length-1;B>=0;B--)if(m.is(w[B],R.selector))return!0}}return!1},kg=(n,i,c)=>zn(c,(m,p)=>{const w=Kk(n,p);return n.formatter.matchNode(i,p,{},w)?m.concat([p]):m},[]),tv=Ft,N5=(n,i)=>n.importNode(i,!0),qW=n=>{const i=[];let c=n;for(;c;){if(Sn(c)&&c.data!==tv||c.childNodes.length>1)return[];Jn(c)&&i.push(c),c=c.firstChild}return i},XB=n=>qW(n).length>0,$x=n=>{if(n){const i=new wi(n,n);for(let c=i.current();c;c=i.next())if(Sn(c))return c}return null},I5=n=>{const i=Ge.fromTag("span");return Ku(i,{id:j_,"data-mce-bogus":"1","data-mce-type":"format-caret"}),n&&na(i,Ge.fromText(tv)),i},Cp=n=>{const i=$x(n);return i&&i.data.charAt(0)===tv&&i.deleteData(0,1),i},TS=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(XB(i))K0(n,!1,Ge.fromDom(i),c);else{const w=p.getRng(),x=m.getParent(i,m.isBlock),R=w.startContainer,B=w.startOffset,G=w.endContainer,ae=w.endOffset,fe=Cp(i);m.remove(i,!0),R===fe&&B>0&&w.setStart(fe,B-1),G===fe&&ae>0&&w.setEnd(fe,ae-1),x&&m.isEmpty(x)&&Ae(Ge.fromDom(x)),p.setRng(w)}},zA=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(i)TS(n,i,c);else if(i=Cb(n.getBody(),p.getStart()),!i)for(;i=m.get(j_);)TS(n,i,c)},B5=(n,i,c)=>{var m,p;const w=n.dom,x=w.getParent(c,Re(Wl,n.schema));x&&w.isEmpty(x)?(m=c.parentNode)===null||m===void 0||m.replaceChild(i,c):(q(Ge.fromDom(c)),w.isEmpty(c)?(p=c.parentNode)===null||p===void 0||p.replaceChild(i,c):w.insertAfter(i,c))},VA=(n,i)=>(n.appendChild(i),i),RO=(n,i)=>{var c;const m=Dn(n,(w,x)=>VA(w,x.cloneNode(!1)),i),p=(c=m.ownerDocument)!==null&&c!==void 0?c:document;return VA(m,p.createTextNode(tv))},L5=(n,i,c,m,p,w)=>{const x=n.formatter,R=n.dom,B=Dt(bs(x.get()),fe=>fe!==m&&!tr(fe,"removeformat")),G=kg(n,c,B);if(Dt(G,fe=>!dP(n,fe,m)).length>0){const fe=c.cloneNode(!1);return R.add(i,fe),x.remove(m,p,fe,w),R.remove(fe),he.some(fe)}else return he.none()},GW=(n,i,c)=>{let m;const p=n.selection,w=n.formatter.get(i);if(!w)return;const x=p.getRng();let R=x.startOffset;const G=x.startContainer.nodeValue;m=Cb(n.getBody(),p.getStart());const ae=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(G&&R>0&&R{const p=n.dom,w=n.selection;let x=!1;const R=n.formatter.get(i);if(!R)return;const B=w.getRng(),G=B.startContainer,ae=B.startOffset;let fe=G;Sn(G)&&(ae!==G.data.length&&(x=!0),fe=fe.parentNode);const be=[];let Be;for(;fe;){if(Rh(n,fe,i,c,m)){Be=fe;break}fe.nextSibling&&(x=!0),be.push(fe),fe=fe.parentNode}if(!!Be)if(x){const Ye=w.getBookmark();B.collapse(!0);let De=z0(p,B,R,!0);De=wp(De),n.formatter.remove(i,c,De,m),w.moveToBookmark(Ye)}else{const Ye=Cb(n.getBody(),Be),De=I5(!1).dom;B5(n,De,Ye!=null?Ye:Be);const ze=L5(n,De,Be,i,c,m),dt=RO(be.concat(ze.toArray()),De);Ye&&TS(n,Ye,!1),w.setCursorLocation(dt,1),p.isEmpty(Be)&&p.remove(Be)}},KW=(n,i,c)=>{const m=n.selection,p=n.getBody();zA(n,null,c),(i===8||i===46)&&m.isCollapsed()&&m.getStart().innerHTML===tv&&zA(n,Cb(p,m.getStart())),(i===37||i===39)&&zA(n,Cb(p,m.getStart()))},JW=n=>Sn(n)&&Ki(n.data,Gr),eU=n=>{n.on("mouseup keydown",i=>{KW(n,i.keyCode,JW(n.selection.getRng().endContainer))})},qB=n=>{const i=I5(!1),c=RO(n,i.dom);return{caretContainer:i,caretPosition:zt(c,0)}},ES=(n,i)=>{const{caretContainer:c,caretPosition:m}=qB(i);return Ca(Ge.fromDom(n),c),wr(Ge.fromDom(n)),m},tU=(n,i)=>{const{caretContainer:c,caretPosition:m}=qB(i);return n.insertNode(c.dom),m},F5=(n,i)=>{const c=n.schema.getTextInlineElements();return un(c,ei(i))&&!qc(i.dom)&&!Pd(i.dom)},WA=n=>qc(n.dom)&&XB(n.dom),Nx={},Q5=Rf(["pre"]),GB=(n,i)=>{Nx[n]||(Nx[n]=[]),Nx[n].push(i)},nU=(n,i)=>{un(Nx,n)&&Ne(Nx[n],c=>{c(i)})};GB("pre",n=>{const i=n.selection.getRng(),c=p=>w=>{const x=w.previousSibling;return Q5(x)&&wt(p,x)},m=(p,w)=>{const x=Ge.fromDom(w),R=Ao(x).dom;wr(x),ti(Ge.fromDom(p),[Ge.fromTag("br",R),Ge.fromTag("br",R),...Da(x)])};if(!i.collapsed){const p=n.selection.getSelectedBlocks(),w=Dt(Dt(p,Q5),c(p));Ne(w,x=>{m(x.previousSibling,x)})}});const KB=["fontWeight","fontStyle","color","fontSize","fontFamily"],oU=n=>te(n.styles)&&Wt(bs(n.styles),i=>wt(KB,i)),sU=n=>oo(n,i=>Ml(i)&&i.inline==="span"&&oU(i)),JB=(n,i)=>{const c=n.get(i);return oe(c)?sU(c):he.none()},e8=(n,i)=>Zu(i,zt.fromRangeStart(n)).isNone(),t8=(n,i)=>Zf(i,zt.fromRangeEnd(n)).exists(c=>!mi(c.getNode())||Zf(i,c).isSome())===!1,n8=n=>i=>Va(i)&&n.isEditable(i),rU=n=>{const i=n.getSelectedBlocks(),c=n.getRng();if(n.isCollapsed())return[];if(i.length===1)return e8(c,i[0])&&t8(c,i[0])?i:[];{const m=$o(i).filter(x=>e8(c,x)).toArray(),p=Mo(i).filter(x=>t8(c,x)).toArray(),w=i.slice(1,-1);return m.concat(w).concat(p)}},iU=n=>Dt(rU(n),n8(n.dom)),o8=n=>Dt(n.getSelectedBlocks(),n8(n.dom)),Z5=hn.each,H5=n=>Jn(n)&&!Wd(n)&&!qc(n)&&!Pd(n),z5=(n,i)=>{for(let c=n;c;c=c[i]){if(Sn(c)&&yr(c.data))return n;if(Jn(c)&&!Wd(c))return c}return n},s8=(n,i,c)=>{const m=PA(n),p=Jn(i)&&vm(i),w=Jn(c)&&vm(c);if(p&&w){const x=z5(i,"previousSibling"),R=z5(c,"nextSibling");if(m.compare(x,R)){for(let B=x.nextSibling;B&&B!==R;){const G=B;B=B.nextSibling,x.appendChild(G)}return n.dom.remove(R),hn.each(hn.grep(R.childNodes),B=>{x.appendChild(B)}),x}}return c},tw=(n,i,c,m)=>{var p;if(m&&i.merge_siblings!==!1){const w=(p=s8(n,Kn(m),m))!==null&&p!==void 0?p:m;s8(n,w,Kn(w,!0))}},aU=(n,i,c)=>{if(i.clear_child_styles){const m=i.links?"*:not(a)":"*";Z5(n.select(m,c),p=>{H5(p)&&vm(p)&&Z5(i.styles,(w,x)=>{n.setStyle(p,x,"")})})}},V5=(n,i,c)=>{Z5(n.childNodes,m=>{H5(m)&&(i(m)&&c(m),m.hasChildNodes()&&V5(m,i,c))})},lU=(n,i)=>{i.nodeName==="SPAN"&&n.getAttribs(i).length===0&&n.remove(i,!0)},r8=(n,i)=>c=>!!(c&&R2(n,c,i)),W5=(n,i,c)=>m=>{n.setStyle(m,i,c),m.getAttribute("style")===""&&m.removeAttribute("style"),lU(n,m)},nw=pg.generate([{keep:[]},{rename:["name"]},{removed:[]}]),cU=/^(src|href|style)$/,U5=hn.each,UA=J_,uU=n=>/^(TR|TH|TD)$/.test(n.nodeName),i8=(n,i,c)=>n.isChildOf(i,c)&&i!==c&&!n.isBlock(c),a8=(n,i,c)=>{let m=i[c?"startContainer":"endContainer"],p=i[c?"startOffset":"endOffset"];if(Jn(m)){const w=m.childNodes.length-1;!c&&p&&p--,m=m.childNodes[p>w?w:p]}return Sn(m)&&c&&p>=m.data.length&&(m=new wi(m,n.getBody()).next()||m),Sn(m)&&!c&&p===0&&(m=new wi(m,n.getBody()).prev()||m),m},l8=(n,i)=>{const c=i?"firstChild":"lastChild",m=n[c];return uU(n)&&m?n.nodeName==="TR"&&m[c]||m:n},Y5=(n,i,c,m)=>{var p;const w=n.create(c,m);return(p=i.parentNode)===null||p===void 0||p.insertBefore(w,i),w.appendChild(i),w},c8=(n,i,c,m,p)=>{const w=Ge.fromDom(i),x=Ge.fromDom(n.create(m,p)),R=c?rl(w):Vg(w);return ti(x,R),c?(Ca(w,x),ih(x,w)):(iu(w,x),na(x,w)),x.dom},X5=(n,i)=>i.links&&n.nodeName==="A",j5=(n,i,c)=>{const m=i.parentNode;let p;const w=n.dom,x=jc(n);wm(c)&&m===w.getRoot()&&(!c.list_block||!UA(i,c.list_block))&&Ne(Rr(i.childNodes),R=>{Om(n,x,R.nodeName.toLowerCase())?p?p.appendChild(R):(p=Y5(w,R,x),w.setAttribs(p,db(n))):p=null}),!(Jk(c)&&!UA(c.inline,i))&&w.remove(i,!0)},fU=(n,i,c)=>ot(n)?{name:i,value:null}:{name:n,value:Dh(i,c)},AS=(n,i)=>{n.getAttrib(i,"style")===""&&(i.removeAttribute("style"),i.removeAttribute("data-mce-style"))},q5=(n,i,c,m,p)=>{let w=!1;U5(c.styles,(x,R)=>{const{name:B,value:G}=fU(R,x,m),ae=M2(G,B);(c.remove_similar||Y(G)||!Jn(p)||UA(R2(n,p,B),ae))&&n.setStyle(i,B,""),w=!0}),w&&AS(n,i)},Ix=(n,i,c)=>{i==="removeformat"?Ne(o8(n.selection),m=>{Ne(KB,p=>n.dom.setStyle(m,p,"")),AS(n.dom,m)}):JB(n.formatter,i).each(m=>{Ne(o8(n.selection),p=>q5(n.dom,p,m,c,null))})},DS=(n,i,c,m,p)=>{const w=n.dom,x=PA(n),R=n.schema;if(Ml(i)&&ep(R,i.inline)&&ig(R,m)&&m.parentElement===n.getBody())return j5(n,m,i),nw.removed();if(!i.ceFalseOverride&&m&&w.getContentEditableParent(m)==="false"||m&&!HA(w,m,i)&&!X5(m,i))return nw.keep();const B=m,G=i.preserve_attributes;if(Ml(i)&&i.remove==="all"&&oe(G)){const ae=Dt(w.getAttribs(B),fe=>wt(G,fe.name.toLowerCase()));if(w.removeAllAttribs(B),Ne(ae,fe=>w.setAttrib(B,fe.name,fe.value)),ae.length>0)return nw.rename("span")}if(i.remove!=="all"){q5(w,B,i,c,p),U5(i.attributes,(fe,be)=>{const{name:Be,value:Ye}=fU(be,fe,c);if(i.remove_similar||Y(Ye)||!Jn(p)||UA(w.getAttrib(p,Be),Ye)){if(Be==="class"){const De=w.getAttrib(B,Be);if(De){let ze="";if(Ne(De.split(/\s+/),dt=>{/mce\-\w+/.test(dt)&&(ze+=(ze?" ":"")+dt)}),ze){w.setAttrib(B,Be,ze);return}}}if(cU.test(Be)&&B.removeAttribute("data-mce-"+Be),Be==="style"&&Rf(["li"])(B)&&w.getStyle(B,"list-style-type")==="none"){B.removeAttribute(Be),w.setStyle(B,"list-style-type","none");return}Be==="class"&&B.removeAttribute("className"),B.removeAttribute(Be)}}),U5(i.classes,fe=>{fe=Dh(fe,c),(!Jn(p)||w.hasClass(p,fe))&&w.removeClass(B,fe)});const ae=w.getAttribs(B);for(let fe=0;fe{let w;return i.parentNode&&Ne($2(n.dom,i.parentNode).reverse(),x=>{if(!w&&Jn(x)&&x.id!=="_start"&&x.id!=="_end"){const R=Rh(n,x,c,m,p);R&&R.split!==!1&&(w=x)}}),w},yie=(n,i,c,m)=>DS(n,i,c,m,m).fold(We(m),p=>(n.dom.createFragment().appendChild(m),n.dom.rename(m,p)),We(null)),dU=(n,i,c,m,p,w,x,R)=>{var B,G;let ae,fe;const be=n.dom;if(c){const Be=c.parentNode;for(let Ye=m.parentNode;Ye&&Ye!==Be;Ye=Ye.parentNode){let De=be.clone(Ye,!1);for(let ze=0;ze{const w=n.formatter.get(i),x=w[0],R=n.dom,B=n.selection,G=De=>{const ze=u8(n,De,i,c,p);return dU(n,w,ze,De,De,!0,x,c)},ae=De=>Wd(De)&&Jn(De)&&(De.id==="_start"||De.id==="_end"),fe=De=>Wt(w,ze=>Bx(n,ze,c,De,De)),be=De=>{const ze=Rr(De.childNodes),vt=fe(De)||Wt(w,dn=>HA(R,De,dn)),St=De.parentNode;if(!vt&&ve(St)&&I2(x)&&fe(St),x.deep&&ze.length)for(let dn=0;dn{Jn(De)&&n.dom.getStyle(De,"text-decoration")===dn&&De.parentNode&&Gk(R,De.parentNode)===dn&&Bx(n,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:dn}},void 0,De)})},Be=De=>{const ze=R.get(De?"_start":"_end");if(ze){let dt=ze[De?"firstChild":"lastChild"];return ae(dt)&&(dt=dt[De?"firstChild":"lastChild"]),Sn(dt)&&dt.data.length===0&&(dt=De?ze.previousSibling||ze.nextSibling:ze.nextSibling||ze.previousSibling),R.remove(ze,!0),dt}else return null},Ye=De=>{let ze,dt,vt=z0(R,De,w,De.collapsed);if(x.split){if(vt=wp(vt),ze=a8(n,vt,!0),dt=a8(n,vt),ze!==dt){if(ze=l8(ze,!0),dt=l8(dt,!1),i8(R,ze,dt)){const Mt=he.from(ze.firstChild).getOr(ze);G(c8(R,Mt,!0,"span",{id:"_start","data-mce-type":"bookmark"})),Be(!0);return}if(i8(R,dt,ze)){const Mt=he.from(dt.lastChild).getOr(dt);G(c8(R,Mt,!1,"span",{id:"_end","data-mce-type":"bookmark"})),Be(!1);return}ze=Y5(R,ze,"span",{id:"_start","data-mce-type":"bookmark"}),dt=Y5(R,dt,"span",{id:"_end","data-mce-type":"bookmark"});const St=R.createRng();St.setStartAfter(ze),St.setEndBefore(dt),c1(R,St,Mt=>{Ne(Mt,dn=>{!Wd(dn)&&!Wd(dn.parentNode)&&G(dn)})}),G(ze),G(dt),ze=Be(!0),dt=Be()}else ze=dt=G(ze);vt.startContainer=ze.parentNode?ze.parentNode:ze,vt.startOffset=R.nodeIndex(ze),vt.endContainer=dt.parentNode?dt.parentNode:dt,vt.endOffset=R.nodeIndex(dt)+1}c1(R,vt,St=>{Ne(St,be)})};if(m){if(D2(m)){const De=R.createRng();De.setStartBefore(m),De.setEndAfter(m),Ye(De)}else Ye(m);Mh(n,i,m,c);return}!B.isCollapsed()||!Ml(x)||xb(n).length?(ZE(n,()=>jk(n,Ye),De=>Ml(x)&&$5(n,i,c,De)),n.nodeChanged()):jB(n,i,c,p),Ix(n,i,c),Mh(n,i,m,c)},f8=(n,i,c,m,p)=>{(m||n.selection.isEditable())&&wie(n,i,c,m,p)},Bx=(n,i,c,m,p)=>DS(n,i,c,m,p).fold(Xe,w=>(n.dom.rename(m,w),!0),_t),hU=hn.each,mU=(n,i,c,m)=>{const p=w=>{if(Jn(w)&&Jn(w.parentNode)&&vm(w)){const x=Gk(n,w.parentNode);n.getStyle(w,"color")&&x?n.setStyle(w,"text-decoration",x):n.getStyle(w,"text-decoration")===x&&n.setStyle(w,"text-decoration",null)}};i.styles&&(i.styles.color||i.styles.textDecoration)&&(hn.walk(m,p,"childNodes"),p(m))},d8=(n,i,c,m)=>{if(i.styles&&i.styles.backgroundColor){const p=r8(n,"fontSize");V5(m,w=>p(w)&&vm(w),W5(n,"backgroundColor",Dh(i.styles.backgroundColor,c)))}},gU=(n,i,c,m)=>{if(Ml(i)&&(i.inline==="sub"||i.inline==="sup")){const p=r8(n,"fontSize");V5(m,x=>p(x)&&vm(x),W5(n,"fontSize",""));const w=Dt(n.select(i.inline==="sup"?"sub":"sup",m),vm);n.remove(w,!0)}},h8=(n,i,c,m)=>{hU(i,p=>{Ml(p)&&hU(n.dom.select(p.inline,m),w=>{H5(w)&&Bx(n,p,c,w,p.exact?w:null)}),aU(n.dom,p,m)})},pU=(n,i,c,m,p)=>{const w=p.parentNode;Rh(n,w,c,m)&&Bx(n,i,m,p)||i.merge_with_parents&&w&&n.dom.getParent(w,x=>Rh(n,x,c,m)?(Bx(n,i,m,p),!0):!1)},ow=hn.each,m8=(n,i,c,m)=>{if(D_(n)&&Ml(i)&&c.parentNode){const p=sd(n.schema),w=$l(Ge.fromDom(c),x=>qc(x.dom));return os(p,m)&&$a(Ge.fromDom(c.parentNode),!1)&&!w}else return!1},rc=(n,i,c,m)=>{if(ow(c.styles,(p,w)=>{n.setStyle(i,w,Dh(p,m))}),c.styles){const p=n.getAttrib(i,"style");p&&n.setAttrib(i,"data-mce-style",p)}},_ie=(n,i,c,m)=>{const p=n.formatter.get(i),w=p[0],x=!m&&n.selection.isCollapsed(),R=n.dom,B=n.selection,G=(Ye,De=w)=>{ue(De.onformat)&&De.onformat(Ye,De,c,m),rc(R,Ye,De,c),ow(De.attributes,(ze,dt)=>{R.setAttrib(Ye,dt,Dh(ze,c))}),ow(De.classes,ze=>{const dt=Dh(ze,c);R.hasClass(Ye,dt)||R.addClass(Ye,dt)})},ae=(Ye,De)=>{let ze=!1;return ow(Ye,dt=>fd(dt)?R.getContentEditable(De)==="false"&&!dt.ceFalseOverride||ve(dt.collapsed)&&dt.collapsed!==x?!0:R.is(De,dt.selector)&&!qc(De)?(G(De,dt),ze=!0,!1):!0:!1),ze},fe=Ye=>{if(L(Ye)){const De=R.create(Ye);return G(De),De}else return null},be=(Ye,De,ze)=>{const dt=[];let vt=!0;const St=w.inline||w.block,Mt=fe(St),dn=Lt=>tS(w)&&Rh(n,Lt,i,c),Hn=(Lt,Zt,yn)=>{const go=N2(w)&&Wl(n.schema,Lt)&&Om(n,Zt,St);return yn&&go},Nn=(Lt,Zt,yn,go)=>{const Po=Lt.nodeName.toLowerCase(),Cs=Om(n,St,Po)&&Om(n,Zt,St),Ws=!ze&&Sn(Lt)&&Cn(Lt.data),Ir=qc(Lt),pi=!Ml(w)||!Ye.isBlock(Lt);return(yn||go)&&Cs&&!Ws&&!Ir&&pi};c1(Ye,De,Lt=>{let Zt;const yn=go=>{let Po=!1,Cs=vt,Ws=!1;const Ir=go.parentNode,pi=Ir.nodeName.toLowerCase(),ul=Ye.getContentEditable(go);ve(ul)&&(Cs=vt,vt=ul==="true",Po=!0,Ws=P2(n,go));const Il=vt&&!Po;if(mi(go)&&!m8(n,w,go,pi)){Zt=null,wm(w)&&Ye.remove(go);return}if(dn(go)){Zt=null;return}if(Hn(go,pi,Il)){const Oc=Ye.rename(go,St);G(Oc),dt.push(Oc),Zt=null;return}if(fd(w)){let Oc=ae(p,go);if(!Oc&&ve(Ir)&&I2(w)&&(Oc=ae(p,Ir)),!Ml(w)||Oc){Zt=null;return}}ve(Mt)&&Nn(go,pi,Il,Ws)?(Zt||(Zt=Ye.clone(Mt,!1),Ir.insertBefore(Zt,go),dt.push(Zt)),Ws&&Po&&(vt=Cs),Zt.appendChild(go)):(Zt=null,Ne(Rr(go.childNodes),yn),Po&&(vt=Cs),Zt=null)};Ne(Lt,yn)}),w.links===!0&&Ne(dt,Lt=>{const Zt=yn=>{yn.nodeName==="A"&&G(yn,w),Ne(Rr(yn.childNodes),Zt)};Zt(Lt)}),Ne(dt,Lt=>{const Zt=Po=>{let Cs=0;return Ne(Po.childNodes,Ws=>{!ym(Ws)&&!Wd(Ws)&&Cs++}),Cs},yn=Po=>oo(Po.childNodes,qk).filter(Ws=>Ye.getContentEditable(Ws)!=="false"&&HA(Ye,Ws,w)).map(Ws=>{const Ir=Ye.clone(Ws,!1);return G(Ir),Ye.replace(Ir,Po,!0),Ye.remove(Ws,!0),Ir}).getOr(Po),go=Zt(Lt);if((dt.length>1||!Ye.isBlock(Lt))&&go===0){Ye.remove(Lt,!0);return}(Ml(w)||wm(w)&&w.wrapper)&&(!w.exact&&go===1&&(Lt=yn(Lt)),h8(n,p,c,Lt),pU(n,w,i,c,Lt),d8(Ye,w,c,Lt),mU(Ye,w,c,Lt),gU(Ye,w,c,Lt),tw(n,w,c,Lt))})},Be=D2(m)?m:B.getNode();if(R.getContentEditable(Be)==="false"&&!P2(n,Be)){m=Be,ae(p,m),GE(n,i,m,c);return}if(w){if(m)if(D2(m)){if(!ae(p,m)){const Ye=R.createRng();Ye.setStartBefore(m),Ye.setEndAfter(m),be(R,z0(R,Ye,p),!0)}}else be(R,m,!0);else!x||!Ml(w)||xb(n).length?(B.setRng(k5(B.getRng())),ZE(n,()=>{jk(n,(Ye,De)=>{const ze=De?Ye:z0(R,Ye,p);be(R,ze,!1)})},_t),n.nodeChanged()):GW(n,i,c),JB(n.formatter,i).each(Ye=>{Ne(iU(n.selection),De=>rc(R,De,Ye,c))});nU(i,n)}GE(n,i,m,c)},bU=(n,i,c,m)=>{(m||n.selection.isEditable())&&_ie(n,i,c,m)},vU=n=>un(n,"vars"),Sie=(n,i)=>{n.set({}),i.on("NodeChange",c=>{ov(i,c.element,n.get())}),i.on("FormatApply FormatRemove",c=>{const m=he.from(c.node).map(p=>D2(p)?p:p.startContainer).bind(p=>Jn(p)?he.some(p):he.from(p.parentElement)).getOrThunk(()=>xg(i));ov(i,m,n.get())})},xg=n=>n.selection.getStart(),Lx=(n,i,c,m,p)=>ps(i,R=>{const B=n.formatter.matchNode(R,c,p!=null?p:{},m);return!_e(B)},R=>R5(n,R,c)?!0:m?!1:ve(n.formatter.matchNode(R,c,p,!0))),nv=(n,i)=>{const c=i!=null?i:xg(n);return Dt($2(n.dom,c),m=>Jn(m)&&!Pd(m))},ov=(n,i,c)=>{const m=nv(n,i);ln(c,(p,w)=>{const x=R=>{const B=Lx(n,m,w,R.similar,vU(R)?R.vars:void 0),G=B.isSome();if(R.state.get()!==G){R.state.set(G);const ae=B.getOr(i);vU(R)?R.callback(G,{node:ae,format:w,parents:m}):Ne(R.callbacks,fe=>fe(G,{node:ae,format:w,parents:m}))}};Ne([p.withSimilar,p.withoutSimilar],x),Ne(p.withVars,x)})},OU=(n,i,c,m,p,w)=>{const x=i.get();Ne(c.split(","),R=>{const B=Oo(x,R).getOrThunk(()=>{const ae={withSimilar:{state:qa(!1),similar:!0,callbacks:[]},withoutSimilar:{state:qa(!1),similar:!1,callbacks:[]},withVars:[]};return x[R]=ae,ae}),G=()=>{const ae=nv(n);return Lx(n,ae,R,p,w).isSome()};if(_e(w)){const ae=p?B.withSimilar:B.withoutSimilar;ae.callbacks.push(m),ae.callbacks.length===1&&ae.state.set(G())}else B.withVars.push({state:qa(G()),similar:p,vars:w,callback:m})}),i.set(x)},yU=(n,i,c)=>{const m=n.get();Ne(i.split(","),p=>Oo(m,p).each(w=>{m[p]={withSimilar:{...w.withSimilar,callbacks:Dt(w.withSimilar.callbacks,x=>x!==c)},withoutSimilar:{...w.withoutSimilar,callbacks:Dt(w.withoutSimilar.callbacks,x=>x!==c)},withVars:Dt(w.withVars,x=>x.callback!==c)}})),n.set(m)},PS=(n,i,c,m,p,w)=>(OU(n,i,c,m,p,w),{unbind:()=>yU(i,c,m)}),MS=(n,i,c,m)=>{const p=n.formatter.get(i);p&&($5(n,i,c,m)&&(!("toggle"in p[0])||p[0].toggle)?f8(n,i,c,m):bU(n,i,c,m))},sw=hn.explode,G5=()=>{const n={};return{addFilter:(p,w)=>{Ne(sw(p),x=>{un(n,x)||(n[x]={name:x,callbacks:[]}),n[x].callbacks.push(w)})},getFilters:()=>uo(n),removeFilter:(p,w)=>{Ne(sw(p),x=>{if(un(n,x))if(ve(w)){const R=n[x],B=Dt(R.callbacks,G=>G!==w);B.length>0?R.callbacks=B:delete n[x]}else delete n[x]})}}},K5=(n,i)=>{Ne(i,c=>{n.attr(c,null)})},g8=(n,i,c)=>{n.addNodeFilter("font",m=>{Ne(m,p=>{const w=i.parse(p.attr("style")),x=p.attr("color"),R=p.attr("face"),B=p.attr("size");x&&(w.color=x),R&&(w["font-family"]=R),B&&ou(B).each(G=>{w["font-size"]=c[G-1]}),p.name="span",p.attr("style",i.serialize(w)),K5(p,["color","face","size"])})})},p8=(n,i,c)=>{n.addNodeFilter("strike",m=>{const p=i.type!=="html4";Ne(m,w=>{if(p)w.name="s";else{const x=c.parse(w.attr("style"));x["text-decoration"]="line-through",w.name="span",w.attr("style",c.serialize(x))}})})},wU=(n,i,c)=>{var m;const p=Qv();i.convert_fonts_to_spans&&g8(n,p,hn.explode((m=i.font_size_legacy_values)!==null&&m!==void 0?m:"")),p8(n,c,p)},_U=(n,i,c)=>{i.inline_styles&&wU(n,i,c)},J5=(n,i,c)=>{i.addNodeFilter("br",(m,p,w)=>{const x=hn.extend({},c.getBlockElements()),R=c.getNonEmptyElements(),B=c.getWhitespaceElements();x.body=1;const G=ae=>ae.name in x||sr(c,ae);for(let ae=0,fe=m.length;aefetch(n).then(i=>i.ok?i.blob():Promise.reject()).catch(()=>Promise.reject({message:`Cannot convert ${n} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"})),CU=n=>{const i=/([a-z0-9+\/=\s]+)/i.exec(n);return i?i[1]:""},eM=n=>{const[i,...c]=n.split(","),m=c.join(","),p=/data:([^/]+\/[^;]+)(;.+)?/.exec(i);if(p){const w=p[2]===";base64",x=w?CU(m):decodeURIComponent(m);return he.some({type:p[1],data:x,base64Encoded:w})}else return he.none()},b8=(n,i,c=!0)=>{let m=i;if(c)try{m=atob(i)}catch{return he.none()}const p=new Uint8Array(m.length);for(let w=0;wnew Promise((i,c)=>{eM(n).bind(({type:m,data:p,base64Encoded:w})=>b8(m,p,w)).fold(()=>c("Invalid data URI"),i)}),v8=n=>Ar(n,"blob:")?SU(n):Ar(n,"data:")?kU(n):Promise.reject("Unknown URI format"),O8=n=>new Promise((i,c)=>{const m=new FileReader;m.onloadend=()=>{i(m.result)},m.onerror=()=>{var p;c((p=m.error)===null||p===void 0?void 0:p.message)},m.readAsDataURL(n)});let Fx=0;const y8=n=>(n||"blobid")+Fx++,w8=(n,i,c)=>eM(n).bind(({data:m,type:p,base64Encoded:w})=>{if(i&&!w)return he.none();{const x=w?m:btoa(m);return c(x,p)}}),tM=(n,i,c)=>{const m=n.create(y8(),i,c);return n.add(m),m},_8=(n,i,c=!1)=>w8(i,c,(m,p)=>he.from(n.getByData(m,p)).orThunk(()=>b8(p,m).map(w=>tM(n,w,m)))),S8=(n,i)=>{const c=()=>Promise.reject("Invalid data URI");if(Ar(i,"blob:")){const m=n.getByUri(i);return ve(m)?Promise.resolve(m):v8(i).then(p=>O8(p).then(w=>w8(w,!1,x=>he.some(tM(n,p,x))).getOrThunk(c)))}else return Ar(i,"data:")?_8(n,i).fold(c,m=>Promise.resolve(m)):Promise.reject("Unknown image data format")},xU=n=>ve(n.attr("data-mce-bogus")),TU=n=>n.attr("src")===Gn.transparentSrc||ve(n.attr("data-mce-placeholder")),C8=(n,i)=>{const{blob_cache:c}=i;if(c){const m=p=>{const w=p.attr("src");TU(p)||xU(p)||Le(w)||_8(c,w,!0).each(x=>{p.attr("src",x.blobUri())})};n.addAttributeFilter("src",p=>Ne(p,m))}},k8=(n,i)=>{const c=n.schema;i.remove_trailing_brs&&J5(i,n,c),n.addAttributeFilter("href",p=>{let w=p.length;const x=B=>B.split(" ").filter(ae=>ae.length>0).concat(["noopener"]).sort().join(" "),R=B=>{const G=B?hn.trim(B):"";return/\b(noopener)\b/g.test(G)?G:x(G)};if(!i.allow_unsafe_link_target)for(;w--;){const B=p[w];B.name==="a"&&B.attr("target")==="_blank"&&B.attr("rel",R(B.attr("rel")))}}),i.allow_html_in_named_anchor||n.addAttributeFilter("id,name",p=>{let w=p.length,x,R,B,G;for(;w--;)if(G=p[w],G.name==="a"&&G.firstChild&&!G.attr("href"))for(B=G.parent,x=G.lastChild;x&&B;)R=x.prev,B.insert(x,G),x=R}),i.fix_list_elements&&n.addNodeFilter("ul,ol",p=>{let w=p.length,x,R;for(;w--;)if(x=p[w],R=x.parent,R&&(R.name==="ul"||R.name==="ol"))if(x.prev&&x.prev.name==="li")x.prev.append(x);else{const B=new Xd("li",1);B.attr("style","list-style-type: none"),x.wrap(B)}});const m=c.getValidClasses();i.validate&&m&&n.addAttributeFilter("class",p=>{var w;let x=p.length;for(;x--;){const R=p[x],B=(w=R.attr("class"))!==null&&w!==void 0?w:"",G=hn.explode(B," ");let ae="";for(let fe=0;fe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qx(n,i,c){return x8()?Qx=Reflect.construct:Qx=function(p,w,x){var R=[null];R.push.apply(R,w);var B=Function.bind.apply(p,R),G=new B;return x&&YA(G,x.prototype),G},Qx.apply(null,arguments)}function g1(n){return EU(n)||AU(n)||nM(n)||T8()}function EU(n){if(Array.isArray(n))return rw(n)}function AU(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function nM(n,i){if(!!n){if(typeof n=="string")return rw(n,i);var c=Object.prototype.toString.call(n).slice(8,-1);if(c==="Object"&&n.constructor&&(c=n.constructor.name),c==="Map"||c==="Set")return Array.from(n);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return rw(n,i)}}function rw(n,i){(i==null||i>n.length)&&(i=n.length);for(var c=0,m=new Array(i);c1?c-1:0),p=1;p/gm),cM=p1(/^data-[\-\w.\u00B7-\uFFFF]/),uM=p1(/^aria-[\-\w]+$/),NU=p1(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IU=p1(/^(?:\w+script|data):/i),Pb=p1(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fM=p1(/^html$/i),BU=function(){return typeof window>"u"?null:window},dM=function(i,c){if($O(i)!=="object"||typeof i.createPolicy!="function")return null;var m=null,p="data-tt-policy-suffix";c.currentScript&&c.currentScript.hasAttribute(p)&&(m=c.currentScript.getAttribute(p));var w="dompurify"+(m?"#"+m:"");try{return i.createPolicy(w,{createHTML:function(R){return R}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}};function KA(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:BU(),i=function(jt){return KA(jt)};if(i.version="2.3.8",i.removed=[],!n||!n.document||n.document.nodeType!==9)return i.isSupported=!1,i;var c=n.document,m=n.document,p=n.DocumentFragment,w=n.HTMLTemplateElement,x=n.Node,R=n.Element,B=n.NodeFilter,G=n.NamedNodeMap,ae=G===void 0?n.NamedNodeMap||n.MozNamedAttrMap:G,fe=n.HTMLFormElement,be=n.DOMParser,Be=n.trustedTypes,Ye=R.prototype,De=Db(Ye,"cloneNode"),ze=Db(Ye,"nextSibling"),dt=Db(Ye,"childNodes"),vt=Db(Ye,"parentNode");if(typeof w=="function"){var St=m.createElement("template");St.content&&St.content.ownerDocument&&(m=St.content.ownerDocument)}var Mt=dM(Be,c),dn=Mt?Mt.createHTML(""):"",Hn=m,Nn=Hn.implementation,Lt=Hn.createNodeIterator,Zt=Hn.createDocumentFragment,yn=Hn.getElementsByTagName,go=c.importNode,Po={};try{Po=Ab(m).documentMode?m.documentMode:{}}catch{}var Cs={};i.isSupported=typeof vt=="function"&&Nn&&typeof Nn.createHTMLDocument<"u"&&Po!==9;var Ws=$8,Ir=$U,pi=cM,ul=uM,Il=IU,Oc=Pb,Mn=NU,eo=null,Cr=Fi({},[].concat(g1(iM),g1(gd),g1(sv),g1(aM),g1(R8))),Is=null,ko=Fi({},[].concat(g1(lM),g1(iw),g1(qA),g1(GA))),Rn=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),En=null,jo=null,Ks=!0,Kr=!0,co=!1,Us=!1,ci=!1,Ka=!1,Ti=!1,$c=!1,Fh=!1,qd=!1,Dm=!0,qO=!0,Pw=!1,GO={},KO=null,Z4=Fi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),H4=null,z4=Fi({},["audio","video","img","source","image","track"]),FT=null,QT=Fi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ZT="http://www.w3.org/1998/Math/MathML",cC="http://www.w3.org/2000/svg",T1="http://www.w3.org/1999/xhtml",uC=T1,Mw=!1,vv,HT=["application/xhtml+xml","text/html"],zT="text/html",Ib,Ov=null,VT=m.createElement("form"),WT=function(jt){return jt instanceof RegExp||jt instanceof Function},UT=function(jt){Ov&&Ov===jt||((!jt||$O(jt)!=="object")&&(jt={}),jt=Ab(jt),eo="ALLOWED_TAGS"in jt?Fi({},jt.ALLOWED_TAGS):Cr,Is="ALLOWED_ATTR"in jt?Fi({},jt.ALLOWED_ATTR):ko,FT="ADD_URI_SAFE_ATTR"in jt?Fi(Ab(QT),jt.ADD_URI_SAFE_ATTR):QT,H4="ADD_DATA_URI_TAGS"in jt?Fi(Ab(z4),jt.ADD_DATA_URI_TAGS):z4,KO="FORBID_CONTENTS"in jt?Fi({},jt.FORBID_CONTENTS):Z4,En="FORBID_TAGS"in jt?Fi({},jt.FORBID_TAGS):{},jo="FORBID_ATTR"in jt?Fi({},jt.FORBID_ATTR):{},GO="USE_PROFILES"in jt?jt.USE_PROFILES:!1,Ks=jt.ALLOW_ARIA_ATTR!==!1,Kr=jt.ALLOW_DATA_ATTR!==!1,co=jt.ALLOW_UNKNOWN_PROTOCOLS||!1,Us=jt.SAFE_FOR_TEMPLATES||!1,ci=jt.WHOLE_DOCUMENT||!1,$c=jt.RETURN_DOM||!1,Fh=jt.RETURN_DOM_FRAGMENT||!1,qd=jt.RETURN_TRUSTED_TYPE||!1,Ti=jt.FORCE_BODY||!1,Dm=jt.SANITIZE_DOM!==!1,qO=jt.KEEP_CONTENT!==!1,Pw=jt.IN_PLACE||!1,Mn=jt.ALLOWED_URI_REGEXP||Mn,uC=jt.NAMESPACE||T1,jt.CUSTOM_ELEMENT_HANDLING&&WT(jt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Rn.tagNameCheck=jt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),jt.CUSTOM_ELEMENT_HANDLING&&WT(jt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Rn.attributeNameCheck=jt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),jt.CUSTOM_ELEMENT_HANDLING&&typeof jt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Rn.allowCustomizedBuiltInElements=jt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vv=HT.indexOf(jt.PARSER_MEDIA_TYPE)===-1?vv=zT:vv=jt.PARSER_MEDIA_TYPE,Ib=vv==="application/xhtml+xml"?function(So){return So}:jA,Us&&(Kr=!1),Fh&&($c=!0),GO&&(eo=Fi({},g1(R8)),Is=[],GO.html===!0&&(Fi(eo,iM),Fi(Is,lM)),GO.svg===!0&&(Fi(eo,gd),Fi(Is,iw),Fi(Is,GA)),GO.svgFilters===!0&&(Fi(eo,sv),Fi(Is,iw),Fi(Is,GA)),GO.mathMl===!0&&(Fi(eo,aM),Fi(Is,qA),Fi(Is,GA))),jt.ADD_TAGS&&(eo===Cr&&(eo=Ab(eo)),Fi(eo,jt.ADD_TAGS)),jt.ADD_ATTR&&(Is===ko&&(Is=Ab(Is)),Fi(Is,jt.ADD_ATTR)),jt.ADD_URI_SAFE_ATTR&&Fi(FT,jt.ADD_URI_SAFE_ATTR),jt.FORBID_CONTENTS&&(KO===Z4&&(KO=Ab(KO)),Fi(KO,jt.FORBID_CONTENTS)),qO&&(eo["#text"]=!0),ci&&Fi(eo,["html","head","body"]),eo.table&&(Fi(eo,["tbody"]),delete En.tbody),md&&md(jt),Ov=jt)},V4=Fi({},["mi","mo","mn","ms","mtext"]),W4=Fi({},["foreignobject","desc","title","annotation-xml"]),kZ=Fi({},["title","style","font","a","script"]),E1=Fi({},gd);Fi(E1,sv),Fi(E1,P8);var Rw=Fi({},aM);Fi(Rw,M8);var Rt=function(jt){var So=vt(jt);(!So||!So.tagName)&&(So={namespaceURI:T1,tagName:"template"});var ws=jA(jt.tagName),Sl=jA(So.tagName);return jt.namespaceURI===cC?So.namespaceURI===T1?ws==="svg":So.namespaceURI===ZT?ws==="svg"&&(Sl==="annotation-xml"||V4[Sl]):Boolean(E1[ws]):jt.namespaceURI===ZT?So.namespaceURI===T1?ws==="math":So.namespaceURI===cC?ws==="math"&&W4[Sl]:Boolean(Rw[ws]):jt.namespaceURI===T1?So.namespaceURI===cC&&!W4[Sl]||So.namespaceURI===ZT&&!V4[Sl]?!1:!Rw[ws]&&(kZ[ws]||!E1[ws]):!1},$t=function(jt){zx(i.removed,{element:jt});try{jt.parentNode.removeChild(jt)}catch{try{jt.outerHTML=dn}catch{jt.remove()}}},$n=function(jt,So){try{zx(i.removed,{attribute:So.getAttributeNode(jt),from:So})}catch{zx(i.removed,{attribute:null,from:So})}if(So.removeAttribute(jt),jt==="is"&&!Is[jt])if($c||Fh)try{$t(So)}catch{}else try{So.setAttribute(jt,"")}catch{}},xn=function(jt){var So,ws;if(Ti)jt=""+jt;else{var Sl=sM(jt,/^[\r\n\t ]+/);ws=Sl&&Sl[0]}vv==="application/xhtml+xml"&&(jt=''+jt+"");var Pm=Mt?Mt.createHTML(jt):jt;if(uC===T1)try{So=new be().parseFromString(Pm,vv)}catch{}if(!So||!So.documentElement){So=Nn.createDocument(uC,"template",null);try{So.documentElement.innerHTML=Mw?"":Pm}catch{}}var Gd=So.body||So.documentElement;return jt&&ws&&Gd.insertBefore(m.createTextNode(ws),Gd.childNodes[0]||null),uC===T1?yn.call(So,ci?"html":"body")[0]:ci?So.documentElement:Gd},Io=function(jt){return Lt.call(jt.ownerDocument||jt,jt,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null,!1)},br=function(jt){return jt instanceof fe&&(typeof jt.nodeName!="string"||typeof jt.textContent!="string"||typeof jt.removeChild!="function"||!(jt.attributes instanceof ae)||typeof jt.removeAttribute!="function"||typeof jt.setAttribute!="function"||typeof jt.namespaceURI!="string"||typeof jt.insertBefore!="function")},ha=function(jt){return $O(x)==="object"?jt instanceof x:jt&&$O(jt)==="object"&&typeof jt.nodeType=="number"&&typeof jt.nodeName=="string"},Nc=function(jt,So,ws){!Cs[jt]||A8(Cs[jt],function(Sl){Sl.call(i,So,ws,Ov)})},_u=function(jt){var So;if(Nc("beforeSanitizeElements",jt,null),br(jt)||$h(/[\u0080-\uFFFF]/,jt.nodeName))return $t(jt),!0;var ws=Ib(jt.nodeName);if(Nc("uponSanitizeElement",jt,{tagName:ws,allowedTags:eo}),jt.hasChildNodes()&&!ha(jt.firstElementChild)&&(!ha(jt.content)||!ha(jt.content.firstElementChild))&&$h(/<[/\w]/g,jt.innerHTML)&&$h(/<[/\w]/g,jt.textContent)||ws==="select"&&$h(/