@paroicms/quill-editor-plugin 1.47.12 → 1.47.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{For as e,Show as t,createEffect as n,createMemo as r,createRoot as i,createSignal as a,onCleanup as o}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.12/+esm";import{className as s,createComponent as c,delegateEvents as l,effect as u,insert as d,memo as f,setStyleProperty as p,template as m}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.12/web/+esm";var h=Object.create,g=Object.defineProperty,_=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,y=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),S=(e,t)=>{let n={};for(var r in e)g(n,r,{get:e[r],enumerable:!0});return t||g(n,Symbol.toStringTag,{value:"Module"}),n},C=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=v(t),a=0,o=i.length,s;a<o;a++)s=i[a],!b.call(e,s)&&s!==n&&g(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=_(t,s))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:h(y(e)),C(t||!e||!e.__esModule?g(n,"default",{value:e,enumerable:!0}):n,e));function T(e){return typeof e=="object"&&!!e&&"j"in e}function E(e){return/^[0-9]+x|x[0-9]+|x[0-9]+x|[0-9]+x[0-9]+$/.test(e)}var D=typeof global=="object"&&global&&global.Object===Object&&global,O=typeof self=="object"&&self&&self.Object===Object&&self,k=D||O||Function("return this")(),A=k.Symbol,ee=Object.prototype,j=ee.hasOwnProperty,M=ee.toString,N=A?A.toStringTag:void 0;function te(e){var t=j.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch{}var i=M.call(e);return r&&(t?e[N]=n:delete e[N]),i}var P=Object.prototype.toString;function ne(e){return P.call(e)}var re="[object Null]",F="[object Undefined]",ie=A?A.toStringTag:void 0;function I(e){return e==null?e===void 0?F:re:ie&&ie in Object(e)?te(e):ne(e)}function ae(e){return typeof e=="object"&&!!e}var oe=Array.isArray;function L(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function se(e){return e}var ce="[object AsyncFunction]",le="[object Function]",ue="[object GeneratorFunction]",de="[object Proxy]";function fe(e){if(!L(e))return!1;var t=I(e);return t==le||t==ue||t==ce||t==de}var pe=k["__core-js_shared__"],me=function(){var e=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function he(e){return!!me&&me in e}var ge=Function.prototype.toString;function _e(e){if(e!=null){try{return ge.call(e)}catch{}try{return e+""}catch{}}return""}var ve=/[\\^$.*+?()[\]{}|]/g,ye=/^\[object .+?Constructor\]$/,be=Function.prototype,xe=Object.prototype,Se=be.toString,Ce=xe.hasOwnProperty,we=RegExp("^"+Se.call(Ce).replace(ve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Te(e){return!L(e)||he(e)?!1:(fe(e)?we:ye).test(_e(e))}function Ee(e,t){return e?.[t]}function De(e,t){var n=Ee(e,t);return Te(n)?n:void 0}var R=De(k,"WeakMap"),Oe=Object.create,ke=function(){function e(){}return function(t){if(!L(t))return{};if(Oe)return Oe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Ae(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function je(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Me=800,Ne=16,Pe=Date.now;function Fe(e){var t=0,n=0;return function(){var r=Pe(),i=Ne-(r-n);if(n=r,i>0){if(++t>=Me)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ie(e){return function(){return e}}var Le=function(){try{var e=De(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Re=Fe(Le?function(e,t){return Le(e,"toString",{configurable:!0,enumerable:!1,value:Ie(t),writable:!0})}:se);function ze(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Be=9007199254740991,Ve=/^(?:0|[1-9]\d*)$/;function He(e,t){var n=typeof e;return t??=Be,!!t&&(n=="number"||n!="symbol"&&Ve.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e,t,n){t=="__proto__"&&Le?Le(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function We(e,t){return e===t||e!==e&&t!==t}var Ge=Object.prototype.hasOwnProperty;function Ke(e,t,n){var r=e[t];(!(Ge.call(e,t)&&We(r,n))||n===void 0&&!(t in e))&&Ue(e,t,n)}function qe(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Ue(n,s,c):Ke(n,s,c)}return n}var Je=Math.max;function Ye(e,t,n){return t=Je(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Je(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Ae(e,this,s)}}function Xe(e,t){return Re(Ye(e,t,se),e+"")}var Ze=9007199254740991;function Qe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ze}function z(e){return e!=null&&Qe(e.length)&&!fe(e)}function $e(e,t,n){if(!L(n))return!1;var r=typeof t;return(r=="number"?z(n)&&He(t,n.length):r=="string"&&t in n)?We(n[t],e):!1}function et(e){return Xe(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&$e(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var tt=Object.prototype;function nt(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||tt)}function rt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var B="[object Arguments]";function it(e){return ae(e)&&I(e)==B}var at=Object.prototype,ot=at.hasOwnProperty,st=at.propertyIsEnumerable,ct=it(function(){return arguments}())?it:function(e){return ae(e)&&ot.call(e,"callee")&&!st.call(e,"callee")};function V(){return!1}var lt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ut=lt&&typeof module=="object"&&module&&!module.nodeType&&module,dt=ut&&ut.exports===lt?k.Buffer:void 0,ft=(dt?dt.isBuffer:void 0)||V,pt="[object Arguments]",mt="[object Array]",ht="[object Boolean]",gt="[object Date]",_t="[object Error]",vt="[object Function]",yt="[object Map]",bt="[object Number]",xt="[object Object]",St="[object RegExp]",Ct="[object Set]",wt="[object String]",Tt="[object WeakMap]",Et="[object ArrayBuffer]",Dt="[object DataView]",Ot="[object Float32Array]",kt="[object Float64Array]",At="[object Int8Array]",jt="[object Int16Array]",Mt="[object Int32Array]",Nt="[object Uint8Array]",Pt="[object Uint8ClampedArray]",Ft="[object Uint16Array]",It="[object Uint32Array]",H={};H[Ot]=H[kt]=H[At]=H[jt]=H[Mt]=H[Nt]=H[Pt]=H[Ft]=H[It]=!0,H[pt]=H[mt]=H[Et]=H[ht]=H[Dt]=H[gt]=H[_t]=H[vt]=H[yt]=H[bt]=H[xt]=H[St]=H[Ct]=H[wt]=H[Tt]=!1;function Lt(e){return ae(e)&&Qe(e.length)&&!!H[I(e)]}function Rt(e){return function(t){return e(t)}}var zt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bt=zt&&typeof module=="object"&&module&&!module.nodeType&&module,Vt=Bt&&Bt.exports===zt&&D.process,Ht=function(){try{return Bt&&Bt.require&&Bt.require("util").types||Vt&&Vt.binding&&Vt.binding("util")}catch{}}(),Ut=Ht&&Ht.isTypedArray,Wt=Ut?Rt(Ut):Lt,Gt=Object.prototype.hasOwnProperty;function U(e,t){var n=oe(e),r=!n&&ct(e),i=!n&&!r&&ft(e),a=!n&&!r&&!i&&Wt(e),o=n||r||i||a,s=o?rt(e.length,String):[],c=s.length;for(var l in e)(t||Gt.call(e,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||He(l,c)))&&s.push(l);return s}function Kt(e,t){return function(n){return e(t(n))}}var qt=Kt(Object.keys,Object),Jt=Object.prototype.hasOwnProperty;function Yt(e){if(!nt(e))return qt(e);var t=[];for(var n in Object(e))Jt.call(e,n)&&n!="constructor"&&t.push(n);return t}function Xt(e){return z(e)?U(e):Yt(e)}function Zt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Qt=Object.prototype.hasOwnProperty;function $t(e){if(!L(e))return Zt(e);var t=nt(e),n=[];for(var r in e)r=="constructor"&&(t||!Qt.call(e,r))||n.push(r);return n}function en(e){return z(e)?U(e,!0):$t(e)}var tn=De(Object,"create");function nn(){this.__data__=tn?tn(null):{},this.size=0}function rn(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var an="__lodash_hash_undefined__",on=Object.prototype.hasOwnProperty;function sn(e){var t=this.__data__;if(tn){var n=t[e];return n===an?void 0:n}return on.call(t,e)?t[e]:void 0}var cn=Object.prototype.hasOwnProperty;function ln(e){var t=this.__data__;return tn?t[e]!==void 0:cn.call(t,e)}var un="__lodash_hash_undefined__";function dn(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tn&&t===void 0?un:t,this}function fn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fn.prototype.clear=nn,fn.prototype.delete=rn,fn.prototype.get=sn,fn.prototype.has=ln,fn.prototype.set=dn;function pn(){this.__data__=[],this.size=0}function mn(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}var hn=Array.prototype.splice;function gn(e){var t=this.__data__,n=mn(t,e);return n<0?!1:(n==t.length-1?t.pop():hn.call(t,n,1),--this.size,!0)}function _n(e){var t=this.__data__,n=mn(t,e);return n<0?void 0:t[n][1]}function vn(e){return mn(this.__data__,e)>-1}function yn(e,t){var n=this.__data__,r=mn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function bn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bn.prototype.clear=pn,bn.prototype.delete=gn,bn.prototype.get=_n,bn.prototype.has=vn,bn.prototype.set=yn;var xn=De(k,"Map");function Sn(){this.size=0,this.__data__={hash:new fn,map:new(xn||bn),string:new fn}}function Cn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function wn(e,t){var n=e.__data__;return Cn(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Tn(e){var t=wn(this,e).delete(e);return this.size-=t?1:0,t}function En(e){return wn(this,e).get(e)}function Dn(e){return wn(this,e).has(e)}function On(e,t){var n=wn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function kn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kn.prototype.clear=Sn,kn.prototype.delete=Tn,kn.prototype.get=En,kn.prototype.has=Dn,kn.prototype.set=On;function An(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var jn=Kt(Object.getPrototypeOf,Object),Mn="[object Object]",Nn=Function.prototype,Pn=Object.prototype,Fn=Nn.toString,In=Pn.hasOwnProperty,Ln=Fn.call(Object);function Rn(e){if(!ae(e)||I(e)!=Mn)return!1;var t=jn(e);if(t===null)return!0;var n=In.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Fn.call(n)==Ln}function zn(){this.__data__=new bn,this.size=0}function Bn(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Vn(e){return this.__data__.get(e)}function Hn(e){return this.__data__.has(e)}var Un=200;function Wn(e,t){var n=this.__data__;if(n instanceof bn){var r=n.__data__;if(!xn||r.length<Un-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new kn(r)}return n.set(e,t),this.size=n.size,this}function Gn(e){this.size=(this.__data__=new bn(e)).size}Gn.prototype.clear=zn,Gn.prototype.delete=Bn,Gn.prototype.get=Vn,Gn.prototype.has=Hn,Gn.prototype.set=Wn;function Kn(e,t){return e&&qe(t,Xt(t),e)}function qn(e,t){return e&&qe(t,en(t),e)}var Jn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yn=Jn&&typeof module=="object"&&module&&!module.nodeType&&module,Xn=Yn&&Yn.exports===Jn?k.Buffer:void 0,Zn=Xn?Xn.allocUnsafe:void 0;function Qn(e,t){if(t)return e.slice();var n=e.length,r=Zn?Zn(n):new e.constructor(n);return e.copy(r),r}function $n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function er(){return[]}var tr=Object.prototype.propertyIsEnumerable,nr=Object.getOwnPropertySymbols,rr=nr?function(e){return e==null?[]:(e=Object(e),$n(nr(e),function(t){return tr.call(e,t)}))}:er;function ir(e,t){return qe(e,rr(e),t)}var ar=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)An(t,rr(e)),e=jn(e);return t}:er;function or(e,t){return qe(e,ar(e),t)}function sr(e,t,n){var r=t(e);return oe(e)?r:An(r,n(e))}function cr(e){return sr(e,Xt,rr)}function lr(e){return sr(e,en,ar)}var ur=De(k,"DataView"),dr=De(k,"Promise"),fr=De(k,"Set"),pr="[object Map]",mr="[object Object]",hr="[object Promise]",gr="[object Set]",_r="[object WeakMap]",vr="[object DataView]",yr=_e(ur),br=_e(xn),xr=_e(dr),Sr=_e(fr),Cr=_e(R),wr=I;(ur&&wr(new ur(new ArrayBuffer(1)))!=vr||xn&&wr(new xn)!=pr||dr&&wr(dr.resolve())!=hr||fr&&wr(new fr)!=gr||R&&wr(new R)!=_r)&&(wr=function(e){var t=I(e),n=t==mr?e.constructor:void 0,r=n?_e(n):"";if(r)switch(r){case yr:return vr;case br:return pr;case xr:return hr;case Sr:return gr;case Cr:return _r}return t});var Tr=wr,Er=Object.prototype.hasOwnProperty;function Dr(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Er.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Or=k.Uint8Array;function kr(e){var t=new e.constructor(e.byteLength);return new Or(t).set(new Or(e)),t}function Ar(e,t){var n=t?kr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var jr=/\w*$/;function Mr(e){var t=new e.constructor(e.source,jr.exec(e));return t.lastIndex=e.lastIndex,t}var Nr=A?A.prototype:void 0,Pr=Nr?Nr.valueOf:void 0;function Fr(e){return Pr?Object(Pr.call(e)):{}}function Ir(e,t){var n=t?kr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Lr="[object Boolean]",Rr="[object Date]",zr="[object Map]",Br="[object Number]",Vr="[object RegExp]",Hr="[object Set]",Ur="[object String]",Wr="[object Symbol]",Gr="[object ArrayBuffer]",Kr="[object DataView]",qr="[object Float32Array]",Jr="[object Float64Array]",Yr="[object Int8Array]",Xr="[object Int16Array]",Zr="[object Int32Array]",Qr="[object Uint8Array]",$r="[object Uint8ClampedArray]",ei="[object Uint16Array]",ti="[object Uint32Array]";function ni(e,t,n){var r=e.constructor;switch(t){case Gr:return kr(e);case Lr:case Rr:return new r(+e);case Kr:return Ar(e,n);case qr:case Jr:case Yr:case Xr:case Zr:case Qr:case $r:case ei:case ti:return Ir(e,n);case zr:return new r;case Br:case Ur:return new r(e);case Vr:return Mr(e);case Hr:return new r;case Wr:return Fr(e)}}function ri(e){return typeof e.constructor=="function"&&!nt(e)?ke(jn(e)):{}}var ii="[object Map]";function ai(e){return ae(e)&&Tr(e)==ii}var oi=Ht&&Ht.isMap,si=oi?Rt(oi):ai,ci="[object Set]";function li(e){return ae(e)&&Tr(e)==ci}var ui=Ht&&Ht.isSet,di=ui?Rt(ui):li,fi=1,pi=2,mi=4,hi="[object Arguments]",gi="[object Array]",_i="[object Boolean]",vi="[object Date]",yi="[object Error]",bi="[object Function]",xi="[object GeneratorFunction]",Si="[object Map]",Ci="[object Number]",wi="[object Object]",Ti="[object RegExp]",Ei="[object Set]",Di="[object String]",Oi="[object Symbol]",ki="[object WeakMap]",Ai="[object ArrayBuffer]",ji="[object DataView]",Mi="[object Float32Array]",Ni="[object Float64Array]",Pi="[object Int8Array]",Fi="[object Int16Array]",Ii="[object Int32Array]",Li="[object Uint8Array]",Ri="[object Uint8ClampedArray]",zi="[object Uint16Array]",Bi="[object Uint32Array]",W={};W[hi]=W[gi]=W[Ai]=W[ji]=W[_i]=W[vi]=W[Mi]=W[Ni]=W[Pi]=W[Fi]=W[Ii]=W[Si]=W[Ci]=W[wi]=W[Ti]=W[Ei]=W[Di]=W[Oi]=W[Li]=W[Ri]=W[zi]=W[Bi]=!0,W[yi]=W[bi]=W[ki]=!1;function Vi(e,t,n,r,i,a){var o,s=t&fi,c=t&pi,l=t&mi;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!L(e))return e;var u=oe(e);if(u){if(o=Dr(e),!s)return je(e,o)}else{var d=Tr(e),f=d==bi||d==xi;if(ft(e))return Qn(e,s);if(d==wi||d==hi||f&&!i){if(o=c||f?{}:ri(e),!s)return c?or(e,qn(o,e)):ir(e,Kn(o,e))}else{if(!W[d])return i?e:{};o=ni(e,d,s)}}a||=new Gn;var p=a.get(e);if(p)return p;a.set(e,o),di(e)?e.forEach(function(r){o.add(Vi(r,t,n,r,e,a))}):si(e)&&e.forEach(function(r,i){o.set(i,Vi(r,t,n,i,e,a))});var m=u?void 0:(l?c?lr:cr:c?en:Xt)(e);return ze(m||e,function(r,i){m&&(i=r,r=e[i]),Ke(o,i,Vi(r,t,n,i,e,a))}),o}var Hi=1,Ui=4;function Wi(e){return Vi(e,Hi|Ui)}var Gi="__lodash_hash_undefined__";function Ki(e){return this.__data__.set(e,Gi),this}function qi(e){return this.__data__.has(e)}function Ji(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new kn;++t<n;)this.add(e[t])}Ji.prototype.add=Ji.prototype.push=Ki,Ji.prototype.has=qi;function Yi(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Xi(e,t){return e.has(t)}var Zi=1,Qi=2;function $i(e,t,n,r,i,a){var o=n&Zi,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Qi?new Ji:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Yi(t,function(e,t){if(!Xi(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function ea(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function ta(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var na=1,ra=2,ia="[object Boolean]",aa="[object Date]",oa="[object Error]",sa="[object Map]",ca="[object Number]",la="[object RegExp]",ua="[object Set]",da="[object String]",fa="[object Symbol]",pa="[object ArrayBuffer]",ma="[object DataView]",ha=A?A.prototype:void 0,ga=ha?ha.valueOf:void 0;function _a(e,t,n,r,i,a,o){switch(n){case ma:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case pa:return!(e.byteLength!=t.byteLength||!a(new Or(e),new Or(t)));case ia:case aa:case ca:return We(+e,+t);case oa:return e.name==t.name&&e.message==t.message;case la:case da:return e==t+"";case sa:var s=ea;case ua:var c=r&na;if(s||=ta,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=ra,o.set(e,t);var u=$i(s(e),s(t),r,i,a,o);return o.delete(e),u;case fa:if(ga)return ga.call(e)==ga.call(t)}return!1}var va=1,ya=Object.prototype.hasOwnProperty;function ba(e,t,n,r,i,a){var o=n&va,s=cr(e),c=s.length;if(c!=cr(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:ya.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u=="constructor"}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof y=="function"&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var xa=1,Sa="[object Arguments]",Ca="[object Array]",wa="[object Object]",Ta=Object.prototype.hasOwnProperty;function Ea(e,t,n,r,i,a){var o=oe(e),s=oe(t),c=o?Ca:Tr(e),l=s?Ca:Tr(t);c=c==Sa?wa:c,l=l==Sa?wa:l;var u=c==wa,d=l==wa,f=c==l;if(f&&ft(e)){if(!ft(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Gn,o||Wt(e)?$i(e,t,n,r,i,a):_a(e,t,c,n,r,i,a);if(!(n&xa)){var p=u&&Ta.call(e,"__wrapped__"),m=d&&Ta.call(t,"__wrapped__");if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Gn,i(h,g,n,r,a)}}return f?(a||=new Gn,ba(e,t,n,r,i,a)):!1}function Da(e,t,n,r,i){return e===t?!0:e==null||t==null||!ae(e)&&!ae(t)?e!==e&&t!==t:Ea(e,t,n,r,Da,i)}function Oa(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var ka=Oa();function Aa(e,t,n){(n!==void 0&&!We(e[t],n)||n===void 0&&!(t in e))&&Ue(e,t,n)}function ja(e){return ae(e)&&z(e)}function Ma(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Na(e){return qe(e,en(e))}function Pa(e,t,n,r,i,a,o){var s=Ma(e,n),c=Ma(t,n),l=o.get(c);if(l){Aa(e,n,l);return}var u=a?a(s,c,n+"",e,t,o):void 0,d=u===void 0;if(d){var f=oe(c),p=!f&&ft(c),m=!f&&!p&&Wt(c);u=c,f||p||m?oe(s)?u=s:ja(s)?u=je(s):p?(d=!1,u=Qn(c,!0)):m?(d=!1,u=Ir(c,!0)):u=[]:Rn(c)||ct(c)?(u=s,ct(s)?u=Na(s):(!L(s)||fe(s))&&(u=ri(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Aa(e,n,u)}function Fa(e,t,n,r,i){e!==t&&ka(t,function(a,o){if(i||=new Gn,L(a))Pa(e,t,o,n,Fa,r,i);else{var s=r?r(Ma(e,o),a,o+"",e,t,i):void 0;s===void 0&&(s=a),Aa(e,o,s)}},en)}function Ia(e,t){return Da(e,t)}var La=et(function(e,t,n){Fa(e,t,n)}),Ra=S({Attributor:()=>za,AttributorStore:()=>qa,BlockBlot:()=>ao,ClassAttributor:()=>Wa,ContainerBlot:()=>so,EmbedBlot:()=>co,InlineBlot:()=>ro,LeafBlot:()=>K,ParentBlot:()=>eo,Registry:()=>Ha,Scope:()=>G,ScrollBlot:()=>po,StyleAttributor:()=>Ka,TextBlot:()=>ho}),G=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(G||{}),za=class{constructor(e,t,n={}){this.attrName=e,this.keyName=t;let r=G.TYPE&G.ATTRIBUTE;this.scope=n.scope==null?G.ATTRIBUTE:n.scope&G.LEVEL|r,n.whitelist!=null&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(e=>e.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){let t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}},Ba=class extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}},Va=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){let i=this.query(n);if(i==null)throw new Ba(`Unable to create ${n} blot`);let a=i,o=new a(t,n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),r);return e.blots.set(o.domNode,o),o}find(t,n=!1){return e.find(t,n)}query(e,t=G.ANY){let n;return typeof e=="string"?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:typeof e=="number"?e&G.LEVEL&G.BLOCK?n=this.types.block:e&G.LEVEL&G.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(e=>(n=this.classes[e],!!n)),n||=this.tags[e.tagName]),n==null?null:"scope"in n&&t&G.LEVEL&n.scope&&t&G.TYPE&n.scope?n:null}register(...e){return e.map(e=>{let t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new Ba("Invalid definition");if(t&&e.blotName==="abstract")throw new Ba("Cannot register abstract class");let r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(e=>e.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{(this.tags[t]==null||e.className==null)&&(this.tags[t]=e)}))),e})}};Va.blots=new WeakMap;var Ha=Va;function Ua(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}var Wa=class extends za{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){Ua(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){let t=(Ua(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function Ga(e){let t=e.split("-"),n=t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join("");return t[0]+n}var Ka=class extends za{static keys(e){return(e.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[Ga(this.keyName)]=t,!0):!1}remove(e){e.style[Ga(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){let t=e.style[Ga(this.keyName)];return this.canAdd(e,t)?t:""}},qa=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)==null?delete this.attributes[e.attrName]:this.attributes[e.attrName]=e):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};let e=Ha.find(this.domNode);if(e==null)return;let t=za.keys(this.domNode),n=Wa.keys(this.domNode),r=Ka.keys(this.domNode);t.concat(n).concat(r).forEach(t=>{let n=e.scroll.query(t,G.ATTRIBUTE);n instanceof za&&(this.attributes[n.attrName]=n)})}copy(e){Object.keys(this.attributes).forEach(t=>{let n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}},Ja=class{constructor(e,t){this.scroll=e,this.domNode=t,Ha.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Ba("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?(typeof e=="string"?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof e=="number"&&(n=e),t=typeof n=="number"?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){let e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Ha.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){let i=this.isolate(e,t);if(this.scroll.query(n,G.BLOT)!=null&&r)i.wrap(n,r);else if(this.scroll.query(n,G.ATTRIBUTE)!=null){let e=this.scroll.create(this.statics.scope);i.wrap(e),e.format(n,r)}}insertAt(e,t,n){let r=n==null?this.scroll.create("text",t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(r,i||void 0)}isolate(e,t){let n=this.split(e);if(n==null)throw Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){let n=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){let n=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new Ba(`Cannot wrap ${e}`);return n.appendChild(this),n}};Ja.blotName="abstract";var Ya=Ja,Xa=class extends Ya{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Xa.scope=G.INLINE_BLOT;var K=Xa,Za=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){let t=e.slice(1);this.append(...t)}}at(e){let t=this.iterator(),n=t();for(;n&&e>0;)--e,n=t();return n}contains(e){let t=this.iterator(),n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){let t=this.iterator(),n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t==null?this.tail==null?(e.prev=null,this.head=this.tail=e):(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)),this.length+=1)}offset(e){let t=0,n=this.head;for(;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),--this.length)}iterator(e=this.head){return()=>{let t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){let n=this.iterator(),r=n();for(;r;){let i=r.length();if(e<i||t&&e===i&&(r.next==null||r.next.length()!==0))return[r,e];e-=i,r=n()}return[null,0]}forEach(e){let t=this.iterator(),n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;let[r,i]=this.find(e),a=e-i,o=this.iterator(r),s=o();for(;s&&a<e+t;){let r=s.length();e>a?n(s,e-a,Math.min(t,a+r-e)):n(s,0,Math.min(r,e+t-a)),a+=r,s=o()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){let n=this.iterator(),r=n();for(;r;)t=e(t,r),r=n();return t}};function Qa(e,t){let n=t.find(e);if(n)return n;try{return t.create(e)}catch{let n=t.create(G.INLINE);return Array.from(e.childNodes).forEach(e=>{n.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}var $a=class e extends Ya{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Za,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{let t=Qa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof Ba)return;throw e}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(e,t,n)=>{e.deleteAt(t,n)})}descendant(t,n=0){let[r,i]=this.children.find(n);return t.blotName==null&&t(r)||t.blotName!=null&&r instanceof t?[r,i]:r instanceof e?r.descendant(t,i):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(n,r,o)=>{(t.blotName==null&&t(n)||t.blotName!=null&&n instanceof t)&&i.push(n),n instanceof e&&(i=i.concat(n.descendants(t,r,a))),a-=o}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(n=>{t||this.statics.allowedChildren.some(e=>n instanceof e)||(n.statics.scope===G.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())})}formatAt(e,t,n,r){this.children.forEachAt(e,t,(e,t,i)=>{e.formatAt(t,i,n,r)})}insertAt(e,t,n){let[r,i]=this.children.find(e);if(r)r.insertAt(i,t,n);else{let e=n==null?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){let e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){let[r,i]=this.children.find(t,n),a=[[this,t]];return r instanceof e?a.concat(r.path(i,n)):(r!=null&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(t,n){let r=typeof t=="string"?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}let n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(e,r,i)=>{let a=e.split(r,t);a!=null&&n.appendChild(a)}),n}splitAfter(e){let t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){let n=[],r=[];e.forEach(e=>{e.target===this.domNode&&e.type==="childList"&&(n.push(...e.addedNodes),r.push(...e.removedNodes))}),r.forEach(e=>{if(e.parentNode!=null&&e.tagName!=="IFRAME"&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;let t=this.scroll.find(e);t!=null&&(t.domNode.parentNode==null||t.domNode.parentNode===this.domNode)&&t.detach()}),n.filter(e=>e.parentNode===this.domNode&&e!==this.uiNode).sort((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(e=>{let t=null;e.nextSibling!=null&&(t=this.scroll.find(e.nextSibling));let n=Qa(e,this.scroll);(n.next!==t||n.next==null)&&(n.parent!=null&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))}),this.enforceAllowedChildren()}};$a.uiClass="";var eo=$a;function to(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}var no=class e extends eo{static create(e){return super.create(e)}static formats(t,n){let r=n.query(e.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new qa(this.domNode)}format(t,n){if(t===this.statics.blotName&&!n)this.children.forEach(t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)}),this.unwrap();else{let e=this.scroll.query(t,G.INLINE);if(e==null)return;e instanceof za?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}}formats(){let e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){this.formats()[n]!=null||this.scroll.query(n,G.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);let n=this.formats();if(Object.keys(n).length===0)return this.unwrap();let r=this.next;r instanceof e&&r.prev===this&&to(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){let n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&e.type==="attributes")&&this.attributes.build()}wrap(t,n){let r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};no.allowedChildren=[no,K],no.blotName="inline",no.scope=G.INLINE_BLOT,no.tagName="SPAN";var ro=no,io=class e extends eo{static create(e){return super.create(e)}static formats(t,n){let r=n.query(e.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new qa(this.domNode)}format(t,n){let r=this.scroll.query(t,G.BLOCK);r!=null&&(r instanceof za?this.attributes.attribute(r,n):t===this.statics.blotName&&!n?this.replaceWith(e.blotName):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n))}formats(){let e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){this.scroll.query(n,G.BLOCK)==null?super.formatAt(e,t,n,r):this.format(n,r)}insertAt(e,t,n){if(n==null||this.scroll.query(t,G.INLINE)!=null)super.insertAt(e,t,n);else{let r=this.split(e);if(r!=null){let e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}else throw Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){let n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&e.type==="attributes")&&this.attributes.build()}};io.blotName="block",io.scope=G.BLOCK_BLOT,io.tagName="P",io.allowedChildren=[ro,io,K];var ao=io,oo=class extends eo{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};oo.blotName="container",oo.scope=G.BLOCK_BLOT;var so=oo,co=class extends K{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){e===0&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},lo={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},uo=100,fo=class extends eo{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(e=>{this.update(e)}),this.observer.observe(this.domNode,lo),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){let n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=G.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(e=>{e.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);let n=t.mutationsMap||new WeakMap,r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());let i=(e,t=!0)=>{e==null||e===this||e.domNode.parentNode!=null&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&i(e.parent))},a=e=>{n.has(e.domNode)&&(e instanceof eo&&e.children.forEach(a),n.delete(e.domNode),e.optimize(t))},o=e;for(let t=0;o.length>0;t+=1){if(t>=uo)throw Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(e=>{let t=this.find(e.target,!0);t!=null&&(t.domNode===e.target&&(e.type==="childList"?(i(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach(e=>{let t=this.find(e,!1);i(t,!1),t instanceof eo&&t.children.forEach(e=>{i(e,!1)})})):e.type==="attributes"&&i(t.prev)),i(t))}),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),r=o.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e||=this.observer.takeRecords();let n=new WeakMap;e.map(e=>{let t=this.find(e.target,!0);return t==null?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)}).forEach(e=>{e!=null&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};fo.blotName="scroll",fo.defaultChild=ao,fo.allowedChildren=[ao,so],fo.scope=G.BLOCK_BLOT,fo.tagName="DIV";var po=fo,mo=class e extends K{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){n==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}let n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(e=>e.type==="characterData"&&e.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};mo.blotName="text",mo.scope=G.INLINE_BLOT;var ho=mo,go=x((e,t)=>{var n=-1,r=1,i=0;function a(e,t,n,r,a){if(e===t)return e?[[i,e]]:[];if(n!=null){var s=D(e,t,n);if(s)return s}var c=l(e,t),u=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=d(e,t);var f=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var m=o(e,t);return u&&m.unshift([i,u]),f&&m.push([i,f]),b(m,a),r&&p(m),m}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!==-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length===1)return[[n,e],[r,t]];var d=f(e,t);if(d){var p=d[0],m=d[1],h=d[2],g=d[3],_=d[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;f<l;f++)u[f]=-1,d[f]=-1;u[s+1]=0,d[s+1]=0;for(var p=i-a,m=p%2!=0,h=0,g=0,_=0,v=0,y=0;y<o;y++){for(var b=-y+h;b<=y-g;b+=2){for(var x=s+b,S=b===-y||b!==y&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1,C=S-b;S<i&&C<a&&e.charAt(S)===t.charAt(C);)S++,C++;if(u[x]=S,S>i)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w<l&&d[w]!==-1){var T=i-d[w];if(S>=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E===-y||E!==y&&d[w-1]<d[w+1]?d[w+1]:d[w-1]+1,D=T-E;T<i&&D<a&&e.charAt(i-T-1)===t.charAt(a-D-1);)T++,D++;if(d[w]=T,T>i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x<l&&u[x]!==-1){var S=u[x],C=s+S-x;if(T=i-T,S>=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return x(e.charCodeAt(i-1))&&i--,i}function u(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}}function d(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return S(e.charCodeAt(e.length-i))&&i--,i}function f(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;function i(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),i=-1,a="",o,s,c,u;(i=t.indexOf(r,i+1))!==-1;){var f=l(e.substring(n),t.substring(i)),p=d(e.substring(0,n),t.substring(0,i));a.length<p+f&&(a=t.substring(i-p,i)+t.substring(i,i+f),o=e.substring(0,n-p),s=e.substring(n+f),c=t.substring(0,i-p),u=t.substring(i+f))}return a.length*2>=e.length?[o,s,c,u,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,u,f,p;e.length>t.length?(c=s[0],u=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],u=s[3]);var m=s[4];return[c,u,f,p,m]}function p(e){for(var t=!1,a=[],o=0,s=null,c=0,l=0,d=0,f=0,p=0;c<e.length;)e[c][0]==i?(a[o++]=c,l=f,d=p,f=0,p=0,s=e[c][1]):(e[c][0]==r?f+=e[c][1].length:p+=e[c][1].length,s&&s.length<=Math.max(l,d)&&s.length<=Math.max(f,p)&&(e.splice(a[o-1],0,[n,s]),e[a[o-1]+1][0]=r,o--,o--,c=o>0?a[o-1]:-1,l=0,d=0,f=0,p=0,s=null,t=!0)),c++;for(t&&b(e),y(e),c=1;c<e.length;){if(e[c-1][0]==n&&e[c][0]==r){var m=e[c-1][1],h=e[c][1],g=u(m,h),_=u(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(c,0,[i,h.substring(0,g)]),e[c-1][1]=m.substring(0,m.length-g),e[c+1][1]=h.substring(g),c++):(_>=m.length/2||_>=h.length/2)&&(e.splice(c,0,[i,m.substring(0,_)]),e[c-1][0]=r,e[c-1][1]=h.substring(0,h.length-_),e[c+1][0]=n,e[c+1][1]=m.substring(_),c++),c++}c++}}var m=/[^a-zA-Z0-9]/,h=/\s/,g=/[\r\n]/,_=/\n\r?\n$/,v=/^\r?\n\r?\n/;function y(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(m),a=r.match(m),o=i&&n.match(h),s=a&&r.match(h),c=o&&n.match(g),l=s&&r.match(g),u=c&&e.match(_),d=l&&t.match(v);return u||d?5:c||l?4:i&&!o&&s?3:o||s?2:i||a?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==i&&e[n+1][0]==i){var r=e[n-1][1],a=e[n][1],o=e[n+1][1],s=d(r,a);if(s){var c=a.substring(a.length-s);r=r.substring(0,r.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=r,u=a,f=o,p=t(r,a)+t(a,o);a.charAt(0)===o.charAt(0);){r+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var y=t(r,a)+t(a,o);y>=p&&(p=y,l=r,u=a,f=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,f?e[n+1][1]=f:(e.splice(n+1,1),n--))}n++}}function b(e,t){e.push([i,""]);for(var a=0,o=0,s=0,c="",u="",f;a<e.length;){if(a<e.length-1&&!e[a][1]){e.splice(a,1);continue}switch(e[a][0]){case r:s++,u+=e[a][1],a++;break;case n:o++,c+=e[a][1],a++;break;case i:var p=a-s-o-1;if(t){if(p>=0&&w(e[p][1])){var m=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),c=m+c,u=m+u,!e[p][1]){e.splice(p,1),a--;var h=p-1;e[h]&&e[h][0]===r&&(s++,u=e[h][1]+u,h--),e[h]&&e[h][0]===n&&(o++,c=e[h][1]+c,h--),p=h}}if(C(e[a][1])){var m=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=m,u+=m}}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(c.length>0||u.length>0){c.length>0&&u.length>0&&(f=l(u,c),f!==0&&(p>=0?e[p][1]+=u.substring(0,f):(e.splice(0,0,[i,u.substring(0,f)]),a++),u=u.substring(f),c=c.substring(f)),f=d(u,c),f!==0&&(e[a][1]=u.substring(u.length-f)+e[a][1],u=u.substring(0,u.length-f),c=c.substring(0,c.length-f)));var g=s+o;c.length===0&&u.length===0?(e.splice(a-g,g),a-=g):c.length===0?(e.splice(a-g,g,[r,u]),a=a-g+1):u.length===0?(e.splice(a-g,g,[n,c]),a=a-g+1):(e.splice(a-g,g,[n,c],[r,u]),a=a-g+2)}a!==0&&e[a-1][0]===i?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,s=0,o=0,c="",u="";break}}e[e.length-1][1]===""&&e.pop();var _=!1;for(a=1;a<e.length-1;)e[a-1][0]===i&&e[a+1][0]===i&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),_=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),_=!0)),a++;_&&b(e,t)}function x(e){return e>=55296&&e<=56319}function S(e){return e>=56320&&e<=57343}function C(e){return S(e.charCodeAt(0))}function w(e){return x(e.charCodeAt(e.length-1))}function T(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}function E(e,t,a,o){return w(e)||C(o)?null:T([[i,e],[n,t],[r,a],[i,o]])}function D(e,t,n){var r=typeof n=="number"?{index:n,length:0}:n.oldRange,i=typeof n=="number"?null:n.newRange,a=e.length,o=t.length;if(r.length===0&&(i===null||i.length===0)){var s=r.index,c=e.slice(0,s),l=e.slice(s),u=i?i.index:null;editBefore:{var d=s+o-a;if(u!==null&&u!==d||d<0||d>o)break editBefore;var f=t.slice(0,d),p=t.slice(d);if(p!==l)break editBefore;var m=Math.min(s,d),h=c.slice(0,m),g=f.slice(0,m);if(h!==g)break editBefore;var _=c.slice(m),v=f.slice(m);return E(h,_,v,l)}editAfter:{if(u!==null&&u!==s)break editAfter;var y=s,f=t.slice(0,y),p=t.slice(y);if(f!==c)break editAfter;var b=Math.min(a-y,o-y),x=l.slice(l.length-b),S=p.slice(p.length-b);if(x!==S)break editAfter;var _=l.slice(0,l.length-b),v=p.slice(0,p.length-b);return E(c,_,v,x)}}if(r.length>0&&i&&i.length===0)replaceRange:{var h=e.slice(0,r.index),x=e.slice(r.index+r.length),m=h.length,b=x.length;if(o<m+b)break replaceRange;var g=t.slice(0,m),S=t.slice(o-b);if(h!==g||x!==S)break replaceRange;var _=e.slice(m,a-b),v=t.slice(m,o-b);return E(h,_,v,x)}return null}function O(e,t,n,r){return a(e,t,n,r,!0)}O.INSERT=r,O.DELETE=n,O.EQUAL=i,t.exports=O}),_o=x((e,t)=>{var n=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",o="[object Array]",s="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",d="[object GeneratorFunction]",f="[object Map]",p="[object Number]",m="[object Object]",h="[object Promise]",g="[object RegExp]",_="[object Set]",v="[object String]",y="[object Symbol]",b="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",w="[object Float64Array]",T="[object Int8Array]",E="[object Int16Array]",D="[object Int32Array]",O="[object Uint8Array]",k="[object Uint8ClampedArray]",A="[object Uint16Array]",ee="[object Uint32Array]",j=/[\\^$.*+?()[\]{}|]/g,M=/\w*$/,N=/^\[object .+?Constructor\]$/,te=/^(?:0|[1-9]\d*)$/,P={};P[a]=P[o]=P[x]=P[S]=P[s]=P[c]=P[C]=P[w]=P[T]=P[E]=P[D]=P[f]=P[p]=P[m]=P[g]=P[_]=P[v]=P[y]=P[O]=P[k]=P[A]=P[ee]=!0,P[l]=P[u]=P[b]=!1;var ne=typeof global=="object"&&global&&global.Object===Object&&global,re=typeof self=="object"&&self&&self.Object===Object&&self,F=ne||re||Function("return this")(),ie=typeof e=="object"&&e&&!e.nodeType&&e,I=ie&&typeof t=="object"&&t&&!t.nodeType&&t,ae=I&&I.exports===ie;function oe(e,t){return e.set(t[0],t[1]),e}function L(e,t){return e.add(t),e}function se(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}function ce(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function le(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function ue(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function de(e,t){return e?.[t]}function fe(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function pe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function me(e,t){return function(n){return e(t(n))}}function he(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ge=Array.prototype,_e=Function.prototype,ve=Object.prototype,ye=F["__core-js_shared__"],be=function(){var e=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),xe=_e.toString,Se=ve.hasOwnProperty,Ce=ve.toString,we=RegExp("^"+xe.call(Se).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=ae?F.Buffer:void 0,Ee=F.Symbol,De=F.Uint8Array,R=me(Object.getPrototypeOf,Object),Oe=Object.create,ke=ve.propertyIsEnumerable,Ae=ge.splice,je=Object.getOwnPropertySymbols,Me=Te?Te.isBuffer:void 0,Ne=me(Object.keys,Object),Pe=H(F,"DataView"),Fe=H(F,"Map"),Ie=H(F,"Promise"),Le=H(F,"Set"),Re=H(F,"WeakMap"),ze=H(Object,"create"),Be=U(Pe),Ve=U(Fe),He=U(Ie),Ue=U(Le),We=U(Re),Ge=Ee?Ee.prototype:void 0,Ke=Ge?Ge.valueOf:void 0;function qe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Je(){this.__data__=ze?ze(null):{}}function Ye(e){return this.has(e)&&delete this.__data__[e]}function Xe(e){var t=this.__data__;if(ze){var n=t[e];return n===r?void 0:n}return Se.call(t,e)?t[e]:void 0}function Ze(e){var t=this.__data__;return ze?t[e]!==void 0:Se.call(t,e)}function Qe(e,t){var n=this.__data__;return n[e]=ze&&t===void 0?r:t,this}qe.prototype.clear=Je,qe.prototype.delete=Ye,qe.prototype.get=Xe,qe.prototype.has=Ze,qe.prototype.set=Qe;function z(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $e(){this.__data__=[]}function et(e){var t=this.__data__,n=gt(t,e);return n<0?!1:(n==t.length-1?t.pop():Ae.call(t,n,1),!0)}function tt(e){var t=this.__data__,n=gt(t,e);return n<0?void 0:t[n][1]}function nt(e){return gt(this.__data__,e)>-1}function rt(e,t){var n=this.__data__,r=gt(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}z.prototype.clear=$e,z.prototype.delete=et,z.prototype.get=tt,z.prototype.has=nt,z.prototype.set=rt;function B(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function it(){this.__data__={hash:new qe,map:new(Fe||z),string:new qe}}function at(e){return It(this,e).delete(e)}function ot(e){return It(this,e).get(e)}function st(e){return It(this,e).has(e)}function ct(e,t){return It(this,e).set(e,t),this}B.prototype.clear=it,B.prototype.delete=at,B.prototype.get=ot,B.prototype.has=st,B.prototype.set=ct;function V(e){this.__data__=new z(e)}function lt(){this.__data__=new z}function ut(e){return this.__data__.delete(e)}function dt(e){return this.__data__.get(e)}function ft(e){return this.__data__.has(e)}function pt(e,t){var r=this.__data__;if(r instanceof z){var i=r.__data__;if(!Fe||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new B(i)}return r.set(e,t),this}V.prototype.clear=lt,V.prototype.delete=ut,V.prototype.get=dt,V.prototype.has=ft,V.prototype.set=pt;function mt(e,t){var n=Yt(e)||Jt(e)?ue(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Se.call(e,a))&&!(i&&(a=="length"||Ht(a,r)))&&n.push(a);return n}function ht(e,t,n){var r=e[t];(!(Se.call(e,t)&&qt(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function gt(e,t){for(var n=e.length;n--;)if(qt(e[n][0],t))return n;return-1}function _t(e,t){return e&&Nt(t,rn(t),e)}function vt(e,t,n,r,i,o,s){var c;if(r&&(c=o?r(e,i,o,s):r(e)),c!==void 0)return c;if(!tn(e))return e;var l=Yt(e);if(l){if(c=zt(e),!t)return Mt(e,c)}else{var f=Rt(e),p=f==u||f==d;if(Qt(e))return wt(e,t);if(f==m||f==a||p&&!o){if(fe(e))return o?e:{};if(c=Bt(p?{}:e),!t)return Pt(e,_t(c,e))}else{if(!P[f])return o?e:{};c=Vt(e,f,vt,t)}}s||=new V;var h=s.get(e);if(h)return h;if(s.set(e,c),!l)var g=n?Ft(e):rn(e);return se(g||e,function(i,a){g&&(a=i,i=e[a]),ht(c,a,vt(i,t,n,r,a,e,s))}),c}function yt(e){return tn(e)?Oe(e):{}}function bt(e,t,n){var r=t(e);return Yt(e)?r:ce(r,n(e))}function xt(e){return Ce.call(e)}function St(e){return!tn(e)||Wt(e)?!1:($t(e)||fe(e)?we:N).test(U(e))}function Ct(e){if(!Gt(e))return Ne(e);var t=[];for(var n in Object(e))Se.call(e,n)&&n!="constructor"&&t.push(n);return t}function wt(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function Tt(e){var t=new e.constructor(e.byteLength);return new De(t).set(new De(e)),t}function Et(e,t){var n=t?Tt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Dt(e,t,n){return le(t?n(pe(e),!0):pe(e),oe,new e.constructor)}function Ot(e){var t=new e.constructor(e.source,M.exec(e));return t.lastIndex=e.lastIndex,t}function kt(e,t,n){return le(t?n(he(e),!0):he(e),L,new e.constructor)}function At(e){return Ke?Object(Ke.call(e)):{}}function jt(e,t){var n=t?Tt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Mt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function Nt(e,t,n,r){n||={};for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;ht(n,o,s===void 0?e[o]:s)}return n}function Pt(e,t){return Nt(e,Lt(e),t)}function Ft(e){return bt(e,rn,Lt)}function It(e,t){var n=e.__data__;return Ut(t)?n[typeof t=="string"?"string":"hash"]:n.map}function H(e,t){var n=de(e,t);return St(n)?n:void 0}var Lt=je?me(je,Object):an,Rt=xt;(Pe&&Rt(new Pe(new ArrayBuffer(1)))!=S||Fe&&Rt(new Fe)!=f||Ie&&Rt(Ie.resolve())!=h||Le&&Rt(new Le)!=_||Re&&Rt(new Re)!=b)&&(Rt=function(e){var t=Ce.call(e),n=t==m?e.constructor:void 0,r=n?U(n):void 0;if(r)switch(r){case Be:return S;case Ve:return f;case He:return h;case Ue:return _;case We:return b}return t});function zt(e){var t=e.length,n=e.constructor(t);return t&&typeof e[0]=="string"&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function Bt(e){return typeof e.constructor=="function"&&!Gt(e)?yt(R(e)):{}}function Vt(e,t,n,r){var i=e.constructor;switch(t){case x:return Tt(e);case s:case c:return new i(+e);case S:return Et(e,r);case C:case w:case T:case E:case D:case O:case k:case A:case ee:return jt(e,r);case f:return Dt(e,r,n);case p:case v:return new i(e);case g:return Ot(e);case _:return kt(e,r,n);case y:return At(e)}}function Ht(e,t){return t??=i,!!t&&(typeof e=="number"||te.test(e))&&e>-1&&e%1==0&&e<t}function Ut(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wt(e){return!!be&&be in e}function Gt(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||ve)}function U(e){if(e!=null){try{return xe.call(e)}catch{}try{return e+""}catch{}}return""}function Kt(e){return vt(e,!0,!0)}function qt(e,t){return e===t||e!==e&&t!==t}function Jt(e){return Zt(e)&&Se.call(e,"callee")&&(!ke.call(e,"callee")||Ce.call(e)==a)}var Yt=Array.isArray;function Xt(e){return e!=null&&en(e.length)&&!$t(e)}function Zt(e){return nn(e)&&Xt(e)}var Qt=Me||on;function $t(e){var t=tn(e)?Ce.call(e):"";return t==u||t==d}function en(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=i}function tn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nn(e){return!!e&&typeof e=="object"}function rn(e){return Xt(e)?mt(e):Ct(e)}function an(){return[]}function on(){return!1}t.exports=Kt}),vo=x((e,t)=>{var n=200,r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",h="[object Map]",g="[object Number]",_="[object Null]",v="[object Object]",y="[object Promise]",b="[object Proxy]",x="[object RegExp]",S="[object Set]",C="[object String]",w="[object Symbol]",T="[object Undefined]",E="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",k="[object Float32Array]",A="[object Float64Array]",ee="[object Int8Array]",j="[object Int16Array]",M="[object Int32Array]",N="[object Uint8Array]",te="[object Uint8ClampedArray]",P="[object Uint16Array]",ne="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,I={};I[k]=I[A]=I[ee]=I[j]=I[M]=I[N]=I[te]=I[P]=I[ne]=!0,I[s]=I[c]=I[D]=I[u]=I[O]=I[d]=I[f]=I[p]=I[h]=I[g]=I[v]=I[x]=I[S]=I[C]=I[E]=!1;var ae=typeof global=="object"&&global&&global.Object===Object&&global,oe=typeof self=="object"&&self&&self.Object===Object&&self,L=ae||oe||Function("return this")(),se=typeof e=="object"&&e&&!e.nodeType&&e,ce=se&&typeof t=="object"&&t&&!t.nodeType&&t,le=ce&&ce.exports===se,ue=le&&ae.process,de=function(){try{return ue&&ue.binding&&ue.binding("util")}catch{}}(),fe=de&&de.isTypedArray;function pe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function me(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function he(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function ge(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function _e(e){return function(t){return e(t)}}function ve(e,t){return e.has(t)}function ye(e,t){return e?.[t]}function be(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function xe(e,t){return function(n){return e(t(n))}}function Se(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Ce=Array.prototype,we=Function.prototype,Te=Object.prototype,Ee=L["__core-js_shared__"],De=we.toString,R=Te.hasOwnProperty,Oe=function(){var e=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ke=Te.toString,Ae=RegExp("^"+De.call(R).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=le?L.Buffer:void 0,Me=L.Symbol,Ne=L.Uint8Array,Pe=Te.propertyIsEnumerable,Fe=Ce.splice,Ie=Me?Me.toStringTag:void 0,Le=Object.getOwnPropertySymbols,Re=je?je.isBuffer:void 0,ze=xe(Object.keys,Object),Be=Lt(L,"DataView"),Ve=Lt(L,"Map"),He=Lt(L,"Promise"),Ue=Lt(L,"Set"),We=Lt(L,"WeakMap"),Ge=Lt(Object,"create"),Ke=U(Be),qe=U(Ve),Je=U(He),Ye=U(Ue),Xe=U(We),Ze=Me?Me.prototype:void 0,Qe=Ze?Ze.valueOf:void 0;function z(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $e(){this.__data__=Ge?Ge(null):{},this.size=0}function et(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function tt(e){var t=this.__data__;if(Ge){var n=t[e];return n===r?void 0:n}return R.call(t,e)?t[e]:void 0}function nt(e){var t=this.__data__;return Ge?t[e]!==void 0:R.call(t,e)}function rt(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ge&&t===void 0?r:t,this}z.prototype.clear=$e,z.prototype.delete=et,z.prototype.get=tt,z.prototype.has=nt,z.prototype.set=rt;function B(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function it(){this.__data__=[],this.size=0}function at(e){var t=this.__data__,n=wt(t,e);return n<0?!1:(n==t.length-1?t.pop():Fe.call(t,n,1),--this.size,!0)}function ot(e){var t=this.__data__,n=wt(t,e);return n<0?void 0:t[n][1]}function st(e){return wt(this.__data__,e)>-1}function ct(e,t){var n=this.__data__,r=wt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}B.prototype.clear=it,B.prototype.delete=at,B.prototype.get=ot,B.prototype.has=st,B.prototype.set=ct;function V(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function lt(){this.size=0,this.__data__={hash:new z,map:new(Ve||B),string:new z}}function ut(e){var t=H(this,e).delete(e);return this.size-=t?1:0,t}function dt(e){return H(this,e).get(e)}function ft(e){return H(this,e).has(e)}function pt(e,t){var n=H(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}V.prototype.clear=lt,V.prototype.delete=ut,V.prototype.get=dt,V.prototype.has=ft,V.prototype.set=pt;function mt(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new V;++t<n;)this.add(e[t])}function ht(e){return this.__data__.set(e,r),this}function gt(e){return this.__data__.has(e)}mt.prototype.add=mt.prototype.push=ht,mt.prototype.has=gt;function _t(e){this.size=(this.__data__=new B(e)).size}function vt(){this.__data__=new B,this.size=0}function yt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function bt(e){return this.__data__.get(e)}function xt(e){return this.__data__.has(e)}function St(e,t){var r=this.__data__;if(r instanceof B){var i=r.__data__;if(!Ve||i.length<n-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new V(i)}return r.set(e,t),this.size=r.size,this}_t.prototype.clear=vt,_t.prototype.delete=yt,_t.prototype.get=bt,_t.prototype.has=xt,_t.prototype.set=St;function Ct(e,t){var n=Jt(e),r=!n&&qt(e),i=!n&&!r&&Xt(e),a=!n&&!r&&!i&&nn(e),o=n||r||i||a,s=o?ge(e.length,String):[],c=s.length;for(var l in e)(t||R.call(e,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Vt(l,c)))&&s.push(l);return s}function wt(e,t){for(var n=e.length;n--;)if(Kt(e[n][0],t))return n;return-1}function Tt(e,t,n){var r=t(e);return Jt(e)?r:me(r,n(e))}function Et(e){return e==null?e===void 0?T:_:Ie&&Ie in Object(e)?Rt(e):Gt(e)}function Dt(e){return tn(e)&&Et(e)==s}function Ot(e,t,n,r,i){return e===t?!0:e==null||t==null||!tn(e)&&!tn(t)?e!==e&&t!==t:kt(e,t,n,r,Ot,i)}function kt(e,t,n,r,a,o){var l=Jt(e),u=Jt(t),d=l?c:Bt(e),f=u?c:Bt(t);d=d==s?v:d,f=f==s?v:f;var p=d==v,m=f==v,h=d==f;if(h&&Xt(e)){if(!Xt(t))return!1;l=!0,p=!1}if(h&&!p)return o||=new _t,l||nn(e)?Nt(e,t,n,r,a,o):Pt(e,t,d,n,r,a,o);if(!(n&i)){var g=p&&R.call(e,"__wrapped__"),_=m&&R.call(t,"__wrapped__");if(g||_){var y=g?e.value():e,b=_?t.value():t;return o||=new _t,a(y,b,n,r,o)}}return h?(o||=new _t,Ft(e,t,n,r,a,o)):!1}function At(e){return!en(e)||Ut(e)?!1:(Qt(e)?Ae:F).test(U(e))}function jt(e){return tn(e)&&$t(e.length)&&!!I[Et(e)]}function Mt(e){if(!Wt(e))return ze(e);var t=[];for(var n in Object(e))R.call(e,n)&&n!="constructor"&&t.push(n);return t}function Nt(e,t,n,r,o,s){var c=n&i,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=n&a?new mt:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var h=e[f],g=t[f];if(r)var _=c?r(g,h,f,t,e,s):r(h,g,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!he(t,function(e,t){if(!ve(m,t)&&(h===e||o(h,e,n,r,s)))return m.push(t)})){p=!1;break}}else if(!(h===g||o(h,g,n,r,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function Pt(e,t,n,r,o,s,c){switch(n){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case D:return!(e.byteLength!=t.byteLength||!s(new Ne(e),new Ne(t)));case u:case d:case g:return Kt(+e,+t);case f:return e.name==t.name&&e.message==t.message;case x:case C:return e==t+"";case h:var l=be;case S:var p=r&i;if(l||=Se,e.size!=t.size&&!p)return!1;var m=c.get(e);if(m)return m==t;r|=a,c.set(e,t);var _=Nt(l(e),l(t),r,o,s,c);return c.delete(e),_;case w:if(Qe)return Qe.call(e)==Qe.call(t)}return!1}function Ft(e,t,n,r,a,o){var s=n&i,c=It(e),l=c.length;if(l!=It(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:R.call(t,d)))return!1}var f=o.get(e);if(f&&o.get(t))return f==t;var p=!0;o.set(e,t),o.set(t,e);for(var m=s;++u<l;){d=c[u];var h=e[d],g=t[d];if(r)var _=s?r(g,h,d,t,e,o):r(h,g,d,e,t,o);if(!(_===void 0?h===g||a(h,g,n,r,o):_)){p=!1;break}m||=d=="constructor"}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof y=="function"&&y instanceof y)&&(p=!1)}return o.delete(e),o.delete(t),p}function It(e){return Tt(e,rn,zt)}function H(e,t){var n=e.__data__;return Ht(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Lt(e,t){var n=ye(e,t);return At(n)?n:void 0}function Rt(e){var t=R.call(e,Ie),n=e[Ie];try{e[Ie]=void 0;var r=!0}catch{}var i=ke.call(e);return r&&(t?e[Ie]=n:delete e[Ie]),i}var zt=Le?function(e){return e==null?[]:(e=Object(e),pe(Le(e),function(t){return Pe.call(e,t)}))}:an,Bt=Et;(Be&&Bt(new Be(new ArrayBuffer(1)))!=O||Ve&&Bt(new Ve)!=h||He&&Bt(He.resolve())!=y||Ue&&Bt(new Ue)!=S||We&&Bt(new We)!=E)&&(Bt=function(e){var t=Et(e),n=t==v?e.constructor:void 0,r=n?U(n):"";if(r)switch(r){case Ke:return O;case qe:return h;case Je:return y;case Ye:return S;case Xe:return E}return t});function Vt(e,t){return t??=o,!!t&&(typeof e=="number"||ie.test(e))&&e>-1&&e%1==0&&e<t}function Ht(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ut(e){return!!Oe&&Oe in e}function Wt(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||Te)}function Gt(e){return ke.call(e)}function U(e){if(e!=null){try{return De.call(e)}catch{}try{return e+""}catch{}}return""}function Kt(e,t){return e===t||e!==e&&t!==t}var qt=Dt(function(){return arguments}())?Dt:function(e){return tn(e)&&R.call(e,"callee")&&!Pe.call(e,"callee")},Jt=Array.isArray;function Yt(e){return e!=null&&$t(e.length)&&!Qt(e)}var Xt=Re||on;function Zt(e,t){return Ot(e,t)}function Qt(e){if(!en(e))return!1;var t=Et(e);return t==p||t==m||t==l||t==b}function $t(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=o}function en(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function tn(e){return typeof e=="object"&&!!e}var nn=fe?_e(fe):jt;function rn(e){return Yt(e)?Ct(e):Mt(e)}function an(){return[]}function on(){return!1}t.exports=Zt}),yo=x(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=_o(),n=vo(),r;(function(e){function r(e={},n={},r=!1){typeof e!="object"&&(e={}),typeof n!="object"&&(n={});let i=t(n);r||(i=Object.keys(i).reduce((e,t)=>(i[t]!=null&&(e[t]=i[t]),e),{}));for(let t in e)e[t]!==void 0&&n[t]===void 0&&(i[t]=e[t]);return Object.keys(i).length>0?i:void 0}e.compose=r;function i(e={},t={}){typeof e!="object"&&(e={}),typeof t!="object"&&(t={});let r=Object.keys(e).concat(Object.keys(t)).reduce((r,i)=>(n(e[i],t[i])||(r[i]=t[i]===void 0?null:t[i]),r),{});return Object.keys(r).length>0?r:void 0}e.diff=i;function a(e={},t={}){e||={};let n=Object.keys(t).reduce((n,r)=>(t[r]!==e[r]&&e[r]!==void 0&&(n[r]=t[r]),n),{});return Object.keys(e).reduce((n,r)=>(e[r]!==t[r]&&t[r]===void 0&&(n[r]=null),n),n)}e.invert=a;function o(e,t,n=!1){if(typeof e!="object")return t;if(typeof t!="object")return;if(!n)return t;let r=Object.keys(t).reduce((n,r)=>(e[r]===void 0&&(n[r]=t[r]),n),{});return Object.keys(r).length>0?r:void 0}e.transform=o})(r||={}),e.default=r}),bo=x(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t;(function(e){function t(e){return typeof e.delete=="number"?e.delete:typeof e.retain=="number"?e.retain:typeof e.retain=="object"&&e.retain!==null?1:typeof e.insert=="string"?e.insert.length:1}e.length=t})(t||={}),e.default=t}),xo=x(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=bo();e.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<Infinity}next(e){e||=Infinity;let n=this.ops[this.index];if(n){let r=this.offset,i=t.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof n.delete=="number")return{delete:e};{let t={};return n.attributes&&(t.attributes=n.attributes),typeof n.retain=="number"?t.retain=e:typeof n.retain=="object"&&n.retain!==null?t.retain=n.retain:typeof n.insert=="string"?t.insert=n.insert.substr(r,e):t.insert=n.insert,t}}else return{retain:Infinity}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:Infinity}peekType(){let e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(!this.hasNext())return[];if(this.offset===0)return this.ops.slice(this.index);{let e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}}}),q=w(x((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;var n=go(),r=_o(),i=vo(),a=yo();e.AttributeMap=a.default;var o=bo();e.Op=o.default;var s=xo();e.OpIterator=s.default;var c="\0",l=(e,t)=>{if(typeof e!="object"||!e)throw Error(`cannot retain a ${typeof e}`);if(typeof t!="object"||!t)throw Error(`cannot retain a ${typeof t}`);let n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]},u=class e{constructor(e){Array.isArray(e)?this.ops=e:e!=null&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){let t=this.handlers[e];if(!t)throw Error(`no handlers for embed type "${e}"`);return t}insert(e,t){let n={};return typeof e=="string"&&e.length===0?this:(n.insert=e,typeof t=="object"&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if(typeof e=="number"&&e<=0)return this;let n={retain:e};return typeof t=="object"&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),typeof n=="object"){if(typeof e.delete=="number"&&typeof n.delete=="number")return this.ops[t-1]={delete:n.delete+e.delete},this;if(typeof n.delete=="number"&&e.insert!=null&&(--t,n=this.ops[t-1],typeof n!="object"))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if(typeof e.insert=="string"&&typeof n.insert=="string")return this.ops[t-1]={insert:n.insert+e.insert},typeof e.attributes=="object"&&(this.ops[t-1].attributes=e.attributes),this;if(typeof e.retain=="number"&&typeof n.retain=="number")return this.ops[t-1]={retain:n.retain+e.retain},typeof e.attributes=="object"&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){let e=this.ops[this.ops.length-1];return e&&typeof e.retain=="number"&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){let t=[],n=[];return this.forEach(r=>{(e(r)?t:n).push(r)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce((e,t)=>t.insert?e+o.default.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+o.default.length(t),0)}slice(t=0,n=Infinity){let r=[],i=new s.default(this.ops),a=0;for(;a<n&&i.hasNext();){let e;a<t?e=i.next(t-a):(e=i.next(n-a),r.push(e)),a+=o.default.length(e)}return new e(r)}compose(t){let n=new s.default(this.ops),r=new s.default(t.ops),o=[],c=r.peek();if(c!=null&&typeof c.retain=="number"&&c.attributes==null){let e=c.retain;for(;n.peekType()==="insert"&&n.peekLength()<=e;)e-=n.peekLength(),o.push(n.next());c.retain-e>0&&r.next(c.retain-e)}let u=new e(o);for(;n.hasNext()||r.hasNext();)if(r.peekType()==="insert")u.push(r.next());else if(n.peekType()==="delete")u.push(n.next());else{let t=Math.min(n.peekLength(),r.peekLength()),o=n.next(t),s=r.next(t);if(s.retain){let c={};if(typeof o.retain=="number")c.retain=typeof s.retain=="number"?t:s.retain;else if(typeof s.retain=="number")o.retain==null?c.insert=o.insert:c.retain=o.retain;else{let t=o.retain==null?"insert":"retain",[n,r,i]=l(o[t],s.retain),a=e.getHandler(n);c[t]={[n]:a.compose(r,i,t==="retain")}}let d=a.default.compose(o.attributes,s.attributes,typeof o.retain=="number");if(d&&(c.attributes=d),u.push(c),!r.hasNext()&&i(u.ops[u.ops.length-1],c)){let t=new e(n.rest());return u.concat(t).chop()}}else typeof s.delete=="number"&&(typeof o.retain=="number"||typeof o.retain=="object"&&o.retain!==null)&&u.push(s)}return u.chop()}concat(t){let n=new e(this.ops.slice());return t.ops.length>0&&(n.push(t.ops[0]),n.ops=n.ops.concat(t.ops.slice(1))),n}diff(t,r){if(this.ops===t.ops)return new e;let o=[this,t].map(e=>e.map(n=>{if(n.insert!=null)return typeof n.insert=="string"?n.insert:c;throw Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")),l=new e,u=n(o[0],o[1],r,!0),d=new s.default(this.ops),f=new s.default(t.ops);return u.forEach(e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(f.peekLength(),t),l.push(f.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),l.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),f.peekLength(),t);let e=d.next(r),o=f.next(r);i(e.insert,o.insert)?l.retain(r,a.default.diff(e.attributes,o.attributes)):l.push(o).delete(r);break}t-=r}}),l.chop()}eachLine(t,n="\n"){let r=new s.default(this.ops),i=new e,a=0;for(;r.hasNext();){if(r.peekType()!=="insert")return;let s=r.peek(),c=o.default.length(s)-r.peekLength(),l=typeof s.insert=="string"?s.insert.indexOf(n,c)-c:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(t(i,r.next(1).attributes||{},a)===!1)return;a+=1,i=new e}}i.length()>0&&t(i,{},a)}invert(t){let n=new e;return this.reduce((r,i)=>{if(i.insert)n.delete(o.default.length(i));else if(typeof i.retain=="number"&&i.attributes==null)return n.retain(i.retain),r+i.retain;else if(i.delete||typeof i.retain=="number"){let e=i.delete||i.retain;return t.slice(r,r+e).forEach(e=>{i.delete?n.push(e):i.retain&&i.attributes&&n.retain(o.default.length(e),a.default.invert(i.attributes,e.attributes))}),r+e}else if(typeof i.retain=="object"&&i.retain!==null){let o=t.slice(r,r+1),c=new s.default(o.ops).next(),[u,d,f]=l(i.retain,c.insert),p=e.getHandler(u);return n.retain({[u]:p.invert(d,f)},a.default.invert(i.attributes,c.attributes)),r+1}return r},0),n.chop()}transform(t,n=!1){if(n=!!n,typeof t=="number")return this.transformPosition(t,n);let r=t,i=new s.default(this.ops),c=new s.default(r.ops),l=new e;for(;i.hasNext()||c.hasNext();)if(i.peekType()==="insert"&&(n||c.peekType()!=="insert"))l.retain(o.default.length(i.next()));else if(c.peekType()==="insert")l.push(c.next());else{let t=Math.min(i.peekLength(),c.peekLength()),r=i.next(t),o=c.next(t);if(r.delete)continue;if(o.delete)l.push(o);else{let i=r.retain,s=o.retain,c=typeof s=="object"&&s?s:t;if(typeof i=="object"&&i&&typeof s=="object"&&s){let t=Object.keys(i)[0];if(t===Object.keys(s)[0]){let r=e.getHandler(t);r&&(c={[t]:r.transform(i[t],s[t],n)})}}l.retain(c,a.default.transform(r.attributes,o.attributes,n))}}return l.chop()}transformPosition(e,t=!1){t=!!t;let n=new s.default(this.ops),r=0;for(;n.hasNext()&&r<=e;){let i=n.peekLength(),a=n.peekType();if(n.next(),a==="delete"){e-=Math.min(i,e-r);continue}else a==="insert"&&(r<e||!t)&&(e+=i);r+=i}return e}};u.Op=o.default,u.OpIterator=s.default,u.AttributeMap=a.default,u.handlers={},e.default=u,typeof t=="object"&&(t.exports=u,t.exports.default=u)})(),1),So=class extends co{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}};So.blotName="break",So.tagName="BR";var Co=class extends ho{},wo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function To(e){return e.replace(/[&<>"']/g,e=>wo[e])}var Eo=class e extends ro{static allowedChildren=[e,So,co,Co];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,n){let r=e.order.indexOf(t),i=e.order.indexOf(n);return r>=0||i>=0?r-i:t===n?0:t<n?-1:1}formatAt(t,n,r,i){if(e.compare(this.statics.blotName,r)<0&&this.scroll.query(r,G.BLOT)){let e=this.isolate(t,n);i&&e.wrap(r,i)}else super.formatAt(t,n,r,i)}optimize(t){if(super.optimize(t),this.parent instanceof e&&e.compare(this.statics.blotName,this.parent.statics.blotName)>0){let e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}},Do=1,J=class extends ao{cache={};delta(){return this.cache.delta??(this.cache.delta=ko(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,G.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n),this.cache={};return}if(t.length===0)return;let r=t.split("\n"),i=r.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;r.reduce((e,t)=>(a=a.split(e,!0),a.insertAt(0,t),t.length),e+i.length)}insertBefore(e,t){let{head:n}=this.children;super.insertBefore(e,t),n instanceof So&&n.remove(),this.cache={}}length(){return this.cache.length??(this.cache.length=super.length()+Do),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Do)){let t=this.clone();return e===0?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}let n=super.split(e,t);return this.cache={},n}};J.blotName="block",J.tagName="P",J.defaultChild=So,J.allowedChildren=[So,Eo,co,Co];var Oo=class extends co{attach(){super.attach(),this.attributes=new qa(this.domNode)}delta(){return(new q.default).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){let n=this.scroll.query(e,G.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}let r=t.split("\n"),i=r.pop(),a=r.map(e=>{let t=this.scroll.create(J.blotName);return t.insertAt(0,e),t}),o=this.split(e);a.forEach(e=>{this.parent.insertBefore(e,o)}),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}};Oo.scope=G.BLOCK_BLOT;function ko(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.descendants(K).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),Ao(n,{},t)),new q.default).insert("\n",Ao(e))}function Ao(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e==null||("formats"in e&&typeof e.formats=="function"&&(t={...t,...e.formats()},n&&delete t["code-token"]),e.parent==null||e.parent.statics.blotName==="scroll"||e.parent.statics.scope!==e.statics.scope)?t:Ao(e.parent,t,n)}var jo=class e extends co{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(t,n,r){super(t,n),this.selection=r,this.textNode=document.createTextNode(e.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,n){if(this.savedLength!==0){super.format(t,n);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==G.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=e.CONTENTS.length,r.optimize(),r.formatAt(i,e.CONTENTS.length,t,n),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;let t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);let n=this.prev instanceof Co?this.prev:null,r=n?n.length():0,i=this.next instanceof Co?this.next:null,a=i?i.text:"",{textNode:o}=this,s=o.data.split(e.CONTENTS).join("");o.data=e.CONTENTS;let c;if(n)c=n,(s||i)&&(n.insertAt(n.length(),s+a),i&&i.remove());else if(i)c=i,i.insertAt(0,s);else{let e=document.createTextNode(s);c=this.scroll.create(e),this.parent.insertBefore(c,this)}if(this.remove(),t){let e=(e,t)=>n&&e===n.domNode?t:e===o?r+t-1:i&&e===i.domNode?r+s.length+t:null,a=e(t.start.node,t.start.offset),l=e(t.end.node,t.end.offset);if(a!==null&&l!==null)return{startNode:c.domNode,startOffset:a,endNode:c.domNode,endOffset:l}}return null}update(e,t){if(e.some(e=>e.type==="characterData"&&e.target===this.textNode)){let e=this.restore();e&&(t.range=e)}}optimize(t){super.optimize(t);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=e.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}},Mo=w(x((e,t)=>{var n=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!="function")throw TypeError("The listener must be a function");var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})(),1),No=new WeakMap,Po=["error","warn","log","info"],Fo="warn";function Io(e){if(Fo&&Po.indexOf(e)<=Po.indexOf(Fo)){var t=[...arguments].slice(1);console[e](...t)}}function Lo(e){return Po.reduce((t,n)=>(t[n]=Io.bind(console,n,e),t),{})}Lo.level=e=>{Fo=e},Io.level=Lo.level;var Ro=Lo("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(e=>{document.addEventListener(e,function(){var e=[...arguments];Array.from(document.querySelectorAll(".ql-container")).forEach(t=>{let n=No.get(t);n&&n.emitter&&n.emitter.handleDOM(...e)})})});var Y=class extends Mo.default{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Ro.error)}emit(){var e=[...arguments];return Ro.log.call(Ro,...e),super.emit(...e)}handleDOM(e){var t=[...arguments].slice(1);(this.domListeners[e.type]||[]).forEach(n=>{let{node:r,handler:i}=n;(e.target===r||r.contains(e.target))&&i(e,...t)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}},zo=Lo("quill:selection"),Bo=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}},Vo=class{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Bo(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Y.sources.USER),1)}),this.emitter.on(Y.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;let e=this.getNativeRange();e!=null&&e.start.node!==this.cursor.textNode&&this.emitter.once(Y.events.SCROLL_UPDATE,(t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);let r=n.some(e=>e.type==="characterData"||e.type==="childList"||e.type==="attributes"&&e.target===this.root);this.update(r?Y.sources.SILENT:t)}catch{}})}),this.emitter.on(Y.events.SCROLL_OPTIMIZE,(e,t)=>{if(t.range){let{startNode:e,startOffset:n,endNode:r,endOffset:i}=t.range;this.setNativeRange(e,n,r,i),this.update(Y.sources.SILENT)}}),this.update(Y.sources.SILENT)}handleComposition(){this.emitter.on(Y.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Y.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){let e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Y.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();let n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(e,G.BLOCK))){if(n.start.node!==this.cursor.textNode){let e=this.scroll.find(n.start.node,!1);if(e==null)return;if(e instanceof K){let t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let r,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){let[t]=this.scroll.leaf(e+1);if(t){let[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(i=t,a=0)}}[r,a]=i.position(a,!0);let o=document.createRange();if(t>0)return o.setStart(r,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([r,a]=i.position(a,!0),o.setEnd(r,a),o.getBoundingClientRect());let s="left",c;if(r instanceof Text){if(!r.data.length)return null;a<r.data.length?(o.setStart(r,a),o.setEnd(r,a+1)):(o.setStart(r,a-1),o.setEnd(r,a),s="right"),c=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;c=i.domNode.getBoundingClientRect(),a>0&&(s="right")}return{bottom:c.top+c.height,height:c.height,left:c[s],right:c[s],top:c.top,width:0}}getNativeRange(){let e=document.getSelection();if(e==null||e.rangeCount<=0)return null;let t=e.getRangeAt(0);if(t==null)return null;let n=this.normalizeNative(t);return zo.info("getNativeRange",n),n}getRange(){let e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];let t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Ho(this.root,document.activeElement)}normalizedToRange(e){let t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);let n=t.map(e=>{let[t,n]=e,r=this.scroll.find(t,!0),i=r.offset(this.scroll);return n===0?i:r instanceof K?i+r.index(t,n):i+r.length()}),r=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(r,...n);return new Bo(i,r-i)}normalizeNative(e){if(!Ho(this.root,e.startContainer)||!e.collapsed&&!Ho(this.root,e.endContainer))return null;let t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else if(t.childNodes.length===n)t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1;else break;e.node=t,e.offset=n}),t}rangeToNative(e){let t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);let[r,i]=this.scroll.leaf(e);return r?r.position(i,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(zo.info("setNativeRange",e,t,n,r),e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))return;let a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});let{native:o}=this.getNativeRange()||{};if(o==null||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&n.tagName==="BR"&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);let i=document.createRange();i.setStart(e,t),i.setEnd(n,r),a.removeAllRanges(),a.addRange(i)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y.sources.API;if(typeof t=="string"&&(n=t,t=!1),zo.info("setRange",e),e!=null){let n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Y.sources.USER,t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ia(t,this.lastRange)){if(!this.composing&&r!=null&&r.native.collapsed&&r.start.node!==this.cursor.textNode){let e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}let n=[Y.events.SELECTION_CHANGE,Wi(this.lastRange),Wi(t),e];this.emitter.emit(Y.events.EDITOR_CHANGE,...n),e!==Y.sources.SILENT&&this.emitter.emit(...n)}}};function Ho(e,t){try{t.parentNode}catch{return!1}return e.contains(t)}var Uo=/^[ -~]*$/,Wo=class{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();let n=Yo(e),r=new q.default;return Zo(n.ops.slice()).reduce((e,n)=>{let i=q.Op.length(n),a=n.attributes||{},o=!1,s=!1;if(n.insert!=null){if(r.retain(i),typeof n.insert=="string"){let r=n.insert;s=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(Oo,e)[0]),this.scroll.insertAt(e,r);let[i,o]=this.scroll.line(e),c=La({},Ao(i));if(i instanceof J){let[e]=i.descendant(K,o);e&&(c=La(c,Ao(e)))}a=q.AttributeMap.diff(c,a)||{}}else if(typeof n.insert=="object"){let r=Object.keys(n.insert)[0];if(r==null)return e;let i=this.scroll.query(r,G.INLINE)!=null;if(i)(t<=e||this.scroll.descendant(Oo,e)[0])&&(s=!0);else if(e>0){let[t,n]=this.scroll.descendant(K,e-1);t instanceof Co?t.value()[n]!=="\n"&&(o=!0):t instanceof co&&t.statics.scope===G.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),i){let[t]=this.scroll.descendant(K,e);if(t){let e=La({},Ao(t));a=q.AttributeMap.diff(e,a)||{}}}}t+=i}else if(r.push(n),n.retain!==null&&typeof n.retain=="object"){let t=Object.keys(n.retain)[0];if(t==null)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(a).forEach(t=>{this.scroll.formatAt(e,i,t,a[t])});let c=o?1:0,l=s?1:0;return t+=c+l,r.retain(c),r.delete(l),e+i+c+l},0),r.reduce((e,t)=>typeof t.delete=="number"?(this.scroll.deleteAt(e,t.delete),e):e+q.Op.length(t),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new q.default).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(r=>{this.scroll.lines(e,Math.max(t,1)).forEach(e=>{e.format(r,n[r])})}),this.scroll.optimize();let r=(new q.default).retain(e).retain(t,Wi(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t,r,n[r])});let r=(new q.default).retain(e).retain(t,Wi(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new q.default)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],r=[];t===0?this.scroll.path(e).forEach(e=>{let[t]=e;t instanceof J?n.push(t):t instanceof K&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(K,e,t));let[i,a]=[n,r].map(e=>{let t=e.shift();if(t==null)return{};let n=Ao(t);for(;Object.keys(n).length>0;){let t=e.shift();if(t==null)return n;n=qo(Ao(t),n)}return n});return{...i,...a}}getHTML(e,t){let[n,r]=this.scroll.line(e);if(n){let i=n.length();return n.length()>=r+t&&!(r===0&&t===i)?Ko(n,r,t,!0):Ko(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(e=>typeof e.insert=="string").map(e=>e.insert).join("")}insertContents(e,t){let n=Yo(t),r=(new q.default).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new q.default).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t.length,r,n[r])}),this.update((new q.default).retain(e).insert(t,Wi(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;let e=this.scroll.children.head;if(e?.statics.blotName!==J.blotName)return!1;let t=e;return t.children.length>1?!1:t.children.head instanceof So}removeFormat(e,t){let n=this.getText(e,t),[r,i]=this.scroll.line(e+t),a=0,o=new q.default;r!=null&&(a=r.length()-i,o=r.delta().slice(i,i+a-1).insert("\n"));let s=this.getContents(e,t+a).diff((new q.default).insert(n).concat(o)),c=(new q.default).retain(e).concat(s);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(Uo)&&this.scroll.find(t[0].target)){let i=this.scroll.find(t[0].target),a=Ao(i),o=i.offset(this.scroll),s=t[0].oldValue.replace(jo.CONTENTS,""),c=(new q.default).insert(s),l=(new q.default).insert(i.value()),u=n&&{oldRange:Xo(n.oldRange,-o),newRange:Xo(n.newRange,-o)};e=(new q.default).retain(o).concat(c.diff(l,u)).reduce((e,t)=>t.insert?e.insert(t.insert,a):e.push(t),new q.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!Ia(r.compose(e),this.delta))&&(e=r.diff(this.delta,n));return e}};function Go(e,t,n){if(e.length===0){let[e]=Jo(n.pop());return t<=0?`</li></${e}>`:`</li></${e}>${Go([],t-1,n)}`}let[{child:r,offset:i,length:a,indent:o,type:s},...c]=e,[l,u]=Jo(s);if(o>t)return n.push(s),o===t+1?`<${l}><li${u}>${Ko(r,i,a)}${Go(c,o,n)}`:`<${l}><li>${Go(e,t+1,n)}`;let d=n[n.length-1];if(o===t&&s===d)return`</li><li${u}>${Ko(r,i,a)}${Go(c,o,n)}`;let[f]=Jo(n.pop());return`</li></${f}>${Go(e,t-1,n)}`}function Ko(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in e&&typeof e.html=="function")return e.html(t,n);if(e instanceof Co)return To(e.value().slice(t,t+n)).replaceAll(" ","&nbsp;");if(e instanceof eo){if(e.statics.blotName==="list-container"){let r=[];return e.children.forEachAt(t,n,(e,t,n)=>{let i="formats"in e&&typeof e.formats=="function"?e.formats():{};r.push({child:e,offset:t,length:n,indent:i.indent||0,type:i.list})}),Go(r,-1,[])}let i=[];if(e.children.forEachAt(t,n,(e,t,n)=>{i.push(Ko(e,t,n))}),r||e.statics.blotName==="list")return i.join("");let{outerHTML:a,innerHTML:o}=e.domNode,[s,c]=a.split(`>${o}<`);return s==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${c}`:`${s}>${i.join("")}<${c}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function qo(e,t){return Object.keys(t).reduce((n,r)=>{if(e[r]==null)return n;let i=t[r];return i===e[r]?n[r]=i:Array.isArray(i)?i.indexOf(e[r])<0?n[r]=i.concat([e[r]]):n[r]=i:n[r]=[i,e[r]],n},{})}function Jo(e){let t=e==="ordered"?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Yo(e){return e.reduce((e,t)=>{if(typeof t.insert=="string"){let n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)},new q.default)}function Xo(e,t){let{index:n,length:r}=e;return new Bo(n+t,r)}function Zo(e){let t=[];return e.forEach(e=>{typeof e.insert=="string"?e.insert.split("\n").forEach((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}var Qo=class{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}},$o="\ufeff",es=class extends co{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(e=>{this.contentNode.appendChild(e)}),this.leftGuard=document.createTextNode($o),this.rightGuard=document.createTextNode($o),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,n,r=e.data.split($o).join("");if(e===this.leftGuard)if(this.prev instanceof Co){let e=this.prev.length();this.prev.insertAt(e,r),t={startNode:this.prev.domNode,startOffset:e+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof Co?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data=$o,t}update(e,t){e.forEach(e=>{if(e.type==="characterData"&&(e.target===this.leftGuard||e.target===this.rightGuard)){let n=this.restore(e.target);n&&(t.range=n)}})}},ts=class{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){let t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof es)&&(this.emitter.emit(Y.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Y.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Y.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Y.events.COMPOSITION_END,e),this.isComposing=!1}},ns=class e{static DEFAULTS={modules:{}};static themes={default:e};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]??this.addModule(e)})}addModule(e){let t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}},rs=e=>e.parentElement||e.getRootNode().host||null,is=e=>{let t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},as=e=>{let t=parseInt(e,10);return Number.isNaN(t)?0:t},os=(e,t,n,r,i,a)=>e<n&&t>r?0:e<n?-(n-e+i):t>r?t-e>r-n?e+i-n:t-r+a:0,ss=(e,t)=>{let n=e.ownerDocument,r=t,i=e;for(;i;){let e=i===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:is(i),a=getComputedStyle(i),o=os(r.left,r.right,t.left,t.right,as(a.scrollPaddingLeft),as(a.scrollPaddingRight)),s=os(r.top,r.bottom,t.top,t.bottom,as(a.scrollPaddingTop),as(a.scrollPaddingBottom));if(o||s)if(e)n.defaultView?.scrollBy(o,s);else{let{scrollLeft:e,scrollTop:t}=i;s&&(i.scrollTop+=s),o&&(i.scrollLeft+=o);let n=i.scrollLeft-e,a=i.scrollTop-t;r={left:r.left-n,top:r.top-a,right:r.right-n,bottom:r.bottom-a}}i=e||a.position==="fixed"?null:rs(i)}},cs=100,ls=["block","break","cursor","inline","scroll","text"],us=(e,t,n)=>{let r=new Ha;return ls.forEach(e=>{let n=t.query(e);n&&r.register(n)}),e.forEach(e=>{let i=t.query(e);i||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>cs){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}}),r},ds=Lo("quill"),fs=new Ha;eo.uiClass="ql-ui";var X=class e{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:fs,theme:"default"};static events=Y.events;static sources=Y.sources;static version="2.0.3";static imports={delta:q.default,parchment:Ra,"core/module":Qo,"core/theme":ns};static debug(e){e===!0&&(e="log"),Lo.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return No.get(e)||fs.find(e,t)}static import(e){return this.imports[e]??ds.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){let e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),n="attrName"in e?e.attrName:e.blotName;typeof n=="string"?this.register(`formats/${n}`,e,t):Object.keys(e).forEach(n=>{this.register(n,e[n],t)})}else{let e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!n&&ds.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&fs.register(t),typeof t.register=="function"&&t.register(fs)}}constructor(t){if(this.options=gs(t,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}),this.container=this.options.container,this.container==null){ds.error("Invalid Quill container",t);return}this.options.debug&&e.debug(this.options.debug);let n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",No.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Y;let r=po.blotName,i=this.options.registry.query(r);if(!i||!("blotName"in i))throw Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Wo(this.scroll),this.selection=new Vo(this.scroll,this.emitter),this.composition=new ts(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Y.events.EDITOR_CHANGE,e=>{e===Y.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Y.events.SCROLL_UPDATE,(e,t)=>{let n=this.selection.lastRange,[r]=this.selection.getRange(),i=n&&r?{oldRange:n,newRange:r}:void 0;_s.call(this,()=>this.editor.update(null,t,i),e)}),this.emitter.on(Y.events.SCROLL_EMBED_UPDATE,(t,n)=>{let r=this.selection.lastRange,[i]=this.selection.getRange(),a=r&&i?{oldRange:r,newRange:i}:void 0;_s.call(this,()=>{let e=(new q.default).retain(t.offset(this)).retain({[t.statics.blotName]:n});return this.editor.update(e,[],a)},e.sources.USER)}),n){let e=this.clipboard.convert({html:`${n}<p><br></p>`,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){let t=e;e=document.createElement("div"),e.classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=vs(e,t,n),_s.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;let t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y.sources.API;return _s.call(this,()=>{let n=this.getSelection(!0),r=new q.default;if(n==null)return r;if(this.scroll.query(e,G.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else if(n.length===0)return this.selection.format(e,t),r;else r=this.editor.formatText(n.index,n.length,{[e]:t});return this.setSelection(n,Y.sources.SILENT),r},n)}formatLine(e,t,n,r,i){let a;return[e,t,a,i]=vs(e,t,n,r,i),_s.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,n,r,i){let a;return[e,t,a,i]=vs(e,t,n,r,i),_s.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(n=typeof e=="number"?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;let r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=vs(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e=="number"?this.scroll.lines(e,t):this.scroll.lines(e.index,e.length)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t??=this.getLength()-e),[e,t]=vs(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t??=this.getLength()-e),[e,t]=vs(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.sources.API;return _s.call(this,()=>this.editor.insertEmbed(t,n,r),i,t)}insertText(e,t,n,r,i){let a;return[e,,a,i]=vs(e,0,n,r,i),_s.call(this,()=>this.editor.insertText(e,t,a),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=vs(e,t,n),_s.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){ss(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){let e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y.sources.API;return _s.call(this,()=>{e=new q.default(e);let t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)},t)}setSelection(t,n,r){t==null?this.selection.setRange(null,n||e.sources.API):([t,n,,r]=vs(t,n,r),this.selection.setRange(new Bo(Math.max(0,t),n),r),r!==Y.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y.sources.API,n=(new q.default).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Y.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y.sources.API;return _s.call(this,()=>(e=new q.default(e),this.editor.applyDelta(e)),t,!0)}};function ps(e){return typeof e=="string"?document.querySelector(e):e}function ms(e){return Object.entries(e??{}).reduce((e,t)=>{let[n,r]=t;return{...e,[n]:r===!0?{}:r}},{})}function hs(e){return Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0))}function gs(e,t){let n=ps(e);if(!n)throw Error("Invalid Quill container");let r=!t.theme||t.theme===X.DEFAULTS.theme?ns:X.import(`themes/${t.theme}`);if(!r)throw Error(`Invalid theme ${t.theme}. Did you register it?`);let{modules:i,...a}=X.DEFAULTS,{modules:o,...s}=r.DEFAULTS,c=ms(t.modules);c!=null&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});let l=La({},ms(i),ms(o),c),u={...a,...hs(s),...hs(t)},d=t.registry;return d?t.formats&&ds.warn('Ignoring "formats" option because "registry" is specified'):d=t.formats?us(t.formats,u.registry,ds):u.registry,{...u,registry:d,container:n,theme:r,modules:Object.entries(l).reduce((e,t)=>{let[n,r]=t;if(!r)return e;let i=X.import(`modules/${n}`);return i==null?(ds.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:La({},i.DEFAULTS||{},r)}},{}),bounds:ps(u.bounds)}}function _s(e,t,n,r){if(!this.isEnabled()&&t===Y.sources.USER&&!this.allowReadOnlyEdits)return new q.default;let i=n==null?null:this.getSelection(),a=this.editor.delta,o=e();if(i!=null&&(n===!0&&(n=i.index),r==null?i=ys(i,o,t):r!==0&&(i=ys(i,n,r,t)),this.setSelection(i,Y.sources.SILENT)),o.length()>0){let e=[Y.events.TEXT_CHANGE,o,a,t];this.emitter.emit(Y.events.EDITOR_CHANGE,...e),t!==Y.sources.SILENT&&this.emitter.emit(...e)}return o}function vs(e,t,n,r,i){let a={};return typeof e.index=="number"&&typeof e.length=="number"?typeof t=="number"?(t=e.length,e=e.index):(i=r,r=n,n=t,t=e.length,e=e.index):typeof t!="number"&&(i=r,r=n,n=t,t=0),typeof n=="object"?(a=n,i=r):typeof n=="string"&&(r==null?i=n:a[n]=r),i||=Y.sources.API,[e,t,a,i]}function ys(e,t,n,r){let i=typeof n=="number"?n:0;if(e==null)return null;let a,o;return t&&typeof t.transformPosition=="function"?[a,o]=[e.index,e.index+e.length].map(e=>t.transformPosition(e,r!==Y.sources.USER)):[a,o]=[e.index,e.index+e.length].map(e=>e<t||e===t&&r===Y.sources.USER?e:i>=0?e+i:Math.max(t,e+i)),new Bo(a,o-a)}var bs=class extends so{};function xs(e){return e instanceof J||e instanceof Oo}function Ss(e){return typeof e.updateContent=="function"}var Cs=class extends po{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=J;static allowedChildren=[J,Oo,bs];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",e=>this.handleDragStart(e))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;let e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Y.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Y.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Y.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){let[n,r]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&n!==i&&r>0){if(n instanceof Oo||i instanceof Oo){this.optimize();return}let e=i.children.head instanceof So?null:i.children.head;n.moveChildren(i,e),n.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(n==null||this.scroll.query(t,G.BLOCK)==null){let e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),n==null&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{let e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===G.INLINE_BLOT){let n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){let n=this.deltaToRenderBlocks(t.concat((new q.default).insert("\n"))),r=n.pop();if(r==null)return;this.batchStart();let i=n.shift();if(i){let t=i.type==="block"&&(i.delta.length()===0||!this.descendant(Oo,e)[0]&&e<this.length()),n=i.type==="block"?i.delta:(new q.default).insert({[i.key]:i.value});ws(this,e,n);let r=i.type==="block"?1:0,a=e+n.length()+r;t&&this.insertAt(a-1,"\n");let o=Ao(this.line(e)[0]),s=q.AttributeMap.diff(o,i.attributes)||{};Object.keys(s).forEach(e=>{this.formatAt(a-1,1,e,s[e])}),e=a}let[a,o]=this.children.find(e);if(n.length&&(a&&(a=a.split(o),o=0),n.forEach(e=>{if(e.type==="block")ws(this.createBlock(e.attributes,a||void 0),0,e.delta);else{let t=this.create(e.key,e.value);this.insertBefore(t,a||void 0),Object.keys(e.attributes).forEach(n=>{t.format(n,e.attributes[n])})}})),r.type==="block"&&r.delta.length()){let e=a?a.offset(a.scroll)+o:this.length();ws(this,e,r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){let t=this.path(e).pop();if(!t)return[null,-1];let[n,r]=t;return n instanceof K?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(xs,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,n=(e,t,r)=>{let i=[],a=r;return e.children.forEachAt(t,r,(e,t,r)=>{xs(e)?i.push(e):e instanceof so&&(i=i.concat(n(e,t,a))),a-=r}),i};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Y.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=Y.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(e=>{let{target:t}=e,n=this.find(t,!0);return n&&!Ss(n)}),e.length>0&&this.emitter.emit(Y.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Y.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){let[r]=this.descendant(e=>e instanceof Oo,e);r&&r.statics.blotName===t&&Ss(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){let t=[],n=new q.default;return e.forEach(e=>{let r=e?.insert;if(r)if(typeof r=="string"){let i=r.split("\n");i.slice(0,-1).forEach(r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new q.default});let a=i[i.length-1];a&&n.insert(a,e.attributes)}else{let i=Object.keys(r)[0];if(!i)return;this.query(i,G.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new q.default,t.push({type:"blockEmbed",key:i,value:r[i],attributes:e.attributes??{}}))}}),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n,r={};Object.entries(e).forEach(e=>{let[t,i]=e;this.query(t,G.BLOCK&G.BLOT)==null?r[t]=i:n=t});let i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);let a=i.length();return Object.entries(r).forEach(e=>{let[t,n]=e;i.formatAt(0,a,t,n)}),i}};function ws(e,t,n){n.reduce((t,n)=>{let r=q.Op.length(n),i=n.attributes||{};if(n.insert!=null){if(typeof n.insert=="string"){let r=n.insert;e.insertAt(t,r);let[a]=e.descendant(K,t),o=Ao(a);i=q.AttributeMap.diff(o,i)||{}}else if(typeof n.insert=="object"){let r=Object.keys(n.insert)[0];if(r==null)return t;if(e.insertAt(t,r,n.insert[r]),e.scroll.query(r,G.INLINE)!=null){let[n]=e.descendant(K,t),r=Ao(n);i=q.AttributeMap.diff(r,i)||{}}}}return Object.keys(i).forEach(n=>{e.formatAt(t,r,n,i[n])}),t+r},t)}var Ts={scope:G.BLOCK,whitelist:["right","center","justify"]},Es=new za("align","align",Ts),Ds=new Wa("align","ql-align",Ts),Os=new Ka("align","text-align",Ts),ks=class extends Ka{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(e=>`00${parseInt(e,10).toString(16)}`.slice(-2)).join("")}`):t}},As=new Wa("color","ql-color",{scope:G.INLINE}),js=new ks("color","color",{scope:G.INLINE}),Ms=new Wa("background","ql-bg",{scope:G.INLINE}),Ns=new ks("background","background-color",{scope:G.INLINE}),Ps=class extends bs{static create(e){let t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(e=>e.length()<=1?"":e.domNode.innerText).join("\n").slice(e,e+t)}html(e,t){return`<pre>\n${To(this.code(e,t))}\n</pre>`}},Z=class extends J{static TAB=" ";static register(){X.register(Ps)}},Fs=class extends Eo{};Fs.blotName="code",Fs.tagName="CODE",Z.blotName="code-block",Z.className="ql-code-block",Z.tagName="DIV",Ps.blotName="code-block-container",Ps.className="ql-code-block-container",Ps.tagName="DIV",Ps.allowedChildren=[Z],Z.allowedChildren=[Co,So,jo],Z.requiredContainer=Ps;var Is={scope:G.BLOCK,whitelist:["rtl"]},Ls=new za("direction","dir",Is),Rs=new Wa("direction","ql-direction",Is),zs=new Ka("direction","direction",Is),Bs={scope:G.INLINE,whitelist:["serif","monospace"]},Vs=new Wa("font","ql-font",Bs),Hs=new class extends Ka{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",Bs),Us=new Wa("size","ql-size",{scope:G.INLINE,whitelist:["small","large","huge"]}),Ws=new Ka("size","font-size",{scope:G.INLINE,whitelist:["10px","18px","32px"]}),Gs=Lo("quill:keyboard"),Ks=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",qs=class e extends Qo{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Qs(e);if(r==null){Gs.warn("Attempted to add invalid keyboard binding",r);return}typeof t=="function"&&(t={handler:t}),typeof n=="function"&&(n={handler:n}),(Array.isArray(r.key)?r.key:[r.key]).forEach(e=>{let i={...r,key:e,...t,...n};this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;let n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(n=>e.match(t,n));if(n.length===0)return;let r=X.find(t.target,!0);if(r&&r.scroll!==this.quill.scroll)return;let i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;let[a,o]=this.quill.getLine(i.index),[s,c]=this.quill.getLeaf(i.index),[l,u]=i.length===0?[s,c]:this.quill.getLeaf(i.index+i.length),d=s instanceof ho?s.value().slice(0,c):"",f=l instanceof ho?l.value().slice(u):"",p={collapsed:i.length===0,empty:i.length===0&&a.length()<=1,format:this.quill.getFormat(i),line:a,offset:o,prefix:d,suffix:f,event:t};n.some(e=>{if(e.collapsed!=null&&e.collapsed!==p.collapsed||e.empty!=null&&e.empty!==p.empty||e.offset!=null&&e.offset!==p.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(e=>p.format[e]==null))return!1}else if(typeof e.format=="object"&&!Object.keys(e.format).every(t=>e.format[t]===!0?p.format[t]!=null:e.format[t]===!1?p.format[t]==null:Ia(e.format[t],p.format[t])))return!1;return e.prefix!=null&&!e.prefix.test(p.prefix)||e.suffix!=null&&!e.suffix.test(p.suffix)?!1:e.handler.call(this,i,p,e)!==!0})&&t.preventDefault()})}handleBackspace(e,t){let n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let r={},[i]=this.quill.getLine(e.index),a=(new q.default).retain(e.index-n).delete(n);if(t.offset===0){let[t]=this.quill.getLine(e.index-1);if(t&&!(t.statics.blotName==="block"&&t.length()<=1)){let t=i.formats(),n=this.quill.getFormat(e.index-1,1);if(r=q.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){let t=(new q.default).retain(e.index+i.length()-2).retain(1,r);a=a.compose(t)}}}this.quill.updateContents(a,X.sources.USER),this.quill.focus()}handleDelete(e,t){let n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={},[i]=this.quill.getLine(e.index),a=(new q.default).retain(e.index).delete(n);if(t.offset>=i.length()-1){let[t]=this.quill.getLine(e.index+1);if(t){let n=i.formats(),o=this.quill.getFormat(e.index,1);r=q.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(a=a.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(a,X.sources.USER),this.quill.focus()}handleDeleteRange(e){$s({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){let n=Object.keys(t.format).reduce((e,n)=>(this.quill.scroll.query(n,G.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e),{}),r=(new q.default).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,X.sources.USER),this.quill.setSelection(e.index+1,X.sources.SILENT),this.quill.focus()}};qs.DEFAULTS={bindings:{bold:Xs("bold"),italic:Xs("italic"),underline:Xs("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",X.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",X.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){t.format.indent==null?t.format.list!=null&&this.quill.format("list",!1,X.sources.USER):this.quill.format("indent","-1",X.sources.USER)}},"indent code-block":Js(!0),"outdent code-block":Js(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,X.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();let n=(new q.default).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,X.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,X.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,X.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){let n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,X.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){let[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},i=(new q.default).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,X.sources.USER),this.quill.setSelection(e.index+1,X.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){let[n,r]=this.quill.getLine(e.index),i=(new q.default).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,X.sources.USER),this.quill.setSelection(e.index+1,X.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){let t=this.quill.getModule("table");if(t){let[n,r,i,a]=t.getTable(e),o=ec(n,r,i,a);if(o==null)return;let s=n.offset();if(o<0){let t=(new q.default).retain(s).insert("\n");this.quill.updateContents(t,X.sources.USER),this.quill.setSelection(e.index+1,e.length,X.sources.SILENT)}else if(o>0){s+=n.length();let e=(new q.default).retain(s).insert("\n");this.quill.updateContents(e,X.sources.USER),this.quill.setSelection(s,X.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){let{event:n,line:r}=t,i=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,X.sources.USER):this.quill.setSelection(i+r.length(),X.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(this.quill.scroll.query("list")==null)return!0;let{length:n}=t.prefix,[r,i]=this.quill.getLine(e.index);if(i>n)return!0;let a;switch(t.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(e.index," ",X.sources.USER),this.quill.history.cutoff();let o=(new q.default).retain(e.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:a});return this.quill.updateContents(o,X.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,X.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){let[t,n]=this.quill.getLine(e.index),r=2,i=t;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,--r,r<=0){let r=(new q.default).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,X.sources.USER),this.quill.setSelection(e.index-1,X.sources.SILENT),!1}return!0}},"embed left":Ys("ArrowLeft",!1),"embed left shift":Ys("ArrowLeft",!0),"embed right":Ys("ArrowRight",!1),"embed right shift":Ys("ArrowRight",!0),"table down":Zs(!1),"table up":Zs(!0)}};function Js(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n,{TAB:i}=this.quill.scroll.query("code-block");if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,X.sources.USER),this.quill.setSelection(t.index+i.length,X.sources.SILENT);return}let a=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t),{index:o,length:s}=t;a.forEach((t,n)=>{e?(t.insertAt(0,i),n===0?o+=i.length:s+=i.length):t.domNode.textContent.startsWith(i)&&(t.deleteAt(0,i.length),n===0?o-=i.length:s-=i.length)}),this.quill.update(X.sources.USER),this.quill.setSelection(o,s,X.sources.SILENT)}}}function Ys(e,t){return{key:e,shiftKey:t,altKey:null,[e==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:r}=n;e==="ArrowRight"&&(r+=n.length+1);let[i]=this.quill.getLeaf(r);return i instanceof co?(e==="ArrowLeft"?t?this.quill.setSelection(n.index-1,n.length+1,X.sources.USER):this.quill.setSelection(n.index-1,X.sources.USER):t?this.quill.setSelection(n.index,n.length+1,X.sources.USER):this.quill.setSelection(n.index+n.length+1,X.sources.USER),!1):!0}}}function Xs(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],X.sources.USER)}}}function Zs(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){let r=e?"prev":"next",i=n.line,a=i.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let e=a.children.head,t=i;for(;t.prev!=null;)t=t.prev,e=e.next;let r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,X.sources.USER)}}else{let t=i.table()[r];t!=null&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,X.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,X.sources.USER))}return!1}}}function Qs(e){if(typeof e=="string"||typeof e=="number")e={key:e};else if(typeof e=="object")e=Wi(e);else return null;return e.shortKey&&(e[Ks]=e.shortKey,delete e.shortKey),e}function $s(e){let{quill:t,range:n}=e,r=t.getLines(n),i={};if(r.length>1){let e=r[0].formats(),t=r[r.length-1].formats();i=q.AttributeMap.diff(t,e)||{}}t.deleteText(n,X.sources.USER),Object.keys(i).length>0&&t.formatLine(n.index,1,i,X.sources.USER),t.setSelection(n.index,X.sources.SILENT)}function ec(e,t,n,r){return t.prev==null&&t.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}var tc=/font-weight:\s*normal/,nc=["P","OL","UL"],rc=e=>e&&nc.includes(e.tagName),ic=e=>{Array.from(e.querySelectorAll("br")).filter(e=>rc(e.previousElementSibling)&&rc(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},ac=e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(tc)).forEach(t=>{let n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)})};function oc(e){e.querySelector('[id^="docs-internal-guid-"]')&&(ac(e),ic(e))}var sc=/\bmso-list:[^;]*ignore/i,cc=/\bmso-list:[^;]*\bl(\d+)/i,lc=/\bmso-list:[^;]*\blevel(\d+)/i,uc=(e,t)=>{let n=e.getAttribute("style"),r=n?.match(cc);if(!r)return null;let i=Number(r[1]),a=n?.match(lc),o=a?Number(a[1]):1,s=RegExp(`@list l${i}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=t.match(s);return{id:i,indent:o,type:c&&c[1]==="bullet"?"bullet":"ordered",element:e}},dc=e=>{let t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach(e=>{(e.getAttribute("style")||"").match(sc)?n.push(e):r.push(e)}),n.forEach(e=>e.parentNode?.removeChild(e));let i=e.documentElement.innerHTML,a=r.map(e=>uc(e,i)).filter(e=>e);for(;a.length;){let e=[],t=a.shift();for(;t;)e.push(t),t=a.length&&a[0]?.element===t.element.nextElementSibling&&a[0].id===t.id?a.shift():null;let n=document.createElement("ul");e.forEach(e=>{let t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class",`ql-indent-${e.indent-1}`),t.innerHTML=e.element.innerHTML,n.appendChild(t)});let r=e[0]?.element,{parentNode:i}=r??{};r&&i?.replaceChild(n,r),e.slice(1).forEach(e=>{let{element:t}=e;i?.removeChild(t)})}};function fc(e){e.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&dc(e)}var pc=[fc,oc],mc=e=>{e.documentElement&&pc.forEach(t=>{t(e)})},hc=Lo("quill:clipboard"),gc=[[Node.TEXT_NODE,Rc],[Node.TEXT_NODE,Fc],["br",Ac],[Node.ELEMENT_NODE,Fc],[Node.ELEMENT_NODE,kc],[Node.ELEMENT_NODE,Oc],[Node.ELEMENT_NODE,Ic],["li",Nc],["ol, ul",Pc],["pre",jc],["tr",Lc],["b",Dc("bold")],["i",Dc("italic")],["strike",Dc("strike")],["style",Mc]],_c=[Es,Ls].reduce((e,t)=>(e[t.keyName]=t,e),{}),vc=[Os,Ns,js,zs,Hs,Ws].reduce((e,t)=>(e[t.keyName]=t,e),{}),yc=class extends Qo{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",e=>this.onCaptureCopy(e,!1)),this.quill.root.addEventListener("cut",e=>this.onCaptureCopy(e,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],gc.concat(this.options.matchers??[]).forEach(e=>{let[t,n]=e;this.addMatcher(t,n)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r[Z.blotName])return(new q.default).insert(n||"",{[Z.blotName]:r[Z.blotName]});if(!t)return(new q.default).insert(n||"",r);let i=this.convertHTML(t);return xc(i,"\n")&&(i.ops[i.ops.length-1].attributes==null||r.table)?i.compose((new q.default).retain(i.length()-1).delete(1)):i}normalizeHTML(e){mc(e)}convertHTML(e){let t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);let n=t.body,r=new WeakMap,[i,a]=this.prepareMatching(n,r);return Ec(this.quill.scroll,n,i,a,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:X.sources.API;if(typeof e=="string"){let n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,X.sources.SILENT)}else{let r=this.convert({html:t,text:""});this.quill.updateContents((new q.default).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),X.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();let[n]=this.quill.selection.getRange();if(n==null)return;let{html:r,text:i}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",r),t&&$s({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(e=>e[0]!=="#").join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();let t=this.quill.getSelection(!0);if(t==null)return;let n=e.clipboardData?.getData("text/html"),r=e.clipboardData?.getData("text/plain");if(!n&&!r){let t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}let i=Array.from(e.clipboardData?.files||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){let e=(new DOMParser).parseFromString(n,"text/html");if(e.body.childElementCount===1&&e.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:r})}onCopy(e){let t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t,i=this.quill.getFormat(e.index),a=this.convert({text:n,html:r},i);hc.log("onPaste",a,{text:n,html:r});let o=(new q.default).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,X.sources.USER),this.quill.setSelection(o.length()-e.length,X.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){let n=[],r=[];return this.matchers.forEach(i=>{let[a,o]=i;switch(a){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach(e=>{t.has(e)?t.get(e)?.push(o):t.set(e,[o])});break}}),[n,r]}};function bc(e,t,n,r){return r.query(t)?e.reduce((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);let i=n?{[t]:n}:{};return e.insert(r.insert,{...i,...r.attributes})},new q.default):e}function xc(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.length<t.length;--r){let t=e.ops[r];if(typeof t.insert!="string")break;n=t.insert+n}return n.slice(-1*t.length)===t}function Sc(e,t){if(!(e instanceof Element))return!1;let n=t.query(e);return n&&n.prototype instanceof co?!1:"address.article.blockquote.canvas.dd.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.iframe.li.main.nav.ol.output.p.pre.section.table.td.tr.ul.video".split(".").includes(e.tagName.toLowerCase())}function Cc(e,t){return e.previousElementSibling&&e.nextElementSibling&&!Sc(e.previousElementSibling,t)&&!Sc(e.nextElementSibling,t)}var wc=new WeakMap;function Tc(e){return e==null?!1:(wc.has(e)||(e.tagName==="PRE"?wc.set(e,!0):wc.set(e,Tc(e.parentNode))),wc.get(e))}function Ec(e,t,n,r,i){return t.nodeType===t.TEXT_NODE?r.reduce((n,r)=>r(t,n,e),new q.default):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((a,o)=>{let s=Ec(e,o,n,r,i);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce((t,n)=>n(o,t,e),s),s=(i.get(o)||[]).reduce((t,n)=>n(o,t,e),s)),a.concat(s)},new q.default):new q.default}function Dc(e){return(t,n,r)=>bc(n,e,!0,r)}function Oc(e,t,n){let r=za.keys(e),i=Wa.keys(e),a=Ka.keys(e),o={};return r.concat(i).concat(a).forEach(t=>{let r=n.query(t,G.ATTRIBUTE);r!=null&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=_c[t],r!=null&&(r.attrName===t||r.keyName===t)&&(o[r.attrName]=r.value(e)||void 0),r=vc[t],r!=null&&(r.attrName===t||r.keyName===t)&&(r=vc[t],o[r.attrName]=r.value(e)||void 0))}),Object.entries(o).reduce((e,t)=>{let[r,i]=t;return bc(e,r,i,n)},t)}function kc(e,t,n){let r=n.query(e);if(r==null)return t;if(r.prototype instanceof co){let t={},i=r.value(e);if(i!=null)return t[r.blotName]=i,(new q.default).insert(t,r.formats(e,n))}else if(r.prototype instanceof ao&&!xc(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return bc(t,r.blotName,r.formats(e,n),n);return t}function Ac(e,t){return xc(t,"\n")||t.insert("\n"),t}function jc(e,t,n){let r=n.query("code-block");return bc(t,"code-block",r&&"formats"in r&&typeof r.formats=="function"?r.formats(e,n):!0,n)}function Mc(){return new q.default}function Nc(e,t,n){let r=n.query(e);if(r==null||r.blotName!=="list"||!xc(t,"\n"))return t;let i=-1,a=e.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(i+=1),a=a.parentNode;return i<=0?t:t.reduce((e,t)=>t.insert?t.attributes&&typeof t.attributes.indent=="number"?e.push(t):e.insert(t.insert,{indent:i,...t.attributes||{}}):e,new q.default)}function Pc(e,t,n){let r=e,i=r.tagName==="OL"?"ordered":"bullet",a=r.getAttribute("data-checked");return a&&(i=a==="true"?"checked":"unchecked"),bc(t,"list",i,n)}function Fc(e,t,n){if(!xc(t,"\n")){if(Sc(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;r!=null;){if(Sc(r,n))return t.insert("\n");let e=n.query(r);if(e&&e.prototype instanceof Oo)return t.insert("\n");r=r.firstChild}}}return t}function Ic(e,t,n){let r={},i=e.style||{};return i.fontStyle==="italic"&&(r.italic=!0),i.textDecoration==="underline"&&(r.underline=!0),i.textDecoration==="line-through"&&(r.strike=!0),(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((e,t)=>{let[r,i]=t;return bc(e,r,i,n)},t),parseFloat(i.textIndent||0)>0?(new q.default).insert("\t").concat(t):t}function Lc(e,t,n){let r=e.parentElement?.tagName==="TABLE"?e.parentElement:e.parentElement?.parentElement;return r==null?t:bc(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n)}function Rc(e,t,n){let r=e.data;if(e.parentElement?.tagName==="O:P")return t.insert(r.trim());if(!Tc(e)){if(r.trim().length===0&&r.includes("\n")&&!Cc(e,n))return t;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(e.previousSibling==null&&e.parentElement!=null&&Sc(e.parentElement,n)||e.previousSibling instanceof Element&&Sc(e.previousSibling,n))&&(r=r.replace(/^ /,"")),(e.nextSibling==null&&e.parentElement!=null&&Sc(e.parentElement,n)||e.nextSibling instanceof Element&&Sc(e.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return t.insert(r)}var zc=class extends Qo{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(X.events.EDITOR_CHANGE,(e,t,n,r)=>{e===X.events.SELECTION_CHANGE?t&&r!==X.sources.SILENT&&(this.currentRange=t):e===X.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||r===X.sources.USER?this.record(t,n):this.transform(t)),this.currentRange=Uc(this.currentRange,t))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",e=>{e.inputType==="historyUndo"?(this.undo(),e.preventDefault()):e.inputType==="historyRedo"&&(this.redo(),e.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;let n=this.stack[e].pop();if(!n)return;let r=this.quill.getContents(),i=n.delta.invert(r);this.stack[t].push({delta:i,range:Uc(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,X.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange,i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){let e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=i;n.length()!==0&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Bc(this.stack.undo,e),Bc(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,X.sources.USER);else{let t=Hc(this.quill.scroll,e.delta);this.quill.setSelection(t,X.sources.USER)}}};function Bc(e,t){let n=t;for(let t=e.length-1;t>=0;--t){let r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&Uc(r.range,n)},n=r.delta.transform(n),e[t].delta.length()===0&&e.splice(t,1)}}function Vc(e,t){let n=t.ops[t.ops.length-1];return n==null?!1:n.insert==null?n.attributes==null?!1:Object.keys(n.attributes).some(t=>e.query(t,G.BLOCK)!=null):typeof n.insert=="string"&&n.insert.endsWith("\n")}function Hc(e,t){let n=t.reduce((e,t)=>e+(t.delete||0),0),r=t.length()-n;return Vc(e,t)&&--r,r}function Uc(e,t){if(!e)return e;let n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}var Wc=class extends Qo{constructor(e,t){super(e,t),e.root.addEventListener("drop",t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){let e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}let r=n&&e.selection.normalizeNative(n);if(r){let n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}})}upload(e,t){let n=[];Array.from(t).forEach(e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)}),n.length>0&&this.options.handler.call(this,e,n)}};Wc.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;let n=t.map(e=>new Promise(t=>{let n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}));Promise.all(n).then(t=>{let n=t.reduce((e,t)=>e.insert({image:t}),(new q.default).retain(e.index).delete(e.length));this.quill.updateContents(n,Y.sources.USER),this.quill.setSelection(e.index+t.length,Y.sources.SILENT)})}};var Gc=["insertText","insertReplacementText"],Kc=class extends Qo{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",e=>{this.handleBeforeInput(e)}),/Android/i.test(navigator.userAgent)||e.on(X.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){$s({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){let n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new q.default).retain(e.index).insert(t,n),X.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,X.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Gc.includes(e.inputType))return;let t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;let n=qc(e);if(n==null)return;let r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){let e=this.quill.getSelection();e&&this.replaceText(e)}};function qc(e){return typeof e.data=="string"?e.data:e.dataTransfer?.types.includes("text/plain")?e.dataTransfer.getData("text/plain"):null}var Jc=/Mac/i.test(navigator.platform),Yc=e=>!!(e.key==="ArrowLeft"||e.key==="ArrowRight"||e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="Home"||Jc&&e.key==="a"&&e.ctrlKey===!0),Xc=class extends Qo{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof eo)||!n.uiNode)return!0;let i=getComputedStyle(n.domNode).direction==="rtl";return i&&r.key!=="ArrowRight"||!i&&r.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),X.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Yc(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,!this.isListening&&(this.isListening=!0,document.addEventListener("selectionchange",()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0}))}handleSelectionChange(){let e=document.getSelection();if(!e)return;let t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;let n=this.quill.scroll.find(t.startContainer);if(!(n instanceof eo)||!n.uiNode)return;let r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}};X.register({"blots/block":J,"blots/block/embed":Oo,"blots/break":So,"blots/container":bs,"blots/cursor":jo,"blots/embed":es,"blots/inline":Eo,"blots/scroll":Cs,"blots/text":Co,"modules/clipboard":yc,"modules/history":zc,"modules/keyboard":qs,"modules/uploader":Wc,"modules/input":Kc,"modules/uiNode":Xc});var Zc=X,Qc=new class extends Wa{add(e,t){let n=0;if(t==="+1"||t==="-1"){let r=this.value(e)||0;n=t==="+1"?r+1:r-1}else typeof t=="number"&&(n=t);return n===0?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:G.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),$c=class extends J{static blotName="blockquote";static tagName="blockquote"},el=class extends J{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},tl=class extends bs{};tl.blotName="list-container",tl.tagName="OL";var nl=class extends J{static create(e){let t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){X.register(tl)}constructor(e,t){super(e,t);let n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;let r=this.statics.formats(t,e);r==="checked"?(this.format("list","unchecked"),n.preventDefault()):r==="unchecked"&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}};nl.blotName="list",nl.tagName="LI",tl.allowedChildren=[nl],nl.requiredContainer=tl;var rl=class extends Eo{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}},il=class extends rl{static blotName="italic";static tagName=["EM","I"]},al=class extends Eo{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){let t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return ol(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}};function ol(e,t){let n=document.createElement("a");n.href=e;let r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}var sl=class extends Eo{static blotName="script";static tagName=["SUB","SUP"];static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}},cl=class extends rl{static blotName="strike";static tagName=["S","STRIKE"]},ll=class extends Eo{static blotName="underline";static tagName="U"},ul=class extends es{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw Error("Formula module requires KaTeX.");let t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){let{formula:e}=this.value();return`<span>${e}</span>`}},dl=["alt","height","width"],fl=class extends co{static blotName="image";static tagName="IMG";static create(e){let t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return dl.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return ol(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){dl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},pl=["height","width"],ml=class extends Oo{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){let t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return pl.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return al.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){pl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){let{video:e}=this.value();return`<a href="${e}">${e}</a>`}},hl=new Wa("code-token","hljs",{scope:G.INLINE}),gl=class e extends Eo{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Z.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),hl.add(this.domNode,n)}format(t,n){t===e.blotName?n?hl.add(this.domNode,n):(hl.remove(this.domNode),this.domNode.classList.remove(this.statics.className)):super.format(t,n)}optimize(){super.optimize(...arguments),hl.value(this.domNode)||this.unwrap()}};gl.blotName="code-token",gl.className="ql-token";var _l=class extends Z{static create(e){let t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),gl.blotName,!1),super.replaceWith(e,t)}},vl=class extends Ps{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===_l.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,r){n===_l.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;let n=`${Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).map(e=>e.textContent).join("\n")}\n`,r=_l.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||this.cachedText==null){let t=this.children.reduce((e,t)=>e.concat(ko(t,!1)),new q.default),i=e(n,r);t.diff(i).reduce((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach(t=>{[_l.blotName,gl.blotName].includes(t)&&this.formatAt(e,n,t,r[t])}),e+n):e},0)}this.cachedText=n,this.forceNext=!1}}html(e,t){let[n]=this.children.find(e);return`<pre data-language="${n?_l.formats(n.domNode):"plain"}">\n${To(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){let e=_l.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}};vl.allowedChildren=[_l],_l.requiredContainer=vl,_l.allowedChildren=[gl,jo,Co,So];var yl=(e,t,n)=>{if(typeof e.versionString=="string"){let r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value},bl=class extends Qo{static register(){X.register(gl,!0),X.register(_l,!0),X.register(vl,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((e,t)=>{let{key:n}=t;return e[n]=!0,e},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(X.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof vl))return;let t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(e=>{let{key:n,label:r}=e,i=t.ownerDocument.createElement("option");i.textContent=r,i.setAttribute("value",n),t.appendChild(i)}),t.addEventListener("change",()=>{e.format(_l.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode??(e.attachUI(t),e.children.head&&(t.value=_l.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(X.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(X.sources.USER);let n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(vl):[e]).forEach(e=>{e.highlight(this.highlightBlot,t)}),this.quill.update(X.sources.SILENT),n!=null&&this.quill.setSelection(n,X.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return To(e).split("\n").reduce((e,n,r)=>(r!==0&&e.insert("\n",{[Z.blotName]:t}),e.insert(n)),new q.default);let n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Z.className),n.innerHTML=yl(this.options.hljs,t,e),Ec(this.quill.scroll,n,[(e,t)=>{let n=hl.value(e);return n?t.compose((new q.default).retain(t.length(),{[gl.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce((e,n,r)=>(r!==0&&e.insert("\n",{[Z.blotName]:t}),e.insert(n)),n)],new WeakMap)}};bl.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};var xl=class e extends J{static blotName="table";static tagName="TD";static create(e){let t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Tl()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===e.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}},Sl=class extends bs{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){let e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(e=>{if(e.next==null)return;let t=e.formats(),n=e.next.formats();if(t.table!==n.table){let t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}},Cl=class extends bs{static blotName="table-body";static tagName="TBODY"},wl=class extends bs{static blotName="table-container";static tagName="TABLE";balanceCells(){let e=this.descendants(Sl),t=e.reduce((e,t)=>Math.max(t.children.length,e),0);e.forEach(e=>{Array(t-e.children.length).fill(0).forEach(()=>{let t;e.children.head!=null&&(t=xl.formats(e.children.head.domNode));let n=this.scroll.create(xl.blotName,t);e.appendChild(n),n.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){let[t]=this.descendant(Cl);t==null||t.children.head==null||t.children.forEach(t=>{t.children.at(e)?.remove()})}insertColumn(e){let[t]=this.descendant(Cl);t==null||t.children.head==null||t.children.forEach(t=>{let n=t.children.at(e),r=xl.formats(t.children.head.domNode),i=this.scroll.create(xl.blotName,r);t.insertBefore(i,n)})}insertRow(e){let[t]=this.descendant(Cl);if(t==null||t.children.head==null)return;let n=Tl(),r=this.scroll.create(Sl.blotName);t.children.head.children.forEach(()=>{let e=this.scroll.create(xl.blotName,n);r.appendChild(e)});let i=t.children.at(e);t.insertBefore(r,i)}rows(){let e=this.children.head;return e==null?[]:e.children.map(e=>e)}};wl.allowedChildren=[Cl],Cl.requiredContainer=wl,Cl.allowedChildren=[Sl],Sl.requiredContainer=Cl,Sl.allowedChildren=[xl],xl.requiredContainer=Sl;function Tl(){return`row-${Math.random().toString(36).slice(2,6)}`}var El=class extends Qo{static register(){X.register(xl),X.register(Sl),X.register(Cl),X.register(wl)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(wl).forEach(e=>{e.balanceCells()})}deleteColumn(){let[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(X.sources.USER))}deleteRow(){let[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(X.sources.USER))}deleteTable(){let[e]=this.getTable();if(e==null)return;let t=e.offset();e.remove(),this.quill.update(X.sources.USER),this.quill.setSelection(t,X.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];let[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==xl.blotName)return[null,null,null,-1];let r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=i.cellOffset();n.insertColumn(a+e),this.quill.update(X.sources.USER);let o=r.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,X.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=r.rowOffset();n.insertRow(a+e),this.quill.update(X.sources.USER),e>0?this.quill.setSelection(t,X.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,X.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){let n=this.quill.getSelection();if(n==null)return;let r=Array(e).fill(0).reduce(e=>{let n=Array(t).fill("\n").join("");return e.insert(n,{table:Tl()})},(new q.default).retain(n.index));this.quill.updateContents(r,X.sources.USER),this.quill.setSelection(n.index,X.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(X.events.SCROLL_OPTIMIZE,e=>{e.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(X.events.TEXT_CHANGE,(e,t,n)=>{n===X.sources.USER&&this.balanceTables()}),!0):!1)})}},Dl=Lo("quill:toolbar"),Ol=class extends Qo{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){let t=document.createElement("div");t.setAttribute("role","toolbar"),Al(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Dl.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(e=>{let t=this.options.handlers?.[e];t&&this.addHandler(e,t)}),Array.from(this.container.querySelectorAll("button, select")).forEach(e=>{this.attach(e)}),this.quill.on(X.events.EDITOR_CHANGE,()=>{let[e]=this.quill.selection.getRange();this.update(e)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(e=>e.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Dl.warn("ignoring attaching to nonexistent format",t,e);return}let n=e.tagName==="SELECT"?"change":"click";e.addEventListener(n,n=>{let r;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;let t=e.options[e.selectedIndex];r=t.hasAttribute("selected")?!1:t.value||!1}else r=e.classList.contains("ql-active")?!1:e.value||!e.hasAttribute("value"),n.preventDefault();this.quill.focus();let[i]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof co){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new q.default).retain(i.index).delete(i.length).insert({[t]:r}),X.sources.USER)}else this.quill.format(t,r,X.sources.USER);this.update(i)}),this.controls.push([t,e])}update(e){let t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{let[r,i]=n;if(i.tagName==="SELECT"){let n=null;if(e==null)n=null;else if(t[r]==null)n=i.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];typeof e=="string"&&(e=e.replace(/"/g,'\\"')),n=i.querySelector(`option[value="${e}"]`)}n==null?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){let e=t[r],n=e===i.getAttribute("value")||e!=null&&e.toString()===i.getAttribute("value")||e==null&&!i.getAttribute("value");i.classList.toggle("ql-active",n),i.setAttribute("aria-pressed",n.toString())}else{let e=t[r]!=null;i.classList.toggle("ql-active",e),i.setAttribute("aria-pressed",e.toString())}})}};Ol.DEFAULTS={};function kl(e,t,n){let r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),n==null?r.setAttribute("aria-label",t):(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)),e.appendChild(r)}function Al(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(t=>{let n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(e=>{if(typeof e=="string")kl(n,e);else{let t=Object.keys(e)[0],r=e[t];Array.isArray(r)?jl(n,t,r):kl(n,t,r)}}),e.appendChild(n)})}function jl(e,t,n){let r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach(e=>{let t=document.createElement("option");e===!1?t.setAttribute("selected","selected"):t.setAttribute("value",String(e)),r.appendChild(t)}),e.appendChild(r)}Ol.DEFAULTS={container:null,handlers:{clean(){let e=this.quill.getSelection();if(e!=null)if(e.length===0){let e=this.quill.getFormat();Object.keys(e).forEach(e=>{this.quill.scroll.query(e,G.INLINE)!=null&&this.quill.format(e,!1,X.sources.USER)})}else this.quill.removeFormat(e.index,e.length,X.sources.USER)},direction(e){let{align:t}=this.quill.getFormat();e==="rtl"&&t==null?this.quill.format("align","right",X.sources.USER):!e&&t==="right"&&this.quill.format("align",!1,X.sources.USER),this.quill.format("direction",e,X.sources.USER)},indent(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e==="+1"||e==="-1"){let t=e==="+1"?1:-1;n.direction==="rtl"&&(t*=-1),this.quill.format("indent",r+t,X.sources.USER)}},link(e){e===!0&&(e=prompt("Enter link URL:")),this.quill.format("link",e,X.sources.USER)},list(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t);e==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,X.sources.USER):this.quill.format("list","unchecked",X.sources.USER):this.quill.format("list",e,X.sources.USER)}}};var Ml='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Nl='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Pl='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Fl='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Il='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Ll='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Rl='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',zl='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Bl='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Vl='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',Hl='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',Ul='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',Wl='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',Gl='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',Kl='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',ql='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Jl='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',Yl='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Xl='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',Zl='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',Ql='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',$l='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',eu='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',tu='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',nu='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',ru='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',iu='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',au='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',ou='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',su='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',cu='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',lu='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',uu='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',du={align:{"":Ml,center:Nl,right:Pl,justify:Fl},background:Il,blockquote:Ll,bold:Rl,clean:zl,code:Bl,"code-block":Bl,color:Vl,direction:{"":Hl,rtl:Ul},formula:Wl,header:{1:Gl,2:Kl,3:ql,4:Jl,5:Yl,6:Xl},italic:Zl,image:Ql,indent:{"+1":$l,"-1":eu},link:tu,list:{bullet:nu,check:ru,ordered:iu},script:{sub:au,super:ou},strike:su,table:cu,underline:lu,video:uu},fu='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>',pu=0;function mu(e,t){e.setAttribute(t,`${e.getAttribute(t)!=="true"}`)}var hu=class{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault();break;default:}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),mu(this.label,"aria-expanded"),mu(this.options,"aria-hidden")}buildItem(e){let t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");let n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault();break;default:}}),t}buildLabel(){let e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=fu,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){let e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${pu}`,pu+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{let n=this.buildItem(t);e.appendChild(n),t.selected===!0&&this.selectItem(n)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.container.querySelector(".ql-selected");e!==n&&(n?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){let t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);let t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}},gu=class extends hu{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(e=>{e.classList.add("ql-primary")})}buildItem(e){let t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);let n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=r:n.style.fill=r)}},_u=class extends hu{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(e=>{e.innerHTML=t[e.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);let n=e||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}},vu=e=>{let{overflowY:t}=getComputedStyle(e,null);return t!=="visible"&&t!=="clip"},yu=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,vu(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){let t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");let r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect(),a=0;if(i.right>r.right&&(a=r.right-i.right,this.root.style.left=`${t+a}px`),i.left<r.left&&(a=r.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>r.bottom){let t=i.bottom-i.top,r=e.bottom-e.top+t;this.root.style.top=`${n-r}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}},bu=[!1,"center","right","justify"],xu="#000000.#e60000.#ff9900.#ffff00.#008a00.#0066cc.#9933ff.#ffffff.#facccc.#ffebcc.#ffffcc.#cce8cc.#cce0f5.#ebd6ff.#bbbbbb.#f06666.#ffc266.#ffff66.#66b966.#66a3e0.#c285ff.#888888.#a10000.#b26b00.#b2b200.#006100.#0047b2.#6b24b2.#444444.#5c0000.#663d00.#666600.#003700.#002966.#3d1466".split("."),Su=[!1,"serif","monospace"],Cu=["1","2","3",!1],wu=["small",!1,"large","huge"],Tu=class extends ns{constructor(e,t){super(e,t);let n=t=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",n);return}this.tooltip!=null&&!this.tooltip.root.contains(t.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(e=>{e.container.contains(t.target)||e.close()})};e.emitter.listenDOM("click",document.body,n)}addModule(e){let t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(e=>{(e.getAttribute("class")||"").split(/\s+/).forEach(n=>{if(n.startsWith("ql-")&&(n=n.slice(3),t[n]!=null))if(n==="direction")e.innerHTML=t[n][""]+t[n].rtl;else if(typeof t[n]=="string")e.innerHTML=t[n];else{let r=e.value||"";r!=null&&t[n][r]&&(e.innerHTML=t[n][r])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(e=>{if(e.classList.contains("ql-align")&&(e.querySelector("option")??Ou(e,bu),typeof t.align=="object"))return new _u(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){let n=e.classList.contains("ql-background")?"background":"color";return e.querySelector("option")??Ou(e,xu,n==="background"?"#ffffff":"#000000"),new gu(e,t[n])}return e.querySelector("option")??(e.classList.contains("ql-font")?Ou(e,Su):e.classList.contains("ql-header")?Ou(e,Cu):e.classList.contains("ql-size")&&Ou(e,wu)),new hu(e)}),this.quill.on(Y.events.EDITOR_CHANGE,()=>{this.pickers.forEach(e=>{e.update()})})}};Tu.DEFAULTS=La({},ns.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");e??(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",()=>{let t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});var Eu=class extends yu{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t==null?e!==this.root.getAttribute("data-mode")&&(this.textbox.value=""):this.textbox.value=t;let n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{let{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Y.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Y.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=Du(e);case"formula":{if(!e)break;let t=this.quill.getSelection(!0);if(t!=null){let n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,Y.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",Y.sources.USER),this.quill.setSelection(n+2,Y.sources.USER)}break}default:}this.textbox.value="",this.hide()}};function Du(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:e}function Ou(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(t=>{let r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)})}var ku=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],Au=class extends Eu{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(e,t){super(e,t),this.quill.on(Y.events.EDITOR_CHANGE,(e,t,n,r)=>{if(e===Y.events.SELECTION_CHANGE)if(t!=null&&t.length>0&&r===Y.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;let e=this.quill.getLines(t.index,t.length);if(e.length===1){let e=this.quill.getBounds(t);e!=null&&this.position(e)}else{let n=e[e.length-1],r=this.quill.getIndex(n),i=Math.min(n.length()-1,t.index+t.length-r),a=this.quill.getBounds(new Bo(r,i));a!=null&&this.position(a)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Y.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;let e=this.quill.getSelection();if(e!=null){let t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){let t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",t!==0&&(n.style.marginLeft=`${-1*t-n.offsetWidth/2}px`),t}},ju=class extends Tu{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=ku),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Au(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),du),this.buildPickers(e.container.querySelectorAll("select"),du))}};ju.DEFAULTS=La({},Tu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,X.sources.USER)}}}}});var Mu=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],Nu=class extends Eu{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(this.linkRange!=null){let e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,Y.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(Y.events.SELECTION_CHANGE,(e,t,n)=>{if(e!=null){if(e.length===0&&n===Y.sources.USER){let[t,n]=this.quill.scroll.descendant(al,e.index);if(t!=null){this.linkRange=new Bo(e.index-n,t.length());let r=al.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();let i=this.quill.getBounds(this.linkRange);i!=null&&this.position(i);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}},Pu=class extends Tu{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Mu),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),du),this.buildPickers(e.container.querySelectorAll("select"),du),this.tooltip=new Nu(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,n)=>{e.handlers.link.call(e,!n.format.link)}))}};Pu.DEFAULTS=La({},Tu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){let e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);let{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,X.sources.USER)}}}}}),Zc.register({"attributors/attribute/direction":Ls,"attributors/class/align":Ds,"attributors/class/background":Ms,"attributors/class/color":As,"attributors/class/direction":Rs,"attributors/class/font":Vs,"attributors/class/size":Us,"attributors/style/align":Os,"attributors/style/background":Ns,"attributors/style/color":js,"attributors/style/direction":zs,"attributors/style/font":Hs,"attributors/style/size":Ws},!0),Zc.register({"formats/align":Ds,"formats/direction":Rs,"formats/indent":Qc,"formats/background":Ns,"formats/color":js,"formats/font":Vs,"formats/size":Us,"formats/blockquote":$c,"formats/code-block":Z,"formats/header":el,"formats/list":nl,"formats/bold":rl,"formats/code":Fs,"formats/italic":il,"formats/link":al,"formats/script":sl,"formats/strike":cl,"formats/underline":ll,"formats/formula":ul,"formats/image":fl,"formats/video":ml,"modules/syntax":bl,"modules/table":El,"modules/toolbar":Ol,"themes/bubble":ju,"themes/snow":Pu,"ui/icons":du,"ui/picker":hu,"ui/icon-picker":_u,"ui/color-picker":gu,"ui/tooltip":yu},!0);var Q=Zc,Fu={generateFilename(){return btoa(String(Math.random()*1e6)+String(+new Date)).replace("=","")},urlIsImage(e,t=3e3){return this.validURL(e)?/\.(jpeg|jpg|gif|png|webp|tiff|bmp)$/.test(e)?Promise.resolve(!0):new Promise((n,r)=>{let i,a=new Image;a.onerror=a.onabort=()=>{clearTimeout(i),r(!1)},a.onload=()=>{clearTimeout(i),n(!0)},i=setTimeout(()=>{a.src="//!/an/invalid.jpg",r(!1)},t),a.src=e}):Promise.reject(!1)},urlIsImageDataUrl(e){return/^data:image\/\w+;base64,/.test(e)},validURL(e){try{return!!new URL(e)}catch{return!1}},isRichText(e){let t=!1,n=!1;return Array.prototype.forEach.call(e,e=>{e.kind==="string"&&e.type.match(/^text\/html$/i)&&(t=!0),e.kind==="file"&&e.type.match(/^image\/\w+$/i)&&(n=!0)}),t&&!n},resolveDataUrl(e,t){let n="";return typeof e=="string"?n=e:e instanceof ArrayBuffer&&(n=this.arrayBufferToBase64Url(e,t)),n},binaryStringToArrayBuffer(e){let t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=-1;for(;++i<t;)r[i]=e.charCodeAt(i);return n},arrayBufferToBase64Url(e,t){return`data:${t};base64,`+btoa(new Uint8Array(e).reduce((e,t)=>e+String.fromCharCode(t),""))},copyText(e,t=document.body){let n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";let i=document.getSelection(),a=!1;i&&i.rangeCount>0&&(a=i.getRangeAt(0)),t.append(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch{}return n.remove(),i&&a&&(i.removeAllRanges(),i.addRange(a)),r&&r.focus(),o},isType(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`},isObject(e){return this.isType(e,"Object")}},Iu=class{constructor(e,t,n){this.dataUrl=e,this.type=t,this.name=n||""}},Lu=class e extends Iu{constructor(e,t,n){super(e,t,n),this.dataUrl=e,this.type=t,this.name=n||`${Fu.generateFilename()}.${this.getSuffix()}`}minify(t){return new Promise((n,r)=>{let i=t.maxWidth||800,a=t.maxHeight||800,o=t.quality||.8;if(!this.dataUrl)return r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, dataUrl should not be empty."});let s=new Image;s.onload=()=>{let t=s.width,c=s.height;t>c?t>i&&(s.height=c*i/t,s.width=i):c>a&&(s.width=t*a/c,s.height=a);let l=document.createElement("canvas");l.width=s.width,l.height=s.height;let u=l.getContext("2d");if(u){u.drawImage(s,0,0,s.width,s.height);let t=this.type||"image/png";n(new e(l.toDataURL(t,o),t,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},s.src=Fu.resolveDataUrl(this.dataUrl,this.type)})}toFile(e){return e||=this.name,window.File?new File([this.toBlob()],e,{type:this.type}):(console.error("[error] QuillImageDropAndPaste: Your browser didnot support File API."),null)}toBlob(){let e=Fu.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=Fu.binaryStringToArrayBuffer(atob(e));return this.createBlob([t],{type:this.type})}createBlob(e,t){t||={},typeof t=="string"&&(t={type:t});try{return new Blob(e,t)}catch(n){if(n.name!=="TypeError")throw n;let r=new("BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder);for(let t=0;t<e.length;t++)r.append(e[t]);return r.getBlob(t.type)}}getSuffix(){let e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}},Ru=class{constructor(e,t){this.quill=e,this.option=t}},zu=class extends Ru{constructor(e,t){super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&&Fu.isObject(e.uploader)&&Fu.isObject(e.uploader?.options)&&(e.uploader.options.handler=()=>{}),this.quill=e,this.option=t,this.handleDrop=this.handleDrop.bind(this),this.handlePaste=this.handlePaste.bind(this),this.insert=this.insert.bind(this),this.quill.root.addEventListener("drop",this.handleDrop,!1),this.quill.root.addEventListener("paste",this.handlePaste,!1)}handleDrop(e){if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){if(e.preventDefault(),document.caretRangeFromPoint){let t=document.getSelection(),n=document.caretRangeFromPoint(e.clientX,e.clientY);t&&n&&t.setBaseAndExtent(n.startContainer,n.startOffset,n.startContainer,n.startOffset)}this.readFiles(e.dataTransfer.files,(e,t="image/png",n)=>{typeof this.option.handler=="function"?this.option.handler.call(this,e,t,new Lu(e,t,n)):this.insert.call(this,Fu.resolveDataUrl(e,t),t)},e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(Fu.isRichText(e.clipboardData.items))return;this.readFiles(e.clipboardData.items,(e,t="image/png")=>{typeof this.option.handler=="function"?this.option.handler.call(this,e,t,new Lu(e,t)):this.insert(Fu.resolveDataUrl(e,t),"image")},e)}}readFiles(e,t,n){Array.prototype.forEach.call(e,e=>{Fu.isType(e,"DataTransferItem")?this.handleDataTransfer(e,t,n):e instanceof File&&this.handleDroppedFile(e,t,n)})}handleDataTransfer(e,t,n){let r=this,{type:i}=e;if(i.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){n.preventDefault();let r=new FileReader;r.onload=e=>{e.target&&e.target.result&&t(e.target.result,i)};let a=e.getAsFile?e.getAsFile():e;a instanceof Blob&&r.readAsDataURL(a)}else i.match(/^text\/plain$/i)&&e.getAsString(e=>{if(Fu.urlIsImageDataUrl(e)){let n=e.match(/^data:(image\/\w+);base64,/),r=n?n[1]:"image/png",i=this.getIndex();t(e,r),this.quill.deleteText(i,e.length,"user"),this.quill.setSelection(i)}else this.option.autoConvert&&Fu.urlIsImage(e).then(()=>{setTimeout(()=>{let t=this.getIndex();this.quill.deleteText(t-e.length,e.length,"user"),r.insert(e,"image",t-e.length)})}).catch(()=>{})})}handleDroppedFile(e,t,n){let{type:r,name:i=""}=e;if(r.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){n.preventDefault();let a=new FileReader;a.onload=e=>{e.target&&e.target.result&&t(e.target.result,r,i)},a.readAsDataURL(e)}}insert(e,t,n){n=n===void 0?this.getIndex():n;let r;t.startsWith("image")?(r=n+1,this.quill.insertEmbed(n,"image",e,"user")):t.startsWith("text")&&(r=n+e.length,this.quill.insertText(n,e,"user")),setTimeout(()=>{this.quill.setSelection(r)})}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}};zu.ImageData=Lu,window.QuillImageDropAndPaste=zu,"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",zu);var Bu=Q.import("blots/block/embed");function Vu(){return class extends Bu{static blotName="html-snippet";static tagName="BUTTON";static className="HtmlSnippet";static create(e){let t=super.create(e);return t.innerText="<HTML>",e.html&&t.setAttribute("data-html",e.html),t}static value(e){let{html:t}=e.dataset;return{html:t}}}}var Hu=Q.import("blots/inline");function Uu(e,t){return class extends Hu{static blotName="internal-link";static tagName="SPAN";static className="InternalLinkPlugin";static create(n){let r=super.create(n);return t?.getDocumentTitle(n).then(e=>{r.innerHTML=`${e}`}).catch(t=>{e.logger.error("Error fetching document title:",t)}),n&&r.setAttribute("data-document-id",n),r.setAttribute("contenteditable","false"),r}static formats(e){let{documentId:t}=e.dataset;return t}}}var Wu=m("<span>");function Gu({center:e}){let t=e?"QpSpinner center":"QpSpinner";return(()=>{var e=Wu();return s(e,t),e})()}function Ku(e){let t=qu(e)??0,[n]=e.getLeaf(t);if(!n)throw Error("editor.getLeaf() returns undefined");return n.domNode}function qu(e){let t=e.getSelection();if(t!==null)return t.index+t.length}var Ju=e=>e!=null&&(e=Object.getPrototypeOf(e),e===Array.prototype||e===Object.prototype);function Yu(e,t,n){for(let[r,i]of Object.entries(t)){let t=`${n}.${r}`;e[t]=i,Ju(i)&&Yu(e,i,t)}}function Xu(e){let t={...e};for(let[n,r]of Object.entries(e))Ju(r)&&Yu(t,r,n);return t}var Zu=(e,t)=>{if(t)for(let[n,r]of Object.entries(t))e=e.replace(RegExp(`{{\\s*${n}\\s*}}`,"g"),r);return e},Qu=e=>e;function $u(e,t=Qu){return(n,...r)=>{n[0]==="."&&(n=n.slice(1));let i=e()?.[n];switch(typeof i){case"function":return i(...r);case"string":return t(i,r[0]);default:return i}}}var ed={en:{CustomToolbar:{insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},image:"image",validate:"Validate",delete:"Delete",cancel:"Cancel",done:"Done",remove:"Remove",auto:"auto",editorFocusLost:"Image not inserted, place cursor in editor first",htmlSnippetLabel:"HTML Snippet",confirmDeletion:"Confirm Deletion",comfirmSnippetDeletionDialog:{content:"Are you sure you want to delete this HTML Snippet?"},makeMediaPropertiesDialog:{variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom",link:"Link",mediaProperties:"Media properties",caption:"Caption",pixelRatio:"Pixel ratio"},openObfuscatorDialog:{obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},videoPlugin:{insertVideo:"Insert a Video",dialog:{title:"Set a video"}},internalLinkPlugin:{insertLink:"Insert an internal link"}},fr:{CustomToolbar:{insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},image:"image",validate:"Valider",delete:"Supprimer",cancel:"Annuler",done:"Terminé",remove:"Retirer",auto:"auto",editorFocusLost:"L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",htmlSnippetLabel:"Code HTML",confirmDeletion:"Confirmer la suppression",comfirmSnippetDeletionDialog:{content:"Voulez-vous vraiment supprimer ce code HTML ?"},makeMediaPropertiesDialog:{variantLabel:"Taille {{ n }}",sizes:"Tailles",imageProperties:"Propriétés de l'image",left:"À gauche",right:"À droite",center:"Centrer",alignment:"Alignement",options:"Options",enableZoom:"Activer le zoom",link:"Lien",mediaProperties:"Propriétés du média",caption:"Légende",pixelRatio:"Pixel ratio"},openObfuscatorDialog:{obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},videoPlugin:{insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},internalLinkPlugin:{insertLink:"Insérer un lien interne"}},es:{CustomToolbar:{insertHtmlSnippetMessage:"Insertar un fragmento HTML",obfuscate:"Ofuscar"},image:"imagen",validate:"Validar",delete:"Eliminar",cancel:"Cancelar",done:"Hecho",remove:"Quitar",auto:"auto",editorFocusLost:"Imagen no insertada, coloque primero el cursor en el editor",htmlSnippetLabel:"Fragmento HTML",confirmDeletion:"Confirmar eliminación",comfirmSnippetDeletionDialog:{content:"¿Está seguro de que desea eliminar este fragmento HTML?"},makeMediaPropertiesDialog:{variantLabel:"Tamaño {{ n }}",sizes:"Tamaños",imageProperties:"Propiedades de la imagen",left:"Izquierda",right:"Derecha",center:"Centro",alignment:"Alineación",options:"Opciones",enableZoom:"Habilitar zoom",link:"Enlace",mediaProperties:"Propiedades del medio",caption:"Leyenda",pixelRatio:"Proporción de píxeles"},openObfuscatorDialog:{obfuscator:"Ofuscador",content:"Contenido:",asALink:"Como enlace",doNotObfuscate:"No ofuscar"},videoPlugin:{insertVideo:"Insertar un video",dialog:{title:"Configurar un video"}},internalLinkPlugin:{insertLink:"Insertar un enlace interno"}},de:{CustomToolbar:{insertHtmlSnippetMessage:"HTML-Snippet einfügen",obfuscate:"Verschleiern"},image:"Bild",validate:"Validieren",delete:"Löschen",cancel:"Abbrechen",done:"Fertig",remove:"Entfernen",auto:"auto",editorFocusLost:"Bild nicht eingefügt, setzen Sie zuerst den Cursor in den Editor",htmlSnippetLabel:"HTML-Snippet",confirmDeletion:"Löschung bestätigen",comfirmSnippetDeletionDialog:{content:"Sind Sie sicher, dass Sie dieses HTML-Snippet löschen möchten?"},makeMediaPropertiesDialog:{variantLabel:"Größe {{ n }}",sizes:"Größen",imageProperties:"Bildeigenschaften",left:"Links",right:"Rechts",center:"Zentriert",alignment:"Ausrichtung",options:"Optionen",enableZoom:"Zoom aktivieren",link:"Link",mediaProperties:"Medieneigenschaften",caption:"Bildunterschrift",pixelRatio:"Pixelverhältnis"},openObfuscatorDialog:{obfuscator:"Verschleierer",content:"Inhalt:",asALink:"Als Link",doNotObfuscate:"Nicht verschleiern"},videoPlugin:{insertVideo:"Video einfügen",dialog:{title:"Video festlegen"}},internalLinkPlugin:{insertLink:"Internen Link einfügen"}},it:{CustomToolbar:{insertHtmlSnippetMessage:"Inserisci un frammento HTML",obfuscate:"Offuscare"},image:"immagine",validate:"Validare",delete:"Eliminare",cancel:"Annullare",done:"Fatto",remove:"Rimuovere",auto:"auto",editorFocusLost:"Immagine non inserita, posiziona prima il cursore nell'editor",htmlSnippetLabel:"Frammento HTML",confirmDeletion:"Conferma eliminazione",comfirmSnippetDeletionDialog:{content:"Sei sicuro di voler eliminare questo frammento HTML?"},makeMediaPropertiesDialog:{variantLabel:"Dimensione {{ n }}",sizes:"Dimensioni",imageProperties:"Proprietà dell'immagine",left:"Sinistra",right:"Destra",center:"Centro",alignment:"Allineamento",options:"Opzioni",enableZoom:"Abilita zoom",link:"Link",mediaProperties:"Proprietà del media",caption:"Didascalia",pixelRatio:"Rapporto pixel"},openObfuscatorDialog:{obfuscator:"Offuscatore",content:"Contenuto:",asALink:"Come link",doNotObfuscate:"Non offuscare"},videoPlugin:{insertVideo:"Inserisci un video",dialog:{title:"Imposta un video"}},internalLinkPlugin:{insertLink:"Inserisci un link interno"}},pt:{CustomToolbar:{insertHtmlSnippetMessage:"Inserir um fragmento HTML",obfuscate:"Ofuscar"},image:"imagem",validate:"Validar",delete:"Excluir",cancel:"Cancelar",done:"Concluído",remove:"Remover",auto:"auto",editorFocusLost:"Imagem não inserida, posicione primeiro o cursor no editor",htmlSnippetLabel:"Fragmento HTML",confirmDeletion:"Confirmar exclusão",comfirmSnippetDeletionDialog:{content:"Tem certeza de que deseja excluir este fragmento HTML?"},makeMediaPropertiesDialog:{variantLabel:"Tamanho {{ n }}",sizes:"Tamanhos",imageProperties:"Propriedades da imagem",left:"Esquerda",right:"Direita",center:"Centro",alignment:"Alinhamento",options:"Opções",enableZoom:"Ativar zoom",link:"Link",mediaProperties:"Propriedades da mídia",caption:"Legenda",pixelRatio:"Proporção de pixels"},openObfuscatorDialog:{obfuscator:"Ofuscador",content:"Conteúdo:",asALink:"Como link",doNotObfuscate:"Não ofuscar"},videoPlugin:{insertVideo:"Inserir um vídeo",dialog:{title:"Definir um vídeo"}},internalLinkPlugin:{insertLink:"Inserir um link interno"}}};function td(e){return{t:$u(r(()=>Xu(ed[e()in ed?e():"en"])),Zu)}}function nd(e,{label:t,url:n}){let r=t??n,i=e.getSelection();i&&i.length!==0&&(r=e.getText(i.index,i.length),e.deleteText(i.index,i.length)),e.insertText(qu(e)??0,r,"link",n)}function rd({editor:e,values:t,service:n,index:r,language:i}){let{t:a}=td(i),o=r??qu(e);if(o===void 0){n.showAlert(a("editorFocusLost"),{severity:"warning",autoDismiss:!0});return}e.insertEmbed(o,"media",t)}function id({values:e,editor:t,index:n}){if(e.html===void 0)throw Error("html is undefined");t.insertEmbed(n,"html-snippet",e);let[r]=t.getLeaf(n+1);if(!r)throw Error("missing last inserted element");return r.domNode}function ad({values:e,editor:t,index:n}){t.insertText(n,e,"internal-link",e)}function od({values:e,editor:t,index:n}){t.insertEmbed(n,"platform-video",e);let[r]=t.getLeaf(n+1);if(!r)throw Error("missing last inserted element");return r.domNode}function sd(e){let{mediaId:t}=e.dataset;if(t)return t;let n=e.getAttribute("src");if(!n)return;let{pathname:r}=new URL(n),i=r.split("/"),a=i[i.length-1].match(/^([0-9a-f-]{36})-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;let[,o]=a;return o}function cd(e){let t=ld(e),n=e.dataset.resize;return{resizeRule:n&&E(n)?n:void 0,align:t}}function ld(e){let t=e.classList;if(t.contains("center"))return"center";if(t.contains("left"))return"left";if(t.contains("right"))return"right"}function ud(e){if(e==="center")return"center";if(e==="left")return"left";if(e==="right")return"right"}var dd=Q.import("blots/block/embed"),fd=["alt"];function pd(e){return class extends dd{static blotName="media";static tagName="figure";static create(t){let n=super.create(t);return md(e,n,t),n}static formats(e){return fd.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png|webp)$/.test(e)||/^data:image\/.+;base64/.test(e)}static value(e){let{mediaId:t,resize:n}=e.dataset;if(!t)throw Error('missing "media-id" attribute');let r=n&&E(n)?n:void 0;if(!r)throw Error('missing "resize" attribute');return{mediaId:t,resizeRule:r,align:ld(e),zoomable:e.dataset.zoomable==="1",href:e.dataset.href?e.dataset.href:void 0}}format(e,t){fd.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}}function md(e,t,n){t.setAttribute("data-pa-blot","media"),t.setAttribute("contenteditable","false"),t.classList.add("MediaBlot","Fig");let r=document.createElement("img");if(r.classList.add("Fig-media"),n.align){let e=ud(n.align);e&&t.classList.add(e)}t.setAttribute("data-zoomable",n.zoomable?"1":"0"),n.zoomable&&t.classList.add("zoomable"),n.href&&(t.setAttribute("data-href",n.href),t.classList.add("asLink")),t.setAttribute("data-media-id",n.mediaId),t.setAttribute("data-resize",n.resizeRule);let i=Gu({center:!0});t.appendChild(i),hd(e,t,r,i,n)}async function hd(e,t,n,r,i){try{let a=await e.useAdminUiImage(i.mediaId,{resizeRule:i.resizeRule});if(!a)throw Error(`Media ${i.mediaId} not found`);let{source:o,variant:s}=a;n.setAttribute("src",s.url),n.setAttribute("width",String(s.width)),n.setAttribute("height",String(s.height));let c=o.attachedData?.[e.contentLanguage]?.caption;if(c){let e=document.createElement("figcaption");e.classList.add("Fig-caption"),e.textContent=c,t.appendChild(e)}gd(t,o,i),t.removeChild(r),t.appendChild(n),t.setAttribute("data-source",JSON.stringify(o))}catch(n){e.logger.error("Error setting up media:",n),t.contains(r)&&t.removeChild(r)}}function gd(e,t,n){let r=document.createElement("div");if(r.classList.add("MediaBlot-flags"),t.pixelRatio!==void 0){let e=document.createElement("span");e.classList.add("MediaBlot-flag","Fig-flag--pixelRatio"),e.textContent=`${t.pixelRatio}×`,r.appendChild(e)}if(n.zoomable){let e=document.createElement("span");e.classList.add("MediaBlot-flag"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">\n <circle cx="6.5" cy="6.5" r="5"/>\n <path d="m10.04 10.04 4.46 4.46"/>\n</svg>',r.appendChild(e)}if(n.href){let e=document.createElement("span");e.classList.add("MediaBlot-flag"),e.innerHTML='<svg width="22" height="22" viewBox="0 0 16 16" fill="currentColor">\n <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/>\n <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z"/>\n</svg>',r.appendChild(e)}e.appendChild(r)}function _d(e){return yd(e)||vd(e)}function vd(e){return!!e.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function yd(e){return!!e.match(/^(\+|00)[1-9][0-9 \-().]{7,32}$/)}function bd(e){return _d(e)?vd(e)?"mailto":"tel":"raw"}function xd(e){if(e==="raw")return"raw";if(e==="mailto")return"mailto";if(e==="tel")return"tel";throw Error(`invalid link-type '${e}'`)}var Sd=Q.import("blots/inline");function Cd(){return class extends Sd{static blotName="obfuscate";static tagName="SPAN";static className="ObfuscateBlot";static create(e){let t=super.create();return t.setAttribute("data-as-a-link",e),t}static formats(e){let{asALink:t}=e.dataset;if(!t)throw Error("No data attribute data-as-a-link");return xd(t)}}}var wd='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>',Td=Q.import("blots/block/embed");function Ed(e){return class extends Td{static blotName="platform-video";static tagName="DIV";static className="PlatformVideo";static create(t){let n=super.create(t),r=e?.getThumbnailUrl(t);return n.style.backgroundImage=`url(${r})`,n.classList.add("PlatformVideo"),n.innerHTML=`<span class="PlatformVideo-playButton">${wd}</span>`,t.videoId&&n.setAttribute("data-video-id",t.videoId),t.platform&&n.setAttribute("data-platform",t.platform),n.querySelector("span")?.addEventListener("click",()=>{n.dispatchEvent(new CustomEvent("click",{bubbles:!0}))}),n}static value(e){let{videoId:t,platform:n}=e.dataset;if(t)return{videoId:t,platform:n??"youtube"}}}}function Dd({service:e,videoPluginHook:t,internalLinkPluginHook:n}){Q.register("formats/media",pd(e),!0),Q.register("formats/html-snippet",Vu(),!0),Q.register("formats/obfuscate",Cd(),!0),Q.register("formats/platform-video",Ed(t),!0),Q.register("formats/internal-link",Uu(e,n),!0),Q.register("modules/imageDropAndPaste",zu,!0)}var Od=m('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),kd=m('<button class="QpBtn secondary"type=button>'),Ad=m("<button class=QpBtn type=button>"),jd=m('<button class="QpBtn danger outlined"type=button>'),Md=m("<p>"),Nd=m('<button class="QpBtn danger"type=button>');async function Pd({service:e,language:t,mode:n,html:r}){let{t:i}=td(t),[o,s]=a(r??""),c=()=>{l.close({action:"remove"})},l=e.createModalDialog({content:(()=>{var e=Od();return e.addEventListener("change",e=>s(e.target.value)),u(()=>e.value=o()),e})(),footer:[n==="update"&&(()=>{var n=jd();return n.$$click=()=>{Fd({deleteSnippet:c,language:t,service:e})},d(n,()=>i("delete")),n})(),(()=>{var e=kd();return e.$$click=()=>l.close(),d(e,()=>i("cancel")),e})(),(()=>{var e=Ad();return e.$$click=()=>l.close({action:n,values:{html:o()}}),d(e,()=>i("validate")),e})()],header:i("htmlSnippetLabel")});return await l.open()}function Fd({deleteSnippet:e,language:t,service:n}){let{t:r}=td(t),i=n.createModalDialog({header:r("confirmDeletion"),content:(()=>{var e=Md();return d(e,()=>r("comfirmSnippetDeletionDialog.content")),e})(),footer:[(()=>{var e=kd();return e.$$click=()=>{i.hide()},d(e,()=>r("cancel")),e})(),(()=>{var t=Nd();return t.$$click=()=>{i.hide(),e()},d(t,()=>r("validate")),t})()]});i.show()}l(["click"]);async function Id({language:e,value:t,internalLinkPluginHook:n}){if(!n)return;let r=await n.openDialog(t??"",{getLanguage:e});if(t&&r)return r.documentId?{action:"update",value:r.documentId}:{action:"remove"};if(!t&&r?.documentId)return{action:"insert",value:r.documentId}}var Ld=m('<button class="QpBtn outlined danger"type=button>'),Rd=m("<button class=QpBtn type=button>"),zd=m("<h2 class=PaField-label>"),Bd=m("<div class=QpOption>"),Vd=m("<input class=QpOption-input type=text>"),Hd=m("<label><input type=checkbox name=enableZoom>"),Ud=m("<div><div class=QpOption><label class><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>"),Wd=m("<div class=QpBox><dl class=QpProp><dt>:</dt><dd></dd></dl><dl class=QpProp><dt>:</dt><dd>"),Gd=m("<button type=button> <small class=PaMl1>(<!>)"),Kd=m("<button type=button>");async function qd({service:i,language:o,fetchedOutput:l,initialValues:p}){let{mediaId:m}=p,{themeConf:h}=i,{t:g}=td(o),[_,v]=a(p.resizeRule),[y,b]=a(p.align),[x,S]=a(p.zoomable),[C,w]=a(!!p.href),[T,E]=a(p.href??""),[D,O]=a();n(()=>{i.useAdminUiImage(m,{resizeRule:_()}).then(e=>{l.source=e?.source,O(e)}).catch(e=>{i.logger.error("Error fetching media:",e)})});let k=r(()=>h.fTextImageResizeRules.map((e,t)=>({resizeRule:e,label:g("makeMediaPropertiesDialog.variantLabel",{n:t+1})})),[h,o()]),A=r(()=>[{align:"left",label:g("makeMediaPropertiesDialog.left")},{align:"center",label:g("makeMediaPropertiesDialog.center")},{align:"right",label:g("makeMediaPropertiesDialog.right")}],[o()]),ee=async()=>{M.close({action:"update",values:{mediaId:m,align:y(),resizeRule:_(),zoomable:x(),href:C()&&T().trim()||void 0}})};n(()=>{C()&&S(!1)});let j=[(()=>{var e=Ld();return e.$$click=()=>{M.close({action:"remove"})},d(e,()=>g("remove")),e})(),(()=>{var e=Rd();return e.$$click=ee,e.disabled=!m||y===void 0||_===void 0,d(e,()=>g("validate")),e})()],M=i.createModalDialog({header:g("makeMediaPropertiesDialog.imageProperties"),content:[(()=>{var e=zd();return d(e,()=>g("makeMediaPropertiesDialog.sizes")),e})(),(()=>{var t=Bd();return d(t,c(e,{get each(){return k()},children:e=>(()=>{var t=Gd(),n=t.firstChild,r=n.nextSibling,i=r.firstChild.nextSibling;return i.nextSibling,t.$$click=()=>v(e.resizeRule),t.disabled=!m,d(t,()=>e.label,n),d(r,()=>e.resizeRule.replace("x","×"),i),u(()=>s(t,`QpBtn secondary ${e.resizeRule===_()?"":"outlined"}`)),t})()})),t})(),(()=>{var e=zd();return d(e,()=>g("makeMediaPropertiesDialog.alignment")),e})(),(()=>{var t=Bd();return d(t,c(e,{get each(){return A()},children:e=>(()=>{var t=Kd();return t.$$click=()=>b(e.align),t.disabled=!m,d(t,()=>e.label),u(()=>s(t,`QpBtn secondary ${e.align===y()?"":"outlined"}`)),t})()})),t})(),(()=>{var e=zd();return d(e,()=>g("makeMediaPropertiesDialog.options")),e})(),(()=>{var e=Ud(),n=e.firstChild,r=n.firstChild,i=r.firstChild,a=n.nextSibling;return i.addEventListener("change",()=>{w(!C())}),d(r,()=>g("makeMediaPropertiesDialog.link"),null),d(r,c(t,{get when(){return C()},get children(){var e=Vd();return e.addEventListener("change",e=>{E(e.currentTarget.value)}),u(()=>e.value=T()),e}}),null),d(a,c(t,{get when(){return!C()},get children(){var e=Hd(),t=e.firstChild;return t.addEventListener("change",()=>{S(!x())}),d(e,()=>g("makeMediaPropertiesDialog.enableZoom"),null),u(()=>t.checked=x()),e}})),u(()=>i.checked=C()),e})(),(()=>{var e=zd();return d(e,()=>g("makeMediaPropertiesDialog.mediaProperties")),e})(),(()=>{var e=Wd(),t=e.firstChild,n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=t.nextSibling.firstChild,s=a.firstChild,l=a.nextSibling;return d(n,()=>g("makeMediaPropertiesDialog.caption"),r),d(i,(()=>{var e=f(()=>!!D());return()=>e()?D()?.source.attachedData?.[o()]?.caption??"-":c(Gu,{})})()),d(a,()=>g("makeMediaPropertiesDialog.pixelRatio"),s),d(l,(()=>{var e=f(()=>!!D());return()=>e()?f(()=>!!D()?.source.pixelRatio)()?`${D()?.source.pixelRatio}×`:g("auto"):c(Gu,{})})()),e})()],footer:j});return await M.open()}l(["click"]);var Jd=m("<label class=ObfuscatorDialog-label><input type=text class=PaMl2>"),Yd=m('<label class="ObfuscatorDialog-label PaMt4"><input type=checkbox name=asALink class=PaMr2>'),Xd=m('<button class="QpBtn danger outlined"type=button>'),Zd=m("<button class=QpBtn type=button>");async function Qd({service:e,language:t,value:n}){let{t:r}=td(t),[i,o]=a(n.asALink),[s,c]=a(n.content),l=e=>{c(e),_d(e)?o(!0):o(!1)},f=e.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var e=Jd(),t=e.firstChild;return d(e,()=>r("openObfuscatorDialog.content"),t),t.$$input=e=>l(e.currentTarget.value),u(()=>t.value=s()),e})(),(()=>{var e=Yd(),t=e.firstChild;return t.addEventListener("change",()=>o(!i())),d(e,()=>r("openObfuscatorDialog.asALink"),null),u(()=>t.checked=i()),e})()],footer:[(()=>{var e=Xd();return e.$$click=()=>f.close({action:"remove"}),d(e,()=>r("openObfuscatorDialog.doNotObfuscate")),e})(),(()=>{var e=Zd();return e.$$click=()=>f.close({action:"update",content:s(),asALink:i()?vd(s())?"mailto":"tel":"raw"}),d(e,()=>r("done")),e})()]});return await f.open()}l(["input","click"]);var $d=m('<button class="QpBtn outlined danger"type=button>'),ef=m('<button class="QpBtn secondary"type=button>'),tf=m("<button class=QpBtn type=button>");async function nf({service:e,language:t,mode:n,value:r,videoPluginHook:i}){if(!i)return;let{t:o}=td(t),[s,c]=a(r),{dispose:l,element:u}=i.createComponent(r??{videoId:"",platform:"youtube"},{onChange(e){c(e)},getLanguage:t}),f=e.createModalDialog({content:u,footer:[(()=>{var e=$d();return e.$$click=()=>{f.close({action:"remove"}),l()},d(e,()=>o("remove")),e})(),(()=>{var e=ef();return e.$$click=()=>{f.close(),l()},d(e,()=>o("cancel")),e})(),(()=>{var e=tf();return e.$$click=()=>{let e=s();e===null?f.close({action:"remove"}):f.close({action:n,value:e}),l()},d(e,()=>o("validate")),e})()],header:o("videoPlugin.dialog.title")});return await f.open()}l(["click"]);async function rf({editor:e,htmlSnippetBtn:t,service:n,language:r}){let i=t.dataset.html,a=await Pd({service:n,html:i,mode:"update",language:r});a&&mf({editor:e,element:t,data:a,insertElementHandler:id,service:n,language:r})}async function af({editor:e,internalLinkElement:t,language:n,internalLinkPluginHook:r}){let i=t.dataset.documentId,a=await Id({language:n,value:i,internalLinkPluginHook:r});if(!a)return;let o=Q.find(t);if(!o||o instanceof Q)throw Error("missing link blot");if(a.action==="update"){if(!a.value)return;let t=e.getIndex(o);o.deleteAt(0,o.length()),ad({values:a.value,editor:e,index:t})}else a.action==="remove"&&o.deleteAt(0,o.length())}async function of({editor:e,videoElement:t,language:n,service:r,videoPluginHook:i}){let a=t.dataset.videoId,o=t.dataset.platform??"youtube",s=await nf({service:r,language:n,mode:"update",value:a?{videoId:a,platform:o}:void 0,videoPluginHook:i});s&&mf({editor:e,element:t,data:{action:s.action,values:s.value},insertElementHandler:od,service:r,language:n})}async function sf({obfuscatorSpan:e,service:t,language:n,editor:r}){let i=e.innerText,a=e.dataset.asALink?xd(e.dataset.asALink):void 0,o=await Qd({service:t,language:n,value:{content:i,asALink:a?a!=="raw":!1}});if(!o)return;let s=Q.find(e);if(!s||s instanceof Q)throw Error("missing embed blot");let c=r.getIndex(s);o.action==="remove"&&(s.remove(),r.insertText(c,i)),o.action==="update"&&(s.remove(),r.insertText(c,o.content??"",{obfuscate:o.asALink??"raw"}))}async function cf({service:e,language:t,element:n,editor:r}){let i=sd(n),{align:a,resizeRule:o}=cd(n);if(!i||!o)return;let s={source:void 0},c={mediaId:i,resizeRule:o,align:a,zoomable:n.dataset.zoomable==="1",href:n.dataset.href},l=await qd({service:e,language:t,initialValues:c,fetchedOutput:s});if(!l){if(!s.source||!n.dataset.source)return;let e=JSON.parse(n.dataset.source);if(e.pixelRatio===s.source.pixelRatio&&e.attachedData?.[t()]?.caption===s.source.attachedData?.[t()]?.caption)return;l={action:"update",values:c}}mf({service:e,language:t,editor:r,element:n,data:l,insertElementHandler:rd})}function lf({quillEditor:e,service:t,language:n,videoPluginHook:r,internalLinkPluginHook:i}){let{themeConf:a}=t;return{insertHtmlSnippetHandler:async()=>{e&&await df({service:t,editorContent:Ku(e),quillEditor:e,language:n})},insertMedia:async r=>{if(!e)return;if(r.kind==="file"){nd(e,{label:r.originalName,url:r.url});return}let i=a.fTextImageResizeRules[0];rd({service:t,editor:e,values:{mediaId:r.mediaId,resizeRule:i,align:"center",zoomable:!0},language:n})},insertObfuscateBlotHandler:async()=>{if(e)try{let r=e.getSelection();if(!r||r.length===0)return;await uf({service:t,userSelection:r,quillEditor:e,language:n})}catch(e){t.logger.error("Failed to insert obfuscate:",e)}},insertVideoHandler:async()=>{e&&await ff({editorContent:Ku(e),quillEditor:e,service:t,language:n,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!e)return;let t=qu(e);t!==void 0&&await pf({quillEditor:e,language:n,internalLinkPluginHook:i,index:t})}}}async function uf({service:e,userSelection:t,quillEditor:n,language:r}){let i=n.getText(t.index,t.length),a=bd(i);n.formatText(t,"obfuscate",a);let o=n.root.querySelectorAll("span.ObfuscateBlot");if(o.length===0)throw Error("missing element 'span' with class 'ObfuscateBlot'");for(let t of o)if(t.innerText===i){await sf({obfuscatorSpan:t,service:e,language:r,editor:n});break}}async function df({service:e,editorContent:t,quillEditor:n,language:r}){let i=await Pd({service:e,language:r,mode:"insert"});i&&mf({editor:n,element:t,data:i,insertElementHandler:id,service:e,language:r})}async function ff({service:e,editorContent:t,quillEditor:n,language:r,videoPluginHook:i,value:a}){let o=await nf({service:e,language:r,mode:a?"update":"insert",value:a,videoPluginHook:i});!o||o.action==="remove"||mf({editor:n,element:t,data:{action:o.action,values:o.value},insertElementHandler:od,service:e,language:r})}async function pf({quillEditor:e,language:t,internalLinkPluginHook:n,value:r,index:i}){let a=await Id({language:t,value:r,internalLinkPluginHook:n});!a||a.action==="remove"||!a.value||ad({editor:e,values:a.value,index:i})}function mf({service:e,editor:t,element:n,data:{values:r,action:i,updateOptions:a},insertElementHandler:o,language:s}){let c=Q.find(n);if(!c||c instanceof Q)throw Error("missing embed blot");let l=t.getIndex(c),u=new q.default;if(!(l===void 0||l===-1)){if(i==="insert"){if(!r)return;o({editor:t,values:r,service:e,index:l,language:s})}else if(i==="update"){if(!r)return;o({editor:t,values:r,service:e,index:l,language:s}),u.retain(l+1),u.delete(a?.textToReplaceLength??1)}else i==="remove"&&(u.retain(l),u.delete(1));t.updateContents(u)}}function hf(){let e={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return e.videoPlugin},get internalLinkPlugin(){return e.internalLinkPlugin},service:{registerVideoPlugin(t){if(e.videoPlugin)throw Error("Video plugin already registered");e.videoPlugin=t},registerInternalLinkPlugin(t){if(e.internalLinkPlugin)throw Error("Internal link plugin already registered");e.internalLinkPlugin=t}}}}var $=w(x((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i==="object"||i==="function")&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o="</span>",s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`},l=class{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(e=>typeof e=="string")?t.children=[t.children.join("")]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e=="string"?e:e.source:null}function m(e){return _("(?=",e,")")}function h(e){return _("(?:",e,")*")}function g(e){return _("(?:",e,")?")}function _(...e){return e.map(e=>p(e)).join("")}function v(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return"("+(v(e).capture?"":"?:")+e.map(e=>p(e)).join("|")+")"}function b(e){return RegExp(e.toString()+"|").exec("").length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i="";for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]==="\\"&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],e[0]==="("&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",D="\\b\\d+(\\.\\d+)?",O="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",A="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ee=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:"\\\\[\\s\\S]",relevance:0},M={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[j]},N={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[j]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},P=function(e,t,n={}){let r=a({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ne=P("//","$"),re=P("/\\*","\\*/"),F=P("#","$"),ie={scope:"number",begin:D,relevance:0},I={scope:"number",begin:O,relevance:0},ae={scope:"number",begin:k,relevance:0},oe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},L={scope:"title",begin:T,relevance:0},se={scope:"title",begin:E,relevance:0},ce={begin:"\\.\\s*"+E,relevance:0},le=Object.freeze({__proto__:null,APOS_STRING_MODE:M,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:k,COMMENT:P,C_BLOCK_COMMENT_MODE:re,C_LINE_COMMENT_MODE:ne,C_NUMBER_MODE:I,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:ce,NUMBER_MODE:ie,NUMBER_RE:D,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:N,REGEXP_MODE:oe,RE_STARTERS_RE:A,SHEBANG:ee,TITLE_MODE:L,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:se});function ue(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function de(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function fe(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ue,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function pe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function me(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function he(e,t){e.relevance===void 0&&(e.relevance=1)}var ge=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},_e=["of","and","for","in","not","or","if","then","parent","list","value"],ve="keyword";function ye(e,t,n=ve){let r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ye(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split("|");r[n[0]]=[e,be(n[0],n[1])]})}}function be(e,t){return t?Number(t):xe(e)?0:1}function xe(e){return _e.includes(e.toLowerCase())}var Se={},Ce=e=>{console.error(e)},we=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Te=(e,t)=>{Se[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Se[`${e}/${t}`]=!0)},Ee=Error();function De(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function R(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ce("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ee;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ce("beginScope must be object"),Ee;De(e,e.begin,{key:"beginScope"}),e.begin=C(e.begin,{joinWith:""})}}function Oe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ce("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ee;if(typeof e.endScope!="object"||e.endScope===null)throw Ce("endScope must be object"),Ee;De(e,e.end,{key:"endScope"}),e.end=C(e.end,{joinWith:""})}}function ke(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ae(e){ke(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),R(e),Oe(e)}function je(e){function t(t,n){return new RegExp(p(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type==="begin"&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[de,me,Ae,ge].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[fe,pe,he].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords=="object"&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ye(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||"",n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?"|":"")+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ne(e==="self"?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Me(e){return e?e.endsWithParent||Me(e.starts):!1}function Ne(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Me(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Pe="11.11.1",Fe=class extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}},Ie=i,Le=a,Re=Symbol("nomatch"),ze=7,Be=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=l.languageDetectRe.exec(t);if(n){let t=M(n[1]);return t||(we(s.replace("{}",n[1])),we("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||M(e))}function p(e,t,n){let r="",i="";typeof t=="object"?(r=e,n=t.ignoreIllegals,i=t.language):(Te("10.7.0","highlight(lang, code, ...args) has been deprecated."),Te("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};F("before:highlight",a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,F("after:highlight",o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){j.addText(N);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(j.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=ze&&(te+=a),e.startsWith("_"))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(N)}n+=N.substring(e),j.addText(n)}function f(){if(N==="")return;let e=null;if(typeof A.subLanguage=="string"){if(!t[A.subLanguage]){j.addText(N);return}e=v(A.subLanguage,N,!0,ee[A.subLanguage]),ee[A.subLanguage]=e._top}else e=S(N,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(te+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),N=""}function m(e,t){e!==""&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(N=i,d(),N=""),n++}}function g(e,t){return e.scope&&typeof e.scope=="string"&&j.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(N,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=""):e.beginScope._multi&&(h(e.beginScope,t),N="")),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e["on:end"]){let n=new r(e);e["on:end"](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(N+=e[0],1):(re=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n["on:begin"]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),!n.returnBegin&&!n.excludeBegin&&(N=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Re;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do{A.scope&&j.closeNode(),!A.skip&&!A.subLanguage&&(te+=A.relevance),A=A.parent}while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(N+=t,a==null)return p(),0;if(T.type==="begin"&&r.type==="end"&&T.index===r.index&&a===""){if(N+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type==="begin")return b(r);if(r.type==="illegal"&&!i){let e=Error('Illegal lexeme "'+a+'" for mode "'+(A.scope||"<unnamed>")+'"');throw e.mode=A,e}else if(r.type==="end"){let e=C(r);if(e!==Re)return e}if(r.type==="illegal"&&a==="")return N+="\n",1;if(ne>1e5&&ne>r.index*3)throw Error("potential infinite loop, way more iterations than matches");return N+=a,a.length}let D=M(e);if(!D)throw Ce(s.replace("{}",e)),Error('Unknown language: "'+e+'"');let O=je(D),k="",A=a||O,ee={},j=new l.__emitter(l);w();let N="",te=0,P=0,ne=0,re=!1;try{if(D.__emitTokens)D.__emitTokens(n,j);else{for(A.matcher.considerAll();;){ne++,re?re=!1:A.matcher.considerAll(),A.matcher.lastIndex=P;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(P,e.index),e);P=e.index+t}E(n.substring(P))}return j.finalize(),k=j.toHTML(),{language:e,value:k,relevance:te,illegal:!1,_emitter:j,_top:A}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:Ie(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:P,context:n.slice(P-100,P+100),mode:t.mode,resultSoFar:k},_emitter:j};if(o)return{language:e,value:Ie(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:A};throw t}}function b(e){let t={value:Ie(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(M).filter(te).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(M(e.language).supersetOf===t.language)return 1;if(M(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add("hljs"),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(F("before:highlightElement",{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),l.throwUnescapedHTML))throw new Fe("One of your code blocks includes unescaped HTML.",e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted="yes",C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),F("after:highlightElement",{el:e,result:i,text:r})}function T(e){l=Le(l,e)}let E=()=>{k(),Te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){k(),Te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function k(){function e(){k()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(Ce("Language definition for '{}' could not be registered.".replace("{}",n)),o)Ce(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})}function ee(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function M(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function N(e,{languageName:t}){typeof e=="string"&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function te(e){let t=M(e);return t&&!t.disableAutodetect}function P(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}function ne(e){P(e),a.push(e)}function re(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function F(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ie(e){return Te("10.7.0","highlightBlock will be removed entirely in v12.0"),Te("10.7.0","Please use highlightElement now."),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ie,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:ee,listLanguages:j,getLanguage:M,registerAliases:N,autoDetection:te,inherit:Le,addPlugin:ne,removePlugin:re}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Pe,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in le)typeof le[e]=="object"&&n(le[e]);return Object.assign(e,le),e},Ve=Be({});Ve.newInstance=()=>Be({}),t.exports=Ve,Ve.HighlightJS=Ve,Ve.default=Ve})()).default;function gf(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],h=["true","false"],g={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],y="autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp".split("."),b="chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes".split(".");return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,"set","shopt",...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function _f(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f={keyword:"asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma".split("."),type:"float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary".split("."),literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat(["self"]),relevance:0}]),relevance:0},h={begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:f,disableAutodetect:!0,illegal:"</",contains:[].concat(m,h,p,[l,{begin:e.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:s,keywords:f}}}function vf(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f="alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq".split("."),p=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],m="any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view".split("."),h="abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf".split("."),g={type:p,keyword:f,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:m},_={className:"function.dispatch",relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},v=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:v.concat([{begin:/\(/,end:/\)/,keywords:g,contains:v.concat(["self"]),relevance:0}]),relevance:0},b={className:"function",begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:g,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(y,b,_,v,[l,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:g,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yf(e){let t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r={keyword:"abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while".split(".").concat("add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield".split(".")),built_in:t,literal:["default","false","null","true"]},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},o={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},c=e.inherit(s,{illegal:/\n/}),l={className:"subst",begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:"<",end:">",contains:[{beginKeywords:"in out"},i]},g=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:r,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},m,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+g+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var bf=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),xf="a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video".split("."),Sf="defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath".split("."),Cf=[...xf,...Sf],wf="any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height".split(".").sort().reverse(),Tf="active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where".split(".").sort().reverse(),Ef=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Df="accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom".split(".").sort().reverse();function Of(e){let t=e.regex,n=bf(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Tf.join("|")+")"},{begin:":(:)?("+Ef.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Df.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:wf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Cf.join("|")+")\\b"}]}}var kf="[0-9](_*[0-9])*",Af=`\\.(${kf})`,jf="[0-9a-fA-F](_*[0-9a-fA-F])*",Mf={className:"number",variants:[{begin:`(\\b(${kf})((${Af})|\\.)?|(${Af}))[eE][+-]?(${kf})[fFdD]?\\b`},{begin:`\\b(${kf})((${Af})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Af})[fFdD]?\\b`},{begin:`\\b(${kf})[fFdD]\\b`},{begin:`\\b0[xX]((${jf})\\.?|(${jf})?\\.(${jf}))[pP][+-]?(${kf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${jf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Nf(e,t,n){return n===-1?"":e.replace(t,r=>Nf(e,t,n-1))}function Pf(e){let t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Nf("(?:<"+n+"~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?",/~~~/g,2),i={keyword:"synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when".split("."),literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},a={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},o={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Mf,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Mf,a]}}var Ff="[A-Za-z$_][0-9A-Za-z$_]*",If="as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using".split("."),Lf=["true","false","null","undefined","NaN","Infinity"],Rf="Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly".split("."),zf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Bf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Vf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Hf=[].concat(Bf,Rf,zf);function Uf(e){let t=e.regex,n=(e,{after:t})=>{let n="</"+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Ff,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i==="<"||i===","){t.ignoreMatch();return}i===">"&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Ff,keyword:If,literal:Lf,built_in:Hf,"variable.language":Vf},c="[0-9](_?[0-9])*",l=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Rf,...zf]}},w={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(e){return t.concat("(?!",e.join("|"),")")}let O={match:t.concat(/\b/,D([...Bf,"super","import"].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},ee="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:ee,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Wf(e){let t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Gf(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,a,c,l,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,r,s,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Kf(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p="[ \t\n]",m={scope:"string",variants:[u,l,d,f]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],_="__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield".split("."),v="Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass".split("."),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",b(v).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},S=t.concat(r,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},w={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",b(_).join("\\b|"),"|",b(v).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...D]},...D,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,h]}}function qf(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Jf(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r="and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield".split("."),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:"__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip".split("."),literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},a={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l="[0-9](_?[0-9])*",u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join("|")}`,f={className:"number",relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Yf(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a=["include","extend","prepend","public","private","protected","raise","throw"],o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...a],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},f="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},h={match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},g={variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v={match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},y=[d,g,h,{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},_,{relevance:0,match:r,scope:"title.class"},v,{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,l),relevance:0}].concat(c,l);u.contains=y,m.contains=y;let b=[{begin:/^\s*=>/,starts:{end:"$",contains:y}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:o,contains:y}}];return l.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(b,l,y)}}function Xf(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s="abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield".split("."),c=["true","false","Some","None","Ok","Err"],l="drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!".split("."),u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:s,literal:c,built_in:l},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:l,type:u}},{className:"punctuation",begin:"->"},a]}}function Zf(e){let t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],s="bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary".split("."),c=["add","asc","collation","desc","final","first","last","view"],l="abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year".split("."),u="abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket".split("."),d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},g={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}let y={scope:"keyword",match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:"type",match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var Qf="[A-Za-z$_][0-9A-Za-z$_]*",$f="as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using".split("."),ep=["true","false","null","undefined","NaN","Infinity"],tp="Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly".split("."),np=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ip=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ap=[].concat(rp,tp,np);function op(e){let t=e.regex,n=(e,{after:t})=>{let n="</"+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Qf,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i==="<"||i===","){t.ignoreMatch();return}i===">"&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Qf,keyword:$f,literal:ep,built_in:ap,"variable.language":ip},c="[0-9](_?[0-9])*",l=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tp,...np]}},w={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(e){return t.concat("(?!",e.join("|"),")")}let O={match:t.concat(/\b/,D([...rp,"super","import"].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},ee="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:ee,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function sp(e){let t=e.regex,n=op(e),r=Qf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:Qf,keyword:$f.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:ep,built_in:ap.concat(i),"variable.language":ip},l={className:"meta",begin:"@"+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope==="attr"),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,"shebang",e.SHEBANG()),u(n,"use_strict",s);let p=n.contains.find(e=>e.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function cp(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function lp(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},l={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:"\\n",relevance:0},d={begin:"\\[",end:"\\]",contains:[l],illegal:"\\n",relevance:0},f=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:f}}$.registerLanguage("bash",gf),$.registerLanguage("c",_f),$.registerLanguage("cpp",vf),$.registerLanguage("cs",yf),$.registerLanguage("css",Of),$.registerLanguage("java",Pf),$.registerLanguage("javascript",Uf),$.registerLanguage("json",Wf),$.registerLanguage("markdown",Gf),$.registerLanguage("plain",qf),$.registerLanguage("php",Kf),$.registerLanguage("python",Jf),$.registerLanguage("sql",Zf),$.registerLanguage("typescript",sp),$.registerLanguage("ruby",Yf),$.registerLanguage("rust",Xf),$.registerLanguage("xml",cp),$.registerLanguage("yaml",lp);var up=[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"c",label:"C"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"json",label:"JSON"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"sql",label:"SQL"},{key:"typescript",label:"TypeScript"},{key:"ruby",label:"Ruby"},{key:"rust",label:"Rust"},{key:"xml",label:"HTML/XML"},{key:"yaml",label:"YAML"}],dp='\x3c!-- @license lucide-static v0.562.0 - ISC --\x3e\n<svg\n class="lucide lucide-hash"\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n>\n <line x1="4" x2="20" y1="9" y2="9" />\n <line x1="4" x2="20" y1="15" y2="15" />\n <line x1="10" x2="8" y1="3" y2="21" />\n <line x1="16" x2="14" y1="3" y2="21" />\n</svg>\n',fp='\x3c!-- @license lucide-static v0.562.0 - ISC --\x3e\n<svg\n class="lucide lucide-pencil"\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n>\n <path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />\n <path d="m15 5 4 4" />\n</svg>\n',pp=m("<button type=button><span class=QpTooltip-text>");function mp({children:e,btnClass:t,tooltipText:n,btnText:r}){return(()=>{var i=pp(),a=i.firstChild;return s(i,`QpTooltip ${t}`),d(i,e,a),d(i,r,a),d(a,n),i})()}var hp=m("<button type=button class=ql-code>"),gp=m("<button type=button class=ql-code-block>"),_p=m("<span>"),vp=m("<div><select class=ql-header><option value=2></option><option value=3></option><option value=4></option><option value selected></option></select><button type=button class=ql-bold></button><button type=button class=ql-italic></button><button type=button class=ql-strike></button><button type=button class=ql-blockquote></button><button type=button class=ql-list value=ordered></button><button type=button class=ql-list value=bullet></button><button type=button class=ql-link></button><select class=ql-align><option value selected></option><option value=center></option><option value=right></option></select><select class=ql-size><option value=small></option><option value selected></option><option value=large></option><option value=huge></option></select><button type=button class=ql-clean>");function yp({language:e,configuration:t,videoPluginHook:n,internalLinkPluginHook:r}){let{t:i}=td(e),a=[hp(),gp()];return(()=>{var e=vp(),o=e.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,s=o.nextSibling.nextSibling;return d(e,()=>t?.code&&a,o),d(e,c(mp,{btnClass:"ql-html-snippet",get tooltipText(){return i("CustomToolbar.insertHtmlSnippetMessage")},get children(){var e=_p();return e.innerHTML=dp,e}}),s),d(e,c(mp,{btnClass:"ql-obfuscate",get tooltipText(){return i("CustomToolbar.obfuscate")},get children(){var e=_p();return e.innerHTML=fp,e}}),s),d(e,n&&c(mp,{btnClass:"ql-platform-video",get tooltipText(){return i("videoPlugin.insertVideo")},get children(){var e=_p();return e.innerHTML='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>',e}}),s),d(e,r&&c(mp,{btnClass:"ql-internal-link",get tooltipText(){return i("internalLinkPlugin.insertLink")},get children(){var e=_p();return e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',e}}),s),e})()}var bp=m("<div>"),xp=m("<div class=QuillEditor>");function Sp({language:e,setValue:t,value:n,service:r,insertMedia:i,videoPluginHook:a,internalLinkPluginHook:o}){let{t:s}=td(e),c=r.configuration,l=r.fieldType.adminUi?.editorRows??26,u=yp({language:e,configuration:c,videoPluginHook:a,internalLinkPluginHook:o}),f=!1,m=(()=>{var e=bp();return p(e,"height",`calc(${l}rem + 24px)`),e})();async function h(e,t){if(!r.uploadMedia)return;let n=t.toBlob(),a=new File([n],`${s("image")}-${Date.now()}.${e.split("/")[1]}`,{type:e}),o=await r.uploadMedia(a);o&&await i(o)}let g=new Q(m,{modules:{toolbar:u,syntax:c.code?{hljs:$,languages:up,interval:1e3}:!1,imageDropAndPaste:{handler:(e,t,n)=>{h(t,n).catch(r.logger.error)}}},theme:"snow"});g.on("text-change",(n,i,o)=>{f&&(n.ops.forEach(async t=>{if(t.insert&&typeof t.insert=="string"){let n=t.insert,i=a?.recognizeUrl(n);if(!i)return;await ff({editorContent:Ku(g),quillEditor:g,service:r,language:e,videoPluginHook:a,value:i})}}),t({delta:g.getContents(),html:g.getSemanticHTML()}.delta))});let _=n();return g.setContents(_??new q.default),g.history.clear(),f=!0,{element:(()=>{var e=xp();return d(e,u,null),d(e,m,null),e})(),quill:g}}var Cp={create:Ep,init:Tp},wp=hf();function Tp(e){let t=`${e.pluginBaseUrl}/admin-ui-plugin.css`,n=document.createElement("link");n.rel="stylesheet",n.href=t,document.head.appendChild(n),e.registerHook("htmlEditorServiceProvider",()=>wp.service)}function Ep(e){let{fieldType:t}=e;if(t.dataType!=="json")throw Error(`field type '${t.name}' is incompatible with Quill plugin, needs data type 'json'`);if(e.initialValue!==void 0&&!T(e.initialValue))throw Error(`field type '${t.name}' is incompatible, should be a json, got '${typeof e.initialValue}'`);let n=Op(e.initialValue);return i(t=>{let[r,i]=a(n),[s,c]=a(e.language);Dd({service:e,videoPluginHook:wp.videoPlugin,internalLinkPluginHook:wp.internalLinkPlugin});let l,{element:u,quill:d}=Sp({language:s,value:r,setValue:t=>{let n=r();i(t),Dp(t,n)||e.setModifiedValue({j:t})},service:e,videoPluginHook:wp.videoPlugin,internalLinkPluginHook:wp.internalLinkPlugin,insertMedia:async e=>await(l?.(e))}),f=lf({quillEditor:d,service:e,language:s,videoPluginHook:wp.videoPlugin,internalLinkPluginHook:wp.internalLinkPlugin});l=f.insertMedia;let p=d.getModule("toolbar");p.addHandler("html-snippet",f.insertHtmlSnippetHandler),p.addHandler("obfuscate",f.insertObfuscateBlotHandler),p.addHandler("platform-video",f.insertVideoHandler),p.addHandler("internal-link",f.insertInternalLinkHandler);let m=d.root,h=e=>g(e,d);m.addEventListener("click",h),o(()=>m.removeEventListener("click",h));let g=async(t,n)=>{let r=t.target;r.tagName==="FIGURE"&&r.classList.contains("MediaBlot")&&await cf({service:e,editor:n,element:r,language:s}),r.tagName==="BUTTON"&&r.classList.contains("HtmlSnippet")&&await rf({language:s,editor:n,service:e,htmlSnippetBtn:r}),r.tagName==="SPAN"&&r.classList.contains("ObfuscateBlot")&&await sf({language:s,editor:n,service:e,obfuscatorSpan:r}),r.tagName==="DIV"&&r.classList.contains("PlatformVideo")&&await of({editor:n,videoElement:r,language:s,service:e,videoPluginHook:wp.videoPlugin}),r.tagName==="SPAN"&&r.classList.contains("InternalLinkPlugin")&&await af({editor:n,internalLinkElement:r,language:s,internalLinkPluginHook:wp.internalLinkPlugin})};return{element:u,setValue:e=>i(Op(e)),setLanguage:c,getValue:()=>({j:r}),dispose:t,insertMedia:e=>l?.(e)}})}function Dp(e,t){return!e||!t?e===t:JSON.stringify(e)===JSON.stringify(t)}function Op(e){if(e!==void 0)return T(e)&&typeof e.j=="object"&&e.j!==null?e.j:void 0}export{Cp as default};
1
+ import{For as e,Show as t,createEffect as n,createMemo as r,createRoot as i,createSignal as a,onCleanup as o}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.12/+esm";import{className as s,createComponent as c,delegateEvents as l,effect as u,insert as d,memo as f,setStyleProperty as p,template as m}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.12/web/+esm";var h=Object.create,g=Object.defineProperty,_=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,y=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,x=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),S=(e,t)=>{let n={};for(var r in e)g(n,r,{get:e[r],enumerable:!0});return t||g(n,Symbol.toStringTag,{value:"Module"}),n},C=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=v(t),a=0,o=i.length,s;a<o;a++)s=i[a],!b.call(e,s)&&s!==n&&g(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=_(t,s))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:h(y(e)),C(t||!e||!e.__esModule?g(n,"default",{value:e,enumerable:!0}):n,e));function T(e){return typeof e=="object"&&!!e&&"j"in e}function E(e){return/^[0-9]+x|x[0-9]+|x[0-9]+x|[0-9]+x[0-9]+$/.test(e)}var D=typeof global=="object"&&global&&global.Object===Object&&global,O=typeof self=="object"&&self&&self.Object===Object&&self,k=D||O||Function("return this")(),A=k.Symbol,ee=Object.prototype,j=ee.hasOwnProperty,M=ee.toString,N=A?A.toStringTag:void 0;function te(e){var t=j.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch{}var i=M.call(e);return r&&(t?e[N]=n:delete e[N]),i}var P=Object.prototype.toString;function ne(e){return P.call(e)}var re="[object Null]",F="[object Undefined]",ie=A?A.toStringTag:void 0;function I(e){return e==null?e===void 0?F:re:ie&&ie in Object(e)?te(e):ne(e)}function ae(e){return typeof e=="object"&&!!e}var oe=Array.isArray;function L(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function se(e){return e}var ce="[object AsyncFunction]",le="[object Function]",ue="[object GeneratorFunction]",de="[object Proxy]";function fe(e){if(!L(e))return!1;var t=I(e);return t==le||t==ue||t==ce||t==de}var pe=k["__core-js_shared__"],me=function(){var e=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function he(e){return!!me&&me in e}var ge=Function.prototype.toString;function _e(e){if(e!=null){try{return ge.call(e)}catch{}try{return e+""}catch{}}return""}var ve=/[\\^$.*+?()[\]{}|]/g,ye=/^\[object .+?Constructor\]$/,be=Function.prototype,xe=Object.prototype,Se=be.toString,Ce=xe.hasOwnProperty,we=RegExp("^"+Se.call(Ce).replace(ve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Te(e){return!L(e)||he(e)?!1:(fe(e)?we:ye).test(_e(e))}function Ee(e,t){return e?.[t]}function De(e,t){var n=Ee(e,t);return Te(n)?n:void 0}var R=De(k,"WeakMap"),Oe=Object.create,ke=function(){function e(){}return function(t){if(!L(t))return{};if(Oe)return Oe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Ae(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function je(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Me=800,Ne=16,Pe=Date.now;function Fe(e){var t=0,n=0;return function(){var r=Pe(),i=Ne-(r-n);if(n=r,i>0){if(++t>=Me)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ie(e){return function(){return e}}var Le=function(){try{var e=De(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Re=Fe(Le?function(e,t){return Le(e,"toString",{configurable:!0,enumerable:!1,value:Ie(t),writable:!0})}:se);function ze(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Be=9007199254740991,Ve=/^(?:0|[1-9]\d*)$/;function He(e,t){var n=typeof e;return t??=Be,!!t&&(n=="number"||n!="symbol"&&Ve.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e,t,n){t=="__proto__"&&Le?Le(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function We(e,t){return e===t||e!==e&&t!==t}var Ge=Object.prototype.hasOwnProperty;function Ke(e,t,n){var r=e[t];(!(Ge.call(e,t)&&We(r,n))||n===void 0&&!(t in e))&&Ue(e,t,n)}function qe(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Ue(n,s,c):Ke(n,s,c)}return n}var Je=Math.max;function Ye(e,t,n){return t=Je(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Je(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Ae(e,this,s)}}function Xe(e,t){return Re(Ye(e,t,se),e+"")}var Ze=9007199254740991;function Qe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ze}function z(e){return e!=null&&Qe(e.length)&&!fe(e)}function $e(e,t,n){if(!L(n))return!1;var r=typeof t;return(r=="number"?z(n)&&He(t,n.length):r=="string"&&t in n)?We(n[t],e):!1}function et(e){return Xe(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&$e(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var tt=Object.prototype;function nt(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||tt)}function rt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var B="[object Arguments]";function it(e){return ae(e)&&I(e)==B}var at=Object.prototype,ot=at.hasOwnProperty,st=at.propertyIsEnumerable,ct=it(function(){return arguments}())?it:function(e){return ae(e)&&ot.call(e,"callee")&&!st.call(e,"callee")};function V(){return!1}var lt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ut=lt&&typeof module=="object"&&module&&!module.nodeType&&module,dt=ut&&ut.exports===lt?k.Buffer:void 0,ft=(dt?dt.isBuffer:void 0)||V,pt="[object Arguments]",mt="[object Array]",ht="[object Boolean]",gt="[object Date]",_t="[object Error]",vt="[object Function]",yt="[object Map]",bt="[object Number]",xt="[object Object]",St="[object RegExp]",Ct="[object Set]",wt="[object String]",Tt="[object WeakMap]",Et="[object ArrayBuffer]",Dt="[object DataView]",Ot="[object Float32Array]",kt="[object Float64Array]",At="[object Int8Array]",jt="[object Int16Array]",Mt="[object Int32Array]",Nt="[object Uint8Array]",Pt="[object Uint8ClampedArray]",Ft="[object Uint16Array]",It="[object Uint32Array]",H={};H[Ot]=H[kt]=H[At]=H[jt]=H[Mt]=H[Nt]=H[Pt]=H[Ft]=H[It]=!0,H[pt]=H[mt]=H[Et]=H[ht]=H[Dt]=H[gt]=H[_t]=H[vt]=H[yt]=H[bt]=H[xt]=H[St]=H[Ct]=H[wt]=H[Tt]=!1;function Lt(e){return ae(e)&&Qe(e.length)&&!!H[I(e)]}function Rt(e){return function(t){return e(t)}}var zt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bt=zt&&typeof module=="object"&&module&&!module.nodeType&&module,Vt=Bt&&Bt.exports===zt&&D.process,Ht=function(){try{return Bt&&Bt.require&&Bt.require("util").types||Vt&&Vt.binding&&Vt.binding("util")}catch{}}(),Ut=Ht&&Ht.isTypedArray,Wt=Ut?Rt(Ut):Lt,Gt=Object.prototype.hasOwnProperty;function U(e,t){var n=oe(e),r=!n&&ct(e),i=!n&&!r&&ft(e),a=!n&&!r&&!i&&Wt(e),o=n||r||i||a,s=o?rt(e.length,String):[],c=s.length;for(var l in e)(t||Gt.call(e,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||He(l,c)))&&s.push(l);return s}function Kt(e,t){return function(n){return e(t(n))}}var qt=Kt(Object.keys,Object),Jt=Object.prototype.hasOwnProperty;function Yt(e){if(!nt(e))return qt(e);var t=[];for(var n in Object(e))Jt.call(e,n)&&n!="constructor"&&t.push(n);return t}function Xt(e){return z(e)?U(e):Yt(e)}function Zt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Qt=Object.prototype.hasOwnProperty;function $t(e){if(!L(e))return Zt(e);var t=nt(e),n=[];for(var r in e)r=="constructor"&&(t||!Qt.call(e,r))||n.push(r);return n}function en(e){return z(e)?U(e,!0):$t(e)}var tn=De(Object,"create");function nn(){this.__data__=tn?tn(null):{},this.size=0}function rn(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var an="__lodash_hash_undefined__",on=Object.prototype.hasOwnProperty;function sn(e){var t=this.__data__;if(tn){var n=t[e];return n===an?void 0:n}return on.call(t,e)?t[e]:void 0}var cn=Object.prototype.hasOwnProperty;function ln(e){var t=this.__data__;return tn?t[e]!==void 0:cn.call(t,e)}var un="__lodash_hash_undefined__";function dn(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=tn&&t===void 0?un:t,this}function fn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fn.prototype.clear=nn,fn.prototype.delete=rn,fn.prototype.get=sn,fn.prototype.has=ln,fn.prototype.set=dn;function pn(){this.__data__=[],this.size=0}function mn(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}var hn=Array.prototype.splice;function gn(e){var t=this.__data__,n=mn(t,e);return n<0?!1:(n==t.length-1?t.pop():hn.call(t,n,1),--this.size,!0)}function _n(e){var t=this.__data__,n=mn(t,e);return n<0?void 0:t[n][1]}function vn(e){return mn(this.__data__,e)>-1}function yn(e,t){var n=this.__data__,r=mn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function bn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bn.prototype.clear=pn,bn.prototype.delete=gn,bn.prototype.get=_n,bn.prototype.has=vn,bn.prototype.set=yn;var xn=De(k,"Map");function Sn(){this.size=0,this.__data__={hash:new fn,map:new(xn||bn),string:new fn}}function Cn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function wn(e,t){var n=e.__data__;return Cn(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Tn(e){var t=wn(this,e).delete(e);return this.size-=+!!t,t}function En(e){return wn(this,e).get(e)}function Dn(e){return wn(this,e).has(e)}function On(e,t){var n=wn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function kn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kn.prototype.clear=Sn,kn.prototype.delete=Tn,kn.prototype.get=En,kn.prototype.has=Dn,kn.prototype.set=On;function An(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var jn=Kt(Object.getPrototypeOf,Object),Mn="[object Object]",Nn=Function.prototype,Pn=Object.prototype,Fn=Nn.toString,In=Pn.hasOwnProperty,Ln=Fn.call(Object);function Rn(e){if(!ae(e)||I(e)!=Mn)return!1;var t=jn(e);if(t===null)return!0;var n=In.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Fn.call(n)==Ln}function zn(){this.__data__=new bn,this.size=0}function Bn(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Vn(e){return this.__data__.get(e)}function Hn(e){return this.__data__.has(e)}var Un=200;function Wn(e,t){var n=this.__data__;if(n instanceof bn){var r=n.__data__;if(!xn||r.length<Un-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new kn(r)}return n.set(e,t),this.size=n.size,this}function Gn(e){var t=this.__data__=new bn(e);this.size=t.size}Gn.prototype.clear=zn,Gn.prototype.delete=Bn,Gn.prototype.get=Vn,Gn.prototype.has=Hn,Gn.prototype.set=Wn;function Kn(e,t){return e&&qe(t,Xt(t),e)}function qn(e,t){return e&&qe(t,en(t),e)}var Jn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yn=Jn&&typeof module=="object"&&module&&!module.nodeType&&module,Xn=Yn&&Yn.exports===Jn?k.Buffer:void 0,Zn=Xn?Xn.allocUnsafe:void 0;function Qn(e,t){if(t)return e.slice();var n=e.length,r=Zn?Zn(n):new e.constructor(n);return e.copy(r),r}function $n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function er(){return[]}var tr=Object.prototype.propertyIsEnumerable,nr=Object.getOwnPropertySymbols,rr=nr?function(e){return e==null?[]:(e=Object(e),$n(nr(e),function(t){return tr.call(e,t)}))}:er;function ir(e,t){return qe(e,rr(e),t)}var ar=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)An(t,rr(e)),e=jn(e);return t}:er;function or(e,t){return qe(e,ar(e),t)}function sr(e,t,n){var r=t(e);return oe(e)?r:An(r,n(e))}function cr(e){return sr(e,Xt,rr)}function lr(e){return sr(e,en,ar)}var ur=De(k,"DataView"),dr=De(k,"Promise"),fr=De(k,"Set"),pr="[object Map]",mr="[object Object]",hr="[object Promise]",gr="[object Set]",_r="[object WeakMap]",vr="[object DataView]",yr=_e(ur),br=_e(xn),xr=_e(dr),Sr=_e(fr),Cr=_e(R),wr=I;(ur&&wr(new ur(new ArrayBuffer(1)))!=vr||xn&&wr(new xn)!=pr||dr&&wr(dr.resolve())!=hr||fr&&wr(new fr)!=gr||R&&wr(new R)!=_r)&&(wr=function(e){var t=I(e),n=t==mr?e.constructor:void 0,r=n?_e(n):"";if(r)switch(r){case yr:return vr;case br:return pr;case xr:return hr;case Sr:return gr;case Cr:return _r}return t});var Tr=wr,Er=Object.prototype.hasOwnProperty;function Dr(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Er.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Or=k.Uint8Array;function kr(e){var t=new e.constructor(e.byteLength);return new Or(t).set(new Or(e)),t}function Ar(e,t){var n=t?kr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var jr=/\w*$/;function Mr(e){var t=new e.constructor(e.source,jr.exec(e));return t.lastIndex=e.lastIndex,t}var Nr=A?A.prototype:void 0,Pr=Nr?Nr.valueOf:void 0;function Fr(e){return Pr?Object(Pr.call(e)):{}}function Ir(e,t){var n=t?kr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Lr="[object Boolean]",Rr="[object Date]",zr="[object Map]",Br="[object Number]",Vr="[object RegExp]",Hr="[object Set]",Ur="[object String]",Wr="[object Symbol]",Gr="[object ArrayBuffer]",Kr="[object DataView]",qr="[object Float32Array]",Jr="[object Float64Array]",Yr="[object Int8Array]",Xr="[object Int16Array]",Zr="[object Int32Array]",Qr="[object Uint8Array]",$r="[object Uint8ClampedArray]",ei="[object Uint16Array]",ti="[object Uint32Array]";function ni(e,t,n){var r=e.constructor;switch(t){case Gr:return kr(e);case Lr:case Rr:return new r(+e);case Kr:return Ar(e,n);case qr:case Jr:case Yr:case Xr:case Zr:case Qr:case $r:case ei:case ti:return Ir(e,n);case zr:return new r;case Br:case Ur:return new r(e);case Vr:return Mr(e);case Hr:return new r;case Wr:return Fr(e)}}function ri(e){return typeof e.constructor=="function"&&!nt(e)?ke(jn(e)):{}}var ii="[object Map]";function ai(e){return ae(e)&&Tr(e)==ii}var oi=Ht&&Ht.isMap,si=oi?Rt(oi):ai,ci="[object Set]";function li(e){return ae(e)&&Tr(e)==ci}var ui=Ht&&Ht.isSet,di=ui?Rt(ui):li,fi=1,pi=2,mi=4,hi="[object Arguments]",gi="[object Array]",_i="[object Boolean]",vi="[object Date]",yi="[object Error]",bi="[object Function]",xi="[object GeneratorFunction]",Si="[object Map]",Ci="[object Number]",wi="[object Object]",Ti="[object RegExp]",Ei="[object Set]",Di="[object String]",Oi="[object Symbol]",ki="[object WeakMap]",Ai="[object ArrayBuffer]",ji="[object DataView]",Mi="[object Float32Array]",Ni="[object Float64Array]",Pi="[object Int8Array]",Fi="[object Int16Array]",Ii="[object Int32Array]",Li="[object Uint8Array]",Ri="[object Uint8ClampedArray]",zi="[object Uint16Array]",Bi="[object Uint32Array]",W={};W[hi]=W[gi]=W[Ai]=W[ji]=W[_i]=W[vi]=W[Mi]=W[Ni]=W[Pi]=W[Fi]=W[Ii]=W[Si]=W[Ci]=W[wi]=W[Ti]=W[Ei]=W[Di]=W[Oi]=W[Li]=W[Ri]=W[zi]=W[Bi]=!0,W[yi]=W[bi]=W[ki]=!1;function Vi(e,t,n,r,i,a){var o,s=t&fi,c=t&pi,l=t&mi;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!L(e))return e;var u=oe(e);if(u){if(o=Dr(e),!s)return je(e,o)}else{var d=Tr(e),f=d==bi||d==xi;if(ft(e))return Qn(e,s);if(d==wi||d==hi||f&&!i){if(o=c||f?{}:ri(e),!s)return c?or(e,qn(o,e)):ir(e,Kn(o,e))}else{if(!W[d])return i?e:{};o=ni(e,d,s)}}a||=new Gn;var p=a.get(e);if(p)return p;a.set(e,o),di(e)?e.forEach(function(r){o.add(Vi(r,t,n,r,e,a))}):si(e)&&e.forEach(function(r,i){o.set(i,Vi(r,t,n,i,e,a))});var m=u?void 0:(l?c?lr:cr:c?en:Xt)(e);return ze(m||e,function(r,i){m&&(i=r,r=e[i]),Ke(o,i,Vi(r,t,n,i,e,a))}),o}var Hi=1,Ui=4;function Wi(e){return Vi(e,Hi|Ui)}var Gi="__lodash_hash_undefined__";function Ki(e){return this.__data__.set(e,Gi),this}function qi(e){return this.__data__.has(e)}function Ji(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new kn;++t<n;)this.add(e[t])}Ji.prototype.add=Ji.prototype.push=Ki,Ji.prototype.has=qi;function Yi(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Xi(e,t){return e.has(t)}var Zi=1,Qi=2;function $i(e,t,n,r,i,a){var o=n&Zi,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Qi?new Ji:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Yi(t,function(e,t){if(!Xi(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function ea(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function ta(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var na=1,ra=2,ia="[object Boolean]",aa="[object Date]",oa="[object Error]",sa="[object Map]",ca="[object Number]",la="[object RegExp]",ua="[object Set]",da="[object String]",fa="[object Symbol]",pa="[object ArrayBuffer]",ma="[object DataView]",ha=A?A.prototype:void 0,ga=ha?ha.valueOf:void 0;function _a(e,t,n,r,i,a,o){switch(n){case ma:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case pa:return!(e.byteLength!=t.byteLength||!a(new Or(e),new Or(t)));case ia:case aa:case ca:return We(+e,+t);case oa:return e.name==t.name&&e.message==t.message;case la:case da:return e==t+"";case sa:var s=ea;case ua:var c=r&na;if(s||=ta,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=ra,o.set(e,t);var u=$i(s(e),s(t),r,i,a,o);return o.delete(e),u;case fa:if(ga)return ga.call(e)==ga.call(t)}return!1}var va=1,ya=Object.prototype.hasOwnProperty;function ba(e,t,n,r,i,a){var o=n&va,s=cr(e),c=s.length;if(c!=cr(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:ya.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u=="constructor"}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof y=="function"&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var xa=1,Sa="[object Arguments]",Ca="[object Array]",wa="[object Object]",Ta=Object.prototype.hasOwnProperty;function Ea(e,t,n,r,i,a){var o=oe(e),s=oe(t),c=o?Ca:Tr(e),l=s?Ca:Tr(t);c=c==Sa?wa:c,l=l==Sa?wa:l;var u=c==wa,d=l==wa,f=c==l;if(f&&ft(e)){if(!ft(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Gn,o||Wt(e)?$i(e,t,n,r,i,a):_a(e,t,c,n,r,i,a);if(!(n&xa)){var p=u&&Ta.call(e,"__wrapped__"),m=d&&Ta.call(t,"__wrapped__");if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Gn,i(h,g,n,r,a)}}return f?(a||=new Gn,ba(e,t,n,r,i,a)):!1}function Da(e,t,n,r,i){return e===t?!0:e==null||t==null||!ae(e)&&!ae(t)?e!==e&&t!==t:Ea(e,t,n,r,Da,i)}function Oa(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var ka=Oa();function Aa(e,t,n){(n!==void 0&&!We(e[t],n)||n===void 0&&!(t in e))&&Ue(e,t,n)}function ja(e){return ae(e)&&z(e)}function Ma(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Na(e){return qe(e,en(e))}function Pa(e,t,n,r,i,a,o){var s=Ma(e,n),c=Ma(t,n),l=o.get(c);if(l){Aa(e,n,l);return}var u=a?a(s,c,n+"",e,t,o):void 0,d=u===void 0;if(d){var f=oe(c),p=!f&&ft(c),m=!f&&!p&&Wt(c);u=c,f||p||m?oe(s)?u=s:ja(s)?u=je(s):p?(d=!1,u=Qn(c,!0)):m?(d=!1,u=Ir(c,!0)):u=[]:Rn(c)||ct(c)?(u=s,ct(s)?u=Na(s):(!L(s)||fe(s))&&(u=ri(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Aa(e,n,u)}function Fa(e,t,n,r,i){e!==t&&ka(t,function(a,o){if(i||=new Gn,L(a))Pa(e,t,o,n,Fa,r,i);else{var s=r?r(Ma(e,o),a,o+"",e,t,i):void 0;s===void 0&&(s=a),Aa(e,o,s)}},en)}function Ia(e,t){return Da(e,t)}var La=et(function(e,t,n){Fa(e,t,n)}),Ra=S({Attributor:()=>za,AttributorStore:()=>qa,BlockBlot:()=>ao,ClassAttributor:()=>Wa,ContainerBlot:()=>so,EmbedBlot:()=>co,InlineBlot:()=>ro,LeafBlot:()=>K,ParentBlot:()=>eo,Registry:()=>Ha,Scope:()=>G,ScrollBlot:()=>po,StyleAttributor:()=>Ka,TextBlot:()=>ho}),G=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(G||{}),za=class{constructor(e,t,n={}){this.attrName=e,this.keyName=t;let r=G.TYPE&G.ATTRIBUTE;this.scope=n.scope==null?G.ATTRIBUTE:n.scope&G.LEVEL|r,n.whitelist!=null&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(e=>e.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){let t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}},Ba=class extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}},Va=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){let i=this.query(n);if(i==null)throw new Ba(`Unable to create ${n} blot`);let a=i,o=new a(t,n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),r);return e.blots.set(o.domNode,o),o}find(t,n=!1){return e.find(t,n)}query(e,t=G.ANY){let n;return typeof e=="string"?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:typeof e=="number"?e&G.LEVEL&G.BLOCK?n=this.types.block:e&G.LEVEL&G.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(e=>(n=this.classes[e],!!n)),n||=this.tags[e.tagName]),n==null?null:"scope"in n&&t&G.LEVEL&n.scope&&t&G.TYPE&n.scope?n:null}register(...e){return e.map(e=>{let t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new Ba("Invalid definition");if(t&&e.blotName==="abstract")throw new Ba("Cannot register abstract class");let r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(e=>e.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{(this.tags[t]==null||e.className==null)&&(this.tags[t]=e)}))),e})}};Va.blots=new WeakMap;var Ha=Va;function Ua(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}var Wa=class extends za{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){Ua(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){let t=(Ua(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function Ga(e){let t=e.split("-"),n=t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join("");return t[0]+n}var Ka=class extends za{static keys(e){return(e.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[Ga(this.keyName)]=t,!0):!1}remove(e){e.style[Ga(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){let t=e.style[Ga(this.keyName)];return this.canAdd(e,t)?t:""}},qa=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)==null?delete this.attributes[e.attrName]:this.attributes[e.attrName]=e):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};let e=Ha.find(this.domNode);if(e==null)return;let t=za.keys(this.domNode),n=Wa.keys(this.domNode),r=Ka.keys(this.domNode);t.concat(n).concat(r).forEach(t=>{let n=e.scroll.query(t,G.ATTRIBUTE);n instanceof za&&(this.attributes[n.attrName]=n)})}copy(e){Object.keys(this.attributes).forEach(t=>{let n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}},Ja=class{constructor(e,t){this.scroll=e,this.domNode=t,Ha.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Ba("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?(typeof e=="string"?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof e=="number"&&(n=e),t=typeof n=="number"?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){let e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Ha.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){let i=this.isolate(e,t);if(this.scroll.query(n,G.BLOT)!=null&&r)i.wrap(n,r);else if(this.scroll.query(n,G.ATTRIBUTE)!=null){let e=this.scroll.create(this.statics.scope);i.wrap(e),e.format(n,r)}}insertAt(e,t,n){let r=n==null?this.scroll.create("text",t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(r,i||void 0)}isolate(e,t){let n=this.split(e);if(n==null)throw Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){let n=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){let n=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new Ba(`Cannot wrap ${e}`);return n.appendChild(this),n}};Ja.blotName="abstract";var Ya=Ja,Xa=class extends Ya{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Xa.scope=G.INLINE_BLOT;var K=Xa,Za=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){let t=e.slice(1);this.append(...t)}}at(e){let t=this.iterator(),n=t();for(;n&&e>0;)--e,n=t();return n}contains(e){let t=this.iterator(),n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){let t=this.iterator(),n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t==null?this.tail==null?(e.prev=null,this.head=this.tail=e):(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)),this.length+=1)}offset(e){let t=0,n=this.head;for(;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),--this.length)}iterator(e=this.head){return()=>{let t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){let n=this.iterator(),r=n();for(;r;){let i=r.length();if(e<i||t&&e===i&&(r.next==null||r.next.length()!==0))return[r,e];e-=i,r=n()}return[null,0]}forEach(e){let t=this.iterator(),n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;let[r,i]=this.find(e),a=e-i,o=this.iterator(r),s=o();for(;s&&a<e+t;){let r=s.length();e>a?n(s,e-a,Math.min(t,a+r-e)):n(s,0,Math.min(r,e+t-a)),a+=r,s=o()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){let n=this.iterator(),r=n();for(;r;)t=e(t,r),r=n();return t}};function Qa(e,t){let n=t.find(e);if(n)return n;try{return t.create(e)}catch{let n=t.create(G.INLINE);return Array.from(e.childNodes).forEach(e=>{n.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}var $a=class e extends Ya{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Za,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{let t=Qa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof Ba)return;throw e}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(e,t,n)=>{e.deleteAt(t,n)})}descendant(t,n=0){let[r,i]=this.children.find(n);return t.blotName==null&&t(r)||t.blotName!=null&&r instanceof t?[r,i]:r instanceof e?r.descendant(t,i):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(n,r,o)=>{(t.blotName==null&&t(n)||t.blotName!=null&&n instanceof t)&&i.push(n),n instanceof e&&(i=i.concat(n.descendants(t,r,a))),a-=o}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(n=>{t||this.statics.allowedChildren.some(e=>n instanceof e)||(n.statics.scope===G.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())})}formatAt(e,t,n,r){this.children.forEachAt(e,t,(e,t,i)=>{e.formatAt(t,i,n,r)})}insertAt(e,t,n){let[r,i]=this.children.find(e);if(r)r.insertAt(i,t,n);else{let e=n==null?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){let e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){let[r,i]=this.children.find(t,n),a=[[this,t]];return r instanceof e?a.concat(r.path(i,n)):(r!=null&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(t,n){let r=typeof t=="string"?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}let n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(e,r,i)=>{let a=e.split(r,t);a!=null&&n.appendChild(a)}),n}splitAfter(e){let t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){let n=[],r=[];e.forEach(e=>{e.target===this.domNode&&e.type==="childList"&&(n.push(...e.addedNodes),r.push(...e.removedNodes))}),r.forEach(e=>{if(e.parentNode!=null&&e.tagName!=="IFRAME"&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;let t=this.scroll.find(e);t!=null&&(t.domNode.parentNode==null||t.domNode.parentNode===this.domNode)&&t.detach()}),n.filter(e=>e.parentNode===this.domNode&&e!==this.uiNode).sort((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(e=>{let t=null;e.nextSibling!=null&&(t=this.scroll.find(e.nextSibling));let n=Qa(e,this.scroll);(n.next!==t||n.next==null)&&(n.parent!=null&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))}),this.enforceAllowedChildren()}};$a.uiClass="";var eo=$a;function to(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}var no=class e extends eo{static create(e){return super.create(e)}static formats(t,n){let r=n.query(e.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new qa(this.domNode)}format(t,n){if(t===this.statics.blotName&&!n)this.children.forEach(t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)}),this.unwrap();else{let e=this.scroll.query(t,G.INLINE);if(e==null)return;e instanceof za?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}}formats(){let e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){this.formats()[n]!=null||this.scroll.query(n,G.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);let n=this.formats();if(Object.keys(n).length===0)return this.unwrap();let r=this.next;r instanceof e&&r.prev===this&&to(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){let n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&e.type==="attributes")&&this.attributes.build()}wrap(t,n){let r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};no.allowedChildren=[no,K],no.blotName="inline",no.scope=G.INLINE_BLOT,no.tagName="SPAN";var ro=no,io=class e extends eo{static create(e){return super.create(e)}static formats(t,n){let r=n.query(e.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new qa(this.domNode)}format(t,n){let r=this.scroll.query(t,G.BLOCK);r!=null&&(r instanceof za?this.attributes.attribute(r,n):t===this.statics.blotName&&!n?this.replaceWith(e.blotName):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n))}formats(){let e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){this.scroll.query(n,G.BLOCK)==null?super.formatAt(e,t,n,r):this.format(n,r)}insertAt(e,t,n){if(n==null||this.scroll.query(t,G.INLINE)!=null)super.insertAt(e,t,n);else{let r=this.split(e);if(r!=null){let e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}else throw Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){let n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&e.type==="attributes")&&this.attributes.build()}};io.blotName="block",io.scope=G.BLOCK_BLOT,io.tagName="P",io.allowedChildren=[ro,io,K];var ao=io,oo=class extends eo{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};oo.blotName="container",oo.scope=G.BLOCK_BLOT;var so=oo,co=class extends K{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){e===0&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},lo={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},uo=100,fo=class extends eo{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(e=>{this.update(e)}),this.observer.observe(this.domNode,lo),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){let n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=G.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(e=>{e.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);let n=t.mutationsMap||new WeakMap,r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());let i=(e,t=!0)=>{e==null||e===this||e.domNode.parentNode!=null&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&i(e.parent))},a=e=>{n.has(e.domNode)&&(e instanceof eo&&e.children.forEach(a),n.delete(e.domNode),e.optimize(t))},o=e;for(let t=0;o.length>0;t+=1){if(t>=uo)throw Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(e=>{let t=this.find(e.target,!0);t!=null&&(t.domNode===e.target&&(e.type==="childList"?(i(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach(e=>{let t=this.find(e,!1);i(t,!1),t instanceof eo&&t.children.forEach(e=>{i(e,!1)})})):e.type==="attributes"&&i(t.prev)),i(t))}),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),r=o.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e||=this.observer.takeRecords();let n=new WeakMap;e.map(e=>{let t=this.find(e.target,!0);return t==null?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)}).forEach(e=>{e!=null&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};fo.blotName="scroll",fo.defaultChild=ao,fo.allowedChildren=[ao,so],fo.scope=G.BLOCK_BLOT,fo.tagName="DIV";var po=fo,mo=class e extends K{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){n==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}let n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(e=>e.type==="characterData"&&e.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};mo.blotName="text",mo.scope=G.INLINE_BLOT;var ho=mo,go=x((e,t)=>{var n=-1,r=1,i=0;function a(e,t,n,r,a){if(e===t)return e?[[i,e]]:[];if(n!=null){var s=D(e,t,n);if(s)return s}var c=l(e,t),u=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=d(e,t);var f=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var m=o(e,t);return u&&m.unshift([i,u]),f&&m.push([i,f]),b(m,a),r&&p(m),m}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!==-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length===1)return[[n,e],[r,t]];var d=f(e,t);if(d){var p=d[0],m=d[1],h=d[2],g=d[3],_=d[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;f<l;f++)u[f]=-1,d[f]=-1;u[s+1]=0,d[s+1]=0;for(var p=i-a,m=p%2!=0,h=0,g=0,_=0,v=0,y=0;y<o;y++){for(var b=-y+h;b<=y-g;b+=2){for(var x=s+b,S=b===-y||b!==y&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1,C=S-b;S<i&&C<a&&e.charAt(S)===t.charAt(C);)S++,C++;if(u[x]=S,S>i)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w<l&&d[w]!==-1){var T=i-d[w];if(S>=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E===-y||E!==y&&d[w-1]<d[w+1]?d[w+1]:d[w-1]+1,D=T-E;T<i&&D<a&&e.charAt(i-T-1)===t.charAt(a-D-1);)T++,D++;if(d[w]=T,T>i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x<l&&u[x]!==-1){var S=u[x],C=s+S-x;if(T=i-T,S>=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return x(e.charCodeAt(i-1))&&i--,i}function u(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}}function d(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return S(e.charCodeAt(e.length-i))&&i--,i}function f(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;function i(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),i=-1,a="",o,s,c,u;(i=t.indexOf(r,i+1))!==-1;){var f=l(e.substring(n),t.substring(i)),p=d(e.substring(0,n),t.substring(0,i));a.length<p+f&&(a=t.substring(i-p,i)+t.substring(i,i+f),o=e.substring(0,n-p),s=e.substring(n+f),c=t.substring(0,i-p),u=t.substring(i+f))}return a.length*2>=e.length?[o,s,c,u,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,u,f,p;e.length>t.length?(c=s[0],u=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],u=s[3]);var m=s[4];return[c,u,f,p,m]}function p(e){for(var t=!1,a=[],o=0,s=null,c=0,l=0,d=0,f=0,p=0;c<e.length;)e[c][0]==i?(a[o++]=c,l=f,d=p,f=0,p=0,s=e[c][1]):(e[c][0]==r?f+=e[c][1].length:p+=e[c][1].length,s&&s.length<=Math.max(l,d)&&s.length<=Math.max(f,p)&&(e.splice(a[o-1],0,[n,s]),e[a[o-1]+1][0]=r,o--,o--,c=o>0?a[o-1]:-1,l=0,d=0,f=0,p=0,s=null,t=!0)),c++;for(t&&b(e),y(e),c=1;c<e.length;){if(e[c-1][0]==n&&e[c][0]==r){var m=e[c-1][1],h=e[c][1],g=u(m,h),_=u(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(c,0,[i,h.substring(0,g)]),e[c-1][1]=m.substring(0,m.length-g),e[c+1][1]=h.substring(g),c++):(_>=m.length/2||_>=h.length/2)&&(e.splice(c,0,[i,m.substring(0,_)]),e[c-1][0]=r,e[c-1][1]=h.substring(0,h.length-_),e[c+1][0]=n,e[c+1][1]=m.substring(_),c++),c++}c++}}var m=/[^a-zA-Z0-9]/,h=/\s/,g=/[\r\n]/,_=/\n\r?\n$/,v=/^\r?\n\r?\n/;function y(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(m),a=r.match(m),o=i&&n.match(h),s=a&&r.match(h),c=o&&n.match(g),l=s&&r.match(g),u=c&&e.match(_),d=l&&t.match(v);return u||d?5:c||l?4:i&&!o&&s?3:o||s?2:i||a?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==i&&e[n+1][0]==i){var r=e[n-1][1],a=e[n][1],o=e[n+1][1],s=d(r,a);if(s){var c=a.substring(a.length-s);r=r.substring(0,r.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=r,u=a,f=o,p=t(r,a)+t(a,o);a.charAt(0)===o.charAt(0);){r+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var y=t(r,a)+t(a,o);y>=p&&(p=y,l=r,u=a,f=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,f?e[n+1][1]=f:(e.splice(n+1,1),n--))}n++}}function b(e,t){e.push([i,""]);for(var a=0,o=0,s=0,c="",u="",f;a<e.length;){if(a<e.length-1&&!e[a][1]){e.splice(a,1);continue}switch(e[a][0]){case r:s++,u+=e[a][1],a++;break;case n:o++,c+=e[a][1],a++;break;case i:var p=a-s-o-1;if(t){if(p>=0&&w(e[p][1])){var m=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),c=m+c,u=m+u,!e[p][1]){e.splice(p,1),a--;var h=p-1;e[h]&&e[h][0]===r&&(s++,u=e[h][1]+u,h--),e[h]&&e[h][0]===n&&(o++,c=e[h][1]+c,h--),p=h}}if(C(e[a][1])){var m=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=m,u+=m}}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(c.length>0||u.length>0){c.length>0&&u.length>0&&(f=l(u,c),f!==0&&(p>=0?e[p][1]+=u.substring(0,f):(e.splice(0,0,[i,u.substring(0,f)]),a++),u=u.substring(f),c=c.substring(f)),f=d(u,c),f!==0&&(e[a][1]=u.substring(u.length-f)+e[a][1],u=u.substring(0,u.length-f),c=c.substring(0,c.length-f)));var g=s+o;c.length===0&&u.length===0?(e.splice(a-g,g),a-=g):c.length===0?(e.splice(a-g,g,[r,u]),a=a-g+1):u.length===0?(e.splice(a-g,g,[n,c]),a=a-g+1):(e.splice(a-g,g,[n,c],[r,u]),a=a-g+2)}a!==0&&e[a-1][0]===i?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,s=0,o=0,c="",u="";break}}e[e.length-1][1]===""&&e.pop();var _=!1;for(a=1;a<e.length-1;)e[a-1][0]===i&&e[a+1][0]===i&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),_=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),_=!0)),a++;_&&b(e,t)}function x(e){return e>=55296&&e<=56319}function S(e){return e>=56320&&e<=57343}function C(e){return S(e.charCodeAt(0))}function w(e){return x(e.charCodeAt(e.length-1))}function T(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}function E(e,t,a,o){return w(e)||C(o)?null:T([[i,e],[n,t],[r,a],[i,o]])}function D(e,t,n){var r=typeof n=="number"?{index:n,length:0}:n.oldRange,i=typeof n=="number"?null:n.newRange,a=e.length,o=t.length;if(r.length===0&&(i===null||i.length===0)){var s=r.index,c=e.slice(0,s),l=e.slice(s),u=i?i.index:null;editBefore:{var d=s+o-a;if(u!==null&&u!==d||d<0||d>o)break editBefore;var f=t.slice(0,d),p=t.slice(d);if(p!==l)break editBefore;var m=Math.min(s,d),h=c.slice(0,m),g=f.slice(0,m);if(h!==g)break editBefore;var _=c.slice(m),v=f.slice(m);return E(h,_,v,l)}editAfter:{if(u!==null&&u!==s)break editAfter;var y=s,f=t.slice(0,y),p=t.slice(y);if(f!==c)break editAfter;var b=Math.min(a-y,o-y),x=l.slice(l.length-b),S=p.slice(p.length-b);if(x!==S)break editAfter;var _=l.slice(0,l.length-b),v=p.slice(0,p.length-b);return E(c,_,v,x)}}if(r.length>0&&i&&i.length===0)replaceRange:{var h=e.slice(0,r.index),x=e.slice(r.index+r.length),m=h.length,b=x.length;if(o<m+b)break replaceRange;var g=t.slice(0,m),S=t.slice(o-b);if(h!==g||x!==S)break replaceRange;var _=e.slice(m,a-b),v=t.slice(m,o-b);return E(h,_,v,x)}return null}function O(e,t,n,r){return a(e,t,n,r,!0)}O.INSERT=r,O.DELETE=n,O.EQUAL=i,t.exports=O}),_o=x((e,t)=>{var n=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",o="[object Array]",s="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",d="[object GeneratorFunction]",f="[object Map]",p="[object Number]",m="[object Object]",h="[object Promise]",g="[object RegExp]",_="[object Set]",v="[object String]",y="[object Symbol]",b="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",w="[object Float64Array]",T="[object Int8Array]",E="[object Int16Array]",D="[object Int32Array]",O="[object Uint8Array]",k="[object Uint8ClampedArray]",A="[object Uint16Array]",ee="[object Uint32Array]",j=/[\\^$.*+?()[\]{}|]/g,M=/\w*$/,N=/^\[object .+?Constructor\]$/,te=/^(?:0|[1-9]\d*)$/,P={};P[a]=P[o]=P[x]=P[S]=P[s]=P[c]=P[C]=P[w]=P[T]=P[E]=P[D]=P[f]=P[p]=P[m]=P[g]=P[_]=P[v]=P[y]=P[O]=P[k]=P[A]=P[ee]=!0,P[l]=P[u]=P[b]=!1;var ne=typeof global=="object"&&global&&global.Object===Object&&global,re=typeof self=="object"&&self&&self.Object===Object&&self,F=ne||re||Function("return this")(),ie=typeof e=="object"&&e&&!e.nodeType&&e,I=ie&&typeof t=="object"&&t&&!t.nodeType&&t,ae=I&&I.exports===ie;function oe(e,t){return e.set(t[0],t[1]),e}function L(e,t){return e.add(t),e}function se(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}function ce(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function le(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function ue(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function de(e,t){return e?.[t]}function fe(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function pe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function me(e,t){return function(n){return e(t(n))}}function he(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ge=Array.prototype,_e=Function.prototype,ve=Object.prototype,ye=F["__core-js_shared__"],be=function(){var e=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),xe=_e.toString,Se=ve.hasOwnProperty,Ce=ve.toString,we=RegExp("^"+xe.call(Se).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=ae?F.Buffer:void 0,Ee=F.Symbol,De=F.Uint8Array,R=me(Object.getPrototypeOf,Object),Oe=Object.create,ke=ve.propertyIsEnumerable,Ae=ge.splice,je=Object.getOwnPropertySymbols,Me=Te?Te.isBuffer:void 0,Ne=me(Object.keys,Object),Pe=H(F,"DataView"),Fe=H(F,"Map"),Ie=H(F,"Promise"),Le=H(F,"Set"),Re=H(F,"WeakMap"),ze=H(Object,"create"),Be=U(Pe),Ve=U(Fe),He=U(Ie),Ue=U(Le),We=U(Re),Ge=Ee?Ee.prototype:void 0,Ke=Ge?Ge.valueOf:void 0;function qe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Je(){this.__data__=ze?ze(null):{}}function Ye(e){return this.has(e)&&delete this.__data__[e]}function Xe(e){var t=this.__data__;if(ze){var n=t[e];return n===r?void 0:n}return Se.call(t,e)?t[e]:void 0}function Ze(e){var t=this.__data__;return ze?t[e]!==void 0:Se.call(t,e)}function Qe(e,t){var n=this.__data__;return n[e]=ze&&t===void 0?r:t,this}qe.prototype.clear=Je,qe.prototype.delete=Ye,qe.prototype.get=Xe,qe.prototype.has=Ze,qe.prototype.set=Qe;function z(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $e(){this.__data__=[]}function et(e){var t=this.__data__,n=gt(t,e);return n<0?!1:(n==t.length-1?t.pop():Ae.call(t,n,1),!0)}function tt(e){var t=this.__data__,n=gt(t,e);return n<0?void 0:t[n][1]}function nt(e){return gt(this.__data__,e)>-1}function rt(e,t){var n=this.__data__,r=gt(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}z.prototype.clear=$e,z.prototype.delete=et,z.prototype.get=tt,z.prototype.has=nt,z.prototype.set=rt;function B(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function it(){this.__data__={hash:new qe,map:new(Fe||z),string:new qe}}function at(e){return It(this,e).delete(e)}function ot(e){return It(this,e).get(e)}function st(e){return It(this,e).has(e)}function ct(e,t){return It(this,e).set(e,t),this}B.prototype.clear=it,B.prototype.delete=at,B.prototype.get=ot,B.prototype.has=st,B.prototype.set=ct;function V(e){this.__data__=new z(e)}function lt(){this.__data__=new z}function ut(e){return this.__data__.delete(e)}function dt(e){return this.__data__.get(e)}function ft(e){return this.__data__.has(e)}function pt(e,t){var r=this.__data__;if(r instanceof z){var i=r.__data__;if(!Fe||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new B(i)}return r.set(e,t),this}V.prototype.clear=lt,V.prototype.delete=ut,V.prototype.get=dt,V.prototype.has=ft,V.prototype.set=pt;function mt(e,t){var n=Yt(e)||Jt(e)?ue(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Se.call(e,a))&&!(i&&(a=="length"||Ht(a,r)))&&n.push(a);return n}function ht(e,t,n){var r=e[t];(!(Se.call(e,t)&&qt(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function gt(e,t){for(var n=e.length;n--;)if(qt(e[n][0],t))return n;return-1}function _t(e,t){return e&&Nt(t,rn(t),e)}function vt(e,t,n,r,i,o,s){var c;if(r&&(c=o?r(e,i,o,s):r(e)),c!==void 0)return c;if(!tn(e))return e;var l=Yt(e);if(l){if(c=zt(e),!t)return Mt(e,c)}else{var f=Rt(e),p=f==u||f==d;if(Qt(e))return wt(e,t);if(f==m||f==a||p&&!o){if(fe(e))return o?e:{};if(c=Bt(p?{}:e),!t)return Pt(e,_t(c,e))}else{if(!P[f])return o?e:{};c=Vt(e,f,vt,t)}}s||=new V;var h=s.get(e);if(h)return h;if(s.set(e,c),!l)var g=n?Ft(e):rn(e);return se(g||e,function(i,a){g&&(a=i,i=e[a]),ht(c,a,vt(i,t,n,r,a,e,s))}),c}function yt(e){return tn(e)?Oe(e):{}}function bt(e,t,n){var r=t(e);return Yt(e)?r:ce(r,n(e))}function xt(e){return Ce.call(e)}function St(e){return!tn(e)||Wt(e)?!1:($t(e)||fe(e)?we:N).test(U(e))}function Ct(e){if(!Gt(e))return Ne(e);var t=[];for(var n in Object(e))Se.call(e,n)&&n!="constructor"&&t.push(n);return t}function wt(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function Tt(e){var t=new e.constructor(e.byteLength);return new De(t).set(new De(e)),t}function Et(e,t){var n=t?Tt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Dt(e,t,n){return le(t?n(pe(e),!0):pe(e),oe,new e.constructor)}function Ot(e){var t=new e.constructor(e.source,M.exec(e));return t.lastIndex=e.lastIndex,t}function kt(e,t,n){return le(t?n(he(e),!0):he(e),L,new e.constructor)}function At(e){return Ke?Object(Ke.call(e)):{}}function jt(e,t){var n=t?Tt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Mt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function Nt(e,t,n,r){n||={};for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;ht(n,o,s===void 0?e[o]:s)}return n}function Pt(e,t){return Nt(e,Lt(e),t)}function Ft(e){return bt(e,rn,Lt)}function It(e,t){var n=e.__data__;return Ut(t)?n[typeof t=="string"?"string":"hash"]:n.map}function H(e,t){var n=de(e,t);return St(n)?n:void 0}var Lt=je?me(je,Object):an,Rt=xt;(Pe&&Rt(new Pe(new ArrayBuffer(1)))!=S||Fe&&Rt(new Fe)!=f||Ie&&Rt(Ie.resolve())!=h||Le&&Rt(new Le)!=_||Re&&Rt(new Re)!=b)&&(Rt=function(e){var t=Ce.call(e),n=t==m?e.constructor:void 0,r=n?U(n):void 0;if(r)switch(r){case Be:return S;case Ve:return f;case He:return h;case Ue:return _;case We:return b}return t});function zt(e){var t=e.length,n=e.constructor(t);return t&&typeof e[0]=="string"&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function Bt(e){return typeof e.constructor=="function"&&!Gt(e)?yt(R(e)):{}}function Vt(e,t,n,r){var i=e.constructor;switch(t){case x:return Tt(e);case s:case c:return new i(+e);case S:return Et(e,r);case C:case w:case T:case E:case D:case O:case k:case A:case ee:return jt(e,r);case f:return Dt(e,r,n);case p:case v:return new i(e);case g:return Ot(e);case _:return kt(e,r,n);case y:return At(e)}}function Ht(e,t){return t??=i,!!t&&(typeof e=="number"||te.test(e))&&e>-1&&e%1==0&&e<t}function Ut(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wt(e){return!!be&&be in e}function Gt(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||ve)}function U(e){if(e!=null){try{return xe.call(e)}catch{}try{return e+""}catch{}}return""}function Kt(e){return vt(e,!0,!0)}function qt(e,t){return e===t||e!==e&&t!==t}function Jt(e){return Zt(e)&&Se.call(e,"callee")&&(!ke.call(e,"callee")||Ce.call(e)==a)}var Yt=Array.isArray;function Xt(e){return e!=null&&en(e.length)&&!$t(e)}function Zt(e){return nn(e)&&Xt(e)}var Qt=Me||on;function $t(e){var t=tn(e)?Ce.call(e):"";return t==u||t==d}function en(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=i}function tn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nn(e){return!!e&&typeof e=="object"}function rn(e){return Xt(e)?mt(e):Ct(e)}function an(){return[]}function on(){return!1}t.exports=Kt}),vo=x((e,t)=>{var n=200,r="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",m="[object GeneratorFunction]",h="[object Map]",g="[object Number]",_="[object Null]",v="[object Object]",y="[object Promise]",b="[object Proxy]",x="[object RegExp]",S="[object Set]",C="[object String]",w="[object Symbol]",T="[object Undefined]",E="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",k="[object Float32Array]",A="[object Float64Array]",ee="[object Int8Array]",j="[object Int16Array]",M="[object Int32Array]",N="[object Uint8Array]",te="[object Uint8ClampedArray]",P="[object Uint16Array]",ne="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,I={};I[k]=I[A]=I[ee]=I[j]=I[M]=I[N]=I[te]=I[P]=I[ne]=!0,I[s]=I[c]=I[D]=I[u]=I[O]=I[d]=I[f]=I[p]=I[h]=I[g]=I[v]=I[x]=I[S]=I[C]=I[E]=!1;var ae=typeof global=="object"&&global&&global.Object===Object&&global,oe=typeof self=="object"&&self&&self.Object===Object&&self,L=ae||oe||Function("return this")(),se=typeof e=="object"&&e&&!e.nodeType&&e,ce=se&&typeof t=="object"&&t&&!t.nodeType&&t,le=ce&&ce.exports===se,ue=le&&ae.process,de=function(){try{return ue&&ue.binding&&ue.binding("util")}catch{}}(),fe=de&&de.isTypedArray;function pe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function me(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function he(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function ge(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function _e(e){return function(t){return e(t)}}function ve(e,t){return e.has(t)}function ye(e,t){return e?.[t]}function be(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function xe(e,t){return function(n){return e(t(n))}}function Se(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Ce=Array.prototype,we=Function.prototype,Te=Object.prototype,Ee=L["__core-js_shared__"],De=we.toString,R=Te.hasOwnProperty,Oe=function(){var e=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ke=Te.toString,Ae=RegExp("^"+De.call(R).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=le?L.Buffer:void 0,Me=L.Symbol,Ne=L.Uint8Array,Pe=Te.propertyIsEnumerable,Fe=Ce.splice,Ie=Me?Me.toStringTag:void 0,Le=Object.getOwnPropertySymbols,Re=je?je.isBuffer:void 0,ze=xe(Object.keys,Object),Be=Lt(L,"DataView"),Ve=Lt(L,"Map"),He=Lt(L,"Promise"),Ue=Lt(L,"Set"),We=Lt(L,"WeakMap"),Ge=Lt(Object,"create"),Ke=U(Be),qe=U(Ve),Je=U(He),Ye=U(Ue),Xe=U(We),Ze=Me?Me.prototype:void 0,Qe=Ze?Ze.valueOf:void 0;function z(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $e(){this.__data__=Ge?Ge(null):{},this.size=0}function et(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function tt(e){var t=this.__data__;if(Ge){var n=t[e];return n===r?void 0:n}return R.call(t,e)?t[e]:void 0}function nt(e){var t=this.__data__;return Ge?t[e]!==void 0:R.call(t,e)}function rt(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Ge&&t===void 0?r:t,this}z.prototype.clear=$e,z.prototype.delete=et,z.prototype.get=tt,z.prototype.has=nt,z.prototype.set=rt;function B(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function it(){this.__data__=[],this.size=0}function at(e){var t=this.__data__,n=wt(t,e);return n<0?!1:(n==t.length-1?t.pop():Fe.call(t,n,1),--this.size,!0)}function ot(e){var t=this.__data__,n=wt(t,e);return n<0?void 0:t[n][1]}function st(e){return wt(this.__data__,e)>-1}function ct(e,t){var n=this.__data__,r=wt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}B.prototype.clear=it,B.prototype.delete=at,B.prototype.get=ot,B.prototype.has=st,B.prototype.set=ct;function V(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function lt(){this.size=0,this.__data__={hash:new z,map:new(Ve||B),string:new z}}function ut(e){var t=H(this,e).delete(e);return this.size-=+!!t,t}function dt(e){return H(this,e).get(e)}function ft(e){return H(this,e).has(e)}function pt(e,t){var n=H(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}V.prototype.clear=lt,V.prototype.delete=ut,V.prototype.get=dt,V.prototype.has=ft,V.prototype.set=pt;function mt(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new V;++t<n;)this.add(e[t])}function ht(e){return this.__data__.set(e,r),this}function gt(e){return this.__data__.has(e)}mt.prototype.add=mt.prototype.push=ht,mt.prototype.has=gt;function _t(e){var t=this.__data__=new B(e);this.size=t.size}function vt(){this.__data__=new B,this.size=0}function yt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function bt(e){return this.__data__.get(e)}function xt(e){return this.__data__.has(e)}function St(e,t){var r=this.__data__;if(r instanceof B){var i=r.__data__;if(!Ve||i.length<n-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new V(i)}return r.set(e,t),this.size=r.size,this}_t.prototype.clear=vt,_t.prototype.delete=yt,_t.prototype.get=bt,_t.prototype.has=xt,_t.prototype.set=St;function Ct(e,t){var n=Jt(e),r=!n&&qt(e),i=!n&&!r&&Xt(e),a=!n&&!r&&!i&&nn(e),o=n||r||i||a,s=o?ge(e.length,String):[],c=s.length;for(var l in e)(t||R.call(e,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Vt(l,c)))&&s.push(l);return s}function wt(e,t){for(var n=e.length;n--;)if(Kt(e[n][0],t))return n;return-1}function Tt(e,t,n){var r=t(e);return Jt(e)?r:me(r,n(e))}function Et(e){return e==null?e===void 0?T:_:Ie&&Ie in Object(e)?Rt(e):Gt(e)}function Dt(e){return tn(e)&&Et(e)==s}function Ot(e,t,n,r,i){return e===t?!0:e==null||t==null||!tn(e)&&!tn(t)?e!==e&&t!==t:kt(e,t,n,r,Ot,i)}function kt(e,t,n,r,a,o){var l=Jt(e),u=Jt(t),d=l?c:Bt(e),f=u?c:Bt(t);d=d==s?v:d,f=f==s?v:f;var p=d==v,m=f==v,h=d==f;if(h&&Xt(e)){if(!Xt(t))return!1;l=!0,p=!1}if(h&&!p)return o||=new _t,l||nn(e)?Nt(e,t,n,r,a,o):Pt(e,t,d,n,r,a,o);if(!(n&i)){var g=p&&R.call(e,"__wrapped__"),_=m&&R.call(t,"__wrapped__");if(g||_){var y=g?e.value():e,b=_?t.value():t;return o||=new _t,a(y,b,n,r,o)}}return h?(o||=new _t,Ft(e,t,n,r,a,o)):!1}function At(e){return!en(e)||Ut(e)?!1:(Qt(e)?Ae:F).test(U(e))}function jt(e){return tn(e)&&$t(e.length)&&!!I[Et(e)]}function Mt(e){if(!Wt(e))return ze(e);var t=[];for(var n in Object(e))R.call(e,n)&&n!="constructor"&&t.push(n);return t}function Nt(e,t,n,r,o,s){var c=n&i,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=n&a?new mt:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var h=e[f],g=t[f];if(r)var _=c?r(g,h,f,t,e,s):r(h,g,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!he(t,function(e,t){if(!ve(m,t)&&(h===e||o(h,e,n,r,s)))return m.push(t)})){p=!1;break}}else if(!(h===g||o(h,g,n,r,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function Pt(e,t,n,r,o,s,c){switch(n){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case D:return!(e.byteLength!=t.byteLength||!s(new Ne(e),new Ne(t)));case u:case d:case g:return Kt(+e,+t);case f:return e.name==t.name&&e.message==t.message;case x:case C:return e==t+"";case h:var l=be;case S:var p=r&i;if(l||=Se,e.size!=t.size&&!p)return!1;var m=c.get(e);if(m)return m==t;r|=a,c.set(e,t);var _=Nt(l(e),l(t),r,o,s,c);return c.delete(e),_;case w:if(Qe)return Qe.call(e)==Qe.call(t)}return!1}function Ft(e,t,n,r,a,o){var s=n&i,c=It(e),l=c.length;if(l!=It(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:R.call(t,d)))return!1}var f=o.get(e);if(f&&o.get(t))return f==t;var p=!0;o.set(e,t),o.set(t,e);for(var m=s;++u<l;){d=c[u];var h=e[d],g=t[d];if(r)var _=s?r(g,h,d,t,e,o):r(h,g,d,e,t,o);if(!(_===void 0?h===g||a(h,g,n,r,o):_)){p=!1;break}m||=d=="constructor"}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof y=="function"&&y instanceof y)&&(p=!1)}return o.delete(e),o.delete(t),p}function It(e){return Tt(e,rn,zt)}function H(e,t){var n=e.__data__;return Ht(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Lt(e,t){var n=ye(e,t);return At(n)?n:void 0}function Rt(e){var t=R.call(e,Ie),n=e[Ie];try{e[Ie]=void 0;var r=!0}catch{}var i=ke.call(e);return r&&(t?e[Ie]=n:delete e[Ie]),i}var zt=Le?function(e){return e==null?[]:(e=Object(e),pe(Le(e),function(t){return Pe.call(e,t)}))}:an,Bt=Et;(Be&&Bt(new Be(new ArrayBuffer(1)))!=O||Ve&&Bt(new Ve)!=h||He&&Bt(He.resolve())!=y||Ue&&Bt(new Ue)!=S||We&&Bt(new We)!=E)&&(Bt=function(e){var t=Et(e),n=t==v?e.constructor:void 0,r=n?U(n):"";if(r)switch(r){case Ke:return O;case qe:return h;case Je:return y;case Ye:return S;case Xe:return E}return t});function Vt(e,t){return t??=o,!!t&&(typeof e=="number"||ie.test(e))&&e>-1&&e%1==0&&e<t}function Ht(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ut(e){return!!Oe&&Oe in e}function Wt(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||Te)}function Gt(e){return ke.call(e)}function U(e){if(e!=null){try{return De.call(e)}catch{}try{return e+""}catch{}}return""}function Kt(e,t){return e===t||e!==e&&t!==t}var qt=Dt(function(){return arguments}())?Dt:function(e){return tn(e)&&R.call(e,"callee")&&!Pe.call(e,"callee")},Jt=Array.isArray;function Yt(e){return e!=null&&$t(e.length)&&!Qt(e)}var Xt=Re||on;function Zt(e,t){return Ot(e,t)}function Qt(e){if(!en(e))return!1;var t=Et(e);return t==p||t==m||t==l||t==b}function $t(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=o}function en(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function tn(e){return typeof e=="object"&&!!e}var nn=fe?_e(fe):jt;function rn(e){return Yt(e)?Ct(e):Mt(e)}function an(){return[]}function on(){return!1}t.exports=Zt}),yo=x(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=_o(),n=vo(),r;(function(e){function r(e={},n={},r=!1){typeof e!="object"&&(e={}),typeof n!="object"&&(n={});let i=t(n);r||(i=Object.keys(i).reduce((e,t)=>(i[t]!=null&&(e[t]=i[t]),e),{}));for(let t in e)e[t]!==void 0&&n[t]===void 0&&(i[t]=e[t]);return Object.keys(i).length>0?i:void 0}e.compose=r;function i(e={},t={}){typeof e!="object"&&(e={}),typeof t!="object"&&(t={});let r=Object.keys(e).concat(Object.keys(t)).reduce((r,i)=>(n(e[i],t[i])||(r[i]=t[i]===void 0?null:t[i]),r),{});return Object.keys(r).length>0?r:void 0}e.diff=i;function a(e={},t={}){e||={};let n=Object.keys(t).reduce((n,r)=>(t[r]!==e[r]&&e[r]!==void 0&&(n[r]=t[r]),n),{});return Object.keys(e).reduce((n,r)=>(e[r]!==t[r]&&t[r]===void 0&&(n[r]=null),n),n)}e.invert=a;function o(e,t,n=!1){if(typeof e!="object")return t;if(typeof t!="object")return;if(!n)return t;let r=Object.keys(t).reduce((n,r)=>(e[r]===void 0&&(n[r]=t[r]),n),{});return Object.keys(r).length>0?r:void 0}e.transform=o})(r||={}),e.default=r}),bo=x(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t;(function(e){function t(e){return typeof e.delete=="number"?e.delete:typeof e.retain=="number"?e.retain:typeof e.retain=="object"&&e.retain!==null?1:typeof e.insert=="string"?e.insert.length:1}e.length=t})(t||={}),e.default=t}),xo=x(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=bo();e.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<Infinity}next(e){e||=Infinity;let n=this.ops[this.index];if(n){let r=this.offset,i=t.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof n.delete=="number")return{delete:e};{let t={};return n.attributes&&(t.attributes=n.attributes),typeof n.retain=="number"?t.retain=e:typeof n.retain=="object"&&n.retain!==null?t.retain=n.retain:typeof n.insert=="string"?t.insert=n.insert.substr(r,e):t.insert=n.insert,t}}else return{retain:Infinity}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:Infinity}peekType(){let e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(!this.hasNext())return[];if(this.offset===0)return this.ops.slice(this.index);{let e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}}}),q=w(x((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;var n=go(),r=_o(),i=vo(),a=yo();e.AttributeMap=a.default;var o=bo();e.Op=o.default;var s=xo();e.OpIterator=s.default;var c="\0",l=(e,t)=>{if(typeof e!="object"||!e)throw Error(`cannot retain a ${typeof e}`);if(typeof t!="object"||!t)throw Error(`cannot retain a ${typeof t}`);let n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]},u=class e{constructor(e){Array.isArray(e)?this.ops=e:e!=null&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){let t=this.handlers[e];if(!t)throw Error(`no handlers for embed type "${e}"`);return t}insert(e,t){let n={};return typeof e=="string"&&e.length===0?this:(n.insert=e,typeof t=="object"&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if(typeof e=="number"&&e<=0)return this;let n={retain:e};return typeof t=="object"&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),typeof n=="object"){if(typeof e.delete=="number"&&typeof n.delete=="number")return this.ops[t-1]={delete:n.delete+e.delete},this;if(typeof n.delete=="number"&&e.insert!=null&&(--t,n=this.ops[t-1],typeof n!="object"))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if(typeof e.insert=="string"&&typeof n.insert=="string")return this.ops[t-1]={insert:n.insert+e.insert},typeof e.attributes=="object"&&(this.ops[t-1].attributes=e.attributes),this;if(typeof e.retain=="number"&&typeof n.retain=="number")return this.ops[t-1]={retain:n.retain+e.retain},typeof e.attributes=="object"&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){let e=this.ops[this.ops.length-1];return e&&typeof e.retain=="number"&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){let t=[],n=[];return this.forEach(r=>{(e(r)?t:n).push(r)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce((e,t)=>t.insert?e+o.default.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+o.default.length(t),0)}slice(t=0,n=Infinity){let r=[],i=new s.default(this.ops),a=0;for(;a<n&&i.hasNext();){let e;a<t?e=i.next(t-a):(e=i.next(n-a),r.push(e)),a+=o.default.length(e)}return new e(r)}compose(t){let n=new s.default(this.ops),r=new s.default(t.ops),o=[],c=r.peek();if(c!=null&&typeof c.retain=="number"&&c.attributes==null){let e=c.retain;for(;n.peekType()==="insert"&&n.peekLength()<=e;)e-=n.peekLength(),o.push(n.next());c.retain-e>0&&r.next(c.retain-e)}let u=new e(o);for(;n.hasNext()||r.hasNext();)if(r.peekType()==="insert")u.push(r.next());else if(n.peekType()==="delete")u.push(n.next());else{let t=Math.min(n.peekLength(),r.peekLength()),o=n.next(t),s=r.next(t);if(s.retain){let c={};if(typeof o.retain=="number")c.retain=typeof s.retain=="number"?t:s.retain;else if(typeof s.retain=="number")o.retain==null?c.insert=o.insert:c.retain=o.retain;else{let t=o.retain==null?"insert":"retain",[n,r,i]=l(o[t],s.retain),a=e.getHandler(n);c[t]={[n]:a.compose(r,i,t==="retain")}}let d=a.default.compose(o.attributes,s.attributes,typeof o.retain=="number");if(d&&(c.attributes=d),u.push(c),!r.hasNext()&&i(u.ops[u.ops.length-1],c)){let t=new e(n.rest());return u.concat(t).chop()}}else typeof s.delete=="number"&&(typeof o.retain=="number"||typeof o.retain=="object"&&o.retain!==null)&&u.push(s)}return u.chop()}concat(t){let n=new e(this.ops.slice());return t.ops.length>0&&(n.push(t.ops[0]),n.ops=n.ops.concat(t.ops.slice(1))),n}diff(t,r){if(this.ops===t.ops)return new e;let o=[this,t].map(e=>e.map(n=>{if(n.insert!=null)return typeof n.insert=="string"?n.insert:c;throw Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")),l=new e,u=n(o[0],o[1],r,!0),d=new s.default(this.ops),f=new s.default(t.ops);return u.forEach(e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(f.peekLength(),t),l.push(f.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),l.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),f.peekLength(),t);let e=d.next(r),o=f.next(r);i(e.insert,o.insert)?l.retain(r,a.default.diff(e.attributes,o.attributes)):l.push(o).delete(r);break}t-=r}}),l.chop()}eachLine(t,n="\n"){let r=new s.default(this.ops),i=new e,a=0;for(;r.hasNext();){if(r.peekType()!=="insert")return;let s=r.peek(),c=o.default.length(s)-r.peekLength(),l=typeof s.insert=="string"?s.insert.indexOf(n,c)-c:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(t(i,r.next(1).attributes||{},a)===!1)return;a+=1,i=new e}}i.length()>0&&t(i,{},a)}invert(t){let n=new e;return this.reduce((r,i)=>{if(i.insert)n.delete(o.default.length(i));else if(typeof i.retain=="number"&&i.attributes==null)return n.retain(i.retain),r+i.retain;else if(i.delete||typeof i.retain=="number"){let e=i.delete||i.retain;return t.slice(r,r+e).forEach(e=>{i.delete?n.push(e):i.retain&&i.attributes&&n.retain(o.default.length(e),a.default.invert(i.attributes,e.attributes))}),r+e}else if(typeof i.retain=="object"&&i.retain!==null){let o=t.slice(r,r+1),c=new s.default(o.ops).next(),[u,d,f]=l(i.retain,c.insert),p=e.getHandler(u);return n.retain({[u]:p.invert(d,f)},a.default.invert(i.attributes,c.attributes)),r+1}return r},0),n.chop()}transform(t,n=!1){if(n=!!n,typeof t=="number")return this.transformPosition(t,n);let r=t,i=new s.default(this.ops),c=new s.default(r.ops),l=new e;for(;i.hasNext()||c.hasNext();)if(i.peekType()==="insert"&&(n||c.peekType()!=="insert"))l.retain(o.default.length(i.next()));else if(c.peekType()==="insert")l.push(c.next());else{let t=Math.min(i.peekLength(),c.peekLength()),r=i.next(t),o=c.next(t);if(r.delete)continue;if(o.delete)l.push(o);else{let i=r.retain,s=o.retain,c=typeof s=="object"&&s?s:t;if(typeof i=="object"&&i&&typeof s=="object"&&s){let t=Object.keys(i)[0];if(t===Object.keys(s)[0]){let r=e.getHandler(t);r&&(c={[t]:r.transform(i[t],s[t],n)})}}l.retain(c,a.default.transform(r.attributes,o.attributes,n))}}return l.chop()}transformPosition(e,t=!1){t=!!t;let n=new s.default(this.ops),r=0;for(;n.hasNext()&&r<=e;){let i=n.peekLength(),a=n.peekType();if(n.next(),a==="delete"){e-=Math.min(i,e-r);continue}else a==="insert"&&(r<e||!t)&&(e+=i);r+=i}return e}};u.Op=o.default,u.OpIterator=s.default,u.AttributeMap=a.default,u.handlers={},e.default=u,typeof t=="object"&&(t.exports=u,t.exports.default=u)})(),1),So=class extends co{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}};So.blotName="break",So.tagName="BR";var Co=class extends ho{},wo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function To(e){return e.replace(/[&<>"']/g,e=>wo[e])}var Eo=class e extends ro{static allowedChildren=[e,So,co,Co];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,n){let r=e.order.indexOf(t),i=e.order.indexOf(n);return r>=0||i>=0?r-i:t===n?0:t<n?-1:1}formatAt(t,n,r,i){if(e.compare(this.statics.blotName,r)<0&&this.scroll.query(r,G.BLOT)){let e=this.isolate(t,n);i&&e.wrap(r,i)}else super.formatAt(t,n,r,i)}optimize(t){if(super.optimize(t),this.parent instanceof e&&e.compare(this.statics.blotName,this.parent.statics.blotName)>0){let e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}},Do=1,J=class extends ao{cache={};delta(){return this.cache.delta??(this.cache.delta=ko(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,G.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n),this.cache={};return}if(t.length===0)return;let r=t.split("\n"),i=r.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;r.reduce((e,t)=>(a=a.split(e,!0),a.insertAt(0,t),t.length),e+i.length)}insertBefore(e,t){let{head:n}=this.children;super.insertBefore(e,t),n instanceof So&&n.remove(),this.cache={}}length(){return this.cache.length??(this.cache.length=super.length()+Do),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Do)){let t=this.clone();return e===0?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}let n=super.split(e,t);return this.cache={},n}};J.blotName="block",J.tagName="P",J.defaultChild=So,J.allowedChildren=[So,Eo,co,Co];var Oo=class extends co{attach(){super.attach(),this.attributes=new qa(this.domNode)}delta(){return(new q.default).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){let n=this.scroll.query(e,G.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}let r=t.split("\n"),i=r.pop(),a=r.map(e=>{let t=this.scroll.create(J.blotName);return t.insertAt(0,e),t}),o=this.split(e);a.forEach(e=>{this.parent.insertBefore(e,o)}),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}};Oo.scope=G.BLOCK_BLOT;function ko(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.descendants(K).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),Ao(n,{},t)),new q.default).insert("\n",Ao(e))}function Ao(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e==null||("formats"in e&&typeof e.formats=="function"&&(t={...t,...e.formats()},n&&delete t["code-token"]),e.parent==null||e.parent.statics.blotName==="scroll"||e.parent.statics.scope!==e.statics.scope)?t:Ao(e.parent,t,n)}var jo=class e extends co{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(t,n,r){super(t,n),this.selection=r,this.textNode=document.createTextNode(e.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,n){if(this.savedLength!==0){super.format(t,n);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==G.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=e.CONTENTS.length,r.optimize(),r.formatAt(i,e.CONTENTS.length,t,n),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;let t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);let n=this.prev instanceof Co?this.prev:null,r=n?n.length():0,i=this.next instanceof Co?this.next:null,a=i?i.text:"",{textNode:o}=this,s=o.data.split(e.CONTENTS).join("");o.data=e.CONTENTS;let c;if(n)c=n,(s||i)&&(n.insertAt(n.length(),s+a),i&&i.remove());else if(i)c=i,i.insertAt(0,s);else{let e=document.createTextNode(s);c=this.scroll.create(e),this.parent.insertBefore(c,this)}if(this.remove(),t){let e=(e,t)=>n&&e===n.domNode?t:e===o?r+t-1:i&&e===i.domNode?r+s.length+t:null,a=e(t.start.node,t.start.offset),l=e(t.end.node,t.end.offset);if(a!==null&&l!==null)return{startNode:c.domNode,startOffset:a,endNode:c.domNode,endOffset:l}}return null}update(e,t){if(e.some(e=>e.type==="characterData"&&e.target===this.textNode)){let e=this.restore();e&&(t.range=e)}}optimize(t){super.optimize(t);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=e.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}},Mo=w(x((e,t)=>{var n=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!="function")throw TypeError("The listener must be a function");var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})(),1),No=new WeakMap,Po=["error","warn","log","info"],Fo="warn";function Io(e){if(Fo&&Po.indexOf(e)<=Po.indexOf(Fo)){var t=[...arguments].slice(1);console[e](...t)}}function Lo(e){return Po.reduce((t,n)=>(t[n]=Io.bind(console,n,e),t),{})}Lo.level=e=>{Fo=e},Io.level=Lo.level;var Ro=Lo("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(e=>{document.addEventListener(e,function(){var e=[...arguments];Array.from(document.querySelectorAll(".ql-container")).forEach(t=>{let n=No.get(t);n&&n.emitter&&n.emitter.handleDOM(...e)})})});var Y=class extends Mo.default{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Ro.error)}emit(){var e=[...arguments];return Ro.log.call(Ro,...e),super.emit(...e)}handleDOM(e){var t=[...arguments].slice(1);(this.domListeners[e.type]||[]).forEach(n=>{let{node:r,handler:i}=n;(e.target===r||r.contains(e.target))&&i(e,...t)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}},zo=Lo("quill:selection"),Bo=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}},Vo=class{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Bo(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Y.sources.USER),1)}),this.emitter.on(Y.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;let e=this.getNativeRange();e!=null&&e.start.node!==this.cursor.textNode&&this.emitter.once(Y.events.SCROLL_UPDATE,(t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);let r=n.some(e=>e.type==="characterData"||e.type==="childList"||e.type==="attributes"&&e.target===this.root);this.update(r?Y.sources.SILENT:t)}catch{}})}),this.emitter.on(Y.events.SCROLL_OPTIMIZE,(e,t)=>{if(t.range){let{startNode:e,startOffset:n,endNode:r,endOffset:i}=t.range;this.setNativeRange(e,n,r,i),this.update(Y.sources.SILENT)}}),this.update(Y.sources.SILENT)}handleComposition(){this.emitter.on(Y.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Y.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){let e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Y.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();let n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(e,G.BLOCK))){if(n.start.node!==this.cursor.textNode){let e=this.scroll.find(n.start.node,!1);if(e==null)return;if(e instanceof K){let t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let r,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){let[t]=this.scroll.leaf(e+1);if(t){let[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(i=t,a=0)}}[r,a]=i.position(a,!0);let o=document.createRange();if(t>0)return o.setStart(r,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([r,a]=i.position(a,!0),o.setEnd(r,a),o.getBoundingClientRect());let s="left",c;if(r instanceof Text){if(!r.data.length)return null;a<r.data.length?(o.setStart(r,a),o.setEnd(r,a+1)):(o.setStart(r,a-1),o.setEnd(r,a),s="right"),c=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;c=i.domNode.getBoundingClientRect(),a>0&&(s="right")}return{bottom:c.top+c.height,height:c.height,left:c[s],right:c[s],top:c.top,width:0}}getNativeRange(){let e=document.getSelection();if(e==null||e.rangeCount<=0)return null;let t=e.getRangeAt(0);if(t==null)return null;let n=this.normalizeNative(t);return zo.info("getNativeRange",n),n}getRange(){let e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];let t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Ho(this.root,document.activeElement)}normalizedToRange(e){let t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);let n=t.map(e=>{let[t,n]=e,r=this.scroll.find(t,!0),i=r.offset(this.scroll);return n===0?i:r instanceof K?i+r.index(t,n):i+r.length()}),r=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(r,...n);return new Bo(i,r-i)}normalizeNative(e){if(!Ho(this.root,e.startContainer)||!e.collapsed&&!Ho(this.root,e.endContainer))return null;let t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else if(t.childNodes.length===n)t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1;else break;e.node=t,e.offset=n}),t}rangeToNative(e){let t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);let[r,i]=this.scroll.leaf(e);return r?r.position(i,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(zo.info("setNativeRange",e,t,n,r),e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))return;let a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});let{native:o}=this.getNativeRange()||{};if(o==null||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&n.tagName==="BR"&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);let i=document.createRange();i.setStart(e,t),i.setEnd(n,r),a.removeAllRanges(),a.addRange(i)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y.sources.API;if(typeof t=="string"&&(n=t,t=!1),zo.info("setRange",e),e!=null){let n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Y.sources.USER,t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ia(t,this.lastRange)){if(!this.composing&&r!=null&&r.native.collapsed&&r.start.node!==this.cursor.textNode){let e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}let n=[Y.events.SELECTION_CHANGE,Wi(this.lastRange),Wi(t),e];this.emitter.emit(Y.events.EDITOR_CHANGE,...n),e!==Y.sources.SILENT&&this.emitter.emit(...n)}}};function Ho(e,t){try{t.parentNode}catch{return!1}return e.contains(t)}var Uo=/^[ -~]*$/,Wo=class{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();let n=Yo(e),r=new q.default;return Zo(n.ops.slice()).reduce((e,n)=>{let i=q.Op.length(n),a=n.attributes||{},o=!1,s=!1;if(n.insert!=null){if(r.retain(i),typeof n.insert=="string"){let r=n.insert;s=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(Oo,e)[0]),this.scroll.insertAt(e,r);let[i,o]=this.scroll.line(e),c=La({},Ao(i));if(i instanceof J){let[e]=i.descendant(K,o);e&&(c=La(c,Ao(e)))}a=q.AttributeMap.diff(c,a)||{}}else if(typeof n.insert=="object"){let r=Object.keys(n.insert)[0];if(r==null)return e;let i=this.scroll.query(r,G.INLINE)!=null;if(i)(t<=e||this.scroll.descendant(Oo,e)[0])&&(s=!0);else if(e>0){let[t,n]=this.scroll.descendant(K,e-1);t instanceof Co?t.value()[n]!=="\n"&&(o=!0):t instanceof co&&t.statics.scope===G.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),i){let[t]=this.scroll.descendant(K,e);if(t){let e=La({},Ao(t));a=q.AttributeMap.diff(e,a)||{}}}}t+=i}else if(r.push(n),n.retain!==null&&typeof n.retain=="object"){let t=Object.keys(n.retain)[0];if(t==null)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(a).forEach(t=>{this.scroll.formatAt(e,i,t,a[t])});let c=+!!o,l=+!!s;return t+=c+l,r.retain(c),r.delete(l),e+i+c+l},0),r.reduce((e,t)=>typeof t.delete=="number"?(this.scroll.deleteAt(e,t.delete),e):e+q.Op.length(t),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new q.default).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(r=>{this.scroll.lines(e,Math.max(t,1)).forEach(e=>{e.format(r,n[r])})}),this.scroll.optimize();let r=(new q.default).retain(e).retain(t,Wi(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t,r,n[r])});let r=(new q.default).retain(e).retain(t,Wi(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new q.default)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],r=[];t===0?this.scroll.path(e).forEach(e=>{let[t]=e;t instanceof J?n.push(t):t instanceof K&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(K,e,t));let[i,a]=[n,r].map(e=>{let t=e.shift();if(t==null)return{};let n=Ao(t);for(;Object.keys(n).length>0;){let t=e.shift();if(t==null)return n;n=qo(Ao(t),n)}return n});return{...i,...a}}getHTML(e,t){let[n,r]=this.scroll.line(e);if(n){let i=n.length();return n.length()>=r+t&&!(r===0&&t===i)?Ko(n,r,t,!0):Ko(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(e=>typeof e.insert=="string").map(e=>e.insert).join("")}insertContents(e,t){let n=Yo(t),r=(new q.default).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new q.default).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t.length,r,n[r])}),this.update((new q.default).retain(e).insert(t,Wi(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;let e=this.scroll.children.head;if(e?.statics.blotName!==J.blotName)return!1;let t=e;return t.children.length>1?!1:t.children.head instanceof So}removeFormat(e,t){let n=this.getText(e,t),[r,i]=this.scroll.line(e+t),a=0,o=new q.default;r!=null&&(a=r.length()-i,o=r.delta().slice(i,i+a-1).insert("\n"));let s=this.getContents(e,t+a).diff((new q.default).insert(n).concat(o)),c=(new q.default).retain(e).concat(s);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(Uo)&&this.scroll.find(t[0].target)){let i=this.scroll.find(t[0].target),a=Ao(i),o=i.offset(this.scroll),s=t[0].oldValue.replace(jo.CONTENTS,""),c=(new q.default).insert(s),l=(new q.default).insert(i.value()),u=n&&{oldRange:Xo(n.oldRange,-o),newRange:Xo(n.newRange,-o)};e=(new q.default).retain(o).concat(c.diff(l,u)).reduce((e,t)=>t.insert?e.insert(t.insert,a):e.push(t),new q.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!Ia(r.compose(e),this.delta))&&(e=r.diff(this.delta,n));return e}};function Go(e,t,n){if(e.length===0){let[e]=Jo(n.pop());return t<=0?`</li></${e}>`:`</li></${e}>${Go([],t-1,n)}`}let[{child:r,offset:i,length:a,indent:o,type:s},...c]=e,[l,u]=Jo(s);if(o>t)return n.push(s),o===t+1?`<${l}><li${u}>${Ko(r,i,a)}${Go(c,o,n)}`:`<${l}><li>${Go(e,t+1,n)}`;let d=n[n.length-1];if(o===t&&s===d)return`</li><li${u}>${Ko(r,i,a)}${Go(c,o,n)}`;let[f]=Jo(n.pop());return`</li></${f}>${Go(e,t-1,n)}`}function Ko(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in e&&typeof e.html=="function")return e.html(t,n);if(e instanceof Co)return To(e.value().slice(t,t+n)).replaceAll(" ","&nbsp;");if(e instanceof eo){if(e.statics.blotName==="list-container"){let r=[];return e.children.forEachAt(t,n,(e,t,n)=>{let i="formats"in e&&typeof e.formats=="function"?e.formats():{};r.push({child:e,offset:t,length:n,indent:i.indent||0,type:i.list})}),Go(r,-1,[])}let i=[];if(e.children.forEachAt(t,n,(e,t,n)=>{i.push(Ko(e,t,n))}),r||e.statics.blotName==="list")return i.join("");let{outerHTML:a,innerHTML:o}=e.domNode,[s,c]=a.split(`>${o}<`);return s==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${c}`:`${s}>${i.join("")}<${c}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function qo(e,t){return Object.keys(t).reduce((n,r)=>{if(e[r]==null)return n;let i=t[r];return i===e[r]?n[r]=i:Array.isArray(i)?i.indexOf(e[r])<0?n[r]=i.concat([e[r]]):n[r]=i:n[r]=[i,e[r]],n},{})}function Jo(e){let t=e==="ordered"?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Yo(e){return e.reduce((e,t)=>{if(typeof t.insert=="string"){let n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)},new q.default)}function Xo(e,t){let{index:n,length:r}=e;return new Bo(n+t,r)}function Zo(e){let t=[];return e.forEach(e=>{typeof e.insert=="string"?e.insert.split("\n").forEach((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}var Qo=class{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}},$o="\ufeff",es=class extends co{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(e=>{this.contentNode.appendChild(e)}),this.leftGuard=document.createTextNode($o),this.rightGuard=document.createTextNode($o),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,n,r=e.data.split($o).join("");if(e===this.leftGuard)if(this.prev instanceof Co){let e=this.prev.length();this.prev.insertAt(e,r),t={startNode:this.prev.domNode,startOffset:e+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof Co?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data=$o,t}update(e,t){e.forEach(e=>{if(e.type==="characterData"&&(e.target===this.leftGuard||e.target===this.rightGuard)){let n=this.restore(e.target);n&&(t.range=n)}})}},ts=class{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){let t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof es)&&(this.emitter.emit(Y.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Y.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Y.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Y.events.COMPOSITION_END,e),this.isComposing=!1}},ns=class e{static DEFAULTS={modules:{}};static themes={default:e};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]??this.addModule(e)})}addModule(e){let t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}},rs=e=>e.parentElement||e.getRootNode().host||null,is=e=>{let t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},as=e=>{let t=parseInt(e,10);return Number.isNaN(t)?0:t},os=(e,t,n,r,i,a)=>e<n&&t>r?0:e<n?-(n-e+i):t>r?t-e>r-n?e+i-n:t-r+a:0,ss=(e,t)=>{let n=e.ownerDocument,r=t,i=e;for(;i;){let e=i===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:is(i),a=getComputedStyle(i),o=os(r.left,r.right,t.left,t.right,as(a.scrollPaddingLeft),as(a.scrollPaddingRight)),s=os(r.top,r.bottom,t.top,t.bottom,as(a.scrollPaddingTop),as(a.scrollPaddingBottom));if(o||s)if(e)n.defaultView?.scrollBy(o,s);else{let{scrollLeft:e,scrollTop:t}=i;s&&(i.scrollTop+=s),o&&(i.scrollLeft+=o);let n=i.scrollLeft-e,a=i.scrollTop-t;r={left:r.left-n,top:r.top-a,right:r.right-n,bottom:r.bottom-a}}i=e||a.position==="fixed"?null:rs(i)}},cs=100,ls=["block","break","cursor","inline","scroll","text"],us=(e,t,n)=>{let r=new Ha;return ls.forEach(e=>{let n=t.query(e);n&&r.register(n)}),e.forEach(e=>{let i=t.query(e);i||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>cs){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}}),r},ds=Lo("quill"),fs=new Ha;eo.uiClass="ql-ui";var X=class e{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:fs,theme:"default"};static events=Y.events;static sources=Y.sources;static version="2.0.3";static imports={delta:q.default,parchment:Ra,"core/module":Qo,"core/theme":ns};static debug(e){e===!0&&(e="log"),Lo.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return No.get(e)||fs.find(e,t)}static import(e){return this.imports[e]??ds.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){let e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),n="attrName"in e?e.attrName:e.blotName;typeof n=="string"?this.register(`formats/${n}`,e,t):Object.keys(e).forEach(n=>{this.register(n,e[n],t)})}else{let e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!n&&ds.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&fs.register(t),typeof t.register=="function"&&t.register(fs)}}constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=gs(t,n),this.container=this.options.container,this.container==null){ds.error("Invalid Quill container",t);return}this.options.debug&&e.debug(this.options.debug);let r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",No.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Y;let i=po.blotName,a=this.options.registry.query(i);if(!a||!("blotName"in a))throw Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Wo(this.scroll),this.selection=new Vo(this.scroll,this.emitter),this.composition=new ts(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Y.events.EDITOR_CHANGE,e=>{e===Y.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Y.events.SCROLL_UPDATE,(e,t)=>{let n=this.selection.lastRange,[r]=this.selection.getRange(),i=n&&r?{oldRange:n,newRange:r}:void 0;_s.call(this,()=>this.editor.update(null,t,i),e)}),this.emitter.on(Y.events.SCROLL_EMBED_UPDATE,(t,n)=>{let r=this.selection.lastRange,[i]=this.selection.getRange(),a=r&&i?{oldRange:r,newRange:i}:void 0;_s.call(this,()=>{let e=(new q.default).retain(t.offset(this)).retain({[t.statics.blotName]:n});return this.editor.update(e,[],a)},e.sources.USER)}),r){let e=this.clipboard.convert({html:`${r}<p><br></p>`,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){let t=e;e=document.createElement("div"),e.classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=vs(e,t,n),_s.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;let t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Y.sources.API;return _s.call(this,()=>{let n=this.getSelection(!0),r=new q.default;if(n==null)return r;if(this.scroll.query(e,G.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else if(n.length===0)return this.selection.format(e,t),r;else r=this.editor.formatText(n.index,n.length,{[e]:t});return this.setSelection(n,Y.sources.SILENT),r},n)}formatLine(e,t,n,r,i){let a;return[e,t,a,i]=vs(e,t,n,r,i),_s.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,n,r,i){let a;return[e,t,a,i]=vs(e,t,n,r,i),_s.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(n=typeof e=="number"?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;let r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=vs(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e=="number"?this.scroll.lines(e,t):this.scroll.lines(e.index,e.length)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t??=this.getLength()-e),[e,t]=vs(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t??=this.getLength()-e),[e,t]=vs(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.sources.API;return _s.call(this,()=>this.editor.insertEmbed(t,n,r),i,t)}insertText(e,t,n,r,i){let a;return[e,,a,i]=vs(e,0,n,r,i),_s.call(this,()=>this.editor.insertText(e,t,a),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=vs(e,t,n),_s.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){ss(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){let e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y.sources.API;return _s.call(this,()=>{e=new q.default(e);let t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)},t)}setSelection(t,n,r){t==null?this.selection.setRange(null,n||e.sources.API):([t,n,,r]=vs(t,n,r),this.selection.setRange(new Bo(Math.max(0,t),n),r),r!==Y.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y.sources.API,n=(new q.default).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Y.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y.sources.API;return _s.call(this,()=>(e=new q.default(e),this.editor.applyDelta(e)),t,!0)}};function ps(e){return typeof e=="string"?document.querySelector(e):e}function ms(e){return Object.entries(e??{}).reduce((e,t)=>{let[n,r]=t;return{...e,[n]:r===!0?{}:r}},{})}function hs(e){return Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0))}function gs(e,t){let n=ps(e);if(!n)throw Error("Invalid Quill container");let r=!t.theme||t.theme===X.DEFAULTS.theme?ns:X.import(`themes/${t.theme}`);if(!r)throw Error(`Invalid theme ${t.theme}. Did you register it?`);let{modules:i,...a}=X.DEFAULTS,{modules:o,...s}=r.DEFAULTS,c=ms(t.modules);c!=null&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});let l=La({},ms(i),ms(o),c),u={...a,...hs(s),...hs(t)},d=t.registry;return d?t.formats&&ds.warn('Ignoring "formats" option because "registry" is specified'):d=t.formats?us(t.formats,u.registry,ds):u.registry,{...u,registry:d,container:n,theme:r,modules:Object.entries(l).reduce((e,t)=>{let[n,r]=t;if(!r)return e;let i=X.import(`modules/${n}`);return i==null?(ds.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:La({},i.DEFAULTS||{},r)}},{}),bounds:ps(u.bounds)}}function _s(e,t,n,r){if(!this.isEnabled()&&t===Y.sources.USER&&!this.allowReadOnlyEdits)return new q.default;let i=n==null?null:this.getSelection(),a=this.editor.delta,o=e();if(i!=null&&(n===!0&&(n=i.index),r==null?i=ys(i,o,t):r!==0&&(i=ys(i,n,r,t)),this.setSelection(i,Y.sources.SILENT)),o.length()>0){let e=[Y.events.TEXT_CHANGE,o,a,t];this.emitter.emit(Y.events.EDITOR_CHANGE,...e),t!==Y.sources.SILENT&&this.emitter.emit(...e)}return o}function vs(e,t,n,r,i){let a={};return typeof e.index=="number"&&typeof e.length=="number"?typeof t=="number"?(t=e.length,e=e.index):(i=r,r=n,n=t,t=e.length,e=e.index):typeof t!="number"&&(i=r,r=n,n=t,t=0),typeof n=="object"?(a=n,i=r):typeof n=="string"&&(r==null?i=n:a[n]=r),i||=Y.sources.API,[e,t,a,i]}function ys(e,t,n,r){let i=typeof n=="number"?n:0;if(e==null)return null;let a,o;return t&&typeof t.transformPosition=="function"?[a,o]=[e.index,e.index+e.length].map(e=>t.transformPosition(e,r!==Y.sources.USER)):[a,o]=[e.index,e.index+e.length].map(e=>e<t||e===t&&r===Y.sources.USER?e:i>=0?e+i:Math.max(t,e+i)),new Bo(a,o-a)}var bs=class extends so{};function xs(e){return e instanceof J||e instanceof Oo}function Ss(e){return typeof e.updateContent=="function"}var Cs=class extends po{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=J;static allowedChildren=[J,Oo,bs];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",e=>this.handleDragStart(e))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;let e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Y.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Y.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Y.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){let[n,r]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&n!==i&&r>0){if(n instanceof Oo||i instanceof Oo){this.optimize();return}let e=i.children.head instanceof So?null:i.children.head;n.moveChildren(i,e),n.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(n==null||this.scroll.query(t,G.BLOCK)==null){let e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),n==null&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{let e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===G.INLINE_BLOT){let n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){let n=this.deltaToRenderBlocks(t.concat((new q.default).insert("\n"))),r=n.pop();if(r==null)return;this.batchStart();let i=n.shift();if(i){let t=i.type==="block"&&(i.delta.length()===0||!this.descendant(Oo,e)[0]&&e<this.length()),n=i.type==="block"?i.delta:(new q.default).insert({[i.key]:i.value});ws(this,e,n);let r=+(i.type==="block"),a=e+n.length()+r;t&&this.insertAt(a-1,"\n");let o=Ao(this.line(e)[0]),s=q.AttributeMap.diff(o,i.attributes)||{};Object.keys(s).forEach(e=>{this.formatAt(a-1,1,e,s[e])}),e=a}let[a,o]=this.children.find(e);if(n.length&&(a&&(a=a.split(o),o=0),n.forEach(e=>{if(e.type==="block")ws(this.createBlock(e.attributes,a||void 0),0,e.delta);else{let t=this.create(e.key,e.value);this.insertBefore(t,a||void 0),Object.keys(e.attributes).forEach(n=>{t.format(n,e.attributes[n])})}})),r.type==="block"&&r.delta.length()){let e=a?a.offset(a.scroll)+o:this.length();ws(this,e,r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){let t=this.path(e).pop();if(!t)return[null,-1];let[n,r]=t;return n instanceof K?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(xs,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,n=(e,t,r)=>{let i=[],a=r;return e.children.forEachAt(t,r,(e,t,r)=>{xs(e)?i.push(e):e instanceof so&&(i=i.concat(n(e,t,a))),a-=r}),i};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Y.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=Y.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(e=>{let{target:t}=e,n=this.find(t,!0);return n&&!Ss(n)}),e.length>0&&this.emitter.emit(Y.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Y.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){let[r]=this.descendant(e=>e instanceof Oo,e);r&&r.statics.blotName===t&&Ss(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){let t=[],n=new q.default;return e.forEach(e=>{let r=e?.insert;if(r)if(typeof r=="string"){let i=r.split("\n");i.slice(0,-1).forEach(r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new q.default});let a=i[i.length-1];a&&n.insert(a,e.attributes)}else{let i=Object.keys(r)[0];if(!i)return;this.query(i,G.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new q.default,t.push({type:"blockEmbed",key:i,value:r[i],attributes:e.attributes??{}}))}}),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n,r={};Object.entries(e).forEach(e=>{let[t,i]=e;this.query(t,G.BLOCK&G.BLOT)==null?r[t]=i:n=t});let i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);let a=i.length();return Object.entries(r).forEach(e=>{let[t,n]=e;i.formatAt(0,a,t,n)}),i}};function ws(e,t,n){n.reduce((t,n)=>{let r=q.Op.length(n),i=n.attributes||{};if(n.insert!=null){if(typeof n.insert=="string"){let r=n.insert;e.insertAt(t,r);let[a]=e.descendant(K,t),o=Ao(a);i=q.AttributeMap.diff(o,i)||{}}else if(typeof n.insert=="object"){let r=Object.keys(n.insert)[0];if(r==null)return t;if(e.insertAt(t,r,n.insert[r]),e.scroll.query(r,G.INLINE)!=null){let[n]=e.descendant(K,t),r=Ao(n);i=q.AttributeMap.diff(r,i)||{}}}}return Object.keys(i).forEach(n=>{e.formatAt(t,r,n,i[n])}),t+r},t)}var Ts={scope:G.BLOCK,whitelist:["right","center","justify"]},Es=new za("align","align",Ts),Ds=new Wa("align","ql-align",Ts),Os=new Ka("align","text-align",Ts),ks=class extends Ka{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(e=>`00${parseInt(e,10).toString(16)}`.slice(-2)).join("")}`):t}},As=new Wa("color","ql-color",{scope:G.INLINE}),js=new ks("color","color",{scope:G.INLINE}),Ms=new Wa("background","ql-bg",{scope:G.INLINE}),Ns=new ks("background","background-color",{scope:G.INLINE}),Ps=class extends bs{static create(e){let t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(e=>e.length()<=1?"":e.domNode.innerText).join("\n").slice(e,e+t)}html(e,t){return`<pre>\n${To(this.code(e,t))}\n</pre>`}},Z=class extends J{static TAB=" ";static register(){X.register(Ps)}},Fs=class extends Eo{};Fs.blotName="code",Fs.tagName="CODE",Z.blotName="code-block",Z.className="ql-code-block",Z.tagName="DIV",Ps.blotName="code-block-container",Ps.className="ql-code-block-container",Ps.tagName="DIV",Ps.allowedChildren=[Z],Z.allowedChildren=[Co,So,jo],Z.requiredContainer=Ps;var Is={scope:G.BLOCK,whitelist:["rtl"]},Ls=new za("direction","dir",Is),Rs=new Wa("direction","ql-direction",Is),zs=new Ka("direction","direction",Is),Bs={scope:G.INLINE,whitelist:["serif","monospace"]},Vs=new Wa("font","ql-font",Bs),Hs=new class extends Ka{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",Bs),Us=new Wa("size","ql-size",{scope:G.INLINE,whitelist:["small","large","huge"]}),Ws=new Ka("size","font-size",{scope:G.INLINE,whitelist:["10px","18px","32px"]}),Gs=Lo("quill:keyboard"),Ks=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",qs=class e extends Qo{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Qs(e);if(r==null){Gs.warn("Attempted to add invalid keyboard binding",r);return}typeof t=="function"&&(t={handler:t}),typeof n=="function"&&(n={handler:n}),(Array.isArray(r.key)?r.key:[r.key]).forEach(e=>{let i={...r,key:e,...t,...n};this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;let n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(n=>e.match(t,n));if(n.length===0)return;let r=X.find(t.target,!0);if(r&&r.scroll!==this.quill.scroll)return;let i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;let[a,o]=this.quill.getLine(i.index),[s,c]=this.quill.getLeaf(i.index),[l,u]=i.length===0?[s,c]:this.quill.getLeaf(i.index+i.length),d=s instanceof ho?s.value().slice(0,c):"",f=l instanceof ho?l.value().slice(u):"",p={collapsed:i.length===0,empty:i.length===0&&a.length()<=1,format:this.quill.getFormat(i),line:a,offset:o,prefix:d,suffix:f,event:t};n.some(e=>{if(e.collapsed!=null&&e.collapsed!==p.collapsed||e.empty!=null&&e.empty!==p.empty||e.offset!=null&&e.offset!==p.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(e=>p.format[e]==null))return!1}else if(typeof e.format=="object"&&!Object.keys(e.format).every(t=>e.format[t]===!0?p.format[t]!=null:e.format[t]===!1?p.format[t]==null:Ia(e.format[t],p.format[t])))return!1;return e.prefix!=null&&!e.prefix.test(p.prefix)||e.suffix!=null&&!e.suffix.test(p.suffix)?!1:e.handler.call(this,i,p,e)!==!0})&&t.preventDefault()})}handleBackspace(e,t){let n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let r={},[i]=this.quill.getLine(e.index),a=(new q.default).retain(e.index-n).delete(n);if(t.offset===0){let[t]=this.quill.getLine(e.index-1);if(t&&!(t.statics.blotName==="block"&&t.length()<=1)){let t=i.formats(),n=this.quill.getFormat(e.index-1,1);if(r=q.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){let t=(new q.default).retain(e.index+i.length()-2).retain(1,r);a=a.compose(t)}}}this.quill.updateContents(a,X.sources.USER),this.quill.focus()}handleDelete(e,t){let n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={},[i]=this.quill.getLine(e.index),a=(new q.default).retain(e.index).delete(n);if(t.offset>=i.length()-1){let[t]=this.quill.getLine(e.index+1);if(t){let n=i.formats(),o=this.quill.getFormat(e.index,1);r=q.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(a=a.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(a,X.sources.USER),this.quill.focus()}handleDeleteRange(e){$s({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){let n=Object.keys(t.format).reduce((e,n)=>(this.quill.scroll.query(n,G.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e),{}),r=(new q.default).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,X.sources.USER),this.quill.setSelection(e.index+1,X.sources.SILENT),this.quill.focus()}};qs.DEFAULTS={bindings:{bold:Xs("bold"),italic:Xs("italic"),underline:Xs("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",X.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",X.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){t.format.indent==null?t.format.list!=null&&this.quill.format("list",!1,X.sources.USER):this.quill.format("indent","-1",X.sources.USER)}},"indent code-block":Js(!0),"outdent code-block":Js(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,X.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();let n=(new q.default).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,X.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,X.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,X.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){let n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,X.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){let[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},i=(new q.default).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,X.sources.USER),this.quill.setSelection(e.index+1,X.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){let[n,r]=this.quill.getLine(e.index),i=(new q.default).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,X.sources.USER),this.quill.setSelection(e.index+1,X.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){let t=this.quill.getModule("table");if(t){let[n,r,i,a]=t.getTable(e),o=ec(n,r,i,a);if(o==null)return;let s=n.offset();if(o<0){let t=(new q.default).retain(s).insert("\n");this.quill.updateContents(t,X.sources.USER),this.quill.setSelection(e.index+1,e.length,X.sources.SILENT)}else if(o>0){s+=n.length();let e=(new q.default).retain(s).insert("\n");this.quill.updateContents(e,X.sources.USER),this.quill.setSelection(s,X.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){let{event:n,line:r}=t,i=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,X.sources.USER):this.quill.setSelection(i+r.length(),X.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(this.quill.scroll.query("list")==null)return!0;let{length:n}=t.prefix,[r,i]=this.quill.getLine(e.index);if(i>n)return!0;let a;switch(t.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(e.index," ",X.sources.USER),this.quill.history.cutoff();let o=(new q.default).retain(e.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:a});return this.quill.updateContents(o,X.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,X.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){let[t,n]=this.quill.getLine(e.index),r=2,i=t;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,--r,r<=0){let r=(new q.default).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,X.sources.USER),this.quill.setSelection(e.index-1,X.sources.SILENT),!1}return!0}},"embed left":Ys("ArrowLeft",!1),"embed left shift":Ys("ArrowLeft",!0),"embed right":Ys("ArrowRight",!1),"embed right shift":Ys("ArrowRight",!0),"table down":Zs(!1),"table up":Zs(!0)}};function Js(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n,{TAB:i}=this.quill.scroll.query("code-block");if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,X.sources.USER),this.quill.setSelection(t.index+i.length,X.sources.SILENT);return}let a=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t),{index:o,length:s}=t;a.forEach((t,n)=>{e?(t.insertAt(0,i),n===0?o+=i.length:s+=i.length):t.domNode.textContent.startsWith(i)&&(t.deleteAt(0,i.length),n===0?o-=i.length:s-=i.length)}),this.quill.update(X.sources.USER),this.quill.setSelection(o,s,X.sources.SILENT)}}}function Ys(e,t){return{key:e,shiftKey:t,altKey:null,[e==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:r}=n;e==="ArrowRight"&&(r+=n.length+1);let[i]=this.quill.getLeaf(r);return i instanceof co?(e==="ArrowLeft"?t?this.quill.setSelection(n.index-1,n.length+1,X.sources.USER):this.quill.setSelection(n.index-1,X.sources.USER):t?this.quill.setSelection(n.index,n.length+1,X.sources.USER):this.quill.setSelection(n.index+n.length+1,X.sources.USER),!1):!0}}}function Xs(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],X.sources.USER)}}}function Zs(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){let r=e?"prev":"next",i=n.line,a=i.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let e=a.children.head,t=i;for(;t.prev!=null;)t=t.prev,e=e.next;let r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,X.sources.USER)}}else{let t=i.table()[r];t!=null&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,X.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,X.sources.USER))}return!1}}}function Qs(e){if(typeof e=="string"||typeof e=="number")e={key:e};else if(typeof e=="object")e=Wi(e);else return null;return e.shortKey&&(e[Ks]=e.shortKey,delete e.shortKey),e}function $s(e){let{quill:t,range:n}=e,r=t.getLines(n),i={};if(r.length>1){let e=r[0].formats(),t=r[r.length-1].formats();i=q.AttributeMap.diff(t,e)||{}}t.deleteText(n,X.sources.USER),Object.keys(i).length>0&&t.formatLine(n.index,1,i,X.sources.USER),t.setSelection(n.index,X.sources.SILENT)}function ec(e,t,n,r){return t.prev==null&&t.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}var tc=/font-weight:\s*normal/,nc=["P","OL","UL"],rc=e=>e&&nc.includes(e.tagName),ic=e=>{Array.from(e.querySelectorAll("br")).filter(e=>rc(e.previousElementSibling)&&rc(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},ac=e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(tc)).forEach(t=>{let n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)})};function oc(e){e.querySelector('[id^="docs-internal-guid-"]')&&(ac(e),ic(e))}var sc=/\bmso-list:[^;]*ignore/i,cc=/\bmso-list:[^;]*\bl(\d+)/i,lc=/\bmso-list:[^;]*\blevel(\d+)/i,uc=(e,t)=>{let n=e.getAttribute("style"),r=n?.match(cc);if(!r)return null;let i=Number(r[1]),a=n?.match(lc),o=a?Number(a[1]):1,s=RegExp(`@list l${i}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=t.match(s);return{id:i,indent:o,type:c&&c[1]==="bullet"?"bullet":"ordered",element:e}},dc=e=>{let t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach(e=>{(e.getAttribute("style")||"").match(sc)?n.push(e):r.push(e)}),n.forEach(e=>e.parentNode?.removeChild(e));let i=e.documentElement.innerHTML,a=r.map(e=>uc(e,i)).filter(e=>e);for(;a.length;){let e=[],t=a.shift();for(;t;)e.push(t),t=a.length&&a[0]?.element===t.element.nextElementSibling&&a[0].id===t.id?a.shift():null;let n=document.createElement("ul");e.forEach(e=>{let t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class",`ql-indent-${e.indent-1}`),t.innerHTML=e.element.innerHTML,n.appendChild(t)});let r=e[0]?.element,{parentNode:i}=r??{};r&&i?.replaceChild(n,r),e.slice(1).forEach(e=>{let{element:t}=e;i?.removeChild(t)})}};function fc(e){e.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&dc(e)}var pc=[fc,oc],mc=e=>{e.documentElement&&pc.forEach(t=>{t(e)})},hc=Lo("quill:clipboard"),gc=[[Node.TEXT_NODE,Rc],[Node.TEXT_NODE,Fc],["br",Ac],[Node.ELEMENT_NODE,Fc],[Node.ELEMENT_NODE,kc],[Node.ELEMENT_NODE,Oc],[Node.ELEMENT_NODE,Ic],["li",Nc],["ol, ul",Pc],["pre",jc],["tr",Lc],["b",Dc("bold")],["i",Dc("italic")],["strike",Dc("strike")],["style",Mc]],_c=[Es,Ls].reduce((e,t)=>(e[t.keyName]=t,e),{}),vc=[Os,Ns,js,zs,Hs,Ws].reduce((e,t)=>(e[t.keyName]=t,e),{}),yc=class extends Qo{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",e=>this.onCaptureCopy(e,!1)),this.quill.root.addEventListener("cut",e=>this.onCaptureCopy(e,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],gc.concat(this.options.matchers??[]).forEach(e=>{let[t,n]=e;this.addMatcher(t,n)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r[Z.blotName])return(new q.default).insert(n||"",{[Z.blotName]:r[Z.blotName]});if(!t)return(new q.default).insert(n||"",r);let i=this.convertHTML(t);return xc(i,"\n")&&(i.ops[i.ops.length-1].attributes==null||r.table)?i.compose((new q.default).retain(i.length()-1).delete(1)):i}normalizeHTML(e){mc(e)}convertHTML(e){let t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);let n=t.body,r=new WeakMap,[i,a]=this.prepareMatching(n,r);return Ec(this.quill.scroll,n,i,a,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:X.sources.API;if(typeof e=="string"){let n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,X.sources.SILENT)}else{let r=this.convert({html:t,text:""});this.quill.updateContents((new q.default).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),X.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();let[n]=this.quill.selection.getRange();if(n==null)return;let{html:r,text:i}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",r),t&&$s({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(e=>e[0]!=="#").join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();let t=this.quill.getSelection(!0);if(t==null)return;let n=e.clipboardData?.getData("text/html"),r=e.clipboardData?.getData("text/plain");if(!n&&!r){let t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}let i=Array.from(e.clipboardData?.files||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){let e=(new DOMParser).parseFromString(n,"text/html");if(e.body.childElementCount===1&&e.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:r})}onCopy(e){let t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t,i=this.quill.getFormat(e.index),a=this.convert({text:n,html:r},i);hc.log("onPaste",a,{text:n,html:r});let o=(new q.default).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,X.sources.USER),this.quill.setSelection(o.length()-e.length,X.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){let n=[],r=[];return this.matchers.forEach(i=>{let[a,o]=i;switch(a){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach(e=>{t.has(e)?t.get(e)?.push(o):t.set(e,[o])});break}}),[n,r]}};function bc(e,t,n,r){return r.query(t)?e.reduce((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);let i=n?{[t]:n}:{};return e.insert(r.insert,{...i,...r.attributes})},new q.default):e}function xc(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.length<t.length;--r){let t=e.ops[r];if(typeof t.insert!="string")break;n=t.insert+n}return n.slice(-1*t.length)===t}function Sc(e,t){if(!(e instanceof Element))return!1;let n=t.query(e);return n&&n.prototype instanceof co?!1:"address.article.blockquote.canvas.dd.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.iframe.li.main.nav.ol.output.p.pre.section.table.td.tr.ul.video".split(".").includes(e.tagName.toLowerCase())}function Cc(e,t){return e.previousElementSibling&&e.nextElementSibling&&!Sc(e.previousElementSibling,t)&&!Sc(e.nextElementSibling,t)}var wc=new WeakMap;function Tc(e){return e==null?!1:(wc.has(e)||(e.tagName==="PRE"?wc.set(e,!0):wc.set(e,Tc(e.parentNode))),wc.get(e))}function Ec(e,t,n,r,i){return t.nodeType===t.TEXT_NODE?r.reduce((n,r)=>r(t,n,e),new q.default):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((a,o)=>{let s=Ec(e,o,n,r,i);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce((t,n)=>n(o,t,e),s),s=(i.get(o)||[]).reduce((t,n)=>n(o,t,e),s)),a.concat(s)},new q.default):new q.default}function Dc(e){return(t,n,r)=>bc(n,e,!0,r)}function Oc(e,t,n){let r=za.keys(e),i=Wa.keys(e),a=Ka.keys(e),o={};return r.concat(i).concat(a).forEach(t=>{let r=n.query(t,G.ATTRIBUTE);r!=null&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=_c[t],r!=null&&(r.attrName===t||r.keyName===t)&&(o[r.attrName]=r.value(e)||void 0),r=vc[t],r!=null&&(r.attrName===t||r.keyName===t)&&(r=vc[t],o[r.attrName]=r.value(e)||void 0))}),Object.entries(o).reduce((e,t)=>{let[r,i]=t;return bc(e,r,i,n)},t)}function kc(e,t,n){let r=n.query(e);if(r==null)return t;if(r.prototype instanceof co){let t={},i=r.value(e);if(i!=null)return t[r.blotName]=i,(new q.default).insert(t,r.formats(e,n))}else if(r.prototype instanceof ao&&!xc(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return bc(t,r.blotName,r.formats(e,n),n);return t}function Ac(e,t){return xc(t,"\n")||t.insert("\n"),t}function jc(e,t,n){let r=n.query("code-block");return bc(t,"code-block",r&&"formats"in r&&typeof r.formats=="function"?r.formats(e,n):!0,n)}function Mc(){return new q.default}function Nc(e,t,n){let r=n.query(e);if(r==null||r.blotName!=="list"||!xc(t,"\n"))return t;let i=-1,a=e.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(i+=1),a=a.parentNode;return i<=0?t:t.reduce((e,t)=>t.insert?t.attributes&&typeof t.attributes.indent=="number"?e.push(t):e.insert(t.insert,{indent:i,...t.attributes||{}}):e,new q.default)}function Pc(e,t,n){let r=e,i=r.tagName==="OL"?"ordered":"bullet",a=r.getAttribute("data-checked");return a&&(i=a==="true"?"checked":"unchecked"),bc(t,"list",i,n)}function Fc(e,t,n){if(!xc(t,"\n")){if(Sc(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;r!=null;){if(Sc(r,n))return t.insert("\n");let e=n.query(r);if(e&&e.prototype instanceof Oo)return t.insert("\n");r=r.firstChild}}}return t}function Ic(e,t,n){let r={},i=e.style||{};return i.fontStyle==="italic"&&(r.italic=!0),i.textDecoration==="underline"&&(r.underline=!0),i.textDecoration==="line-through"&&(r.strike=!0),(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((e,t)=>{let[r,i]=t;return bc(e,r,i,n)},t),parseFloat(i.textIndent||0)>0?(new q.default).insert("\t").concat(t):t}function Lc(e,t,n){let r=e.parentElement?.tagName==="TABLE"?e.parentElement:e.parentElement?.parentElement;return r==null?t:bc(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n)}function Rc(e,t,n){let r=e.data;if(e.parentElement?.tagName==="O:P")return t.insert(r.trim());if(!Tc(e)){if(r.trim().length===0&&r.includes("\n")&&!Cc(e,n))return t;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(e.previousSibling==null&&e.parentElement!=null&&Sc(e.parentElement,n)||e.previousSibling instanceof Element&&Sc(e.previousSibling,n))&&(r=r.replace(/^ /,"")),(e.nextSibling==null&&e.parentElement!=null&&Sc(e.parentElement,n)||e.nextSibling instanceof Element&&Sc(e.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return t.insert(r)}var zc=class extends Qo{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(X.events.EDITOR_CHANGE,(e,t,n,r)=>{e===X.events.SELECTION_CHANGE?t&&r!==X.sources.SILENT&&(this.currentRange=t):e===X.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||r===X.sources.USER?this.record(t,n):this.transform(t)),this.currentRange=Uc(this.currentRange,t))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",e=>{e.inputType==="historyUndo"?(this.undo(),e.preventDefault()):e.inputType==="historyRedo"&&(this.redo(),e.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;let n=this.stack[e].pop();if(!n)return;let r=this.quill.getContents(),i=n.delta.invert(r);this.stack[t].push({delta:i,range:Uc(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,X.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange,i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){let e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=i;n.length()!==0&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Bc(this.stack.undo,e),Bc(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,X.sources.USER);else{let t=Hc(this.quill.scroll,e.delta);this.quill.setSelection(t,X.sources.USER)}}};function Bc(e,t){let n=t;for(let t=e.length-1;t>=0;--t){let r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&Uc(r.range,n)},n=r.delta.transform(n),e[t].delta.length()===0&&e.splice(t,1)}}function Vc(e,t){let n=t.ops[t.ops.length-1];return n==null?!1:n.insert==null?n.attributes==null?!1:Object.keys(n.attributes).some(t=>e.query(t,G.BLOCK)!=null):typeof n.insert=="string"&&n.insert.endsWith("\n")}function Hc(e,t){let n=t.reduce((e,t)=>e+(t.delete||0),0),r=t.length()-n;return Vc(e,t)&&--r,r}function Uc(e,t){if(!e)return e;let n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}var Wc=class extends Qo{constructor(e,t){super(e,t),e.root.addEventListener("drop",t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){let e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}let r=n&&e.selection.normalizeNative(n);if(r){let n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}})}upload(e,t){let n=[];Array.from(t).forEach(e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)}),n.length>0&&this.options.handler.call(this,e,n)}};Wc.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;let n=t.map(e=>new Promise(t=>{let n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}));Promise.all(n).then(t=>{let n=t.reduce((e,t)=>e.insert({image:t}),(new q.default).retain(e.index).delete(e.length));this.quill.updateContents(n,Y.sources.USER),this.quill.setSelection(e.index+t.length,Y.sources.SILENT)})}};var Gc=["insertText","insertReplacementText"],Kc=class extends Qo{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",e=>{this.handleBeforeInput(e)}),/Android/i.test(navigator.userAgent)||e.on(X.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){$s({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){let n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new q.default).retain(e.index).insert(t,n),X.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,X.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Gc.includes(e.inputType))return;let t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;let n=qc(e);if(n==null)return;let r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){let e=this.quill.getSelection();e&&this.replaceText(e)}};function qc(e){return typeof e.data=="string"?e.data:e.dataTransfer?.types.includes("text/plain")?e.dataTransfer.getData("text/plain"):null}var Jc=/Mac/i.test(navigator.platform),Yc=e=>!!(e.key==="ArrowLeft"||e.key==="ArrowRight"||e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="Home"||Jc&&e.key==="a"&&e.ctrlKey===!0),Xc=class extends Qo{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof eo)||!n.uiNode)return!0;let i=getComputedStyle(n.domNode).direction==="rtl";return i&&r.key!=="ArrowRight"||!i&&r.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+ +!!r.shiftKey,X.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Yc(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,!this.isListening&&(this.isListening=!0,document.addEventListener("selectionchange",()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0}))}handleSelectionChange(){let e=document.getSelection();if(!e)return;let t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;let n=this.quill.scroll.find(t.startContainer);if(!(n instanceof eo)||!n.uiNode)return;let r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}};X.register({"blots/block":J,"blots/block/embed":Oo,"blots/break":So,"blots/container":bs,"blots/cursor":jo,"blots/embed":es,"blots/inline":Eo,"blots/scroll":Cs,"blots/text":Co,"modules/clipboard":yc,"modules/history":zc,"modules/keyboard":qs,"modules/uploader":Wc,"modules/input":Kc,"modules/uiNode":Xc});var Zc=X,Qc=new class extends Wa{add(e,t){let n=0;if(t==="+1"||t==="-1"){let r=this.value(e)||0;n=t==="+1"?r+1:r-1}else typeof t=="number"&&(n=t);return n===0?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:G.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),$c=class extends J{static blotName="blockquote";static tagName="blockquote"},el=class extends J{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},tl=class extends bs{};tl.blotName="list-container",tl.tagName="OL";var nl=class extends J{static create(e){let t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){X.register(tl)}constructor(e,t){super(e,t);let n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;let r=this.statics.formats(t,e);r==="checked"?(this.format("list","unchecked"),n.preventDefault()):r==="unchecked"&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}};nl.blotName="list",nl.tagName="LI",tl.allowedChildren=[nl],nl.requiredContainer=tl;var rl=class extends Eo{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}},il=class extends rl{static blotName="italic";static tagName=["EM","I"]},al=class extends Eo{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){let t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return ol(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}};function ol(e,t){let n=document.createElement("a");n.href=e;let r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}var sl=class extends Eo{static blotName="script";static tagName=["SUB","SUP"];static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}},cl=class extends rl{static blotName="strike";static tagName=["S","STRIKE"]},ll=class extends Eo{static blotName="underline";static tagName="U"},ul=class extends es{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw Error("Formula module requires KaTeX.");let t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){let{formula:e}=this.value();return`<span>${e}</span>`}},dl=["alt","height","width"],fl=class extends co{static blotName="image";static tagName="IMG";static create(e){let t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return dl.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return ol(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){dl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},pl=["height","width"],ml=class extends Oo{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){let t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return pl.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return al.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){pl.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){let{video:e}=this.value();return`<a href="${e}">${e}</a>`}},hl=new Wa("code-token","hljs",{scope:G.INLINE}),gl=class e extends Eo{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Z.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),hl.add(this.domNode,n)}format(t,n){t===e.blotName?n?hl.add(this.domNode,n):(hl.remove(this.domNode),this.domNode.classList.remove(this.statics.className)):super.format(t,n)}optimize(){super.optimize(...arguments),hl.value(this.domNode)||this.unwrap()}};gl.blotName="code-token",gl.className="ql-token";var _l=class extends Z{static create(e){let t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),gl.blotName,!1),super.replaceWith(e,t)}},vl=class extends Ps{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===_l.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,r){n===_l.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;let n=`${Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).map(e=>e.textContent).join("\n")}\n`,r=_l.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||this.cachedText==null){let t=this.children.reduce((e,t)=>e.concat(ko(t,!1)),new q.default),i=e(n,r);t.diff(i).reduce((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach(t=>{[_l.blotName,gl.blotName].includes(t)&&this.formatAt(e,n,t,r[t])}),e+n):e},0)}this.cachedText=n,this.forceNext=!1}}html(e,t){let[n]=this.children.find(e);return`<pre data-language="${n?_l.formats(n.domNode):"plain"}">\n${To(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){let e=_l.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}};vl.allowedChildren=[_l],_l.requiredContainer=vl,_l.allowedChildren=[gl,jo,Co,So];var yl=(e,t,n)=>{if(typeof e.versionString=="string"){let r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value},bl=class extends Qo{static register(){X.register(gl,!0),X.register(_l,!0),X.register(vl,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((e,t)=>{let{key:n}=t;return e[n]=!0,e},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(X.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof vl))return;let t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(e=>{let{key:n,label:r}=e,i=t.ownerDocument.createElement("option");i.textContent=r,i.setAttribute("value",n),t.appendChild(i)}),t.addEventListener("change",()=>{e.format(_l.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode??(e.attachUI(t),e.children.head&&(t.value=_l.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(X.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(X.sources.USER);let n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(vl):[e]).forEach(e=>{e.highlight(this.highlightBlot,t)}),this.quill.update(X.sources.SILENT),n!=null&&this.quill.setSelection(n,X.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return To(e).split("\n").reduce((e,n,r)=>(r!==0&&e.insert("\n",{[Z.blotName]:t}),e.insert(n)),new q.default);let n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Z.className),n.innerHTML=yl(this.options.hljs,t,e),Ec(this.quill.scroll,n,[(e,t)=>{let n=hl.value(e);return n?t.compose((new q.default).retain(t.length(),{[gl.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce((e,n,r)=>(r!==0&&e.insert("\n",{[Z.blotName]:t}),e.insert(n)),n)],new WeakMap)}};bl.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};var xl=class e extends J{static blotName="table";static tagName="TD";static create(e){let t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Tl()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===e.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}},Sl=class extends bs{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){let e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(e=>{if(e.next==null)return;let t=e.formats(),n=e.next.formats();if(t.table!==n.table){let t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}},Cl=class extends bs{static blotName="table-body";static tagName="TBODY"},wl=class extends bs{static blotName="table-container";static tagName="TABLE";balanceCells(){let e=this.descendants(Sl),t=e.reduce((e,t)=>Math.max(t.children.length,e),0);e.forEach(e=>{Array(t-e.children.length).fill(0).forEach(()=>{let t;e.children.head!=null&&(t=xl.formats(e.children.head.domNode));let n=this.scroll.create(xl.blotName,t);e.appendChild(n),n.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){let[t]=this.descendant(Cl);t==null||t.children.head==null||t.children.forEach(t=>{t.children.at(e)?.remove()})}insertColumn(e){let[t]=this.descendant(Cl);t==null||t.children.head==null||t.children.forEach(t=>{let n=t.children.at(e),r=xl.formats(t.children.head.domNode),i=this.scroll.create(xl.blotName,r);t.insertBefore(i,n)})}insertRow(e){let[t]=this.descendant(Cl);if(t==null||t.children.head==null)return;let n=Tl(),r=this.scroll.create(Sl.blotName);t.children.head.children.forEach(()=>{let e=this.scroll.create(xl.blotName,n);r.appendChild(e)});let i=t.children.at(e);t.insertBefore(r,i)}rows(){let e=this.children.head;return e==null?[]:e.children.map(e=>e)}};wl.allowedChildren=[Cl],Cl.requiredContainer=wl,Cl.allowedChildren=[Sl],Sl.requiredContainer=Cl,Sl.allowedChildren=[xl],xl.requiredContainer=Sl;function Tl(){return`row-${Math.random().toString(36).slice(2,6)}`}var El=class extends Qo{static register(){X.register(xl),X.register(Sl),X.register(Cl),X.register(wl)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(wl).forEach(e=>{e.balanceCells()})}deleteColumn(){let[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(X.sources.USER))}deleteRow(){let[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(X.sources.USER))}deleteTable(){let[e]=this.getTable();if(e==null)return;let t=e.offset();e.remove(),this.quill.update(X.sources.USER),this.quill.setSelection(t,X.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];let[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==xl.blotName)return[null,null,null,-1];let r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=i.cellOffset();n.insertColumn(a+e),this.quill.update(X.sources.USER);let o=r.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,X.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=r.rowOffset();n.insertRow(a+e),this.quill.update(X.sources.USER),e>0?this.quill.setSelection(t,X.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,X.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){let n=this.quill.getSelection();if(n==null)return;let r=Array(e).fill(0).reduce(e=>{let n=Array(t).fill("\n").join("");return e.insert(n,{table:Tl()})},(new q.default).retain(n.index));this.quill.updateContents(r,X.sources.USER),this.quill.setSelection(n.index,X.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(X.events.SCROLL_OPTIMIZE,e=>{e.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(X.events.TEXT_CHANGE,(e,t,n)=>{n===X.sources.USER&&this.balanceTables()}),!0):!1)})}},Dl=Lo("quill:toolbar"),Ol=class extends Qo{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){let t=document.createElement("div");t.setAttribute("role","toolbar"),Al(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Dl.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(e=>{let t=this.options.handlers?.[e];t&&this.addHandler(e,t)}),Array.from(this.container.querySelectorAll("button, select")).forEach(e=>{this.attach(e)}),this.quill.on(X.events.EDITOR_CHANGE,()=>{let[e]=this.quill.selection.getRange();this.update(e)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(e=>e.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Dl.warn("ignoring attaching to nonexistent format",t,e);return}let n=e.tagName==="SELECT"?"change":"click";e.addEventListener(n,n=>{let r;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;let t=e.options[e.selectedIndex];r=t.hasAttribute("selected")?!1:t.value||!1}else r=e.classList.contains("ql-active")?!1:e.value||!e.hasAttribute("value"),n.preventDefault();this.quill.focus();let[i]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof co){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new q.default).retain(i.index).delete(i.length).insert({[t]:r}),X.sources.USER)}else this.quill.format(t,r,X.sources.USER);this.update(i)}),this.controls.push([t,e])}update(e){let t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{let[r,i]=n;if(i.tagName==="SELECT"){let n=null;if(e==null)n=null;else if(t[r]==null)n=i.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];typeof e=="string"&&(e=e.replace(/"/g,'\\"')),n=i.querySelector(`option[value="${e}"]`)}n==null?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){let e=t[r],n=e===i.getAttribute("value")||e!=null&&e.toString()===i.getAttribute("value")||e==null&&!i.getAttribute("value");i.classList.toggle("ql-active",n),i.setAttribute("aria-pressed",n.toString())}else{let e=t[r]!=null;i.classList.toggle("ql-active",e),i.setAttribute("aria-pressed",e.toString())}})}};Ol.DEFAULTS={};function kl(e,t,n){let r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),n==null?r.setAttribute("aria-label",t):(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)),e.appendChild(r)}function Al(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(t=>{let n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(e=>{if(typeof e=="string")kl(n,e);else{let t=Object.keys(e)[0],r=e[t];Array.isArray(r)?jl(n,t,r):kl(n,t,r)}}),e.appendChild(n)})}function jl(e,t,n){let r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach(e=>{let t=document.createElement("option");e===!1?t.setAttribute("selected","selected"):t.setAttribute("value",String(e)),r.appendChild(t)}),e.appendChild(r)}Ol.DEFAULTS={container:null,handlers:{clean(){let e=this.quill.getSelection();if(e!=null)if(e.length===0){let e=this.quill.getFormat();Object.keys(e).forEach(e=>{this.quill.scroll.query(e,G.INLINE)!=null&&this.quill.format(e,!1,X.sources.USER)})}else this.quill.removeFormat(e.index,e.length,X.sources.USER)},direction(e){let{align:t}=this.quill.getFormat();e==="rtl"&&t==null?this.quill.format("align","right",X.sources.USER):!e&&t==="right"&&this.quill.format("align",!1,X.sources.USER),this.quill.format("direction",e,X.sources.USER)},indent(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e==="+1"||e==="-1"){let t=e==="+1"?1:-1;n.direction==="rtl"&&(t*=-1),this.quill.format("indent",r+t,X.sources.USER)}},link(e){e===!0&&(e=prompt("Enter link URL:")),this.quill.format("link",e,X.sources.USER)},list(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t);e==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,X.sources.USER):this.quill.format("list","unchecked",X.sources.USER):this.quill.format("list",e,X.sources.USER)}}};var Ml='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Nl='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Pl='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Fl='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Il='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Ll='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Rl='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',zl='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Bl='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Vl={align:{"":Ml,center:Nl,right:Pl,justify:Fl},background:Il,blockquote:Ll,bold:Rl,clean:zl,code:Bl,"code-block":Bl,color:'<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',direction:{"":'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',rtl:'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>'},formula:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',header:{1:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',2:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',3:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',4:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',5:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',6:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>'},italic:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',image:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indent:{"+1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',"-1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>'},link:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',list:{bullet:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',check:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',ordered:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>'},script:{sub:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',super:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>'},strike:'<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',table:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underline:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',video:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>'},Hl='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>',Ul=0;function Wl(e,t){e.setAttribute(t,`${e.getAttribute(t)!=="true"}`)}var Gl=class{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault();break;default:}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Wl(this.label,"aria-expanded"),Wl(this.options,"aria-hidden")}buildItem(e){let t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");let n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault();break;default:}}),t}buildLabel(){let e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Hl,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){let e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Ul}`,Ul+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{let n=this.buildItem(t);e.appendChild(n),t.selected===!0&&this.selectItem(n)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.container.querySelector(".ql-selected");e!==n&&(n?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){let t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);let t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}},Kl=class extends Gl{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(e=>{e.classList.add("ql-primary")})}buildItem(e){let t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);let n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&(n.tagName==="line"?n.style.stroke=r:n.style.fill=r)}},ql=class extends Gl{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(e=>{e.innerHTML=t[e.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);let n=e||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}},Jl=e=>{let{overflowY:t}=getComputedStyle(e,null);return t!=="visible"&&t!=="clip"},Yl=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Jl(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){let t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");let r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect(),a=0;if(i.right>r.right&&(a=r.right-i.right,this.root.style.left=`${t+a}px`),i.left<r.left&&(a=r.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>r.bottom){let t=i.bottom-i.top,r=e.bottom-e.top+t;this.root.style.top=`${n-r}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}},Xl=[!1,"center","right","justify"],Zl="#000000.#e60000.#ff9900.#ffff00.#008a00.#0066cc.#9933ff.#ffffff.#facccc.#ffebcc.#ffffcc.#cce8cc.#cce0f5.#ebd6ff.#bbbbbb.#f06666.#ffc266.#ffff66.#66b966.#66a3e0.#c285ff.#888888.#a10000.#b26b00.#b2b200.#006100.#0047b2.#6b24b2.#444444.#5c0000.#663d00.#666600.#003700.#002966.#3d1466".split("."),Ql=[!1,"serif","monospace"],$l=["1","2","3",!1],eu=["small",!1,"large","huge"],tu=class extends ns{constructor(e,t){super(e,t);let n=t=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",n);return}this.tooltip!=null&&!this.tooltip.root.contains(t.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(e=>{e.container.contains(t.target)||e.close()})};e.emitter.listenDOM("click",document.body,n)}addModule(e){let t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(e=>{(e.getAttribute("class")||"").split(/\s+/).forEach(n=>{if(n.startsWith("ql-")&&(n=n.slice(3),t[n]!=null))if(n==="direction")e.innerHTML=t[n][""]+t[n].rtl;else if(typeof t[n]=="string")e.innerHTML=t[n];else{let r=e.value||"";r!=null&&t[n][r]&&(e.innerHTML=t[n][r])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(e=>{if(e.classList.contains("ql-align")&&(e.querySelector("option")??iu(e,Xl),typeof t.align=="object"))return new ql(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){let n=e.classList.contains("ql-background")?"background":"color";return e.querySelector("option")??iu(e,Zl,n==="background"?"#ffffff":"#000000"),new Kl(e,t[n])}return e.querySelector("option")??(e.classList.contains("ql-font")?iu(e,Ql):e.classList.contains("ql-header")?iu(e,$l):e.classList.contains("ql-size")&&iu(e,eu)),new Gl(e)}),this.quill.on(Y.events.EDITOR_CHANGE,()=>{this.pickers.forEach(e=>{e.update()})})}};tu.DEFAULTS=La({},ns.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");e??(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",()=>{let t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});var nu=class extends Yl{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t==null?e!==this.root.getAttribute("data-mode")&&(this.textbox.value=""):this.textbox.value=t;let n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{let{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Y.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Y.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=ru(e);case"formula":{if(!e)break;let t=this.quill.getSelection(!0);if(t!=null){let n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,Y.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(n+1," ",Y.sources.USER),this.quill.setSelection(n+2,Y.sources.USER)}break}default:}this.textbox.value="",this.hide()}};function ru(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:e}function iu(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(t=>{let r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)})}var au=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],ou=class extends nu{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(e,t){super(e,t),this.quill.on(Y.events.EDITOR_CHANGE,(e,t,n,r)=>{if(e===Y.events.SELECTION_CHANGE)if(t!=null&&t.length>0&&r===Y.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;let e=this.quill.getLines(t.index,t.length);if(e.length===1){let e=this.quill.getBounds(t);e!=null&&this.position(e)}else{let n=e[e.length-1],r=this.quill.getIndex(n),i=Math.min(n.length()-1,t.index+t.length-r),a=this.quill.getBounds(new Bo(r,i));a!=null&&this.position(a)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Y.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;let e=this.quill.getSelection();if(e!=null){let t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){let t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",t!==0&&(n.style.marginLeft=`${-1*t-n.offsetWidth/2}px`),t}},su=class extends tu{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=au),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new ou(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Vl),this.buildPickers(e.container.querySelectorAll("select"),Vl))}};su.DEFAULTS=La({},tu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,X.sources.USER)}}}}});var cu=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],lu=class extends nu{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(this.linkRange!=null){let e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,Y.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(Y.events.SELECTION_CHANGE,(e,t,n)=>{if(e!=null){if(e.length===0&&n===Y.sources.USER){let[t,n]=this.quill.scroll.descendant(al,e.index);if(t!=null){this.linkRange=new Bo(e.index-n,t.length());let r=al.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();let i=this.quill.getBounds(this.linkRange);i!=null&&this.position(i);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}},uu=class extends tu{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=cu),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Vl),this.buildPickers(e.container.querySelectorAll("select"),Vl),this.tooltip=new lu(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,n)=>{e.handlers.link.call(e,!n.format.link)}))}};uu.DEFAULTS=La({},tu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){let e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);let{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,X.sources.USER)}}}}}),Zc.register({"attributors/attribute/direction":Ls,"attributors/class/align":Ds,"attributors/class/background":Ms,"attributors/class/color":As,"attributors/class/direction":Rs,"attributors/class/font":Vs,"attributors/class/size":Us,"attributors/style/align":Os,"attributors/style/background":Ns,"attributors/style/color":js,"attributors/style/direction":zs,"attributors/style/font":Hs,"attributors/style/size":Ws},!0),Zc.register({"formats/align":Ds,"formats/direction":Rs,"formats/indent":Qc,"formats/background":Ns,"formats/color":js,"formats/font":Vs,"formats/size":Us,"formats/blockquote":$c,"formats/code-block":Z,"formats/header":el,"formats/list":nl,"formats/bold":rl,"formats/code":Fs,"formats/italic":il,"formats/link":al,"formats/script":sl,"formats/strike":cl,"formats/underline":ll,"formats/formula":ul,"formats/image":fl,"formats/video":ml,"modules/syntax":bl,"modules/table":El,"modules/toolbar":Ol,"themes/bubble":su,"themes/snow":uu,"ui/icons":Vl,"ui/picker":Gl,"ui/icon-picker":ql,"ui/color-picker":Kl,"ui/tooltip":Yl},!0);var Q=Zc,du={generateFilename(){return btoa(String(Math.random()*1e6)+String(+new Date)).replace("=","")},urlIsImage(e,t=3e3){return this.validURL(e)?/\.(jpeg|jpg|gif|png|webp|tiff|bmp)$/.test(e)?Promise.resolve(!0):new Promise((n,r)=>{let i,a=new Image;a.onerror=a.onabort=()=>{clearTimeout(i),r(!1)},a.onload=()=>{clearTimeout(i),n(!0)},i=setTimeout(()=>{a.src="//!/an/invalid.jpg",r(!1)},t),a.src=e}):Promise.reject(!1)},urlIsImageDataUrl(e){return/^data:image\/\w+;base64,/.test(e)},validURL(e){try{return!!new URL(e)}catch{return!1}},isRichText(e){let t=!1,n=!1;return Array.prototype.forEach.call(e,e=>{e.kind==="string"&&e.type.match(/^text\/html$/i)&&(t=!0),e.kind==="file"&&e.type.match(/^image\/\w+$/i)&&(n=!0)}),t&&!n},resolveDataUrl(e,t){let n="";return typeof e=="string"?n=e:e instanceof ArrayBuffer&&(n=this.arrayBufferToBase64Url(e,t)),n},binaryStringToArrayBuffer(e){let t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=-1;for(;++i<t;)r[i]=e.charCodeAt(i);return n},arrayBufferToBase64Url(e,t){return`data:${t};base64,`+btoa(new Uint8Array(e).reduce((e,t)=>e+String.fromCharCode(t),""))},copyText(e,t=document.body){let n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";let i=document.getSelection(),a=!1;i&&i.rangeCount>0&&(a=i.getRangeAt(0)),t.append(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch{}return n.remove(),i&&a&&(i.removeAllRanges(),i.addRange(a)),r&&r.focus(),o},isType(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`},isObject(e){return this.isType(e,"Object")}},fu=class{constructor(e,t,n){this.dataUrl=e,this.type=t,this.name=n||""}},pu=class e extends fu{constructor(e,t,n){super(e,t,n),this.dataUrl=e,this.type=t,this.name=n||`${du.generateFilename()}.${this.getSuffix()}`}minify(t){return new Promise((n,r)=>{let i=t.maxWidth||800,a=t.maxHeight||800,o=t.quality||.8;if(!this.dataUrl)return r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, dataUrl should not be empty."});let s=new Image;s.onload=()=>{let t=s.width,c=s.height;t>c?t>i&&(s.height=c*i/t,s.width=i):c>a&&(s.width=t*a/c,s.height=a);let l=document.createElement("canvas");l.width=s.width,l.height=s.height;let u=l.getContext("2d");if(u){u.drawImage(s,0,0,s.width,s.height);let t=this.type||"image/png";n(new e(l.toDataURL(t,o),t,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},s.src=du.resolveDataUrl(this.dataUrl,this.type)})}toFile(e){return e||=this.name,window.File?new File([this.toBlob()],e,{type:this.type}):(console.error("[error] QuillImageDropAndPaste: Your browser didnot support File API."),null)}toBlob(){let e=du.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=du.binaryStringToArrayBuffer(atob(e));return this.createBlob([t],{type:this.type})}createBlob(e,t){t||={},typeof t=="string"&&(t={type:t});try{return new Blob(e,t)}catch(n){if(n.name!=="TypeError")throw n;let r=new("BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder);for(let t=0;t<e.length;t++)r.append(e[t]);return r.getBlob(t.type)}}getSuffix(){let e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}},mu=class{constructor(e,t){this.quill=e,this.option=t}},hu=class extends mu{constructor(e,t){super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&&du.isObject(e.uploader)&&du.isObject(e.uploader?.options)&&(e.uploader.options.handler=()=>{}),this.quill=e,this.option=t,this.handleDrop=this.handleDrop.bind(this),this.handlePaste=this.handlePaste.bind(this),this.insert=this.insert.bind(this),this.quill.root.addEventListener("drop",this.handleDrop,!1),this.quill.root.addEventListener("paste",this.handlePaste,!1)}handleDrop(e){if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){if(e.preventDefault(),document.caretRangeFromPoint){let t=document.getSelection(),n=document.caretRangeFromPoint(e.clientX,e.clientY);t&&n&&t.setBaseAndExtent(n.startContainer,n.startOffset,n.startContainer,n.startOffset)}this.readFiles(e.dataTransfer.files,(e,t="image/png",n)=>{typeof this.option.handler=="function"?this.option.handler.call(this,e,t,new pu(e,t,n)):this.insert.call(this,du.resolveDataUrl(e,t),t)},e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(du.isRichText(e.clipboardData.items))return;this.readFiles(e.clipboardData.items,(e,t="image/png")=>{typeof this.option.handler=="function"?this.option.handler.call(this,e,t,new pu(e,t)):this.insert(du.resolveDataUrl(e,t),"image")},e)}}readFiles(e,t,n){Array.prototype.forEach.call(e,e=>{du.isType(e,"DataTransferItem")?this.handleDataTransfer(e,t,n):e instanceof File&&this.handleDroppedFile(e,t,n)})}handleDataTransfer(e,t,n){let r=this,{type:i}=e;if(i.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){n.preventDefault();let r=new FileReader;r.onload=e=>{e.target&&e.target.result&&t(e.target.result,i)};let a=e.getAsFile?e.getAsFile():e;a instanceof Blob&&r.readAsDataURL(a)}else i.match(/^text\/plain$/i)&&e.getAsString(e=>{if(du.urlIsImageDataUrl(e)){let n=e.match(/^data:(image\/\w+);base64,/),r=n?n[1]:"image/png",i=this.getIndex();t(e,r),this.quill.deleteText(i,e.length,"user"),this.quill.setSelection(i)}else this.option.autoConvert&&du.urlIsImage(e).then(()=>{setTimeout(()=>{let t=this.getIndex();this.quill.deleteText(t-e.length,e.length,"user"),r.insert(e,"image",t-e.length)})}).catch(()=>{})})}handleDroppedFile(e,t,n){let{type:r,name:i=""}=e;if(r.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){n.preventDefault();let a=new FileReader;a.onload=e=>{e.target&&e.target.result&&t(e.target.result,r,i)},a.readAsDataURL(e)}}insert(e,t,n){n=n===void 0?this.getIndex():n;let r;t.startsWith("image")?(r=n+1,this.quill.insertEmbed(n,"image",e,"user")):t.startsWith("text")&&(r=n+e.length,this.quill.insertText(n,e,"user")),setTimeout(()=>{this.quill.setSelection(r)})}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}};hu.ImageData=pu,window.QuillImageDropAndPaste=hu,"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",hu);var gu=Q.import("blots/block/embed");function _u(){return class extends gu{static blotName="html-snippet";static tagName="BUTTON";static className="HtmlSnippet";static create(e){let t=super.create(e);return t.innerText="<HTML>",e.html&&t.setAttribute("data-html",e.html),t}static value(e){let{html:t}=e.dataset;return{html:t}}}}var vu=Q.import("blots/inline");function yu(e,t){return class extends vu{static blotName="internal-link";static tagName="SPAN";static className="InternalLinkPlugin";static create(n){let r=super.create(n);return t?.getDocumentTitle(n).then(e=>{r.innerHTML=`${e}`}).catch(t=>{e.logger.error("Error fetching document title:",t)}),n&&r.setAttribute("data-document-id",n),r.setAttribute("contenteditable","false"),r}static formats(e){let{documentId:t}=e.dataset;return t}}}var bu=m("<span>");function xu({center:e}){let t=e?"QpSpinner center":"QpSpinner";return(()=>{var e=bu();return s(e,t),e})()}function Su(e){let t=Cu(e)??0,[n]=e.getLeaf(t);if(!n)throw Error("editor.getLeaf() returns undefined");return n.domNode}function Cu(e){let t=e.getSelection();if(t!==null)return t.index+t.length}var wu=e=>e!=null&&(e=Object.getPrototypeOf(e),e===Array.prototype||e===Object.prototype);function Tu(e,t,n){for(let[r,i]of Object.entries(t)){let t=`${n}.${r}`;e[t]=i,wu(i)&&Tu(e,i,t)}}function Eu(e){let t={...e};for(let[n,r]of Object.entries(e))wu(r)&&Tu(t,r,n);return t}var Du=(e,t)=>{if(t)for(let[n,r]of Object.entries(t))e=e.replace(RegExp(`{{\\s*${n}\\s*}}`,"g"),r);return e},Ou=e=>e;function ku(e,t=Ou){return(n,...r)=>{n[0]==="."&&(n=n.slice(1));let i=e()?.[n];switch(typeof i){case"function":return i(...r);case"string":return t(i,r[0]);default:return i}}}var Au={en:{CustomToolbar:{insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},image:"image",validate:"Validate",delete:"Delete",cancel:"Cancel",done:"Done",remove:"Remove",auto:"auto",editorFocusLost:"Image not inserted, place cursor in editor first",htmlSnippetLabel:"HTML Snippet",confirmDeletion:"Confirm Deletion",comfirmSnippetDeletionDialog:{content:"Are you sure you want to delete this HTML Snippet?"},makeMediaPropertiesDialog:{variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom",link:"Link",mediaProperties:"Media properties",caption:"Caption",pixelRatio:"Pixel ratio"},openObfuscatorDialog:{obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},videoPlugin:{insertVideo:"Insert a Video",dialog:{title:"Set a video"}},internalLinkPlugin:{insertLink:"Insert an internal link"}},fr:{CustomToolbar:{insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},image:"image",validate:"Valider",delete:"Supprimer",cancel:"Annuler",done:"Terminé",remove:"Retirer",auto:"auto",editorFocusLost:"L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",htmlSnippetLabel:"Code HTML",confirmDeletion:"Confirmer la suppression",comfirmSnippetDeletionDialog:{content:"Voulez-vous vraiment supprimer ce code HTML ?"},makeMediaPropertiesDialog:{variantLabel:"Taille {{ n }}",sizes:"Tailles",imageProperties:"Propriétés de l'image",left:"À gauche",right:"À droite",center:"Centrer",alignment:"Alignement",options:"Options",enableZoom:"Activer le zoom",link:"Lien",mediaProperties:"Propriétés du média",caption:"Légende",pixelRatio:"Pixel ratio"},openObfuscatorDialog:{obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},videoPlugin:{insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},internalLinkPlugin:{insertLink:"Insérer un lien interne"}},es:{CustomToolbar:{insertHtmlSnippetMessage:"Insertar un fragmento HTML",obfuscate:"Ofuscar"},image:"imagen",validate:"Validar",delete:"Eliminar",cancel:"Cancelar",done:"Hecho",remove:"Quitar",auto:"auto",editorFocusLost:"Imagen no insertada, coloque primero el cursor en el editor",htmlSnippetLabel:"Fragmento HTML",confirmDeletion:"Confirmar eliminación",comfirmSnippetDeletionDialog:{content:"¿Está seguro de que desea eliminar este fragmento HTML?"},makeMediaPropertiesDialog:{variantLabel:"Tamaño {{ n }}",sizes:"Tamaños",imageProperties:"Propiedades de la imagen",left:"Izquierda",right:"Derecha",center:"Centro",alignment:"Alineación",options:"Opciones",enableZoom:"Habilitar zoom",link:"Enlace",mediaProperties:"Propiedades del medio",caption:"Leyenda",pixelRatio:"Proporción de píxeles"},openObfuscatorDialog:{obfuscator:"Ofuscador",content:"Contenido:",asALink:"Como enlace",doNotObfuscate:"No ofuscar"},videoPlugin:{insertVideo:"Insertar un video",dialog:{title:"Configurar un video"}},internalLinkPlugin:{insertLink:"Insertar un enlace interno"}},de:{CustomToolbar:{insertHtmlSnippetMessage:"HTML-Snippet einfügen",obfuscate:"Verschleiern"},image:"Bild",validate:"Validieren",delete:"Löschen",cancel:"Abbrechen",done:"Fertig",remove:"Entfernen",auto:"auto",editorFocusLost:"Bild nicht eingefügt, setzen Sie zuerst den Cursor in den Editor",htmlSnippetLabel:"HTML-Snippet",confirmDeletion:"Löschung bestätigen",comfirmSnippetDeletionDialog:{content:"Sind Sie sicher, dass Sie dieses HTML-Snippet löschen möchten?"},makeMediaPropertiesDialog:{variantLabel:"Größe {{ n }}",sizes:"Größen",imageProperties:"Bildeigenschaften",left:"Links",right:"Rechts",center:"Zentriert",alignment:"Ausrichtung",options:"Optionen",enableZoom:"Zoom aktivieren",link:"Link",mediaProperties:"Medieneigenschaften",caption:"Bildunterschrift",pixelRatio:"Pixelverhältnis"},openObfuscatorDialog:{obfuscator:"Verschleierer",content:"Inhalt:",asALink:"Als Link",doNotObfuscate:"Nicht verschleiern"},videoPlugin:{insertVideo:"Video einfügen",dialog:{title:"Video festlegen"}},internalLinkPlugin:{insertLink:"Internen Link einfügen"}},it:{CustomToolbar:{insertHtmlSnippetMessage:"Inserisci un frammento HTML",obfuscate:"Offuscare"},image:"immagine",validate:"Validare",delete:"Eliminare",cancel:"Annullare",done:"Fatto",remove:"Rimuovere",auto:"auto",editorFocusLost:"Immagine non inserita, posiziona prima il cursore nell'editor",htmlSnippetLabel:"Frammento HTML",confirmDeletion:"Conferma eliminazione",comfirmSnippetDeletionDialog:{content:"Sei sicuro di voler eliminare questo frammento HTML?"},makeMediaPropertiesDialog:{variantLabel:"Dimensione {{ n }}",sizes:"Dimensioni",imageProperties:"Proprietà dell'immagine",left:"Sinistra",right:"Destra",center:"Centro",alignment:"Allineamento",options:"Opzioni",enableZoom:"Abilita zoom",link:"Link",mediaProperties:"Proprietà del media",caption:"Didascalia",pixelRatio:"Rapporto pixel"},openObfuscatorDialog:{obfuscator:"Offuscatore",content:"Contenuto:",asALink:"Come link",doNotObfuscate:"Non offuscare"},videoPlugin:{insertVideo:"Inserisci un video",dialog:{title:"Imposta un video"}},internalLinkPlugin:{insertLink:"Inserisci un link interno"}},pt:{CustomToolbar:{insertHtmlSnippetMessage:"Inserir um fragmento HTML",obfuscate:"Ofuscar"},image:"imagem",validate:"Validar",delete:"Excluir",cancel:"Cancelar",done:"Concluído",remove:"Remover",auto:"auto",editorFocusLost:"Imagem não inserida, posicione primeiro o cursor no editor",htmlSnippetLabel:"Fragmento HTML",confirmDeletion:"Confirmar exclusão",comfirmSnippetDeletionDialog:{content:"Tem certeza de que deseja excluir este fragmento HTML?"},makeMediaPropertiesDialog:{variantLabel:"Tamanho {{ n }}",sizes:"Tamanhos",imageProperties:"Propriedades da imagem",left:"Esquerda",right:"Direita",center:"Centro",alignment:"Alinhamento",options:"Opções",enableZoom:"Ativar zoom",link:"Link",mediaProperties:"Propriedades da mídia",caption:"Legenda",pixelRatio:"Proporção de pixels"},openObfuscatorDialog:{obfuscator:"Ofuscador",content:"Conteúdo:",asALink:"Como link",doNotObfuscate:"Não ofuscar"},videoPlugin:{insertVideo:"Inserir um vídeo",dialog:{title:"Definir um vídeo"}},internalLinkPlugin:{insertLink:"Inserir um link interno"}}};function ju(e){return{t:ku(r(()=>Eu(Au[e()in Au?e():"en"])),Du)}}function Mu(e,{label:t,url:n}){let r=t??n,i=e.getSelection();i&&i.length!==0&&(r=e.getText(i.index,i.length),e.deleteText(i.index,i.length)),e.insertText(Cu(e)??0,r,"link",n)}function Nu({editor:e,values:t,service:n,index:r,language:i}){let{t:a}=ju(i),o=r??Cu(e);if(o===void 0){n.showAlert(a("editorFocusLost"),{severity:"warning",autoDismiss:!0});return}e.insertEmbed(o,"media",t)}function Pu({values:e,editor:t,index:n}){if(e.html===void 0)throw Error("html is undefined");t.insertEmbed(n,"html-snippet",e);let[r]=t.getLeaf(n+1);if(!r)throw Error("missing last inserted element");return r.domNode}function Fu({values:e,editor:t,index:n}){t.insertText(n,e,"internal-link",e)}function Iu({values:e,editor:t,index:n}){t.insertEmbed(n,"platform-video",e);let[r]=t.getLeaf(n+1);if(!r)throw Error("missing last inserted element");return r.domNode}function Lu(e){let{mediaId:t}=e.dataset;if(t)return t;let n=e.getAttribute("src");if(!n)return;let{pathname:r}=new URL(n),i=r.split("/"),a=i[i.length-1].match(/^([0-9a-f-]{36})-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;let[,o]=a;return o}function Ru(e){let t=zu(e),n=e.dataset.resize;return{resizeRule:n&&E(n)?n:void 0,align:t}}function zu(e){let t=e.classList;if(t.contains("center"))return"center";if(t.contains("left"))return"left";if(t.contains("right"))return"right"}function Bu(e){if(e==="center")return"center";if(e==="left")return"left";if(e==="right")return"right"}var Vu=Q.import("blots/block/embed"),Hu=["alt"];function Uu(e){return class extends Vu{static blotName="media";static tagName="figure";static create(t){let n=super.create(t);return Wu(e,n,t),n}static formats(e){return Hu.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png|webp)$/.test(e)||/^data:image\/.+;base64/.test(e)}static value(e){let{mediaId:t,resize:n}=e.dataset;if(!t)throw Error('missing "media-id" attribute');let r=n&&E(n)?n:void 0;if(!r)throw Error('missing "resize" attribute');return{mediaId:t,resizeRule:r,align:zu(e),zoomable:e.dataset.zoomable==="1",href:e.dataset.href?e.dataset.href:void 0}}format(e,t){Hu.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}}function Wu(e,t,n){t.setAttribute("data-pa-blot","media"),t.setAttribute("contenteditable","false"),t.classList.add("MediaBlot","Fig");let r=document.createElement("img");if(r.classList.add("Fig-media"),n.align){let e=Bu(n.align);e&&t.classList.add(e)}t.setAttribute("data-zoomable",n.zoomable?"1":"0"),n.zoomable&&t.classList.add("zoomable"),n.href&&(t.setAttribute("data-href",n.href),t.classList.add("asLink")),t.setAttribute("data-media-id",n.mediaId),t.setAttribute("data-resize",n.resizeRule);let i=xu({center:!0});t.appendChild(i),Gu(e,t,r,i,n)}async function Gu(e,t,n,r,i){try{let a=await e.useAdminUiImage(i.mediaId,{resizeRule:i.resizeRule});if(!a)throw Error(`Media ${i.mediaId} not found`);let{source:o,variant:s}=a;n.setAttribute("src",s.url),n.setAttribute("width",String(s.width)),n.setAttribute("height",String(s.height));let c=o.attachedData?.[e.contentLanguage]?.caption;if(c){let e=document.createElement("figcaption");e.classList.add("Fig-caption"),e.textContent=c,t.appendChild(e)}Ku(t,o,i),t.removeChild(r),t.appendChild(n),t.setAttribute("data-source",JSON.stringify(o))}catch(n){e.logger.error("Error setting up media:",n),t.contains(r)&&t.removeChild(r)}}function Ku(e,t,n){let r=document.createElement("div");if(r.classList.add("MediaBlot-flags"),t.pixelRatio!==void 0){let e=document.createElement("span");e.classList.add("MediaBlot-flag","Fig-flag--pixelRatio"),e.textContent=`${t.pixelRatio}×`,r.appendChild(e)}if(n.zoomable){let e=document.createElement("span");e.classList.add("MediaBlot-flag"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5">\n <circle cx="6.5" cy="6.5" r="5"/>\n <path d="m10.04 10.04 4.46 4.46"/>\n</svg>',r.appendChild(e)}if(n.href){let e=document.createElement("span");e.classList.add("MediaBlot-flag"),e.innerHTML='<svg width="22" height="22" viewBox="0 0 16 16" fill="currentColor">\n <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/>\n <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z"/>\n</svg>',r.appendChild(e)}e.appendChild(r)}function qu(e){return Yu(e)||Ju(e)}function Ju(e){return!!e.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function Yu(e){return!!e.match(/^(\+|00)[1-9][0-9 \-().]{7,32}$/)}function Xu(e){return qu(e)?Ju(e)?"mailto":"tel":"raw"}function Zu(e){if(e==="raw")return"raw";if(e==="mailto")return"mailto";if(e==="tel")return"tel";throw Error(`invalid link-type '${e}'`)}var Qu=Q.import("blots/inline");function $u(){return class extends Qu{static blotName="obfuscate";static tagName="SPAN";static className="ObfuscateBlot";static create(e){let t=super.create();return t.setAttribute("data-as-a-link",e),t}static formats(e){let{asALink:t}=e.dataset;if(!t)throw Error("No data attribute data-as-a-link");return Zu(t)}}}var ed='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>',td=Q.import("blots/block/embed");function nd(e){return class extends td{static blotName="platform-video";static tagName="DIV";static className="PlatformVideo";static create(t){let n=super.create(t),r=e?.getThumbnailUrl(t);return n.style.backgroundImage=`url(${r})`,n.classList.add("PlatformVideo"),n.innerHTML=`<span class="PlatformVideo-playButton">${ed}</span>`,t.videoId&&n.setAttribute("data-video-id",t.videoId),t.platform&&n.setAttribute("data-platform",t.platform),n.querySelector("span")?.addEventListener("click",()=>{n.dispatchEvent(new CustomEvent("click",{bubbles:!0}))}),n}static value(e){let{videoId:t,platform:n}=e.dataset;if(t)return{videoId:t,platform:n??"youtube"}}}}function rd({service:e,videoPluginHook:t,internalLinkPluginHook:n}){Q.register("formats/media",Uu(e),!0),Q.register("formats/html-snippet",_u(),!0),Q.register("formats/obfuscate",$u(),!0),Q.register("formats/platform-video",nd(t),!0),Q.register("formats/internal-link",yu(e,n),!0),Q.register("modules/imageDropAndPaste",hu,!0)}var id=m('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),ad=m('<button class="QpBtn secondary"type=button>'),od=m("<button class=QpBtn type=button>"),sd=m('<button class="QpBtn danger outlined"type=button>'),cd=m("<p>"),ld=m('<button class="QpBtn danger"type=button>');async function ud({service:e,language:t,mode:n,html:r}){let{t:i}=ju(t),[o,s]=a(r??""),c=()=>{l.close({action:"remove"})},l=e.createModalDialog({content:(()=>{var e=id();return e.addEventListener("change",e=>s(e.target.value)),u(()=>e.value=o()),e})(),footer:[n==="update"&&(()=>{var n=sd();return n.$$click=()=>{dd({deleteSnippet:c,language:t,service:e})},d(n,()=>i("delete")),n})(),(()=>{var e=ad();return e.$$click=()=>l.close(),d(e,()=>i("cancel")),e})(),(()=>{var e=od();return e.$$click=()=>l.close({action:n,values:{html:o()}}),d(e,()=>i("validate")),e})()],header:i("htmlSnippetLabel")});return await l.open()}function dd({deleteSnippet:e,language:t,service:n}){let{t:r}=ju(t),i=n.createModalDialog({header:r("confirmDeletion"),content:(()=>{var e=cd();return d(e,()=>r("comfirmSnippetDeletionDialog.content")),e})(),footer:[(()=>{var e=ad();return e.$$click=()=>{i.hide()},d(e,()=>r("cancel")),e})(),(()=>{var t=ld();return t.$$click=()=>{i.hide(),e()},d(t,()=>r("validate")),t})()]});i.show()}l(["click"]);async function fd({language:e,value:t,internalLinkPluginHook:n}){if(!n)return;let r=await n.openDialog(t??"",{getLanguage:e});if(t&&r)return r.documentId?{action:"update",value:r.documentId}:{action:"remove"};if(!t&&r?.documentId)return{action:"insert",value:r.documentId}}var pd=m('<button class="QpBtn outlined danger"type=button>'),md=m("<button class=QpBtn type=button>"),hd=m("<h2 class=PaField-label>"),gd=m("<div class=QpOption>"),_d=m("<input class=QpOption-input type=text>"),vd=m("<label><input type=checkbox name=enableZoom>"),yd=m("<div><div class=QpOption><label class><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>"),bd=m("<div class=QpBox><dl class=QpProp><dt>:</dt><dd></dd></dl><dl class=QpProp><dt>:</dt><dd>"),xd=m("<button type=button> <small class=PaMl1>(<!>)"),Sd=m("<button type=button>");async function Cd({service:i,language:o,fetchedOutput:l,initialValues:p}){let{mediaId:m}=p,{themeConf:h}=i,{t:g}=ju(o),[_,v]=a(p.resizeRule),[y,b]=a(p.align),[x,S]=a(p.zoomable),[C,w]=a(!!p.href),[T,E]=a(p.href??""),[D,O]=a();n(()=>{i.useAdminUiImage(m,{resizeRule:_()}).then(e=>{l.source=e?.source,O(e)}).catch(e=>{i.logger.error("Error fetching media:",e)})});let k=r(()=>h.fTextImageResizeRules.map((e,t)=>({resizeRule:e,label:g("makeMediaPropertiesDialog.variantLabel",{n:t+1})})),[h,o()]),A=r(()=>[{align:"left",label:g("makeMediaPropertiesDialog.left")},{align:"center",label:g("makeMediaPropertiesDialog.center")},{align:"right",label:g("makeMediaPropertiesDialog.right")}],[o()]),ee=async()=>{M.close({action:"update",values:{mediaId:m,align:y(),resizeRule:_(),zoomable:x(),href:C()&&T().trim()||void 0}})};n(()=>{C()&&S(!1)});let j=[(()=>{var e=pd();return e.$$click=()=>{M.close({action:"remove"})},d(e,()=>g("remove")),e})(),(()=>{var e=md();return e.$$click=ee,e.disabled=!m||y===void 0||_===void 0,d(e,()=>g("validate")),e})()],M=i.createModalDialog({header:g("makeMediaPropertiesDialog.imageProperties"),content:[(()=>{var e=hd();return d(e,()=>g("makeMediaPropertiesDialog.sizes")),e})(),(()=>{var t=gd();return d(t,c(e,{get each(){return k()},children:e=>(()=>{var t=xd(),n=t.firstChild,r=n.nextSibling,i=r.firstChild.nextSibling;return i.nextSibling,t.$$click=()=>v(e.resizeRule),t.disabled=!m,d(t,()=>e.label,n),d(r,()=>e.resizeRule.replace("x","×"),i),u(()=>s(t,`QpBtn secondary ${e.resizeRule===_()?"":"outlined"}`)),t})()})),t})(),(()=>{var e=hd();return d(e,()=>g("makeMediaPropertiesDialog.alignment")),e})(),(()=>{var t=gd();return d(t,c(e,{get each(){return A()},children:e=>(()=>{var t=Sd();return t.$$click=()=>b(e.align),t.disabled=!m,d(t,()=>e.label),u(()=>s(t,`QpBtn secondary ${e.align===y()?"":"outlined"}`)),t})()})),t})(),(()=>{var e=hd();return d(e,()=>g("makeMediaPropertiesDialog.options")),e})(),(()=>{var e=yd(),n=e.firstChild,r=n.firstChild,i=r.firstChild,a=n.nextSibling;return i.addEventListener("change",()=>{w(!C())}),d(r,()=>g("makeMediaPropertiesDialog.link"),null),d(r,c(t,{get when(){return C()},get children(){var e=_d();return e.addEventListener("change",e=>{E(e.currentTarget.value)}),u(()=>e.value=T()),e}}),null),d(a,c(t,{get when(){return!C()},get children(){var e=vd(),t=e.firstChild;return t.addEventListener("change",()=>{S(!x())}),d(e,()=>g("makeMediaPropertiesDialog.enableZoom"),null),u(()=>t.checked=x()),e}})),u(()=>i.checked=C()),e})(),(()=>{var e=hd();return d(e,()=>g("makeMediaPropertiesDialog.mediaProperties")),e})(),(()=>{var e=bd(),t=e.firstChild,n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=t.nextSibling.firstChild,s=a.firstChild,l=a.nextSibling;return d(n,()=>g("makeMediaPropertiesDialog.caption"),r),d(i,(()=>{var e=f(()=>!!D());return()=>e()?D()?.source.attachedData?.[o()]?.caption??"-":c(xu,{})})()),d(a,()=>g("makeMediaPropertiesDialog.pixelRatio"),s),d(l,(()=>{var e=f(()=>!!D());return()=>e()?f(()=>!!D()?.source.pixelRatio)()?`${D()?.source.pixelRatio}×`:g("auto"):c(xu,{})})()),e})()],footer:j});return await M.open()}l(["click"]);var wd=m("<label class=ObfuscatorDialog-label><input type=text class=PaMl2>"),Td=m('<label class="ObfuscatorDialog-label PaMt4"><input type=checkbox name=asALink class=PaMr2>'),Ed=m('<button class="QpBtn danger outlined"type=button>'),Dd=m("<button class=QpBtn type=button>");async function Od({service:e,language:t,value:n}){let{t:r}=ju(t),[i,o]=a(n.asALink),[s,c]=a(n.content),l=e=>{c(e),qu(e)?o(!0):o(!1)},f=e.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var e=wd(),t=e.firstChild;return d(e,()=>r("openObfuscatorDialog.content"),t),t.$$input=e=>l(e.currentTarget.value),u(()=>t.value=s()),e})(),(()=>{var e=Td(),t=e.firstChild;return t.addEventListener("change",()=>o(!i())),d(e,()=>r("openObfuscatorDialog.asALink"),null),u(()=>t.checked=i()),e})()],footer:[(()=>{var e=Ed();return e.$$click=()=>f.close({action:"remove"}),d(e,()=>r("openObfuscatorDialog.doNotObfuscate")),e})(),(()=>{var e=Dd();return e.$$click=()=>f.close({action:"update",content:s(),asALink:i()?Ju(s())?"mailto":"tel":"raw"}),d(e,()=>r("done")),e})()]});return await f.open()}l(["input","click"]);var kd=m('<button class="QpBtn outlined danger"type=button>'),Ad=m('<button class="QpBtn secondary"type=button>'),jd=m("<button class=QpBtn type=button>");async function Md({service:e,language:t,mode:n,value:r,videoPluginHook:i}){if(!i)return;let{t:o}=ju(t),[s,c]=a(r),{dispose:l,element:u}=i.createComponent(r??{videoId:"",platform:"youtube"},{onChange(e){c(e)},getLanguage:t}),f=e.createModalDialog({content:u,footer:[(()=>{var e=kd();return e.$$click=()=>{f.close({action:"remove"}),l()},d(e,()=>o("remove")),e})(),(()=>{var e=Ad();return e.$$click=()=>{f.close(),l()},d(e,()=>o("cancel")),e})(),(()=>{var e=jd();return e.$$click=()=>{let e=s();e===null?f.close({action:"remove"}):f.close({action:n,value:e}),l()},d(e,()=>o("validate")),e})()],header:o("videoPlugin.dialog.title")});return await f.open()}l(["click"]);async function Nd({editor:e,htmlSnippetBtn:t,service:n,language:r}){let i=t.dataset.html,a=await ud({service:n,html:i,mode:"update",language:r});a&&Ud({editor:e,element:t,data:a,insertElementHandler:Pu,service:n,language:r})}async function Pd({editor:e,internalLinkElement:t,language:n,internalLinkPluginHook:r}){let i=t.dataset.documentId,a=await fd({language:n,value:i,internalLinkPluginHook:r});if(!a)return;let o=Q.find(t);if(!o||o instanceof Q)throw Error("missing link blot");if(a.action==="update"){if(!a.value)return;let t=e.getIndex(o);o.deleteAt(0,o.length()),Fu({values:a.value,editor:e,index:t})}else a.action==="remove"&&o.deleteAt(0,o.length())}async function Fd({editor:e,videoElement:t,language:n,service:r,videoPluginHook:i}){let a=t.dataset.videoId,o=t.dataset.platform??"youtube",s=await Md({service:r,language:n,mode:"update",value:a?{videoId:a,platform:o}:void 0,videoPluginHook:i});s&&Ud({editor:e,element:t,data:{action:s.action,values:s.value},insertElementHandler:Iu,service:r,language:n})}async function Id({obfuscatorSpan:e,service:t,language:n,editor:r}){let i=e.innerText,a=e.dataset.asALink?Zu(e.dataset.asALink):void 0,o=await Od({service:t,language:n,value:{content:i,asALink:a?a!=="raw":!1}});if(!o)return;let s=Q.find(e);if(!s||s instanceof Q)throw Error("missing embed blot");let c=r.getIndex(s);o.action==="remove"&&(s.remove(),r.insertText(c,i)),o.action==="update"&&(s.remove(),r.insertText(c,o.content??"",{obfuscate:o.asALink??"raw"}))}async function Ld({service:e,language:t,element:n,editor:r}){let i=Lu(n),{align:a,resizeRule:o}=Ru(n);if(!i||!o)return;let s={source:void 0},c={mediaId:i,resizeRule:o,align:a,zoomable:n.dataset.zoomable==="1",href:n.dataset.href},l=await Cd({service:e,language:t,initialValues:c,fetchedOutput:s});if(!l){if(!s.source||!n.dataset.source)return;let e=JSON.parse(n.dataset.source);if(e.pixelRatio===s.source.pixelRatio&&e.attachedData?.[t()]?.caption===s.source.attachedData?.[t()]?.caption)return;l={action:"update",values:c}}Ud({service:e,language:t,editor:r,element:n,data:l,insertElementHandler:Nu})}function Rd({quillEditor:e,service:t,language:n,videoPluginHook:r,internalLinkPluginHook:i}){let{themeConf:a}=t;return{insertHtmlSnippetHandler:async()=>{e&&await Bd({service:t,editorContent:Su(e),quillEditor:e,language:n})},insertMedia:async r=>{if(!e)return;if(r.kind==="file"){Mu(e,{label:r.originalName,url:r.url});return}let i=a.fTextImageResizeRules[0];Nu({service:t,editor:e,values:{mediaId:r.mediaId,resizeRule:i,align:"center",zoomable:!0},language:n})},insertObfuscateBlotHandler:async()=>{if(e)try{let r=e.getSelection();if(!r||r.length===0)return;await zd({service:t,userSelection:r,quillEditor:e,language:n})}catch(e){t.logger.error("Failed to insert obfuscate:",e)}},insertVideoHandler:async()=>{e&&await Vd({editorContent:Su(e),quillEditor:e,service:t,language:n,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!e)return;let t=Cu(e);t!==void 0&&await Hd({quillEditor:e,language:n,internalLinkPluginHook:i,index:t})}}}async function zd({service:e,userSelection:t,quillEditor:n,language:r}){let i=n.getText(t.index,t.length),a=Xu(i);n.formatText(t,"obfuscate",a);let o=n.root.querySelectorAll("span.ObfuscateBlot");if(o.length===0)throw Error("missing element 'span' with class 'ObfuscateBlot'");for(let t of o)if(t.innerText===i){await Id({obfuscatorSpan:t,service:e,language:r,editor:n});break}}async function Bd({service:e,editorContent:t,quillEditor:n,language:r}){let i=await ud({service:e,language:r,mode:"insert"});i&&Ud({editor:n,element:t,data:i,insertElementHandler:Pu,service:e,language:r})}async function Vd({service:e,editorContent:t,quillEditor:n,language:r,videoPluginHook:i,value:a}){let o=await Md({service:e,language:r,mode:a?"update":"insert",value:a,videoPluginHook:i});!o||o.action==="remove"||Ud({editor:n,element:t,data:{action:o.action,values:o.value},insertElementHandler:Iu,service:e,language:r})}async function Hd({quillEditor:e,language:t,internalLinkPluginHook:n,value:r,index:i}){let a=await fd({language:t,value:r,internalLinkPluginHook:n});!a||a.action==="remove"||!a.value||Fu({editor:e,values:a.value,index:i})}function Ud({service:e,editor:t,element:n,data:{values:r,action:i,updateOptions:a},insertElementHandler:o,language:s}){let c=Q.find(n);if(!c||c instanceof Q)throw Error("missing embed blot");let l=t.getIndex(c),u=new q.default;if(!(l===void 0||l===-1)){if(i==="insert"){if(!r)return;o({editor:t,values:r,service:e,index:l,language:s})}else if(i==="update"){if(!r)return;o({editor:t,values:r,service:e,index:l,language:s}),u.retain(l+1),u.delete(a?.textToReplaceLength??1)}else i==="remove"&&(u.retain(l),u.delete(1));t.updateContents(u)}}function Wd(){let e={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return e.videoPlugin},get internalLinkPlugin(){return e.internalLinkPlugin},service:{registerVideoPlugin(t){if(e.videoPlugin)throw Error("Video plugin already registered");e.videoPlugin=t},registerInternalLinkPlugin(t){if(e.internalLinkPlugin)throw Error("Internal link plugin already registered");e.internalLinkPlugin=t}}}}var $=w(x((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i==="object"||i==="function")&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o="</span>",s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`},l=class{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(e=>typeof e=="string")?t.children=[t.children.join("")]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e=="string"?e:e.source:null}function m(e){return _("(?=",e,")")}function h(e){return _("(?:",e,")*")}function g(e){return _("(?:",e,")?")}function _(...e){return e.map(e=>p(e)).join("")}function v(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return"("+(v(e).capture?"":"?:")+e.map(e=>p(e)).join("|")+")"}function b(e){return RegExp(e.toString()+"|").exec("").length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i="";for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]==="\\"&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],e[0]==="("&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",D="\\b\\d+(\\.\\d+)?",O="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",A="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ee=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:"\\\\[\\s\\S]",relevance:0},M={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[j]},N={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[j]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},P=function(e,t,n={}){let r=a({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ne=P("//","$"),re=P("/\\*","\\*/"),F=P("#","$"),ie={scope:"number",begin:D,relevance:0},I={scope:"number",begin:O,relevance:0},ae={scope:"number",begin:k,relevance:0},oe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},L={scope:"title",begin:T,relevance:0},se={scope:"title",begin:E,relevance:0},ce={begin:"\\.\\s*"+E,relevance:0},le=Object.freeze({__proto__:null,APOS_STRING_MODE:M,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:k,COMMENT:P,C_BLOCK_COMMENT_MODE:re,C_LINE_COMMENT_MODE:ne,C_NUMBER_MODE:I,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:ce,NUMBER_MODE:ie,NUMBER_RE:D,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:N,REGEXP_MODE:oe,RE_STARTERS_RE:A,SHEBANG:ee,TITLE_MODE:L,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:se});function ue(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function de(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function fe(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ue,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function pe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function me(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function he(e,t){e.relevance===void 0&&(e.relevance=1)}var ge=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},_e=["of","and","for","in","not","or","if","then","parent","list","value"],ve="keyword";function ye(e,t,n=ve){let r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ye(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split("|");r[n[0]]=[e,be(n[0],n[1])]})}}function be(e,t){return t?Number(t):+!xe(e)}function xe(e){return _e.includes(e.toLowerCase())}var Se={},Ce=e=>{console.error(e)},we=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Te=(e,t)=>{Se[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Se[`${e}/${t}`]=!0)},Ee=Error();function De(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function R(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ce("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ee;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ce("beginScope must be object"),Ee;De(e,e.begin,{key:"beginScope"}),e.begin=C(e.begin,{joinWith:""})}}function Oe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ce("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ee;if(typeof e.endScope!="object"||e.endScope===null)throw Ce("endScope must be object"),Ee;De(e,e.end,{key:"endScope"}),e.end=C(e.end,{joinWith:""})}}function ke(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ae(e){ke(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),R(e),Oe(e)}function je(e){function t(t,n){return new RegExp(p(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type==="begin"&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[de,me,Ae,ge].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[fe,pe,he].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords=="object"&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ye(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||"",n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?"|":"")+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ne(e==="self"?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Me(e){return e?e.endsWithParent||Me(e.starts):!1}function Ne(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Me(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Pe="11.11.1",Fe=class extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}},Ie=i,Le=a,Re=Symbol("nomatch"),ze=7,Be=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=l.languageDetectRe.exec(t);if(n){let t=M(n[1]);return t||(we(s.replace("{}",n[1])),we("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>u(e)||M(e))}function p(e,t,n){let r="",i="";typeof t=="object"?(r=e,n=t.ignoreIllegals,i=t.language):(Te("10.7.0","highlight(lang, code, ...args) has been deprecated."),Te("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};F("before:highlight",a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,F("after:highlight",o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){j.addText(N);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(j.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=ze&&(te+=a),e.startsWith("_"))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(N)}n+=N.substring(e),j.addText(n)}function f(){if(N==="")return;let e=null;if(typeof A.subLanguage=="string"){if(!t[A.subLanguage]){j.addText(N);return}e=v(A.subLanguage,N,!0,ee[A.subLanguage]),ee[A.subLanguage]=e._top}else e=S(N,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(te+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),N=""}function m(e,t){e!==""&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(N=i,d(),N=""),n++}}function g(e,t){return e.scope&&typeof e.scope=="string"&&j.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(N,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=""):e.beginScope._multi&&(h(e.beginScope,t),N="")),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e["on:end"]){let n=new r(e);e["on:end"](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(N+=e[0],1):(re=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n["on:begin"]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),!n.returnBegin&&!n.excludeBegin&&(N=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Re;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do{A.scope&&j.closeNode(),!A.skip&&!A.subLanguage&&(te+=A.relevance),A=A.parent}while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(N+=t,a==null)return p(),0;if(T.type==="begin"&&r.type==="end"&&T.index===r.index&&a===""){if(N+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type==="begin")return b(r);if(r.type==="illegal"&&!i){let e=Error('Illegal lexeme "'+a+'" for mode "'+(A.scope||"<unnamed>")+'"');throw e.mode=A,e}else if(r.type==="end"){let e=C(r);if(e!==Re)return e}if(r.type==="illegal"&&a==="")return N+="\n",1;if(ne>1e5&&ne>r.index*3)throw Error("potential infinite loop, way more iterations than matches");return N+=a,a.length}let D=M(e);if(!D)throw Ce(s.replace("{}",e)),Error('Unknown language: "'+e+'"');let O=je(D),k="",A=a||O,ee={},j=new l.__emitter(l);w();let N="",te=0,P=0,ne=0,re=!1;try{if(D.__emitTokens)D.__emitTokens(n,j);else{for(A.matcher.considerAll();;){ne++,re?re=!1:A.matcher.considerAll(),A.matcher.lastIndex=P;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(P,e.index),e);P=e.index+t}E(n.substring(P))}return j.finalize(),k=j.toHTML(),{language:e,value:k,relevance:te,illegal:!1,_emitter:j,_top:A}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:Ie(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:P,context:n.slice(P-100,P+100),mode:t.mode,resultSoFar:k},_emitter:j};if(o)return{language:e,value:Ie(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:A};throw t}}function b(e){let t={value:Ie(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(M).filter(te).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(M(e.language).supersetOf===t.language)return 1;if(M(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add("hljs"),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(F("before:highlightElement",{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),l.throwUnescapedHTML))throw new Fe("One of your code blocks includes unescaped HTML.",e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted="yes",C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),F("after:highlightElement",{el:e,result:i,text:r})}function T(e){l=Le(l,e)}let E=()=>{k(),Te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){k(),Te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function k(){function e(){k()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(Ce("Language definition for '{}' could not be registered.".replace("{}",n)),o)Ce(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})}function ee(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function M(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function N(e,{languageName:t}){typeof e=="string"&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function te(e){let t=M(e);return t&&!t.disableAutodetect}function P(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}function ne(e){P(e),a.push(e)}function re(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function F(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ie(e){return Te("10.7.0","highlightBlock will be removed entirely in v12.0"),Te("10.7.0","Please use highlightElement now."),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ie,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:ee,listLanguages:j,getLanguage:M,registerAliases:N,autoDetection:te,inherit:Le,addPlugin:ne,removePlugin:re}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Pe,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in le)typeof le[e]=="object"&&n(le[e]);return Object.assign(e,le),e},Ve=Be({});Ve.newInstance=()=>Be({}),t.exports=Ve,Ve.HighlightJS=Ve,Ve.default=Ve})()).default;function Gd(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],h=["true","false"],g={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],y="autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp".split("."),b="chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes".split(".");return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,"set","shopt",...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function Kd(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f={keyword:"asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma".split("."),type:"float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary".split("."),literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},p=[l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat(["self"]),relevance:0}]),relevance:0},h={begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:f,disableAutodetect:!0,illegal:"</",contains:[].concat(m,h,p,[l,{begin:e.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:s,keywords:f}}}function qd(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f="alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq".split("."),p=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],m="any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view".split("."),h="abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf".split("."),g={type:p,keyword:f,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:m},_={className:"function.dispatch",relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},v=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:v.concat([{begin:/\(/,end:/\)/,keywords:g,contains:v.concat(["self"]),relevance:0}]),relevance:0},b={className:"function",begin:"("+a+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:g,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(y,b,_,v,[l,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:g,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Jd(e){let t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r={keyword:"abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while".split(".").concat("add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield".split(".")),built_in:t,literal:["default","false","null","true"]},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},o={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},c=e.inherit(s,{illegal:/\n/}),l={className:"subst",begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:"<",end:">",contains:[{beginKeywords:"in out"},i]},g=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:r,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},m,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+g+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var Yd=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Xd="a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video".split("."),Zd="defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath".split("."),Qd=[...Xd,...Zd],$d="any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height".split(".").sort().reverse(),ef="active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where".split(".").sort().reverse(),tf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),nf="accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom".split(".").sort().reverse();function rf(e){let t=e.regex,n=Yd(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+ef.join("|")+")"},{begin:":(:)?("+tf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+nf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:$d.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Qd.join("|")+")\\b"}]}}var af="[0-9](_*[0-9])*",of=`\\.(${af})`,sf="[0-9a-fA-F](_*[0-9a-fA-F])*",cf={className:"number",variants:[{begin:`(\\b(${af})((${of})|\\.)?|(${of}))[eE][+-]?(${af})[fFdD]?\\b`},{begin:`\\b(${af})((${of})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${of})[fFdD]?\\b`},{begin:`\\b(${af})[fFdD]\\b`},{begin:`\\b0[xX]((${sf})\\.?|(${sf})?\\.(${sf}))[pP][+-]?(${af})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${sf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function lf(e,t,n){return n===-1?"":e.replace(t,r=>lf(e,t,n-1))}function uf(e){let t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+lf("(?:<"+n+"~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?",/~~~/g,2),i={keyword:"synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when".split("."),literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},a={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},o={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,cf,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},cf,a]}}var df="[A-Za-z$_][0-9A-Za-z$_]*",ff="as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using".split("."),pf=["true","false","null","undefined","NaN","Infinity"],mf="Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly".split("."),hf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_f=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],vf=[].concat(gf,mf,hf);function yf(e){let t=e.regex,n=(e,{after:t})=>{let n="</"+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=df,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i==="<"||i===","){t.ignoreMatch();return}i===">"&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:df,keyword:ff,literal:pf,built_in:vf,"variable.language":_f},c="[0-9](_?[0-9])*",l=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...mf,...hf]}},w={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(e){return t.concat("(?!",e.join("|"),")")}let O={match:t.concat(/\b/,D([...gf,"super","import"].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},ee="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:ee,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function bf(e){let t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function xf(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,a,c,l,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,r,s,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Sf(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p="[ \t\n]",m={scope:"string",variants:[u,l,d,f]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],_="__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield".split("."),v="Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass".split("."),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",b(v).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},S=t.concat(r,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},w={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",b(_).join("\\b|"),"|",b(v).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...D]},...D,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,h]}}function Cf(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function wf(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r="and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield".split("."),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:"__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip".split("."),literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},a={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l="[0-9](_?[0-9])*",u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join("|")}`,f={className:"number",relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Tf(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:"alias.and.begin.BEGIN.break.case.class.defined.do.else.elsif.end.END.ensure.for.if.in.module.next.not.or.redo.require.rescue.retry.return.then.undef.unless.until.when.while.yield.include.extend.prepend.public.private.protected.raise.throw".split("."),built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],l={className:"subst",begin:/#\{/,end:/\}/,keywords:a},u={className:"string",contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d="[0-9](_?[0-9])*",f={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},p={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[p]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},f,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:"$",contains:m}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:a,contains:m}}];return c.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(h,c,m)}}function Ef(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s="abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield".split("."),c=["true","false","Some","None","Ok","Err"],l="drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!".split("."),u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:s,literal:c,built_in:l},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:l,type:u}},{className:"punctuation",begin:"->"},a]}}function Df(e){let t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],s="bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary".split("."),c=["add","asc","collation","desc","final","first","last","view"],l="abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year".split("."),u="abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket".split("."),d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},g={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}let y={scope:"keyword",match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:"type",match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var Of="[A-Za-z$_][0-9A-Za-z$_]*",kf="as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using".split("."),Af=["true","false","null","undefined","NaN","Infinity"],jf="Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly".split("."),Mf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Nf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Pf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ff=[].concat(Nf,jf,Mf);function If(e){let t=e.regex,n=(e,{after:t})=>{let n="</"+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Of,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i==="<"||i===","){t.ignoreMatch();return}i===">"&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Of,keyword:kf,literal:Af,built_in:Ff,"variable.language":Pf},c="[0-9](_?[0-9])*",l=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...jf,...Mf]}},w={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(e){return t.concat("(?!",e.join("|"),")")}let O={match:t.concat(/\b/,D([...Nf,"super","import"].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},ee="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,e.REGEXP_MODE,{className:"function",begin:ee,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Lf(e){let t=e.regex,n=If(e),r=Of,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:Of,keyword:kf.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:Af,built_in:Ff.concat(i),"variable.language":Pf},l={className:"meta",begin:"@"+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope==="attr"),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,"shebang",e.SHEBANG()),u(n,"use_strict",s);let p=n.contains.find(e=>e.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Rf(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function zf(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},l={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:"\\n",relevance:0},d={begin:"\\[",end:"\\]",contains:[l],illegal:"\\n",relevance:0},f=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:f}}$.registerLanguage("bash",Gd),$.registerLanguage("c",Kd),$.registerLanguage("cpp",qd),$.registerLanguage("cs",Jd),$.registerLanguage("css",rf),$.registerLanguage("java",uf),$.registerLanguage("javascript",yf),$.registerLanguage("json",bf),$.registerLanguage("markdown",xf),$.registerLanguage("plain",Cf),$.registerLanguage("php",Sf),$.registerLanguage("python",wf),$.registerLanguage("sql",Df),$.registerLanguage("typescript",Lf),$.registerLanguage("ruby",Tf),$.registerLanguage("rust",Ef),$.registerLanguage("xml",Rf),$.registerLanguage("yaml",zf);var Bf=[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"c",label:"C"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"json",label:"JSON"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"sql",label:"SQL"},{key:"typescript",label:"TypeScript"},{key:"ruby",label:"Ruby"},{key:"rust",label:"Rust"},{key:"xml",label:"HTML/XML"},{key:"yaml",label:"YAML"}],Vf='\x3c!-- @license lucide-static v0.562.0 - ISC --\x3e\n<svg\n class="lucide lucide-hash"\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n>\n <line x1="4" x2="20" y1="9" y2="9" />\n <line x1="4" x2="20" y1="15" y2="15" />\n <line x1="10" x2="8" y1="3" y2="21" />\n <line x1="16" x2="14" y1="3" y2="21" />\n</svg>\n',Hf='\x3c!-- @license lucide-static v0.562.0 - ISC --\x3e\n<svg\n class="lucide lucide-pencil"\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n>\n <path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />\n <path d="m15 5 4 4" />\n</svg>\n',Uf=m("<button type=button><span class=QpTooltip-text>");function Wf({children:e,btnClass:t,tooltipText:n,btnText:r}){return(()=>{var i=Uf(),a=i.firstChild;return s(i,`QpTooltip ${t}`),d(i,e,a),d(i,r,a),d(a,n),i})()}var Gf=m("<button type=button class=ql-code>"),Kf=m("<button type=button class=ql-code-block>"),qf=m("<span>"),Jf=m("<div><select class=ql-header><option value=2></option><option value=3></option><option value=4></option><option value selected></option></select><button type=button class=ql-bold></button><button type=button class=ql-italic></button><button type=button class=ql-strike></button><button type=button class=ql-blockquote></button><button type=button class=ql-list value=ordered></button><button type=button class=ql-list value=bullet></button><button type=button class=ql-link></button><select class=ql-align><option value selected></option><option value=center></option><option value=right></option></select><select class=ql-size><option value=small></option><option value selected></option><option value=large></option><option value=huge></option></select><button type=button class=ql-clean>");function Yf({language:e,configuration:t,videoPluginHook:n,internalLinkPluginHook:r}){let{t:i}=ju(e),a=[Gf(),Kf()];return(()=>{var e=Jf(),o=e.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,s=o.nextSibling.nextSibling;return d(e,()=>t?.code&&a,o),d(e,c(Wf,{btnClass:"ql-html-snippet",get tooltipText(){return i("CustomToolbar.insertHtmlSnippetMessage")},get children(){var e=qf();return e.innerHTML=Vf,e}}),s),d(e,c(Wf,{btnClass:"ql-obfuscate",get tooltipText(){return i("CustomToolbar.obfuscate")},get children(){var e=qf();return e.innerHTML=Hf,e}}),s),d(e,n&&c(Wf,{btnClass:"ql-platform-video",get tooltipText(){return i("videoPlugin.insertVideo")},get children(){var e=qf();return e.innerHTML='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>',e}}),s),d(e,r&&c(Wf,{btnClass:"ql-internal-link",get tooltipText(){return i("internalLinkPlugin.insertLink")},get children(){var e=qf();return e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',e}}),s),e})()}var Xf=m("<div>"),Zf=m("<div class=QuillEditor>");function Qf({language:e,setValue:t,value:n,service:r,insertMedia:i,videoPluginHook:a,internalLinkPluginHook:o}){let{t:s}=ju(e),c=r.configuration,l=r.fieldType.adminUi?.editorRows??26,u=Yf({language:e,configuration:c,videoPluginHook:a,internalLinkPluginHook:o}),f=!1,m=(()=>{var e=Xf();return p(e,"height",`calc(${l}rem + 24px)`),e})();async function h(e,t){if(!r.uploadMedia)return;let n=t.toBlob(),a=new File([n],`${s("image")}-${Date.now()}.${e.split("/")[1]}`,{type:e}),o=await r.uploadMedia(a);o&&await i(o)}let g=new Q(m,{modules:{toolbar:u,syntax:c.code?{hljs:$,languages:Bf,interval:1e3}:!1,imageDropAndPaste:{handler:(e,t,n)=>{h(t,n).catch(r.logger.error)}}},theme:"snow"});g.on("text-change",(n,i,o)=>{f&&(n.ops.forEach(async t=>{if(t.insert&&typeof t.insert=="string"){let n=t.insert,i=a?.recognizeUrl(n);if(!i)return;await Vd({editorContent:Su(g),quillEditor:g,service:r,language:e,videoPluginHook:a,value:i})}}),t({delta:g.getContents(),html:g.getSemanticHTML()}.delta))});let _=n();return g.setContents(_??new q.default),g.history.clear(),f=!0,{element:(()=>{var e=Zf();return d(e,u,null),d(e,m,null),e})(),quill:g}}var $f={create:np,init:tp},ep=Wd();function tp(e){let t=`${e.pluginBaseUrl}/admin-ui-plugin.css`,n=document.createElement("link");n.rel="stylesheet",n.href=t,document.head.appendChild(n),e.registerHook("htmlEditorServiceProvider",()=>ep.service)}function np(e){let{fieldType:t}=e;if(t.dataType!=="json")throw Error(`field type '${t.name}' is incompatible with Quill plugin, needs data type 'json'`);if(e.initialValue!==void 0&&!T(e.initialValue))throw Error(`field type '${t.name}' is incompatible, should be a json, got '${typeof e.initialValue}'`);let n=ip(e.initialValue);return i(t=>{let[r,i]=a(n),[s,c]=a(e.language);rd({service:e,videoPluginHook:ep.videoPlugin,internalLinkPluginHook:ep.internalLinkPlugin});let l,{element:u,quill:d}=Qf({language:s,value:r,setValue:t=>{let n=r();i(t),rp(t,n)||e.setModifiedValue({j:t})},service:e,videoPluginHook:ep.videoPlugin,internalLinkPluginHook:ep.internalLinkPlugin,insertMedia:async e=>await(l?.(e))}),f=Rd({quillEditor:d,service:e,language:s,videoPluginHook:ep.videoPlugin,internalLinkPluginHook:ep.internalLinkPlugin});l=f.insertMedia;let p=d.getModule("toolbar");p.addHandler("html-snippet",f.insertHtmlSnippetHandler),p.addHandler("obfuscate",f.insertObfuscateBlotHandler),p.addHandler("platform-video",f.insertVideoHandler),p.addHandler("internal-link",f.insertInternalLinkHandler);let m=d.root,h=e=>g(e,d);m.addEventListener("click",h),o(()=>m.removeEventListener("click",h));let g=async(t,n)=>{let r=t.target;r.tagName==="FIGURE"&&r.classList.contains("MediaBlot")&&await Ld({service:e,editor:n,element:r,language:s}),r.tagName==="BUTTON"&&r.classList.contains("HtmlSnippet")&&await Nd({language:s,editor:n,service:e,htmlSnippetBtn:r}),r.tagName==="SPAN"&&r.classList.contains("ObfuscateBlot")&&await Id({language:s,editor:n,service:e,obfuscatorSpan:r}),r.tagName==="DIV"&&r.classList.contains("PlatformVideo")&&await Fd({editor:n,videoElement:r,language:s,service:e,videoPluginHook:ep.videoPlugin}),r.tagName==="SPAN"&&r.classList.contains("InternalLinkPlugin")&&await Pd({editor:n,internalLinkElement:r,language:s,internalLinkPluginHook:ep.internalLinkPlugin})};return{element:u,setValue:e=>i(ip(e)),setLanguage:c,getValue:()=>({j:r}),dispose:t,insertMedia:e=>l?.(e)}})}function rp(e,t){return!e||!t?e===t:JSON.stringify(e)===JSON.stringify(t)}function ip(e){if(e!==void 0)return T(e)&&typeof e.j=="object"&&e.j!==null?e.j:void 0}export{$f as default};