@tqc-solution/design-system 0.1.73

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 (131) hide show
  1. package/README.md +207 -0
  2. package/dist/assets/icon/IconAi.d.ts +3 -0
  3. package/dist/assets/icon/IconAlertTriangleSolid.d.ts +3 -0
  4. package/dist/assets/icon/IconAudio.d.ts +3 -0
  5. package/dist/assets/icon/IconCalendar.d.ts +3 -0
  6. package/dist/assets/icon/IconCaretDown.d.ts +3 -0
  7. package/dist/assets/icon/IconCheck.d.ts +3 -0
  8. package/dist/assets/icon/IconCheckCircleSolid.d.ts +3 -0
  9. package/dist/assets/icon/IconChevronLeft.d.ts +3 -0
  10. package/dist/assets/icon/IconChevronRight.d.ts +3 -0
  11. package/dist/assets/icon/IconCircleArrowLeftSolid.d.ts +3 -0
  12. package/dist/assets/icon/IconCircleArrowRightSolid.d.ts +3 -0
  13. package/dist/assets/icon/IconClock.d.ts +3 -0
  14. package/dist/assets/icon/IconClose.d.ts +3 -0
  15. package/dist/assets/icon/IconCloseCircleSolid.d.ts +3 -0
  16. package/dist/assets/icon/IconColumns.d.ts +3 -0
  17. package/dist/assets/icon/IconCopy.d.ts +3 -0
  18. package/dist/assets/icon/IconDelete.d.ts +3 -0
  19. package/dist/assets/icon/IconDocument.d.ts +3 -0
  20. package/dist/assets/icon/IconExcel.d.ts +3 -0
  21. package/dist/assets/icon/IconEye.d.ts +3 -0
  22. package/dist/assets/icon/IconEyeSlash.d.ts +3 -0
  23. package/dist/assets/icon/IconFile.d.ts +3 -0
  24. package/dist/assets/icon/IconFolder.d.ts +3 -0
  25. package/dist/assets/icon/IconImg.d.ts +3 -0
  26. package/dist/assets/icon/IconInfoSolid.d.ts +3 -0
  27. package/dist/assets/icon/IconPdf.d.ts +3 -0
  28. package/dist/assets/icon/IconPowerPoint.d.ts +3 -0
  29. package/dist/assets/icon/IconPts.d.ts +3 -0
  30. package/dist/assets/icon/IconSearch.d.ts +3 -0
  31. package/dist/assets/icon/IconSmallCaretRightSolid.d.ts +3 -0
  32. package/dist/assets/icon/IconTemplate.d.ts +3 -0
  33. package/dist/assets/icon/IconTxt.d.ts +3 -0
  34. package/dist/assets/icon/IconUpload.d.ts +3 -0
  35. package/dist/assets/icon/IconVideo.d.ts +3 -0
  36. package/dist/assets/icon/IconWord.d.ts +3 -0
  37. package/dist/assets/icon/IconZip.d.ts +3 -0
  38. package/dist/components/Alert/Alert.d.ts +13 -0
  39. package/dist/components/Alert/index.d.ts +2 -0
  40. package/dist/components/Avatar/Avatar.d.ts +37 -0
  41. package/dist/components/Avatar/index.d.ts +2 -0
  42. package/dist/components/Badge/Badge.d.ts +37 -0
  43. package/dist/components/Badge/index.d.ts +2 -0
  44. package/dist/components/Button/Button.d.ts +19 -0
  45. package/dist/components/Button/index.d.ts +2 -0
  46. package/dist/components/CardTable/CardTable.d.ts +87 -0
  47. package/dist/components/CardTable/index.d.ts +2 -0
  48. package/dist/components/Chart/BarChart/BarChart.d.ts +40 -0
  49. package/dist/components/Chart/BarChart/index.d.ts +2 -0
  50. package/dist/components/Chart/HorizontalBarChart/HorizontalBarChart.d.ts +32 -0
  51. package/dist/components/Chart/HorizontalBarChart/index.d.ts +2 -0
  52. package/dist/components/Chart/LineChart/LineChart.d.ts +48 -0
  53. package/dist/components/Chart/LineChart/index.d.ts +2 -0
  54. package/dist/components/Chart/MultiLineAndBarChart/MultiLineAndBarChart.d.ts +57 -0
  55. package/dist/components/Chart/MultiLineAndBarChart/index.d.ts +2 -0
  56. package/dist/components/Chart/MultilineChart/MultilineChart.d.ts +25 -0
  57. package/dist/components/Chart/MultilineChart/index.d.ts +2 -0
  58. package/dist/components/Chart/PieChart/PieChart.d.ts +20 -0
  59. package/dist/components/Chart/PieChart/index.d.ts +2 -0
  60. package/dist/components/Checkbox/Checkbox.d.ts +21 -0
  61. package/dist/components/Checkbox/index.d.ts +2 -0
  62. package/dist/components/DatePicker/DatePicker/DatePicker.d.ts +24 -0
  63. package/dist/components/DatePicker/DatePicker/index.d.ts +2 -0
  64. package/dist/components/DatePicker/DateRangePicker/DateRangePicker.d.ts +34 -0
  65. package/dist/components/DatePicker/DateRangePicker/index.d.ts +2 -0
  66. package/dist/components/DatePicker/MonthPicker/MonthPicker.d.ts +20 -0
  67. package/dist/components/DatePicker/MonthPicker/index.d.ts +2 -0
  68. package/dist/components/DatePicker/TimePicker/TimePicker.d.ts +20 -0
  69. package/dist/components/DatePicker/TimePicker/index.d.ts +2 -0
  70. package/dist/components/DatePicker/YearPicker/YearPicker.d.ts +20 -0
  71. package/dist/components/DatePicker/YearPicker/index.d.ts +2 -0
  72. package/dist/components/Editor/Editor.d.ts +16 -0
  73. package/dist/components/Editor/index.d.ts +2 -0
  74. package/dist/components/EditorHtml/EditorHtml.d.ts +35 -0
  75. package/dist/components/EditorHtml/index.d.ts +2 -0
  76. package/dist/components/EditorJs/EditorJs.d.ts +35 -0
  77. package/dist/components/EditorJs/index.d.ts +2 -0
  78. package/dist/components/Input/InputForm/InputForm.d.ts +42 -0
  79. package/dist/components/Input/InputForm/index.d.ts +2 -0
  80. package/dist/components/Input/InputFormSpecial/InputFormSpecial.d.ts +110 -0
  81. package/dist/components/Input/InputFormSpecial/index.d.ts +2 -0
  82. package/dist/components/Input/InputOTP/InputOTP.d.ts +29 -0
  83. package/dist/components/Input/InputOTP/index.d.ts +2 -0
  84. package/dist/components/Input/InputSearch/InputSearch.d.ts +34 -0
  85. package/dist/components/Input/InputSearch/index.d.ts +2 -0
  86. package/dist/components/InputText/InputText.d.ts +56 -0
  87. package/dist/components/InputText/index.d.ts +2 -0
  88. package/dist/components/Loading/Loading.d.ts +19 -0
  89. package/dist/components/Loading/index.d.ts +2 -0
  90. package/dist/components/Modal/Modal.d.ts +49 -0
  91. package/dist/components/Modal/index.d.ts +2 -0
  92. package/dist/components/Pagination/Pagination.d.ts +24 -0
  93. package/dist/components/Pagination/index.d.ts +2 -0
  94. package/dist/components/ProgressBar/ProgressBar.d.ts +21 -0
  95. package/dist/components/ProgressBar/index.d.ts +2 -0
  96. package/dist/components/RadioButton/RadioButton.d.ts +17 -0
  97. package/dist/components/RadioButton/index.d.ts +2 -0
  98. package/dist/components/Slider/Slider.d.ts +37 -0
  99. package/dist/components/Slider/index.d.ts +1 -0
  100. package/dist/components/TabBar/TabBar.d.ts +18 -0
  101. package/dist/components/TabBar/index.d.ts +2 -0
  102. package/dist/components/TabBarGroup/TabBarGroup.d.ts +32 -0
  103. package/dist/components/TabBarGroup/index.d.ts +2 -0
  104. package/dist/components/Tag/Tag.d.ts +45 -0
  105. package/dist/components/Tag/index.d.ts +2 -0
  106. package/dist/components/Toast/Toast.d.ts +9 -0
  107. package/dist/components/Toast/index.d.ts +2 -0
  108. package/dist/components/Toggle/Toggle.d.ts +17 -0
  109. package/dist/components/Toggle/index.d.ts +2 -0
  110. package/dist/components/Tooltip/Tooltip.d.ts +10 -0
  111. package/dist/components/Tooltip/index.d.ts +2 -0
  112. package/dist/components/Typography/Typography.d.ts +16 -0
  113. package/dist/components/Typography/index.d.ts +2 -0
  114. package/dist/components/Upload/Upload.d.ts +49 -0
  115. package/dist/components/Upload/index.d.ts +2 -0
  116. package/dist/index-BcEf-eHA.js +228 -0
  117. package/dist/index-BhBGF4B7.cjs +11 -0
  118. package/dist/index-DU1rSsif.js +548 -0
  119. package/dist/index-b5gz6Ifp.cjs +1 -0
  120. package/dist/index.cjs.js +58 -0
  121. package/dist/index.d.ts +74 -0
  122. package/dist/index.es.js +8045 -0
  123. package/dist/pubfuture.css +188 -0
  124. package/dist/quill-CqfsVyV-.js +7529 -0
  125. package/dist/quill-DqFubOCp.cjs +49 -0
  126. package/dist/tailwind/index.d.ts +4 -0
  127. package/dist/tailwind/index.js +2 -0
  128. package/dist/tailwind/pubfuture.preset.d.ts +4 -0
  129. package/dist/tailwind/pubfuture.preset.js +217 -0
  130. package/dist/types.d.ts +6 -0
  131. package/package.json +100 -0
