Files
SnowCatQQ/release-tools/webui-static/assets/modal-CW_tV9ed.js
T
2026-11-12 06:29:38 +08:00

56 lines
233 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var mo=Object.defineProperty;var bo=(s,t,e)=>t in s?mo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var q=(s,t,e)=>bo(s,typeof t!="symbol"?t+"":t,e);import{j as b,r as H}from"./react-vendor-jWT2yUdV.js";import{t as yo,V as dt,v as il,x as vo,y as xo,z as wo,B as al,X as Xi,Y as No,D as Ao,E as Eo,b as lt,c as To,U as Co,O as Lo,Q as So,R as _o,S as Oo,T as qo}from"./index-DiaaLdUu.js";import{z as Er}from"./react-hot-toast-cGcFZPSt.js";import{c as Te,g as ll,l as Yi}from"./qface-BZLvZXJ8.js";import{t as xt}from"./chunk-6LIX6LVT-B246pOuK.js";import{u as Io}from"./use-dialog-CRIMuzeE.js";import{i as Kt}from"./chunk-2QAN2V2R-B2qCPZrG.js";import{p as $t,a as Ut,b as Ft}from"./chunk-2QQAR2RD-YG5LNmAk.js";import{d as Ro,e as jo}from"./index-_HIxriDC.js";import{t as Qi,u as ko,v as Mo}from"./index-FvTxWQTZ.js";import{n as Gs,o as Vs,p as Bo,q as Po,r as Do,s as $o}from"./index-DE7yoXMZ.js";import{g as Uo,h as Fo}from"./index-DPx4wqle.js";import{i as Ho}from"./chunk-MLPFQTYO-DSnBqIsb.js";import{p as zo}from"./index-BBhZPeTB.js";import{F as Go}from"./chunk-SLABUSGS-Cmz8sGrU.js";import{s as Vo,l as Ko}from"./chunk-KVDW62ZT-CGYYmJoP.js";import{t as Zo,a as Ji}from"./chunk-ML27DD5T-ZFWrMOn-.js";import{u as Wo,C as Ur}from"./react-hook-form-DTbqnRcd.js";import{e as ta,f as Xo}from"./code_editor-TFSnOENo.js";import{G as Yo}from"./iconBase-B7bT1FlI.js";var Hn=yo({slots:{base:"inline-flex items-center justify-between h-fit rounded-large gap-2",pre:"bg-transparent text-inherit font-mono font-normal inline-block whitespace-nowrap",content:"flex flex-col",symbol:"select-none",copyButton:["group","relative","z-10","text-large","text-inherit","data-[hover=true]:bg-transparent"],copyIcon:["absolute text-inherit opacity-100 scale-100 group-data-[copied=true]:opacity-0 group-data-[copied=true]:scale-50"],checkIcon:["absolute text-inherit opacity-0 scale-50 group-data-[copied=true]:opacity-100 group-data-[copied=true]:scale-100"]},variants:{variant:{flat:"",solid:"",bordered:"border-medium bg-transparent",shadow:""},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{base:"px-1.5 py-0.5 text-tiny rounded-small"},md:{base:"px-3 py-1.5 text-small rounded-medium"},lg:{base:"px-4 py-2 text-medium rounded-large"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"}},fullWidth:{true:{base:"w-full"}},disableAnimation:{true:{},false:{copyIcon:"transition-transform-opacity",checkIcon:"transition-transform-opacity"}}},defaultVariants:{color:"default",variant:"flat",size:"md",fullWidth:!1},compoundVariants:[{variant:["solid","shadow"],color:"default",class:{copyButton:"data-[focus-visible]:outline-default-foreground"}},{variant:["solid","shadow"],color:"primary",class:{copyButton:"data-[focus-visible]:outline-primary-foreground"}},{variant:["solid","shadow"],color:"secondary",class:{copyButton:"data-[focus-visible]:outline-secondary-foreground"}},{variant:["solid","shadow"],color:"success",class:{copyButton:"data-[focus-visible]:outline-success-foreground"}},{variant:["solid","shadow"],color:"warning",class:{copyButton:"data-[focus-visible]:outline-warning-foreground"}},{variant:["solid","shadow"],color:"danger",class:{copyButton:"data-[focus-visible]:outline-danger-foreground"}},{variant:"flat",color:"default",class:{base:dt.flat.default}},{variant:"flat",color:"primary",class:{base:dt.flat.primary}},{variant:"flat",color:"secondary",class:{base:dt.flat.secondary}},{variant:"flat",color:"success",class:{base:dt.flat.success}},{variant:"flat",color:"warning",class:{base:dt.flat.warning}},{variant:"flat",color:"danger",class:{base:dt.flat.danger}},{variant:"solid",color:"default",class:{base:dt.solid.default}},{variant:"solid",color:"primary",class:{base:dt.solid.primary}},{variant:"solid",color:"secondary",class:{base:dt.solid.secondary}},{variant:"solid",color:"success",class:{base:dt.solid.success}},{variant:"solid",color:"warning",class:{base:dt.solid.warning}},{variant:"solid",color:"danger",class:{base:dt.solid.danger}},{variant:"shadow",color:"default",class:{base:dt.shadow.default}},{variant:"shadow",color:"primary",class:{base:dt.shadow.primary}},{variant:"shadow",color:"secondary",class:{base:dt.shadow.secondary}},{variant:"shadow",color:"success",class:{base:dt.shadow.success}},{variant:"shadow",color:"warning",class:{base:dt.shadow.warning}},{variant:"shadow",color:"danger",class:{base:dt.shadow.danger}},{variant:"bordered",color:"default",class:{base:dt.bordered.default}},{variant:"bordered",color:"primary",class:{base:dt.bordered.primary}},{variant:"bordered",color:"secondary",class:{base:dt.bordered.secondary}},{variant:"bordered",color:"success",class:{base:dt.bordered.success}},{variant:"bordered",color:"warning",class:{base:dt.bordered.warning}},{variant:"bordered",color:"danger",class:{base:dt.bordered.danger}}]}),Qo=s=>b.jsxs("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",width:"1em",...s,children:[b.jsx("path",{d:"M16 17.1c0 3.5-1.4 4.9-4.9 4.9H6.9C3.4 22 2 20.6 2 17.1v-4.2C2 9.4 3.4 8 6.9 8h4.2c3.5 0 4.9 1.4 4.9 4.9Z"}),b.jsx("path",{d:"M8 8V6.9C8 3.4 9.4 2 12.9 2h4.2C20.6 2 22 3.4 22 6.9v4.2c0 3.5-1.4 4.9-4.9 4.9H16"}),b.jsx("path",{d:"M16 12.9C16 9.4 14.6 8 11.1 8"})]}),Jo=s=>b.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:"1em",...s,children:b.jsx("polyline",{points:"20 6 9 17 4 12"})}),tc=H.forwardRef(function(t,e){var r,n;const i=il(),l=(n=(r=t.validationBehavior)!=null?r:i==null?void 0:i.validationBehavior)!=null?n:"aria";return b.jsx(Go,{...t,ref:e,validationBehavior:l})}),ol=typeof global=="object"&&global&&global.Object===Object&&global,ec=typeof self=="object"&&self&&self.Object===Object&&self,ue=ol||ec||Function("return this")(),_e=ue.Symbol,cl=Object.prototype,rc=cl.hasOwnProperty,sc=cl.toString,Fr=_e?_e.toStringTag:void 0;function nc(s){var t=rc.call(s,Fr),e=s[Fr];try{s[Fr]=void 0;var r=!0}catch{}var n=sc.call(s);return r&&(t?s[Fr]=e:delete s[Fr]),n}var ic=Object.prototype,ac=ic.toString;function lc(s){return ac.call(s)}var oc="[object Null]",cc="[object Undefined]",ea=_e?_e.toStringTag:void 0;function Tr(s){return s==null?s===void 0?cc:oc:ea&&ea in Object(s)?nc(s):lc(s)}function me(s){return s!=null&&typeof s=="object"}var De=Array.isArray;function Oe(s){var t=typeof s;return s!=null&&(t=="object"||t=="function")}function ul(s){return s}var uc="[object AsyncFunction]",hc="[object Function]",fc="[object GeneratorFunction]",dc="[object Proxy]";function Oi(s){if(!Oe(s))return!1;var t=Tr(s);return t==hc||t==fc||t==uc||t==dc}var zn=ue["__core-js_shared__"],ra=(function(){var s=/[^.]+$/.exec(zn&&zn.keys&&zn.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function pc(s){return!!ra&&ra in s}var gc=Function.prototype,mc=gc.toString;function Fe(s){if(s!=null){try{return mc.call(s)}catch{}try{return s+""}catch{}}return""}var bc=/[\\^$.*+?()[\]{}|]/g,yc=/^\[object .+?Constructor\]$/,vc=Function.prototype,xc=Object.prototype,wc=vc.toString,Nc=xc.hasOwnProperty,Ac=RegExp("^"+wc.call(Nc).replace(bc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ec(s){if(!Oe(s)||pc(s))return!1;var t=Oi(s)?Ac:yc;return t.test(Fe(s))}function Tc(s,t){return s==null?void 0:s[t]}function He(s,t){var e=Tc(s,t);return Ec(e)?e:void 0}var ni=He(ue,"WeakMap"),sa=Object.create,Cc=(function(){function s(){}return function(t){if(!Oe(t))return{};if(sa)return sa(t);s.prototype=t;var e=new s;return s.prototype=void 0,e}})();function Lc(s,t,e){switch(e.length){case 0:return s.call(t);case 1:return s.call(t,e[0]);case 2:return s.call(t,e[0],e[1]);case 3:return s.call(t,e[0],e[1],e[2])}return s.apply(t,e)}function Sc(s,t){var e=-1,r=s.length;for(t||(t=Array(r));++e<r;)t[e]=s[e];return t}var _c=800,Oc=16,qc=Date.now;function Ic(s){var t=0,e=0;return function(){var r=qc(),n=Oc-(r-e);if(e=r,n>0){if(++t>=_c)return arguments[0]}else t=0;return s.apply(void 0,arguments)}}function Rc(s){return function(){return s}}var Us=(function(){try{var s=He(Object,"defineProperty");return s({},"",{}),s}catch{}})(),jc=Us?function(s,t){return Us(s,"toString",{configurable:!0,enumerable:!1,value:Rc(t),writable:!0})}:ul,kc=Ic(jc);function Mc(s,t){for(var e=-1,r=s==null?0:s.length;++e<r&&t(s[e],e,s)!==!1;);return s}var Bc=9007199254740991,Pc=/^(?:0|[1-9]\d*)$/;function hl(s,t){var e=typeof s;return t=t??Bc,!!t&&(e=="number"||e!="symbol"&&Pc.test(s))&&s>-1&&s%1==0&&s<t}function qi(s,t,e){t=="__proto__"&&Us?Us(s,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):s[t]=e}function ns(s,t){return s===t||s!==s&&t!==t}var Dc=Object.prototype,$c=Dc.hasOwnProperty;function fl(s,t,e){var r=s[t];(!($c.call(s,t)&&ns(r,e))||e===void 0&&!(t in s))&&qi(s,t,e)}function Uc(s,t,e,r){var n=!e;e||(e={});for(var i=-1,l=t.length;++i<l;){var o=t[i],c=void 0;c===void 0&&(c=s[o]),n?qi(e,o,c):fl(e,o,c)}return e}var na=Math.max;function Fc(s,t,e){return t=na(t===void 0?s.length-1:t,0),function(){for(var r=arguments,n=-1,i=na(r.length-t,0),l=Array(i);++n<i;)l[n]=r[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=r[n];return o[t]=e(l),Lc(s,this,o)}}function Hc(s,t){return kc(Fc(s,t,ul),s+"")}var zc=9007199254740991;function dl(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=zc}function Ks(s){return s!=null&&dl(s.length)&&!Oi(s)}function Gc(s,t,e){if(!Oe(e))return!1;var r=typeof t;return(r=="number"?Ks(e)&&hl(t,e.length):r=="string"&&t in e)?ns(e[t],s):!1}function Vc(s){return Hc(function(t,e){var r=-1,n=e.length,i=n>1?e[n-1]:void 0,l=n>2?e[2]:void 0;for(i=s.length>3&&typeof i=="function"?(n--,i):void 0,l&&Gc(e[0],e[1],l)&&(i=n<3?void 0:i,n=1),t=Object(t);++r<n;){var o=e[r];o&&s(t,o,r,i)}return t})}var Kc=Object.prototype;function Ii(s){var t=s&&s.constructor,e=typeof t=="function"&&t.prototype||Kc;return s===e}function Zc(s,t){for(var e=-1,r=Array(s);++e<s;)r[e]=t(e);return r}var Wc="[object Arguments]";function ia(s){return me(s)&&Tr(s)==Wc}var pl=Object.prototype,Xc=pl.hasOwnProperty,Yc=pl.propertyIsEnumerable,ii=ia((function(){return arguments})())?ia:function(s){return me(s)&&Xc.call(s,"callee")&&!Yc.call(s,"callee")};function Qc(){return!1}var gl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,aa=gl&&typeof module=="object"&&module&&!module.nodeType&&module,Jc=aa&&aa.exports===gl,la=Jc?ue.Buffer:void 0,tu=la?la.isBuffer:void 0,Yr=tu||Qc,eu="[object Arguments]",ru="[object Array]",su="[object Boolean]",nu="[object Date]",iu="[object Error]",au="[object Function]",lu="[object Map]",ou="[object Number]",cu="[object Object]",uu="[object RegExp]",hu="[object Set]",fu="[object String]",du="[object WeakMap]",pu="[object ArrayBuffer]",gu="[object DataView]",mu="[object Float32Array]",bu="[object Float64Array]",yu="[object Int8Array]",vu="[object Int16Array]",xu="[object Int32Array]",wu="[object Uint8Array]",Nu="[object Uint8ClampedArray]",Au="[object Uint16Array]",Eu="[object Uint32Array]",ft={};ft[mu]=ft[bu]=ft[yu]=ft[vu]=ft[xu]=ft[wu]=ft[Nu]=ft[Au]=ft[Eu]=!0;ft[eu]=ft[ru]=ft[pu]=ft[su]=ft[gu]=ft[nu]=ft[iu]=ft[au]=ft[lu]=ft[ou]=ft[cu]=ft[uu]=ft[hu]=ft[fu]=ft[du]=!1;function Tu(s){return me(s)&&dl(s.length)&&!!ft[Tr(s)]}function Ri(s){return function(t){return s(t)}}var ml=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kr=ml&&typeof module=="object"&&module&&!module.nodeType&&module,Cu=Kr&&Kr.exports===ml,Gn=Cu&&ol.process,yr=(function(){try{var s=Kr&&Kr.require&&Kr.require("util").types;return s||Gn&&Gn.binding&&Gn.binding("util")}catch{}})(),oa=yr&&yr.isTypedArray,ji=oa?Ri(oa):Tu,Lu=Object.prototype,Su=Lu.hasOwnProperty;function bl(s,t){var e=De(s),r=!e&&ii(s),n=!e&&!r&&Yr(s),i=!e&&!r&&!n&&ji(s),l=e||r||n||i,o=l?Zc(s.length,String):[],c=o.length;for(var h in s)(t||Su.call(s,h))&&!(l&&(h=="length"||n&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||hl(h,c)))&&o.push(h);return o}function yl(s,t){return function(e){return s(t(e))}}var _u=yl(Object.keys,Object),Ou=Object.prototype,qu=Ou.hasOwnProperty;function Iu(s){if(!Ii(s))return _u(s);var t=[];for(var e in Object(s))qu.call(s,e)&&e!="constructor"&&t.push(e);return t}function Ru(s){return Ks(s)?bl(s):Iu(s)}function ju(s){var t=[];if(s!=null)for(var e in Object(s))t.push(e);return t}var ku=Object.prototype,Mu=ku.hasOwnProperty;function Bu(s){if(!Oe(s))return ju(s);var t=Ii(s),e=[];for(var r in s)r=="constructor"&&(t||!Mu.call(s,r))||e.push(r);return e}function vl(s){return Ks(s)?bl(s,!0):Bu(s)}var Qr=He(Object,"create");function Pu(){this.__data__=Qr?Qr(null):{},this.size=0}function Du(s){var t=this.has(s)&&delete this.__data__[s];return this.size-=t?1:0,t}var $u="__lodash_hash_undefined__",Uu=Object.prototype,Fu=Uu.hasOwnProperty;function Hu(s){var t=this.__data__;if(Qr){var e=t[s];return e===$u?void 0:e}return Fu.call(t,s)?t[s]:void 0}var zu=Object.prototype,Gu=zu.hasOwnProperty;function Vu(s){var t=this.__data__;return Qr?t[s]!==void 0:Gu.call(t,s)}var Ku="__lodash_hash_undefined__";function Zu(s,t){var e=this.__data__;return this.size+=this.has(s)?0:1,e[s]=Qr&&t===void 0?Ku:t,this}function $e(s){var t=-1,e=s==null?0:s.length;for(this.clear();++t<e;){var r=s[t];this.set(r[0],r[1])}}$e.prototype.clear=Pu;$e.prototype.delete=Du;$e.prototype.get=Hu;$e.prototype.has=Vu;$e.prototype.set=Zu;function Wu(){this.__data__=[],this.size=0}function Zs(s,t){for(var e=s.length;e--;)if(ns(s[e][0],t))return e;return-1}var Xu=Array.prototype,Yu=Xu.splice;function Qu(s){var t=this.__data__,e=Zs(t,s);if(e<0)return!1;var r=t.length-1;return e==r?t.pop():Yu.call(t,e,1),--this.size,!0}function Ju(s){var t=this.__data__,e=Zs(t,s);return e<0?void 0:t[e][1]}function th(s){return Zs(this.__data__,s)>-1}function eh(s,t){var e=this.__data__,r=Zs(e,s);return r<0?(++this.size,e.push([s,t])):e[r][1]=t,this}function ve(s){var t=-1,e=s==null?0:s.length;for(this.clear();++t<e;){var r=s[t];this.set(r[0],r[1])}}ve.prototype.clear=Wu;ve.prototype.delete=Qu;ve.prototype.get=Ju;ve.prototype.has=th;ve.prototype.set=eh;var Jr=He(ue,"Map");function rh(){this.size=0,this.__data__={hash:new $e,map:new(Jr||ve),string:new $e}}function sh(s){var t=typeof s;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?s!=="__proto__":s===null}function Ws(s,t){var e=s.__data__;return sh(t)?e[typeof t=="string"?"string":"hash"]:e.map}function nh(s){var t=Ws(this,s).delete(s);return this.size-=t?1:0,t}function ih(s){return Ws(this,s).get(s)}function ah(s){return Ws(this,s).has(s)}function lh(s,t){var e=Ws(this,s),r=e.size;return e.set(s,t),this.size+=e.size==r?0:1,this}function ze(s){var t=-1,e=s==null?0:s.length;for(this.clear();++t<e;){var r=s[t];this.set(r[0],r[1])}}ze.prototype.clear=rh;ze.prototype.delete=nh;ze.prototype.get=ih;ze.prototype.has=ah;ze.prototype.set=lh;function oh(s,t){for(var e=-1,r=t.length,n=s.length;++e<r;)s[n+e]=t[e];return s}var xl=yl(Object.getPrototypeOf,Object),ch="[object Object]",uh=Function.prototype,hh=Object.prototype,wl=uh.toString,fh=hh.hasOwnProperty,dh=wl.call(Object);function ph(s){if(!me(s)||Tr(s)!=ch)return!1;var t=xl(s);if(t===null)return!0;var e=fh.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&wl.call(e)==dh}function gh(){this.__data__=new ve,this.size=0}function mh(s){var t=this.__data__,e=t.delete(s);return this.size=t.size,e}function bh(s){return this.__data__.get(s)}function yh(s){return this.__data__.has(s)}var vh=200;function xh(s,t){var e=this.__data__;if(e instanceof ve){var r=e.__data__;if(!Jr||r.length<vh-1)return r.push([s,t]),this.size=++e.size,this;e=this.__data__=new ze(r)}return e.set(s,t),this.size=e.size,this}function ae(s){var t=this.__data__=new ve(s);this.size=t.size}ae.prototype.clear=gh;ae.prototype.delete=mh;ae.prototype.get=bh;ae.prototype.has=yh;ae.prototype.set=xh;var Nl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ca=Nl&&typeof module=="object"&&module&&!module.nodeType&&module,wh=ca&&ca.exports===Nl,ua=wh?ue.Buffer:void 0,ha=ua?ua.allocUnsafe:void 0;function Al(s,t){if(t)return s.slice();var e=s.length,r=ha?ha(e):new s.constructor(e);return s.copy(r),r}function Nh(s,t){for(var e=-1,r=s==null?0:s.length,n=0,i=[];++e<r;){var l=s[e];t(l,e,s)&&(i[n++]=l)}return i}function Ah(){return[]}var Eh=Object.prototype,Th=Eh.propertyIsEnumerable,fa=Object.getOwnPropertySymbols,Ch=fa?function(s){return s==null?[]:(s=Object(s),Nh(fa(s),function(t){return Th.call(s,t)}))}:Ah;function Lh(s,t,e){var r=t(s);return De(s)?r:oh(r,e(s))}function ai(s){return Lh(s,Ru,Ch)}var li=He(ue,"DataView"),oi=He(ue,"Promise"),ci=He(ue,"Set"),da="[object Map]",Sh="[object Object]",pa="[object Promise]",ga="[object Set]",ma="[object WeakMap]",ba="[object DataView]",_h=Fe(li),Oh=Fe(Jr),qh=Fe(oi),Ih=Fe(ci),Rh=Fe(ni),Zt=Tr;(li&&Zt(new li(new ArrayBuffer(1)))!=ba||Jr&&Zt(new Jr)!=da||oi&&Zt(oi.resolve())!=pa||ci&&Zt(new ci)!=ga||ni&&Zt(new ni)!=ma)&&(Zt=function(s){var t=Tr(s),e=t==Sh?s.constructor:void 0,r=e?Fe(e):"";if(r)switch(r){case _h:return ba;case Oh:return da;case qh:return pa;case Ih:return ga;case Rh:return ma}return t});var jh=Object.prototype,kh=jh.hasOwnProperty;function Mh(s){var t=s.length,e=new s.constructor(t);return t&&typeof s[0]=="string"&&kh.call(s,"index")&&(e.index=s.index,e.input=s.input),e}var Fs=ue.Uint8Array;function ki(s){var t=new s.constructor(s.byteLength);return new Fs(t).set(new Fs(s)),t}function Bh(s,t){var e=ki(s.buffer);return new s.constructor(e,s.byteOffset,s.byteLength)}var Ph=/\w*$/;function Dh(s){var t=new s.constructor(s.source,Ph.exec(s));return t.lastIndex=s.lastIndex,t}var ya=_e?_e.prototype:void 0,va=ya?ya.valueOf:void 0;function $h(s){return va?Object(va.call(s)):{}}function El(s,t){var e=t?ki(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.length)}var Uh="[object Boolean]",Fh="[object Date]",Hh="[object Map]",zh="[object Number]",Gh="[object RegExp]",Vh="[object Set]",Kh="[object String]",Zh="[object Symbol]",Wh="[object ArrayBuffer]",Xh="[object DataView]",Yh="[object Float32Array]",Qh="[object Float64Array]",Jh="[object Int8Array]",tf="[object Int16Array]",ef="[object Int32Array]",rf="[object Uint8Array]",sf="[object Uint8ClampedArray]",nf="[object Uint16Array]",af="[object Uint32Array]";function lf(s,t,e){var r=s.constructor;switch(t){case Wh:return ki(s);case Uh:case Fh:return new r(+s);case Xh:return Bh(s);case Yh:case Qh:case Jh:case tf:case ef:case rf:case sf:case nf:case af:return El(s,e);case Hh:return new r;case zh:case Kh:return new r(s);case Gh:return Dh(s);case Vh:return new r;case Zh:return $h(s)}}function Tl(s){return typeof s.constructor=="function"&&!Ii(s)?Cc(xl(s)):{}}var of="[object Map]";function cf(s){return me(s)&&Zt(s)==of}var xa=yr&&yr.isMap,uf=xa?Ri(xa):cf,hf="[object Set]";function ff(s){return me(s)&&Zt(s)==hf}var wa=yr&&yr.isSet,df=wa?Ri(wa):ff,pf=1,Cl="[object Arguments]",gf="[object Array]",mf="[object Boolean]",bf="[object Date]",yf="[object Error]",Ll="[object Function]",vf="[object GeneratorFunction]",xf="[object Map]",wf="[object Number]",Sl="[object Object]",Nf="[object RegExp]",Af="[object Set]",Ef="[object String]",Tf="[object Symbol]",Cf="[object WeakMap]",Lf="[object ArrayBuffer]",Sf="[object DataView]",_f="[object Float32Array]",Of="[object Float64Array]",qf="[object Int8Array]",If="[object Int16Array]",Rf="[object Int32Array]",jf="[object Uint8Array]",kf="[object Uint8ClampedArray]",Mf="[object Uint16Array]",Bf="[object Uint32Array]",ht={};ht[Cl]=ht[gf]=ht[Lf]=ht[Sf]=ht[mf]=ht[bf]=ht[_f]=ht[Of]=ht[qf]=ht[If]=ht[Rf]=ht[xf]=ht[wf]=ht[Sl]=ht[Nf]=ht[Af]=ht[Ef]=ht[Tf]=ht[jf]=ht[kf]=ht[Mf]=ht[Bf]=!0;ht[yf]=ht[Ll]=ht[Cf]=!1;function Ps(s,t,e,r,n,i){var l,o=t&pf;if(l!==void 0)return l;if(!Oe(s))return s;var c=De(s);if(c)l=Mh(s);else{var h=Zt(s),m=h==Ll||h==vf;if(Yr(s))return Al(s,o);if(h==Sl||h==Cl||m&&!n)l=m?{}:Tl(s);else{if(!ht[h])return n?s:{};l=lf(s,h,o)}}i||(i=new ae);var y=i.get(s);if(y)return y;i.set(s,l),df(s)?s.forEach(function(v){l.add(Ps(v,t,e,v,s,i))}):uf(s)&&s.forEach(function(v,w){l.set(w,Ps(v,t,e,w,s,i))});var f=ai,d=c?void 0:f(s);return Mc(d||s,function(v,w){d&&(w=v,v=s[w]),fl(l,w,Ps(v,t,e,w,s,i))}),l}var Pf=1,Df=4;function gr(s){return Ps(s,Pf|Df)}var $f="__lodash_hash_undefined__";function Uf(s){return this.__data__.set(s,$f),this}function Ff(s){return this.__data__.has(s)}function Hs(s){var t=-1,e=s==null?0:s.length;for(this.__data__=new ze;++t<e;)this.add(s[t])}Hs.prototype.add=Hs.prototype.push=Uf;Hs.prototype.has=Ff;function Hf(s,t){for(var e=-1,r=s==null?0:s.length;++e<r;)if(t(s[e],e,s))return!0;return!1}function zf(s,t){return s.has(t)}var Gf=1,Vf=2;function _l(s,t,e,r,n,i){var l=e&Gf,o=s.length,c=t.length;if(o!=c&&!(l&&c>o))return!1;var h=i.get(s),m=i.get(t);if(h&&m)return h==t&&m==s;var y=-1,f=!0,d=e&Vf?new Hs:void 0;for(i.set(s,t),i.set(t,s);++y<o;){var v=s[y],w=t[y];if(r)var N=l?r(w,v,y,t,s,i):r(v,w,y,s,t,i);if(N!==void 0){if(N)continue;f=!1;break}if(d){if(!Hf(t,function(T,O){if(!zf(d,O)&&(v===T||n(v,T,e,r,i)))return d.push(O)})){f=!1;break}}else if(!(v===w||n(v,w,e,r,i))){f=!1;break}}return i.delete(s),i.delete(t),f}function Kf(s){var t=-1,e=Array(s.size);return s.forEach(function(r,n){e[++t]=[n,r]}),e}function Zf(s){var t=-1,e=Array(s.size);return s.forEach(function(r){e[++t]=r}),e}var Wf=1,Xf=2,Yf="[object Boolean]",Qf="[object Date]",Jf="[object Error]",td="[object Map]",ed="[object Number]",rd="[object RegExp]",sd="[object Set]",nd="[object String]",id="[object Symbol]",ad="[object ArrayBuffer]",ld="[object DataView]",Na=_e?_e.prototype:void 0,Vn=Na?Na.valueOf:void 0;function od(s,t,e,r,n,i,l){switch(e){case ld:if(s.byteLength!=t.byteLength||s.byteOffset!=t.byteOffset)return!1;s=s.buffer,t=t.buffer;case ad:return!(s.byteLength!=t.byteLength||!i(new Fs(s),new Fs(t)));case Yf:case Qf:case ed:return ns(+s,+t);case Jf:return s.name==t.name&&s.message==t.message;case rd:case nd:return s==t+"";case td:var o=Kf;case sd:var c=r&Wf;if(o||(o=Zf),s.size!=t.size&&!c)return!1;var h=l.get(s);if(h)return h==t;r|=Xf,l.set(s,t);var m=_l(o(s),o(t),r,n,i,l);return l.delete(s),m;case id:if(Vn)return Vn.call(s)==Vn.call(t)}return!1}var cd=1,ud=Object.prototype,hd=ud.hasOwnProperty;function fd(s,t,e,r,n,i){var l=e&cd,o=ai(s),c=o.length,h=ai(t),m=h.length;if(c!=m&&!l)return!1;for(var y=c;y--;){var f=o[y];if(!(l?f in t:hd.call(t,f)))return!1}var d=i.get(s),v=i.get(t);if(d&&v)return d==t&&v==s;var w=!0;i.set(s,t),i.set(t,s);for(var N=l;++y<c;){f=o[y];var T=s[f],O=t[f];if(r)var k=l?r(O,T,f,t,s,i):r(T,O,f,s,t,i);if(!(k===void 0?T===O||n(T,O,e,r,i):k)){w=!1;break}N||(N=f=="constructor")}if(w&&!N){var z=s.constructor,j=t.constructor;z!=j&&"constructor"in s&&"constructor"in t&&!(typeof z=="function"&&z instanceof z&&typeof j=="function"&&j instanceof j)&&(w=!1)}return i.delete(s),i.delete(t),w}var dd=1,Aa="[object Arguments]",Ea="[object Array]",Ss="[object Object]",pd=Object.prototype,Ta=pd.hasOwnProperty;function gd(s,t,e,r,n,i){var l=De(s),o=De(t),c=l?Ea:Zt(s),h=o?Ea:Zt(t);c=c==Aa?Ss:c,h=h==Aa?Ss:h;var m=c==Ss,y=h==Ss,f=c==h;if(f&&Yr(s)){if(!Yr(t))return!1;l=!0,m=!1}if(f&&!m)return i||(i=new ae),l||ji(s)?_l(s,t,e,r,n,i):od(s,t,c,e,r,n,i);if(!(e&dd)){var d=m&&Ta.call(s,"__wrapped__"),v=y&&Ta.call(t,"__wrapped__");if(d||v){var w=d?s.value():s,N=v?t.value():t;return i||(i=new ae),n(w,N,e,r,i)}}return f?(i||(i=new ae),fd(s,t,e,r,n,i)):!1}function Ol(s,t,e,r,n){return s===t?!0:s==null||t==null||!me(s)&&!me(t)?s!==s&&t!==t:gd(s,t,e,r,Ol,n)}function md(s){return function(t,e,r){for(var n=-1,i=Object(t),l=r(t),o=l.length;o--;){var c=l[++n];if(e(i[c],c,i)===!1)break}return t}}var bd=md();function ui(s,t,e){(e!==void 0&&!ns(s[t],e)||e===void 0&&!(t in s))&&qi(s,t,e)}function yd(s){return me(s)&&Ks(s)}function hi(s,t){if(!(t==="constructor"&&typeof s[t]=="function")&&t!="__proto__")return s[t]}function vd(s){return Uc(s,vl(s))}function xd(s,t,e,r,n,i,l){var o=hi(s,e),c=hi(t,e),h=l.get(c);if(h){ui(s,e,h);return}var m=i?i(o,c,e+"",s,t,l):void 0,y=m===void 0;if(y){var f=De(c),d=!f&&Yr(c),v=!f&&!d&&ji(c);m=c,f||d||v?De(o)?m=o:yd(o)?m=Sc(o):d?(y=!1,m=Al(c,!0)):v?(y=!1,m=El(c,!0)):m=[]:ph(c)||ii(c)?(m=o,ii(o)?m=vd(o):(!Oe(o)||Oi(o))&&(m=Tl(c))):y=!1}y&&(l.set(c,m),n(m,c,r,i,l),l.delete(c)),ui(s,e,m)}function ql(s,t,e,r,n){s!==t&&bd(t,function(i,l){if(n||(n=new ae),Oe(i))xd(s,t,l,e,ql,r,n);else{var o=r?r(hi(s,l),i,l+"",s,t,n):void 0;o===void 0&&(o=i),ui(s,l,o)}},vl)}function Mi(s,t){return Ol(s,t)}var Se=Vc(function(s,t,e){ql(s,t,e)}),D=(s=>(s[s.TYPE=3]="TYPE",s[s.LEVEL=12]="LEVEL",s[s.ATTRIBUTE=13]="ATTRIBUTE",s[s.BLOT=14]="BLOT",s[s.INLINE=7]="INLINE",s[s.BLOCK=11]="BLOCK",s[s.BLOCK_BLOT=10]="BLOCK_BLOT",s[s.INLINE_BLOT=6]="INLINE_BLOT",s[s.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",s[s.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",s[s.ANY=15]="ANY",s))(D||{});class oe{constructor(t,e,r={}){this.attrName=t,this.keyName=e;const n=D.TYPE&D.ATTRIBUTE;this.scope=r.scope!=null?r.scope&D.LEVEL|n:D.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(t){return Array.from(t.attributes).map(e=>e.name)}add(t,e){return this.canAdd(t,e)?(t.setAttribute(this.keyName,e),!0):!1}canAdd(t,e){return this.whitelist==null?!0:typeof e=="string"?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class mr extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const Il=class fi{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let r=null;try{r=t.parentNode}catch{return null}return this.find(r,e)}return null}create(t,e,r){const n=this.query(e);if(n==null)throw new mr(`Unable to create ${e} blot`);const i=n,l=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(r),o=new i(t,l,r);return fi.blots.set(o.domNode,o),o}find(t,e=!1){return fi.find(t,e)}query(t,e=D.ANY){let r;return typeof t=="string"?r=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?r=this.types.text:typeof t=="number"?t&D.LEVEL&D.BLOCK?r=this.types.block:t&D.LEVEL&D.INLINE&&(r=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(n=>(r=this.classes[n],!!r)),r=r||this.tags[t.tagName]),r==null?null:"scope"in r&&e&D.LEVEL&r.scope&&e&D.TYPE&r.scope?r:null}register(...t){return t.map(e=>{const r="blotName"in e,n="attrName"in e;if(!r&&!n)throw new mr("Invalid definition");if(r&&e.blotName==="abstract")throw new mr("Cannot register abstract class");const i=r?e.blotName:n?e.attrName:void 0;return this.types[i]=e,n?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):r&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(l=>l.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(l=>{(this.tags[l]==null||e.className==null)&&(this.tags[l]=e)}))),e})}};Il.blots=new WeakMap;let vr=Il;function Ca(s,t){return(s.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class wd extends oe{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(t,e){return this.canAdd(t,e)?(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0):!1}remove(t){Ca(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(Ca(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const Qt=wd;function Kn(s){const t=s.split("-"),e=t.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return t[0]+e}class Nd extends oe{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[Kn(this.keyName)]=e,!0):!1}remove(t){t.style[Kn(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[Kn(this.keyName)];return this.canAdd(t,e)?e:""}}const qe=Nd;class Ad{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=vr.find(this.domNode);if(t==null)return;const e=oe.keys(this.domNode),r=Qt.keys(this.domNode),n=qe.keys(this.domNode);e.concat(r).concat(n).forEach(i=>{const l=t.scroll.query(i,D.ATTRIBUTE);l instanceof oe&&(this.attributes[l.attrName]=l)})}copy(t){Object.keys(this.attributes).forEach(e=>{const r=this.attributes[e].value(this.domNode);t.format(e,r)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}}const Xs=Ad,Rl=class{constructor(t,e){this.scroll=t,this.domNode=e,vr.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new mr("Blot definition missing tagName");let e,r;return Array.isArray(this.tagName)?(typeof t=="string"?(r=t.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof t=="number"&&(r=t),typeof r=="number"?e=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?e=document.createElement(r):e=document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),vr.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,r,n){const i=this.isolate(t,e);if(this.scroll.query(r,D.BLOT)!=null&&n)i.wrap(r,n);else if(this.scroll.query(r,D.ATTRIBUTE)!=null){const l=this.scroll.create(this.statics.scope);i.wrap(l),l.format(r,n)}}insertAt(t,e,r){const n=r==null?this.scroll.create("text",e):this.scroll.create(e,r),i=this.split(t);this.parent.insertBefore(n,i||void 0)}isolate(t,e){const r=this.split(t);if(r==null)throw new Error("Attempt to isolate at end");return r.split(e),r}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){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(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new mr(`Cannot wrap ${t}`);return r.appendChild(this),r}};Rl.blotName="abstract";let jl=Rl;const kl=class extends jl{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};kl.scope=D.INLINE_BLOT;let Ed=kl;const Lt=Ed;class Td{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const e=t.slice(1);this.append(...e)}}at(t){const e=this.iterator();let r=e();for(;r&&t>0;)t-=1,r=e();return r}contains(t){const e=this.iterator();let r=e();for(;r;){if(r===t)return!0;r=e()}return!1}indexOf(t){const e=this.iterator();let r=e(),n=0;for(;r;){if(r===t)return n;n+=1,r=e()}return-1}insertBefore(t,e){t!=null&&(this.remove(t),t.next=e,e!=null?(t.prev=e.prev,e.prev!=null&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,r=this.head;for(;r!=null;){if(r===t)return e;e+=r.length(),r=r.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return t!=null&&(t=t.next),e}}find(t,e=!1){const r=this.iterator();let n=r();for(;n;){const i=n.length();if(t<i||e&&t===i&&(n.next==null||n.next.length()!==0))return[n,t];t-=i,n=r()}return[null,0]}forEach(t){const e=this.iterator();let r=e();for(;r;)t(r),r=e()}forEachAt(t,e,r){if(e<=0)return;const[n,i]=this.find(t);let l=t-i;const o=this.iterator(n);let c=o();for(;c&&l<t+e;){const h=c.length();t>l?r(c,t-l,Math.min(e,l+h-t)):r(c,0,Math.min(h,t+e-l)),l+=h,c=o()}}map(t){return this.reduce((e,r)=>(e.push(t(r)),e),[])}reduce(t,e){const r=this.iterator();let n=r();for(;n;)e=t(e,n),n=r();return e}}function La(s,t){const e=t.find(s);if(e)return e;try{return t.create(s)}catch{const r=t.create(D.INLINE);return Array.from(s.childNodes).forEach(n=>{r.domNode.appendChild(n)}),s.parentNode&&s.parentNode.replaceChild(r.domNode,s),r.attach(),r}}const Ml=class Ee extends jl{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,Ee.uiClass&&this.uiNode.classList.add(Ee.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Td,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=La(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof mr)return;throw e}})}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,(r,n,i)=>{r.deleteAt(n,i)})}descendant(t,e=0){const[r,n]=this.children.find(e);return t.blotName==null&&t(r)||t.blotName!=null&&r instanceof t?[r,n]:r instanceof Ee?r.descendant(t,n):[null,-1]}descendants(t,e=0,r=Number.MAX_VALUE){let n=[],i=r;return this.children.forEachAt(e,r,(l,o,c)=>{(t.blotName==null&&t(l)||t.blotName!=null&&l instanceof t)&&n.push(l),l instanceof Ee&&(n=n.concat(l.descendants(t,o,i))),i-=c}),n}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(r=>e instanceof r)||(e.statics.scope===D.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof Ee?e.unwrap():e.remove())})}formatAt(t,e,r,n){this.children.forEachAt(t,e,(i,l,o)=>{i.formatAt(l,o,r,n)})}insertAt(t,e,r){const[n,i]=this.children.find(t);if(n)n.insertAt(i,e,r);else{const l=r==null?this.scroll.create("text",e):this.scroll.create(e,r);this.appendChild(l)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let r=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(r=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(t.domNode,r),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(r=>{t.insertBefore(r,e)})}optimize(t){if(super.optimize(t),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){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,e=!1){const[r,n]=this.children.find(t,e),i=[[this,t]];return r instanceof Ee?i.concat(r.path(n,e)):(r!=null&&i.push([r,n]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;return r instanceof Ee&&this.moveChildren(r),super.replaceWith(r)}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(t,this.length(),(n,i,l)=>{const o=n.split(i,e);o!=null&&r.appendChild(o)}),r}splitAfter(t){const e=this.clone();for(;t.next!=null;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const r=[],n=[];t.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),n.push(...i.removedNodes))}),n.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const l=this.scroll.find(i);l!=null&&(l.domNode.parentNode==null||l.domNode.parentNode===this.domNode)&&l.detach()}),r.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,l)=>i===l?0:i.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let l=null;i.nextSibling!=null&&(l=this.scroll.find(i.nextSibling));const o=La(i,this.scroll);(o.next!==l||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,l||void 0))}),this.enforceAllowedChildren()}};Ml.uiClass="";let Cd=Ml;const Xt=Cd;function Ld(s,t){if(Object.keys(s).length!==Object.keys(t).length)return!1;for(const e in s)if(s[e]!==t[e])return!1;return!0}const ar=class lr extends Xt{static create(t){return super.create(t)}static formats(t,e){const r=e.query(lr.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(t,e){super(t,e),this.attributes=new Xs(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(r=>{r instanceof lr||(r=r.wrap(lr.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(t,D.INLINE);if(r==null)return;r instanceof oe?this.attributes.attribute(r,e):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e)}}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,r,n){this.formats()[r]!=null||this.scroll.query(r,D.ATTRIBUTE)?this.isolate(t,e).format(r,n):super.formatAt(t,e,r,n)}optimize(t){super.optimize(t);const e=this.formats();if(Object.keys(e).length===0)return this.unwrap();const r=this.next;r instanceof lr&&r.prev===this&&Ld(e,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(t,e){const r=super.replaceWith(t,e);return this.attributes.copy(r),r}update(t,e){super.update(t,e),t.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(t,e){const r=super.wrap(t,e);return r instanceof lr&&this.attributes.move(r),r}};ar.allowedChildren=[ar,Lt],ar.blotName="inline",ar.scope=D.INLINE_BLOT,ar.tagName="SPAN";let Sd=ar;const Bi=Sd,or=class di extends Xt{static create(t){return super.create(t)}static formats(t,e){const r=e.query(di.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(t,e){super(t,e),this.attributes=new Xs(this.domNode)}format(t,e){const r=this.scroll.query(t,D.BLOCK);r!=null&&(r instanceof oe?this.attributes.attribute(r,e):t===this.statics.blotName&&!e?this.replaceWith(di.blotName):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,r,n){this.scroll.query(r,D.BLOCK)!=null?this.format(r,n):super.formatAt(t,e,r,n)}insertAt(t,e,r){if(r==null||this.scroll.query(e,D.INLINE)!=null)super.insertAt(t,e,r);else{const n=this.split(t);if(n!=null){const i=this.scroll.create(e,r);n.parent.insertBefore(i,n)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,e){const r=super.replaceWith(t,e);return this.attributes.copy(r),r}update(t,e){super.update(t,e),t.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};or.blotName="block",or.scope=D.BLOCK_BLOT,or.tagName="P",or.allowedChildren=[Bi,or,Lt];let _d=or;const ts=_d,pi=class extends Xt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,r,n){super.formatAt(t,e,r,n),this.enforceAllowedChildren()}insertAt(t,e,r){super.insertAt(t,e,r),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};pi.blotName="container",pi.scope=D.BLOCK_BLOT;let Od=pi;const Ys=Od;class qd extends Lt{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,r,n){t===0&&e===this.length()?this.format(r,n):super.formatAt(t,e,r,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Rt=qd,Id={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Rd=100,cr=class extends Xt{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,Id),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const r=this.registry.find(t,e);return r?r.scroll===this?r:e?this.find(r.scroll.domNode.parentNode,!0):null:null}query(t,e=D.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),t===0&&e===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(t,e)}formatAt(t,e,r,n){this.update(),super.formatAt(t,e,r,n)}insertAt(t,e,r){this.update(),super.insertAt(t,e,r)}optimize(t=[],e={}){super.optimize(e);const r=e.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)t.push(n.pop());const i=(c,h=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),h&&i(c.parent))},l=c=>{r.has(c.domNode)&&(c instanceof Xt&&c.children.forEach(l),r.delete(c.domNode),c.optimize(e))};let o=t;for(let c=0;o.length>0;c+=1){if(c>=Rd)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(h=>{const m=this.find(h.target,!0);m!=null&&(m.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(y=>{const f=this.find(y,!1);i(f,!1),f instanceof Xt&&f.children.forEach(d=>{i(d,!1)})})):h.type==="attributes"&&i(m.prev)),i(m))}),this.children.forEach(l),o=Array.from(this.observer.takeRecords()),n=o.slice();n.length>0;)t.push(n.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const r=new WeakMap;t.map(n=>{const i=this.find(n.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(n),null):(r.set(i.domNode,[n]),i)}).forEach(n=>{n!=null&&n!==this&&r.has(n.domNode)&&n.update(r.get(n.domNode)||[],e)}),e.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),e),this.optimize(t,e)}};cr.blotName="scroll",cr.defaultChild=ts,cr.allowedChildren=[ts,Ys],cr.scope=D.BLOCK_BLOT,cr.tagName="DIV";let jd=cr;const Pi=jd,gi=class Bl extends Lt{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,r){r==null?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,r)}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 Bl&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(t,e){t.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};gi.blotName="text",gi.scope=D.INLINE_BLOT;let kd=gi;const zs=kd,Md=Object.freeze(Object.defineProperty({__proto__:null,Attributor:oe,AttributorStore:Xs,BlockBlot:ts,ClassAttributor:Qt,ContainerBlot:Ys,EmbedBlot:Rt,InlineBlot:Bi,LeafBlot:Lt,ParentBlot:Xt,Registry:vr,Scope:D,ScrollBlot:Pi,StyleAttributor:qe,TextBlot:zs},Symbol.toStringTag,{value:"Module"}));var _s={exports:{}},Zn,Sa;function Bd(){if(Sa)return Zn;Sa=1;var s=-1,t=1,e=0;function r(g,L,x,I,S){if(g===L)return g?[[e,g]]:[];if(x!=null){var C=pt(g,L,x);if(C)return C}var _=o(g,L),B=g.substring(0,_);g=g.substring(_),L=L.substring(_),_=h(g,L);var $=g.substring(g.length-_);g=g.substring(0,g.length-_),L=L.substring(0,L.length-_);var R=n(g,L);return B&&R.unshift([e,B]),$&&R.push([e,$]),O(R,S),I&&y(R),R}function n(g,L){var x;if(!g)return[[t,L]];if(!L)return[[s,g]];var I=g.length>L.length?g:L,S=g.length>L.length?L:g,C=I.indexOf(S);if(C!==-1)return x=[[t,I.substring(0,C)],[e,S],[t,I.substring(C+S.length)]],g.length>L.length&&(x[0][0]=x[2][0]=s),x;if(S.length===1)return[[s,g],[t,L]];var _=m(g,L);if(_){var B=_[0],$=_[1],R=_[2],K=_[3],G=_[4],Z=r(B,R),Y=r($,K);return Z.concat([[e,G]],Y)}return i(g,L)}function i(g,L){for(var x=g.length,I=L.length,S=Math.ceil((x+I)/2),C=S,_=2*S,B=new Array(_),$=new Array(_),R=0;R<_;R++)B[R]=-1,$[R]=-1;B[C+1]=0,$[C+1]=0;for(var K=x-I,G=K%2!==0,Z=0,Y=0,U=0,ct=0,ut=0;ut<S;ut++){for(var W=-ut+Z;W<=ut-Y;W+=2){var nt=C+W,Q;W===-ut||W!==ut&&B[nt-1]<B[nt+1]?Q=B[nt+1]:Q=B[nt-1]+1;for(var et=Q-W;Q<x&&et<I&&g.charAt(Q)===L.charAt(et);)Q++,et++;if(B[nt]=Q,Q>x)Y+=2;else if(et>I)Z+=2;else if(G){var it=C+K-W;if(it>=0&&it<_&&$[it]!==-1){var rt=x-$[it];if(Q>=rt)return l(g,L,Q,et)}}}for(var mt=-ut+U;mt<=ut-ct;mt+=2){var it=C+mt,rt;mt===-ut||mt!==ut&&$[it-1]<$[it+1]?rt=$[it+1]:rt=$[it-1]+1;for(var yt=rt-mt;rt<x&&yt<I&&g.charAt(x-rt-1)===L.charAt(I-yt-1);)rt++,yt++;if($[it]=rt,rt>x)ct+=2;else if(yt>I)U+=2;else if(!G){var nt=C+K-mt;if(nt>=0&&nt<_&&B[nt]!==-1){var Q=B[nt],et=C+Q-nt;if(rt=x-rt,Q>=rt)return l(g,L,Q,et)}}}}return[[s,g],[t,L]]}function l(g,L,x,I){var S=g.substring(0,x),C=L.substring(0,I),_=g.substring(x),B=L.substring(I),$=r(S,C),R=r(_,B);return $.concat(R)}function o(g,L){if(!g||!L||g.charAt(0)!==L.charAt(0))return 0;for(var x=0,I=Math.min(g.length,L.length),S=I,C=0;x<S;)g.substring(C,S)==L.substring(C,S)?(x=S,C=x):I=S,S=Math.floor((I-x)/2+x);return k(g.charCodeAt(S-1))&&S--,S}function c(g,L){var x=g.length,I=L.length;if(x==0||I==0)return 0;x>I?g=g.substring(x-I):x<I&&(L=L.substring(0,x));var S=Math.min(x,I);if(g==L)return S;for(var C=0,_=1;;){var B=g.substring(S-_),$=L.indexOf(B);if($==-1)return C;_+=$,($==0||g.substring(S-_)==L.substring(0,_))&&(C=_,_++)}}function h(g,L){if(!g||!L||g.slice(-1)!==L.slice(-1))return 0;for(var x=0,I=Math.min(g.length,L.length),S=I,C=0;x<S;)g.substring(g.length-S,g.length-C)==L.substring(L.length-S,L.length-C)?(x=S,C=x):I=S,S=Math.floor((I-x)/2+x);return z(g.charCodeAt(g.length-S))&&S--,S}function m(g,L){var x=g.length>L.length?g:L,I=g.length>L.length?L:g;if(x.length<4||I.length*2<x.length)return null;function S(Y,U,ct){for(var ut=Y.substring(ct,ct+Math.floor(Y.length/4)),W=-1,nt="",Q,et,it,rt;(W=U.indexOf(ut,W+1))!==-1;){var mt=o(Y.substring(ct),U.substring(W)),yt=h(Y.substring(0,ct),U.substring(0,W));nt.length<yt+mt&&(nt=U.substring(W-yt,W)+U.substring(W,W+mt),Q=Y.substring(0,ct-yt),et=Y.substring(ct+mt),it=U.substring(0,W-yt),rt=U.substring(W+mt))}return nt.length*2>=Y.length?[Q,et,it,rt,nt]:null}var C=S(x,I,Math.ceil(x.length/4)),_=S(x,I,Math.ceil(x.length/2)),B;if(!C&&!_)return null;_?C?B=C[4].length>_[4].length?C:_:B=_:B=C;var $,R,K,G;g.length>L.length?($=B[0],R=B[1],K=B[2],G=B[3]):(K=B[0],G=B[1],$=B[2],R=B[3]);var Z=B[4];return[$,R,K,G,Z]}function y(g){for(var L=!1,x=[],I=0,S=null,C=0,_=0,B=0,$=0,R=0;C<g.length;)g[C][0]==e?(x[I++]=C,_=$,B=R,$=0,R=0,S=g[C][1]):(g[C][0]==t?$+=g[C][1].length:R+=g[C][1].length,S&&S.length<=Math.max(_,B)&&S.length<=Math.max($,R)&&(g.splice(x[I-1],0,[s,S]),g[x[I-1]+1][0]=t,I--,I--,C=I>0?x[I-1]:-1,_=0,B=0,$=0,R=0,S=null,L=!0)),C++;for(L&&O(g),T(g),C=1;C<g.length;){if(g[C-1][0]==s&&g[C][0]==t){var K=g[C-1][1],G=g[C][1],Z=c(K,G),Y=c(G,K);Z>=Y?(Z>=K.length/2||Z>=G.length/2)&&(g.splice(C,0,[e,G.substring(0,Z)]),g[C-1][1]=K.substring(0,K.length-Z),g[C+1][1]=G.substring(Z),C++):(Y>=K.length/2||Y>=G.length/2)&&(g.splice(C,0,[e,K.substring(0,Y)]),g[C-1][0]=t,g[C-1][1]=G.substring(0,G.length-Y),g[C+1][0]=s,g[C+1][1]=K.substring(Y),C++),C++}C++}}var f=/[^a-zA-Z0-9]/,d=/\s/,v=/[\r\n]/,w=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(g){function L(Y,U){if(!Y||!U)return 6;var ct=Y.charAt(Y.length-1),ut=U.charAt(0),W=ct.match(f),nt=ut.match(f),Q=W&&ct.match(d),et=nt&&ut.match(d),it=Q&&ct.match(v),rt=et&&ut.match(v),mt=it&&Y.match(w),yt=rt&&U.match(N);return mt||yt?5:it||rt?4:W&&!Q&&et?3:Q||et?2:W||nt?1:0}for(var x=1;x<g.length-1;){if(g[x-1][0]==e&&g[x+1][0]==e){var I=g[x-1][1],S=g[x][1],C=g[x+1][1],_=h(I,S);if(_){var B=S.substring(S.length-_);I=I.substring(0,I.length-_),S=B+S.substring(0,S.length-_),C=B+C}for(var $=I,R=S,K=C,G=L(I,S)+L(S,C);S.charAt(0)===C.charAt(0);){I+=S.charAt(0),S=S.substring(1)+C.charAt(0),C=C.substring(1);var Z=L(I,S)+L(S,C);Z>=G&&(G=Z,$=I,R=S,K=C)}g[x-1][1]!=$&&($?g[x-1][1]=$:(g.splice(x-1,1),x--),g[x][1]=R,K?g[x+1][1]=K:(g.splice(x+1,1),x--))}x++}}function O(g,L){g.push([e,""]);for(var x=0,I=0,S=0,C="",_="",B;x<g.length;){if(x<g.length-1&&!g[x][1]){g.splice(x,1);continue}switch(g[x][0]){case t:S++,_+=g[x][1],x++;break;case s:I++,C+=g[x][1],x++;break;case e:var $=x-S-I-1;if(L){if($>=0&&V(g[$][1])){var R=g[$][1].slice(-1);if(g[$][1]=g[$][1].slice(0,-1),C=R+C,_=R+_,!g[$][1]){g.splice($,1),x--;var K=$-1;g[K]&&g[K][0]===t&&(S++,_=g[K][1]+_,K--),g[K]&&g[K][0]===s&&(I++,C=g[K][1]+C,K--),$=K}}if(j(g[x][1])){var R=g[x][1].charAt(0);g[x][1]=g[x][1].slice(1),C+=R,_+=R}}if(x<g.length-1&&!g[x][1]){g.splice(x,1);break}if(C.length>0||_.length>0){C.length>0&&_.length>0&&(B=o(_,C),B!==0&&($>=0?g[$][1]+=_.substring(0,B):(g.splice(0,0,[e,_.substring(0,B)]),x++),_=_.substring(B),C=C.substring(B)),B=h(_,C),B!==0&&(g[x][1]=_.substring(_.length-B)+g[x][1],_=_.substring(0,_.length-B),C=C.substring(0,C.length-B)));var G=S+I;C.length===0&&_.length===0?(g.splice(x-G,G),x=x-G):C.length===0?(g.splice(x-G,G,[t,_]),x=x-G+1):_.length===0?(g.splice(x-G,G,[s,C]),x=x-G+1):(g.splice(x-G,G,[s,C],[t,_]),x=x-G+2)}x!==0&&g[x-1][0]===e?(g[x-1][1]+=g[x][1],g.splice(x,1)):x++,S=0,I=0,C="",_="";break}}g[g.length-1][1]===""&&g.pop();var Z=!1;for(x=1;x<g.length-1;)g[x-1][0]===e&&g[x+1][0]===e&&(g[x][1].substring(g[x][1].length-g[x-1][1].length)===g[x-1][1]?(g[x][1]=g[x-1][1]+g[x][1].substring(0,g[x][1].length-g[x-1][1].length),g[x+1][1]=g[x-1][1]+g[x+1][1],g.splice(x-1,1),Z=!0):g[x][1].substring(0,g[x+1][1].length)==g[x+1][1]&&(g[x-1][1]+=g[x+1][1],g[x][1]=g[x][1].substring(g[x+1][1].length)+g[x+1][1],g.splice(x+1,1),Z=!0)),x++;Z&&O(g,L)}function k(g){return g>=55296&&g<=56319}function z(g){return g>=56320&&g<=57343}function j(g){return z(g.charCodeAt(0))}function V(g){return k(g.charCodeAt(g.length-1))}function tt(g){for(var L=[],x=0;x<g.length;x++)g[x][1].length>0&&L.push(g[x]);return L}function J(g,L,x,I){return V(g)||j(I)?null:tt([[e,g],[s,L],[t,x],[e,I]])}function pt(g,L,x){var I=typeof x=="number"?{index:x,length:0}:x.oldRange,S=typeof x=="number"?null:x.newRange,C=g.length,_=L.length;if(I.length===0&&(S===null||S.length===0)){var B=I.index,$=g.slice(0,B),R=g.slice(B),K=S?S.index:null;t:{var G=B+_-C;if(K!==null&&K!==G||G<0||G>_)break t;var Z=L.slice(0,G),Y=L.slice(G);if(Y!==R)break t;var U=Math.min(B,G),ct=$.slice(0,U),ut=Z.slice(0,U);if(ct!==ut)break t;var W=$.slice(U),nt=Z.slice(U);return J(ct,W,nt,R)}t:{if(K!==null&&K!==B)break t;var Q=B,Z=L.slice(0,Q),Y=L.slice(Q);if(Z!==$)break t;var et=Math.min(C-Q,_-Q),it=R.slice(R.length-et),rt=Y.slice(Y.length-et);if(it!==rt)break t;var W=R.slice(0,R.length-et),nt=Y.slice(0,Y.length-et);return J($,W,nt,it)}}if(I.length>0&&S&&S.length===0)t:{var ct=g.slice(0,I.index),it=g.slice(I.index+I.length),U=ct.length,et=it.length;if(_<U+et)break t;var ut=L.slice(0,U),rt=L.slice(_-et);if(ct!==ut||it!==rt)break t;var W=g.slice(U,C-et),nt=L.slice(U,_-et);return J(ct,W,nt,it)}return null}function gt(g,L,x,I){return r(g,L,x,I,!0)}return gt.INSERT=t,gt.DELETE=s,gt.EQUAL=e,Zn=gt,Zn}var zr={exports:{}};zr.exports;var _a;function Pl(){return _a||(_a=1,(function(s,t){var e=200,r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",l="[object Array]",o="[object Boolean]",c="[object Date]",h="[object Error]",m="[object Function]",y="[object GeneratorFunction]",f="[object Map]",d="[object Number]",v="[object Object]",w="[object Promise]",N="[object RegExp]",T="[object Set]",O="[object String]",k="[object Symbol]",z="[object WeakMap]",j="[object ArrayBuffer]",V="[object DataView]",tt="[object Float32Array]",J="[object Float64Array]",pt="[object Int8Array]",gt="[object Int16Array]",g="[object Int32Array]",L="[object Uint8Array]",x="[object Uint8ClampedArray]",I="[object Uint16Array]",S="[object Uint32Array]",C=/[\\^$.*+?()[\]{}|]/g,_=/\w*$/,B=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,R={};R[i]=R[l]=R[j]=R[V]=R[o]=R[c]=R[tt]=R[J]=R[pt]=R[gt]=R[g]=R[f]=R[d]=R[v]=R[N]=R[T]=R[O]=R[k]=R[L]=R[x]=R[I]=R[S]=!0,R[h]=R[m]=R[z]=!1;var K=typeof Te=="object"&&Te&&Te.Object===Object&&Te,G=typeof self=="object"&&self&&self.Object===Object&&self,Z=K||G||Function("return this")(),Y=t&&!t.nodeType&&t,U=Y&&!0&&s&&!s.nodeType&&s,ct=U&&U.exports===Y;function ut(a,u){return a.set(u[0],u[1]),a}function W(a,u){return a.add(u),a}function nt(a,u){for(var p=-1,A=a?a.length:0;++p<A&&u(a[p],p,a)!==!1;);return a}function Q(a,u){for(var p=-1,A=u.length,X=a.length;++p<A;)a[X+p]=u[p];return a}function et(a,u,p,A){for(var X=-1,F=a?a.length:0;++X<F;)p=u(p,a[X],X,a);return p}function it(a,u){for(var p=-1,A=Array(a);++p<a;)A[p]=u(p);return A}function rt(a,u){return a==null?void 0:a[u]}function mt(a){var u=!1;if(a!=null&&typeof a.toString!="function")try{u=!!(a+"")}catch{}return u}function yt(a){var u=-1,p=Array(a.size);return a.forEach(function(A,X){p[++u]=[X,A]}),p}function we(a,u){return function(p){return a(u(p))}}function cs(a){var u=-1,p=Array(a.size);return a.forEach(function(A){p[++u]=A}),p}var en=Array.prototype,rn=Function.prototype,We=Object.prototype,Cr=Z["__core-js_shared__"],us=(function(){var a=/[^.]+$/.exec(Cr&&Cr.keys&&Cr.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),hs=rn.toString,ee=We.hasOwnProperty,Xe=We.toString,sn=RegExp("^"+hs.call(ee).replace(C,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=ct?Z.Buffer:void 0,Ye=Z.Symbol,Lr=Z.Uint8Array,jt=we(Object.getPrototypeOf,Object),fs=Object.create,ds=We.propertyIsEnumerable,nn=en.splice,Sr=Object.getOwnPropertySymbols,Qe=Ie?Ie.isBuffer:void 0,ps=we(Object.keys,Object),Je=zt(Z,"DataView"),Re=zt(Z,"Map"),Ht=zt(Z,"Promise"),tr=zt(Z,"Set"),_r=zt(Z,"WeakMap"),je=zt(Object,"create"),Or=_t(Je),ke=_t(Re),qr=_t(Ht),Ir=_t(tr),Rr=_t(_r),Ne=Ye?Ye.prototype:void 0,gs=Ne?Ne.valueOf:void 0;function he(a){var u=-1,p=a?a.length:0;for(this.clear();++u<p;){var A=a[u];this.set(A[0],A[1])}}function an(){this.__data__=je?je(null):{}}function ln(a){return this.has(a)&&delete this.__data__[a]}function on(a){var u=this.__data__;if(je){var p=u[a];return p===r?void 0:p}return ee.call(u,a)?u[a]:void 0}function ms(a){var u=this.__data__;return je?u[a]!==void 0:ee.call(u,a)}function jr(a,u){var p=this.__data__;return p[a]=je&&u===void 0?r:u,this}he.prototype.clear=an,he.prototype.delete=ln,he.prototype.get=on,he.prototype.has=ms,he.prototype.set=jr;function wt(a){var u=-1,p=a?a.length:0;for(this.clear();++u<p;){var A=a[u];this.set(A[0],A[1])}}function cn(){this.__data__=[]}function un(a){var u=this.__data__,p=rr(u,a);if(p<0)return!1;var A=u.length-1;return p==A?u.pop():nn.call(u,p,1),!0}function hn(a){var u=this.__data__,p=rr(u,a);return p<0?void 0:u[p][1]}function fn(a){return rr(this.__data__,a)>-1}function dn(a,u){var p=this.__data__,A=rr(p,a);return A<0?p.push([a,u]):p[A][1]=u,this}wt.prototype.clear=cn,wt.prototype.delete=un,wt.prototype.get=hn,wt.prototype.has=fn,wt.prototype.set=dn;function Et(a){var u=-1,p=a?a.length:0;for(this.clear();++u<p;){var A=a[u];this.set(A[0],A[1])}}function pn(){this.__data__={hash:new he,map:new(Re||wt),string:new he}}function gn(a){return Be(this,a).delete(a)}function mn(a){return Be(this,a).get(a)}function bn(a){return Be(this,a).has(a)}function yn(a,u){return Be(this,a).set(a,u),this}Et.prototype.clear=pn,Et.prototype.delete=gn,Et.prototype.get=mn,Et.prototype.has=bn,Et.prototype.set=yn;function Ot(a){this.__data__=new wt(a)}function vn(){this.__data__=new wt}function xn(a){return this.__data__.delete(a)}function wn(a){return this.__data__.get(a)}function Nn(a){return this.__data__.has(a)}function An(a,u){var p=this.__data__;if(p instanceof wt){var A=p.__data__;if(!Re||A.length<e-1)return A.push([a,u]),this;p=this.__data__=new Et(A)}return p.set(a,u),this}Ot.prototype.clear=vn,Ot.prototype.delete=xn,Ot.prototype.get=wn,Ot.prototype.has=Nn,Ot.prototype.set=An;function er(a,u){var p=Pr(a)||nr(a)?it(a.length,String):[],A=p.length,X=!!A;for(var F in a)ee.call(a,F)&&!(X&&(F=="length"||Bn(F,A)))&&p.push(F);return p}function bs(a,u,p){var A=a[u];(!(ee.call(a,u)&&Ns(A,p))||p===void 0&&!(u in a))&&(a[u]=p)}function rr(a,u){for(var p=a.length;p--;)if(Ns(a[p][0],u))return p;return-1}function re(a,u){return a&&Br(u,$r(u),a)}function kr(a,u,p,A,X,F,at){var st;if(A&&(st=F?A(a,X,F,at):A(a)),st!==void 0)return st;if(!ne(a))return a;var bt=Pr(a);if(bt){if(st=kn(a),!u)return In(a,st)}else{var ot=de(a),Tt=ot==m||ot==y;if(As(a))return sr(a,u);if(ot==v||ot==i||Tt&&!F){if(mt(a))return F?a:{};if(st=se(Tt?{}:a),!u)return Rn(a,re(st,a))}else{if(!R[ot])return F?a:{};st=Mn(a,ot,kr,u)}}at||(at=new Ot);var qt=at.get(a);if(qt)return qt;if(at.set(a,st),!bt)var vt=p?jn(a):$r(a);return nt(vt||a,function(Ct,Nt){vt&&(Nt=Ct,Ct=a[Nt]),bs(st,Nt,kr(Ct,u,p,A,Nt,a,at))}),st}function En(a){return ne(a)?fs(a):{}}function Tn(a,u,p){var A=u(a);return Pr(a)?A:Q(A,p(a))}function Cn(a){return Xe.call(a)}function Ln(a){if(!ne(a)||Dn(a))return!1;var u=Dr(a)||mt(a)?sn:B;return u.test(_t(a))}function Sn(a){if(!xs(a))return ps(a);var u=[];for(var p in Object(a))ee.call(a,p)&&p!="constructor"&&u.push(p);return u}function sr(a,u){if(u)return a.slice();var p=new a.constructor(a.length);return a.copy(p),p}function Mr(a){var u=new a.constructor(a.byteLength);return new Lr(u).set(new Lr(a)),u}function Me(a,u){var p=u?Mr(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function ys(a,u,p){var A=u?p(yt(a),!0):yt(a);return et(A,ut,new a.constructor)}function vs(a){var u=new a.constructor(a.source,_.exec(a));return u.lastIndex=a.lastIndex,u}function _n(a,u,p){var A=u?p(cs(a),!0):cs(a);return et(A,W,new a.constructor)}function On(a){return gs?Object(gs.call(a)):{}}function qn(a,u){var p=u?Mr(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function In(a,u){var p=-1,A=a.length;for(u||(u=Array(A));++p<A;)u[p]=a[p];return u}function Br(a,u,p,A){p||(p={});for(var X=-1,F=u.length;++X<F;){var at=u[X],st=void 0;bs(p,at,st===void 0?a[at]:st)}return p}function Rn(a,u){return Br(a,fe(a),u)}function jn(a){return Tn(a,$r,fe)}function Be(a,u){var p=a.__data__;return Pn(u)?p[typeof u=="string"?"string":"hash"]:p.map}function zt(a,u){var p=rt(a,u);return Ln(p)?p:void 0}var fe=Sr?we(Sr,Object):Un,de=Cn;(Je&&de(new Je(new ArrayBuffer(1)))!=V||Re&&de(new Re)!=f||Ht&&de(Ht.resolve())!=w||tr&&de(new tr)!=T||_r&&de(new _r)!=z)&&(de=function(a){var u=Xe.call(a),p=u==v?a.constructor:void 0,A=p?_t(p):void 0;if(A)switch(A){case Or:return V;case ke:return f;case qr:return w;case Ir:return T;case Rr:return z}return u});function kn(a){var u=a.length,p=a.constructor(u);return u&&typeof a[0]=="string"&&ee.call(a,"index")&&(p.index=a.index,p.input=a.input),p}function se(a){return typeof a.constructor=="function"&&!xs(a)?En(jt(a)):{}}function Mn(a,u,p,A){var X=a.constructor;switch(u){case j:return Mr(a);case o:case c:return new X(+a);case V:return Me(a,A);case tt:case J:case pt:case gt:case g:case L:case x:case I:case S:return qn(a,A);case f:return ys(a,A,p);case d:case O:return new X(a);case N:return vs(a);case T:return _n(a,A,p);case k:return On(a)}}function Bn(a,u){return u=u??n,!!u&&(typeof a=="number"||$.test(a))&&a>-1&&a%1==0&&a<u}function Pn(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Dn(a){return!!us&&us in a}function xs(a){var u=a&&a.constructor,p=typeof u=="function"&&u.prototype||We;return a===p}function _t(a){if(a!=null){try{return hs.call(a)}catch{}try{return a+""}catch{}}return""}function ws(a){return kr(a,!0,!0)}function Ns(a,u){return a===u||a!==a&&u!==u}function nr(a){return $n(a)&&ee.call(a,"callee")&&(!ds.call(a,"callee")||Xe.call(a)==i)}var Pr=Array.isArray;function ir(a){return a!=null&&Es(a.length)&&!Dr(a)}function $n(a){return Ts(a)&&ir(a)}var As=Qe||Fn;function Dr(a){var u=ne(a)?Xe.call(a):"";return u==m||u==y}function Es(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=n}function ne(a){var u=typeof a;return!!a&&(u=="object"||u=="function")}function Ts(a){return!!a&&typeof a=="object"}function $r(a){return ir(a)?er(a):Sn(a)}function Un(){return[]}function Fn(){return!1}s.exports=ws})(zr,zr.exports)),zr.exports}var Gr={exports:{}};Gr.exports;var Oa;function Dl(){return Oa||(Oa=1,(function(s,t){var e=200,r="__lodash_hash_undefined__",n=1,i=2,l=9007199254740991,o="[object Arguments]",c="[object Array]",h="[object AsyncFunction]",m="[object Boolean]",y="[object Date]",f="[object Error]",d="[object Function]",v="[object GeneratorFunction]",w="[object Map]",N="[object Number]",T="[object Null]",O="[object Object]",k="[object Promise]",z="[object Proxy]",j="[object RegExp]",V="[object Set]",tt="[object String]",J="[object Symbol]",pt="[object Undefined]",gt="[object WeakMap]",g="[object ArrayBuffer]",L="[object DataView]",x="[object Float32Array]",I="[object Float64Array]",S="[object Int8Array]",C="[object Int16Array]",_="[object Int32Array]",B="[object Uint8Array]",$="[object Uint8ClampedArray]",R="[object Uint16Array]",K="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,U={};U[x]=U[I]=U[S]=U[C]=U[_]=U[B]=U[$]=U[R]=U[K]=!0,U[o]=U[c]=U[g]=U[m]=U[L]=U[y]=U[f]=U[d]=U[w]=U[N]=U[O]=U[j]=U[V]=U[tt]=U[gt]=!1;var ct=typeof Te=="object"&&Te&&Te.Object===Object&&Te,ut=typeof self=="object"&&self&&self.Object===Object&&self,W=ct||ut||Function("return this")(),nt=t&&!t.nodeType&&t,Q=nt&&!0&&s&&!s.nodeType&&s,et=Q&&Q.exports===nt,it=et&&ct.process,rt=(function(){try{return it&&it.binding&&it.binding("util")}catch{}})(),mt=rt&&rt.isTypedArray;function yt(a,u){for(var p=-1,A=a==null?0:a.length,X=0,F=[];++p<A;){var at=a[p];u(at,p,a)&&(F[X++]=at)}return F}function we(a,u){for(var p=-1,A=u.length,X=a.length;++p<A;)a[X+p]=u[p];return a}function cs(a,u){for(var p=-1,A=a==null?0:a.length;++p<A;)if(u(a[p],p,a))return!0;return!1}function en(a,u){for(var p=-1,A=Array(a);++p<a;)A[p]=u(p);return A}function rn(a){return function(u){return a(u)}}function We(a,u){return a.has(u)}function Cr(a,u){return a==null?void 0:a[u]}function us(a){var u=-1,p=Array(a.size);return a.forEach(function(A,X){p[++u]=[X,A]}),p}function hs(a,u){return function(p){return a(u(p))}}function ee(a){var u=-1,p=Array(a.size);return a.forEach(function(A){p[++u]=A}),p}var Xe=Array.prototype,sn=Function.prototype,Ie=Object.prototype,Ye=W["__core-js_shared__"],Lr=sn.toString,jt=Ie.hasOwnProperty,fs=(function(){var a=/[^.]+$/.exec(Ye&&Ye.keys&&Ye.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),ds=Ie.toString,nn=RegExp("^"+Lr.call(jt).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sr=et?W.Buffer:void 0,Qe=W.Symbol,ps=W.Uint8Array,Je=Ie.propertyIsEnumerable,Re=Xe.splice,Ht=Qe?Qe.toStringTag:void 0,tr=Object.getOwnPropertySymbols,_r=Sr?Sr.isBuffer:void 0,je=hs(Object.keys,Object),Or=fe(W,"DataView"),ke=fe(W,"Map"),qr=fe(W,"Promise"),Ir=fe(W,"Set"),Rr=fe(W,"WeakMap"),Ne=fe(Object,"create"),gs=_t(Or),he=_t(ke),an=_t(qr),ln=_t(Ir),on=_t(Rr),ms=Qe?Qe.prototype:void 0,jr=ms?ms.valueOf:void 0;function wt(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u<p;){var A=a[u];this.set(A[0],A[1])}}function cn(){this.__data__=Ne?Ne(null):{},this.size=0}function un(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function hn(a){var u=this.__data__;if(Ne){var p=u[a];return p===r?void 0:p}return jt.call(u,a)?u[a]:void 0}function fn(a){var u=this.__data__;return Ne?u[a]!==void 0:jt.call(u,a)}function dn(a,u){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=Ne&&u===void 0?r:u,this}wt.prototype.clear=cn,wt.prototype.delete=un,wt.prototype.get=hn,wt.prototype.has=fn,wt.prototype.set=dn;function Et(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u<p;){var A=a[u];this.set(A[0],A[1])}}function pn(){this.__data__=[],this.size=0}function gn(a){var u=this.__data__,p=sr(u,a);if(p<0)return!1;var A=u.length-1;return p==A?u.pop():Re.call(u,p,1),--this.size,!0}function mn(a){var u=this.__data__,p=sr(u,a);return p<0?void 0:u[p][1]}function bn(a){return sr(this.__data__,a)>-1}function yn(a,u){var p=this.__data__,A=sr(p,a);return A<0?(++this.size,p.push([a,u])):p[A][1]=u,this}Et.prototype.clear=pn,Et.prototype.delete=gn,Et.prototype.get=mn,Et.prototype.has=bn,Et.prototype.set=yn;function Ot(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u<p;){var A=a[u];this.set(A[0],A[1])}}function vn(){this.size=0,this.__data__={hash:new wt,map:new(ke||Et),string:new wt}}function xn(a){var u=zt(this,a).delete(a);return this.size-=u?1:0,u}function wn(a){return zt(this,a).get(a)}function Nn(a){return zt(this,a).has(a)}function An(a,u){var p=zt(this,a),A=p.size;return p.set(a,u),this.size+=p.size==A?0:1,this}Ot.prototype.clear=vn,Ot.prototype.delete=xn,Ot.prototype.get=wn,Ot.prototype.has=Nn,Ot.prototype.set=An;function er(a){var u=-1,p=a==null?0:a.length;for(this.__data__=new Ot;++u<p;)this.add(a[u])}function bs(a){return this.__data__.set(a,r),this}function rr(a){return this.__data__.has(a)}er.prototype.add=er.prototype.push=bs,er.prototype.has=rr;function re(a){var u=this.__data__=new Et(a);this.size=u.size}function kr(){this.__data__=new Et,this.size=0}function En(a){var u=this.__data__,p=u.delete(a);return this.size=u.size,p}function Tn(a){return this.__data__.get(a)}function Cn(a){return this.__data__.has(a)}function Ln(a,u){var p=this.__data__;if(p instanceof Et){var A=p.__data__;if(!ke||A.length<e-1)return A.push([a,u]),this.size=++p.size,this;p=this.__data__=new Ot(A)}return p.set(a,u),this.size=p.size,this}re.prototype.clear=kr,re.prototype.delete=En,re.prototype.get=Tn,re.prototype.has=Cn,re.prototype.set=Ln;function Sn(a,u){var p=nr(a),A=!p&&Ns(a),X=!p&&!A&&ir(a),F=!p&&!A&&!X&&Ts(a),at=p||A||X||F,st=at?en(a.length,String):[],bt=st.length;for(var ot in a)jt.call(a,ot)&&!(at&&(ot=="length"||X&&(ot=="offset"||ot=="parent")||F&&(ot=="buffer"||ot=="byteLength"||ot=="byteOffset")||Mn(ot,bt)))&&st.push(ot);return st}function sr(a,u){for(var p=a.length;p--;)if(ws(a[p][0],u))return p;return-1}function Mr(a,u,p){var A=u(a);return nr(a)?A:we(A,p(a))}function Me(a){return a==null?a===void 0?pt:T:Ht&&Ht in Object(a)?de(a):xs(a)}function ys(a){return ne(a)&&Me(a)==o}function vs(a,u,p,A,X){return a===u?!0:a==null||u==null||!ne(a)&&!ne(u)?a!==a&&u!==u:_n(a,u,p,A,vs,X)}function _n(a,u,p,A,X,F){var at=nr(a),st=nr(u),bt=at?c:se(a),ot=st?c:se(u);bt=bt==o?O:bt,ot=ot==o?O:ot;var Tt=bt==O,qt=ot==O,vt=bt==ot;if(vt&&ir(a)){if(!ir(u))return!1;at=!0,Tt=!1}if(vt&&!Tt)return F||(F=new re),at||Ts(a)?Br(a,u,p,A,X,F):Rn(a,u,bt,p,A,X,F);if(!(p&n)){var Ct=Tt&&jt.call(a,"__wrapped__"),Nt=qt&&jt.call(u,"__wrapped__");if(Ct||Nt){var Ae=Ct?a.value():a,pe=Nt?u.value():u;return F||(F=new re),X(Ae,pe,p,A,F)}}return vt?(F||(F=new re),jn(a,u,p,A,X,F)):!1}function On(a){if(!Es(a)||Pn(a))return!1;var u=As(a)?nn:Z;return u.test(_t(a))}function qn(a){return ne(a)&&Dr(a.length)&&!!U[Me(a)]}function In(a){if(!Dn(a))return je(a);var u=[];for(var p in Object(a))jt.call(a,p)&&p!="constructor"&&u.push(p);return u}function Br(a,u,p,A,X,F){var at=p&n,st=a.length,bt=u.length;if(st!=bt&&!(at&&bt>st))return!1;var ot=F.get(a);if(ot&&F.get(u))return ot==u;var Tt=-1,qt=!0,vt=p&i?new er:void 0;for(F.set(a,u),F.set(u,a);++Tt<st;){var Ct=a[Tt],Nt=u[Tt];if(A)var Ae=at?A(Nt,Ct,Tt,u,a,F):A(Ct,Nt,Tt,a,u,F);if(Ae!==void 0){if(Ae)continue;qt=!1;break}if(vt){if(!cs(u,function(pe,Pe){if(!We(vt,Pe)&&(Ct===pe||X(Ct,pe,p,A,F)))return vt.push(Pe)})){qt=!1;break}}else if(!(Ct===Nt||X(Ct,Nt,p,A,F))){qt=!1;break}}return F.delete(a),F.delete(u),qt}function Rn(a,u,p,A,X,F,at){switch(p){case L:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case g:return!(a.byteLength!=u.byteLength||!F(new ps(a),new ps(u)));case m:case y:case N:return ws(+a,+u);case f:return a.name==u.name&&a.message==u.message;case j:case tt:return a==u+"";case w:var st=us;case V:var bt=A&n;if(st||(st=ee),a.size!=u.size&&!bt)return!1;var ot=at.get(a);if(ot)return ot==u;A|=i,at.set(a,u);var Tt=Br(st(a),st(u),A,X,F,at);return at.delete(a),Tt;case J:if(jr)return jr.call(a)==jr.call(u)}return!1}function jn(a,u,p,A,X,F){var at=p&n,st=Be(a),bt=st.length,ot=Be(u),Tt=ot.length;if(bt!=Tt&&!at)return!1;for(var qt=bt;qt--;){var vt=st[qt];if(!(at?vt in u:jt.call(u,vt)))return!1}var Ct=F.get(a);if(Ct&&F.get(u))return Ct==u;var Nt=!0;F.set(a,u),F.set(u,a);for(var Ae=at;++qt<bt;){vt=st[qt];var pe=a[vt],Pe=u[vt];if(A)var Wi=at?A(Pe,pe,vt,u,a,F):A(pe,Pe,vt,a,u,F);if(!(Wi===void 0?pe===Pe||X(pe,Pe,p,A,F):Wi)){Nt=!1;break}Ae||(Ae=vt=="constructor")}if(Nt&&!Ae){var Cs=a.constructor,Ls=u.constructor;Cs!=Ls&&"constructor"in a&&"constructor"in u&&!(typeof Cs=="function"&&Cs instanceof Cs&&typeof Ls=="function"&&Ls instanceof Ls)&&(Nt=!1)}return F.delete(a),F.delete(u),Nt}function Be(a){return Mr(a,$r,kn)}function zt(a,u){var p=a.__data__;return Bn(u)?p[typeof u=="string"?"string":"hash"]:p.map}function fe(a,u){var p=Cr(a,u);return On(p)?p:void 0}function de(a){var u=jt.call(a,Ht),p=a[Ht];try{a[Ht]=void 0;var A=!0}catch{}var X=ds.call(a);return A&&(u?a[Ht]=p:delete a[Ht]),X}var kn=tr?function(a){return a==null?[]:(a=Object(a),yt(tr(a),function(u){return Je.call(a,u)}))}:Un,se=Me;(Or&&se(new Or(new ArrayBuffer(1)))!=L||ke&&se(new ke)!=w||qr&&se(qr.resolve())!=k||Ir&&se(new Ir)!=V||Rr&&se(new Rr)!=gt)&&(se=function(a){var u=Me(a),p=u==O?a.constructor:void 0,A=p?_t(p):"";if(A)switch(A){case gs:return L;case he:return w;case an:return k;case ln:return V;case on:return gt}return u});function Mn(a,u){return u=u??l,!!u&&(typeof a=="number"||Y.test(a))&&a>-1&&a%1==0&&a<u}function Bn(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Pn(a){return!!fs&&fs in a}function Dn(a){var u=a&&a.constructor,p=typeof u=="function"&&u.prototype||Ie;return a===p}function xs(a){return ds.call(a)}function _t(a){if(a!=null){try{return Lr.call(a)}catch{}try{return a+""}catch{}}return""}function ws(a,u){return a===u||a!==a&&u!==u}var Ns=ys((function(){return arguments})())?ys:function(a){return ne(a)&&jt.call(a,"callee")&&!Je.call(a,"callee")},nr=Array.isArray;function Pr(a){return a!=null&&Dr(a.length)&&!As(a)}var ir=_r||Fn;function $n(a,u){return vs(a,u)}function As(a){if(!Es(a))return!1;var u=Me(a);return u==d||u==v||u==h||u==z}function Dr(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=l}function Es(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function ne(a){return a!=null&&typeof a=="object"}var Ts=mt?rn(mt):qn;function $r(a){return Pr(a)?Sn(a):In(a)}function Un(){return[]}function Fn(){return!1}s.exports=$n})(Gr,Gr.exports)),Gr.exports}var Os={},qa;function Pd(){if(qa)return Os;qa=1,Object.defineProperty(Os,"__esModule",{value:!0});const s=Pl(),t=Dl();var e;return(function(r){function n(c={},h={},m=!1){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});let y=s(h);m||(y=Object.keys(y).reduce((f,d)=>(y[d]!=null&&(f[d]=y[d]),f),{}));for(const f in c)c[f]!==void 0&&h[f]===void 0&&(y[f]=c[f]);return Object.keys(y).length>0?y:void 0}r.compose=n;function i(c={},h={}){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});const m=Object.keys(c).concat(Object.keys(h)).reduce((y,f)=>(t(c[f],h[f])||(y[f]=h[f]===void 0?null:h[f]),y),{});return Object.keys(m).length>0?m:void 0}r.diff=i;function l(c={},h={}){c=c||{};const m=Object.keys(h).reduce((y,f)=>(h[f]!==c[f]&&c[f]!==void 0&&(y[f]=h[f]),y),{});return Object.keys(c).reduce((y,f)=>(c[f]!==h[f]&&h[f]===void 0&&(y[f]=null),y),m)}r.invert=l;function o(c,h,m=!1){if(typeof c!="object")return h;if(typeof h!="object")return;if(!m)return h;const y=Object.keys(h).reduce((f,d)=>(c[d]===void 0&&(f[d]=h[d]),f),{});return Object.keys(y).length>0?y:void 0}r.transform=o})(e||(e={})),Os.default=e,Os}var qs={},Ia;function $l(){if(Ia)return qs;Ia=1,Object.defineProperty(qs,"__esModule",{value:!0});var s;return(function(t){function e(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}t.length=e})(s||(s={})),qs.default=s,qs}var Is={},Ra;function Dd(){if(Ra)return Is;Ra=1,Object.defineProperty(Is,"__esModule",{value:!0});const s=$l();class t{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const n=this.ops[this.index];if(n){const i=this.offset,l=s.default.length(n);if(r>=l-i?(r=l-i,this.index+=1,this.offset=0):this.offset+=r,typeof n.delete=="number")return{delete:r};{const o={};return n.attributes&&(o.attributes=n.attributes),typeof n.retain=="number"?o.retain=r:typeof n.retain=="object"&&n.retain!==null?o.retain=n.retain:typeof n.insert=="string"?o.insert=n.insert.substr(i,r):o.insert=n.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?s.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,n=this.index,i=this.next(),l=this.ops.slice(this.index);return this.offset=r,this.index=n,[i].concat(l)}}else return[]}}return Is.default=t,Is}var ja;function $d(){return ja||(ja=1,(function(s,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=Bd(),r=Pl(),n=Dl(),i=Pd();t.AttributeMap=i.default;const l=$l();t.Op=l.default;const o=Dd();t.OpIterator=o.default;const c="\0",h=(y,f)=>{if(typeof y!="object"||y===null)throw new Error(`cannot retain a ${typeof y}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const d=Object.keys(y)[0];if(!d||d!==Object.keys(f)[0])throw new Error(`embed types not matched: ${d} != ${Object.keys(f)[0]}`);return[d,y[d],f[d]]};class m{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,d){this.handlers[f]=d}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const d=this.handlers[f];if(!d)throw new Error(`no handlers for embed type "${f}"`);return d}insert(f,d){const v={};return typeof f=="string"&&f.length===0?this:(v.insert=f,d!=null&&typeof d=="object"&&Object.keys(d).length>0&&(v.attributes=d),this.push(v))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,d){if(typeof f=="number"&&f<=0)return this;const v={retain:f};return d!=null&&typeof d=="object"&&Object.keys(d).length>0&&(v.attributes=d),this.push(v)}push(f){let d=this.ops.length,v=this.ops[d-1];if(f=r(f),typeof v=="object"){if(typeof f.delete=="number"&&typeof v.delete=="number")return this.ops[d-1]={delete:v.delete+f.delete},this;if(typeof v.delete=="number"&&f.insert!=null&&(d-=1,v=this.ops[d-1],typeof v!="object"))return this.ops.unshift(f),this;if(n(f.attributes,v.attributes)){if(typeof f.insert=="string"&&typeof v.insert=="string")return this.ops[d-1]={insert:v.insert+f.insert},typeof f.attributes=="object"&&(this.ops[d-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof v.retain=="number")return this.ops[d-1]={retain:v.retain+f.retain},typeof f.attributes=="object"&&(this.ops[d-1].attributes=f.attributes),this}}return d===this.ops.length?this.ops.push(f):this.ops.splice(d,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const d=[],v=[];return this.forEach(w=>{(f(w)?d:v).push(w)}),[d,v]}reduce(f,d){return this.ops.reduce(f,d)}changeLength(){return this.reduce((f,d)=>d.insert?f+l.default.length(d):d.delete?f-d.delete:f,0)}length(){return this.reduce((f,d)=>f+l.default.length(d),0)}slice(f=0,d=1/0){const v=[],w=new o.default(this.ops);let N=0;for(;N<d&&w.hasNext();){let T;N<f?T=w.next(f-N):(T=w.next(d-N),v.push(T)),N+=l.default.length(T)}return new m(v)}compose(f){const d=new o.default(this.ops),v=new o.default(f.ops),w=[],N=v.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let O=N.retain;for(;d.peekType()==="insert"&&d.peekLength()<=O;)O-=d.peekLength(),w.push(d.next());N.retain-O>0&&v.next(N.retain-O)}const T=new m(w);for(;d.hasNext()||v.hasNext();)if(v.peekType()==="insert")T.push(v.next());else if(d.peekType()==="delete")T.push(d.next());else{const O=Math.min(d.peekLength(),v.peekLength()),k=d.next(O),z=v.next(O);if(z.retain){const j={};if(typeof k.retain=="number")j.retain=typeof z.retain=="number"?O:z.retain;else if(typeof z.retain=="number")k.retain==null?j.insert=k.insert:j.retain=k.retain;else{const tt=k.retain==null?"insert":"retain",[J,pt,gt]=h(k[tt],z.retain),g=m.getHandler(J);j[tt]={[J]:g.compose(pt,gt,tt==="retain")}}const V=i.default.compose(k.attributes,z.attributes,typeof k.retain=="number");if(V&&(j.attributes=V),T.push(j),!v.hasNext()&&n(T.ops[T.ops.length-1],j)){const tt=new m(d.rest());return T.concat(tt).chop()}}else typeof z.delete=="number"&&(typeof k.retain=="number"||typeof k.retain=="object"&&k.retain!==null)&&T.push(z)}return T.chop()}concat(f){const d=new m(this.ops.slice());return f.ops.length>0&&(d.push(f.ops[0]),d.ops=d.ops.concat(f.ops.slice(1))),d}diff(f,d){if(this.ops===f.ops)return new m;const v=[this,f].map(k=>k.map(z=>{if(z.insert!=null)return typeof z.insert=="string"?z.insert:c;const j=k===f?"on":"with";throw new Error("diff() called "+j+" non-document")}).join("")),w=new m,N=e(v[0],v[1],d,!0),T=new o.default(this.ops),O=new o.default(f.ops);return N.forEach(k=>{let z=k[1].length;for(;z>0;){let j=0;switch(k[0]){case e.INSERT:j=Math.min(O.peekLength(),z),w.push(O.next(j));break;case e.DELETE:j=Math.min(z,T.peekLength()),T.next(j),w.delete(j);break;case e.EQUAL:j=Math.min(T.peekLength(),O.peekLength(),z);const V=T.next(j),tt=O.next(j);n(V.insert,tt.insert)?w.retain(j,i.default.diff(V.attributes,tt.attributes)):w.push(tt).delete(j);break}z-=j}}),w.chop()}eachLine(f,d=`
`){const v=new o.default(this.ops);let w=new m,N=0;for(;v.hasNext();){if(v.peekType()!=="insert")return;const T=v.peek(),O=l.default.length(T)-v.peekLength(),k=typeof T.insert=="string"?T.insert.indexOf(d,O)-O:-1;if(k<0)w.push(v.next());else if(k>0)w.push(v.next(k));else{if(f(w,v.next(1).attributes||{},N)===!1)return;N+=1,w=new m}}w.length()>0&&f(w,{},N)}invert(f){const d=new m;return this.reduce((v,w)=>{if(w.insert)d.delete(l.default.length(w));else{if(typeof w.retain=="number"&&w.attributes==null)return d.retain(w.retain),v+w.retain;if(w.delete||typeof w.retain=="number"){const N=w.delete||w.retain;return f.slice(v,v+N).forEach(O=>{w.delete?d.push(O):w.retain&&w.attributes&&d.retain(l.default.length(O),i.default.invert(w.attributes,O.attributes))}),v+N}else if(typeof w.retain=="object"&&w.retain!==null){const N=f.slice(v,v+1),T=new o.default(N.ops).next(),[O,k,z]=h(w.retain,T.insert),j=m.getHandler(O);return d.retain({[O]:j.invert(k,z)},i.default.invert(w.attributes,T.attributes)),v+1}}return v},0),d.chop()}transform(f,d=!1){if(d=!!d,typeof f=="number")return this.transformPosition(f,d);const v=f,w=new o.default(this.ops),N=new o.default(v.ops),T=new m;for(;w.hasNext()||N.hasNext();)if(w.peekType()==="insert"&&(d||N.peekType()!=="insert"))T.retain(l.default.length(w.next()));else if(N.peekType()==="insert")T.push(N.next());else{const O=Math.min(w.peekLength(),N.peekLength()),k=w.next(O),z=N.next(O);if(k.delete)continue;if(z.delete)T.push(z);else{const j=k.retain,V=z.retain;let tt=typeof V=="object"&&V!==null?V:O;if(typeof j=="object"&&j!==null&&typeof V=="object"&&V!==null){const J=Object.keys(j)[0];if(J===Object.keys(V)[0]){const pt=m.getHandler(J);pt&&(tt={[J]:pt.transform(j[J],V[J],d)})}}T.retain(tt,i.default.transform(k.attributes,z.attributes,d))}}return T.chop()}transformPosition(f,d=!1){d=!!d;const v=new o.default(this.ops);let w=0;for(;v.hasNext()&&w<=f;){const N=v.peekLength(),T=v.peekType();if(v.next(),T==="delete"){f-=Math.min(N,f-w);continue}else T==="insert"&&(w<f||!d)&&(f+=N);w+=N}return f}}m.Op=l.default,m.OpIterator=o.default,m.AttributeMap=i.default,m.handlers={},t.default=m,s.exports=m,s.exports.default=m})(_s,_s.exports)),_s.exports}var Dt=$d();const P=ll(Dt);class Jt extends Rt{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Jt.blotName="break";Jt.tagName="BR";let Yt=class extends zs{};const Ud={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Qs(s){return s.replace(/[&<>"']/g,t=>Ud[t])}const ie=class ie extends Bi{static compare(t,e){const r=ie.order.indexOf(t),n=ie.order.indexOf(e);return r>=0||n>=0?r-n:t===e?0:t<e?-1:1}formatAt(t,e,r,n){if(ie.compare(this.statics.blotName,r)<0&&this.scroll.query(r,D.BLOT)){const i=this.isolate(t,e);n&&i.wrap(r,n)}else super.formatAt(t,e,r,n)}optimize(t){if(super.optimize(t),this.parent instanceof ie&&ie.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};q(ie,"allowedChildren",[ie,Jt,Rt,Yt]),q(ie,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let ce=ie;const ka=1;class At extends ts{constructor(){super(...arguments);q(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Ul(this)),this.cache.delta}deleteAt(e,r){super.deleteAt(e,r),this.cache={}}formatAt(e,r,n,i){r<=0||(this.scroll.query(n,D.BLOCK)?e+r===this.length()&&this.format(n,i):super.formatAt(e,Math.min(r,this.length()-e-1),n,i),this.cache={})}insertAt(e,r,n){if(n!=null){super.insertAt(e,r,n),this.cache={};return}if(r.length===0)return;const i=r.split(`
`),l=i.shift();l.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),l):this.children.tail.insertAt(this.children.tail.length(),l),this.cache={});let o=this;i.reduce((c,h)=>(o=o.split(c,!0),o.insertAt(0,h),h.length),e+l.length)}insertBefore(e,r){const{head:n}=this.children;super.insertBefore(e,r),n instanceof Jt&&n.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+ka),this.cache.length}moveChildren(e,r){super.moveChildren(e,r),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 r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(e===0||e>=this.length()-ka)){const i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const n=super.split(e,r);return this.cache={},n}}At.blotName="block";At.tagName="P";At.defaultChild=Jt;At.allowedChildren=[Jt,ce,Rt,Yt];let Pt=class extends Rt{attach(){super.attach(),this.attributes=new Xs(this.domNode)}delta(){return new P().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const r=this.scroll.query(t,D.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,e)}formatAt(t,e,r,n){this.format(r,n)}insertAt(t,e,r){if(r!=null){super.insertAt(t,e,r);return}const n=e.split(`
`),i=n.pop(),l=n.map(c=>{const h=this.scroll.create(At.blotName);return h.insertAt(0,c),h}),o=this.split(t);l.forEach(c=>{this.parent.insertBefore(c,o)}),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}};Pt.scope=D.BLOCK_BLOT;function Ul(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return s.descendants(Lt).reduce((e,r)=>r.length()===0?e:e.insert(r.value(),Mt(r,{},t)),new P).insert(`
`,Mt(s))}function Mt(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return s==null||("formats"in s&&typeof s.formats=="function"&&(t={...t,...s.formats()},e&&delete t["code-token"]),s.parent==null||s.parent.statics.blotName==="scroll"||s.parent.statics.scope!==s.statics.scope)?t:Mt(s.parent,t,e)}const kt=class kt extends Rt{static value(){}constructor(t,e,r){super(t,e),this.selection=r,this.textNode=document.createTextNode(kt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let r=this,n=0;for(;r!=null&&r.statics.scope!==D.BLOCK_BLOT;)n+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=kt.CONTENTS.length,r.optimize(),r.formatAt(n,kt.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}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;const t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof Yt?this.prev:null,r=e?e.length():0,n=this.next instanceof Yt?this.next:null,i=n?n.text:"",{textNode:l}=this,o=l.data.split(kt.CONTENTS).join("");l.data=kt.CONTENTS;let c;if(e)c=e,(o||n)&&(e.insertAt(e.length(),o+i),n&&n.remove());else if(n)c=n,n.insertAt(0,o);else{const h=document.createTextNode(o);c=this.scroll.create(h),this.parent.insertBefore(c,this)}if(this.remove(),t){const h=(f,d)=>e&&f===e.domNode?d:f===l?r+d-1:n&&f===n.domNode?r+o.length+d:null,m=h(t.start.node,t.start.offset),y=h(t.end.node,t.end.offset);if(m!==null&&y!==null)return{startNode:c.domNode,startOffset:m,endNode:c.domNode,endOffset:y}}return null}update(t,e){if(t.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(e.range=r)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=kt.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};q(kt,"blotName","cursor"),q(kt,"className","ql-cursor"),q(kt,"tagName","span"),q(kt,"CONTENTS","\uFEFF");let xr=kt;var Wn={exports:{}},Ma;function Fd(){return Ma||(Ma=1,(function(s){var t=Object.prototype.hasOwnProperty,e="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(e=!1));function n(c,h,m){this.fn=c,this.context=h,this.once=m||!1}function i(c,h,m,y,f){if(typeof m!="function")throw new TypeError("The listener must be a function");var d=new n(m,y||c,f),v=e?e+h:h;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],d]:c._events[v].push(d):(c._events[v]=d,c._eventsCount++),c}function l(c,h){--c._eventsCount===0?c._events=new r:delete c._events[h]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],m,y;if(this._eventsCount===0)return h;for(y in m=this._events)t.call(m,y)&&h.push(e?y.slice(1):y);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},o.prototype.listeners=function(h){var m=e?e+h:h,y=this._events[m];if(!y)return[];if(y.fn)return[y.fn];for(var f=0,d=y.length,v=new Array(d);f<d;f++)v[f]=y[f].fn;return v},o.prototype.listenerCount=function(h){var m=e?e+h:h,y=this._events[m];return y?y.fn?1:y.length:0},o.prototype.emit=function(h,m,y,f,d,v){var w=e?e+h:h;if(!this._events[w])return!1;var N=this._events[w],T=arguments.length,O,k;if(N.fn){switch(N.once&&this.removeListener(h,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,m),!0;case 3:return N.fn.call(N.context,m,y),!0;case 4:return N.fn.call(N.context,m,y,f),!0;case 5:return N.fn.call(N.context,m,y,f,d),!0;case 6:return N.fn.call(N.context,m,y,f,d,v),!0}for(k=1,O=new Array(T-1);k<T;k++)O[k-1]=arguments[k];N.fn.apply(N.context,O)}else{var z=N.length,j;for(k=0;k<z;k++)switch(N[k].once&&this.removeListener(h,N[k].fn,void 0,!0),T){case 1:N[k].fn.call(N[k].context);break;case 2:N[k].fn.call(N[k].context,m);break;case 3:N[k].fn.call(N[k].context,m,y);break;case 4:N[k].fn.call(N[k].context,m,y,f);break;default:if(!O)for(j=1,O=new Array(T-1);j<T;j++)O[j-1]=arguments[j];N[k].fn.apply(N[k].context,O)}}return!0},o.prototype.on=function(h,m,y){return i(this,h,m,y,!1)},o.prototype.once=function(h,m,y){return i(this,h,m,y,!0)},o.prototype.removeListener=function(h,m,y,f){var d=e?e+h:h;if(!this._events[d])return this;if(!m)return l(this,d),this;var v=this._events[d];if(v.fn)v.fn===m&&(!f||v.once)&&(!y||v.context===y)&&l(this,d);else{for(var w=0,N=[],T=v.length;w<T;w++)(v[w].fn!==m||f&&!v[w].once||y&&v[w].context!==y)&&N.push(v[w]);N.length?this._events[d]=N.length===1?N[0]:N:l(this,d)}return this},o.prototype.removeAllListeners=function(h){var m;return h?(m=e?e+h:h,this._events[m]&&l(this,m)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,s.exports=o})(Wn)),Wn.exports}var Hd=Fd();const zd=ll(Hd),mi=new WeakMap,bi=["error","warn","log","info"];let yi="warn";function Fl(s){if(yi&&bi.indexOf(s)<=bi.indexOf(yi)){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];console[s](...e)}}function xe(s){return bi.reduce((t,e)=>(t[e]=Fl.bind(console,e,s),t),{})}xe.level=s=>{yi=s};Fl.level=xe.level;const Xn=xe("quill:events"),Gd=["selectionchange","mousedown","mouseup","click"];Gd.forEach(s=>{document.addEventListener(s,function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(n=>{const i=mi.get(n);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class M extends zd{constructor(){super(),this.domListeners={},this.on("error",Xn.error)}emit(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Xn.log.call(Xn,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];(this.domListeners[t.type]||[]).forEach(i=>{let{node:l,handler:o}=i;(t.target===l||l.contains(t.target))&&o(t,...r)})}listenDOM(t,e,r){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:r})}}q(M,"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"}),q(M,"sources",{API:"api",SILENT:"silent",USER:"user"});const Yn=xe("quill:selection");class Ue{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class Vd{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Ue(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,M.sources.USER),1)}),this.emitter.on(M.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(M.events.SCROLL_UPDATE,(n,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const l=i.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(l?M.sources.SILENT:n)}catch{}})}),this.emitter.on(M.events.SCROLL_OPTIMIZE,(r,n)=>{if(n.range){const{startNode:i,startOffset:l,endNode:o,endOffset:c}=n.range;this.setNativeRange(i,l,o,c),this.update(M.sources.SILENT)}}),this.update(M.sources.SILENT)}handleComposition(){this.emitter.on(M.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(M.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(M.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(t,D.BLOCK))){if(r.start.node!==this.cursor.textNode){const n=this.scroll.find(r.start.node,!1);if(n==null)return;if(n instanceof Lt){const i=n.split(r.start.offset);n.parent.insertBefore(this.cursor,i)}else n.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();t=Math.min(t,r-1),e=Math.min(t+e,r-1)-t;let n,[i,l]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&l===i.length()){const[m]=this.scroll.leaf(t+1);if(m){const[y]=this.scroll.line(t),[f]=this.scroll.line(t+1);y===f&&(i=m,l=0)}}[n,l]=i.position(l,!0);const o=document.createRange();if(e>0)return o.setStart(n,l),[i,l]=this.scroll.leaf(t+e),i==null?null:([n,l]=i.position(l,!0),o.setEnd(n,l),o.getBoundingClientRect());let c="left",h;if(n instanceof Text){if(!n.data.length)return null;l<n.data.length?(o.setStart(n,l),o.setEnd(n,l+1)):(o.setStart(n,l-1),o.setEnd(n,l),c="right"),h=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;h=i.domNode.getBoundingClientRect(),l>0&&(c="right")}return{bottom:h.top+h.height,height:h.height,left:h[c],right:h[c],top:h.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const r=this.normalizeNative(e);return Yn.info("getNativeRange",r),r}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Qn(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const r=e.map(l=>{const[o,c]=l,h=this.scroll.find(o,!0),m=h.offset(this.scroll);return c===0?m:h instanceof Lt?m+h.index(o,c):m+h.length()}),n=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(n,...r);return new Ue(i,n-i)}normalizeNative(t){if(!Qn(this.root,t.startContainer)||!t.collapsed&&!Qn(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(r=>{let{node:n,offset:i}=r;for(;!(n instanceof Text)&&n.childNodes.length>0;)if(n.childNodes.length>i)n=n.childNodes[i],i=0;else if(n.childNodes.length===i)n=n.lastChild,n instanceof Text?i=n.data.length:n.childNodes.length>0?i=n.childNodes.length:i=n.childNodes.length+1;else break;r.node=n,r.offset=i}),e}rangeToNative(t){const e=this.scroll.length(),r=(n,i)=>{n=Math.min(e-1,n);const[l,o]=this.scroll.leaf(n);return l?l.position(o,i):[null,-1]};return[...r(t.index,!1),...r(t.index+t.length,!0)]}setNativeRange(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Yn.info("setNativeRange",t,e,r,n),t!=null&&(this.root.parentNode==null||t.parentNode==null||r.parentNode==null))return;const l=document.getSelection();if(l!=null)if(t!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||i||t!==o.startContainer||e!==o.startOffset||r!==o.endContainer||n!==o.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),r instanceof Element&&r.tagName==="BR"&&(n=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(t,e),c.setEnd(r,n),l.removeAllRanges(),l.addRange(c)}}else l.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;if(typeof e=="string"&&(r=e,e=!1),Yn.info("setRange",t),t!=null){const n=this.rangeToNative(t);this.setNativeRange(...n,e)}else this.setNativeRange(null);this.update(r)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const e=this.lastRange,[r,n]=this.getRange();if(this.lastRange=r,this.lastNative=n,this.lastRange!=null&&(this.savedRange=this.lastRange),!Mi(e,this.lastRange)){if(!this.composing&&n!=null&&n.native.collapsed&&n.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const i=[M.events.SELECTION_CHANGE,gr(this.lastRange),gr(e),t];this.emitter.emit(M.events.EDITOR_CHANGE,...i),t!==M.sources.SILENT&&this.emitter.emit(...i)}}}function Qn(s,t){try{t.parentNode}catch{return!1}return s.contains(t)}const Kd=/^[ -~]*$/;class Zd{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const r=Ba(t),n=new P;return Xd(r.ops.slice()).reduce((l,o)=>{const c=Dt.Op.length(o);let h=o.attributes||{},m=!1,y=!1;if(o.insert!=null){if(n.retain(c),typeof o.insert=="string"){const v=o.insert;y=!v.endsWith(`
`)&&(e<=l||!!this.scroll.descendant(Pt,l)[0]),this.scroll.insertAt(l,v);const[w,N]=this.scroll.line(l);let T=Se({},Mt(w));if(w instanceof At){const[O]=w.descendant(Lt,N);O&&(T=Se(T,Mt(O)))}h=Dt.AttributeMap.diff(T,h)||{}}else if(typeof o.insert=="object"){const v=Object.keys(o.insert)[0];if(v==null)return l;const w=this.scroll.query(v,D.INLINE)!=null;if(w)(e<=l||this.scroll.descendant(Pt,l)[0])&&(y=!0);else if(l>0){const[N,T]=this.scroll.descendant(Lt,l-1);N instanceof Yt?N.value()[T]!==`
`&&(m=!0):N instanceof Rt&&N.statics.scope===D.INLINE_BLOT&&(m=!0)}if(this.scroll.insertAt(l,v,o.insert[v]),w){const[N]=this.scroll.descendant(Lt,l);if(N){const T=Se({},Mt(N));h=Dt.AttributeMap.diff(T,h)||{}}}}e+=c}else if(n.push(o),o.retain!==null&&typeof o.retain=="object"){const v=Object.keys(o.retain)[0];if(v==null)return l;this.scroll.updateEmbedAt(l,v,o.retain[v])}Object.keys(h).forEach(v=>{this.scroll.formatAt(l,c,v,h[v])});const f=m?1:0,d=y?1:0;return e+=f+d,n.retain(f),n.delete(d),l+c+f+d},0),n.reduce((l,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(l,o.delete),l):l+Dt.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new P().retain(t).delete(e))}formatLine(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(l=>{l.format(i,r[i])})}),this.scroll.optimize();const n=new P().retain(t).retain(e,gr(r));return this.update(n)}formatText(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(i=>{this.scroll.formatAt(t,e,i,r[i])});const n=new P().retain(t).retain(e,gr(r));return this.update(n)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new P)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],n=[];e===0?this.scroll.path(t).forEach(o=>{const[c]=o;c instanceof At?r.push(c):c instanceof Lt&&n.push(c)}):(r=this.scroll.lines(t,e),n=this.scroll.descendants(Lt,t,e));const[i,l]=[r,n].map(o=>{const c=o.shift();if(c==null)return{};let h=Mt(c);for(;Object.keys(h).length>0;){const m=o.shift();if(m==null)return h;h=Wd(Mt(m),h)}return h});return{...i,...l}}getHTML(t,e){const[r,n]=this.scroll.line(t);if(r){const i=r.length();return r.length()>=n+e&&!(n===0&&e===i)?es(r,n,e,!0):es(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(t,e){const r=Ba(e),n=new P().retain(t).concat(r);return this.scroll.insertContents(t,r),this.update(n)}insertEmbed(t,e,r){return this.scroll.insertAt(t,e,r),this.update(new P().retain(t).insert({[e]:r}))}insertText(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(t,e),Object.keys(r).forEach(n=>{this.scroll.formatAt(t,e.length,n,r[n])}),this.update(new P().retain(t).insert(e,gr(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if((t==null?void 0:t.statics.blotName)!==At.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof Jt}removeFormat(t,e){const r=this.getText(t,e),[n,i]=this.scroll.line(t+e);let l=0,o=new P;n!=null&&(l=n.length()-i,o=n.delta().slice(i,i+l-1).insert(`
`));const h=this.getContents(t,e+l).diff(new P().insert(r).concat(o)),m=new P().retain(t).concat(h);return this.applyDelta(m)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const n=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(Kd)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),l=Mt(i),o=i.offset(this.scroll),c=e[0].oldValue.replace(xr.CONTENTS,""),h=new P().insert(c),m=new P().insert(i.value()),y=r&&{oldRange:Pa(r.oldRange,-o),newRange:Pa(r.newRange,-o)};t=new P().retain(o).concat(h.diff(m,y)).reduce((d,v)=>v.insert?d.insert(v.insert,l):d.push(v),new P),this.delta=n.compose(t)}else this.delta=this.getDelta(),(!t||!Mi(n.compose(t),this.delta))&&(t=n.diff(this.delta,r));return t}}function ur(s,t,e){if(s.length===0){const[d]=Jn(e.pop());return t<=0?`</li></${d}>`:`</li></${d}>${ur([],t-1,e)}`}const[{child:r,offset:n,length:i,indent:l,type:o},...c]=s,[h,m]=Jn(o);if(l>t)return e.push(o),l===t+1?`<${h}><li${m}>${es(r,n,i)}${ur(c,l,e)}`:`<${h}><li>${ur(s,t+1,e)}`;const y=e[e.length-1];if(l===t&&o===y)return`</li><li${m}>${es(r,n,i)}${ur(c,l,e)}`;const[f]=Jn(e.pop());return`</li></${f}>${ur(s,t-1,e)}`}function es(s,t,e){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in s&&typeof s.html=="function")return s.html(t,e);if(s instanceof Yt)return Qs(s.value().slice(t,t+e)).replaceAll(" ","&nbsp;");if(s instanceof Xt){if(s.statics.blotName==="list-container"){const h=[];return s.children.forEachAt(t,e,(m,y,f)=>{const d="formats"in m&&typeof m.formats=="function"?m.formats():{};h.push({child:m,offset:y,length:f,indent:d.indent||0,type:d.list})}),ur(h,-1,[])}const n=[];if(s.children.forEachAt(t,e,(h,m,y)=>{n.push(es(h,m,y))}),r||s.statics.blotName==="list")return n.join("");const{outerHTML:i,innerHTML:l}=s.domNode,[o,c]=i.split(`>${l}<`);return o==="<table"?`<table style="border: 1px solid #000;">${n.join("")}<${c}`:`${o}>${n.join("")}<${c}`}return s.domNode instanceof Element?s.domNode.outerHTML:""}function Wd(s,t){return Object.keys(t).reduce((e,r)=>{if(s[r]==null)return e;const n=t[r];return n===s[r]?e[r]=n:Array.isArray(n)?n.indexOf(s[r])<0?e[r]=n.concat([s[r]]):e[r]=n:e[r]=[n,s[r]],e},{})}function Jn(s){const t=s==="ordered"?"ol":"ul";switch(s){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Ba(s){return s.reduce((t,e)=>{if(typeof e.insert=="string"){const r=e.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return t.insert(r,e.attributes)}return t.push(e)},new P)}function Pa(s,t){let{index:e,length:r}=s;return new Ue(e+t,r)}function Xd(s){const t=[];return s.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
`).forEach((n,i)=>{i&&t.push({insert:`
`,attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}class te{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}q(te,"DEFAULTS",{});const Rs="\uFEFF";let Di=class extends Rt{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(Rs),this.rightGuard=document.createTextNode(Rs),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e=null,r;const n=t.data.split(Rs).join("");if(t===this.leftGuard)if(this.prev instanceof Yt){const i=this.prev.length();this.prev.insertAt(i,n),e={startNode:this.prev.domNode,startOffset:i+n.length}}else r=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(r),this),e={startNode:r,startOffset:n.length};else t===this.rightGuard&&(this.next instanceof Yt?(this.next.insertAt(0,n),e={startNode:this.next.domNode,startOffset:n.length}):(r=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(r),this.next),e={startNode:r,startOffset:n.length}));return t.data=Rs,e}update(t,e){t.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const n=this.restore(r.target);n&&(e.range=n)}})}};class Yd{constructor(t,e){q(this,"isComposing",!1);this.scroll=t,this.emitter=e,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",t=>{this.isComposing||this.handleCompositionStart(t)}),this.scroll.domNode.addEventListener("compositionend",t=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(t)})})}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,!0):null;e&&!(e instanceof Di)&&(this.emitter.emit(M.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(M.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(M.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(M.events.COMPOSITION_END,t),this.isComposing=!1}}const Wr=class Wr{constructor(t,e){q(this,"modules",{});this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}};q(Wr,"DEFAULTS",{modules:{}}),q(Wr,"themes",{default:Wr});let wr=Wr;const Qd=s=>s.parentElement||s.getRootNode().host||null,Jd=s=>{const t=s.getBoundingClientRect(),e="offsetWidth"in s&&Math.abs(t.width)/s.offsetWidth||1,r="offsetHeight"in s&&Math.abs(t.height)/s.offsetHeight||1;return{top:t.top,right:t.left+s.clientWidth*e,bottom:t.top+s.clientHeight*r,left:t.left}},js=s=>{const t=parseInt(s,10);return Number.isNaN(t)?0:t},Da=(s,t,e,r,n,i)=>s<e&&t>r?0:s<e?-(e-s+n):t>r?t-s>r-e?s+n-e:t-r+i:0,tp=(s,t)=>{var i,l,o;const e=s.ownerDocument;let r=t,n=s;for(;n;){const c=n===e.body,h=c?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??e.documentElement.clientWidth,bottom:((l=window.visualViewport)==null?void 0:l.height)??e.documentElement.clientHeight,left:0}:Jd(n),m=getComputedStyle(n),y=Da(r.left,r.right,h.left,h.right,js(m.scrollPaddingLeft),js(m.scrollPaddingRight)),f=Da(r.top,r.bottom,h.top,h.bottom,js(m.scrollPaddingTop),js(m.scrollPaddingBottom));if(y||f)if(c)(o=e.defaultView)==null||o.scrollBy(y,f);else{const{scrollLeft:d,scrollTop:v}=n;f&&(n.scrollTop+=f),y&&(n.scrollLeft+=y);const w=n.scrollLeft-d,N=n.scrollTop-v;r={left:r.left-w,top:r.top-N,right:r.right-w,bottom:r.bottom-N}}n=c||m.position==="fixed"?null:Qd(n)}},ep=100,rp=["block","break","cursor","inline","scroll","text"],sp=(s,t,e)=>{const r=new vr;return rp.forEach(n=>{const i=t.query(n);i&&r.register(i)}),s.forEach(n=>{let i=t.query(n);i||e.error(`Cannot register "${n}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,l+=1,l>ep){e.error(`Cycle detected in registering blot requiredContainer: "${n}"`);break}}),r},br=xe("quill"),ks=new vr;Xt.uiClass="ql-ui";const Vt=class Vt{static debug(t){t===!0&&(t="log"),xe.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return mi.get(t)||ks.find(t,e)}static import(t){return this.imports[t]==null&&br.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],e=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in t?t.attrName:t.blotName;typeof r=="string"?this.register(`formats/${r}`,t,e):Object.keys(t).forEach(n=>{this.register(n,t[n],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!r&&br.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&ks.register(e),typeof e.register=="function"&&e.register(ks)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=np(t,e),this.container=this.options.container,this.container==null){br.error("Invalid Quill container",t);return}this.options.debug&&Vt.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",mi.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new M;const n=Pi.blotName,i=this.options.registry.query(n);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${n}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Zd(this.scroll),this.selection=new Vd(this.scroll,this.emitter),this.composition=new Yd(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(M.events.EDITOR_CHANGE,l=>{l===M.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(M.events.SCROLL_UPDATE,(l,o)=>{const c=this.selection.lastRange,[h]=this.selection.getRange(),m=c&&h?{oldRange:c,newRange:h}:void 0;Gt.call(this,()=>this.editor.update(null,o,m),l)}),this.emitter.on(M.events.SCROLL_EMBED_UPDATE,(l,o)=>{const c=this.selection.lastRange,[h]=this.selection.getRange(),m=c&&h?{oldRange:c,newRange:h}:void 0;Gt.call(this,()=>{const y=new P().retain(l.offset(this)).retain({[l.statics.blotName]:o});return this.editor.update(y,[],m)},Vt.sources.USER)}),r){const l=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
`});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const r=t;t=document.createElement("div"),t.classList.add(r)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,r){return[t,e,,r]=ge(t,e,r),Gt.call(this,()=>this.editor.deleteText(t,e),r,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:M.sources.API;return Gt.call(this,()=>{const n=this.getSelection(!0);let i=new P;if(n==null)return i;if(this.scroll.query(t,D.BLOCK))i=this.editor.formatLine(n.index,n.length,{[t]:e});else{if(n.length===0)return this.selection.format(t,e),i;i=this.editor.formatText(n.index,n.length,{[t]:e})}return this.setSelection(n,M.sources.SILENT),i},r)}formatLine(t,e,r,n,i){let l;return[t,e,l,i]=ge(t,e,r,n,i),Gt.call(this,()=>this.editor.formatLine(t,e,l),i,t,0)}formatText(t,e,r,n,i){let l;return[t,e,l,i]=ge(t,e,r,n,i),Gt.call(this,()=>this.editor.formatText(t,e,l),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof t=="number"?r=this.selection.getBounds(t,e):r=this.selection.getBounds(t.index,t.length),!r)return null;const n=this.container.getBoundingClientRect();return{bottom:r.bottom-n.top,height:r.height,left:r.left-n.left,right:r.right-n.left,top:r.top-n.top,width:r.width}}getContents(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,e]=ge(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=ge(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=ge(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Vt.sources.API;return Gt.call(this,()=>this.editor.insertEmbed(t,e,r),n,t)}insertText(t,e,r,n,i){let l;return[t,,l,i]=ge(t,0,r,n,i),Gt.call(this,()=>this.editor.insertText(t,e,l),i,t,e.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(t,e,r){return[t,e,,r]=ge(t,e,r),Gt.call(this,()=>this.editor.removeFormat(t,e),r,t)}scrollRectIntoView(t){tp(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange,e=t&&this.selection.getBounds(t.index,t.length);e&&this.scrollRectIntoView(e)}setContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;return Gt.call(this,()=>{t=new P(t);const r=this.getLength(),n=this.editor.deleteText(0,r),i=this.editor.insertContents(0,t),l=this.editor.deleteText(this.getLength()-1,1);return n.compose(i).compose(l)},e)}setSelection(t,e,r){t==null?this.selection.setRange(null,e||Vt.sources.API):([t,e,,r]=ge(t,e,r),this.selection.setRange(new Ue(Math.max(0,t),e),r),r!==M.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;const r=new P().insert(t);return this.setContents(r,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M.sources.API;return Gt.call(this,()=>(t=new P(t),this.editor.applyDelta(t)),e,!0)}};q(Vt,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:ks,theme:"default"}),q(Vt,"events",M.events),q(Vt,"sources",M.sources),q(Vt,"version","2.0.3"),q(Vt,"imports",{delta:P,parchment:Md,"core/module":te,"core/theme":wr});let E=Vt;function $a(s){return typeof s=="string"?document.querySelector(s):s}function ti(s){return Object.entries(s??{}).reduce((t,e)=>{let[r,n]=e;return{...t,[r]:n===!0?{}:n}},{})}function Ua(s){return Object.fromEntries(Object.entries(s).filter(t=>t[1]!==void 0))}function np(s,t){const e=$a(s);if(!e)throw new Error("Invalid Quill container");const n=!t.theme||t.theme===E.DEFAULTS.theme?wr:E.import(`themes/${t.theme}`);if(!n)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...l}=E.DEFAULTS,{modules:o,...c}=n.DEFAULTS;let h=ti(t.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const m=Se({},ti(i),ti(o),h),y={...l,...Ua(c),...Ua(t)};let f=t.registry;return f?t.formats&&br.warn('Ignoring "formats" option because "registry" is specified'):f=t.formats?sp(t.formats,y.registry,br):y.registry,{...y,registry:f,container:e,theme:n,modules:Object.entries(m).reduce((d,v)=>{let[w,N]=v;if(!N)return d;const T=E.import(`modules/${w}`);return T==null?(br.error(`Cannot load ${w} module. Are you sure you registered it?`),d):{...d,[w]:Se({},T.DEFAULTS||{},N)}},{}),bounds:$a(y.bounds)}}function Gt(s,t,e,r){if(!this.isEnabled()&&t===M.sources.USER&&!this.allowReadOnlyEdits)return new P;let n=e==null?null:this.getSelection();const i=this.editor.delta,l=s();if(n!=null&&(e===!0&&(e=n.index),r==null?n=Fa(n,l,t):r!==0&&(n=Fa(n,e,r,t)),this.setSelection(n,M.sources.SILENT)),l.length()>0){const o=[M.events.TEXT_CHANGE,l,i,t];this.emitter.emit(M.events.EDITOR_CHANGE,...o),t!==M.sources.SILENT&&this.emitter.emit(...o)}return l}function ge(s,t,e,r,n){let i={};return typeof s.index=="number"&&typeof s.length=="number"?typeof t!="number"?(n=r,r=e,e=t,t=s.length,s=s.index):(t=s.length,s=s.index):typeof t!="number"&&(n=r,r=e,e=t,t=0),typeof e=="object"?(i=e,n=r):typeof e=="string"&&(r!=null?i[e]=r:n=e),n=n||M.sources.API,[s,t,i,n]}function Fa(s,t,e,r){const n=typeof e=="number"?e:0;if(s==null)return null;let i,l;return t&&typeof t.transformPosition=="function"?[i,l]=[s.index,s.index+s.length].map(o=>t.transformPosition(o,r!==M.sources.USER)):[i,l]=[s.index,s.index+s.length].map(o=>o<t||o===t&&r===M.sources.USER?o:n>=0?o+n:Math.max(t,o+n)),new Ue(i,l-i)}class Ge extends Ys{}function Ha(s){return s instanceof At||s instanceof Pt}function za(s){return typeof s.updateContent=="function"}class hr extends Pi{constructor(t,e,r){let{emitter:n}=r;super(t,e),this.emitter=n,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(M.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(M.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(M.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[r,n]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),i!=null&&r!==i&&n>0){if(r instanceof Pt||i instanceof Pt){this.optimize();return}const l=i.children.head instanceof Jt?null:i.children.head;r.moveChildren(i,l),r.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,r,n){super.formatAt(t,e,r,n),this.optimize()}insertAt(t,e,r){if(t>=this.length())if(r==null||this.scroll.query(e,D.BLOCK)==null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n),r==null&&e.endsWith(`
`)?n.insertAt(0,e.slice(0,-1),r):n.insertAt(0,e,r)}else{const n=this.scroll.create(e,r);this.appendChild(n)}else super.insertAt(t,e,r);this.optimize()}insertBefore(t,e){if(t.statics.scope===D.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(t),super.insertBefore(r,e)}else super.insertBefore(t,e)}insertContents(t,e){const r=this.deltaToRenderBlocks(e.concat(new P().insert(`
`))),n=r.pop();if(n==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(Pt,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new P().insert({[i.key]:i.value});ei(this,t,h);const m=i.type==="block"?1:0,y=t+h.length()+m;c&&this.insertAt(y-1,`
`);const f=Mt(this.line(t)[0]),d=Dt.AttributeMap.diff(f,i.attributes)||{};Object.keys(d).forEach(v=>{this.formatAt(y-1,1,v,d[v])}),t=y}let[l,o]=this.children.find(t);if(r.length&&(l&&(l=l.split(o),o=0),r.forEach(c=>{if(c.type==="block"){const h=this.createBlock(c.attributes,l||void 0);ei(h,0,c.delta)}else{const h=this.create(c.key,c.value);this.insertBefore(h,l||void 0),Object.keys(c.attributes).forEach(m=>{h.format(m,c.attributes[m])})}})),n.type==="block"&&n.delta.length()){const c=l?l.offset(l.scroll)+o:this.length();ei(this,c,n.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[r,n]=e;return r instanceof Lt?[r,n]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(Ha,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(n,i,l)=>{let o=[],c=l;return n.children.forEachAt(i,l,(h,m,y)=>{Ha(h)?o.push(h):h instanceof Ys&&(o=o.concat(r(h,m,c))),c-=y}),o};return r(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(M.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let e=M.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(r=>{let{target:n}=r;const i=this.find(n,!0);return i&&!za(i)}),t.length>0&&this.emitter.emit(M.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(M.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,r){const[n]=this.descendant(i=>i instanceof Pt,t);n&&n.statics.blotName===e&&za(n)&&n.updateContent(r)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let r=new P;return t.forEach(n=>{const i=n==null?void 0:n.insert;if(i)if(typeof i=="string"){const l=i.split(`
`);l.slice(0,-1).forEach(c=>{r.insert(c,n.attributes),e.push({type:"block",delta:r,attributes:n.attributes??{}}),r=new P});const o=l[l.length-1];o&&r.insert(o,n.attributes)}else{const l=Object.keys(i)[0];if(!l)return;this.query(l,D.INLINE)?r.push(n):(r.length()&&e.push({type:"block",delta:r,attributes:{}}),r=new P,e.push({type:"blockEmbed",key:l,value:i[l],attributes:n.attributes??{}}))}}),r.length()&&e.push({type:"block",delta:r,attributes:{}}),e}createBlock(t,e){let r;const n={};Object.entries(t).forEach(o=>{let[c,h]=o;this.query(c,D.BLOCK&D.BLOT)!=null?r=c:n[c]=h});const i=this.create(r||this.statics.defaultChild.blotName,r?t[r]:void 0);this.insertBefore(i,e||void 0);const l=i.length();return Object.entries(n).forEach(o=>{let[c,h]=o;i.formatAt(0,l,c,h)}),i}}q(hr,"blotName","scroll"),q(hr,"className","ql-editor"),q(hr,"tagName","DIV"),q(hr,"defaultChild",At),q(hr,"allowedChildren",[At,Pt,Ge]);function ei(s,t,e){e.reduce((r,n)=>{const i=Dt.Op.length(n);let l=n.attributes||{};if(n.insert!=null){if(typeof n.insert=="string"){const o=n.insert;s.insertAt(r,o);const[c]=s.descendant(Lt,r),h=Mt(c);l=Dt.AttributeMap.diff(h,l)||{}}else if(typeof n.insert=="object"){const o=Object.keys(n.insert)[0];if(o==null)return r;if(s.insertAt(r,o,n.insert[o]),s.scroll.query(o,D.INLINE)!=null){const[h]=s.descendant(Lt,r),m=Mt(h);l=Dt.AttributeMap.diff(m,l)||{}}}}return Object.keys(l).forEach(o=>{s.formatAt(r,i,o,l[o])}),r+i},t)}const $i={scope:D.BLOCK,whitelist:["right","center","justify"]},ip=new oe("align","align",$i),Hl=new Qt("align","ql-align",$i),zl=new qe("align","text-align",$i);class Gl extends qe{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map(n=>`00${parseInt(n,10).toString(16)}`.slice(-2)).join("")}`):e}}const ap=new Qt("color","ql-color",{scope:D.INLINE}),Ui=new Gl("color","color",{scope:D.INLINE}),lp=new Qt("background","ql-bg",{scope:D.INLINE}),Fi=new Gl("background","background-color",{scope:D.INLINE});class Ve extends Ge{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
`).slice(t,t+e)}html(t,e){return`<pre>
${Qs(this.code(t,e))}
</pre>`}}class St extends At{static register(){E.register(Ve)}}q(St,"TAB"," ");class Hi extends ce{}Hi.blotName="code";Hi.tagName="CODE";St.blotName="code-block";St.className="ql-code-block";St.tagName="DIV";Ve.blotName="code-block-container";Ve.className="ql-code-block-container";Ve.tagName="DIV";Ve.allowedChildren=[St];St.allowedChildren=[Yt,Jt,xr];St.requiredContainer=Ve;const zi={scope:D.BLOCK,whitelist:["rtl"]},Vl=new oe("direction","dir",zi),Kl=new Qt("direction","ql-direction",zi),Zl=new qe("direction","direction",zi),Wl={scope:D.INLINE,whitelist:["serif","monospace"]},Xl=new Qt("font","ql-font",Wl);class op extends qe{value(t){return super.value(t).replace(/["']/g,"")}}const Yl=new op("font","font-family",Wl),Ql=new Qt("size","ql-size",{scope:D.INLINE,whitelist:["small","large","huge"]}),Jl=new qe("size","font-size",{scope:D.INLINE,whitelist:["10px","18px","32px"]}),cp=xe("quill:keyboard"),up=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Js extends te{static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!e[r]!==t[r]&&e[r]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),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(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=fp(t);if(n==null){cp.warn("Attempted to add invalid keyboard binding",n);return}typeof e=="function"&&(e={handler:e}),typeof r=="function"&&(r={handler:r}),(Array.isArray(n.key)?n.key:[n.key]).forEach(l=>{const o={...n,key:l,...e,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(T=>Js.match(t,T));if(n.length===0)return;const i=E.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[o,c]=this.quill.getLine(l.index),[h,m]=this.quill.getLeaf(l.index),[y,f]=l.length===0?[h,m]:this.quill.getLeaf(l.index+l.length),d=h instanceof zs?h.value().slice(0,m):"",v=y instanceof zs?y.value().slice(f):"",w={collapsed:l.length===0,empty:l.length===0&&o.length()<=1,format:this.quill.getFormat(l),line:o,offset:c,prefix:d,suffix:v,event:t};n.some(T=>{if(T.collapsed!=null&&T.collapsed!==w.collapsed||T.empty!=null&&T.empty!==w.empty||T.offset!=null&&T.offset!==w.offset)return!1;if(Array.isArray(T.format)){if(T.format.every(O=>w.format[O]==null))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every(O=>T.format[O]===!0?w.format[O]!=null:T.format[O]===!1?w.format[O]==null:Mi(T.format[O],w.format[O])))return!1;return T.prefix!=null&&!T.prefix.test(w.prefix)||T.suffix!=null&&!T.suffix.test(w.suffix)?!1:T.handler.call(this,l,w,T)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let n={};const[i]=this.quill.getLine(t.index);let l=new P().retain(t.index-r).delete(r);if(e.offset===0){const[o]=this.quill.getLine(t.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const h=i.formats(),m=this.quill.getFormat(t.index-1,1);if(n=Dt.AttributeMap.diff(h,m)||{},Object.keys(n).length>0){const y=new P().retain(t.index+i.length()-2).retain(1,n);l=l.compose(y)}}}this.quill.updateContents(l,E.sources.USER),this.quill.focus()}handleDelete(t,e){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-r)return;let n={};const[i]=this.quill.getLine(t.index);let l=new P().retain(t.index).delete(r);if(e.offset>=i.length()-1){const[o]=this.quill.getLine(t.index+1);if(o){const c=i.formats(),h=this.quill.getFormat(t.index,1);n=Dt.AttributeMap.diff(c,h)||{},Object.keys(n).length>0&&(l=l.retain(o.length()-1).retain(1,n))}}this.quill.updateContents(l,E.sources.USER),this.quill.focus()}handleDeleteRange(t){Gi({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const r=Object.keys(e.format).reduce((i,l)=>(this.quill.scroll.query(l,D.BLOCK)&&!Array.isArray(e.format[l])&&(i[l]=e.format[l]),i),{}),n=new P().retain(t.index).delete(t.length).insert(`
`,r);this.quill.updateContents(n,E.sources.USER),this.quill.setSelection(t.index+1,E.sources.SILENT),this.quill.focus()}}const hp={bindings:{bold:ri("bold"),italic:ri("italic"),underline:ri("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(s,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",E.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(s,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",E.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(s,t){t.format.indent!=null?this.quill.format("indent","-1",E.sources.USER):t.format.list!=null&&this.quill.format("list",!1,E.sources.USER)}},"indent code-block":Ga(!0),"outdent code-block":Ga(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(s){this.quill.deleteText(s.index-1,1,E.sources.USER)}},tab:{key:"Tab",handler(s,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new P().retain(s.index).delete(s.length).insert(" ");return this.quill.updateContents(e,E.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(s.index+1,E.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,E.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(s,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(s.index,s.length,e,E.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(s){const[t,e]=this.quill.getLine(s.index),r={...t.formats(),list:"checked"},n=new P().retain(s.index).insert(`
`,r).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(n,E.sources.USER),this.quill.setSelection(s.index+1,E.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(s,t){const[e,r]=this.quill.getLine(s.index),n=new P().retain(s.index).insert(`
`,t.format).retain(e.length()-r-1).retain(1,{header:null});this.quill.updateContents(n,E.sources.USER),this.quill.setSelection(s.index+1,E.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(s){const t=this.quill.getModule("table");if(t){const[e,r,n,i]=t.getTable(s),l=dp(e,r,n,i);if(l==null)return;let o=e.offset();if(l<0){const c=new P().retain(o).insert(`
`);this.quill.updateContents(c,E.sources.USER),this.quill.setSelection(s.index+1,s.length,E.sources.SILENT)}else if(l>0){o+=e.length();const c=new P().retain(o).insert(`
`);this.quill.updateContents(c,E.sources.USER),this.quill.setSelection(o,E.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(s,t){const{event:e,line:r}=t,n=r.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(n-1,E.sources.USER):this.quill.setSelection(n+r.length(),E.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(s,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[r,n]=this.quill.getLine(s.index);if(n>e)return!0;let i;switch(t.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(s.index," ",E.sources.USER),this.quill.history.cutoff();const l=new P().retain(s.index-n).delete(e+1).retain(r.length()-2-n).retain(1,{list:i});return this.quill.updateContents(l,E.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(s.index-e,E.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(s){const[t,e]=this.quill.getLine(s.index);let r=2,n=t;for(;n!=null&&n.length()<=1&&n.formats()["code-block"];)if(n=n.prev,r-=1,r<=0){const i=new P().retain(s.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,E.sources.USER),this.quill.setSelection(s.index-1,E.sources.SILENT),!1}return!0}},"embed left":Ms("ArrowLeft",!1),"embed left shift":Ms("ArrowLeft",!0),"embed right":Ms("ArrowRight",!1),"embed right shift":Ms("ArrowRight",!0),"table down":Va(!1),"table up":Va(!0)}};Js.DEFAULTS=hp;function Ga(s){return{key:"Tab",shiftKey:!s,format:{"code-block":!0},handler(t,e){let{event:r}=e;const n=this.quill.scroll.query("code-block"),{TAB:i}=n;if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,E.sources.USER),this.quill.setSelection(t.index+i.length,E.sources.SILENT);return}const l=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:o,length:c}=t;l.forEach((h,m)=>{s?(h.insertAt(0,i),m===0?o+=i.length:c+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),m===0?o-=i.length:c-=i.length)}),this.quill.update(E.sources.USER),this.quill.setSelection(o,c,E.sources.SILENT)}}}function Ms(s,t){return{key:s,shiftKey:t,altKey:null,[s==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:n}=r;s==="ArrowRight"&&(n+=r.length+1);const[i]=this.quill.getLeaf(n);return i instanceof Rt?(s==="ArrowLeft"?t?this.quill.setSelection(r.index-1,r.length+1,E.sources.USER):this.quill.setSelection(r.index-1,E.sources.USER):t?this.quill.setSelection(r.index,r.length+1,E.sources.USER):this.quill.setSelection(r.index+r.length+1,E.sources.USER),!1):!0}}}function ri(s){return{key:s[0],shortKey:!0,handler(t,e){this.quill.format(s,!e.format[s],E.sources.USER)}}}function Va(s){return{key:s?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const r=s?"prev":"next",n=e.line,i=n.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let l=i.children.head,o=n;for(;o.prev!=null;)o=o.prev,l=l.next;const c=l.offset(this.quill.scroll)+Math.min(e.offset,l.length()-1);this.quill.setSelection(c,0,E.sources.USER)}}else{const l=n.table()[r];l!=null&&(s?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,E.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,E.sources.USER))}return!1}}}function fp(s){if(typeof s=="string"||typeof s=="number")s={key:s};else if(typeof s=="object")s=gr(s);else return null;return s.shortKey&&(s[up]=s.shortKey,delete s.shortKey),s}function Gi(s){let{quill:t,range:e}=s;const r=t.getLines(e);let n={};if(r.length>1){const i=r[0].formats(),l=r[r.length-1].formats();n=Dt.AttributeMap.diff(l,i)||{}}t.deleteText(e,E.sources.USER),Object.keys(n).length>0&&t.formatLine(e.index,1,n,E.sources.USER),t.setSelection(e.index,E.sources.SILENT)}function dp(s,t,e,r){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?r===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const pp=/font-weight:\s*normal/,gp=["P","OL","UL"],Ka=s=>s&&gp.includes(s.tagName),mp=s=>{Array.from(s.querySelectorAll("br")).filter(t=>Ka(t.previousElementSibling)&&Ka(t.nextElementSibling)).forEach(t=>{var e;(e=t.parentNode)==null||e.removeChild(t)})},bp=s=>{Array.from(s.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return(e=t.getAttribute("style"))==null?void 0:e.match(pp)}).forEach(t=>{var r;const e=s.createDocumentFragment();e.append(...t.childNodes),(r=t.parentNode)==null||r.replaceChild(e,t)})};function yp(s){s.querySelector('[id^="docs-internal-guid-"]')&&(bp(s),mp(s))}const vp=/\bmso-list:[^;]*ignore/i,xp=/\bmso-list:[^;]*\bl(\d+)/i,wp=/\bmso-list:[^;]*\blevel(\d+)/i,Np=(s,t)=>{const e=s.getAttribute("style"),r=e==null?void 0:e.match(xp);if(!r)return null;const n=Number(r[1]),i=e==null?void 0:e.match(wp),l=i?Number(i[1]):1,o=new RegExp(`@list l${n}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=t.match(o),h=c&&c[1]==="bullet"?"bullet":"ordered";return{id:n,indent:l,type:h,element:s}},Ap=s=>{var l,o;const t=Array.from(s.querySelectorAll("[style*=mso-list]")),e=[],r=[];t.forEach(c=>{(c.getAttribute("style")||"").match(vp)?e.push(c):r.push(c)}),e.forEach(c=>{var h;return(h=c.parentNode)==null?void 0:h.removeChild(c)});const n=s.documentElement.innerHTML,i=r.map(c=>Np(c,n)).filter(c=>c);for(;i.length;){const c=[];let h=i.shift();for(;h;)c.push(h),h=i.length&&((l=i[0])==null?void 0:l.element)===h.element.nextElementSibling&&i[0].id===h.id?i.shift():null;const m=document.createElement("ul");c.forEach(d=>{const v=document.createElement("li");v.setAttribute("data-list",d.type),d.indent>1&&v.setAttribute("class",`ql-indent-${d.indent-1}`),v.innerHTML=d.element.innerHTML,m.appendChild(v)});const y=(o=c[0])==null?void 0:o.element,{parentNode:f}=y??{};y&&(f==null||f.replaceChild(m,y)),c.slice(1).forEach(d=>{let{element:v}=d;f==null||f.removeChild(v)})}};function Ep(s){s.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Ap(s)}const Tp=[Ep,yp],Cp=s=>{s.documentElement&&Tp.forEach(t=>{t(s)})},Lp=xe("quill:clipboard"),Sp=[[Node.TEXT_NODE,$p],[Node.TEXT_NODE,Wa],["br",Rp],[Node.ELEMENT_NODE,Wa],[Node.ELEMENT_NODE,Ip],[Node.ELEMENT_NODE,qp],[Node.ELEMENT_NODE,Pp],["li",Mp],["ol, ul",Bp],["pre",jp],["tr",Dp],["b",si("bold")],["i",si("italic")],["strike",si("strike")],["style",kp]],_p=[ip,Vl].reduce((s,t)=>(s[t.keyName]=t,s),{}),Za=[zl,Fi,Ui,Zl,Yl,Jl].reduce((s,t)=>(s[t.keyName]=t,s),{});class to extends te{constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Sp.concat(this.options.matchers??[]).forEach(r=>{let[n,i]=r;this.addMatcher(n,i)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:r}=t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n[St.blotName])return new P().insert(r||"",{[St.blotName]:n[St.blotName]});if(!e)return new P().insert(r||"",n);const i=this.convertHTML(e);return is(i,`
`)&&(i.ops[i.ops.length-1].attributes==null||n.table)?i.compose(new P().retain(i.length()-1).delete(1)):i}normalizeHTML(t){Cp(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const r=e.body,n=new WeakMap,[i,l]=this.prepareMatching(r,n);return Vi(this.quill.scroll,r,i,l,n)}dangerouslyPasteHTML(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.sources.API;if(typeof t=="string"){const n=this.convert({html:t,text:""});this.quill.setContents(n,e),this.quill.setSelection(0,E.sources.SILENT)}else{const n=this.convert({html:e,text:""});this.quill.updateContents(new P().retain(t).concat(n),r),this.quill.setSelection(t+n.length(),E.sources.SILENT)}}onCaptureCopy(t){var l,o;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:n,text:i}=this.onCopy(r,e);(l=t.clipboardData)==null||l.setData("text/plain",i),(o=t.clipboardData)==null||o.setData("text/html",n),e&&Gi({range:r,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
`)}onCapturePaste(t){var l,o,c,h,m;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const r=(l=t.clipboardData)==null?void 0:l.getData("text/html");let n=(o=t.clipboardData)==null?void 0:o.getData("text/plain");if(!r&&!n){const y=(c=t.clipboardData)==null?void 0:c.getData("text/uri-list");y&&(n=this.normalizeURIList(y))}const i=Array.from(((h=t.clipboardData)==null?void 0:h.files)||[]);if(!r&&i.length>0){this.quill.uploader.upload(e,i);return}if(r&&i.length>0){const y=new DOMParser().parseFromString(r,"text/html");if(y.body.childElementCount===1&&((m=y.body.firstElementChild)==null?void 0:m.tagName)==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:r,text:n})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:r,html:n}=e;const i=this.quill.getFormat(t.index),l=this.convert({text:r,html:n},i);Lp.log("onPaste",l,{text:r,html:n});const o=new P().retain(t.index).delete(t.length).concat(l);this.quill.updateContents(o,E.sources.USER),this.quill.setSelection(o.length()-t.length,E.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const r=[],n=[];return this.matchers.forEach(i=>{const[l,o]=i;switch(l){case Node.TEXT_NODE:n.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(t.querySelectorAll(l)).forEach(c=>{if(e.has(c)){const h=e.get(c);h==null||h.push(o)}else e.set(c,[o])});break}}),[r,n]}}q(to,"DEFAULTS",{matchers:[]});function Ke(s,t,e,r){return r.query(t)?s.reduce((n,i)=>{if(!i.insert)return n;if(i.attributes&&i.attributes[t])return n.push(i);const l=e?{[t]:e}:{};return n.insert(i.insert,{...l,...i.attributes})},new P):s}function is(s,t){let e="";for(let r=s.ops.length-1;r>=0&&e.length<t.length;--r){const n=s.ops[r];if(typeof n.insert!="string")break;e=n.insert+e}return e.slice(-1*t.length)===t}function Ce(s,t){if(!(s instanceof Element))return!1;const e=t.query(s);return e&&e.prototype instanceof Rt?!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"].includes(s.tagName.toLowerCase())}function Op(s,t){return s.previousElementSibling&&s.nextElementSibling&&!Ce(s.previousElementSibling,t)&&!Ce(s.nextElementSibling,t)}const Bs=new WeakMap;function eo(s){return s==null?!1:(Bs.has(s)||(s.tagName==="PRE"?Bs.set(s,!0):Bs.set(s,eo(s.parentNode))),Bs.get(s))}function Vi(s,t,e,r,n){return t.nodeType===t.TEXT_NODE?r.reduce((i,l)=>l(t,i,s),new P):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,l)=>{let o=Vi(s,l,e,r,n);return l.nodeType===t.ELEMENT_NODE&&(o=e.reduce((c,h)=>h(l,c,s),o),o=(n.get(l)||[]).reduce((c,h)=>h(l,c,s),o)),i.concat(o)},new P):new P}function si(s){return(t,e,r)=>Ke(e,s,!0,r)}function qp(s,t,e){const r=oe.keys(s),n=Qt.keys(s),i=qe.keys(s),l={};return r.concat(n).concat(i).forEach(o=>{let c=e.query(o,D.ATTRIBUTE);c!=null&&(l[c.attrName]=c.value(s),l[c.attrName])||(c=_p[o],c!=null&&(c.attrName===o||c.keyName===o)&&(l[c.attrName]=c.value(s)||void 0),c=Za[o],c!=null&&(c.attrName===o||c.keyName===o)&&(c=Za[o],l[c.attrName]=c.value(s)||void 0))}),Object.entries(l).reduce((o,c)=>{let[h,m]=c;return Ke(o,h,m,e)},t)}function Ip(s,t,e){const r=e.query(s);if(r==null)return t;if(r.prototype instanceof Rt){const n={},i=r.value(s);if(i!=null)return n[r.blotName]=i,new P().insert(n,r.formats(s,e))}else if(r.prototype instanceof ts&&!is(t,`
`)&&t.insert(`
`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Ke(t,r.blotName,r.formats(s,e),e);return t}function Rp(s,t){return is(t,`
`)||t.insert(`
`),t}function jp(s,t,e){const r=e.query("code-block"),n=r&&"formats"in r&&typeof r.formats=="function"?r.formats(s,e):!0;return Ke(t,"code-block",n,e)}function kp(){return new P}function Mp(s,t,e){const r=e.query(s);if(r==null||r.blotName!=="list"||!is(t,`
`))return t;let n=-1,i=s.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(n+=1),i=i.parentNode;return n<=0?t:t.reduce((l,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?l.push(o):l.insert(o.insert,{indent:n,...o.attributes||{}}):l,new P)}function Bp(s,t,e){const r=s;let n=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(n=i==="true"?"checked":"unchecked"),Ke(t,"list",n,e)}function Wa(s,t,e){if(!is(t,`
`)){if(Ce(s,e)&&(s.childNodes.length>0||s instanceof HTMLParagraphElement))return t.insert(`
`);if(t.length()>0&&s.nextSibling){let r=s.nextSibling;for(;r!=null;){if(Ce(r,e))return t.insert(`
`);const n=e.query(r);if(n&&n.prototype instanceof Pt)return t.insert(`
`);r=r.firstChild}}}return t}function Pp(s,t,e){var i;const r={},n=s.style||{};return n.fontStyle==="italic"&&(r.italic=!0),n.textDecoration==="underline"&&(r.underline=!0),n.textDecoration==="line-through"&&(r.strike=!0),((i=n.fontWeight)!=null&&i.startsWith("bold")||parseInt(n.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((l,o)=>{let[c,h]=o;return Ke(l,c,h,e)},t),parseFloat(n.textIndent||0)>0?new P().insert(" ").concat(t):t}function Dp(s,t,e){var n,i;const r=((n=s.parentElement)==null?void 0:n.tagName)==="TABLE"?s.parentElement:(i=s.parentElement)==null?void 0:i.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(s)+1;return Ke(t,"table",o,e)}return t}function $p(s,t,e){var n;let r=s.data;if(((n=s.parentElement)==null?void 0:n.tagName)==="O:P")return t.insert(r.trim());if(!eo(s)){if(r.trim().length===0&&r.includes(`
`)&&!Op(s,e))return t;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(s.previousSibling==null&&s.parentElement!=null&&Ce(s.parentElement,e)||s.previousSibling instanceof Element&&Ce(s.previousSibling,e))&&(r=r.replace(/^ /,"")),(s.nextSibling==null&&s.parentElement!=null&&Ce(s.parentElement,e)||s.nextSibling instanceof Element&&Ce(s.nextSibling,e))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return t.insert(r)}class ro extends te{constructor(e,r){super(e,r);q(this,"lastRecorded",0);q(this,"ignoreChange",!1);q(this,"stack",{undo:[],redo:[]});q(this,"currentRange",null);this.quill.on(E.events.EDITOR_CHANGE,(n,i,l,o)=>{n===E.events.SELECTION_CHANGE?i&&o!==E.sources.SILENT&&(this.currentRange=i):n===E.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===E.sources.USER?this.record(i,l):this.transform(i)),this.currentRange=vi(this.currentRange,i))}),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",n=>{n.inputType==="historyUndo"?(this.undo(),n.preventDefault()):n.inputType==="historyRedo"&&(this.redo(),n.preventDefault())})}change(e,r){if(this.stack[e].length===0)return;const n=this.stack[e].pop();if(!n)return;const i=this.quill.getContents(),l=n.delta.invert(i);this.stack[r].push({delta:l,range:vi(n.range,l)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,E.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,r){if(e.ops.length===0)return;this.stack.redo=[];let n=e.invert(r),i=this.currentRange;const l=Date.now();if(this.lastRecorded+this.options.delay>l&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(n=n.compose(o.delta),i=o.range)}else this.lastRecorded=l;n.length()!==0&&(this.stack.undo.push({delta:n,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Xa(this.stack.undo,e),Xa(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,E.sources.USER);else{const r=Fp(this.quill.scroll,e.delta);this.quill.setSelection(r,E.sources.USER)}}}q(ro,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function Xa(s,t){let e=t;for(let r=s.length-1;r>=0;r-=1){const n=s[r];s[r]={delta:e.transform(n.delta,!0),range:n.range&&vi(n.range,e)},e=n.delta.transform(e),s[r].delta.length()===0&&s.splice(r,1)}}function Up(s,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
`):e.attributes!=null?Object.keys(e.attributes).some(r=>s.query(r,D.BLOCK)!=null):!1}function Fp(s,t){const e=t.reduce((n,i)=>n+(i.delete||0),0);let r=t.length()-e;return Up(s,t)&&(r-=1),r}function vi(s,t){if(!s)return s;const e=t.transformPosition(s.index),r=t.transformPosition(s.index+s.length);return{index:e,length:r-e}}class so extends te{constructor(t,e){super(t,e),t.root.addEventListener("drop",r=>{var l;r.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);n=document.createRange(),n.setStart(o.offsetNode,o.offset),n.setEnd(o.offsetNode,o.offset)}const i=n&&t.selection.normalizeNative(n);if(i){const o=t.selection.normalizedToRange(i);(l=r.dataTransfer)!=null&&l.files&&this.upload(o,r.dataTransfer.files)}})}upload(t,e){const r=[];Array.from(e).forEach(n=>{var i;n&&((i=this.options.mimetypes)!=null&&i.includes(n.type))&&r.push(n)}),r.length>0&&this.options.handler.call(this,t,r)}}so.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(s,t){if(!this.quill.scroll.query("image"))return;const e=t.map(r=>new Promise(n=>{const i=new FileReader;i.onload=()=>{n(i.result)},i.readAsDataURL(r)}));Promise.all(e).then(r=>{const n=r.reduce((i,l)=>i.insert({image:l}),new P().retain(s.index).delete(s.length));this.quill.updateContents(n,M.sources.USER),this.quill.setSelection(s.index+r.length,M.sources.SILENT)})}};const Hp=["insertText","insertReplacementText"];class zp extends te{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||t.on(E.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){Gi({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(e){const r=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new P().retain(t.index).insert(e,r),E.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,E.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Hp.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const r=Gp(t);if(r==null)return;const n=this.quill.selection.normalizeNative(e),i=n?this.quill.selection.normalizedToRange(n):null;i&&this.replaceText(i,r)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function Gp(s){var t;return typeof s.data=="string"?s.data:(t=s.dataTransfer)!=null&&t.types.includes("text/plain")?s.dataTransfer.getData("text/plain"):null}const Vp=/Mac/i.test(navigator.platform),Kp=100,Zp=s=>!!(s.key==="ArrowLeft"||s.key==="ArrowRight"||s.key==="ArrowUp"||s.key==="ArrowDown"||s.key==="Home"||Vp&&s.key==="a"&&s.ctrlKey===!0);class Wp extends te{constructor(e,r){super(e,r);q(this,"isListening",!1);q(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,r){let{line:n,event:i}=r;if(!(n instanceof Xt)||!n.uiNode)return!0;const l=getComputedStyle(n.domNode).direction==="rtl";return l&&i.key!=="ArrowRight"||!l&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),E.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Zp(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Kp,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const r=e.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const n=this.quill.scroll.find(r.startContainer);if(!(n instanceof Xt)||!n.uiNode)return;const i=document.createRange();i.setStartAfter(n.uiNode),i.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(i)}}E.register({"blots/block":At,"blots/block/embed":Pt,"blots/break":Jt,"blots/container":Ge,"blots/cursor":xr,"blots/embed":Di,"blots/inline":ce,"blots/scroll":hr,"blots/text":Yt,"modules/clipboard":to,"modules/history":ro,"modules/keyboard":Js,"modules/uploader":so,"modules/input":zp,"modules/uiNode":Wp});class Xp extends Qt{add(t,e){let r=0;if(e==="+1"||e==="-1"){const n=this.value(t)||0;r=e==="+1"?n+1:n-1}else typeof e=="number"&&(r=e);return r===0?(this.remove(t),!0):super.add(t,r.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}const Yp=new Xp("indent","ql-indent",{scope:D.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class xi extends At{}q(xi,"blotName","blockquote"),q(xi,"tagName","blockquote");class wi extends At{static formats(t){return this.tagName.indexOf(t.tagName)+1}}q(wi,"blotName","header"),q(wi,"tagName",["H1","H2","H3","H4","H5","H6"]);class as extends Ge{}as.blotName="list-container";as.tagName="OL";class ls extends At{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){E.register(as)}constructor(t,e){super(t,e);const r=e.ownerDocument.createElement("span"),n=i=>{if(!t.isEnabled())return;const l=this.statics.formats(e,t);l==="checked"?(this.format("list","unchecked"),i.preventDefault()):l==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",n),r.addEventListener("touchstart",n),this.attachUI(r)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}ls.blotName="list";ls.tagName="LI";as.allowedChildren=[ls];ls.requiredContainer=as;class rs extends ce{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}q(rs,"blotName","bold"),q(rs,"tagName",["STRONG","B"]);class Ni extends rs{}q(Ni,"blotName","italic"),q(Ni,"tagName",["EM","I"]);class Le extends ce{static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return no(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t!==this.statics.blotName||!e?super.format(t,e):this.domNode.setAttribute("href",this.constructor.sanitize(e))}}q(Le,"blotName","link"),q(Le,"tagName","A"),q(Le,"SANITIZED_URL","about:blank"),q(Le,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function no(s,t){const e=document.createElement("a");e.href=s;const r=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(r)>-1}class Ai extends ce{static create(t){return t==="super"?document.createElement("sup"):t==="sub"?document.createElement("sub"):super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super"}}q(Ai,"blotName","script"),q(Ai,"tagName",["SUB","SUP"]);class Ei extends rs{}q(Ei,"blotName","strike"),q(Ei,"tagName",["S","STRIKE"]);class Ti extends ce{}q(Ti,"blotName","underline"),q(Ti,"tagName","U");class Ds extends Di{static create(t){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return typeof t=="string"&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}q(Ds,"blotName","formula"),q(Ds,"className","ql-formula"),q(Ds,"tagName","SPAN");const Ya=["alt","height","width"];class Ci extends Rt{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Ya.reduce((e,r)=>(t.hasAttribute(r)&&(e[r]=t.getAttribute(r)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return no(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Ya.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}q(Ci,"blotName","image"),q(Ci,"tagName","IMG");const Qa=["height","width"];class $s extends Pt{static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","true"),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Qa.reduce((e,r)=>(t.hasAttribute(r)&&(e[r]=t.getAttribute(r)),e),{})}static sanitize(t){return Le.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){Qa.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}q($s,"blotName","video"),q($s,"className","ql-video"),q($s,"tagName","IFRAME");const Vr=new Qt("code-token","hljs",{scope:D.INLINE});class be extends ce{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(St.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,r){super(t,e,r),Vr.add(this.domNode,r)}format(t,e){t!==be.blotName?super.format(t,e):e?Vr.add(this.domNode,e):(Vr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Vr.value(this.domNode)||this.unwrap()}}be.blotName="code-token";be.className="ql-token";class Bt extends St{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),be.blotName,!1),super.replaceWith(t,e)}}class Zr extends Ve{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===Bt.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(t,e)}))}formatAt(t,e,r,n){r===Bt.blotName&&(this.forceNext=!0),super.formatAt(t,e,r,n)}highlight(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const n=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(`
`)}
`,i=Bt.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==n){if(n.trim().length>0||this.cachedText==null){const l=this.children.reduce((c,h)=>c.concat(Ul(h,!1)),new P),o=t(n,i);l.diff(o).reduce((c,h)=>{let{retain:m,attributes:y}=h;return m?(y&&Object.keys(y).forEach(f=>{[Bt.blotName,be.blotName].includes(f)&&this.formatAt(c,m,f,y[f])}),c+m):c},0)}this.cachedText=n,this.forceNext=!1}}html(t,e){const[r]=this.children.find(t);return`<pre data-language="${r?Bt.formats(r.domNode):"plain"}">
${Qs(this.code(t,e))}
</pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=Bt.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Zr.allowedChildren=[Bt];Bt.requiredContainer=Zr;Bt.allowedChildren=[be,xr,Yt,Jt];const Qp=(s,t,e)=>{if(typeof s.versionString=="string"){const r=s.versionString.split(".")[0];if(parseInt(r,10)>=11)return s.highlight(e,{language:t}).value}return s.highlight(t,e).value};class io extends te{static register(){E.register(be,!0),E.register(Bt,!0),E.register(Zr,!0)}constructor(t,e){if(super(t,e),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,n)=>{let{key:i}=n;return r[i]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(E.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof Zr))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:n,label:i}=r;const l=e.ownerDocument.createElement("option");l.textContent=i,l.setAttribute("value",n),e.appendChild(l)}),e.addEventListener("change",()=>{t.format(Bt.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=Bt.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(E.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(E.sources.USER);const r=this.quill.getSelection();(t==null?this.quill.scroll.descendants(Zr):[t]).forEach(i=>{i.highlight(this.highlightBlot,e)}),this.quill.update(E.sources.SILENT),r!=null&&this.quill.setSelection(r,E.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(e=this.languages[e]?e:"plain",e==="plain")return Qs(t).split(`
`).reduce((n,i,l)=>(l!==0&&n.insert(`
`,{[St.blotName]:e}),n.insert(i)),new P);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(St.className),r.innerHTML=Qp(this.options.hljs,e,t),Vi(this.quill.scroll,r,[(n,i)=>{const l=Vr.value(n);return l?i.compose(new P().retain(i.length(),{[be.blotName]:l})):i}],[(n,i)=>n.data.split(`
`).reduce((l,o,c)=>(c!==0&&l.insert(`
`,{[St.blotName]:e}),l.insert(o)),i)],new WeakMap)}}io.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"}]};const Xr=class Xr extends At{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Ki()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===Xr.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};q(Xr,"blotName","table"),q(Xr,"tagName","TD");let Wt=Xr;class ye extends Ge{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),r=this.next.children.head.formats(),n=this.next.children.tail.formats();return t.table===e.table&&t.table===r.table&&t.table===n.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const r=e.formats(),n=e.next.formats();if(r.table!==n.table){const i=this.splitAfter(e);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}q(ye,"blotName","table-row"),q(ye,"tagName","TR");class le extends Ge{}q(le,"blotName","table-body"),q(le,"tagName","TBODY");class Nr extends Ge{balanceCells(){const t=this.descendants(ye),e=t.reduce((r,n)=>Math.max(n.children.length,r),0);t.forEach(r=>{new Array(e-r.children.length).fill(0).forEach(()=>{let n;r.children.head!=null&&(n=Wt.formats(r.children.head.domNode));const i=this.scroll.create(Wt.blotName,n);r.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(le);e==null||e.children.head==null||e.children.forEach(r=>{const n=r.children.at(t);n!=null&&n.remove()})}insertColumn(t){const[e]=this.descendant(le);e==null||e.children.head==null||e.children.forEach(r=>{const n=r.children.at(t),i=Wt.formats(r.children.head.domNode),l=this.scroll.create(Wt.blotName,i);r.insertBefore(l,n)})}insertRow(t){const[e]=this.descendant(le);if(e==null||e.children.head==null)return;const r=Ki(),n=this.scroll.create(ye.blotName);e.children.head.children.forEach(()=>{const l=this.scroll.create(Wt.blotName,r);n.appendChild(l)});const i=e.children.at(t);e.insertBefore(n,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}q(Nr,"blotName","table-container"),q(Nr,"tagName","TABLE");Nr.allowedChildren=[le];le.requiredContainer=Nr;le.allowedChildren=[ye];ye.requiredContainer=le;ye.allowedChildren=[Wt];Wt.requiredContainer=ye;function Ki(){return`row-${Math.random().toString(36).slice(2,6)}`}class Jp extends te{static register(){E.register(Wt),E.register(ye),E.register(le),E.register(Nr)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Nr).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(E.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(E.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(E.sources.USER),this.quill.setSelection(e,E.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,r]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==Wt.blotName)return[null,null,null,-1];const n=e.parent;return[n.parent.parent,n,e,r]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[r,n,i]=this.getTable(e);if(i==null)return;const l=i.cellOffset();r.insertColumn(l+t),this.quill.update(E.sources.USER);let o=n.rowOffset();t===0&&(o+=1),this.quill.setSelection(e.index+o,e.length,E.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[r,n,i]=this.getTable(e);if(i==null)return;const l=n.rowOffset();r.insertRow(l+t),this.quill.update(E.sources.USER),t>0?this.quill.setSelection(e,E.sources.SILENT):this.quill.setSelection(e.index+n.children.length,e.length,E.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const r=this.quill.getSelection();if(r==null)return;const n=new Array(t).fill(0).reduce(i=>{const l=new Array(e).fill(`
`).join("");return i.insert(l,{table:Ki()})},new P().retain(r.index));this.quill.updateContents(n,E.sources.USER),this.quill.setSelection(r.index,E.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(E.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(E.events.TEXT_CHANGE,(r,n,i)=>{i===E.sources.USER&&this.balanceTables()}),!0):!1)})}}const Ja=xe("quill:toolbar");class Zi extends te{constructor(t,e){var r,n;if(super(t,e),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),t1(i,this.options.container),(n=(r=t.container)==null?void 0:r.parentNode)==null||n.insertBefore(i,t.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Ja.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(i=>{var o;const l=(o=this.options.handlers)==null?void 0:o[i];l&&this.addHandler(i,l)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(E.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(n=>n.indexOf("ql-")===0);if(!e)return;if(e=e.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[e]==null&&this.quill.scroll.query(e)==null){Ja.warn("ignoring attaching to nonexistent format",e,t);return}const r=t.tagName==="SELECT"?"change":"click";t.addEventListener(r,n=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const o=t.options[t.selectedIndex];o.hasAttribute("selected")?i=!1:i=o.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),n.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[e]!=null)this.handlers[e].call(this,i);else if(this.quill.scroll.query(e).prototype instanceof Rt){if(i=prompt(`Enter ${e}`),!i)return;this.quill.updateContents(new P().retain(l.index).delete(l.length).insert({[e]:i}),E.sources.USER)}else this.quill.format(e,i,E.sources.USER);this.update(l)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(r=>{const[n,i]=r;if(i.tagName==="SELECT"){let l=null;if(t==null)l=null;else if(e[n]==null)l=i.querySelector("option[selected]");else if(!Array.isArray(e[n])){let o=e[n];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),l=i.querySelector(`option[value="${o}"]`)}l==null?(i.value="",i.selectedIndex=-1):l.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const l=e[n],o=l===i.getAttribute("value")||l!=null&&l.toString()===i.getAttribute("value")||l==null&&!i.getAttribute("value");i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}else{const l=e[n]!=null;i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}})}}Zi.DEFAULTS={};function tl(s,t,e){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),e!=null?(r.value=e,r.setAttribute("aria-label",`${t}: ${e}`)):r.setAttribute("aria-label",t),s.appendChild(r)}function t1(s,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const r=document.createElement("span");r.classList.add("ql-formats"),e.forEach(n=>{if(typeof n=="string")tl(r,n);else{const i=Object.keys(n)[0],l=n[i];Array.isArray(l)?e1(r,i,l):tl(r,i,l)}}),s.appendChild(r)})}function e1(s,t,e){const r=document.createElement("select");r.classList.add(`ql-${t}`),e.forEach(n=>{const i=document.createElement("option");n!==!1?i.setAttribute("value",String(n)):i.setAttribute("selected","selected"),r.appendChild(i)}),s.appendChild(r)}Zi.DEFAULTS={container:null,handlers:{clean(){const s=this.quill.getSelection();if(s!=null)if(s.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,D.INLINE)!=null&&this.quill.format(e,!1,E.sources.USER)})}else this.quill.removeFormat(s.index,s.length,E.sources.USER)},direction(s){const{align:t}=this.quill.getFormat();s==="rtl"&&t==null?this.quill.format("align","right",E.sources.USER):!s&&t==="right"&&this.quill.format("align",!1,E.sources.USER),this.quill.format("direction",s,E.sources.USER)},indent(s){const t=this.quill.getSelection(),e=this.quill.getFormat(t),r=parseInt(e.indent||0,10);if(s==="+1"||s==="-1"){let n=s==="+1"?1:-1;e.direction==="rtl"&&(n*=-1),this.quill.format("indent",r+n,E.sources.USER)}},link(s){s===!0&&(s=prompt("Enter link URL:")),this.quill.format("link",s,E.sources.USER)},list(s){const t=this.quill.getSelection(),e=this.quill.getFormat(t);s==="check"?e.list==="checked"||e.list==="unchecked"?this.quill.format("list",!1,E.sources.USER):this.quill.format("list","unchecked",E.sources.USER):this.quill.format("list",s,E.sources.USER)}}};const r1='<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>',s1='<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>',n1='<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>',i1='<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>',a1='<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>',l1='<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>',o1='<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>',c1='<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>',el='<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>',u1='<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>',h1='<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>',f1='<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>',d1='<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>',p1='<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>',g1='<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>',m1='<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>',b1='<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>',y1='<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>',v1='<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>',x1='<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>',w1='<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>',N1='<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>',A1='<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>',E1='<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>',T1='<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>',C1='<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>',L1='<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>',S1='<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>',_1='<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>',O1='<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>',q1='<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>',I1='<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>',R1='<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>',ss={align:{"":r1,center:s1,right:n1,justify:i1},background:a1,blockquote:l1,bold:o1,clean:c1,code:el,"code-block":el,color:u1,direction:{"":h1,rtl:f1},formula:d1,header:{1:p1,2:g1,3:m1,4:b1,5:y1,6:v1},italic:x1,image:w1,indent:{"+1":N1,"-1":A1},link:E1,list:{bullet:T1,check:C1,ordered:L1},script:{sub:S1,super:_1},strike:O1,table:q1,underline:I1,video:R1},j1='<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>';let rl=0;function sl(s,t){s.setAttribute(t,`${s.getAttribute(t)!=="true"}`)}class tn{constructor(t){this.select=t,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}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),sl(this.label,"aria-expanded"),sl(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item");const r=t.getAttribute("value");return r&&e.setAttribute("data-value",r),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.selectItem(e,!0),n.preventDefault();break;case"Escape":this.escape(),n.preventDefault();break}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=j1,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${rl}`,rl+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const r=this.buildItem(e);t.appendChild(r),e.selected===!0&&this.selectItem(r)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.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(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");t!==r&&(r!=null&&r.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class ao extends tn{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const r=this.label.querySelector(".ql-color-label"),n=t&&t.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=n:r.style.fill=n)}}class lo extends tn{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=e[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const r=t||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const k1=s=>{const{overflowY:t}=getComputedStyle(s,null);return t!=="visible"&&t!=="clip"};class oo{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,k1(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(t){const e=t.left+t.width/2-this.root.offsetWidth/2,r=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const n=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let l=0;if(i.right>n.right&&(l=n.right-i.right,this.root.style.left=`${e+l}px`),i.left<n.left&&(l=n.left-i.left,this.root.style.left=`${e+l}px`),i.bottom>n.bottom){const o=i.bottom-i.top,c=t.bottom-t.top+o;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const M1=[!1,"center","right","justify"],B1=["#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"],P1=[!1,"serif","monospace"],D1=["1","2","3",!1],$1=["small",!1,"large","huge"];class os extends wr{constructor(t,e){super(t,e);const r=n=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(n.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(n.target)||i.close()})};t.emitter.listenDOM("click",document.body,r)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),e[i]!=null))if(i==="direction")r.innerHTML=e[i][""]+e[i].rtl;else if(typeof e[i]=="string")r.innerHTML=e[i];else{const l=r.value||"";l!=null&&e[i][l]&&(r.innerHTML=e[i][l])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(n=>{if(n.classList.contains("ql-align")&&(n.querySelector("option")==null&&Hr(n,M1),typeof e.align=="object"))return new lo(n,e.align);if(n.classList.contains("ql-background")||n.classList.contains("ql-color")){const i=n.classList.contains("ql-background")?"background":"color";return n.querySelector("option")==null&&Hr(n,B1,i==="background"?"#ffffff":"#000000"),new ao(n,e[i])}return n.querySelector("option")==null&&(n.classList.contains("ql-font")?Hr(n,P1):n.classList.contains("ql-header")?Hr(n,D1):n.classList.contains("ql-size")&&Hr(n,$1)),new tn(n)});const r=()=>{this.pickers.forEach(n=>{n.update()})};this.quill.on(M.events.EDITOR_CHANGE,r)}}os.DEFAULTS=Se({},wr.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let s=this.container.querySelector("input.ql-image[type=file]");s==null&&(s=document.createElement("input"),s.setAttribute("type","file"),s.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),s.classList.add("ql-image"),s.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,s.files),s.value=""}),this.container.appendChild(s)),s.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class co extends oo{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",e=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;e!=null?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,M.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,M.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=U1(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const r=e.index+e.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,M.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",M.sources.USER),this.quill.setSelection(r+2,M.sources.USER)}break}}this.textbox.value="",this.hide()}}function U1(s){let t=s.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||s.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=s.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:s}function Hr(s,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(r=>{const n=document.createElement("option");r===e?n.setAttribute("selected","selected"):n.setAttribute("value",String(r)),s.appendChild(n)})}const F1=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class uo extends co{constructor(t,e){super(t,e),this.quill.on(M.events.EDITOR_CHANGE,(r,n,i,l)=>{if(r===M.events.SELECTION_CHANGE)if(n!=null&&n.length>0&&l===M.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(n.index,n.length);if(o.length===1){const c=this.quill.getBounds(n);c!=null&&this.position(c)}else{const c=o[o.length-1],h=this.quill.getIndex(c),m=Math.min(c.length()-1,n.index+n.length-h),y=this.quill.getBounds(new Ue(h,m));y!=null&&this.position(y)}}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(M.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);e!=null&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",e!==0&&(r.style.marginLeft=`${-1*e-r.offsetWidth/2}px`),e}}q(uo,"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(""));class ho extends os{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=F1),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new uo(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),ss),this.buildPickers(t.container.querySelectorAll("select"),ss))}}ho.DEFAULTS=Se({},os.DEFAULTS,{modules:{toolbar:{handlers:{link(s){s?this.quill.theme.tooltip.edit():this.quill.format("link",!1,E.sources.USER)}}}}});const H1=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class fo extends co{constructor(){super(...arguments);q(this,"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){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,M.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(M.events.SELECTION_CHANGE,(e,r,n)=>{if(e!=null){if(e.length===0&&n===M.sources.USER){const[i,l]=this.quill.scroll.descendant(Le,e.index);if(i!=null){this.linkRange=new Ue(e.index-l,i.length());const o=Le.formats(i.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const c=this.quill.getBounds(this.linkRange);c!=null&&this.position(c);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}q(fo,"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(""));class po extends os{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=H1),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),ss),this.buildPickers(t.container.querySelectorAll("select"),ss),this.tooltip=new fo(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,r)=>{t.handlers.link.call(t,!r.format.link)}))}}po.DEFAULTS=Se({},os.DEFAULTS,{modules:{toolbar:{handlers:{link(s){if(s){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0&&(e=`mailto:${e}`);const{tooltip:r}=this.quill.theme;r.edit("link",e)}else this.quill.format("link",!1,E.sources.USER)}}}}});E.register({"attributors/attribute/direction":Vl,"attributors/class/align":Hl,"attributors/class/background":lp,"attributors/class/color":ap,"attributors/class/direction":Kl,"attributors/class/font":Xl,"attributors/class/size":Ql,"attributors/style/align":zl,"attributors/style/background":Fi,"attributors/style/color":Ui,"attributors/style/direction":Zl,"attributors/style/font":Yl,"attributors/style/size":Jl},!0);E.register({"formats/align":Hl,"formats/direction":Kl,"formats/indent":Yp,"formats/background":Fi,"formats/color":Ui,"formats/font":Xl,"formats/size":Ql,"formats/blockquote":xi,"formats/code-block":St,"formats/header":wi,"formats/list":ls,"formats/bold":rs,"formats/code":Hi,"formats/italic":Ni,"formats/link":Le,"formats/script":Ai,"formats/strike":Ei,"formats/underline":Ti,"formats/formula":Ds,"formats/image":Ci,"formats/video":$s,"modules/syntax":io,"modules/table":Jp,"modules/toolbar":Zi,"themes/bubble":ho,"themes/snow":po,"ui/icons":ss,"ui/picker":tn,"ui/icon-picker":lo,"ui/color-picker":ao,"ui/tooltip":oo},!0);const z1=({modules:s,formats:t,placeholder:e})=>{const r=H.useRef(null),[n,i]=H.useState(null);return H.useEffect(()=>{if(r.current){const l=new E(r.current,{modules:s,formats:t,placeholder:e});i(l)}},[]),{quillRef:r,quill:n,Quill:E}};var G1=s=>s.replace(/[\u00A0]/g," ");function V1({timeout:s=2e3}={}){const[t,e]=H.useState(null),[r,n]=H.useState(!1),[i,l]=H.useState(null),o=H.useCallback(()=>{i&&clearTimeout(i)},[i]),c=H.useCallback(y=>{o(),l(setTimeout(()=>n(!1),s)),n(y)},[o,s]),h=H.useCallback(y=>{if("clipboard"in navigator){const f=typeof y=="string"?G1(y):y;navigator.clipboard.writeText(f).then(()=>c(!0)).catch(d=>e(d))}else e(new Error("useClipboard: navigator.clipboard is not supported"))},[c]),m=H.useCallback(()=>{n(!1),e(null),o()},[o]);return{copy:h,reset:m,error:t,copied:r}}function K1(s){var t,e,r,n;const i=il(),[l,o]=vo(s,Hn.variantKeys),{ref:c,as:h,children:m,symbol:y="$",classNames:f,timeout:d,copyIcon:v,checkIcon:w,codeString:N,disableCopy:T=!1,disableTooltip:O=!1,hideCopyButton:k=!1,autoFocus:z=!1,hideSymbol:j=!1,onCopy:V,tooltipProps:tt={},copyButtonProps:J={},className:pt,...gt}=l,g=h||"div",L=typeof g=="string",x=(e=(t=s==null?void 0:s.disableAnimation)!=null?t:i==null?void 0:i.disableAnimation)!=null?e:!1,I={offset:15,delay:1e3,content:"Copy to clipboard",color:(n=s==null?void 0:s.color)!=null?n:(r=Hn.defaultVariants)==null?void 0:r.color,isDisabled:l.disableCopy,...tt},S=xo(c),C=H.useRef(null),{copy:_,copied:B}=V1({timeout:d}),$=m&&Array.isArray(m),{isFocusVisible:R,isFocused:K,focusProps:G}=wo({autoFocus:z}),Z=H.useMemo(()=>Hn({...o,disableAnimation:x}),[al(o),x]),Y=H.useMemo(()=>{if(!y||typeof y!="string")return y;const Q=y.trim();return Q?`${Q} `:""},[y]),U=Xi(f==null?void 0:f.base,pt),ct=H.useCallback(()=>({className:Z.base({class:U}),...No(gt,{enabled:L})}),[Z,U,$,gt]),ut=H.useCallback(()=>{var Q;if(T)return;let et="";typeof m=="string"?et=m:Array.isArray(m)&&m.forEach(rt=>{var mt,yt;const we=typeof rt=="string"?rt:(yt=(mt=rt==null?void 0:rt.props)==null?void 0:mt.children)==null?void 0:yt.toString();we&&(et+=we+`
`)});const it=N||et||((Q=C.current)==null?void 0:Q.textContent)||"";_(it),V==null||V(it)},[_,N,T,V,m]),W={"aria-label":typeof I.content=="string"?I.content:"Copy to clipboard",size:"sm",variant:"light",isDisabled:T,onPress:ut,isIconOnly:!0,...J},nt=H.useCallback(()=>({...W,"data-copied":Ao(B),className:Z.copyButton({class:Xi(f==null?void 0:f.copyButton)})}),[Z,R,K,T,f==null?void 0:f.copyButton,W,G]);return{Component:g,as:h,domRef:S,preRef:C,children:m,slots:Z,classNames:f,copied:B,onCopy:ut,copyIcon:v,checkIcon:w,symbolBefore:Y,isMultiLine:$,isFocusVisible:R,hideCopyButton:k,disableCopy:T,disableTooltip:O,hideSymbol:j,tooltipProps:I,getSnippetProps:ct,getCopyButtonProps:nt}}var go=Eo((s,t)=>{const{Component:e,domRef:r,preRef:n,children:i,slots:l,classNames:o,copied:c,copyIcon:h=b.jsx(Qo,{}),checkIcon:m=b.jsx(Jo,{}),symbolBefore:y,disableCopy:f,disableTooltip:d,hideSymbol:v,hideCopyButton:w,tooltipProps:N,isMultiLine:T,onCopy:O,getSnippetProps:k,getCopyButtonProps:z}=K1({...s,ref:t}),j=H.useCallback(({children:J})=>b.jsx(xt,{...N,isDisabled:c||N.isDisabled,children:J}),[al(N)]),V=H.useMemo(()=>{if(w)return null;const J=m&&H.cloneElement(m,{className:l.checkIcon()}),pt=h&&H.cloneElement(h,{className:l.copyIcon()}),gt=b.jsxs(lt,{...z(),children:[J,pt]});return d?gt:b.jsx(j,{children:gt})},[l,o==null?void 0:o.copyButton,c,m,h,O,j,f,d,w]),tt=H.useMemo(()=>T&&i&&Array.isArray(i)?b.jsx("div",{className:l.content({class:o==null?void 0:o.content}),children:i.map((J,pt)=>b.jsxs("pre",{className:l.pre({class:o==null?void 0:o.pre}),children:[!v&&b.jsx("span",{className:l.symbol({class:o==null?void 0:o.symbol}),children:y}),J]},`${pt}-${J}`))}):b.jsxs("pre",{ref:n,className:l.pre({class:o==null?void 0:o.pre}),children:[!v&&b.jsx("span",{className:l.symbol({class:o==null?void 0:o.symbol}),children:y}),i]}),[i,v,T,y,o==null?void 0:o.pre,l]);return b.jsxs(e,{ref:r,...k(),children:[tt,V]})});go.displayName="HeroUI.Snippet";var Z1=go;const W1=({messages:s})=>b.jsx(Z1,{hideSymbol:!0,codeString:JSON.stringify(s,null,2),tooltipProps:{content:"点击复制"},classNames:{copyButton:"self-start sticky top-0 right-0"},className:"bg-content1 h-96 overflow-y-scroll items-start",children:JSON.stringify(s,null,2).split(`
`).map((t,e)=>b.jsx("span",{className:"whitespace-pre-wrap break-all",children:t},e))}),Ze=()=>{const s=Io();return e=>{s.alert({title:"消息内容",size:"3xl",content:H.createElement(W1,{messages:e})})}};var It=(s=>(s.GroupUpload="group_upload",s.GroupAdmin="group_admin",s.GroupDecrease="group_decrease",s.GroupIncrease="group_increase",s.GroupBan="group_ban",s.FriendAdd="friend_add",s.GroupRecall="group_recall",s.FriendRecall="friend_recall",s.Notify="notify",s.GroupMsgEmojiLike="group_msg_emoji_like",s.GroupMsgEmojiLikeLagrange="reaction",s.GroupEssence="essence",s.GroupCard="group_card",s))(It||{});const Dg=s=>{switch(s){case"message":return"消息";case"notice":return"通知";case"request":return"请求";case"meta_event":return"元事件";case"message_sent":return"消息上报";default:return"未知"}},$g=s=>{switch(s){case"enable":return"启用";case"disable":return"停用";case"connect":return"连接";default:return"未知"}},Ug=s=>{switch(s){case"enable":return"success";case"disable":return"danger";case"connect":return"success";default:return"default"}},Fg=s=>"post_type"in s,Hg=s=>"status"in s&&"retcode"in s,zg=s=>{switch(s){case"ok":return"成功";case"failed":return"失败";case"async":return"异步";default:return"未知"}},Gg=s=>{switch(s){case"ok":return"success";case"failed":return"danger";case"async":return"warning";default:return"default"}},Vg=s=>{switch(s){case It.GroupUpload:return"群文件上传";case It.GroupAdmin:return"群管理员变动";case It.GroupDecrease:return"群成员减少";case It.GroupIncrease:return"群成员增加";case It.GroupBan:return"群禁言";case It.FriendAdd:return"好友添加";case It.GroupRecall:return"群消息撤回";case It.FriendRecall:return"好友消息撤回";case It.Notify:return"通知";case It.GroupMsgEmojiLike:return"群消息表情回应";case It.GroupEssence:return"群消息精华";case It.GroupCard:return"群名片更新";default:return"未知"}},Kg=s=>s.message_type==="group",X1=s=>{var e,r,n;let t={type:"text",data:{text:s.insert}};return typeof s.insert!="string"&&((e=s.insert)!=null&&e.image?t={type:"image",data:{file:s.insert.image.src}}:(r=s.insert)!=null&&r.emoji?t={type:"face",data:{id:s.insert.emoji.id}}:(n=s.insert)!=null&&n.reply&&(t={type:"reply",data:{id:s.insert.reply.messageId}})),t},Ar=s=>/^(http|https|file):\/\/.*/.test(s),Y1=()=>{const[s,t]=H.useState(""),e=H.useRef(null),r=Ze(),n=j=>{r([{type:"record",data:{file:j}}])},[i,l]=H.useState(!1),o=H.useRef(null),c=H.useRef([]),[h,m]=H.useState(null),[y,f]=H.useState(!1),d=H.useRef(null),[v,w]=H.useState(0),N=H.useRef(null);H.useEffect(()=>{var j;i?(navigator.mediaDevices.getUserMedia({audio:!0}).then(V=>{d.current=V;const tt=new MediaRecorder(V);o.current=tt,tt.start(),tt.ondataavailable=J=>{J.data.size>0&&c.current.push(J.data)},tt.onstop=()=>{if(c.current.length>0){const J=new Blob(c.current,{type:"audio/wav"}),pt=new FileReader;pt.readAsDataURL(J),pt.onloadend=()=>{const gt=pt.result;m(gt),f(!0)},c.current=[]}V.getTracks().forEach(J=>J.stop())}}),N.current=setInterval(()=>{w(V=>V+1)},1e3)):((j=o.current)==null||j.stop(),N.current&&(clearInterval(N.current),N.current=null))},[i]);const T=()=>{m(null),f(!1),w(0),l(!0)},O=()=>{l(!1)},k=()=>{h&&n(h)},z=j=>{const V=Math.floor(j/60),tt=j%60;return`${V}:${tt.toString().padStart(2,"0")}`};return b.jsxs(b.Fragment,{children:[b.jsxs($t,{children:[b.jsx(xt,{content:"发送音频",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",children:b.jsx(Qi,{className:"text-xl"})})})})}),b.jsxs(Ft,{className:"flex-row gap-2 p-4",children:[b.jsx(xt,{content:"上传音频",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",onPress:()=>{var j;(j=e==null?void 0:e.current)==null||j.click()},children:b.jsx(Gs,{})})}),b.jsxs($t,{children:[b.jsx(xt,{content:"输入音频地址",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{tooltip:"输入音频地址",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",children:b.jsx(Vs,{})})})})}),b.jsxs(Ft,{className:"flex-row gap-1 p-2",children:[b.jsx(Kt,{value:s,onChange:j=>t(j.target.value),placeholder:"请输入音频地址"}),b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",onPress:()=>{if(!Ar(s)){Er.error("请输入正确的音频地址");return}n(s),t("")},children:b.jsx(Ro,{})})]})]}),b.jsxs($t,{children:[b.jsx(xt,{content:"录制音频",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",children:b.jsx(Qi,{})})})})}),b.jsxs(Ft,{className:"flex-col gap-2 p-4",children:[b.jsxs("div",{className:"flex gap-2",children:[b.jsx(lt,{color:"primary",variant:"flat",onPress:i?O:T,children:i?"停止录制":"开始录制"}),y&&h&&b.jsx(lt,{color:"primary",variant:"flat",onPress:k,children:"查看消息"})]}),(i||h)&&b.jsxs("div",{className:"flex gap-1 items-center",children:[b.jsx("span",{className:To("w-4 h-4 rounded-full",i?"animate-pulse bg-primary-400":"bg-success-400")}),b.jsxs("span",{children:["录制时长: ",z(v)]})]}),y&&h&&b.jsx("audio",{controls:!0,src:h})]})]})]})]}),b.jsx("input",{type:"file",ref:e,hidden:!0,accept:"audio/*",className:"hidden",onChange:j=>{var J;const V=(J=j.target.files)==null?void 0:J[0];if(!V)return;const tt=new FileReader;tt.readAsDataURL(V),tt.onload=pt=>{var g;const gt=(g=pt.target)==null?void 0:g.result;n(gt),j.target.value=""}}})]})},Q1=()=>{const s=Ze();return b.jsx(xt,{content:"发送骰子",children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",onPress:()=>{s([{type:"dice"}])},children:b.jsx(Uo,{className:"text-lg"})})})},nl=Yi.data.map(s=>({alt:s.QDes,src:Yi.getUrl(s.QSid),id:s.QSid})),J1=({onInsertEmoji:s,onOpenChange:t})=>{const[e,r]=H.useState([]),[n,i]=H.useState(!1),l=H.useRef(null);H.useEffect(()=>{n&&(r([]),requestAnimationFrame(()=>o()))},[n]);const o=(c=0,h=10)=>{c<nl.length&&(r(m=>[...m,...nl.slice(c,c+h)]),requestAnimationFrame(()=>o(c+h,h)))};return b.jsx("div",{ref:l,children:b.jsxs($t,{portalContainer:l.current,shouldCloseOnScroll:!1,placement:"right-start",onOpenChange:c=>{t(c),i(c)},children:[b.jsx(xt,{content:"插入表情",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",children:b.jsx(Bo,{className:"text-xl"})})})})}),b.jsx(Ft,{className:"grid grid-cols-8 gap-1 flex-wrap justify-start items-start overflow-y-auto max-w-full max-h-96 p-2",children:e.map(c=>b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",onPress:()=>s(c),children:b.jsx(Ho,{src:c.src,alt:c.alt,className:"w-6 h-6"})},c.id))})]})})},tg=()=>{const[s,t]=H.useState(""),e=H.useRef(null),r=Ze(),n=i=>{r([{type:"file",data:{file:i}}])};return b.jsxs(b.Fragment,{children:[b.jsxs($t,{children:[b.jsx(xt,{content:"发送文件",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",children:b.jsx(jo,{className:"text-lg"})})})})}),b.jsxs(Ft,{className:"flex-row gap-2 p-4",children:[b.jsx(xt,{content:"上传文件",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",onPress:()=>{var i;(i=e==null?void 0:e.current)==null||i.click()},children:b.jsx(Gs,{})})}),b.jsxs($t,{children:[b.jsx(xt,{content:"输入文件地址",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{tooltip:"输入文件地址",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",children:b.jsx(Vs,{})})})})}),b.jsxs(Ft,{className:"flex-row gap-1 p-2",children:[b.jsx(Kt,{value:s,onChange:i=>t(i.target.value),placeholder:"请输入文件地址"}),b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",onPress:()=>{if(!Ar(s)){Er.error("请输入正确的文件地址");return}n(s),t("")},children:b.jsx(zo,{})})]})]})]})]}),b.jsx("input",{type:"file",ref:e,hidden:!0,className:"hidden",onChange:i=>{var c;const l=(c=i.target.files)==null?void 0:c[0];if(!l)return;const o=new FileReader;o.readAsDataURL(l),o.onload=h=>{var y;const m=(y=h.target)==null?void 0:y.result;n(m),i.target.value=""}}})]})},eg=({insertImage:s,onOpenChange:t})=>{const[e,r]=H.useState(""),n=H.useRef(null);return b.jsxs(b.Fragment,{children:[b.jsxs($t,{onOpenChange:t,children:[b.jsx(xt,{content:"插入图片",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",children:b.jsx(Po,{className:"text-xl"})})})})}),b.jsxs(Ft,{className:"flex-row gap-2 p-4",children:[b.jsx(xt,{content:"上传图片",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",onPress:()=>{var i;(i=n==null?void 0:n.current)==null||i.click()},children:b.jsx(Gs,{})})}),b.jsxs($t,{children:[b.jsx(xt,{content:"输入图片地址",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{tooltip:"输入图片地址",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",children:b.jsx(Vs,{})})})})}),b.jsxs(Ft,{className:"flex-row gap-1 p-2",children:[b.jsx(Kt,{value:e,onChange:i=>r(i.target.value),placeholder:"请输入图片地址"}),b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",onPress:()=>{if(!Ar(e)){Er.error("请输入正确的图片地址");return}s(e),r("")},children:b.jsx(Do,{})})]})]})]})]}),b.jsx("input",{type:"file",ref:n,hidden:!0,accept:"image/*",className:"hidden",onChange:i=>{var c;const l=(c=i.target.files)==null?void 0:c[0];if(!l)return;const o=new FileReader;o.readAsDataURL(l),o.onload=h=>{var y;const m=(y=h.target)==null?void 0:y.result;s(m),i.target.value=""}}})]})},rg=()=>{const[s,t]=H.useState(""),[e,r]=H.useState(new Set(["163"])),[n,i]=H.useState("default"),l=H.useRef(null),{control:o,handleSubmit:c,reset:h}=Wo({defaultValues:{url:"",audio:"",title:"",image:"",content:""}}),m=Ze(),y=d=>{const v=[];d.type==="custom"?v.push({type:"music",data:{...d,type:"custom"}}):v.push({type:"music",data:d}),m(v)},f=d=>{y({type:"custom",...d}),h()};return b.jsx("div",{ref:l,className:"overflow-visible",children:b.jsxs($t,{placement:"right-start",shouldCloseOnScroll:!1,portalContainer:l.current,children:[b.jsx(xt,{content:"发送音乐",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",children:b.jsx(ko,{className:"text-xl"})})})})}),b.jsx(Ft,{className:"gap-2 p-4",children:b.jsxs(Zo,{placement:"top",className:"w-96",fullWidth:!0,selectedKey:n,onSelectionChange:d=>{d!==null&&i(d)},children:[b.jsxs(Ji,{title:"主流平台",className:"flex flex-col gap-2",children:[b.jsx(Vo,{onClick:d=>d.stopPropagation(),"aria-label":"音乐平台",selectedKeys:e,label:"音乐平台",placeholder:"请选择音乐平台",items:[{name:"QQ音乐",id:"qq"},{name:"网易云音乐",id:"163"},{name:"虾米音乐",id:"xm"}],onSelectionChange:r,children:d=>b.jsx(Ko,{value:d.id,children:d.name},d.id)}),b.jsx(Kt,{value:s,onChange:d=>t(d.target.value),placeholder:"请输入音乐ID",label:"音乐ID"}),b.jsxs(lt,{fullWidth:!0,size:"lg",color:"primary",variant:"flat",radius:"full",onPress:()=>{if(!s){Er.error("请输入音乐ID");return}y({type:Array.from(e)[0],id:s}),t("")},startContent:b.jsx(ta,{}),children:["创建",Array.from(e)[0]==="163"?"网易云":"QQ","音乐"]})]},"default"),b.jsx(Ji,{title:"自定义音乐",className:"flex flex-col gap-2",children:b.jsxs(tc,{onSubmit:c(f),className:"flex flex-col gap-2",validationBehavior:"native",children:[b.jsx(Ur,{name:"url",control:o,render:({field:d})=>b.jsx(Kt,{...d,isRequired:!0,validate:v=>Ar(v)?null:"请输入正确的音乐URL",size:"sm",placeholder:"请输入音乐URL",label:"音乐URL"})}),b.jsx(Ur,{name:"audio",control:o,render:({field:d})=>b.jsx(Kt,{...d,isRequired:!0,validate:v=>Ar(v)?null:"请输入正确的音频URL",size:"sm",placeholder:"请输入音频URL",label:"音频URL"})}),b.jsx(Ur,{name:"title",control:o,render:({field:d})=>b.jsx(Kt,{...d,isRequired:!0,size:"sm",errorMessage:"请输入音乐标题",placeholder:"请输入音乐标题",label:"音乐标题"})}),b.jsx(Ur,{name:"image",control:o,render:({field:d})=>b.jsx(Kt,{...d,size:"sm",placeholder:"请输入封面图片URL",label:"封面图片URL"})}),b.jsx(Ur,{name:"content",control:o,render:({field:d})=>b.jsx(Kt,{...d,size:"sm",placeholder:"请输入音乐描述",label:"音乐描述"})}),b.jsx(lt,{fullWidth:!0,size:"lg",color:"primary",variant:"flat",radius:"full",type:"submit",startContent:b.jsx(ta,{}),children:"创建自定义音乐"})]})},"custom")]})})]})})},sg=({insertReply:s})=>{const[t,e]=H.useState("");return b.jsx(b.Fragment,{children:b.jsxs($t,{children:[b.jsx(xt,{content:"回复消息",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",children:b.jsx(Fo,{className:"text-lg"})})})})}),b.jsxs(Ft,{className:"flex-row gap-2 p-4",children:[b.jsx(Kt,{placeholder:"输入消息 ID",value:t,onChange:r=>{const n=r.target.value;/^(?:0|(?:-?[1-9]\d*))$/.test(n)&&e(n)}}),b.jsx(lt,{color:"primary",variant:"flat",radius:"full",isIconOnly:!0,onPress:()=>{s(t),e("")},children:b.jsx($o,{})})]})]})})};function ng(s){return Yo({attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 11.40625 6.96875 C 10.578125 6.953125 9.890625 7.125 9.46875 7.25 C 9.457031 7.25 9.449219 7.25 9.4375 7.25 L 6.9375 8.03125 C 4.003906 8.933594 2 11.652344 2 14.71875 L 2 20 C 2 23.855469 5.144531 27 9 27 L 18.90625 27 C 20.125 27.027344 21.304688 26.3125 21.78125 25.125 C 22.082031 24.371094 22.039063 23.578125 21.75 22.875 C 22.363281 22.550781 22.882813 22.027344 23.15625 21.34375 C 23.46875 20.558594 23.417969 19.722656 23.09375 19 L 27 19 C 28.644531 19 30 17.644531 30 16 C 30 14.355469 28.644531 13 27 13 L 25.46875 13 L 25.875 12.875 C 27.449219 12.398438 28.351563 10.699219 27.875 9.125 C 27.398438 7.550781 25.699219 6.648438 24.125 7.125 L 15.6875 9.71875 C 15.613281 9.53125 15.527344 9.328125 15.40625 9.125 C 14.90625 8.289063 13.894531 7.34375 12.28125 7.0625 C 11.980469 7.011719 11.683594 6.972656 11.40625 6.96875 Z M 25.125 9 C 25.515625 9.042969 25.847656 9.3125 25.96875 9.71875 C 26.132813 10.257813 25.820313 10.804688 25.28125 10.96875 L 18.4375 13.03125 L 18.78125 14.15625 L 18.78125 15 L 27 15 C 27.566406 15 28 15.433594 28 16 C 28 16.566406 27.566406 17 27 17 L 20.40625 17 L 17.78125 15.96875 C 17.402344 15.816406 17.011719 15.742188 16.625 15.75 L 16.09375 11.65625 L 24.71875 9.03125 C 24.855469 8.988281 24.996094 8.984375 25.125 9 Z M 11.375 9.03125 C 11.566406 9.03125 11.765625 9.03125 11.9375 9.0625 C 13.011719 9.25 13.425781 9.71875 13.6875 10.15625 C 13.949219 10.59375 13.96875 10.90625 13.96875 10.90625 C 13.96875 10.925781 13.96875 10.949219 13.96875 10.96875 L 14.8125 17.40625 C 14.820313 17.4375 14.832031 17.46875 14.84375 17.5 C 14.96875 18.027344 14.652344 18.53125 14.125 18.65625 C 13.800781 18.734375 13.636719 18.691406 13.46875 18.59375 C 13.300781 18.496094 13.09375 18.289063 12.9375 17.84375 L 11.6875 13 C 11.609375 12.703125 11.398438 12.460938 11.121094 12.339844 C 10.839844 12.21875 10.519531 12.230469 10.25 12.375 L 8.59375 13.28125 C 8.109375 13.546875 7.933594 14.15625 8.203125 14.640625 C 8.46875 15.125 9.078125 15.300781 9.5625 15.03125 L 10.0625 14.75 L 11.03125 18.4375 C 11.039063 18.46875 11.050781 18.5 11.0625 18.53125 C 11.332031 19.304688 11.792969 19.925781 12.4375 20.3125 C 12.964844 20.628906 13.578125 20.75 14.1875 20.6875 C 13.871094 20.980469 13.609375 21.355469 13.4375 21.78125 C 12.980469 22.925781 13.269531 24.183594 14.09375 25 L 9 25 C 6.226563 25 4 22.773438 4 20 L 4 14.71875 C 4 12.519531 5.429688 10.585938 7.53125 9.9375 L 10.03125 9.1875 C 10.234375 9.125 10.804688 9.03125 11.375 9.03125 Z M 16.8125 17.78125 C 16.886719 17.792969 16.957031 17.78125 17.03125 17.8125 L 20.75 19.3125 C 21.273438 19.523438 21.523438 20.070313 21.3125 20.59375 C 21.101563 21.117188 20.523438 21.367188 20 21.15625 L 16.28125 19.6875 C 16.226563 19.667969 16.203125 19.621094 16.15625 19.59375 C 16.550781 19.085938 16.804688 18.445313 16.8125 17.78125 Z M 16.1875 21.90625 C 16.320313 21.90625 16.460938 21.917969 16.59375 21.96875 L 17.9375 22.5 L 19.25 23.03125 L 19.375 23.0625 C 19.898438 23.273438 20.148438 23.851563 19.9375 24.375 C 19.785156 24.757813 19.445313 24.980469 19.0625 25 C 19.050781 25 19.042969 25 19.03125 25 C 18.898438 25.003906 18.757813 24.988281 18.625 24.9375 L 15.84375 23.8125 C 15.320313 23.601563 15.070313 23.023438 15.28125 22.5 C 15.386719 22.238281 15.578125 22.070313 15.8125 21.96875 C 15.929688 21.917969 16.054688 21.90625 16.1875 21.90625 Z"},child:[]}]})(s)}const ig=()=>{const s=Ze();return b.jsx(xt,{content:"发送猜拳",children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",onPress:()=>{s([{type:"rps"}])},children:b.jsx(ng,{className:"text-2xl"})})})},ag=()=>{const[s,t]=H.useState(""),e=H.useRef(null),r=Ze(),n=i=>{r([{type:"video",data:{file:i}}])};return b.jsxs(b.Fragment,{children:[b.jsxs($t,{children:[b.jsx(xt,{content:"发送视频",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{children:b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",children:b.jsx(Mo,{className:"text-xl"})})})})}),b.jsxs(Ft,{className:"flex-row gap-2 p-4",children:[b.jsx(xt,{content:"上传视频",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",onPress:()=>{var i;(i=e==null?void 0:e.current)==null||i.click()},children:b.jsx(Gs,{})})}),b.jsxs($t,{children:[b.jsx(xt,{content:"输入视频地址",children:b.jsx("div",{className:"max-w-fit",children:b.jsx(Ut,{tooltip:"输入视频地址",children:b.jsx(lt,{className:"text-lg",color:"primary",isIconOnly:!0,variant:"flat",radius:"full",children:b.jsx(Vs,{})})})})}),b.jsxs(Ft,{className:"flex-row gap-1 p-2",children:[b.jsx(Kt,{value:s,onChange:i=>t(i.target.value),placeholder:"请输入视频地址"}),b.jsx(lt,{color:"primary",variant:"flat",isIconOnly:!0,radius:"full",onPress:()=>{if(!Ar(s)){Er.error("请输入正确的视频地址");return}n(s),t("")},children:b.jsx(Xo,{})})]})]})]})]}),b.jsx("input",{type:"file",ref:e,hidden:!0,accept:"video/*",className:"hidden",onChange:i=>{var c;const l=(c=i.target.files)==null?void 0:c[0];if(!l)return;const o=new FileReader;o.readAsDataURL(l),o.onload=h=>{var y;const m=(y=h.target)==null?void 0:y.result;n(m),i.target.value=""}}})]})},lg=E.import("blots/embed"),fr=class fr extends lg{static create(t){const e=super.create(t);return e.setAttribute("alt",t.alt),e.setAttribute("src",t.src),e.setAttribute("data-id",t.id),e.classList.add(...fr.classNames),e}static formats(t){return{alt:t.getAttribute("alt")??"",src:t.getAttribute("src")??"",id:t.getAttribute("data-id")??""}}static value(t){return{alt:t.getAttribute("alt")??"",src:t.getAttribute("src")??"",id:t.getAttribute("data-id")??""}}};q(fr,"blotName","emoji"),q(fr,"tagName","img"),q(fr,"classNames",["w-6","h-6"]);let Li=fr;const og=E.import("blots/embed"),dr=class dr extends og{static create(t){const e=super.create();return e.setAttribute("alt",t.alt),e.setAttribute("src",t.src),e.classList.add(...dr.classNames),e}static value(t){return{alt:t.getAttribute("alt")??"",src:t.getAttribute("src")??""}}};q(dr,"blotName","image"),q(dr,"tagName","img"),q(dr,"classNames",["max-w-48","max-h-48","align-bottom"]);let Si=dr;const cg=E.import("blots/block/embed"),pr=class pr extends cg{static create(t){const e=super.create();e.setAttribute("data-message-id",t.messageId),e.setAttribute("contenteditable","false"),e.classList.add(...pr.classNames);const r=document.createElement("div");r.classList.add("text-sm","text-default-500","relative");const n=document.createElement("div");n.classList.add("w-3","h-3","absolute","top-0","right-0");const i='<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M15.9082 12.3714H20.5982C20.5182 17.0414 19.5982 17.8114 16.7282 19.5114C16.3982 19.7114 16.2882 20.1314 16.4882 20.4714C16.6882 20.8014 17.1082 20.9114 17.4482 20.7114C20.8282 18.7114 22.0082 17.4914 22.0082 11.6714V6.28141C22.0082 4.57141 20.6182 3.19141 18.9182 3.19141H15.9182C14.1582 3.19141 12.8282 4.52141 12.8282 6.28141V9.28141C12.8182 11.0414 14.1482 12.3714 15.9082 12.3714Z" fill="#292D32"></path> <path d="M5.09 12.3714H9.78C9.7 17.0414 8.78 17.8114 5.91 19.5114C5.58 19.7114 5.47 20.1314 5.67 20.4714C5.87 20.8014 6.29 20.9114 6.63 20.7114C10.01 18.7114 11.19 17.4914 11.19 11.6714V6.28141C11.19 4.57141 9.8 3.19141 8.1 3.19141H5.1C3.33 3.19141 2 4.52141 2 6.28141V9.28141C2 11.0414 3.33 12.3714 5.09 12.3714Z" fill="#292D32"></path> </g></svg>';return n.innerHTML=i,r.innerHTML=`消息ID:${t.messageId}`,r.appendChild(n),e.appendChild(r),e}static value(t){return{messageId:t.getAttribute("data-message-id")||""}}};q(pr,"blotName","reply"),q(pr,"tagName","div"),q(pr,"classNames",["p-2","select-none","bg-default-100","rounded-md","pointer-events-none"]);let _i=pr;const ug=()=>{const s=H.useRef(null),t=Ze(),e=["image","emoji","reply"],r={toolbar:"#toolbar"},{quillRef:n,quill:i,Quill:l}=z1({modules:r,formats:e,placeholder:"请输入消息"});l&&!i&&(l.register("formats/emoji",Li),l.register("formats/image",Si,!0),l.register("formats/reply",_i)),i&&(i.on("selection-change",f=>{var d;if(f){const w=i.getContents().ops[0];typeof(w==null?void 0:w.insert)!="string"&&((d=w==null?void 0:w.insert)!=null&&d.reply)&&f.index===0&&f.length!==i.getLength()&&i.setSelection(1,l.sources.SILENT)}}),i.on("text-change",()=>{var v;const d=i.getContents().ops[0];d&&typeof d.insert!="string"&&((v=d.insert)!=null&&v.reply)&&i.getLength()===1&&i.insertText(1,`
`,l.sources.SILENT)}),i.on("editor-change",f=>{var d;if(f==="text-change"){const w=i.getContents().ops[0];w&&typeof w.insert!="string"&&((d=w.insert)!=null&&d.reply)&&i.getLength()===1&&i.insertText(1,`
`,l.sources.SILENT)}}),i.root.addEventListener("compositionstart",()=>{var v;const d=i.getContents().ops[0];d&&typeof d.insert!="string"&&((v=d.insert)!=null&&v.reply)&&i.getLength()===1&&i.insertText(1,`
`,l.sources.SILENT)}));const o=f=>{if(f){const d=i==null?void 0:i.getSelection();d&&(s.current=d)}},c=f=>{const d=s.current||(i==null?void 0:i.getSelection());i==null||i.deleteText((d==null?void 0:d.index)||0,(d==null?void 0:d.length)||0),i==null||i.insertEmbed((d==null?void 0:d.index)||0,"image",{src:f,alt:"图片"}),i==null||i.setSelection(((d==null?void 0:d.index)||0)+1,0)};function h(f){var T;if(!/^(?:0|(?:-?[1-9]\d*))$/.test(f)){Er.error("请输入正确的消息ID");return}const v=i==null?void 0:i.getContents(),w=v==null?void 0:v.ops[0],N=i==null?void 0:i.getSelection();if(w&&typeof w.insert!="string"&&((T=w.insert)!=null&&T.reply)){const O=i==null?void 0:i.getContents();O&&(O.ops[0]={insert:{reply:{messageId:f}}},i==null||i.setContents(O,l.sources.USER))}else i==null||i.insertEmbed(0,"reply",{messageId:f},l.sources.USER);i==null||i.setSelection(((N==null?void 0:N.index)||0)+1,0),i==null||i.blur()}const m=f=>{const d=s.current||(i==null?void 0:i.getSelection());i==null||i.deleteText((d==null?void 0:d.index)||0,(d==null?void 0:d.length)||0),i==null||i.insertEmbed((d==null?void 0:d.index)||0,"emoji",{alt:f.alt,src:f.src,id:f.id}),i==null||i.setSelection(((d==null?void 0:d.index)||0)+1,0)},y=()=>{var w;const f=i==null?void 0:i.getContents();return(((w=f==null?void 0:f.ops)==null?void 0:w.filter(N=>N.insert!==`
`))??[]).map(N=>X1(N))};return b.jsxs("div",{children:[b.jsx("div",{ref:n,className:"border border-default-200 rounded-md !mb-2 !text-base !h-64"}),b.jsxs("div",{id:"toolbar",className:"!border-none flex gap-2",children:[b.jsx(eg,{insertImage:c,onOpenChange:o}),b.jsx(J1,{onInsertEmoji:m,onOpenChange:o}),b.jsx(sg,{insertReply:h}),b.jsx(tg,{}),b.jsx(Y1,{}),b.jsx(ag,{}),b.jsx(rg,{}),b.jsx(Q1,{}),b.jsx(ig,{}),b.jsx(lt,{color:"primary",onPress:()=>{const f=y();t(f)},className:"ml-auto",children:"获取JSON格式"})]})]})};function Zg({children:s}){const{isOpen:t,onOpen:e,onOpenChange:r}=Co();return b.jsxs(b.Fragment,{children:[s?s(e):b.jsx(lt,{onPress:e,color:"primary",radius:"full",variant:"flat",size:"sm",className:"bg-primary/10 text-primary",children:"构造消息"}),b.jsx(Lo,{size:"4xl",scrollBehavior:"inside",isOpen:t,onOpenChange:r,children:b.jsx(So,{children:n=>b.jsxs(b.Fragment,{children:[b.jsx(_o,{className:"flex flex-col gap-1",children:"构造消息"}),b.jsx(Oo,{className:"overflow-y-auto",children:b.jsx("div",{className:"overflow-y-auto",children:b.jsx(ug,{})})}),b.jsx(qo,{children:b.jsx(lt,{color:"primary",onPress:n,variant:"flat",children:"关闭"})})]})})})]})}export{Zg as C,It as O,Ug as a,Vg as b,zg as c,Gg as d,Dg as e,Fg as f,$g as g,Hg as h,Kg as i,Z1 as s};