@mgdis/mg-components 6.18.0 → 6.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/cjs/{index-DCZEYvlH.js → index-Bp6wZzau.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mg-action-more_37.cjs.entry.js +90 -120
  4. package/dist/cjs/mg-alert.cjs.entry.js +1 -1
  5. package/dist/cjs/mg-components.cjs.js +2 -2
  6. package/dist/cjs/mg-fieldset.cjs.entry.js +2 -2
  7. package/dist/cjs/mg-input-combobox.cjs.entry.js +39 -38
  8. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +4 -8
  9. package/dist/cjs/{mg-input.conf-HYIzRsy7.js → mg-input.conf-D7jmj_lh.js} +2 -0
  10. package/dist/cjs/mg-loader.cjs.entry.js +1 -1
  11. package/dist/cjs/mg-progress.cjs.entry.js +1 -1
  12. package/dist/collection/assets/icons/index.js +1 -1
  13. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  14. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +1 -0
  15. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +36 -35
  16. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +2 -6
  17. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +17 -16
  18. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +5 -21
  19. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +72 -84
  20. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
  21. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
  22. package/dist/components/mg-card2.js +1 -1
  23. package/dist/components/mg-icon2.js +1 -1
  24. package/dist/components/mg-illustrated-message.js +1 -1
  25. package/dist/components/mg-input-checkbox.js +1 -1
  26. package/dist/components/mg-input-combobox.js +38 -37
  27. package/dist/components/mg-input-date.js +1 -1
  28. package/dist/components/mg-input-numeric.js +1 -1
  29. package/dist/components/mg-input-password.js +1 -1
  30. package/dist/components/mg-input-rich-text-editor.js +2 -6
  31. package/dist/components/mg-input-select2.js +1 -1
  32. package/dist/components/mg-input-text2.js +16 -16
  33. package/dist/components/mg-input-textarea.js +6 -22
  34. package/dist/components/mg-input-toggle.js +60 -75
  35. package/dist/components/mg-input2.js +3 -2
  36. package/dist/components/mg-message2.js +1 -1
  37. package/dist/components/mg-modal.js +1 -1
  38. package/dist/components/mg-panel.js +1 -1
  39. package/dist/components/mg-popover-content2.js +1 -1
  40. package/dist/components/mg-popover2.js +1 -1
  41. package/dist/esm/{index-T6kOJXP1.js → index-BluNKQ3L.js} +1 -1
  42. package/dist/esm/loader.js +3 -3
  43. package/dist/esm/mg-action-more_37.entry.js +90 -120
  44. package/dist/esm/mg-alert.entry.js +1 -1
  45. package/dist/esm/mg-components.js +3 -3
  46. package/dist/esm/mg-fieldset.entry.js +2 -2
  47. package/dist/esm/mg-input-combobox.entry.js +40 -39
  48. package/dist/esm/mg-input-rich-text-editor.entry.js +4 -8
  49. package/dist/esm/{mg-input.conf-D9V2v4n2.js → mg-input.conf-DDnrE1hD.js} +2 -1
  50. package/dist/esm/mg-loader.entry.js +1 -1
  51. package/dist/esm/mg-progress.entry.js +1 -1
  52. package/dist/mg-components/mg-components.css +1 -1
  53. package/dist/mg-components/mg-components.esm.js +1 -1
  54. package/dist/mg-components/{p-f2cddd52.entry.js → p-016bd291.entry.js} +1 -1
  55. package/dist/mg-components/{p-f6afaeb8.entry.js → p-186a6139.entry.js} +1 -1
  56. package/dist/mg-components/p-7132bca1.entry.js +1 -0
  57. package/dist/mg-components/{p-952288bd.entry.js → p-916dfb6d.entry.js} +1 -1
  58. package/dist/mg-components/p-BluNKQ3L.js +2 -0
  59. package/dist/mg-components/p-DDnrE1hD.js +1 -0
  60. package/dist/mg-components/p-cd061b38.entry.js +1 -0
  61. package/dist/mg-components/{p-5abc77cd.entry.js → p-d2c72f09.entry.js} +1 -1
  62. package/dist/mg-components/{p-92e5e5a6.entry.js → p-d5a276eb.entry.js} +1 -1
  63. package/dist/types/assets/icons/index.d.ts +9 -0
  64. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +1 -0
  65. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.d.ts +1 -0
  66. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +4 -5
  67. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +0 -1
  68. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +1 -5
  69. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -6
  70. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +13 -16
  71. package/dist/types/components.d.ts +6 -8
  72. package/ide/intellij/web-types.json +35 -28
  73. package/ide/vscode/css-custom-data.json +19 -3
  74. package/ide/vscode/custom.css-data.json +425 -0
  75. package/ide/vscode/html-custom-data.json +60 -6
  76. package/package.json +21 -21
  77. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +0 -1
  78. package/dist/mg-components/p-2bab89c2.entry.js +0 -1
  79. package/dist/mg-components/p-7d2e43b2.entry.js +0 -1
  80. package/dist/mg-components/p-D9V2v4n2.js +0 -1
  81. package/dist/mg-components/p-T6kOJXP1.js +0 -2
  82. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +0 -8
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,a as n}from"./p-T6kOJXP1.js";import{i as r,C as s,t as l}from"./p-C7xjtdiw.js";import{c as o,a}from"./p-D9V2v4n2.js";import{i as c}from"./p-CNX6lq0x.js";var h="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,d=h||u||Function("return this")(),f=d.Symbol,p=Object.prototype,q=p.hasOwnProperty,b=p.toString,v=f?f.toStringTag:void 0,m=Object.prototype.toString,g=f?f.toStringTag:void 0;function w(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?function(t){var e=q.call(t,v),i=t[v];try{t[v]=void 0;var n=!0}catch(t){}var r=b.call(t);return n&&(e?t[v]=i:delete t[v]),r}(t):function(t){return m.call(t)}(t)}function y(t){return null!=t&&"object"==typeof t}var k=Array.isArray;function x(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function j(t){return t}function A(t){if(!x(t))return!1;var e=w(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var O,M=d["__core-js_shared__"],E=(O=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",T=Function.prototype.toString;function _(t){if(null!=t){try{return T.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var N=/^\[object .+?Constructor\]$/,L=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!x(t)||(e=t,E&&E in e))&&(A(t)?L:N).test(_(t));var e}(i)?i:void 0}var z,C,S,B=$(d,"WeakMap"),R=Object.create,H=function(){function t(){}return function(e){if(!x(e))return{};if(R)return R(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}(),V=Date.now,D=function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),I=D?function(t,e){return D(t,"toString",{configurable:!0,enumerable:!1,value:(i=e,function(){return i}),writable:!0});var i}:j,P=(z=I,C=0,S=0,function(){var t=V(),e=16-(t-S);if(S=t,e>0){if(++C>=800)return arguments[0]}else C=0;return z.apply(void 0,arguments)}),F=/^(?:0|[1-9]\d*)$/;function U(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&F.test(t))&&t>-1&&t%1==0&&t<e}function Z(t,e,i){"__proto__"==e&&D?D(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function K(t,e){return t===e||t!=t&&e!=e}var W=Object.prototype.hasOwnProperty;function G(t,e,i){var n=t[e];W.call(t,e)&&K(n,i)&&(void 0!==i||e in t)||Z(t,e,i)}var Q=Math.max;function Y(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function X(t){return null!=t&&Y(t.length)&&!A(t)}var J=Object.prototype;function tt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function et(t){return y(t)&&"[object Arguments]"==w(t)}var it=Object.prototype,nt=it.hasOwnProperty,rt=it.propertyIsEnumerable,st=et(function(){return arguments}())?et:function(t){return y(t)&&nt.call(t,"callee")&&!rt.call(t,"callee")},lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,ot=lt&&"object"==typeof module&&module&&!module.nodeType&&module,at=ot&&ot.exports===lt?d.Buffer:void 0,ct=(at?at.isBuffer:void 0)||function(){return!1},ht={};function ut(t){return function(e){return t(e)}}ht["[object Float32Array]"]=ht["[object Float64Array]"]=ht["[object Int8Array]"]=ht["[object Int16Array]"]=ht["[object Int32Array]"]=ht["[object Uint8Array]"]=ht["[object Uint8ClampedArray]"]=ht["[object Uint16Array]"]=ht["[object Uint32Array]"]=!0,ht["[object Arguments]"]=ht["[object Array]"]=ht["[object ArrayBuffer]"]=ht["[object Boolean]"]=ht["[object DataView]"]=ht["[object Date]"]=ht["[object Error]"]=ht["[object Function]"]=ht["[object Map]"]=ht["[object Number]"]=ht["[object Object]"]=ht["[object RegExp]"]=ht["[object Set]"]=ht["[object String]"]=ht["[object WeakMap]"]=!1;var dt="object"==typeof exports&&exports&&!exports.nodeType&&exports,ft=dt&&"object"==typeof module&&module&&!module.nodeType&&module,pt=ft&&ft.exports===dt&&h.process,qt=function(){try{return ft&&ft.require&&ft.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(t){}}(),bt=qt&&qt.isTypedArray,vt=bt?ut(bt):function(t){return y(t)&&Y(t.length)&&!!ht[w(t)]},mt=Object.prototype.hasOwnProperty;function gt(t,e){var i=k(t),n=!i&&st(t),r=!i&&!n&&ct(t),s=!i&&!n&&!r&&vt(t),l=i||n||r||s,o=l?function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(t.length,String):[],a=o.length;for(var c in t)!e&&!mt.call(t,c)||l&&("length"==c||r&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||U(c,a))||o.push(c);return o}function wt(t,e){return function(i){return t(e(i))}}var yt=wt(Object.keys,Object),kt=Object.prototype.hasOwnProperty;function xt(t){return X(t)?gt(t):function(t){if(!tt(t))return yt(t);var e=[];for(var i in Object(t))kt.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t)}var jt=Object.prototype.hasOwnProperty;function At(t){return X(t)?gt(t,!0):function(t){if(!x(t))return function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}(t);var e=tt(t),i=[];for(var n in t)("constructor"!=n||!e&&jt.call(t,n))&&i.push(n);return i}(t)}var Ot=$(Object,"create"),Mt=Object.prototype.hasOwnProperty,Et=Object.prototype.hasOwnProperty;function Tt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function _t(t,e){for(var i=t.length;i--;)if(K(t[i][0],e))return i;return-1}Tt.prototype.clear=function(){this.__data__=Ot?Ot(null):{},this.size=0},Tt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Tt.prototype.get=function(t){var e=this.__data__;if(Ot){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return Mt.call(e,t)?e[t]:void 0},Tt.prototype.has=function(t){var e=this.__data__;return Ot?void 0!==e[t]:Et.call(e,t)},Tt.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Ot&&void 0===e?"__lodash_hash_undefined__":e,this};var Nt=Array.prototype.splice;function Lt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Lt.prototype.clear=function(){this.__data__=[],this.size=0},Lt.prototype.delete=function(t){var e=this.__data__,i=_t(e,t);return!(i<0||(i==e.length-1?e.pop():Nt.call(e,i,1),--this.size,0))},Lt.prototype.get=function(t){var e=this.__data__,i=_t(e,t);return i<0?void 0:e[i][1]},Lt.prototype.has=function(t){return _t(this.__data__,t)>-1},Lt.prototype.set=function(t,e){var i=this.__data__,n=_t(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};var $t=$(d,"Map");function zt(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function Ct(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=function(){this.size=0,this.__data__={hash:new Tt,map:new($t||Lt),string:new Tt}},Ct.prototype.delete=function(t){var e=zt(this,t).delete(t);return this.size-=e?1:0,e},Ct.prototype.get=function(t){return zt(this,t).get(t)},Ct.prototype.has=function(t){return zt(this,t).has(t)},Ct.prototype.set=function(t,e){var i=zt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};var St=wt(Object.getPrototypeOf,Object),Bt=Function.prototype.toString,Rt=Object.prototype.hasOwnProperty,Ht=Bt.call(Object);function Vt(t){var e=this.__data__=new Lt(t);this.size=e.size}Vt.prototype.clear=function(){this.__data__=new Lt,this.size=0},Vt.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Vt.prototype.get=function(t){return this.__data__.get(t)},Vt.prototype.has=function(t){return this.__data__.has(t)},Vt.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Lt){var n=i.__data__;if(!$t||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Ct(n)}return i.set(t,e),this.size=i.size,this};var Dt="object"==typeof exports&&exports&&!exports.nodeType&&exports,It=Dt&&"object"==typeof module&&module&&!module.nodeType&&module,Pt=It&&It.exports===Dt?d.Buffer:void 0,Ft=Pt?Pt.allocUnsafe:void 0;function Ut(t,e){if(e)return t.slice();var i=t.length,n=Ft?Ft(i):new t.constructor(i);return t.copy(n),n}var Zt=Object.prototype.propertyIsEnumerable,Kt=Object.getOwnPropertySymbols,Wt=Kt?function(t){return null==t?[]:(t=Object(t),function(e){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var l=e[i];Zt.call(t,l)&&(s[r++]=l)}return s}(Kt(t)))}:function(){return[]};function Gt(t){return function(t,e,i){var n=xt(t);return k(t)?n:function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}(n,i(t))}(t,0,Wt)}var Qt=$(d,"DataView"),Yt=$(d,"Promise"),Xt=$(d,"Set"),Jt="[object Map]",te="[object Promise]",ee="[object Set]",ie="[object WeakMap]",ne="[object DataView]",re=_(Qt),se=_($t),le=_(Yt),oe=_(Xt),ae=_(B),ce=w;(Qt&&ce(new Qt(new ArrayBuffer(1)))!=ne||$t&&ce(new $t)!=Jt||Yt&&ce(Yt.resolve())!=te||Xt&&ce(new Xt)!=ee||B&&ce(new B)!=ie)&&(ce=function(t){var e=w(t),i="[object Object]"==e?t.constructor:void 0,n=i?_(i):"";if(n)switch(n){case re:return ne;case se:return Jt;case le:return te;case oe:return ee;case ae:return ie}return e});var he=Object.prototype.hasOwnProperty,ue=d.Uint8Array;function de(t){var e=new t.constructor(t.byteLength);return new ue(e).set(new ue(t)),e}var fe=/\w*$/,pe=f?f.prototype:void 0,qe=pe?pe.valueOf:void 0;function be(t,e){var i=e?de(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function ve(t){return"function"!=typeof t.constructor||tt(t)?{}:H(St(t))}var me=qt&&qt.isMap,ge=me?ut(me):function(t){return y(t)&&"[object Map]"==ce(t)},we=qt&&qt.isSet,ye=we?ut(we):function(t){return y(t)&&"[object Set]"==ce(t)},ke="[object Arguments]",xe="[object Function]",je="[object Object]",Ae={};function Oe(t,e,i,n,r,s){var l,o=1&e;if(void 0!==l)return l;if(!x(t))return t;var a=k(t);if(a)l=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&he.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t);else{var c=ce(t),h=c==xe||"[object GeneratorFunction]"==c;if(ct(t))return Ut(t,o);if(c==je||c==ke||h&&!r)l=h?{}:ve(t);else{if(!Ae[c])return r?t:{};l=function(t,e,i){var n,r,s,l,o=t.constructor;switch(e){case"[object ArrayBuffer]":return de(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return l=de((s=t).buffer),new s.constructor(l,s.byteOffset,s.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return be(t,i);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return(r=new(n=t).constructor(n.source,fe.exec(n))).lastIndex=n.lastIndex,r;case"[object Symbol]":return qe?Object(qe.call(t)):{}}}(t,c,o)}}s||(s=new Vt);var u=s.get(t);if(u)return u;s.set(t,l),ye(t)?t.forEach((function(n){l.add(Oe(n,e,i,0,t,s))})):ge(t)&&t.forEach((function(n,r){l.set(r,Oe(n,e,i,0,t,s))}));var d=a?void 0:Gt(t);return function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i););}(d||t,(function(n,r){d&&(n=t[r=n]),G(l,r,Oe(n,e,i,0,t,s))})),l}function Me(t){return Oe(t,5)}function Ee(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Ct;++e<i;)this.add(t[e])}function Te(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}function _e(t,e,i,n,r,s){var l=1&i,o=t.length,a=e.length;if(o!=a&&!(l&&a>o))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,f=2&i?new Ee:void 0;for(s.set(t,e),s.set(e,t);++u<o;){var p=t[u],q=e[u];if(n)var b=l?n(q,p,u,e,t,s):n(p,q,u,t,e,s);if(void 0!==b){if(b)continue;d=!1;break}if(f){if(!Te(e,(function(t,e){if(!f.has(e)&&(p===t||r(p,t,i,n,s)))return f.push(e)}))){d=!1;break}}else if(p!==q&&!r(p,q,i,n,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function Ne(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function Le(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}Ae[ke]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object DataView]"]=Ae["[object Boolean]"]=Ae["[object Date]"]=Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae[je]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object Symbol]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Error]"]=Ae[xe]=Ae["[object WeakMap]"]=!1,Ee.prototype.add=Ee.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Ee.prototype.has=function(t){return this.__data__.has(t)};var $e=f?f.prototype:void 0,ze=$e?$e.valueOf:void 0,Ce=Object.prototype.hasOwnProperty,Se="[object Arguments]",Be="[object Array]",Re="[object Object]",He=Object.prototype.hasOwnProperty;function Ve(t,e,i,n,r){return t===e||(null==t||null==e||!y(t)&&!y(e)?t!=t&&e!=e:function(t,e,i,n,r,s){var l=k(t),o=k(e),a=l?Be:ce(t),c=o?Be:ce(e),h=(a=a==Se?Re:a)==Re,u=(c=c==Se?Re:c)==Re,d=a==c;if(d&&ct(t)){if(!ct(e))return!1;l=!0,h=!1}if(d&&!h)return s||(s=new Vt),l||vt(t)?_e(t,e,i,n,r,s):function(t,e,i,n,r,s,l){switch(i){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!s(new ue(t),new ue(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return K(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var o=Ne;case"[object Set]":if(o||(o=Le),t.size!=e.size&&!(1&n))return!1;var a=l.get(t);if(a)return a==e;n|=2,l.set(t,e);var c=_e(o(t),o(e),n,r,s,l);return l.delete(t),c;case"[object Symbol]":if(ze)return ze.call(t)==ze.call(e)}return!1}(t,e,a,i,n,r,s);if(!(1&i)){var f=h&&He.call(t,"__wrapped__"),p=u&&He.call(e,"__wrapped__");if(f||p){var q=f?t.value():t,b=p?e.value():e;return s||(s=new Vt),r(q,b,i,n,s)}}return!!d&&(s||(s=new Vt),function(t,e,i,n,r,s){var l=1&i,o=Gt(t),a=o.length;if(a!=Gt(e).length&&!l)return!1;for(var c=a;c--;){var h=o[c];if(!(l?h in e:Ce.call(e,h)))return!1}var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var f=!0;s.set(t,e),s.set(e,t);for(var p=l;++c<a;){var q=t[h=o[c]],b=e[h];if(n)var v=l?n(b,q,h,e,t,s):n(q,b,h,t,e,s);if(!(void 0===v?q===b||r(q,b,i,n,s):v)){f=!1;break}p||(p="constructor"==h)}if(f&&!p){var m=t.constructor,g=e.constructor;m==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof g&&g instanceof g||(f=!1)}return s.delete(t),s.delete(e),f}(t,e,i,n,r,s))}(t,e,i,n,Ve,r))}function De(t,e,i){(void 0!==i&&!K(t[e],i)||void 0===i&&!(e in t))&&Z(t,e,i)}function Ie(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Pe(t,e,i,n,r,s,l){var o=Ie(t,i),a=Ie(e,i),c=l.get(a);if(c)De(t,i,c);else{var h,u=s?s(o,a,i+"",t,e,l):void 0,d=void 0===u;if(d){var f=k(a),p=!f&&ct(a),q=!f&&!p&&vt(a);u=a,f||p||q?k(o)?u=o:y(h=o)&&X(h)?u=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}(o):p?(d=!1,u=Ut(a,!0)):q?(d=!1,u=be(a,!0)):u=[]:function(t){if(!y(t)||"[object Object]"!=w(t))return!1;var e=St(t);if(null===e)return!0;var i=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Bt.call(i)==Ht}(a)||st(a)?(u=o,st(o)?u=function(t){return function(t,e,i){var n=!i;i||(i={});for(var r=-1,s=e.length;++r<s;){var l=e[r],o=void 0;void 0===o&&(o=t[l]),n?Z(i,l,o):G(i,l,o)}return i}(t,At(t))}(o):x(o)&&!A(o)||(u=ve(a))):d=!1}d&&(l.set(a,u),r(u,a,n,s,l),l.delete(a)),De(t,i,u)}}function Fe(t,e,i,n,r){t!==e&&function(t,e,i){for(var n=-1,r=Object(t),s=i(t),l=s.length;l--;){var o=s[++n];if(!1===e(r[o],o,r))break}}(e,(function(s,l){if(r||(r=new Vt),x(s))Pe(t,e,l,i,Fe,n,r);else{var o=n?n(Ie(t,l),s,l+"",t,e,r):void 0;void 0===o&&(o=s),De(t,l,o)}}),At)}function Ue(t,e){return Ve(t,e)}var Ze,Ke=(Ze=function(t,e,i){Fe(t,e,i)},function(t,e){return P(function(t,e,i){return e=Q(void 0===e?t.length-1:e,0),function(){for(var n=arguments,r=-1,s=Q(n.length-e,0),l=Array(s);++r<s;)l[r]=n[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=n[r];return o[e]=i(l),function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}(t,this,o)}}(t,e,j),t+"")}((function(t,e){var i=-1,n=e.length,r=n>1?e[n-1]:void 0,s=n>2?e[2]:void 0;for(r=Ze.length>3&&"function"==typeof r?(n--,r):void 0,s&&function(t,e,i){if(!x(i))return!1;var n=typeof e;return!!("number"==n?X(i)&&U(e,i.length):"string"==n&&e in i)&&K(i[e],t)}(e[0],e[1],s)&&(r=n<3?void 0:r,n=1),t=Object(t);++i<n;){var l=e[i];l&&Ze(t,l,i)}return t}))),We=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(We||{});class Ge{constructor(t,e,i={}){this.attrName=t,this.keyName=e,this.scope=null!=i.scope?i.scope&We.LEVEL|We.TYPE&We.ATTRIBUTE:We.ATTRIBUTE,null!=i.whitelist&&(this.whitelist=i.whitelist)}static keys(t){return Array.from(t.attributes).map((t=>t.name))}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?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 Qe extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}const Ye=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(null==t)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let i=null;try{i=t.parentNode}catch{return null}return this.find(i,e)}return null}create(e,i,n){const r=this.query(i);if(null==r)throw new Qe(`Unable to create ${i} blot`);const s=r,l=i instanceof Node||i.nodeType===Node.TEXT_NODE?i:s.create(n),o=new s(e,l,n);return t.blots.set(o.domNode,o),o}find(e,i=!1){return t.find(e,i)}query(t,e=We.ANY){let i;return"string"==typeof t?i=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?i=this.types.text:"number"==typeof t?t&We.LEVEL&We.BLOCK?i=this.types.block:t&We.LEVEL&We.INLINE&&(i=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some((t=>(i=this.classes[t],!!i))),i=i||this.tags[t.tagName]),null==i?null:"scope"in i&&e&We.LEVEL&i.scope&&e&We.TYPE&i.scope?i:null}register(...t){return t.map((t=>{const e="blotName"in t,i="attrName"in t;if(!e&&!i)throw new Qe("Invalid definition");if(e&&"abstract"===t.blotName)throw new Qe("Cannot register abstract class");return this.types[e?t.blotName:i?t.attrName:void 0]=t,i?"string"==typeof t.keyName&&(this.attributes[t.keyName]=t):e&&(t.className&&(this.classes[t.className]=t),t.tagName&&(t.tagName=Array.isArray(t.tagName)?t.tagName.map((t=>t.toUpperCase())):t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach((e=>{(null==this.tags[e]||null==t.className)&&(this.tags[e]=t)})))),t}))}};Ye.blots=new WeakMap;let Xe=Ye;function Je(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((t=>0===t.indexOf(`${e}-`)))}const ti=class extends Ge{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map((t=>t.split("-").slice(0,-1).join("-")))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){Je(t,this.keyName).forEach((e=>{t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(Je(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function ei(t){const e=t.split("-"),i=e.slice(1).map((t=>t[0].toUpperCase()+t.slice(1))).join("");return e[0]+i}const ii=class extends Ge{static keys(t){return(t.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(t,e){return!!this.canAdd(t,e)&&(t.style[ei(this.keyName)]=e,!0)}remove(t){t.style[ei(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[ei(this.keyName)];return this.canAdd(t,e)?e:""}},ni=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=Xe.find(this.domNode);if(null==t)return;const e=Ge.keys(this.domNode),i=ti.keys(this.domNode),n=ii.keys(this.domNode);e.concat(i).concat(n).forEach((e=>{const i=t.scroll.query(e,We.ATTRIBUTE);i instanceof Ge&&(this.attributes[i.attrName]=i)}))}copy(t){Object.keys(this.attributes).forEach((e=>{const i=this.attributes[e].value(this.domNode);t.format(e,i)}))}move(t){this.copy(t),Object.keys(this.attributes).forEach((t=>{this.attributes[t].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t)),{})}},ri=class{constructor(t,e){this.scroll=t,this.domNode=e,Xe.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new Qe("Blot definition missing tagName");let e,i;return Array.isArray(this.tagName)?("string"==typeof t?(i=t.toUpperCase(),parseInt(i,10).toString()===i&&(i=parseInt(i,10))):"number"==typeof t&&(i=t),e="number"==typeof i?document.createElement(this.tagName[i-1]):i&&this.tagName.indexOf(i)>-1?document.createElement(i):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(){null!=this.parent&&this.parent.removeChild(this),Xe.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,i,n){const r=this.isolate(t,e);if(null!=this.scroll.query(i,We.BLOT)&&n)r.wrap(i,n);else if(null!=this.scroll.query(i,We.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);r.wrap(t),t.format(i,n)}}insertAt(t,e,i){const n=null==i?this.scroll.create("text",e):this.scroll.create(e,i),r=this.split(t);this.parent.insertBefore(n,r||void 0)}isolate(t,e){const i=this.split(t);if(null==i)throw new Error("Attempt to isolate at end");return i.split(e),i}length(){return 1}offset(t=this.parent){return null==this.parent||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(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(i,this.next||void 0),this.remove()),i}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(i,this.next||void 0),"function"!=typeof i.appendChild)throw new Qe(`Cannot wrap ${t}`);return i.appendChild(this),i}};ri.blotName="abstract";let si=ri;const li=class extends si{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 i=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(i+=1),[this.parent.domNode,i]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};li.scope=We.INLINE_BLOT;const oi=li;class ai{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 i=e();for(;i&&t>0;)t-=1,i=e();return i}contains(t){const e=this.iterator();let i=e();for(;i;){if(i===t)return!0;i=e()}return!1}indexOf(t){const e=this.iterator();let i=e(),n=0;for(;i;){if(i===t)return n;n+=1,i=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(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,i=this.head;for(;null!=i;){if(i===t)return e;e+=i.length(),i=i.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(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 null!=t&&(t=t.next),e}}find(t,e=!1){const i=this.iterator();let n=i();for(;n;){const r=n.length();if(t<r||e&&t===r&&(null==n.next||0!==n.next.length()))return[n,t];t-=r,n=i()}return[null,0]}forEach(t){const e=this.iterator();let i=e();for(;i;)t(i),i=e()}forEachAt(t,e,i){if(e<=0)return;const[n,r]=this.find(t);let s=t-r;const l=this.iterator(n);let o=l();for(;o&&s<t+e;){const n=o.length();t>s?i(o,t-s,Math.min(e,s+n-t)):i(o,0,Math.min(n,t+e-s)),s+=n,o=l()}}map(t){return this.reduce(((e,i)=>(e.push(t(i)),e)),[])}reduce(t,e){const i=this.iterator();let n=i();for(;n;)e=t(e,n),n=i();return e}}function ci(t,e){const i=e.find(t);if(i)return i;try{return e.create(t)}catch{const i=e.create(We.INLINE);return Array.from(t.childNodes).forEach((t=>{i.domNode.appendChild(t)})),t.parentNode&&t.parentNode.replaceChild(i.domNode,t),i.attach(),i}}const hi=class t extends si{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(e){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=e,t.uiClass&&this.uiNode.classList.add(t.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new ai,Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode)).reverse().forEach((t=>{try{const e=ci(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof Qe)return;throw t}}))}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,((t,e,i)=>{t.deleteAt(e,i)}))}descendant(e,i=0){const[n,r]=this.children.find(i);return null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e?[n,r]:n instanceof t?n.descendant(e,r):[null,-1]}descendants(e,i=0,n=Number.MAX_VALUE){let r=[],s=n;return this.children.forEachAt(i,n,((i,n,l)=>{(null==e.blotName&&e(i)||null!=e.blotName&&i instanceof e)&&r.push(i),i instanceof t&&(r=r.concat(i.descendants(e,n,s))),s-=l})),r}detach(){this.children.forEach((t=>{t.detach()})),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach((i=>{e||this.statics.allowedChildren.some((t=>i instanceof t))||(i.statics.scope===We.BLOCK_BLOT?(null!=i.next&&this.splitAfter(i),null!=i.prev&&this.splitAfter(i.prev),i.parent.unwrap(),e=!0):i instanceof t?i.unwrap():i.remove())}))}formatAt(t,e,i,n){this.children.forEachAt(t,e,((t,e,r)=>{t.formatAt(e,r,i,n)}))}insertAt(t,e,i){const[n,r]=this.children.find(t);if(n)n.insertAt(r,e,i);else{const t=null==i?this.scroll.create("text",e):this.scroll.create(e,i);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let i=null;this.children.insertBefore(t,e||null),t.parent=this,null!=e&&(i=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==i)&&this.domNode.insertBefore(t.domNode,i),t.attach()}length(){return this.children.reduce(((t,e)=>t+e.length()),0)}moveChildren(t,e){this.children.forEach((i=>{t.insertBefore(i,e)}))}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,i=!1){const[n,r]=this.children.find(e,i),s=[[this,e]];return n instanceof t?s.concat(n.path(r,i)):(null!=n&&s.push([n,r]),s)}removeChild(t){this.children.remove(t)}replaceWith(e,i){const n="string"==typeof e?this.scroll.create(e,i):e;return n instanceof t&&this.moveChildren(n),super.replaceWith(n)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const i=this.clone();return this.parent&&this.parent.insertBefore(i,this.next||void 0),this.children.forEachAt(t,this.length(),((t,n)=>{const r=t.split(n,e);null!=r&&i.appendChild(r)})),i}splitAfter(t){const e=this.clone();for(;null!=t.next;)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 i=[],n=[];t.forEach((t=>{t.target===this.domNode&&"childList"===t.type&&(i.push(...t.addedNodes),n.push(...t.removedNodes))})),n.forEach((t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null==e.domNode.parentNode||e.domNode.parentNode===this.domNode)&&e.detach()})),i.filter((t=>t.parentNode===this.domNode&&t!==this.uiNode)).sort(((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const i=ci(t,this.scroll);(i.next!==e||null==i.next)&&(null!=i.parent&&i.parent.removeChild(this),this.insertBefore(i,e||void 0))})),this.enforceAllowedChildren()}};hi.uiClass="";const ui=hi,di=class t extends ui{static create(t){return super.create(t)}static formats(e,i){const n=i.query(t.blotName);if(null==n||e.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new ni(this.domNode)}format(e,i){if(e!==this.statics.blotName||i){const t=this.scroll.query(e,We.INLINE);if(null==t)return;t instanceof Ge?this.attributes.attribute(t,i):i&&(e!==this.statics.blotName||this.formats()[e]!==i)&&this.replaceWith(e,i)}else this.children.forEach((e=>{e instanceof t||(e=e.wrap(t.blotName,!0)),this.attributes.copy(e)})),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,n){null!=this.formats()[i]||this.scroll.query(i,We.ATTRIBUTE)?this.isolate(t,e).format(i,n):super.formatAt(t,e,i,n)}optimize(e){super.optimize(e);const i=this.formats();if(0===Object.keys(i).length)return this.unwrap();const n=this.next;n instanceof t&&n.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}(i,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some((t=>t.target===this.domNode&&"attributes"===t.type))&&this.attributes.build()}wrap(e,i){const n=super.wrap(e,i);return n instanceof t&&this.attributes.move(n),n}};di.allowedChildren=[di,oi],di.blotName="inline",di.scope=We.INLINE_BLOT,di.tagName="SPAN";const fi=di,pi=class t extends ui{static create(t){return super.create(t)}static formats(e,i){const n=i.query(t.blotName);if(null==n||e.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new ni(this.domNode)}format(e,i){const n=this.scroll.query(e,We.BLOCK);null!=n&&(n instanceof Ge?this.attributes.attribute(n,i):e!==this.statics.blotName||i?i&&(e!==this.statics.blotName||this.formats()[e]!==i)&&this.replaceWith(e,i):this.replaceWith(t.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,n){null!=this.scroll.query(i,We.BLOCK)?this.format(i,n):super.formatAt(t,e,i,n)}insertAt(t,e,i){if(null==i||null!=this.scroll.query(e,We.INLINE))super.insertAt(t,e,i);else{const n=this.split(t);if(null==n)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,i);n.parent.insertBefore(t,n)}}}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some((t=>t.target===this.domNode&&"attributes"===t.type))&&this.attributes.build()}};pi.blotName="block",pi.scope=We.BLOCK_BLOT,pi.tagName="P",pi.allowedChildren=[fi,pi,oi];const qi=pi,bi=class extends ui{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,i,n){super.formatAt(t,e,i,n),this.enforceAllowedChildren()}insertAt(t,e,i){super.insertAt(t,e,i),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};bi.blotName="container",bi.scope=We.BLOCK_BLOT;const vi=bi,mi=class extends oi{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,i,n){0===t&&e===this.length()?this.format(i,n):super.formatAt(t,e,i,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}},gi={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},wi=class extends ui{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver((t=>{this.update(t)})),this.observer.observe(this.domNode,gi),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const i=this.registry.find(t,e);return i?i.scroll===this?i:e?this.find(i.scroll.domNode.parentNode,!0):null:null}query(t,e=We.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach((t=>{t.remove()})):super.deleteAt(t,e)}formatAt(t,e,i,n){this.update(),super.formatAt(t,e,i,n)}insertAt(t,e,i){this.update(),super.insertAt(t,e,i)}optimize(t=[],e={}){super.optimize(e);const i=e.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)t.push(n.pop());const r=(t,e=!0)=>{null==t||t===this||null!=t.domNode.parentNode&&(i.has(t.domNode)||i.set(t.domNode,[]),e&&r(t.parent))},s=t=>{i.has(t.domNode)&&(t instanceof ui&&t.children.forEach(s),i.delete(t.domNode),t.optimize(e))};let l=t;for(let e=0;l.length>0;e+=1){if(e>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach((t=>{const e=this.find(t,!1);r(e,!1),e instanceof ui&&e.children.forEach((t=>{r(t,!1)}))}))):"attributes"===t.type&&r(e.prev)),r(e))})),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),n=l.slice();n.length>0;)t.push(n.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const i=new WeakMap;t.map((t=>{const e=this.find(t.target,!0);return null==e?null:i.has(e.domNode)?(i.get(e.domNode).push(t),null):(i.set(e.domNode,[t]),e)})).forEach((t=>{null!=t&&t!==this&&i.has(t.domNode)&&t.update(i.get(t.domNode)||[],e)})),e.mutationsMap=i,i.has(this.domNode)&&super.update(i.get(this.domNode),e),this.optimize(t,e)}};wi.blotName="scroll",wi.defaultChild=qi,wi.allowedChildren=[qi,vi],wi.scope=We.BLOCK_BLOT,wi.tagName="DIV";const yi=wi,ki=class t extends oi{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,i){null==i?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,i)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&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(0===t)return this;if(t===this.length())return this.next}const i=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(i,this.next||void 0),this.text=this.statics.value(this.domNode),i}update(t,e){t.some((t=>"characterData"===t.type&&t.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};ki.blotName="text",ki.scope=We.INLINE_BLOT;const xi=ki;var ji=Object.freeze({__proto__:null,Attributor:Ge,AttributorStore:ni,BlockBlot:qi,ClassAttributor:ti,ContainerBlot:vi,EmbedBlot:mi,InlineBlot:fi,LeafBlot:oi,ParentBlot:ui,Registry:Xe,Scope:We,ScrollBlot:yi,StyleAttributor:ii,TextBlot:xi}),Ai="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mi,Ei,Ti={exports:{}};var _i,Ni={exports:{}};function Li(){return _i||(_i=1,function(t,e){var i="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",s="[object Boolean]",l="[object Date]",o="[object Function]",a="[object GeneratorFunction]",c="[object Map]",h="[object Number]",u="[object Object]",d="[object Promise]",f="[object RegExp]",p="[object Set]",q="[object String]",b="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",g="[object DataView]",w="[object Float32Array]",y="[object Float64Array]",k="[object Int8Array]",x="[object Int16Array]",j="[object Int32Array]",A="[object Uint8Array]",O="[object Uint8ClampedArray]",M="[object Uint16Array]",E="[object Uint32Array]",T=/\w*$/,_=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,L={};L[r]=L["[object Array]"]=L[m]=L[g]=L[s]=L[l]=L[w]=L[y]=L[k]=L[x]=L[j]=L[c]=L[h]=L[u]=L[f]=L[p]=L[q]=L[b]=L[A]=L[O]=L[M]=L[E]=!0,L["[object Error]"]=L[o]=L[v]=!1;var $="object"==typeof self&&self&&self.Object===Object&&self,z="object"==typeof Ai&&Ai&&Ai.Object===Object&&Ai||$||Function("return this")(),C=e&&!e.nodeType&&e,S=C&&t&&!t.nodeType&&t,B=S&&S.exports===C;function R(t,e){return t.set(e[0],e[1]),t}function H(t,e){return t.add(e),t}function V(t,e,i){for(var n=-1,r=t?t.length:0;++n<r;)i=e(i,t[n],n,t);return i}function D(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function I(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function P(t,e){return function(i){return t(e(i))}}function F(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}var U=Array.prototype,Z=Function.prototype,K=Object.prototype,W=z["__core-js_shared__"],G=function(){var t=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Q=Z.toString,Y=K.hasOwnProperty,X=K.toString,J=RegExp("^"+Q.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=B?z.Buffer:void 0,et=z.Symbol,it=z.Uint8Array,nt=P(Object.getPrototypeOf,Object),rt=Object.create,st=K.propertyIsEnumerable,lt=U.splice,ot=Object.getOwnPropertySymbols,at=tt?tt.isBuffer:void 0,ct=P(Object.keys,Object),ht=$t(z,"DataView"),ut=$t(z,"Map"),dt=$t(z,"Promise"),ft=$t(z,"Set"),pt=$t(z,"WeakMap"),qt=$t(Object,"create"),bt=Rt(ht),vt=Rt(ut),mt=Rt(dt),gt=Rt(ft),wt=Rt(pt),yt=et?et.prototype:void 0,kt=yt?yt.valueOf:void 0;function xt(t){var e=-1,i=t?t.length:0;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function jt(t){var e=-1,i=t?t.length:0;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function At(t){var e=-1,i=t?t.length:0;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Ot(t){this.__data__=new jt(t)}function Mt(t,e,i){var n=t[e];Y.call(t,e)&&Ht(n,i)&&(void 0!==i||e in t)||(t[e]=i)}function Et(t,e){for(var i=t.length;i--;)if(Ht(t[i][0],e))return i;return-1}function Tt(t,e,i,n,d,v,_){var N;if(n&&(N=v?n(t,d,v,_):n(t)),void 0!==N)return N;if(!Ft(t))return t;var $=Vt(t);if($){if(N=function(t){var e=t.length,i=t.constructor(e);return e&&"string"==typeof t[0]&&Y.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t),!e)return function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}(t,N)}else{var z=Ct(t),C=z==o||z==a;if(It(t))return function(t,e){if(e)return t.slice();var i=new t.constructor(t.length);return t.copy(i),i}(t,e);if(z==u||z==r||C&&!v){if(D(t))return v?t:{};if(N=function(t){return"function"!=typeof t.constructor||Bt(t)?{}:Ft(e=nt(t))?rt(e):{};var e}(C?{}:t),!e)return function(t,e){return Nt(t,zt(t),e)}(t,function(t,e){return t&&Nt(e,Ut(e),t)}(N,t))}else{if(!L[z])return v?t:{};N=function(t,e,i,n){var r=t.constructor;switch(e){case m:return _t(t);case s:case l:return new r(+t);case g:return function(t,e){var i=e?_t(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,n);case w:case y:case k:case x:case j:case A:case O:case M:case E:return function(t,e){var i=e?_t(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}(t,n);case c:return function(t,e,i){return V(e?i(I(t),!0):I(t),R,new t.constructor)}(t,n,i);case h:case q:return new r(t);case f:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case p:return function(t,e,i){return V(e?i(F(t),!0):F(t),H,new t.constructor)}(t,n,i);case b:return kt?Object(kt.call(t)):{}}}(t,z,Tt,e)}}_||(_=new Ot);var S=_.get(t);if(S)return S;if(_.set(t,N),!$)var B=i?function(t){return function(t,e,i){var n=e(t);return Vt(t)?n:function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}(n,i(t))}(t,Ut,zt)}(t):Ut(t);return function(t,e){for(var i=-1,n=t?t.length:0;++i<n&&!1!==e(t[i],i););}(B||t,(function(r,s){B&&(r=t[s=r]),Mt(N,s,Tt(r,e,i,n,s,t,_))})),N}function _t(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Nt(t,e,i){i||(i={});for(var n=-1,r=e.length;++n<r;){var s=e[n];Mt(i,s,t[s])}return i}function Lt(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function $t(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Ft(t)||function(t){return!!G&&G in t}(t))&&(Pt(t)||D(t)?J:_).test(Rt(t))}(i)?i:void 0}xt.prototype.clear=function(){this.__data__=qt?qt(null):{}},xt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},xt.prototype.get=function(t){var e=this.__data__;if(qt){var n=e[t];return n===i?void 0:n}return Y.call(e,t)?e[t]:void 0},xt.prototype.has=function(t){var e=this.__data__;return qt?void 0!==e[t]:Y.call(e,t)},xt.prototype.set=function(t,e){return this.__data__[t]=qt&&void 0===e?i:e,this},jt.prototype.clear=function(){this.__data__=[]},jt.prototype.delete=function(t){var e=this.__data__,i=Et(e,t);return!(i<0||(i==e.length-1?e.pop():lt.call(e,i,1),0))},jt.prototype.get=function(t){var e=this.__data__,i=Et(e,t);return i<0?void 0:e[i][1]},jt.prototype.has=function(t){return Et(this.__data__,t)>-1},jt.prototype.set=function(t,e){var i=this.__data__,n=Et(i,t);return n<0?i.push([t,e]):i[n][1]=e,this},At.prototype.clear=function(){this.__data__={hash:new xt,map:new(ut||jt),string:new xt}},At.prototype.delete=function(t){return Lt(this,t).delete(t)},At.prototype.get=function(t){return Lt(this,t).get(t)},At.prototype.has=function(t){return Lt(this,t).has(t)},At.prototype.set=function(t,e){return Lt(this,t).set(t,e),this},Ot.prototype.clear=function(){this.__data__=new jt},Ot.prototype.delete=function(t){return this.__data__.delete(t)},Ot.prototype.get=function(t){return this.__data__.get(t)},Ot.prototype.has=function(t){return this.__data__.has(t)},Ot.prototype.set=function(t,e){var i=this.__data__;if(i instanceof jt){var n=i.__data__;if(!ut||n.length<199)return n.push([t,e]),this;i=this.__data__=new At(n)}return i.set(t,e),this};var zt=ot?P(ot,Object):function(){return[]},Ct=function(t){return X.call(t)};function St(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||N.test(t))&&t>-1&&t%1==0&&t<e}function Bt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||K)}function Rt(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(ht&&Ct(new ht(new ArrayBuffer(1)))!=g||ut&&Ct(new ut)!=c||dt&&Ct(dt.resolve())!=d||ft&&Ct(new ft)!=p||pt&&Ct(new pt)!=v)&&(Ct=function(t){var e=X.call(t),i=e==u?t.constructor:void 0,n=i?Rt(i):void 0;if(n)switch(n){case bt:return g;case vt:return c;case mt:return d;case gt:return p;case wt:return v}return e});var Vt=Array.isArray;function Dt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}(t.length)&&!Pt(t)}var It=at||function(){return!1};function Pt(t){var e=Ft(t)?X.call(t):"";return e==o||e==a}function Ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ut(t){return Dt(t)?function(t){var e=Vt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Dt(t)}(t)&&Y.call(t,"callee")&&(!st.call(t,"callee")||X.call(t)==r)}(t)?function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(t.length,String):[],i=e.length,n=!!i;for(var s in t)!Y.call(t,s)||n&&("length"==s||St(s,i))||e.push(s);return e}(t):function(t){if(!Bt(t))return ct(t);var e=[];for(var i in Object(t))Y.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t)}t.exports=function(t){return Tt(t,!0,!0)}}(Ni,Ni.exports)),Ni.exports}var $i,zi={exports:{}};function Ci(){return $i||($i=1,function(t,e){var i="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",s="[object Array]",l="[object Boolean]",o="[object Date]",a="[object Error]",c="[object Function]",h="[object Map]",u="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",q="[object Set]",b="[object String]",v="[object WeakMap]",m="[object ArrayBuffer]",g="[object DataView]",w=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[r]=k[s]=k[m]=k[l]=k[g]=k[o]=k[a]=k[c]=k[h]=k[u]=k[d]=k[p]=k[q]=k[b]=k[v]=!1;var x="object"==typeof Ai&&Ai&&Ai.Object===Object&&Ai,j="object"==typeof self&&self&&self.Object===Object&&self,A=x||j||Function("return this")(),O=e&&!e.nodeType&&e,M=O&&t&&!t.nodeType&&t,E=M&&M.exports===O,T=E&&x.process,_=function(){try{return T&&T.binding&&T.binding("util")}catch(t){}}(),N=_&&_.isTypedArray;function L(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}function $(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function z(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}var C=Array.prototype,S=Object.prototype,B=A["__core-js_shared__"],R=Function.prototype.toString,H=S.hasOwnProperty,V=function(){var t=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),D=S.toString,I=RegExp("^"+R.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=E?A.Buffer:void 0,F=A.Symbol,U=A.Uint8Array,Z=S.propertyIsEnumerable,K=C.splice,W=F?F.toStringTag:void 0,G=Object.getOwnPropertySymbols,Q=P?P.isBuffer:void 0,Y=function(t,e){return function(i){return t(e(i))}}(Object.keys,Object),X=xt(A,"DataView"),J=xt(A,"Map"),tt=xt(A,"Promise"),et=xt(A,"Set"),it=xt(A,"WeakMap"),nt=xt(Object,"create"),rt=Mt(X),st=Mt(J),lt=Mt(tt),ot=Mt(et),at=Mt(it),ct=F?F.prototype:void 0,ht=ct?ct.valueOf:void 0;function ut(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function dt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function ft(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function pt(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new ft;++e<i;)this.add(t[e])}function qt(t){var e=this.__data__=new dt(t);this.size=e.size}function bt(t,e){for(var i=t.length;i--;)if(Et(t[i][0],e))return i;return-1}function vt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":W&&W in Object(t)?function(t){var e=H.call(t,W),i=t[W];try{t[W]=void 0;var n=!0}catch(t){}var r=D.call(t);return n&&(e?t[W]=i:delete t[W]),r}(t):function(t){return D.call(t)}(t)}function mt(t){return Ct(t)&&vt(t)==r}function gt(t,e,i,n,c){return t===e||(null==t||null==e||!Ct(t)&&!Ct(e)?t!=t&&e!=e:function(t,e,i,n,c,f){var v=_t(t),w=_t(e),y=v?s:At(t),k=w?s:At(e),x=(y=y==r?d:y)==d,j=(k=k==r?d:k)==d,A=y==k;if(A&&Nt(t)){if(!Nt(e))return!1;v=!0,x=!1}if(A&&!x)return f||(f=new qt),v||St(t)?wt(t,e,i,n,c,f):function(t,e,i,n,r,s,c){switch(i){case g:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case m:return!(t.byteLength!=e.byteLength||!s(new U(t),new U(e)));case l:case o:case u:return Et(+t,+e);case a:return t.name==e.name&&t.message==e.message;case p:case b:return t==e+"";case h:var d=$;case q:if(d||(d=z),t.size!=e.size&&!(1&n))return!1;var f=c.get(t);if(f)return f==e;n|=2,c.set(t,e);var v=wt(d(t),d(e),n,r,s,c);return c.delete(t),v;case"[object Symbol]":if(ht)return ht.call(t)==ht.call(e)}return!1}(t,e,y,i,n,c,f);if(!(1&i)){var O=x&&H.call(t,"__wrapped__"),M=j&&H.call(e,"__wrapped__");if(O||M){var E=O?t.value():t,T=M?e.value():e;return f||(f=new qt),c(E,T,i,n,f)}}return!!A&&(f||(f=new qt),function(t,e,i,n,r,s){var l=1&i,o=yt(t),a=o.length;if(a!=yt(e).length&&!l)return!1;for(var c=a;c--;){var h=o[c];if(!(l?h in e:H.call(e,h)))return!1}var u=s.get(t);if(u&&s.get(e))return u==e;var d=!0;s.set(t,e),s.set(e,t);for(var f=l;++c<a;){var p=t[h=o[c]],q=e[h];if(n)var b=l?n(q,p,h,e,t,s):n(p,q,h,t,e,s);if(!(void 0===b?p===q||r(p,q,i,n,s):b)){d=!1;break}f||(f="constructor"==h)}if(d&&!f){var v=t.constructor,m=e.constructor;v==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof m&&m instanceof m||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,i,n,c,f))}(t,e,i,n,gt,c))}function wt(t,e,i,n,r,s){var l=1&i,o=t.length,a=e.length;if(o!=a&&!(l&&a>o))return!1;var c=s.get(t);if(c&&s.get(e))return c==e;var h=-1,u=!0,d=2&i?new pt:void 0;for(s.set(t,e),s.set(e,t);++h<o;){var f=t[h],p=e[h];if(n)var q=l?n(p,f,h,e,t,s):n(f,p,h,t,e,s);if(void 0!==q){if(q)continue;u=!1;break}if(d){if(!L(e,(function(t,e){if(!d.has(e)&&(f===t||r(f,t,i,n,s)))return d.push(e)}))){u=!1;break}}else if(f!==p&&!r(f,p,i,n,s)){u=!1;break}}return s.delete(t),s.delete(e),u}function yt(t){return function(t,e,i){var n=e(t);return _t(t)?n:function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}(n,i(t))}(t,Bt,jt)}function kt(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function xt(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!zt(t)||function(t){return!!V&&V in t}(t))&&(Lt(t)?I:w).test(Mt(t))}(i)?i:void 0}ut.prototype.clear=function(){this.__data__=nt?nt(null):{},this.size=0},ut.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ut.prototype.get=function(t){var e=this.__data__;if(nt){var n=e[t];return n===i?void 0:n}return H.call(e,t)?e[t]:void 0},ut.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:H.call(e,t)},ut.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nt&&void 0===e?i:e,this},dt.prototype.clear=function(){this.__data__=[],this.size=0},dt.prototype.delete=function(t){var e=this.__data__,i=bt(e,t);return!(i<0||(i==e.length-1?e.pop():K.call(e,i,1),--this.size,0))},dt.prototype.get=function(t){var e=this.__data__,i=bt(e,t);return i<0?void 0:e[i][1]},dt.prototype.has=function(t){return bt(this.__data__,t)>-1},dt.prototype.set=function(t,e){var i=this.__data__,n=bt(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},ft.prototype.clear=function(){this.size=0,this.__data__={hash:new ut,map:new(J||dt),string:new ut}},ft.prototype.delete=function(t){var e=kt(this,t).delete(t);return this.size-=e?1:0,e},ft.prototype.get=function(t){return kt(this,t).get(t)},ft.prototype.has=function(t){return kt(this,t).has(t)},ft.prototype.set=function(t,e){var i=kt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},pt.prototype.add=pt.prototype.push=function(t){return this.__data__.set(t,i),this},pt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.clear=function(){this.__data__=new dt,this.size=0},qt.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},qt.prototype.get=function(t){return this.__data__.get(t)},qt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.set=function(t,e){var i=this.__data__;if(i instanceof dt){var n=i.__data__;if(!J||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new ft(n)}return i.set(t,e),this.size=i.size,this};var jt=G?function(t){return null==t?[]:(t=Object(t),function(e){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var l=e[i];Z.call(t,l)&&(s[r++]=l)}return s}(G(t)))}:function(){return[]},At=vt;function Ot(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||y.test(t))&&t>-1&&t%1==0&&t<e}function Mt(t){if(null!=t){try{return R.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Et(t,e){return t===e||t!=t&&e!=e}(X&&At(new X(new ArrayBuffer(1)))!=g||J&&At(new J)!=h||tt&&At(tt.resolve())!=f||et&&At(new et)!=q||it&&At(new it)!=v)&&(At=function(t){var e=vt(t),i=e==d?t.constructor:void 0,n=i?Mt(i):"";if(n)switch(n){case rt:return g;case st:return h;case lt:return f;case ot:return q;case at:return v}return e});var Tt=mt(function(){return arguments}())?mt:function(t){return Ct(t)&&H.call(t,"callee")&&!Z.call(t,"callee")},_t=Array.isArray,Nt=Q||function(){return!1};function Lt(t){if(!zt(t))return!1;var e=vt(t);return e==c||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $t(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function zt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var St=N?function(t){return function(e){return t(e)}}(N):function(t){return Ct(t)&&$t(t.length)&&!!k[vt(t)]};function Bt(t){return null!=(e=t)&&$t(e.length)&&!Lt(e)?function(t){var e=_t(t),i=!e&&Tt(t),n=!e&&!i&&Nt(t),r=!e&&!i&&!n&&St(t),s=e||i||n||r,l=s?function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(t.length,String):[],o=l.length;for(var a in t)!H.call(t,a)||s&&("length"==a||n&&("offset"==a||"parent"==a)||r&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ot(a,o))||l.push(a);return l}(t):function(t){if((e=t)!==("function"==typeof(i=e&&e.constructor)&&i.prototype||S))return Y(t);var e,i,n=[];for(var r in Object(t))H.call(t,r)&&"constructor"!=r&&n.push(r);return n}(t);var e}t.exports=function(t,e){return gt(t,e)}}(zi,zi.exports)),zi.exports}var Si,Bi,Ri={},Hi={};function Vi(){return Bi||(Bi=1,Object.defineProperty(Hi,"__esModule",{value:!0}),function(t){t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"object"==typeof t.retain&&null!==t.retain?1:"string"==typeof t.insert?t.insert.length:1}}(t||(t={})),Hi.default=t),Hi;var t}var Di,Ii,Pi={},Fi=(Ii||(Ii=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const i=function(){if(Ei)return Mi;Ei=1;var t=-1;function e(d,f,p,q,v){if(d===f)return d?[[0,d]]:[];if(null!=p){var m=function(t,e,i){var n="number"==typeof i?{index:i,length:0}:i.oldRange,r="number"==typeof i?null:i.newRange,s=t.length,l=e.length;if(0===n.length&&(null===r||0===r.length)){var o=n.index,a=t.slice(0,o),c=t.slice(o),h=r?r.index:null,u=o+l-s;if((null===h||h===u)&&!(u<0||u>l)){var d=e.slice(0,u);if((q=e.slice(u))===c){var f=Math.min(o,u);if((m=a.slice(0,f))===(w=d.slice(0,f)))return b(m,a.slice(f),d.slice(f),c)}}if(null===h||h===o){var p=o,q=(d=e.slice(0,p),e.slice(p));if(d===a){var v=Math.min(s-p,l-p);if((g=c.slice(c.length-v))===(y=q.slice(q.length-v)))return b(a,c.slice(0,c.length-v),q.slice(0,q.length-v),g)}}}if(n.length>0&&r&&0===r.length){var m=t.slice(0,n.index),g=t.slice(n.index+n.length);if(!(l<(f=m.length)+(v=g.length))){var w=e.slice(0,f),y=e.slice(l-v);if(m===w&&g===y)return b(m,t.slice(f,s-v),e.slice(f,l-v),g)}}return null}(d,f,p);if(m)return m}var g=n(d,f),w=d.substring(0,g);g=s(d=d.substring(g),f=f.substring(g));var y=d.substring(d.length-g),k=function(r,l){var o;if(!r)return[[1,l]];if(!l)return[[t,r]];var a=r.length>l.length?r:l,c=r.length>l.length?l:r,h=a.indexOf(c);if(-1!==h)return o=[[1,a.substring(0,h)],[0,c],[1,a.substring(h+c.length)]],r.length>l.length&&(o[0][0]=o[2][0]=t),o;if(1===c.length)return[[t,r],[1,l]];var u=function(t,e){var i=t.length>e.length?t:e,r=t.length>e.length?e:t;if(i.length<4||2*r.length<i.length)return null;function l(t,e,i){for(var r,l,o,a,c=t.substring(i,i+Math.floor(t.length/4)),h=-1,u="";-1!==(h=e.indexOf(c,h+1));){var d=n(t.substring(i),e.substring(h)),f=s(t.substring(0,i),e.substring(0,h));u.length<f+d&&(u=e.substring(h-f,h)+e.substring(h,h+d),r=t.substring(0,i-f),l=t.substring(i+d),o=e.substring(0,h-f),a=e.substring(h+d))}return 2*u.length>=t.length?[r,l,o,a,u]:null}var o,a,c,h,u,d=l(i,r,Math.ceil(i.length/4)),f=l(i,r,Math.ceil(i.length/2));return d||f?(o=f?d&&d[4].length>f[4].length?d:f:d,t.length>e.length?(a=o[0],c=o[1],h=o[2],u=o[3]):(h=o[0],u=o[1],a=o[2],c=o[3]),[a,c,h,u,o[4]]):null}(r,l);if(u){var d=u[1],f=u[3],p=u[4],q=e(u[0],u[2]),b=e(d,f);return q.concat([[0,p]],b)}return function(e,n){for(var r=e.length,s=n.length,l=Math.ceil((r+s)/2),o=l,a=2*l,c=new Array(a),h=new Array(a),u=0;u<a;u++)c[u]=-1,h[u]=-1;c[o+1]=0,h[o+1]=0;for(var d=r-s,f=d%2!=0,p=0,q=0,b=0,v=0,m=0;m<l;m++){for(var g=-m+p;g<=m-q;g+=2){for(var w=o+g,y=(O=g===-m||g!==m&&c[w-1]<c[w+1]?c[w+1]:c[w-1]+1)-g;O<r&&y<s&&e.charAt(O)===n.charAt(y);)O++,y++;if(c[w]=O,O>r)q+=2;else if(y>s)p+=2;else if(f&&(j=o+d-g)>=0&&j<a&&-1!==h[j]&&O>=(x=r-h[j]))return i(e,n,O,y)}for(var k=-m+b;k<=m-v;k+=2){for(var x,j=o+k,A=(x=k===-m||k!==m&&h[j-1]<h[j+1]?h[j+1]:h[j-1]+1)-k;x<r&&A<s&&e.charAt(r-x-1)===n.charAt(s-A-1);)x++,A++;if(h[j]=x,x>r)v+=2;else if(A>s)b+=2;else if(!f){var O;if((w=o+d-k)>=0&&w<a&&-1!==c[w]&&(y=o+(O=c[w])-w,O>=(x=r-x)))return i(e,n,O,y)}}}return[[t,e],[1,n]]}(r,l)}(d=d.substring(0,d.length-g),f=f.substring(0,f.length-g));return w&&k.unshift([0,w]),y&&k.push([0,y]),u(k,v),q&&function(e){for(var i=!1,n=[],d=0,f=null,p=0,q=0,b=0,v=0,m=0;p<e.length;)0==e[p][0]?(n[d++]=p,q=v,b=m,v=0,m=0,f=e[p][1]):(1==e[p][0]?v+=e[p][1].length:m+=e[p][1].length,f&&f.length<=Math.max(q,b)&&f.length<=Math.max(v,m)&&(e.splice(n[d-1],0,[t,f]),e[n[d-1]+1][0]=1,d--,p=--d>0?n[d-1]:-1,q=0,b=0,v=0,m=0,f=null,i=!0)),p++;for(i&&u(e),function(t){function e(t,e){if(!t||!e)return 6;var i=t.charAt(t.length-1),n=e.charAt(0),r=i.match(l),s=n.match(l),u=r&&i.match(o),d=s&&n.match(o),f=u&&i.match(a),p=d&&n.match(a),q=f&&t.match(c),b=p&&e.match(h);return q||b?5:f||p?4:r&&!u&&d?3:u||d?2:r||s?1:0}for(var i=1;i<t.length-1;){if(0==t[i-1][0]&&0==t[i+1][0]){var n=t[i-1][1],r=t[i][1],u=t[i+1][1],d=s(n,r);if(d){var f=r.substring(r.length-d);n=n.substring(0,n.length-d),r=f+r.substring(0,r.length-d),u=f+u}for(var p=n,q=r,b=u,v=e(n,r)+e(r,u);r.charAt(0)===u.charAt(0);){n+=r.charAt(0),r=r.substring(1)+u.charAt(0),u=u.substring(1);var m=e(n,r)+e(r,u);m>=v&&(v=m,p=n,q=r,b=u)}t[i-1][1]!=p&&(p?t[i-1][1]=p:(t.splice(i-1,1),i--),t[i][1]=q,b?t[i+1][1]=b:(t.splice(i+1,1),i--))}i++}}(e),p=1;p<e.length;){if(e[p-1][0]==t&&1==e[p][0]){var g=e[p-1][1],w=e[p][1],y=r(g,w),k=r(w,g);y>=k?(y>=g.length/2||y>=w.length/2)&&(e.splice(p,0,[0,w.substring(0,y)]),e[p-1][1]=g.substring(0,g.length-y),e[p+1][1]=w.substring(y),p++):(k>=g.length/2||k>=w.length/2)&&(e.splice(p,0,[0,g.substring(0,k)]),e[p-1][0]=1,e[p-1][1]=w.substring(0,w.length-k),e[p+1][0]=t,e[p+1][1]=g.substring(k),p++),p++}p++}}(k),k}function i(t,i,n,r){var s=t.substring(0,n),l=i.substring(0,r),o=t.substring(n),a=i.substring(r),c=e(s,l),h=e(o,a);return c.concat(h)}function n(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var i=0,n=Math.min(t.length,e.length),r=n,s=0;i<r;)t.substring(s,r)==e.substring(s,r)?s=i=r:n=r,r=Math.floor((n-i)/2+i);return d(t.charCodeAt(r-1))&&r--,r}function r(t,e){var i=t.length,n=e.length;if(0==i||0==n)return 0;i>n?t=t.substring(i-n):i<n&&(e=e.substring(0,i));var r=Math.min(i,n);if(t==e)return r;for(var s=0,l=1;;){var o=t.substring(r-l),a=e.indexOf(o);if(-1==a)return s;l+=a,0!=a&&t.substring(r-l)!=e.substring(0,l)||(s=l,l++)}}function s(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var i=0,n=Math.min(t.length,e.length),r=n,s=0;i<r;)t.substring(t.length-r,t.length-s)==e.substring(e.length-r,e.length-s)?s=i=r:n=r,r=Math.floor((n-i)/2+i);return f(t.charCodeAt(t.length-r))&&r--,r}var l=/[^a-zA-Z0-9]/,o=/\s/,a=/[\r\n]/,c=/\n\r?\n$/,h=/^\r?\n\r?\n/;function u(e,i){e.push([0,""]);for(var r,l=0,o=0,a=0,c="",h="";l<e.length;)if(l<e.length-1&&!e[l][1])e.splice(l,1);else switch(e[l][0]){case 1:a++,h+=e[l][1],l++;break;case t:o++,c+=e[l][1],l++;break;case 0:var d=l-a-o-1;if(i){if(d>=0&&q(e[d][1])){var f=e[d][1].slice(-1);if(e[d][1]=e[d][1].slice(0,-1),c=f+c,h=f+h,!e[d][1]){e.splice(d,1),l--;var b=d-1;e[b]&&1===e[b][0]&&(a++,h=e[b][1]+h,b--),e[b]&&e[b][0]===t&&(o++,c=e[b][1]+c,b--),d=b}}p(e[l][1])&&(f=e[l][1].charAt(0),e[l][1]=e[l][1].slice(1),c+=f,h+=f)}if(l<e.length-1&&!e[l][1]){e.splice(l,1);break}if(c.length>0||h.length>0){c.length>0&&h.length>0&&(0!==(r=n(h,c))&&(d>=0?e[d][1]+=h.substring(0,r):(e.splice(0,0,[0,h.substring(0,r)]),l++),h=h.substring(r),c=c.substring(r)),0!==(r=s(h,c))&&(e[l][1]=h.substring(h.length-r)+e[l][1],h=h.substring(0,h.length-r),c=c.substring(0,c.length-r)));var v=a+o;0===c.length&&0===h.length?(e.splice(l-v,v),l-=v):0===c.length?(e.splice(l-v,v,[1,h]),l=l-v+1):0===h.length?(e.splice(l-v,v,[t,c]),l=l-v+1):(e.splice(l-v,v,[t,c],[1,h]),l=l-v+2)}0!==l&&0===e[l-1][0]?(e[l-1][1]+=e[l][1],e.splice(l,1)):l++,a=0,o=0,c="",h=""}""===e[e.length-1][1]&&e.pop();var m=!1;for(l=1;l<e.length-1;)0===e[l-1][0]&&0===e[l+1][0]&&(e[l][1].substring(e[l][1].length-e[l-1][1].length)===e[l-1][1]?(e[l][1]=e[l-1][1]+e[l][1].substring(0,e[l][1].length-e[l-1][1].length),e[l+1][1]=e[l-1][1]+e[l+1][1],e.splice(l-1,1),m=!0):e[l][1].substring(0,e[l+1][1].length)==e[l+1][1]&&(e[l-1][1]+=e[l+1][1],e[l][1]=e[l][1].substring(e[l+1][1].length)+e[l+1][1],e.splice(l+1,1),m=!0)),l++;m&&u(e,i)}function d(t){return t>=55296&&t<=56319}function f(t){return t>=56320&&t<=57343}function p(t){return f(t.charCodeAt(0))}function q(t){return d(t.charCodeAt(t.length-1))}function b(e,i,n,r){return q(e)||p(r)?null:function(t){for(var e=[],i=0;i<t.length;i++)t[i][1].length>0&&e.push(t[i]);return e}([[0,e],[t,i],[1,n],[0,r]])}function v(t,i,n,r){return e(t,i,n,r,!0)}return v.INSERT=1,v.DELETE=t,v.EQUAL=0,Mi=v}(),n=Li(),r=Ci(),s=function(){if(Si)return Ri;Si=1,Object.defineProperty(Ri,"__esModule",{value:!0});const t=Li(),e=Ci();var i;return function(i){i.compose=function(e={},i={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof i&&(i={});let r=t(i);n||(r=Object.keys(r).reduce(((t,e)=>(null!=r[e]&&(t[e]=r[e]),t)),{}));for(const t in e)void 0!==e[t]&&void 0===i[t]&&(r[t]=e[t]);return Object.keys(r).length>0?r:void 0},i.diff=function(t={},i={}){"object"!=typeof t&&(t={}),"object"!=typeof i&&(i={});const n=Object.keys(t).concat(Object.keys(i)).reduce(((n,r)=>(e(t[r],i[r])||(n[r]=void 0===i[r]?null:i[r]),n)),{});return Object.keys(n).length>0?n:void 0},i.invert=function(t={},e={}){t=t||{};const i=Object.keys(e).reduce(((i,n)=>(e[n]!==t[n]&&void 0!==t[n]&&(i[n]=e[n]),i)),{});return Object.keys(t).reduce(((i,n)=>(t[n]!==e[n]&&void 0===e[n]&&(i[n]=null),i)),i)},i.transform=function(t,e,i=!1){if("object"!=typeof t)return e;if("object"!=typeof e)return;if(!i)return e;const n=Object.keys(e).reduce(((i,n)=>(void 0===t[n]&&(i[n]=e[n]),i)),{});return Object.keys(n).length>0?n:void 0}}(i||(i={})),Ri.default=i,Ri}();e.AttributeMap=s.default;const l=Vi();e.Op=l.default;const o=function(){if(Di)return Pi;Di=1,Object.defineProperty(Pi,"__esModule",{value:!0});const t=Vi();return Pi.default=class{constructor(t){this.ops=t,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const i=this.ops[this.index];if(i){const n=this.offset,r=t.default.length(i);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof i.delete)return{delete:e};{const t={};return i.attributes&&(t.attributes=i.attributes),"number"==typeof i.retain?t.retain=e:"object"==typeof i.retain&&null!==i.retain?t.retain=i.retain:t.insert="string"==typeof i.insert?i.insert.substr(n,e):i.insert,t}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const t=this.ops[this.index];return t?"number"==typeof t.delete?"delete":"number"==typeof t.retain||"object"==typeof t.retain&&null!==t.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const t=this.offset,e=this.index,i=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[i].concat(n)}}return[]}},Pi}();e.OpIterator=o.default;const a=String.fromCharCode(0),c=(t,e)=>{if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);const i=Object.keys(t)[0];if(!i||i!==Object.keys(e)[0])throw new Error(`embed types not matched: ${i} != ${Object.keys(e)[0]}`);return[i,t[i],e[i]]};class h{constructor(t){this.ops=Array.isArray(t)?t:null!=t&&Array.isArray(t.ops)?t.ops:[]}static registerEmbed(t,e){this.handlers[t]=e}static unregisterEmbed(t){delete this.handlers[t]}static getHandler(t){const e=this.handlers[t];if(!e)throw new Error(`no handlers for embed type "${t}"`);return e}insert(t,e){const i={};return"string"==typeof t&&0===t.length?this:(i.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i))}delete(t){return t<=0?this:this.push({delete:t})}retain(t,e){if("number"==typeof t&&t<=0)return this;const i={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i)}push(t){let e=this.ops.length,i=this.ops[e-1];if(t=n(t),"object"==typeof i){if("number"==typeof t.delete&&"number"==typeof i.delete)return this.ops[e-1]={delete:i.delete+t.delete},this;if("number"==typeof i.delete&&null!=t.insert&&(e-=1,i=this.ops[e-1],"object"!=typeof i))return this.ops.unshift(t),this;if(r(t.attributes,i.attributes)){if("string"==typeof t.insert&&"string"==typeof i.insert)return this.ops[e-1]={insert:i.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof i.retain)return this.ops[e-1]={retain:i.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this}chop(){const t=this.ops[this.ops.length-1];return t&&"number"==typeof t.retain&&!t.attributes&&this.ops.pop(),this}filter(t){return this.ops.filter(t)}forEach(t){this.ops.forEach(t)}map(t){return this.ops.map(t)}partition(t){const e=[],i=[];return this.forEach((n=>{(t(n)?e:i).push(n)})),[e,i]}reduce(t,e){return this.ops.reduce(t,e)}changeLength(){return this.reduce(((t,e)=>e.insert?t+l.default.length(e):e.delete?t-e.delete:t),0)}length(){return this.reduce(((t,e)=>t+l.default.length(e)),0)}slice(t=0,e=1/0){const i=[],n=new o.default(this.ops);let r=0;for(;r<e&&n.hasNext();){let s;r<t?s=n.next(t-r):(s=n.next(e-r),i.push(s)),r+=l.default.length(s)}return new h(i)}compose(t){const e=new o.default(this.ops),i=new o.default(t.ops),n=[],l=i.peek();if(null!=l&&"number"==typeof l.retain&&null==l.attributes){let t=l.retain;for(;"insert"===e.peekType()&&e.peekLength()<=t;)t-=e.peekLength(),n.push(e.next());l.retain-t>0&&i.next(l.retain-t)}const a=new h(n);for(;e.hasNext()||i.hasNext();)if("insert"===i.peekType())a.push(i.next());else if("delete"===e.peekType())a.push(e.next());else{const t=Math.min(e.peekLength(),i.peekLength()),n=e.next(t),l=i.next(t);if(l.retain){const o={};if("number"==typeof n.retain)o.retain="number"==typeof l.retain?t:l.retain;else if("number"==typeof l.retain)null==n.retain?o.insert=n.insert:o.retain=n.retain;else{const t=null==n.retain?"insert":"retain",[e,i,r]=c(n[t],l.retain),s=h.getHandler(e);o[t]={[e]:s.compose(i,r,"retain"===t)}}const u=s.default.compose(n.attributes,l.attributes,"number"==typeof n.retain);if(u&&(o.attributes=u),a.push(o),!i.hasNext()&&r(a.ops[a.ops.length-1],o)){const t=new h(e.rest());return a.concat(t).chop()}}else"number"==typeof l.delete&&("number"==typeof n.retain||"object"==typeof n.retain&&null!==n.retain)&&a.push(l)}return a.chop()}concat(t){const e=new h(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e}diff(t,e){if(this.ops===t.ops)return new h;const n=[this,t].map((e=>e.map((i=>{if(null!=i.insert)return"string"==typeof i.insert?i.insert:a;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")})).join(""))),l=new h,c=i(n[0],n[1],e,!0),u=new o.default(this.ops),d=new o.default(t.ops);return c.forEach((t=>{let e=t[1].length;for(;e>0;){let n=0;switch(t[0]){case i.INSERT:n=Math.min(d.peekLength(),e),l.push(d.next(n));break;case i.DELETE:n=Math.min(e,u.peekLength()),u.next(n),l.delete(n);break;case i.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),e);const t=u.next(n),o=d.next(n);r(t.insert,o.insert)?l.retain(n,s.default.diff(t.attributes,o.attributes)):l.push(o).delete(n)}e-=n}})),l.chop()}eachLine(t,e="\n"){const i=new o.default(this.ops);let n=new h,r=0;for(;i.hasNext();){if("insert"!==i.peekType())return;const s=i.peek(),o=l.default.length(s)-i.peekLength(),a="string"==typeof s.insert?s.insert.indexOf(e,o)-o:-1;if(a<0)n.push(i.next());else if(a>0)n.push(i.next(a));else{if(!1===t(n,i.next(1).attributes||{},r))return;r+=1,n=new h}}n.length()>0&&t(n,{},r)}invert(t){const e=new h;return this.reduce(((i,n)=>{if(n.insert)e.delete(l.default.length(n));else{if("number"==typeof n.retain&&null==n.attributes)return e.retain(n.retain),i+n.retain;if(n.delete||"number"==typeof n.retain){const r=n.delete||n.retain;return t.slice(i,i+r).forEach((t=>{n.delete?e.push(t):n.retain&&n.attributes&&e.retain(l.default.length(t),s.default.invert(n.attributes,t.attributes))})),i+r}if("object"==typeof n.retain&&null!==n.retain){const r=t.slice(i,i+1),l=new o.default(r.ops).next(),[a,u,d]=c(n.retain,l.insert),f=h.getHandler(a);return e.retain({[a]:f.invert(u,d)},s.default.invert(n.attributes,l.attributes)),i+1}}return i}),0),e.chop()}transform(t,e=!1){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);const i=t,n=new o.default(this.ops),r=new o.default(i.ops),a=new h;for(;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())a.push(r.next());else{const t=Math.min(n.peekLength(),r.peekLength()),i=n.next(t),l=r.next(t);if(i.delete)continue;if(l.delete)a.push(l);else{const n=i.retain,r=l.retain;let o="object"==typeof r&&null!==r?r:t;if("object"==typeof n&&null!==n&&"object"==typeof r&&null!==r){const t=Object.keys(n)[0];if(t===Object.keys(r)[0]){const i=h.getHandler(t);i&&(o={[t]:i.transform(n[t],r[t],e)})}}a.retain(o,s.default.transform(i.attributes,l.attributes,e))}}else a.retain(l.default.length(n.next()));return a.chop()}transformPosition(t,e=!1){e=!!e;const i=new o.default(this.ops);let n=0;for(;i.hasNext()&&n<=t;){const r=i.peekLength(),s=i.peekType();i.next(),"delete"!==s?("insert"===s&&(n<t||!e)&&(t+=r),n+=r):t-=Math.min(r,t-n)}return t}}h.Op=l.default,h.OpIterator=o.default,h.AttributeMap=s.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h}(Ti,Ti.exports)),Ti.exports),Ui=Oi(Fi);class Zi extends mi{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Zi.blotName="break",Zi.tagName="BR";let Ki=class extends xi{};const Wi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Gi(t){return t.replace(/[&<>"']/g,(t=>Wi[t]))}class Qi extends fi{static allowedChildren=[Qi,Zi,mi,Ki];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,e){const i=Qi.order.indexOf(t),n=Qi.order.indexOf(e);return i>=0||n>=0?i-n:t===e?0:t<e?-1:1}formatAt(t,e,i,n){if(Qi.compare(this.statics.blotName,i)<0&&this.scroll.query(i,We.BLOT)){const r=this.isolate(t,e);n&&r.wrap(i,n)}else super.formatAt(t,e,i,n)}optimize(t){if(super.optimize(t),this.parent instanceof Qi&&Qi.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}class Yi extends qi{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=Ji(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,i,n){e<=0||(this.scroll.query(i,We.BLOCK)?t+e===this.length()&&this.format(i,n):super.formatAt(t,Math.min(e,this.length()-t-1),i,n),this.cache={})}insertAt(t,e,i){if(null!=i)return super.insertAt(t,e,i),void(this.cache={});if(0===e.length)return;const n=e.split("\n"),r=n.shift();r.length>0&&(t<this.length()-1||null==this.children.tail?super.insertAt(Math.min(t,this.length()-1),r):this.children.tail.insertAt(this.children.tail.length(),r),this.cache={});let s=this;n.reduce(((t,e)=>(s=s.split(t,!0),s.insertAt(0,e),e.length)),t+r.length)}insertBefore(t,e){const{head:i}=this.children;super.insertBefore(t,e),i instanceof Zi&&i.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(t,e){super.moveChildren(t,e),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-1)){const e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}const i=super.split(t,e);return this.cache={},i}}Yi.blotName="block",Yi.tagName="P",Yi.defaultChild=Zi,Yi.allowedChildren=[Zi,Qi,mi,Ki];class Xi extends mi{attach(){super.attach(),this.attributes=new ni(this.domNode)}delta(){return(new Ui).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const i=this.scroll.query(t,We.BLOCK_ATTRIBUTE);null!=i&&this.attributes.attribute(i,e)}formatAt(t,e,i,n){this.format(i,n)}insertAt(t,e,i){if(null!=i)return void super.insertAt(t,e,i);const n=e.split("\n"),r=n.pop(),s=n.map((t=>{const e=this.scroll.create(Yi.blotName);return e.insertAt(0,t),e})),l=this.split(t);s.forEach((t=>{this.parent.insertBefore(t,l)})),r&&this.parent.insertBefore(this.scroll.create("text",r),l)}}function Ji(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.descendants(oi).reduce(((t,i)=>0===i.length()?t:t.insert(i.value(),tn(i,{},e))),new Ui).insert("\n",tn(t))}function tn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==t?e:("formats"in t&&"function"==typeof t.formats&&(e={...e,...t.formats()},i&&delete e["code-token"]),null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:tn(t.parent,e,i))}Xi.scope=We.BLOCK_BLOT;class en extends mi{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(t,e,i){super(t,e),this.selection=i,this.textNode=document.createTextNode(en.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,e){if(0!==this.savedLength)return void super.format(t,e);let i=this,n=0;for(;null!=i&&i.statics.scope!==We.BLOCK_BLOT;)n+=i.offset(i.parent),i=i.parent;null!=i&&(this.savedLength=en.CONTENTS.length,i.optimize(),i.formatAt(n,en.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||null==this.parent)return null;const t=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof Ki?this.prev:null,i=e?e.length():0,n=this.next instanceof Ki?this.next:null,r=n?n.text:"",{textNode:s}=this,l=s.data.split(en.CONTENTS).join("");let o;if(s.data=en.CONTENTS,e)o=e,(l||n)&&(e.insertAt(e.length(),l+r),n&&n.remove());else if(n)o=n,n.insertAt(0,l);else{const t=document.createTextNode(l);o=this.scroll.create(t),this.parent.insertBefore(o,this)}if(this.remove(),t){const r=(t,r)=>e&&t===e.domNode?r:t===s?i+r-1:n&&t===n.domNode?i+l.length+r:null,a=r(t.start.node,t.start.offset),c=r(t.end.node,t.end.offset);if(null!==a&&null!==c)return{startNode:o.domNode,startOffset:a,endNode:o.domNode,endOffset:c}}return null}update(t,e){if(t.some((t=>"characterData"===t.type&&t.target===this.textNode))){const t=this.restore();t&&(e.range=t)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if("A"===e.domNode.tagName){this.savedLength=en.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}}var nn,rn={exports:{}},sn=(nn||(nn=1,function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,l){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,l),a=i?i+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=this._events[i?i+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,s=new Array(r);n<r;n++)s[n]=e[n].fn;return s},o.prototype.listenerCount=function(t){var e=this._events[i?i+t:t];return e?e.fn?1:e.length:0},o.prototype.emit=function(t,e,n,r,s,l){var o=i?i+t:t;if(!this._events[o])return!1;var a,c,h=this._events[o],u=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),u){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,n),!0;case 4:return h.fn.call(h.context,e,n,r),!0;case 5:return h.fn.call(h.context,e,n,r,s),!0;case 6:return h.fn.call(h.context,e,n,r,s,l),!0}for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];h.fn.apply(h.context,a)}else{var d,f=h.length;for(c=0;c<f;c++)switch(h[c].once&&this.removeListener(t,h[c].fn,void 0,!0),u){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,e);break;case 3:h[c].fn.call(h[c].context,e,n);break;case 4:h[c].fn.call(h[c].context,e,n,r);break;default:if(!a)for(d=1,a=new Array(u-1);d<u;d++)a[d-1]=arguments[d];h[c].fn.apply(h[c].context,a)}}return!0},o.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return l(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||l(this,s);else{for(var a=0,c=[],h=o.length;a<h;a++)(o[a].fn!==e||r&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=1===c.length?c[0]:c:l(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?this._events[e=i?i+t:t]&&l(this,e):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(rn)),rn.exports),ln=Oi(sn),on=new WeakMap;const an=["error","warn","log","info"];let cn="warn";function hn(t){if(cn&&an.indexOf(t)<=an.indexOf(cn)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];console[t](...i)}}function un(t){return an.reduce(((e,i)=>(e[i]=hn.bind(console,i,t),e)),{})}hn.level=un.level=t=>{cn=t};const dn=un("quill:events");["selectionchange","mousedown","mouseup","click"].forEach((t=>{document.addEventListener(t,(function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Array.from(document.querySelectorAll(".ql-container")).forEach((t=>{const i=on.get(t);i&&i.emitter&&i.emitter.handleDOM(...e)}))}))}));class fn extends ln{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",dn.error)}emit(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return dn.log.call(dn,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(this.domListeners[t.type]||[]).forEach((e=>{let{node:n,handler:r}=e;(t.target===n||n.contains(t.target))&&r(t,...i)}))}listenDOM(t,e,i){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:i})}}const pn=un("quill:selection");class qn{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class bn{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 qn(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,fn.sources.USER),1)})),this.emitter.on(fn.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const t=this.getNativeRange();null!=t&&t.start.node!==this.cursor.textNode&&this.emitter.once(fn.events.SCROLL_UPDATE,((e,i)=>{try{this.root.contains(t.start.node)&&this.root.contains(t.end.node)&&this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset);const n=i.some((t=>"characterData"===t.type||"childList"===t.type||"attributes"===t.type&&t.target===this.root));this.update(n?fn.sources.SILENT:e)}catch(t){}}))})),this.emitter.on(fn.events.SCROLL_OPTIMIZE,((t,e)=>{if(e.range){const{startNode:t,startOffset:i,endNode:n,endOffset:r}=e.range;this.setNativeRange(t,i,n,r),this.update(fn.sources.SILENT)}})),this.update(fn.sources.SILENT)}handleComposition(){this.emitter.on(fn.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(fn.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(fn.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const i=this.getNativeRange();if(null!=i&&i.native.collapsed&&!this.scroll.query(t,We.BLOCK)){if(i.start.node!==this.cursor.textNode){const t=this.scroll.find(i.start.node,!1);if(null==t)return;if(t instanceof oi){const e=t.split(i.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,i.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&&void 0!==arguments[1]?arguments[1]:0;const i=this.scroll.length();let n;t=Math.min(t,i-1),e=Math.min(t+e,i-1)-t;let[r,s]=this.scroll.leaf(t);if(null==r)return null;if(e>0&&s===r.length()){const[e]=this.scroll.leaf(t+1);if(e){const[i]=this.scroll.line(t),[n]=this.scroll.line(t+1);i===n&&(r=e,s=0)}}[n,s]=r.position(s,!0);const l=document.createRange();if(e>0)return l.setStart(n,s),[r,s]=this.scroll.leaf(t+e),null==r?null:([n,s]=r.position(s,!0),l.setEnd(n,s),l.getBoundingClientRect());let o,a="left";if(n instanceof Text){if(!n.data.length)return null;s<n.data.length?(l.setStart(n,s),l.setEnd(n,s+1)):(l.setStart(n,s-1),l.setEnd(n,s),a="right"),o=l.getBoundingClientRect()}else{if(!(r.domNode instanceof Element))return null;o=r.domNode.getBoundingClientRect(),s>0&&(a="right")}return{bottom:o.top+o.height,height:o.height,left:o[a],right:o[a],top:o.top,width:0}}getNativeRange(){const t=document.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;const i=this.normalizeNative(e);return pn.info("getNativeRange",i),i}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&vn(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 i=e.map((t=>{const[e,i]=t,n=this.scroll.find(e,!0),r=n.offset(this.scroll);return 0===i?r:n instanceof oi?r+n.index(e,i):r+n.length()})),n=Math.min(Math.max(...i),this.scroll.length()-1),r=Math.min(n,...i);return new qn(r,n-r)}normalizeNative(t){if(!vn(this.root,t.startContainer)||!t.collapsed&&!vn(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((t=>{let{node:e,offset:i}=t;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>i)e=e.childNodes[i],i=0;else{if(e.childNodes.length!==i)break;e=e.lastChild,i=e instanceof Text?e.data.length:e.childNodes.length>0?e.childNodes.length:e.childNodes.length+1}t.node=e,t.offset=i})),e}rangeToNative(t){const e=this.scroll.length(),i=(t,i)=>{t=Math.min(e-1,t);const[n,r]=this.scroll.leaf(t);return n?n.position(r,i):[null,-1]};return[...i(t.index,!1),...i(t.index+t.length,!0)]}setNativeRange(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(pn.info("setNativeRange",t,e,i,n),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==i.parentNode))return;const s=document.getSelection();if(null!=s)if(null!=t){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:l}=this.getNativeRange()||{};if(null==l||r||t!==l.startContainer||e!==l.startOffset||i!==l.endContainer||n!==l.endOffset){t instanceof Element&&"BR"===t.tagName&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),i instanceof Element&&"BR"===i.tagName&&(n=Array.from(i.parentNode.childNodes).indexOf(i),i=i.parentNode);const r=document.createRange();r.setStart(t,e),r.setEnd(i,n),s.removeAllRanges(),s.addRange(r)}}else s.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fn.sources.API;if("string"==typeof e&&(i=e,e=!1),pn.info("setRange",t),null!=t){const i=this.rangeToNative(t);this.setNativeRange(...i,e)}else this.setNativeRange(null);this.update(i)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fn.sources.USER;const e=this.lastRange,[i,n]=this.getRange();if(this.lastRange=i,this.lastNative=n,null!=this.lastRange&&(this.savedRange=this.lastRange),!Ue(e,this.lastRange)){if(!this.composing&&null!=n&&n.native.collapsed&&n.start.node!==this.cursor.textNode){const t=this.cursor.restore();t&&this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}const i=[fn.events.SELECTION_CHANGE,Me(this.lastRange),Me(e),t];this.emitter.emit(fn.events.EDITOR_CHANGE,...i),t!==fn.sources.SILENT&&this.emitter.emit(...i)}}}function vn(t,e){return t.contains(e)}const mn=/^[ -~]*$/;class gn{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const i=jn(t),n=new Ui;return function(t){const e=[];return t.forEach((t=>{"string"==typeof t.insert?t.insert.split("\n").forEach(((i,n)=>{n&&e.push({insert:"\n",attributes:t.attributes}),i&&e.push({insert:i,attributes:t.attributes})})):e.push(t)})),e}(i.ops.slice()).reduce(((t,i)=>{const r=Fi.Op.length(i);let s=i.attributes||{},l=!1,o=!1;if(null!=i.insert){if(n.retain(r),"string"==typeof i.insert){const n=i.insert;o=!n.endsWith("\n")&&(e<=t||!!this.scroll.descendant(Xi,t)[0]),this.scroll.insertAt(t,n);const[r,l]=this.scroll.line(t);let a=Ke({},tn(r));if(r instanceof Yi){const[t]=r.descendant(oi,l);t&&(a=Ke(a,tn(t)))}s=Fi.AttributeMap.diff(a,s)||{}}else if("object"==typeof i.insert){const n=Object.keys(i.insert)[0];if(null==n)return t;const r=null!=this.scroll.query(n,We.INLINE);if(r)(e<=t||this.scroll.descendant(Xi,t)[0])&&(o=!0);else if(t>0){const[e,i]=this.scroll.descendant(oi,t-1);e instanceof Ki?"\n"!==e.value()[i]&&(l=!0):e instanceof mi&&e.statics.scope===We.INLINE_BLOT&&(l=!0)}if(this.scroll.insertAt(t,n,i.insert[n]),r){const[e]=this.scroll.descendant(oi,t);if(e){const t=Ke({},tn(e));s=Fi.AttributeMap.diff(t,s)||{}}}}e+=r}else if(n.push(i),null!==i.retain&&"object"==typeof i.retain){const e=Object.keys(i.retain)[0];if(null==e)return t;this.scroll.updateEmbedAt(t,e,i.retain[e])}Object.keys(s).forEach((e=>{this.scroll.formatAt(t,r,e,s[e])}));const a=l?1:0,c=o?1:0;return e+=a+c,n.retain(a),n.delete(c),t+r+a+c}),0),n.reduce(((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+Fi.Op.length(e)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(i)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new Ui).retain(t).delete(e))}formatLine(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(i).forEach((n=>{this.scroll.lines(t,Math.max(e,1)).forEach((t=>{t.format(n,i[n])}))})),this.scroll.optimize();const n=(new Ui).retain(t).retain(e,Me(i));return this.update(n)}formatText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(i).forEach((n=>{this.scroll.formatAt(t,e,n,i[n])}));const n=(new Ui).retain(t).retain(e,Me(i));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 Ui)}getFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],n=[];0===e?this.scroll.path(t).forEach((t=>{const[e]=t;e instanceof Yi?i.push(e):e instanceof oi&&n.push(e)})):(i=this.scroll.lines(t,e),n=this.scroll.descendants(oi,t,e));const[r,s]=[i,n].map((t=>{const e=t.shift();if(null==e)return{};let i=tn(e);for(;Object.keys(i).length>0;){const e=t.shift();if(null==e)return i;i=kn(tn(e),i)}return i}));return{...r,...s}}getHTML(t,e){const[i,n]=this.scroll.line(t);if(i){const r=i.length();return i.length()>=n+e&&(0!==n||e!==r)?yn(i,n,e,!0):yn(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter((t=>"string"==typeof t.insert)).map((t=>t.insert)).join("")}insertContents(t,e){const i=jn(e),n=(new Ui).retain(t).concat(i);return this.scroll.insertContents(t,i),this.update(n)}insertEmbed(t,e,i){return this.scroll.insertAt(t,e,i),this.update((new Ui).retain(t).insert({[e]:i}))}insertText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(i).forEach((n=>{this.scroll.formatAt(t,e.length,n,i[n])})),this.update((new Ui).retain(t).insert(e,Me(i)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;return t?.statics.blotName===Yi.blotName&&(!(t.children.length>1)&&t.children.head instanceof Zi)}removeFormat(t,e){const i=this.getText(t,e),[n,r]=this.scroll.line(t+e);let s=0,l=new Ui;null!=n&&(s=n.length()-r,l=n.delta().slice(r,r+s-1).insert("\n"));const o=this.getContents(t,e+s).diff((new Ui).insert(i).concat(l)),a=(new Ui).retain(t).concat(o);return this.applyDelta(a)}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(mn)&&this.scroll.find(e[0].target)){const r=this.scroll.find(e[0].target),s=tn(r),l=r.offset(this.scroll),o=e[0].oldValue.replace(en.CONTENTS,""),a=(new Ui).insert(o),c=(new Ui).insert(r.value()),h=i&&{oldRange:An(i.oldRange,-l),newRange:An(i.newRange,-l)};t=(new Ui).retain(l).concat(a.diff(c,h)).reduce(((t,e)=>e.insert?t.insert(e.insert,s):t.push(e)),new Ui),this.delta=n.compose(t)}else this.delta=this.getDelta(),t&&Ue(n.compose(t),this.delta)||(t=n.diff(this.delta,i));return t}}function wn(t,e,i){if(0===t.length){const[t]=xn(i.pop());return e<=0?`</li></${t}>`:`</li></${t}>${wn([],e-1,i)}`}const[{child:n,offset:r,length:s,indent:l,type:o},...a]=t,[c,h]=xn(o);if(l>e)return i.push(o),l===e+1?`<${c}><li${h}>${yn(n,r,s)}${wn(a,l,i)}`:`<${c}><li>${wn(t,e+1,i)}`;if(l===e&&o===i[i.length-1])return`</li><li${h}>${yn(n,r,s)}${wn(a,l,i)}`;const[u]=xn(i.pop());return`</li></${u}>${wn(t,e-1,i)}`}function yn(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in t&&"function"==typeof t.html)return t.html(e,i);if(t instanceof Ki)return Gi(t.value().slice(e,e+i)).replaceAll(" ","&nbsp;");if(t instanceof ui){if("list-container"===t.statics.blotName){const n=[];return t.children.forEachAt(e,i,((t,e,i)=>{const r="formats"in t&&"function"==typeof t.formats?t.formats():{};n.push({child:t,offset:e,length:i,indent:r.indent||0,type:r.list})})),wn(n,-1,[])}const r=[];if(t.children.forEachAt(e,i,((t,e,i)=>{r.push(yn(t,e,i))})),n||"list"===t.statics.blotName)return r.join("");const{outerHTML:s,innerHTML:l}=t.domNode,[o,a]=s.split(`>${l}<`);return"<table"===o?`<table style="border: 1px solid #000;">${r.join("")}<${a}`:`${o}>${r.join("")}<${a}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function kn(t,e){return Object.keys(e).reduce(((i,n)=>{if(null==t[n])return i;const r=e[n];return i[n]=r===t[n]?r:Array.isArray(r)?r.indexOf(t[n])<0?r.concat([t[n]]):r:[r,t[n]],i}),{})}function xn(t){const e="ordered"===t?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function jn(t){return t.reduce(((t,e)=>{if("string"==typeof e.insert){const i=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(i,e.attributes)}return t.push(e)}),new Ui)}function An(t,e){let{index:i,length:n}=t;return new qn(i+e,n)}class On{static DEFAULTS={};constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}const Mn="\ufeff";class En extends mi{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((t=>{this.contentNode.appendChild(t)})),this.leftGuard=document.createTextNode(Mn),this.rightGuard=document.createTextNode(Mn),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,i=null;const n=t.data.split(Mn).join("");if(t===this.leftGuard)if(this.prev instanceof Ki){const t=this.prev.length();this.prev.insertAt(t,n),i={startNode:this.prev.domNode,startOffset:t+n.length}}else e=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(e),this),i={startNode:e,startOffset:n.length};else t===this.rightGuard&&(this.next instanceof Ki?(this.next.insertAt(0,n),i={startNode:this.next.domNode,startOffset:n.length}):(e=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(e),this.next),i={startNode:e,startOffset:n.length}));return t.data=Mn,i}update(t,e){t.forEach((t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){const i=this.restore(t.target);i&&(e.range=i)}}))}}class Tn{isComposing=!1;constructor(t,e){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 En||(this.emitter.emit(fn.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(fn.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(fn.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(fn.events.COMPOSITION_END,t),this.isComposing=!1}}class _n{static DEFAULTS={modules:{}};static themes={default:_n};modules={};constructor(t,e){this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach((t=>{null==this.modules[t]&&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]}}const Nn=t=>{const e=t.getBoundingClientRect(),i="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,n="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*i,bottom:e.top+t.clientHeight*n,left:e.left}},Ln=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},$n=(t,e,i,n,r,s)=>t<i&&e>n?0:t<i?-(i-t+r):e>n?e-t>n-i?t+r-i:e-n+s:0,zn=["block","break","cursor","inline","scroll","text"],Cn=un("quill"),Sn=new Xe;ui.uiClass="ql-ui";class Bn{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Sn,theme:"default"};static events=fn.events;static sources=fn.sources;static version="2.0.3";static imports={delta:Ui,parchment:ji,"core/module":On,"core/theme":_n};static debug(t){!0===t&&(t="log"),un.level(t)}static find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return on.get(t)||Sn.find(t,e)}static import(t){return null==this.imports[t]&&Cn.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const t=arguments.length<=0?void 0:arguments[0],e=!!(arguments.length<=1?void 0:arguments[1]),i="attrName"in t?t.attrName:t.blotName;"string"==typeof i?this.register(`formats/${i}`,t,e):Object.keys(t).forEach((i=>{this.register(i,t[i],e)}))}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1];null==this.imports[t]||!!(arguments.length<=2?void 0:arguments[2])||Cn.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&"boolean"!=typeof e&&"abstract"!==e.blotName&&Sn.register(e),"function"==typeof e.register&&e.register(Sn)}}constructor(t){if(this.options=function(t,e){const i=Rn(t);if(!i)throw new Error("Invalid Quill container");const n=!e.theme||e.theme===Bn.DEFAULTS.theme?_n:Bn.import(`themes/${e.theme}`);if(!n)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:r,...s}=Bn.DEFAULTS,{modules:l,...o}=n.DEFAULTS;let a=Hn(e.modules);null!=a&&a.toolbar&&a.toolbar.constructor!==Object&&(a={...a,toolbar:{container:a.toolbar}});const c=Ke({},Hn(r),Hn(l),a),h={...s,...Vn(o),...Vn(e)};let u=e.registry;return u?e.formats&&Cn.warn('Ignoring "formats" option because "registry" is specified'):u=e.formats?((t,e,i)=>{const n=new Xe;return zn.forEach((t=>{const i=e.query(t);i&&n.register(i)})),t.forEach((t=>{let r=e.query(t);r||i.error(`Cannot register "${t}" specified in "formats" config. Are you sure it was registered?`);let s=0;for(;r;)if(n.register(r),r="blotName"in r?r.requiredContainer??null:null,s+=1,s>100){i.error(`Cycle detected in registering blot requiredContainer: "${t}"`);break}})),n})(e.formats,h.registry,Cn):h.registry,{...h,registry:u,container:i,theme:n,modules:Object.entries(c).reduce(((t,e)=>{let[i,n]=e;if(!n)return t;const r=Bn.import(`modules/${i}`);return null==r?(Cn.error(`Cannot load ${i} module. Are you sure you registered it?`),t):{...t,[i]:Ke({},r.DEFAULTS||{},n)}}),{}),bounds:Rn(h.bounds)}}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.container=this.options.container,null==this.container)return void Cn.error("Invalid Quill container",t);this.options.debug&&Bn.debug(this.options.debug);const e=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",on.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new fn;const i=yi.blotName,n=this.options.registry.query(i);if(!n||!("blotName"in n))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new n(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new gn(this.scroll),this.selection=new bn(this.scroll,this.emitter),this.composition=new Tn(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(fn.events.EDITOR_CHANGE,(t=>{t===fn.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(fn.events.SCROLL_UPDATE,((t,e)=>{const i=this.selection.lastRange,[n]=this.selection.getRange(),r=i&&n?{oldRange:i,newRange:n}:void 0;Dn.call(this,(()=>this.editor.update(null,e,r)),t)})),this.emitter.on(fn.events.SCROLL_EMBED_UPDATE,((t,e)=>{const i=this.selection.lastRange,[n]=this.selection.getRange(),r=i&&n?{oldRange:i,newRange:n}:void 0;Dn.call(this,(()=>{const i=(new Ui).retain(t.offset(this)).retain({[t.statics.blotName]:e});return this.editor.update(i,[],r)}),Bn.sources.USER)})),e){const t=this.clipboard.convert({html:`${e}<p><br></p>`,text:"\n"});this.setContents(t)}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&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){const e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,i){return[t,e,,i]=In(t,e,i),Dn.call(this,(()=>this.editor.deleteText(t,e)),i,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&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){return Dn.call(this,(()=>{const i=this.getSelection(!0);let n=new Ui;if(null==i)return n;if(this.scroll.query(t,We.BLOCK))n=this.editor.formatLine(i.index,i.length,{[t]:e});else{if(0===i.length)return this.selection.format(t,e),n;n=this.editor.formatText(i.index,i.length,{[t]:e})}return this.setSelection(i,fn.sources.SILENT),n}),arguments.length>2&&void 0!==arguments[2]?arguments[2]:fn.sources.API)}formatLine(t,e,i,n,r){let s;return[t,e,s,r]=In(t,e,i,n,r),Dn.call(this,(()=>this.editor.formatLine(t,e,s)),r,t,0)}formatText(t,e,i,n,r){let s;return[t,e,s,r]=In(t,e,i,n,r),Dn.call(this,(()=>this.editor.formatText(t,e,s)),r,t,0)}getBounds(t){let e=null;if(e="number"==typeof t?this.selection.getBounds(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0):this.selection.getBounds(t.index,t.length),!e)return null;const i=this.container.getBoundingClientRect();return{bottom:e.bottom-i.top,height:e.height,left:e.left-i.left,right:e.right-i.left,top:e.top-i.top,width:e.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=In(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0);return"number"==typeof t?this.editor.getFormat(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0):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&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=e??this.getLength()-t),[t,e]=In(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=e??this.getLength()-t),[t,e]=In(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,i){return Dn.call(this,(()=>this.editor.insertEmbed(t,e,i)),arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bn.sources.API,t)}insertText(t,e,i,n,r){let s;return[t,,s,r]=In(t,0,i,n,r),Dn.call(this,(()=>this.editor.insertText(t,e,s)),r,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,i){return[t,e,,i]=In(t,e,i),Dn.call(this,(()=>this.editor.removeFormat(t,e)),i,t)}scrollRectIntoView(t){((t,e)=>{const i=t.ownerDocument;let n=e,r=t;for(;r;){const t=r===i.body,e=t?{top:0,right:window.visualViewport?.width??i.documentElement.clientWidth,bottom:window.visualViewport?.height??i.documentElement.clientHeight,left:0}:Nn(r),l=getComputedStyle(r),o=$n(n.left,n.right,e.left,e.right,Ln(l.scrollPaddingLeft),Ln(l.scrollPaddingRight)),a=$n(n.top,n.bottom,e.top,e.bottom,Ln(l.scrollPaddingTop),Ln(l.scrollPaddingBottom));if(o||a)if(t)i.defaultView?.scrollBy(o,a);else{const{scrollLeft:t,scrollTop:e}=r;a&&(r.scrollTop+=a),o&&(r.scrollLeft+=o);const i=r.scrollLeft-t,s=r.scrollTop-e;n={left:n.left-i,top:n.top-s,right:n.right-i,bottom:n.bottom-s}}r=t||"fixed"===l.position?null:(s=r).parentElement||s.getRootNode().host||null}var s})(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){return Dn.call(this,(()=>{t=new Ui(t);const e=this.getLength(),i=this.editor.deleteText(0,e),n=this.editor.insertContents(0,t),r=this.editor.deleteText(this.getLength()-1,1);return i.compose(n).compose(r)}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn.sources.API)}setSelection(t,e,i){null==t?this.selection.setRange(null,e||Bn.sources.API):([t,e,,i]=In(t,e,i),this.selection.setRange(new qn(Math.max(0,t),e),i),i!==fn.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn.sources.API;const i=(new Ui).insert(t);return this.setContents(i,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fn.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){return Dn.call(this,(()=>(t=new Ui(t),this.editor.applyDelta(t))),arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn.sources.API,!0)}}function Rn(t){return"string"==typeof t?document.querySelector(t):t}function Hn(t){return Object.entries(t??{}).reduce(((t,e)=>{let[i,n]=e;return{...t,[i]:!0===n?{}:n}}),{})}function Vn(t){return Object.fromEntries(Object.entries(t).filter((t=>void 0!==t[1])))}function Dn(t,e,i,n){if(!this.isEnabled()&&e===fn.sources.USER&&!this.allowReadOnlyEdits)return new Ui;let r=null==i?null:this.getSelection();const s=this.editor.delta,l=t();if(null!=r&&(!0===i&&(i=r.index),null==n?r=Pn(r,l,e):0!==n&&(r=Pn(r,i,n,e)),this.setSelection(r,fn.sources.SILENT)),l.length()>0){const t=[fn.events.TEXT_CHANGE,l,s,e];this.emitter.emit(fn.events.EDITOR_CHANGE,...t),e!==fn.sources.SILENT&&this.emitter.emit(...t)}return l}function In(t,e,i,n,r){let s={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(r=n,n=i,i=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(r=n,n=i,i=e,e=0),"object"==typeof i?(s=i,r=n):"string"==typeof i&&(null!=n?s[i]=n:r=i),[t,e,s,r=r||fn.sources.API]}function Pn(t,e,i,n){const r="number"==typeof i?i:0;if(null==t)return null;let s,l;return[s,l]=[t.index,t.index+t.length].map(e&&"function"==typeof e.transformPosition?t=>e.transformPosition(t,n!==fn.sources.USER):t=>t<e||t===e&&n===fn.sources.USER?t:r>=0?t+r:Math.max(e,t+r)),new qn(s,l-s)}class Fn extends vi{}function Un(t){return t instanceof Yi||t instanceof Xi}function Zn(t){return"function"==typeof t.updateContent}function Kn(t,e,i){i.reduce(((e,i)=>{const n=Fi.Op.length(i);let r=i.attributes||{};if(null!=i.insert)if("string"==typeof i.insert){t.insertAt(e,i.insert);const[n]=t.descendant(oi,e),s=tn(n);r=Fi.AttributeMap.diff(s,r)||{}}else if("object"==typeof i.insert){const n=Object.keys(i.insert)[0];if(null==n)return e;if(t.insertAt(e,n,i.insert[n]),null!=t.scroll.query(n,We.INLINE)){const[i]=t.descendant(oi,e),n=tn(i);r=Fi.AttributeMap.diff(n,r)||{}}}return Object.keys(r).forEach((i=>{t.formatAt(e,n,i,r[i])})),e+n}),e)}const Wn={scope:We.BLOCK,whitelist:["right","center","justify"]},Gn=new Ge("align","align",Wn),Qn=new ti("align","ql-align",Wn),Yn=new ii("align","text-align",Wn);class Xn extends ii{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map((t=>`00${parseInt(t,10).toString(16)}`.slice(-2))).join("")}`):e}}const Jn=new ti("color","ql-color",{scope:We.INLINE}),tr=new Xn("color","color",{scope:We.INLINE}),er=new ti("background","ql-bg",{scope:We.INLINE}),ir=new Xn("background","background-color",{scope:We.INLINE});class nr extends Fn{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map((t=>t.length()<=1?"":t.domNode.innerText)).join("\n").slice(t,t+e)}html(t,e){return`<pre>\n${Gi(this.code(t,e))}\n</pre>`}}class rr extends Yi{static TAB=" ";static register(){Bn.register(nr)}}class sr extends Qi{}sr.blotName="code",sr.tagName="CODE",rr.blotName="code-block",rr.className="ql-code-block",rr.tagName="DIV",nr.blotName="code-block-container",nr.className="ql-code-block-container",nr.tagName="DIV",nr.allowedChildren=[rr],rr.allowedChildren=[Ki,Zi,en],rr.requiredContainer=nr;const lr={scope:We.BLOCK,whitelist:["rtl"]},or=new Ge("direction","dir",lr),ar=new ti("direction","ql-direction",lr),cr=new ii("direction","direction",lr),hr={scope:We.INLINE,whitelist:["serif","monospace"]},ur=new ti("font","ql-font",hr),dr=new class extends ii{value(t){return super.value(t).replace(/["']/g,"")}}("font","font-family",hr),fr=new ti("size","ql-size",{scope:We.INLINE,whitelist:["small","large","huge"]}),pr=new ii("size","font-size",{scope:We.INLINE,whitelist:["10px","18px","32px"]}),qr=un("quill:keyboard"),br=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class vr extends On{static match(t,e){return!["altKey","ctrlKey","metaKey","shiftKey"].some((i=>!!e[i]!==t[i]&&null!==e[i]))&&(e.key===t.key||e.key===t.which)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach((t=>{this.options.bindings[t]&&this.addBinding(this.options.bindings[t])})),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&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=function(t){if("string"==typeof t||"number"==typeof t)t={key:t};else{if("object"!=typeof t)return null;t=Me(t)}return t.shortKey&&(t[br]=t.shortKey,delete t.shortKey),t}(t);null!=n?("function"==typeof e&&(e={handler:e}),"function"==typeof i&&(i={handler:i}),(Array.isArray(n.key)?n.key:[n.key]).forEach((t=>{const r={...n,key:t,...e,...i};this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}))):qr.warn("Attempted to add invalid keyboard binding",n)}listen(){this.quill.root.addEventListener("keydown",(t=>{if(t.defaultPrevented||t.isComposing)return;if(229===t.keyCode&&("Enter"===t.key||"Backspace"===t.key))return;const e=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter((e=>vr.match(t,e)));if(0===e.length)return;const i=Bn.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const n=this.quill.getSelection();if(null==n||!this.quill.hasFocus())return;const[r,s]=this.quill.getLine(n.index),[l,o]=this.quill.getLeaf(n.index),[a,c]=0===n.length?[l,o]:this.quill.getLeaf(n.index+n.length),h=l instanceof xi?l.value().slice(0,o):"",u=a instanceof xi?a.value().slice(c):"",d={collapsed:0===n.length,empty:0===n.length&&r.length()<=1,format:this.quill.getFormat(n),line:r,offset:s,prefix:h,suffix:u,event:t};e.some((t=>{if(null!=t.collapsed&&t.collapsed!==d.collapsed)return!1;if(null!=t.empty&&t.empty!==d.empty)return!1;if(null!=t.offset&&t.offset!==d.offset)return!1;if(Array.isArray(t.format)){if(t.format.every((t=>null==d.format[t])))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every((e=>!0===t.format[e]?null!=d.format[e]:!1===t.format[e]?null==d.format[e]:Ue(t.format[e],d.format[e]))))return!1;return!(null!=t.prefix&&!t.prefix.test(d.prefix)||null!=t.suffix&&!t.suffix.test(d.suffix)||!0===t.handler.call(this,n,d,t))}))&&t.preventDefault()}))}handleBackspace(t,e){const i=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(0===t.index||this.quill.getLength()<=1)return;let n={};const[r]=this.quill.getLine(t.index);let s=(new Ui).retain(t.index-i).delete(i);if(0===e.offset){const[e]=this.quill.getLine(t.index-1);if(e&&!("block"===e.statics.blotName&&e.length()<=1)){const e=r.formats(),i=this.quill.getFormat(t.index-1,1);if(n=Fi.AttributeMap.diff(e,i)||{},Object.keys(n).length>0){const e=(new Ui).retain(t.index+r.length()-2).retain(1,n);s=s.compose(e)}}}this.quill.updateContents(s,Bn.sources.USER),this.quill.focus()}handleDelete(t,e){const i=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-i)return;let n={};const[r]=this.quill.getLine(t.index);let s=(new Ui).retain(t.index).delete(i);if(e.offset>=r.length()-1){const[e]=this.quill.getLine(t.index+1);if(e){const i=r.formats(),l=this.quill.getFormat(t.index,1);n=Fi.AttributeMap.diff(i,l)||{},Object.keys(n).length>0&&(s=s.retain(e.length()-1).retain(1,n))}}this.quill.updateContents(s,Bn.sources.USER),this.quill.focus()}handleDeleteRange(t){xr({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const i=Object.keys(e.format).reduce(((t,i)=>(this.quill.scroll.query(i,We.BLOCK)&&!Array.isArray(e.format[i])&&(t[i]=e.format[i]),t)),{}),n=(new Ui).retain(t.index).delete(t.length).insert("\n",i);this.quill.updateContents(n,Bn.sources.USER),this.quill.setSelection(t.index+1,Bn.sources.SILENT),this.quill.focus()}}const mr={bindings:{bold:yr("bold"),italic:yr("italic"),underline:yr("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","+1",Bn.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","-1",Bn.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){null!=e.format.indent?this.quill.format("indent","-1",Bn.sources.USER):null!=e.format.list&&this.quill.format("list",!1,Bn.sources.USER)}},"indent code-block":gr(!0),"outdent code-block":gr(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,Bn.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const i=(new Ui).retain(t.index).delete(t.length).insert("\t");return this.quill.updateContents(i,Bn.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,Bn.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Bn.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const i={list:!1};e.format.indent&&(i.indent=!1),this.quill.formatLine(t.index,t.length,i,Bn.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const[e,i]=this.quill.getLine(t.index),n={...e.formats(),list:"checked"},r=(new Ui).retain(t.index).insert("\n",n).retain(e.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(r,Bn.sources.USER),this.quill.setSelection(t.index+1,Bn.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const[i,n]=this.quill.getLine(t.index),r=(new Ui).retain(t.index).insert("\n",e.format).retain(i.length()-n-1).retain(1,{header:null});this.quill.updateContents(r,Bn.sources.USER),this.quill.setSelection(t.index+1,Bn.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(t){const e=this.quill.getModule("table");if(e){const[i,n,r,s]=e.getTable(t),l=function(t,e,i,n){return null==e.prev&&null==e.next?null==i.prev&&null==i.next?0===n?-1:1:null==i.prev?-1:1:null==e.prev?-1:null==e.next?1:null}(0,n,r,s);if(null==l)return;let o=i.offset();if(l<0){const e=(new Ui).retain(o).insert("\n");this.quill.updateContents(e,Bn.sources.USER),this.quill.setSelection(t.index+1,t.length,Bn.sources.SILENT)}else if(l>0){o+=i.length();const t=(new Ui).retain(o).insert("\n");this.quill.updateContents(t,Bn.sources.USER),this.quill.setSelection(o,Bn.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:i,line:n}=e,r=n.offset(this.quill.scroll);this.quill.setSelection(i.shiftKey?r-1:r+n.length(),Bn.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(null==this.quill.scroll.query("list"))return!0;const{length:i}=e.prefix,[n,r]=this.quill.getLine(t.index);if(r>i)return!0;let s;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",Bn.sources.USER),this.quill.history.cutoff();const l=(new Ui).retain(t.index-r).delete(i+1).retain(n.length()-2-r).retain(1,{list:s});return this.quill.updateContents(l,Bn.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-i,Bn.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,i]=this.quill.getLine(t.index);let n=2,r=e;for(;null!=r&&r.length()<=1&&r.formats()["code-block"];)if(r=r.prev,n-=1,n<=0){const n=(new Ui).retain(t.index+e.length()-i-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(n,Bn.sources.USER),this.quill.setSelection(t.index-1,Bn.sources.SILENT),!1}return!0}},"embed left":wr("ArrowLeft",!1),"embed left shift":wr("ArrowLeft",!0),"embed right":wr("ArrowRight",!1),"embed right shift":wr("ArrowRight",!0),"table down":kr(!1),"table up":kr(!0)}};function gr(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,i){let{event:n}=i;const r=this.quill.scroll.query("code-block"),{TAB:s}=r;if(0===e.length&&!n.shiftKey)return this.quill.insertText(e.index,s,Bn.sources.USER),void this.quill.setSelection(e.index+s.length,Bn.sources.SILENT);const l=0===e.length?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:a}=e;l.forEach(((e,i)=>{t?(e.insertAt(0,s),0===i?o+=s.length:a+=s.length):e.domNode.textContent.startsWith(s)&&(e.deleteAt(0,s.length),0===i?o-=s.length:a-=s.length)})),this.quill.update(Bn.sources.USER),this.quill.setSelection(o,a,Bn.sources.SILENT)}}}function wr(t,e){const i="ArrowLeft"===t?"prefix":"suffix";return{key:t,shiftKey:e,altKey:null,[i]:/^$/,handler(i){let{index:n}=i;"ArrowRight"===t&&(n+=i.length+1);const[r]=this.quill.getLeaf(n);return!(r instanceof mi&&("ArrowLeft"===t?e?this.quill.setSelection(i.index-1,i.length+1,Bn.sources.USER):this.quill.setSelection(i.index-1,Bn.sources.USER):e?this.quill.setSelection(i.index,i.length+1,Bn.sources.USER):this.quill.setSelection(i.index+i.length+1,Bn.sources.USER),1))}}}function yr(t){return{key:t[0],shortKey:!0,handler(e,i){this.quill.format(t,!i.format[t],Bn.sources.USER)}}}function kr(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,i){const n=t?"prev":"next",r=i.line,s=r.parent[n];if(null!=s){if("table-row"===s.statics.blotName){let t=s.children.head,e=r;for(;null!=e.prev;)e=e.prev,t=t.next;const n=t.offset(this.quill.scroll)+Math.min(i.offset,t.length()-1);this.quill.setSelection(n,0,Bn.sources.USER)}}else{const e=r.table()[n];null!=e&&this.quill.setSelection(t?e.offset(this.quill.scroll)+e.length()-1:e.offset(this.quill.scroll),0,Bn.sources.USER)}return!1}}}function xr(t){let{quill:e,range:i}=t;const n=e.getLines(i);let r={};if(n.length>1){const t=n[0].formats(),e=n[n.length-1].formats();r=Fi.AttributeMap.diff(e,t)||{}}e.deleteText(i,Bn.sources.USER),Object.keys(r).length>0&&e.formatLine(i.index,1,r,Bn.sources.USER),e.setSelection(i.index,Bn.sources.SILENT)}vr.DEFAULTS=mr;const jr=/font-weight:\s*normal/,Ar=["P","OL","UL"],Or=t=>t&&Ar.includes(t.tagName),Mr=/\bmso-list:[^;]*ignore/i,Er=/\bmso-list:[^;]*\bl(\d+)/i,Tr=/\bmso-list:[^;]*\blevel(\d+)/i,_r=[function(t){"urn:schemas-microsoft-com:office:word"===t.documentElement.getAttribute("xmlns:w")&&(t=>{const e=Array.from(t.querySelectorAll("[style*=mso-list]")),i=[],n=[];e.forEach((t=>{(t.getAttribute("style")||"").match(Mr)?i.push(t):n.push(t)})),i.forEach((t=>t.parentNode?.removeChild(t)));const r=t.documentElement.innerHTML,s=n.map((t=>((t,e)=>{const i=t.getAttribute("style"),n=i?.match(Er);if(!n)return null;const r=Number(n[1]),s=i?.match(Tr),l=s?Number(s[1]):1,o=new RegExp(`@list l${r}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),a=e.match(o);return{id:r,indent:l,type:a&&"bullet"===a[1]?"bullet":"ordered",element:t}})(t,r))).filter((t=>t));for(;s.length;){const t=[];let e=s.shift();for(;e;)t.push(e),e=s.length&&s[0]?.element===e.element.nextElementSibling&&s[0].id===e.id?s.shift():null;const i=document.createElement("ul");t.forEach((t=>{const e=document.createElement("li");e.setAttribute("data-list",t.type),t.indent>1&&e.setAttribute("class","ql-indent-"+(t.indent-1)),e.innerHTML=t.element.innerHTML,i.appendChild(e)}));const n=t[0]?.element,{parentNode:r}=n??{};n&&r?.replaceChild(i,n),t.slice(1).forEach((t=>{let{element:e}=t;r?.removeChild(e)}))}})(t)},function(t){t.querySelector('[id^="docs-internal-guid-"]')&&((t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter((t=>t.getAttribute("style")?.match(jr))).forEach((e=>{const i=t.createDocumentFragment();i.append(...e.childNodes),e.parentNode?.replaceChild(i,e)}))})(t),(t=>{Array.from(t.querySelectorAll("br")).filter((t=>Or(t.previousElementSibling)&&Or(t.nextElementSibling))).forEach((t=>{t.parentNode?.removeChild(t)}))})(t))}],Nr=un("quill:clipboard"),Lr=[[Node.TEXT_NODE,function(t,e,i){let n=t.data;if("O:P"===t.parentElement?.tagName)return e.insert(n.trim());if(!Hr(t)){if(0===n.trim().length&&n.includes("\n")&&!function(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Br(t.previousElementSibling,e)&&!Br(t.nextElementSibling,e)}(t,i))return e;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(null==t.previousSibling&&null!=t.parentElement&&Br(t.parentElement,i)||t.previousSibling instanceof Element&&Br(t.previousSibling,i))&&(n=n.replace(/^ /,"")),(null==t.nextSibling&&null!=t.parentElement&&Br(t.parentElement,i)||t.nextSibling instanceof Element&&Br(t.nextSibling,i))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return e.insert(n)}],[Node.TEXT_NODE,Ir],["br",function(t,e){return Sr(e,"\n")||e.insert("\n"),e}],[Node.ELEMENT_NODE,Ir],[Node.ELEMENT_NODE,function(t,e,i){const n=i.query(t);if(null==n)return e;if(n.prototype instanceof mi){const e={},r=n.value(t);if(null!=r)return e[n.blotName]=r,(new Ui).insert(e,n.formats(t,i))}else if(n.prototype instanceof qi&&!Sr(e,"\n")&&e.insert("\n"),"blotName"in n&&"formats"in n&&"function"==typeof n.formats)return Cr(e,n.blotName,n.formats(t,i),i);return e}],[Node.ELEMENT_NODE,function(t,e,i){const n=Ge.keys(t),r=ti.keys(t),s=ii.keys(t),l={};return n.concat(r).concat(s).forEach((e=>{let n=i.query(e,We.ATTRIBUTE);null!=n&&(l[n.attrName]=n.value(t),l[n.attrName])||(n=$r[e],null==n||n.attrName!==e&&n.keyName!==e||(l[n.attrName]=n.value(t)||void 0),n=zr[e],null==n||n.attrName!==e&&n.keyName!==e||(n=zr[e],l[n.attrName]=n.value(t)||void 0))})),Object.entries(l).reduce(((t,e)=>{let[n,r]=e;return Cr(t,n,r,i)}),e)}],[Node.ELEMENT_NODE,function(t,e,i){const n={},r=t.style||{};return"italic"===r.fontStyle&&(n.italic=!0),"underline"===r.textDecoration&&(n.underline=!0),"line-through"===r.textDecoration&&(n.strike=!0),(r.fontWeight?.startsWith("bold")||parseInt(r.fontWeight,10)>=700)&&(n.bold=!0),e=Object.entries(n).reduce(((t,e)=>{let[n,r]=e;return Cr(t,n,r,i)}),e),parseFloat(r.textIndent||0)>0?(new Ui).insert("\t").concat(e):e}],["li",function(t,e,i){const n=i.query(t);if(null==n||"list"!==n.blotName||!Sr(e,"\n"))return e;let r=-1,s=t.parentNode;for(;null!=s;)["OL","UL"].includes(s.tagName)&&(r+=1),s=s.parentNode;return r<=0?e:e.reduce(((t,e)=>e.insert?e.attributes&&"number"==typeof e.attributes.indent?t.push(e):t.insert(e.insert,{indent:r,...e.attributes||{}}):t),new Ui)}],["ol, ul",function(t,e,i){let n="OL"===t.tagName?"ordered":"bullet";const r=t.getAttribute("data-checked");return r&&(n="true"===r?"checked":"unchecked"),Cr(e,"list",n,i)}],["pre",function(t,e,i){const n=i.query("code-block");return Cr(e,"code-block",!n||!("formats"in n)||"function"!=typeof n.formats||n.formats(t,i),i)}],["tr",function(t,e,i){const n="TABLE"===t.parentElement?.tagName?t.parentElement:t.parentElement?.parentElement;return null!=n?Cr(e,"table",Array.from(n.querySelectorAll("tr")).indexOf(t)+1,i):e}],["b",Dr("bold")],["i",Dr("italic")],["strike",Dr("strike")],["style",function(){return new Ui}]],$r=[Gn,or].reduce(((t,e)=>(t[e.keyName]=e,t)),{}),zr=[Yn,ir,tr,cr,dr,pr].reduce(((t,e)=>(t[e.keyName]=e,t)),{});function Cr(t,e,i,n){return n.query(e)?t.reduce(((t,n)=>n.insert?n.attributes&&n.attributes[e]?t.push(n):t.insert(n.insert,{...i?{[e]:i}:{},...n.attributes}):t),new Ui):t}function Sr(t,e){let i="";for(let n=t.ops.length-1;n>=0&&i.length<e.length;--n){const e=t.ops[n];if("string"!=typeof e.insert)break;i=e.insert+i}return i.slice(-1*e.length)===e}function Br(t,e){if(!(t instanceof Element))return!1;const i=e.query(t);return!(i&&i.prototype instanceof mi)&&["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(t.tagName.toLowerCase())}const Rr=new WeakMap;function Hr(t){return null!=t&&(Rr.has(t)||Rr.set(t,"PRE"===t.tagName||Hr(t.parentNode)),Rr.get(t))}function Vr(t,e,i,n,r){return e.nodeType===e.TEXT_NODE?n.reduce(((i,n)=>n(e,i,t)),new Ui):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce(((s,l)=>{let o=Vr(t,l,i,n,r);return l.nodeType===e.ELEMENT_NODE&&(o=i.reduce(((e,i)=>i(l,e,t)),o),o=(r.get(l)||[]).reduce(((e,i)=>i(l,e,t)),o)),s.concat(o)}),new Ui):new Ui}function Dr(t){return(e,i,n)=>Cr(i,t,!0,n)}function Ir(t,e,i){if(!Sr(e,"\n")){if(Br(t,i)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert("\n");if(e.length()>0&&t.nextSibling){let n=t.nextSibling;for(;null!=n;){if(Br(n,i))return e.insert("\n");const t=i.query(n);if(t&&t.prototype instanceof Xi)return e.insert("\n");n=n.firstChild}}}return e}function Pr(t,e){let i=e;for(let e=t.length-1;e>=0;e-=1){const n=t[e];t[e]={delta:i.transform(n.delta,!0),range:n.range&&Fr(n.range,i)},i=n.delta.transform(i),0===t[e].delta.length()&&t.splice(e,1)}}function Fr(t,e){if(!t)return t;const i=e.transformPosition(t.index);return{index:i,length:e.transformPosition(t.index+t.length)-i}}class Ur extends On{constructor(t,e){super(t,e),t.root.addEventListener("drop",(e=>{e.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(e.clientX,e.clientY);else if(document.caretPositionFromPoint){const t=document.caretPositionFromPoint(e.clientX,e.clientY);i=document.createRange(),i.setStart(t.offsetNode,t.offset),i.setEnd(t.offsetNode,t.offset)}const n=i&&t.selection.normalizeNative(i);if(n){const i=t.selection.normalizedToRange(n);e.dataTransfer?.files&&this.upload(i,e.dataTransfer.files)}}))}upload(t,e){const i=[];Array.from(e).forEach((t=>{t&&this.options.mimetypes?.includes(t.type)&&i.push(t)})),i.length>0&&this.options.handler.call(this,t,i)}}Ur.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const i=e.map((t=>new Promise((e=>{const i=new FileReader;i.onload=()=>{e(i.result)},i.readAsDataURL(t)}))));Promise.all(i).then((e=>{const i=e.reduce(((t,e)=>t.insert({image:e})),(new Ui).retain(t.index).delete(t.length));this.quill.updateContents(i,fn.sources.USER),this.quill.setSelection(t.index+e.length,fn.sources.SILENT)}))}};const Zr=["insertText","insertReplacementText"],Kr=/Mac/i.test(navigator.platform);Bn.register({"blots/block":Yi,"blots/block/embed":Xi,"blots/break":Zi,"blots/container":Fn,"blots/cursor":en,"blots/embed":En,"blots/inline":Qi,"blots/scroll":class extends yi{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Yi;static allowedChildren=[Yi,Xi,Fn];constructor(t,e,i){let{emitter:n}=i;super(t,e),this.emitter=n,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(t=>this.handleDragStart(t)))}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(fn.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(fn.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(fn.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[i,n]=this.line(t),[r]=this.line(t+e);if(super.deleteAt(t,e),null!=r&&i!==r&&n>0){if(i instanceof Xi||r instanceof Xi)return void this.optimize();i.moveChildren(r,r.children.head instanceof Zi?null:r.children.head),i.remove()}this.optimize()}enable(){this.domNode.setAttribute("contenteditable",arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?"false":"true")}formatAt(t,e,i,n){super.formatAt(t,e,i,n),this.optimize()}insertAt(t,e,i){if(t>=this.length())if(null==i||null==this.scroll.query(e,We.BLOCK)){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t),null==i&&e.endsWith("\n")?t.insertAt(0,e.slice(0,-1),i):t.insertAt(0,e,i)}else{const t=this.scroll.create(e,i);this.appendChild(t)}else super.insertAt(t,e,i);this.optimize()}insertBefore(t,e){if(t.statics.scope===We.INLINE_BLOT){const i=this.scroll.create(this.statics.defaultChild.blotName);i.appendChild(t),super.insertBefore(i,e)}else super.insertBefore(t,e)}insertContents(t,e){const i=this.deltaToRenderBlocks(e.concat((new Ui).insert("\n"))),n=i.pop();if(null==n)return;this.batchStart();const r=i.shift();if(r){const e="block"===r.type&&(0===r.delta.length()||!this.descendant(Xi,t)[0]&&t<this.length()),i="block"===r.type?r.delta:(new Ui).insert({[r.key]:r.value});Kn(this,t,i);const n="block"===r.type?1:0,s=t+i.length()+n;e&&this.insertAt(s-1,"\n");const l=tn(this.line(t)[0]),o=Fi.AttributeMap.diff(l,r.attributes)||{};Object.keys(o).forEach((t=>{this.formatAt(s-1,1,t,o[t])})),t=s}let[s,l]=this.children.find(t);i.length&&(s&&(s=s.split(l),l=0),i.forEach((t=>{if("block"===t.type)Kn(this.createBlock(t.attributes,s||void 0),0,t.delta);else{const e=this.create(t.key,t.value);this.insertBefore(e,s||void 0),Object.keys(t.attributes).forEach((i=>{e.format(i,t.attributes[i])}))}}))),"block"===n.type&&n.delta.length()&&Kn(this,s?s.offset(s.scroll)+l:this.length(),n.delta),this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[i,n]=e;return i instanceof oi?[i,n]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(Un,t)}lines(){const t=(e,i,n)=>{let r=[],s=n;return e.children.forEachAt(i,n,((e,i,n)=>{Un(e)?r.push(e):e instanceof vi&&(r=r.concat(t(e,i,s))),s-=n})),r};return t(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(fn.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch)return void(Array.isArray(t)&&(this.batch=this.batch.concat(t)));let e=fn.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),(t=t.filter((t=>{let{target:e}=t;const i=this.find(e,!0);return i&&!Zn(i)}))).length>0&&this.emitter.emit(fn.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(fn.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,i){const[n]=this.descendant((t=>t instanceof Xi),t);n&&n.statics.blotName===e&&Zn(n)&&n.updateContent(i)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let i=new Ui;return t.forEach((t=>{const n=t?.insert;if(n)if("string"==typeof n){const r=n.split("\n");r.slice(0,-1).forEach((n=>{i.insert(n,t.attributes),e.push({type:"block",delta:i,attributes:t.attributes??{}}),i=new Ui}));const s=r[r.length-1];s&&i.insert(s,t.attributes)}else{const r=Object.keys(n)[0];if(!r)return;this.query(r,We.INLINE)?i.push(t):(i.length()&&e.push({type:"block",delta:i,attributes:{}}),i=new Ui,e.push({type:"blockEmbed",key:r,value:n[r],attributes:t.attributes??{}}))}})),i.length()&&e.push({type:"block",delta:i,attributes:{}}),e}createBlock(t,e){let i;const n={};Object.entries(t).forEach((t=>{let[e,r]=t;null!=this.query(e,We.BLOCK&We.BLOT)?i=e:n[e]=r}));const r=this.create(i||this.statics.defaultChild.blotName,i?t[i]:void 0);this.insertBefore(r,e||void 0);const s=r.length();return Object.entries(n).forEach((t=>{let[e,i]=t;r.formatAt(0,s,e,i)})),r}},"blots/text":Ki,"modules/clipboard":class extends On{static DEFAULTS={matchers:[]};constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",(t=>this.onCaptureCopy(t,!1))),this.quill.root.addEventListener("cut",(t=>this.onCaptureCopy(t,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Lr.concat(this.options.matchers??[]).forEach((t=>{let[e,i]=t;this.addMatcher(e,i)}))}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:i}=t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n[rr.blotName])return(new Ui).insert(i||"",{[rr.blotName]:n[rr.blotName]});if(!e)return(new Ui).insert(i||"",n);const r=this.convertHTML(e);return Sr(r,"\n")&&(null==r.ops[r.ops.length-1].attributes||n.table)?r.compose((new Ui).retain(r.length()-1).delete(1)):r}normalizeHTML(t){(t=>{t.documentElement&&_r.forEach((e=>{e(t)}))})(t)}convertHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");this.normalizeHTML(e);const i=e.body,n=new WeakMap,[r,s]=this.prepareMatching(i,n);return Vr(this.quill.scroll,i,r,s,n)}dangerouslyPasteHTML(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bn.sources.API;if("string"==typeof t){const i=this.convert({html:t,text:""});this.quill.setContents(i,e),this.quill.setSelection(0,Bn.sources.SILENT)}else{const n=this.convert({html:e,text:""});this.quill.updateContents((new Ui).retain(t).concat(n),i),this.quill.setSelection(t+n.length(),Bn.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.defaultPrevented)return;t.preventDefault();const[i]=this.quill.selection.getRange();if(null==i)return;const{html:n,text:r}=this.onCopy(i,e);t.clipboardData?.setData("text/plain",r),t.clipboardData?.setData("text/html",n),e&&xr({range:i,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter((t=>"#"!==t[0])).join("\n")}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(null==e)return;const i=t.clipboardData?.getData("text/html");let n=t.clipboardData?.getData("text/plain");if(!i&&!n){const e=t.clipboardData?.getData("text/uri-list");e&&(n=this.normalizeURIList(e))}const r=Array.from(t.clipboardData?.files||[]);if(!i&&r.length>0)this.quill.uploader.upload(e,r);else{if(i&&r.length>0){const t=(new DOMParser).parseFromString(i,"text/html");if(1===t.body.childElementCount&&"IMG"===t.body.firstElementChild?.tagName)return void this.quill.uploader.upload(e,r)}this.onPaste(e,{html:i,text:n})}}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:i,html:n}=e;const r=this.quill.getFormat(t.index),s=this.convert({text:i,html:n},r);Nr.log("onPaste",s,{text:i,html:n});const l=(new Ui).retain(t.index).delete(t.length).concat(s);this.quill.updateContents(l,Bn.sources.USER),this.quill.setSelection(l.length()-t.length,Bn.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const i=[],n=[];return this.matchers.forEach((r=>{const[s,l]=r;switch(s){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:i.push(l);break;default:Array.from(t.querySelectorAll(s)).forEach((t=>{if(e.has(t)){const i=e.get(t);i?.push(l)}else e.set(t,[l])}))}})),[i,n]}},"modules/history":class extends On{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(t,e){super(t,e),this.quill.on(Bn.events.EDITOR_CHANGE,((t,e,i,n)=>{t===Bn.events.SELECTION_CHANGE?e&&n!==Bn.sources.SILENT&&(this.currentRange=e):t===Bn.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&n!==Bn.sources.USER?this.transform(e):this.record(e,i)),this.currentRange=Fr(this.currentRange,e))})),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",(t=>{"historyUndo"===t.inputType?(this.undo(),t.preventDefault()):"historyRedo"===t.inputType&&(this.redo(),t.preventDefault())}))}change(t,e){if(0===this.stack[t].length)return;const i=this.stack[t].pop();if(!i)return;const n=this.quill.getContents(),r=i.delta.invert(n);this.stack[e].push({delta:r,range:Fr(i.range,r)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i.delta,Bn.sources.USER),this.ignoreChange=!1,this.restoreSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let i=t.invert(e),n=this.currentRange;const r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){const t=this.stack.undo.pop();t&&(i=i.compose(t.delta),n=t.range)}else this.lastRecorded=r;0!==i.length()&&(this.stack.undo.push({delta:i,range:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){Pr(this.stack.undo,t),Pr(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,Bn.sources.USER);else{const e=function(t,e){const i=e.reduce(((t,e)=>t+(e.delete||0)),0);let n=e.length()-i;return function(t,e){const i=e.ops[e.ops.length-1];return null!=i&&(null!=i.insert?"string"==typeof i.insert&&i.insert.endsWith("\n"):null!=i.attributes&&Object.keys(i.attributes).some((e=>null!=t.query(e,We.BLOCK))))}(t,e)&&(n-=1),n}(this.quill.scroll,t.delta);this.quill.setSelection(e,Bn.sources.USER)}}},"modules/keyboard":vr,"modules/uploader":Ur,"modules/input":class extends On{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",(t=>{this.handleBeforeInput(t)})),/Android/i.test(navigator.userAgent)||t.on(Bn.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(t){xr({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===t.length)return!1;if(e){const i=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents((new Ui).retain(t.index).insert(e,i),Bn.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,Bn.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Zr.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||!0===e.collapsed)return;const i=function(t){return"string"==typeof t.data?t.data:t.dataTransfer?.types.includes("text/plain")?t.dataTransfer.getData("text/plain"):null}(t);if(null==i)return;const n=this.quill.selection.normalizeNative(e),r=n?this.quill.selection.normalizedToRange(n):null;r&&this.replaceText(r,i)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}},"modules/uiNode":class extends On{isListening=!1;selectionChangeDeadline=0;constructor(t,e){super(t,e),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,e){let{line:i,event:n}=e;if(!(i instanceof ui&&i.uiNode))return!0;const r="rtl"===getComputedStyle(i.domNode).direction;return!!(r&&"ArrowRight"!==n.key||!r&&"ArrowLeft"!==n.key)||(this.quill.setSelection(t.index-1,t.length+(n.shiftKey?1:0),Bn.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(t=>{!t.defaultPrevented&&(t=>"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowUp"===t.key||"ArrowDown"===t.key||"Home"===t.key||!(!Kr||"a"!==t.key||!0!==t.ctrlKey))(t)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,this.isListening||(this.isListening=!0,document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0}))}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(!0!==e.collapsed||0!==e.startOffset)return;const i=this.quill.scroll.find(e.startContainer);if(!(i instanceof ui&&i.uiNode))return;const n=document.createRange();n.setStartAfter(i.uiNode),n.setEndAfter(i.uiNode),t.removeAllRanges(),t.addRange(n)}}});const Wr=new class extends ti{add(t,e){let i=0;if("+1"===e||"-1"===e){const n=this.value(t)||0;i="+1"===e?n+1:n-1}else"number"==typeof e&&(i=e);return 0===i?(this.remove(t),!0):super.add(t,i.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}}("indent","ql-indent",{scope:We.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Gr extends Fn{}Gr.blotName="list-container",Gr.tagName="OL";class Qr extends Yi{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(){Bn.register(Gr)}constructor(t,e){super(t,e);const i=e.ownerDocument.createElement("span"),n=i=>{if(!t.isEnabled())return;const n=this.statics.formats(e,t);"checked"===n?(this.format("list","unchecked"),i.preventDefault()):"unchecked"===n&&(this.format("list","checked"),i.preventDefault())};i.addEventListener("mousedown",n),i.addEventListener("touchstart",n),this.attachUI(i)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}Qr.blotName="list",Qr.tagName="LI",Gr.allowedChildren=[Qr],Qr.requiredContainer=Gr;class Yr extends Qi{static blotName="bold";static tagName=["STRONG","B"];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)}}class Xr extends Qi{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];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 Jr(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("href",this.constructor.sanitize(e)):super.format(t,e)}}function Jr(t,e){const i=document.createElement("a");i.href=t;const n=i.href.slice(0,i.href.indexOf(":"));return e.indexOf(n)>-1}const ts=["alt","height","width"],es=["height","width"],is=new ti("code-token","hljs",{scope:We.INLINE});class ns extends Qi{static formats(t,e){for(;null!=t&&t!==e.domNode;){if(t.classList&&t.classList.contains(rr.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,i){super(t,e,i),is.add(this.domNode,i)}format(t,e){t!==ns.blotName?super.format(t,e):e?is.add(this.domNode,e):(is.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),is.value(this.domNode)||this.unwrap()}}ns.blotName="code-token",ns.className="ql-token";class rs extends rr{static create(t){const e=super.create(t);return"string"==typeof t&&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(),ns.blotName,!1),super.replaceWith(t,e)}}class ss extends nr{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===rs.blotName&&(this.forceNext=!0,this.children.forEach((i=>{i.format(t,e)})))}formatAt(t,e,i,n){i===rs.blotName&&(this.forceNext=!0),super.formatAt(t,e,i,n)}highlight(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const i=`${Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode)).map((t=>t.textContent)).join("\n")}\n`,n=rs.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==i){if(i.trim().length>0||null==this.cachedText){const e=this.children.reduce(((t,e)=>t.concat(Ji(e,!1))),new Ui),r=t(i,n);e.diff(r).reduce(((t,e)=>{let{retain:i,attributes:n}=e;return i?(n&&Object.keys(n).forEach((e=>{[rs.blotName,ns.blotName].includes(e)&&this.formatAt(t,i,e,n[e])})),t+i):t}),0)}this.cachedText=i,this.forceNext=!1}}html(t,e){const[i]=this.children.find(t);return`<pre data-language="${i?rs.formats(i.domNode):"plain"}">\n${Gi(this.code(t,e))}\n</pre>`}optimize(t){if(super.optimize(t),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const t=rs.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}ss.allowedChildren=[rs],rs.requiredContainer=ss,rs.allowedChildren=[ns,en,Ki,Zi];class ls extends On{static register(){Bn.register(ns,!0),Bn.register(rs,!0),Bn.register(ss,!0)}constructor(t,e){if(super(t,e),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((t,e)=>{let{key:i}=e;return t[i]=!0,t}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Bn.events.SCROLL_BLOT_MOUNT,(t=>{if(!(t instanceof ss))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((t=>{let{key:i,label:n}=t;const r=e.ownerDocument.createElement("option");r.textContent=n,r.setAttribute("value",i),e.appendChild(r)})),e.addEventListener("change",(()=>{t.format(rs.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)})),null==t.uiNode&&(t.attachUI(e),t.children.head&&(e.value=rs.formats(t.children.head.domNode)))}))}initTimer(){let t=null;this.quill.on(Bn.events.SCROLL_OPTIMIZE,(()=>{t&&clearTimeout(t),t=setTimeout((()=>{this.highlight(),t=null}),this.options.interval)}))}highlight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(Bn.sources.USER);const i=this.quill.getSelection();(null==t?this.quill.scroll.descendants(ss):[t]).forEach((t=>{t.highlight(this.highlightBlot,e)})),this.quill.update(Bn.sources.SILENT),null!=i&&this.quill.setSelection(i,Bn.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(e=this.languages[e]?e:"plain","plain"===e)return Gi(t).split("\n").reduce(((t,i,n)=>(0!==n&&t.insert("\n",{[rr.blotName]:e}),t.insert(i))),new Ui);const i=this.quill.root.ownerDocument.createElement("div");return i.classList.add(rr.className),i.innerHTML=((t,e,i)=>{if("string"==typeof t.versionString){const n=t.versionString.split(".")[0];if(parseInt(n,10)>=11)return t.highlight(i,{language:e}).value}return t.highlight(e,i).value})(this.options.hljs,e,t),Vr(this.quill.scroll,i,[(t,e)=>{const i=is.value(t);return i?e.compose((new Ui).retain(e.length(),{[ns.blotName]:i})):e}],[(t,i)=>t.data.split("\n").reduce(((t,i,n)=>(0!==n&&t.insert("\n",{[rr.blotName]:e}),t.insert(i))),i)],new WeakMap)}}ls.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"}]};class os extends Yi{static blotName="table";static tagName="TD";static create(t){const e=super.create();return e.setAttribute("data-row",t||us()),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===os.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()}}class as extends Fn{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const t=this.children.head.formats(),e=this.children.tail.formats(),i=this.next.children.head.formats(),n=this.next.children.tail.formats();return t.table===e.table&&t.table===i.table&&t.table===n.table}return!1}optimize(t){super.optimize(t),this.children.forEach((t=>{if(null==t.next)return;const e=t.formats(),i=t.next.formats();if(e.table!==i.table){const e=this.splitAfter(t);e&&e.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class cs extends Fn{static blotName="table-body";static tagName="TBODY"}class hs extends Fn{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(as),e=t.reduce(((t,e)=>Math.max(e.children.length,t)),0);t.forEach((t=>{new Array(e-t.children.length).fill(0).forEach((()=>{let e;null!=t.children.head&&(e=os.formats(t.children.head.domNode));const i=this.scroll.create(os.blotName,e);t.appendChild(i),i.optimize()}))}))}cells(t){return this.rows().map((e=>e.children.at(t)))}deleteColumn(t){const[e]=this.descendant(cs);null!=e&&null!=e.children.head&&e.children.forEach((e=>{const i=e.children.at(t);null!=i&&i.remove()}))}insertColumn(t){const[e]=this.descendant(cs);null!=e&&null!=e.children.head&&e.children.forEach((e=>{const i=e.children.at(t),n=os.formats(e.children.head.domNode),r=this.scroll.create(os.blotName,n);e.insertBefore(r,i)}))}insertRow(t){const[e]=this.descendant(cs);if(null==e||null==e.children.head)return;const i=us(),n=this.scroll.create(as.blotName);e.children.head.children.forEach((()=>{const t=this.scroll.create(os.blotName,i);n.appendChild(t)}));const r=e.children.at(t);e.insertBefore(n,r)}rows(){const t=this.children.head;return null==t?[]:t.children.map((t=>t))}}function us(){return`row-${Math.random().toString(36).slice(2,6)}`}hs.allowedChildren=[cs],cs.requiredContainer=hs,cs.allowedChildren=[as],as.requiredContainer=cs,as.allowedChildren=[os],os.requiredContainer=as;const ds=un("quill:toolbar");class fs extends On{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const e=document.createElement("div");e.setAttribute("role","toolbar"),function(t,e){Array.isArray(e[0])||(e=[e]),e.forEach((e=>{const i=document.createElement("span");i.classList.add("ql-formats"),e.forEach((t=>{if("string"==typeof t)ps(i,t);else{const e=Object.keys(t)[0],n=t[e];Array.isArray(n)?function(t,e,i){const n=document.createElement("select");n.classList.add(`ql-${e}`),i.forEach((t=>{const e=document.createElement("option");!1!==t?e.setAttribute("value",String(t)):e.setAttribute("selected","selected"),n.appendChild(e)})),t.appendChild(n)}(i,e,n):ps(i,e,n)}})),t.appendChild(i)}))}(e,this.options.container),t.container?.parentNode?.insertBefore(e,t.container),this.container=e}else this.container="string"==typeof this.options.container?document.querySelector(this.options.container):this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((t=>{const e=this.options.handlers?.[t];e&&this.addHandler(t,e)})),Array.from(this.container.querySelectorAll("button, select")).forEach((t=>{this.attach(t)})),this.quill.on(Bn.events.EDITOR_CHANGE,(()=>{const[t]=this.quill.selection.getRange();this.update(t)}))):ds.error("Container required for toolbar",this.options)}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find((t=>0===t.indexOf("ql-")));e&&(e=e.slice(3),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null!=this.handlers[e]||null!=this.quill.scroll.query(e)?(t.addEventListener("SELECT"===t.tagName?"change":"click",(i=>{let n;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];n=!e.hasAttribute("selected")&&(e.value||!1)}else n=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),i.preventDefault();this.quill.focus();const[r]=this.quill.selection.getRange();if(null!=this.handlers[e])this.handlers[e].call(this,n);else if(this.quill.scroll.query(e).prototype instanceof mi){if(n=prompt(`Enter ${e}`),!n)return;this.quill.updateContents((new Ui).retain(r.index).delete(r.length).insert({[e]:n}),Bn.sources.USER)}else this.quill.format(e,n,Bn.sources.USER);this.update(r)})),this.controls.push([e,t])):ds.warn("ignoring attaching to nonexistent format",e,t))}update(t){const e=null==t?{}:this.quill.getFormat(t);this.controls.forEach((i=>{const[n,r]=i;if("SELECT"===r.tagName){let i=null;if(null==t)i=null;else if(null==e[n])i=r.querySelector("option[selected]");else if(!Array.isArray(e[n])){let t=e[n];"string"==typeof t&&(t=t.replace(/"/g,'\\"')),i=r.querySelector(`option[value="${t}"]`)}null==i?(r.value="",r.selectedIndex=-1):i.selected=!0}else if(null==t)r.classList.remove("ql-active"),r.setAttribute("aria-pressed","false");else if(r.hasAttribute("value")){const t=e[n],i=t===r.getAttribute("value")||null!=t&&t.toString()===r.getAttribute("value")||null==t&&!r.getAttribute("value");r.classList.toggle("ql-active",i),r.setAttribute("aria-pressed",i.toString())}else{const t=null!=e[n];r.classList.toggle("ql-active",t),r.setAttribute("aria-pressed",t.toString())}}))}}function ps(t,e,i){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${e}`),n.setAttribute("aria-pressed","false"),null!=i?(n.value=i,n.setAttribute("aria-label",`${e}: ${i}`)):n.setAttribute("aria-label",e),t.appendChild(n)}fs.DEFAULTS={},fs.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(null!=t)if(0===t.length){const t=this.quill.getFormat();Object.keys(t).forEach((t=>{null!=this.quill.scroll.query(t,We.INLINE)&&this.quill.format(t,!1,Bn.sources.USER)}))}else this.quill.removeFormat(t.index,t.length,Bn.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();"rtl"===t&&null==e?this.quill.format("align","right",Bn.sources.USER):t||"right"!==e||this.quill.format("align",!1,Bn.sources.USER),this.quill.format("direction",t,Bn.sources.USER)},indent(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e),n=parseInt(i.indent||0,10);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===i.direction&&(e*=-1),this.quill.format("indent",n+e,Bn.sources.USER)}},link(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,Bn.sources.USER)},list(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e);this.quill.format("list","check"===t?"checked"!==i.list&&"unchecked"!==i.list&&"unchecked":t,Bn.sources.USER)}}};const qs='<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>';var bs={align:{"":'<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>',center:'<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>',right:'<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>',justify:'<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>'},background:'<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>',blockquote:'<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>',bold:'<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>',clean:'<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>',code:qs,"code-block":qs,color:'<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',direction:{"":'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',rtl:'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>'},formula:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',header:{1:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',2:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',3:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',4:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',5:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',6:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>'},italic:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',image:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indent:{"+1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',"-1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>'},link:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',list:{bullet:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',check:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',ordered:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>'},script:{sub:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',super:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>'},strike:'<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',table:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underline:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',video:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>'};let vs=0;function ms(t,e){t.setAttribute(e,`${!("true"===t.getAttribute(e))}`)}class gs{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",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),ms(this.label,"aria-expanded"),ms(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 i=t.getAttribute("value");return i&&e.setAttribute("data-value",i),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",(()=>{this.selectItem(e,!0)})),e.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.selectItem(e,!0),t.preventDefault();break;case"Escape":this.escape(),t.preventDefault()}})),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML='<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>',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-${vs}`,vs+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach((e=>{const i=this.buildItem(e);t.appendChild(i),!0===e.selected&&this.selectItem(i)})),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&&void 0!==arguments[1]&&arguments[1];const i=this.container.querySelector(".ql-selected");t!==i&&(null!=i&&i.classList.remove("ql-selected"),null!=t&&(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 e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);const e=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class ws extends gs{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((t=>{t.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 i=this.label.querySelector(".ql-color-label"),n=t&&t.getAttribute("data-value")||"";i&&("line"===i.tagName?i.style.stroke=n:i.style.fill=n)}}class ys extends gs{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((t=>{t.innerHTML=e[t.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const i=t||this.defaultItem;if(null!=i){if(this.label.innerHTML===i.innerHTML)return;this.label.innerHTML=i.innerHTML}}}class ks{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(t=>{const{overflowY:e}=getComputedStyle(t,null);return"visible"!==e&&"clip"!==e})(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,i=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${i}px`,this.root.classList.remove("ql-flip");const n=this.boundsContainer.getBoundingClientRect(),r=this.root.getBoundingClientRect();let s=0;return r.right>n.right&&(s=n.right-r.right,this.root.style.left=`${e+s}px`),r.left<n.left&&(s=n.left-r.left,this.root.style.left=`${e+s}px`),r.bottom>n.bottom&&(this.root.style.top=i-(t.bottom-t.top+(r.bottom-r.top))+"px",this.root.classList.add("ql-flip")),s}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const xs=[!1,"center","right","justify"],js=["#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"],As=[!1,"serif","monospace"],Os=["1","2","3",!1],Ms=["small",!1,"large","huge"];class Es extends _n{constructor(t,e){super(t,e);const i=e=>{document.body.contains(t.root)?(null==this.tooltip||this.tooltip.root.contains(e.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((t=>{t.container.contains(e.target)||t.close()}))):document.body.removeEventListener("click",i)};t.emitter.listenDOM("click",document.body,i)}addModule(t){const e=super.addModule(t);return"toolbar"===t&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach((t=>{(t.getAttribute("class")||"").split(/\s+/).forEach((i=>{if(i.startsWith("ql-")&&(i=i.slice(3),null!=e[i]))if("direction"===i)t.innerHTML=e[i][""]+e[i].rtl;else if("string"==typeof e[i])t.innerHTML=e[i];else{const n=t.value||"";null!=n&&e[i][n]&&(t.innerHTML=e[i][n])}}))}))}buildPickers(t,e){this.pickers=Array.from(t).map((t=>{if(t.classList.contains("ql-align")&&(null==t.querySelector("option")&&_s(t,xs),"object"==typeof e.align))return new ys(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const i=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&_s(t,js,"background"===i?"#ffffff":"#000000"),new ws(t,e[i])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?_s(t,As):t.classList.contains("ql-header")?_s(t,Os):t.classList.contains("ql-size")&&_s(t,Ms)),new gs(t)})),this.quill.on(fn.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((t=>{t.update()}))}))}}Es.DEFAULTS=Ke({},_n.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");null==t&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",(()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""})),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Ts extends ks{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(t=>{"Enter"===t.key?(this.save(),t.preventDefault()):"Escape"===t.key&&(this.cancel(),t.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const i=this.quill.getBounds(this.quill.selection.savedRange);null!=i&&this.position(i),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,fn.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,fn.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=function(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(null!=e){const i=e.index+e.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),t,fn.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",fn.sources.USER),this.quill.setSelection(i+2,fn.sources.USER)}break}}this.textbox.value="",this.hide()}}function _s(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach((e=>{const n=document.createElement("option");e===i?n.setAttribute("selected","selected"):n.setAttribute("value",String(e)),t.appendChild(n)}))}const Ns=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Ls extends Ts{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,e){super(t,e),this.quill.on(fn.events.EDITOR_CHANGE,((t,e,i,n)=>{if(t===fn.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&n===fn.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const t=this.quill.getLines(e.index,e.length);if(1===t.length){const t=this.quill.getBounds(e);null!=t&&this.position(t)}else{const i=t[t.length-1],n=this.quill.getIndex(i),r=Math.min(i.length()-1,e.index+e.length-n),s=this.quill.getBounds(new qn(n,r));null!=s&&this.position(s)}}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(fn.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(null!=t){const e=this.quill.getBounds(t);null!=e&&this.position(e)}}),1)}))}cancel(){this.show()}position(t){const e=super.position(t),i=this.root.querySelector(".ql-tooltip-arrow");return i.style.marginLeft="",0!==e&&(i.style.marginLeft=-1*e-i.offsetWidth/2+"px"),e}}class $s extends Es{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=Ns),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Ls(this.quill,this.options.bounds),null!=t.container&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),bs),this.buildPickers(t.container.querySelectorAll("select"),bs))}}$s.DEFAULTS=Ke({},Es.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Bn.sources.USER)}}}}});const zs=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Cs extends Ts{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(t=>{if(null!=this.linkRange){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,fn.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()})),this.quill.on(fn.events.SELECTION_CHANGE,((t,e,i)=>{if(null!=t){if(0===t.length&&i===fn.sources.USER){const[e,i]=this.quill.scroll.descendant(Xr,t.index);if(null!=e){this.linkRange=new qn(t.index-i,e.length());const n=Xr.formats(e.domNode);this.preview.textContent=n,this.preview.setAttribute("href",n),this.show();const r=this.quill.getBounds(this.linkRange);return void(null!=r&&this.position(r))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class Ss extends Es{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=zs),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){null!=t.container&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),bs),this.buildPickers(t.container.querySelectorAll("select"),bs),this.tooltip=new Cs(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((e,i)=>{t.handlers.link.call(t,!i.format.link)})))}}Ss.DEFAULTS=Ke({},Es.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(null==t||0===t.length)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&0!==e.indexOf("mailto:")&&(e=`mailto:${e}`);const{tooltip:i}=this.quill.theme;i.edit("link",e)}else this.quill.format("link",!1,Bn.sources.USER)}}}}}),Bn.register({"attributors/attribute/direction":or,"attributors/class/align":Qn,"attributors/class/background":er,"attributors/class/color":Jn,"attributors/class/direction":ar,"attributors/class/font":ur,"attributors/class/size":fr,"attributors/style/align":Yn,"attributors/style/background":ir,"attributors/style/color":tr,"attributors/style/direction":cr,"attributors/style/font":dr,"attributors/style/size":pr},!0),Bn.register({"formats/align":Qn,"formats/direction":ar,"formats/indent":Wr,"formats/background":ir,"formats/color":tr,"formats/font":ur,"formats/size":fr,"formats/blockquote":class extends Yi{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":rr,"formats/header":class extends Yi{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(t){return this.tagName.indexOf(t.tagName)+1}},"formats/list":Qr,"formats/bold":Yr,"formats/code":sr,"formats/italic":class extends Yr{static blotName="italic";static tagName=["EM","I"]},"formats/link":Xr,"formats/script":class extends Qi{static blotName="script";static tagName=["SUB","SUP"];static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}},"formats/strike":class extends Yr{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends Qi{static blotName="underline";static tagName="U"},"formats/formula":class extends En{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(t){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return"string"==typeof t&&(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>`}},"formats/image":class extends mi{static blotName="image";static tagName="IMG";static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return ts.reduce(((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e)),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Jr(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){ts.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}},"formats/video":class extends Xi{static blotName="video";static className="ql-video";static tagName="IFRAME";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 es.reduce(((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e)),{})}static sanitize(t){return Xr.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){es.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>`}},"modules/syntax":ls,"modules/table":class extends On{static register(){Bn.register(os),Bn.register(as),Bn.register(cs),Bn.register(hs)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(hs).forEach((t=>{t.balanceCells()}))}deleteColumn(){const[t,,e]=this.getTable();null!=e&&(t.deleteColumn(e.cellOffset()),this.quill.update(Bn.sources.USER))}deleteRow(){const[,t]=this.getTable();null!=t&&(t.remove(),this.quill.update(Bn.sources.USER))}deleteTable(){const[t]=this.getTable();if(null==t)return;const e=t.offset();t.remove(),this.quill.update(Bn.sources.USER),this.quill.setSelection(e,Bn.sources.SILENT)}getTable(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==t)return[null,null,null,-1];const[e,i]=this.quill.getLine(t.index);if(null==e||e.statics.blotName!==os.blotName)return[null,null,null,-1];const n=e.parent;return[n.parent.parent,n,e,i]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[i,n,r]=this.getTable(e);if(null==r)return;const s=r.cellOffset();i.insertColumn(s+t),this.quill.update(Bn.sources.USER);let l=n.rowOffset();0===t&&(l+=1),this.quill.setSelection(e.index+l,e.length,Bn.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[i,n,r]=this.getTable(e);if(null==r)return;const s=n.rowOffset();i.insertRow(s+t),this.quill.update(Bn.sources.USER),t>0?this.quill.setSelection(e,Bn.sources.SILENT):this.quill.setSelection(e.index+n.children.length,e.length,Bn.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const i=this.quill.getSelection();if(null==i)return;const n=new Array(t).fill(0).reduce((t=>{const i=new Array(e).fill("\n").join("");return t.insert(i,{table:us()})}),(new Ui).retain(i.index));this.quill.updateContents(n,Bn.sources.USER),this.quill.setSelection(i.index,Bn.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Bn.events.SCROLL_OPTIMIZE,(t=>{t.some((t=>!!["TD","TR","TBODY","TABLE"].includes(t.target.tagName)&&(this.quill.once(Bn.events.TEXT_CHANGE,((t,e,i)=>{i===Bn.sources.USER&&this.balanceTables()})),!0)))}))}},"modules/toolbar":fs,"themes/bubble":$s,"themes/snow":Ss,"ui/icons":bs,"ui/picker":gs,"ui/icon-picker":ys,"ui/color-picker":ws,"ui/tooltip":ks},!0);const Bs=t=>Boolean(t.tagName),Rs=class{constructor(i){t(this,i),this.inputValid=e(this,"input-valid",7),this.valueChange=e(this,"value-change",7),this.hasDisplayedError=!1,this.customErrorMessage={lock:!1},this.classFocus="mg-u-is-focused",this.value="",this.labelOnTop=!1,this.labelHide=!1,this.rows=5,this.required=!1,this.readonly=!1,this.disabled=!1,this.tooltipPosition="input",this.classCollection=new s(["mg-c-input--rich-text-editor"]),this.isEmpty=()=>{const t=this.getTextContent();return!(r(t)&&"\n"!==t)},this.getTextContent=()=>this.value.replace(/<[^>]*>/g,"").trim(),this.getPatternValidity=()=>void 0===this.pattern||new RegExp(`^${this.pattern}$`,"u").test(this.getTextContent()),this.checkValidity=()=>{this.setValidity(this.readonly||this.disabled||(!this.required||!this.isEmpty())&&this.getPatternValidity())},this.setErrorMessage=(t=!1)=>{this.errorMessage=void 0,this.valid||(t||this.customErrorMessage.lock&&void 0!==this.customErrorMessage.message?this.errorMessage=this.customErrorMessage.message:this.required&&this.isEmpty()?this.errorMessage=this.messages.errors.required:this.getPatternValidity()||(this.errorMessage=this.patternErrorMessage))},this.handleFocus=()=>{this.classCollection.add(this.classFocus),this.classCollection=new s(this.classCollection.classes)},this.handleBlur=()=>{this.classCollection.delete(this.classFocus),this.classCollection=new s(this.classCollection.classes),this.readonly||(this.checkValidity(),this.setErrorMessage(),this.valid||(this.hasDisplayedError=!0))},this.handleTextChange=()=>{const t=this.editor.getSemanticHTML();this.value=t,this.valueChange.emit(t),this.checkValidity(),this.hasDisplayedError&&this.setErrorMessage()}}watchReadonly(t){t?this.classCollection.add(o):this.classCollection.delete(o)}watchDisabled(t){var e,i;t?(this.classCollection.add(a),null===(e=this.editor)||void 0===e||e.disable()):(this.classCollection.delete(a),null===(i=this.editor)||void 0===i||i.enable())}handleValidityChange(){null!=this.editor&&(this.checkValidity(),this.hasDisplayedError&&(this.setErrorMessage(),this.hasDisplayedError=!1))}validatePattern(t){if(!(void 0===t||r(this.pattern)&&r(this.patternErrorMessage)))throw new Error(`<mg-input-rich-text-editor> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${l(this.pattern)}'" and "patternErrorMessage='${l(this.patternErrorMessage)}'".`)}async setFocus(){var t;null===(t=this.editor)||void 0===t||t.focus()}async getHTML(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getSemanticHTML())}))}))}async getText(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getText())}))}))}async displayError(){return new Promise((t=>{requestAnimationFrame((()=>{this.checkValidity(),this.setErrorMessage(),this.hasDisplayedError=this.invalid,t()}))}))}async setError(t,e,i=!1){if("boolean"!=typeof t)throw new Error('<mg-input-rich-text-editor> method "setError()" param "valid" must be a boolean.');if(void 0!==e&&!r(e))throw new Error('<mg-input-rich-text-editor> method "setError()" param "errorMessage" must be a string.');this.customErrorMessage={lock:!t&&i,message:t?void 0:e},this.setValidity(t),this.setErrorMessage(!0),this.hasDisplayedError=this.invalid}async reset(){if(!this.readonly)return this.value="",this.editor.setText(""),new Promise((t=>{requestAnimationFrame((()=>{this.customErrorMessage={lock:!1},this.checkValidity(),this.errorMessage=void 0,this.hasDisplayedError=!1,t()}))}))}setValidity(t){const e=this.valid;this.customErrorMessage.lock&&(void 0===this.customErrorMessage.message||t)||(this.valid=t),this.invalid=!this.valid,this.valid!==e&&this.inputValid.emit(this.valid)}componentWillLoad(){return this.messages=c(this.element).messages,this.element.style.setProperty("--mg-c-input-rich-text-editor-rows",this.rows.toString()),this.validatePattern(this.pattern),this.validatePattern(this.patternErrorMessage),this.watchReadonly(this.readonly),this.watchDisabled(this.disabled),setTimeout((()=>{this.checkValidity()}),0)}componentDidLoad(){this.readonly||(this.editor=((t,{value:e,modules:i,readOnly:n,placeholder:s,handleTextChange:l,handleFocus:o,handleBlur:a})=>{const c=new Bn(t.querySelector("div"),{theme:"snow",modules:i||{toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]},readOnly:n,placeholder:s});r(e)&&/<[a-z][\s\S]*>/i.test(e)?c.clipboard.dangerouslyPasteHTML(e):r(e)&&c.setText(e);const h=t.querySelector(".ql-editor");return h.addEventListener("focus",o),h.addEventListener("blur",a),c.on("text-change",l),(t=>{const e=()=>t.root.getRootNode();t.selection.hasFocus=()=>e().activeElement===t.root,t.selection.getNativeRange=()=>{const i=(t=>{try{if("function"==typeof document.createElement("div").attachShadow({mode:"open"}).getSelection)return t.getSelection().getRangeAt(0);const e=window.getSelection();return"function"==typeof e.getComposedRanges?e.getComposedRanges(t)[0]:e.getRangeAt(0)}catch(t){return null}})(e());return Boolean(i)?t.selection.normalizeNative(i):null},t.selection.setNativeRange=(e,i,n=e,r=i,s=!1)=>{if([null==e?void 0:e.parentNode,t.root.parentNode,null==n?void 0:n.parentNode].some((t=>null==t)))return;const l=window.getSelection();t.selection.hasFocus()||t.root.focus();const o=(t.selection.getNativeRange()||{}).native;Boolean(o)&&!s&&e===o.startContainer&&i===o.startOffset&&n===o.endContainer&&r===o.endOffset||(Bs(e)&&"BR"===e.tagName&&(i=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),Bs(n)&&"BR"===n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode),l.setBaseAndExtent(e,i,n,r))},document.addEventListener("selectionchange",(()=>{t.selection.update()}))})(c),c})(this.wrapperElement,{modules:this.modules,readOnly:this.readonly||this.disabled,placeholder:this.placeholder,value:this.value,handleTextChange:this.handleTextChange,handleBlur:this.handleBlur,handleFocus:this.handleFocus}))}render(){return i("mg-input",{key:"2f8f244cb60996c9cbe891b04168b5aea420d3a0",identifier:this.identifier,class:this.classCollection.join(),label:this.label,labelOnTop:this.labelOnTop,labelHide:this.labelHide,required:this.required,tooltip:this.tooltip,tooltipPosition:this.tooltipPosition,helpText:this.helpText,errorMessage:this.hasDisplayedError?this.errorMessage:void 0},this.readonly?i("div",{class:"mg-c-input__readonly-value",innerHTML:this.value}):i("div",{ref:t=>{this.wrapperElement=t},id:this.identifier,class:"mg-c-input__wrapper"},i("div",null)))}get element(){return n(this)}static get watchers(){return{readonly:["watchReadonly","handleValidityChange"],disabled:["watchDisabled","handleValidityChange"],required:["handleValidityChange"],pattern:["validatePattern"],patternErrorMessage:["validatePattern"]}}};Rs.style="/*!\n * Quill Editor v2.0.3\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked]>.ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked]>.ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li>.ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked]>.ql-ui,.ql-editor li[data-list=unchecked]>.ql-ui{color:#777}.ql-editor li[data-list=bullet]>.ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked]>.ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked]>.ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered]>.ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1>.ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2>.ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3>.ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4>.ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5>.ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6>.ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7>.ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8>.ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9>.ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl>.ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow+.ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);overflow-wrap:anywhere}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.mg-c-input__wrapper{display:flex;width:100%;flex-direction:column;border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light)}.mg-c-input__wrapper:focus-within{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus);outline:Highlight auto .1rem;outline:-webkit-focus-ring-color auto .1rem}.mg-c-input--has-error .mg-c-input__wrapper{border-color:var(--mg-b-color-danger)}.mg-c-input--disabled .mg-c-input__wrapper{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p{margin:0}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor .ql-toolbar{display:flex;flex-wrap:wrap;padding:var(--mg-b-size-8);border:0;border-radius:var(--mg-c-input-border-radius) var(--mg-c-input-border-radius) 0 0;background:var(--mg-b-color-neutral-0);border-block-end-width:var(--mg-c-input-border-width);border-block-end-color:var(--mg-c-input-color-border);border-block-end-style:solid}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats{display:inline-flex;margin:inherit;gap:.2rem}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats:not(:last-child)::after{width:.1rem;height:var(--mg-b-size-16);background:var(--mg-c-input-color-border);content:\"\";margin-block:var(--mg-b-size-8);margin-inline:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-toolbar button .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-fill{fill:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button{display:flex;min-width:var(--mg-b-size-32);height:var(--mg-b-size-32);align-items:center;justify-content:center;padding:var(--mg-b-size-4);border:.1rem solid rgba(0,0,0,0);border-radius:var(--mg-b-size-radius);color:var(--mg-b-color-dark);float:inherit;transition-duration:.2s;transition-property:background-color,border-color;transition-timing-function:ease-in-out}.mg-c-input--rich-text-editor .ql-toolbar button svg{width:var(--mg-b-size-20);height:var(--mg-b-size-20)}.mg-c-input--rich-text-editor .ql-toolbar button:focus{color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button:focus-visible,.mg-c-input--rich-text-editor .ql-toolbar button:hover,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active{border-color:var(--mg-b-color-neutral-70);background:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke-width:.12rem}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke.ql-thin{stroke-width:.1rem}.mg-c-input--rich-text-editor .ql-toolbar button.ql-bold .ql-stroke{stroke-width:.2rem}.mg-c-input--rich-text-editor .ql-container{border:0;border-radius:0 0 var(--mg-c-input-border-radius) var(--mg-c-input-border-radius);margin:0 .1rem .1rem;background:var(--mg-b-color-neutral-0)}.mg-c-input--rich-text-editor .ql-editor{min-height:calc(calc(var(--mg-b-font-size) * var(--mg-b-line-height) * var(--mg-c-input-rich-text-editor-rows, 3)) + calc((var(--mg-b-size-min-height) - var(--mg-b-font-size) * var(--mg-b-line-height)) / 2));padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);color:var(--mg-b-color-dark);font-size:var(--mg-b-font-size)}.mg-c-input--rich-text-editor .ql-editor.ql-blank::before{right:var(--mg-b-size-8);left:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-editor p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor.mg-c-input--disabled .ql-toolbar{pointer-events:none}.mg-c-input--rich-text-editor.mg-c-input--has-error .ql-toolbar{border-color:var(--mg-b-color-danger)}";export{Rs as mg_input_rich_text_editor}
1
+ import{r as t,c as e,h as i,a as n}from"./p-BluNKQ3L.js";import{i as r,C as s,t as l}from"./p-C7xjtdiw.js";import{c as o,a}from"./p-DDnrE1hD.js";import{i as c}from"./p-CNX6lq0x.js";var h="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,d=h||u||Function("return this")(),f=d.Symbol,p=Object.prototype,q=p.hasOwnProperty,b=p.toString,v=f?f.toStringTag:void 0,m=Object.prototype.toString,g=f?f.toStringTag:void 0;function w(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?function(t){var e=q.call(t,v),i=t[v];try{t[v]=void 0;var n=!0}catch(t){}var r=b.call(t);return n&&(e?t[v]=i:delete t[v]),r}(t):function(t){return m.call(t)}(t)}function y(t){return null!=t&&"object"==typeof t}var k=Array.isArray;function x(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function j(t){return t}function A(t){if(!x(t))return!1;var e=w(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var O,M=d["__core-js_shared__"],E=(O=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",T=Function.prototype.toString;function _(t){if(null!=t){try{return T.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var N=/^\[object .+?Constructor\]$/,L=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!x(t)||(e=t,E&&E in e))&&(A(t)?L:N).test(_(t));var e}(i)?i:void 0}var z,C,S,B=$(d,"WeakMap"),R=Object.create,H=function(){function t(){}return function(e){if(!x(e))return{};if(R)return R(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}(),D=Date.now,V=function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),I=V?function(t,e){return V(t,"toString",{configurable:!0,enumerable:!1,value:(i=e,function(){return i}),writable:!0});var i}:j,P=(z=I,C=0,S=0,function(){var t=D(),e=16-(t-S);if(S=t,e>0){if(++C>=800)return arguments[0]}else C=0;return z.apply(void 0,arguments)}),F=/^(?:0|[1-9]\d*)$/;function U(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&F.test(t))&&t>-1&&t%1==0&&t<e}function Z(t,e,i){"__proto__"==e&&V?V(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function K(t,e){return t===e||t!=t&&e!=e}var W=Object.prototype.hasOwnProperty;function G(t,e,i){var n=t[e];W.call(t,e)&&K(n,i)&&(void 0!==i||e in t)||Z(t,e,i)}var Q=Math.max;function Y(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function X(t){return null!=t&&Y(t.length)&&!A(t)}var J=Object.prototype;function tt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function et(t){return y(t)&&"[object Arguments]"==w(t)}var it=Object.prototype,nt=it.hasOwnProperty,rt=it.propertyIsEnumerable,st=et(function(){return arguments}())?et:function(t){return y(t)&&nt.call(t,"callee")&&!rt.call(t,"callee")},lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,ot=lt&&"object"==typeof module&&module&&!module.nodeType&&module,at=ot&&ot.exports===lt?d.Buffer:void 0,ct=(at?at.isBuffer:void 0)||function(){return!1},ht={};function ut(t){return function(e){return t(e)}}ht["[object Float32Array]"]=ht["[object Float64Array]"]=ht["[object Int8Array]"]=ht["[object Int16Array]"]=ht["[object Int32Array]"]=ht["[object Uint8Array]"]=ht["[object Uint8ClampedArray]"]=ht["[object Uint16Array]"]=ht["[object Uint32Array]"]=!0,ht["[object Arguments]"]=ht["[object Array]"]=ht["[object ArrayBuffer]"]=ht["[object Boolean]"]=ht["[object DataView]"]=ht["[object Date]"]=ht["[object Error]"]=ht["[object Function]"]=ht["[object Map]"]=ht["[object Number]"]=ht["[object Object]"]=ht["[object RegExp]"]=ht["[object Set]"]=ht["[object String]"]=ht["[object WeakMap]"]=!1;var dt="object"==typeof exports&&exports&&!exports.nodeType&&exports,ft=dt&&"object"==typeof module&&module&&!module.nodeType&&module,pt=ft&&ft.exports===dt&&h.process,qt=function(){try{return ft&&ft.require&&ft.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(t){}}(),bt=qt&&qt.isTypedArray,vt=bt?ut(bt):function(t){return y(t)&&Y(t.length)&&!!ht[w(t)]},mt=Object.prototype.hasOwnProperty;function gt(t,e){var i=k(t),n=!i&&st(t),r=!i&&!n&&ct(t),s=!i&&!n&&!r&&vt(t),l=i||n||r||s,o=l?function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(t.length,String):[],a=o.length;for(var c in t)!e&&!mt.call(t,c)||l&&("length"==c||r&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||U(c,a))||o.push(c);return o}function wt(t,e){return function(i){return t(e(i))}}var yt=wt(Object.keys,Object),kt=Object.prototype.hasOwnProperty;function xt(t){return X(t)?gt(t):function(t){if(!tt(t))return yt(t);var e=[];for(var i in Object(t))kt.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t)}var jt=Object.prototype.hasOwnProperty;function At(t){return X(t)?gt(t,!0):function(t){if(!x(t))return function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}(t);var e=tt(t),i=[];for(var n in t)("constructor"!=n||!e&&jt.call(t,n))&&i.push(n);return i}(t)}var Ot=$(Object,"create"),Mt=Object.prototype.hasOwnProperty,Et=Object.prototype.hasOwnProperty;function Tt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function _t(t,e){for(var i=t.length;i--;)if(K(t[i][0],e))return i;return-1}Tt.prototype.clear=function(){this.__data__=Ot?Ot(null):{},this.size=0},Tt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Tt.prototype.get=function(t){var e=this.__data__;if(Ot){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return Mt.call(e,t)?e[t]:void 0},Tt.prototype.has=function(t){var e=this.__data__;return Ot?void 0!==e[t]:Et.call(e,t)},Tt.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Ot&&void 0===e?"__lodash_hash_undefined__":e,this};var Nt=Array.prototype.splice;function Lt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Lt.prototype.clear=function(){this.__data__=[],this.size=0},Lt.prototype.delete=function(t){var e=this.__data__,i=_t(e,t);return!(i<0||(i==e.length-1?e.pop():Nt.call(e,i,1),--this.size,0))},Lt.prototype.get=function(t){var e=this.__data__,i=_t(e,t);return i<0?void 0:e[i][1]},Lt.prototype.has=function(t){return _t(this.__data__,t)>-1},Lt.prototype.set=function(t,e){var i=this.__data__,n=_t(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};var $t=$(d,"Map");function zt(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function Ct(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Ct.prototype.clear=function(){this.size=0,this.__data__={hash:new Tt,map:new($t||Lt),string:new Tt}},Ct.prototype.delete=function(t){var e=zt(this,t).delete(t);return this.size-=e?1:0,e},Ct.prototype.get=function(t){return zt(this,t).get(t)},Ct.prototype.has=function(t){return zt(this,t).has(t)},Ct.prototype.set=function(t,e){var i=zt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};var St=wt(Object.getPrototypeOf,Object),Bt=Function.prototype.toString,Rt=Object.prototype.hasOwnProperty,Ht=Bt.call(Object);function Dt(t){var e=this.__data__=new Lt(t);this.size=e.size}Dt.prototype.clear=function(){this.__data__=new Lt,this.size=0},Dt.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Dt.prototype.get=function(t){return this.__data__.get(t)},Dt.prototype.has=function(t){return this.__data__.has(t)},Dt.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Lt){var n=i.__data__;if(!$t||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Ct(n)}return i.set(t,e),this.size=i.size,this};var Vt="object"==typeof exports&&exports&&!exports.nodeType&&exports,It=Vt&&"object"==typeof module&&module&&!module.nodeType&&module,Pt=It&&It.exports===Vt?d.Buffer:void 0,Ft=Pt?Pt.allocUnsafe:void 0;function Ut(t,e){if(e)return t.slice();var i=t.length,n=Ft?Ft(i):new t.constructor(i);return t.copy(n),n}var Zt=Object.prototype.propertyIsEnumerable,Kt=Object.getOwnPropertySymbols,Wt=Kt?function(t){return null==t?[]:(t=Object(t),function(e){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var l=e[i];Zt.call(t,l)&&(s[r++]=l)}return s}(Kt(t)))}:function(){return[]};function Gt(t){return function(t,e,i){var n=xt(t);return k(t)?n:function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}(n,i(t))}(t,0,Wt)}var Qt=$(d,"DataView"),Yt=$(d,"Promise"),Xt=$(d,"Set"),Jt="[object Map]",te="[object Promise]",ee="[object Set]",ie="[object WeakMap]",ne="[object DataView]",re=_(Qt),se=_($t),le=_(Yt),oe=_(Xt),ae=_(B),ce=w;(Qt&&ce(new Qt(new ArrayBuffer(1)))!=ne||$t&&ce(new $t)!=Jt||Yt&&ce(Yt.resolve())!=te||Xt&&ce(new Xt)!=ee||B&&ce(new B)!=ie)&&(ce=function(t){var e=w(t),i="[object Object]"==e?t.constructor:void 0,n=i?_(i):"";if(n)switch(n){case re:return ne;case se:return Jt;case le:return te;case oe:return ee;case ae:return ie}return e});var he=Object.prototype.hasOwnProperty,ue=d.Uint8Array;function de(t){var e=new t.constructor(t.byteLength);return new ue(e).set(new ue(t)),e}var fe=/\w*$/,pe=f?f.prototype:void 0,qe=pe?pe.valueOf:void 0;function be(t,e){var i=e?de(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function ve(t){return"function"!=typeof t.constructor||tt(t)?{}:H(St(t))}var me=qt&&qt.isMap,ge=me?ut(me):function(t){return y(t)&&"[object Map]"==ce(t)},we=qt&&qt.isSet,ye=we?ut(we):function(t){return y(t)&&"[object Set]"==ce(t)},ke="[object Arguments]",xe="[object Function]",je="[object Object]",Ae={};function Oe(t,e,i,n,r,s){var l,o=1&e;if(void 0!==l)return l;if(!x(t))return t;var a=k(t);if(a)l=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&he.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t);else{var c=ce(t),h=c==xe||"[object GeneratorFunction]"==c;if(ct(t))return Ut(t,o);if(c==je||c==ke||h&&!r)l=h?{}:ve(t);else{if(!Ae[c])return r?t:{};l=function(t,e,i){var n,r,s,l,o=t.constructor;switch(e){case"[object ArrayBuffer]":return de(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return l=de((s=t).buffer),new s.constructor(l,s.byteOffset,s.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return be(t,i);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return(r=new(n=t).constructor(n.source,fe.exec(n))).lastIndex=n.lastIndex,r;case"[object Symbol]":return qe?Object(qe.call(t)):{}}}(t,c,o)}}s||(s=new Dt);var u=s.get(t);if(u)return u;s.set(t,l),ye(t)?t.forEach((function(n){l.add(Oe(n,e,i,0,t,s))})):ge(t)&&t.forEach((function(n,r){l.set(r,Oe(n,e,i,0,t,s))}));var d=a?void 0:Gt(t);return function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i););}(d||t,(function(n,r){d&&(n=t[r=n]),G(l,r,Oe(n,e,i,0,t,s))})),l}function Me(t){return Oe(t,5)}function Ee(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Ct;++e<i;)this.add(t[e])}function Te(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}function _e(t,e,i,n,r,s){var l=1&i,o=t.length,a=e.length;if(o!=a&&!(l&&a>o))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,f=2&i?new Ee:void 0;for(s.set(t,e),s.set(e,t);++u<o;){var p=t[u],q=e[u];if(n)var b=l?n(q,p,u,e,t,s):n(p,q,u,t,e,s);if(void 0!==b){if(b)continue;d=!1;break}if(f){if(!Te(e,(function(t,e){if(!f.has(e)&&(p===t||r(p,t,i,n,s)))return f.push(e)}))){d=!1;break}}else if(p!==q&&!r(p,q,i,n,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function Ne(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function Le(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}Ae[ke]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object DataView]"]=Ae["[object Boolean]"]=Ae["[object Date]"]=Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae[je]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object Symbol]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Error]"]=Ae[xe]=Ae["[object WeakMap]"]=!1,Ee.prototype.add=Ee.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Ee.prototype.has=function(t){return this.__data__.has(t)};var $e=f?f.prototype:void 0,ze=$e?$e.valueOf:void 0,Ce=Object.prototype.hasOwnProperty,Se="[object Arguments]",Be="[object Array]",Re="[object Object]",He=Object.prototype.hasOwnProperty;function De(t,e,i,n,r){return t===e||(null==t||null==e||!y(t)&&!y(e)?t!=t&&e!=e:function(t,e,i,n,r,s){var l=k(t),o=k(e),a=l?Be:ce(t),c=o?Be:ce(e),h=(a=a==Se?Re:a)==Re,u=(c=c==Se?Re:c)==Re,d=a==c;if(d&&ct(t)){if(!ct(e))return!1;l=!0,h=!1}if(d&&!h)return s||(s=new Dt),l||vt(t)?_e(t,e,i,n,r,s):function(t,e,i,n,r,s,l){switch(i){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!s(new ue(t),new ue(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return K(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var o=Ne;case"[object Set]":if(o||(o=Le),t.size!=e.size&&!(1&n))return!1;var a=l.get(t);if(a)return a==e;n|=2,l.set(t,e);var c=_e(o(t),o(e),n,r,s,l);return l.delete(t),c;case"[object Symbol]":if(ze)return ze.call(t)==ze.call(e)}return!1}(t,e,a,i,n,r,s);if(!(1&i)){var f=h&&He.call(t,"__wrapped__"),p=u&&He.call(e,"__wrapped__");if(f||p){var q=f?t.value():t,b=p?e.value():e;return s||(s=new Dt),r(q,b,i,n,s)}}return!!d&&(s||(s=new Dt),function(t,e,i,n,r,s){var l=1&i,o=Gt(t),a=o.length;if(a!=Gt(e).length&&!l)return!1;for(var c=a;c--;){var h=o[c];if(!(l?h in e:Ce.call(e,h)))return!1}var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var f=!0;s.set(t,e),s.set(e,t);for(var p=l;++c<a;){var q=t[h=o[c]],b=e[h];if(n)var v=l?n(b,q,h,e,t,s):n(q,b,h,t,e,s);if(!(void 0===v?q===b||r(q,b,i,n,s):v)){f=!1;break}p||(p="constructor"==h)}if(f&&!p){var m=t.constructor,g=e.constructor;m==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof g&&g instanceof g||(f=!1)}return s.delete(t),s.delete(e),f}(t,e,i,n,r,s))}(t,e,i,n,De,r))}function Ve(t,e,i){(void 0!==i&&!K(t[e],i)||void 0===i&&!(e in t))&&Z(t,e,i)}function Ie(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Pe(t,e,i,n,r,s,l){var o=Ie(t,i),a=Ie(e,i),c=l.get(a);if(c)Ve(t,i,c);else{var h,u=s?s(o,a,i+"",t,e,l):void 0,d=void 0===u;if(d){var f=k(a),p=!f&&ct(a),q=!f&&!p&&vt(a);u=a,f||p||q?k(o)?u=o:y(h=o)&&X(h)?u=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}(o):p?(d=!1,u=Ut(a,!0)):q?(d=!1,u=be(a,!0)):u=[]:function(t){if(!y(t)||"[object Object]"!=w(t))return!1;var e=St(t);if(null===e)return!0;var i=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Bt.call(i)==Ht}(a)||st(a)?(u=o,st(o)?u=function(t){return function(t,e,i){var n=!i;i||(i={});for(var r=-1,s=e.length;++r<s;){var l=e[r],o=void 0;void 0===o&&(o=t[l]),n?Z(i,l,o):G(i,l,o)}return i}(t,At(t))}(o):x(o)&&!A(o)||(u=ve(a))):d=!1}d&&(l.set(a,u),r(u,a,n,s,l),l.delete(a)),Ve(t,i,u)}}function Fe(t,e,i,n,r){t!==e&&function(t,e,i){for(var n=-1,r=Object(t),s=i(t),l=s.length;l--;){var o=s[++n];if(!1===e(r[o],o,r))break}}(e,(function(s,l){if(r||(r=new Dt),x(s))Pe(t,e,l,i,Fe,n,r);else{var o=n?n(Ie(t,l),s,l+"",t,e,r):void 0;void 0===o&&(o=s),Ve(t,l,o)}}),At)}function Ue(t,e){return De(t,e)}var Ze,Ke=(Ze=function(t,e,i){Fe(t,e,i)},function(t,e){return P(function(t,e,i){return e=Q(void 0===e?t.length-1:e,0),function(){for(var n=arguments,r=-1,s=Q(n.length-e,0),l=Array(s);++r<s;)l[r]=n[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=n[r];return o[e]=i(l),function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}(t,this,o)}}(t,e,j),t+"")}((function(t,e){var i=-1,n=e.length,r=n>1?e[n-1]:void 0,s=n>2?e[2]:void 0;for(r=Ze.length>3&&"function"==typeof r?(n--,r):void 0,s&&function(t,e,i){if(!x(i))return!1;var n=typeof e;return!!("number"==n?X(i)&&U(e,i.length):"string"==n&&e in i)&&K(i[e],t)}(e[0],e[1],s)&&(r=n<3?void 0:r,n=1),t=Object(t);++i<n;){var l=e[i];l&&Ze(t,l,i)}return t}))),We=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(We||{});class Ge{constructor(t,e,i={}){this.attrName=t,this.keyName=e,this.scope=null!=i.scope?i.scope&We.LEVEL|We.TYPE&We.ATTRIBUTE:We.ATTRIBUTE,null!=i.whitelist&&(this.whitelist=i.whitelist)}static keys(t){return Array.from(t.attributes).map((t=>t.name))}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?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 Qe extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}const Ye=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(null==t)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let i=null;try{i=t.parentNode}catch{return null}return this.find(i,e)}return null}create(e,i,n){const r=this.query(i);if(null==r)throw new Qe(`Unable to create ${i} blot`);const s=r,l=i instanceof Node||i.nodeType===Node.TEXT_NODE?i:s.create(n),o=new s(e,l,n);return t.blots.set(o.domNode,o),o}find(e,i=!1){return t.find(e,i)}query(t,e=We.ANY){let i;return"string"==typeof t?i=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?i=this.types.text:"number"==typeof t?t&We.LEVEL&We.BLOCK?i=this.types.block:t&We.LEVEL&We.INLINE&&(i=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some((t=>(i=this.classes[t],!!i))),i=i||this.tags[t.tagName]),null==i?null:"scope"in i&&e&We.LEVEL&i.scope&&e&We.TYPE&i.scope?i:null}register(...t){return t.map((t=>{const e="blotName"in t,i="attrName"in t;if(!e&&!i)throw new Qe("Invalid definition");if(e&&"abstract"===t.blotName)throw new Qe("Cannot register abstract class");return this.types[e?t.blotName:i?t.attrName:void 0]=t,i?"string"==typeof t.keyName&&(this.attributes[t.keyName]=t):e&&(t.className&&(this.classes[t.className]=t),t.tagName&&(t.tagName=Array.isArray(t.tagName)?t.tagName.map((t=>t.toUpperCase())):t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach((e=>{(null==this.tags[e]||null==t.className)&&(this.tags[e]=t)})))),t}))}};Ye.blots=new WeakMap;let Xe=Ye;function Je(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((t=>0===t.indexOf(`${e}-`)))}const ti=class extends Ge{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map((t=>t.split("-").slice(0,-1).join("-")))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){Je(t,this.keyName).forEach((e=>{t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(Je(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function ei(t){const e=t.split("-"),i=e.slice(1).map((t=>t[0].toUpperCase()+t.slice(1))).join("");return e[0]+i}const ii=class extends Ge{static keys(t){return(t.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(t,e){return!!this.canAdd(t,e)&&(t.style[ei(this.keyName)]=e,!0)}remove(t){t.style[ei(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[ei(this.keyName)];return this.canAdd(t,e)?e:""}},ni=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=Xe.find(this.domNode);if(null==t)return;const e=Ge.keys(this.domNode),i=ti.keys(this.domNode),n=ii.keys(this.domNode);e.concat(i).concat(n).forEach((e=>{const i=t.scroll.query(e,We.ATTRIBUTE);i instanceof Ge&&(this.attributes[i.attrName]=i)}))}copy(t){Object.keys(this.attributes).forEach((e=>{const i=this.attributes[e].value(this.domNode);t.format(e,i)}))}move(t){this.copy(t),Object.keys(this.attributes).forEach((t=>{this.attributes[t].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t)),{})}},ri=class{constructor(t,e){this.scroll=t,this.domNode=e,Xe.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new Qe("Blot definition missing tagName");let e,i;return Array.isArray(this.tagName)?("string"==typeof t?(i=t.toUpperCase(),parseInt(i,10).toString()===i&&(i=parseInt(i,10))):"number"==typeof t&&(i=t),e="number"==typeof i?document.createElement(this.tagName[i-1]):i&&this.tagName.indexOf(i)>-1?document.createElement(i):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(){null!=this.parent&&this.parent.removeChild(this),Xe.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,i,n){const r=this.isolate(t,e);if(null!=this.scroll.query(i,We.BLOT)&&n)r.wrap(i,n);else if(null!=this.scroll.query(i,We.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);r.wrap(t),t.format(i,n)}}insertAt(t,e,i){const n=null==i?this.scroll.create("text",e):this.scroll.create(e,i),r=this.split(t);this.parent.insertBefore(n,r||void 0)}isolate(t,e){const i=this.split(t);if(null==i)throw new Error("Attempt to isolate at end");return i.split(e),i}length(){return 1}offset(t=this.parent){return null==this.parent||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(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(i,this.next||void 0),this.remove()),i}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const i="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(i,this.next||void 0),"function"!=typeof i.appendChild)throw new Qe(`Cannot wrap ${t}`);return i.appendChild(this),i}};ri.blotName="abstract";let si=ri;const li=class extends si{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 i=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(i+=1),[this.parent.domNode,i]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};li.scope=We.INLINE_BLOT;const oi=li;class ai{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 i=e();for(;i&&t>0;)t-=1,i=e();return i}contains(t){const e=this.iterator();let i=e();for(;i;){if(i===t)return!0;i=e()}return!1}indexOf(t){const e=this.iterator();let i=e(),n=0;for(;i;){if(i===t)return n;n+=1,i=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(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,i=this.head;for(;null!=i;){if(i===t)return e;e+=i.length(),i=i.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(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 null!=t&&(t=t.next),e}}find(t,e=!1){const i=this.iterator();let n=i();for(;n;){const r=n.length();if(t<r||e&&t===r&&(null==n.next||0!==n.next.length()))return[n,t];t-=r,n=i()}return[null,0]}forEach(t){const e=this.iterator();let i=e();for(;i;)t(i),i=e()}forEachAt(t,e,i){if(e<=0)return;const[n,r]=this.find(t);let s=t-r;const l=this.iterator(n);let o=l();for(;o&&s<t+e;){const n=o.length();t>s?i(o,t-s,Math.min(e,s+n-t)):i(o,0,Math.min(n,t+e-s)),s+=n,o=l()}}map(t){return this.reduce(((e,i)=>(e.push(t(i)),e)),[])}reduce(t,e){const i=this.iterator();let n=i();for(;n;)e=t(e,n),n=i();return e}}function ci(t,e){const i=e.find(t);if(i)return i;try{return e.create(t)}catch{const i=e.create(We.INLINE);return Array.from(t.childNodes).forEach((t=>{i.domNode.appendChild(t)})),t.parentNode&&t.parentNode.replaceChild(i.domNode,t),i.attach(),i}}const hi=class t extends si{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(e){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=e,t.uiClass&&this.uiNode.classList.add(t.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new ai,Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode)).reverse().forEach((t=>{try{const e=ci(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof Qe)return;throw t}}))}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,((t,e,i)=>{t.deleteAt(e,i)}))}descendant(e,i=0){const[n,r]=this.children.find(i);return null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e?[n,r]:n instanceof t?n.descendant(e,r):[null,-1]}descendants(e,i=0,n=Number.MAX_VALUE){let r=[],s=n;return this.children.forEachAt(i,n,((i,n,l)=>{(null==e.blotName&&e(i)||null!=e.blotName&&i instanceof e)&&r.push(i),i instanceof t&&(r=r.concat(i.descendants(e,n,s))),s-=l})),r}detach(){this.children.forEach((t=>{t.detach()})),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach((i=>{e||this.statics.allowedChildren.some((t=>i instanceof t))||(i.statics.scope===We.BLOCK_BLOT?(null!=i.next&&this.splitAfter(i),null!=i.prev&&this.splitAfter(i.prev),i.parent.unwrap(),e=!0):i instanceof t?i.unwrap():i.remove())}))}formatAt(t,e,i,n){this.children.forEachAt(t,e,((t,e,r)=>{t.formatAt(e,r,i,n)}))}insertAt(t,e,i){const[n,r]=this.children.find(t);if(n)n.insertAt(r,e,i);else{const t=null==i?this.scroll.create("text",e):this.scroll.create(e,i);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let i=null;this.children.insertBefore(t,e||null),t.parent=this,null!=e&&(i=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==i)&&this.domNode.insertBefore(t.domNode,i),t.attach()}length(){return this.children.reduce(((t,e)=>t+e.length()),0)}moveChildren(t,e){this.children.forEach((i=>{t.insertBefore(i,e)}))}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,i=!1){const[n,r]=this.children.find(e,i),s=[[this,e]];return n instanceof t?s.concat(n.path(r,i)):(null!=n&&s.push([n,r]),s)}removeChild(t){this.children.remove(t)}replaceWith(e,i){const n="string"==typeof e?this.scroll.create(e,i):e;return n instanceof t&&this.moveChildren(n),super.replaceWith(n)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const i=this.clone();return this.parent&&this.parent.insertBefore(i,this.next||void 0),this.children.forEachAt(t,this.length(),((t,n)=>{const r=t.split(n,e);null!=r&&i.appendChild(r)})),i}splitAfter(t){const e=this.clone();for(;null!=t.next;)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 i=[],n=[];t.forEach((t=>{t.target===this.domNode&&"childList"===t.type&&(i.push(...t.addedNodes),n.push(...t.removedNodes))})),n.forEach((t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null==e.domNode.parentNode||e.domNode.parentNode===this.domNode)&&e.detach()})),i.filter((t=>t.parentNode===this.domNode&&t!==this.uiNode)).sort(((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const i=ci(t,this.scroll);(i.next!==e||null==i.next)&&(null!=i.parent&&i.parent.removeChild(this),this.insertBefore(i,e||void 0))})),this.enforceAllowedChildren()}};hi.uiClass="";const ui=hi,di=class t extends ui{static create(t){return super.create(t)}static formats(e,i){const n=i.query(t.blotName);if(null==n||e.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new ni(this.domNode)}format(e,i){if(e!==this.statics.blotName||i){const t=this.scroll.query(e,We.INLINE);if(null==t)return;t instanceof Ge?this.attributes.attribute(t,i):i&&(e!==this.statics.blotName||this.formats()[e]!==i)&&this.replaceWith(e,i)}else this.children.forEach((e=>{e instanceof t||(e=e.wrap(t.blotName,!0)),this.attributes.copy(e)})),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,n){null!=this.formats()[i]||this.scroll.query(i,We.ATTRIBUTE)?this.isolate(t,e).format(i,n):super.formatAt(t,e,i,n)}optimize(e){super.optimize(e);const i=this.formats();if(0===Object.keys(i).length)return this.unwrap();const n=this.next;n instanceof t&&n.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}(i,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some((t=>t.target===this.domNode&&"attributes"===t.type))&&this.attributes.build()}wrap(e,i){const n=super.wrap(e,i);return n instanceof t&&this.attributes.move(n),n}};di.allowedChildren=[di,oi],di.blotName="inline",di.scope=We.INLINE_BLOT,di.tagName="SPAN";const fi=di,pi=class t extends ui{static create(t){return super.create(t)}static formats(e,i){const n=i.query(t.blotName);if(null==n||e.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new ni(this.domNode)}format(e,i){const n=this.scroll.query(e,We.BLOCK);null!=n&&(n instanceof Ge?this.attributes.attribute(n,i):e!==this.statics.blotName||i?i&&(e!==this.statics.blotName||this.formats()[e]!==i)&&this.replaceWith(e,i):this.replaceWith(t.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,i,n){null!=this.scroll.query(i,We.BLOCK)?this.format(i,n):super.formatAt(t,e,i,n)}insertAt(t,e,i){if(null==i||null!=this.scroll.query(e,We.INLINE))super.insertAt(t,e,i);else{const n=this.split(t);if(null==n)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,i);n.parent.insertBefore(t,n)}}}replaceWith(t,e){const i=super.replaceWith(t,e);return this.attributes.copy(i),i}update(t,e){super.update(t,e),t.some((t=>t.target===this.domNode&&"attributes"===t.type))&&this.attributes.build()}};pi.blotName="block",pi.scope=We.BLOCK_BLOT,pi.tagName="P",pi.allowedChildren=[fi,pi,oi];const qi=pi,bi=class extends ui{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,i,n){super.formatAt(t,e,i,n),this.enforceAllowedChildren()}insertAt(t,e,i){super.insertAt(t,e,i),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};bi.blotName="container",bi.scope=We.BLOCK_BLOT;const vi=bi,mi=class extends oi{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,i,n){0===t&&e===this.length()?this.format(i,n):super.formatAt(t,e,i,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}},gi={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},wi=class extends ui{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver((t=>{this.update(t)})),this.observer.observe(this.domNode,gi),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const i=this.registry.find(t,e);return i?i.scroll===this?i:e?this.find(i.scroll.domNode.parentNode,!0):null:null}query(t,e=We.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach((t=>{t.remove()})):super.deleteAt(t,e)}formatAt(t,e,i,n){this.update(),super.formatAt(t,e,i,n)}insertAt(t,e,i){this.update(),super.insertAt(t,e,i)}optimize(t=[],e={}){super.optimize(e);const i=e.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)t.push(n.pop());const r=(t,e=!0)=>{null==t||t===this||null!=t.domNode.parentNode&&(i.has(t.domNode)||i.set(t.domNode,[]),e&&r(t.parent))},s=t=>{i.has(t.domNode)&&(t instanceof ui&&t.children.forEach(s),i.delete(t.domNode),t.optimize(e))};let l=t;for(let e=0;l.length>0;e+=1){if(e>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach((t=>{const e=this.find(t,!1);r(e,!1),e instanceof ui&&e.children.forEach((t=>{r(t,!1)}))}))):"attributes"===t.type&&r(e.prev)),r(e))})),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),n=l.slice();n.length>0;)t.push(n.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const i=new WeakMap;t.map((t=>{const e=this.find(t.target,!0);return null==e?null:i.has(e.domNode)?(i.get(e.domNode).push(t),null):(i.set(e.domNode,[t]),e)})).forEach((t=>{null!=t&&t!==this&&i.has(t.domNode)&&t.update(i.get(t.domNode)||[],e)})),e.mutationsMap=i,i.has(this.domNode)&&super.update(i.get(this.domNode),e),this.optimize(t,e)}};wi.blotName="scroll",wi.defaultChild=qi,wi.allowedChildren=[qi,vi],wi.scope=We.BLOCK_BLOT,wi.tagName="DIV";const yi=wi,ki=class t extends oi{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,i){null==i?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,i)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&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(0===t)return this;if(t===this.length())return this.next}const i=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(i,this.next||void 0),this.text=this.statics.value(this.domNode),i}update(t,e){t.some((t=>"characterData"===t.type&&t.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};ki.blotName="text",ki.scope=We.INLINE_BLOT;const xi=ki;var ji=Object.freeze({__proto__:null,Attributor:Ge,AttributorStore:ni,BlockBlot:qi,ClassAttributor:ti,ContainerBlot:vi,EmbedBlot:mi,InlineBlot:fi,LeafBlot:oi,ParentBlot:ui,Registry:Xe,Scope:We,ScrollBlot:yi,StyleAttributor:ii,TextBlot:xi}),Ai="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mi,Ei,Ti={exports:{}};var _i,Ni={exports:{}};function Li(){return _i||(_i=1,function(t,e){var i="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",s="[object Boolean]",l="[object Date]",o="[object Function]",a="[object GeneratorFunction]",c="[object Map]",h="[object Number]",u="[object Object]",d="[object Promise]",f="[object RegExp]",p="[object Set]",q="[object String]",b="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",g="[object DataView]",w="[object Float32Array]",y="[object Float64Array]",k="[object Int8Array]",x="[object Int16Array]",j="[object Int32Array]",A="[object Uint8Array]",O="[object Uint8ClampedArray]",M="[object Uint16Array]",E="[object Uint32Array]",T=/\w*$/,_=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,L={};L[r]=L["[object Array]"]=L[m]=L[g]=L[s]=L[l]=L[w]=L[y]=L[k]=L[x]=L[j]=L[c]=L[h]=L[u]=L[f]=L[p]=L[q]=L[b]=L[A]=L[O]=L[M]=L[E]=!0,L["[object Error]"]=L[o]=L[v]=!1;var $="object"==typeof self&&self&&self.Object===Object&&self,z="object"==typeof Ai&&Ai&&Ai.Object===Object&&Ai||$||Function("return this")(),C=e&&!e.nodeType&&e,S=C&&t&&!t.nodeType&&t,B=S&&S.exports===C;function R(t,e){return t.set(e[0],e[1]),t}function H(t,e){return t.add(e),t}function D(t,e,i){for(var n=-1,r=t?t.length:0;++n<r;)i=e(i,t[n],n,t);return i}function V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function I(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function P(t,e){return function(i){return t(e(i))}}function F(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}var U=Array.prototype,Z=Function.prototype,K=Object.prototype,W=z["__core-js_shared__"],G=function(){var t=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Q=Z.toString,Y=K.hasOwnProperty,X=K.toString,J=RegExp("^"+Q.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=B?z.Buffer:void 0,et=z.Symbol,it=z.Uint8Array,nt=P(Object.getPrototypeOf,Object),rt=Object.create,st=K.propertyIsEnumerable,lt=U.splice,ot=Object.getOwnPropertySymbols,at=tt?tt.isBuffer:void 0,ct=P(Object.keys,Object),ht=$t(z,"DataView"),ut=$t(z,"Map"),dt=$t(z,"Promise"),ft=$t(z,"Set"),pt=$t(z,"WeakMap"),qt=$t(Object,"create"),bt=Rt(ht),vt=Rt(ut),mt=Rt(dt),gt=Rt(ft),wt=Rt(pt),yt=et?et.prototype:void 0,kt=yt?yt.valueOf:void 0;function xt(t){var e=-1,i=t?t.length:0;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function jt(t){var e=-1,i=t?t.length:0;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function At(t){var e=-1,i=t?t.length:0;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Ot(t){this.__data__=new jt(t)}function Mt(t,e,i){var n=t[e];Y.call(t,e)&&Ht(n,i)&&(void 0!==i||e in t)||(t[e]=i)}function Et(t,e){for(var i=t.length;i--;)if(Ht(t[i][0],e))return i;return-1}function Tt(t,e,i,n,d,v,_){var N;if(n&&(N=v?n(t,d,v,_):n(t)),void 0!==N)return N;if(!Ft(t))return t;var $=Dt(t);if($){if(N=function(t){var e=t.length,i=t.constructor(e);return e&&"string"==typeof t[0]&&Y.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t),!e)return function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}(t,N)}else{var z=Ct(t),C=z==o||z==a;if(It(t))return function(t,e){if(e)return t.slice();var i=new t.constructor(t.length);return t.copy(i),i}(t,e);if(z==u||z==r||C&&!v){if(V(t))return v?t:{};if(N=function(t){return"function"!=typeof t.constructor||Bt(t)?{}:Ft(e=nt(t))?rt(e):{};var e}(C?{}:t),!e)return function(t,e){return Nt(t,zt(t),e)}(t,function(t,e){return t&&Nt(e,Ut(e),t)}(N,t))}else{if(!L[z])return v?t:{};N=function(t,e,i,n){var r=t.constructor;switch(e){case m:return _t(t);case s:case l:return new r(+t);case g:return function(t,e){var i=e?_t(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,n);case w:case y:case k:case x:case j:case A:case O:case M:case E:return function(t,e){var i=e?_t(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}(t,n);case c:return function(t,e,i){return D(e?i(I(t),!0):I(t),R,new t.constructor)}(t,n,i);case h:case q:return new r(t);case f:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case p:return function(t,e,i){return D(e?i(F(t),!0):F(t),H,new t.constructor)}(t,n,i);case b:return kt?Object(kt.call(t)):{}}}(t,z,Tt,e)}}_||(_=new Ot);var S=_.get(t);if(S)return S;if(_.set(t,N),!$)var B=i?function(t){return function(t,e,i){var n=e(t);return Dt(t)?n:function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}(n,i(t))}(t,Ut,zt)}(t):Ut(t);return function(t,e){for(var i=-1,n=t?t.length:0;++i<n&&!1!==e(t[i],i););}(B||t,(function(r,s){B&&(r=t[s=r]),Mt(N,s,Tt(r,e,i,n,s,t,_))})),N}function _t(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Nt(t,e,i){i||(i={});for(var n=-1,r=e.length;++n<r;){var s=e[n];Mt(i,s,t[s])}return i}function Lt(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function $t(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Ft(t)||function(t){return!!G&&G in t}(t))&&(Pt(t)||V(t)?J:_).test(Rt(t))}(i)?i:void 0}xt.prototype.clear=function(){this.__data__=qt?qt(null):{}},xt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},xt.prototype.get=function(t){var e=this.__data__;if(qt){var n=e[t];return n===i?void 0:n}return Y.call(e,t)?e[t]:void 0},xt.prototype.has=function(t){var e=this.__data__;return qt?void 0!==e[t]:Y.call(e,t)},xt.prototype.set=function(t,e){return this.__data__[t]=qt&&void 0===e?i:e,this},jt.prototype.clear=function(){this.__data__=[]},jt.prototype.delete=function(t){var e=this.__data__,i=Et(e,t);return!(i<0||(i==e.length-1?e.pop():lt.call(e,i,1),0))},jt.prototype.get=function(t){var e=this.__data__,i=Et(e,t);return i<0?void 0:e[i][1]},jt.prototype.has=function(t){return Et(this.__data__,t)>-1},jt.prototype.set=function(t,e){var i=this.__data__,n=Et(i,t);return n<0?i.push([t,e]):i[n][1]=e,this},At.prototype.clear=function(){this.__data__={hash:new xt,map:new(ut||jt),string:new xt}},At.prototype.delete=function(t){return Lt(this,t).delete(t)},At.prototype.get=function(t){return Lt(this,t).get(t)},At.prototype.has=function(t){return Lt(this,t).has(t)},At.prototype.set=function(t,e){return Lt(this,t).set(t,e),this},Ot.prototype.clear=function(){this.__data__=new jt},Ot.prototype.delete=function(t){return this.__data__.delete(t)},Ot.prototype.get=function(t){return this.__data__.get(t)},Ot.prototype.has=function(t){return this.__data__.has(t)},Ot.prototype.set=function(t,e){var i=this.__data__;if(i instanceof jt){var n=i.__data__;if(!ut||n.length<199)return n.push([t,e]),this;i=this.__data__=new At(n)}return i.set(t,e),this};var zt=ot?P(ot,Object):function(){return[]},Ct=function(t){return X.call(t)};function St(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||N.test(t))&&t>-1&&t%1==0&&t<e}function Bt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||K)}function Rt(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(ht&&Ct(new ht(new ArrayBuffer(1)))!=g||ut&&Ct(new ut)!=c||dt&&Ct(dt.resolve())!=d||ft&&Ct(new ft)!=p||pt&&Ct(new pt)!=v)&&(Ct=function(t){var e=X.call(t),i=e==u?t.constructor:void 0,n=i?Rt(i):void 0;if(n)switch(n){case bt:return g;case vt:return c;case mt:return d;case gt:return p;case wt:return v}return e});var Dt=Array.isArray;function Vt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}(t.length)&&!Pt(t)}var It=at||function(){return!1};function Pt(t){var e=Ft(t)?X.call(t):"";return e==o||e==a}function Ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ut(t){return Vt(t)?function(t){var e=Dt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Vt(t)}(t)&&Y.call(t,"callee")&&(!st.call(t,"callee")||X.call(t)==r)}(t)?function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(t.length,String):[],i=e.length,n=!!i;for(var s in t)!Y.call(t,s)||n&&("length"==s||St(s,i))||e.push(s);return e}(t):function(t){if(!Bt(t))return ct(t);var e=[];for(var i in Object(t))Y.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t)}t.exports=function(t){return Tt(t,!0,!0)}}(Ni,Ni.exports)),Ni.exports}var $i,zi={exports:{}};function Ci(){return $i||($i=1,function(t,e){var i="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",s="[object Array]",l="[object Boolean]",o="[object Date]",a="[object Error]",c="[object Function]",h="[object Map]",u="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",q="[object Set]",b="[object String]",v="[object WeakMap]",m="[object ArrayBuffer]",g="[object DataView]",w=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[r]=k[s]=k[m]=k[l]=k[g]=k[o]=k[a]=k[c]=k[h]=k[u]=k[d]=k[p]=k[q]=k[b]=k[v]=!1;var x="object"==typeof Ai&&Ai&&Ai.Object===Object&&Ai,j="object"==typeof self&&self&&self.Object===Object&&self,A=x||j||Function("return this")(),O=e&&!e.nodeType&&e,M=O&&t&&!t.nodeType&&t,E=M&&M.exports===O,T=E&&x.process,_=function(){try{return T&&T.binding&&T.binding("util")}catch(t){}}(),N=_&&_.isTypedArray;function L(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}function $(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function z(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}var C=Array.prototype,S=Object.prototype,B=A["__core-js_shared__"],R=Function.prototype.toString,H=S.hasOwnProperty,D=function(){var t=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),V=S.toString,I=RegExp("^"+R.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=E?A.Buffer:void 0,F=A.Symbol,U=A.Uint8Array,Z=S.propertyIsEnumerable,K=C.splice,W=F?F.toStringTag:void 0,G=Object.getOwnPropertySymbols,Q=P?P.isBuffer:void 0,Y=function(t,e){return function(i){return t(e(i))}}(Object.keys,Object),X=xt(A,"DataView"),J=xt(A,"Map"),tt=xt(A,"Promise"),et=xt(A,"Set"),it=xt(A,"WeakMap"),nt=xt(Object,"create"),rt=Mt(X),st=Mt(J),lt=Mt(tt),ot=Mt(et),at=Mt(it),ct=F?F.prototype:void 0,ht=ct?ct.valueOf:void 0;function ut(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function dt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function ft(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function pt(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new ft;++e<i;)this.add(t[e])}function qt(t){var e=this.__data__=new dt(t);this.size=e.size}function bt(t,e){for(var i=t.length;i--;)if(Et(t[i][0],e))return i;return-1}function vt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":W&&W in Object(t)?function(t){var e=H.call(t,W),i=t[W];try{t[W]=void 0;var n=!0}catch(t){}var r=V.call(t);return n&&(e?t[W]=i:delete t[W]),r}(t):function(t){return V.call(t)}(t)}function mt(t){return Ct(t)&&vt(t)==r}function gt(t,e,i,n,c){return t===e||(null==t||null==e||!Ct(t)&&!Ct(e)?t!=t&&e!=e:function(t,e,i,n,c,f){var v=_t(t),w=_t(e),y=v?s:At(t),k=w?s:At(e),x=(y=y==r?d:y)==d,j=(k=k==r?d:k)==d,A=y==k;if(A&&Nt(t)){if(!Nt(e))return!1;v=!0,x=!1}if(A&&!x)return f||(f=new qt),v||St(t)?wt(t,e,i,n,c,f):function(t,e,i,n,r,s,c){switch(i){case g:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case m:return!(t.byteLength!=e.byteLength||!s(new U(t),new U(e)));case l:case o:case u:return Et(+t,+e);case a:return t.name==e.name&&t.message==e.message;case p:case b:return t==e+"";case h:var d=$;case q:if(d||(d=z),t.size!=e.size&&!(1&n))return!1;var f=c.get(t);if(f)return f==e;n|=2,c.set(t,e);var v=wt(d(t),d(e),n,r,s,c);return c.delete(t),v;case"[object Symbol]":if(ht)return ht.call(t)==ht.call(e)}return!1}(t,e,y,i,n,c,f);if(!(1&i)){var O=x&&H.call(t,"__wrapped__"),M=j&&H.call(e,"__wrapped__");if(O||M){var E=O?t.value():t,T=M?e.value():e;return f||(f=new qt),c(E,T,i,n,f)}}return!!A&&(f||(f=new qt),function(t,e,i,n,r,s){var l=1&i,o=yt(t),a=o.length;if(a!=yt(e).length&&!l)return!1;for(var c=a;c--;){var h=o[c];if(!(l?h in e:H.call(e,h)))return!1}var u=s.get(t);if(u&&s.get(e))return u==e;var d=!0;s.set(t,e),s.set(e,t);for(var f=l;++c<a;){var p=t[h=o[c]],q=e[h];if(n)var b=l?n(q,p,h,e,t,s):n(p,q,h,t,e,s);if(!(void 0===b?p===q||r(p,q,i,n,s):b)){d=!1;break}f||(f="constructor"==h)}if(d&&!f){var v=t.constructor,m=e.constructor;v==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof m&&m instanceof m||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,i,n,c,f))}(t,e,i,n,gt,c))}function wt(t,e,i,n,r,s){var l=1&i,o=t.length,a=e.length;if(o!=a&&!(l&&a>o))return!1;var c=s.get(t);if(c&&s.get(e))return c==e;var h=-1,u=!0,d=2&i?new pt:void 0;for(s.set(t,e),s.set(e,t);++h<o;){var f=t[h],p=e[h];if(n)var q=l?n(p,f,h,e,t,s):n(f,p,h,t,e,s);if(void 0!==q){if(q)continue;u=!1;break}if(d){if(!L(e,(function(t,e){if(!d.has(e)&&(f===t||r(f,t,i,n,s)))return d.push(e)}))){u=!1;break}}else if(f!==p&&!r(f,p,i,n,s)){u=!1;break}}return s.delete(t),s.delete(e),u}function yt(t){return function(t,e,i){var n=e(t);return _t(t)?n:function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}(n,i(t))}(t,Bt,jt)}function kt(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function xt(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!zt(t)||function(t){return!!D&&D in t}(t))&&(Lt(t)?I:w).test(Mt(t))}(i)?i:void 0}ut.prototype.clear=function(){this.__data__=nt?nt(null):{},this.size=0},ut.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ut.prototype.get=function(t){var e=this.__data__;if(nt){var n=e[t];return n===i?void 0:n}return H.call(e,t)?e[t]:void 0},ut.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:H.call(e,t)},ut.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nt&&void 0===e?i:e,this},dt.prototype.clear=function(){this.__data__=[],this.size=0},dt.prototype.delete=function(t){var e=this.__data__,i=bt(e,t);return!(i<0||(i==e.length-1?e.pop():K.call(e,i,1),--this.size,0))},dt.prototype.get=function(t){var e=this.__data__,i=bt(e,t);return i<0?void 0:e[i][1]},dt.prototype.has=function(t){return bt(this.__data__,t)>-1},dt.prototype.set=function(t,e){var i=this.__data__,n=bt(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},ft.prototype.clear=function(){this.size=0,this.__data__={hash:new ut,map:new(J||dt),string:new ut}},ft.prototype.delete=function(t){var e=kt(this,t).delete(t);return this.size-=e?1:0,e},ft.prototype.get=function(t){return kt(this,t).get(t)},ft.prototype.has=function(t){return kt(this,t).has(t)},ft.prototype.set=function(t,e){var i=kt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},pt.prototype.add=pt.prototype.push=function(t){return this.__data__.set(t,i),this},pt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.clear=function(){this.__data__=new dt,this.size=0},qt.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},qt.prototype.get=function(t){return this.__data__.get(t)},qt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.set=function(t,e){var i=this.__data__;if(i instanceof dt){var n=i.__data__;if(!J||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new ft(n)}return i.set(t,e),this.size=i.size,this};var jt=G?function(t){return null==t?[]:(t=Object(t),function(e){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var l=e[i];Z.call(t,l)&&(s[r++]=l)}return s}(G(t)))}:function(){return[]},At=vt;function Ot(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||y.test(t))&&t>-1&&t%1==0&&t<e}function Mt(t){if(null!=t){try{return R.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Et(t,e){return t===e||t!=t&&e!=e}(X&&At(new X(new ArrayBuffer(1)))!=g||J&&At(new J)!=h||tt&&At(tt.resolve())!=f||et&&At(new et)!=q||it&&At(new it)!=v)&&(At=function(t){var e=vt(t),i=e==d?t.constructor:void 0,n=i?Mt(i):"";if(n)switch(n){case rt:return g;case st:return h;case lt:return f;case ot:return q;case at:return v}return e});var Tt=mt(function(){return arguments}())?mt:function(t){return Ct(t)&&H.call(t,"callee")&&!Z.call(t,"callee")},_t=Array.isArray,Nt=Q||function(){return!1};function Lt(t){if(!zt(t))return!1;var e=vt(t);return e==c||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $t(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function zt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var St=N?function(t){return function(e){return t(e)}}(N):function(t){return Ct(t)&&$t(t.length)&&!!k[vt(t)]};function Bt(t){return null!=(e=t)&&$t(e.length)&&!Lt(e)?function(t){var e=_t(t),i=!e&&Tt(t),n=!e&&!i&&Nt(t),r=!e&&!i&&!n&&St(t),s=e||i||n||r,l=s?function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(t.length,String):[],o=l.length;for(var a in t)!H.call(t,a)||s&&("length"==a||n&&("offset"==a||"parent"==a)||r&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ot(a,o))||l.push(a);return l}(t):function(t){if((e=t)!==("function"==typeof(i=e&&e.constructor)&&i.prototype||S))return Y(t);var e,i,n=[];for(var r in Object(t))H.call(t,r)&&"constructor"!=r&&n.push(r);return n}(t);var e}t.exports=function(t,e){return gt(t,e)}}(zi,zi.exports)),zi.exports}var Si,Bi,Ri={},Hi={};function Di(){return Bi||(Bi=1,Object.defineProperty(Hi,"__esModule",{value:!0}),function(t){t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"object"==typeof t.retain&&null!==t.retain?1:"string"==typeof t.insert?t.insert.length:1}}(t||(t={})),Hi.default=t),Hi;var t}var Vi,Ii,Pi={},Fi=(Ii||(Ii=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const i=function(){if(Ei)return Mi;Ei=1;var t=-1;function e(d,f,p,q,v){if(d===f)return d?[[0,d]]:[];if(null!=p){var m=function(t,e,i){var n="number"==typeof i?{index:i,length:0}:i.oldRange,r="number"==typeof i?null:i.newRange,s=t.length,l=e.length;if(0===n.length&&(null===r||0===r.length)){var o=n.index,a=t.slice(0,o),c=t.slice(o),h=r?r.index:null,u=o+l-s;if((null===h||h===u)&&!(u<0||u>l)){var d=e.slice(0,u);if((q=e.slice(u))===c){var f=Math.min(o,u);if((m=a.slice(0,f))===(w=d.slice(0,f)))return b(m,a.slice(f),d.slice(f),c)}}if(null===h||h===o){var p=o,q=(d=e.slice(0,p),e.slice(p));if(d===a){var v=Math.min(s-p,l-p);if((g=c.slice(c.length-v))===(y=q.slice(q.length-v)))return b(a,c.slice(0,c.length-v),q.slice(0,q.length-v),g)}}}if(n.length>0&&r&&0===r.length){var m=t.slice(0,n.index),g=t.slice(n.index+n.length);if(!(l<(f=m.length)+(v=g.length))){var w=e.slice(0,f),y=e.slice(l-v);if(m===w&&g===y)return b(m,t.slice(f,s-v),e.slice(f,l-v),g)}}return null}(d,f,p);if(m)return m}var g=n(d,f),w=d.substring(0,g);g=s(d=d.substring(g),f=f.substring(g));var y=d.substring(d.length-g),k=function(r,l){var o;if(!r)return[[1,l]];if(!l)return[[t,r]];var a=r.length>l.length?r:l,c=r.length>l.length?l:r,h=a.indexOf(c);if(-1!==h)return o=[[1,a.substring(0,h)],[0,c],[1,a.substring(h+c.length)]],r.length>l.length&&(o[0][0]=o[2][0]=t),o;if(1===c.length)return[[t,r],[1,l]];var u=function(t,e){var i=t.length>e.length?t:e,r=t.length>e.length?e:t;if(i.length<4||2*r.length<i.length)return null;function l(t,e,i){for(var r,l,o,a,c=t.substring(i,i+Math.floor(t.length/4)),h=-1,u="";-1!==(h=e.indexOf(c,h+1));){var d=n(t.substring(i),e.substring(h)),f=s(t.substring(0,i),e.substring(0,h));u.length<f+d&&(u=e.substring(h-f,h)+e.substring(h,h+d),r=t.substring(0,i-f),l=t.substring(i+d),o=e.substring(0,h-f),a=e.substring(h+d))}return 2*u.length>=t.length?[r,l,o,a,u]:null}var o,a,c,h,u,d=l(i,r,Math.ceil(i.length/4)),f=l(i,r,Math.ceil(i.length/2));return d||f?(o=f?d&&d[4].length>f[4].length?d:f:d,t.length>e.length?(a=o[0],c=o[1],h=o[2],u=o[3]):(h=o[0],u=o[1],a=o[2],c=o[3]),[a,c,h,u,o[4]]):null}(r,l);if(u){var d=u[1],f=u[3],p=u[4],q=e(u[0],u[2]),b=e(d,f);return q.concat([[0,p]],b)}return function(e,n){for(var r=e.length,s=n.length,l=Math.ceil((r+s)/2),o=l,a=2*l,c=new Array(a),h=new Array(a),u=0;u<a;u++)c[u]=-1,h[u]=-1;c[o+1]=0,h[o+1]=0;for(var d=r-s,f=d%2!=0,p=0,q=0,b=0,v=0,m=0;m<l;m++){for(var g=-m+p;g<=m-q;g+=2){for(var w=o+g,y=(O=g===-m||g!==m&&c[w-1]<c[w+1]?c[w+1]:c[w-1]+1)-g;O<r&&y<s&&e.charAt(O)===n.charAt(y);)O++,y++;if(c[w]=O,O>r)q+=2;else if(y>s)p+=2;else if(f&&(j=o+d-g)>=0&&j<a&&-1!==h[j]&&O>=(x=r-h[j]))return i(e,n,O,y)}for(var k=-m+b;k<=m-v;k+=2){for(var x,j=o+k,A=(x=k===-m||k!==m&&h[j-1]<h[j+1]?h[j+1]:h[j-1]+1)-k;x<r&&A<s&&e.charAt(r-x-1)===n.charAt(s-A-1);)x++,A++;if(h[j]=x,x>r)v+=2;else if(A>s)b+=2;else if(!f){var O;if((w=o+d-k)>=0&&w<a&&-1!==c[w]&&(y=o+(O=c[w])-w,O>=(x=r-x)))return i(e,n,O,y)}}}return[[t,e],[1,n]]}(r,l)}(d=d.substring(0,d.length-g),f=f.substring(0,f.length-g));return w&&k.unshift([0,w]),y&&k.push([0,y]),u(k,v),q&&function(e){for(var i=!1,n=[],d=0,f=null,p=0,q=0,b=0,v=0,m=0;p<e.length;)0==e[p][0]?(n[d++]=p,q=v,b=m,v=0,m=0,f=e[p][1]):(1==e[p][0]?v+=e[p][1].length:m+=e[p][1].length,f&&f.length<=Math.max(q,b)&&f.length<=Math.max(v,m)&&(e.splice(n[d-1],0,[t,f]),e[n[d-1]+1][0]=1,d--,p=--d>0?n[d-1]:-1,q=0,b=0,v=0,m=0,f=null,i=!0)),p++;for(i&&u(e),function(t){function e(t,e){if(!t||!e)return 6;var i=t.charAt(t.length-1),n=e.charAt(0),r=i.match(l),s=n.match(l),u=r&&i.match(o),d=s&&n.match(o),f=u&&i.match(a),p=d&&n.match(a),q=f&&t.match(c),b=p&&e.match(h);return q||b?5:f||p?4:r&&!u&&d?3:u||d?2:r||s?1:0}for(var i=1;i<t.length-1;){if(0==t[i-1][0]&&0==t[i+1][0]){var n=t[i-1][1],r=t[i][1],u=t[i+1][1],d=s(n,r);if(d){var f=r.substring(r.length-d);n=n.substring(0,n.length-d),r=f+r.substring(0,r.length-d),u=f+u}for(var p=n,q=r,b=u,v=e(n,r)+e(r,u);r.charAt(0)===u.charAt(0);){n+=r.charAt(0),r=r.substring(1)+u.charAt(0),u=u.substring(1);var m=e(n,r)+e(r,u);m>=v&&(v=m,p=n,q=r,b=u)}t[i-1][1]!=p&&(p?t[i-1][1]=p:(t.splice(i-1,1),i--),t[i][1]=q,b?t[i+1][1]=b:(t.splice(i+1,1),i--))}i++}}(e),p=1;p<e.length;){if(e[p-1][0]==t&&1==e[p][0]){var g=e[p-1][1],w=e[p][1],y=r(g,w),k=r(w,g);y>=k?(y>=g.length/2||y>=w.length/2)&&(e.splice(p,0,[0,w.substring(0,y)]),e[p-1][1]=g.substring(0,g.length-y),e[p+1][1]=w.substring(y),p++):(k>=g.length/2||k>=w.length/2)&&(e.splice(p,0,[0,g.substring(0,k)]),e[p-1][0]=1,e[p-1][1]=w.substring(0,w.length-k),e[p+1][0]=t,e[p+1][1]=g.substring(k),p++),p++}p++}}(k),k}function i(t,i,n,r){var s=t.substring(0,n),l=i.substring(0,r),o=t.substring(n),a=i.substring(r),c=e(s,l),h=e(o,a);return c.concat(h)}function n(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var i=0,n=Math.min(t.length,e.length),r=n,s=0;i<r;)t.substring(s,r)==e.substring(s,r)?s=i=r:n=r,r=Math.floor((n-i)/2+i);return d(t.charCodeAt(r-1))&&r--,r}function r(t,e){var i=t.length,n=e.length;if(0==i||0==n)return 0;i>n?t=t.substring(i-n):i<n&&(e=e.substring(0,i));var r=Math.min(i,n);if(t==e)return r;for(var s=0,l=1;;){var o=t.substring(r-l),a=e.indexOf(o);if(-1==a)return s;l+=a,0!=a&&t.substring(r-l)!=e.substring(0,l)||(s=l,l++)}}function s(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var i=0,n=Math.min(t.length,e.length),r=n,s=0;i<r;)t.substring(t.length-r,t.length-s)==e.substring(e.length-r,e.length-s)?s=i=r:n=r,r=Math.floor((n-i)/2+i);return f(t.charCodeAt(t.length-r))&&r--,r}var l=/[^a-zA-Z0-9]/,o=/\s/,a=/[\r\n]/,c=/\n\r?\n$/,h=/^\r?\n\r?\n/;function u(e,i){e.push([0,""]);for(var r,l=0,o=0,a=0,c="",h="";l<e.length;)if(l<e.length-1&&!e[l][1])e.splice(l,1);else switch(e[l][0]){case 1:a++,h+=e[l][1],l++;break;case t:o++,c+=e[l][1],l++;break;case 0:var d=l-a-o-1;if(i){if(d>=0&&q(e[d][1])){var f=e[d][1].slice(-1);if(e[d][1]=e[d][1].slice(0,-1),c=f+c,h=f+h,!e[d][1]){e.splice(d,1),l--;var b=d-1;e[b]&&1===e[b][0]&&(a++,h=e[b][1]+h,b--),e[b]&&e[b][0]===t&&(o++,c=e[b][1]+c,b--),d=b}}p(e[l][1])&&(f=e[l][1].charAt(0),e[l][1]=e[l][1].slice(1),c+=f,h+=f)}if(l<e.length-1&&!e[l][1]){e.splice(l,1);break}if(c.length>0||h.length>0){c.length>0&&h.length>0&&(0!==(r=n(h,c))&&(d>=0?e[d][1]+=h.substring(0,r):(e.splice(0,0,[0,h.substring(0,r)]),l++),h=h.substring(r),c=c.substring(r)),0!==(r=s(h,c))&&(e[l][1]=h.substring(h.length-r)+e[l][1],h=h.substring(0,h.length-r),c=c.substring(0,c.length-r)));var v=a+o;0===c.length&&0===h.length?(e.splice(l-v,v),l-=v):0===c.length?(e.splice(l-v,v,[1,h]),l=l-v+1):0===h.length?(e.splice(l-v,v,[t,c]),l=l-v+1):(e.splice(l-v,v,[t,c],[1,h]),l=l-v+2)}0!==l&&0===e[l-1][0]?(e[l-1][1]+=e[l][1],e.splice(l,1)):l++,a=0,o=0,c="",h=""}""===e[e.length-1][1]&&e.pop();var m=!1;for(l=1;l<e.length-1;)0===e[l-1][0]&&0===e[l+1][0]&&(e[l][1].substring(e[l][1].length-e[l-1][1].length)===e[l-1][1]?(e[l][1]=e[l-1][1]+e[l][1].substring(0,e[l][1].length-e[l-1][1].length),e[l+1][1]=e[l-1][1]+e[l+1][1],e.splice(l-1,1),m=!0):e[l][1].substring(0,e[l+1][1].length)==e[l+1][1]&&(e[l-1][1]+=e[l+1][1],e[l][1]=e[l][1].substring(e[l+1][1].length)+e[l+1][1],e.splice(l+1,1),m=!0)),l++;m&&u(e,i)}function d(t){return t>=55296&&t<=56319}function f(t){return t>=56320&&t<=57343}function p(t){return f(t.charCodeAt(0))}function q(t){return d(t.charCodeAt(t.length-1))}function b(e,i,n,r){return q(e)||p(r)?null:function(t){for(var e=[],i=0;i<t.length;i++)t[i][1].length>0&&e.push(t[i]);return e}([[0,e],[t,i],[1,n],[0,r]])}function v(t,i,n,r){return e(t,i,n,r,!0)}return v.INSERT=1,v.DELETE=t,v.EQUAL=0,Mi=v}(),n=Li(),r=Ci(),s=function(){if(Si)return Ri;Si=1,Object.defineProperty(Ri,"__esModule",{value:!0});const t=Li(),e=Ci();var i;return function(i){i.compose=function(e={},i={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof i&&(i={});let r=t(i);n||(r=Object.keys(r).reduce(((t,e)=>(null!=r[e]&&(t[e]=r[e]),t)),{}));for(const t in e)void 0!==e[t]&&void 0===i[t]&&(r[t]=e[t]);return Object.keys(r).length>0?r:void 0},i.diff=function(t={},i={}){"object"!=typeof t&&(t={}),"object"!=typeof i&&(i={});const n=Object.keys(t).concat(Object.keys(i)).reduce(((n,r)=>(e(t[r],i[r])||(n[r]=void 0===i[r]?null:i[r]),n)),{});return Object.keys(n).length>0?n:void 0},i.invert=function(t={},e={}){t=t||{};const i=Object.keys(e).reduce(((i,n)=>(e[n]!==t[n]&&void 0!==t[n]&&(i[n]=e[n]),i)),{});return Object.keys(t).reduce(((i,n)=>(t[n]!==e[n]&&void 0===e[n]&&(i[n]=null),i)),i)},i.transform=function(t,e,i=!1){if("object"!=typeof t)return e;if("object"!=typeof e)return;if(!i)return e;const n=Object.keys(e).reduce(((i,n)=>(void 0===t[n]&&(i[n]=e[n]),i)),{});return Object.keys(n).length>0?n:void 0}}(i||(i={})),Ri.default=i,Ri}();e.AttributeMap=s.default;const l=Di();e.Op=l.default;const o=function(){if(Vi)return Pi;Vi=1,Object.defineProperty(Pi,"__esModule",{value:!0});const t=Di();return Pi.default=class{constructor(t){this.ops=t,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const i=this.ops[this.index];if(i){const n=this.offset,r=t.default.length(i);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof i.delete)return{delete:e};{const t={};return i.attributes&&(t.attributes=i.attributes),"number"==typeof i.retain?t.retain=e:"object"==typeof i.retain&&null!==i.retain?t.retain=i.retain:t.insert="string"==typeof i.insert?i.insert.substr(n,e):i.insert,t}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const t=this.ops[this.index];return t?"number"==typeof t.delete?"delete":"number"==typeof t.retain||"object"==typeof t.retain&&null!==t.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const t=this.offset,e=this.index,i=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[i].concat(n)}}return[]}},Pi}();e.OpIterator=o.default;const a=String.fromCharCode(0),c=(t,e)=>{if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);const i=Object.keys(t)[0];if(!i||i!==Object.keys(e)[0])throw new Error(`embed types not matched: ${i} != ${Object.keys(e)[0]}`);return[i,t[i],e[i]]};class h{constructor(t){this.ops=Array.isArray(t)?t:null!=t&&Array.isArray(t.ops)?t.ops:[]}static registerEmbed(t,e){this.handlers[t]=e}static unregisterEmbed(t){delete this.handlers[t]}static getHandler(t){const e=this.handlers[t];if(!e)throw new Error(`no handlers for embed type "${t}"`);return e}insert(t,e){const i={};return"string"==typeof t&&0===t.length?this:(i.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i))}delete(t){return t<=0?this:this.push({delete:t})}retain(t,e){if("number"==typeof t&&t<=0)return this;const i={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(i.attributes=e),this.push(i)}push(t){let e=this.ops.length,i=this.ops[e-1];if(t=n(t),"object"==typeof i){if("number"==typeof t.delete&&"number"==typeof i.delete)return this.ops[e-1]={delete:i.delete+t.delete},this;if("number"==typeof i.delete&&null!=t.insert&&(e-=1,i=this.ops[e-1],"object"!=typeof i))return this.ops.unshift(t),this;if(r(t.attributes,i.attributes)){if("string"==typeof t.insert&&"string"==typeof i.insert)return this.ops[e-1]={insert:i.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof i.retain)return this.ops[e-1]={retain:i.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this}chop(){const t=this.ops[this.ops.length-1];return t&&"number"==typeof t.retain&&!t.attributes&&this.ops.pop(),this}filter(t){return this.ops.filter(t)}forEach(t){this.ops.forEach(t)}map(t){return this.ops.map(t)}partition(t){const e=[],i=[];return this.forEach((n=>{(t(n)?e:i).push(n)})),[e,i]}reduce(t,e){return this.ops.reduce(t,e)}changeLength(){return this.reduce(((t,e)=>e.insert?t+l.default.length(e):e.delete?t-e.delete:t),0)}length(){return this.reduce(((t,e)=>t+l.default.length(e)),0)}slice(t=0,e=1/0){const i=[],n=new o.default(this.ops);let r=0;for(;r<e&&n.hasNext();){let s;r<t?s=n.next(t-r):(s=n.next(e-r),i.push(s)),r+=l.default.length(s)}return new h(i)}compose(t){const e=new o.default(this.ops),i=new o.default(t.ops),n=[],l=i.peek();if(null!=l&&"number"==typeof l.retain&&null==l.attributes){let t=l.retain;for(;"insert"===e.peekType()&&e.peekLength()<=t;)t-=e.peekLength(),n.push(e.next());l.retain-t>0&&i.next(l.retain-t)}const a=new h(n);for(;e.hasNext()||i.hasNext();)if("insert"===i.peekType())a.push(i.next());else if("delete"===e.peekType())a.push(e.next());else{const t=Math.min(e.peekLength(),i.peekLength()),n=e.next(t),l=i.next(t);if(l.retain){const o={};if("number"==typeof n.retain)o.retain="number"==typeof l.retain?t:l.retain;else if("number"==typeof l.retain)null==n.retain?o.insert=n.insert:o.retain=n.retain;else{const t=null==n.retain?"insert":"retain",[e,i,r]=c(n[t],l.retain),s=h.getHandler(e);o[t]={[e]:s.compose(i,r,"retain"===t)}}const u=s.default.compose(n.attributes,l.attributes,"number"==typeof n.retain);if(u&&(o.attributes=u),a.push(o),!i.hasNext()&&r(a.ops[a.ops.length-1],o)){const t=new h(e.rest());return a.concat(t).chop()}}else"number"==typeof l.delete&&("number"==typeof n.retain||"object"==typeof n.retain&&null!==n.retain)&&a.push(l)}return a.chop()}concat(t){const e=new h(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e}diff(t,e){if(this.ops===t.ops)return new h;const n=[this,t].map((e=>e.map((i=>{if(null!=i.insert)return"string"==typeof i.insert?i.insert:a;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")})).join(""))),l=new h,c=i(n[0],n[1],e,!0),u=new o.default(this.ops),d=new o.default(t.ops);return c.forEach((t=>{let e=t[1].length;for(;e>0;){let n=0;switch(t[0]){case i.INSERT:n=Math.min(d.peekLength(),e),l.push(d.next(n));break;case i.DELETE:n=Math.min(e,u.peekLength()),u.next(n),l.delete(n);break;case i.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),e);const t=u.next(n),o=d.next(n);r(t.insert,o.insert)?l.retain(n,s.default.diff(t.attributes,o.attributes)):l.push(o).delete(n)}e-=n}})),l.chop()}eachLine(t,e="\n"){const i=new o.default(this.ops);let n=new h,r=0;for(;i.hasNext();){if("insert"!==i.peekType())return;const s=i.peek(),o=l.default.length(s)-i.peekLength(),a="string"==typeof s.insert?s.insert.indexOf(e,o)-o:-1;if(a<0)n.push(i.next());else if(a>0)n.push(i.next(a));else{if(!1===t(n,i.next(1).attributes||{},r))return;r+=1,n=new h}}n.length()>0&&t(n,{},r)}invert(t){const e=new h;return this.reduce(((i,n)=>{if(n.insert)e.delete(l.default.length(n));else{if("number"==typeof n.retain&&null==n.attributes)return e.retain(n.retain),i+n.retain;if(n.delete||"number"==typeof n.retain){const r=n.delete||n.retain;return t.slice(i,i+r).forEach((t=>{n.delete?e.push(t):n.retain&&n.attributes&&e.retain(l.default.length(t),s.default.invert(n.attributes,t.attributes))})),i+r}if("object"==typeof n.retain&&null!==n.retain){const r=t.slice(i,i+1),l=new o.default(r.ops).next(),[a,u,d]=c(n.retain,l.insert),f=h.getHandler(a);return e.retain({[a]:f.invert(u,d)},s.default.invert(n.attributes,l.attributes)),i+1}}return i}),0),e.chop()}transform(t,e=!1){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);const i=t,n=new o.default(this.ops),r=new o.default(i.ops),a=new h;for(;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())a.push(r.next());else{const t=Math.min(n.peekLength(),r.peekLength()),i=n.next(t),l=r.next(t);if(i.delete)continue;if(l.delete)a.push(l);else{const n=i.retain,r=l.retain;let o="object"==typeof r&&null!==r?r:t;if("object"==typeof n&&null!==n&&"object"==typeof r&&null!==r){const t=Object.keys(n)[0];if(t===Object.keys(r)[0]){const i=h.getHandler(t);i&&(o={[t]:i.transform(n[t],r[t],e)})}}a.retain(o,s.default.transform(i.attributes,l.attributes,e))}}else a.retain(l.default.length(n.next()));return a.chop()}transformPosition(t,e=!1){e=!!e;const i=new o.default(this.ops);let n=0;for(;i.hasNext()&&n<=t;){const r=i.peekLength(),s=i.peekType();i.next(),"delete"!==s?("insert"===s&&(n<t||!e)&&(t+=r),n+=r):t-=Math.min(r,t-n)}return t}}h.Op=l.default,h.OpIterator=o.default,h.AttributeMap=s.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h}(Ti,Ti.exports)),Ti.exports),Ui=Oi(Fi);class Zi extends mi{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Zi.blotName="break",Zi.tagName="BR";let Ki=class extends xi{};const Wi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Gi(t){return t.replace(/[&<>"']/g,(t=>Wi[t]))}class Qi extends fi{static allowedChildren=[Qi,Zi,mi,Ki];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,e){const i=Qi.order.indexOf(t),n=Qi.order.indexOf(e);return i>=0||n>=0?i-n:t===e?0:t<e?-1:1}formatAt(t,e,i,n){if(Qi.compare(this.statics.blotName,i)<0&&this.scroll.query(i,We.BLOT)){const r=this.isolate(t,e);n&&r.wrap(i,n)}else super.formatAt(t,e,i,n)}optimize(t){if(super.optimize(t),this.parent instanceof Qi&&Qi.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}class Yi extends qi{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=Ji(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,i,n){e<=0||(this.scroll.query(i,We.BLOCK)?t+e===this.length()&&this.format(i,n):super.formatAt(t,Math.min(e,this.length()-t-1),i,n),this.cache={})}insertAt(t,e,i){if(null!=i)return super.insertAt(t,e,i),void(this.cache={});if(0===e.length)return;const n=e.split("\n"),r=n.shift();r.length>0&&(t<this.length()-1||null==this.children.tail?super.insertAt(Math.min(t,this.length()-1),r):this.children.tail.insertAt(this.children.tail.length(),r),this.cache={});let s=this;n.reduce(((t,e)=>(s=s.split(t,!0),s.insertAt(0,e),e.length)),t+r.length)}insertBefore(t,e){const{head:i}=this.children;super.insertBefore(t,e),i instanceof Zi&&i.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(t,e){super.moveChildren(t,e),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-1)){const e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}const i=super.split(t,e);return this.cache={},i}}Yi.blotName="block",Yi.tagName="P",Yi.defaultChild=Zi,Yi.allowedChildren=[Zi,Qi,mi,Ki];class Xi extends mi{attach(){super.attach(),this.attributes=new ni(this.domNode)}delta(){return(new Ui).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const i=this.scroll.query(t,We.BLOCK_ATTRIBUTE);null!=i&&this.attributes.attribute(i,e)}formatAt(t,e,i,n){this.format(i,n)}insertAt(t,e,i){if(null!=i)return void super.insertAt(t,e,i);const n=e.split("\n"),r=n.pop(),s=n.map((t=>{const e=this.scroll.create(Yi.blotName);return e.insertAt(0,t),e})),l=this.split(t);s.forEach((t=>{this.parent.insertBefore(t,l)})),r&&this.parent.insertBefore(this.scroll.create("text",r),l)}}function Ji(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.descendants(oi).reduce(((t,i)=>0===i.length()?t:t.insert(i.value(),tn(i,{},e))),new Ui).insert("\n",tn(t))}function tn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==t?e:("formats"in t&&"function"==typeof t.formats&&(e={...e,...t.formats()},i&&delete e["code-token"]),null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:tn(t.parent,e,i))}Xi.scope=We.BLOCK_BLOT;class en extends mi{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(t,e,i){super(t,e),this.selection=i,this.textNode=document.createTextNode(en.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,e){if(0!==this.savedLength)return void super.format(t,e);let i=this,n=0;for(;null!=i&&i.statics.scope!==We.BLOCK_BLOT;)n+=i.offset(i.parent),i=i.parent;null!=i&&(this.savedLength=en.CONTENTS.length,i.optimize(),i.formatAt(n,en.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||null==this.parent)return null;const t=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof Ki?this.prev:null,i=e?e.length():0,n=this.next instanceof Ki?this.next:null,r=n?n.text:"",{textNode:s}=this,l=s.data.split(en.CONTENTS).join("");let o;if(s.data=en.CONTENTS,e)o=e,(l||n)&&(e.insertAt(e.length(),l+r),n&&n.remove());else if(n)o=n,n.insertAt(0,l);else{const t=document.createTextNode(l);o=this.scroll.create(t),this.parent.insertBefore(o,this)}if(this.remove(),t){const r=(t,r)=>e&&t===e.domNode?r:t===s?i+r-1:n&&t===n.domNode?i+l.length+r:null,a=r(t.start.node,t.start.offset),c=r(t.end.node,t.end.offset);if(null!==a&&null!==c)return{startNode:o.domNode,startOffset:a,endNode:o.domNode,endOffset:c}}return null}update(t,e){if(t.some((t=>"characterData"===t.type&&t.target===this.textNode))){const t=this.restore();t&&(e.range=t)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if("A"===e.domNode.tagName){this.savedLength=en.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}}var nn,rn={exports:{}},sn=(nn||(nn=1,function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,l){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,l),a=i?i+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=this._events[i?i+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,s=new Array(r);n<r;n++)s[n]=e[n].fn;return s},o.prototype.listenerCount=function(t){var e=this._events[i?i+t:t];return e?e.fn?1:e.length:0},o.prototype.emit=function(t,e,n,r,s,l){var o=i?i+t:t;if(!this._events[o])return!1;var a,c,h=this._events[o],u=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),u){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,n),!0;case 4:return h.fn.call(h.context,e,n,r),!0;case 5:return h.fn.call(h.context,e,n,r,s),!0;case 6:return h.fn.call(h.context,e,n,r,s,l),!0}for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];h.fn.apply(h.context,a)}else{var d,f=h.length;for(c=0;c<f;c++)switch(h[c].once&&this.removeListener(t,h[c].fn,void 0,!0),u){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,e);break;case 3:h[c].fn.call(h[c].context,e,n);break;case 4:h[c].fn.call(h[c].context,e,n,r);break;default:if(!a)for(d=1,a=new Array(u-1);d<u;d++)a[d-1]=arguments[d];h[c].fn.apply(h[c].context,a)}}return!0},o.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return l(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||l(this,s);else{for(var a=0,c=[],h=o.length;a<h;a++)(o[a].fn!==e||r&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=1===c.length?c[0]:c:l(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?this._events[e=i?i+t:t]&&l(this,e):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(rn)),rn.exports),ln=Oi(sn),on=new WeakMap;const an=["error","warn","log","info"];let cn="warn";function hn(t){if(cn&&an.indexOf(t)<=an.indexOf(cn)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];console[t](...i)}}function un(t){return an.reduce(((e,i)=>(e[i]=hn.bind(console,i,t),e)),{})}hn.level=un.level=t=>{cn=t};const dn=un("quill:events");["selectionchange","mousedown","mouseup","click"].forEach((t=>{document.addEventListener(t,(function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];Array.from(document.querySelectorAll(".ql-container")).forEach((t=>{const i=on.get(t);i&&i.emitter&&i.emitter.handleDOM(...e)}))}))}));class fn extends ln{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",dn.error)}emit(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return dn.log.call(dn,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(this.domListeners[t.type]||[]).forEach((e=>{let{node:n,handler:r}=e;(t.target===n||n.contains(t.target))&&r(t,...i)}))}listenDOM(t,e,i){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:i})}}const pn=un("quill:selection");class qn{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class bn{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 qn(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,fn.sources.USER),1)})),this.emitter.on(fn.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const t=this.getNativeRange();null!=t&&t.start.node!==this.cursor.textNode&&this.emitter.once(fn.events.SCROLL_UPDATE,((e,i)=>{try{this.root.contains(t.start.node)&&this.root.contains(t.end.node)&&this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset);const n=i.some((t=>"characterData"===t.type||"childList"===t.type||"attributes"===t.type&&t.target===this.root));this.update(n?fn.sources.SILENT:e)}catch(t){}}))})),this.emitter.on(fn.events.SCROLL_OPTIMIZE,((t,e)=>{if(e.range){const{startNode:t,startOffset:i,endNode:n,endOffset:r}=e.range;this.setNativeRange(t,i,n,r),this.update(fn.sources.SILENT)}})),this.update(fn.sources.SILENT)}handleComposition(){this.emitter.on(fn.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(fn.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(fn.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const i=this.getNativeRange();if(null!=i&&i.native.collapsed&&!this.scroll.query(t,We.BLOCK)){if(i.start.node!==this.cursor.textNode){const t=this.scroll.find(i.start.node,!1);if(null==t)return;if(t instanceof oi){const e=t.split(i.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,i.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&&void 0!==arguments[1]?arguments[1]:0;const i=this.scroll.length();let n;t=Math.min(t,i-1),e=Math.min(t+e,i-1)-t;let[r,s]=this.scroll.leaf(t);if(null==r)return null;if(e>0&&s===r.length()){const[e]=this.scroll.leaf(t+1);if(e){const[i]=this.scroll.line(t),[n]=this.scroll.line(t+1);i===n&&(r=e,s=0)}}[n,s]=r.position(s,!0);const l=document.createRange();if(e>0)return l.setStart(n,s),[r,s]=this.scroll.leaf(t+e),null==r?null:([n,s]=r.position(s,!0),l.setEnd(n,s),l.getBoundingClientRect());let o,a="left";if(n instanceof Text){if(!n.data.length)return null;s<n.data.length?(l.setStart(n,s),l.setEnd(n,s+1)):(l.setStart(n,s-1),l.setEnd(n,s),a="right"),o=l.getBoundingClientRect()}else{if(!(r.domNode instanceof Element))return null;o=r.domNode.getBoundingClientRect(),s>0&&(a="right")}return{bottom:o.top+o.height,height:o.height,left:o[a],right:o[a],top:o.top,width:0}}getNativeRange(){const t=document.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;const i=this.normalizeNative(e);return pn.info("getNativeRange",i),i}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&vn(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 i=e.map((t=>{const[e,i]=t,n=this.scroll.find(e,!0),r=n.offset(this.scroll);return 0===i?r:n instanceof oi?r+n.index(e,i):r+n.length()})),n=Math.min(Math.max(...i),this.scroll.length()-1),r=Math.min(n,...i);return new qn(r,n-r)}normalizeNative(t){if(!vn(this.root,t.startContainer)||!t.collapsed&&!vn(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((t=>{let{node:e,offset:i}=t;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>i)e=e.childNodes[i],i=0;else{if(e.childNodes.length!==i)break;e=e.lastChild,i=e instanceof Text?e.data.length:e.childNodes.length>0?e.childNodes.length:e.childNodes.length+1}t.node=e,t.offset=i})),e}rangeToNative(t){const e=this.scroll.length(),i=(t,i)=>{t=Math.min(e-1,t);const[n,r]=this.scroll.leaf(t);return n?n.position(r,i):[null,-1]};return[...i(t.index,!1),...i(t.index+t.length,!0)]}setNativeRange(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(pn.info("setNativeRange",t,e,i,n),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==i.parentNode))return;const s=document.getSelection();if(null!=s)if(null!=t){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:l}=this.getNativeRange()||{};if(null==l||r||t!==l.startContainer||e!==l.startOffset||i!==l.endContainer||n!==l.endOffset){t instanceof Element&&"BR"===t.tagName&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),i instanceof Element&&"BR"===i.tagName&&(n=Array.from(i.parentNode.childNodes).indexOf(i),i=i.parentNode);const r=document.createRange();r.setStart(t,e),r.setEnd(i,n),s.removeAllRanges(),s.addRange(r)}}else s.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fn.sources.API;if("string"==typeof e&&(i=e,e=!1),pn.info("setRange",t),null!=t){const i=this.rangeToNative(t);this.setNativeRange(...i,e)}else this.setNativeRange(null);this.update(i)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fn.sources.USER;const e=this.lastRange,[i,n]=this.getRange();if(this.lastRange=i,this.lastNative=n,null!=this.lastRange&&(this.savedRange=this.lastRange),!Ue(e,this.lastRange)){if(!this.composing&&null!=n&&n.native.collapsed&&n.start.node!==this.cursor.textNode){const t=this.cursor.restore();t&&this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}const i=[fn.events.SELECTION_CHANGE,Me(this.lastRange),Me(e),t];this.emitter.emit(fn.events.EDITOR_CHANGE,...i),t!==fn.sources.SILENT&&this.emitter.emit(...i)}}}function vn(t,e){return t.contains(e)}const mn=/^[ -~]*$/;class gn{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const i=jn(t),n=new Ui;return function(t){const e=[];return t.forEach((t=>{"string"==typeof t.insert?t.insert.split("\n").forEach(((i,n)=>{n&&e.push({insert:"\n",attributes:t.attributes}),i&&e.push({insert:i,attributes:t.attributes})})):e.push(t)})),e}(i.ops.slice()).reduce(((t,i)=>{const r=Fi.Op.length(i);let s=i.attributes||{},l=!1,o=!1;if(null!=i.insert){if(n.retain(r),"string"==typeof i.insert){const n=i.insert;o=!n.endsWith("\n")&&(e<=t||!!this.scroll.descendant(Xi,t)[0]),this.scroll.insertAt(t,n);const[r,l]=this.scroll.line(t);let a=Ke({},tn(r));if(r instanceof Yi){const[t]=r.descendant(oi,l);t&&(a=Ke(a,tn(t)))}s=Fi.AttributeMap.diff(a,s)||{}}else if("object"==typeof i.insert){const n=Object.keys(i.insert)[0];if(null==n)return t;const r=null!=this.scroll.query(n,We.INLINE);if(r)(e<=t||this.scroll.descendant(Xi,t)[0])&&(o=!0);else if(t>0){const[e,i]=this.scroll.descendant(oi,t-1);e instanceof Ki?"\n"!==e.value()[i]&&(l=!0):e instanceof mi&&e.statics.scope===We.INLINE_BLOT&&(l=!0)}if(this.scroll.insertAt(t,n,i.insert[n]),r){const[e]=this.scroll.descendant(oi,t);if(e){const t=Ke({},tn(e));s=Fi.AttributeMap.diff(t,s)||{}}}}e+=r}else if(n.push(i),null!==i.retain&&"object"==typeof i.retain){const e=Object.keys(i.retain)[0];if(null==e)return t;this.scroll.updateEmbedAt(t,e,i.retain[e])}Object.keys(s).forEach((e=>{this.scroll.formatAt(t,r,e,s[e])}));const a=l?1:0,c=o?1:0;return e+=a+c,n.retain(a),n.delete(c),t+r+a+c}),0),n.reduce(((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+Fi.Op.length(e)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(i)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new Ui).retain(t).delete(e))}formatLine(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(i).forEach((n=>{this.scroll.lines(t,Math.max(e,1)).forEach((t=>{t.format(n,i[n])}))})),this.scroll.optimize();const n=(new Ui).retain(t).retain(e,Me(i));return this.update(n)}formatText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(i).forEach((n=>{this.scroll.formatAt(t,e,n,i[n])}));const n=(new Ui).retain(t).retain(e,Me(i));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 Ui)}getFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],n=[];0===e?this.scroll.path(t).forEach((t=>{const[e]=t;e instanceof Yi?i.push(e):e instanceof oi&&n.push(e)})):(i=this.scroll.lines(t,e),n=this.scroll.descendants(oi,t,e));const[r,s]=[i,n].map((t=>{const e=t.shift();if(null==e)return{};let i=tn(e);for(;Object.keys(i).length>0;){const e=t.shift();if(null==e)return i;i=kn(tn(e),i)}return i}));return{...r,...s}}getHTML(t,e){const[i,n]=this.scroll.line(t);if(i){const r=i.length();return i.length()>=n+e&&(0!==n||e!==r)?yn(i,n,e,!0):yn(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter((t=>"string"==typeof t.insert)).map((t=>t.insert)).join("")}insertContents(t,e){const i=jn(e),n=(new Ui).retain(t).concat(i);return this.scroll.insertContents(t,i),this.update(n)}insertEmbed(t,e,i){return this.scroll.insertAt(t,e,i),this.update((new Ui).retain(t).insert({[e]:i}))}insertText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(i).forEach((n=>{this.scroll.formatAt(t,e.length,n,i[n])})),this.update((new Ui).retain(t).insert(e,Me(i)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;return t?.statics.blotName===Yi.blotName&&(!(t.children.length>1)&&t.children.head instanceof Zi)}removeFormat(t,e){const i=this.getText(t,e),[n,r]=this.scroll.line(t+e);let s=0,l=new Ui;null!=n&&(s=n.length()-r,l=n.delta().slice(r,r+s-1).insert("\n"));const o=this.getContents(t,e+s).diff((new Ui).insert(i).concat(l)),a=(new Ui).retain(t).concat(o);return this.applyDelta(a)}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(mn)&&this.scroll.find(e[0].target)){const r=this.scroll.find(e[0].target),s=tn(r),l=r.offset(this.scroll),o=e[0].oldValue.replace(en.CONTENTS,""),a=(new Ui).insert(o),c=(new Ui).insert(r.value()),h=i&&{oldRange:An(i.oldRange,-l),newRange:An(i.newRange,-l)};t=(new Ui).retain(l).concat(a.diff(c,h)).reduce(((t,e)=>e.insert?t.insert(e.insert,s):t.push(e)),new Ui),this.delta=n.compose(t)}else this.delta=this.getDelta(),t&&Ue(n.compose(t),this.delta)||(t=n.diff(this.delta,i));return t}}function wn(t,e,i){if(0===t.length){const[t]=xn(i.pop());return e<=0?`</li></${t}>`:`</li></${t}>${wn([],e-1,i)}`}const[{child:n,offset:r,length:s,indent:l,type:o},...a]=t,[c,h]=xn(o);if(l>e)return i.push(o),l===e+1?`<${c}><li${h}>${yn(n,r,s)}${wn(a,l,i)}`:`<${c}><li>${wn(t,e+1,i)}`;if(l===e&&o===i[i.length-1])return`</li><li${h}>${yn(n,r,s)}${wn(a,l,i)}`;const[u]=xn(i.pop());return`</li></${u}>${wn(t,e-1,i)}`}function yn(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in t&&"function"==typeof t.html)return t.html(e,i);if(t instanceof Ki)return Gi(t.value().slice(e,e+i)).replaceAll(" ","&nbsp;");if(t instanceof ui){if("list-container"===t.statics.blotName){const n=[];return t.children.forEachAt(e,i,((t,e,i)=>{const r="formats"in t&&"function"==typeof t.formats?t.formats():{};n.push({child:t,offset:e,length:i,indent:r.indent||0,type:r.list})})),wn(n,-1,[])}const r=[];if(t.children.forEachAt(e,i,((t,e,i)=>{r.push(yn(t,e,i))})),n||"list"===t.statics.blotName)return r.join("");const{outerHTML:s,innerHTML:l}=t.domNode,[o,a]=s.split(`>${l}<`);return"<table"===o?`<table style="border: 1px solid #000;">${r.join("")}<${a}`:`${o}>${r.join("")}<${a}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function kn(t,e){return Object.keys(e).reduce(((i,n)=>{if(null==t[n])return i;const r=e[n];return i[n]=r===t[n]?r:Array.isArray(r)?r.indexOf(t[n])<0?r.concat([t[n]]):r:[r,t[n]],i}),{})}function xn(t){const e="ordered"===t?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function jn(t){return t.reduce(((t,e)=>{if("string"==typeof e.insert){const i=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(i,e.attributes)}return t.push(e)}),new Ui)}function An(t,e){let{index:i,length:n}=t;return new qn(i+e,n)}class On{static DEFAULTS={};constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}const Mn="\ufeff";class En extends mi{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((t=>{this.contentNode.appendChild(t)})),this.leftGuard=document.createTextNode(Mn),this.rightGuard=document.createTextNode(Mn),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,i=null;const n=t.data.split(Mn).join("");if(t===this.leftGuard)if(this.prev instanceof Ki){const t=this.prev.length();this.prev.insertAt(t,n),i={startNode:this.prev.domNode,startOffset:t+n.length}}else e=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(e),this),i={startNode:e,startOffset:n.length};else t===this.rightGuard&&(this.next instanceof Ki?(this.next.insertAt(0,n),i={startNode:this.next.domNode,startOffset:n.length}):(e=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(e),this.next),i={startNode:e,startOffset:n.length}));return t.data=Mn,i}update(t,e){t.forEach((t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){const i=this.restore(t.target);i&&(e.range=i)}}))}}class Tn{isComposing=!1;constructor(t,e){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 En||(this.emitter.emit(fn.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(fn.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(fn.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(fn.events.COMPOSITION_END,t),this.isComposing=!1}}class _n{static DEFAULTS={modules:{}};static themes={default:_n};modules={};constructor(t,e){this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach((t=>{null==this.modules[t]&&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]}}const Nn=t=>{const e=t.getBoundingClientRect(),i="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,n="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*i,bottom:e.top+t.clientHeight*n,left:e.left}},Ln=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},$n=(t,e,i,n,r,s)=>t<i&&e>n?0:t<i?-(i-t+r):e>n?e-t>n-i?t+r-i:e-n+s:0,zn=["block","break","cursor","inline","scroll","text"],Cn=un("quill"),Sn=new Xe;ui.uiClass="ql-ui";class Bn{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Sn,theme:"default"};static events=fn.events;static sources=fn.sources;static version="2.0.3";static imports={delta:Ui,parchment:ji,"core/module":On,"core/theme":_n};static debug(t){!0===t&&(t="log"),un.level(t)}static find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return on.get(t)||Sn.find(t,e)}static import(t){return null==this.imports[t]&&Cn.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const t=arguments.length<=0?void 0:arguments[0],e=!!(arguments.length<=1?void 0:arguments[1]),i="attrName"in t?t.attrName:t.blotName;"string"==typeof i?this.register(`formats/${i}`,t,e):Object.keys(t).forEach((i=>{this.register(i,t[i],e)}))}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1];null==this.imports[t]||!!(arguments.length<=2?void 0:arguments[2])||Cn.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&"boolean"!=typeof e&&"abstract"!==e.blotName&&Sn.register(e),"function"==typeof e.register&&e.register(Sn)}}constructor(t){if(this.options=function(t,e){const i=Rn(t);if(!i)throw new Error("Invalid Quill container");const n=!e.theme||e.theme===Bn.DEFAULTS.theme?_n:Bn.import(`themes/${e.theme}`);if(!n)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:r,...s}=Bn.DEFAULTS,{modules:l,...o}=n.DEFAULTS;let a=Hn(e.modules);null!=a&&a.toolbar&&a.toolbar.constructor!==Object&&(a={...a,toolbar:{container:a.toolbar}});const c=Ke({},Hn(r),Hn(l),a),h={...s,...Dn(o),...Dn(e)};let u=e.registry;return u?e.formats&&Cn.warn('Ignoring "formats" option because "registry" is specified'):u=e.formats?((t,e,i)=>{const n=new Xe;return zn.forEach((t=>{const i=e.query(t);i&&n.register(i)})),t.forEach((t=>{let r=e.query(t);r||i.error(`Cannot register "${t}" specified in "formats" config. Are you sure it was registered?`);let s=0;for(;r;)if(n.register(r),r="blotName"in r?r.requiredContainer??null:null,s+=1,s>100){i.error(`Cycle detected in registering blot requiredContainer: "${t}"`);break}})),n})(e.formats,h.registry,Cn):h.registry,{...h,registry:u,container:i,theme:n,modules:Object.entries(c).reduce(((t,e)=>{let[i,n]=e;if(!n)return t;const r=Bn.import(`modules/${i}`);return null==r?(Cn.error(`Cannot load ${i} module. Are you sure you registered it?`),t):{...t,[i]:Ke({},r.DEFAULTS||{},n)}}),{}),bounds:Rn(h.bounds)}}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.container=this.options.container,null==this.container)return void Cn.error("Invalid Quill container",t);this.options.debug&&Bn.debug(this.options.debug);const e=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",on.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new fn;const i=yi.blotName,n=this.options.registry.query(i);if(!n||!("blotName"in n))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new n(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new gn(this.scroll),this.selection=new bn(this.scroll,this.emitter),this.composition=new Tn(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(fn.events.EDITOR_CHANGE,(t=>{t===fn.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(fn.events.SCROLL_UPDATE,((t,e)=>{const i=this.selection.lastRange,[n]=this.selection.getRange(),r=i&&n?{oldRange:i,newRange:n}:void 0;Vn.call(this,(()=>this.editor.update(null,e,r)),t)})),this.emitter.on(fn.events.SCROLL_EMBED_UPDATE,((t,e)=>{const i=this.selection.lastRange,[n]=this.selection.getRange(),r=i&&n?{oldRange:i,newRange:n}:void 0;Vn.call(this,(()=>{const i=(new Ui).retain(t.offset(this)).retain({[t.statics.blotName]:e});return this.editor.update(i,[],r)}),Bn.sources.USER)})),e){const t=this.clipboard.convert({html:`${e}<p><br></p>`,text:"\n"});this.setContents(t)}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&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){const e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,i){return[t,e,,i]=In(t,e,i),Vn.call(this,(()=>this.editor.deleteText(t,e)),i,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&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){return Vn.call(this,(()=>{const i=this.getSelection(!0);let n=new Ui;if(null==i)return n;if(this.scroll.query(t,We.BLOCK))n=this.editor.formatLine(i.index,i.length,{[t]:e});else{if(0===i.length)return this.selection.format(t,e),n;n=this.editor.formatText(i.index,i.length,{[t]:e})}return this.setSelection(i,fn.sources.SILENT),n}),arguments.length>2&&void 0!==arguments[2]?arguments[2]:fn.sources.API)}formatLine(t,e,i,n,r){let s;return[t,e,s,r]=In(t,e,i,n,r),Vn.call(this,(()=>this.editor.formatLine(t,e,s)),r,t,0)}formatText(t,e,i,n,r){let s;return[t,e,s,r]=In(t,e,i,n,r),Vn.call(this,(()=>this.editor.formatText(t,e,s)),r,t,0)}getBounds(t){let e=null;if(e="number"==typeof t?this.selection.getBounds(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0):this.selection.getBounds(t.index,t.length),!e)return null;const i=this.container.getBoundingClientRect();return{bottom:e.bottom-i.top,height:e.height,left:e.left-i.left,right:e.right-i.left,top:e.top-i.top,width:e.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=In(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0);return"number"==typeof t?this.editor.getFormat(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0):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&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=e??this.getLength()-t),[t,e]=In(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=e??this.getLength()-t),[t,e]=In(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,i){return Vn.call(this,(()=>this.editor.insertEmbed(t,e,i)),arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bn.sources.API,t)}insertText(t,e,i,n,r){let s;return[t,,s,r]=In(t,0,i,n,r),Vn.call(this,(()=>this.editor.insertText(t,e,s)),r,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,i){return[t,e,,i]=In(t,e,i),Vn.call(this,(()=>this.editor.removeFormat(t,e)),i,t)}scrollRectIntoView(t){((t,e)=>{const i=t.ownerDocument;let n=e,r=t;for(;r;){const t=r===i.body,e=t?{top:0,right:window.visualViewport?.width??i.documentElement.clientWidth,bottom:window.visualViewport?.height??i.documentElement.clientHeight,left:0}:Nn(r),l=getComputedStyle(r),o=$n(n.left,n.right,e.left,e.right,Ln(l.scrollPaddingLeft),Ln(l.scrollPaddingRight)),a=$n(n.top,n.bottom,e.top,e.bottom,Ln(l.scrollPaddingTop),Ln(l.scrollPaddingBottom));if(o||a)if(t)i.defaultView?.scrollBy(o,a);else{const{scrollLeft:t,scrollTop:e}=r;a&&(r.scrollTop+=a),o&&(r.scrollLeft+=o);const i=r.scrollLeft-t,s=r.scrollTop-e;n={left:n.left-i,top:n.top-s,right:n.right-i,bottom:n.bottom-s}}r=t||"fixed"===l.position?null:(s=r).parentElement||s.getRootNode().host||null}var s})(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){return Vn.call(this,(()=>{t=new Ui(t);const e=this.getLength(),i=this.editor.deleteText(0,e),n=this.editor.insertContents(0,t),r=this.editor.deleteText(this.getLength()-1,1);return i.compose(n).compose(r)}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn.sources.API)}setSelection(t,e,i){null==t?this.selection.setRange(null,e||Bn.sources.API):([t,e,,i]=In(t,e,i),this.selection.setRange(new qn(Math.max(0,t),e),i),i!==fn.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn.sources.API;const i=(new Ui).insert(t);return this.setContents(i,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fn.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){return Vn.call(this,(()=>(t=new Ui(t),this.editor.applyDelta(t))),arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn.sources.API,!0)}}function Rn(t){return"string"==typeof t?document.querySelector(t):t}function Hn(t){return Object.entries(t??{}).reduce(((t,e)=>{let[i,n]=e;return{...t,[i]:!0===n?{}:n}}),{})}function Dn(t){return Object.fromEntries(Object.entries(t).filter((t=>void 0!==t[1])))}function Vn(t,e,i,n){if(!this.isEnabled()&&e===fn.sources.USER&&!this.allowReadOnlyEdits)return new Ui;let r=null==i?null:this.getSelection();const s=this.editor.delta,l=t();if(null!=r&&(!0===i&&(i=r.index),null==n?r=Pn(r,l,e):0!==n&&(r=Pn(r,i,n,e)),this.setSelection(r,fn.sources.SILENT)),l.length()>0){const t=[fn.events.TEXT_CHANGE,l,s,e];this.emitter.emit(fn.events.EDITOR_CHANGE,...t),e!==fn.sources.SILENT&&this.emitter.emit(...t)}return l}function In(t,e,i,n,r){let s={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(r=n,n=i,i=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(r=n,n=i,i=e,e=0),"object"==typeof i?(s=i,r=n):"string"==typeof i&&(null!=n?s[i]=n:r=i),[t,e,s,r=r||fn.sources.API]}function Pn(t,e,i,n){const r="number"==typeof i?i:0;if(null==t)return null;let s,l;return[s,l]=[t.index,t.index+t.length].map(e&&"function"==typeof e.transformPosition?t=>e.transformPosition(t,n!==fn.sources.USER):t=>t<e||t===e&&n===fn.sources.USER?t:r>=0?t+r:Math.max(e,t+r)),new qn(s,l-s)}class Fn extends vi{}function Un(t){return t instanceof Yi||t instanceof Xi}function Zn(t){return"function"==typeof t.updateContent}function Kn(t,e,i){i.reduce(((e,i)=>{const n=Fi.Op.length(i);let r=i.attributes||{};if(null!=i.insert)if("string"==typeof i.insert){t.insertAt(e,i.insert);const[n]=t.descendant(oi,e),s=tn(n);r=Fi.AttributeMap.diff(s,r)||{}}else if("object"==typeof i.insert){const n=Object.keys(i.insert)[0];if(null==n)return e;if(t.insertAt(e,n,i.insert[n]),null!=t.scroll.query(n,We.INLINE)){const[i]=t.descendant(oi,e),n=tn(i);r=Fi.AttributeMap.diff(n,r)||{}}}return Object.keys(r).forEach((i=>{t.formatAt(e,n,i,r[i])})),e+n}),e)}const Wn={scope:We.BLOCK,whitelist:["right","center","justify"]},Gn=new Ge("align","align",Wn),Qn=new ti("align","ql-align",Wn),Yn=new ii("align","text-align",Wn);class Xn extends ii{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map((t=>`00${parseInt(t,10).toString(16)}`.slice(-2))).join("")}`):e}}const Jn=new ti("color","ql-color",{scope:We.INLINE}),tr=new Xn("color","color",{scope:We.INLINE}),er=new ti("background","ql-bg",{scope:We.INLINE}),ir=new Xn("background","background-color",{scope:We.INLINE});class nr extends Fn{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map((t=>t.length()<=1?"":t.domNode.innerText)).join("\n").slice(t,t+e)}html(t,e){return`<pre>\n${Gi(this.code(t,e))}\n</pre>`}}class rr extends Yi{static TAB=" ";static register(){Bn.register(nr)}}class sr extends Qi{}sr.blotName="code",sr.tagName="CODE",rr.blotName="code-block",rr.className="ql-code-block",rr.tagName="DIV",nr.blotName="code-block-container",nr.className="ql-code-block-container",nr.tagName="DIV",nr.allowedChildren=[rr],rr.allowedChildren=[Ki,Zi,en],rr.requiredContainer=nr;const lr={scope:We.BLOCK,whitelist:["rtl"]},or=new Ge("direction","dir",lr),ar=new ti("direction","ql-direction",lr),cr=new ii("direction","direction",lr),hr={scope:We.INLINE,whitelist:["serif","monospace"]},ur=new ti("font","ql-font",hr),dr=new class extends ii{value(t){return super.value(t).replace(/["']/g,"")}}("font","font-family",hr),fr=new ti("size","ql-size",{scope:We.INLINE,whitelist:["small","large","huge"]}),pr=new ii("size","font-size",{scope:We.INLINE,whitelist:["10px","18px","32px"]}),qr=un("quill:keyboard"),br=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class vr extends On{static match(t,e){return!["altKey","ctrlKey","metaKey","shiftKey"].some((i=>!!e[i]!==t[i]&&null!==e[i]))&&(e.key===t.key||e.key===t.which)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach((t=>{this.options.bindings[t]&&this.addBinding(this.options.bindings[t])})),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&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=function(t){if("string"==typeof t||"number"==typeof t)t={key:t};else{if("object"!=typeof t)return null;t=Me(t)}return t.shortKey&&(t[br]=t.shortKey,delete t.shortKey),t}(t);null!=n?("function"==typeof e&&(e={handler:e}),"function"==typeof i&&(i={handler:i}),(Array.isArray(n.key)?n.key:[n.key]).forEach((t=>{const r={...n,key:t,...e,...i};this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}))):qr.warn("Attempted to add invalid keyboard binding",n)}listen(){this.quill.root.addEventListener("keydown",(t=>{if(t.defaultPrevented||t.isComposing)return;if(229===t.keyCode&&("Enter"===t.key||"Backspace"===t.key))return;const e=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter((e=>vr.match(t,e)));if(0===e.length)return;const i=Bn.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const n=this.quill.getSelection();if(null==n||!this.quill.hasFocus())return;const[r,s]=this.quill.getLine(n.index),[l,o]=this.quill.getLeaf(n.index),[a,c]=0===n.length?[l,o]:this.quill.getLeaf(n.index+n.length),h=l instanceof xi?l.value().slice(0,o):"",u=a instanceof xi?a.value().slice(c):"",d={collapsed:0===n.length,empty:0===n.length&&r.length()<=1,format:this.quill.getFormat(n),line:r,offset:s,prefix:h,suffix:u,event:t};e.some((t=>{if(null!=t.collapsed&&t.collapsed!==d.collapsed)return!1;if(null!=t.empty&&t.empty!==d.empty)return!1;if(null!=t.offset&&t.offset!==d.offset)return!1;if(Array.isArray(t.format)){if(t.format.every((t=>null==d.format[t])))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every((e=>!0===t.format[e]?null!=d.format[e]:!1===t.format[e]?null==d.format[e]:Ue(t.format[e],d.format[e]))))return!1;return!(null!=t.prefix&&!t.prefix.test(d.prefix)||null!=t.suffix&&!t.suffix.test(d.suffix)||!0===t.handler.call(this,n,d,t))}))&&t.preventDefault()}))}handleBackspace(t,e){const i=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(0===t.index||this.quill.getLength()<=1)return;let n={};const[r]=this.quill.getLine(t.index);let s=(new Ui).retain(t.index-i).delete(i);if(0===e.offset){const[e]=this.quill.getLine(t.index-1);if(e&&!("block"===e.statics.blotName&&e.length()<=1)){const e=r.formats(),i=this.quill.getFormat(t.index-1,1);if(n=Fi.AttributeMap.diff(e,i)||{},Object.keys(n).length>0){const e=(new Ui).retain(t.index+r.length()-2).retain(1,n);s=s.compose(e)}}}this.quill.updateContents(s,Bn.sources.USER),this.quill.focus()}handleDelete(t,e){const i=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-i)return;let n={};const[r]=this.quill.getLine(t.index);let s=(new Ui).retain(t.index).delete(i);if(e.offset>=r.length()-1){const[e]=this.quill.getLine(t.index+1);if(e){const i=r.formats(),l=this.quill.getFormat(t.index,1);n=Fi.AttributeMap.diff(i,l)||{},Object.keys(n).length>0&&(s=s.retain(e.length()-1).retain(1,n))}}this.quill.updateContents(s,Bn.sources.USER),this.quill.focus()}handleDeleteRange(t){xr({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const i=Object.keys(e.format).reduce(((t,i)=>(this.quill.scroll.query(i,We.BLOCK)&&!Array.isArray(e.format[i])&&(t[i]=e.format[i]),t)),{}),n=(new Ui).retain(t.index).delete(t.length).insert("\n",i);this.quill.updateContents(n,Bn.sources.USER),this.quill.setSelection(t.index+1,Bn.sources.SILENT),this.quill.focus()}}const mr={bindings:{bold:yr("bold"),italic:yr("italic"),underline:yr("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","+1",Bn.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","-1",Bn.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){null!=e.format.indent?this.quill.format("indent","-1",Bn.sources.USER):null!=e.format.list&&this.quill.format("list",!1,Bn.sources.USER)}},"indent code-block":gr(!0),"outdent code-block":gr(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,Bn.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const i=(new Ui).retain(t.index).delete(t.length).insert("\t");return this.quill.updateContents(i,Bn.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,Bn.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Bn.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const i={list:!1};e.format.indent&&(i.indent=!1),this.quill.formatLine(t.index,t.length,i,Bn.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const[e,i]=this.quill.getLine(t.index),n={...e.formats(),list:"checked"},r=(new Ui).retain(t.index).insert("\n",n).retain(e.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(r,Bn.sources.USER),this.quill.setSelection(t.index+1,Bn.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const[i,n]=this.quill.getLine(t.index),r=(new Ui).retain(t.index).insert("\n",e.format).retain(i.length()-n-1).retain(1,{header:null});this.quill.updateContents(r,Bn.sources.USER),this.quill.setSelection(t.index+1,Bn.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(t){const e=this.quill.getModule("table");if(e){const[i,n,r,s]=e.getTable(t),l=function(t,e,i,n){return null==e.prev&&null==e.next?null==i.prev&&null==i.next?0===n?-1:1:null==i.prev?-1:1:null==e.prev?-1:null==e.next?1:null}(0,n,r,s);if(null==l)return;let o=i.offset();if(l<0){const e=(new Ui).retain(o).insert("\n");this.quill.updateContents(e,Bn.sources.USER),this.quill.setSelection(t.index+1,t.length,Bn.sources.SILENT)}else if(l>0){o+=i.length();const t=(new Ui).retain(o).insert("\n");this.quill.updateContents(t,Bn.sources.USER),this.quill.setSelection(o,Bn.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:i,line:n}=e,r=n.offset(this.quill.scroll);this.quill.setSelection(i.shiftKey?r-1:r+n.length(),Bn.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(null==this.quill.scroll.query("list"))return!0;const{length:i}=e.prefix,[n,r]=this.quill.getLine(t.index);if(r>i)return!0;let s;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",Bn.sources.USER),this.quill.history.cutoff();const l=(new Ui).retain(t.index-r).delete(i+1).retain(n.length()-2-r).retain(1,{list:s});return this.quill.updateContents(l,Bn.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-i,Bn.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,i]=this.quill.getLine(t.index);let n=2,r=e;for(;null!=r&&r.length()<=1&&r.formats()["code-block"];)if(r=r.prev,n-=1,n<=0){const n=(new Ui).retain(t.index+e.length()-i-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(n,Bn.sources.USER),this.quill.setSelection(t.index-1,Bn.sources.SILENT),!1}return!0}},"embed left":wr("ArrowLeft",!1),"embed left shift":wr("ArrowLeft",!0),"embed right":wr("ArrowRight",!1),"embed right shift":wr("ArrowRight",!0),"table down":kr(!1),"table up":kr(!0)}};function gr(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,i){let{event:n}=i;const r=this.quill.scroll.query("code-block"),{TAB:s}=r;if(0===e.length&&!n.shiftKey)return this.quill.insertText(e.index,s,Bn.sources.USER),void this.quill.setSelection(e.index+s.length,Bn.sources.SILENT);const l=0===e.length?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:a}=e;l.forEach(((e,i)=>{t?(e.insertAt(0,s),0===i?o+=s.length:a+=s.length):e.domNode.textContent.startsWith(s)&&(e.deleteAt(0,s.length),0===i?o-=s.length:a-=s.length)})),this.quill.update(Bn.sources.USER),this.quill.setSelection(o,a,Bn.sources.SILENT)}}}function wr(t,e){const i="ArrowLeft"===t?"prefix":"suffix";return{key:t,shiftKey:e,altKey:null,[i]:/^$/,handler(i){let{index:n}=i;"ArrowRight"===t&&(n+=i.length+1);const[r]=this.quill.getLeaf(n);return!(r instanceof mi&&("ArrowLeft"===t?e?this.quill.setSelection(i.index-1,i.length+1,Bn.sources.USER):this.quill.setSelection(i.index-1,Bn.sources.USER):e?this.quill.setSelection(i.index,i.length+1,Bn.sources.USER):this.quill.setSelection(i.index+i.length+1,Bn.sources.USER),1))}}}function yr(t){return{key:t[0],shortKey:!0,handler(e,i){this.quill.format(t,!i.format[t],Bn.sources.USER)}}}function kr(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,i){const n=t?"prev":"next",r=i.line,s=r.parent[n];if(null!=s){if("table-row"===s.statics.blotName){let t=s.children.head,e=r;for(;null!=e.prev;)e=e.prev,t=t.next;const n=t.offset(this.quill.scroll)+Math.min(i.offset,t.length()-1);this.quill.setSelection(n,0,Bn.sources.USER)}}else{const e=r.table()[n];null!=e&&this.quill.setSelection(t?e.offset(this.quill.scroll)+e.length()-1:e.offset(this.quill.scroll),0,Bn.sources.USER)}return!1}}}function xr(t){let{quill:e,range:i}=t;const n=e.getLines(i);let r={};if(n.length>1){const t=n[0].formats(),e=n[n.length-1].formats();r=Fi.AttributeMap.diff(e,t)||{}}e.deleteText(i,Bn.sources.USER),Object.keys(r).length>0&&e.formatLine(i.index,1,r,Bn.sources.USER),e.setSelection(i.index,Bn.sources.SILENT)}vr.DEFAULTS=mr;const jr=/font-weight:\s*normal/,Ar=["P","OL","UL"],Or=t=>t&&Ar.includes(t.tagName),Mr=/\bmso-list:[^;]*ignore/i,Er=/\bmso-list:[^;]*\bl(\d+)/i,Tr=/\bmso-list:[^;]*\blevel(\d+)/i,_r=[function(t){"urn:schemas-microsoft-com:office:word"===t.documentElement.getAttribute("xmlns:w")&&(t=>{const e=Array.from(t.querySelectorAll("[style*=mso-list]")),i=[],n=[];e.forEach((t=>{(t.getAttribute("style")||"").match(Mr)?i.push(t):n.push(t)})),i.forEach((t=>t.parentNode?.removeChild(t)));const r=t.documentElement.innerHTML,s=n.map((t=>((t,e)=>{const i=t.getAttribute("style"),n=i?.match(Er);if(!n)return null;const r=Number(n[1]),s=i?.match(Tr),l=s?Number(s[1]):1,o=new RegExp(`@list l${r}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),a=e.match(o);return{id:r,indent:l,type:a&&"bullet"===a[1]?"bullet":"ordered",element:t}})(t,r))).filter((t=>t));for(;s.length;){const t=[];let e=s.shift();for(;e;)t.push(e),e=s.length&&s[0]?.element===e.element.nextElementSibling&&s[0].id===e.id?s.shift():null;const i=document.createElement("ul");t.forEach((t=>{const e=document.createElement("li");e.setAttribute("data-list",t.type),t.indent>1&&e.setAttribute("class","ql-indent-"+(t.indent-1)),e.innerHTML=t.element.innerHTML,i.appendChild(e)}));const n=t[0]?.element,{parentNode:r}=n??{};n&&r?.replaceChild(i,n),t.slice(1).forEach((t=>{let{element:e}=t;r?.removeChild(e)}))}})(t)},function(t){t.querySelector('[id^="docs-internal-guid-"]')&&((t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter((t=>t.getAttribute("style")?.match(jr))).forEach((e=>{const i=t.createDocumentFragment();i.append(...e.childNodes),e.parentNode?.replaceChild(i,e)}))})(t),(t=>{Array.from(t.querySelectorAll("br")).filter((t=>Or(t.previousElementSibling)&&Or(t.nextElementSibling))).forEach((t=>{t.parentNode?.removeChild(t)}))})(t))}],Nr=un("quill:clipboard"),Lr=[[Node.TEXT_NODE,function(t,e,i){let n=t.data;if("O:P"===t.parentElement?.tagName)return e.insert(n.trim());if(!Hr(t)){if(0===n.trim().length&&n.includes("\n")&&!function(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Br(t.previousElementSibling,e)&&!Br(t.nextElementSibling,e)}(t,i))return e;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(null==t.previousSibling&&null!=t.parentElement&&Br(t.parentElement,i)||t.previousSibling instanceof Element&&Br(t.previousSibling,i))&&(n=n.replace(/^ /,"")),(null==t.nextSibling&&null!=t.parentElement&&Br(t.parentElement,i)||t.nextSibling instanceof Element&&Br(t.nextSibling,i))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return e.insert(n)}],[Node.TEXT_NODE,Ir],["br",function(t,e){return Sr(e,"\n")||e.insert("\n"),e}],[Node.ELEMENT_NODE,Ir],[Node.ELEMENT_NODE,function(t,e,i){const n=i.query(t);if(null==n)return e;if(n.prototype instanceof mi){const e={},r=n.value(t);if(null!=r)return e[n.blotName]=r,(new Ui).insert(e,n.formats(t,i))}else if(n.prototype instanceof qi&&!Sr(e,"\n")&&e.insert("\n"),"blotName"in n&&"formats"in n&&"function"==typeof n.formats)return Cr(e,n.blotName,n.formats(t,i),i);return e}],[Node.ELEMENT_NODE,function(t,e,i){const n=Ge.keys(t),r=ti.keys(t),s=ii.keys(t),l={};return n.concat(r).concat(s).forEach((e=>{let n=i.query(e,We.ATTRIBUTE);null!=n&&(l[n.attrName]=n.value(t),l[n.attrName])||(n=$r[e],null==n||n.attrName!==e&&n.keyName!==e||(l[n.attrName]=n.value(t)||void 0),n=zr[e],null==n||n.attrName!==e&&n.keyName!==e||(n=zr[e],l[n.attrName]=n.value(t)||void 0))})),Object.entries(l).reduce(((t,e)=>{let[n,r]=e;return Cr(t,n,r,i)}),e)}],[Node.ELEMENT_NODE,function(t,e,i){const n={},r=t.style||{};return"italic"===r.fontStyle&&(n.italic=!0),"underline"===r.textDecoration&&(n.underline=!0),"line-through"===r.textDecoration&&(n.strike=!0),(r.fontWeight?.startsWith("bold")||parseInt(r.fontWeight,10)>=700)&&(n.bold=!0),e=Object.entries(n).reduce(((t,e)=>{let[n,r]=e;return Cr(t,n,r,i)}),e),parseFloat(r.textIndent||0)>0?(new Ui).insert("\t").concat(e):e}],["li",function(t,e,i){const n=i.query(t);if(null==n||"list"!==n.blotName||!Sr(e,"\n"))return e;let r=-1,s=t.parentNode;for(;null!=s;)["OL","UL"].includes(s.tagName)&&(r+=1),s=s.parentNode;return r<=0?e:e.reduce(((t,e)=>e.insert?e.attributes&&"number"==typeof e.attributes.indent?t.push(e):t.insert(e.insert,{indent:r,...e.attributes||{}}):t),new Ui)}],["ol, ul",function(t,e,i){let n="OL"===t.tagName?"ordered":"bullet";const r=t.getAttribute("data-checked");return r&&(n="true"===r?"checked":"unchecked"),Cr(e,"list",n,i)}],["pre",function(t,e,i){const n=i.query("code-block");return Cr(e,"code-block",!n||!("formats"in n)||"function"!=typeof n.formats||n.formats(t,i),i)}],["tr",function(t,e,i){const n="TABLE"===t.parentElement?.tagName?t.parentElement:t.parentElement?.parentElement;return null!=n?Cr(e,"table",Array.from(n.querySelectorAll("tr")).indexOf(t)+1,i):e}],["b",Vr("bold")],["i",Vr("italic")],["strike",Vr("strike")],["style",function(){return new Ui}]],$r=[Gn,or].reduce(((t,e)=>(t[e.keyName]=e,t)),{}),zr=[Yn,ir,tr,cr,dr,pr].reduce(((t,e)=>(t[e.keyName]=e,t)),{});function Cr(t,e,i,n){return n.query(e)?t.reduce(((t,n)=>n.insert?n.attributes&&n.attributes[e]?t.push(n):t.insert(n.insert,{...i?{[e]:i}:{},...n.attributes}):t),new Ui):t}function Sr(t,e){let i="";for(let n=t.ops.length-1;n>=0&&i.length<e.length;--n){const e=t.ops[n];if("string"!=typeof e.insert)break;i=e.insert+i}return i.slice(-1*e.length)===e}function Br(t,e){if(!(t instanceof Element))return!1;const i=e.query(t);return!(i&&i.prototype instanceof mi)&&["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(t.tagName.toLowerCase())}const Rr=new WeakMap;function Hr(t){return null!=t&&(Rr.has(t)||Rr.set(t,"PRE"===t.tagName||Hr(t.parentNode)),Rr.get(t))}function Dr(t,e,i,n,r){return e.nodeType===e.TEXT_NODE?n.reduce(((i,n)=>n(e,i,t)),new Ui):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce(((s,l)=>{let o=Dr(t,l,i,n,r);return l.nodeType===e.ELEMENT_NODE&&(o=i.reduce(((e,i)=>i(l,e,t)),o),o=(r.get(l)||[]).reduce(((e,i)=>i(l,e,t)),o)),s.concat(o)}),new Ui):new Ui}function Vr(t){return(e,i,n)=>Cr(i,t,!0,n)}function Ir(t,e,i){if(!Sr(e,"\n")){if(Br(t,i)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert("\n");if(e.length()>0&&t.nextSibling){let n=t.nextSibling;for(;null!=n;){if(Br(n,i))return e.insert("\n");const t=i.query(n);if(t&&t.prototype instanceof Xi)return e.insert("\n");n=n.firstChild}}}return e}function Pr(t,e){let i=e;for(let e=t.length-1;e>=0;e-=1){const n=t[e];t[e]={delta:i.transform(n.delta,!0),range:n.range&&Fr(n.range,i)},i=n.delta.transform(i),0===t[e].delta.length()&&t.splice(e,1)}}function Fr(t,e){if(!t)return t;const i=e.transformPosition(t.index);return{index:i,length:e.transformPosition(t.index+t.length)-i}}class Ur extends On{constructor(t,e){super(t,e),t.root.addEventListener("drop",(e=>{e.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(e.clientX,e.clientY);else if(document.caretPositionFromPoint){const t=document.caretPositionFromPoint(e.clientX,e.clientY);i=document.createRange(),i.setStart(t.offsetNode,t.offset),i.setEnd(t.offsetNode,t.offset)}const n=i&&t.selection.normalizeNative(i);if(n){const i=t.selection.normalizedToRange(n);e.dataTransfer?.files&&this.upload(i,e.dataTransfer.files)}}))}upload(t,e){const i=[];Array.from(e).forEach((t=>{t&&this.options.mimetypes?.includes(t.type)&&i.push(t)})),i.length>0&&this.options.handler.call(this,t,i)}}Ur.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const i=e.map((t=>new Promise((e=>{const i=new FileReader;i.onload=()=>{e(i.result)},i.readAsDataURL(t)}))));Promise.all(i).then((e=>{const i=e.reduce(((t,e)=>t.insert({image:e})),(new Ui).retain(t.index).delete(t.length));this.quill.updateContents(i,fn.sources.USER),this.quill.setSelection(t.index+e.length,fn.sources.SILENT)}))}};const Zr=["insertText","insertReplacementText"],Kr=/Mac/i.test(navigator.platform);Bn.register({"blots/block":Yi,"blots/block/embed":Xi,"blots/break":Zi,"blots/container":Fn,"blots/cursor":en,"blots/embed":En,"blots/inline":Qi,"blots/scroll":class extends yi{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Yi;static allowedChildren=[Yi,Xi,Fn];constructor(t,e,i){let{emitter:n}=i;super(t,e),this.emitter=n,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(t=>this.handleDragStart(t)))}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(fn.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(fn.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(fn.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[i,n]=this.line(t),[r]=this.line(t+e);if(super.deleteAt(t,e),null!=r&&i!==r&&n>0){if(i instanceof Xi||r instanceof Xi)return void this.optimize();i.moveChildren(r,r.children.head instanceof Zi?null:r.children.head),i.remove()}this.optimize()}enable(){this.domNode.setAttribute("contenteditable",arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?"false":"true")}formatAt(t,e,i,n){super.formatAt(t,e,i,n),this.optimize()}insertAt(t,e,i){if(t>=this.length())if(null==i||null==this.scroll.query(e,We.BLOCK)){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t),null==i&&e.endsWith("\n")?t.insertAt(0,e.slice(0,-1),i):t.insertAt(0,e,i)}else{const t=this.scroll.create(e,i);this.appendChild(t)}else super.insertAt(t,e,i);this.optimize()}insertBefore(t,e){if(t.statics.scope===We.INLINE_BLOT){const i=this.scroll.create(this.statics.defaultChild.blotName);i.appendChild(t),super.insertBefore(i,e)}else super.insertBefore(t,e)}insertContents(t,e){const i=this.deltaToRenderBlocks(e.concat((new Ui).insert("\n"))),n=i.pop();if(null==n)return;this.batchStart();const r=i.shift();if(r){const e="block"===r.type&&(0===r.delta.length()||!this.descendant(Xi,t)[0]&&t<this.length()),i="block"===r.type?r.delta:(new Ui).insert({[r.key]:r.value});Kn(this,t,i);const n="block"===r.type?1:0,s=t+i.length()+n;e&&this.insertAt(s-1,"\n");const l=tn(this.line(t)[0]),o=Fi.AttributeMap.diff(l,r.attributes)||{};Object.keys(o).forEach((t=>{this.formatAt(s-1,1,t,o[t])})),t=s}let[s,l]=this.children.find(t);i.length&&(s&&(s=s.split(l),l=0),i.forEach((t=>{if("block"===t.type)Kn(this.createBlock(t.attributes,s||void 0),0,t.delta);else{const e=this.create(t.key,t.value);this.insertBefore(e,s||void 0),Object.keys(t.attributes).forEach((i=>{e.format(i,t.attributes[i])}))}}))),"block"===n.type&&n.delta.length()&&Kn(this,s?s.offset(s.scroll)+l:this.length(),n.delta),this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[i,n]=e;return i instanceof oi?[i,n]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(Un,t)}lines(){const t=(e,i,n)=>{let r=[],s=n;return e.children.forEachAt(i,n,((e,i,n)=>{Un(e)?r.push(e):e instanceof vi&&(r=r.concat(t(e,i,s))),s-=n})),r};return t(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(fn.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch)return void(Array.isArray(t)&&(this.batch=this.batch.concat(t)));let e=fn.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),(t=t.filter((t=>{let{target:e}=t;const i=this.find(e,!0);return i&&!Zn(i)}))).length>0&&this.emitter.emit(fn.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(fn.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,i){const[n]=this.descendant((t=>t instanceof Xi),t);n&&n.statics.blotName===e&&Zn(n)&&n.updateContent(i)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let i=new Ui;return t.forEach((t=>{const n=t?.insert;if(n)if("string"==typeof n){const r=n.split("\n");r.slice(0,-1).forEach((n=>{i.insert(n,t.attributes),e.push({type:"block",delta:i,attributes:t.attributes??{}}),i=new Ui}));const s=r[r.length-1];s&&i.insert(s,t.attributes)}else{const r=Object.keys(n)[0];if(!r)return;this.query(r,We.INLINE)?i.push(t):(i.length()&&e.push({type:"block",delta:i,attributes:{}}),i=new Ui,e.push({type:"blockEmbed",key:r,value:n[r],attributes:t.attributes??{}}))}})),i.length()&&e.push({type:"block",delta:i,attributes:{}}),e}createBlock(t,e){let i;const n={};Object.entries(t).forEach((t=>{let[e,r]=t;null!=this.query(e,We.BLOCK&We.BLOT)?i=e:n[e]=r}));const r=this.create(i||this.statics.defaultChild.blotName,i?t[i]:void 0);this.insertBefore(r,e||void 0);const s=r.length();return Object.entries(n).forEach((t=>{let[e,i]=t;r.formatAt(0,s,e,i)})),r}},"blots/text":Ki,"modules/clipboard":class extends On{static DEFAULTS={matchers:[]};constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",(t=>this.onCaptureCopy(t,!1))),this.quill.root.addEventListener("cut",(t=>this.onCaptureCopy(t,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Lr.concat(this.options.matchers??[]).forEach((t=>{let[e,i]=t;this.addMatcher(e,i)}))}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:i}=t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n[rr.blotName])return(new Ui).insert(i||"",{[rr.blotName]:n[rr.blotName]});if(!e)return(new Ui).insert(i||"",n);const r=this.convertHTML(e);return Sr(r,"\n")&&(null==r.ops[r.ops.length-1].attributes||n.table)?r.compose((new Ui).retain(r.length()-1).delete(1)):r}normalizeHTML(t){(t=>{t.documentElement&&_r.forEach((e=>{e(t)}))})(t)}convertHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");this.normalizeHTML(e);const i=e.body,n=new WeakMap,[r,s]=this.prepareMatching(i,n);return Dr(this.quill.scroll,i,r,s,n)}dangerouslyPasteHTML(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bn.sources.API;if("string"==typeof t){const i=this.convert({html:t,text:""});this.quill.setContents(i,e),this.quill.setSelection(0,Bn.sources.SILENT)}else{const n=this.convert({html:e,text:""});this.quill.updateContents((new Ui).retain(t).concat(n),i),this.quill.setSelection(t+n.length(),Bn.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.defaultPrevented)return;t.preventDefault();const[i]=this.quill.selection.getRange();if(null==i)return;const{html:n,text:r}=this.onCopy(i,e);t.clipboardData?.setData("text/plain",r),t.clipboardData?.setData("text/html",n),e&&xr({range:i,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter((t=>"#"!==t[0])).join("\n")}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(null==e)return;const i=t.clipboardData?.getData("text/html");let n=t.clipboardData?.getData("text/plain");if(!i&&!n){const e=t.clipboardData?.getData("text/uri-list");e&&(n=this.normalizeURIList(e))}const r=Array.from(t.clipboardData?.files||[]);if(!i&&r.length>0)this.quill.uploader.upload(e,r);else{if(i&&r.length>0){const t=(new DOMParser).parseFromString(i,"text/html");if(1===t.body.childElementCount&&"IMG"===t.body.firstElementChild?.tagName)return void this.quill.uploader.upload(e,r)}this.onPaste(e,{html:i,text:n})}}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:i,html:n}=e;const r=this.quill.getFormat(t.index),s=this.convert({text:i,html:n},r);Nr.log("onPaste",s,{text:i,html:n});const l=(new Ui).retain(t.index).delete(t.length).concat(s);this.quill.updateContents(l,Bn.sources.USER),this.quill.setSelection(l.length()-t.length,Bn.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const i=[],n=[];return this.matchers.forEach((r=>{const[s,l]=r;switch(s){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:i.push(l);break;default:Array.from(t.querySelectorAll(s)).forEach((t=>{if(e.has(t)){const i=e.get(t);i?.push(l)}else e.set(t,[l])}))}})),[i,n]}},"modules/history":class extends On{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(t,e){super(t,e),this.quill.on(Bn.events.EDITOR_CHANGE,((t,e,i,n)=>{t===Bn.events.SELECTION_CHANGE?e&&n!==Bn.sources.SILENT&&(this.currentRange=e):t===Bn.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&n!==Bn.sources.USER?this.transform(e):this.record(e,i)),this.currentRange=Fr(this.currentRange,e))})),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",(t=>{"historyUndo"===t.inputType?(this.undo(),t.preventDefault()):"historyRedo"===t.inputType&&(this.redo(),t.preventDefault())}))}change(t,e){if(0===this.stack[t].length)return;const i=this.stack[t].pop();if(!i)return;const n=this.quill.getContents(),r=i.delta.invert(n);this.stack[e].push({delta:r,range:Fr(i.range,r)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i.delta,Bn.sources.USER),this.ignoreChange=!1,this.restoreSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let i=t.invert(e),n=this.currentRange;const r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){const t=this.stack.undo.pop();t&&(i=i.compose(t.delta),n=t.range)}else this.lastRecorded=r;0!==i.length()&&(this.stack.undo.push({delta:i,range:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){Pr(this.stack.undo,t),Pr(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,Bn.sources.USER);else{const e=function(t,e){const i=e.reduce(((t,e)=>t+(e.delete||0)),0);let n=e.length()-i;return function(t,e){const i=e.ops[e.ops.length-1];return null!=i&&(null!=i.insert?"string"==typeof i.insert&&i.insert.endsWith("\n"):null!=i.attributes&&Object.keys(i.attributes).some((e=>null!=t.query(e,We.BLOCK))))}(t,e)&&(n-=1),n}(this.quill.scroll,t.delta);this.quill.setSelection(e,Bn.sources.USER)}}},"modules/keyboard":vr,"modules/uploader":Ur,"modules/input":class extends On{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",(t=>{this.handleBeforeInput(t)})),/Android/i.test(navigator.userAgent)||t.on(Bn.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(t){xr({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===t.length)return!1;if(e){const i=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents((new Ui).retain(t.index).insert(e,i),Bn.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,Bn.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Zr.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||!0===e.collapsed)return;const i=function(t){return"string"==typeof t.data?t.data:t.dataTransfer?.types.includes("text/plain")?t.dataTransfer.getData("text/plain"):null}(t);if(null==i)return;const n=this.quill.selection.normalizeNative(e),r=n?this.quill.selection.normalizedToRange(n):null;r&&this.replaceText(r,i)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}},"modules/uiNode":class extends On{isListening=!1;selectionChangeDeadline=0;constructor(t,e){super(t,e),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,e){let{line:i,event:n}=e;if(!(i instanceof ui&&i.uiNode))return!0;const r="rtl"===getComputedStyle(i.domNode).direction;return!!(r&&"ArrowRight"!==n.key||!r&&"ArrowLeft"!==n.key)||(this.quill.setSelection(t.index-1,t.length+(n.shiftKey?1:0),Bn.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(t=>{!t.defaultPrevented&&(t=>"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowUp"===t.key||"ArrowDown"===t.key||"Home"===t.key||!(!Kr||"a"!==t.key||!0!==t.ctrlKey))(t)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,this.isListening||(this.isListening=!0,document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0}))}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(!0!==e.collapsed||0!==e.startOffset)return;const i=this.quill.scroll.find(e.startContainer);if(!(i instanceof ui&&i.uiNode))return;const n=document.createRange();n.setStartAfter(i.uiNode),n.setEndAfter(i.uiNode),t.removeAllRanges(),t.addRange(n)}}});const Wr=new class extends ti{add(t,e){let i=0;if("+1"===e||"-1"===e){const n=this.value(t)||0;i="+1"===e?n+1:n-1}else"number"==typeof e&&(i=e);return 0===i?(this.remove(t),!0):super.add(t,i.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}}("indent","ql-indent",{scope:We.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Gr extends Fn{}Gr.blotName="list-container",Gr.tagName="OL";class Qr extends Yi{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(){Bn.register(Gr)}constructor(t,e){super(t,e);const i=e.ownerDocument.createElement("span"),n=i=>{if(!t.isEnabled())return;const n=this.statics.formats(e,t);"checked"===n?(this.format("list","unchecked"),i.preventDefault()):"unchecked"===n&&(this.format("list","checked"),i.preventDefault())};i.addEventListener("mousedown",n),i.addEventListener("touchstart",n),this.attachUI(i)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}Qr.blotName="list",Qr.tagName="LI",Gr.allowedChildren=[Qr],Qr.requiredContainer=Gr;class Yr extends Qi{static blotName="bold";static tagName=["STRONG","B"];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)}}class Xr extends Qi{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];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 Jr(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("href",this.constructor.sanitize(e)):super.format(t,e)}}function Jr(t,e){const i=document.createElement("a");i.href=t;const n=i.href.slice(0,i.href.indexOf(":"));return e.indexOf(n)>-1}const ts=["alt","height","width"],es=["height","width"],is=new ti("code-token","hljs",{scope:We.INLINE});class ns extends Qi{static formats(t,e){for(;null!=t&&t!==e.domNode;){if(t.classList&&t.classList.contains(rr.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,i){super(t,e,i),is.add(this.domNode,i)}format(t,e){t!==ns.blotName?super.format(t,e):e?is.add(this.domNode,e):(is.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),is.value(this.domNode)||this.unwrap()}}ns.blotName="code-token",ns.className="ql-token";class rs extends rr{static create(t){const e=super.create(t);return"string"==typeof t&&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(),ns.blotName,!1),super.replaceWith(t,e)}}class ss extends nr{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===rs.blotName&&(this.forceNext=!0,this.children.forEach((i=>{i.format(t,e)})))}formatAt(t,e,i,n){i===rs.blotName&&(this.forceNext=!0),super.formatAt(t,e,i,n)}highlight(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const i=`${Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode)).map((t=>t.textContent)).join("\n")}\n`,n=rs.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==i){if(i.trim().length>0||null==this.cachedText){const e=this.children.reduce(((t,e)=>t.concat(Ji(e,!1))),new Ui),r=t(i,n);e.diff(r).reduce(((t,e)=>{let{retain:i,attributes:n}=e;return i?(n&&Object.keys(n).forEach((e=>{[rs.blotName,ns.blotName].includes(e)&&this.formatAt(t,i,e,n[e])})),t+i):t}),0)}this.cachedText=i,this.forceNext=!1}}html(t,e){const[i]=this.children.find(t);return`<pre data-language="${i?rs.formats(i.domNode):"plain"}">\n${Gi(this.code(t,e))}\n</pre>`}optimize(t){if(super.optimize(t),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const t=rs.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}ss.allowedChildren=[rs],rs.requiredContainer=ss,rs.allowedChildren=[ns,en,Ki,Zi];class ls extends On{static register(){Bn.register(ns,!0),Bn.register(rs,!0),Bn.register(ss,!0)}constructor(t,e){if(super(t,e),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((t,e)=>{let{key:i}=e;return t[i]=!0,t}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Bn.events.SCROLL_BLOT_MOUNT,(t=>{if(!(t instanceof ss))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((t=>{let{key:i,label:n}=t;const r=e.ownerDocument.createElement("option");r.textContent=n,r.setAttribute("value",i),e.appendChild(r)})),e.addEventListener("change",(()=>{t.format(rs.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)})),null==t.uiNode&&(t.attachUI(e),t.children.head&&(e.value=rs.formats(t.children.head.domNode)))}))}initTimer(){let t=null;this.quill.on(Bn.events.SCROLL_OPTIMIZE,(()=>{t&&clearTimeout(t),t=setTimeout((()=>{this.highlight(),t=null}),this.options.interval)}))}highlight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(Bn.sources.USER);const i=this.quill.getSelection();(null==t?this.quill.scroll.descendants(ss):[t]).forEach((t=>{t.highlight(this.highlightBlot,e)})),this.quill.update(Bn.sources.SILENT),null!=i&&this.quill.setSelection(i,Bn.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(e=this.languages[e]?e:"plain","plain"===e)return Gi(t).split("\n").reduce(((t,i,n)=>(0!==n&&t.insert("\n",{[rr.blotName]:e}),t.insert(i))),new Ui);const i=this.quill.root.ownerDocument.createElement("div");return i.classList.add(rr.className),i.innerHTML=((t,e,i)=>{if("string"==typeof t.versionString){const n=t.versionString.split(".")[0];if(parseInt(n,10)>=11)return t.highlight(i,{language:e}).value}return t.highlight(e,i).value})(this.options.hljs,e,t),Dr(this.quill.scroll,i,[(t,e)=>{const i=is.value(t);return i?e.compose((new Ui).retain(e.length(),{[ns.blotName]:i})):e}],[(t,i)=>t.data.split("\n").reduce(((t,i,n)=>(0!==n&&t.insert("\n",{[rr.blotName]:e}),t.insert(i))),i)],new WeakMap)}}ls.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"}]};class os extends Yi{static blotName="table";static tagName="TD";static create(t){const e=super.create();return e.setAttribute("data-row",t||us()),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===os.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()}}class as extends Fn{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const t=this.children.head.formats(),e=this.children.tail.formats(),i=this.next.children.head.formats(),n=this.next.children.tail.formats();return t.table===e.table&&t.table===i.table&&t.table===n.table}return!1}optimize(t){super.optimize(t),this.children.forEach((t=>{if(null==t.next)return;const e=t.formats(),i=t.next.formats();if(e.table!==i.table){const e=this.splitAfter(t);e&&e.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class cs extends Fn{static blotName="table-body";static tagName="TBODY"}class hs extends Fn{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(as),e=t.reduce(((t,e)=>Math.max(e.children.length,t)),0);t.forEach((t=>{new Array(e-t.children.length).fill(0).forEach((()=>{let e;null!=t.children.head&&(e=os.formats(t.children.head.domNode));const i=this.scroll.create(os.blotName,e);t.appendChild(i),i.optimize()}))}))}cells(t){return this.rows().map((e=>e.children.at(t)))}deleteColumn(t){const[e]=this.descendant(cs);null!=e&&null!=e.children.head&&e.children.forEach((e=>{const i=e.children.at(t);null!=i&&i.remove()}))}insertColumn(t){const[e]=this.descendant(cs);null!=e&&null!=e.children.head&&e.children.forEach((e=>{const i=e.children.at(t),n=os.formats(e.children.head.domNode),r=this.scroll.create(os.blotName,n);e.insertBefore(r,i)}))}insertRow(t){const[e]=this.descendant(cs);if(null==e||null==e.children.head)return;const i=us(),n=this.scroll.create(as.blotName);e.children.head.children.forEach((()=>{const t=this.scroll.create(os.blotName,i);n.appendChild(t)}));const r=e.children.at(t);e.insertBefore(n,r)}rows(){const t=this.children.head;return null==t?[]:t.children.map((t=>t))}}function us(){return`row-${Math.random().toString(36).slice(2,6)}`}hs.allowedChildren=[cs],cs.requiredContainer=hs,cs.allowedChildren=[as],as.requiredContainer=cs,as.allowedChildren=[os],os.requiredContainer=as;const ds=un("quill:toolbar");class fs extends On{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const e=document.createElement("div");e.setAttribute("role","toolbar"),function(t,e){Array.isArray(e[0])||(e=[e]),e.forEach((e=>{const i=document.createElement("span");i.classList.add("ql-formats"),e.forEach((t=>{if("string"==typeof t)ps(i,t);else{const e=Object.keys(t)[0],n=t[e];Array.isArray(n)?function(t,e,i){const n=document.createElement("select");n.classList.add(`ql-${e}`),i.forEach((t=>{const e=document.createElement("option");!1!==t?e.setAttribute("value",String(t)):e.setAttribute("selected","selected"),n.appendChild(e)})),t.appendChild(n)}(i,e,n):ps(i,e,n)}})),t.appendChild(i)}))}(e,this.options.container),t.container?.parentNode?.insertBefore(e,t.container),this.container=e}else this.container="string"==typeof this.options.container?document.querySelector(this.options.container):this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((t=>{const e=this.options.handlers?.[t];e&&this.addHandler(t,e)})),Array.from(this.container.querySelectorAll("button, select")).forEach((t=>{this.attach(t)})),this.quill.on(Bn.events.EDITOR_CHANGE,(()=>{const[t]=this.quill.selection.getRange();this.update(t)}))):ds.error("Container required for toolbar",this.options)}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find((t=>0===t.indexOf("ql-")));e&&(e=e.slice(3),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null!=this.handlers[e]||null!=this.quill.scroll.query(e)?(t.addEventListener("SELECT"===t.tagName?"change":"click",(i=>{let n;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];n=!e.hasAttribute("selected")&&(e.value||!1)}else n=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),i.preventDefault();this.quill.focus();const[r]=this.quill.selection.getRange();if(null!=this.handlers[e])this.handlers[e].call(this,n);else if(this.quill.scroll.query(e).prototype instanceof mi){if(n=prompt(`Enter ${e}`),!n)return;this.quill.updateContents((new Ui).retain(r.index).delete(r.length).insert({[e]:n}),Bn.sources.USER)}else this.quill.format(e,n,Bn.sources.USER);this.update(r)})),this.controls.push([e,t])):ds.warn("ignoring attaching to nonexistent format",e,t))}update(t){const e=null==t?{}:this.quill.getFormat(t);this.controls.forEach((i=>{const[n,r]=i;if("SELECT"===r.tagName){let i=null;if(null==t)i=null;else if(null==e[n])i=r.querySelector("option[selected]");else if(!Array.isArray(e[n])){let t=e[n];"string"==typeof t&&(t=t.replace(/"/g,'\\"')),i=r.querySelector(`option[value="${t}"]`)}null==i?(r.value="",r.selectedIndex=-1):i.selected=!0}else if(null==t)r.classList.remove("ql-active"),r.setAttribute("aria-pressed","false");else if(r.hasAttribute("value")){const t=e[n],i=t===r.getAttribute("value")||null!=t&&t.toString()===r.getAttribute("value")||null==t&&!r.getAttribute("value");r.classList.toggle("ql-active",i),r.setAttribute("aria-pressed",i.toString())}else{const t=null!=e[n];r.classList.toggle("ql-active",t),r.setAttribute("aria-pressed",t.toString())}}))}}function ps(t,e,i){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${e}`),n.setAttribute("aria-pressed","false"),null!=i?(n.value=i,n.setAttribute("aria-label",`${e}: ${i}`)):n.setAttribute("aria-label",e),t.appendChild(n)}fs.DEFAULTS={},fs.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(null!=t)if(0===t.length){const t=this.quill.getFormat();Object.keys(t).forEach((t=>{null!=this.quill.scroll.query(t,We.INLINE)&&this.quill.format(t,!1,Bn.sources.USER)}))}else this.quill.removeFormat(t.index,t.length,Bn.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();"rtl"===t&&null==e?this.quill.format("align","right",Bn.sources.USER):t||"right"!==e||this.quill.format("align",!1,Bn.sources.USER),this.quill.format("direction",t,Bn.sources.USER)},indent(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e),n=parseInt(i.indent||0,10);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===i.direction&&(e*=-1),this.quill.format("indent",n+e,Bn.sources.USER)}},link(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,Bn.sources.USER)},list(t){const e=this.quill.getSelection(),i=this.quill.getFormat(e);this.quill.format("list","check"===t?"checked"!==i.list&&"unchecked"!==i.list&&"unchecked":t,Bn.sources.USER)}}};const qs='<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>';var bs={align:{"":'<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>',center:'<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>',right:'<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>',justify:'<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>'},background:'<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>',blockquote:'<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>',bold:'<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>',clean:'<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>',code:qs,"code-block":qs,color:'<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',direction:{"":'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',rtl:'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>'},formula:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',header:{1:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',2:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',3:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',4:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',5:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',6:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>'},italic:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',image:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indent:{"+1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',"-1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>'},link:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',list:{bullet:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',check:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',ordered:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>'},script:{sub:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',super:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>'},strike:'<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',table:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underline:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',video:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>'};let vs=0;function ms(t,e){t.setAttribute(e,`${!("true"===t.getAttribute(e))}`)}class gs{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",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),ms(this.label,"aria-expanded"),ms(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 i=t.getAttribute("value");return i&&e.setAttribute("data-value",i),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",(()=>{this.selectItem(e,!0)})),e.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.selectItem(e,!0),t.preventDefault();break;case"Escape":this.escape(),t.preventDefault()}})),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML='<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>',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-${vs}`,vs+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach((e=>{const i=this.buildItem(e);t.appendChild(i),!0===e.selected&&this.selectItem(i)})),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&&void 0!==arguments[1]&&arguments[1];const i=this.container.querySelector(".ql-selected");t!==i&&(null!=i&&i.classList.remove("ql-selected"),null!=t&&(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 e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);const e=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class ws extends gs{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((t=>{t.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 i=this.label.querySelector(".ql-color-label"),n=t&&t.getAttribute("data-value")||"";i&&("line"===i.tagName?i.style.stroke=n:i.style.fill=n)}}class ys extends gs{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((t=>{t.innerHTML=e[t.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const i=t||this.defaultItem;if(null!=i){if(this.label.innerHTML===i.innerHTML)return;this.label.innerHTML=i.innerHTML}}}class ks{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(t=>{const{overflowY:e}=getComputedStyle(t,null);return"visible"!==e&&"clip"!==e})(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,i=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${i}px`,this.root.classList.remove("ql-flip");const n=this.boundsContainer.getBoundingClientRect(),r=this.root.getBoundingClientRect();let s=0;return r.right>n.right&&(s=n.right-r.right,this.root.style.left=`${e+s}px`),r.left<n.left&&(s=n.left-r.left,this.root.style.left=`${e+s}px`),r.bottom>n.bottom&&(this.root.style.top=i-(t.bottom-t.top+(r.bottom-r.top))+"px",this.root.classList.add("ql-flip")),s}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const xs=[!1,"center","right","justify"],js=["#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"],As=[!1,"serif","monospace"],Os=["1","2","3",!1],Ms=["small",!1,"large","huge"];class Es extends _n{constructor(t,e){super(t,e);const i=e=>{document.body.contains(t.root)?(null==this.tooltip||this.tooltip.root.contains(e.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((t=>{t.container.contains(e.target)||t.close()}))):document.body.removeEventListener("click",i)};t.emitter.listenDOM("click",document.body,i)}addModule(t){const e=super.addModule(t);return"toolbar"===t&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach((t=>{(t.getAttribute("class")||"").split(/\s+/).forEach((i=>{if(i.startsWith("ql-")&&(i=i.slice(3),null!=e[i]))if("direction"===i)t.innerHTML=e[i][""]+e[i].rtl;else if("string"==typeof e[i])t.innerHTML=e[i];else{const n=t.value||"";null!=n&&e[i][n]&&(t.innerHTML=e[i][n])}}))}))}buildPickers(t,e){this.pickers=Array.from(t).map((t=>{if(t.classList.contains("ql-align")&&(null==t.querySelector("option")&&_s(t,xs),"object"==typeof e.align))return new ys(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const i=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&_s(t,js,"background"===i?"#ffffff":"#000000"),new ws(t,e[i])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?_s(t,As):t.classList.contains("ql-header")?_s(t,Os):t.classList.contains("ql-size")&&_s(t,Ms)),new gs(t)})),this.quill.on(fn.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((t=>{t.update()}))}))}}Es.DEFAULTS=Ke({},_n.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");null==t&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",(()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""})),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Ts extends ks{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(t=>{"Enter"===t.key?(this.save(),t.preventDefault()):"Escape"===t.key&&(this.cancel(),t.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const i=this.quill.getBounds(this.quill.selection.savedRange);null!=i&&this.position(i),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,fn.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,fn.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=function(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(null!=e){const i=e.index+e.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),t,fn.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",fn.sources.USER),this.quill.setSelection(i+2,fn.sources.USER)}break}}this.textbox.value="",this.hide()}}function _s(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach((e=>{const n=document.createElement("option");e===i?n.setAttribute("selected","selected"):n.setAttribute("value",String(e)),t.appendChild(n)}))}const Ns=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Ls extends Ts{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,e){super(t,e),this.quill.on(fn.events.EDITOR_CHANGE,((t,e,i,n)=>{if(t===fn.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&n===fn.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const t=this.quill.getLines(e.index,e.length);if(1===t.length){const t=this.quill.getBounds(e);null!=t&&this.position(t)}else{const i=t[t.length-1],n=this.quill.getIndex(i),r=Math.min(i.length()-1,e.index+e.length-n),s=this.quill.getBounds(new qn(n,r));null!=s&&this.position(s)}}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(fn.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(null!=t){const e=this.quill.getBounds(t);null!=e&&this.position(e)}}),1)}))}cancel(){this.show()}position(t){const e=super.position(t),i=this.root.querySelector(".ql-tooltip-arrow");return i.style.marginLeft="",0!==e&&(i.style.marginLeft=-1*e-i.offsetWidth/2+"px"),e}}class $s extends Es{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=Ns),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Ls(this.quill,this.options.bounds),null!=t.container&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),bs),this.buildPickers(t.container.querySelectorAll("select"),bs))}}$s.DEFAULTS=Ke({},Es.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Bn.sources.USER)}}}}});const zs=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Cs extends Ts{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(t=>{if(null!=this.linkRange){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,fn.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()})),this.quill.on(fn.events.SELECTION_CHANGE,((t,e,i)=>{if(null!=t){if(0===t.length&&i===fn.sources.USER){const[e,i]=this.quill.scroll.descendant(Xr,t.index);if(null!=e){this.linkRange=new qn(t.index-i,e.length());const n=Xr.formats(e.domNode);this.preview.textContent=n,this.preview.setAttribute("href",n),this.show();const r=this.quill.getBounds(this.linkRange);return void(null!=r&&this.position(r))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class Ss extends Es{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=zs),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){null!=t.container&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),bs),this.buildPickers(t.container.querySelectorAll("select"),bs),this.tooltip=new Cs(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((e,i)=>{t.handlers.link.call(t,!i.format.link)})))}}Ss.DEFAULTS=Ke({},Es.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(null==t||0===t.length)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&0!==e.indexOf("mailto:")&&(e=`mailto:${e}`);const{tooltip:i}=this.quill.theme;i.edit("link",e)}else this.quill.format("link",!1,Bn.sources.USER)}}}}}),Bn.register({"attributors/attribute/direction":or,"attributors/class/align":Qn,"attributors/class/background":er,"attributors/class/color":Jn,"attributors/class/direction":ar,"attributors/class/font":ur,"attributors/class/size":fr,"attributors/style/align":Yn,"attributors/style/background":ir,"attributors/style/color":tr,"attributors/style/direction":cr,"attributors/style/font":dr,"attributors/style/size":pr},!0),Bn.register({"formats/align":Qn,"formats/direction":ar,"formats/indent":Wr,"formats/background":ir,"formats/color":tr,"formats/font":ur,"formats/size":fr,"formats/blockquote":class extends Yi{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":rr,"formats/header":class extends Yi{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(t){return this.tagName.indexOf(t.tagName)+1}},"formats/list":Qr,"formats/bold":Yr,"formats/code":sr,"formats/italic":class extends Yr{static blotName="italic";static tagName=["EM","I"]},"formats/link":Xr,"formats/script":class extends Qi{static blotName="script";static tagName=["SUB","SUP"];static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}},"formats/strike":class extends Yr{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends Qi{static blotName="underline";static tagName="U"},"formats/formula":class extends En{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(t){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return"string"==typeof t&&(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>`}},"formats/image":class extends mi{static blotName="image";static tagName="IMG";static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return ts.reduce(((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e)),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Jr(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){ts.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}},"formats/video":class extends Xi{static blotName="video";static className="ql-video";static tagName="IFRAME";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 es.reduce(((e,i)=>(t.hasAttribute(i)&&(e[i]=t.getAttribute(i)),e)),{})}static sanitize(t){return Xr.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){es.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>`}},"modules/syntax":ls,"modules/table":class extends On{static register(){Bn.register(os),Bn.register(as),Bn.register(cs),Bn.register(hs)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(hs).forEach((t=>{t.balanceCells()}))}deleteColumn(){const[t,,e]=this.getTable();null!=e&&(t.deleteColumn(e.cellOffset()),this.quill.update(Bn.sources.USER))}deleteRow(){const[,t]=this.getTable();null!=t&&(t.remove(),this.quill.update(Bn.sources.USER))}deleteTable(){const[t]=this.getTable();if(null==t)return;const e=t.offset();t.remove(),this.quill.update(Bn.sources.USER),this.quill.setSelection(e,Bn.sources.SILENT)}getTable(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==t)return[null,null,null,-1];const[e,i]=this.quill.getLine(t.index);if(null==e||e.statics.blotName!==os.blotName)return[null,null,null,-1];const n=e.parent;return[n.parent.parent,n,e,i]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[i,n,r]=this.getTable(e);if(null==r)return;const s=r.cellOffset();i.insertColumn(s+t),this.quill.update(Bn.sources.USER);let l=n.rowOffset();0===t&&(l+=1),this.quill.setSelection(e.index+l,e.length,Bn.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[i,n,r]=this.getTable(e);if(null==r)return;const s=n.rowOffset();i.insertRow(s+t),this.quill.update(Bn.sources.USER),t>0?this.quill.setSelection(e,Bn.sources.SILENT):this.quill.setSelection(e.index+n.children.length,e.length,Bn.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const i=this.quill.getSelection();if(null==i)return;const n=new Array(t).fill(0).reduce((t=>{const i=new Array(e).fill("\n").join("");return t.insert(i,{table:us()})}),(new Ui).retain(i.index));this.quill.updateContents(n,Bn.sources.USER),this.quill.setSelection(i.index,Bn.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Bn.events.SCROLL_OPTIMIZE,(t=>{t.some((t=>!!["TD","TR","TBODY","TABLE"].includes(t.target.tagName)&&(this.quill.once(Bn.events.TEXT_CHANGE,((t,e,i)=>{i===Bn.sources.USER&&this.balanceTables()})),!0)))}))}},"modules/toolbar":fs,"themes/bubble":$s,"themes/snow":Ss,"ui/icons":bs,"ui/picker":gs,"ui/icon-picker":ys,"ui/color-picker":ws,"ui/tooltip":ks},!0);const Bs=t=>Boolean(t.tagName),Rs=class{constructor(i){t(this,i),this.inputValid=e(this,"input-valid",7),this.valueChange=e(this,"value-change",7),this.hasDisplayedError=!1,this.customErrorMessage={lock:!1},this.value="",this.labelOnTop=!1,this.labelHide=!1,this.rows=5,this.required=!1,this.readonly=!1,this.disabled=!1,this.tooltipPosition="input",this.classCollection=new s(["mg-c-input--rich-text-editor"]),this.isEmpty=()=>{const t=this.getTextContent();return!(r(t)&&"\n"!==t)},this.getTextContent=()=>this.value.replace(/<[^>]*>/g,"").trim(),this.getPatternValidity=()=>void 0===this.pattern||new RegExp(`^${this.pattern}$`,"u").test(this.getTextContent()),this.checkValidity=()=>{this.setValidity(this.readonly||this.disabled||(!this.required||!this.isEmpty())&&this.getPatternValidity())},this.setErrorMessage=(t=!1)=>{this.errorMessage=void 0,this.valid||(t||this.customErrorMessage.lock&&void 0!==this.customErrorMessage.message?this.errorMessage=this.customErrorMessage.message:this.required&&this.isEmpty()?this.errorMessage=this.messages.errors.required:this.getPatternValidity()||(this.errorMessage=this.patternErrorMessage))},this.handleFocus=()=>{this.classCollection=new s(this.classCollection.classes)},this.handleBlur=()=>{this.classCollection=new s(this.classCollection.classes),this.readonly||(this.checkValidity(),this.setErrorMessage(),this.valid||(this.hasDisplayedError=!0))},this.handleTextChange=()=>{const t=this.editor.getSemanticHTML();this.value=t,this.valueChange.emit(t),this.checkValidity(),this.hasDisplayedError&&this.setErrorMessage()}}watchReadonly(t){t?this.classCollection.add(o):this.classCollection.delete(o)}watchDisabled(t){var e,i;t?(this.classCollection.add(a),null===(e=this.editor)||void 0===e||e.disable()):(this.classCollection.delete(a),null===(i=this.editor)||void 0===i||i.enable())}handleValidityChange(){null!=this.editor&&(this.checkValidity(),this.hasDisplayedError&&(this.setErrorMessage(),this.hasDisplayedError=!1))}validatePattern(t){if(!(void 0===t||r(this.pattern)&&r(this.patternErrorMessage)))throw new Error(`<mg-input-rich-text-editor> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${l(this.pattern)}'" and "patternErrorMessage='${l(this.patternErrorMessage)}'".`)}async setFocus(){var t;null===(t=this.editor)||void 0===t||t.focus()}getHTML(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getSemanticHTML())}))}))}async getText(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getText())}))}))}async displayError(){return new Promise((t=>{requestAnimationFrame((()=>{this.checkValidity(),this.setErrorMessage(),this.hasDisplayedError=this.invalid,t()}))}))}async setError(t,e,i=!1){if("boolean"!=typeof t)throw new Error('<mg-input-rich-text-editor> method "setError()" param "valid" must be a boolean.');if(void 0!==e&&!r(e))throw new Error('<mg-input-rich-text-editor> method "setError()" param "errorMessage" must be a string.');this.customErrorMessage={lock:!t&&i,message:t?void 0:e},this.setValidity(t),this.setErrorMessage(!0),this.hasDisplayedError=this.invalid}async reset(){if(!this.readonly)return this.value="",this.editor.setText(""),new Promise((t=>{requestAnimationFrame((()=>{this.customErrorMessage={lock:!1},this.checkValidity(),this.errorMessage=void 0,this.hasDisplayedError=!1,t()}))}))}setValidity(t){const e=this.valid;this.customErrorMessage.lock&&(void 0===this.customErrorMessage.message||t)||(this.valid=t),this.invalid=!this.valid,this.valid!==e&&this.inputValid.emit(this.valid)}componentWillLoad(){return this.messages=c(this.element).messages,this.element.style.setProperty("--mg-c-input-rich-text-editor-rows",this.rows.toString()),this.validatePattern(this.pattern),this.validatePattern(this.patternErrorMessage),this.watchReadonly(this.readonly),this.watchDisabled(this.disabled),setTimeout((()=>{this.checkValidity()}),0)}componentDidLoad(){this.readonly||(this.editor=((t,{value:e,modules:i,readOnly:n,placeholder:s,handleTextChange:l,handleFocus:o,handleBlur:a})=>{const c=new Bn(t.querySelector("div"),{theme:"snow",modules:i||{toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]},readOnly:n,placeholder:s});r(e)&&/<[a-z][\s\S]*>/i.test(e)?c.clipboard.dangerouslyPasteHTML(e):r(e)&&c.setText(e);const h=t.querySelector(".ql-editor");return h.addEventListener("focus",o),h.addEventListener("blur",a),c.on("text-change",l),(t=>{const e=()=>t.root.getRootNode();t.selection.hasFocus=()=>e().activeElement===t.root,t.selection.getNativeRange=()=>{const i=(t=>{try{if("function"==typeof document.createElement("div").attachShadow({mode:"open"}).getSelection)return t.getSelection().getRangeAt(0);const e=window.getSelection();return"function"==typeof e.getComposedRanges?e.getComposedRanges(t)[0]:e.getRangeAt(0)}catch(t){return null}})(e());return Boolean(i)?t.selection.normalizeNative(i):null},t.selection.setNativeRange=(e,i,n=e,r=i,s=!1)=>{if([null==e?void 0:e.parentNode,t.root.parentNode,null==n?void 0:n.parentNode].some((t=>null==t)))return;const l=window.getSelection();t.selection.hasFocus()||t.root.focus();const o=(t.selection.getNativeRange()||{}).native;Boolean(o)&&!s&&e===o.startContainer&&i===o.startOffset&&n===o.endContainer&&r===o.endOffset||(Bs(e)&&"BR"===e.tagName&&(i=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),Bs(n)&&"BR"===n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode),l.setBaseAndExtent(e,i,n,r))},document.addEventListener("selectionchange",(()=>{t.selection.update()}))})(c),c})(this.wrapperElement,{modules:this.modules,readOnly:this.readonly||this.disabled,placeholder:this.placeholder,value:this.value,handleTextChange:this.handleTextChange,handleBlur:this.handleBlur,handleFocus:this.handleFocus}))}render(){return i("mg-input",{key:"5e807e1059704a6624a1fda63ab56a6f9a51230f",identifier:this.identifier,class:this.classCollection.join(),label:this.label,labelOnTop:this.labelOnTop,labelHide:this.labelHide,required:this.required,tooltip:this.tooltip,tooltipPosition:this.tooltipPosition,helpText:this.helpText,errorMessage:this.hasDisplayedError?this.errorMessage:void 0},this.readonly?i("div",{class:"mg-c-input__readonly-value",innerHTML:this.value}):i("div",{ref:t=>{this.wrapperElement=t},id:this.identifier,class:"mg-c-input__wrapper"},i("div",null)))}get element(){return n(this)}static get watchers(){return{readonly:["watchReadonly","handleValidityChange"],disabled:["watchDisabled","handleValidityChange"],required:["handleValidityChange"],pattern:["validatePattern"],patternErrorMessage:["validatePattern"]}}};Rs.style="/*!\n * Quill Editor v2.0.3\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked]>.ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked]>.ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li>.ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked]>.ql-ui,.ql-editor li[data-list=unchecked]>.ql-ui{color:#777}.ql-editor li[data-list=bullet]>.ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked]>.ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked]>.ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered]>.ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1>.ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2>.ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3>.ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4>.ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5>.ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6>.ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7>.ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8>.ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9>.ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl>.ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow+.ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);overflow-wrap:anywhere}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.mg-c-input__wrapper{display:flex;width:100%;flex-direction:column;border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light)}.mg-c-input__wrapper:focus-within{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus);outline:Highlight auto .1rem;outline:-webkit-focus-ring-color auto .1rem}.mg-c-input--has-error .mg-c-input__wrapper{border-color:var(--mg-b-color-danger)}.mg-c-input--disabled .mg-c-input__wrapper{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p{margin:0}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor .ql-toolbar{display:flex;flex-wrap:wrap;padding:var(--mg-b-size-8);border:0;border-radius:var(--mg-c-input-border-radius) var(--mg-c-input-border-radius) 0 0;background:var(--mg-b-color-neutral-0);border-block-end-width:var(--mg-c-input-border-width);border-block-end-color:var(--mg-c-input-color-border);border-block-end-style:solid}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats{display:inline-flex;margin:inherit;gap:.2rem}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats:not(:last-child)::after{width:.1rem;height:var(--mg-b-size-16);background:var(--mg-c-input-color-border);content:\"\";margin-block:var(--mg-b-size-8);margin-inline:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-toolbar button .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-fill{fill:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button{display:flex;min-width:var(--mg-b-size-32);height:var(--mg-b-size-32);align-items:center;justify-content:center;padding:var(--mg-b-size-4);border:.1rem solid rgba(0,0,0,0);border-radius:var(--mg-b-size-radius);color:var(--mg-b-color-dark);float:inherit;transition-duration:.2s;transition-property:background-color,border-color;transition-timing-function:ease-in-out}.mg-c-input--rich-text-editor .ql-toolbar button svg{width:var(--mg-b-size-20);height:var(--mg-b-size-20)}.mg-c-input--rich-text-editor .ql-toolbar button:focus{color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button:focus-visible,.mg-c-input--rich-text-editor .ql-toolbar button:hover,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active{border-color:var(--mg-b-color-neutral-70);background:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke-width:.12rem}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke.ql-thin{stroke-width:.1rem}.mg-c-input--rich-text-editor .ql-toolbar button.ql-bold .ql-stroke{stroke-width:.2rem}.mg-c-input--rich-text-editor .ql-container{border:0;border-radius:0 0 var(--mg-c-input-border-radius) var(--mg-c-input-border-radius);margin:0 .1rem .1rem;background:var(--mg-b-color-neutral-0)}.mg-c-input--rich-text-editor .ql-editor{min-height:calc(calc(var(--mg-b-font-size) * var(--mg-b-line-height) * var(--mg-c-input-rich-text-editor-rows, 3)) + calc((var(--mg-b-size-min-height) - var(--mg-b-font-size) * var(--mg-b-line-height)) / 2));padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);color:var(--mg-b-color-dark);font-size:var(--mg-b-font-size)}.mg-c-input--rich-text-editor .ql-editor.ql-blank::before{right:var(--mg-b-size-8);left:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-editor p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor.mg-c-input--disabled .ql-toolbar{pointer-events:none}.mg-c-input--rich-text-editor.mg-c-input--has-error .ql-toolbar{border-color:var(--mg-b-color-danger)}";export{Rs as mg_input_rich_text_editor}