@@ -0,0 +1,49 @@
1
+ "use strict";var gl=typeof global=="object"&&global&&global.Object===Object&&global,vo=typeof self=="object"&&self&&self.Object===Object&&self,Xt=gl||vo||Function("return this")(),de=Xt.Symbol,pl=Object.prototype,Eo=pl.hasOwnProperty,Ao=pl.toString,yr=de?de.toStringTag:void 0;function No(n){var t=Eo.call(n,yr),e=n[yr];try{n[yr]=void 0;var r=!0}catch{}var s=Ao.call(n);return r&&(t?n[yr]=e:delete n[yr]),s}var wo=Object.prototype,To=wo.toString;function xo(n){return To.call(n)}var Lo="[object Null]",_o="[object Undefined]",hi=de?de.toStringTag:void 0;function tr(n){return n==null?n===void 0?_o:Lo:hi&&hi in Object(n)?No(n):xo(n)}function re(n){return n!=null&&typeof n=="object"}var Te=Array.isArray;function pe(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function ml(n){return n}var So="[object AsyncFunction]",Oo="[object Function]",qo="[object GeneratorFunction]",Co="[object Proxy]";function Ks(n){if(!pe(n))return!1;var t=tr(n);return t==Oo||t==qo||t==So||t==Co}var ps=Xt["__core-js_shared__"],fi=(function(){var n=/[^.]+$/.exec(ps&&ps.keys&&ps.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function Io(n){return!!fi&&fi in n}var Ro=Function.prototype,ko=Ro.toString;function _e(n){if(n!=null){try{return ko.call(n)}catch{}try{return n+""}catch{}}return""}var Bo=/[\\^$.*+?()[\]{}|]/g,Mo=/^\[object .+?Constructor\]$/,Do=Function.prototype,jo=Object.prototype,Po=Do.toString,$o=jo.hasOwnProperty,Uo=RegExp("^"+Po.call($o).replace(Bo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fo(n){if(!pe(n)||Io(n))return!1;var t=Ks(n)?Uo:Mo;return t.test(_e(n))}function Ho(n,t){return n?.[t]}function Se(n,t){var e=Ho(n,t);return Fo(e)?e:void 0}var Os=Se(Xt,"WeakMap"),di=Object.create,zo=(function(){function n(){}return function(t){if(!pe(t))return{};if(di)return di(t);n.prototype=t;var e=new n;return n.prototype=void 0,e}})();function Ko(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function Go(n,t){var e=-1,r=n.length;for(t||(t=Array(r));++e<r;)t[e]=n[e];return t}var Vo=800,Wo=16,Zo=Date.now;function Xo(n){var t=0,e=0;return function(){var r=Zo(),s=Wo-(r-e);if(e=r,s>0){if(++t>=Vo)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function Yo(n){return function(){return n}}var dn=(function(){try{var n=Se(Object,"defineProperty");return n({},"",{}),n}catch{}})(),Qo=dn?function(n,t){return dn(n,"toString",{configurable:!0,enumerable:!1,value:Yo(t),writable:!0})}:ml,Jo=Xo(Qo);function ta(n,t){for(var e=-1,r=n==null?0:n.length;++e<r&&t(n[e],e,n)!==!1;);return n}var ea=9007199254740991,ra=/^(?:0|[1-9]\d*)$/;function bl(n,t){var e=typeof n;return t=t??ea,!!t&&(e=="number"||e!="symbol"&&ra.test(n))&&n>-1&&n%1==0&&n<t}function Gs(n,t,e){t=="__proto__"&&dn?dn(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function Cr(n,t){return n===t||n!==n&&t!==t}var na=Object.prototype,sa=na.hasOwnProperty;function yl(n,t,e){var r=n[t];(!(sa.call(n,t)&&Cr(r,e))||e===void 0&&!(t in n))&&Gs(n,t,e)}function ia(n,t,e,r){var s=!e;e||(e={});for(var i=-1,o=t.length;++i<o;){var a=t[i],u=void 0;u===void 0&&(u=n[a]),s?Gs(e,a,u):yl(e,a,u)}return e}var gi=Math.max;function la(n,t,e){return t=gi(t===void 0?n.length-1:t,0),function(){for(var r=arguments,s=-1,i=gi(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=e(o),Ko(n,this,a)}}function oa(n,t){return Jo(la(n,t,ml),n+"")}var aa=9007199254740991;function vl(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=aa}function vn(n){return n!=null&&vl(n.length)&&!Ks(n)}function ca(n,t,e){if(!pe(e))return!1;var r=typeof t;return(r=="number"?vn(e)&&bl(t,e.length):r=="string"&&t in e)?Cr(e[t],n):!1}function ua(n){return oa(function(t,e){var r=-1,s=e.length,i=s>1?e[s-1]:void 0,o=s>2?e[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,o&&ca(e[0],e[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=e[r];a&&n(t,a,r,i)}return t})}var ha=Object.prototype;function Vs(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||ha;return n===e}function fa(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}var da="[object Arguments]";function pi(n){return re(n)&&tr(n)==da}var El=Object.prototype,ga=El.hasOwnProperty,pa=El.propertyIsEnumerable,qs=pi((function(){return arguments})())?pi:function(n){return re(n)&&ga.call(n,"callee")&&!pa.call(n,"callee")};function ma(){return!1}var Al=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mi=Al&&typeof module=="object"&&module&&!module.nodeType&&module,ba=mi&&mi.exports===Al,bi=ba?Xt.Buffer:void 0,ya=bi?bi.isBuffer:void 0,xr=ya||ma,va="[object Arguments]",Ea="[object Array]",Aa="[object Boolean]",Na="[object Date]",wa="[object Error]",Ta="[object Function]",xa="[object Map]",La="[object Number]",_a="[object Object]",Sa="[object RegExp]",Oa="[object Set]",qa="[object String]",Ca="[object WeakMap]",Ia="[object ArrayBuffer]",Ra="[object DataView]",ka="[object Float32Array]",Ba="[object Float64Array]",Ma="[object Int8Array]",Da="[object Int16Array]",ja="[object Int32Array]",Pa="[object Uint8Array]",$a="[object Uint8ClampedArray]",Ua="[object Uint16Array]",Fa="[object Uint32Array]",it={};it[ka]=it[Ba]=it[Ma]=it[Da]=it[ja]=it[Pa]=it[$a]=it[Ua]=it[Fa]=!0;it[va]=it[Ea]=it[Ia]=it[Aa]=it[Ra]=it[Na]=it[wa]=it[Ta]=it[xa]=it[La]=it[_a]=it[Sa]=it[Oa]=it[qa]=it[Ca]=!1;function Ha(n){return re(n)&&vl(n.length)&&!!it[tr(n)]}function Ws(n){return function(t){return n(t)}}var Nl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wr=Nl&&typeof module=="object"&&module&&!module.nodeType&&module,za=wr&&wr.exports===Nl,ms=za&&gl.process,Qe=(function(){try{var n=wr&&wr.require&&wr.require("util").types;return n||ms&&ms.binding&&ms.binding("util")}catch{}})(),yi=Qe&&Qe.isTypedArray,Zs=yi?Ws(yi):Ha,Ka=Object.prototype,Ga=Ka.hasOwnProperty;function wl(n,t){var e=Te(n),r=!e&&qs(n),s=!e&&!r&&xr(n),i=!e&&!r&&!s&&Zs(n),o=e||r||s||i,a=o?fa(n.length,String):[],u=a.length;for(var h in n)(t||Ga.call(n,h))&&!(o&&(h=="length"||s&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||bl(h,u)))&&a.push(h);return a}function Tl(n,t){return function(e){return n(t(e))}}var Va=Tl(Object.keys,Object),Wa=Object.prototype,Za=Wa.hasOwnProperty;function Xa(n){if(!Vs(n))return Va(n);var t=[];for(var e in Object(n))Za.call(n,e)&&e!="constructor"&&t.push(e);return t}function Ya(n){return vn(n)?wl(n):Xa(n)}function Qa(n){var t=[];if(n!=null)for(var e in Object(n))t.push(e);return t}var Ja=Object.prototype,tc=Ja.hasOwnProperty;function ec(n){if(!pe(n))return Qa(n);var t=Vs(n),e=[];for(var r in n)r=="constructor"&&(t||!tc.call(n,r))||e.push(r);return e}function xl(n){return vn(n)?wl(n,!0):ec(n)}var Lr=Se(Object,"create");function rc(){this.__data__=Lr?Lr(null):{},this.size=0}function nc(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var sc="__lodash_hash_undefined__",ic=Object.prototype,lc=ic.hasOwnProperty;function oc(n){var t=this.__data__;if(Lr){var e=t[n];return e===sc?void 0:e}return lc.call(t,n)?t[n]:void 0}var ac=Object.prototype,cc=ac.hasOwnProperty;function uc(n){var t=this.__data__;return Lr?t[n]!==void 0:cc.call(t,n)}var hc="__lodash_hash_undefined__";function fc(n,t){var e=this.__data__;return this.size+=this.has(n)?0:1,e[n]=Lr&&t===void 0?hc:t,this}function xe(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}xe.prototype.clear=rc;xe.prototype.delete=nc;xe.prototype.get=oc;xe.prototype.has=uc;xe.prototype.set=fc;function dc(){this.__data__=[],this.size=0}function En(n,t){for(var e=n.length;e--;)if(Cr(n[e][0],t))return e;return-1}var gc=Array.prototype,pc=gc.splice;function mc(n){var t=this.__data__,e=En(t,n);if(e<0)return!1;var r=t.length-1;return e==r?t.pop():pc.call(t,e,1),--this.size,!0}function bc(n){var t=this.__data__,e=En(t,n);return e<0?void 0:t[e][1]}function yc(n){return En(this.__data__,n)>-1}function vc(n,t){var e=this.__data__,r=En(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}function se(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}se.prototype.clear=dc;se.prototype.delete=mc;se.prototype.get=bc;se.prototype.has=yc;se.prototype.set=vc;var _r=Se(Xt,"Map");function Ec(){this.size=0,this.__data__={hash:new xe,map:new(_r||se),string:new xe}}function Ac(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function An(n,t){var e=n.__data__;return Ac(t)?e[typeof t=="string"?"string":"hash"]:e.map}function Nc(n){var t=An(this,n).delete(n);return this.size-=t?1:0,t}function wc(n){return An(this,n).get(n)}function Tc(n){return An(this,n).has(n)}function xc(n,t){var e=An(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this}function Oe(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}Oe.prototype.clear=Ec;Oe.prototype.delete=Nc;Oe.prototype.get=wc;Oe.prototype.has=Tc;Oe.prototype.set=xc;function Lc(n,t){for(var e=-1,r=t.length,s=n.length;++e<r;)n[s+e]=t[e];return n}var Ll=Tl(Object.getPrototypeOf,Object),_c="[object Object]",Sc=Function.prototype,Oc=Object.prototype,_l=Sc.toString,qc=Oc.hasOwnProperty,Cc=_l.call(Object);function Ic(n){if(!re(n)||tr(n)!=_c)return!1;var t=Ll(n);if(t===null)return!0;var e=qc.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&_l.call(e)==Cc}function Rc(){this.__data__=new se,this.size=0}function kc(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}function Bc(n){return this.__data__.get(n)}function Mc(n){return this.__data__.has(n)}var Dc=200;function jc(n,t){var e=this.__data__;if(e instanceof se){var r=e.__data__;if(!_r||r.length<Dc-1)return r.push([n,t]),this.size=++e.size,this;e=this.__data__=new Oe(r)}return e.set(n,t),this.size=e.size,this}function Wt(n){var t=this.__data__=new se(n);this.size=t.size}Wt.prototype.clear=Rc;Wt.prototype.delete=kc;Wt.prototype.get=Bc;Wt.prototype.has=Mc;Wt.prototype.set=jc;var Sl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vi=Sl&&typeof module=="object"&&module&&!module.nodeType&&module,Pc=vi&&vi.exports===Sl,Ei=Pc?Xt.Buffer:void 0,Ai=Ei?Ei.allocUnsafe:void 0;function Ol(n,t){if(t)return n.slice();var e=n.length,r=Ai?Ai(e):new n.constructor(e);return n.copy(r),r}function $c(n,t){for(var e=-1,r=n==null?0:n.length,s=0,i=[];++e<r;){var o=n[e];t(o,e,n)&&(i[s++]=o)}return i}function Uc(){return[]}var Fc=Object.prototype,Hc=Fc.propertyIsEnumerable,Ni=Object.getOwnPropertySymbols,zc=Ni?function(n){return n==null?[]:(n=Object(n),$c(Ni(n),function(t){return Hc.call(n,t)}))}:Uc;function Kc(n,t,e){var r=t(n);return Te(n)?r:Lc(r,e(n))}function Cs(n){return Kc(n,Ya,zc)}var Is=Se(Xt,"DataView"),Rs=Se(Xt,"Promise"),ks=Se(Xt,"Set"),wi="[object Map]",Gc="[object Object]",Ti="[object Promise]",xi="[object Set]",Li="[object WeakMap]",_i="[object DataView]",Vc=_e(Is),Wc=_e(_r),Zc=_e(Rs),Xc=_e(ks),Yc=_e(Os),Mt=tr;(Is&&Mt(new Is(new ArrayBuffer(1)))!=_i||_r&&Mt(new _r)!=wi||Rs&&Mt(Rs.resolve())!=Ti||ks&&Mt(new ks)!=xi||Os&&Mt(new Os)!=Li)&&(Mt=function(n){var t=tr(n),e=t==Gc?n.constructor:void 0,r=e?_e(e):"";if(r)switch(r){case Vc:return _i;case Wc:return wi;case Zc:return Ti;case Xc:return xi;case Yc:return Li}return t});var Qc=Object.prototype,Jc=Qc.hasOwnProperty;function tu(n){var t=n.length,e=new n.constructor(t);return t&&typeof n[0]=="string"&&Jc.call(n,"index")&&(e.index=n.index,e.input=n.input),e}var gn=Xt.Uint8Array;function Xs(n){var t=new n.constructor(n.byteLength);return new gn(t).set(new gn(n)),t}function eu(n,t){var e=Xs(n.buffer);return new n.constructor(e,n.byteOffset,n.byteLength)}var ru=/\w*$/;function nu(n){var t=new n.constructor(n.source,ru.exec(n));return t.lastIndex=n.lastIndex,t}var Si=de?de.prototype:void 0,Oi=Si?Si.valueOf:void 0;function su(n){return Oi?Object(Oi.call(n)):{}}function ql(n,t){var e=t?Xs(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}var iu="[object Boolean]",lu="[object Date]",ou="[object Map]",au="[object Number]",cu="[object RegExp]",uu="[object Set]",hu="[object String]",fu="[object Symbol]",du="[object ArrayBuffer]",gu="[object DataView]",pu="[object Float32Array]",mu="[object Float64Array]",bu="[object Int8Array]",yu="[object Int16Array]",vu="[object Int32Array]",Eu="[object Uint8Array]",Au="[object Uint8ClampedArray]",Nu="[object Uint16Array]",wu="[object Uint32Array]";function Tu(n,t,e){var r=n.constructor;switch(t){case du:return Xs(n);case iu:case lu:return new r(+n);case gu:return eu(n);case pu:case mu:case bu:case yu:case vu:case Eu:case Au:case Nu:case wu:return ql(n,e);case ou:return new r;case au:case hu:return new r(n);case cu:return nu(n);case uu:return new r;case fu:return su(n)}}function Cl(n){return typeof n.constructor=="function"&&!Vs(n)?zo(Ll(n)):{}}var xu="[object Map]";function Lu(n){return re(n)&&Mt(n)==xu}var qi=Qe&&Qe.isMap,_u=qi?Ws(qi):Lu,Su="[object Set]";function Ou(n){return re(n)&&Mt(n)==Su}var Ci=Qe&&Qe.isSet,qu=Ci?Ws(Ci):Ou,Cu=1,Il="[object Arguments]",Iu="[object Array]",Ru="[object Boolean]",ku="[object Date]",Bu="[object Error]",Rl="[object Function]",Mu="[object GeneratorFunction]",Du="[object Map]",ju="[object Number]",kl="[object Object]",Pu="[object RegExp]",$u="[object Set]",Uu="[object String]",Fu="[object Symbol]",Hu="[object WeakMap]",zu="[object ArrayBuffer]",Ku="[object DataView]",Gu="[object Float32Array]",Vu="[object Float64Array]",Wu="[object Int8Array]",Zu="[object Int16Array]",Xu="[object Int32Array]",Yu="[object Uint8Array]",Qu="[object Uint8ClampedArray]",Ju="[object Uint16Array]",th="[object Uint32Array]",nt={};nt[Il]=nt[Iu]=nt[zu]=nt[Ku]=nt[Ru]=nt[ku]=nt[Gu]=nt[Vu]=nt[Wu]=nt[Zu]=nt[Xu]=nt[Du]=nt[ju]=nt[kl]=nt[Pu]=nt[$u]=nt[Uu]=nt[Fu]=nt[Yu]=nt[Qu]=nt[Ju]=nt[th]=!0;nt[Bu]=nt[Rl]=nt[Hu]=!1;function fn(n,t,e,r,s,i){var o,a=t&Cu;if(o!==void 0)return o;if(!pe(n))return n;var u=Te(n);if(u)o=tu(n);else{var h=Mt(n),p=h==Rl||h==Mu;if(xr(n))return Ol(n,a);if(h==kl||h==Il||p&&!s)o=p?{}:Cl(n);else{if(!nt[h])return s?n:{};o=Tu(n,h,a)}}i||(i=new Wt);var v=i.get(n);if(v)return v;i.set(n,o),qu(n)?n.forEach(function(y){o.add(fn(y,t,e,y,n,i))}):_u(n)&&n.forEach(function(y,N){o.set(N,fn(y,t,e,N,n,i))});var f=Cs,m=u?void 0:f(n);return ta(m||n,function(y,N){m&&(N=y,y=n[N]),yl(o,N,fn(y,t,e,N,n,i))}),o}var eh=1,rh=4;function Ze(n){return fn(n,eh|rh)}var nh="__lodash_hash_undefined__";function sh(n){return this.__data__.set(n,nh),this}function ih(n){return this.__data__.has(n)}function pn(n){var t=-1,e=n==null?0:n.length;for(this.__data__=new Oe;++t<e;)this.add(n[t])}pn.prototype.add=pn.prototype.push=sh;pn.prototype.has=ih;function lh(n,t){for(var e=-1,r=n==null?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}function oh(n,t){return n.has(t)}var ah=1,ch=2;function Bl(n,t,e,r,s,i){var o=e&ah,a=n.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var h=i.get(n),p=i.get(t);if(h&&p)return h==t&&p==n;var v=-1,f=!0,m=e&ch?new pn:void 0;for(i.set(n,t),i.set(t,n);++v<a;){var y=n[v],N=t[v];if(r)var w=o?r(N,y,v,t,n,i):r(y,N,v,n,t,i);if(w!==void 0){if(w)continue;f=!1;break}if(m){if(!lh(t,function(x,q){if(!oh(m,q)&&(y===x||s(y,x,e,r,i)))return m.push(q)})){f=!1;break}}else if(!(y===N||s(y,N,e,r,i))){f=!1;break}}return i.delete(n),i.delete(t),f}function uh(n){var t=-1,e=Array(n.size);return n.forEach(function(r,s){e[++t]=[s,r]}),e}function hh(n){var t=-1,e=Array(n.size);return n.forEach(function(r){e[++t]=r}),e}var fh=1,dh=2,gh="[object Boolean]",ph="[object Date]",mh="[object Error]",bh="[object Map]",yh="[object Number]",vh="[object RegExp]",Eh="[object Set]",Ah="[object String]",Nh="[object Symbol]",wh="[object ArrayBuffer]",Th="[object DataView]",Ii=de?de.prototype:void 0,bs=Ii?Ii.valueOf:void 0;function xh(n,t,e,r,s,i,o){switch(e){case Th:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case wh:return!(n.byteLength!=t.byteLength||!i(new gn(n),new gn(t)));case gh:case ph:case yh:return Cr(+n,+t);case mh:return n.name==t.name&&n.message==t.message;case vh:case Ah:return n==t+"";case bh:var a=uh;case Eh:var u=r&fh;if(a||(a=hh),n.size!=t.size&&!u)return!1;var h=o.get(n);if(h)return h==t;r|=dh,o.set(n,t);var p=Bl(a(n),a(t),r,s,i,o);return o.delete(n),p;case Nh:if(bs)return bs.call(n)==bs.call(t)}return!1}var Lh=1,_h=Object.prototype,Sh=_h.hasOwnProperty;function Oh(n,t,e,r,s,i){var o=e&Lh,a=Cs(n),u=a.length,h=Cs(t),p=h.length;if(u!=p&&!o)return!1;for(var v=u;v--;){var f=a[v];if(!(o?f in t:Sh.call(t,f)))return!1}var m=i.get(n),y=i.get(t);if(m&&y)return m==t&&y==n;var N=!0;i.set(n,t),i.set(t,n);for(var w=o;++v<u;){f=a[v];var x=n[f],q=t[f];if(r)var B=o?r(q,x,f,t,n,i):r(x,q,f,n,t,i);if(!(B===void 0?x===q||s(x,q,e,r,i):B)){N=!1;break}w||(w=f=="constructor")}if(N&&!w){var H=n.constructor,$=t.constructor;H!=$&&"constructor"in n&&"constructor"in t&&!(typeof H=="function"&&H instanceof H&&typeof $=="function"&&$ instanceof $)&&(N=!1)}return i.delete(n),i.delete(t),N}var qh=1,Ri="[object Arguments]",ki="[object Array]",en="[object Object]",Ch=Object.prototype,Bi=Ch.hasOwnProperty;function Ih(n,t,e,r,s,i){var o=Te(n),a=Te(t),u=o?ki:Mt(n),h=a?ki:Mt(t);u=u==Ri?en:u,h=h==Ri?en:h;var p=u==en,v=h==en,f=u==h;if(f&&xr(n)){if(!xr(t))return!1;o=!0,p=!1}if(f&&!p)return i||(i=new Wt),o||Zs(n)?Bl(n,t,e,r,s,i):xh(n,t,u,e,r,s,i);if(!(e&qh)){var m=p&&Bi.call(n,"__wrapped__"),y=v&&Bi.call(t,"__wrapped__");if(m||y){var N=m?n.value():n,w=y?t.value():t;return i||(i=new Wt),s(N,w,e,r,i)}}return f?(i||(i=new Wt),Oh(n,t,e,r,s,i)):!1}function Ml(n,t,e,r,s){return n===t?!0:n==null||t==null||!re(n)&&!re(t)?n!==n&&t!==t:Ih(n,t,e,r,Ml,s)}function Rh(n){return function(t,e,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var u=o[++s];if(e(i[u],u,i)===!1)break}return t}}var kh=Rh();function Bs(n,t,e){(e!==void 0&&!Cr(n[t],e)||e===void 0&&!(t in n))&&Gs(n,t,e)}function Bh(n){return re(n)&&vn(n)}function Ms(n,t){if(!(t==="constructor"&&typeof n[t]=="function")&&t!="__proto__")return n[t]}function Mh(n){return ia(n,xl(n))}function Dh(n,t,e,r,s,i,o){var a=Ms(n,e),u=Ms(t,e),h=o.get(u);if(h){Bs(n,e,h);return}var p=i?i(a,u,e+"",n,t,o):void 0,v=p===void 0;if(v){var f=Te(u),m=!f&&xr(u),y=!f&&!m&&Zs(u);p=u,f||m||y?Te(a)?p=a:Bh(a)?p=Go(a):m?(v=!1,p=Ol(u,!0)):y?(v=!1,p=ql(u,!0)):p=[]:Ic(u)||qs(u)?(p=a,qs(a)?p=Mh(a):(!pe(a)||Ks(a))&&(p=Cl(u))):v=!1}v&&(o.set(u,p),s(p,u,r,i,o),o.delete(u)),Bs(n,e,p)}function Dl(n,t,e,r,s){n!==t&&kh(t,function(i,o){if(s||(s=new Wt),pe(i))Dh(n,t,o,e,Dl,r,s);else{var a=r?r(Ms(n,o),i,o+"",n,t,s):void 0;a===void 0&&(a=i),Bs(n,o,a)}},xl)}function Nn(n,t){return Ml(n,t)}var he=ua(function(n,t,e){Dl(n,t,e)}),M=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(M||{});class Zt{constructor(t,e,r={}){this.attrName=t,this.keyName=e;const s=M.TYPE&M.ATTRIBUTE;this.scope=r.scope!=null?r.scope&M.LEVEL|s:M.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(t){return Array.from(t.attributes).map(e=>e.name)}add(t,e){return this.canAdd(t,e)?(t.setAttribute(this.keyName,e),!0):!1}canAdd(t,e){return this.whitelist==null?!0:typeof e=="string"?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class Xe extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const jl=class Ds{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(t==null)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let r=null;try{r=t.parentNode}catch{return null}return this.find(r,e)}return null}create(t,e,r){const s=this.query(e);if(s==null)throw new Xe(`Unable to create ${e} blot`);const i=s,o=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(r),a=new i(t,o,r);return Ds.blots.set(a.domNode,a),a}find(t,e=!1){return Ds.find(t,e)}query(t,e=M.ANY){let r;return typeof t=="string"?r=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?r=this.types.text:typeof t=="number"?t&M.LEVEL&M.BLOCK?r=this.types.block:t&M.LEVEL&M.INLINE&&(r=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[t.tagName]),r==null?null:"scope"in r&&e&M.LEVEL&r.scope&&e&M.TYPE&r.scope?r:null}register(...t){return t.map(e=>{const r="blotName"in e,s="attrName"in e;if(!r&&!s)throw new Xe("Invalid definition");if(r&&e.blotName==="abstract")throw new Xe("Cannot register abstract class");const i=r?e.blotName:s?e.attrName:void 0;return this.types[i]=e,s?typeof e.keyName=="string"&&(this.attributes[e.keyName]=e):r&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(o=>o.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(o=>{(this.tags[o]==null||e.className==null)&&(this.tags[o]=e)}))),e})}};jl.blots=new WeakMap;let Je=jl;function Mi(n,t){return(n.getAttribute("class")||"").split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}class jh extends Zt{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(t,e){return this.canAdd(t,e)?(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0):!1}remove(t){Mi(t,this.keyName).forEach(e=>{t.classList.remove(e)}),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(Mi(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const Ut=jh;function ys(n){const t=n.split("-"),e=t.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return t[0]+e}class Ph extends Zt{static keys(t){return(t.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(t,e){return this.canAdd(t,e)?(t.style[ys(this.keyName)]=e,!0):!1}remove(t){t.style[ys(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[ys(this.keyName)];return this.canAdd(t,e)?e:""}}const me=Ph;class $h{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=Je.find(this.domNode);if(t==null)return;const e=Zt.keys(this.domNode),r=Ut.keys(this.domNode),s=me.keys(this.domNode);e.concat(r).concat(s).forEach(i=>{const o=t.scroll.query(i,M.ATTRIBUTE);o instanceof Zt&&(this.attributes[o.attrName]=o)})}copy(t){Object.keys(this.attributes).forEach(e=>{const r=this.attributes[e].value(this.domNode);t.format(e,r)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}}const wn=$h,Pl=class{constructor(t,e){this.scroll=t,this.domNode=e,Je.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new Xe("Blot definition missing tagName");let e,r;return Array.isArray(this.tagName)?(typeof t=="string"?(r=t.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof t=="number"&&(r=t),typeof r=="number"?e=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?e=document.createElement(r):e=document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),Je.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,r,s){const i=this.isolate(t,e);if(this.scroll.query(r,M.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,M.ATTRIBUTE)!=null){const o=this.scroll.create(this.statics.scope);i.wrap(o),o.format(r,s)}}insertAt(t,e,r){const s=r==null?this.scroll.create("text",e):this.scroll.create(e,r),i=this.split(t);this.parent.insertBefore(s,i||void 0)}isolate(t,e){const r=this.split(t);if(r==null)throw new Error("Attempt to isolate at end");return r.split(e),r}length(){return 1}offset(t=this.parent){return this.parent==null||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Xe(`Cannot wrap ${t}`);return r.appendChild(this),r}};Pl.blotName="abstract";let $l=Pl;const Ul=class extends $l{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Ul.scope=M.INLINE_BLOT;let Uh=Ul;const vt=Uh;class Fh{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const e=t.slice(1);this.append(...e)}}at(t){const e=this.iterator();let r=e();for(;r&&t>0;)t-=1,r=e();return r}contains(t){const e=this.iterator();let r=e();for(;r;){if(r===t)return!0;r=e()}return!1}indexOf(t){const e=this.iterator();let r=e(),s=0;for(;r;){if(r===t)return s;s+=1,r=e()}return-1}insertBefore(t,e){t!=null&&(this.remove(t),t.next=e,e!=null?(t.prev=e.prev,e.prev!=null&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):this.tail!=null?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,r=this.head;for(;r!=null;){if(r===t)return e;e+=r.length(),r=r.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return t!=null&&(t=t.next),e}}find(t,e=!1){const r=this.iterator();let s=r();for(;s;){const i=s.length();if(t<i||e&&t===i&&(s.next==null||s.next.length()!==0))return[s,t];t-=i,s=r()}return[null,0]}forEach(t){const e=this.iterator();let r=e();for(;r;)t(r),r=e()}forEachAt(t,e,r){if(e<=0)return;const[s,i]=this.find(t);let o=t-i;const a=this.iterator(s);let u=a();for(;u&&o<t+e;){const h=u.length();t>o?r(u,t-o,Math.min(e,o+h-t)):r(u,0,Math.min(h,t+e-o)),o+=h,u=a()}}map(t){return this.reduce((e,r)=>(e.push(t(r)),e),[])}reduce(t,e){const r=this.iterator();let s=r();for(;s;)e=t(e,s),s=r();return e}}function Di(n,t){const e=t.find(n);if(e)return e;try{return t.create(n)}catch{const r=t.create(M.INLINE);return Array.from(n.childNodes).forEach(s=>{r.domNode.appendChild(s)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Fl=class ae extends $l{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,ae.uiClass&&this.uiNode.classList.add(ae.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Fh,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=Di(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof Xe)return;throw e}})}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,(r,s,i)=>{r.deleteAt(s,i)})}descendant(t,e=0){const[r,s]=this.children.find(e);return t.blotName==null&&t(r)||t.blotName!=null&&r instanceof t?[r,s]:r instanceof ae?r.descendant(t,s):[null,-1]}descendants(t,e=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(e,r,(o,a,u)=>{(t.blotName==null&&t(o)||t.blotName!=null&&o instanceof t)&&s.push(o),o instanceof ae&&(s=s.concat(o.descendants(t,a,i))),i-=u}),s}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(r=>e instanceof r)||(e.statics.scope===M.BLOCK_BLOT?(e.next!=null&&this.splitAfter(e),e.prev!=null&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof ae?e.unwrap():e.remove())})}formatAt(t,e,r,s){this.children.forEachAt(t,e,(i,o,a)=>{i.formatAt(o,a,r,s)})}insertAt(t,e,r){const[s,i]=this.children.find(t);if(s)s.insertAt(i,e,r);else{const o=r==null?this.scroll.create("text",e):this.scroll.create(e,r);this.appendChild(o)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let r=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(r=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(t.domNode,r),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(r=>{t.insertBefore(r,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,e=!1){const[r,s]=this.children.find(t,e),i=[[this,t]];return r instanceof ae?i.concat(r.path(s,e)):(r!=null&&i.push([r,s]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const r=typeof t=="string"?this.scroll.create(t,e):t;return r instanceof ae&&this.moveChildren(r),super.replaceWith(r)}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(t,this.length(),(s,i,o)=>{const a=s.split(i,e);a!=null&&r.appendChild(a)}),r}splitAfter(t){const e=this.clone();for(;t.next!=null;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const r=[],s=[];t.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),r.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=Di(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};Fl.uiClass="";let Hh=Fl;const Pt=Hh;function zh(n,t){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const e in n)if(n[e]!==t[e])return!1;return!0}const ze=class Ke extends Pt{static create(t){return super.create(t)}static formats(t,e){const r=e.query(Ke.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new wn(this.domNode)}format(t,e){if(t===this.statics.blotName&&!e)this.children.forEach(r=>{r instanceof Ke||(r=r.wrap(Ke.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(t,M.INLINE);if(r==null)return;r instanceof Zt?this.attributes.attribute(r,e):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e)}}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,r,s){this.formats()[r]!=null||this.scroll.query(r,M.ATTRIBUTE)?this.isolate(t,e).format(r,s):super.formatAt(t,e,r,s)}optimize(t){super.optimize(t);const e=this.formats();if(Object.keys(e).length===0)return this.unwrap();const r=this.next;r instanceof Ke&&r.prev===this&&zh(e,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(t,e){const r=super.replaceWith(t,e);return this.attributes.copy(r),r}update(t,e){super.update(t,e),t.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(t,e){const r=super.wrap(t,e);return r instanceof Ke&&this.attributes.move(r),r}};ze.allowedChildren=[ze,vt],ze.blotName="inline",ze.scope=M.INLINE_BLOT,ze.tagName="SPAN";let Kh=ze;const Ys=Kh,Ge=class js extends Pt{static create(t){return super.create(t)}static formats(t,e){const r=e.query(js.blotName);if(!(r!=null&&t.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new wn(this.domNode)}format(t,e){const r=this.scroll.query(t,M.BLOCK);r!=null&&(r instanceof Zt?this.attributes.attribute(r,e):t===this.statics.blotName&&!e?this.replaceWith(js.blotName):e&&(t!==this.statics.blotName||this.formats()[t]!==e)&&this.replaceWith(t,e))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,r,s){this.scroll.query(r,M.BLOCK)!=null?this.format(r,s):super.formatAt(t,e,r,s)}insertAt(t,e,r){if(r==null||this.scroll.query(e,M.INLINE)!=null)super.insertAt(t,e,r);else{const s=this.split(t);if(s!=null){const i=this.scroll.create(e,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(t,e){const r=super.replaceWith(t,e);return this.attributes.copy(r),r}update(t,e){super.update(t,e),t.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};Ge.blotName="block",Ge.scope=M.BLOCK_BLOT,Ge.tagName="P",Ge.allowedChildren=[Ys,Ge,vt];let Gh=Ge;const Sr=Gh,Ps=class extends Pt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,r,s){super.formatAt(t,e,r,s),this.enforceAllowedChildren()}insertAt(t,e,r){super.insertAt(t,e,r),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ps.blotName="container",Ps.scope=M.BLOCK_BLOT;let Vh=Ps;const Tn=Vh;class Wh extends vt{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,r,s){t===0&&e===this.length()?this.format(r,s):super.formatAt(t,e,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const _t=Wh,Zh={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Xh=100,Ve=class extends Pt{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,Zh),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const r=this.registry.find(t,e);return r?r.scroll===this?r:e?this.find(r.scroll.domNode.parentNode,!0):null:null}query(t,e=M.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),t===0&&e===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(t,e)}formatAt(t,e,r,s){this.update(),super.formatAt(t,e,r,s)}insertAt(t,e,r){this.update(),super.insertAt(t,e,r)}optimize(t=[],e={}){super.optimize(e);const r=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const i=(u,h=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(r.has(u.domNode)||r.set(u.domNode,[]),h&&i(u.parent))},o=u=>{r.has(u.domNode)&&(u instanceof Pt&&u.children.forEach(o),r.delete(u.domNode),u.optimize(e))};let a=t;for(let u=0;a.length>0;u+=1){if(u>=Xh)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(h=>{const p=this.find(h.target,!0);p!=null&&(p.domNode===h.target&&(h.type==="childList"?(i(this.find(h.previousSibling,!1)),Array.from(h.addedNodes).forEach(v=>{const f=this.find(v,!1);i(f,!1),f instanceof Pt&&f.children.forEach(m=>{i(m,!1)})})):h.type==="attributes"&&i(p.prev)),i(p))}),this.children.forEach(o),a=Array.from(this.observer.takeRecords()),s=a.slice();s.length>0;)t.push(s.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const r=new WeakMap;t.map(s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],e)}),e.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),e),this.optimize(t,e)}};Ve.blotName="scroll",Ve.defaultChild=Sr,Ve.allowedChildren=[Sr,Tn],Ve.scope=M.BLOCK_BLOT,Ve.tagName="DIV";let Yh=Ve;const Qs=Yh,$s=class Hl extends vt{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,r){r==null?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,r)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Hl&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(t===0)return this;if(t===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(t,e){t.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};$s.blotName="text",$s.scope=M.INLINE_BLOT;let Qh=$s;const mn=Qh,zl=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Zt,AttributorStore:wn,BlockBlot:Sr,ClassAttributor:Ut,ContainerBlot:Tn,EmbedBlot:_t,InlineBlot:Ys,LeafBlot:vt,ParentBlot:Pt,Registry:Je,Scope:M,ScrollBlot:Qs,StyleAttributor:me,TextBlot:mn},Symbol.toStringTag,{value:"Module"}));var ce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rn={exports:{}},vs,ji;function Jh(){if(ji)return vs;ji=1;var n=-1,t=1,e=0;function r(g,L,b,O,_){if(g===L)return g?[[e,g]]:[];if(b!=null){var T=It(g,L,b);if(T)return T}var S=a(g,L),k=g.substring(0,S);g=g.substring(S),L=L.substring(S),S=h(g,L);var D=g.substring(g.length-S);g=g.substring(0,g.length-S),L=L.substring(0,L.length-S);var C=s(g,L);return k&&C.unshift([e,k]),D&&C.push([e,D]),q(C,_),O&&v(C),C}function s(g,L){var b;if(!g)return[[t,L]];if(!L)return[[n,g]];var O=g.length>L.length?g:L,_=g.length>L.length?L:g,T=O.indexOf(_);if(T!==-1)return b=[[t,O.substring(0,T)],[e,_],[t,O.substring(T+_.length)]],g.length>L.length&&(b[0][0]=b[2][0]=n),b;if(_.length===1)return[[n,g],[t,L]];var S=p(g,L);if(S){var k=S[0],D=S[1],C=S[2],z=S[3],U=S[4],G=r(k,C),V=r(D,z);return G.concat([[e,U]],V)}return i(g,L)}function i(g,L){for(var b=g.length,O=L.length,_=Math.ceil((b+O)/2),T=_,S=2*_,k=new Array(S),D=new Array(S),C=0;C<S;C++)k[C]=-1,D[C]=-1;k[T+1]=0,D[T+1]=0;for(var z=b-O,U=z%2!==0,G=0,V=0,P=0,st=0,lt=0;lt<_;lt++){for(var K=-lt+G;K<=lt-V;K+=2){var Y=T+K,X;K===-lt||K!==lt&&k[Y-1]<k[Y+1]?X=k[Y+1]:X=k[Y-1]+1;for(var Q=X-K;X<b&&Q<O&&g.charAt(X)===L.charAt(Q);)X++,Q++;if(k[Y]=X,X>b)V+=2;else if(Q>O)G+=2;else if(U){var tt=T+z-K;if(tt>=0&&tt<S&&D[tt]!==-1){var et=b-D[tt];if(X>=et)return o(g,L,X,Q)}}}for(var at=-lt+P;at<=lt-st;at+=2){var tt=T+at,et;at===-lt||at!==lt&&D[tt-1]<D[tt+1]?et=D[tt+1]:et=D[tt-1]+1;for(var pt=et-at;et<b&&pt<O&&g.charAt(b-et-1)===L.charAt(O-pt-1);)et++,pt++;if(D[tt]=et,et>b)st+=2;else if(pt>O)P+=2;else if(!U){var Y=T+z-at;if(Y>=0&&Y<S&&k[Y]!==-1){var X=k[Y],Q=T+X-Y;if(et=b-et,X>=et)return o(g,L,X,Q)}}}}return[[n,g],[t,L]]}function o(g,L,b,O){var _=g.substring(0,b),T=L.substring(0,O),S=g.substring(b),k=L.substring(O),D=r(_,T),C=r(S,k);return D.concat(C)}function a(g,L){if(!g||!L||g.charAt(0)!==L.charAt(0))return 0;for(var b=0,O=Math.min(g.length,L.length),_=O,T=0;b<_;)g.substring(T,_)==L.substring(T,_)?(b=_,T=b):O=_,_=Math.floor((O-b)/2+b);return B(g.charCodeAt(_-1))&&_--,_}function u(g,L){var b=g.length,O=L.length;if(b==0||O==0)return 0;b>O?g=g.substring(b-O):b<O&&(L=L.substring(0,b));var _=Math.min(b,O);if(g==L)return _;for(var T=0,S=1;;){var k=g.substring(_-S),D=L.indexOf(k);if(D==-1)return T;S+=D,(D==0||g.substring(_-S)==L.substring(0,S))&&(T=S,S++)}}function h(g,L){if(!g||!L||g.slice(-1)!==L.slice(-1))return 0;for(var b=0,O=Math.min(g.length,L.length),_=O,T=0;b<_;)g.substring(g.length-_,g.length-T)==L.substring(L.length-_,L.length-T)?(b=_,T=b):O=_,_=Math.floor((O-b)/2+b);return H(g.charCodeAt(g.length-_))&&_--,_}function p(g,L){var b=g.length>L.length?g:L,O=g.length>L.length?L:g;if(b.length<4||O.length*2<b.length)return null;function _(V,P,st){for(var lt=V.substring(st,st+Math.floor(V.length/4)),K=-1,Y="",X,Q,tt,et;(K=P.indexOf(lt,K+1))!==-1;){var at=a(V.substring(st),P.substring(K)),pt=h(V.substring(0,st),P.substring(0,K));Y.length<pt+at&&(Y=P.substring(K-pt,K)+P.substring(K,K+at),X=V.substring(0,st-pt),Q=V.substring(st+at),tt=P.substring(0,K-pt),et=P.substring(K+at))}return Y.length*2>=V.length?[X,Q,tt,et,Y]:null}var T=_(b,O,Math.ceil(b.length/4)),S=_(b,O,Math.ceil(b.length/2)),k;if(!T&&!S)return null;S?T?k=T[4].length>S[4].length?T:S:k=S:k=T;var D,C,z,U;g.length>L.length?(D=k[0],C=k[1],z=k[2],U=k[3]):(z=k[0],U=k[1],D=k[2],C=k[3]);var G=k[4];return[D,C,z,U,G]}function v(g){for(var L=!1,b=[],O=0,_=null,T=0,S=0,k=0,D=0,C=0;T<g.length;)g[T][0]==e?(b[O++]=T,S=D,k=C,D=0,C=0,_=g[T][1]):(g[T][0]==t?D+=g[T][1].length:C+=g[T][1].length,_&&_.length<=Math.max(S,k)&&_.length<=Math.max(D,C)&&(g.splice(b[O-1],0,[n,_]),g[b[O-1]+1][0]=t,O--,O--,T=O>0?b[O-1]:-1,S=0,k=0,D=0,C=0,_=null,L=!0)),T++;for(L&&q(g),x(g),T=1;T<g.length;){if(g[T-1][0]==n&&g[T][0]==t){var z=g[T-1][1],U=g[T][1],G=u(z,U),V=u(U,z);G>=V?(G>=z.length/2||G>=U.length/2)&&(g.splice(T,0,[e,U.substring(0,G)]),g[T-1][1]=z.substring(0,z.length-G),g[T+1][1]=U.substring(G),T++):(V>=z.length/2||V>=U.length/2)&&(g.splice(T,0,[e,z.substring(0,V)]),g[T-1][0]=t,g[T-1][1]=U.substring(0,U.length-V),g[T+1][0]=n,g[T+1][1]=z.substring(V),T++),T++}T++}}var f=/[^a-zA-Z0-9]/,m=/\s/,y=/[\r\n]/,N=/\n\r?\n$/,w=/^\r?\n\r?\n/;function x(g){function L(V,P){if(!V||!P)return 6;var st=V.charAt(V.length-1),lt=P.charAt(0),K=st.match(f),Y=lt.match(f),X=K&&st.match(m),Q=Y&&lt.match(m),tt=X&&st.match(y),et=Q&&lt.match(y),at=tt&&V.match(N),pt=et&&P.match(w);return at||pt?5:tt||et?4:K&&!X&&Q?3:X||Q?2:K||Y?1:0}for(var b=1;b<g.length-1;){if(g[b-1][0]==e&&g[b+1][0]==e){var O=g[b-1][1],_=g[b][1],T=g[b+1][1],S=h(O,_);if(S){var k=_.substring(_.length-S);O=O.substring(0,O.length-S),_=k+_.substring(0,_.length-S),T=k+T}for(var D=O,C=_,z=T,U=L(O,_)+L(_,T);_.charAt(0)===T.charAt(0);){O+=_.charAt(0),_=_.substring(1)+T.charAt(0),T=T.substring(1);var G=L(O,_)+L(_,T);G>=U&&(U=G,D=O,C=_,z=T)}g[b-1][1]!=D&&(D?g[b-1][1]=D:(g.splice(b-1,1),b--),g[b][1]=C,z?g[b+1][1]=z:(g.splice(b+1,1),b--))}b++}}function q(g,L){g.push([e,""]);for(var b=0,O=0,_=0,T="",S="",k;b<g.length;){if(b<g.length-1&&!g[b][1]){g.splice(b,1);continue}switch(g[b][0]){case t:_++,S+=g[b][1],b++;break;case n:O++,T+=g[b][1],b++;break;case e:var D=b-_-O-1;if(L){if(D>=0&&rt(g[D][1])){var C=g[D][1].slice(-1);if(g[D][1]=g[D][1].slice(0,-1),T=C+T,S=C+S,!g[D][1]){g.splice(D,1),b--;var z=D-1;g[z]&&g[z][0]===t&&(_++,S=g[z][1]+S,z--),g[z]&&g[z][0]===n&&(O++,T=g[z][1]+T,z--),D=z}}if($(g[b][1])){var C=g[b][1].charAt(0);g[b][1]=g[b][1].slice(1),T+=C,S+=C}}if(b<g.length-1&&!g[b][1]){g.splice(b,1);break}if(T.length>0||S.length>0){T.length>0&&S.length>0&&(k=a(S,T),k!==0&&(D>=0?g[D][1]+=S.substring(0,k):(g.splice(0,0,[e,S.substring(0,k)]),b++),S=S.substring(k),T=T.substring(k)),k=h(S,T),k!==0&&(g[b][1]=S.substring(S.length-k)+g[b][1],S=S.substring(0,S.length-k),T=T.substring(0,T.length-k)));var U=_+O;T.length===0&&S.length===0?(g.splice(b-U,U),b=b-U):T.length===0?(g.splice(b-U,U,[t,S]),b=b-U+1):S.length===0?(g.splice(b-U,U,[n,T]),b=b-U+1):(g.splice(b-U,U,[n,T],[t,S]),b=b-U+2)}b!==0&&g[b-1][0]===e?(g[b-1][1]+=g[b][1],g.splice(b,1)):b++,_=0,O=0,T="",S="";break}}g[g.length-1][1]===""&&g.pop();var G=!1;for(b=1;b<g.length-1;)g[b-1][0]===e&&g[b+1][0]===e&&(g[b][1].substring(g[b][1].length-g[b-1][1].length)===g[b-1][1]?(g[b][1]=g[b-1][1]+g[b][1].substring(0,g[b][1].length-g[b-1][1].length),g[b+1][1]=g[b-1][1]+g[b+1][1],g.splice(b-1,1),G=!0):g[b][1].substring(0,g[b+1][1].length)==g[b+1][1]&&(g[b-1][1]+=g[b+1][1],g[b][1]=g[b][1].substring(g[b+1][1].length)+g[b+1][1],g.splice(b+1,1),G=!0)),b++;G&&q(g,L)}function B(g){return g>=55296&&g<=56319}function H(g){return g>=56320&&g<=57343}function $(g){return H(g.charCodeAt(0))}function rt(g){return B(g.charCodeAt(g.length-1))}function ot(g){for(var L=[],b=0;b<g.length;b++)g[b][1].length>0&&L.push(g[b]);return L}function ht(g,L,b,O){return rt(g)||$(O)?null:ot([[e,g],[n,L],[t,b],[e,O]])}function It(g,L,b){var O=typeof b=="number"?{index:b,length:0}:b.oldRange,_=typeof b=="number"?null:b.newRange,T=g.length,S=L.length;if(O.length===0&&(_===null||_.length===0)){var k=O.index,D=g.slice(0,k),C=g.slice(k),z=_?_.index:null;t:{var U=k+S-T;if(z!==null&&z!==U||U<0||U>S)break t;var G=L.slice(0,U),V=L.slice(U);if(V!==C)break t;var P=Math.min(k,U),st=D.slice(0,P),lt=G.slice(0,P);if(st!==lt)break t;var K=D.slice(P),Y=G.slice(P);return ht(st,K,Y,C)}t:{if(z!==null&&z!==k)break t;var X=k,G=L.slice(0,X),V=L.slice(X);if(G!==D)break t;var Q=Math.min(T-X,S-X),tt=C.slice(C.length-Q),et=V.slice(V.length-Q);if(tt!==et)break t;var K=C.slice(0,C.length-Q),Y=V.slice(0,V.length-Q);return ht(D,K,Y,tt)}}if(O.length>0&&_&&_.length===0)t:{var st=g.slice(0,O.index),tt=g.slice(O.index+O.length),P=st.length,Q=tt.length;if(S<P+Q)break t;var lt=L.slice(0,P),et=L.slice(S-Q);if(st!==lt||tt!==et)break t;var K=g.slice(P,T-Q),Y=L.slice(P,S-Q);return ht(st,K,Y,tt)}return null}function Lt(g,L,b,O){return r(g,L,b,O,!0)}return Lt.INSERT=t,Lt.DELETE=n,Lt.EQUAL=e,vs=Lt,vs}var Er={exports:{}};Er.exports;var Pi;function Gl(){return Pi||(Pi=1,(function(n,t){var e=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",h="[object Error]",p="[object Function]",v="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Object]",N="[object Promise]",w="[object RegExp]",x="[object Set]",q="[object String]",B="[object Symbol]",H="[object WeakMap]",$="[object ArrayBuffer]",rt="[object DataView]",ot="[object Float32Array]",ht="[object Float64Array]",It="[object Int8Array]",Lt="[object Int16Array]",g="[object Int32Array]",L="[object Uint8Array]",b="[object Uint8ClampedArray]",O="[object Uint16Array]",_="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,S=/\w*$/,k=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,C={};C[i]=C[o]=C[$]=C[rt]=C[a]=C[u]=C[ot]=C[ht]=C[It]=C[Lt]=C[g]=C[f]=C[m]=C[y]=C[w]=C[x]=C[q]=C[B]=C[L]=C[b]=C[O]=C[_]=!0,C[h]=C[p]=C[H]=!1;var z=typeof ce=="object"&&ce&&ce.Object===Object&&ce,U=typeof self=="object"&&self&&self.Object===Object&&self,G=z||U||Function("return this")(),V=t&&!t.nodeType&&t,P=V&&!0&&n&&!n.nodeType&&n,st=P&&P.exports===V;function lt(l,c){return l.set(c[0],c[1]),l}function K(l,c){return l.add(c),l}function Y(l,c){for(var d=-1,E=l?l.length:0;++d<E&&c(l[d],d,l)!==!1;);return l}function X(l,c){for(var d=-1,E=c.length,F=l.length;++d<E;)l[F+d]=c[d];return l}function Q(l,c,d,E){for(var F=-1,j=l?l.length:0;++F<j;)d=c(d,l[F],F,l);return d}function tt(l,c){for(var d=-1,E=Array(l);++d<l;)E[d]=c(d);return E}function et(l,c){return l?.[c]}function at(l){var c=!1;if(l!=null&&typeof l.toString!="function")try{c=!!(l+"")}catch{}return c}function pt(l){var c=-1,d=Array(l.size);return l.forEach(function(E,F){d[++c]=[F,E]}),d}function rr(l,c){return function(d){return l(c(d))}}function Mr(l){var c=-1,d=Array(l.size);return l.forEach(function(E){d[++c]=E}),d}var Sn=Array.prototype,On=Function.prototype,Re=Object.prototype,nr=G["__core-js_shared__"],Dr=(function(){var l=/[^.]+$/.exec(nr&&nr.keys&&nr.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""})(),jr=On.toString,zt=Re.hasOwnProperty,ke=Re.toString,qn=RegExp("^"+jr.call(zt).replace(T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=st?G.Buffer:void 0,Be=G.Symbol,sr=G.Uint8Array,St=rr(Object.getPrototypeOf,Object),Pr=Object.create,$r=Re.propertyIsEnumerable,Cn=Sn.splice,ir=Object.getOwnPropertySymbols,Me=be?be.isBuffer:void 0,Ur=rr(Object.keys,Object),De=kt(G,"DataView"),ye=kt(G,"Map"),Rt=kt(G,"Promise"),je=kt(G,"Set"),lr=kt(G,"WeakMap"),ve=kt(Object,"create"),or=Et(De),Ee=Et(ye),ar=Et(Rt),cr=Et(je),ur=Et(lr),le=Be?Be.prototype:void 0,Fr=le?le.valueOf:void 0;function Yt(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function In(){this.__data__=ve?ve(null):{}}function Rn(l){return this.has(l)&&delete this.__data__[l]}function kn(l){var c=this.__data__;if(ve){var d=c[l];return d===r?void 0:d}return zt.call(c,l)?c[l]:void 0}function Hr(l){var c=this.__data__;return ve?c[l]!==void 0:zt.call(c,l)}function hr(l,c){var d=this.__data__;return d[l]=ve&&c===void 0?r:c,this}Yt.prototype.clear=In,Yt.prototype.delete=Rn,Yt.prototype.get=kn,Yt.prototype.has=Hr,Yt.prototype.set=hr;function ft(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Bn(){this.__data__=[]}function Mn(l){var c=this.__data__,d=$e(c,l);if(d<0)return!1;var E=c.length-1;return d==E?c.pop():Cn.call(c,d,1),!0}function Dn(l){var c=this.__data__,d=$e(c,l);return d<0?void 0:c[d][1]}function jn(l){return $e(this.__data__,l)>-1}function Pn(l,c){var d=this.__data__,E=$e(d,l);return E<0?d.push([l,c]):d[E][1]=c,this}ft.prototype.clear=Bn,ft.prototype.delete=Mn,ft.prototype.get=Dn,ft.prototype.has=jn,ft.prototype.set=Pn;function mt(l){var c=-1,d=l?l.length:0;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function $n(){this.__data__={hash:new Yt,map:new(ye||ft),string:new Yt}}function Un(l){return Ne(this,l).delete(l)}function Fn(l){return Ne(this,l).get(l)}function Hn(l){return Ne(this,l).has(l)}function zn(l,c){return Ne(this,l).set(l,c),this}mt.prototype.clear=$n,mt.prototype.delete=Un,mt.prototype.get=Fn,mt.prototype.has=Hn,mt.prototype.set=zn;function Tt(l){this.__data__=new ft(l)}function Kn(){this.__data__=new ft}function Gn(l){return this.__data__.delete(l)}function Vn(l){return this.__data__.get(l)}function Wn(l){return this.__data__.has(l)}function Zn(l,c){var d=this.__data__;if(d instanceof ft){var E=d.__data__;if(!ye||E.length<e-1)return E.push([l,c]),this;d=this.__data__=new mt(E)}return d.set(l,c),this}Tt.prototype.clear=Kn,Tt.prototype.delete=Gn,Tt.prototype.get=Vn,Tt.prototype.has=Wn,Tt.prototype.set=Zn;function Pe(l,c){var d=pr(l)||Fe(l)?tt(l.length,String):[],E=d.length,F=!!E;for(var j in l)zt.call(l,j)&&!(F&&(j=="length"||cs(j,E)))&&d.push(j);return d}function zr(l,c,d){var E=l[c];(!(zt.call(l,c)&&Zr(E,d))||d===void 0&&!(c in l))&&(l[c]=d)}function $e(l,c){for(var d=l.length;d--;)if(Zr(l[d][0],c))return d;return-1}function Kt(l,c){return l&&gr(c,br(c),l)}function fr(l,c,d,E,F,j,Z){var W;if(E&&(W=j?E(l,F,j,Z):E(l)),W!==void 0)return W;if(!Vt(l))return l;var ct=pr(l);if(ct){if(W=os(l),!c)return ss(l,W)}else{var J=Jt(l),bt=J==p||J==v;if(Xr(l))return Ue(l,c);if(J==y||J==i||bt&&!j){if(at(l))return j?l:{};if(W=Gt(bt?{}:l),!c)return is(l,Kt(W,l))}else{if(!C[J])return j?l:{};W=as(l,J,fr,c)}}Z||(Z=new Tt);var xt=Z.get(l);if(xt)return xt;if(Z.set(l,W),!ct)var ut=d?ls(l):br(l);return Y(ut||l,function(yt,dt){ut&&(dt=yt,yt=l[dt]),zr(W,dt,fr(yt,c,d,E,dt,l,Z))}),W}function Xn(l){return Vt(l)?Pr(l):{}}function Yn(l,c,d){var E=c(l);return pr(l)?E:X(E,d(l))}function Qn(l){return ke.call(l)}function Jn(l){if(!Vt(l)||hs(l))return!1;var c=mr(l)||at(l)?qn:k;return c.test(Et(l))}function ts(l){if(!Vr(l))return Ur(l);var c=[];for(var d in Object(l))zt.call(l,d)&&d!="constructor"&&c.push(d);return c}function Ue(l,c){if(c)return l.slice();var d=new l.constructor(l.length);return l.copy(d),d}function dr(l){var c=new l.constructor(l.byteLength);return new sr(c).set(new sr(l)),c}function Ae(l,c){var d=c?dr(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.byteLength)}function Kr(l,c,d){var E=c?d(pt(l),!0):pt(l);return Q(E,lt,new l.constructor)}function Gr(l){var c=new l.constructor(l.source,S.exec(l));return c.lastIndex=l.lastIndex,c}function es(l,c,d){var E=c?d(Mr(l),!0):Mr(l);return Q(E,K,new l.constructor)}function rs(l){return Fr?Object(Fr.call(l)):{}}function ns(l,c){var d=c?dr(l.buffer):l.buffer;return new l.constructor(d,l.byteOffset,l.length)}function ss(l,c){var d=-1,E=l.length;for(c||(c=Array(E));++d<E;)c[d]=l[d];return c}function gr(l,c,d,E){d||(d={});for(var F=-1,j=c.length;++F<j;){var Z=c[F],W=void 0;zr(d,Z,W===void 0?l[Z]:W)}return d}function is(l,c){return gr(l,Qt(l),c)}function ls(l){return Yn(l,br,Qt)}function Ne(l,c){var d=l.__data__;return us(c)?d[typeof c=="string"?"string":"hash"]:d.map}function kt(l,c){var d=et(l,c);return Jn(d)?d:void 0}var Qt=ir?rr(ir,Object):ds,Jt=Qn;(De&&Jt(new De(new ArrayBuffer(1)))!=rt||ye&&Jt(new ye)!=f||Rt&&Jt(Rt.resolve())!=N||je&&Jt(new je)!=x||lr&&Jt(new lr)!=H)&&(Jt=function(l){var c=ke.call(l),d=c==y?l.constructor:void 0,E=d?Et(d):void 0;if(E)switch(E){case or:return rt;case Ee:return f;case ar:return N;case cr:return x;case ur:return H}return c});function os(l){var c=l.length,d=l.constructor(c);return c&&typeof l[0]=="string"&&zt.call(l,"index")&&(d.index=l.index,d.input=l.input),d}function Gt(l){return typeof l.constructor=="function"&&!Vr(l)?Xn(St(l)):{}}function as(l,c,d,E){var F=l.constructor;switch(c){case $:return dr(l);case a:case u:return new F(+l);case rt:return Ae(l,E);case ot:case ht:case It:case Lt:case g:case L:case b:case O:case _:return ns(l,E);case f:return Kr(l,E,d);case m:case q:return new F(l);case w:return Gr(l);case x:return es(l,E,d);case B:return rs(l)}}function cs(l,c){return c=c??s,!!c&&(typeof l=="number"||D.test(l))&&l>-1&&l%1==0&&l<c}function us(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function hs(l){return!!Dr&&Dr in l}function Vr(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||Re;return l===d}function Et(l){if(l!=null){try{return jr.call(l)}catch{}try{return l+""}catch{}}return""}function Wr(l){return fr(l,!0,!0)}function Zr(l,c){return l===c||l!==l&&c!==c}function Fe(l){return fs(l)&&zt.call(l,"callee")&&(!$r.call(l,"callee")||ke.call(l)==i)}var pr=Array.isArray;function He(l){return l!=null&&Yr(l.length)&&!mr(l)}function fs(l){return Qr(l)&&He(l)}var Xr=Me||gs;function mr(l){var c=Vt(l)?ke.call(l):"";return c==p||c==v}function Yr(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=s}function Vt(l){var c=typeof l;return!!l&&(c=="object"||c=="function")}function Qr(l){return!!l&&typeof l=="object"}function br(l){return He(l)?Pe(l):ts(l)}function ds(){return[]}function gs(){return!1}n.exports=Wr})(Er,Er.exports)),Er.exports}var Ar={exports:{}};Ar.exports;var $i;function Vl(){return $i||($i=1,(function(n,t){var e=200,r="__lodash_hash_undefined__",s=1,i=2,o=9007199254740991,a="[object Arguments]",u="[object Array]",h="[object AsyncFunction]",p="[object Boolean]",v="[object Date]",f="[object Error]",m="[object Function]",y="[object GeneratorFunction]",N="[object Map]",w="[object Number]",x="[object Null]",q="[object Object]",B="[object Promise]",H="[object Proxy]",$="[object RegExp]",rt="[object Set]",ot="[object String]",ht="[object Symbol]",It="[object Undefined]",Lt="[object WeakMap]",g="[object ArrayBuffer]",L="[object DataView]",b="[object Float32Array]",O="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",S="[object Int32Array]",k="[object Uint8Array]",D="[object Uint8ClampedArray]",C="[object Uint16Array]",z="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,G=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,P={};P[b]=P[O]=P[_]=P[T]=P[S]=P[k]=P[D]=P[C]=P[z]=!0,P[a]=P[u]=P[g]=P[p]=P[L]=P[v]=P[f]=P[m]=P[N]=P[w]=P[q]=P[$]=P[rt]=P[ot]=P[Lt]=!1;var st=typeof ce=="object"&&ce&&ce.Object===Object&&ce,lt=typeof self=="object"&&self&&self.Object===Object&&self,K=st||lt||Function("return this")(),Y=t&&!t.nodeType&&t,X=Y&&!0&&n&&!n.nodeType&&n,Q=X&&X.exports===Y,tt=Q&&st.process,et=(function(){try{return tt&&tt.binding&&tt.binding("util")}catch{}})(),at=et&&et.isTypedArray;function pt(l,c){for(var d=-1,E=l==null?0:l.length,F=0,j=[];++d<E;){var Z=l[d];c(Z,d,l)&&(j[F++]=Z)}return j}function rr(l,c){for(var d=-1,E=c.length,F=l.length;++d<E;)l[F+d]=c[d];return l}function Mr(l,c){for(var d=-1,E=l==null?0:l.length;++d<E;)if(c(l[d],d,l))return!0;return!1}function Sn(l,c){for(var d=-1,E=Array(l);++d<l;)E[d]=c(d);return E}function On(l){return function(c){return l(c)}}function Re(l,c){return l.has(c)}function nr(l,c){return l?.[c]}function Dr(l){var c=-1,d=Array(l.size);return l.forEach(function(E,F){d[++c]=[F,E]}),d}function jr(l,c){return function(d){return l(c(d))}}function zt(l){var c=-1,d=Array(l.size);return l.forEach(function(E){d[++c]=E}),d}var ke=Array.prototype,qn=Function.prototype,be=Object.prototype,Be=K["__core-js_shared__"],sr=qn.toString,St=be.hasOwnProperty,Pr=(function(){var l=/[^.]+$/.exec(Be&&Be.keys&&Be.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""})(),$r=be.toString,Cn=RegExp("^"+sr.call(St).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ir=Q?K.Buffer:void 0,Me=K.Symbol,Ur=K.Uint8Array,De=be.propertyIsEnumerable,ye=ke.splice,Rt=Me?Me.toStringTag:void 0,je=Object.getOwnPropertySymbols,lr=ir?ir.isBuffer:void 0,ve=jr(Object.keys,Object),or=Qt(K,"DataView"),Ee=Qt(K,"Map"),ar=Qt(K,"Promise"),cr=Qt(K,"Set"),ur=Qt(K,"WeakMap"),le=Qt(Object,"create"),Fr=Et(or),Yt=Et(Ee),In=Et(ar),Rn=Et(cr),kn=Et(ur),Hr=Me?Me.prototype:void 0,hr=Hr?Hr.valueOf:void 0;function ft(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Bn(){this.__data__=le?le(null):{},this.size=0}function Mn(l){var c=this.has(l)&&delete this.__data__[l];return this.size-=c?1:0,c}function Dn(l){var c=this.__data__;if(le){var d=c[l];return d===r?void 0:d}return St.call(c,l)?c[l]:void 0}function jn(l){var c=this.__data__;return le?c[l]!==void 0:St.call(c,l)}function Pn(l,c){var d=this.__data__;return this.size+=this.has(l)?0:1,d[l]=le&&c===void 0?r:c,this}ft.prototype.clear=Bn,ft.prototype.delete=Mn,ft.prototype.get=Dn,ft.prototype.has=jn,ft.prototype.set=Pn;function mt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function $n(){this.__data__=[],this.size=0}function Un(l){var c=this.__data__,d=Ue(c,l);if(d<0)return!1;var E=c.length-1;return d==E?c.pop():ye.call(c,d,1),--this.size,!0}function Fn(l){var c=this.__data__,d=Ue(c,l);return d<0?void 0:c[d][1]}function Hn(l){return Ue(this.__data__,l)>-1}function zn(l,c){var d=this.__data__,E=Ue(d,l);return E<0?(++this.size,d.push([l,c])):d[E][1]=c,this}mt.prototype.clear=$n,mt.prototype.delete=Un,mt.prototype.get=Fn,mt.prototype.has=Hn,mt.prototype.set=zn;function Tt(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var E=l[c];this.set(E[0],E[1])}}function Kn(){this.size=0,this.__data__={hash:new ft,map:new(Ee||mt),string:new ft}}function Gn(l){var c=kt(this,l).delete(l);return this.size-=c?1:0,c}function Vn(l){return kt(this,l).get(l)}function Wn(l){return kt(this,l).has(l)}function Zn(l,c){var d=kt(this,l),E=d.size;return d.set(l,c),this.size+=d.size==E?0:1,this}Tt.prototype.clear=Kn,Tt.prototype.delete=Gn,Tt.prototype.get=Vn,Tt.prototype.has=Wn,Tt.prototype.set=Zn;function Pe(l){var c=-1,d=l==null?0:l.length;for(this.__data__=new Tt;++c<d;)this.add(l[c])}function zr(l){return this.__data__.set(l,r),this}function $e(l){return this.__data__.has(l)}Pe.prototype.add=Pe.prototype.push=zr,Pe.prototype.has=$e;function Kt(l){var c=this.__data__=new mt(l);this.size=c.size}function fr(){this.__data__=new mt,this.size=0}function Xn(l){var c=this.__data__,d=c.delete(l);return this.size=c.size,d}function Yn(l){return this.__data__.get(l)}function Qn(l){return this.__data__.has(l)}function Jn(l,c){var d=this.__data__;if(d instanceof mt){var E=d.__data__;if(!Ee||E.length<e-1)return E.push([l,c]),this.size=++d.size,this;d=this.__data__=new Tt(E)}return d.set(l,c),this.size=d.size,this}Kt.prototype.clear=fr,Kt.prototype.delete=Xn,Kt.prototype.get=Yn,Kt.prototype.has=Qn,Kt.prototype.set=Jn;function ts(l,c){var d=Fe(l),E=!d&&Zr(l),F=!d&&!E&&He(l),j=!d&&!E&&!F&&Qr(l),Z=d||E||F||j,W=Z?Sn(l.length,String):[],ct=W.length;for(var J in l)St.call(l,J)&&!(Z&&(J=="length"||F&&(J=="offset"||J=="parent")||j&&(J=="buffer"||J=="byteLength"||J=="byteOffset")||as(J,ct)))&&W.push(J);return W}function Ue(l,c){for(var d=l.length;d--;)if(Wr(l[d][0],c))return d;return-1}function dr(l,c,d){var E=c(l);return Fe(l)?E:rr(E,d(l))}function Ae(l){return l==null?l===void 0?It:x:Rt&&Rt in Object(l)?Jt(l):Vr(l)}function Kr(l){return Vt(l)&&Ae(l)==a}function Gr(l,c,d,E,F){return l===c?!0:l==null||c==null||!Vt(l)&&!Vt(c)?l!==l&&c!==c:es(l,c,d,E,Gr,F)}function es(l,c,d,E,F,j){var Z=Fe(l),W=Fe(c),ct=Z?u:Gt(l),J=W?u:Gt(c);ct=ct==a?q:ct,J=J==a?q:J;var bt=ct==q,xt=J==q,ut=ct==J;if(ut&&He(l)){if(!He(c))return!1;Z=!0,bt=!1}if(ut&&!bt)return j||(j=new Kt),Z||Qr(l)?gr(l,c,d,E,F,j):is(l,c,ct,d,E,F,j);if(!(d&s)){var yt=bt&&St.call(l,"__wrapped__"),dt=xt&&St.call(c,"__wrapped__");if(yt||dt){var oe=yt?l.value():l,te=dt?c.value():c;return j||(j=new Kt),F(oe,te,d,E,j)}}return ut?(j||(j=new Kt),ls(l,c,d,E,F,j)):!1}function rs(l){if(!Yr(l)||us(l))return!1;var c=Xr(l)?Cn:G;return c.test(Et(l))}function ns(l){return Vt(l)&&mr(l.length)&&!!P[Ae(l)]}function ss(l){if(!hs(l))return ve(l);var c=[];for(var d in Object(l))St.call(l,d)&&d!="constructor"&&c.push(d);return c}function gr(l,c,d,E,F,j){var Z=d&s,W=l.length,ct=c.length;if(W!=ct&&!(Z&&ct>W))return!1;var J=j.get(l);if(J&&j.get(c))return J==c;var bt=-1,xt=!0,ut=d&i?new Pe:void 0;for(j.set(l,c),j.set(c,l);++bt<W;){var yt=l[bt],dt=c[bt];if(E)var oe=Z?E(dt,yt,bt,c,l,j):E(yt,dt,bt,l,c,j);if(oe!==void 0){if(oe)continue;xt=!1;break}if(ut){if(!Mr(c,function(te,we){if(!Re(ut,we)&&(yt===te||F(yt,te,d,E,j)))return ut.push(we)})){xt=!1;break}}else if(!(yt===dt||F(yt,dt,d,E,j))){xt=!1;break}}return j.delete(l),j.delete(c),xt}function is(l,c,d,E,F,j,Z){switch(d){case L:if(l.byteLength!=c.byteLength||l.byteOffset!=c.byteOffset)return!1;l=l.buffer,c=c.buffer;case g:return!(l.byteLength!=c.byteLength||!j(new Ur(l),new Ur(c)));case p:case v:case w:return Wr(+l,+c);case f:return l.name==c.name&&l.message==c.message;case $:case ot:return l==c+"";case N:var W=Dr;case rt:var ct=E&s;if(W||(W=zt),l.size!=c.size&&!ct)return!1;var J=Z.get(l);if(J)return J==c;E|=i,Z.set(l,c);var bt=gr(W(l),W(c),E,F,j,Z);return Z.delete(l),bt;case ht:if(hr)return hr.call(l)==hr.call(c)}return!1}function ls(l,c,d,E,F,j){var Z=d&s,W=Ne(l),ct=W.length,J=Ne(c),bt=J.length;if(ct!=bt&&!Z)return!1;for(var xt=ct;xt--;){var ut=W[xt];if(!(Z?ut in c:St.call(c,ut)))return!1}var yt=j.get(l);if(yt&&j.get(c))return yt==c;var dt=!0;j.set(l,c),j.set(c,l);for(var oe=Z;++xt<ct;){ut=W[xt];var te=l[ut],we=c[ut];if(E)var ui=Z?E(we,te,ut,c,l,j):E(te,we,ut,l,c,j);if(!(ui===void 0?te===we||F(te,we,d,E,j):ui)){dt=!1;break}oe||(oe=ut=="constructor")}if(dt&&!oe){var Jr=l.constructor,tn=c.constructor;Jr!=tn&&"constructor"in l&&"constructor"in c&&!(typeof Jr=="function"&&Jr instanceof Jr&&typeof tn=="function"&&tn instanceof tn)&&(dt=!1)}return j.delete(l),j.delete(c),dt}function Ne(l){return dr(l,br,os)}function kt(l,c){var d=l.__data__;return cs(c)?d[typeof c=="string"?"string":"hash"]:d.map}function Qt(l,c){var d=nr(l,c);return rs(d)?d:void 0}function Jt(l){var c=St.call(l,Rt),d=l[Rt];try{l[Rt]=void 0;var E=!0}catch{}var F=$r.call(l);return E&&(c?l[Rt]=d:delete l[Rt]),F}var os=je?function(l){return l==null?[]:(l=Object(l),pt(je(l),function(c){return De.call(l,c)}))}:ds,Gt=Ae;(or&&Gt(new or(new ArrayBuffer(1)))!=L||Ee&&Gt(new Ee)!=N||ar&&Gt(ar.resolve())!=B||cr&&Gt(new cr)!=rt||ur&&Gt(new ur)!=Lt)&&(Gt=function(l){var c=Ae(l),d=c==q?l.constructor:void 0,E=d?Et(d):"";if(E)switch(E){case Fr:return L;case Yt:return N;case In:return B;case Rn:return rt;case kn:return Lt}return c});function as(l,c){return c=c??o,!!c&&(typeof l=="number"||V.test(l))&&l>-1&&l%1==0&&l<c}function cs(l){var c=typeof l;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?l!=="__proto__":l===null}function us(l){return!!Pr&&Pr in l}function hs(l){var c=l&&l.constructor,d=typeof c=="function"&&c.prototype||be;return l===d}function Vr(l){return $r.call(l)}function Et(l){if(l!=null){try{return sr.call(l)}catch{}try{return l+""}catch{}}return""}function Wr(l,c){return l===c||l!==l&&c!==c}var Zr=Kr((function(){return arguments})())?Kr:function(l){return Vt(l)&&St.call(l,"callee")&&!De.call(l,"callee")},Fe=Array.isArray;function pr(l){return l!=null&&mr(l.length)&&!Xr(l)}var He=lr||gs;function fs(l,c){return Gr(l,c)}function Xr(l){if(!Yr(l))return!1;var c=Ae(l);return c==m||c==y||c==h||c==H}function mr(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=o}function Yr(l){var c=typeof l;return l!=null&&(c=="object"||c=="function")}function Vt(l){return l!=null&&typeof l=="object"}var Qr=at?On(at):ns;function br(l){return pr(l)?ts(l):ss(l)}function ds(){return[]}function gs(){return!1}n.exports=fs})(Ar,Ar.exports)),Ar.exports}var nn={},Ui;function tf(){if(Ui)return nn;Ui=1,Object.defineProperty(nn,"__esModule",{value:!0});const n=Gl(),t=Vl();var e;return(function(r){function s(u={},h={},p=!1){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});let v=n(h);p||(v=Object.keys(v).reduce((f,m)=>(v[m]!=null&&(f[m]=v[m]),f),{}));for(const f in u)u[f]!==void 0&&h[f]===void 0&&(v[f]=u[f]);return Object.keys(v).length>0?v:void 0}r.compose=s;function i(u={},h={}){typeof u!="object"&&(u={}),typeof h!="object"&&(h={});const p=Object.keys(u).concat(Object.keys(h)).reduce((v,f)=>(t(u[f],h[f])||(v[f]=h[f]===void 0?null:h[f]),v),{});return Object.keys(p).length>0?p:void 0}r.diff=i;function o(u={},h={}){u=u||{};const p=Object.keys(h).reduce((v,f)=>(h[f]!==u[f]&&u[f]!==void 0&&(v[f]=h[f]),v),{});return Object.keys(u).reduce((v,f)=>(u[f]!==h[f]&&h[f]===void 0&&(v[f]=null),v),p)}r.invert=o;function a(u,h,p=!1){if(typeof u!="object")return h;if(typeof h!="object")return;if(!p)return h;const v=Object.keys(h).reduce((f,m)=>(u[m]===void 0&&(f[m]=h[m]),f),{});return Object.keys(v).length>0?v:void 0}r.transform=a})(e||(e={})),nn.default=e,nn}var sn={},Fi;function Wl(){if(Fi)return sn;Fi=1,Object.defineProperty(sn,"__esModule",{value:!0});var n;return(function(t){function e(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}t.length=e})(n||(n={})),sn.default=n,sn}var ln={},Hi;function ef(){if(Hi)return ln;Hi=1,Object.defineProperty(ln,"__esModule",{value:!0});const n=Wl();class t{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,o=n.default.length(s);if(r>=o-i?(r=o-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const a={};return s.attributes&&(a.attributes=s.attributes),typeof s.retain=="number"?a.retain=r:typeof s.retain=="object"&&s.retain!==null?a.retain=s.retain:typeof s.insert=="string"?a.insert=s.insert.substr(i,r):a.insert=s.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),o=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(o)}}else return[]}}return ln.default=t,ln}var zi;function rf(){return zi||(zi=1,(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=Jh(),r=Gl(),s=Vl(),i=tf();t.AttributeMap=i.default;const o=Wl();t.Op=o.default;const a=ef();t.OpIterator=a.default;const u="\0",h=(v,f)=>{if(typeof v!="object"||v===null)throw new Error(`cannot retain a ${typeof v}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const m=Object.keys(v)[0];if(!m||m!==Object.keys(f)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(f)[0]}`);return[m,v[m],f[m]]};class p{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,m){this.handlers[f]=m}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const m=this.handlers[f];if(!m)throw new Error(`no handlers for embed type "${f}"`);return m}insert(f,m){const y={};return typeof f=="string"&&f.length===0?this:(y.insert=f,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,m){if(typeof f=="number"&&f<=0)return this;const y={retain:f};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y)}push(f){let m=this.ops.length,y=this.ops[m-1];if(f=r(f),typeof y=="object"){if(typeof f.delete=="number"&&typeof y.delete=="number")return this.ops[m-1]={delete:y.delete+f.delete},this;if(typeof y.delete=="number"&&f.insert!=null&&(m-=1,y=this.ops[m-1],typeof y!="object"))return this.ops.unshift(f),this;if(s(f.attributes,y.attributes)){if(typeof f.insert=="string"&&typeof y.insert=="string")return this.ops[m-1]={insert:y.insert+f.insert},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof y.retain=="number")return this.ops[m-1]={retain:y.retain+f.retain},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this}}return m===this.ops.length?this.ops.push(f):this.ops.splice(m,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const m=[],y=[];return this.forEach(N=>{(f(N)?m:y).push(N)}),[m,y]}reduce(f,m){return this.ops.reduce(f,m)}changeLength(){return this.reduce((f,m)=>m.insert?f+o.default.length(m):m.delete?f-m.delete:f,0)}length(){return this.reduce((f,m)=>f+o.default.length(m),0)}slice(f=0,m=1/0){const y=[],N=new a.default(this.ops);let w=0;for(;w<m&&N.hasNext();){let x;w<f?x=N.next(f-w):(x=N.next(m-w),y.push(x)),w+=o.default.length(x)}return new p(y)}compose(f){const m=new a.default(this.ops),y=new a.default(f.ops),N=[],w=y.peek();if(w!=null&&typeof w.retain=="number"&&w.attributes==null){let q=w.retain;for(;m.peekType()==="insert"&&m.peekLength()<=q;)q-=m.peekLength(),N.push(m.next());w.retain-q>0&&y.next(w.retain-q)}const x=new p(N);for(;m.hasNext()||y.hasNext();)if(y.peekType()==="insert")x.push(y.next());else if(m.peekType()==="delete")x.push(m.next());else{const q=Math.min(m.peekLength(),y.peekLength()),B=m.next(q),H=y.next(q);if(H.retain){const $={};if(typeof B.retain=="number")$.retain=typeof H.retain=="number"?q:H.retain;else if(typeof H.retain=="number")B.retain==null?$.insert=B.insert:$.retain=B.retain;else{const ot=B.retain==null?"insert":"retain",[ht,It,Lt]=h(B[ot],H.retain),g=p.getHandler(ht);$[ot]={[ht]:g.compose(It,Lt,ot==="retain")}}const rt=i.default.compose(B.attributes,H.attributes,typeof B.retain=="number");if(rt&&($.attributes=rt),x.push($),!y.hasNext()&&s(x.ops[x.ops.length-1],$)){const ot=new p(m.rest());return x.concat(ot).chop()}}else typeof H.delete=="number"&&(typeof B.retain=="number"||typeof B.retain=="object"&&B.retain!==null)&&x.push(H)}return x.chop()}concat(f){const m=new p(this.ops.slice());return f.ops.length>0&&(m.push(f.ops[0]),m.ops=m.ops.concat(f.ops.slice(1))),m}diff(f,m){if(this.ops===f.ops)return new p;const y=[this,f].map(B=>B.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:u;const $=B===f?"on":"with";throw new Error("diff() called "+$+" non-document")}).join("")),N=new p,w=e(y[0],y[1],m,!0),x=new a.default(this.ops),q=new a.default(f.ops);return w.forEach(B=>{let H=B[1].length;for(;H>0;){let $=0;switch(B[0]){case e.INSERT:$=Math.min(q.peekLength(),H),N.push(q.next($));break;case e.DELETE:$=Math.min(H,x.peekLength()),x.next($),N.delete($);break;case e.EQUAL:$=Math.min(x.peekLength(),q.peekLength(),H);const rt=x.next($),ot=q.next($);s(rt.insert,ot.insert)?N.retain($,i.default.diff(rt.attributes,ot.attributes)):N.push(ot).delete($);break}H-=$}}),N.chop()}eachLine(f,m=`
2
+ `){const y=new a.default(this.ops);let N=new p,w=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const x=y.peek(),q=o.default.length(x)-y.peekLength(),B=typeof x.insert=="string"?x.insert.indexOf(m,q)-q:-1;if(B<0)N.push(y.next());else if(B>0)N.push(y.next(B));else{if(f(N,y.next(1).attributes||{},w)===!1)return;w+=1,N=new p}}N.length()>0&&f(N,{},w)}invert(f){const m=new p;return this.reduce((y,N)=>{if(N.insert)m.delete(o.default.length(N));else{if(typeof N.retain=="number"&&N.attributes==null)return m.retain(N.retain),y+N.retain;if(N.delete||typeof N.retain=="number"){const w=N.delete||N.retain;return f.slice(y,y+w).forEach(q=>{N.delete?m.push(q):N.retain&&N.attributes&&m.retain(o.default.length(q),i.default.invert(N.attributes,q.attributes))}),y+w}else if(typeof N.retain=="object"&&N.retain!==null){const w=f.slice(y,y+1),x=new a.default(w.ops).next(),[q,B,H]=h(N.retain,x.insert),$=p.getHandler(q);return m.retain({[q]:$.invert(B,H)},i.default.invert(N.attributes,x.attributes)),y+1}}return y},0),m.chop()}transform(f,m=!1){if(m=!!m,typeof f=="number")return this.transformPosition(f,m);const y=f,N=new a.default(this.ops),w=new a.default(y.ops),x=new p;for(;N.hasNext()||w.hasNext();)if(N.peekType()==="insert"&&(m||w.peekType()!=="insert"))x.retain(o.default.length(N.next()));else if(w.peekType()==="insert")x.push(w.next());else{const q=Math.min(N.peekLength(),w.peekLength()),B=N.next(q),H=w.next(q);if(B.delete)continue;if(H.delete)x.push(H);else{const $=B.retain,rt=H.retain;let ot=typeof rt=="object"&&rt!==null?rt:q;if(typeof $=="object"&&$!==null&&typeof rt=="object"&&rt!==null){const ht=Object.keys($)[0];if(ht===Object.keys(rt)[0]){const It=p.getHandler(ht);It&&(ot={[ht]:It.transform($[ht],rt[ht],m)})}}x.retain(ot,i.default.transform(B.attributes,H.attributes,m))}}return x.chop()}transformPosition(f,m=!1){m=!!m;const y=new a.default(this.ops);let N=0;for(;y.hasNext()&&N<=f;){const w=y.peekLength(),x=y.peekType();if(y.next(),x==="delete"){f-=Math.min(w,f-N);continue}else x==="insert"&&(N<f||!m)&&(f+=w);N+=w}return f}}p.Op=o.default,p.OpIterator=a.default,p.AttributeMap=i.default,p.handlers={},t.default=p,n.exports=p,n.exports.default=p})(rn,rn.exports)),rn.exports}var Nt=rf();const R=Kl(Nt);class Ft extends _t{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ft.blotName="break";Ft.tagName="BR";let $t=class extends mn{};const nf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function xn(n){return n.replace(/[&<>"']/g,t=>nf[t])}class At extends Ys{static allowedChildren=[At,Ft,_t,$t];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,e){const r=At.order.indexOf(t),s=At.order.indexOf(e);return r>=0||s>=0?r-s:t===e?0:t<e?-1:1}formatAt(t,e,r,s){if(At.compare(this.statics.blotName,r)<0&&this.scroll.query(r,M.BLOT)){const i=this.isolate(t,e);s&&i.wrap(r,s)}else super.formatAt(t,e,r,s)}optimize(t){if(super.optimize(t),this.parent instanceof At&&At.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}const Ki=1;class gt extends Sr{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Zl(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,r,s){e<=0||(this.scroll.query(r,M.BLOCK)?t+e===this.length()&&this.format(r,s):super.formatAt(t,Math.min(e,this.length()-t-1),r,s),this.cache={})}insertAt(t,e,r){if(r!=null){super.insertAt(t,e,r),this.cache={};return}if(e.length===0)return;const s=e.split(`
3
+ `),i=s.shift();i.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let o=this;s.reduce((a,u)=>(o=o.split(a,!0),o.insertAt(0,u),u.length),t+i.length)}insertBefore(t,e){const{head:r}=this.children;super.insertBefore(t,e),r instanceof Ft&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Ki),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&&arguments[1]!==void 0?arguments[1]:!1;if(e&&(t===0||t>=this.length()-Ki)){const s=this.clone();return t===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(t,e);return this.cache={},r}}gt.blotName="block";gt.tagName="P";gt.defaultChild=Ft;gt.allowedChildren=[Ft,At,_t,$t];class Ct extends _t{attach(){super.attach(),this.attributes=new wn(this.domNode)}delta(){return new R().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const r=this.scroll.query(t,M.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,e)}formatAt(t,e,r,s){this.format(r,s)}insertAt(t,e,r){if(r!=null){super.insertAt(t,e,r);return}const s=e.split(`
4
+ `),i=s.pop(),o=s.map(u=>{const h=this.scroll.create(gt.blotName);return h.insertAt(0,u),h}),a=this.split(t);o.forEach(u=>{this.parent.insertBefore(u,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}Ct.scope=M.BLOCK_BLOT;function Zl(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(vt).reduce((e,r)=>r.length()===0?e:e.insert(r.value(),Ot(r,{},t)),new R).insert(`
5
+ `,Ot(n))}function Ot(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(t={...t,...n.formats()},e&&delete t["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?t:Ot(n.parent,t,e)}class Dt extends _t{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(t,e,r){super(t,e),this.selection=r,this.textNode=document.createTextNode(Dt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==M.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Dt.CONTENTS.length,r.optimize(),r.formatAt(s,Dt.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof $t?this.prev:null,r=e?e.length():0,s=this.next instanceof $t?this.next:null,i=s?s.text:"",{textNode:o}=this,a=o.data.split(Dt.CONTENTS).join("");o.data=Dt.CONTENTS;let u;if(e)u=e,(a||s)&&(e.insertAt(e.length(),a+i),s&&s.remove());else if(s)u=s,s.insertAt(0,a);else{const h=document.createTextNode(a);u=this.scroll.create(h),this.parent.insertBefore(u,this)}if(this.remove(),t){const h=(f,m)=>e&&f===e.domNode?m:f===o?r+m-1:s&&f===s.domNode?r+a.length+m:null,p=h(t.start.node,t.start.offset),v=h(t.end.node,t.end.offset);if(p!==null&&v!==null)return{startNode:u.domNode,startOffset:p,endNode:u.domNode,endOffset:v}}return null}update(t,e){if(t.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(e.range=r)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=Dt.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}}var Es={exports:{}},Gi;function sf(){return Gi||(Gi=1,(function(n){var t=Object.prototype.hasOwnProperty,e="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(e=!1));function s(u,h,p){this.fn=u,this.context=h,this.once=p||!1}function i(u,h,p,v,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new s(p,v||u,f),y=e?e+h:h;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],m]:u._events[y].push(m):(u._events[y]=m,u._eventsCount++),u}function o(u,h){--u._eventsCount===0?u._events=new r:delete u._events[h]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],p,v;if(this._eventsCount===0)return h;for(v in p=this._events)t.call(p,v)&&h.push(e?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},a.prototype.listeners=function(h){var p=e?e+h:h,v=this._events[p];if(!v)return[];if(v.fn)return[v.fn];for(var f=0,m=v.length,y=new Array(m);f<m;f++)y[f]=v[f].fn;return y},a.prototype.listenerCount=function(h){var p=e?e+h:h,v=this._events[p];return v?v.fn?1:v.length:0},a.prototype.emit=function(h,p,v,f,m,y){var N=e?e+h:h;if(!this._events[N])return!1;var w=this._events[N],x=arguments.length,q,B;if(w.fn){switch(w.once&&this.removeListener(h,w.fn,void 0,!0),x){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,p),!0;case 3:return w.fn.call(w.context,p,v),!0;case 4:return w.fn.call(w.context,p,v,f),!0;case 5:return w.fn.call(w.context,p,v,f,m),!0;case 6:return w.fn.call(w.context,p,v,f,m,y),!0}for(B=1,q=new Array(x-1);B<x;B++)q[B-1]=arguments[B];w.fn.apply(w.context,q)}else{var H=w.length,$;for(B=0;B<H;B++)switch(w[B].once&&this.removeListener(h,w[B].fn,void 0,!0),x){case 1:w[B].fn.call(w[B].context);break;case 2:w[B].fn.call(w[B].context,p);break;case 3:w[B].fn.call(w[B].context,p,v);break;case 4:w[B].fn.call(w[B].context,p,v,f);break;default:if(!q)for($=1,q=new Array(x-1);$<x;$++)q[$-1]=arguments[$];w[B].fn.apply(w[B].context,q)}}return!0},a.prototype.on=function(h,p,v){return i(this,h,p,v,!1)},a.prototype.once=function(h,p,v){return i(this,h,p,v,!0)},a.prototype.removeListener=function(h,p,v,f){var m=e?e+h:h;if(!this._events[m])return this;if(!p)return o(this,m),this;var y=this._events[m];if(y.fn)y.fn===p&&(!f||y.once)&&(!v||y.context===v)&&o(this,m);else{for(var N=0,w=[],x=y.length;N<x;N++)(y[N].fn!==p||f&&!y[N].once||v&&y[N].context!==v)&&w.push(y[N]);w.length?this._events[m]=w.length===1?w[0]:w:o(this,m)}return this},a.prototype.removeAllListeners=function(h){var p;return h?(p=e?e+h:h,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,n.exports=a})(Es)),Es.exports}var lf=sf();const of=Kl(lf),Us=new WeakMap,Fs=["error","warn","log","info"];let Hs="warn";function Xl(n){if(Hs&&Fs.indexOf(n)<=Fs.indexOf(Hs)){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];console[n](...e)}}function ie(n){return Fs.reduce((t,e)=>(t[e]=Xl.bind(console,e,n),t),{})}ie.level=n=>{Hs=n};Xl.level=ie.level;const As=ie("quill:events"),af=["selectionchange","mousedown","mouseup","click"];af.forEach(n=>{document.addEventListener(n,function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=Us.get(s);i&&i.emitter&&i.emitter.handleDOM(...e)})})});class I extends of{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",As.error)}emit(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return As.log.call(As,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];(this.domListeners[t.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(t.target===o||o.contains(t.target))&&a(t,...r)})}listenDOM(t,e,r){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:r})}}const Ns=ie("quill:selection");class ge{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class cf{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 ge(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,I.sources.USER),1)}),this.emitter.on(I.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(I.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?I.sources.SILENT:s)}catch{}})}),this.emitter.on(I.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:i,startOffset:o,endNode:a,endOffset:u}=s.range;this.setNativeRange(i,o,a,u),this.update(I.sources.SILENT)}}),this.update(I.sources.SILENT)}handleComposition(){this.emitter.on(I.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(I.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(I.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(t,M.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof vt){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();t=Math.min(t,r-1),e=Math.min(t+e,r-1)-t;let s,[i,o]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&o===i.length()){const[p]=this.scroll.leaf(t+1);if(p){const[v]=this.scroll.line(t),[f]=this.scroll.line(t+1);v===f&&(i=p,o=0)}}[s,o]=i.position(o,!0);const a=document.createRange();if(e>0)return a.setStart(s,o),[i,o]=this.scroll.leaf(t+e),i==null?null:([s,o]=i.position(o,!0),a.setEnd(s,o),a.getBoundingClientRect());let u="left",h;if(s instanceof Text){if(!s.data.length)return null;o<s.data.length?(a.setStart(s,o),a.setEnd(s,o+1)):(a.setStart(s,o-1),a.setEnd(s,o),u="right"),h=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;h=i.domNode.getBoundingClientRect(),o>0&&(u="right")}return{bottom:h.top+h.height,height:h.height,left:h[u],right:h[u],top:h.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const r=this.normalizeNative(e);return Ns.info("getNativeRange",r),r}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&ws(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const r=e.map(o=>{const[a,u]=o,h=this.scroll.find(a,!0),p=h.offset(this.scroll);return u===0?p:h instanceof vt?p+h.index(a,u):p+h.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new ge(i,s-i)}normalizeNative(t){if(!ws(this.root,t.startContainer)||!t.collapsed&&!ws(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i}),e}rangeToNative(t){const e=this.scroll.length(),r=(s,i)=>{s=Math.min(e-1,s);const[o,a]=this.scroll.leaf(s);return o?o.position(a,i):[null,-1]};return[...r(t.index,!1),...r(t.index+t.length,!0)]}setNativeRange(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Ns.info("setNativeRange",t,e,r,s),t!=null&&(this.root.parentNode==null||t.parentNode==null||r.parentNode==null))return;const o=document.getSelection();if(o!=null)if(t!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||i||t!==a.startContainer||e!==a.startOffset||r!==a.endContainer||s!==a.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const u=document.createRange();u.setStart(t,e),u.setEnd(r,s),o.removeAllRanges(),o.addRange(u)}}else o.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I.sources.API;if(typeof e=="string"&&(r=e,e=!1),Ns.info("setRange",t),t!=null){const s=this.rangeToNative(t);this.setNativeRange(...s,e)}else this.setNativeRange(null);this.update(r)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.sources.USER;const e=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Nn(e,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[I.events.SELECTION_CHANGE,Ze(this.lastRange),Ze(e),t];this.emitter.emit(I.events.EDITOR_CHANGE,...i),t!==I.sources.SILENT&&this.emitter.emit(...i)}}}function ws(n,t){try{t.parentNode}catch{return!1}return n.contains(t)}const uf=/^[ -~]*$/;class hf{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const r=Vi(t),s=new R;return df(r.ops.slice()).reduce((o,a)=>{const u=Nt.Op.length(a);let h=a.attributes||{},p=!1,v=!1;if(a.insert!=null){if(s.retain(u),typeof a.insert=="string"){const y=a.insert;v=!y.endsWith(`
6
+ `)&&(e<=o||!!this.scroll.descendant(Ct,o)[0]),this.scroll.insertAt(o,y);const[N,w]=this.scroll.line(o);let x=he({},Ot(N));if(N instanceof gt){const[q]=N.descendant(vt,w);q&&(x=he(x,Ot(q)))}h=Nt.AttributeMap.diff(x,h)||{}}else if(typeof a.insert=="object"){const y=Object.keys(a.insert)[0];if(y==null)return o;const N=this.scroll.query(y,M.INLINE)!=null;if(N)(e<=o||this.scroll.descendant(Ct,o)[0])&&(v=!0);else if(o>0){const[w,x]=this.scroll.descendant(vt,o-1);w instanceof $t?w.value()[x]!==`
7
+ `&&(p=!0):w instanceof _t&&w.statics.scope===M.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(o,y,a.insert[y]),N){const[w]=this.scroll.descendant(vt,o);if(w){const x=he({},Ot(w));h=Nt.AttributeMap.diff(x,h)||{}}}}e+=u}else if(s.push(a),a.retain!==null&&typeof a.retain=="object"){const y=Object.keys(a.retain)[0];if(y==null)return o;this.scroll.updateEmbedAt(o,y,a.retain[y])}Object.keys(h).forEach(y=>{this.scroll.formatAt(o,u,y,h[y])});const f=p?1:0,m=v?1:0;return e+=f+m,s.retain(f),s.delete(m),o+u+f+m},0),s.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+Nt.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new R().retain(t).delete(e))}formatLine(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(o=>{o.format(i,r[i])})}),this.scroll.optimize();const s=new R().retain(t).retain(e,Ze(r));return this.update(s)}formatText(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(i=>{this.scroll.formatAt(t,e,i,r[i])});const s=new R().retain(t).retain(e,Ze(r));return this.update(s)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new R)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];e===0?this.scroll.path(t).forEach(a=>{const[u]=a;u instanceof gt?r.push(u):u instanceof vt&&s.push(u)}):(r=this.scroll.lines(t,e),s=this.scroll.descendants(vt,t,e));const[i,o]=[r,s].map(a=>{const u=a.shift();if(u==null)return{};let h=Ot(u);for(;Object.keys(h).length>0;){const p=a.shift();if(p==null)return h;h=ff(Ot(p),h)}return h});return{...i,...o}}getHTML(t,e){const[r,s]=this.scroll.line(t);if(r){const i=r.length();return r.length()>=s+e&&!(s===0&&e===i)?Or(r,s,e,!0):Or(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(t,e){const r=Vi(e),s=new R().retain(t).concat(r);return this.scroll.insertContents(t,r),this.update(s)}insertEmbed(t,e,r){return this.scroll.insertAt(t,e,r),this.update(new R().retain(t).insert({[e]:r}))}insertText(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
8
+ `).replace(/\r/g,`
9
+ `),this.scroll.insertAt(t,e),Object.keys(r).forEach(s=>{this.scroll.formatAt(t,e.length,s,r[s])}),this.update(new R().retain(t).insert(e,Ze(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if(t?.statics.blotName!==gt.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof Ft}removeFormat(t,e){const r=this.getText(t,e),[s,i]=this.scroll.line(t+e);let o=0,a=new R;s!=null&&(o=s.length()-i,a=s.delta().slice(i,i+o-1).insert(`
10
+ `));const h=this.getContents(t,e+o).diff(new R().insert(r).concat(a)),p=new R().retain(t).concat(h);return this.applyDelta(p)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(uf)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),o=Ot(i),a=i.offset(this.scroll),u=e[0].oldValue.replace(Dt.CONTENTS,""),h=new R().insert(u),p=new R().insert(i.value()),v=r&&{oldRange:Wi(r.oldRange,-a),newRange:Wi(r.newRange,-a)};t=new R().retain(a).concat(h.diff(p,v)).reduce((m,y)=>y.insert?m.insert(y.insert,o):m.push(y),new R),this.delta=s.compose(t)}else this.delta=this.getDelta(),(!t||!Nn(s.compose(t),this.delta))&&(t=s.diff(this.delta,r));return t}}function We(n,t,e){if(n.length===0){const[m]=Ts(e.pop());return t<=0?`</li></${m}>`:`</li></${m}>${We([],t-1,e)}`}const[{child:r,offset:s,length:i,indent:o,type:a},...u]=n,[h,p]=Ts(a);if(o>t)return e.push(a),o===t+1?`<${h}><li${p}>${Or(r,s,i)}${We(u,o,e)}`:`<${h}><li>${We(n,t+1,e)}`;const v=e[e.length-1];if(o===t&&a===v)return`</li><li${p}>${Or(r,s,i)}${We(u,o,e)}`;const[f]=Ts(e.pop());return`</li></${f}>${We(n,t-1,e)}`}function Or(n,t,e){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(t,e);if(n instanceof $t)return xn(n.value().slice(t,t+e)).replaceAll(" ","&nbsp;");if(n instanceof Pt){if(n.statics.blotName==="list-container"){const h=[];return n.children.forEachAt(t,e,(p,v,f)=>{const m="formats"in p&&typeof p.formats=="function"?p.formats():{};h.push({child:p,offset:v,length:f,indent:m.indent||0,type:m.list})}),We(h,-1,[])}const s=[];if(n.children.forEachAt(t,e,(h,p,v)=>{s.push(Or(h,p,v))}),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:o}=n.domNode,[a,u]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${a}>${s.join("")}<${u}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function ff(n,t){return Object.keys(t).reduce((e,r)=>{if(n[r]==null)return e;const s=t[r];return s===n[r]?e[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?e[r]=s.concat([n[r]]):e[r]=s:e[r]=[s,n[r]],e},{})}function Ts(n){const t=n==="ordered"?"ol":"ul";switch(n){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function Vi(n){return n.reduce((t,e)=>{if(typeof e.insert=="string"){const r=e.insert.replace(/\r\n/g,`
11
+ `).replace(/\r/g,`
12
+ `);return t.insert(r,e.attributes)}return t.push(e)},new R)}function Wi(n,t){let{index:e,length:r}=n;return new ge(e+t,r)}function df(n){const t=[];return n.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
13
+ `).forEach((s,i)=>{i&&t.push({insert:`
14
+ `,attributes:e.attributes}),s&&t.push({insert:s,attributes:e.attributes})}):t.push(e)}),t}class Ht{static DEFAULTS={};constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}const on="\uFEFF";class Js extends _t{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(on),this.rightGuard=document.createTextNode(on),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e=null,r;const s=t.data.split(on).join("");if(t===this.leftGuard)if(this.prev instanceof $t){const i=this.prev.length();this.prev.insertAt(i,s),e={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),e={startNode:r,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof $t?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),e={startNode:r,startOffset:s.length}));return t.data=on,e}update(t,e){t.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(e.range=s)}})}}class gf{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 Js)&&(this.emitter.emit(I.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(I.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(I.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(I.events.COMPOSITION_END,t),this.isComposing=!1}}class er{static DEFAULTS={modules:{}};static themes={default:er};modules={};constructor(t,e){this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}const pf=n=>n.parentElement||n.getRootNode().host||null,mf=n=>{const t=n.getBoundingClientRect(),e="offsetWidth"in n&&Math.abs(t.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(t.height)/n.offsetHeight||1;return{top:t.top,right:t.left+n.clientWidth*e,bottom:t.top+n.clientHeight*r,left:t.left}},an=n=>{const t=parseInt(n,10);return Number.isNaN(t)?0:t},Zi=(n,t,e,r,s,i)=>n<e&&t>r?0:n<e?-(e-n+s):t>r?t-n>r-e?n+s-e:t-r+i:0,bf=(n,t)=>{const e=n.ownerDocument;let r=t,s=n;for(;s;){const i=s===e.body,o=i?{top:0,right:window.visualViewport?.width??e.documentElement.clientWidth,bottom:window.visualViewport?.height??e.documentElement.clientHeight,left:0}:mf(s),a=getComputedStyle(s),u=Zi(r.left,r.right,o.left,o.right,an(a.scrollPaddingLeft),an(a.scrollPaddingRight)),h=Zi(r.top,r.bottom,o.top,o.bottom,an(a.scrollPaddingTop),an(a.scrollPaddingBottom));if(u||h)if(i)e.defaultView?.scrollBy(u,h);else{const{scrollLeft:p,scrollTop:v}=s;h&&(s.scrollTop+=h),u&&(s.scrollLeft+=u);const f=s.scrollLeft-p,m=s.scrollTop-v;r={left:r.left-f,top:r.top-m,right:r.right-f,bottom:r.bottom-m}}s=i||a.position==="fixed"?null:pf(s)}},yf=100,vf=["block","break","cursor","inline","scroll","text"],Ef=(n,t,e)=>{const r=new Je;return vf.forEach(s=>{const i=t.query(s);i&&r.register(i)}),n.forEach(s=>{let i=t.query(s);i||e.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,o+=1,o>yf){e.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},Ye=ie("quill"),cn=new Je;Pt.uiClass="ql-ui";class A{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:cn,theme:"default"};static events=I.events;static sources=I.sources;static version="2.0.3";static imports={delta:R,parchment:zl,"core/module":Ht,"core/theme":er};static debug(t){t===!0&&(t="log"),ie.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Us.get(t)||cn.find(t,e)}static import(t){return this.imports[t]==null&&Ye.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],e=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in t?t.attrName:t.blotName;typeof r=="string"?this.register(`formats/${r}`,t,e):Object.keys(t).forEach(s=>{this.register(s,t[s],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!r&&Ye.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&cn.register(e),typeof e.register=="function"&&e.register(cn)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Af(t,e),this.container=this.options.container,this.container==null){Ye.error("Invalid Quill container",t);return}this.options.debug&&A.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Us.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new I;const s=Qs.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new hf(this.scroll),this.selection=new cf(this.scroll,this.emitter),this.composition=new gf(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(I.events.EDITOR_CHANGE,o=>{o===I.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(I.events.SCROLL_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Bt.call(this,()=>this.editor.update(null,a,p),o)}),this.emitter.on(I.events.SCROLL_EMBED_UPDATE,(o,a)=>{const u=this.selection.lastRange,[h]=this.selection.getRange(),p=u&&h?{oldRange:u,newRange:h}:void 0;Bt.call(this,()=>{const v=new R().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(v,[],p)},A.sources.USER)}),r){const o=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
15
+ `});this.setContents(o)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const r=t;t=document.createElement("div"),t.classList.add(r)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,r){return[t,e,,r]=ee(t,e,r),Bt.call(this,()=>this.editor.deleteText(t,e),r,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I.sources.API;return Bt.call(this,()=>{const s=this.getSelection(!0);let i=new R;if(s==null)return i;if(this.scroll.query(t,M.BLOCK))i=this.editor.formatLine(s.index,s.length,{[t]:e});else{if(s.length===0)return this.selection.format(t,e),i;i=this.editor.formatText(s.index,s.length,{[t]:e})}return this.setSelection(s,I.sources.SILENT),i},r)}formatLine(t,e,r,s,i){let o;return[t,e,o,i]=ee(t,e,r,s,i),Bt.call(this,()=>this.editor.formatLine(t,e,o),i,t,0)}formatText(t,e,r,s,i){let o;return[t,e,o,i]=ee(t,e,r,s,i),Bt.call(this,()=>this.editor.formatText(t,e,o),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof t=="number"?r=this.selection.getBounds(t,e):r=this.selection.getBounds(t.index,t.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,e]=ee(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=ee(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=ee(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A.sources.API;return Bt.call(this,()=>this.editor.insertEmbed(t,e,r),s,t)}insertText(t,e,r,s,i){let o;return[t,,o,i]=ee(t,0,r,s,i),Bt.call(this,()=>this.editor.insertText(t,e,o),i,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,r){return[t,e,,r]=ee(t,e,r),Bt.call(this,()=>this.editor.removeFormat(t,e),r,t)}scrollRectIntoView(t){bf(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange,e=t&&this.selection.getBounds(t.index,t.length);e&&this.scrollRectIntoView(e)}setContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:I.sources.API;return Bt.call(this,()=>{t=new R(t);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,t),o=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(o)},e)}setSelection(t,e,r){t==null?this.selection.setRange(null,e||A.sources.API):([t,e,,r]=ee(t,e,r),this.selection.setRange(new ge(Math.max(0,t),e),r),r!==I.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:I.sources.API;const r=new R().insert(t);return this.setContents(r,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:I.sources.API;return Bt.call(this,()=>(t=new R(t),this.editor.applyDelta(t)),e,!0)}}function Xi(n){return typeof n=="string"?document.querySelector(n):n}function xs(n){return Object.entries(n??{}).reduce((t,e)=>{let[r,s]=e;return{...t,[r]:s===!0?{}:s}},{})}function Yi(n){return Object.fromEntries(Object.entries(n).filter(t=>t[1]!==void 0))}function Af(n,t){const e=Xi(n);if(!e)throw new Error("Invalid Quill container");const s=!t.theme||t.theme===A.DEFAULTS.theme?er:A.import(`themes/${t.theme}`);if(!s)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...o}=A.DEFAULTS,{modules:a,...u}=s.DEFAULTS;let h=xs(t.modules);h!=null&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const p=he({},xs(i),xs(a),h),v={...o,...Yi(u),...Yi(t)};let f=t.registry;return f?t.formats&&Ye.warn('Ignoring "formats" option because "registry" is specified'):f=t.formats?Ef(t.formats,v.registry,Ye):v.registry,{...v,registry:f,container:e,theme:s,modules:Object.entries(p).reduce((m,y)=>{let[N,w]=y;if(!w)return m;const x=A.import(`modules/${N}`);return x==null?(Ye.error(`Cannot load ${N} module. Are you sure you registered it?`),m):{...m,[N]:he({},x.DEFAULTS||{},w)}},{}),bounds:Xi(v.bounds)}}function Bt(n,t,e,r){if(!this.isEnabled()&&t===I.sources.USER&&!this.allowReadOnlyEdits)return new R;let s=e==null?null:this.getSelection();const i=this.editor.delta,o=n();if(s!=null&&(e===!0&&(e=s.index),r==null?s=Qi(s,o,t):r!==0&&(s=Qi(s,e,r,t)),this.setSelection(s,I.sources.SILENT)),o.length()>0){const a=[I.events.TEXT_CHANGE,o,i,t];this.emitter.emit(I.events.EDITOR_CHANGE,...a),t!==I.sources.SILENT&&this.emitter.emit(...a)}return o}function ee(n,t,e,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof t!="number"?(s=r,r=e,e=t,t=n.length,n=n.index):(t=n.length,n=n.index):typeof t!="number"&&(s=r,r=e,e=t,t=0),typeof e=="object"?(i=e,s=r):typeof e=="string"&&(r!=null?i[e]=r:s=e),s=s||I.sources.API,[n,t,i,s]}function Qi(n,t,e,r){const s=typeof e=="number"?e:0;if(n==null)return null;let i,o;return t&&typeof t.transformPosition=="function"?[i,o]=[n.index,n.index+n.length].map(a=>t.transformPosition(a,r!==I.sources.USER)):[i,o]=[n.index,n.index+n.length].map(a=>a<t||a===t&&r===I.sources.USER?a:s>=0?a+s:Math.max(t,a+s)),new ge(i,o-i)}class qe extends Tn{}function Ji(n){return n instanceof gt||n instanceof Ct}function tl(n){return typeof n.updateContent=="function"}class Nf extends Qs{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=gt;static allowedChildren=[gt,Ct,qe];constructor(t,e,r){let{emitter:s}=r;super(t,e),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(I.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(I.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(I.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[r,s]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),i!=null&&r!==i&&s>0){if(r instanceof Ct||i instanceof Ct){this.optimize();return}const o=i.children.head instanceof Ft?null:i.children.head;r.moveChildren(i,o),r.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,r,s){super.formatAt(t,e,r,s),this.optimize()}insertAt(t,e,r){if(t>=this.length())if(r==null||this.scroll.query(e,M.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&e.endsWith(`
16
+ `)?s.insertAt(0,e.slice(0,-1),r):s.insertAt(0,e,r)}else{const s=this.scroll.create(e,r);this.appendChild(s)}else super.insertAt(t,e,r);this.optimize()}insertBefore(t,e){if(t.statics.scope===M.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(t),super.insertBefore(r,e)}else super.insertBefore(t,e)}insertContents(t,e){const r=this.deltaToRenderBlocks(e.concat(new R().insert(`
17
+ `))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const u=i.type==="block"&&(i.delta.length()===0||!this.descendant(Ct,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new R().insert({[i.key]:i.value});Ls(this,t,h);const p=i.type==="block"?1:0,v=t+h.length()+p;u&&this.insertAt(v-1,`
18
+ `);const f=Ot(this.line(t)[0]),m=Nt.AttributeMap.diff(f,i.attributes)||{};Object.keys(m).forEach(y=>{this.formatAt(v-1,1,y,m[y])}),t=v}let[o,a]=this.children.find(t);if(r.length&&(o&&(o=o.split(a),a=0),r.forEach(u=>{if(u.type==="block"){const h=this.createBlock(u.attributes,o||void 0);Ls(h,0,u.delta)}else{const h=this.create(u.key,u.value);this.insertBefore(h,o||void 0),Object.keys(u.attributes).forEach(p=>{h.format(p,u.attributes[p])})}})),s.type==="block"&&s.delta.length()){const u=o?o.offset(o.scroll)+a:this.length();Ls(this,u,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[r,s]=e;return r instanceof vt?[r,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(Ji,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,i,o)=>{let a=[],u=o;return s.children.forEachAt(i,o,(h,p,v)=>{Ji(h)?a.push(h):h instanceof Tn&&(a=a.concat(r(h,p,u))),u-=v}),a};return r(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(I.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let e=I.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!tl(i)}),t.length>0&&this.emitter.emit(I.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(I.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,r){const[s]=this.descendant(i=>i instanceof Ct,t);s&&s.statics.blotName===e&&tl(s)&&s.updateContent(r)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let r=new R;return t.forEach(s=>{const i=s?.insert;if(i)if(typeof i=="string"){const o=i.split(`
19
+ `);o.slice(0,-1).forEach(u=>{r.insert(u,s.attributes),e.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new R});const a=o[o.length-1];a&&r.insert(a,s.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,M.INLINE)?r.push(s):(r.length()&&e.push({type:"block",delta:r,attributes:{}}),r=new R,e.push({type:"blockEmbed",key:o,value:i[o],attributes:s.attributes??{}}))}}),r.length()&&e.push({type:"block",delta:r,attributes:{}}),e}createBlock(t,e){let r;const s={};Object.entries(t).forEach(a=>{let[u,h]=a;this.query(u,M.BLOCK&M.BLOT)!=null?r=u:s[u]=h});const i=this.create(r||this.statics.defaultChild.blotName,r?t[r]:void 0);this.insertBefore(i,e||void 0);const o=i.length();return Object.entries(s).forEach(a=>{let[u,h]=a;i.formatAt(0,o,u,h)}),i}}function Ls(n,t,e){e.reduce((r,s)=>{const i=Nt.Op.length(s);let o=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const a=s.insert;n.insertAt(r,a);const[u]=n.descendant(vt,r),h=Ot(u);o=Nt.AttributeMap.diff(h,o)||{}}else if(typeof s.insert=="object"){const a=Object.keys(s.insert)[0];if(a==null)return r;if(n.insertAt(r,a,s.insert[a]),n.scroll.query(a,M.INLINE)!=null){const[h]=n.descendant(vt,r),p=Ot(h);o=Nt.AttributeMap.diff(p,o)||{}}}}return Object.keys(o).forEach(a=>{n.formatAt(r,i,a,o[a])}),r+i},t)}const ti={scope:M.BLOCK,whitelist:["right","center","justify"]},wf=new Zt("align","align",ti),Yl=new Ut("align","ql-align",ti),Ql=new me("align","text-align",ti);class Jl extends me{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):e}}const Tf=new Ut("color","ql-color",{scope:M.INLINE}),ei=new Jl("color","color",{scope:M.INLINE}),xf=new Ut("background","ql-bg",{scope:M.INLINE}),ri=new Jl("background","background-color",{scope:M.INLINE});class Ce extends qe{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
20
+ `).slice(t,t+e)}html(t,e){return`<pre>
21
+ ${xn(this.code(t,e))}
22
+ </pre>`}}class wt extends gt{static TAB=" ";static register(){A.register(Ce)}}class ni extends At{}ni.blotName="code";ni.tagName="CODE";wt.blotName="code-block";wt.className="ql-code-block";wt.tagName="DIV";Ce.blotName="code-block-container";Ce.className="ql-code-block-container";Ce.tagName="DIV";Ce.allowedChildren=[wt];wt.allowedChildren=[$t,Ft,Dt];wt.requiredContainer=Ce;const si={scope:M.BLOCK,whitelist:["rtl"]},to=new Zt("direction","dir",si),eo=new Ut("direction","ql-direction",si),ro=new me("direction","direction",si),no={scope:M.INLINE,whitelist:["serif","monospace"]},so=new Ut("font","ql-font",no);class Lf extends me{value(t){return super.value(t).replace(/["']/g,"")}}const io=new Lf("font","font-family",no),lo=new Ut("size","ql-size",{scope:M.INLINE,whitelist:["small","large","huge"]}),oo=new me("size","font-size",{scope:M.INLINE,whitelist:["10px","18px","32px"]}),_f=ie("quill:keyboard"),Sf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ln extends Ht{static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!e[r]!==t[r]&&e[r]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=qf(t);if(s==null){_f.warn("Attempted to add invalid keyboard binding",s);return}typeof e=="function"&&(e={handler:e}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(o=>{const a={...s,key:o,...e,...r};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const s=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(x=>Ln.match(t,x));if(s.length===0)return;const i=A.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const o=this.quill.getSelection();if(o==null||!this.quill.hasFocus())return;const[a,u]=this.quill.getLine(o.index),[h,p]=this.quill.getLeaf(o.index),[v,f]=o.length===0?[h,p]:this.quill.getLeaf(o.index+o.length),m=h instanceof mn?h.value().slice(0,p):"",y=v instanceof mn?v.value().slice(f):"",N={collapsed:o.length===0,empty:o.length===0&&a.length()<=1,format:this.quill.getFormat(o),line:a,offset:u,prefix:m,suffix:y,event:t};s.some(x=>{if(x.collapsed!=null&&x.collapsed!==N.collapsed||x.empty!=null&&x.empty!==N.empty||x.offset!=null&&x.offset!==N.offset)return!1;if(Array.isArray(x.format)){if(x.format.every(q=>N.format[q]==null))return!1}else if(typeof x.format=="object"&&!Object.keys(x.format).every(q=>x.format[q]===!0?N.format[q]!=null:x.format[q]===!1?N.format[q]==null:Nn(x.format[q],N.format[q])))return!1;return x.prefix!=null&&!x.prefix.test(N.prefix)||x.suffix!=null&&!x.suffix.test(N.suffix)?!1:x.handler.call(this,o,N,x)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(t.index);let o=new R().retain(t.index-r).delete(r);if(e.offset===0){const[a]=this.quill.getLine(t.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const h=i.formats(),p=this.quill.getFormat(t.index-1,1);if(s=Nt.AttributeMap.diff(h,p)||{},Object.keys(s).length>0){const v=new R().retain(t.index+i.length()-2).retain(1,s);o=o.compose(v)}}}this.quill.updateContents(o,A.sources.USER),this.quill.focus()}handleDelete(t,e){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(t.index);let o=new R().retain(t.index).delete(r);if(e.offset>=i.length()-1){const[a]=this.quill.getLine(t.index+1);if(a){const u=i.formats(),h=this.quill.getFormat(t.index,1);s=Nt.AttributeMap.diff(u,h)||{},Object.keys(s).length>0&&(o=o.retain(a.length()-1).retain(1,s))}}this.quill.updateContents(o,A.sources.USER),this.quill.focus()}handleDeleteRange(t){ii({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const r=Object.keys(e.format).reduce((i,o)=>(this.quill.scroll.query(o,M.BLOCK)&&!Array.isArray(e.format[o])&&(i[o]=e.format[o]),i),{}),s=new R().retain(t.index).delete(t.length).insert(`
23
+ `,r);this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(t.index+1,A.sources.SILENT),this.quill.focus()}}const Of={bindings:{bold:_s("bold"),italic:_s("italic"),underline:_s("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",A.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",A.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,t){t.format.indent!=null?this.quill.format("indent","-1",A.sources.USER):t.format.list!=null&&this.quill.format("list",!1,A.sources.USER)}},"indent code-block":el(!0),"outdent code-block":el(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,A.sources.USER)}},tab:{key:"Tab",handler(n,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new R().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(e,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,A.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,A.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(n.index,n.length,e,A.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[t,e]=this.quill.getLine(n.index),r={...t.formats(),list:"checked"},s=new R().retain(n.index).insert(`
24
+ `,r).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index+1,A.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,t){const[e,r]=this.quill.getLine(n.index),s=new R().retain(n.index).insert(`
25
+ `,t.format).retain(e.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index+1,A.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(n){const t=this.quill.getModule("table");if(t){const[e,r,s,i]=t.getTable(n),o=Cf(e,r,s,i);if(o==null)return;let a=e.offset();if(o<0){const u=new R().retain(a).insert(`
26
+ `);this.quill.updateContents(u,A.sources.USER),this.quill.setSelection(n.index+1,n.length,A.sources.SILENT)}else if(o>0){a+=e.length();const u=new R().retain(a).insert(`
27
+ `);this.quill.updateContents(u,A.sources.USER),this.quill.setSelection(a,A.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,t){const{event:e,line:r}=t,s=r.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(s-1,A.sources.USER):this.quill.setSelection(s+r.length(),A.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[r,s]=this.quill.getLine(n.index);if(s>e)return!0;let i;switch(t.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(n.index," ",A.sources.USER),this.quill.history.cutoff();const o=new R().retain(n.index-s).delete(e+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(o,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-e,A.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[t,e]=this.quill.getLine(n.index);let r=2,s=t;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=new R().retain(n.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,A.sources.USER),this.quill.setSelection(n.index-1,A.sources.SILENT),!1}return!0}},"embed left":un("ArrowLeft",!1),"embed left shift":un("ArrowLeft",!0),"embed right":un("ArrowRight",!1),"embed right shift":un("ArrowRight",!0),"table down":rl(!1),"table up":rl(!0)}};Ln.DEFAULTS=Of;function el(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(t,e){let{event:r}=e;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,A.sources.USER),this.quill.setSelection(t.index+i.length,A.sources.SILENT);return}const o=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:u}=t;o.forEach((h,p)=>{n?(h.insertAt(0,i),p===0?a+=i.length:u+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),p===0?a-=i.length:u-=i.length)}),this.quill.update(A.sources.USER),this.quill.setSelection(a,u,A.sources.SILENT)}}}function un(n,t){return{key:n,shiftKey:t,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof _t?(n==="ArrowLeft"?t?this.quill.setSelection(r.index-1,r.length+1,A.sources.USER):this.quill.setSelection(r.index-1,A.sources.USER):t?this.quill.setSelection(r.index,r.length+1,A.sources.USER):this.quill.setSelection(r.index+r.length+1,A.sources.USER),!1):!0}}}function _s(n){return{key:n[0],shortKey:!0,handler(t,e){this.quill.format(n,!e.format[n],A.sources.USER)}}}function rl(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const r=n?"prev":"next",s=e.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=s;for(;a.prev!=null;)a=a.prev,o=o.next;const u=o.offset(this.quill.scroll)+Math.min(e.offset,o.length()-1);this.quill.setSelection(u,0,A.sources.USER)}}else{const o=s.table()[r];o!=null&&(n?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,A.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function qf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=Ze(n);else return null;return n.shortKey&&(n[Sf]=n.shortKey,delete n.shortKey),n}function ii(n){let{quill:t,range:e}=n;const r=t.getLines(e);let s={};if(r.length>1){const i=r[0].formats(),o=r[r.length-1].formats();s=Nt.AttributeMap.diff(o,i)||{}}t.deleteText(e,A.sources.USER),Object.keys(s).length>0&&t.formatLine(e.index,1,s,A.sources.USER),t.setSelection(e.index,A.sources.SILENT)}function Cf(n,t,e,r){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?r===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const If=/font-weight:\s*normal/,Rf=["P","OL","UL"],nl=n=>n&&Rf.includes(n.tagName),kf=n=>{Array.from(n.querySelectorAll("br")).filter(t=>nl(t.previousElementSibling)&&nl(t.nextElementSibling)).forEach(t=>{t.parentNode?.removeChild(t)})},Bf=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(t=>t.getAttribute("style")?.match(If)).forEach(t=>{const e=n.createDocumentFragment();e.append(...t.childNodes),t.parentNode?.replaceChild(e,t)})};function Mf(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Bf(n),kf(n))}const Df=/\bmso-list:[^;]*ignore/i,jf=/\bmso-list:[^;]*\bl(\d+)/i,Pf=/\bmso-list:[^;]*\blevel(\d+)/i,$f=(n,t)=>{const e=n.getAttribute("style"),r=e?.match(jf);if(!r)return null;const s=Number(r[1]),i=e?.match(Pf),o=i?Number(i[1]):1,a=new RegExp(`@list l${s}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=t.match(a),h=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:o,type:h,element:n}},Uf=n=>{const t=Array.from(n.querySelectorAll("[style*=mso-list]")),e=[],r=[];t.forEach(o=>{(o.getAttribute("style")||"").match(Df)?e.push(o):r.push(o)}),e.forEach(o=>o.parentNode?.removeChild(o));const s=n.documentElement.innerHTML,i=r.map(o=>$f(o,s)).filter(o=>o);for(;i.length;){const o=[];let a=i.shift();for(;a;)o.push(a),a=i.length&&i[0]?.element===a.element.nextElementSibling&&i[0].id===a.id?i.shift():null;const u=document.createElement("ul");o.forEach(v=>{const f=document.createElement("li");f.setAttribute("data-list",v.type),v.indent>1&&f.setAttribute("class",`ql-indent-${v.indent-1}`),f.innerHTML=v.element.innerHTML,u.appendChild(f)});const h=o[0]?.element,{parentNode:p}=h??{};h&&p?.replaceChild(u,h),o.slice(1).forEach(v=>{let{element:f}=v;p?.removeChild(f)})}};function Ff(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Uf(n)}const Hf=[Ff,Mf],zf=n=>{n.documentElement&&Hf.forEach(t=>{t(n)})},Kf=ie("quill:clipboard"),Gf=[[Node.TEXT_NODE,id],[Node.TEXT_NODE,il],["br",Qf],[Node.ELEMENT_NODE,il],[Node.ELEMENT_NODE,Yf],[Node.ELEMENT_NODE,Xf],[Node.ELEMENT_NODE,nd],["li",ed],["ol, ul",rd],["pre",Jf],["tr",sd],["b",Ss("bold")],["i",Ss("italic")],["strike",Ss("strike")],["style",td]],Vf=[wf,to].reduce((n,t)=>(n[t.keyName]=t,n),{}),sl=[Ql,ri,ei,ro,io,oo].reduce((n,t)=>(n[t.keyName]=t,n),{});class Wf extends Ht{static DEFAULTS={matchers:[]};constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Gf.concat(this.options.matchers??[]).forEach(r=>{let[s,i]=r;this.addMatcher(s,i)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:r}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[wt.blotName])return new R().insert(r||"",{[wt.blotName]:s[wt.blotName]});if(!e)return new R().insert(r||"",s);const i=this.convertHTML(e);return Ir(i,`
28
+ `)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new R().retain(i.length()-1).delete(1)):i}normalizeHTML(t){zf(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const r=e.body,s=new WeakMap,[i,o]=this.prepareMatching(r,s);return li(this.quill.scroll,r,i,o,s)}dangerouslyPasteHTML(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof t=="string"){const s=this.convert({html:t,text:""});this.quill.setContents(s,e),this.quill.setSelection(0,A.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents(new R().retain(t).concat(s),r),this.quill.setSelection(t+s.length(),A.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,e);t.clipboardData?.setData("text/plain",i),t.clipboardData?.setData("text/html",s),e&&ii({range:r,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
29
+ `)}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const r=t.clipboardData?.getData("text/html");let s=t.clipboardData?.getData("text/plain");if(!r&&!s){const o=t.clipboardData?.getData("text/uri-list");o&&(s=this.normalizeURIList(o))}const i=Array.from(t.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(e,i);return}if(r&&i.length>0){const o=new DOMParser().parseFromString(r,"text/html");if(o.body.childElementCount===1&&o.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:r,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:r,html:s}=e;const i=this.quill.getFormat(t.index),o=this.convert({text:r,html:s},i);Kf.log("onPaste",o,{text:r,html:s});const a=new R().retain(t.index).delete(t.length).concat(o);this.quill.updateContents(a,A.sources.USER),this.quill.setSelection(a.length()-t.length,A.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const r=[],s=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:s.push(a);break;case Node.ELEMENT_NODE:r.push(a);break;default:Array.from(t.querySelectorAll(o)).forEach(u=>{e.has(u)?e.get(u)?.push(a):e.set(u,[a])});break}}),[r,s]}}function Ie(n,t,e,r){return r.query(t)?n.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[t])return s.push(i);const o=e?{[t]:e}:{};return s.insert(i.insert,{...o,...i.attributes})},new R):n}function Ir(n,t){let e="";for(let r=n.ops.length-1;r>=0&&e.length<t.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;e=s.insert+e}return e.slice(-1*t.length)===t}function ue(n,t){if(!(n instanceof Element))return!1;const e=t.query(n);return e&&e.prototype instanceof _t?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function Zf(n,t){return n.previousElementSibling&&n.nextElementSibling&&!ue(n.previousElementSibling,t)&&!ue(n.nextElementSibling,t)}const hn=new WeakMap;function ao(n){return n==null?!1:(hn.has(n)||(n.tagName==="PRE"?hn.set(n,!0):hn.set(n,ao(n.parentNode))),hn.get(n))}function li(n,t,e,r,s){return t.nodeType===t.TEXT_NODE?r.reduce((i,o)=>o(t,i,n),new R):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,o)=>{let a=li(n,o,e,r,s);return o.nodeType===t.ELEMENT_NODE&&(a=e.reduce((u,h)=>h(o,u,n),a),a=(s.get(o)||[]).reduce((u,h)=>h(o,u,n),a)),i.concat(a)},new R):new R}function Ss(n){return(t,e,r)=>Ie(e,n,!0,r)}function Xf(n,t,e){const r=Zt.keys(n),s=Ut.keys(n),i=me.keys(n),o={};return r.concat(s).concat(i).forEach(a=>{let u=e.query(a,M.ATTRIBUTE);u!=null&&(o[u.attrName]=u.value(n),o[u.attrName])||(u=Vf[a],u!=null&&(u.attrName===a||u.keyName===a)&&(o[u.attrName]=u.value(n)||void 0),u=sl[a],u!=null&&(u.attrName===a||u.keyName===a)&&(u=sl[a],o[u.attrName]=u.value(n)||void 0))}),Object.entries(o).reduce((a,u)=>{let[h,p]=u;return Ie(a,h,p,e)},t)}function Yf(n,t,e){const r=e.query(n);if(r==null)return t;if(r.prototype instanceof _t){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,new R().insert(s,r.formats(n,e))}else if(r.prototype instanceof Sr&&!Ir(t,`
30
+ `)&&t.insert(`
31
+ `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Ie(t,r.blotName,r.formats(n,e),e);return t}function Qf(n,t){return Ir(t,`
32
+ `)||t.insert(`
33
+ `),t}function Jf(n,t,e){const r=e.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,e):!0;return Ie(t,"code-block",s,e)}function td(){return new R}function ed(n,t,e){const r=e.query(n);if(r==null||r.blotName!=="list"||!Ir(t,`
34
+ `))return t;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?t:t.reduce((o,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?o.push(a):o.insert(a.insert,{indent:s,...a.attributes||{}}):o,new R)}function rd(n,t,e){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),Ie(t,"list",s,e)}function il(n,t,e){if(!Ir(t,`
35
+ `)){if(ue(n,e)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return t.insert(`
36
+ `);if(t.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(ue(r,e))return t.insert(`
37
+ `);const s=e.query(r);if(s&&s.prototype instanceof Ct)return t.insert(`
38
+ `);r=r.firstChild}}}return t}function nd(n,t,e){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((i,o)=>{let[a,u]=o;return Ie(i,a,u,e)},t),parseFloat(s.textIndent||0)>0?new R().insert(" ").concat(t):t}function sd(n,t,e){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Ie(t,"table",i,e)}return t}function id(n,t,e){let r=n.data;if(n.parentElement?.tagName==="O:P")return t.insert(r.trim());if(!ao(n)){if(r.trim().length===0&&r.includes(`
39
+ `)&&!Zf(n,e))return t;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&ue(n.parentElement,e)||n.previousSibling instanceof Element&&ue(n.previousSibling,e))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&ue(n.parentElement,e)||n.nextSibling instanceof Element&&ue(n.nextSibling,e))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return t.insert(r)}class ld extends Ht{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(A.events.EDITOR_CHANGE,(r,s,i,o)=>{r===A.events.SELECTION_CHANGE?s&&o!==A.sources.SILENT&&(this.currentRange=s):r===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===A.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=zs(this.currentRange,s))}),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",r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())})}change(t,e){if(this.stack[t].length===0)return;const r=this.stack[t].pop();if(!r)return;const s=this.quill.getContents(),i=r.delta.invert(s);this.stack[e].push({delta:i,range:zs(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,A.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(t.ops.length===0)return;this.stack.redo=[];let r=t.invert(e),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(r=r.compose(o.delta),s=o.range)}else this.lastRecorded=i;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){ll(this.stack.undo,t),ll(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,A.sources.USER);else{const e=ad(this.quill.scroll,t.delta);this.quill.setSelection(e,A.sources.USER)}}}function ll(n,t){let e=t;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:e.transform(s.delta,!0),range:s.range&&zs(s.range,e)},e=s.delta.transform(e),n[r].delta.length()===0&&n.splice(r,1)}}function od(n,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
40
+ `):e.attributes!=null?Object.keys(e.attributes).some(r=>n.query(r,M.BLOCK)!=null):!1}function ad(n,t){const e=t.reduce((s,i)=>s+(i.delete||0),0);let r=t.length()-e;return od(n,t)&&(r-=1),r}function zs(n,t){if(!n)return n;const e=t.transformPosition(n.index),r=t.transformPosition(n.index+n.length);return{index:e,length:r-e}}class co extends Ht{constructor(t,e){super(t,e),t.root.addEventListener("drop",r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const i=s&&t.selection.normalizeNative(s);if(i){const o=t.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(o,r.dataTransfer.files)}})}upload(t,e){const r=[];Array.from(e).forEach(s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)}),r.length>0&&this.options.handler.call(this,t,r)}}co.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,t){if(!this.quill.scroll.query("image"))return;const e=t.map(r=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}));Promise.all(e).then(r=>{const s=r.reduce((i,o)=>i.insert({image:o}),new R().retain(n.index).delete(n.length));this.quill.updateContents(s,I.sources.USER),this.quill.setSelection(n.index+r.length,I.sources.SILENT)})}};const cd=["insertText","insertReplacementText"];class ud extends Ht{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||t.on(A.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){ii({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(e){const r=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new R().retain(t.index).insert(e,r),A.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,A.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!cd.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const r=hd(t);if(r==null)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function hd(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const fd=/Mac/i.test(navigator.platform),dd=100,gd=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||fd&&n.key==="a"&&n.ctrlKey===!0);class pd extends Ht{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:r,event:s}=e;if(!(r instanceof Pt)||!r.uiNode)return!0;const i=getComputedStyle(r.domNode).direction==="rtl";return i&&s.key!=="ArrowRight"||!i&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(s.shiftKey?1:0),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&gd(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+dd,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(e.collapsed!==!0||e.startOffset!==0)return;const r=this.quill.scroll.find(e.startContainer);if(!(r instanceof Pt)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),t.removeAllRanges(),t.addRange(s)}}A.register({"blots/block":gt,"blots/block/embed":Ct,"blots/break":Ft,"blots/container":qe,"blots/cursor":Dt,"blots/embed":Js,"blots/inline":At,"blots/scroll":Nf,"blots/text":$t,"modules/clipboard":Wf,"modules/history":ld,"modules/keyboard":Ln,"modules/uploader":co,"modules/input":ud,"modules/uiNode":pd});class md extends Ut{add(t,e){let r=0;if(e==="+1"||e==="-1"){const s=this.value(t)||0;r=e==="+1"?s+1:s-1}else typeof e=="number"&&(r=e);return r===0?(this.remove(t),!0):super.add(t,r.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}const bd=new md("indent","ql-indent",{scope:M.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class yd extends gt{static blotName="blockquote";static tagName="blockquote"}class vd extends gt{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(t){return this.tagName.indexOf(t.tagName)+1}}class Rr extends qe{}Rr.blotName="list-container";Rr.tagName="OL";class kr extends gt{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(){A.register(Rr)}constructor(t,e){super(t,e);const r=e.ownerDocument.createElement("span"),s=i=>{if(!t.isEnabled())return;const o=this.statics.formats(e,t);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}kr.blotName="list";kr.tagName="LI";Rr.allowedChildren=[kr];kr.requiredContainer=Rr;class oi extends At{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 Ed extends oi{static blotName="italic";static tagName=["EM","I"]}class bn extends At{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 uo(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t!==this.statics.blotName||!e?super.format(t,e):this.domNode.setAttribute("href",this.constructor.sanitize(e))}}function uo(n,t){const e=document.createElement("a");e.href=n;const r=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(r)>-1}class Ad extends At{static blotName="script";static tagName=["SUB","SUP"];static create(t){return t==="super"?document.createElement("sup"):t==="sub"?document.createElement("sub"):super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super"}}class Nd extends oi{static blotName="strike";static tagName=["S","STRIKE"]}class wd extends At{static blotName="underline";static tagName="U"}class Td extends Js{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(t){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return typeof t=="string"&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}const ol=["alt","height","width"];class xd extends _t{static blotName="image";static tagName="IMG";static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return ol.reduce((e,r)=>(t.hasAttribute(r)&&(e[r]=t.getAttribute(r)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return uo(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){ol.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}const al=["height","width"];class Ld extends Ct{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 al.reduce((e,r)=>(t.hasAttribute(r)&&(e[r]=t.getAttribute(r)),e),{})}static sanitize(t){return bn.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){al.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>`}}const Nr=new Ut("code-token","hljs",{scope:M.INLINE});class ne extends At{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(wt.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,r){super(t,e,r),Nr.add(this.domNode,r)}format(t,e){t!==ne.blotName?super.format(t,e):e?Nr.add(this.domNode,e):(Nr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Nr.value(this.domNode)||this.unwrap()}}ne.blotName="code-token";ne.className="ql-token";class qt extends wt{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),ne.blotName,!1),super.replaceWith(t,e)}}class Tr extends Ce{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===qt.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(t,e)}))}formatAt(t,e,r,s){r===qt.blotName&&(this.forceNext=!0),super.formatAt(t,e,r,s)}highlight(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(o=>o!==this.uiNode).map(o=>o.textContent).join(`
41
+ `)}
42
+ `,i=qt.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const o=this.children.reduce((u,h)=>u.concat(Zl(h,!1)),new R),a=t(s,i);o.diff(a).reduce((u,h)=>{let{retain:p,attributes:v}=h;return p?(v&&Object.keys(v).forEach(f=>{[qt.blotName,ne.blotName].includes(f)&&this.formatAt(u,p,f,v[f])}),u+p):u},0)}this.cachedText=s,this.forceNext=!1}}html(t,e){const[r]=this.children.find(t);return`<pre data-language="${r?qt.formats(r.domNode):"plain"}">
43
+ ${xn(this.code(t,e))}
44
+ </pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=qt.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}Tr.allowedChildren=[qt];qt.requiredContainer=Tr;qt.allowedChildren=[ne,Dt,$t,Ft];const _d=(n,t,e)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(e,{language:t}).value}return n.highlight(t,e).value};class ho extends Ht{static register(){A.register(ne,!0),A.register(qt,!0),A.register(Tr,!0)}constructor(t,e){if(super(t,e),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,s)=>{let{key:i}=s;return r[i]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(A.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof Tr))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:i}=r;const o=e.ownerDocument.createElement("option");o.textContent=i,o.setAttribute("value",s),e.appendChild(o)}),e.addEventListener("change",()=>{t.format(qt.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=qt.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(A.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(A.sources.USER);const r=this.quill.getSelection();(t==null?this.quill.scroll.descendants(Tr):[t]).forEach(i=>{i.highlight(this.highlightBlot,e)}),this.quill.update(A.sources.SILENT),r!=null&&this.quill.setSelection(r,A.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(e=this.languages[e]?e:"plain",e==="plain")return xn(t).split(`
45
+ `).reduce((s,i,o)=>(o!==0&&s.insert(`
46
+ `,{[wt.blotName]:e}),s.insert(i)),new R);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(wt.className),r.innerHTML=_d(this.options.hljs,e,t),li(this.quill.scroll,r,[(s,i)=>{const o=Nr.value(s);return o?i.compose(new R().retain(i.length(),{[ne.blotName]:o})):i}],[(s,i)=>s.data.split(`
47
+ `).reduce((o,a,u)=>(u!==0&&o.insert(`
48
+ `,{[wt.blotName]:e}),o.insert(a)),i)],new WeakMap)}}ho.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 jt extends gt{static blotName="table";static tagName="TD";static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",ai()),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===jt.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 Le extends qe{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===r.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const r=e.formats(),s=e.next.formats();if(r.table!==s.table){const i=this.splitAfter(e);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class fe extends qe{static blotName="table-body";static tagName="TBODY"}class yn extends qe{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(Le),e=t.reduce((r,s)=>Math.max(s.children.length,r),0);t.forEach(r=>{new Array(e-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=jt.formats(r.children.head.domNode));const i=this.scroll.create(jt.blotName,s);r.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(fe);e==null||e.children.head==null||e.children.forEach(r=>{const s=r.children.at(t);s?.remove()})}insertColumn(t){const[e]=this.descendant(fe);e==null||e.children.head==null||e.children.forEach(r=>{const s=r.children.at(t),i=jt.formats(r.children.head.domNode),o=this.scroll.create(jt.blotName,i);r.insertBefore(o,s)})}insertRow(t){const[e]=this.descendant(fe);if(e==null||e.children.head==null)return;const r=ai(),s=this.scroll.create(Le.blotName);e.children.head.children.forEach(()=>{const o=this.scroll.create(jt.blotName,r);s.appendChild(o)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}yn.allowedChildren=[fe];fe.requiredContainer=yn;fe.allowedChildren=[Le];Le.requiredContainer=fe;Le.allowedChildren=[jt];jt.requiredContainer=Le;function ai(){return`row-${Math.random().toString(36).slice(2,6)}`}class Sd extends Ht{static register(){A.register(jt),A.register(Le),A.register(fe),A.register(yn)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(yn).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(A.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(A.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(A.sources.USER),this.quill.setSelection(e,A.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,r]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==jt.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,r]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[r,s,i]=this.getTable(e);if(i==null)return;const o=i.cellOffset();r.insertColumn(o+t),this.quill.update(A.sources.USER);let a=s.rowOffset();t===0&&(a+=1),this.quill.setSelection(e.index+a,e.length,A.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[r,s,i]=this.getTable(e);if(i==null)return;const o=s.rowOffset();r.insertRow(o+t),this.quill.update(A.sources.USER),t>0?this.quill.setSelection(e,A.sources.SILENT):this.quill.setSelection(e.index+s.children.length,e.length,A.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const r=this.quill.getSelection();if(r==null)return;const s=new Array(t).fill(0).reduce(i=>{const o=new Array(e).fill(`
49
+ `).join("");return i.insert(o,{table:ai()})},new R().retain(r.index));this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(r.index,A.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(A.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(A.events.TEXT_CHANGE,(r,s,i)=>{i===A.sources.USER&&this.balanceTables()}),!0):!1)})}}const cl=ie("quill:toolbar");class ci extends Ht{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),Od(r,this.options.container),t.container?.parentNode?.insertBefore(r,t.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){cl.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(A.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(s=>s.indexOf("ql-")===0);if(!e)return;if(e=e.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[e]==null&&this.quill.scroll.query(e)==null){cl.warn("ignoring attaching to nonexistent format",e,t);return}const r=t.tagName==="SELECT"?"change":"click";t.addEventListener(r,s=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const a=t.options[t.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),s.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(this.handlers[e]!=null)this.handlers[e].call(this,i);else if(this.quill.scroll.query(e).prototype instanceof _t){if(i=prompt(`Enter ${e}`),!i)return;this.quill.updateContents(new R().retain(o.index).delete(o.length).insert({[e]:i}),A.sources.USER)}else this.quill.format(e,i,A.sources.USER);this.update(o)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(r=>{const[s,i]=r;if(i.tagName==="SELECT"){let o=null;if(t==null)o=null;else if(e[s]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let a=e[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=e[s],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=e[s]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}ci.DEFAULTS={};function ul(n,t,e){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),e!=null?(r.value=e,r.setAttribute("aria-label",`${t}: ${e}`)):r.setAttribute("aria-label",t),n.appendChild(r)}function Od(n,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const r=document.createElement("span");r.classList.add("ql-formats"),e.forEach(s=>{if(typeof s=="string")ul(r,s);else{const i=Object.keys(s)[0],o=s[i];Array.isArray(o)?qd(r,i,o):ul(r,i,o)}}),n.appendChild(r)})}function qd(n,t,e){const r=document.createElement("select");r.classList.add(`ql-${t}`),e.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)}),n.appendChild(r)}ci.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,M.INLINE)!=null&&this.quill.format(e,!1,A.sources.USER)})}else this.quill.removeFormat(n.index,n.length,A.sources.USER)},direction(n){const{align:t}=this.quill.getFormat();n==="rtl"&&t==null?this.quill.format("align","right",A.sources.USER):!n&&t==="right"&&this.quill.format("align",!1,A.sources.USER),this.quill.format("direction",n,A.sources.USER)},indent(n){const t=this.quill.getSelection(),e=this.quill.getFormat(t),r=parseInt(e.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;e.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,A.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,A.sources.USER)},list(n){const t=this.quill.getSelection(),e=this.quill.getFormat(t);n==="check"?e.list==="checked"||e.list==="unchecked"?this.quill.format("list",!1,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",n,A.sources.USER)}}};const Cd='<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>',Id='<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>',Rd='<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>',kd='<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>',Bd='<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>',Md='<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>',Dd='<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>',jd='<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>',hl='<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>',Pd='<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>',$d='<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>',Ud='<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>',Fd='<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>',Hd='<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>',zd='<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>',Kd='<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>',Gd='<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>',Vd='<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>',Wd='<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>',Zd='<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>',Xd='<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>',Yd='<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>',Qd='<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>',Jd='<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>',tg='<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>',eg='<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>',rg='<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>',ng='<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>',sg='<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>',ig='<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>',lg='<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>',og='<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>',ag='<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>',qr={align:{"":Cd,center:Id,right:Rd,justify:kd},background:Bd,blockquote:Md,bold:Dd,clean:jd,code:hl,"code-block":hl,color:Pd,direction:{"":$d,rtl:Ud},formula:Fd,header:{1:Hd,2:zd,3:Kd,4:Gd,5:Vd,6:Wd},italic:Zd,image:Xd,indent:{"+1":Yd,"-1":Qd},link:Jd,list:{bullet:tg,check:eg,ordered:rg},script:{sub:ng,super:sg},strike:ig,table:lg,underline:og,video:ag},cg='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let fl=0;function dl(n,t){n.setAttribute(t,`${n.getAttribute(t)!=="true"}`)}class _n{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),dl(this.label,"aria-expanded"),dl(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item");const r=t.getAttribute("value");return r&&e.setAttribute("data-value",r),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(e,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=cg,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-${fl}`,fl+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const r=this.buildItem(e);t.appendChild(r),e.selected===!0&&this.selectItem(r)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");t!==r&&(r?.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class fo extends _n{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const r=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class go extends _n{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=e[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const r=t||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const ug=n=>{const{overflowY:t}=getComputedStyle(n,null);return t!=="visible"&&t!=="clip"};class po{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,ug(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const e=t.left+t.width/2-this.root.offsetWidth/2,r=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>s.right&&(o=s.right-i.right,this.root.style.left=`${e+o}px`),i.left<s.left&&(o=s.left-i.left,this.root.style.left=`${e+o}px`),i.bottom>s.bottom){const a=i.bottom-i.top,u=t.bottom-t.top+a;this.root.style.top=`${r-u}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const hg=[!1,"center","right","justify"],fg=["#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"],dg=[!1,"serif","monospace"],gg=["1","2","3",!1],pg=["small",!1,"large","huge"];class Br extends er{constructor(t,e){super(t,e);const r=s=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(s.target)||i.close()})};t.emitter.listenDOM("click",document.body,r)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),e[i]!=null))if(i==="direction")r.innerHTML=e[i][""]+e[i].rtl;else if(typeof e[i]=="string")r.innerHTML=e[i];else{const o=r.value||"";o!=null&&e[i][o]&&(r.innerHTML=e[i][o])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&vr(s,hg),typeof e.align=="object"))return new go(s,e.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&vr(s,fg,i==="background"?"#ffffff":"#000000"),new fo(s,e[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?vr(s,dg):s.classList.contains("ql-header")?vr(s,gg):s.classList.contains("ql-size")&&vr(s,pg)),new _n(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(I.events.EDITOR_CHANGE,r)}}Br.DEFAULTS=he({},er.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class mo extends po{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;e!=null?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,I.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,I.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=mg(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const r=e.index+e.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,I.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",I.sources.USER),this.quill.setSelection(r+2,I.sources.USER)}break}}this.textbox.value="",this.hide()}}function mg(n){let t=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:n}function vr(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(r=>{const s=document.createElement("option");r===e?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)})}const bg=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class yg extends mo{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(I.events.EDITOR_CHANGE,(r,s,i,o)=>{if(r===I.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&o===I.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(s.index,s.length);if(a.length===1){const u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=a[a.length-1],h=this.quill.getIndex(u),p=Math.min(u.length()-1,s.index+s.length-h),v=this.quill.getBounds(new ge(h,p));v!=null&&this.position(v)}}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(I.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);e!=null&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",e!==0&&(r.style.marginLeft=`${-1*e-r.offsetWidth/2}px`),e}}class bo extends Br{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=bg),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new yg(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),qr),this.buildPickers(t.container.querySelectorAll("select"),qr))}}bo.DEFAULTS=he({},Br.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const vg=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Eg extends mo{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(this.linkRange!=null){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,I.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(I.events.SELECTION_CHANGE,(t,e,r)=>{if(t!=null){if(t.length===0&&r===I.sources.USER){const[s,i]=this.quill.scroll.descendant(bn,t.index);if(s!=null){this.linkRange=new ge(t.index-i,s.length());const o=bn.formats(s.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const a=this.quill.getBounds(this.linkRange);a!=null&&this.position(a);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class yo extends Br{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=vg),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),qr),this.buildPickers(t.container.querySelectorAll("select"),qr),this.tooltip=new Eg(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,r)=>{t.handlers.link.call(t,!r.format.link)}))}}yo.DEFAULTS=he({},Br.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0&&(e=`mailto:${e}`);const{tooltip:r}=this.quill.theme;r.edit("link",e)}else this.quill.format("link",!1,A.sources.USER)}}}}});A.register({"attributors/attribute/direction":to,"attributors/class/align":Yl,"attributors/class/background":xf,"attributors/class/color":Tf,"attributors/class/direction":eo,"attributors/class/font":so,"attributors/class/size":lo,"attributors/style/align":Ql,"attributors/style/background":ri,"attributors/style/color":ei,"attributors/style/direction":ro,"attributors/style/font":io,"attributors/style/size":oo},!0);A.register({"formats/align":Yl,"formats/direction":eo,"formats/indent":bd,"formats/background":ri,"formats/color":ei,"formats/font":so,"formats/size":lo,"formats/blockquote":yd,"formats/code-block":wt,"formats/header":vd,"formats/list":kr,"formats/bold":oi,"formats/code":ni,"formats/italic":Ed,"formats/link":bn,"formats/script":Ad,"formats/strike":Nd,"formats/underline":wd,"formats/formula":Td,"formats/image":xd,"formats/video":Ld,"modules/syntax":ho,"modules/table":Sd,"modules/toolbar":ci,"themes/bubble":bo,"themes/snow":yo,"ui/icons":qr,"ui/picker":_n,"ui/icon-picker":go,"ui/color-picker":fo,"ui/tooltip":po},!0);const Ag=Object.freeze(Object.defineProperty({__proto__:null,AttributeMap:Nt.AttributeMap,Delta:R,Module:Ht,Op:Nt.Op,OpIterator:Nt.OpIterator,Parchment:zl,Range:ge,default:A},Symbol.toStringTag,{value:"Module"}));exports.Quill=A;exports.isEqual=Nn;exports.quill=Ag;
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'tailwindcss';
2
+
3
+ declare const config: Config;
4
+ export default config;
@@ -0,0 +1,2 @@
1
+ // Auto-generated: Re-export pubfuture theme preset
2
+ export { default } from './pubfuture.preset.js';