@umoteam/editor 1.0.0-beta.1

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 (80) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +102 -0
  3. package/dist/es/icons/file/ai.svg +1 -0
  4. package/dist/es/icons/file/app.svg +1 -0
  5. package/dist/es/icons/file/axure.svg +1 -0
  6. package/dist/es/icons/file/book.svg +1 -0
  7. package/dist/es/icons/file/common.svg +1 -0
  8. package/dist/es/icons/file/css.svg +1 -0
  9. package/dist/es/icons/file/dmg.svg +1 -0
  10. package/dist/es/icons/file/excel.svg +1 -0
  11. package/dist/es/icons/file/exe.svg +1 -0
  12. package/dist/es/icons/file/font.svg +1 -0
  13. package/dist/es/icons/file/html.svg +1 -0
  14. package/dist/es/icons/file/img.svg +1 -0
  15. package/dist/es/icons/file/jar.svg +1 -0
  16. package/dist/es/icons/file/java.svg +1 -0
  17. package/dist/es/icons/file/js.svg +1 -0
  18. package/dist/es/icons/file/json.svg +1 -0
  19. package/dist/es/icons/file/keynote.svg +1 -0
  20. package/dist/es/icons/file/md.svg +1 -0
  21. package/dist/es/icons/file/music.svg +1 -0
  22. package/dist/es/icons/file/numbers.svg +1 -0
  23. package/dist/es/icons/file/pages.svg +1 -0
  24. package/dist/es/icons/file/pdf.svg +1 -0
  25. package/dist/es/icons/file/php.svg +1 -0
  26. package/dist/es/icons/file/pkg.svg +1 -0
  27. package/dist/es/icons/file/ppt.svg +1 -0
  28. package/dist/es/icons/file/psd.svg +1 -0
  29. package/dist/es/icons/file/python.svg +1 -0
  30. package/dist/es/icons/file/sh.svg +1 -0
  31. package/dist/es/icons/file/sketch.svg +1 -0
  32. package/dist/es/icons/file/sql.svg +1 -0
  33. package/dist/es/icons/file/text.svg +1 -0
  34. package/dist/es/icons/file/video.svg +1 -0
  35. package/dist/es/icons/file/vue.svg +1 -0
  36. package/dist/es/icons/file/word.svg +1 -0
  37. package/dist/es/icons/file/xmind.svg +1 -0
  38. package/dist/es/icons/file/zip.svg +1 -0
  39. package/dist/es/style.css +1 -0
  40. package/dist/es/umo-editor.mjs +35300 -0
  41. package/dist/umd/icons/file/ai.svg +1 -0
  42. package/dist/umd/icons/file/app.svg +1 -0
  43. package/dist/umd/icons/file/axure.svg +1 -0
  44. package/dist/umd/icons/file/book.svg +1 -0
  45. package/dist/umd/icons/file/common.svg +1 -0
  46. package/dist/umd/icons/file/css.svg +1 -0
  47. package/dist/umd/icons/file/dmg.svg +1 -0
  48. package/dist/umd/icons/file/excel.svg +1 -0
  49. package/dist/umd/icons/file/exe.svg +1 -0
  50. package/dist/umd/icons/file/font.svg +1 -0
  51. package/dist/umd/icons/file/html.svg +1 -0
  52. package/dist/umd/icons/file/img.svg +1 -0
  53. package/dist/umd/icons/file/jar.svg +1 -0
  54. package/dist/umd/icons/file/java.svg +1 -0
  55. package/dist/umd/icons/file/js.svg +1 -0
  56. package/dist/umd/icons/file/json.svg +1 -0
  57. package/dist/umd/icons/file/keynote.svg +1 -0
  58. package/dist/umd/icons/file/md.svg +1 -0
  59. package/dist/umd/icons/file/music.svg +1 -0
  60. package/dist/umd/icons/file/numbers.svg +1 -0
  61. package/dist/umd/icons/file/pages.svg +1 -0
  62. package/dist/umd/icons/file/pdf.svg +1 -0
  63. package/dist/umd/icons/file/php.svg +1 -0
  64. package/dist/umd/icons/file/pkg.svg +1 -0
  65. package/dist/umd/icons/file/ppt.svg +1 -0
  66. package/dist/umd/icons/file/psd.svg +1 -0
  67. package/dist/umd/icons/file/python.svg +1 -0
  68. package/dist/umd/icons/file/sh.svg +1 -0
  69. package/dist/umd/icons/file/sketch.svg +1 -0
  70. package/dist/umd/icons/file/sql.svg +1 -0
  71. package/dist/umd/icons/file/text.svg +1 -0
  72. package/dist/umd/icons/file/video.svg +1 -0
  73. package/dist/umd/icons/file/vue.svg +1 -0
  74. package/dist/umd/icons/file/word.svg +1 -0
  75. package/dist/umd/icons/file/xmind.svg +1 -0
  76. package/dist/umd/icons/file/zip.svg +1 -0
  77. package/dist/umd/style.css +1 -0
  78. package/dist/umd/umo-editor.js +8 -0
  79. package/dist/umd/umo-editor.js.gz +0 -0
  80. package/package.json +115 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @umodoc/editor 1.0.0-beta.1
3
+ * @license MIT
4
+ * @author [object Object]
5
+ * @see https://umodoc.com
6
+ **/
7
+
8
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("mermaid"),require("jsbarcode"),require("qrcode-svg"),require("@imgly/background-removal"),require("plyr"),require("katex")):"function"==typeof define&&define.amd?define(["exports","vue","mermaid","jsbarcode","qrcode-svg","@imgly/background-removal","plyr","katex"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UmoEditor={},e.Vue,e.mermaid,e.JsBarcode,e.QRCode,e.imglyRemoveBackground,e.Plyr,e.katex)}(this,(function(e,t,n,r,o,i,a,l){"use strict";var s=Object.defineProperty,c=(e,t,n)=>(((e,t,n)=>{t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);if("undefined"!=typeof window){let e=function(){var e=document.body,t=document.getElementById("__svg__icons__dom__");t||((t=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.position="absolute",t.style.width="0",t.style.height="0",t.id="__svg__icons__dom__",t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("xmlns:link","http://www.w3.org/1999/xlink")),t.innerHTML='<symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-align-center"><path d="M1.75 2.25h12.504M4.754 8h6.496m-9.5 5.75h12.504" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-align-distributed"><path d="M1.75 9.834h12.504M1.75 13.75h12.504m0-9.5-2-2m2 2-2 2m2-2H1.8m2-2-2 2m0 0 2 2" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol class="kd-icon kd-icon-align_both_side" id="icon-align-justify"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke-width="1.5"><path d="M1.75 2.25h12.504M1.75 8h12.504M1.75 13.75h12.504" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></svg></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-align-left"><path d="M1.75 2.25h12.504M1.75 8h6.496M1.75 13.75h12.504" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-align-right"><path d="M1.75 2.25h12.504M7.754 8h6.496m-12.5 5.75h12.504" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-arrow-down"><path d="M36 18 24 30 12 18" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-audio"><rect x="16" y="4" width="16" height="28" rx="8" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M10 21v3c0 7.732 6.268 14 14 14s14-6.268 14-14v-3M24 5v6m-8 5h5m6 0h5m-16 6h5m6 0h5" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M24 38v6" stroke="currentColor" stroke-width="3" /><path d="M16 44h16" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-auto-width"><path d="M6 7h36M8 24h32" stroke="currentColor" stroke-width="3" stroke-linecap="round" /><path d="M13.99 30 8 24.005 14 18m20.01 0L40 23.995 34 30" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M6 41h36" stroke="currentColor" stroke-width="3" stroke-linecap="round" /></symbol><symbol viewBox="0 0 24 24" id="icon-background-color"><g stroke="currentColor" stroke-width="2" fill="none" fill-rule="evenodd"><rect x=".5" y=".5" width="23" height="23" rx="3" /><path stroke-linecap="round" stroke-linejoin="round" d="m12.167 5-7.5 14m3-4.384h9M12.167 5l7.5 14" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-barcode"><path d="M16 6H8a2 2 0 0 0-2 2v8m10 26H8a2 2 0 0 1-2-2v-8m26 10h8a2 2 0 0 0 2-2v-8M32 6h8a2 2 0 0 1 2 2v8m-18 0v16m8-16v16M16 16v16" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-bold"><path d="M3.25 7.75h5.5a3 3 0 1 0 0-6h-4a1.5 1.5 0 0 0-1.5 1.5v4.5zm0 0H9.5a3.25 3.25 0 0 1 0 6.5H4.75a1.5 1.5 0 0 1-1.5-1.5v-5z" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-break-marks"><path d="M6 4v40M42 4v40M18 26l-4 4 4 4" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M15 30h13a6 6 0 0 0 0-12H14" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-bullet-list-circle"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4z" /></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-bullet-list-disc"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6z" /></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-bullet-list-square"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M14 27v6H8v-6h6zm0-9v6H8v-6h6zm0-9v6H8V9h6z" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-bullet-list"><path d="M5.734 7.747h8.5m-8.5 5.5h8.5M5.734 2.25h8.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /><path d="M2.25 3.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5zM3.5 7.748a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0zm-1.25 6.748a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5z" fill="var(--umo-primary-color)" fill-rule="evenodd" clip-rule="evenodd" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-chinese-case"><path d="M38 10 10 38M6 6l6 8 6-8M5 14h14M5 20h14m-7-6v12m20.846 0H42v16H22v-5.85" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-clear-cache"><path d="M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M33.542 27c-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7v6m19.084-18v6c-1.274-4.057-5.064-7-9.542-7-4.477 0-8.268 2.943-9.542 7" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-clear-format"><g stroke="currentColor"><path d="m13.83 6.061-3.37-3.37a1.5 1.5 0 0 0-2.121 0L2.223 8.807a1.5 1.5 0 0 0 0 2.122l3.322 3.322h2.218l6.068-6.068a1.5 1.5 0 0 0 0-2.122zm-9.908.569 6.081 6.081" vector-effect="non-scaling-stroke" /><path d="M6 14.25h8.25" stroke-linecap="round" vector-effect="non-scaling-stroke" /></g></symbol><symbol fill="none" viewBox="0 0 24 24" class="t-icon t-icon-close" id="icon-close"><path fill="currentColor" d="M7.05 5.64 12 10.59l4.95-4.95 1.41 1.41L13.41 12l4.95 4.95-1.41 1.41L12 13.41l-4.95 4.95-1.41-1.41L10.59 12 5.64 7.05l1.41-1.41z" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-code-block"><path d="M23 40H7a3 3 0 0 1-3-3V11a3 3 0 0 1 3-3h34a3 3 0 0 1 3 3v14.882" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M4 11a3 3 0 0 1 3-3h34a3 3 0 0 1 3 3v9H4v-9z" stroke="currentColor" stroke-width="3" /><path d="m34 33-4 4 4 4m6-8 4 4-4 4" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><circle r="2" transform="matrix(0 -1 -1 0 10 14)" fill="currentColor" /><circle r="2" transform="matrix(0 -1 -1 0 16 14)" fill="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-code-line-number"><path d="M9 4v9m3 0H6m6 14H6m0-7s3-3 5 0-5 7-5 7m0 7.5s2-3 5-1 0 4.5 0 4.5 3 2.5 0 4.5-5-1-5-1m5-3.5H9M9 4 6 6m15 18h22M21 38h22M21 10h22" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-code-word-wrap"><path d="M6 9h36M6 19h36M6 29h18M6 39h10m8 0h13a5 5 0 0 0 0-10h-5m-8 10 4-4m-4 4 4 4" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-code"><path d="M16 13 4 25.432 16 37m16-24 12 12.432L32 37" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="m28 4-7 40" stroke="currentColor" stroke-width="4" stroke-linecap="round" /></symbol><symbol viewBox="0 0 24 24" id="icon-color"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M12.5 2.5 4 21.5m3.4-6.045h10.2M12.5 2.5l8.5 19" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-copy"><path d="M13 38h28V16H30V4H13v34zM30 4l11 12" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="M7 20v24h21" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="M19 20h4m-4 8h12" stroke="currentColor" stroke-width="4" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-date"><path stroke="currentColor" stroke-width="3" stroke-linejoin="round" d="M4 8h40v36H4z" /><path clip-rule="evenodd" d="M28 20v14h8V20h-8z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M17 4v8m14-8v8m-19 8h8v14h-8m8-7h-6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-diagrams"><path d="M40.99 8.027H12.182C9.455 8.027 4 9.55 4 15.967 4 22.384 9.455 24 12.182 24h23.812C38.72 24 44 25.568 44 31.985c0 6.416-5.279 8.018-8.006 8.018H6.065" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="m8.046 35.993-3.979 4.066L8.046 44M38.043 3.954 42.02 8.02l-3.978 3.941" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-download"><path d="M6 24.008V42h36V24" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="m33 23-9 9-9-9m8.992-17v26" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-edit"><path d="M5.325 43.5h8.485l31.113-31.113-8.486-8.485L5.325 35.015V43.5z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="m27.952 12.387 8.485 8.485" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-embed"><rect x="4" y="8" width="40" height="32" rx="3" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M4 11a3 3 0 0 1 3-3h34a3 3 0 0 1 3 3v9H4v-9z" stroke="currentColor" stroke-width="3" /><circle r="2" transform="matrix(0 -1 -1 0 10 14)" fill="currentColor" /><circle r="2" transform="matrix(0 -1 -1 0 16 14)" fill="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-emoji"><path d="M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M31 18v1m-14-1v1m14 12s-2 4-7 4-7-4-7-4" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-equal-proportion"><path d="M42 7H6a2 2 0 0 0-2 2v30a2 2 0 0 0 2 2h36a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z" stroke="currentColor" stroke-width="4" /><path d="M12 20.58 16 18v12m15-9.42L35 18v12" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="M24 20v1m0 6v1" stroke="currentColor" stroke-width="4" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-exit"><path d="M23.992 6H6v36h18m9-9 9-9-9-9m-17 8.992h26" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-expand-down"><path d="M6 9h36M6 19h36M6 26l18 14 18-14" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-file"><path d="M10 44h28a2 2 0 0 0 2-2V14H30V4H10a2 2 0 0 0-2 2v36a2 2 0 0 0 2 2ZM30 4l10 10M24 21v14M17 28h14" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-font-size-decrease"><path d="m2 13.5 1.422-3.412m0 0 3.301-7.923a.3.3 0 0 1 .554 0l3.301 7.923m-7.156 0h7.156m0 0L12 13.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /><path d="M11.043 2.75h3.173" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="var(--umo-primary-color)" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-font-size-increase"><path d="m2 13.5 1.422-3.412m0 0 3.301-7.923a.3.3 0 0 1 .554 0l3.301 7.923m-7.156 0h7.156m0 0L12 13.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /><path d="M11 2.75h3.476M12.75 4.549V1" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="var(--umo-primary-color)" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-format-paint"><path d="M6.543 3.961s-1.03 1.203-2.494 1.892c-1.006.473-2.181.585-2.734.626-.2.015-.344.21-.277.398.293.82 1.112 2.801 2.658 4.347 2.126 2.126 3.659 2.968 4.142 3.202.1.048.215.03.299-.04.385-.326 1.5-1.278 2.21-1.987.891-.89 2.186-2.447 2.186-2.447m.48.055a.3.3 0 0 1-.425 0L6.325 3.743a.3.3 0 0 1 0-.424l.68-.68a1.5 1.5 0 0 1 2.121 0l1.357 1.356 1.604-2.02a1.629 1.629 0 1 1 2.279 2.295L12.34 5.853l1.353 1.352a1.5 1.5 0 0 1 0 2.121l-.68.68z" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-format"><path stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 24h32v18H8zM4 13h14V6h12v7h14v11H4V13Z" /><path d="M16 32v10" stroke="currentColor" stroke-width="3" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-full-screen-exit"><path d="M33 6v9h9M15 6v9H6M15 42v-9H6M33 42v-9h8.9" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-full-screen"><path d="M33 6h9v9M42 33v9h-9M15 42H6v-9M6 15V6h9" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-hard-break"><path d="M6 9h36M6 19h36M6 29h18M6 39h10m8 0h13a5 5 0 0 0 0-10h-5m-8 10 4-4m-4 4 4 4" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-help"><path d="M24 44a19.937 19.937 0 0 0 14.142-5.858A19.937 19.937 0 0 0 44 24a19.938 19.938 0 0 0-5.858-14.142A19.937 19.937 0 0 0 24 4 19.938 19.938 0 0 0 9.858 9.858 19.938 19.938 0 0 0 4 24a19.937 19.937 0 0 0 5.858 14.142A19.938 19.938 0 0 0 24 44z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M24 28.625v-4a6 6 0 1 0-6-6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path fill-rule="evenodd" clip-rule="evenodd" d="M24 37.625a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z" fill="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-hide-toolbar"><rect x="6" y="6" width="36" height="36" rx="3" stroke="currentColor" stroke-width="2" stroke-linejoin="round" /><path d="M6 16h36M20 32l4-4 4 4M6 10v12M42 10v12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-highlight"><path d="M6 44V25h6v-8h24v8h6v19H6z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="M17 17V8l14-4v13" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-home-page"><path clip-rule="evenodd" d="M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M4 24h40" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path clip-rule="evenodd" d="M24 44c4.418 0 8-8.954 8-20S28.418 4 24 4s-8 8.954-8 20 3.582 20 8 20z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M9.858 10.142A19.937 19.937 0 0 0 24 16a19.937 19.937 0 0 0 14.142-5.858m0 27.716A19.937 19.937 0 0 0 24 32a19.937 19.937 0 0 0-14.142 5.858" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-horizontal-line"><path d="M5 24h38M21 38h6m10 0h6M21 10h6M5 38h6M5 10h6m26 0h6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-html5"><path d="M37.804 5H10.196a2 2 0 0 0-1.991 2.187l2.688 28.666a2 2 0 0 0 1.153 1.63l11.116 5.13a2 2 0 0 0 1.676 0l11.116-5.13a2 2 0 0 0 1.154-1.63l2.687-28.666A2 2 0 0 0 37.804 5z" stroke="currentColor" stroke-width="3" /><path d="M32 12H16l1 9h14l-1 11-6 3-6-3-.5-5" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image-download"><path d="M44 24a2 2 0 1 0-4 0h4zM24 8a2 2 0 1 0 0-4v4zm15 32H9v4h30v-4zM8 39V9H4v30h4zm32-15v15h4V24h-4zM9 8h15V4H9v4zm0 32a1 1 0 0 1-1-1H4a5 5 0 0 0 5 5v-4zm30 4a5 5 0 0 0 5-5h-4a1 1 0 0 1-1 1v4zM8 9a1 1 0 0 1 1-1V4a5 5 0 0 0-5 5h4z" fill="currentColor" /><path d="m6 35 10.693-9.802a2 2 0 0 1 2.653-.044L32 36m-4-5 4.773-4.773a2 2 0 0 1 2.615-.186L42 31M32 13l5 5 5-5m-5-7v12" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image-draggable"><path d="M9.583 27.182C7.867 28.354 7.009 30.293 7.009 33c0 4.06 4.991 11 9.492 11h11.515c4.405 0 7.08-3.85 7.08-6.94V24.6a3.253 3.253 0 0 0-3.243-3.253 3.235 3.235 0 0 0-3.245 3.226v.11" stroke="currentColor" stroke-width="3" stroke-linecap="round" /><path d="M10.981 29.445V7.662a3.217 3.217 0 0 1 6.435 0v15.986" stroke="#333" stroke-width="3" stroke-linecap="round" /><path d="M17.416 24v-4.192a2.804 2.804 0 0 1 5.608 0v4.62" stroke="#333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M23 24.658v-2.85a2.804 2.804 0 0 1 5.608 0v3.195" stroke="#333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M11 8h30" stroke="#333" stroke-width="3" stroke-linecap="round" /><path d="m36 12.5 1.667-1.5L41 8l-3.333-3L36 3.5" stroke="#333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-image-failed"><path d="M480 164.571 580.571 376.87 461.824 512l158.5 193.06-79.25 154.369H73.143V164.57z" opacity=".12" /><path d="m566.857 164.571 99.109 212.444-118.547 134.948 159.16 193.354-79.58 154.112h323.858V164.57z" fill-opacity=".12" /><path d="M182.894 749.714v-85.357L315.209 525.75l157.312 132.206 56.759-63.744 90.917 110.884-22.803 44.617zm658.249 0H683.575l22.985-44.47-132.681-161.207 93.257-105.18 174.062 215.845z" fill-opacity=".12" /><path d="M256 347.429a73.143 73.143 0 1 0 146.286 0 73.143 73.143 0 1 0-146.286 0z" opacity=".12" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image-flip"><path d="M24 6v36" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="m4 34 12-22v22H4zm40 0H32V12l12 22z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image-preview"><path d="M44 24a2 2 0 1 0-4 0h4zM24 8a2 2 0 1 0 0-4v4zm15 32H9v4h30v-4zM8 39V9H4v30h4zm32-15v15h4V24h-4zM9 8h15V4H9v4zm0 32a1 1 0 0 1-1-1H4a5 5 0 0 0 5 5v-4zm30 4a5 5 0 0 0 5-5h-4a1 1 0 0 1-1 1v4zM8 9a1 1 0 0 1 1-1V4a5 5 0 0 0-5 5h4z" fill="currentColor" /><path d="m6 35 10.693-9.802a2 2 0 0 1 2.653-.044L32 36m-4-5 4.773-4.773a2 2 0 0 1 2.615-.186L42 31M30 12h12m-6-6v12" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image-remove-background"><path d="M44 23.994a2 2 0 0 0-4 0h4zm-20-16a2 2 0 1 0 0-4v4zm15 32H9v4h30v-4zm-31-1v-30H4v30h4zm32-15v15h4v-15h-4zm-31-16h15v-4H9v4zm0 32a1 1 0 0 1-1-1H4a5 5 0 0 0 5 5v-4zm30 4a5 5 0 0 0 5-5h-4a1 1 0 0 1-1 1v4zm-31-35a1 1 0 0 1 1-1v-4a5 5 0 0 0-5 5h4z" fill="currentColor" /><path d="m6 35 10.693-9.802a2 2 0 0 1 2.653-.044L32 36m-4-5 4.773-4.773a2 2 0 0 1 2.615-.186L42 31M33 7l8 8m0-8-8 8" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image-reset"><path d="M11.272 36.728A17.943 17.943 0 0 0 24 42c9.941 0 18-8.059 18-18S33.941 6 24 6c-4.97 0-9.47 2.015-12.728 5.272C9.614 12.93 6 17 6 17" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="M6 9v8h8" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image-rotate"><path d="M12 24h30v18H12V24z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="M6 8v9h9" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M38.475 13.299C35.195 8.87 29.933 6 24 6c-5.821 0-10.997 2.763-14.287 7.05L6 17" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-image"><path clip-rule="evenodd" d="M5 10a2 2 0 0 1 2-2h34a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V10z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path clip-rule="evenodd" d="M14.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="m15 24 5 4 6-7 17 13v4a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-4l10-10z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-indent"><path d="M1.75 2.25h12.504M1.75 8h7.496M1.75 13.75h12.504" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /><path d="m12.25 6 1.993 1.993a.01.01 0 0 1 0 .014L12.25 10" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="var(--umo-primary-color)" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-italic"><path d="M7.75 1.75h5.5M10.5 2l-5 12m-2.75.25h5.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-laser-pointer"><g clip-path="url(#icon-laser-pointer_a)"><rect x="35.193" y="5.322" width="12" height="38" rx="6" transform="rotate(45 35.193 5.322)" stroke="currentColor" stroke-width="3" /><path d="m18 23 8 8M6 43l6-6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><rect x="33.268" y="12.34" width="4" height="4" rx="2" transform="rotate(30 33.268 12.34)" fill="currentColor" /></g><defs><clipPath id="icon-laser-pointer_a"><path fill="currentColor" d="M0 0h48v48H0z" /></clipPath></defs></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-line-height"><path d="m1.75 3.806 2-2.056 2 2.056m-2 10.144-2-2.056m2 2.056 2-2.056m-2 2.056.012-12.187" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="var(--umo-primary-color)" /><path d="M8.754 13.75h5.5m-5.5-4h5.5m-5.5-4h5.5m-5.504-4h5.504" vector-effect="non-scaling-stroke" stroke="currentColor" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-line-number"><path d="M9 4v9m3 0H6m6 14H6m0-7s3-3 5 0-5 7-5 7m0 7.5s2-3 5-1 0 4.5 0 4.5 3 2.5 0 4.5-5-1-5-1m5-3.5H9M9 4 6 6m15 18h22M21 38h22M21 10h22" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-link"><path d="m26.24 16.373-9.14-9.14c-2.661-2.661-7.035-2.603-9.768.131-2.734 2.734-2.793 7.107-.131 9.768l7.935 7.936m17.767-2.065 7.935 7.935c2.661 2.662 2.603 7.035-.13 9.769-2.735 2.734-7.108 2.792-9.77.13l-9.14-9.14m4.312-5.555c2.733-2.734 2.792-7.108.13-9.769m-4.441 5.425c-2.734 2.734-2.792 7.108-.131 9.769" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-loading"><path d="M4 24c0 11.046 8.954 20 20 20s20-8.954 20-20S35.046 4 24 4" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol class="icon" viewBox="0 0 1024 1024" id="icon-markdown"><path stroke="currentColor" d="M896 192a64 64 0 0 1 64 64v512a64 64 0 0 1-64 64H128a64 64 0 0 1-64-64V256a64 64 0 0 1 64-64h768zm-768-64A128 128 0 0 0 0 256v512a128 128 0 0 0 128 128h768a128 128 0 0 0 128-128V256a128 128 0 0 0-128-128H128z" data-spm-anchor-id="a313x.search_index.0.i1.3d203a817x9KY2" /><path stroke="currentColor" d="M585.344 521.344a32 32 0 0 1 45.312 0L736 626.752l105.344-105.408a32.064 32.064 0 0 1 45.312 45.312l-128 128a31.872 31.872 0 0 1-45.312 0l-128-128a32 32 0 0 1 0-45.312z" /><path stroke="currentColor" d="M736 320a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V352a32 32 0 0 1 32-32zM227.84 704V448.64h3.584l91.392 207.296h49.536l90.88-207.36h3.584V704h68.672V320.064h-76.8L349.248 569.28h-2.496l-109.44-249.216H160V704h67.84z" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-mathematics"><path d="m40 9-3-3H8l18 18L8 42h29l3-3" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-menu"><path d="M7.95 11.95h32m-32 12h32m-32 12h32" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-mermaid"><path d="M41 14 24 4 7 14v20l17 10 17-10V14z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M16 18.998 23.993 24l8.002-5.002M24 24v9" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-message"><path d="M43 5 29.7 43l-7.6-17.1L5 18.3 43 5z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M43 5 22.1 25.9" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-mind-map"><path d="M8 28a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM42 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M32 6H20v36h12M12 24h20" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-minus"><path d="M10.5 24h28" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-node-delete"><path d="M9 10v34h30V10H9z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="M20 20v13m8-13v13M4 10h40" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="m16 10 3.289-6h9.488L32 10H16z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-ordered-list-decimal-leading-zero"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M5.714 15.11c.624 0 1.11-.22 1.46-.66.421-.533.632-1.408.632-2.627 0-1.222-.21-2.096-.629-2.624-.351-.445-.839-.668-1.463-.668-.624 0-1.11.22-1.459.66-.422.533-.633 1.406-.633 2.619 0 1.236.192 2.095.576 2.577.384.482.89.723 1.516.723zm0-1.024a.614.614 0 0 1-.398-.14c-.115-.094-.211-.283-.287-.565-.077-.283-.115-.802-.115-1.558s.043-1.294.128-1.613c.064-.246.155-.417.272-.512a.617.617 0 0 1 .4-.143.61.61 0 0 1 .398.143c.116.095.211.284.288.567.076.283.114.802.114 1.558s-.043 1.292-.128 1.608c-.064.246-.155.417-.272.512a.617.617 0 0 1-.4.143zm6.078.914V8.531H10.79c-.14.393-.4.736-.778 1.03-.378.295-.728.495-1.05.6v1.121a4.257 4.257 0 0 0 1.595-.936V15h1.235zm3.344 0v-1.235h-1.235V15h1.235zm-9.422 9.11c.624 0 1.11-.22 1.46-.66.421-.533.632-1.408.632-2.627 0-1.222-.21-2.096-.629-2.624-.351-.445-.839-.668-1.463-.668-.624 0-1.11.22-1.459.66-.422.533-.633 1.406-.633 2.619 0 1.236.192 2.095.576 2.577.384.482.89.723 1.516.723zm0-1.024a.614.614 0 0 1-.398-.14c-.115-.094-.211-.283-.287-.565-.077-.283-.115-.802-.115-1.558s.043-1.294.128-1.613c.064-.246.155-.417.272-.512a.617.617 0 0 1 .4-.143.61.61 0 0 1 .398.143c.116.095.211.284.288.567.076.283.114.802.114 1.558s-.043 1.292-.128 1.608c-.064.246-.155.417-.272.512a.617.617 0 0 1-.4.143zm7.088.914v-1.147H10.35c.065-.111.149-.226.253-.343.104-.117.35-.354.74-.712.39-.357.66-.631.81-.821.225-.288.39-.562.493-.824.104-.263.156-.539.156-.829 0-.51-.181-.936-.544-1.279-.364-.342-.863-.514-1.499-.514-.58 0-1.063.148-1.45.444-.387.296-.617.784-.69 1.463l1.23.124c.024-.36.112-.619.264-.774.152-.155.357-.233.615-.233.261 0 .465.074.613.222.148.148.222.36.222.635 0 .25-.085.501-.255.756-.126.185-.467.536-1.024 1.055-.691.641-1.154 1.156-1.388 1.544-.235.389-.375.8-.422 1.233h4.328zm2.334 0v-1.235h-1.235V24h1.235zM5.714 34.11c.624 0 1.11-.22 1.46-.66.421-.533.632-1.408.632-2.627 0-1.222-.21-2.096-.629-2.624-.351-.445-.839-.668-1.463-.668-.624 0-1.11.22-1.459.66-.422.533-.633 1.406-.633 2.619 0 1.236.192 2.095.576 2.577.384.482.89.723 1.516.723zm0-1.024a.614.614 0 0 1-.398-.14c-.115-.094-.211-.283-.287-.565-.077-.283-.115-.802-.115-1.558s.043-1.294.128-1.613c.064-.246.155-.417.272-.512a.617.617 0 0 1 .4-.143.61.61 0 0 1 .398.143c.116.095.211.284.288.567.076.283.114.802.114 1.558s-.043 1.292-.128 1.608c-.064.246-.155.417-.272.512a.617.617 0 0 1-.4.143zm4.992 1.024c.616 0 1.13-.2 1.543-.598.413-.398.62-.88.62-1.446 0-.39-.111-.722-.332-.997a1.5 1.5 0 0 0-.886-.532c.618-.337.927-.788.927-1.353 0-.399-.15-.756-.452-1.073-.366-.386-.853-.58-1.46-.58a2.25 2.25 0 0 0-.96.2 1.617 1.617 0 0 0-.667.55c-.16.232-.28.544-.359.933l1.139.194c.032-.282.123-.495.272-.642.15-.146.33-.22.54-.22.214 0 .386.065.515.194s.193.302.193.518c0 .255-.088.46-.264.613-.175.154-.43.227-.764.218l-.136 1.006c.22-.061.408-.092.566-.092.24 0 .444.09.611.272.167.182.25.428.25.739 0 .328-.086.589-.26.782a.833.833 0 0 1-.644.29.841.841 0 0 1-.607-.242c-.167-.16-.27-.394-.308-.698l-1.195.145c.062.542.284.98.668 1.316.384.335.867.503 1.45.503zm4.43-.11v-1.235h-1.235V34h1.235z" /></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-ordered-list-decimal"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M10.29 15V8.531H9.286c-.14.393-.4.736-.778 1.03-.378.295-.728.495-1.05.6v1.121a4.257 4.257 0 0 0 1.595-.936V15h1.235zm3.343 0v-1.235h-1.235V15h1.235zM11.3 24v-1.147H8.848c.064-.111.148-.226.252-.343.104-.117.351-.354.74-.712.39-.357.66-.631.81-.821.225-.288.39-.562.494-.824.104-.263.156-.539.156-.829 0-.51-.182-.936-.545-1.279-.363-.342-.863-.514-1.499-.514-.58 0-1.063.148-1.45.444-.387.296-.617.784-.69 1.463l1.23.124c.024-.36.112-.619.264-.774.153-.155.358-.233.616-.233.26 0 .465.074.613.222.148.148.222.36.222.635 0 .25-.085.501-.255.756-.126.185-.468.536-1.024 1.055-.692.641-1.155 1.156-1.389 1.544-.234.389-.375.8-.422 1.233H11.3zm2.333 0v-1.235h-1.235V24h1.235zM9.204 34.11c.615 0 1.129-.2 1.542-.598.413-.398.62-.88.62-1.446 0-.39-.11-.722-.332-.997a1.5 1.5 0 0 0-.886-.532c.619-.337.928-.788.928-1.353 0-.399-.151-.756-.453-1.073-.366-.386-.852-.58-1.459-.58a2.25 2.25 0 0 0-.96.2 1.617 1.617 0 0 0-.668.55c-.16.232-.28.544-.358.933l1.138.194c.032-.282.123-.495.272-.642.15-.146.33-.22.54-.22.215 0 .386.065.515.194s.193.302.193.518c0 .255-.087.46-.263.613-.176.154-.43.227-.765.218l-.136 1.006c.22-.061.409-.092.567-.092.24 0 .444.09.61.272.168.182.251.428.251.739 0 .328-.087.589-.261.782a.833.833 0 0 1-.644.29.841.841 0 0 1-.607-.242c-.167-.16-.27-.394-.307-.698l-1.196.145c.062.542.285.98.668 1.316.384.335.868.503 1.45.503zm4.43-.11v-1.235h-1.236V34h1.235z" /></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-ordered-list-lower-latin"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M9.62 14.105c.272 0 .528-.05.768-.153s.466-.257.677-.462c.009.024.023.072.044.145.047.161.086.283.119.365h1.221a2.649 2.649 0 0 1-.222-.626c-.04-.195-.059-.498-.059-.908l.013-1.441c0-.536-.055-.905-.165-1.105-.11-.201-.3-.367-.569-.497-.27-.13-.68-.195-1.23-.195-.607 0-1.064.108-1.371.325-.308.217-.525.55-.65 1.002l1.12.202c.076-.217.176-.369.299-.455.123-.086.294-.13.514-.13.325 0 .546.05.663.152.118.101.176.27.176.508v.123c-.222.093-.622.194-1.2.303-.427.082-.755.178-.982.288-.227.11-.403.268-.53.474a1.327 1.327 0 0 0-.188.706c0 .398.138.728.415.988.277.261.656.391 1.136.391zm.368-.87a.675.675 0 0 1-.492-.189.606.606 0 0 1-.193-.448c0-.176.08-.32.241-.435.106-.07.33-.142.673-.215a7.19 7.19 0 0 0 .751-.19v.247c0 .296-.016.496-.048.602a.773.773 0 0 1-.295.409 1.07 1.07 0 0 1-.637.22zm4.645.765v-1.235h-1.235V14h1.235zM10.2 25.105c.542 0 1.003-.215 1.382-.646.38-.43.57-1.044.57-1.84 0-.771-.187-1.362-.559-1.774a1.82 1.82 0 0 0-1.41-.617c-.522 0-.973.216-1.354.65v-2.32H7.594V25h1.147v-.686a1.9 1.9 0 0 0 .67.592c.26.133.523.2.79.2zm-.299-.975c-.354 0-.638-.164-.852-.492-.153-.232-.229-.59-.229-1.073 0-.468.098-.818.295-1.048a.93.93 0 0 1 .738-.345c.302 0 .55.118.743.354.193.236.29.62.29 1.154 0 .5-.096.868-.288 1.1-.192.233-.424.35-.697.35zm4.478.87v-1.235h-1.234V25h1.234zm-4.017 9.105c.6 0 1.08-.142 1.437-.426.357-.284.599-.704.725-1.261l-1.213-.207c-.061.326-.167.555-.316.688a.832.832 0 0 1-.576.2.916.916 0 0 1-.75-.343c-.185-.228-.278-.62-.278-1.173 0-.498.091-.853.274-1.066.183-.212.429-.318.736-.318.232 0 .42.061.565.184.145.123.238.306.28.55l1.216-.22c-.146-.501-.387-.874-.722-1.119-.336-.244-.788-.366-1.356-.366-.695 0-1.245.214-1.653.643-.407.43-.61 1.03-.61 1.8 0 .762.202 1.358.608 1.788.406.431.95.646 1.633.646zM14.633 34v-1.235h-1.235V34h1.235z" /></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-ordered-list-lower-roman"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M11.88 8.7V7.558h-1.234V8.7h1.234zm0 5.3V9.333h-1.234V14h1.234zm2.5 0v-1.235h-1.234V14h1.235zm-4.75 4.7v-1.142H8.395V18.7H9.63zm0 5.3v-4.667H8.395V24H9.63zm2.5-5.3v-1.142h-1.234V18.7h1.235zm0 5.3v-4.667h-1.234V24h1.235zm2.501 0v-1.235h-1.235V24h1.235zM7.38 28.7v-1.142H6.145V28.7H7.38zm0 5.3v-4.667H6.145V34H7.38zm2.5-5.3v-1.142H8.646V28.7H9.88zm0 5.3v-4.667H8.646V34H9.88zm2.5-5.3v-1.142h-1.234V28.7h1.235zm0 5.3v-4.667h-1.234V34h1.235zm2.501 0v-1.235h-1.235V34h1.235z" /></symbol><symbol viewBox="0 0 44 44" id="icon-ordered-list-simp-chinese-formal"><g fill="none" fill-rule="evenodd"><path d="M36 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H19a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H19a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H19a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" fill="#000" fill-rule="nonzero" /><path d="M0 0h44v44H0z" /><path d="M9.648 11.728v.624h4.704v-.624H9.648zm-.136.968v1.712h.816l.216.512H8.432v.696h7.128v-.696h-2.136l.248-.512h.816v-1.712H9.512zm1.872 2.224-.216-.512h1.624l-.248.512h-1.16zm2.28-1.136h-3.328v-.48h3.328v.48zM8.696 8.816v.672H11.6v.328H9.2v.64h5.712v-.64H12.4v-.328h2.928v-.672H12.4v-.4h-.8v.4H8.696zm6.712 1.936H8.584v1.28h.768v-.624h5.288v.624h.768v-1.28zM8.36 18.16v.752h4.624c.032 1.232.128 2.312.272 3.232.264 1.728.712 2.608 1.344 2.64.48 0 .848-.624 1.112-1.856l-.696-.392c-.168.856-.304 1.288-.416 1.288-.128-.008-.288-.44-.48-1.288-.184-.912-.296-2.12-.336-3.624h1.808v-.752h-.44a4.676 4.676 0 0 0-.392-.776l-.72.264c.12.16.232.328.328.512h-.6c-.008-.248-.008-.504-.008-.776h-.8c0 .256 0 .512.008.776H8.36zm.72 1.032v.608h3.256v-.608H9.08zm-.448.888v.624h4.128v-.624H8.632zm3.936.936H8.832v2.424h.824v-1.784h2.088v1.72h.824v-2.36zm-1.264 2.336-.472.584c.64.288 1.16.608 1.576.96l.544-.656a9.288 9.288 0 0 0-1.648-.888zm-1.016-1.408v.464c-.032.456-.168.824-.424 1.112-.256.256-.744.48-1.48.656l.44.696c.784-.2 1.344-.488 1.696-.856.368-.4.568-.936.6-1.608v-.464h-.832zm-.128 8.736v.384h3.688v-.44a7.26 7.26 0 0 0 1.536.824l.352-.736c-.896-.28-1.576-.656-2.04-1.12h1.792v-.752h-3.576c.096-.176.176-.36.24-.552.592-.032 1.16-.056 1.712-.088.168.176.32.344.456.512l.688-.48c-.4-.448-.968-.968-1.704-1.576l-.632.4c.192.168.376.336.552.504-.824.04-1.664.072-2.528.104.432-.288.864-.624 1.288-1.008l-.8-.272c-.832.832-1.472 1.264-1.912 1.312l.136.68c.648-.016 1.272-.04 1.88-.056-.072.176-.16.352-.264.52H8.512v.752h1.872c-.52.464-1.232.84-2.128 1.12l.376.744a8.521 8.521 0 0 0 1.528-.776zm1.256-1.088H12.8c.192.264.424.512.696.752h-2.864c.296-.232.56-.48.784-.752zm-1.68 1.96v.728h4.52v-.728h-4.52zM8.848 32.8v.768h6.296V32.8H8.848z" fill="#000" fill-rule="nonzero" /></g></symbol><symbol viewBox="0 0 44 44" id="icon-ordered-list-trad-chinese-informal"><g fill="none" fill-rule="evenodd"><path d="M36 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H19a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H19a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H19a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" fill="#000" fill-rule="nonzero" /><path d="M15.416 12.416H8.584v-.88h6.832zm-.296 6.992H8.864v-.888h6.256v.888zm.448 4.704H8.432v-.888h7.136v.888zm-.384 3.944h-6.4v-.848h6.4v.848zm.384 5.584H8.416v-.84h7.152v.84zm-.72-2.912H9.192v-.848h5.656v.848z" fill="#000" fill-rule="nonzero" /><path d="M0 0h44v44H0z" /></g></symbol><symbol class="ck ck-icon ck-reset_all-excluded ck-icon_inherit-color ck-button__icon" viewBox="0 0 44 44" id="icon-ordered-list-upper-latin"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="m7.88 15 .532-1.463h2.575L11.549 15h1.415l-2.58-6.442H9.01L6.5 15h1.38zm2.69-2.549H8.811l.87-2.39.887 2.39zM14.88 15v-1.235h-1.234V15h1.234zM9.352 25c.83-.006 1.352-.02 1.569-.044.346-.038.636-.14.872-.305.236-.166.422-.387.558-.664.137-.277.205-.562.205-.855 0-.372-.106-.695-.317-.97-.21-.276-.512-.471-.905-.585a1.51 1.51 0 0 0 .661-.567 1.5 1.5 0 0 0 .244-.83c0-.28-.066-.53-.197-.754a1.654 1.654 0 0 0-.495-.539 1.676 1.676 0 0 0-.672-.266c-.25-.042-.63-.063-1.14-.063H7.158V25h2.193zm.142-3.88H8.46v-1.49h.747c.612 0 .983.007 1.112.022.217.026.38.102.49.226.11.125.165.287.165.486a.68.68 0 0 1-.192.503.86.86 0 0 1-.525.23 11.47 11.47 0 0 1-.944.023h.18zm.17 2.795H8.46v-1.723h1.05c.592 0 .977.03 1.154.092.177.062.313.16.406.295a.84.84 0 0 1 .14.492c0 .228-.06.41-.181.547a.806.806 0 0 1-.473.257c-.126.026-.423.04-.892.04zM14.88 25v-1.235h-1.234V25h1.234zm-5.018 9.11c.691 0 1.262-.17 1.711-.512.45-.341.772-.864.965-1.567l-1.261-.4c-.109.472-.287.818-.536 1.037-.25.22-.547.33-.892.33-.47 0-.85-.173-1.143-.519-.293-.345-.44-.925-.44-1.74 0-.767.15-1.322.447-1.665.297-.343.684-.514 1.162-.514.346 0 .64.096.881.29.242.193.4.457.477.79l1.288-.307c-.147-.516-.367-.911-.66-1.187-.492-.465-1.132-.698-1.92-.698-.902 0-1.63.296-2.184.89-.554.593-.83 1.426-.83 2.498 0 1.014.275 1.813.825 2.397.551.585 1.254.877 2.11.877zM14.88 34v-1.235h-1.234V34h1.234z" /></symbol><symbol viewBox="0 0 44 44" id="icon-ordered-list-upper-roman"><path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163" /><path d="M11.916 15V8.558h-1.301V15h1.3zm2.465 0v-1.235h-1.235V15h1.235zM9.665 25v-6.442h-1.3V25h1.3zm2.5 0v-6.442h-1.3V25h1.3zm2.466 0v-1.235h-1.235V25h1.235zm-7.216 9v-6.442h-1.3V34h1.3zm2.5 0v-6.442h-1.3V34h1.3zm2.501 0v-6.442h-1.3V34h1.3zm2.465 0v-1.235h-1.235V34h1.235z" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-ordered-list"><path d="M7.734 7.747h6.5m-6.5 5.5h6.5M7.734 2.25h6.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /><path d="M2.75 6.113V2.127l-.817.802a.546.546 0 0 1-.778-.011.56.56 0 0 1 .012-.786L2.407.914C2.948.384 3.85.77 3.85 1.53v4.583a.553.553 0 0 1-.55.556.553.553 0 0 1-.55-.556zm-.267 2.879c.409-.322.904-.322 1.312 0 .383.301.493.87.204 1.277a4.4 4.4 0 0 1-.23.29c-.197.23-.456.508-.744.803a56.575 56.575 0 0 1-1.709 1.66c-.557.521-.181 1.447.588 1.447H4.64c.304 0 .55-.242.55-.54a.545.545 0 0 0-.55-.542H2.517a49.34 49.34 0 0 0 1.3-1.275c.297-.303.575-.6.795-.858.109-.128.208-.252.289-.366.075-.105.157-.233.205-.363.318-.857.158-1.761-.623-2.377a2.125 2.125 0 0 0-2.688 0c-.594.469-.692 1.098-.706 1.484a.545.545 0 0 0 .53.56.546.546 0 0 0 .569-.521c.01-.26.068-.5.295-.68z" fill="var(--umo-primary-color)" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-outdent"><path d="M1.75 2.25h12.504M6.754 8h7.496m-12.5 5.75h12.504" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /><path d="M3.75 6 1.757 7.993a.01.01 0 0 0 0 .014L3.75 10" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="var(--umo-primary-color)" /></symbol><symbol viewBox="0 0 24 24" id="icon-page-background"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><rect stroke="currentColor" stroke-width="1.5" x="3.5" y="1.5" width="17" height="21" rx="1" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-page-break"><path d="M8 6v6h32V6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M14 24h20" stroke="currentColor" stroke-width="3" stroke-linecap="round" /><path d="M8 42v-6h32v6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 24 24" id="icon-page-footer"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><rect stroke="currentColor" stroke-width="1.5" x="3.5" y="1.5" width="17" height="21" rx="1" /><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M3.5 18.5h17" /></g></symbol><symbol viewBox="0 0 24 24" id="icon-page-header"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><rect stroke="currentColor" x="3.5" stroke-width="1.5" y="1.5" width="17" height="21" rx="1" /><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M3.5 5.5h17" /></g></symbol><symbol viewBox="0 0 24 24" id="icon-page-margin"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><rect stroke="currentColor" x="3.5" y="1.5" stroke-width="1.5" width="17" height="21" rx="1" /><path d="M3.5 4.5h17m-14 18v-21m11 21v-21m-14 18h17" stroke="currentColor" opacity=".3" stroke-linecap="round" stroke-linejoin="round" /></g></symbol><symbol viewBox="0 0 24 24" id="icon-page-orientation"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><rect stroke="currentColor" x="1" y="2.5" stroke-width="1.5" width="13" height="18" rx="1" /><rect stroke="currentColor" transform="rotate(90 15.5 17.5)" x="10" y="10" stroke-width="1.5" width="11" height="15" rx="1" /></g></symbol><symbol viewBox="0 0 24 24" id="icon-page-size"><g fill="none" fill-rule="evenodd" stroke-width="1.5"><path d="M0 0h24v24H0z" /><path d="M4.5 2.5h11a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-14a1 1 0 0 1 1-1z" stroke="currentColor" /><path d="m15 20.5 1.5 1.5-1.5 1.5m-10-3L3.5 22 5 23.5M3.5 22h12m6-5L20 18.5 18.5 17m3-13L20 2.5 18.5 4M20 2.5V18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-page"><path d="M10 44h28a2 2 0 0 0 2-2V14H30V4H10a2 2 0 0 0-2 2v36a2 2 0 0 0 2 2zM30 4l10 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-palette-color"><path d="M24 44c5.96 0 2.336-8.864 6-13 3.126-3.53 14-1.914 14-7 0-11.046-8.954-20-20-20S4 12.954 4 24s8.954 20 20 20z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="M28 17a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-12 4a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm1 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-pdf"><path d="M10 4h20l10 10v28a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path clip-rule="evenodd" d="M18 18h12v7.992L18.008 26 18 18z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M18 18v16" stroke="currentColor" stroke-width="3" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-plus"><path d="m24.06 10-.036 28M10 24h28" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-preview"><path d="M12 35.014H4V8.013a2 2 0 0 1 2-2h36a2 2 0 0 1 2 2v27h-8" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M24 32 14 42h20L24 32Z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-print"><path d="M37 32H11v12h26V32z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path clip-rule="evenodd" d="M4 20h40v18h-6.983v-6H10.98v6H4V20z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M38 4H10v16h28V4z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-qrcode"><path stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M32 6h10v10H32zm0 26h10v10H32zM6 32h10v10H6zM6 6h10v10H6zm2 18h22m8 0h2M24 37v2m0-22v14m0-23v2" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-quote"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.853 9.116C11.323 13.952 7.14 19.58 6.303 26.003 5 36 13.94 40.893 18.47 36.497 23 32.1 20.285 26.52 17.005 24.994c-3.28-1.525-5.286-.994-4.936-3.033.35-2.038 5.016-7.69 9.116-10.322a.749.749 0 0 0 .114-1.02L20.285 9.3c-.44-.572-.862-.55-1.432-.185zm19.826 0c-7.53 4.836-11.714 10.465-12.55 16.887-1.303 9.997 7.637 14.89 12.167 10.494 4.53-4.397 1.815-9.977-1.466-11.503-3.28-1.525-5.286-.994-4.936-3.033.35-2.038 5.017-7.69 9.117-10.322a.749.749 0 0 0 .113-1.02L40.11 9.3c-.44-.572-.862-.55-1.431-.185z" fill="currentColor" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-redo"><g stroke="currentColor" stroke-linecap="round"><path d="M14.113 4.75h-7.5a4.75 4.75 0 0 0 0 9.5h3.75" vector-effect="non-scaling-stroke" /><path d="m11.113 1.75 2.993 2.993a.01.01 0 0 1 0 .014L11.113 7.75" vector-effect="non-scaling-stroke" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-seal"><path d="M5 37a2 2 0 0 1 2-2h34a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-5Z" stroke="currentColor" stroke-width="3" /><path d="M5 31a2 2 0 0 1 2-2h34a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V31Z" stroke="currentColor" stroke-width="3" /><path d="M18.763 15.664a1 1 0 0 1 .942-.664h8.59a1 1 0 0 1 .942.664L34 29H14l4.763-13.336Z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><rect x="15" y="4" width="18" height="10.8" rx="5.4" stroke="currentColor" stroke-width="3" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-search-replace"><path d="M40 27V6a2 2 0 0 0-2-2H10a2 2 0 0 0-2 2v36a2 2 0 0 0 2 2h11m-4-32h14m-14 8h14m-14 8h6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M37 37c0 1.38-.56 2.63-1.465 3.535A5 5 0 1 1 37 37z" /><path d="m39 44-3.465-3.465m0 0a5 5 0 1 0-7.071-7.07 5 5 0 0 0 7.072 7.07z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-select-all"><path d="M32 16h9a2 2 0 0 1 2 2v23a2 2 0 0 1-2 2H18a2 2 0 0 1-2-2v-9" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M32 16V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v23a2 2 0 0 0 2 2h9m25-16L17 40M32 7 7 32m25-16L16 32m27-8L24 43m0-38L5 24m38 10-9 9M14 5l-9 9" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-setting"><path d="M1.853 3.966a.01.01 0 0 0-.016.003 4.307 4.307 0 0 0 5.714 5.7l4.87 4.871a1.5 1.5 0 1 0 2.122-2.12L9.671 7.546a4.307 4.307 0 0 0-5.713-5.704.01.01 0 0 0-.003.016l2.6 2.6L4.45 6.563 1.853 3.966z" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-share"><path d="M35 16a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM13 29a5 5 0 1 0 0-10 5 5 0 0 0 0 10z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="m30 13.575-12.66 7.67m-.002 5.319 13.34 7.883" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M35 32a5 5 0 1 1 0 10 5 5 0 0 1 0-10z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-shortcut"><path d="M42 7H6a2 2 0 0 0-2 2v28a2 2 0 0 0 2 2h36a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M12 19h2m7 0h2m6 0h7m-24 9h24" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-signature"><path clip-rule="evenodd" d="M24 24v-5L39 4l5 5-15 15h-5z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M16 24H9a5 5 0 0 0 0 10h30a5 5 0 0 1 0 10H18" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-special-characters"><path d="M4 40.003h14.004C11.334 35.636 8 30.301 8 24c0-9.453 7.017-16 16.008-16C33 8 40 15 40 24c0 6-3.331 11.334-9.993 16.003H44" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-spellcheck"><path d="m34 10 8 8m0-8-8 8m10 12-7 8-4-4m-7-24H4v8h22v-8zm0 20H4v8h22v-8z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-strike"><path d="M1.5 8.25h13m-11.75 6 1.415-3.503m9.085 3.504-1.401-3.504M6.178 5.28l1.544-3.872a.3.3 0 0 1 .556 0L9.816 5.28" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-subscript"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.266 10.905a.402.402 0 0 0 .399.446h.171c.236 0 .424-.208.464-.46v-.005c.03-.16.078-.305.142-.432a.841.841 0 0 1 .253-.316.633.633 0 0 1 .395-.124c.228 0 .414.08.558.24.15.155.224.374.224.657a.983.983 0 0 1-.112.473c-.07.139-.159.263-.268.374-.104.11-.221.213-.35.308-.13.088-.25.177-.365.265-.223.172-.437.341-.64.507a3.246 3.246 0 0 0-.521.549l-.037.048a2.273 2.273 0 0 0-.328.614c-.084.25-.108.951.699.951h2.581c.236 0 .428-.207.428-.461v-.091c0-.255-.192-.462-.428-.462h-2.037l.036-.056c.12-.187.258-.4.411-.535.169-.15.342-.288.521-.416.179-.132.355-.265.529-.398.178-.133.337-.28.476-.44.14-.167.25-.355.335-.566a2.03 2.03 0 0 0 .127-.756c0-.282-.05-.537-.149-.764a1.648 1.648 0 0 0-.96-.93A1.851 1.851 0 0 0 14.141 9c-.313 0-.59.06-.834.183a1.602 1.602 0 0 0-.595.498c-.16.21-.278.46-.358.748-.043.151-.072.31-.09.476z" fill="var(--umo-primary-color)" /><path d="m10.75 1.75-9 12.5m9 0-9-12.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-superscript"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.665 3.351a.402.402 0 0 1-.4-.446c.018-.166.047-.325.09-.476.08-.288.199-.537.357-.748a1.61 1.61 0 0 1 .596-.498c.243-.122.521-.183.834-.183.238 0 .464.042.678.125a1.648 1.648 0 0 1 .96.93c.1.227.149.482.149.764 0 .294-.042.546-.127.756a2.08 2.08 0 0 1-.335.565c-.139.16-.298.308-.476.44-.174.134-.35.266-.529.4a6.289 6.289 0 0 0-.521.415c-.153.136-.29.348-.41.535l-.037.056h2.037c.236 0 .428.207.428.462v.09c0 .255-.192.462-.428.462H12.95c-.807 0-.783-.701-.7-.95.083-.229.196-.443.329-.615l.037-.049c.149-.199.322-.382.52-.548.204-.166.418-.335.641-.507a7.68 7.68 0 0 1 .365-.265c.129-.095.246-.197.35-.308.11-.11.198-.235.268-.374a.984.984 0 0 0 .112-.473c0-.283-.075-.501-.224-.657a.715.715 0 0 0-.558-.24.633.633 0 0 0-.395.124.842.842 0 0 0-.253.316 1.593 1.593 0 0 0-.141.432l-.001.006c-.04.251-.228.46-.464.46h-.171z" fill="var(--umo-primary-color)" /><path d="m10.75 1.75-9 12.5m9 0-9-12.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-add-column-after"><path stroke="currentColor" stroke-width="4" stroke-linejoin="round" d="M14.5 17h28v14h-28z" /><path d="M6.5 6v36" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-add-column-before"><path stroke="currentColor" stroke-width="4" stroke-linejoin="round" d="M6 17h28v14H6z" /><path d="M42 6v36" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-add-row-after"><path stroke="currentColor" stroke-width="4" stroke-linejoin="round" d="M17 6h14v28H17z" /><path d="M42 42H6" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-add-row-before"><path stroke="currentColor" stroke-width="4" stroke-linejoin="round" d="M17 14.5h14v28H17z" /><path d="M42 6.5H6" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-cells-align"><rect x="6" y="6" width="36" height="36" rx="3" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M22 30h4m-8-6h12m-10-6h8" stroke="currentColor" stroke-width="3" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-cells-background"><path fill-rule="evenodd" clip-rule="evenodd" d="M37 37a4 4 0 0 0 4-4c0-1.473-1.333-3.473-4-6-2.667 2.527-4 4.527-4 6a4 4 0 0 0 4 4z" fill="currentColor" /><path d="m20.854 5.504 3.535 3.536" stroke="currentColor" stroke-width="3" stroke-linecap="round" /><path d="M23.682 8.333 8.125 23.889 19.44 35.203l15.556-15.557L23.682 8.333z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="m12 20.073 16.961 5.577M4 43h40" stroke="currentColor" stroke-width="3" stroke-linecap="round" /></symbol><symbol viewBox="0 0 24 24" id="icon-table-delete-column"><g fill="none" fill-rule="evenodd"><path d="m10 17.5 4 4m-4 0 4-4m-4-4v-11h4v11h-4z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M0 0v24h24V0z" /><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M3 21.5v-19m18 18.75v-19" /></g></symbol><symbol viewBox="0 0 24 24" id="icon-table-delete-row"><g fill="none" fill-rule="evenodd"><path d="m17.5 14 4-4m0 4-4-4m-4 4h-11v-4h11v4z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M0 24h24V0H0z" /><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M21.5 21h-19M21.25 3h-19" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-delete"><path d="M14 11 4 24l10 13h30V11H14zm7 8 10 10m0-10L21 29" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-fix"><rect x="5" y="5" width="38" height="38" rx="2" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M5 18h38M5 30h38M17 5v38M30 5v38" stroke="currentColor" stroke-width="3" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-header-cell"><path d="M40 6H8a2 2 0 0 0-2 2v32a2 2 0 0 0 2 2h32a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="M16.123 6 6 15m20.003-9L6 24M35 6 6 33m13-3L6 42m35-32L29.243 20.852M19 21v21m0-21h23" stroke="currentColor" stroke-width="4" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-header-column"><path d="M40 6H8a2 2 0 0 0-2 2v32a2 2 0 0 0 2 2h32a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="M16.123 6 6 15m13-3L6 24m13-3L6 33m13-3L6 42M19 6v36" stroke="currentColor" stroke-width="4" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-header-row"><path d="M40 6H8a2 2 0 0 0-2 2v32a2 2 0 0 0 2 2h32a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z" stroke="currentColor" stroke-width="4" stroke-linejoin="round" /><path d="M6 19.059h36M16.123 6 6 15m36-4.993L32 19M26.123 6l-14.2 12.624M36.123 6l-14.2 12.624" stroke="currentColor" stroke-width="4" stroke-linecap="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-merge-cell"><path d="M20 14V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v38a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-9m8 0v9a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H29a1 1 0 0 0-1 1v9m0 10h16M5 24h15" stroke="currentColor" stroke-width="4" stroke-linecap="round" /><path d="m32.748 28.818-1.59-1.59-3.182-3.183 3.181-3.182 1.591-1.59m-17.373 9.545 1.591-1.59 3.182-3.183-3.182-3.182-1.591-1.59" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-next-cell"><path d="M42 19V9a3 3 0 0 0-3-3H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h10" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="m34 24 8 8-8 8m-10-8h18" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-previous-cell"><path d="M42 19V9a3 3 0 0 0-3-3H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h10" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /><path d="m32 24-8 8 8 8m-8-8h18" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table-split-cell"><path d="M4 14V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v38a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9m40 0v9a1 1 0 0 1-1 1H29a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v9M28 24l16 .013m-40 0L20 24" stroke="currentColor" stroke-width="4" stroke-linecap="round" /><path d="m39.227 28.778 1.592-1.591L44 24.005l-3.181-3.182-1.592-1.591M8.755 28.786l-1.59-1.59-3.183-3.183 3.182-3.182 1.591-1.59" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-table"><path d="M42 6H6a2 2 0 0 0-2 2v32a2 2 0 0 0 2 2h36a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M4 18h40m-26.5 0v24m13-24v24M4 30h40m0-22v32a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 14 14" id="icon-task"><g fill="none" fill-rule="evenodd"><path d="M0 0h14v14H0z" /><path d="M13 5.667V12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h7" stroke="currentColor" stroke-width="1.333" stroke-linecap="round" stroke-linejoin="round" /><path stroke="var(--umo-primary-color)" stroke-width="1.333" stroke-linecap="round" stroke-linejoin="round" d="m4.333 5.667 3.334 2.666 5-7" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-template"><path d="M23 4H4v22h19V4zm21 30H4v9h40v-9zm0-30H31v8h13V4zm0 14H31v8h13v-8z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-text-box"><path d="M12 4H4v8h8V4zm32 32h-8v8h8v-8zm-32 0H4v8h8v-8zM44 4h-8v8h8V4z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M8 36V12m32 24V12M12 8h24M12 40h24" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-text"><path d="M10 44h28a2 2 0 0 0 2-2V14H30V4H10a2 2 0 0 0-2 2v36a2 2 0 0 0 2 2zM30 4l10 10m-16 8v14m-6-14h12" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-toc"><rect x="8" y="4" width="32" height="40" rx="2" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M21 14h12M21 24h12M21 34h12" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path fill-rule="evenodd" clip-rule="evenodd" d="M15 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" fill="currentColor" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-toolbar-classic"><rect x="6" y="6" width="36" height="36" rx="3" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M6 16h36M6 13v6m36-6v6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-toolbar-ribbon"><rect x="6" y="6" width="36" height="36" rx="3" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M6 32h36M6 29v6m36-6v6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-toolbar-source"><rect x="4" y="8" width="40" height="32" rx="2" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M4 10a2 2 0 0 1 2-2h36a2 2 0 0 1 2 2v6H4v-6z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="m25 23-2 11" stroke="currentColor" stroke-width="3" stroke-linecap="round" /><path d="m31 23 6 5-6 6M17 23l-6 5 6 6" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-underline"><path d="M12.25 1.75V7a4.25 4.25 0 0 1-8.5 0V1.75m-.5 12.5h9.5" stroke-linecap="round" vector-effect="non-scaling-stroke" stroke="currentColor" /></symbol><symbol fill="none" stroke-width="1.5" viewBox="0 0 16 16" id="icon-undo"><g stroke="currentColor" stroke-linecap="round"><path d="M2 4.75h7.5a4.75 4.75 0 1 1 0 9.5H5.75" vector-effect="non-scaling-stroke" /><path d="M4.886 1.75 1.894 4.743a.01.01 0 0 0 0 .014L4.886 7.75" vector-effect="non-scaling-stroke" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-video"><path d="M4 10a2 2 0 0 1 2-2h36a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V10z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /><path d="M36 8v32M12 8v32m26-22h6m-6 12h6M4 18h6m-6-2v4M9 8h6M9 40h6M33 8h6m-6 32h6M4 30h6m-6-2v4m40-4v4m0-16v4" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="m21 19 8 5-8 5V19z" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /></symbol><symbol viewBox="0 0 24 24" id="icon-watermark"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z" /><rect stroke="currentColor" stroke-width="1.5" x="3.5" y="1.5" width="17" height="21" rx="1" /><path d="m8.5 4.5-3 3m13 9L16 19M13.5 4.5l-8 8m13-7-13 13m13-7L11 19" opacity=".334" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" /></g></symbol><symbol viewBox="0 0 48 48" fill="none" id="icon-web-page"><path d="M25 40H7a3 3 0 0 1-3-3V11a3 3 0 0 1 3-3h34a3 3 0 0 1 3 3v13.941" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><path d="M4 11a3 3 0 0 1 3-3h34a3 3 0 0 1 3 3v9H4v-9z" stroke="currentColor" stroke-width="3" /><path d="M32 35h12m-6-6v12" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /><circle r="2" transform="matrix(0 -1 -1 0 10 14)" fill="currentColor" /><circle r="2" transform="matrix(0 -1 -1 0 16 14)" fill="currentColor" /></symbol>',e.insertBefore(t,e.lastChild)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function p(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e){var t=function(e,t){if("object"!=f(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==f(t)?t:t+""}function m(e,t,n){return(t=h(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const y=g(b);var w="object"==typeof v&&v&&v.Object===Object&&v,k=w,x="object"==typeof self&&self&&self.Object===Object&&self,C=k||x||Function("return this")(),O=C.Symbol,S=O,E=Object.prototype,N=E.hasOwnProperty,_=E.toString,M=S?S.toStringTag:void 0;var A=function(e){var t=N.call(e,M),n=e[M];try{e[M]=void 0;var r=!0}catch(i){}var o=_.call(e);return r&&(t?e[M]=n:delete e[M]),o},T=Object.prototype.toString;var V=A,j=function(e){return T.call(e)},B=O?O.toStringTag:void 0;var P=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?V(e):j(e)},I=P,D=b;var L=function(e){if(!D(e))return!1;var t=I(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const R=g(L);var z,F=C["__core-js_shared__"],$=(z=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var H=function(e){return!!$&&$ in e},U=Function.prototype.toString;var W=function(e){if(null!=e){try{return U.call(e)}catch(t){}try{return e+""}catch(t){}}return""},q=L,K=H,G=b,Y=W,X=/^\[object .+?Constructor\]$/,Z=Function.prototype,J=Object.prototype,Q=Z.toString,ee=J.hasOwnProperty,te=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ne=function(e){return!(!G(e)||K(e))&&(q(e)?te:X).test(Y(e))},re=function(e,t){return null==e?void 0:e[t]};var oe=function(e,t){var n=re(e,t);return ne(n)?n:void 0},ie=oe,ae=function(){try{var e=ie(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),le=ae;var se=function(e,t,n){"__proto__"==t&&le?le(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ce=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}();var ue=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var de=function(e){return null!=e&&"object"==typeof e},pe=P,fe=de;var he=function(e){return fe(e)&&"[object Arguments]"==pe(e)},me=de,ve=Object.prototype,ge=ve.hasOwnProperty,be=ve.propertyIsEnumerable,ye=he(function(){return arguments}())?he:function(e){return me(e)&&ge.call(e,"callee")&&!be.call(e,"callee")},we=ye,ke=Array.isArray;const xe=g(ke);var Ce,Oe,Se,Ee,Ne,_e,Me,Ae,Te={exports:{}};Ce=Te,Se=C,Ee=function(){return!1},Ne=(Oe=Te.exports)&&!Oe.nodeType&&Oe,_e=Ne&&Ce&&!Ce.nodeType&&Ce,Me=_e&&_e.exports===Ne?Se.Buffer:void 0,Ae=(Me?Me.isBuffer:void 0)||Ee,Ce.exports=Ae;var Ve=Te.exports,je=/^(?:0|[1-9]\d*)$/;var Be=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&je.test(e))&&e>-1&&e%1==0&&e<t};var Pe=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ie=P,De=Pe,Le=de,Re={};Re["[object Float32Array]"]=Re["[object Float64Array]"]=Re["[object Int8Array]"]=Re["[object Int16Array]"]=Re["[object Int32Array]"]=Re["[object Uint8Array]"]=Re["[object Uint8ClampedArray]"]=Re["[object Uint16Array]"]=Re["[object Uint32Array]"]=!0,Re["[object Arguments]"]=Re["[object Array]"]=Re["[object ArrayBuffer]"]=Re["[object Boolean]"]=Re["[object DataView]"]=Re["[object Date]"]=Re["[object Error]"]=Re["[object Function]"]=Re["[object Map]"]=Re["[object Number]"]=Re["[object Object]"]=Re["[object RegExp]"]=Re["[object Set]"]=Re["[object String]"]=Re["[object WeakMap]"]=!1;var ze=function(e){return Le(e)&&De(e.length)&&!!Re[Ie(e)]};var Fe=function(e){return function(t){return e(t)}},$e={exports:{}};!function(e,t){var n=w,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(t){}}();e.exports=a}($e,$e.exports);var He=$e.exports,Ue=ze,We=Fe,qe=He&&He.isTypedArray,Ke=qe?We(qe):Ue,Ge=ue,Ye=we,Xe=ke,Ze=Ve,Je=Be,Qe=Ke,et=Object.prototype.hasOwnProperty;var tt=function(e,t){var n=Xe(e),r=!n&&Ye(e),o=!n&&!r&&Ze(e),i=!n&&!r&&!o&&Qe(e),a=n||r||o||i,l=a?Ge(e.length,String):[],s=l.length;for(var c in e)!t&&!et.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Je(c,s))||l.push(c);return l},nt=Object.prototype;var rt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||nt)};var ot=function(e,t){return function(n){return e(t(n))}},it=ot(Object.keys,Object),at=rt,lt=it,st=Object.prototype.hasOwnProperty;var ct=function(e){if(!at(e))return lt(e);var t=[];for(var n in Object(e))st.call(e,n)&&"constructor"!=n&&t.push(n);return t},ut=L,dt=Pe;var pt=function(e){return null!=e&&dt(e.length)&&!ut(e)},ft=tt,ht=ct,mt=pt;var vt=function(e){return mt(e)?ft(e):ht(e)},gt=ce,bt=vt;var yt=function(e,t){return e&&gt(e,t,bt)};var wt=function(){this.__data__=[],this.size=0};var kt=function(e,t){return e===t||e!=e&&t!=t},xt=kt;var Ct=function(e,t){for(var n=e.length;n--;)if(xt(e[n][0],t))return n;return-1},Ot=Ct,St=Array.prototype.splice;var Et=Ct;var Nt=Ct;var _t=Ct;var Mt=wt,At=function(e){var t=this.__data__,n=Ot(t,e);return!(n<0)&&(n==t.length-1?t.pop():St.call(t,n,1),--this.size,!0)},Tt=function(e){var t=this.__data__,n=Et(t,e);return n<0?void 0:t[n][1]},Vt=function(e){return Nt(this.__data__,e)>-1},jt=function(e,t){var n=this.__data__,r=_t(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Bt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bt.prototype.clear=Mt,Bt.prototype.delete=At,Bt.prototype.get=Tt,Bt.prototype.has=Vt,Bt.prototype.set=jt;var Pt=Bt,It=Pt;var Dt=function(){this.__data__=new It,this.size=0};var Lt=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Rt=function(e){return this.__data__.get(e)};var zt=function(e){return this.__data__.has(e)},Ft=oe(C,"Map"),$t=oe(Object,"create"),Ht=$t;var Ut=function(){this.__data__=Ht?Ht(null):{},this.size=0};var Wt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},qt=$t,Kt=Object.prototype.hasOwnProperty;var Gt=function(e){var t=this.__data__;if(qt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Kt.call(t,e)?t[e]:void 0},Yt=$t,Xt=Object.prototype.hasOwnProperty;var Zt=$t;var Jt=Ut,Qt=Wt,en=Gt,tn=function(e){var t=this.__data__;return Yt?void 0!==t[e]:Xt.call(t,e)},nn=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Zt&&void 0===t?"__lodash_hash_undefined__":t,this};function rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rn.prototype.clear=Jt,rn.prototype.delete=Qt,rn.prototype.get=en,rn.prototype.has=tn,rn.prototype.set=nn;var on=rn,an=Pt,ln=Ft;var sn=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var cn=function(e,t){var n=e.__data__;return sn(t)?n["string"==typeof t?"string":"hash"]:n.map},un=cn;var dn=cn;var pn=cn;var fn=cn;var hn=function(){this.size=0,this.__data__={hash:new on,map:new(ln||an),string:new on}},mn=function(e){var t=un(this,e).delete(e);return this.size-=t?1:0,t},vn=function(e){return dn(this,e).get(e)},gn=function(e){return pn(this,e).has(e)},bn=function(e,t){var n=fn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yn.prototype.clear=hn,yn.prototype.delete=mn,yn.prototype.get=vn,yn.prototype.has=gn,yn.prototype.set=bn;var wn=yn,kn=Pt,xn=Ft,Cn=wn;var On=Pt,Sn=Dt,En=Lt,Nn=Rt,_n=zt,Mn=function(e,t){var n=this.__data__;if(n instanceof kn){var r=n.__data__;if(!xn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Cn(r)}return n.set(e,t),this.size=n.size,this};function An(e){var t=this.__data__=new On(e);this.size=t.size}An.prototype.clear=Sn,An.prototype.delete=En,An.prototype.get=Nn,An.prototype.has=_n,An.prototype.set=Mn;var Tn=An;var Vn=wn,jn=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Bn=function(e){return this.__data__.has(e)};function Pn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Vn;++t<n;)this.add(e[t])}Pn.prototype.add=Pn.prototype.push=jn,Pn.prototype.has=Bn;var In=Pn;var Dn=function(e,t){return e.has(t)},Ln=In,Rn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},zn=Dn;var Fn=function(e,t,n,r,o,i){var a=1&n,l=e.length,s=t.length;if(l!=s&&!(a&&s>l))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,f=2&n?new Ln:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var h=e[d],m=t[d];if(r)var v=a?r(m,h,d,t,e,i):r(h,m,d,e,t,i);if(void 0!==v){if(v)continue;p=!1;break}if(f){if(!Rn(t,(function(e,t){if(!zn(f,t)&&(h===e||o(h,e,n,r,i)))return f.push(t)}))){p=!1;break}}else if(h!==m&&!o(h,m,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p},$n=C.Uint8Array;var Hn=$n,Un=kt,Wn=Fn,qn=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Kn=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},Gn=O?O.prototype:void 0,Yn=Gn?Gn.valueOf:void 0;var Xn=function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Hn(e),new Hn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Un(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=qn;case"[object Set]":var s=1&r;if(l||(l=Kn),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=Wn(l(e),l(t),r,o,i,a);return a.delete(e),u;case"[object Symbol]":if(Yn)return Yn.call(e)==Yn.call(t)}return!1};var Zn=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},Jn=Zn,Qn=ke;var er=function(e,t,n){var r=t(e);return Qn(e)?r:Jn(r,n(e))};var tr=function(){return[]},nr=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i},rr=tr,or=Object.prototype.propertyIsEnumerable,ir=Object.getOwnPropertySymbols,ar=ir?function(e){return null==e?[]:(e=Object(e),nr(ir(e),(function(t){return or.call(e,t)})))}:rr,lr=er,sr=ar,cr=vt;var ur=function(e){return lr(e,cr,sr)},dr=ur,pr=Object.prototype.hasOwnProperty;var fr=function(e,t,n,r,o,i){var a=1&n,l=dr(e),s=l.length;if(s!=dr(t).length&&!a)return!1;for(var c=s;c--;){var u=l[c];if(!(a?u in t:pr.call(t,u)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var h=a;++c<s;){var m=e[u=l[c]],v=t[u];if(r)var g=a?r(v,m,u,t,e,i):r(m,v,u,e,t,i);if(!(void 0===g?m===v||o(m,v,n,r,i):g)){f=!1;break}h||(h="constructor"==u)}if(f&&!h){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(f=!1)}return i.delete(e),i.delete(t),f},hr=oe(C,"DataView"),mr=Ft,vr=oe(C,"Promise"),gr=oe(C,"Set"),br=oe(C,"WeakMap"),yr=P,wr=W,kr="[object Map]",xr="[object Promise]",Cr="[object Set]",Or="[object WeakMap]",Sr="[object DataView]",Er=wr(hr),Nr=wr(mr),_r=wr(vr),Mr=wr(gr),Ar=wr(br),Tr=yr;(hr&&Tr(new hr(new ArrayBuffer(1)))!=Sr||mr&&Tr(new mr)!=kr||vr&&Tr(vr.resolve())!=xr||gr&&Tr(new gr)!=Cr||br&&Tr(new br)!=Or)&&(Tr=function(e){var t=yr(e),n="[object Object]"==t?e.constructor:void 0,r=n?wr(n):"";if(r)switch(r){case Er:return Sr;case Nr:return kr;case _r:return xr;case Mr:return Cr;case Ar:return Or}return t});var Vr=Tr,jr=Tn,Br=Fn,Pr=Xn,Ir=fr,Dr=Vr,Lr=ke,Rr=Ve,zr=Ke,Fr="[object Arguments]",$r="[object Array]",Hr="[object Object]",Ur=Object.prototype.hasOwnProperty;var Wr=function(e,t,n,r,o,i){var a=Lr(e),l=Lr(t),s=a?$r:Dr(e),c=l?$r:Dr(t),u=(s=s==Fr?Hr:s)==Hr,d=(c=c==Fr?Hr:c)==Hr,p=s==c;if(p&&Rr(e)){if(!Rr(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new jr),a||zr(e)?Br(e,t,n,r,o,i):Pr(e,t,s,n,r,o,i);if(!(1&n)){var f=u&&Ur.call(e,"__wrapped__"),h=d&&Ur.call(t,"__wrapped__");if(f||h){var m=f?e.value():e,v=h?t.value():t;return i||(i=new jr),o(m,v,n,r,i)}}return!!p&&(i||(i=new jr),Ir(e,t,n,r,o,i))},qr=de;var Kr=function e(t,n,r,o,i){return t===n||(null==t||null==n||!qr(t)&&!qr(n)?t!=t&&n!=n:Wr(t,n,r,o,e,i))},Gr=Tn,Yr=Kr;var Xr=b;var Zr=function(e){return e==e&&!Xr(e)},Jr=Zr,Qr=vt;var eo=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},to=function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<i;){var s=(l=n[o])[0],c=e[s],u=l[1];if(a&&l[2]){if(void 0===c&&!(s in e))return!1}else{var d=new Gr;if(r)var p=r(c,u,s,e,t,d);if(!(void 0===p?Yr(u,c,3,r,d):p))return!1}}return!0},no=function(e){for(var t=Qr(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Jr(o)]}return t},ro=eo;var oo=function(e){var t=no(e);return 1==t.length&&t[0][2]?ro(t[0][0],t[0][1]):function(n){return n===e||to(n,e,t)}},io=P,ao=de;var lo=function(e){return"symbol"==typeof e||ao(e)&&"[object Symbol]"==io(e)},so=ke,co=lo,uo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,po=/^\w*$/;var fo=function(e,t){if(so(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!co(e))||(po.test(e)||!uo.test(e)||null!=t&&e in Object(t))},ho=wn;function mo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(mo.Cache||ho),n}mo.Cache=ho;var vo=mo;var go=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bo=/\\(\\)?/g,yo=function(e){var t=vo(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(go,(function(e,n,r,o){t.push(r?o.replace(bo,"$1"):n||e)})),t}));var wo=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},ko=wo,xo=ke,Co=lo,Oo=O?O.prototype:void 0,So=Oo?Oo.toString:void 0;var Eo=function e(t){if("string"==typeof t)return t;if(xo(t))return ko(t,e)+"";if(Co(t))return So?So.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},No=Eo;var _o=function(e){return null==e?"":No(e)},Mo=ke,Ao=fo,To=yo,Vo=_o;var jo=function(e,t){return Mo(e)?e:Ao(e,t)?[e]:To(Vo(e))},Bo=lo;var Po=function(e){if("string"==typeof e||Bo(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Io=jo,Do=Po;var Lo=function(e,t){for(var n=0,r=(t=Io(t,e)).length;null!=e&&n<r;)e=e[Do(t[n++])];return n&&n==r?e:void 0},Ro=Lo;var zo=function(e,t,n){var r=null==e?void 0:Ro(e,t);return void 0===r?n:r};const Fo=g(zo);var $o=jo,Ho=we,Uo=ke,Wo=Be,qo=Pe,Ko=Po;var Go=function(e,t){return null!=e&&t in Object(e)},Yo=function(e,t,n){for(var r=-1,o=(t=$o(t,e)).length,i=!1;++r<o;){var a=Ko(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&qo(o)&&Wo(a,o)&&(Uo(e)||Ho(e))};var Xo=function(e,t){return null!=e&&Yo(e,t,Go)},Zo=Kr,Jo=zo,Qo=Xo,ei=fo,ti=Zr,ni=eo,ri=Po;var oi=function(e){return e};var ii=Lo;var ai=function(e){return function(t){return null==t?void 0:t[e]}},li=function(e){return function(t){return ii(t,e)}},si=fo,ci=Po;var ui=oo,di=function(e,t){return ei(e)&&ti(t)?ni(ri(e),t):function(n){var r=Jo(n,e);return void 0===r&&r===t?Qo(n,e):Zo(t,r,3)}},pi=oi,fi=ke,hi=function(e){return si(e)?ai(ci(e)):li(e)};var mi=function(e){return"function"==typeof e?e:null==e?pi:"object"==typeof e?fi(e)?di(e[0],e[1]):ui(e):hi(e)},vi=se,gi=yt,bi=mi;const yi=g((function(e,t){var n={};return t=bi(t),gi(e,(function(e,r,o){vi(n,t(e,r,o),e)})),n}));var wi=Kr;const ki=g((function(e,t){return wi(e,t)}));var xi=se,Ci=kt;var Oi=function(e,t,n){(void 0!==n&&!Ci(e[t],n)||void 0===n&&!(t in e))&&xi(e,t,n)},Si={exports:{}};!function(e,t){var n=C,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(Si,Si.exports);var Ei=Si.exports,Ni=$n;var _i=function(e){var t=new e.constructor(e.byteLength);return new Ni(t).set(new Ni(e)),t},Mi=_i;var Ai=function(e,t){var n=t?Mi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Ti=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},Vi=b,ji=Object.create,Bi=function(){function e(){}return function(t){if(!Vi(t))return{};if(ji)return ji(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Pi=ot(Object.getPrototypeOf,Object),Ii=Bi,Di=Pi,Li=rt;var Ri=function(e){return"function"!=typeof e.constructor||Li(e)?{}:Ii(Di(e))},zi=pt,Fi=de;var $i=function(e){return Fi(e)&&zi(e)},Hi=P,Ui=Pi,Wi=de,qi=Function.prototype,Ki=Object.prototype,Gi=qi.toString,Yi=Ki.hasOwnProperty,Xi=Gi.call(Object);var Zi=function(e){if(!Wi(e)||"[object Object]"!=Hi(e))return!1;var t=Ui(e);if(null===t)return!0;var n=Yi.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Gi.call(n)==Xi};var Ji=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Qi=se,ea=kt,ta=Object.prototype.hasOwnProperty;var na=function(e,t,n){var r=e[t];ta.call(e,t)&&ea(r,n)&&(void 0!==n||t in e)||Qi(e,t,n)},ra=na,oa=se;var ia=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var l=t[i],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),o?oa(n,l,s):ra(n,l,s)}return n};var aa=b,la=rt,sa=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ca=Object.prototype.hasOwnProperty;var ua=tt,da=function(e){if(!aa(e))return sa(e);var t=la(e),n=[];for(var r in e)("constructor"!=r||!t&&ca.call(e,r))&&n.push(r);return n},pa=pt;var fa=function(e){return pa(e)?ua(e,!0):da(e)},ha=ia,ma=fa;var va=Oi,ga=Ei,ba=Ai,ya=Ti,wa=Ri,ka=we,xa=ke,Ca=$i,Oa=Ve,Sa=L,Ea=b,Na=Zi,_a=Ke,Ma=Ji,Aa=function(e){return ha(e,ma(e))};var Ta=Tn,Va=Oi,ja=ce,Ba=function(e,t,n,r,o,i,a){var l=Ma(e,n),s=Ma(t,n),c=a.get(s);if(c)va(e,n,c);else{var u=i?i(l,s,n+"",e,t,a):void 0,d=void 0===u;if(d){var p=xa(s),f=!p&&Oa(s),h=!p&&!f&&_a(s);u=s,p||f||h?xa(l)?u=l:Ca(l)?u=ya(l):f?(d=!1,u=ga(s,!0)):h?(d=!1,u=ba(s,!0)):u=[]:Na(s)||ka(s)?(u=l,ka(l)?u=Aa(l):Ea(l)&&!Sa(l)||(u=wa(s))):d=!1}d&&(a.set(s,u),o(u,s,r,i,a),a.delete(s)),va(e,n,u)}},Pa=b,Ia=fa,Da=Ji;var La=function e(t,n,r,o,i){t!==n&&ja(n,(function(a,l){if(i||(i=new Ta),Pa(a))Ba(t,n,l,r,e,o,i);else{var s=o?o(Da(t,l),a,l+"",t,n,i):void 0;void 0===s&&(s=a),Va(t,l,s)}}),Ia)};var Ra=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},za=Math.max;var Fa=function(e,t,n){return t=za(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=za(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),Ra(e,this,l)}};var $a=function(e){return function(){return e}},Ha=ae,Ua=Ha?function(e,t){return Ha(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:oi,Wa=Date.now;var qa=function(e){var t=0,n=0;return function(){var r=Wa(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},Ka=qa(Ua),Ga=oi,Ya=Fa,Xa=Ka;var Za=function(e,t){return Xa(Ya(e,t,Ga),e+"")},Ja=kt,Qa=pt,el=Be,tl=b;var nl=Za,rl=function(e,t,n){if(!tl(n))return!1;var r=typeof t;return!!("number"==r?Qa(n)&&el(t,n.length):"string"==r&&t in n)&&Ja(n[t],e)};var ol=function(e){return nl((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&rl(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,i)}return t}))},il=La;const al=g(ol((function(e,t,n){il(e,t,n)})));function ll(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(u){c=!0,o=u}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sl(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function cl(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var ul=P,dl=ke,pl=de;const fl=g((function(e){return"string"==typeof e||!dl(e)&&pl(e)&&"[object String]"==ul(e)}));const hl=g((function(e){return null===e}));const ml=g((function(e){return void 0===e}));var vl=P,gl=de;const bl=g((function(e){return"number"==typeof e||gl(e)&&"[object Number]"==vl(e)}));function yl(){if("undefined"==typeof navigator||!navigator)return Number.MAX_SAFE_INTEGER;var e=navigator.userAgent,t=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1,n=e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1;if(t){var r=new RegExp("MSIE (\\d+\\.\\d+);"),o=e.match(r);if(!o)return-1;var i=parseFloat(o[1]);return i<7?6:i}return n?11:Number.MAX_SAFE_INTEGER}function wl(e,t){var n=bl(t);if(!e||0===e.length)return n?{length:0,characters:e}:0;for(var r=0,o=0;o<e.length;o++){var i=0;if(i=e.charCodeAt(o)>127?2:1,n&&r+i>t)return{length:r,characters:e.slice(0,o)};r+=i}return n?{length:r,characters:e}:r}function kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kl(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Cl=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Ol=ia,Sl=vt;var El=function(e,t){return e&&Ol(t,Sl(t),e)},Nl=ia,_l=fa;var Ml=function(e,t){return e&&Nl(t,_l(t),e)},Al=ia,Tl=ar;var Vl=function(e,t){return Al(e,Tl(e),t)},jl=Zn,Bl=Pi,Pl=ar,Il=tr,Dl=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)jl(t,Pl(e)),e=Bl(e);return t}:Il,Ll=ia,Rl=Dl;var zl=function(e,t){return Ll(e,Rl(e),t)},Fl=er,$l=Dl,Hl=fa;var Ul=function(e){return Fl(e,Hl,$l)},Wl=Object.prototype.hasOwnProperty;var ql=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Wl.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Kl=_i;var Gl=function(e,t){var n=t?Kl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Yl=/\w*$/;var Xl=function(e){var t=new e.constructor(e.source,Yl.exec(e));return t.lastIndex=e.lastIndex,t},Zl=O?O.prototype:void 0,Jl=Zl?Zl.valueOf:void 0;var Ql=_i,es=Gl,ts=Xl,ns=function(e){return Jl?Object(Jl.call(e)):{}},rs=Ai;var is=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Ql(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return es(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return rs(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return ts(e);case"[object Symbol]":return ns(e)}},as=Vr,ls=de;var ss=function(e){return ls(e)&&"[object Map]"==as(e)},cs=Fe,us=He&&He.isMap,ds=us?cs(us):ss,ps=Vr,fs=de;var hs=function(e){return fs(e)&&"[object Set]"==ps(e)},ms=Fe,vs=He&&He.isSet,gs=vs?ms(vs):hs,bs=Tn,ys=Cl,ws=na,ks=El,xs=Ml,Cs=Ei,Os=Ti,Ss=Vl,Es=zl,Ns=ur,_s=Ul,Ms=Vr,As=ql,Ts=is,Vs=Ri,js=ke,Bs=Ve,Ps=ds,Is=b,Ds=gs,Ls=vt,Rs=fa,zs="[object Arguments]",Fs="[object Function]",$s="[object Object]",Hs={};Hs[zs]=Hs["[object Array]"]=Hs["[object ArrayBuffer]"]=Hs["[object DataView]"]=Hs["[object Boolean]"]=Hs["[object Date]"]=Hs["[object Float32Array]"]=Hs["[object Float64Array]"]=Hs["[object Int8Array]"]=Hs["[object Int16Array]"]=Hs["[object Int32Array]"]=Hs["[object Map]"]=Hs["[object Number]"]=Hs[$s]=Hs["[object RegExp]"]=Hs["[object Set]"]=Hs["[object String]"]=Hs["[object Symbol]"]=Hs["[object Uint8Array]"]=Hs["[object Uint8ClampedArray]"]=Hs["[object Uint16Array]"]=Hs["[object Uint32Array]"]=!0,Hs["[object Error]"]=Hs[Fs]=Hs["[object WeakMap]"]=!1;var Us=function e(t,n,r,o,i,a){var l,s=1&n,c=2&n,u=4&n;if(r&&(l=i?r(t,o,i,a):r(t)),void 0!==l)return l;if(!Is(t))return t;var d=js(t);if(d){if(l=As(t),!s)return Os(t,l)}else{var p=Ms(t),f=p==Fs||"[object GeneratorFunction]"==p;if(Bs(t))return Cs(t,s);if(p==$s||p==zs||f&&!i){if(l=c||f?{}:Vs(t),!s)return c?Es(t,xs(l,t)):Ss(t,ks(l,t))}else{if(!Hs[p])return i?t:{};l=Ts(t,p,s)}}a||(a=new bs);var h=a.get(t);if(h)return h;a.set(t,l),Ds(t)?t.forEach((function(o){l.add(e(o,n,r,o,t,a))})):Ps(t)&&t.forEach((function(o,i){l.set(i,e(o,n,r,i,t,a))}));var m=d?void 0:(u?c?_s:Ns:c?Rs:Ls)(t);return ys(m||t,(function(o,i){m&&(o=t[i=o]),ws(l,i,e(o,n,r,i,t,a))})),l},Ws=Us;const qs=g((function(e){return Ws(e,5)}));var Ks=La;const Gs=g(ol((function(e,t,n,r){Ks(e,t,n,r)})));var Ys="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e,t){e.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",d="year",p="date",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},b={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,c),i=n-o<0,a=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:s,d:l,D:p,h:a,m:i,s:o,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",w={};w[y]=v;var k="$isDayjsObject",x=function(e){return e instanceof E||!(!e||!e[k])},C=function e(t,n,r){var o;if(!t)return y;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),n&&(w[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var l=t.name;w[l]=t,o=l}return!r&&o&&(y=o),o||!r&&y},O=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},S=b;S.l=C,S.i=x,S.w=function(e,t){return O(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function v(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[k]=!0}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(e,t){var n=O(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return O(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<O(e)},g.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,r=!!S.u(t)||t,u=S.p(e),f=function(e,t){var o=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(l)},h=function(e,t){return S.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,v=this.$M,g=this.$D,b="set"+(this.$u?"UTC":"");switch(u){case d:return r?f(1,0):f(31,11);case c:return r?f(1,v):f(0,v+1);case s:var y=this.$locale().weekStart||0,w=(m<y?m+7:m)-y;return f(r?g-w:g+(6-w),v);case l:case p:return h(b+"Hours",0);case a:return h(b+"Minutes",1);case i:return h(b+"Seconds",2);case o:return h(b+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var n,s=S.p(e),u="set"+(this.$u?"UTC":""),f=(n={},n[l]=u+"Date",n[p]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[a]=u+"Hours",n[i]=u+"Minutes",n[o]=u+"Seconds",n[r]=u+"Milliseconds",n)[s],h=s===l?this.$D+(t-this.$W):t;if(s===c||s===d){var m=this.clone().set(p,1);m.$d[f](h),m.init(),this.$d=m.set(p,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](h);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[S.p(e)]()},g.add=function(r,u){var p,f=this;r=Number(r);var h=S.p(u),m=function(e){var t=O(f);return S.w(t.date(t.date()+Math.round(e*r)),f)};if(h===c)return this.set(c,this.$M+r);if(h===d)return this.set(d,this.$y+r);if(h===l)return m(1);if(h===s)return m(7);var v=(p={},p[i]=t,p[a]=n,p[o]=e,p)[h]||1,g=this.$d.getTime()+r*v;return S.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=S.z(this),i=this.$H,a=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},p=function(e){return S.s(i%12||12,e,"0")},h=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return l+1;case"MM":return S.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,c,3);case"MMMM":return d(c,l);case"D":return t.$D;case"DD":return S.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,s,2);case"ddd":return d(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return S.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return S.s(a,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(r,p,f){var h,m=this,v=S.p(p),g=O(r),b=(g.utcOffset()-this.utcOffset())*t,y=this-g,w=function(){return S.m(m,g)};switch(v){case d:h=w()/12;break;case c:h=w();break;case u:h=w()/3;break;case s:h=(y-b)/6048e5;break;case l:h=(y-b)/864e5;break;case a:h=y/n;break;case i:h=y/t;break;case o:h=y/e;break;default:h=y}return f?h:S.a(h)},g.daysInMonth=function(){return this.endOf(c).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},v}(),N=E.prototype;return O.prototype=N,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",l],["$M",c],["$y",d],["$D",p]].forEach((function(e){N[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),O.extend=function(e,t){return e.$i||(e(t,E,O),e.$i=!0),O},O.locale=C,O.isDayjs=x,O.unix=function(e){return O(1e3*e)},O.en=w[y],O.Ls=w,O.p={},O}()}({exports:{}});var Zs=function(e){return e.ripple="ripple",e.expand="expand",e.fade="fade",e}(Zs||{}),Js=al({classPrefix:"t",animation:{include:["ripple","expand","fade"],exclude:[]},calendar:{firstDayOfWeek:1,fillWithZero:!0,controllerConfig:void 0},icon:{},input:{autocomplete:""},dialog:{closeOnEscKeydown:!0,closeOnOverlayClick:!0,confirmBtnTheme:{default:"primary",info:"primary",warning:"primary",danger:"primary",success:"primary"}},message:{},popconfirm:{confirmBtnTheme:{default:"primary",warning:"primary",danger:"primary"}},table:{expandIcon:void 0,sortIcon:void 0,filterIcon:void 0,treeExpandAndFoldIcon:void 0,hideSortTips:!1,size:"medium"},select:{clearIcon:void 0,filterable:!1},drawer:{closeOnEscKeydown:!0,closeOnOverlayClick:!0,size:"small"},tree:{folderIcon:void 0},datePicker:{firstDayOfWeek:1},steps:{checkIcon:void 0,errorIcon:void 0},tag:{closeIcon:void 0},form:{requiredMark:void 0}},{pagination:{itemsPerPage:"{size} 条/页",jumpTo:"跳至",page:"页",total:"共 {total} 条数据"},cascader:{empty:"暂无数据",loadingText:"加载中",placeholder:"请选择"},calendar:{yearSelection:"{year} 年",monthSelection:"{month} 月",yearRadio:"年",monthRadio:"月",hideWeekend:"隐藏周末",showWeekend:"显示周末",today:"今天",thisMonth:"本月",week:"一,二,三,四,五,六,日",cellMonth:"1 月,2 月,3 月,4 月,5 月,6 月,7 月,8 月,9 月,10 月,11 月,12 月"},transfer:{title:"{checked} / {total} 项",empty:"暂无数据",placeholder:"请输入关键词搜索"},timePicker:{dayjsLocale:"zh-cn",now:"此刻",confirm:"确定",anteMeridiem:"上午",postMeridiem:"下午",placeholder:"选择时间"},dialog:{confirm:"确认",cancel:"取消"},drawer:{confirm:"确认",cancel:"取消"},popconfirm:{confirm:{content:"确定"},cancel:{content:"取消"}},table:{empty:"暂无数据",loadingText:"正在加载中,请稍后",loadingMoreText:"点击加载更多",filterInputPlaceholder:"请输入内容(无默认值)",sortAscendingOperationText:"点击升序",sortCancelOperationText:"点击取消排序",sortDescendingOperationText:"点击降序",clearFilterResultButtonText:"清空筛选",columnConfigButtonText:"列配置",columnConfigTitleText:"表格列配置",columnConfigDescriptionText:"请选择需要在表格中显示的数据列",confirmText:"确认",cancelText:"取消",resetText:"重置",selectAllText:"全选",searchResultText:"搜索“{result}”,找到 {count} 条结果"},select:{empty:"暂无数据",loadingText:"加载中",placeholder:"请选择"},tree:{empty:"暂无数据"},treeSelect:{empty:"暂无数据",loadingText:"加载中",placeholder:"请选择"},datePicker:{dayjsLocale:"zh-cn",placeholder:{date:"请选择日期",month:"请选择月份",year:"请选择年份",quarter:"请选择季度",week:"请选择周"},weekdays:["一","二","三","四","五","六","日"],months:["1 月","2 月","3 月","4 月","5 月","6 月","7 月","8 月","9 月","10 月","11 月","12 月"],quarters:["一季度","二季度","三季度","四季度"],rangeSeparator:" - ",direction:"ltr",format:"YYYY-MM-DD",dayAriaLabel:"日",weekAbbreviation:"周",yearAriaLabel:"年",monthAriaLabel:"月",confirm:"确定",selectTime:"选择时间",selectDate:"选择日期",nextYear:"下一年",preYear:"上一年",nextMonth:"下个月",preMonth:"上个月",preDecade:"上个十年",nextDecade:"下个十年",now:"当前"},upload:{sizeLimitMessage:"文件大小不能超过 {sizeLimit}",cancelUploadText:"取消上传",triggerUploadText:{fileInput:"选择文件",image:"点击上传图片",normal:"点击上传",reupload:"重新选择",continueUpload:"继续选择",delete:"删除",uploading:"上传中"},dragger:{dragDropText:"释放鼠标",draggingText:"拖拽到此区域",clickAndDragText:"点击上方“选择文件”或将文件拖拽到此区域"},file:{fileNameText:"文件名",fileSizeText:"文件大小",fileStatusText:"状态",fileOperationText:"操作",fileOperationDateText:"上传日期"},progress:{uploadingText:"上传中",waitingText:"待上传",failText:"上传失败",successText:"上传成功"}},form:{errorMessage:{date:"请输入正确的${name}",url:"请输入正确的${name}",required:"${name}必填",max:"${name}字符长度不能超过 ${validate} 个字符,一个中文等于两个字符",min:"${name}字符长度不能少于 ${validate} 个字符,一个中文等于两个字符",len:"${name}字符长度必须是 ${validate}",enum:"${name}只能是${validate}等",idcard:"请输入正确的${name}",telnumber:"请输入正确的${name}",pattern:"请输入正确的${name}",validator:"${name}不符合要求",boolean:"${name}数据类型必须是布尔类型",number:"${name}必须是数字"}},input:{placeholder:"请输入"},list:{loadingText:"正在加载中,请稍等",loadingMoreText:"点击加载更多"},alert:{expandText:"展开更多",collapseText:"收起"},anchor:{copySuccessText:"链接复制成功",copyText:"复制链接"},colorPicker:{swatchColorTitle:"系统预设颜色",recentColorTitle:"最近使用颜色",clearConfirmText:"确定清空最近使用的颜色吗?"},guide:{finishButtonProps:{content:"完成",theme:"primary"},nextButtonProps:{content:"下一步",theme:"primary"},skipButtonProps:{content:"跳过",theme:"default"},prevButtonProps:{content:"上一步",theme:"default"}},image:{errorText:"图片无法显示",loadingText:"图片加载中"},imageViewer:{errorText:"图片加载失败,可尝试重新加载",mirrorTipText:"镜像",rotateTipText:"旋转",originalSizeTipText:"原始大小"},typography:{expand:"展开",collapse:"收起",copied:"复制成功"}}),Qs=Symbol("configProvide"),ec=t.ref();function tc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1?arguments[1]:void 0,r=t.getCurrentInstance()?t.inject(Qs,null):ec,o=t.computed((function(){return(null==r?void 0:r.value)||Js})),i=t.computed((function(){return Object.assign({},o.value[e],n)}));return{t:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=r[0];if(fl(e)){if(!i)return e;return e.replace(/\{\s*([\w-]+)\s*\}/g,(function(e,t){return i?String(i[t]):""}))}return R(e)?r.length?e.apply(void 0,r):e(t.h):""},global:i,globalConfig:i,classPrefix:t.computed((function(){return o.value.classPrefix}))}}var nc=function(e){var n=qs(Js),r=t.computed((function(){return t=n,r=e.globalConfig,Gs(t,r,(function(e,t){if(xe(e))return t}));var t,r}));return t.provide(Qs,r),ec.value||(ec.value=r.value),r};function rc(e){var n=tc("classPrefix").classPrefix;return t.computed((function(){return e?"".concat(n.value,"-").concat(e):n.value}))}function oc(){var e=tc("classPrefix").classPrefix;return{SIZE:t.computed((function(){return{small:"".concat(e.value,"-size-s"),medium:"".concat(e.value,"-size-m"),large:"".concat(e.value,"-size-l"),default:"",xs:"".concat(e.value,"-size-xs"),xl:"".concat(e.value,"-size-xl"),block:"".concat(e.value,"-size-full-width")}})),STATUS:t.computed((function(){return{loading:"".concat(e.value,"-is-loading"),loadMore:"".concat(e.value,"-is-load-more"),disabled:"".concat(e.value,"-is-disabled"),focused:"".concat(e.value,"-is-focused"),success:"".concat(e.value,"-is-success"),error:"".concat(e.value,"-is-error"),warning:"".concat(e.value,"-is-warning"),selected:"".concat(e.value,"-is-selected"),active:"".concat(e.value,"-is-active"),checked:"".concat(e.value,"-is-checked"),current:"".concat(e.value,"-is-current"),hidden:"".concat(e.value,"-is-hidden"),visible:"".concat(e.value,"-is-visible"),expanded:"".concat(e.value,"-is-expanded"),indeterminate:"".concat(e.value,"-is-indeterminate")}}))}}var ic=t.defineComponent({name:"TLoadingGradient",setup:function(){var e=rc();return t.onMounted((function(){var e=t.getCurrentInstance().refs.circle;t.nextTick((function(){!function(e){var t,n,r,o={};if(e&&"undefined"!=typeof window){var i=null===(t=window)||void 0===t||null===(n=t.getComputedStyle)||void 0===n?void 0:n.call(t,e),a=i.color,l=i.fontSize,s=null===(r=window)||void 0===r||null===(r=r.navigator)||void 0===r?void 0:r.userAgent,c=/Safari/.test(s)&&!/Chrome/.test(s),u=/(?=.*iPhone)[?=.*MicroMessenger]/.test(s)&&!/Chrome/.test(s);if((c||u)&&(o={transformOrigin:"0px 0px",transform:"scale(".concat(parseInt(l,10)/12,")")}),a&&yl()>11){var d=a.match(/[\d.]+/g),p=d?"rgba(".concat(d[0],", ").concat(d[1],", ").concat(d[2],", 0)"):"";sl(e,xl(xl({},o),{},{background:"conic-gradient(from 90deg at 50% 50%,".concat(p," 0deg, ").concat(a," 360deg)")}))}else sl(e,xl(xl({},o),{},{background:""}))}}(e)}))})),{classPrefix:e}},render:function(){var e=this.classPrefix,n="".concat(e,"-loading__gradient"),r=[n,"".concat(e,"-icon-loading")];return t.createVNode("svg",{class:r,viewBox:"0 0 12 12",version:"1.1",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("foreignObject",{x:"0",y:"0",width:"12",height:"12"},[t.createVNode("div",{class:"".concat(n,"-conic"),ref:"circle"},null)])])}}),ac=function(e,t,n,r){var o=(n-t)/2,i=e/(r/2);return i<1?o*i*i*i+t:o*((i-=2)*i*i+2)+t},lc={exports:{}},sc={exports:{}};(function(){var e,t,n,r,o,i;"undefined"!=typeof performance&&null!==performance&&performance.now?sc.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(sc.exports=function(){return(e()-o)/1e6},t=process.hrtime,r=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),i=1e9*process.uptime(),o=r-i):Date.now?(sc.exports=function(){return Date.now()-n},n=Date.now()):(sc.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(Ys);for(var cc=sc.exports,uc="undefined"==typeof window?Ys:window,dc=["moz","webkit"],pc="AnimationFrame",fc=uc["request"+pc],hc=uc["cancel"+pc]||uc["cancelRequest"+pc],mc=0;!fc&&mc<dc.length;mc++)fc=uc[dc[mc]+"Request"+pc],hc=uc[dc[mc]+"Cancel"+pc]||uc[dc[mc]+"CancelRequest"+pc];if(!fc||!hc){var vc=0,gc=0,bc=[],yc=1e3/60;fc=function(e){if(0===bc.length){var t=cc(),n=Math.max(0,yc-(t-vc));vc=n+t,setTimeout((function(){var e=bc.slice(0);bc.length=0;for(var t=function(){if(!e[n].cancelled)try{e[n].callback(vc)}catch(t){setTimeout((function(){throw t}),0)}},n=0;n<e.length;n++)t()}),Math.round(n))}return bc.push({handle:++gc,callback:e,cancelled:!1}),gc},hc=function(e){for(var t=0;t<bc.length;t++)bc[t].handle===e&&(bc[t].cancelled=!0)}}lc.exports=function(e){return fc.call(uc,e)},lc.exports.cancel=function(){hc.apply(uc,arguments)},lc.exports.polyfill=function(e){e||(e=uc),e.requestAnimationFrame=fc,e.cancelAnimationFrame=hc};var wc=lc.exports,kc="undefined"==typeof window,xc=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},Cc=!kc&&document.addEventListener?function(e,t,n,r){e&&t&&n&&e.addEventListener(t,n,r)}:function(e,t,n){e&&t&&n&&e.attachEvent("on".concat(t),n)},Oc=!kc&&document.removeEventListener?function(e,t,n,r){e&&t&&e.removeEventListener(t,n,r)}:function(e,t,n){e&&t&&e.detachEvent("on".concat(t),n)};function Sc(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):" ".concat(e.className," ").indexOf(" ".concat(t," "))>-1}function Ec(e,t){if(e){for(var n=e.className,r=(t||"").split(" "),o=0,i=r.length;o<i;o++){var a=r[o];a&&(e.classList?e.classList.add(a):Sc(e,a)||(n+=" ".concat(a)))}e.classList||(e.className=n)}}function Nc(e,t){if(e&&t){for(var n=t.split(" "),r=" ".concat(e.className," "),o=0,i=n.length;o<i;o++){var a=n[o];a&&(e.classList?e.classList.remove(a):Sc(e,a)&&(r=r.replace(" ".concat(a," ")," ")))}e.classList||(e.className=xc(r))}}var _c=function(e,t){var n=R(e)?e(t):e;return n?fl(n)?document.querySelector(n):n instanceof HTMLElement?n:document.body:document.body};function Mc(e){return e&&e===e.window}function Ac(e,t){var n=t.container,r=void 0===n?window:n,o=t.duration,i=void 0===o?450:o,a=t.easing,l=void 0===a?ac:a,s=function(e,t){if(kc||!e)return 0;var n=t?"scrollLeft":"scrollTop",r=0;return Mc(e)?r=e[t?"pageXOffset":"pageYOffset"]:e instanceof Document?r=e.documentElement[n]:e&&(r=e[n]),r}(r),c=Date.now();return new Promise((function(t){wc((function n(){var o=Date.now()-c,a=l(Math.min(o,i),s,e,i);Mc(r)?r.scrollTo(window.pageXOffset,a):r instanceof Document||"HTMLDocument"===r.constructor.name?r.documentElement.scrollTop=a:r.scrollTop=a,wc(o<i?n:t)}))}))}var Tc=function(e){if(!(e instanceof HTMLFormElement))throw new Error("target must be HTMLFormElement");var t=document.createElement("input");t.type="submit",t.hidden=!0,e.appendChild(t),t.click(),e.removeChild(t)},Vc=ct,jc=Vr,Bc=we,Pc=ke,Ic=pt,Dc=Ve,Lc=rt,Rc=Ke,zc=Object.prototype.hasOwnProperty;const Fc=g((function(e){if(null==e)return!0;if(Ic(e)&&(Pc(e)||"string"==typeof e||"function"==typeof e.splice||Dc(e)||Rc(e)||Bc(e)))return!e.length;var t=jc(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Lc(e))return!Vc(e).length;for(var n in e)if(zc.call(e,n))return!1;return!0}));var $c=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i},Hc=$c;var Uc=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Hc(e,t,n)},Wc=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var qc=function(e){return Wc.test(e)};var Kc=function(e){return e.split("")},Gc="\\ud800-\\udfff",Yc="["+Gc+"]",Xc="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Zc="\\ud83c[\\udffb-\\udfff]",Jc="[^"+Gc+"]",Qc="(?:\\ud83c[\\udde6-\\uddff]){2}",eu="[\\ud800-\\udbff][\\udc00-\\udfff]",tu="(?:"+Xc+"|"+Zc+")"+"?",nu="[\\ufe0e\\ufe0f]?",ru=nu+tu+("(?:\\u200d(?:"+[Jc,Qc,eu].join("|")+")"+nu+tu+")*"),ou="(?:"+[Jc+Xc+"?",Xc,Qc,eu,Yc].join("|")+")",iu=RegExp(Zc+"(?="+Zc+")|"+ou+ru,"g");var au=Kc,lu=qc,su=function(e){return e.match(iu)||[]};var cu=Uc,uu=qc,du=function(e){return lu(e)?su(e):au(e)},pu=_o;var fu=function(e){return function(t){t=pu(t);var n=uu(t)?du(t):void 0,r=n?n[0]:t.charAt(0),o=n?cu(n,1).join(""):t.slice(1);return r[e]()+o}}("toUpperCase"),hu=_o,mu=fu;var vu=function(e){return mu(hu(e).toLowerCase())};var gu=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n};var bu=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),yu=_o,wu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ku=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var xu=function(e){return(e=yu(e))&&e.replace(wu,bu).replace(ku,"")},Cu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Ou=function(e){return e.match(Cu)||[]},Su=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Eu=function(e){return Su.test(e)},Nu="\\ud800-\\udfff",_u="\\u2700-\\u27bf",Mu="a-z\\xdf-\\xf6\\xf8-\\xff",Au="A-Z\\xc0-\\xd6\\xd8-\\xde",Tu="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Vu="["+Tu+"]",ju="\\d+",Bu="["+_u+"]",Pu="["+Mu+"]",Iu="[^"+Nu+Tu+ju+_u+Mu+Au+"]",Du="(?:\\ud83c[\\udde6-\\uddff]){2}",Lu="[\\ud800-\\udbff][\\udc00-\\udfff]",Ru="["+Au+"]",zu="(?:"+Pu+"|"+Iu+")",Fu="(?:"+Ru+"|"+Iu+")",$u="(?:['’](?:d|ll|m|re|s|t|ve))?",Hu="(?:['’](?:D|LL|M|RE|S|T|VE))?",Uu="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Wu="[\\ufe0e\\ufe0f]?",qu=Wu+Uu+("(?:\\u200d(?:"+["[^"+Nu+"]",Du,Lu].join("|")+")"+Wu+Uu+")*"),Ku="(?:"+[Bu,Du,Lu].join("|")+")"+qu,Gu=RegExp([Ru+"?"+Pu+"+"+$u+"(?="+[Vu,Ru,"$"].join("|")+")",Fu+"+"+Hu+"(?="+[Vu,Ru+zu,"$"].join("|")+")",Ru+"?"+zu+"+"+$u,Ru+"+"+Hu,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ju,Ku].join("|"),"g");var Yu=Ou,Xu=Eu,Zu=_o,Ju=function(e){return e.match(Gu)||[]};var Qu=gu,ed=xu,td=function(e,t,n){return e=Zu(e),void 0===(t=n?void 0:t)?Xu(e)?Ju(e):Yu(e):e.match(t)||[]},nd=RegExp("['’]","g");var rd=function(e){return function(t){return Qu(td(ed(t).replace(nd,"")),e,"")}},od=vu;const id=g(rd((function(e,t,n){return t=t.toLowerCase(),e+(n?od(t):t)})));const ad=g(rd((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})));function ld(e){var n;return y(e)&&"defaultNode"in e?n=e.defaultNode:(t.isVNode(e)||fl(e))&&(n=e),n}function sd(e){return y(e)&&"params"in e?e.params:{}}function cd(e,t,n){var r,o,i,a,l=null===(r=(o=e.$slots)[id(n)])||void 0===r?void 0:r.call(o,t);return l||((l=null===(i=(a=e.$slots)[ad(n)])||void 0===i?void 0:i.call(a,t))||null)}var ud=function(e,n,r){var o,i=sd(r),a=ld(r);if(n in e&&(o=e[n]),!1!==o&&null!==o)return!0===o&&a?cd(e,i,n)||a:R(o)?o(t.h,i):[void 0,i,""].includes(o)&&(e.$slots[id(n)]||e.$slots[ad(n)])?cd(e,i,n):o},dd={attach:{type:[String,Function],default:""},content:{type:[String,Function]},default:{type:[String,Function]},delay:{type:Number,default:0},fullscreen:Boolean,indicator:{type:[Boolean,Function],default:!0},inheritColor:Boolean,loading:{type:Boolean,default:!0},preventScrollThrough:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},size:{type:String,default:"medium"},text:{type:[String,Function]},zIndex:{type:Number}},pd=function(e,n){var r=R(e)?t.computed(e):t.ref(e),o=R(n)?t.computed(n):t.ref(n),i=t.ref(),a=function(){i.value=_c(r.value,o.value)};return t.onMounted((function(){return a()})),t.watch([r,o],(function(){return a()})),i},fd=t.defineComponent({name:"TLoading",inheritAttrs:!1,props:dd,setup:function(e,n){var r=n.slots,o=t.ref(!1),i={name:rc("loading"),centerClass:rc("loading--center"),fullscreenClass:rc("loading__fullscreen"),lockClass:rc("loading--lock"),overlayClass:rc("loading__overlay"),relativeClass:rc("loading__parent"),fullClass:rc("loading--full"),inheritColorClass:rc("loading--inherit-color")},a=i.name,l=i.centerClass,s=i.fullscreenClass,c=i.lockClass,u=i.overlayClass,d=i.relativeClass,p=i.fullClass,f=i.inheritColorClass,h=rc(),v=oc().SIZE,g=function(){o.value=!1;var t=setTimeout((function(){o.value=!0,clearTimeout(t)}),e.delay)},b=pd((function(){return e.attach})),y=t.computed((function(){return Boolean(!e.delay||e.delay&&o.value)})),w=t.computed((function(){var t={};return void 0!==e.zIndex&&(t.zIndex=e.zIndex),["small","medium","large"].includes(e.size)||(t["font-size"]=e.size),t})),k=t.computed((function(){return Boolean(e.default||r.default||e.content||r.content)})),x=t.computed((function(){return e.preventScrollThrough&&e.fullscreen})),C=t.computed((function(){return Boolean(e.text||r.text)})),O=t.computed((function(){return k.value&&e.loading&&y.value})),S=t.computed((function(){return e.fullscreen&&e.loading&&y.value})),E=t.computed((function(){return e.attach&&e.loading&&y.value})),N=t.computed((function(){return e.attach&&e.loading&&y.value})),_=t.computed((function(){var t=[l.value,v.value[e.size],m({},f.value,e.inheritColor)],n=[a.value,s.value,l.value,u.value];return{baseClasses:t,attachClasses:t.concat([a.value,p.value,m({},u.value,e.showOverlay)]),withContentClasses:t.concat([a.value,p.value,m({},u.value,e.showOverlay)]),fullScreenClasses:n,normalClasses:t.concat([a.value])}})),M=t.toRefs(e).loading;return t.watch([M],(function(e){ll(e,1)[0]?(g(),x.value&&Ec(document.body,c.value)):x.value&&Nc(document.body,c.value)})),t.onMounted((function(){e.delay&&g()})),{classPrefix:h,relativeClass:d,delayShowLoading:o,styles:w,showText:C,hasContent:k,classes:_,lockFullscreen:x,showWrapLoading:O,showNormalLoading:E,showFullScreenLoading:S,showAttachedLoading:N,teleportElement:b}},render:function(){var e,n,r,o,i,a,l,s,c,u,d=this,p=this.classes,f=p.fullScreenClasses,h=p.baseClasses,m=p.withContentClasses,v=p.attachClasses,g=p.normalClasses,b=t.createVNode(ic,{size:this.size},null),y=this.loading&&ud(this,"indicator",b),w=this.showText&&t.createVNode("div",{class:"".concat(this.classPrefix,"-loading__text")},[ud(this,"text")]);return this.fullscreen?this.showFullScreenLoading&&this.loading?t.createVNode(t.Teleport,{disabled:!this.attach||!this.teleportElement,to:this.teleportElement},{default:function(){return[t.createVNode("div",t.mergeProps({class:f,style:d.styles},d.$attrs),[t.createVNode("div",{class:h},[y,w])])]}}):null:this.hasContent?t.createVNode("div",t.mergeProps({class:this.relativeClass},this.$attrs),[(e=this,n="default",r="content",i=sd(o),a=ld(o),l=i?{params:i}:void 0,s=ud(e,n,l),c=ud(e,r,l),u=Fc(s)?c:s,Fc(u)?a:u),this.showWrapLoading&&t.createVNode("div",{class:m,style:this.styles},[y,w])]):this.attach?this.showAttachedLoading&&this.loading?t.createVNode(t.Teleport,{disabled:!this.attach||!this.teleportElement,to:this.teleportElement},{default:function(){return[t.createVNode("div",t.mergeProps({class:v,style:d.styles},d.$attrs),[y,w])]}}):null:this.loading?t.createVNode("div",t.mergeProps({class:g,style:this.styles},this.$attrs),[y,w]):null}});function hd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var md=null;function vd(e){var n=function(e){return al({fullscreen:!1,attach:"body",loading:!0,preventScrollThrough:!0},e)}(e);if(n.fullscreen&&md)return md;var r=t.defineComponent({setup:function(){return{loadingOptions:t.reactive(n)}},render:function(){return t.h(fd,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hd(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},this.loadingOptions))}}),o=_c(n.fullscreen?"body":n.attach),i=t.createApp(r),a=i.mount(document.createElement("div")),l=rc("loading__parent--relative").value,s=rc("loading--lock");return n.preventScrollThrough&&n.fullscreen&&Ec(document.body,s.value),o?Ec(o,l):console.error("attach is not exist"),{hide:function(){a.loading=!1,Nc(o,l),Nc(document.body,s.value),i.unmount()}}}function gd(e){return!0===e?md=vd({fullscreen:!0,loading:!0,attach:"body",preventScrollThrough:!0}):!1===e?(null===(t=md)||void 0===t||t.hide(),void(md=null)):vd(e);var t}var bd=gd;bd.install=function(e){e.config.globalProperties.$loading=gd};var yd=Symbol("TdLoading"),wd=function(e,t){var n=t.modifiers,r=n.fullscreen,o=n.inheritColor,i={attach:function(){return e},fullscreen:null!=r&&r,inheritColor:null!=o&&o,loading:t.value};y(t.value)&&yi(t.value,(function(e,t){i[t]=e})),e[yd]={options:i,instance:bd(i)}},kd={mounted:function(e,t){t.value&&wd(e,t)},updated:function(e,t){var n,r=e[yd],o=t.value,i=t.oldValue;ki(o,i)||((null!==(n=null==o?void 0:o.loading)&&void 0!==n?n:o)?wd(e,t):null==r||r.instance.hide())},unmounted:function(e){var t;null===(t=e[yd])||void 0===t||t.instance.hide()}};function xd(e,t,n){var r=e;return r.install=function(o,i){o.component(t||i||r.name,e),n&&o.directive(n.name,n.comp)},r}var Cd=xd(fd,fd.name,{name:"loading",comp:kd}),Od={block:Boolean,content:{type:[String,Function]},default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},ghost:Boolean,href:{type:String,default:""},icon:{type:Function},loading:Boolean,shape:{type:String,default:"rectangle",validator:function(e){return!e||["rectangle","square","round","circle"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return!e||["extra-small","small","medium","large"].includes(e)}},suffix:{type:Function},tag:{type:String,validator:function(e){return!e||["button","a","div"].includes(e)}},theme:{type:String,validator:function(e){return!e||["default","primary","danger","warning","success"].includes(e)}},type:{type:String,default:"button",validator:function(e){return!e||["submit","reset","button"].includes(e)}},variant:{type:String,default:"base",validator:function(e){return!e||["base","outline","dashed","text"].includes(e)}},onClick:Function},Sd=Zs.expand,Ed=Zs.ripple,Nd=Zs.fade;function _d(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function Md(e,n){var r,o,i=t.ref(null),a=rc(),l=(r=tc("animation").globalConfig,{keepExpand:(o=function(e){var t,n,o=r.value;return o&&!(null!==(t=o.exclude)&&void 0!==t&&t.includes(e))&&(null===(n=o.include)||void 0===n?void 0:n.includes(e))})(Sd),keepRipple:o(Ed),keepFade:o(Nd)}).keepRipple,s=function(t){var r=e.value,o=function(e,t){var n;if(t)return t;if(null!=e&&null!==(n=e.dataset)&&void 0!==n&&n.ripple)return e.dataset.ripple;var r=getComputedStyle(e).getPropertyValue("--ripple-color");return r||"rgba(0, 0, 0, 0.35)"}(r,null==n?void 0:n.value);if(0===t.button&&e&&l&&!(r.classList.contains("".concat(a.value,"-is-active"))||r.classList.contains("".concat(a.value,"-is-disabled"))||r.classList.contains("".concat(a.value,"-is-checked"))||r.classList.contains("".concat(a.value,"-is-loading")))){var s=getComputedStyle(r),c=parseInt(s.borderWidth,10),u=c>0?c:0,d=r.offsetWidth,p=r.offsetHeight;null===i.value.parentNode&&(_d(i.value,{position:"absolute",left:"".concat(0-u,"px"),top:"".concat(0-u,"px"),width:"".concat(d,"px"),height:"".concat(p,"px"),borderRadius:s.borderRadius,pointerEvents:"none",overflow:"hidden"}),r.appendChild(i.value));var f=document.createElement("div");_d(f,{marginTop:"0",marginLeft:"0",right:"".concat(d,"px"),width:"".concat(d+20,"px"),height:"100%",transition:"transform ".concat(200,"ms cubic-bezier(.38, 0, .24, 1), background ").concat(400,"ms linear"),transform:"skewX(-8deg)",pointerEvents:"none",position:"absolute",zIndex:0,backgroundColor:o,opacity:"0.9"});for(var h=new WeakMap,m=r.children.length,v=0;v<m;++v){var g=r.children[v];""===g.style.zIndex&&g!==i.value&&(g.style.zIndex="1",h.set(g,!0))}var b=r.style.position?r.style.position:getComputedStyle(r).position;""!==b&&"static"!==b||(r.style.position="relative"),i.value.insertBefore(f,i.value.firstChild),setTimeout((function(){f.style.transform="translateX(".concat(d,"px)")}),0);var y=function t(){f.style.backgroundColor="rgba(0, 0, 0, 0)",e.value&&(e.value.removeEventListener("pointerup",t,!1),e.value.removeEventListener("pointerleave",t,!1),setTimeout((function(){f.remove(),0===i.value.children.length&&i.value.remove()}),500))};e.value.addEventListener("pointerup",y,!1),e.value.addEventListener("pointerleave",y,!1)}};t.onMounted((function(){var t=null==e?void 0:e.value;t&&(i.value=document.createElement("div"),t.addEventListener("pointerdown",s,!1))})),t.onUnmounted((function(){var t;null==e||null===(t=e.value)||void 0===t||t.removeEventListener("pointerdown",s,!1)}))}function Ad(e,t,n){var r,o,i,a,l=null===(r=(o=e.slots)[id(t)])||void 0===r?void 0:r.call(o,n);return l&&l.filter((function(e){return"Symbol(v-cmt)"!==e.type.toString()})).length||(l=null===(i=(a=e.slots)[ad(t)])||void 0===i?void 0:i.call(a,n))&&l.filter((function(e){return"Symbol(v-cmt)"!==e.type.toString()})).length?l:null}function Td(e){return!![void 0,null,""].includes(e)||!(e instanceof Array?e:[e]).filter((function(e){var t;return"Symbol(Comment)"!==(null==e||null===(t=e.type)||void 0===t?void 0:t.toString())})).length}var Vd=function(){var e=t.getCurrentInstance();return function(n,r){var o,i=sd(r),a=ld(r),l=function(e){return y(e)&&"slotFirst"in e?e.slotFirst:{}}(r);if(Object.keys(e.props).includes(n)&&(o=e.props[n]),!1!==o&&null!==o)return!0===o?Ad(e,n,i)||a:R(o)?o(t.h,i):([void 0,i,""].includes(o)||l)&&(e.slots[id(n)]||e.slots[ad(n)])?Ad(e,n,i):o}},jd=function(){var e=Vd();return function(t,n){var r=ld(n);return e(t,n)||r}},Bd=function(){var e=Vd();return function(t,n,r){var o=sd(r),i=ld(r),a=o?{params:o}:void 0,l=e(t,a),s=e(n,a),c=Td(l)?s:l;return Td(c)?i:c}},Pd=P,Id=de;const Dd=g((function(e){return!0===e||!1===e||Id(e)&&"[object Boolean]"==Pd(e)}));function Ld(e){var n=t.getCurrentInstance(),r=t.computed((function(){return n.props.disabled})),o=t.inject("formDisabled",Object.create(null));return t.computed((function(){var t;return Dd(null==e?void 0:e.beforeDisabled.value)?e.beforeDisabled.value:Dd(r.value)?r.value:Dd(null==e?void 0:e.afterDisabled.value)?e.afterDisabled.value:!!Dd(null===(t=o.disabled)||void 0===t?void 0:t.value)&&o.disabled.value}))}function Rd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rd(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fd=xd(t.defineComponent({name:"TButton",props:Od,setup:function(e,n){var r=n.attrs,o=n.slots,i=Vd(),a=Bd(),l=rc("button"),s=oc(),c=s.STATUS,u=s.SIZE,d=t.ref();Md(d);var f=Ld(),h=t.computed((function(){var t=e.theme,n=e.variant;return t||("base"===n?"primary":"default")})),v=t.computed((function(){return["".concat(l.value),"".concat(l.value,"--variant-").concat(e.variant),"".concat(l.value,"--theme-").concat(h.value),m(m(m(m(m(m({},u.value[e.size],"medium"!==e.size),c.value.disabled,f.value),c.value.loading,e.loading),"".concat(l.value,"--shape-").concat(e.shape),"rectangle"!==e.shape),"".concat(l.value,"--ghost"),e.ghost),u.value.block,e.block)]}));return function(){var n=a("default","content"),s=e.loading?t.createVNode(Cd,{inheritColor:!0},null):i("icon"),c=s&&!n,u=e.suffix||o.suffix?t.createVNode("span",{className:"".concat(l.value,"__suffix")},[i("suffix")]):null;n=n?t.createVNode("span",{class:"".concat(l.value,"__text")},[n]):"",s&&(n=[s,n]),u&&(n=[n].concat(u));var h={class:[].concat(p(v.value),[m({},"".concat(l.value,"--icon-only"),c)]),type:e.type,disabled:f.value||e.loading,href:e.href,tabindex:f.value?void 0:"0"};return t.h(!e.tag&&e.href?"a":e.tag||"button",zd(zd(zd({ref:d},r),h),{},{onClick:e.onClick}),[n])}}}));function $d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ud(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hd(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wd(e,n){var r=Object.keys(e.attrs).reduce(((t,n)=>{var r;return t[(r=n,["fillOpacity","fillRule","clipRule"].includes(r)?r.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():r)]=e.attrs[n],t}),{});return t.h(e.tag,Ud(Ud({},r),n),(e.children||[]).map((e=>Wd(e,{}))))}const qd={classPrefix:"t",locale:"zh-CN"};function Kd(e){var n=function(){var{classPrefix:e}=qd;return{SIZE:{default:"",xs:"".concat(e,"-size-xs"),small:"".concat(e,"-size-s"),medium:"".concat(e,"-size-m"),large:"".concat(e,"-size-l"),xl:"".concat(e,"-size-xl"),block:"".concat(e,"-size-full-width")},STATUS:{loading:"".concat(e,"-is-loading"),disabled:"".concat(e,"-is-disabled"),focused:"".concat(e,"-is-focused"),success:"".concat(e,"-is-success"),error:"".concat(e,"-is-error"),warning:"".concat(e,"-is-warning"),selected:"".concat(e,"-is-selected"),active:"".concat(e,"-is-active"),checked:"".concat(e,"-is-checked"),current:"".concat(e,"-is-current"),hidden:"".concat(e,"-is-hidden"),visible:"".concat(e,"-is-visible"),expanded:"".concat(e,"-is-expanded"),indeterminate:"".concat(e,"-is-indeterminate")}}}().SIZE,r=t.computed((()=>e.value in n?n[e.value]:""));return{style:t.computed((()=>void 0===e.value||e.value in n?{}:{fontSize:e.value})),className:r}}function Gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gd(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Xd={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M13 4v7h7v2h-7v7h-2v-7H4v-2h7V4h2z"}}]};const Zd=t.defineComponent({name:"AddIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-add",i.value])),s=t.computed((()=>Yd(Yd({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Xd,c.value)}});function Jd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jd(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ep={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4 4h16v2H4V4zm8 3.59l6.91 6.91-1.41 1.41-4.5-4.5V21h-2v-9.59l-4.5 4.5-1.41-1.41L12 7.59z"}}]};const tp=t.defineComponent({name:"BacktopIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-backtop",i.value])),s=t.computed((()=>Qd(Qd({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(ep,c.value)}});function np(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?np(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):np(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var op={tag:"svg",attrs:{fill:"none",viewBox:"0 0 26 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4 1.59l6.17 6.17 7.07 7.07L23.41 21 22 22.41l-2.97-2.96A12.5 12.5 0 011.08 12.3L1 12l.1-.3c.77-2.4 2.24-4.5 4.18-6.02L2.59 3 4 1.59zM6.7 7.1A10.53 10.53 0 003.1 12a10.5 10.5 0 0014.45 5.97l-1.8-1.8a5 5 0 01-6.93-6.93L6.7 7.11zm3.6 3.6a3 3 0 004 4l-4-4zM13 5c-.58 0-1.14.05-1.7.14l-.98.16L10 3.32l.99-.16A12.5 12.5 0 0124.9 11.7l.1.31-.1.3c-.41 1.3-1.03 2.5-1.82 3.58l-.59.8-1.61-1.18.59-.8c.6-.82 1.08-1.73 1.42-2.7A10.5 10.5 0 0013 5zm.51 1.93l.96.29a5 5 0 013.31 3.31l.3.96-1.92.58-.3-.95a3 3 0 00-1.98-1.99l-.95-.3.58-1.9z"}}]};const ip=t.defineComponent({name:"BrowseOffIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-browse-off",i.value])),s=t.computed((()=>rp(rp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(op,c.value)}});function ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ap(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ap(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"g",attrs:{clipPath:"url(#clip0_8726_7319)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.1 12a10.5 10.5 0 0019.8 0 10.5 10.5 0 00-19.8 0zm-2.01-.3a12.5 12.5 0 0123.82 0l.1.3-.1.3a12.5 12.5 0 01-23.82 0l-.1-.3.1-.3zM12 9a3 3 0 100 6 3 3 0 000-6zm-5 3a5 5 0 1110 0 5 5 0 01-10 0z"}}]}]};const cp=t.defineComponent({name:"BrowseIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-browse",i.value])),s=t.computed((()=>lp(lp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(sp,c.value)}});function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?up(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 23a11 11 0 100-22 11 11 0 000 22zM7.5 10.59l3 3 6-6L17.91 9l-7.41 7.41L6.09 12l1.41-1.41z"}}]};const fp=t.defineComponent({name:"CheckCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-check-circle-filled",i.value])),s=t.computed((()=>dp(dp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(pp,c.value)}});function hp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var vp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M17.5 8.09l-5.5 5.5-5.5-5.5L5.09 9.5 12 16.41l6.91-6.91-1.41-1.41z"}}]};const gp=t.defineComponent({name:"ChevronDownIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-chevron-down",i.value])),s=t.computed((()=>mp(mp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(vp,c.value)}});function bp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bp(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M15.91 17.5l-5.5-5.5 5.5-5.5-1.41-1.41L7.59 12l6.91 6.91 1.41-1.41z"}}]};const kp=t.defineComponent({name:"ChevronLeftIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-chevron-left",i.value])),s=t.computed((()=>yp(yp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(wp,c.value)}});function xp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xp(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Op={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.09 17.5l5.5-5.5-5.5-5.5L9.5 5.09 16.41 12 9.5 18.91 8.09 17.5z"}}]};const Sp=t.defineComponent({name:"ChevronRightIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-chevron-right",i.value])),s=t.computed((()=>Cp(Cp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Op,c.value)}});function Ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Np(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ep(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ep(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _p={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M17.5 15.91l-5.5-5.5-5.5 5.5-1.41-1.41L12 7.59l6.91 6.91-1.41 1.41z"}}]};const Mp=t.defineComponent({name:"ChevronUpIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-chevron-up",i.value])),s=t.computed((()=>Np(Np({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(_p,c.value)}});function Ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ap(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ap(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Vp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 23a11 11 0 100-22 11 11 0 000 22zM8.82 7.4L12 10.6l3.18-3.19 1.42 1.42L13.4 12l3.19 3.18-1.42 1.42L12 13.4 8.82 16.6 7.4 15.18 10.6 12 7.4 8.82 8.82 7.4z"}}]};const jp=t.defineComponent({name:"CloseCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-close-circle-filled",i.value])),s=t.computed((()=>Tp(Tp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Vp,c.value)}});function Bp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bp(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ip={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7.05 5.64L12 10.59l4.95-4.95 1.41 1.41L13.41 12l4.95 4.95-1.41 1.41L12 13.41l-4.95 4.95-1.41-1.41L10.59 12 5.64 7.05l1.41-1.41z"}}]};const Dp=t.defineComponent({name:"CloseIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-close",i.value])),s=t.computed((()=>Pp(Pp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Ip,c.value)}});function Lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lp(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7.5 1h9v3H22v2h-2.03l-.5 17H4.53l-.5-17H2V4h5.5V1zm2 3h5V3h-5v1zM6.03 6l.44 15h11.06l.44-15H6.03zM13 8v11h-2V8h2z"}}]};const Fp=t.defineComponent({name:"DeleteIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-delete",i.value])),s=t.computed((()=>Rp(Rp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(zp,c.value)}});function $p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$p(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Up={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M13 3v9.59l3.5-3.5 1.41 1.41L12 16.41 6.09 10.5 7.5 9.09l3.5 3.5V3h2zM4.5 14v5h15v-5h2v7h-19v-7h2z"}}]};const Wp=t.defineComponent({name:"DownloadIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-download",i.value])),s=t.computed((()=>Hp(Hp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Up,c.value)}});function qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qp(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Gp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 1a11 11 0 110 22 11 11 0 010-22zm-1 13h2V6.5h-2V14zm2 1.5h-2v2h2v-2z"}}]};const Yp=t.defineComponent({name:"ErrorCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-error-circle-filled",i.value])),s=t.computed((()=>Kp(Kp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Gp,c.value)}});function Xp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xp(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jp={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 23a11 11 0 100-22 11 11 0 000 22zm-.17-11.11c.43-.53.97-.97 1.4-1.32A2 2 0 0012 7a2 2 0 00-1.89 1.33l-.33.95L7.9 8.6l.34-.94a4 4 0 116.24 4.47 7 7 0 00-1.1 1.01c-.27.34-.37.61-.37.85v1.25h-2V14c0-.87.39-1.57.83-2.11zM11 18.25v-2h2v2h-2z"}}]};const Qp=t.defineComponent({name:"HelpCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-help-circle-filled",i.value])),s=t.computed((()=>Zp(Zp({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Jp,c.value)}});function ef(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ef(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nf={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.59l5-5L14.41 14 13 15.41l-4-4-5 5V20h8v2H2V2zm13.55 5a1 1 0 100 2 1 1 0 000-2zm-3 1a3 3 0 116 0 3 3 0 01-6 0zm3.62 6.76L19 17.59l2.83-2.83 1.41 1.41L20.41 19l2.83 2.83-1.41 1.41L19 20.41l-2.83 2.83-1.41-1.41L17.59 19l-2.83-2.83 1.41-1.41z"}}]};const rf=t.defineComponent({name:"ImageErrorIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-image-error",i.value])),s=t.computed((()=>tf(tf({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(nf,c.value)}});function of(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?of(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):of(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lf={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v20H2V2zm2 18h13.59L9 11.41l-5 5V20zm16-.41V4H4v9.59l5-5 11 11zM15.55 7a1 1 0 100 2 1 1 0 000-2zm-3 1a3 3 0 116 0 3 3 0 01-6 0z"}}]};const sf=t.defineComponent({name:"ImageIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-image",i.value])),s=t.computed((()=>af(af({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(lf,c.value)}});function cf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cf(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var df={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 23a11 11 0 100-22 11 11 0 000 22zM11 8.5v-2h2v2h-2zm2 1.5v7.5h-2V10h2z"}}]};const pf=t.defineComponent({name:"InfoCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-info-circle-filled",i.value])),s=t.computed((()=>uf(uf({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(df,c.value)}});function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ff(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ff(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mf={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M13 2v20h-2V2h2zM9 4.64V18.5H1.3L9 4.64zm6 0l7.7 13.86H15V4.64zM4.7 16.5H7v-4.14L4.7 16.5zM17 12.36v4.14h2.3L17 12.36z"}}]};const vf=t.defineComponent({name:"MirrorIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-mirror",i.value])),s=t.computed((()=>hf(hf({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(mf,c.value)}});function gf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gf(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yf={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4 11h16v2H4v-2z"}}]};const wf=t.defineComponent({name:"RemoveIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-remove",i.value])),s=t.computed((()=>bf(bf({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(yf,c.value)}});function kf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kf(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Cf={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4 2v9a9 9 0 019 9h9v2H2V2h2zm0 18h7a7 7 0 00-7-7v7z"}}]};const Of=t.defineComponent({name:"RotationIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-rotation",i.value])),s=t.computed((()=>xf(xf({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Cf,c.value)}});function Sf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sf(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Nf={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M15.1 5.9a6.5 6.5 0 10-9.2 9.2 6.5 6.5 0 009.2-9.2zM4.49 4.5a8.5 8.5 0 0112.69 11.27l5.34 5.35-1.41 1.41-5.35-5.34A8.5 8.5 0 014.5 4.49zM11.5 6.5v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2z"}}]};const _f=t.defineComponent({name:"ZoomInIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-zoom-in",i.value])),s=t.computed((()=>Ef(Ef({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Nf,c.value)}});function Mf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mf(Object(n),!0).forEach((function(t){$d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Tf={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M15.1 5.9a6.5 6.5 0 10-9.2 9.2 6.5 6.5 0 009.2-9.2zM4.49 4.5a8.5 8.5 0 0112.69 11.27l5.34 5.35-1.41 1.41-5.35-5.34A8.5 8.5 0 014.5 4.49zM6.5 11.5v-2h8v2h-8z"}}]};const Vf=t.defineComponent({name:"ZoomOutIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,n){var{attrs:r}=n,o=t.computed((()=>e.size)),{className:i,style:a}=Kd(o),l=t.computed((()=>["t-icon","t-icon-zoom-out",i.value])),s=t.computed((()=>Af(Af({},a.value),r.style))),c=t.computed((()=>({class:l.value,style:s.value,onClick:t=>{var n;return null===(n=e.onClick)||void 0===n?void 0:n.call(e,{e:t})}})));return()=>Wd(Tf,c.value)}});var jf={align:{type:String,default:"center",validator:function(e){return!e||["left","right","center"].includes(e)}},content:{type:[String,Function]},dashed:Boolean,default:{type:[String,Function]},layout:{type:String,default:"horizontal",validator:function(e){return!e||["horizontal","vertical"].includes(e)}},theme:{type:String,validator:function(e){return!e||["horizontal","vertical"].includes(e)}}};function Bf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Pf=t.defineComponent({name:"TDivider",props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bf(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},jf),setup:function(e){var n=rc("divider"),r=Bd();return function(){var o=e.layout,i=e.dashed,a=e.align,l=r("default","content"),s=["".concat(n.value),["".concat(n.value,"--").concat(o)],m(m(m({},"".concat(n.value,"--dashed"),!!i),"".concat(n.value,"--with-text"),!!l),"".concat(n.value,"--with-text-").concat(a),!!l)];return t.createVNode("div",{class:s},[l&&t.createVNode("span",{class:"".concat(n.value,"__inner-text")},[l])])}}}),If=xd(Pf),Df={align:{type:String,validator:function(e){return!e||["start","end","center","baseline"].includes(e)}},breakLine:Boolean,direction:{type:String,default:"horizontal",validator:function(e){return!e||["vertical","horizontal"].includes(e)}},separator:{type:[String,Function]},size:{type:[String,Number,Array],default:"medium"}};function Lf(){var e=t.getCurrentInstance();return function(n,r){var o,i;r||(r=e.slots);var a=(null===(o=r)||void 0===o||null===(i=o.default)||void 0===i?void 0:i.call(o))||[],l=[];return function e(n){if(xe(n))return n.forEach((function(n){if(n.children&&xe(n.children)){if(n.type!==t.Fragment)return;e(n.children)}else l.push(n)})),l}(a).filter((function(e){var t;return null===(t=e.type.name)||void 0===t?void 0:t.endsWith(n)}))}}function Rf(){var e=t.getCurrentInstance();return function(){var n,r=e.slots;return((null==r||null===(n=r.default)||void 0===n?void 0:n.call(r))||[]).filter((function(e){return!("symbol"===f(e.type)&&!e.children)&&e.type!==t.Comment})).map((function(e){return e.children&&xe(e.children)&&e.type===t.Fragment?e.children:e})).flat()}}function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ff(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zf(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $f={small:"8px",medium:"16px",large:"24px"},Hf=function(){var e,t,n;if("undefined"==typeof navigator||!navigator)return!1;var r=navigator.userAgent,o=r.match(/AppleWebKit.+Chrome\/(.+) Safari\/.+/i);if(Number(null==o||null===(e=o[1])||void 0===e?void 0:e.split(".")[0])<100)return!0;var i=r.match(/AppleWebKit.+Version\/(.+) Safari\/.+/i);if(Number(null==i||null===(t=i[1])||void 0===t?void 0:t.split(".")[0])<12)return!0;if(yl()<=11)return!0;var a=r.match(/Firefox\/(.+)/i);return Number(null==a||null===(n=a[1])||void 0===n?void 0:n.split(".")[0])<100}(),Uf=xd(t.defineComponent({name:"TSpace",props:Ff(Ff({},Df),{},{forceFlexGapPolyfill:Boolean}),setup:function(e){var n=rc("space"),r=Vd(),o=Rf(),i=t.computed((function(){return e.forceFlexGapPolyfill||Hf})),a=t.computed((function(){var t="";xe(e.size)?t=e.size.map((function(e){return bl(e)?"".concat(e,"px"):fl(e)&&$f[e]||e})).join(" "):fl(e.size)?t=$f[e.size]||e.size:bl(e.size)&&(t="".concat(e.size,"px"));var n={};if(i.value){var r=ll(t.split(" "),2),o=r[0],a=r[1];n["--td-space-column-gap"]=o,n["--td-space-row-gap"]=a||o}else n.gap=t;return n}));return function(){var l,s,c=["".concat(n.value),m(m(m(m({},"".concat(n.value,"-align-").concat(e.align),e.align),"".concat(n.value,"-").concat(e.direction),e.direction),"".concat(n.value,"--break-line"),e.breakLine),"".concat(n.value,"--polyfill"),i.value)];return t.createVNode("div",{class:c,style:a.value},[(l=o(),s=r("separator"),l.map((function(e,r){var o=r+1!==l.length&&s;return t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"".concat(n.value,"-item")},[e]),o&&t.createVNode("div",{class:"".concat(n.value,"-item-separator")},[s])])})))])}}}));const Wf=g((function(e){return null==e}));function qf(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(c){return void n(c)}l.done?t(s):Promise.resolve(s).then(r,o)}function Kf(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){qf(i,r,o,a,l,"next",e)}function l(e){qf(i,r,o,a,l,"throw",e)}a(void 0)}))}}var Gf={exports:{}},Yf={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Yf);var Xf=Yf.exports;!function(e){var t=Xf.default;function n(){e.exports=n=function(){return o},e.exports.__esModule=!0,e.exports.default=e.exports;var r,o={},i=Object.prototype,a=i.hasOwnProperty,l=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",d=s.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(P){p=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof w?t:w,i=Object.create(o.prototype),a=new j(r||[]);return l(i,"_invoke",{value:M(e,n,a)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}o.wrap=f;var m="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function k(){}function x(){}var C={};p(C,c,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(B([])));S&&S!==i&&a.call(S,c)&&(C=S);var E=x.prototype=w.prototype=Object.create(C);function N(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,n){function r(o,i,l,s){var c=h(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==t(d)&&a.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,l,s)}),(function(e){r("throw",e,l,s)})):n.resolve(d).then((function(e){u.value=e,l(u)}),(function(e){return r("throw",e,l,s)}))}s(c.arg)}var o;l(this,"_invoke",{value:function(e,t){function i(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(i,i):i()}})}function M(e,t,n){var o=m;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var s=A(l,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var c=h(e,t,n);if("normal"===c.type){if(o=n.done?b:v,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=b,n.method="throw",n.arg=c.arg)}}}function A(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,A(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=h(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,y;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,y):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return k.prototype=x,l(E,"constructor",{value:x,configurable:!0}),l(x,"constructor",{value:k,configurable:!0}),k.displayName=p(x,d,"GeneratorFunction"),o.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===k||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,p(e,d,"GeneratorFunction")),e.prototype=Object.create(E),e},o.awrap=function(e){return{__await:e}},N(_.prototype),p(_.prototype,u,(function(){return this})),o.AsyncIterator=_,o.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var a=new _(f(e,t,n,r),i);return o.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(E),p(E,d,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),o.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},o.values=B,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(V),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return l.type="throw",l.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),V(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;V(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),y}},o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Gf);var Zf=(0,Gf.exports)(),Jf=Zf;try{regeneratorRuntime=Zf}catch(noe){"object"==typeof globalThis?globalThis.regeneratorRuntime=Zf:Function("r","regeneratorRuntime = r")(Zf)}const Qf=g(Jf);function eh(e){var t=tc("icon").globalConfig,n={};return Object.keys(e).forEach((function(r){var o;n[r]=(null===(o=t.value)||void 0===o?void 0:o[r])||e[r]})),n}var th="top",nh="bottom",rh="right",oh="left",ih="auto",ah=[th,nh,rh,oh],lh="start",sh="end",ch="clippingParents",uh="viewport",dh="popper",ph="reference",fh=ah.reduce((function(e,t){return e.concat([t+"-"+lh,t+"-"+sh])}),[]),hh=[].concat(ah,[ih]).reduce((function(e,t){return e.concat([t,t+"-"+lh,t+"-"+sh])}),[]),mh=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function vh(e){return e?(e.nodeName||"").toLowerCase():null}function gh(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function bh(e){return e instanceof gh(e).Element||e instanceof Element}function yh(e){return e instanceof gh(e).HTMLElement||e instanceof HTMLElement}function wh(e){return"undefined"!=typeof ShadowRoot&&(e instanceof gh(e).ShadowRoot||e instanceof ShadowRoot)}const kh={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];yh(o)&&vh(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});yh(r)&&vh(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function xh(e){return e.split("-")[0]}var Ch=Math.max,Oh=Math.min,Sh=Math.round;function Eh(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Nh(){return!/^((?!chrome|android).)*safari/i.test(Eh())}function _h(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&yh(e)&&(o=e.offsetWidth>0&&Sh(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Sh(r.height)/e.offsetHeight||1);var a=(bh(e)?gh(e):window).visualViewport,l=!Nh()&&n,s=(r.left+(l&&a?a.offsetLeft:0))/o,c=(r.top+(l&&a?a.offsetTop:0))/i,u=r.width/o,d=r.height/i;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s,x:s,y:c}}function Mh(e){var t=_h(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Ah(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&wh(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Th(e){return gh(e).getComputedStyle(e)}function Vh(e){return["table","td","th"].indexOf(vh(e))>=0}function jh(e){return((bh(e)?e.ownerDocument:e.document)||window.document).documentElement}function Bh(e){return"html"===vh(e)?e:e.assignedSlot||e.parentNode||(wh(e)?e.host:null)||jh(e)}function Ph(e){return yh(e)&&"fixed"!==Th(e).position?e.offsetParent:null}function Ih(e){for(var t=gh(e),n=Ph(e);n&&Vh(n)&&"static"===Th(n).position;)n=Ph(n);return n&&("html"===vh(n)||"body"===vh(n)&&"static"===Th(n).position)?t:n||function(e){var t=/firefox/i.test(Eh());if(/Trident/i.test(Eh())&&yh(e)&&"fixed"===Th(e).position)return null;var n=Bh(e);for(wh(n)&&(n=n.host);yh(n)&&["html","body"].indexOf(vh(n))<0;){var r=Th(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Dh(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Lh(e,t,n){return Ch(e,Oh(t,n))}function Rh(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function zh(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Fh(e){return e.split("-")[1]}var $h={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Hh(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,l=e.position,s=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,f=void 0===p?0:p,h=a.y,m=void 0===h?0:h,v="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var g=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),y=oh,w=th,k=window;if(c){var x=Ih(n),C="clientHeight",O="clientWidth";if(x===gh(n)&&"static"!==Th(x=jh(n)).position&&"absolute"===l&&(C="scrollHeight",O="scrollWidth"),o===th||(o===oh||o===rh)&&i===sh)w=nh,m-=(d&&x===k&&k.visualViewport?k.visualViewport.height:x[C])-r.height,m*=s?1:-1;if(o===oh||(o===th||o===nh)&&i===sh)y=rh,f-=(d&&x===k&&k.visualViewport?k.visualViewport.width:x[O])-r.width,f*=s?1:-1}var S,E=Object.assign({position:l},c&&$h),N=!0===u?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Sh(n*o)/o||0,y:Sh(r*o)/o||0}}({x:f,y:m},gh(n)):{x:f,y:m};return f=N.x,m=N.y,s?Object.assign({},E,((S={})[w]=b?"0":"",S[y]=g?"0":"",S.transform=(k.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",S)):Object.assign({},E,((t={})[w]=b?m+"px":"",t[y]=g?f+"px":"",t.transform="",t))}var Uh={passive:!0};var Wh={left:"right",right:"left",bottom:"top",top:"bottom"};function qh(e){return e.replace(/left|right|bottom|top/g,(function(e){return Wh[e]}))}var Kh={start:"end",end:"start"};function Gh(e){return e.replace(/start|end/g,(function(e){return Kh[e]}))}function Yh(e){var t=gh(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xh(e){return _h(jh(e)).left+Yh(e).scrollLeft}function Zh(e){var t=Th(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Jh(e){return["html","body","#document"].indexOf(vh(e))>=0?e.ownerDocument.body:yh(e)&&Zh(e)?e:Jh(Bh(e))}function Qh(e,t){var n;void 0===t&&(t=[]);var r=Jh(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=gh(r),a=o?[i].concat(i.visualViewport||[],Zh(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(Qh(Bh(a)))}function em(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function tm(e,t,n){return t===uh?em(function(e,t){var n=gh(e),r=jh(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;var c=Nh();(c||!c&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l+Xh(e),y:s}}(e,n)):bh(t)?function(e,t){var n=_h(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):em(function(e){var t,n=jh(e),r=Yh(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ch(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ch(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+Xh(e),s=-r.scrollTop;return"rtl"===Th(o||n).direction&&(l+=Ch(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(jh(e)))}function nm(e,t,n,r){var o="clippingParents"===t?function(e){var t=Qh(Bh(e)),n=["absolute","fixed"].indexOf(Th(e).position)>=0&&yh(e)?Ih(e):e;return bh(n)?t.filter((function(e){return bh(e)&&Ah(e,n)&&"body"!==vh(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],l=i.reduce((function(t,n){var o=tm(e,n,r);return t.top=Ch(o.top,t.top),t.right=Oh(o.right,t.right),t.bottom=Oh(o.bottom,t.bottom),t.left=Ch(o.left,t.left),t}),tm(e,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function rm(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?xh(o):null,a=o?Fh(o):null,l=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(i){case th:t={x:l,y:n.y-r.height};break;case nh:t={x:l,y:n.y+n.height};break;case rh:t={x:n.x+n.width,y:s};break;case oh:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var c=i?Dh(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case lh:t[c]=t[c]-(n[u]/2-r[u]/2);break;case sh:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function om(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,l=n.boundary,s=void 0===l?ch:l,c=n.rootBoundary,u=void 0===c?uh:c,d=n.elementContext,p=void 0===d?dh:d,f=n.altBoundary,h=void 0!==f&&f,m=n.padding,v=void 0===m?0:m,g=Rh("number"!=typeof v?v:zh(v,ah)),b=p===dh?ph:dh,y=e.rects.popper,w=e.elements[h?b:p],k=nm(bh(w)?w:w.contextElement||jh(e.elements.popper),s,u,a),x=_h(e.elements.reference),C=rm({reference:x,element:y,strategy:"absolute",placement:o}),O=em(Object.assign({},y,C)),S=p===dh?O:x,E={top:k.top-S.top+g.top,bottom:S.bottom-k.bottom+g.bottom,left:k.left-S.left+g.left,right:S.right-k.right+g.right},N=e.modifiersData.offset;if(p===dh&&N){var _=N[o];Object.keys(E).forEach((function(e){var t=[rh,nh].indexOf(e)>=0?1:-1,n=[th,nh].indexOf(e)>=0?"y":"x";E[e]+=_[n]*t}))}return E}function im(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function am(e){return[th,rh,nh,oh].some((function(t){return e[t]>=0}))}function lm(e,t,n){void 0===n&&(n=!1);var r,o,i=yh(t),a=yh(t)&&function(e){var t=e.getBoundingClientRect(),n=Sh(t.width)/e.offsetWidth||1,r=Sh(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),l=jh(t),s=_h(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==vh(t)||Zh(l))&&(c=(r=t)!==gh(r)&&yh(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:Yh(r)),yh(t)?((u=_h(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):l&&(u.x=Xh(l))),{x:s.left+c.scrollLeft-u.x,y:s.top+c.scrollTop-u.y,width:s.width,height:s.height}}function sm(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var cm={placement:"bottom",modifiers:[],strategy:"absolute"};function um(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function dm(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?cm:o;return function(e,t,n){void 0===n&&(n=i);var o,a,l={placement:"bottom",orderedModifiers:[],options:Object.assign({},cm,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],c=!1,u={state:l,setOptions:function(n){var o="function"==typeof n?n(l.options):n;d(),l.options=Object.assign({},i,l.options,o),l.scrollParents={reference:bh(e)?Qh(e):e.contextElement?Qh(e.contextElement):[],popper:Qh(t)};var a,c,p=function(e){var t=sm(e);return mh.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((a=[].concat(r,l.options.modifiers),c=a.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(c).map((function(e){return c[e]}))));return l.orderedModifiers=p.filter((function(e){return e.enabled})),l.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:l,name:t,instance:u,options:r}),a=function(){};s.push(i||a)}})),u.update()},forceUpdate:function(){if(!c){var e=l.elements,t=e.reference,n=e.popper;if(um(t,n)){l.rects={reference:lm(t,Ih(n),"fixed"===l.options.strategy),popper:Mh(n)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<l.orderedModifiers.length;r++)if(!0!==l.reset){var o=l.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,d=o.name;"function"==typeof i&&(l=i({state:l,options:s,name:d,instance:u})||l)}else l.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){u.forceUpdate(),e(l)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(o())}))}))),a}),destroy:function(){d(),c=!0}};if(!um(e,t))return u;function d(){s.forEach((function(e){return e()})),s=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var pm=dm({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,l=void 0===a||a,s=gh(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,Uh)})),l&&s.addEventListener("resize",n.update,Uh),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Uh)})),l&&s.removeEventListener("resize",n.update,Uh)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=rm({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,l=n.roundOffsets,s=void 0===l||l,c={placement:xh(t.placement),variation:Fh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Hh(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Hh(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},kh,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=hh.reduce((function(e,n){return e[n]=function(e,t,n){var r=xh(e),o=[oh,th].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],l=i[1];return a=a||0,l=(l||0)*o,[oh,rh].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}(n,t.rects,i),e}),{}),l=a[t.placement],s=l.x,c=l.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,l=void 0===a||a,s=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=xh(v),b=s||(g===v||!h?[qh(v)]:function(e){if(xh(e)===ih)return[];var t=qh(e);return[Gh(e),t,Gh(t)]}(v)),y=[v].concat(b).reduce((function(e,n){return e.concat(xh(n)===ih?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,l=n.flipVariations,s=n.allowedAutoPlacements,c=void 0===s?hh:s,u=Fh(r),d=u?l?fh:fh.filter((function(e){return Fh(e)===u})):ah,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=om(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[xh(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,k=t.rects.popper,x=new Map,C=!0,O=y[0],S=0;S<y.length;S++){var E=y[S],N=xh(E),_=Fh(E)===lh,M=[th,nh].indexOf(N)>=0,A=M?"width":"height",T=om(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),V=M?_?rh:oh:_?nh:th;w[A]>k[A]&&(V=qh(V));var j=qh(V),B=[];if(i&&B.push(T[N]<=0),l&&B.push(T[V]<=0,T[j]<=0),B.every((function(e){return e}))){O=E,C=!1;break}x.set(E,B)}if(C)for(var P=function(e){var t=y.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},I=h?3:1;I>0;I--){if("break"===P(I))break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,l=void 0!==a&&a,s=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,v=om(t,{boundary:s,rootBoundary:c,padding:d,altBoundary:u}),g=xh(t.placement),b=Fh(t.placement),y=!b,w=Dh(g),k="x"===w?"y":"x",x=t.modifiersData.popperOffsets,C=t.rects.reference,O=t.rects.popper,S="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,E="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,_={x:0,y:0};if(x){if(i){var M,A="y"===w?th:oh,T="y"===w?nh:rh,V="y"===w?"height":"width",j=x[w],B=j+v[A],P=j-v[T],I=f?-O[V]/2:0,D=b===lh?C[V]:O[V],L=b===lh?-O[V]:-C[V],R=t.elements.arrow,z=f&&R?Mh(R):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=F[A],H=F[T],U=Lh(0,C[V],z[V]),W=y?C[V]/2-I-U-$-E.mainAxis:D-U-$-E.mainAxis,q=y?-C[V]/2+I+U+H+E.mainAxis:L+U+H+E.mainAxis,K=t.elements.arrow&&Ih(t.elements.arrow),G=K?"y"===w?K.clientTop||0:K.clientLeft||0:0,Y=null!=(M=null==N?void 0:N[w])?M:0,X=j+q-Y,Z=Lh(f?Oh(B,j+W-Y-G):B,j,f?Ch(P,X):P);x[w]=Z,_[w]=Z-j}if(l){var J,Q="x"===w?th:oh,ee="x"===w?nh:rh,te=x[k],ne="y"===k?"height":"width",re=te+v[Q],oe=te-v[ee],ie=-1!==[th,oh].indexOf(g),ae=null!=(J=null==N?void 0:N[k])?J:0,le=ie?re:te-C[ne]-O[ne]-ae+E.altAxis,se=ie?te+C[ne]+O[ne]-ae-E.altAxis:oe,ce=f&&ie?(de=Lh(le,te,ue=se))>ue?ue:de:Lh(f?le:re,te,f?se:oe);x[k]=ce,_[k]=ce-te}var ue,de;t.modifiersData[r]=_}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,l=xh(n.placement),s=Dh(l),c=[oh,rh].indexOf(l)>=0?"height":"width";if(i&&a){var u=function(e,t){return Rh("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:zh(e,ah))}(o.padding,n),d=Mh(i),p="y"===s?th:oh,f="y"===s?nh:rh,h=n.rects.reference[c]+n.rects.reference[s]-a[s]-n.rects.popper[c],m=a[s]-n.rects.reference[s],v=Ih(i),g=v?"y"===s?v.clientHeight||0:v.clientWidth||0:0,b=h/2-m/2,y=u[p],w=g-d[c]-u[f],k=g/2-d[c]/2+b,x=Lh(y,k,w),C=s;n.modifiersData[r]=((t={})[C]=x,t.centerOffset=x-k,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Ah(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=om(t,{elementContext:"reference"}),l=om(t,{altBoundary:!0}),s=im(a,r),c=im(l,o,i),u=am(s),d=am(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),fm=C,hm=/\s/;var mm=function(e){for(var t=e.length;t--&&hm.test(e.charAt(t)););return t},vm=/^\s+/;var gm=function(e){return e?e.slice(0,mm(e)+1).replace(vm,""):e},bm=b,ym=lo,wm=/^[-+]0x[0-9a-f]+$/i,km=/^0b[01]+$/i,xm=/^0o[0-7]+$/i,Cm=parseInt;var Om=b,Sm=function(){return fm.Date.now()},Em=function(e){if("number"==typeof e)return e;if(ym(e))return NaN;if(bm(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=bm(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=gm(e);var n=km.test(e);return n||xm.test(e)?Cm(e.slice(2),n?2:8):wm.test(e)?NaN:+e},Nm=Math.max,_m=Math.min;var Mm=function(e,t,n){var r,o,i,a,l,s,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function h(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=i}function m(){var e=Sm();if(h(e))return v(e);l=setTimeout(m,function(e){var n=t-(e-s);return d?_m(n,i-(e-c)):n}(e))}function v(e){return l=void 0,p&&r?f(e):(r=o=void 0,a)}function g(){var e=Sm(),n=h(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(m,t),u?f(e):a}(s);if(d)return clearTimeout(l),l=setTimeout(m,t),f(s)}return void 0===l&&(l=setTimeout(m,t)),a}return t=Em(t)||0,Om(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Nm(Em(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=o=l=void 0},g.flush=function(){return void 0===l?a:v(Sm())},g};const Am=g(Mm);function Tm(e,n,r,o){var i=t.getCurrentInstance(),a=i.emit,l=i.vnode,s=t.ref(),c=l.props||{};return Object.prototype.hasOwnProperty.call(c,o)||Object.prototype.hasOwnProperty.call(c,ad(o))?[e,function(e){a("update:".concat(o),e);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];null==r||r.apply(void 0,[e].concat(n))}]:(s.value=n,[s,function(e){s.value=e;for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];null==r||r.apply(void 0,[e].concat(n))}])}function Vm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vm(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bm(e,n,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"value",a=t.getCurrentInstance(),l=a.emit,s=a.vnode,c=t.ref(),u=s.props||{},d=Object.prototype.hasOwnProperty.call(u,"modelValue")||Object.prototype.hasOwnProperty.call(u,"model-value"),p=Object.prototype.hasOwnProperty.call(u,i)||Object.prototype.hasOwnProperty.call(u,ad(i));return d?[n,function(e){l("update:modelValue",e);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];null==o||o.apply(void 0,[e].concat(n))}]:p?[e,function(e){l("update:".concat(i),e);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];null==o||o.apply(void 0,[e].concat(n))}]:(c.value=r,[c,function(e){c.value=e;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];null==o||o.apply(void 0,[e].concat(n))}])}var Pm=new Set,Im={warn:function(e,t){console.warn("TDesign ".concat(e," Warn: ").concat(t))},warnOnce:function(e,t){var n="TDesign ".concat(e," Warn: ").concat(t);Pm.has(n)||(Pm.add(n),console.warn(n))},error:function(e,t){console.error("TDesign ".concat(e," Error: ").concat(t))},errorOnce:function(e,t){var n="TDesign ".concat(e," Error: ").concat(t);Pm.has(n)||(Pm.add(n),console.error(n))},info:function(e,t){console.info("TDesign ".concat(e," Info: ").concat(t))}};function Dm(e){var n=t.ref("");return t.watch([e],(function(e,t){var r,o=ll(e,1)[0];ll(t,1)[0]!==o&&("string"!=typeof o?(r=o,new Promise((function(e){if(r){var t=new FileReader;t.readAsDataURL(r),t.onload=function(t){var n;e(null===(n=t.target)||void 0===n?void 0:n.result)}}else e("")}))).then((function(e){n.value=e})):n.value=o)}),{immediate:!0}),{previewUrl:n}}var Lm={attach:{type:[String,Function],default:"body"},content:{type:[String,Function]},default:{type:[String,Function]},delay:{type:[Number,Array]},destroyOnClose:Boolean,disabled:Boolean,hideEmptyPopup:Boolean,overlayClassName:{type:[String,Object,Array]},overlayInnerClassName:{type:[String,Object,Array]},overlayInnerStyle:{type:[Boolean,Object,Function]},overlayStyle:{type:[Boolean,Object,Function]},placement:{type:String,default:"top"},popperOptions:{type:Object},showArrow:Boolean,trigger:{type:String,default:"hover",validator:function(e){return!e||["hover","click","focus","mousedown","context-menu"].includes(e)}},triggerElement:{type:[String,Function]},visible:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultVisible:Boolean,zIndex:{type:Number},onOverlayClick:Function,onScroll:Function,onScrollToBottom:Function,onVisibleChange:Function};function Rm(e,n){if("undefined"!=typeof window&&(window&&window.ResizeObserver)){var r=null,o=function(){r&&e.value&&(r.unobserve(e.value),r.disconnect(),r=null)};e&&t.watch(e,(function(e){o(),e&&function(e){(r=new ResizeObserver(n)).observe(e)}(e)}),{immediate:!0,flush:"post"}),t.onBeforeUnmount((function(){o()}))}}function zm(){var e=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n){xe(n)?e.push.apply(e,p(n)):n.type===t.Fragment?e.push.apply(e,p(zm(n.children))):e.push(n)})),e.filter((function(e){return!(e&&(e.type===t.Comment||e.type===t.Fragment&&0===e.children.length||e.type===t.Text&&""===e.children.trim()))}))}function Fm(e){var n=t.getCurrentInstance(),r=t.ref();return t.onMounted((function(){r.value=e(n)})),t.onUpdated((function(){var t=e(n);r.value!==t&&(r.value=t)})),r}var $m=t.defineComponent({name:"TPopupTrigger",props:{forwardRef:Function},emits:["resize"],setup:function(e,n){var r=n.emit,o=n.slots,i=Fm((function(e){return e.parent.vnode.el.nextElementSibling})),a=t.ref();return t.watch(i,(function(){var t;null===(t=e.forwardRef)||void 0===t||t.call(e,i.value)})),Rm(i,(function(e){var t=ll(e,1)[0].contentRect;a.value=t})),t.watch(a,(function(e,t){var n,o;o=t,!(n=e)&&!o||n&&o&&!["width","height","x","y"].some((function(e){return n[e]!==o[e]}))||r("resize")})),function(){var e,n,r=zm(null===(e=o.default)||void 0===e?void 0:e.call(o));return r.length>1||(null===(n=r[0])||void 0===n?void 0:n.type)===t.Text?t.createVNode("span",null,[r]):r[0]}}}),Hm=t.defineComponent({name:"TPopupContent",emits:["resize"],setup:function(e,n){var r=n.emit,o=n.slots;return Rm(Fm((function(e){return e.vnode.el.children[0]})),(function(){r("resize")})),function(){return t.createVNode("div",{style:"position: absolute; top: 0px; left: 0px; width: 100%"},[o.default()])}}}),Um=t.defineComponent({name:"TPopupContainer",inheritAttrs:!1,props:{parent:Object,visible:Boolean,attach:Lm.attach,forwardRef:Function},emits:["resize","contentMounted"],setup:function(e,n){var r=n.emit,o=n.attrs,i=n.slots,a=n.expose,l=t.ref(),s=t.ref(!1);function c(){r("resize")}return t.onMounted((function(){requestAnimationFrame((function(){s.value=e.visible}))})),t.watch((function(){return e.visible}),(function(t){t&&(s.value=e.visible)})),a({unmountContent:function(){s.value=!1}}),function(){var n,a,u=function(){return _c(e.attach,l.value)};return t.createVNode(t.Fragment,null,[t.createVNode($m,{class:o.class,forwardRef:function(t){e.forwardRef(t),l.value=t},onResize:c},(a=n=i.default(),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!t.isVNode(a)?n:{default:function(){return[n]}})),s.value&&t.createVNode(t.Teleport,{disabled:!u(),to:u()},{default:function(){return[t.createVNode(Hm,{onResize:c,onVnodeMounted:function(){return r("contentMounted")}},{default:function(){return[i.content&&i.content()]}})]}})])}}});function Wm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wm(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Km="data-td-popup",Gm="data-td-popup-parent";function Ym(e,t){var n=[],r=[Gm,Km];return e?(t&&r.unshift(r.pop()),function e(t){document.querySelectorAll("[".concat(r[0],'="').concat(t,'"]')).forEach((function(o){n.push(o);var i=o.getAttribute(r[1]);i&&i!==t&&e(i)}))}(e),n):n}var Xm=Symbol();var Zm=xd(t.defineComponent({name:"TPopup",props:qm(qm({},Lm),{},{expandAnimation:{type:Boolean}}),setup:function(e,n){var r,o,i,a,l=n.expose,s=t.toRefs(e),c=ll(Bm(s.visible,s.modelValue,e.defaultVisible,e.onVisibleChange,"visible"),2),u=c[0],d=c[1],p=Vd(),f=Bd(),h=t.ref(null),v=t.ref(null),g=t.ref(null),b=t.ref(null),w=t.ref(!1),k="undefined"!=typeof process&&null!==(r=process.env)&&void 0!==r&&r.TEST?"":Date.now().toString(36),x=t.inject(Xm,void 0);t.provide(Xm,{id:k,assertMouseLeave:D});var C,O,S=rc("popup"),E=oc().STATUS,N=t.computed((function(){var t,n,r="hover"!==e.trigger?[0,0]:[].concat(null!==(t=e.delay)&&void 0!==t?t:[250,150]);return{show:r[0],hide:null!==(n=r[1])&&void 0!==n?n:r[0]}})),_=(C=h,O=[],{add:function(e,t){e&&(Cc(C.value,e,t),O.push((function(){Oc(C.value,e,t)})))},clean:function(){O.forEach((function(e){return null==e?void 0:e()})),O.length=0}});function M(){var t=e.overlayStyle;if(h.value&&v.value)return R(t)?t(h.value,v.value):y(t)?t:void 0}function A(){var t=e.overlayInnerStyle;h.value&&v.value&&(R(t)?sl(v.value,t(h.value,v.value)):y(t)&&sl(v.value,t))}function T(){var n;if(g.value&&u.value)if(o)if(h.value.getRootNode()instanceof ShadowRoot)o.state.elements.reference=h.value,o.update();else{for(var r=h.value.getBoundingClientRect(),i=h.value;i&&i!==document.body;)i=i.parentElement;i!==document.body||0===r.width&&0===r.height?d(!1,{trigger:P({type:"mouseenter"})}):(o.state.elements.reference=h.value,o.update())}else o=pm(h.value,g.value,qm({placement:(n=e.placement,n.replace(/-(left|top)$/,"-start").replace(/-(right|bottom)$/,"-end")),onFirstUpdate:function(){t.nextTick(T)}},e.popperOptions))}function V(){var t,n;o&&(null===(t=o)||void 0===t||t.destroy(),o=null);e.destroyOnClose&&(null===(n=b.value)||void 0===n||n.unmountContent())}function j(e){B(),a=setTimeout((function(){d(!1,{trigger:P(e),e:e})}),N.value.hide)}function B(){clearTimeout(i),clearTimeout(a)}function P(e){switch(null==e?void 0:e.type){case"mouseenter":case"mouseleave":return"trigger-element-hover";case"focusin":return"trigger-element-focus";case"focusout":return"trigger-element-blur";case"click":return"trigger-element-click";case"context-menu":case"keydown":return"keydown-esc";case"mousedown":return"document";default:return"trigger-element-close"}}function I(e){var t,n;if(!(null!==(t=g.value)&&void 0!==t&&t.contains(e.target)||null!==(n=h.value)&&void 0!==n&&n.contains(e.target))){var r=Ym(k).find((function(t){return t.contains(e.target)}));r&&Ym(r.getAttribute(Gm),!0).some((function(e){return e===g.value}))||j(e)}}function D(t){(w.value=!1,"hover"!==e.trigger||h.value.contains(t.target))||(Ym(k).some((function(e){var n=e.getBoundingClientRect();return t.x>n.x&&t.x<n.x+n.width&&t.y>n.y&&t.y<n.y+n.height}))||(j(t),null==x||x.assertMouseLeave(t)))}function L(){w.value=!0,u.value&&"hover"===e.trigger&&B()}function z(t){var n;null===(n=e.onOverlayClick)||void 0===n||n.call(e,{e:t})}t.watch((function(){return[e.trigger,h.value]}),(function(){h.value&&(_.clean(),_.add({hover:"mouseenter",focus:"focusin","context-menu":"contextmenu",click:"click"}[e.trigger],(function(t){e.disabled||("contextmenu"===t.type&&t.preventDefault(),"click"!==t.type&&"contextmenu"!==t.type||!u.value?function(e){B(),i=setTimeout((function(){d(!0,{trigger:P(e)})}),N.value.show)}(t):j(t))})),_.add({hover:"mouseleave",focus:"focusout"}[e.trigger],j))})),t.watch((function(){return[e.overlayStyle,e.overlayInnerStyle,v.value]}),(function(){A(),T()})),t.watch((function(){return e.placement}),(function(){V(),T()})),t.watch((function(){return u.value}),(function(t){if(t)return Cc(document,"mousedown",I,!0),void("focus"===e.trigger&&(n=h.value,r="keydown",a=R(o=function(e){var t,n="undefined"!=typeof process&&null!==(t=process.env)&&void 0!==t&&t.TEST?"27":"Escape";e.code===n&&j(e)})?o:o.handleEvent,Cc(n,r,(function e(t){a(t),Oc(n,r,e,i)}),i)));var n,r,o,i,a;Oc(document,"mousedown",I,!0)})),t.onUnmounted((function(){V(),B(),Oc(document,"mousedown",I,!0)})),l({update:T,getOverlay:function(){return v.value},getOverlayState:function(){return{hover:w.value}},close:function(){return j()}});var F=t.inject("updateScrollTop",void 0);function $(t){var n,r=t.target,o=r.scrollTop,i=r.clientHeight,a=r.scrollHeight,l=Am((function(t){var n;return null===(n=e.onScrollToBottom)||void 0===n?void 0:n.call(e,{e:t})}),100);i+Math.floor(o)===a&&l(t),null===(n=e.onScroll)||void 0===n||n.call(e,{e:t})}return t.watch((function(){return[u.value,v.value]}),(function(){u.value&&v.value&&F&&(null==F||F(v.value))})),function(){var n=p("content"),r=e.hideEmptyPopup&&["",void 0,null].includes(n),o=u.value||!e.destroyOnClose?t.withDirectives(t.createVNode("div",t.mergeProps(m(m({},Km,k),Gm,null==x?void 0:x.id),{class:[S.value,e.overlayClassName],ref:function(e){return g.value=e},style:[{zIndex:e.zIndex},M(),r&&{visibility:"hidden"}],onClick:z,onMouseenter:L,onMouseleave:D}),[t.createVNode("div",{class:["".concat(S.value,"__content"),m(m(m({},"".concat(S.value,"__content--text"),fl(e.content)),"".concat(S.value,"__content--arrow"),e.showArrow),E.value.disabled,e.disabled),e.overlayInnerClassName],ref:v,onScroll:$},[n,e.showArrow&&t.createVNode("div",{class:"".concat(S.value,"__arrow")},null)])]),[[t.vShow,u.value]]):null;return t.createVNode(Um,{ref:function(e){return b.value=e},forwardRef:function(e){return h.value=e},onContentMounted:function(){if(u.value){T();var e=setTimeout((function(){A(),clearTimeout(e)}),60)}},onResize:function(){u.value&&T()},visible:u.value,attach:e.attach},{content:function(){return t.createVNode(t.Transition,{name:"".concat(S.value,"--animation").concat(e.expandAnimation?"-expand":""),appear:!0,onEnter:T,onAfterLeave:V},"function"==typeof(n=o)||"[object Object]"===Object.prototype.toString.call(n)&&!t.isVNode(n)?o:{default:function(){return[o]}});var n},default:function(){return f("default","triggerElement")}})}}}));var Jm=Lo,Qm=$c;var ev=jo,tv=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},nv=function(e,t){return t.length<2?e:Jm(e,Qm(t,0,-1))},rv=Po;var ov=function(e,t){return t=ev(t,e),null==(e=nv(e,t))||delete e[rv(tv(t))]},iv=Zi;var av=function(e){return iv(e)?void 0:e},lv=we,sv=ke,cv=O?O.isConcatSpreadable:void 0;var uv=Zn,dv=function(e){return sv(e)||lv(e)||!!(cv&&e&&e[cv])};var pv=function e(t,n,r,o,i){var a=-1,l=t.length;for(r||(r=dv),i||(i=[]);++a<l;){var s=t[a];n>0&&r(s)?n>1?e(s,n-1,r,o,i):uv(i,s):o||(i[i.length]=s)}return i},fv=pv;var hv=function(e){return(null==e?0:e.length)?fv(e,1):[]},mv=Fa,vv=Ka;var gv=function(e){return vv(mv(e,void 0,hv),e+"")},bv=wo,yv=Us,wv=ov,kv=jo,xv=ia,Cv=av,Ov=Ul;const Sv=g(gv((function(e,t){var n={};if(null==e)return n;var r=!1;t=bv(t,(function(t){return t=kv(t,e),r||(r=t.length>1),t})),xv(e,Ov(e),n),r&&(n=yv(n,7,Cv));for(var o=t.length;o--;)wv(n,t[o]);return n})));var Ev={delay:{type:Number},destroyOnClose:{type:Boolean,default:!0},duration:{type:Number},placement:{type:String,default:"top"},showArrow:{type:Boolean,default:!0},theme:{type:String,default:"default",validator:function(e){return!e||["default","primary","success","danger","warning","light"].includes(e)}}};function Nv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nv(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mv=xd(t.defineComponent({name:"TTooltip",props:_v(_v({},Lm),Ev),setup:function(e,n){var r=t.ref(null),o=t.ref(null),i=t.toRefs(e),a=ll(Bm(i.visible,i.modelValue,e.defaultVisible,e.onVisibleChange,"visible"),2),l=a[0],s=a[1],c=t.getCurrentInstance(),u=t.ref(e.visible||e.defaultVisible),d=rc(),p=Vd(),f=Bd(),h=function(){var e=t.ref(0),n=t.ref(0),r=function(t){e.value=t.clientX,n.value=t.clientY};return kc||(t.onMounted((function(){window.addEventListener("mousemove",r,{passive:!0})})),t.onUnmounted((function(){window.removeEventListener("mousemove",r)}))),{x:e,y:n}}(),v=h.x,g=t.ref(v.value);t.onMounted((function(){e.duration&&u.value&&(r.value=setTimeout((function(){s(!1,{}),clearTimeout(r.value),r.value=null}),e.duration))}));var b=function(e,t){r.value&&"document"!==(null==t?void 0:t.trigger)||(e&&(g.value=v.value),s(e,t))},y=t.computed((function(){return["".concat(d.value,"-tooltip"),m({},"".concat(d.value,"-tooltip--").concat(e.theme),e.theme),e.overlayClassName]})),w=t.computed((function(){return _v(_v({},(null==c?void 0:c.vnode.props)||{}),{},{placement:"mouse"===e.placement?"bottom-left":e.placement,showArrow:"mouse"!==e.placement&&e.showArrow,overlayClassName:y.value,onVisibleChange:b,disabled:e.disabled})})),k=t.computed((function(){if("mouse"!==e.placement||0===g.value)return e.overlayInnerStyle;var t=function(e){return{transform:"translateX(".concat(g.value-e.getBoundingClientRect().left,"px)")}};return e.overlayInnerStyle?function(n,r){return _v(_v({},t(n)),R(e.overlayInnerStyle)?e.overlayInnerStyle(n,r):e.overlayInnerStyle)}:t}));t.watch((function(){return u.value}),(function(){r.value&&!u.value&&(clearTimeout(r.value),r.value=null)}));return n.expose({updatePopper:function(){var e,t;null===(e=o.value)||void 0===e||null===(t=e.update)||void 0===t||t.call(e)}}),function(){var n=p("content");return n||e.content?t.createVNode(Zm,t.mergeProps(Sv(w.value,["content","default"]),{ref:o,overlayInnerStyle:k.value,visible:l.value}),{default:function(){return[f("default","triggerElement")]},content:function(){return n}}):f("default","triggerElement")}}})),Av={active:Boolean,content:{type:[String,Function],default:""},disabled:Boolean,divider:Boolean,prefixIcon:{type:Function},theme:{type:String,default:"default",validator:function(e){return!e||["default","success","warning","error"].includes(e)}},value:{type:[String,Number,Object]},onClick:Function};function Tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vv(e,t){for(var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tv(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e),r=0;r<t.length;r++){delete n[t[r]]}return n}function jv(e){return bl(e)?"".concat(e,"px"):e}function Bv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bv(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Iv=t.defineComponent({name:"TDropdownItem",props:Pv(Pv({},Av),{},{maxColumnWidth:{type:[String,Number],default:100},minColumnWidth:{type:[String,Number],default:10},isSubmenu:Boolean}),setup:function(e){var n=Vd(),r=Bd(),o=t.ref();Md(e.isSubmenu?null:o);var i=n("prefixIcon"),a=rc("dropdown__item"),l=function(t){var n;e.disabled||null===(n=e.onClick)||void 0===n||n.call(e,e.value,{e:t})};return function(){var n=r("default","content"),s=[a.value,"".concat(a.value,"--theme-").concat(e.theme),m(m({},"".concat(a.value,"--active"),e.active),"".concat(a.value,"--disabled"),e.disabled)];return t.createVNode("li",{class:s,onClick:l,style:{maxWidth:jv(e.maxColumnWidth),minWidth:jv(e.minColumnWidth)},ref:o},[e.prefixIcon?t.createVNode("div",{class:"".concat(a.value,"-icon")},[i]):null,n])}}}),Dv={direction:{type:String,default:"right",validator:function(e){return!e||["left","right"].includes(e)}},disabled:Boolean,hideAfterItemClick:{type:Boolean,default:!0},maxColumnWidth:{type:[String,Number],default:100},maxHeight:{type:Number,default:300},minColumnWidth:{type:[String,Number],default:10},options:{type:Array,default:function(){return[]}},panelBottomContent:{type:[String,Function]},panelTopContent:{type:[String,Function]},placement:{type:String,default:"bottom-left",validator:function(e){return!e||["top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","left-top","left-bottom","right-top","right-bottom"].includes(e)}},popupProps:{type:Object},trigger:{type:String,default:"hover",validator:function(e){return!e||["hover","click","focus","context-menu"].includes(e)}},onClick:Function};function Lv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lv(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zv=t.defineComponent({name:"TDropdownMenu",props:Rv({},Dv),setup:function(e){var n=rc("dropdown"),r=rc("dropdown__menu"),o=t.reactive({}),i=t.ref(),a=t.ref(!1),l=eh({ChevronRightIcon:Sp}).ChevronRightIcon,s=function(e,t){var n=e.target.scrollTop;o[t]=n};t.onMounted((function(){var t;i.value&&(parseInt(null===(t=window)||void 0===t?void 0:t.getComputedStyle(i.value).height,10)>=e.maxHeight&&(a.value=!0))}));var c=function(e){return R(e)?e(t.h):e},u=function r(i,a){var u,d,p=[];return null===(u=i.forEach)||void 0===u||u.call(i,(function(i,u){var f=Rv({},i),h=u-Math.ceil(o[a]/30),v=h>=0?h:u;f.children?(f.children=r(f.children,a+1),d=t.createVNode("div",{key:u},[t.createVNode(Iv,{style:f.style,class:["".concat(n.value,"__item"),"".concat(n.value,"__item--suffix"),f.class],value:f.value,theme:f.theme,active:f.active,prefixIcon:f.prefixIcon,disabled:f.disabled,minColumnWidth:e.minColumnWidth,maxColumnWidth:e.maxColumnWidth,isSubmenu:!0},{default:function(){return[t.createVNode("div",{class:"".concat(n.value,"__item-content")},[t.createVNode("span",{class:"".concat(n.value,"__item-text")},[c(f.content)]),t.createVNode(l,{class:"".concat(n.value,"__item-direction"),size:"16"},null)]),t.createVNode("div",{class:["".concat(n.value,"__submenu-wrapper"),m({},"".concat(n.value,"__submenu-wrapper--").concat(e.direction),e.direction)],style:{position:"absolute",top:"".concat(30*v,"px")}},[t.createVNode("div",{class:["".concat(n.value,"__submenu"),m({},"".concat(n.value,"__submenu--disabled"),f.disabled)],style:{position:"static",maxHeight:"".concat(e.maxHeight,"px")},onScroll:function(e){return s(e,a+1)}},[t.createVNode("ul",null,[f.children])])])]}}),f.divider?t.createVNode(If,null,null):null])):d=t.createVNode("div",{key:u},[t.createVNode(Iv,{style:f.style,class:["".concat(n.value,"__item"),f.class],value:f.value,theme:f.theme,active:f.active,prefixIcon:f.prefixIcon,disabled:f.disabled,minColumnWidth:e.minColumnWidth,maxColumnWidth:e.maxColumnWidth,onClick:f.disabled||f.children?function(){return null}:function(t,n){return function(t){var n,r,o=t.data,i=t.context;null==o||null===(n=o.onClick)||void 0===n||n.call(o,o,i),null===(r=e.onClick)||void 0===r||r.call(e,o,i)}({data:f,context:n})}},{default:function(){return[t.createVNode("span",{class:"".concat(n.value,"__item-text")},[c(f.content)])]}}),f.divider?t.createVNode(If,null,null):null]),p.push(d)})),p};return function(){return t.createVNode("div",{class:[r.value,"".concat(r.value,"--").concat(e.direction),m({},"".concat(r.value,"--overflow"),a.value)],style:{maxHeight:"".concat(e.maxHeight,"px")},ref:i,onScroll:function(e){return s(e,0)}},[u(e.options,0)])}}});function Fv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fv(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hv=function e(t){var n,r,o;if(!t)return[];if("TDropdownMenu"===(null===(n=t[0])||void 0===n||null===(n=n.type)||void 0===n?void 0:n.name)){var i,a,l=null===(i=t[0])||void 0===i||null===(i=i.children)||void 0===i||null===(a=i.default)||void 0===a?void 0:a.call(i);if(xe(l))return e(l)}return xe(t)?(t=t.reduce((function(e,t){return e=e.concat(xe(t.children)?t.children:t)}),[])).map((function(t){var n,r,o,i,a,l,s,c,u,d,p=null===(n=t.children)||void 0===n||null===(r=n.content)||void 0===r?void 0:r.call(n),f=(null===(o=t.children)||void 0===o||null===(i=o.prefixIcon)||void 0===i?void 0:i.call(o))||(null===(a=t.children)||void 0===a||null===(l=a["prefix-icon"])||void 0===l?void 0:l.call(a)),h=null===(s=t.children)||void 0===s||null===(c=s.default)||void 0===c?void 0:c.call(s),m=null==h||null===(u=h.filter)||void 0===u?void 0:u.call(h,(function(e){var t;return!["TDropdownMenu","TDropdownItem"].includes(null===(t=e.type)||void 0===t?void 0:t.name)})),v=null==h||null===(d=h.filter)||void 0===d?void 0:d.call(h,(function(e){var t;return!fl(e.children)&&["TDropdownMenu","TDropdownItem"].includes(null===(t=e.type)||void 0===t?void 0:t.name)}));return $v($v($v({content:p||m||h},Object.keys(t.props||{}).reduce((function(e,n){var r;return""===t.props[n]&&"TDropdownItem"===(null===(r=t.type)||void 0===r?void 0:r.name)&&["active","divider","disabled"].includes(n)?e[id(n)]=!0:e[id(n)]=t.props[n],e}),{})),f?{prefixIcon:function(){return f}}:{}),{},{children:(null==v?void 0:v.length)>0?e(v):null})})).filter((function(e){return!!e.content})):xe(null===(r=t[0])||void 0===r?void 0:r.children)?e(null===(o=t[0])||void 0===o?void 0:o.children):[]};function Uv(e){var n,r,o,i,a=Lf(),l=t.getCurrentInstance(),s=(null===(n=a("DropdownMenu"))||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.children)||void 0===n||null===(r=n.default)||void 0===r?void 0:r.call(n))||(null===(o=l.slots)||void 0===o||null===(i=o.dropdown)||void 0===i?void 0:i.call(o));return t.computed((function(){return e.options&&e.options.length>0?e.options:Hv(s)}))}function Wv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wv(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kv=xd(t.defineComponent({name:"TDropdown",props:Dv,setup:function(e,n){var r=n.attrs,o=Vd(),i=rc("dropdown"),a=t.ref(null),l=t.ref(!1),s=t.computed((function(){var t,n=null===(t=e.popupProps)||void 0===t?void 0:t.delay;return bl(n)?n+10:xe(n)?n[1]+10:160})),c=function(t,n){var r,o,i,a,c;e.hideAfterItemClick&&(setTimeout((function(){return l.value=!1}),s.value),null===(o=e.popupProps)||void 0===o||null===(i=o.onVisibleChange)||void 0===i||i.call(o,!1,n),null===(a=e.popupProps)||void 0===a||null===(c=a["on-visible-change"])||void 0===c||c.call(a,!1,n));null==e||null===(r=e.onClick)||void 0===r||r.call(e,t,n)},u=function(t,n){var r,o,i,a;l.value=t,null===(r=e.popupProps)||void 0===r||null===(o=r.onVisibleChange)||void 0===o||o.call(r,t,n),null===(i=e.popupProps)||void 0===i||null===(a=i["on-visible-change"])||void 0===a||a.call(i,t,n)};return function(){var n,s,d=null===(n=o("default"))||void 0===n?void 0:n[0],p=Uv(e),f=qv(qv(qv({},r),{},{disabled:e.disabled,placement:e.placement,trigger:e.trigger},Sv(e.popupProps,["onVisibleChange","on-visible-change"])),{},{overlayInnerClassName:[i.value,null===(s=e.popupProps)||void 0===s?void 0:s.overlayInnerClassName]});return t.createVNode(Zm,t.mergeProps({destroyOnClose:!0,ref:a,visible:l.value,onVisibleChange:u,expandAnimation:!0},f),{default:function(){return[d]},content:function(){return t.createVNode(zv,t.mergeProps(Sv(e,"onClick"),{options:p.value,onClick:c}),null)}})}}})),Gv=xd(Iv),Yv=xd(zv);function Xv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}function Jv(e,t,n){return t&&Zv(e.prototype,t),n&&Zv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Qv=t.defineComponent({name:"TFakeArrow",props:{isActive:{type:Boolean},overlayClassName:{type:[String,Object,Array]},overlayStyle:{type:Object||String}},setup:function(e){var n=rc("fake-arrow");return{classes:t.computed((function(){return[n.value,m({},"".concat(n.value,"--active"),e.isActive),e.overlayClassName]}))}},render:function(){return t.createVNode("svg",{class:this.classes,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:this.overlayStyle},[t.createVNode("path",{d:"M3.75 5.7998L7.99274 10.0425L12.2361 5.79921",stroke:"black","stroke-opacity":"0.9","stroke-width":"1.3"},null)])}}),eg={align:{type:String,default:"left",validator:function(e){return!e||["left","center","right"].includes(e)}},allowInputOverMax:Boolean,autoWidth:Boolean,autocomplete:{type:String,default:void 0},autofocus:Boolean,borderless:Boolean,clearable:Boolean,disabled:Boolean,format:{type:Function},inputClass:{type:[String,Object,Array]},label:{type:[String,Function]},maxcharacter:{type:Number},maxlength:{type:[String,Number]},name:{type:String,default:""},placeholder:{type:String,default:void 0},prefixIcon:{type:Function},readonly:Boolean,showClearIconOnEmpty:Boolean,showLimitNumber:Boolean,size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},status:{type:String,default:void 0,validator:function(e){return!e||["default","success","warning","error"].includes(e)}},suffix:{type:[String,Function]},suffixIcon:{type:Function},tips:{type:[String,Function]},type:{type:String,default:"text",validator:function(e){return!e||["text","number","url","tel","password","search","submit","hidden"].includes(e)}},value:{type:[String,Number],default:void 0},modelValue:{type:[String,Number],default:void 0},defaultValue:{type:[String,Number]},onBlur:Function,onChange:Function,onClear:Function,onClick:Function,onCompositionend:Function,onCompositionstart:Function,onEnter:Function,onFocus:Function,onKeydown:Function,onKeypress:Function,onKeyup:Function,onMouseenter:Function,onMouseleave:Function,onPaste:Function,onValidate:Function,onWheel:Function};function tg(e){var n=t.getCurrentInstance(),r=t.computed((function(){return n.props.disabled})),o=t.inject("formDisabled",Object.create(null)).disabled;return t.computed((function(){return r.value||(null==o?void 0:o.value)||(null==e?void 0:e.value)||!1}))}var ng=function(){var e=rc();return t.computed((function(){var t="".concat(e.value,"-form"),n="".concat(e.value,"-input"),r="".concat(e.value,"-is");return{form:t,label:"".concat(t,"__label"),labelTop:"".concat(t,"__label--top"),inline:"".concat(t,"-inline"),formItem:"".concat(t,"__item"),formItemWithHelp:"".concat(t,"__item-with-help"),formItemWithExtra:"".concat(t,"__item-with-extra"),controls:"".concat(t,"__controls"),controlsContent:"".concat(t,"__controls-content"),status:"".concat(t,"__status"),extra:"".concat(n,"__extra"),help:"".concat(n,"__help"),success:"".concat(r,"-success"),successBorder:"".concat(t,"--success-border"),error:"".concat(r,"-error"),warning:"".concat(r,"-warning")}}))},rg=function(e){return e.TO_BE_VALIDATED="not",e.SUCCESS="success",e.FAIL="fail",e}(rg||{}),og=Symbol("FormProvide"),ig=Symbol("FormItemProvide");function ag(e){var n=t.computed((function(){var t,n=e.value,r=n.maxlength,o=n.maxcharacter,i=n.value;if(bl(i))return String(i);if(r&&o&&Im.warn("Input","Pick one of maxlength and maxcharacter please."),r){var a=null!=i&&i.length?p(null!=(t=i)?t:"").length:0;return"".concat(a,"/").concat(r)}return o?"".concat(wl(i||""),"/").concat(o):""})),r=t.computed((function(){if(n.value){var e=ll(n.value.split("/"),2),t=e[0],r=e[1];return Number(t)>Number(r)?"error":""}return""})),o=t.computed((function(){return e.value.status||r.value})),i=function(){var t,n;null===(t=(n=e.value).onValidate)||void 0===t||t.call(n,{error:r.value?"exceed-maximum":void 0})};return t.watch(r,i),t.onMounted((function(){r.value&&i()})),{tStatus:o,limitNumber:n,getValueByLimitNumber:function(t){var n,r,o,i=e.value,a=i.allowInputOverMax,l=i.maxlength,s=i.maxcharacter;if(!l&&!s||a||!t)return t;if(l)return n=t,r=l,p(null!=o?o:"").slice().length===r?o||"":p(null!=n?n:"").slice(0,r).join("");if(s){var c=wl(t,s);if(y(c))return c.characters}}}}function lg(e,t){return"number"===t?e||0===e?Number(e):void 0:e}function sg(e,n){var r=t.toRefs(e),o=r.value,i=r.modelValue,a=t.ref(),l=t.ref(!1),s=t.ref(),c=t.ref(null),u=t.ref(),d=tg(),p=ll(Bm(o,i,e.defaultValue,e.onChange),2),f=p[0],h=p[1],m=t.ref(!1),v=t.ref(!1),g=t.ref(e.type),b=t.ref(null),y=ag(t.computed((function(){return{value:[void 0,null].includes(f.value)?void 0:String(f.value),status:e.status,maxlength:Number(e.maxlength),maxcharacter:e.maxcharacter,allowInputOverMax:e.allowInputOverMax,onValidate:e.onValidate}}))),w=y.limitNumber,k=y.getValueByLimitNumber,x=y.tStatus,C=t.computed((function(){return(f.value&&!d.value&&e.clearable&&!e.readonly||e.showClearIconOnEmpty)&&m.value})),O=function(){var e;v.value=!0,null===(e=b.value)||void 0===e||e.focus()},S=function(n){var r,o=n.target.value;"number"!==e.type&&"string"==typeof f.value&&o.length>(null===(r=f.value)||void 0===r?void 0:r.length)&&(o=k(o)),h(lg(o,e.type),{e:n,trigger:"input"}),t.nextTick((function(){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=b.value;if(t){var n=String(e);t.value&&t.value!==n&&(t.value=n)}}(f.value)}))},E=t.inject(ig,void 0);return t.watch((function(){return e.autofocus}),(function(e){!0===e&&t.nextTick((function(){var e;null===(e=b.value)||void 0===e||e.focus()}))}),{immediate:!0}),t.watch(f,(function(t,n){var r="number"===e.type;void 0===n&&e.format&&"number"!=typeof t&&!r?a.value=e.format(t):a.value=t;var o="number"==typeof t?t:k(t);o===t||r||h(o,{trigger:"initial"})}),{immediate:!0}),t.watch((function(){return e.type}),(function(e){g.value=e}),{immediate:!0}),n({inputRef:b,focus:O,blur:function(){var e;v.value=!1,null===(e=b.value)||void 0===e||e.blur()}}),{isHover:m,focused:v,renderType:g,showClear:C,inputRef:b,clearIconRef:c,inputValue:a,isComposition:l,compositionValue:s,limitNumber:w,tStatus:x,emitFocus:function(t){var n;m.value&&v.value||(a.value=f.value,e.disabled||(v.value=!0,null===(n=e.onFocus)||void 0===n||n.call(e,f.value,{e:t})))},formatAndEmitBlur:function(t){var n;(function(){var e,t=u.value;if(!(t&&t.tagName&&null!==(e=c.value)&&void 0!==e&&e.$el&&["path","svg"].includes(t.tagName)))return!1;for(;t;){var n;if((null===(n=c.value)||void 0===n?void 0:n.$el)===t)return!0;t=t.parentNode}return!1})()?O():(e.format&&(a.value="number"==typeof f.value||"number"===e.type?f.value:e.format(f.value)),v.value=!1,null===(n=e.onBlur)||void 0===n||n.call(e,f.value,{e:t}),null==E||E.handleBlur())},onHandleCompositionend:function(t){var n;l.value=!1,s.value="",S(t),null===(n=e.onCompositionend)||void 0===n||n.call(e,String(f.value),{e:t})},onHandleCompositionstart:function(t){var n;l.value=!0;var r=t.currentTarget.value;s.value=r,null===(n=e.onCompositionstart)||void 0===n||n.call(e,String(f.value),{e:t})},onRootClick:function(t){var n,r;null===(n=b.value)||void 0===n||n.focus(),null===(r=e.onClick)||void 0===r||r.call(e,{e:t})},emitPassword:function(){var e="password"===g.value?"text":"password";g.value=e},handleInput:function(e){var t=e.inputType&&"insertCompositionText"===e.inputType,n=e.currentTarget.value;t||l.value?s.value=n:S(e)},emitClear:function(t){var n,r=t.e,o="number"===e.type?void 0:"";h(o,{e:r,trigger:"clear"}),null===(n=e.onClear)||void 0===n||n.call(e,{e:r})},onClearIconMousedown:function(e){u.value=e.target},innerValue:f}}function cg(e,n,r){var o=t.toRefs(e),i=o.autoWidth,a=o.placeholder,l=t.ref(null),s=t.ref(null),c=function(){if(l.value&&n.value){var e=l.value.getBoundingClientRect().width;n.value.style.width="".concat(e||0,"px")}};Rm(n,(function(){i.value&&(s.value=setTimeout((function(){c(),clearTimeout(s.value)}),100))})),t.onBeforeUnmount((function(){clearTimeout(s.value)}));return t.onMounted((function(){i.value&&t.watch([r,a],(function(){i.value&&t.nextTick((function(){c()}))}),{immediate:!0})})),{inputPreRef:l}}var ug=["isHover","tStatus","inputRef","renderType","showClear","focused","inputValue","isComposition","compositionValue","innerValue","limitNumber"];function dg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dg(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fg(e){var t={};return Object.keys(e).forEach((function(n){ml(e[n])||(t[n]=e[n])})),t}var hg=t.defineComponent({name:"TInput",props:pg(pg({},eg),{},{showInput:{type:Boolean,default:!0},keepWrapperWidth:{type:Boolean,default:!1}}),setup:function(e,n){var r=n.expose,o=tc("input").globalConfig,i=eh({BrowseIcon:cp,BrowseOffIcon:ip,CloseCircleFilledIcon:jp}),a=i.BrowseIcon,l=i.BrowseOffIcon,s=i.CloseCircleFilledIcon,c=tg(),u=rc("input"),d=rc("input__wrap"),p=rc("input__tips"),f=oc(),h=f.STATUS,v=f.SIZE,g=rc(),b=Vd(),y=sg(e,r),w=y.isHover,k=y.tStatus,x=y.inputRef,C=y.renderType,O=y.showClear,S=y.focused,E=y.inputValue,N=y.isComposition,_=y.compositionValue,M=y.innerValue,A=y.limitNumber,T=cl(y,ug),V=cg(e,x,M).inputPreRef,j=function(e,t){var n=function(e){return t.value=e};return{isHover:t,handleKeydown:function(t){if(!e.disabled){var n,r,o=t.code,i=lg(t.currentTarget.value,e.type);/enter/i.test(o)||/enter/i.test(t.key)?null===(n=e.onEnter)||void 0===n||n.call(e,i,{e:t}):null===(r=e.onKeydown)||void 0===r||r.call(e,i,{e:t})}},handleKeyUp:function(t){var n;if(!e.disabled){var r=lg(t.currentTarget.value,e.type);null===(n=e.onKeyup)||void 0===n||n.call(e,r,{e:t})}},handleKeypress:function(t){var n;if(!e.disabled){var r=lg(t.currentTarget.value,e.type);null===(n=e.onKeypress)||void 0===n||n.call(e,r,{e:t})}},onHandlePaste:function(t){var n;if(!e.disabled){var r=t.clipboardData||window.clipboardData;null===(n=e.onPaste)||void 0===n||n.call(e,{e:t,pasteValue:null==r?void 0:r.getData("text/plain")})}},onHandleMousewheel:function(t){var n;return null===(n=e.onWheel)||void 0===n?void 0:n.call(e,{e:t})},onInputMouseenter:function(t){var r;n(!0),null===(r=e.onMouseenter)||void 0===r||r.call(e,{e:t})},onInputMouseleave:function(t){var r;n(!1),null===(r=e.onMouseleave)||void 0===r||r.call(e,{e:t})}}}(e,w),B=t.computed((function(){var t;return null!==(t=e.placeholder)&&void 0!==t?t:o.value.placeholder})),P=t.computed((function(){var t;return fg({autofocus:e.autofocus,disabled:c.value,readonly:e.readonly,placeholder:B.value,maxlength:!e.allowInputOverMax&&e.maxlength||void 0,name:e.name||void 0,type:C.value,autocomplete:null!==(t=e.autocomplete)&&void 0!==t?t:o.value.autocomplete||void 0,unselectable:e.readonly?"on":void 0})})),I=t.computed((function(){return[d.value,m({},"".concat(u.value,"--auto-width"),e.autoWidth&&!e.keepWrapperWidth)]})),D=fg({onFocus:T.emitFocus,onBlur:T.formatAndEmitBlur,onKeydown:j.handleKeydown,onKeyup:j.handleKeyUp,onKeypress:j.handleKeypress,onPaste:j.onHandlePaste,onCompositionend:T.onHandleCompositionend,onCompositionstart:T.onHandleCompositionstart});return function(){var n,r,o=b("prefixIcon"),i=b("suffixIcon"),d=b("passwordIcon"),f=b("label",{silent:!0}),y=b("suffix"),w=A.value&&e.showLimitNumber?t.createVNode("div",{class:["".concat(g.value,"-input__limit-number"),m({},"".concat(g.value,"-is-disabled"),c.value)]},[A.value]):null,L=f?t.createVNode("div",{class:"".concat(u.value,"__prefix")},[f]):null,R=y||w?t.createVNode("div",{class:"".concat(u.value,"__suffix")},[y,w]):null;"password"===e.type&&("password"===C.value?i=t.createVNode(l,{class:"".concat(u.value,"__suffix-clear"),onClick:T.emitPassword},null):"text"===C.value&&(i=t.createVNode(a,{class:"".concat(u.value,"__suffix-clear"),onClick:T.emitPassword},null))),O.value&&("password"===e.type?d=t.createVNode(s,{ref:T.clearIconRef,class:"".concat(u.value,"__suffix-clear"),onClick:T.emitClear,onMousedown:T.onClearIconMousedown},null):i=t.createVNode(s,{ref:T.clearIconRef,class:"".concat(u.value,"__suffix-clear"),onClick:T.emitClear,onMousedown:T.onClearIconMousedown},null));var z=[u.value,e.inputClass,m(m(m(m(m(m(m(m(m({},v.value[e.size],"medium"!==e.size),h.value.disabled,c.value),h.value.focused,!c.value&&S.value),"".concat(g.value,"-is-").concat(k.value),k.value&&"default"!==k.value),"".concat(g.value,"-align-").concat(e.align),"left"!==e.align),"".concat(g.value,"-is-readonly"),e.readonly),"".concat(u.value,"--prefix"),o||L),"".concat(u.value,"--suffix"),i||R),"".concat(u.value,"--focused"),S.value)],F=b("tips"),$=[p.value,"".concat(g.value,"-tips"),"".concat(g.value,"-is-").concat(k.value||"default")];return t.withDirectives(t.createVNode("div",{class:I.value},[t.createVNode("div",{class:z,onClick:T.onRootClick,onMouseenter:j.onInputMouseenter,onMouseleave:j.onInputMouseleave,onWheel:j.onHandleMousewheel},[o?t.createVNode("span",{class:["".concat(u.value,"__prefix"),"".concat(u.value,"__prefix-icon")]},[o]):null,L,t.createVNode("input",t.mergeProps({class:["".concat(u.value,"__inner"),m({},"".concat(u.value,"--soft-hidden"),!e.showInput)]},P.value,D,{ref:x,value:N.value?null!==(n=_.value)&&void 0!==n?n:"":null!==(r=E.value)&&void 0!==r?r:"",onInput:function(e){return T.handleInput(e)}}),null),e.autoWidth&&t.createVNode("span",{ref:V,class:"".concat(g.value,"-input__input-pre")},[M.value||B.value]),R,d?t.createVNode("span",{class:["".concat(u.value,"__suffix"),"".concat(u.value,"__suffix-icon"),"".concat(u.value,"__clear")]},[d]):null,i?t.createVNode("span",{class:["".concat(u.value,"__suffix"),"".concat(u.value,"__suffix-icon"),m({},"".concat(u.value,"__clear"),O.value)]},[i]):null]),F&&t.createVNode("div",{class:$},[F])]),[[t.vShow,"hidden"!==e.type]])}}}),mg={separate:Boolean},vg=t.defineComponent({name:"TInputGroup",props:mg,setup:function(e){var n=rc("input-group"),r=Vd(),o=t.computed((function(){return[n.value,m({},"".concat(n.value,"--separate"),e.separate)]}));return function(){return t.createVNode("div",{class:o.value},[r("default")])}}}),gg=xd(hg);xd(vg);var bg={align:{type:String,validator:function(e){return!e||["left","center","right"].includes(e)}},allowInputOverLimit:{type:Boolean,default:!0},autoWidth:Boolean,decimalPlaces:{type:Number,default:void 0},disabled:Boolean,format:{type:Function},inputProps:{type:Object},label:{type:[String,Function]},largeNumber:Boolean,max:{type:[String,Number],default:1/0},min:{type:[String,Number],default:-1/0},placeholder:{type:String,default:void 0},readonly:Boolean,size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},status:{type:String,default:"default",validator:function(e){return!e||["default","success","warning","error"].includes(e)}},step:{type:[String,Number],default:1},suffix:{type:[String,Function]},theme:{type:String,default:"row",validator:function(e){return!e||["column","row","normal"].includes(e)}},tips:{type:[String,Function]},value:{type:[String,Number],default:void 0},modelValue:{type:[String,Number],default:void 0},defaultValue:{type:[String,Number]},onBlur:Function,onChange:Function,onEnter:Function,onFocus:Function,onKeydown:Function,onKeypress:Function,onKeyup:Function,onValidate:Function};function yg(e){return new Array(e).fill(0).join("")}function wg(e){if(!e)return!0;if(bl(e))return!Number.isNaN(e);if(!/^[0-9|e|E|-]+\.*[0-9|e|E|-]*$/.test(e))return!1;for(var t=0,n=0,r=0,o=0,i=e.length;o<i;o++){if("."===e[o]&&(r+=1)>1)return!1;if(/(e|E)+/.test(e[o])&&(t+=1)>1)return!1;if("-"===e[o]&&(n+=1)>2)return!1}return!0}function kg(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return-1!==e.indexOf(".")?(Im.error("InputNumber","num is not a integer number."),e):!e||"0"===e&&t?"":"0"===e?e:(t?e.replace(/0+$/,""):e.replace(/^0+/,""))||"0"}function xg(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=kg(e,n),o=kg(t,n),i=r.length>o.length,a=i?r:o,l=i?o:r,s=[],c=[],u=n?0:a.length-l.length,d=n?l.length:a.length,p=d-1;p>=0;p--){var f=p-u,h=Number(a[p])+(Number(l[f])||0)+(c[p]||0);h>=10&&(c[p-1]=1),s.unshift(String(h%10))}return c[-1]&&s.unshift("1"),n?s.concat(a.slice(d,a.length)).join(""):s.join("")}function Cg(e,t){var n=ll(e.split("."),2),r=n[0],o=void 0===r?"0":r,i=n[1],a=void 0===i?"0":i,l=ll(t.split("."),2),s=l[0],c=void 0===s?"0":s,u=l[1],d=void 0===u?"0":u,p=xg(o,c);if("0"===a&&"0"===d)return p;var f=kg(a,!0),h=kg(d,!0),m=xg(f,h,!0),v=m.length;return v>f.length&&v>h.length?[kg(xg(p,"1")),kg(m.slice(1),!0)].filter((function(e){return e})).join("."):[kg(p),kg(m,!0)].filter((function(e){return e})).join(".")}function Og(e,t){var n=kg(e),r=kg(t);if(n.length===r.length){for(var o=0,i=n.length;o<i;o++){if(n[o]>r[o])return 1;if(n[o]<r[o])return-1}return 0}return n.length>r.length?1:-1}function Sg(e,t){for(var n=e&&"0"!==e?e.replace(/0+$/,""):"0",r=t&&"0"!==t?t.replace(/0+$/,""):"0",o=0,i=Math.max(n.length,r.length);o<i;o++){if((n[o]||0)>(r[o]||0))return 1;if((n[o]||0)<(r[o]||0))return-1}return 0}function Eg(e){var t=ll(e.split("e"),2),n=t[0],r=t[1];if(!r)return e;var o=ll(e.split("."),2),i=o[0],a=o[1],l=void 0===a?"":a,s=Number(r),c=ll(l.split("e"),1)[0];if(s>c.length){var u=yg(s-c.length);return n.replace(/(^0+|\.)/g,"")+u}var d=i.replace(/^0+/,"")+c.slice(0,s),p=c.slice(s);return p?[d,p].join("."):d}function Ng(e){return[-1/0,1/0].includes(Number(e))}function _g(e){return Number(e)<Number.MAX_SAFE_INTEGER&&Number(e)>Number.MIN_SAFE_INTEGER}function Mg(e,t,n){var r=_g(e)&&_g(t)&&!n,o=Ng(e)||Ng(t);return r||o?Number(e)===Number(t)?0:Number(e)>Number(t)?1:-1:function(e,t){var n=ll(Eg(e).split("."),2),r=n[0],o=n[1],i=ll(Eg(t).split("."),2),a=i[0],l=i[1],s=Og(r.replace("-",""),a.replace("-","")),c=r.includes("-"),u=a.includes("-");return c&&!u?-1:!c&&u?1:c&&u?0===s?0:s>0?-1:1:0===s?Sg(o,l):s}(String(e),String(t))}function Ag(e,t,n){if(e===t)return"0";for(var r=n||{},o=r.decimal,i=r.stayZero,a=kg(e),l=kg(t),s=Og(a,l)>0,c=s?a:l,u=s?l:a,d=[],p=[],f=o?0:c.length-u.length,h=o?u.length:c.length,m=h-1;m>=0;m--){var v=m-f,g=Number(c[m])-(Number(u[v])||0)-(p[m]||0);g<0&&(p[m-1]=1,g+=10),d.unshift(String(g))}if(o)return d.concat(c.slice(h,c.length)).join("");var b=d.join("");return i||(b=b.replace(/^0+/,"")),kg(s?b:"-".concat(b))}function Tg(e,t){if(e===t)return"0";var n=Mg(e,t,!0)>0,r=n?t:e,o=ll((n?e:t).split("."),2),i=o[0],a=o[1],l=void 0===a?"0":a,s=ll(r.split("."),2),c=s[0],u=s[1],d=void 0===u?"0":u,p=Ag(i,c);if("0"===l&&"0"===d)return n?p:"-".concat(p);var f="",h=l;l.length<d.length&&(h="".concat(l).concat(yg(d.length-l.length))),Sg(h,d)>=0?f=Ag(h,d,{decimal:!0}):(l.length<d.length||"0"===l?(f=Ag("1".concat(h),d,{stayZero:!0}),f=yg(d.length-f.length)+f):f=Ag(l,d,{decimal:!0}),p=Ag(p,"1"));var m=f?[p,f].join("."):p;return n?m:"-".concat(m)}function Vg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]))return Number(e).toFixed(t);if(!fl(e))return String(e);var n=ll(e.split("."),2),r=n[0],o=n[1];if(!o)return t?[e,yg(t)].join("."):e;if(0===t)return Number(o[0])>=5?Cg(r,"1"):r;var i=o.slice(0,t);return o.length<t?i+=yg(t-o.length):i=Number(o[t])>=5?Cg(i,"1"):i,[r,i].join(".")}function jg(e,t){var n,r;if(!e||!t)return(e||0)+(t||0);var o=(null===(n=e.toString().split(".")[1])||void 0===n?void 0:n.length)||0,i=(null===(r=t.toString().split(".")[1])||void 0===r?void 0:r.length)||0;if(!o&&!i)return e+t;var a=e,l=t,s=Math.abs(o-i),c=Math.pow(10,Math.max(o,i));if(s>0){var u=Math.pow(10,s);o>i?(a=Number(e.toString().replace(".","")),l=Number(t.toString().replace(".",""))*u):(a=Number(e.toString().replace(".",""))*u,l=Number(t.toString().replace(".","")))}else a=Number(e.toString().replace(".","")),l=Number(t.toString().replace(".",""));return(a+l)/c}function Bg(e,t){var n,r;if(!e||!t)return(e||0)-(t||0);var o=(null===(n=e.toString().split(".")[1])||void 0===n?void 0:n.length)||0,i=(null===(r=t.toString().split(".")[1])||void 0===r?void 0:r.length)||0,a=Math.pow(10,Math.max(o,i));return Number(((e*a-t*a)/a).toFixed(o>=i?o:i))}function Pg(e){var t=e.op,n=e.step,r=e.lastValue,o=e.max,i=e.min,a=e.largeNumber;if(n<=0)return Im.error("InputNumber","step must be larger than 0."),r;var l,s,c,u=bl(n)?String(n):n;return"add"===t?a&&fl(r)?l=function(e,t){var n="-"===e[0],r="-"===t[0];if(n&&!r)return Tg(t,e.slice(1));if(n&&r){var o=Cg(t.slice(1),e.slice(1));return"-".concat(o)}return!n&&r?Tg(e,t.slice(1)):Cg(e,t)}(String(r),String(u)):(s=Number(r||0),c=Number(n),l=s<0&&c>0?Bg(c,Math.abs(s)):s<0&&c<0?-1*jg(Math.abs(s),Math.abs(c)):s>0&&c<0?Bg(s,Math.abs(c)):jg(s,c)):"reduce"===t&&(l=a&&fl(r)?function(e,t){var n="-"===e[0],r="-"===t[0];if(n&&!r){var o=Cg(e.slice(1),t);return"-".concat(o)}return n&&r?Tg(t.slice(1),e.slice(1)):!n&&r?Cg(e,t.slice(1)):Tg(e,t)}(String(r),String(u)):function(e,t){return e<0&&t>0?-1*jg(Math.abs(e),t):e<0&&t<0?Bg(Math.abs(t),Math.abs(e)):e>0&&t<0?jg(e,Math.abs(t)):Bg(e,t)}(Number(r||0),Number(n))),ml(r)&&(l=function(e,t){if(""!==e){var n=t.max,r=t.min,o=t.lastValue,i=t.largeNumber;return wg(e)?!i||!fl(n)&&n!==1/0||!fl(r)&&r!==-1/0?Math.max(Number(r),Math.min(Number(n),Number(e))):Mg(n,e,i)<0?n:Mg(r,e,i)>0?r:e:o}}(l,{max:o,min:i,lastValue:r,largeNumber:a})),a?l:Number(l)}function Ig(e){var t=e.largeNumber,n=e.value,r=e.max,o=e.min;if(!ml(t))return t&&bl(n)&&Im.warn("InputNumber","largeNumber value must be a string."),Mg(n,r,t)>0?"exceed-maximum":Mg(n,o,t)<0?"below-minimum":void 0}var Dg=["-",".","e","E","+"];function Lg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!["",null,void 0].includes(e)&&/\d+/.test(e)){var n=t.decimalPlaces,r=t.largeNumber,o=t.isToFixed,i=e.replace(/[.|+|\-|e]$/,"");return r&&(i=Eg(i)),void 0!==n&&(i=Vg(i,n,r)),r||o?i:parseFloat(i)}}function Rg(e){var n=function(){var e=tc().classPrefix,t={small:"".concat(e.value,"-size-s"),medium:"".concat(e.value,"-size-m"),large:"".concat(e.value,"-size-l"),default:"",xs:"".concat(e.value,"-size-xs"),xl:"".concat(e.value,"-size-xl"),block:"".concat(e.value,"-size-full-width")},n={loading:"".concat(e.value,"-is-loading"),loadMore:"".concat(e.value,"-is-load-more"),disabled:"".concat(e.value,"-is-disabled"),focused:"".concat(e.value,"-is-focused"),success:"".concat(e.value,"-is-success"),error:"".concat(e.value,"-is-error"),warning:"".concat(e.value,"-is-warning"),selected:"".concat(e.value,"-is-selected"),active:"".concat(e.value,"-is-active"),checked:"".concat(e.value,"-is-checked"),current:"".concat(e.value,"-is-current"),hidden:"".concat(e.value,"-is-hidden"),visible:"".concat(e.value,"-is-visible"),expanded:"".concat(e.value,"-is-expanded"),indeterminate:"".concat(e.value,"-is-indeterminate")};return{classPrefix:e,sizeClassNames:t,statusClassNames:n,classNames:{size:t,status:n}}}(),r=n.classPrefix,o=n.sizeClassNames,i=n.statusClassNames,a=t.toRefs(e),l=a.value,s=a.modelValue,c=a.max,u=a.min,d=ll(Bm(l,s,e.defaultValue,e.onChange),2),p=d[0],f=d[1],h=t.ref(),v=t.ref(""),g=tg(),b=t.ref(),y=t.computed((function(){return g.value||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!e&&0!==e||(n&&fl(e)?Mg(e,t,n)>0:e>t)}(p.value,e.min,e.largeNumber)})),w=t.computed((function(){return g.value||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!e&&0!==e||(n&&fl(e)?Mg(e,t,n)<0:e<t)}(p.value,e.max,e.largeNumber)})),k=t.computed((function(){return["".concat(r.value,"-input-number"),o[e.size],m(m(m(m({},i.disabled,g.value),"".concat(r.value,"-is-controls-right"),"column"===e.theme),"".concat(r.value,"-input-number--").concat(e.theme),e.theme),"".concat(r.value,"-input-number--auto-width"),e.autoWidth)]})),x=t.computed((function(){return["".concat(r.value,"-input-number__decrease"),m({},i.disabled,y.value)]})),C=t.computed((function(){return["".concat(r.value,"-input-number__increase"),m({},i.disabled,w.value)]})),O=function(t){var n;if(!t&&0!==t)return"";var r=t||0===t?String(t):"";if(null===(n=h.value)||void 0===n||null===(n=n.inputRef)||void 0===n||!n.contains(document.activeElement)){var o=Lg(r,{decimalPlaces:e.decimalPlaces,largeNumber:e.largeNumber,isToFixed:!0});r=o||0===o?String(o):"",e.format&&(r=String(e.format(t,{fixedNumber:r})))}return r};t.watch(p,(function(t){var n=e.largeNumber,r=e.decimalPlaces,o=[void 0,null].includes(t)?"":String(t);if(!n&&!Number.isNaN(v.value)){parseFloat(v.value)!==t&&(v.value=O(o));var i=Number(Vg(o,r,n));void 0===r||[void 0,null].includes(t)||Number(i)===Number(p.value)||f(i,{type:"props",e:void 0})}n&&(v.value=O(o),void 0!==r&&Vg(o,r,n)!==t&&f(v.value,{type:"props",e:void 0}))}),{immediate:!0}),t.watch([p,c,u],(function(){var t;if(![void 0,"",null].includes(p.value)){var n=e.max,r=e.min,o=e.largeNumber,i=Ig({value:p.value,largeNumber:o,max:n,min:r});b.value=i,null===(t=e.onValidate)||void 0===t||t.call(e,{error:i})}}),{immediate:!0});var S=function(t){var n=Pg({op:t,step:e.step,max:e.max,min:e.min,lastValue:p.value,largeNumber:e.largeNumber});return{overLimit:Ig({value:n,largeNumber:e.largeNumber,max:e.max,min:e.min}),newValue:n}},E=function(t){if(!y.value&&!e.readonly){var n=S("reduce");n.overLimit&&!e.allowInputOverLimit||f(n.newValue,{type:"reduce",e:t})}},N=function(t){if(!w.value&&!e.readonly){var n=S("add");n.overLimit&&!e.allowInputOverLimit||f(n.newValue,{type:"add",e:t})}},_=function(){h.value.focus()};return{classPrefix:r,wrapClasses:k,reduceClasses:x,addClasses:C,tDisabled:g,isError:b,listeners:{onBlur:function(t,n){var r,o=e.largeNumber,i=e.max,a=e.min,l=e.decimalPlaces;if(!e.allowInputOverLimit&&void 0!==p.value){var s,c,u=Ig({value:p.value,largeNumber:o,max:i,min:a});if("below-minimum"===u)return f(a,{type:"blur",e:n.e}),void(null===(s=e.onBlur)||void 0===s||s.call(e,a,n));if("exceed-maximum"===u)return f(i,{type:"blur",e:n.e}),void(null===(c=e.onBlur)||void 0===c||c.call(e,i,n))}var d=Lg(t,{decimalPlaces:l,largeNumber:o});v.value=O(d),d!==p.value&&f(d,{type:"blur",e:n.e}),null===(r=e.onBlur)||void 0===r||r.call(e,d,n)},onFocus:function(t,n){var r;v.value=p.value||0===p.value?String(p.value):"",null===(r=e.onFocus)||void 0===r||r.call(e,t,n)},onKeydown:function(t,n){var r;if(!g.value){var o=n.e,i={ArrowUp:N,ArrowDown:E},a=o.code||o.key;void 0!==i[a]&&i[a](o),null===(r=e.onKeydown)||void 0===r||r.call(e,t,n)}},onKeyup:function(t,n){var r;null===(r=e.onKeyup)||void 0===r||r.call(e,t,n)},onKeypress:function(t,n){var r;null===(r=e.onKeypress)||void 0===r||r.call(e,t,n)},onEnter:function(t,n){var r;v.value=O(t);var o=Lg(t,{decimalPlaces:e.decimalPlaces,largeNumber:e.largeNumber});o!==t&&String(o)!==t&&f(o,{type:"enter",e:n.e}),null===(r=e.onEnter)||void 0===r||r.call(e,o,n)},onClick:_},userInput:v,tValue:p,inputRef:h,focus:_,blur:function(){h.value.blur()},handleReduce:E,handleAdd:N,onInnerInputChange:function(t,n){var r,o=n.e,i=/^[-+]?\d{1,3}(,\d{3})*(\.(\d*))?$/.test(r=t)?r.replace(/,/g,""):r;if(function(e,t){var n;if(["",null,void 0].includes(e))return!0;if("00"===e.slice(0,2))return!1;if((null===(n=e.match(/\./g))||void 0===n?void 0:n.length)>1)return!1;var r=e.slice(1);return!(/(\+|-)/.test(r)&&!/e+/i.test(r)||!(t&&wg(e)||!Number.isNaN(Number(e))||Dg.includes(e.slice(-1)))||/e/i.test(e)&&!/\de/i.test(e))}(i,e.largeNumber))if(v.value=i,e.largeNumber)f(i,{type:"input",e:o});else if(function(e,t){return parseFloat(e)!==t&&!Number.isNaN(Number(e))}(String(i),Number(p.value))){var a=""===i?void 0:Number(i);f(a,{type:"input",e:o})}}}}function zg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Fg=t.defineComponent({name:"TInputNumber",props:bg,setup:function(e,n){var r=Vd(),o=eh({AddIcon:Zd,RemoveIcon:wf,ChevronDownIcon:gp,ChevronUpIcon:Mp}),i=o.AddIcon,a=o.RemoveIcon,l=o.ChevronDownIcon,s=o.ChevronUpIcon,c=Rg(e),u=c.inputRef;return n.expose(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zg(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},c)),function(){var o="column"===e.theme?t.createVNode(l,{size:e.size},null):t.createVNode(a,{size:e.size},null),d="column"===e.theme?t.createVNode(s,{size:e.size},null):t.createVNode(i,{size:e.size},null),p=c.isError.value?"error":e.status,f=c.classPrefix.value,h=r("tips");return t.createVNode("div",{class:c.wrapClasses.value},["normal"!==e.theme&&t.createVNode(Fd,{class:c.reduceClasses.value,disabled:c.tDisabled.value,onClick:c.handleReduce,variant:"outline",shape:"square",icon:function(){return o}},null),t.createVNode(gg,t.mergeProps({ref:u,disabled:c.tDisabled.value,readonly:e.readonly,autocomplete:"off",placeholder:e.placeholder,unselectable:e.readonly?"on":"off",autoWidth:e.autoWidth,align:e.align||("row"===e.theme?"center":void 0),status:p,label:e.label,suffix:e.suffix},c.listeners,e.inputProps,{value:c.userInput.value,onChange:c.onInnerInputChange}),n.slots),"normal"!==e.theme&&t.createVNode(Fd,{class:c.addClasses.value,disabled:c.tDisabled.value,onClick:c.handleAdd,variant:"outline",shape:"square",icon:function(){return d}},null),h&&t.createVNode("div",{class:"".concat(f,"-input__tips ").concat(f,"-tips ").concat(f,"-is-").concat(p)},[h])])}}}),$g=xd(Fg),Hg=na,Ug=jo,Wg=Be,qg=b,Kg=Po;var Gg=function(e,t,n,r){if(!qg(e))return e;for(var o=-1,i=(t=Ug(t,e)).length,a=i-1,l=e;null!=l&&++o<i;){var s=Kg(t[o]),c=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(o!=a){var u=l[s];void 0===(c=r?r(u,s,l):void 0)&&(c=qg(u)?u:Wg(t[o+1])?[]:{})}Hg(l,s,c),l=l[s]}return e},Yg=Lo,Xg=Gg,Zg=jo;var Jg=function(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=Yg(e,a);n(l,a)&&Xg(i,Zg(a,e),l)}return i},Qg=Jg,eb=Xo;var tb=function(e,t){return Qg(e,t,(function(t,n){return eb(e,n)}))};const nb=g(gv((function(e,t){return null==e?{}:tb(e,t)})));var rb=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1},ob=function(e){return e!=e},ib=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1};var ab=function(e,t,n){return t==t?ib(e,t,n):rb(e,ob,n)};var lb=In,sb=function(e,t){return!!(null==e?0:e.length)&&ab(e,t,0)>-1},cb=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1},ub=wo,db=Fe,pb=Dn,fb=Math.min;var hb=$i;var mb=wo,vb=function(e,t,n){for(var r=n?cb:sb,o=e[0].length,i=e.length,a=i,l=Array(i),s=1/0,c=[];a--;){var u=e[a];a&&t&&(u=ub(u,db(t))),s=fb(u.length,s),l[a]=!n&&(t||o>=120&&u.length>=120)?new lb(a&&u):void 0}u=e[0];var d=-1,p=l[0];e:for(;++d<o&&c.length<s;){var f=u[d],h=t?t(f):f;if(f=n||0!==f?f:0,!(p?pb(p,h):r(c,h,n))){for(a=i;--a;){var m=l[a];if(!(m?pb(m,h):r(e[a],h,n)))continue e}p&&p.push(h),c.push(f)}}return c},gb=function(e){return hb(e)?e:[]};const bb=g(Za((function(e){var t=mb(e,gb);return t.length&&t[0]===e[0]?vb(t):[]})));var yb={allowInput:Boolean,autoWidth:Boolean,autofocus:Boolean,borderless:Boolean,clearable:Boolean,collapsedItems:{type:Function},disabled:Boolean,inputProps:{type:Object},inputValue:{type:[String,Number],default:void 0},defaultInputValue:{type:[String,Number]},keys:{type:Object},label:{type:[String,Function]},loading:Boolean,minCollapsedNum:{type:Number,default:0},multiple:Boolean,panel:{type:[String,Function]},placeholder:{type:String,default:""},popupProps:{type:Object},popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:Boolean,readonly:Boolean,reserveKeyword:Boolean,status:{type:String,default:"default",validator:function(e){return!e||["default","success","warning","error"].includes(e)}},suffix:{type:[String,Function]},suffixIcon:{type:Function},tag:{type:[String,Function]},tagInputProps:{type:Object},tagProps:{type:Object},tips:{type:[String,Function]},value:{type:[String,Number,Boolean,Object,Array,Date],default:void 0},valueDisplay:{type:[String,Function]},onBlur:Function,onClear:Function,onEnter:Function,onFocus:Function,onInputChange:Function,onMouseenter:Function,onMouseleave:Function,onPaste:Function,onPopupVisibleChange:Function,onTagChange:Function},wb=["tips"];function kb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kb(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Cb=["status","clearable","disabled","label","placeholder","readonly","suffix","suffixIcon","onPaste","onMouseenter","onMouseleave"],Ob={label:"label",value:"value",children:"children"};function Sb(e,n,r){var o,i=t.toRefs(e),a=i.value,l=i.keys,s=i.inputValue,c=rc(),u=t.ref(e.autofocus),d=t.ref(),p=ll(Tm(s,null!==(o=e.defaultInputValue)&&void 0!==o?o:"",e.onInputChange,"inputValue"),2),f=p[0],h=p[1],m=Vd(),v=tg(),g=t.computed((function(){return xb(xb({},nb(e,Cb)),{},{disabled:v.value})})),b=function(t){var n,r;null==t||null===(n=t.e)||void 0===n||n.stopPropagation(),null===(r=e.onClear)||void 0===r||r.call(e,t),h("",{trigger:"clear"})},w=function(t,n){e.allowInput&&h(t,xb(xb({},n),{},{trigger:n.trigger||"input"}))},k=function(t,n){var r,o,i=m("label");if(!i&&!t)return[];if(t&&(null!==(r=e.valueDisplayOptions)&&void 0!==r&&r.usePlaceholder&&!a.value||null!==(o=e.valueDisplayOptions)&&void 0!==o&&o.useInputDisplay&&n))return[i];return[i,t]},x=function(t,n,r){var o,i;if(t&&(null===(o=e.valueDisplayOptions)||void 0===o||!o.useInputDisplay||null!==(i=e.valueDisplayOptions)&&void 0!==i&&i.useInputDisplay&&!r))return;return n},C=function(t){var n,r;if(t&&(null===(n=e.valueDisplayOptions)||void 0===n||!n.usePlaceholder||null!==(r=e.valueDisplayOptions)&&void 0!==r&&r.usePlaceholder&&a.value))return"";return e.placeholder};return{inputRef:d,isSingleFocus:u,commonInputProps:g,singleInputValue:f,onInnerClear:b,renderSelectSingle:function(o){var i,s=m("valueDisplay"),p=o&&e.allowInput?f.value:function(e,t){var n=xb(xb({},Ob),t);return y(e)?e[n.label]:e}(a.value,l.value),h=k(s,o),O=xb(xb({},g.value),{},{value:x(s,p,o),label:h.length?function(){return h}:void 0,autoWidth:e.autoWidth,readonly:!e.allowInput||e.readonly,placeholder:C(s),suffixIcon:!v.value&&e.loading?function(){return t.createVNode(Cd,{loading:!0,size:"small"},null)}:e.suffixIcon,showClearIconOnEmpty:Boolean(e.clearable&&(f.value||p)&&!v.value&&!e.readonly)},e.inputProps),S=n.slots;S.tips;var E=cl(S,wb),N=o?["".concat(c.value,"-input--focused"),"".concat(c.value,"-is-focused"),null==O?void 0:O.inputClass]:null==O?void 0:O.inputClass;return t.createVNode(gg,t.mergeProps({ref:d,style:null===(i=n.attrs)||void 0===i?void 0:i.style},xb({onChange:w,onClear:b,onEnter:function(t,n){var r;null===(r=e.onEnter)||void 0===r||r.call(e,a.value,xb(xb({},n),{},{inputValue:t}))},onFocus:function(t,n){var o,i,l=null===(o=r.value)||void 0===o?void 0:o.getOverlayState();u.value||null!=l&&l.hover||(u.value=!0,null===(i=e.onFocus)||void 0===i||i.call(e,a.value,xb(xb({},n),{},{inputValue:t})))},onBlur:function(t,n){var o,i,l=null===(o=r.value)||void 0===o?void 0:o.getOverlayState();null!=l&&l.hover||(u.value=!1,null===(i=e.onBlur)||void 0===i||i.call(e,a.value,xb(xb({},n),{},{inputValue:t})))}},O),{inputClass:N}),E)}}}var Eb={autoWidth:Boolean,clearable:Boolean,collapsedItems:{type:Function},disabled:Boolean,dragSort:Boolean,excessTagsDisplayType:{type:String,default:"break-line",validator:function(e){return!e||["scroll","break-line"].includes(e)}},inputProps:{type:Object},inputValue:{type:[String,Number],default:void 0},defaultInputValue:{type:[String,Number],default:""},label:{type:[String,Function]},max:{type:Number},minCollapsedNum:{type:Number,default:0},placeholder:{type:String,default:void 0},prefixIcon:{type:Function},readonly:Boolean,size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},status:{type:String,validator:function(e){return!e||["default","success","warning","error"].includes(e)}},suffix:{type:[String,Function]},suffixIcon:{type:Function},tag:{type:[String,Function]},tagProps:{type:Object},tips:{type:[String,Function]},value:{type:Array,default:void 0},modelValue:{type:Array,default:void 0},defaultValue:{type:Array,default:function(){return[]}},valueDisplay:{type:[String,Function]},onBlur:Function,onChange:Function,onClear:Function,onClick:Function,onDragSort:Function,onEnter:Function,onFocus:Function,onInputChange:Function,onMouseenter:Function,onMouseleave:Function,onPaste:Function,onRemove:Function};function Nb(e){return(Nb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var _b=/^\s+/,Mb=/\s+$/;function Ab(e,t){if(t=t||{},(e=e||"")instanceof Ab)return e;if(!(this instanceof Ab))return new Ab(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,l=!1;"string"==typeof e&&(e=function(e){e=e.replace(_b,"").replace(Mb,"").toLowerCase();var t,n=!1;if(Kb[e])e=Kb[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=ay.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=ay.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=ay.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=ay.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=ay.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=ay.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=ay.hex8.exec(e))return{r:Jb(t[1]),g:Jb(t[2]),b:Jb(t[3]),a:ny(t[4]),format:n?"name":"hex8"};if(t=ay.hex6.exec(e))return{r:Jb(t[1]),g:Jb(t[2]),b:Jb(t[3]),format:n?"name":"hex"};if(t=ay.hex4.exec(e))return{r:Jb(t[1]+""+t[1]),g:Jb(t[2]+""+t[2]),b:Jb(t[3]+""+t[3]),a:ny(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=ay.hex3.exec(e))return{r:Jb(t[1]+""+t[1]),g:Jb(t[2]+""+t[2]),b:Jb(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==Nb(e)&&(ly(e.r)&&ly(e.g)&&ly(e.b)?(s=e.r,c=e.g,u=e.b,t={r:255*Xb(s,255),g:255*Xb(c,255),b:255*Xb(u,255)},a=!0,l="%"===String(e.r).substr(-1)?"prgb":"rgb"):ly(e.h)&&ly(e.s)&&ly(e.v)?(r=ey(e.s),o=ey(e.v),t=function(e,t,n){e=6*Xb(e,360),t=Xb(t,100),n=Xb(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),l=n*(1-(1-o)*t),s=r%6,c=[n,a,i,i,l,n][s],u=[l,n,n,a,i,i][s],d=[i,i,l,n,n,a][s];return{r:255*c,g:255*u,b:255*d}}(e.h,r,o),a=!0,l="hsv"):ly(e.h)&&ly(e.s)&&ly(e.l)&&(r=ey(e.s),i=ey(e.l),t=function(e,t,n){var r,o,i;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=Xb(e,360),t=Xb(t,100),n=Xb(n,100),0===t)r=o=i=n;else{var l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;r=a(s,l,e+1/3),o=a(s,l,e),i=a(s,l,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,i),a=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));var s,c,u;return n=Yb(n),{ok:a,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Tb(e,t,n){e=Xb(e,255),t=Xb(t,255),n=Xb(n,255);var r,o,i=Math.max(e,t,n),a=Math.min(e,t,n),l=(i+a)/2;if(i==a)r=o=0;else{var s=i-a;switch(o=l>.5?s/(2-i-a):s/(i+a),i){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:o,l:l}}function Vb(e,t,n){e=Xb(e,255),t=Xb(t,255),n=Xb(n,255);var r,o,i=Math.max(e,t,n),a=Math.min(e,t,n),l=i,s=i-a;if(o=0===i?0:s/i,i==a)r=0;else{switch(i){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:o,v:l}}function jb(e,t,n,r){var o=[Qb(Math.round(e).toString(16)),Qb(Math.round(t).toString(16)),Qb(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Bb(e,t,n,r){return[Qb(ty(r)),Qb(Math.round(e).toString(16)),Qb(Math.round(t).toString(16)),Qb(Math.round(n).toString(16))].join("")}function Pb(e,t){t=0===t?0:t||10;var n=Ab(e).toHsl();return n.s-=t/100,n.s=Zb(n.s),Ab(n)}function Ib(e,t){t=0===t?0:t||10;var n=Ab(e).toHsl();return n.s+=t/100,n.s=Zb(n.s),Ab(n)}function Db(e){return Ab(e).desaturate(100)}function Lb(e,t){t=0===t?0:t||10;var n=Ab(e).toHsl();return n.l+=t/100,n.l=Zb(n.l),Ab(n)}function Rb(e,t){t=0===t?0:t||10;var n=Ab(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),Ab(n)}function zb(e,t){t=0===t?0:t||10;var n=Ab(e).toHsl();return n.l-=t/100,n.l=Zb(n.l),Ab(n)}function Fb(e,t){var n=Ab(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,Ab(n)}function $b(e){var t=Ab(e).toHsl();return t.h=(t.h+180)%360,Ab(t)}function Hb(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Ab(e).toHsl(),r=[Ab(e)],o=360/t,i=1;i<t;i++)r.push(Ab({h:(n.h+i*o)%360,s:n.s,l:n.l}));return r}function Ub(e){var t=Ab(e).toHsl(),n=t.h;return[Ab(e),Ab({h:(n+72)%360,s:t.s,l:t.l}),Ab({h:(n+216)%360,s:t.s,l:t.l})]}function Wb(e,t,n){t=t||6,n=n||30;var r=Ab(e).toHsl(),o=360/n,i=[Ab(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(Ab(r));return i}function qb(e,t){t=t||6;for(var n=Ab(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],l=1/t;t--;)a.push(Ab({h:r,s:o,v:i})),i=(i+l)%1;return a}Ab.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Yb(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Vb(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Vb(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=Tb(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Tb(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return jb(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var i=[Qb(Math.round(e).toString(16)),Qb(Math.round(t).toString(16)),Qb(Math.round(n).toString(16)),Qb(ty(r))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Xb(this._r,255))+"%",g:Math.round(100*Xb(this._g,255))+"%",b:Math.round(100*Xb(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Xb(this._r,255))+"%, "+Math.round(100*Xb(this._g,255))+"%, "+Math.round(100*Xb(this._b,255))+"%)":"rgba("+Math.round(100*Xb(this._r,255))+"%, "+Math.round(100*Xb(this._g,255))+"%, "+Math.round(100*Xb(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Gb[jb(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Bb(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=Ab(e);n="#"+Bb(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Ab(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Lb,arguments)},brighten:function(){return this._applyModification(Rb,arguments)},darken:function(){return this._applyModification(zb,arguments)},desaturate:function(){return this._applyModification(Pb,arguments)},saturate:function(){return this._applyModification(Ib,arguments)},greyscale:function(){return this._applyModification(Db,arguments)},spin:function(){return this._applyModification(Fb,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(Wb,arguments)},complement:function(){return this._applyCombination($b,arguments)},monochromatic:function(){return this._applyCombination(qb,arguments)},splitcomplement:function(){return this._applyCombination(Ub,arguments)},triad:function(){return this._applyCombination(Hb,[3])},tetrad:function(){return this._applyCombination(Hb,[4])}},Ab.fromRatio=function(e,t){if("object"==Nb(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:ey(e[r]));e=n}return Ab(e,t)},Ab.equals=function(e,t){return!(!e||!t)&&Ab(e).toRgbString()==Ab(t).toRgbString()},Ab.random=function(){return Ab.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ab.mix=function(e,t,n){n=0===n?0:n||50;var r=Ab(e).toRgb(),o=Ab(t).toRgb(),i=n/100;return Ab({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},Ab.readability=function(e,t){var n=Ab(e),r=Ab(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Ab.isReadable=function(e,t,n){var r,o,i=Ab.readability(e,t);switch(o=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},Ab.mostReadable=function(e,t,n){var r,o,i,a,l=null,s=0;o=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var c=0;c<t.length;c++)(r=Ab.readability(e,t[c]))>s&&(s=r,l=Ab(t[c]));return Ab.isReadable(e,l,{level:i,size:a})||!o?l:(n.includeFallbackColors=!1,Ab.mostReadable(e,["#fff","#000"],n))};var Kb=Ab.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Gb=Ab.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(Kb);function Yb(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Xb(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Zb(e){return Math.min(1,Math.max(0,e))}function Jb(e){return parseInt(e,16)}function Qb(e){return 1==e.length?"0"+e:""+e}function ey(e){return e<=1&&(e=100*e+"%"),e}function ty(e){return Math.round(255*parseFloat(e)).toString(16)}function ny(e){return Jb(e)/255}var ry,oy,iy,ay=(oy="[\\s|\\(]+("+(ry="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+ry+")[,|\\s]+("+ry+")\\s*\\)?",iy="[\\s|\\(]+("+ry+")[,|\\s]+("+ry+")[,|\\s]+("+ry+")[,|\\s]+("+ry+")\\s*\\)?",{CSS_UNIT:new RegExp(ry),rgb:new RegExp("rgb"+oy),rgba:new RegExp("rgba"+iy),hsl:new RegExp("hsl"+oy),hsla:new RegExp("hsla"+iy),hsv:new RegExp("hsv"+oy),hsva:new RegExp("hsva"+iy),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function ly(e){return!!ay.CSS_UNIT.exec(e)}var sy={closable:Boolean,color:{type:String,default:""},content:{type:[String,Function]},default:{type:[String,Function]},disabled:Boolean,icon:{type:Function,default:void 0},maxWidth:{type:[String,Number]},shape:{type:String,default:"square",validator:function(e){return!e||["square","round","mark"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},theme:{type:String,default:"default",validator:function(e){return!e||["default","primary","warning","danger","success"].includes(e)}},variant:{type:String,default:"dark",validator:function(e){return!e||["dark","light","outline","light-outline"].includes(e)}},onClick:Function,onClose:Function};function cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var uy=t.defineComponent({name:"TTag",props:sy,setup:function(e){var n=tc("tag").globalConfig,r=rc("tag"),o=eh({CloseIcon:Dp}).CloseIcon,i=Vd(),a=Bd(),l=oc().SIZE,s=t.computed((function(){return["".concat(r.value),"".concat(r.value,"--").concat(e.theme),"".concat(r.value,"--").concat(e.variant),m(m(m(m({},"".concat(r.value,"--ellipsis"),e.maxWidth),"".concat(r.value,"--close"),e.closable),"".concat(r.value,"--disabled"),e.disabled),l.value[e.size],"medium"!==e.size),"square"!==e.shape&&"".concat(r.value,"--").concat(e.shape)]})),c=t.computed((function(){var t=e.maxWidth,n=u();return e.maxWidth?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cy(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({maxWidth:isNaN(Number(t))?String(t):"".concat(t,"px")},n):n})),u=function(){var t=e.color,n=e.variant;if(!t)return{};var r,o,i,a,l={color:Ab(t).getLuminance()>.5?"black":"white"};if("outline"!==n&&"light-outline"!==n||(l.borderColor=t),"outline"!==n){l.backgroundColor="dark"===n?t:(r=Ab(t).toRgb(),o=r.r,i=r.g,a=r.b,"rgba(".concat(o,", ").concat(i,", ").concat(a,", 0.1)"))}return"dark"!==n&&(l.color=t),l},d=function(t){var n;e.disabled||null===(n=e.onClick)||void 0===n||n.call(e,{e:t})};return function(){var l=function(){if(!e.closable)return null;var i="".concat(r.value,"__icon-close");return n.value.closeIcon?t.h(n.value.closeIcon(t.h),{class:i}):t.createVNode(o,{onClick:function(t){var n,r=t.e;r.stopPropagation(),null===(n=e.onClose)||void 0===n||n.call(e,{e:r})},class:i},null)}(),u=a("default","content"),p=i("icon"),f=fl(u)?u:"",h=f&&e.maxWidth?f:void 0;return t.createVNode("div",{class:s.value,style:c.value,onClick:d},[p,e.maxWidth?t.createVNode("span",{class:m({},"".concat(r.value,"--text"),e.maxWidth),title:h},[u]):u,!e.disabled&&l])}}}),dy={checked:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultChecked:Boolean,checkedProps:{type:Object},content:{type:[String,Number,Array,Function]},default:{type:[String,Function]},disabled:Boolean,size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},uncheckedProps:{type:Object},value:{type:[String,Number]},onChange:Function,onClick:Function},py=/^Space$/i,fy=/^Enter$/i,hy=/^(Enter|Space)$/i;function my(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?my(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):my(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var gy=t.defineComponent({name:"TCheckTag",props:dy,setup:function(e){var n=rc("tag"),r=oc().SIZE,o=Bd(),i=t.toRefs(e),a=ll(Bm(i.checked,i.modelValue,e.defaultChecked,e.onChange,"checked"),2),l=a[0],s=a[1],c=t.computed((function(){return["".concat(n.value),"".concat(n.value,"--check"),r.value[e.size],m(m({},"".concat(n.value,"--checked"),l.value),"".concat(n.value,"--disabled"),e.disabled)]})),u=t.computed((function(){var t=vy({theme:"primary"},e.checkedProps),n=vy({},e.uncheckedProps);return l.value?t:n})),d=function(t){var n,r=t.e;e.disabled||(null===(n=e.onClick)||void 0===n||n.call(e,{e:r}),s(!l.value,{e:r,value:e.value}))},p=function(t){var n,r=t.code||(null===(n=t.key)||void 0===n?void 0:n.trim());(py.test(r)||fy.test(r))&&(t.preventDefault(),s(!l.value,{e:t,value:e.value}))},f=function(e){e.currentTarget.addEventListener("keydown",p)},h=function(e){e.currentTarget.removeEventListener("keydown",p)};return function(){var n,r=o("default","content");return t.createVNode(uy,t.mergeProps({class:c.value,disabled:e.disabled,tabindex:e.disabled?void 0:"0",onFocus:f,onBlur:h},u.value,{onClick:d}),"function"==typeof(n=r)||"[object Object]"===Object.prototype.toString.call(n)&&!t.isVNode(n)?r:{default:function(){return[r]}})}}}),by={checkedProps:{type:Object},multiple:Boolean,options:{type:Array},uncheckedProps:{type:Object},value:{type:Array,default:void 0},modelValue:{type:Array,default:void 0},defaultValue:{type:Array,default:function(){return[]}},onChange:Function};var yy=t.defineComponent({name:"TCheckTagGroup",props:by,setup:function(e,n){var r=t.toRefs(e),o=r.value,i=r.modelValue,a=r.options,l=rc("check-tag-group"),s=t.computed((function(){return[l.value]})),c=ll(Bm(o,i,e.defaultValue,e.onChange),2),u=c[0],d=c[1],p=function(t,n){var r=n.value;if(t)e.multiple?d(u.value.concat(r),{e:n.e,type:"check",value:r}):d([r],{e:n.e,type:"check",value:r});else{var o=[];e.multiple&&(o=u.value.filter((function(e){return e!==r}))),d(o,{e:n.e,type:"uncheck",value:r})}};return function(){return t.createVNode("div",{class:s.value},[(a.value||[]).map((function(r){var o,i;return t.createVNode(gy,{key:r.value,value:r.value,checkedProps:e.checkedProps,uncheckedProps:e.uncheckedProps,checked:u.value.includes(r.value),onChange:p,disabled:r.disabled,size:r.size,"data-value":r.value},(i=o=function(e){return n.slots.option?n.slots.option(e):n.slots.label?n.slots.label(e):e.label?R(e.label)?e.label(t.h):e.label:e.content&&R(e.content)?e.content(t.h):e.default&&R(e.default)?e.default(t.h):e.value}(r),"function"==typeof i||"[object Object]"===Object.prototype.toString.call(i)&&!t.isVNode(i)?o:{default:function(){return[o]}}))}))])}}}),wy=xd(uy);function ky(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ky(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ky(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cy(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}xd(gy),xd(yy);var Sy=xd(t.defineComponent({name:"TTagInput",props:Oy({},Eb),setup:function(e){var n={NAME_CLASS:rc("tag-input"),CLEAR_CLASS:rc("tag-input__suffix-clear"),BREAK_LINE_CLASS:rc("tag-input--break-line")},r=n.NAME_CLASS,o=n.CLEAR_CLASS,i=n.BREAK_LINE_CLASS,a=eh({CloseCircleFilledIcon:jp}).CloseCircleFilledIcon,l=t.toRefs(e),s=l.inputValue,c=l.inputProps,u=ll(Tm(s,e.defaultInputValue,e.onInputChange,"inputValue"),2),d=u[0],f=u[1],h=t.toRefs(e),v=h.excessTagsDisplayType,g=h.readonly,b=h.disabled,y=h.clearable,w=h.placeholder,k=function(e){var n=e.disabled,r=e.readonly,o=e.onMouseenter,i=e.onMouseleave,a=t.ref(!1);return{isHover:a,addHover:function(e){r||n||(a.value=!0,null==o||o(e))},cancelHover:function(e){r||n||(a.value=!1,null==i||i(e))}}}({readonly:e.readonly,disabled:e.disabled,onMouseenter:e.onMouseenter,onMouseleave:e.onMouseleave}),x=k.isHover,C=k.addHover,O=k.cancelHover,S=t.ref(!1),E=tc().classPrefix,N=t.ref(!1),_=function(e){var n=e.sortOnDraggable,r=e.onDragSort,o=e.onDragOverCheck,i=t.ref(-1),a=t.ref(null),l=t.ref(null),s=t.reactive({nodeX:0,nodeWidth:0,mouseX:0}),c=function(e,t,n){if(e.preventDefault(),i.value!==t&&-1!==i.value){var l=e.target;if(null==o||!o.targetClassNameRegExp||null!=o&&o.targetClassNameRegExp.test(l.className)){if(null!=o&&o.x&&l){if(!s.nodeWidth)return;var c=l.getBoundingClientRect(),u=c.x,d=c.width,p=u+d/2,f=e.clientX-(s.mouseX-s.nodeX),h=f+s.nodeWidth;if(!(f>u&&f<u+d?f<p:h>p))return}null==r||r({currentIndex:i.value,current:a,target:n,targetIndex:t}),i.value=t}}};if(!n)return{};function u(e,t,n){i.value=t,a.value=n;var r=e.target;if(o&&r){var l=r.getBoundingClientRect(),c=l.x,u=l.width;s.nodeX=c,s.nodeWidth=u,s.mouseX=e.clientX}}function d(){l.value=!0}function p(){l.value,l.value=!1,i.value=-1,a.value=null}return{onDragStart:u,onDragOver:c,onDrop:d,onDragEnd:p,getDragProps:function(e,t){return n?{draggable:!0,onDragstart:function(n){u(n,e,t)},onDragover:function(n){c(n,e,t)},onDrop:function(){d()},onDragend:function(){p()}}:{}},dragging:-1!==i.value}}(Oy(Oy({},e),{},{sortOnDraggable:e.dragSort,onDragOverCheck:{x:!0,targetClassNameRegExp:new RegExp("^".concat(E.value,"-tag"))}})),M=_.getDragProps,A=function(e){var n=t.ref(),r=t.toRefs(e),o=r.excessTagsDisplayType,i=r.readonly,a=r.disabled,l=t.ref(0),s=t.ref(),c=t.ref(),u=t.ref(!1),d=function(e){var t=e.children[0];s.value=t},p=function(){l.value=s.value.scrollWidth-s.value.clientWidth},f=function(e){var t;R(null===(t=s.value)||void 0===t?void 0:t.scroll)&&s.value.scroll({left:e,behavior:"smooth"})},h=function(){p(),f(l.value),setTimeout((function(){u.value=!0}),200)};return t.onMounted((function(){var e,t=null===(e=n.value)||void 0===e?void 0:e.$el;t&&d(t)})),t.onUnmounted((function(){clearTimeout(c.value)})),{tagInputRef:n,scrollElement:s,scrollDistance:l,scrollTo:f,scrollToRight:h,scrollToLeft:function(){f(0)},updateScrollElement:d,updateScrollDistance:p,onWheel:function(e){var t=e.e;if(!i.value&&!a.value&&s.value)if(t.deltaX>0){var n=Math.min(s.value.scrollLeft+120,l.value);f(n)}else{var r=Math.max(s.value.scrollLeft-120,0);f(r)}},scrollToRightOnEnter:function(){"scroll"===o.value&&(c.value=setTimeout((function(){h(),clearTimeout(c.value)}),100))},scrollToLeftOnLeave:function(){"scroll"===o.value&&(u.value=!1,f(0),clearTimeout(c.value))},isScrollable:u}}(e),T=A.scrollToRight,V=A.onWheel,j=A.scrollToRightOnEnter,B=A.scrollToLeftOnLeave,P=A.tagInputRef,I=A.isScrollable,D=function(e){var n=Vd(),r=rc(),o=t.toRefs(e),i=o.value,a=o.modelValue,l=o.onRemove,s=o.max,c=o.minCollapsedNum,u=o.size,d=o.disabled,f=o.readonly,h=o.tagProps,m=o.getDragProps,v=ll(Bm(i,a,e.defaultValue||[],e.onChange),2),g=v[0],b=v[1],y=t.ref(),w=function(e){var t,n=p(g.value),r=ll(n.splice(e.index,1),1)[0];b(n,xy(xy({trigger:"tag-remove"},e),{},{item:r})),null===(t=l.value)||void 0===t||t.call(l,xy(xy({},e),{},{item:r,trigger:"tag-remove",value:n}))};return{tagValue:g,clearAll:function(e){b([],{trigger:"clear",e:e.e})},onClose:w,onInnerEnter:function(t,n){var r,o,i=t?String(t).trim():"",a=s&&(null===(r=g.value)||void 0===r?void 0:r.length)>=s.value,l=g.value;!a&&i&&(l=g.value instanceof Array?g.value.concat(String(i)):[i],b(l,{trigger:"enter",index:l.length-1,item:i,e:n.e})),null==e||null===(o=e.onEnter)||void 0===o||o.call(e,l,xy(xy({},n),{},{inputValue:t}))},onInputBackspaceKeyUp:function(e){g.value&&g.value.length&&(y.value=e)},onInputBackspaceKeyDown:function(e,t){var n=t.e;if(g.value&&g.value.length&&"Process"!==n.key){var r=/(Backspace|NumpadDelete)/i.test(n.code)||/(Backspace|NumpadDelete)/i.test(n.key);if(!e&&r){var o,i=g.value.length-1,a=g.value[i],s="backspace",c=g.value.slice(0,-1);b(c,{e:n,index:i,item:a,trigger:s}),null===(o=l.value)||void 0===o||o.call(l,{e:n,index:i,item:a,trigger:s,value:c})}y.value=e}},renderLabel:function(e){var o,i=e.displayNode,a=e.label,l=c.value?g.value.slice(0,c.value):g.value,s=i?[i]:(null==l||null===(o=l.map)||void 0===o?void 0:o.call(l,(function(e,r){var o,i=n("tag",{params:{value:e}});return t.createVNode(wy,t.mergeProps({key:"".concat(e).concat(r),size:u.value,disabled:d.value,onClose:function(e){return w({e:e.e,index:r})},closable:!f.value&&!d.value},null===(o=m.value)||void 0===o?void 0:o.call(m,r,e),h.value),{default:function(){return[null!=i?i:e]}})})))||[];if([null,void 0,""].includes(a)||s.unshift(t.createVNode("div",{class:"".concat(r.value,"-tag-input__prefix"),key:"label"},[a])),l.length!==(g.value||[]).length){var p=g.value.length-l.length,v=n("collapsedItems",{params:{value:g.value,count:g.value.length-c.value,collapsedTags:g.value.slice(c.value,g.value.length),collapsedSelectedItems:g.value.slice(c.value,g.value.length),onClose:w}});s.push(null!=v?v:t.createVNode(wy,{key:"more",size:u.value},{default:function(){return["+",p]}}))}return s}}}(t.reactive(Oy(Oy({},t.toRefs(e)),{},{getDragProps:M}))),L=D.tagValue,z=D.onInnerEnter,F=D.onInputBackspaceKeyUp,$=D.onInputBackspaceKeyDown,H=D.clearAll,U=D.renderLabel,W=D.onClose,q=t.computed((function(){var e=!(xe(L.value)&&L.value.length);return[r.value,m(m(m({},i.value,"break-line"===v.value),"".concat(E.value,"-is-empty"),e),"".concat(E.value,"-tag-input--with-tag"),!e)]})),K=t.computed((function(){var e;return null!==(e=L.value)&&void 0!==e&&e.length?"":w.value})),G=t.computed((function(){var e;return Boolean(!g.value&&!b.value&&y.value&&x.value&&((null===(e=L.value)||void 0===e?void 0:e.length)||d.value))}));return t.watch((function(){return I.value}),(function(t){if("scroll"===e.excessTagsDisplayType){var n="".concat(E.value,"-input__prefix"),r=P.value.$el.querySelector(".".concat(n));t?r.classList.add("".concat(n,"--scrollable")):r.classList.remove("".concat(n,"--scrollable"))}})),{CLEAR_CLASS:o,CloseCircleFilledIcon:a,tagValue:L,tInputValue:d,isHover:x,tagInputPlaceholder:K,showClearIcon:G,tagInputRef:P,classPrefix:E,isFocused:N,focus:function(){P.value.focus()},blur:function(){P.value.blur()},setTInputValue:f,onMouseEnter:function(e){C(e),j()},onMouseLeave:function(e){O(e),B()},onInnerFocus:function(t,n){var r;N.value||(N.value=!0,null===(r=e.onFocus)||void 0===r||r.call(e,L.value,{e:n.e,inputValue:t}))},onInnerBlur:function(t,n){var r;N.value=!1,f("",{e:n.e,trigger:"blur"}),null===(r=e.onBlur)||void 0===r||r.call(e,L.value,{e:n.e,inputValue:t})},onInnerChange:function(e,t){f(e,Oy(Oy({},t),{},{trigger:"input"}))},addHover:C,cancelHover:O,onInputEnter:function(e,n){var r,o;null===(r=n.e)||void 0===r||null===(o=r.preventDefault)||void 0===o||o.call(r),f("",{e:n.e,trigger:"enter"}),!S.value&&z(e,n),t.nextTick((function(){T(),S.value=!1}))},onInnerEnter:z,onInputBackspaceKeyUp:F,onInputBackspaceKeyDown:$,renderLabel:U,onWheel:V,scrollToRightOnEnter:j,scrollToLeftOnLeave:B,onClick:function(t){var n;b.value||(N.value=!0,P.value.focus(),null===(n=e.onClick)||void 0===n||n.call(e,t))},onClearClick:function(t){var n;H(t),f("",{e:t.e,trigger:"clear"}),null===(n=e.onClear)||void 0===n||n.call(e,t)},onClose:W,onInputCompositionstart:function(e,t){var n,r;S.value=!0,null===(n=c.value)||void 0===n||null===(r=n.onCompositionstart)||void 0===r||r.call(n,e,t)},onInputCompositionend:function(e,t){var n,r;S.value=!1,null===(n=c.value)||void 0===n||null===(r=n.onCompositionend)||void 0===r||r.call(n,e,t)},classes:q}},render:function(){var e,n=this,r=this.CloseCircleFilledIcon,o=this.showClearIcon?t.createVNode(r,{class:this.CLEAR_CLASS,onClick:this.onClearClick},null):ud(this,"suffixIcon"),i=ud(this,"prefixIcon"),a="".concat(this.classPrefix,"-tag-input__with-suffix-icon");o&&!this.classes.includes(a)&&this.classes.push(a);var l=ud(this,"valueDisplay",{params:{value:this.tagValue,onClose:function(e){return n.onClose({index:e})}}}),s=ud(this,"label",{silent:!0}),c=this.inputProps,u=this.readonly||(null==c?void 0:c.readonly);return t.createVNode(gg,t.mergeProps({ref:"tagInputRef",readonly:u,showInput:!u||!this.tagValue||!(null!==(e=this.tagValue)&&void 0!==e&&e.length),value:this.tInputValue,autoWidth:!0,size:this.size,disabled:this.disabled,label:function(){return n.renderLabel({displayNode:l,label:s})},class:this.classes,tips:this.tips,status:this.status,placeholder:this.tagInputPlaceholder,suffix:this.suffix,suffixIcon:function(){return o},prefixIcon:function(){return i},keepWrapperWidth:!this.autoWidth,onWheel:this.onWheel,onChange:this.onInnerChange,onPaste:this.onPaste,onEnter:this.onInputEnter,onKeyup:this.onInputBackspaceKeyUp,onKeydown:this.onInputBackspaceKeyDown,onMouseenter:this.onMouseEnter,onMouseleave:this.onMouseLeave,onFocus:this.onInnerFocus,onBlur:this.onInnerBlur,onClick:this.onClick,onCompositionstart:this.onInputCompositionstart,onCompositionend:this.onInputCompositionend},this.inputProps),{suffix:this.$slots.suffix})}})),Ey=["tips"];function Ny(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ny(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var My={label:"label",key:"key",children:"children"};function Ay(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ty(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ay(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ay(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vy(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var By=xd(t.defineComponent({name:"TSelectInput",props:jy(jy({},yb),{},{valueDisplayOptions:{type:Object}}),setup:function(e,n){var r={NAME_CLASS:rc("select-input"),BASE_CLASS_BORDERLESS:rc("select-input--borderless"),BASE_CLASS_MULTIPLE:rc("select-input--multiple"),BASE_CLASS_POPUP_VISIBLE:rc("select-input--popup-visible"),BASE_CLASS_EMPTY:rc("select-input--empty")},o=r.NAME_CLASS,i=r.BASE_CLASS_BORDERLESS,a=r.BASE_CLASS_MULTIPLE,l=r.BASE_CLASS_POPUP_VISIBLE,s=r.BASE_CLASS_EMPTY,c=rc(),u=Vd(),d=t.ref(),p=t.ref(),h=t.toRefs(e),v=h.multiple,g=h.value,b=h.popupVisible,w=h.borderless,k=function(e){var n=t.toRefs(e),r=n.popupProps,o=n.autoWidth,i=t.ref(!1),a=tg(),l=function(e,t){var n=(t.scrollHeight,t.offsetHeight,0),o=t.offsetWidth+n>=e.offsetWidth?t.offsetWidth:e.offsetWidth,i={};return r.value&&"object"===f(r.value.overlayInnerStyle)&&!r.value.overlayInnerStyle.width&&(i=r.value.overlayInnerStyle),Ty({width:"".concat(Math.min(o,1e3),"px")},i)},s=function(e,t){var n;return Ty({width:"".concat(Math.max(e.offsetWidth,t.offsetWidth),"px")},null===(n=r.value)||void 0===n?void 0:n.overlayInnerStyle)};return{tOverlayInnerStyle:t.computed((function(){var e,t=(null===(e=r.value)||void 0===e?void 0:e.overlayInnerStyle)||{};return R(t)||y(t)&&t.width?t:o.value?s:l})),innerPopupVisible:i,onInnerPopupVisibleChange:function(t,n){if(!a.value&&!e.readonly){var r,o=!("trigger-element-click"!==n.trigger||!e.allowInput)||t;e.popupVisible!==o&&(i.value=o,null===(r=e.onPopupVisibleChange)||void 0===r||r.call(e,o,n))}}}}(e),x=k.tOverlayInnerStyle,C=k.innerPopupVisible,O=k.onInnerPopupVisibleChange,S=Sb(e,n,p),E=S.isSingleFocus,N=S.commonInputProps,_=S.onInnerClear,M=S.renderSelectSingle,A=function(e,n,r){var o=t.toRefs(e).inputValue,i=rc(),a=t.ref(),l=t.ref(e.autofocus),s=ll(Tm(o,e.defaultInputValue,e.onInputChange,"inputValue"),2),c=s[0],u=s[1],d=tg(),p=t.computed((function(){return _y(_y({},My),e.keys)})),f=t.computed((function(){return e.value instanceof Array?e.value.map((function(e){return y(e)?e[p.value.label]:e})):y(e.value)?[e.value[p.value.label]]:[e.value]})),h=t.computed((function(){return f.value&&f.value.length?"":e.placeholder})),v=function(t,n){var r,o;"tag-remove"===n.trigger&&(null===(o=n.e)||void 0===o||o.stopPropagation()),null===(r=e.onTagChange)||void 0===r||r.call(e,t,n)},g=function(e,t){"enter"!==t.trigger&&"blur"!==t.trigger&&u(e,{trigger:t.trigger,e:t.e})},b=function(t,n){var o,i,a=null===(o=r.value)||void 0===o?void 0:o.getOverlayState();null!=a&&a.hover||(l.value=!1,null===(i=e.onBlur)||void 0===i||i.call(e,e.value,_y(_y({},n),{},{tagInputValue:t})))},w=function(t,n){var o,i,a=null===(o=r.value)||void 0===o?void 0:o.getOverlayState();if(!(l.value||null!=a&&a.hover)){l.value=!0;var s=_y(_y({},n),{},{tagInputValue:t});null===(i=e.onFocus)||void 0===i||i.call(e,e.value,s)}},k=function(t,n){var r,o=_y(_y({},n),{},{tagInputValue:t});null===(r=e.onEnter)||void 0===r||r.call(e,e.value,o)};return{tags:f,tPlaceholder:h,tagInputRef:a,isMultipleFocus:l,multipleInputValue:c,renderSelectMultiple:function(r){var o=_y(_y({},r.commonInputProps),{},{tagProps:e.tagProps,label:e.label,autoWidth:e.autoWidth,readonly:e.readonly,placeholder:h.value,minCollapsedNum:e.minCollapsedNum,collapsedItems:e.collapsedItems,tag:e.tag,value:f.value,valueDisplay:e.valueDisplay,inputValue:r.popupVisible&&r.allowInput?c.value:"",inputProps:_y({readonly:!e.allowInput||e.readonly,inputClass:m({},"".concat(i.value,"-input--focused"),r.popupVisible)},e.inputProps),suffixIcon:!d.value&&e.loading?function(){return t.createVNode(Cd,{loading:!0,size:"small"},null)}:e.suffixIcon},e.tagInputProps),l=n.slots;l.tips;var s=cl(l,Ey);return t.createVNode(Sy,t.mergeProps({ref:a},o,{onInputChange:g,onChange:v,onClear:r.onInnerClear,onBlur:b,onEnter:k,onFocus:w}),s)}}}(e,n,p),T=A.isMultipleFocus,V=A.tagInputRef,j=A.renderSelectMultiple,B=t.computed((function(){return e.multiple?T.value:E.value})),P=t.computed((function(){var e;return["".concat(o.value),m(m(m(m({},a.value,v.value),i.value,w.value),l.value,null!==(e=b.value)&&void 0!==e?e:C.value),s.value,g.value instanceof Array?!g.value.length:!g.value)]})),I=function(t){var r,o=t.code||(null===(r=t.key)||void 0===r?void 0:r.trim());if(/(ArrowDown|ArrowUp)/.test(o)&&!b.value){var i,a=jy(jy({},n),{},{trigger:"trigger-element-focus"});null===(i=e.onPopupVisibleChange)||void 0===i||i.call(e,!0,a)}};t.watch([B],(function(e){var t=ll(e,1)[0];b.value||(t?d.value.addEventListener("keydown",I):d.value.removeEventListener("keydown",I))})),t.onMounted((function(){!b.value&&B&&d.value.addEventListener("keydown",I)})),t.onBeforeUnmount((function(){d.value.removeEventListener("keydown",I)}));return{classPrefix:c,NAME_CLASS:o,innerPopupVisible:C,commonInputProps:N,tOverlayInnerStyle:x,selectInputRef:d,popupRef:p,classes:P,onInnerClear:_,renderTNodeJSX:u,renderSelectSingle:M,renderSelectMultiple:j,onOverlayClick:function(t){var n,r;null===(n=t.e)||void 0===n||n.stopPropagation(),t.e.target.tabIndex>=0||e.multiple&&(null===(r=V.value)||void 0===r||r.focus())},onInnerPopupVisibleChange:O}},render:function(){var e,n,r=this,o={visible:null!==(e=this.popupVisible)&&void 0!==e?e:this.innerPopupVisible},i=t.createVNode(Zm,t.mergeProps({ref:"popupRef",trigger:(null===(n=this.popupProps)||void 0===n?void 0:n.trigger)||"click",placement:"bottom-left"},o,{content:this.panel,hideEmptyPopup:!0},jy(jy({onVisibleChange:this.onInnerPopupVisibleChange,onOverlayClick:this.onOverlayClick},this.popupProps),{},{overlayInnerStyle:this.tOverlayInnerStyle})),jy({default:function(){return[r.multiple?r.renderSelectMultiple({commonInputProps:r.commonInputProps,onInnerClear:r.onInnerClear,popupVisible:o.visible,allowInput:r.allowInput}):r.renderSelectSingle(o.visible)]}},jy(jy({},this.$slots),{},{content:this.$slots.panel}))),a=this.renderTNodeJSX("tips"),l=["".concat(this.classPrefix,"-input__tips"),"".concat(this.classPrefix,"-tips"),"".concat(this.classPrefix,"-is-").concat(this.status)];return t.createVNode("div",{ref:"selectInputRef",class:this.classes},[i,a&&t.createVNode("div",{class:l},[a])])}})),Py={checkAll:Boolean,content:{type:[String,Function]},default:{type:[String,Function]},disabled:Boolean,label:{type:String,default:""},title:{type:String,default:""},value:{type:[String,Number]}},Iy={checkAll:Boolean,checked:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultChecked:Boolean,default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:{type:[String,Function]},lazyLoad:Boolean,name:{type:String,default:""},readonly:Boolean,value:{type:[String,Number,Boolean]},onChange:Function},Dy=Symbol("CheckboxGroupProvide");function Ly(e,t,n,r){if("undefined"==typeof window)return null;if(!window||!window.IntersectionObserver)return n(),null;var o=null;try{(o=new window.IntersectionObserver((function(t){t[0].isIntersecting&&(n(),o.unobserve(e))}),{rootMargin:"0px 0px ".concat(r,"px 0px"),root:t})).observe(e)}catch(i){console.error(i),n()}return o}function Ry(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ry(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ry(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fy=t.defineComponent({name:"TCheckbox",props:zy(zy({},Iy),{},{needRipple:Boolean,stopLabelTrigger:Boolean,index:Number,data:Object}),setup:function(e){var n=t.ref();e.needRipple&&Md(n);var r=oc().STATUS,o=t.toRefs(e),i=o.checked,a=o.modelValue,l=o.lazyLoad,s=ll(Bm(i,a,e.defaultChecked,e.onChange,"checked"),2),c=s[0],u=s[1],d=t.inject(Dy,void 0),p=t.ref();t.watch((function(){return[e.name,null==d?void 0:d.value.name].join("_")}),(function(){var t=e.name||(null==d?void 0:d.value.name);t&&(p.value=t)}),{immediate:!0});var f=t.ref(!1);t.watch((function(){var e;return[c.value,null==d?void 0:d.value.isCheckAll,null==d||null===(e=d.value.checkedValues)||void 0===e?void 0:e.join(",")]}),(function(){var t;f.value=(t=e.value,e.checkAll?null==d?void 0:d.value.isCheckAll:null!=d&&d.value?d.value.checkedValues.includes(t):c.value)}),{immediate:!0});var h=Ld({beforeDisabled:t.computed((function(){return!(e.checkAll||f.value||null==d||!d.value.maxExceeded)||null})),afterDisabled:t.computed((function(){return null==d?void 0:d.value.disabled}))}),v=t.ref(!1);t.watch((function(){return[e.checkAll,e.indeterminate,null==d?void 0:d.value.indeterminate]}),(function(){v.value=e.checkAll?null==d?void 0:d.value.indeterminate:e.indeterminate}),{immediate:!0});var g=rc("checkbox"),b=t.ref({});t.watch([f,h,v],(function(){b.value=["".concat(g.value),m(m(m({},r.value.checked,f.value),r.value.disabled,h.value),r.value.indeterminate,v.value)]}),{immediate:!0});var y=function(t){if(!e.readonly){var n=!f.value;u(n,{e:t}),null!=d&&d.value.handleCheckboxChange&&d.value.onCheckedChange({checked:n,checkAll:e.checkAll,e:t,option:e})}},w=Bd(),k=function(t){e.stopLabelTrigger&&t.preventDefault()},x=function(e,n){var r=t.ref(),o=t.ref(!0),i=function(){if(n.value){o.value=!1;var t=Ly(e.value,null,(function(){o.value=!0}),0);r.value=t}};return t.onMounted(i),t.watch([n,e],i),t.onBeforeUnmount((function(){n.value&&r.value.unobserve(e.value)})),{showCheckbox:o}}(n,l),C=x.showCheckbox,O=function(e){var t=function(t){(hy.test(t.key)||hy.test(t.code))&&(t.preventDefault(),!t.currentTarget.querySelector("input").disabled&&e(t))};return{onCheckboxFocus:function(e){e.currentTarget.addEventListener("keydown",t)},onCheckboxBlur:function(e){e.currentTarget.removeEventListener("keydown",t)}}}(y),S=O.onCheckboxFocus,E=O.onCheckboxBlur;return function(){return t.createVNode("label",{ref:n,class:b.value,tabindex:h.value?void 0:"0",onFocus:S,onBlur:E},[C.value?[t.createVNode("input",{type:"checkbox",tabindex:"-1",class:"".concat(g.value,"__former"),disabled:h.value,readonly:e.readonly,indeterminate:v.value,name:p.value,value:e.value?e.value:void 0,checked:f.value,onChange:y,key:"input"},null),t.createVNode("span",{class:"".concat(g.value,"__input"),key:"input-span"},null),t.createVNode("span",{class:"".concat(g.value,"__label"),key:"label",onClick:k},[w("default","label")])]:null])}}}),$y={disabled:{type:Boolean,default:void 0},lazyLoad:Boolean,max:{type:Number,default:void 0},name:{type:String,default:""},options:{type:Array},value:{type:Array,default:void 0},modelValue:{type:Array,default:void 0},defaultValue:{type:Array,default:function(){return[]}},onChange:Function},Hy=t.defineComponent({name:"TCheckboxGroup",props:$y,setup:function(e){var n=rc("checkbox-group"),r=Vd(),o=Array.isArray,i=t.toRefs(e),a=ll(Bm(i.value,i.modelValue,e.defaultValue,e.onChange),2),l=a[0],s=a[1],c=t.ref([]),u=t.computed((function(){if(!o(l.value))return 0;var e=c.value.map((function(e){return e.value}));return bb(l.value,e).length})),d=t.computed((function(){var e=c.value.filter((function(e){return!e.disabled&&!e.checkAll})).map((function(e){return e.value}));return bb(e,l.value).length===e.length})),h=t.computed((function(){return!d.value&&u.value<c.value.length&&0!==u.value})),m=t.computed((function(){return!ml(e.max)&&l.value.length===e.max}));t.watchEffect((function(){if(!e.options)return[];c.value=e.options.map((function(e){return y(e)?e:{label:String(e),value:e}}))}));var v=function(e,t){var n=e?function(){for(var e=new Set,t=0,n=c.value.length;t<n;t++){var r=c.value[t];if(!r.checkAll&&!r.disabled&&(e.add(r.value),m.value))break}return p(e)}():[];s(n,{e:t.e,type:e?"check":"uncheck",current:void 0,option:void 0})},g=function(e){var t=e.option.value;if(o(l.value)){var n=p(l.value);if(e.checked)n.push(t);else{var r=n.indexOf(t);n.splice(r,1)}s(n,{e:e.e,current:e.option.value,option:e.option,type:e.checked?"check":"uncheck"})}else console.warn("TDesign CheckboxGroup Warn: `value` must be an array, instead of ".concat(f(l.value)))},b=function(e){var t=e.checked,n=e.checkAll,r=e.e;n?v(t,{e:r}):g(e)},w=Lf();return t.provide(Dy,t.computed((function(){return{name:e.name,isCheckAll:d.value,checkedValues:l.value||[],maxExceeded:m.value,disabled:e.disabled,indeterminate:h.value,handleCheckboxChange:g,onCheckedChange:b}}))),function(){var o,i=null;if(null!==(o=e.options)&&void 0!==o&&o.length){var a;i=null===(a=c.value)||void 0===a?void 0:a.map((function(n,r){var o;return t.createVNode(Fy,t.mergeProps({key:"".concat(n.value||"").concat(r),lazyLoad:e.lazyLoad},n,{index:r,checked:null===(o=l.value)||void 0===o?void 0:o.includes(n.value),data:n}),null)}))}else{var s=r("default");c.value=function(){var e=w("Checkbox"),t=[];return null==e||e.forEach((function(e){var n=e.props;n&&(""!==n["check-all"]&&!0!==n["check-all"]||(n.checkAll=!0),t.push(n))})),t}(),i=s}return t.createVNode("div",{class:n.value,role:"group","aria-label":"checkbox-group"},[i])}}}),Uy=xd(Fy);function Wy(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return qy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qy(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function qy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}xd(Hy);var Ky=Symbol("selectProvide"),Gy=function(e,t){var n=t.value.get(e);return(null==n?void 0:n.label)||(null==e?void 0:e.toString())},Yy=function(e,t){var n=qs(e),r=n.indexOf(t);return r<0?n.push(t):n.splice(r,1),{value:n,isCheck:r<0}};function Xy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xy(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jy=t.defineComponent({name:"TOption",props:Zy(Zy({},Py),{},{createAble:Boolean,multiple:Boolean,index:Number,rowIndex:Number,trs:Map,scrollType:String,isVirtual:Boolean,bufferSize:Number,checkAll:Boolean}),emits:["row-mounted"],setup:function(e,n){var r=t.inject(Ky),o=tg(),i=t.computed((function(){return 0!==r.value.max&&r.value.max<=r.value.selectValue.length})),a=t.computed((function(){return o.value||e.multiple&&i.value&&!v.value&&!r.value.isCheckAll})),l=Bd(),s=rc("select"),c=oc(),u=c.STATUS,d=c.SIZE,f=t.ref(),h=t.ref(!1),v=t.computed((function(){return!(!r.value.isCheckAll||e.disabled)||(e.multiple?r.value.selectValue.includes(e.value):r.value.selectValue===e.value)})),g=t.computed((function(){return!!e.checkAll&&r.value.indeterminate})),b=t.computed((function(){return["".concat(s.value,"-option"),[d.value[r.value.size]],m(m(m({},u.value.disabled,a.value),u.value.selected,v.value),"".concat(s.value,"-option__hover"),(h.value||r.value.hoverIndex===e.index)&&!a.value)]})),y=t.computed((function(){return e.label||e.value})),w=function(t){if(!e.disabled&&!a.value){if(e.multiple)return k(!v.value,{e:t}),void t.preventDefault();var n,o;if(e.createAble)if(null===(n=(o=r.value).handleCreate)||void 0===n||n.call(o,e.value),r.value.multiple)return void r.value.handleValueChange([].concat(p(r.value.selectValue),[e.value]),{selectedOptions:r.value.getSelectedOptions(),trigger:"check",e:t});var i=r.value.getSelectedOptions(e.value);r.value.handleValueChange(e.value,{option:null==i?void 0:i[0],selectedOptions:i,trigger:"check",e:t}),r.value.handlePopupVisibleChange(!1,{e:t})}},k=function(t,n){if(e.checkAll)r.value.onCheckAllChange(t);else{var o=Yy(r.value.selectValue,e.value),i=r.value.getSelectedOptions(o.value);r.value.handleValueChange(o.value,{option:i.find((function(t){return t.value===e.value})),selectedOptions:i,trigger:t?"check":"uncheck",e:n.e}),r.value.reserveKeyword||r.value.handlerInputChange("")}};return t.onMounted((function(){var t=e.trs,r=e.rowIndex;e.isVirtual&&(t.set(r,f.value),n.emit("row-mounted"))})),t.onBeforeUnmount((function(){if(e.isVirtual){var t=e.trs,n=e.rowIndex;t.delete(n)}})),Md(f),function(){var n,o=l("default","content")||y.value;return t.createVNode("li",{ref:f,class:b.value,title:e.title||"".concat(y.value),onMouseenter:function(){return h.value=!0},onMouseleave:function(){return h.value=!1},onClick:w},[r&&e.multiple?t.createVNode(Uy,{checked:v.value,disabled:a.value,onChange:k,indeterminate:g.value},(n=o,"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!t.isVNode(n)?o:{default:function(){return[o]}})):t.createVNode("span",null,[o])])}}}),Qy={divider:{type:Boolean,default:!0},label:{type:String,default:""}};function ew(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var tw=t.defineComponent({name:"TOptionGroup",props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ew(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ew(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Qy),setup:function(e){var n=t.inject(Ky),r=rc("select-option-group"),o=oc().SIZE,i=Vd(),a=t.computed((function(){return[r.value,o.value[n.value.size],m({},"".concat(r.value,"__divider"),e.divider)]}));return function(){return t.createVNode("li",{class:a.value},[t.createVNode("div",{class:"".concat(r.value,"__header")},[e.label]),i("default")])}}}),nw={autoWidth:Boolean,autofocus:Boolean,borderless:Boolean,clearable:Boolean,collapsedItems:{type:Function},creatable:Boolean,disabled:Boolean,empty:{type:[String,Function]},filter:{type:Function},filterable:Boolean,inputProps:{type:Object},inputValue:{type:[String,Number],default:void 0},defaultInputValue:{type:[String,Number]},keys:{type:Object},label:{type:[String,Function]},loading:Boolean,loadingText:{type:[String,Function]},max:{type:Number,default:0},minCollapsedNum:{type:Number,default:0},multiple:Boolean,options:{type:Array},panelBottomContent:{type:[String,Function]},panelTopContent:{type:[String,Function]},placeholder:{type:String,default:void 0},popupProps:{type:Object},popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:Boolean,prefixIcon:{type:Function},readonly:Boolean,reserveKeyword:Boolean,scroll:{type:Object},selectInputProps:{type:Object},showArrow:{type:Boolean,default:!0},size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},status:{type:String,default:"default",validator:function(e){return!e||["default","success","warning","error"].includes(e)}},suffix:{type:[String,Function]},suffixIcon:{type:Function},tagInputProps:{type:Object},tagProps:{type:Object},tips:{type:[String,Function]},value:{type:[String,Number,Boolean,Object,Array],default:void 0},modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},defaultValue:{type:[String,Number,Boolean,Object,Array],default:void 0},valueDisplay:{type:[String,Function]},valueType:{type:String,default:"value",validator:function(e){return!e||["value","object"].includes(e)}},onBlur:Function,onChange:Function,onClear:Function,onCreate:Function,onEnter:Function,onFocus:Function,onInputChange:Function,onPopupVisibleChange:Function,onRemove:Function,onSearch:Function},rw=function(e){var n,r,o,i,a,l=t.computed((function(){var t,n,r;return"virtual"===(null===(t=e.scroll)||void 0===t?void 0:t.type)&&(null===(n=e.options.value)||void 0===n?void 0:n.length)>((null===(r=e.scroll)||void 0===r?void 0:r.threshold)||100)})),s="virtual"===(null===(n=e.scroll)||void 0===n?void 0:n.type)?function(e){var n=e.data,r=e.container,o=e.fixedHeight,i=void 0!==o&&o,a=e.lineHeight,l=void 0===a?30:a,s=e.bufferSize,c=void 0===s?20:s,u=e.threshold,d=void 0===u?100:u,p=t.reactive({visibleData:[],cachedHeight:[],cachedScrollY:[]}),f=t.computed((function(){return n.value.length>d})),h=t.ref(0),m=new Map,v=0,g=0,b=0,y=0,w=0,k=0,x=function(){n.value.forEach((function(e,t){e.$index=t,i&&(p.cachedScrollY[t]=t*l)})),i||(p.cachedScrollY[n.value.length-1]=void 0)};x();var C=t.computed((function(){var e=p.cachedHeight;if(e.length){var t=e.reduce((function(e,t){return e+t||l}),0);if(e.length===n.value.length)return t;var r=t/e.length;return t+(n.value.length-e.length)*r}return f.value?n.value.length*l:0})),O=t.computed((function(){var e=p.visibleData,t=e[0];return t?1===e.length?0:p.cachedScrollY[t.$index]:0})),S=function(){k=Math.min(w+v+2*c,n.value.length),p.visibleData=n.value.slice(w,k)},E=function(){var e,o=m.get(b);if(o){var i=null==o||null===(e=o.getBoundingClientRect())||void 0===e?void 0:e.height;p.cachedScrollY[b]=r.value.scrollTop-y,p.cachedHeight[b]=i;for(var a=b+1;a<=(null===(l=p.visibleData[p.visibleData.length-1])||void 0===l?void 0:l.$index);a++){var l,s=m.get(a),c=((null==s?void 0:s.getBoundingClientRect())||{}).height;p.cachedHeight[a]=c;var u=p.cachedScrollY[a-1]+p.cachedHeight[a-1];p.cachedScrollY.splice(a,1,u)}for(var d=b-1;d>=(null===(f=p.visibleData[0])||void 0===f?void 0:f.$index);d--){var f,h=m.get(d),v=((null==h?void 0:h.getBoundingClientRect())||{}).height;p.cachedHeight[d]=v;var x=p.cachedScrollY[d+1]-p.cachedHeight[d];p.cachedScrollY.splice(d,1,x)}if(p.cachedScrollY[0]>0){for(var C=p.cachedScrollY[0],O=Math.min(k,n.value.length),S=0;S<O;S++)p.cachedScrollY.splice(S,1,p.cachedScrollY[S]-C);var E=p.cachedScrollY[b-1]?p.cachedScrollY[b-1]+y:y;r.value.scrollTop=E,g=E}if(p.cachedScrollY[w]<0){var N=p.cachedHeight.slice(0,Math.max(0,b)).reduce((function(e,t){return e+t}),0)+y;r.value.scrollTop=N,g=N,0===N&&(b=0,y=0)}t.nextTick((function(){var e=r.value,t=e.scrollTop,n=e.scrollHeight;if(t+e.clientHeight===n)for(var o=k-1;o>=w;o--)o===k-1?p.cachedScrollY.splice(o,1,n.value-p.cachedHeight[o]):p.cachedScrollY.splice(o,1,p.cachedScrollY[o+1]-p.cachedHeight[o])}))}};!i&&t.watch(h,E,{flush:"post"}),t.watch(n,(function(){x(),p.visibleData=[],p.cachedScrollY=[],p.cachedHeight=[],g=0,b=0,y=0,w=0,m.clear(),n.value.length<=d?p.visibleData=n.value:S(),r.value&&(r.value.scrollTop=0)}));var N=!1,_=function(){N&&(v=Math.ceil(r.value.offsetHeight/l),S())};return t.onMounted((function(){if(window&&window.IntersectionObserver){var e=new window.IntersectionObserver((function(t){var n=t[0];(n.isIntersecting||n.intersectionRatio)&&(N=!0,f.value&&_(),e.unobserve(r.value))}));r.value&&e.observe(r.value)}})),jm(jm({trs:m,scrollHeight:C},t.toRefs(p)),{},{translateY:O,handleScroll:function(){if(f.value){var e=r.value.scrollTop,t=e-g;g=e;var o=b;if(t+=y){if(t>=0){for(;o<n.value.length&&t>(p.cachedHeight[o]||l);)p.cachedHeight[o]||(p.cachedHeight[o]=l),t-=p.cachedHeight[o],o++;o>=n.value.length?(b=n.value.length-1,y=0):(b=o,y=t);var i=r.value;e+i.clientHeight===i.scrollHeight&&(b=n.value.length-v+1),w<=b-c&&(w=Math.min(n.value.length-v,b-c))<0&&(w=0)}else{for(;t<0;)o--,p.cachedHeight[o]||(p.cachedHeight[o]=l),t+=p.cachedHeight[o];o<0?(b=0,y=0):(b=o,y=t),E(),w>b-c&&(w=Math.max(0,b-c))}S()}}},handleRowMounted:function(){f.value&&h.value++},refreshContainer:_,fixedHeight:i,calculateScrollY:E})}({container:e.popupContentRef,data:e.options,fixedHeight:(null===(r=e.scroll)||void 0===r?void 0:r.isFixedRowHeight)||!1,lineHeight:(null===(o=e.scroll)||void 0===o?void 0:o.rowHeight)||28,bufferSize:(null===(i=e.scroll)||void 0===i?void 0:i.bufferSize)||20,threshold:(null===(a=e.scroll)||void 0===a?void 0:a.threshold)||100}):{},c=s.trs,u=void 0===c?null:c,d=s.visibleData,p=void 0===d?null:d,f=s.handleScroll,h=void 0===f?null:f,m=s.scrollHeight,v=void 0===m?null:m,g=s.translateY,b=void 0===g?null:g,y=s.handleRowMounted,w=void 0===y?null:y,k=-1,x=function(e){if(l.value){var t=e.target.scrollTop;Math.abs(k-t)>5?(h(),k=t):k=-1}};t.onMounted((function(){var t;null===(t=e.popupContentRef.value)||void 0===t||t.addEventListener("scroll",x)})),t.onBeforeUnmount((function(){var t;null===(t=e.popupContentRef.value)||void 0===t||t.removeEventListener("scroll",x)}));var C=t.computed((function(){return{position:"absolute",width:"1px",height:"1px",transition:"transform 0.2s",transform:"translate(0, ".concat(v.value,"px)"),"-ms-transform":"translate(0, ".concat(v.value,"px)"),"-moz-transform":"translate(0, ".concat(v.value,"px)"),"-webkit-transform":"translate(0, ".concat(v.value,"px)")}})),O=t.computed((function(){return{transform:"translate(0, ".concat(b.value,"px)"),"-ms-transform":"translate(0, ".concat(b.value,"px)"),"-moz-transform":"translate(0, ".concat(b.value,"px)"),"-webkit-transform":"translate(0, ".concat(b.value,"px)")}}));return{trs:u,scrollHeight:v,translateY:b,visibleData:p,handleRowMounted:w,isVirtual:l,cursorStyle:C,panelStyle:O}};var ow=t.defineComponent({name:"TSelectPanel",props:{inputValue:nw.inputValue,panelTopContent:nw.panelTopContent,panelBottomContent:nw.panelBottomContent,empty:nw.empty,creatable:nw.creatable,loading:nw.loading,loadingText:nw.loadingText,multiple:nw.multiple,filterable:nw.filterable,filter:nw.filter,scroll:nw.scroll,size:nw.size},setup:function(e,n){var r=n.expose,o=rc("select"),i=Vd(),a=jd(),l=tc("select"),s=l.t,c=l.globalConfig,u=t.inject(Ky),d=t.ref(null),p=t.computed((function(){return u.value.popupContentRef.value})),f=t.computed((function(){return e.creatable&&e.filterable&&e.inputValue})),h=t.computed((function(){return u.value.displayOptions})),m=rw({scroll:e.scroll,popupContentRef:p,options:h}),v=m.trs,g=m.visibleData,b=m.handleRowMounted,y=m.isVirtual,w=m.panelStyle,k=m.cursorStyle,x=t.computed((function(){return!h.value.length})),C=function n(r){return t.createVNode("ul",{class:"".concat(o.value,"__list")},[r.map((function(r,o){var i,a,l,s;return r.group?t.createVNode(tw,{label:r.group,divider:r.divider},"function"==typeof(s=l=n(r.children))||"[object Object]"===Object.prototype.toString.call(s)&&!t.isVNode(s)?l:{default:function(){return[l]}}):t.createVNode(Jy,t.mergeProps(Sv(r,"index","$index","className","tagName"),y.value?{rowIndex:r.$index,trs:v,scrollType:null===(i=e.scroll)||void 0===i?void 0:i.type,isVirtual:y.value,bufferSize:null===(a=e.scroll)||void 0===a?void 0:a.bufferSize,key:"".concat(r.$index||"","_").concat(o)}:{key:"".concat(o,"_").concat(r.value)},{index:o,multiple:e.multiple,onRowMounted:b}),r.slots)}))])},O=t.computed((function(){return{small:"s",medium:"m",large:"l"}[u.value.size]}));r({innerRef:d,visibleData:g,isVirtual:y,displayOptions:h});return{renderPanel:function(n,r){return t.createVNode("div",{ref:d,class:["".concat(o.value,"__dropdown-inner"),"".concat(o.value,"__dropdown-inner--size-").concat(O.value)],style:r},[f.value&&t.createVNode("ul",{class:["".concat(o.value,"__create-option"),"".concat(o.value,"__list")]},[t.createVNode(Jy,{value:e.inputValue,label:"".concat(e.inputValue),createAble:!0,class:"".concat(o.value,"__create-option--special")},null)]),e.loading&&a("loadingText",{defaultNode:t.createVNode("div",{class:"".concat(o.value,"__loading-tips")},[s(c.value.loadingText)])}),!e.loading&&x.value&&!f.value&&a("empty",{defaultNode:t.createVNode("div",{class:"".concat(o.value,"__empty")},[s(c.value.empty)])}),!x.value&&!e.loading&&C(n)])},panelStyle:w,cursorStyle:k,isVirtual:y,displayOptions:h,visibleData:g,renderTNodeJSX:i}},render:function(){return this.isVirtual?t.createVNode(t.Fragment,null,[this.renderTNodeJSX("panelTopContent"),t.createVNode("div",null,[t.createVNode("div",{style:this.cursorStyle},null),this.renderPanel(this.visibleData,this.panelStyle)]),this.renderTNodeJSX("panelBottomContent")]):t.createVNode(t.Fragment,null,[this.renderTNodeJSX("panelTopContent"),this.renderPanel(this.displayOptions),this.renderTNodeJSX("panelBottomContent")])}});function iw(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return aw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aw(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function aw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lw(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cw=["overlayClassName"];function uw(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return dw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dw(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function dw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pw(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hw=t.defineComponent({name:"TSelect",props:fw(fw({},nw),{},{valueDisplayOptions:{type:Object}}),setup:function(e,n){var r=n.slots,o=rc(),i=tg(),a=Vd(),l=rc("select"),s=tc("select"),c=s.globalConfig,u=s.t,d=t.toRefs(e),f=d.popupVisible,h=d.inputValue,v=d.modelValue,g=d.value,b=ll(Tm(h,e.defaultInputValue,e.onInputChange,"inputValue"),2),y=b[0],w=b[1],k=ll(Bm(g,v,e.defaultValue,e.onChange),2),x=k[0],C=k[1],O=t.ref(null),S=t.ref(null),E=t.computed((function(){var t,n,r;return{label:(null===(t=e.keys)||void 0===t?void 0:t.label)||"label",value:(null===(n=e.keys)||void 0===n?void 0:n.value)||"value",disabled:(null===(r=e.keys)||void 0===r?void 0:r.disabled)||"disabled"}})),N=function(e,n,r){var o=Lf(),i=t.ref([]),a=t.computed((function(){var t,r=0,i=(null===(t=e.options)||void 0===t?void 0:t.map((function(e){var t=function(e){var t=n.value,o=t.value,i=t.label,a=t.disabled,l=sw(sw({},e),{},{index:r,label:Fo(e,i),value:Fo(e,o),disabled:Fo(e,a)});return r++,l};return e.group&&e.children?sw(sw({},e),{},{children:e.children.map((function(e){return t(e)}))}):t(e)})))||[],a=o("Option"),l=o("OptionGroup");if(xe(l)){var s,c=iw(l);try{for(c.s();!(s=c.n()).done;){var u,d,p,f=s.value,h=sw(sw({group:null===(u=f.props)||void 0===u?void 0:u.label},f.props),{},{children:[]}),m=f.children.default();if(xe(m)&&null!==(d=m[0])&&void 0!==d&&d.children){var v,g=iw(null==m||null===(p=m[0])||void 0===p?void 0:p.children);try{for(g.s();!(v=g.n()).done;){var b=v.value;h.children.push(sw(sw({},b.props),{},{slots:b.children,index:r})),r++}}catch(x){g.e(x)}finally{g.f()}i.push(h)}}}catch(x){c.e(x)}finally{c.f()}}if(xe(a)){var y,w=iw(a);try{for(w.s();!(y=w.n()).done;){var k=y.value;i.push(sw(sw({},k.props),{},{slots:k.children,index:r})),r++}}catch(x){w.e(x)}finally{w.f()}}return i})),l=t.computed((function(){var e=[];return function t(n){var r,o=iw(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;i.group?t(i.children):e.push(i)}}catch(a){o.e(a)}finally{o.f()}}(a.value),e})),s=t.computed((function(){var e=new Map;return i.value.concat(l.value).forEach((function(t){e.set(t.value,t)})),e})),c=t.computed((function(){if(e.onSearch&&e.filterable)return a.value;if(!r.value||!e.filterable&&!R(e.filter))return a.value;var t=function(t){var n,o;return R(e.filter)?e.filter("".concat(r.value),t):(null===(n=t.label)||void 0===n||null===(o=n.toLowerCase)||void 0===o?void 0:o.call(n).indexOf("".concat(r.value).toLowerCase()))>-1},n=[];return a.value.forEach((function(e){e.group&&e.children&&n.push(sw(sw({},e),{},{children:e.children.filter(t)})),t(e)&&n.push(e)})),n}));return{options:a,optionsMap:s,optionsList:l,optionsCache:i,displayOptions:c}}(e,E,y),_=N.optionsMap,M=N.optionsList,A=N.optionsCache,T=N.displayOptions,V=t.computed((function(){return void 0===x.value?e.multiple?[]:void 0:"object"===e.valueType?e.multiple?x.value.map((function(e){return e[E.value.value]})):x.value[E.value.value]:x.value})),j=function(t,n){if("object"===e.valueType){var r=E.value,o=r.value,i=r.label,a=function(e){if(void 0!==e){var t=_.value.get(e);return m(m({},o,Fo(t,o)),i,Fo(t,i))}};t=e.multiple?t.map((function(e){return a(e)})):a(t)}t!==x.value&&C(t,fw({selectedOptions:q(t)},n))},B=ll(Tm(f,!1,(function(t,n){var r;null===(r=e.onPopupVisibleChange)||void 0===r||r.call(e,t,n)}),"popupVisible"),2),P=B[0],I=B[1],D=t.computed((function(){var t;return null!==(t=!e.multiple&&P.value&&Gy(V.value,_)||e.placeholder)&&void 0!==t?t:u(c.value.placeholder)})),L=t.computed((function(){return e.multiple?function(e,t){var n,r=[],o=Wy(e);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=Gy(i,t);a&&r.push(a)}}catch(l){o.e(l)}finally{o.f()}return r}(V.value,_):Gy(V.value,_)})),z=t.computed((function(){var t,n=e.multiple&&xe(V.value)?V.value.map((function(e){var t;return{value:e,label:null===(t=_.value.get(e))||void 0===t?void 0:t.label}})):V.value,r={value:n,onClose:e.multiple?function(e){return $(e)}:function(){}};return e.minCollapsedNum&&e.multiple?fw(fw({},r),{},{displayValue:null==n||null===(t=n.slice)||void 0===t?void 0:t.call(n,0,e.minCollapsedNum)}):r})),F=t.computed((function(){return Boolean(e.filterable||c.value.filterable||R(e.filter))})),$=function(t,n){var r;n&&n.stopPropagation();var o=qs(V.value),i=o[t];o.splice(t,1),j(o,{selectedOptions:q(o),trigger:"tag-remove",e:n}),null===(r=e.onRemove)||void 0===r||r.call(e,{value:i,data:_.value.get(i),e:n})},H=function(){var t;y.value&&(null===(t=e.onCreate)||void 0===t||t.call(e,y.value),w(""))},U=t.computed((function(){var e;return null===(e=S.value)||void 0===e?void 0:e.popupRef.getOverlay()})),W=t.computed((function(){return M.value.filter((function(e){return!e.disabled&&!e["check-all"]&&!e.checkAll}))})),q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V.value;return M.value.filter((function(t){if(!t.checkAll)return xe(e)?e.includes(t.value):e===t.value}))},K=function(e){var n=e.displayOptions,r=e.optionsList,o=e.innerPopupVisible,i=e.setInnerPopupVisible,a=e.selectPanelRef,l=e.isFilterable,s=e.getSelectedOptions,c=e.setInnerValue,u=e.innerValue,d=e.popupContentRef,p=e.multiple,f=e.max,h=t.ref(-1),m=t.ref([]),v=t.ref([]),g=rc();return t.watch(o,(function(e){e&&(h.value=-1,v.value=[],m.value=[])})),t.watch(h,(function(e){var t,n=(null===(t=a.value)||void 0===t||null===(t=t.innerRef)||void 0===t?void 0:t.querySelector(".".concat(g.value,"-select-option")).clientHeight)*e;d.value.scrollTo({top:n,behavior:"smooth"})})),{hoverIndex:h,handleKeyDown:function(e){var t,d,g=n.value.length,b=h.value;switch(e.code){case"ArrowUp":e.preventDefault(),-1===h.value?b=0:0===h.value||h.value>n.value.length-1?b=g-1:b--,null!==(t=r.value[b])&&void 0!==t&&t.disabled&&b--,h.value=b;break;case"ArrowDown":e.preventDefault(),-1===h.value||h.value>=g-1?b=0:b++,null!==(d=r.value[b])&&void 0!==d&&d.disabled&&b++,h.value=b;break;case"Enter":if(-1===h.value)break;var y=a.value.isVirtual&&l.value&&v.value.length?v.value:m.value;if(y.length||(y=r.value),!o.value){i(!0,{e:e});break}if(p){var w;if(-1===h.value)return;var k=null===(w=y[h.value])||void 0===w?void 0:w.value;if(!k)return;var x=Yy(u.value,k);if(f>0&&x.value.length>f)return;var C=s(x.value);c(x.value,{option:C.find((function(e){return e.value==k})),selectedOptions:C,trigger:x.isCheck?"check":"uncheck",e:e})}else{var O=s(y[h.value].value);c(y[h.value].value,{option:null==O?void 0:O[0],selectedOptions:s(y[h.value].value),trigger:"check",e:e}),i(!1,{e:e})}break;case"Escape":i(!1,{e:e})}},virtualFilteredOptions:v,filteredOptions:m}}({displayOptions:T,optionsList:M,innerPopupVisible:P,setInnerPopupVisible:I,selectPanelRef:O,isFilterable:F,getSelectedOptions:q,setInnerValue:j,innerValue:V,popupContentRef:U,multiple:e.multiple,max:e.max}),G=K.hoverIndex,Y=K.virtualFilteredOptions,X=K.handleKeyDown,Z=K.filteredOptions,J=function(t){if(e.multiple){var n=t?W.value.map((function(e){return e.value})):[];j(n,{selectedOptions:q(n),trigger:t?"check":"clear"})}},Q=t.computed((function(){var e=W.value.map((function(e){return e.value}));return bb(V.value,e).length})),ee=t.computed((function(){return Q.value===W.value.length})),te=t.computed((function(){return!ee.value&&0!==Q.value})),ne=t.computed((function(){return{max:e.max,multiple:e.multiple,hoverIndex:G.value,selectValue:V.value,reserveKeyword:e.reserveKeyword,handleValueChange:j,handlerInputChange:w,handlePopupVisibleChange:I,handleCreate:H,size:e.size,popupContentRef:U,indeterminate:te.value,isCheckAll:ee.value,onCheckAllChange:J,getSelectedOptions:q,displayOptions:T.value}}));t.provide(Ky,ne);var re=function(){!e.multiple&&xe(x.value)&&C(void 0,{selectedOptions:[],trigger:"default"}),e.multiple&&!xe(x.value)&&C([],{selectedOptions:[],trigger:"default"})},oe=Am((function(t,n){var r,o=n.e;null===(r=e.onSearch)||void 0===r||r.call(e,"".concat(t),{e:o})}),300),ie=function(e,n){e&&I(!0,{e:n.e}),w(e),oe("".concat(e),{e:n.e}),t.nextTick((function(){var e,t;Y.value=null===(e=O.value)||void 0===e?void 0:e.visibleData,Z.value=null===(t=O.value)||void 0===t?void 0:t.displayOptions}))},ae=function(e,t){I(e,t),e&&"trigger-element-click"===t.trigger&&w("")};t.watch(x,(function(n){re(),t.nextTick((function(){!function(t){if(e.multiple){var n,r=[],o=uw(t||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=_.value.get(i);a&&r.push(a)}}catch(s){o.e(s)}finally{o.f()}A.value=Array.from(new Set([].concat(r,p(A.value))))}else{var l=_.value.get(t);l&&(A.value=Array.from(new Set([l].concat(p(A.value)))))}}(n)}))}),{immediate:!0}),t.watch((function(){return e.multiple}),(function(){re()}));return t.provide("updateScrollTop",(function(e){var n;if(O.value){var r=null===(n=O.value)||void 0===n||null===(n=n.innerRef)||void 0===n?void 0:n.querySelector(".".concat(o.value,"-is-selected"));t.nextTick((function(){if(r&&e){var t=getComputedStyle(r).paddingBottom,n=getComputedStyle(e).marginBottom,o=parseInt(t,10)+parseInt(n,10),i=r.offsetTop-e.offsetTop-(e.clientHeight-r.clientHeight)+o;e.scrollTop=i}}))}})),function(){var n=e.popupProps||{},o=n.overlayClassName,s=cl(n,cw);return t.createVNode("div",{class:"".concat(l.value,"__wrap")},[t.createVNode(By,t.mergeProps({autoWidth:e.autoWidth,readonly:e.readonly,borderless:e.borderless,multiple:e.multiple,clearable:e.clearable,loading:e.loading,status:e.status,tips:e.tips,minCollapsedNum:e.minCollapsedNum,autofocus:e.autofocus,suffix:e.suffix,valueDisplayOptions:e.valueDisplayOptions},{ref:S,class:l.value,value:L.value,disabled:i.value,popupVisible:P.value,inputValue:P.value?y.value:"",placeholder:"".concat(D.value),allowInput:F.value,"collapsed-items":e.collapsedItems,inputProps:fw(fw({size:e.size,autofocus:e.autofocus},e.inputProps),{},{onkeydown:X}),tagInputProps:fw({size:e.size},e.tagInputProps),onTagChange:function(e,t){$(t.index)},tagProps:fw({},e.tagProps),popupProps:fw({overlayClassName:["".concat(l.value,"__dropdown"),o]},s),label:e.label,prefixIcon:e.prefixIcon,suffix:e.suffix,suffixIcon:function(){return e.suffixIcon||r.suffixIcon?a("suffixIcon"):e.showArrow&&t.createVNode(Qv,{overlayClassName:"".concat(l.value,"__right-icon"),isActive:P.value},null)},valueDisplay:function(){return a("valueDisplay",{params:z.value})},onPopupVisibleChange:ae,onInputChange:ie,onClear:function(t){var n,r=t.e;j(e.multiple?[]:void 0,{option:null,selectedOptions:q(e.multiple?[]:void 0),trigger:"clear",e:r}),null===(n=e.onClear)||void 0===n||n.call(e,{e:r})},onEnter:function(t,n){var r,o=n.e;null===(r=e.onEnter)||void 0===r||r.call(e,{inputValue:"".concat(y.value),e:o,value:V.value}),H()},onBlur:function(t,n){var r,o=n.e;null===(r=e.onBlur)||void 0===r||r.call(e,{e:o,value:V.value})},onFocus:function(t,n){var r,o=n.e;null===(r=e.onFocus)||void 0===r||r.call(e,{e:o,value:V.value})}},e.selectInputProps),{label:r.label,prefixIcon:r.prefixIcon,suffix:r.suffix,panel:function(){return t.createVNode(ow,t.mergeProps({ref:O},nb(e,["size","multiple","empty","loading","loadingText","filterable","creatable","panelTopContent","panelBottomContent","filter","scroll"]),{inputValue:y.value}),r)},collapsedItems:r.collapsedItems})])}}}),mw=xd(hw),vw=xd(Jy),gw=xd(tw),bw={container:{type:[String,Function],default:"body"},content:{type:[String,Function]},default:{type:[String,Function]},duration:{type:Number,default:200},offset:{type:Array,default:function(){return["24px","80px"]}},shape:{type:String,default:"square",validator:function(e){return!e||["circle","square"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return!e||["medium","small"].includes(e)}},target:{type:[String,Function],default:"body"},theme:{type:String,default:"light",validator:function(e){return!e||["light","primary","dark"].includes(e)}},visibleHeight:{type:[String,Number],default:"200px"},onClick:Function},yw=xd(t.defineComponent({name:"TBackTop",props:bw,setup:function(e){var n=t.ref(!1),r=t.ref(null),o=rc("back-top"),i=tc("alert").classPrefix,a=eh({BacktopIcon:tp}).BacktopIcon,l=Bd(),s=function(e){return"string"==typeof e&&void 0!==("undefined"==typeof document?"undefined":f(document))?"body"===e?document:document.querySelector(e):"function"==typeof e?e():null};return t.onMounted((function(){var t,o;(r.value=s(e.container),0!==(t="string"==typeof e.visibleHeight?Number(e.visibleHeight.replace("px","")):e.visibleHeight))?(o=void 0===r.value.scrollTop?document.documentElement:r.value,r.value.onscroll=function(){var e,r=null===(e=o)||void 0===e?void 0:e.scrollTop;r>=t&&(n.value=!0),r<t&&n.value&&(n.value=!1)}):n.value=!0})),t.onBeforeUnmount((function(){r.value.onscroll=null})),function(){var c=e.theme,u=e.shape,d=e.size,p=e.target,f=e.duration,h=e.offset,v=e.container,g=Rf()();g.length<1&&(g=null);var b=t.computed((function(){return m(m(m(m(m(m({},o.value,!0),"".concat(o.value,"--theme-").concat(c),!0),"".concat(o.value,"--").concat(u),!0),"".concat(o.value,"--show"),n.value),"".concat(i.value,"-size-s"),"small"===d),"".concat(i.value,"-size-m"),"medium"===d)})),y=t.createVNode(t.Fragment,null,[t.createVNode(a,{class:"".concat(o.value,"__icon"),size:"24"},null),t.createVNode("span",{class:"".concat(o.value,"__text")},[t.createTextVNode("TOP")])]),w=t.computed((function(){return{insetInlineEnd:h[0],insetBlockEnd:h[1]}}));return t.createVNode("button",{type:"button",class:b.value,style:w.value,onClick:function(t){var n;Ac(function(){if(p===v)return 0;if("body"===p)return 0;if(!p)return 0;var e=s(p);return e?e.getBoundingClientRect().y:0}(),{container:r.value,duration:f}),null===(n=e.onClick)||void 0===n||n.call(e,{e:t})}},[l("content","default",y)])}}})),ww=Gg;const kw=g((function(e,t,n){return null==e?e:ww(e,t,n)}));var xw={exports:{}},Cw={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},e.exports=t.default,e.exports.default=t.default}(Cw,Cw.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){t="string"==typeof t?(0,r.default)({format:t},a):(0,r.default)(t,a);if("string"==typeof e&&(b=t.format,/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(b))){var n,i=t.delimiters.find((function(e){return-1!==t.format.indexOf(e)})),l=t.strictMode?i:t.delimiters.find((function(t){return-1!==e.indexOf(t)})),s=function(e,t){for(var n=[],r=Math.min(e.length,t.length),o=0;o<r;o++)n.push([e[o],t[o]]);return n}(e.split(l),t.format.toLowerCase().split(i)),c={},u=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,a=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw a}}}}(s);try{for(u.s();!(n=u.n()).done;){var d=(v=n.value,g=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(v,g)||o(v,g)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=d[0],f=d[1];if(p.length!==f.length)return!1;c[f.charAt(0)]=p}}catch(y){u.e(y)}finally{u.f()}var h=c.y;if(2===c.y.length){var m=parseInt(c.y,10);if(isNaN(m))return!1;h=m<(new Date).getFullYear()%100?"20".concat(c.y):"19".concat(c.y)}return new Date("".concat(h,"-").concat(c.m,"-").concat(c.d)).getDate()===+c.d}var v,g;var b;if(!t.strictMode)return"[object Date]"===Object.prototype.toString.call(e)&&isFinite(e);return!1};var n,r=(n=Cw.exports)&&n.__esModule?n:{default:n};function o(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var a={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};e.exports=t.default,e.exports.default=t.default}(xw,xw.exports);var Ow=Xs(xw.exports),Sw={exports:{}},Ew={exports:{}};!function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t=n(e);throw null===e?t="null":"object"===t&&(t=e.constructor.name),new TypeError("Expected a string but received a ".concat(t))}},e.exports=t.default,e.exports.default=t.default}(Ew,Ew.exports);var Nw={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,i;(0,r.default)(e),"object"===o(t)?(n=t.min||0,i=t.max):(n=arguments[1],i=arguments[2]);var a=encodeURI(e).split(/%..|./).length-1;return a>=n&&(void 0===i||a<=i)};var n,r=(n=Ew.exports)&&n.__esModule?n:{default:n};function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=t.default,e.exports.default=t.default}(Nw,Nw.exports);var _w={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),(t=(0,r.default)(t,i)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var o=e.split("."),a=o[o.length-1];if(t.require_tld){if(o.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(a))return!1;if(/\s/.test(a))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(a))return!1;return o.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var n=o(Ew.exports),r=o(Cw.exports);function o(e){return e&&e.__esModule?e:{default:e}}var i={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(_w,_w.exports);var Mw={exports:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,r.default)(t),!(n=String(n)))return e(t,4)||e(t,6);if("4"===n)return a.test(t);if("6"===n)return s.test(t);return!1};var n,r=(n=Ew.exports)&&n.__esModule?n:{default:n};var o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",i="(".concat(o,"[.]){3}").concat(o),a=new RegExp("^".concat(i,"$")),l="(?:[0-9a-fA-F]{1,4})",s=new RegExp("^("+"(?:".concat(l,":){7}(?:").concat(l,"|:)|")+"(?:".concat(l,":){6}(?:").concat(i,"|:").concat(l,"|:)|")+"(?:".concat(l,":){5}(?::").concat(i,"|(:").concat(l,"){1,2}|:)|")+"(?:".concat(l,":){4}(?:(:").concat(l,"){0,1}:").concat(i,"|(:").concat(l,"){1,3}|:)|")+"(?:".concat(l,":){3}(?:(:").concat(l,"){0,2}:").concat(i,"|(:").concat(l,"){1,4}|:)|")+"(?:".concat(l,":){2}(?:(:").concat(l,"){0,3}:").concat(i,"|(:").concat(l,"){1,5}|:)|")+"(?:".concat(l,":){1}(?:(:").concat(l,"){0,4}:").concat(i,"|(:").concat(l,"){1,6}|:)|")+"(?::((?::".concat(l,"){0,5}:").concat(i,"|(?::").concat(l,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(Mw,Mw.exports),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),(t=(0,a.default)(t,s)).require_display_name||t.allow_display_name){var l=e.match(c);if(l){var v=l[1];if(e=e.replace(v,"").replace(/(^<|>$)/g,""),v.endsWith(" ")&&(v=v.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(!(t.split('"').length===t.split('\\"').length))return!1}return!0}(v))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>m)return!1;var g=e.split("@"),b=g.pop(),y=b.toLowerCase();if(t.host_blacklist.includes(y))return!1;if(t.host_whitelist.length>0&&!t.host_whitelist.includes(y))return!1;var w=g.join("@");if(t.domain_specific_validation&&("gmail.com"===y||"googlemail.com"===y)){var k=(w=w.toLowerCase()).split("+")[0];if(!(0,r.default)(k.replace(/\./g,""),{min:6,max:30}))return!1;for(var x=k.split("."),C=0;C<x.length;C++)if(!d.test(x[C]))return!1}if(!(!1!==t.ignore_max_length||(0,r.default)(w,{max:64})&&(0,r.default)(b,{max:254})))return!1;if(!(0,o.default)(b,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!(0,i.default)(b)){if(!b.startsWith("[")||!b.endsWith("]"))return!1;var O=b.slice(1,-1);if(0===O.length||!(0,i.default)(O))return!1}}if('"'===w[0])return w=w.slice(1,w.length-1),t.allow_utf8_local_part?h.test(w):p.test(w);for(var S=t.allow_utf8_local_part?f:u,E=w.split("."),N=0;N<E.length;N++)if(!S.test(E[N]))return!1;if(t.blacklisted_chars&&-1!==w.search(new RegExp("[".concat(t.blacklisted_chars,"]+"),"g")))return!1;return!0};var n=l(Ew.exports),r=l(Nw.exports),o=l(_w.exports),i=l(Mw.exports),a=l(Cw.exports);function l(e){return e&&e.__esModule?e:{default:e}}var s={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},c=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,u=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,d=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,f=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,m=254;e.exports=t.default,e.exports.default=t.default}(Sw,Sw.exports);var Aw=Xs(Sw.exports),Tw={exports:{}};function Vw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vw(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bw(e){return"[object Date]"!==Object.prototype.toString.call(e)&&(y(e)?Fc(e):["",void 0,null].includes(e))}!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,i.default)(t,s)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var a,d,p,f,h,m,v,g;if(v=e.split("#"),e=v.shift(),v=e.split("?"),e=v.shift(),(v=e.split("://")).length>1){if(a=v.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(a))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;v[0]=e.slice(2)}}if(""===(e=v.join("://")))return!1;if(v=e.split("/"),""===(e=v.shift())&&!t.require_host)return!0;if((v=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===v[0])return!1;if((d=v.shift()).indexOf(":")>=0&&d.split(":").length>2)return!1;var b=d.split(":"),y=(C=2,function(e){if(Array.isArray(e))return e}(x=b)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}}(x,C)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(x,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=y[0],k=y[1];if(""===w&&""===k)return!1}var x,C;f=v.join("@"),m=null,g=null;var O=f.match(c);O?(p="",g=O[1],m=O[2]||null):(p=(v=f.split(":")).shift(),v.length&&(m=v.join(":")));if(null!==m&&m.length>0){if(h=parseInt(m,10),!/^[0-9]+$/.test(m)||h<=0||h>65535)return!1}else if(t.require_port)return!1;if(t.host_whitelist)return u(p,t.host_whitelist);if(""===p&&!t.require_host)return!0;if(!((0,o.default)(p)||(0,r.default)(p,t)||g&&(0,o.default)(g,6)))return!1;if(p=p||g,t.host_blacklist&&u(p,t.host_blacklist))return!1;return!0};var n=a(Ew.exports),r=a(_w.exports),o=a(Mw.exports),i=a(Cw.exports);function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},c=/^\[([^\]]+)\](?::([0-9]+))?$/;function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(e===r||(o=r,"[object RegExp]"===Object.prototype.toString.call(o)&&r.test(e)))return!0}var o;return!1}e.exports=t.default,e.exports.default=t.default}(Tw,Tw.exports);var Pw={date:Ow,url:Xs(Tw.exports),email:Aw,required:function(e){return!Bw(e)},whitespace:function(e){return!(/^\s+$/.test(e)||""===e)},boolean:function(e){return Dd(e)},max:function(e,t){return bl(e)?e<=t:wl(e)<=t},min:function(e,t){return bl(e)?e>=t:wl(e)>=t},len:function(e,t){return wl(String(e))===t},number:function(e){return bl(e)},enum:function(e,t){return t.includes(e)},idcard:function(e){return/^(\d{18,18}|\d{15,15}|\d{17,17}x)$/i.test(e)},telnumber:function(e){return/^1[3-9]\d{9}$/.test(e)},pattern:function(e,t){return t.test(e)},validator:function(e,t){return t(e)}};function Iw(e,t){return Dw.apply(this,arguments)}function Dw(){return(Dw=Kf(Qf.mark((function e(t,n){var r,o,i,a,l,s,c;return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={result:!0},o=Object.keys(n),l=0;case 3:if(!(l<o.length)){e.next=15;break}if(s=o[l],n.required||!Bw(t)||n.validator){e.next=7;break}return e.abrupt("return",r);case 7:if(!(c=Pw[s])||!n[s]&&0!==n[s]){e.next=12;break}return i=!0===n[s]?void 0:n[s],a=c,e.abrupt("break",15);case 12:l++,e.next=3;break;case 15:if(!a){e.next=23;break}return e.next=18,a(t,i);case 18:if(r=e.sent,!Dd(r)){e.next=21;break}return e.abrupt("return",jw(jw({},n),{},{result:r}));case 21:if(!y(r)){e.next=23;break}return e.abrupt("return",r);case 23:return e.abrupt("return",r);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lw(e,t){return Rw.apply(this,arguments)}function Rw(){return(Rw=Kf(Qf.mark((function e(t,n){var r,o;return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.map((function(e){return Iw(t,e)})),e.next=3,Promise.all(r);case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var zw={for:{type:String,default:""},help:{type:[String,Function]},label:{type:[String,Function],default:""},labelAlign:{type:String,validator:function(e){return!e||["left","right","top"].includes(e)}},labelWidth:{type:[String,Number]},name:{type:String,default:""},requiredMark:{type:Boolean,default:void 0},rules:{type:Array},showErrorMessage:{type:Boolean,default:void 0},status:{type:String,default:""},statusIcon:{type:[Boolean,Function],default:void 0},successBorder:Boolean,tips:{type:[String,Function]}};function Fw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fw(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hw(e,t){return t?"".concat(e,"__").concat(t).replace(/(\[|\]\.)/g,"_"):""}var Uw=t.defineComponent({name:"TFormItem",props:$w({},zw),setup:function(e,n){var r=n.slots,o=Vd(),i=ng(),a=tc("form").globalConfig,l=eh({CheckCircleFilledIcon:fp,CloseCircleFilledIcon:jp,ErrorCircleFilledIcon:Yp}),s=l.CheckCircleFilledIcon,c=l.CloseCircleFilledIcon,u=l.ErrorCircleFilledIcon,d=t.inject(og,void 0),p=rc(),f=rc("form-item"),h=t.computed((function(){var t,n,r=null!==(t=null!==(n=e.requiredMark)&&void 0!==n?n:null==d?void 0:d.requiredMark)&&void 0!==t?t:a.value.requiredMark,o=I.value.filter((function(e){return e.required})).length>0;return null!=r?r:o})),v=t.computed((function(){return r.label||e.label})),g=t.computed((function(){return!(null==d||!d.colon||!v.value)})),b=rc("form__label"),y=t.computed((function(){return Wf(e.labelAlign)?null==d?void 0:d.labelAlign:e.labelAlign})),w=t.computed((function(){return Wf(e.labelWidth)?null==d?void 0:d.labelWidth:e.labelWidth})),k=t.computed((function(){return[i.value.label,m(m(m(m(m({},"".concat(b.value,"--required"),h.value),"".concat(b.value,"--colon"),g.value),"".concat(b.value,"--top"),v.value&&("top"===y.value||!w.value)),"".concat(b.value,"--left"),"left"===y.value&&w.value),"".concat(b.value,"--right"),"right"===y.value&&w.value)]})),x=function(){if(0!==Number(w.value)){var n={};return w.value&&"top"!==y.value&&(n=bl(w.value)?{width:"".concat(w.value,"px")}:{width:w.value}),t.createVNode("div",{class:k.value,style:n},[t.createVNode("label",{for:e.for||null},[o("label")])])}},C=function(){var e=function(e){return t.createVNode("span",{class:i.value.status},[t.createVNode(e,null,null)])},n=_.value;if(A.value===rg.SUCCESS)return e(s);if(null!=n&&n[0]){var r=n[0].type||"error";return e({error:c,warning:u}[r]||s)}return null},O=function(){if(!1!==e.statusIcon){var n=o("statusIcon",{defaultNode:C()});if(n)return t.createVNode("span",{class:i.value.status},[n]);if(!1!==n)return(n=null==d?void 0:d.renderContent("statusIcon",{defaultNode:C(),params:e}))||void 0}},S=t.computed((function(){return W.value?A.value===rg.SUCCESS?e.successBorder?[i.value.success,i.value.successBorder].join(" "):i.value.success:_.value.length?"error"===(_.value[0].type||"error")?i.value.error:i.value.warning:void 0:""})),E=t.computed((function(){return[i.value.controls,S.value]})),N=t.computed((function(){var e={};return w.value&&"top"!==y.value&&(e=bl(w.value)?{marginLeft:"".concat(w.value,"px")}:{marginLeft:w.value}),e})),_=t.ref([]),M=t.ref([]),A=t.ref(rg.TO_BE_VALIDATED),T=t.ref(!1),V=t.ref(!1),j=function(){V.value=!1,_.value=[],M.value=[],A.value=rg.TO_BE_VALIDATED},B=function(){var n=Kf(Qf.mark((function n(){var r,o=arguments;return Qf.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=o.length>0&&void 0!==o[0]?o[0]:null==d?void 0:d.resetType,e.name){n.next=3;break}return n.abrupt("return");case 3:return"empty"===r?kw(null==d?void 0:d.data,e.name,(i=void 0,a=void 0,"[object String]"===(a=Object.prototype.toString.call(Fo(null==d?void 0:d.data,e.name)))&&(i=""),"[object Array]"===a&&(i=[]),"[object Object]"===a&&(i={}),i)):"initial"===r&&kw(null==d?void 0:d.data,e.name,F.value),n.next=6,t.nextTick();case 6:T.value?V.value=!0:j();case 7:case"end":return n.stop()}var i,a}),n)})));return function(){return n.apply(this,arguments)}}(),P=t.computed((function(){var e;return null!==(e=null==d?void 0:d.errorMessage)&&void 0!==e?e:a.value.errorMessage})),I=t.computed((function(){var t;if(null!==(t=e.rules)&&void 0!==t&&t.length)return e.rules;if(!e.name)return[];var n="".concat(e.name).lastIndexOf(".")||-1,r="".concat(e.name).slice(n+1);return Fo(null==d?void 0:d.rules,e.name)||Fo(null==d?void 0:d.rules,r)||[]})),D=function(){var t=Kf(Qf.mark((function t(n){var r,o;return Qf.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o={successList:[],errorList:[],rules:[],resultList:[],allowSetValue:!1}).rules="all"===n?I.value:I.value.filter((function(e){return(e.trigger||"change")===n})),!I.value.length||null!==(r=o.rules)&&void 0!==r&&r.length){t.next=4;break}return t.abrupt("return",o);case 4:return o.allowSetValue=!0,t.next=7,Lw(z.value,o.rules);case 7:return o.resultList=t.sent,o.errorList=o.resultList.filter((function(e){return!0!==e.result})).map((function(t){return Object.keys(t).forEach((function(n){if(!t.message&&P.value[n]){var r=fl(e.label)?e.label:e.name;t.message=(o=P.value[n],i={name:r,validate:t[n]},o.replace(/\${(.*?)}/g,(function(e,t){return i[t.trim()]||""})))}var o,i})),t})),o.successList=o.resultList.filter((function(e){return!0===e.result&&e.message&&"success"===e.type})),t.abrupt("return",o);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),L=function(){var t=Kf(Qf.mark((function t(n,r){var o,i,a,l,s;return Qf.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return T.value=!0,U.value=r,t.next=4,D(n);case 4:return o=t.sent,i=o.successList,a=o.errorList,l=o.rules,s=o.resultList,o.allowSetValue&&(M.value=i,_.value=a),l.length&&(A.value=a.length?rg.FAIL:rg.SUCCESS),V.value&&j(),T.value=!1,t.abrupt("return",m({},e.name,0===a.length||s));case 15:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),R=function(){var t=Kf(Qf.mark((function t(n){var r,o,i;return Qf.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,D(n);case 2:return r=t.sent,o=r.errorList,i=r.resultList,t.abrupt("return",m({},e.name,0===o.length||i));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),z=t.computed((function(){return(null==d?void 0:d.data)&&Fo(null==d?void 0:d.data,e.name)})),F=t.ref(void 0),$=t.toRefs(e).name,H=t.reactive({name:$,resetHandler:j,resetField:B,validate:L,validateOnly:R,setValidateMessage:function(e){(e||xe(e))&&(0===e.length&&(_.value=[],A.value=rg.SUCCESS),_.value=e.map((function(e){return $w($w({},e),{},{result:!1})})),A.value=rg.FAIL)}});t.onMounted((function(){F.value=qs(z.value),null==d||d.children.push(H)})),t.onBeforeUnmount((function(){d&&(d.children=null==d?void 0:d.children.filter((function(e){return e!==H})))})),t.watch(z,Kf(Qf.mark((function e(){return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L("change");case 2:case"end":return e.stop()}}),e)}))),{deep:!0}),t.watch((function(){return[e.name,JSON.stringify(e.rules)].join(",")}),(function(){L("change")}));var U=t.ref(void 0),W=t.computed((function(){return Dd(U.value)?U.value:Dd(e.showErrorMessage)?e.showErrorMessage:null==d?void 0:d.showErrorMessage})),q=t.computed((function(){return[i.value.formItem,Hw(f.value,e.name),m(m({},i.value.formItemWithHelp,K.value),i.value.formItemWithExtra,G.value)]})),K=t.computed((function(){var e=o("help");return e?t.createVNode("div",{class:i.value.help},[e]):null})),G=t.computed((function(){var e,n=function(e){return t.createVNode("div",{class:i.value.extra,title:e},[e])},r=_.value;return W.value&&null!=r&&null!==(e=r[0])&&void 0!==e&&e.message?n(r[0].message):M.value.length?n(M.value[0].message):null})),Y=t.computed((function(){var n=o("tips");if(!n)return null;var r=["".concat(f.value,"-tips"),"".concat(p.value,"-tips"),"".concat(p.value,"-is-").concat(e.status||"default")];return t.createVNode("div",{class:r},[n])})),X=function(){var e=Kf(Qf.mark((function e(){return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L("blur");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return t.provide(ig,{handleBlur:X}),function(){return t.createVNode("div",{class:q.value},[x(),t.createVNode("div",{class:E.value,style:N.value},[t.createVNode("div",{class:i.value.controlsContent},[o("default"),O()]),K.value,Y.value,G.value])])}}}),Ww={colon:Boolean,data:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:void 0},errorMessage:{type:Object},formControlledComponents:{type:Array},labelAlign:{type:String,default:"right",validator:function(e){return!e||["left","right","top"].includes(e)}},labelWidth:{type:[String,Number],default:"100px"},layout:{type:String,default:"vertical",validator:function(e){return!e||["vertical","inline"].includes(e)}},preventSubmitDefault:{type:Boolean,default:!0},requiredMark:{type:Boolean,default:void 0},resetType:{type:String,default:"empty",validator:function(e){return!e||["empty","initial"].includes(e)}},rules:{type:Object},scrollToFirstError:{type:String,validator:function(e){return!e||["","smooth","auto"].includes(e)}},showErrorMessage:{type:Boolean,default:!0},statusIcon:{type:[Boolean,Function],default:void 0},submitWithWarningMessage:Boolean,onReset:Function,onSubmit:Function,onValidate:Function};function qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Kw=t.defineComponent({name:"TForm",props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qw(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Ww),setup:function(e,n){var r=n.expose,o=Vd(),i=t.toRefs(e).disabled;t.provide("formDisabled",{disabled:i});var a=t.ref(null),l=t.ref([]),s=t.toRefs(e),c=s.showErrorMessage,u=s.labelWidth,d=s.labelAlign,p=s.data,f=s.colon,h=s.requiredMark,v=s.rules,g=s.errorMessage,b=s.resetType;t.provide(og,t.reactive({showErrorMessage:c,labelWidth:u,labelAlign:d,data:p,colon:f,requiredMark:h,rules:v,errorMessage:g,resetType:b,children:l,renderContent:o}));var y=rc("form"),w=ng(),k=t.computed((function(){return[w.value.form,m({},"".concat(y.value,"-inline"),"inline"===e.layout)]})),x=rc("form-item"),C=function(t){if(Dd(t))return"";var n=ll(Object.keys(t),1)[0];if(e.scrollToFirstError){var r=Hw(x.value,n);O(r)}var o=t[n];return xe(o)?o.filter((function(e){return!e.result}))[0].message:""},O=function(t){var n=ll(a.value.getElementsByClassName(t),1)[0],r=e.scrollToFirstError;r&&n&&n.scrollIntoView({behavior:r})},S=function(e,t){return!t||!xe(t)||-1!==t.indexOf("".concat(e))},E=function(e){var t=e.reduce((function(e,t){return Object.assign(e||{},t)}),{});return Object.keys(t).forEach((function(e){!0===t[e]&&delete t[e]})),!!Fc(t)||t},N=function(){var t=Kf(Qf.mark((function t(n){var r,o,i,a,s,c,u,d,p,f;return Qf.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=(o=n||{}).fields,a=o.trigger,s=void 0===a?"all":a,c=o.showErrorMessage,u=l.value.filter((function(e){return R(e.validate)&&S(String(e.name),i)})).map((function(e){return e.validate(s,c)})),t.next=4,Promise.all(u);case 4:return d=t.sent,p=E(d),f=C(p),null===(r=e.onValidate)||void 0===r||r.call(e,{validateResult:p,firstError:f}),t.abrupt("return",p);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_=function(){var e=Kf(Qf.mark((function e(t){var n,r,o,i,a,s;return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=t||{}).fields,o=n.trigger,i=void 0===o?"all":o,a=l.value.filter((function(e){return R(e.validateOnly)&&S(String(e.name),r)})).map((function(e){return e.validateOnly(i)})),e.next=4,Promise.all(a);case 4:return s=e.sent,e.abrupt("return",E(s));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),M=t.ref(),A=function(){var e=Kf(Qf.mark((function e(t){return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M.value=t,Tc(a.value);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=t.ref();return r({validate:N,submit:A,reset:function(e){T.value=e,a.value.reset()},clearValidate:function(e){l.value.forEach((function(t){R(t.resetHandler)&&S(String(t.name),e)&&t.resetHandler()}))},setValidateMessage:function(e){var t=Object.keys(e);if(t.length){var n=l.value.filter((function(e){return R(e.setValidateMessage)&&t.includes("".concat(e.name))})).map((function(t){return t.setValidateMessage(e[t.name])}));Promise.all(n)}},validateOnly:_}),function(){return t.createVNode("form",{ref:a,class:k.value,onSubmit:function(t){return function(t){e.preventSubmitDefault&&t&&(t.preventDefault(),t.stopPropagation()),N(M.value).then((function(n){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,{validateResult:n,firstError:C(n),e:t})})),M.value=void 0}(t)},onReset:function(t){return function(t){var n;e.preventSubmitDefault&&t&&(t.preventDefault(),t.stopPropagation()),l.value.filter((function(e){var t;return R(e.resetField)&&S(String(e.name),null===(t=T.value)||void 0===t?void 0:t.fields)})).forEach((function(e){var t;return e.resetField(null===(t=T.value)||void 0===t?void 0:t.type)})),T.value=void 0,null===(n=e.onReset)||void 0===n||n.call(e,{e:t})}(t)}},[o("default")])}}}),Gw=xd(Kw),Yw=xd(Uw),Xw={allowUncheck:Boolean,checked:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultChecked:Boolean,default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},label:{type:[String,Function]},name:{type:String,default:""},readonly:Boolean,value:{type:[String,Number,Boolean],default:void 0},onChange:Function,onClick:Function},Zw=Symbol("RadioGroupProvide"),Jw=Symbol("RadioButtonProvide");function Qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ek=t.defineComponent({name:"TRadio",inheritAttrs:!1,props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qw(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Xw),setup:function(e,n){var r=n.attrs,o=t.ref(),i=t.toRefs(e),a=ll(Bm(i.checked,i.modelValue,e.defaultChecked,e.onChange,"checked"),2),l=a[0],s=a[1],c=t.computed((function(){return u?e.value===u.value:l.value})),u=t.inject(Zw,void 0),d=t.computed((function(){return Boolean(e.allowUncheck||(null==u?void 0:u.allowUncheck))})),f=function(e){e.stopPropagation()},h=function(t){var n;if(!b.value&&!e.readonly&&(null===(n=e.onClick)||void 0===n||n.call(e,{e:t}),!c.value||d.value))if(u){var r=c.value&&d.value?void 0:e.value;u.setValue(r,{e:t})}else{var o=!d.value||!c.value;s(o,{e:t})}},v=t.computed((function(){return e={focus:r.onFocus,blur:r.onBlur,keydown:r.onKeydown,keyup:r.onKeyup,keypresss:r.onKeypresss},t={},Object.keys(e).forEach((function(n){ml(e[n])||(t[n]=e[n])})),t;var e,t})),g=t.computed((function(){var e=[].concat(p(Object.keys(v.value)),["input","change"]).map((function(e){return"on".concat(e[0].toUpperCase()).concat(e.slice(1))}));return Vv(r,e)})),b=tg(t.computed((function(){return null==u?void 0:u.disabled}))),y=t.computed((function(){return{name:u?u.name:e.name,checked:c.value,disabled:b.value,readonly:e.readonly,value:e.value}})),w=oc().STATUS,k=t.inject(Jw,void 0),x=rc("radio-button"),C=rc("radio"),O=t.computed((function(){return k?x.value:C.value})),S=t.computed((function(){return["".concat(O.value),m(m({},w.value.checked,y.value.checked),w.value.disabled,y.value.disabled)]})),E=Bd();return function(){return t.createVNode("label",t.mergeProps({ref:o,class:S.value},g.value,{tabindex:b.value?void 0:"0",onClick:h}),[t.createVNode("input",t.mergeProps({type:"radio",class:"".concat(O.value,"__former")},v.value,y.value,{onClick:f,tabindex:"-1","data-value":fl(e.value)?"'".concat(e.value,"'"):e.value,"data-allow-uncheck":d.value||void 0}),null),t.createVNode("span",{class:"".concat(O.value,"__input")},null),t.createVNode("span",{class:"".concat(O.value,"__label")},[E("default","label")])])}}}),tk=Mm,nk=b;const rk=g((function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return nk(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),tk(e,t,{leading:r,maxWait:t,trailing:o})}));var ok={allowUncheck:Boolean,disabled:Boolean,name:{type:String,default:""},options:{type:Array},size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0},defaultValue:{type:[String,Number,Boolean]},variant:{type:String,default:"outline",validator:function(e){return!e||["outline","primary-filled","default-filled"].includes(e)}},onChange:Function};var ik=["window"],ak="undefined"!=typeof window?window:void 0;function lk(e,n){var r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=i.window,l=void 0===a?ak:a,s=cl(i,ik),c=l&&"MutationObserver"in l,u=function(){r&&(r.disconnect(),r=void 0)},d=t.watch((function(){return n=e,o=t.unref(n),null!==(r=null==o?void 0:o.$el)&&void 0!==r?r:o;var n,r,o}),(function(e){u(),c&&l&&e&&(r=new MutationObserver(n)).observe(e,s)}),{immediate:!0}),p=function(){u(),d()};return o=p,t.getCurrentScope()&&t.onScopeDispose(o),{isSupported:c,stop:p}}function sk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ck(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sk(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uk=t.defineComponent({name:"TRadioGroup",props:ck({},ok),setup:function(e){var n=t.toRefs(e),r=ll(Bm(n.value,n.modelValue,e.defaultValue,e.onChange),2),o=r[0],i=r[1],a=t.ref(),l=rc("radio-button"),s=oc(),c=s.STATUS,u=s.SIZE;!function(e,n){var r=function(e){if(hy.test(e.key)||hy.test(e.code)){e.preventDefault();var t=e.target.querySelector("input");if(!t)return;var r=t.dataset;if(t.checked&&r.allowUncheck)n(void 0,{e:e});else{var o=isNaN(Number(r.value))?r.value:Number(r.value);o=fl(o)&&{true:!0,false:!1}[o]||o,o=fl(o)&&"'"===o[0]?o.replace(/'/g,""):o,n(o,{e:e})}}};t.onMounted((function(){Cc(e.value,"keydown",r)})),t.onBeforeMount((function(){Oc(e.value,"keydown",r)}))}(a,i);var d,p=t.computed((function(){return".".concat(l.value,".").concat(c.value.checked)})),f=t.ref({width:"0px",height:"0px",left:"0px",top:"0px","transition-property":"none"}),h=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("outline"!==e.variant){var n=a.value.querySelector(p.value),r=t?"none":"all";if(n){var o=n.offsetWidth,i=n.offsetHeight,l=n.offsetLeft,s=n.offsetTop;o?f.value={"transition-property":r,width:"".concat(o,"px"),height:"".concat(i,"px"),left:"".concat(l,"px"),top:"".concat(s,"px")}:function(){var e=document.createElement("div");e.setAttribute("style","position: absolute; visibility: hidden;"),e.appendChild(a.value.cloneNode(!0)),document.body.appendChild(e);var t=e.querySelector(p.value),n=t.offsetWidth,r=t.offsetHeight,o=t.offsetLeft,i=t.offsetTop;f.value=ck(ck({},f.value),{},{width:"".concat(n,"px"),height:"".concat(r,"px"),left:"".concat(o,"px"),top:"".concat(i,"px")}),document.body.removeChild(e)}()}else f.value={"transition-property":r,width:"0px",height:"9px",left:"0px",top:"0px"}}};t.watch(o,Kf(Qf.mark((function e(){return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.nextTick();case 2:h();case 3:case"end":return e.stop()}}),e)})))),t.onMounted((function(){h(!0),Rm(a,rk(Kf(Qf.mark((function e(){return Qf.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.nextTick();case 2:h();case 3:case"end":return e.stop()}}),e)}))),300));var e=a.value.querySelector("".concat(p.value," .").concat(l.value,"__label"));e&&(d=lk(e,(function(e){e.forEach((function(e){"characterData"===e.type&&h()}))}),{attributes:!0,childList:!0,characterData:!0,subtree:!0}))})),t.onUnmounted((function(){var e;null===(e=d)||void 0===e||e.stop()}));var v=t.toRefs(e),g=v.name,b=v.disabled;t.provide(Zw,t.reactive({name:g,disabled:b,value:o,allowUncheck:e.allowUncheck,setValue:i}));var y=rc("radio-group"),w=jd(),k=function(){if(e.variant.includes("filled")&&!Wf(o.value))return t.createVNode("div",{style:f.value,class:"".concat(y.value,"__bg-block")},null)},x=t.computed((function(){return["".concat(y.value),u.value[e.size],m(m(m({},"".concat(y.value,"__outline"),"outline"===e.variant),"".concat(y.value,"--filled"),e.variant.includes("filled")),"".concat(y.value,"--primary-filled"),"primary-filled"===e.variant)]}));return function(){return t.createVNode("div",{ref:a,class:x.value},[w("default")||(null===(n=e.options)||void 0===n?void 0:n.map((function(n){var r=n;return(bl(n)||fl(n))&&(r={value:n,label:n.toString()}),t.createVNode(ek,{key:"radio-group-options-".concat(r.value,"-").concat(Math.random()),name:e.name,checked:o.value===r.value,disabled:"disabled"in r?r.disabled:e.disabled,value:r.value},{default:function(){return[R(r.label)?r.label(t.h):r.label]}})}))),k()]);var n}}});function dk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dk(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fk=t.defineComponent({name:"TRadioButton",inheritAttrs:!1,props:pk({},Xw),setup:function(e,n){var r=n.attrs;t.provide(Jw,t.reactive({}));var o=t.computed((function(){return pk(pk({},e),Vv(r,Object.keys(r).filter((function(e){return e.startsWith("on")}))))})),i=Bd();return function(){var e,n;return t.createVNode(ek,o.value,"function"==typeof(n=e=i("default","label"))||"[object Object]"===Object.prototype.toString.call(n)&&!t.isVNode(n)?e:{default:function(){return[e]}})}}});xd(ek);var hk=xd(uk),mk=xd(fk),vk={disabled:Boolean,inputNumberProps:{type:[Boolean,Object],default:!1},label:{type:[String,Boolean,Function],default:!0},layout:{type:String,default:"horizontal",validator:function(e){return!e||["vertical","horizontal"].includes(e)}},marks:{type:[Object,Array]},max:{type:Number,default:100},min:{type:Number,default:0},range:Boolean,showStep:Boolean,step:{type:Number,default:1},tooltipProps:{type:Object},value:{type:[Number,Array],default:void 0},modelValue:{type:[Number,Array],default:void 0},defaultValue:{type:[Number,Array],default:0},onChange:Function,onChangeEnd:Function},gk=function(e,t){return t?{top:"calc(".concat(100-e,"% - 1px)")}:{left:"".concat(e,"%")}},bk=function(e,t){return"first"===t?e instanceof Array?e[0]:e:e instanceof Array?e[1]:0};function yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yk(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kk={visible:!1,trigger:"hover",showArrow:!0,overlayInnerStyle:void 0,overlayClassName:void 0,attach:"body",theme:"default"},xk=function(e){var n=t.ref(),r=t.computed({get:function(){return!1==!e.value.tooltipProps},set:function(e){return e}}),o=t.ref(wk({},kk)),i=Vd();return{tooltipRef:n,tooltipProps:t.computed((function(){var t=e.value,n=t.vertical,r=t.tooltipProps,a=t.label,l=t.value,s=t.position,c=t.range,u=n?"right":"top",d=!0===a?String(l):"string"==typeof a?function(e,t){if(!1===Boolean(e))return String(t);if(fl(e)){var n=String(t);try{var r=/\${value}%/g;if(!r.test(e))throw n=e,new Error;n=e.replace(r,String(t))}catch(o){console.warn("fail to parse label prop, please pass string such as '${value}%'")}return n}return e}(a,l):i("label",{params:c?{value:l,position:s}:{value:l}});return r instanceof Object?(null!=r&&r.placement||(o.value.placement=u),r.content&&(d=r.content),wk(wk(wk({},o.value),r),{},{content:d})):wk(wk({},o.value),{},{placement:u,content:d})})),toggleTooltip:function(e){r.value&&(o.value.visible=e)},showTooltip:r}},Ck=Symbol("sliderProps"),Ok=t.defineComponent({name:"TSliderButton",props:{value:{type:[Number],default:0},vertical:{type:Boolean,default:!1},tooltipProps:{type:[Boolean,Object],default:!0},label:{type:[String,Boolean,Function]},range:{type:Boolean,default:!1},position:{type:String}},emits:["input","mouseup"],setup:function(e,n){var r=rc("slider__button"),o=t.computed((function(){return e})),i=xk(o),a=i.tooltipRef,l=i.tooltipProps,s=i.toggleTooltip,c=i.showTooltip,u=t.inject(Ck),d=t.ref(),p=t.ref(!1),f=t.reactive({dragging:!1,isClick:!1,startX:0,startY:0,startPos:0,newPos:null}),h=t.computed((function(){return Number(u.max)-Number(u.min)})),v=t.computed((function(){return"".concat((e.value-u.min)/h.value*100,"%")})),g=t.computed((function(){return u.step})),b=t.computed((function(){return e.vertical?{bottom:v.value}:{left:v.value}}));t.watchEffect((function(){u.toggleDragging(f.dragging)}));var y=function(e){var r=e;if(null!==r&&!Number.isNaN(r)){r>100?r=100:r<0&&(r=0);var o=100*g.value/h.value,i=Math.round(r/o)*o*h.value*.01;i+=u.min,i=Number(parseFloat("".concat(i)).toFixed(u.precision)),n.emit("input",i),t.nextTick((function(){var e,t;a.value&&(null===(e=(t=a.value).updatePopper)||void 0===e||e.call(t))}))}},w=function(){d.value.focus(),s(!0)},k=function(){f.dragging||s(!1)},x=function(t){var n=t;if(f.dragging){p.value=!0,f.isClick=!1,null!=u&&u.resetSize&&R(null==u?void 0:u.resetSize)&&u.resetSize();var r=0,o=u.sliderSize;r=(r=e.vertical?f.startY-n.clientY:n.clientX-f.startX)/o*100,f.newPos=f.startPos+r,y(f.newPos)}},C=function e(){f.dragging&&(setTimeout((function(){f.dragging=!1,s(!1),f.isClick||y(f.newPos),p.value&&n.emit("mouseup"),p.value=!1}),0),window.removeEventListener("mousemove",x),window.removeEventListener("touchmove",x),window.removeEventListener("mouseup",e),window.removeEventListener("touchend",e),window.removeEventListener("contextmenu",e))};function O(t){u.disabled||(t.preventDefault(),function(t){f.dragging=!0,f.isClick=!0;var n=t.type,r=t.clientY,o=t.clientX;if("touchstart"===n){var i=t.touches,a=[i[0].clientY,i[0].clientX];r=a[0],o=a[1]}e.vertical?f.startY=r:f.startX=o,f.startPos=parseFloat(v.value),f.newPos=f.startPos}(t),window.addEventListener("mousemove",x),window.addEventListener("mouseup",C),window.addEventListener("touchmove",x),window.addEventListener("touchend",C),window.addEventListener("contextmenu",C))}var S=function(e){if(!u.disabled){var t=g.value/h.value*100;"sub"===e&&(t=-t),f.newPos=parseFloat(v.value)+t,y(f.newPos)}},E=function(e){var t=e.code;e.preventDefault(),"ArrowDown"!==t&&"ArrowLeft"!==t||S("sub"),"ArrowUp"!==t&&"ArrowRight"!==t||S("add")};return n.expose({setPosition:y}),function(){return t.createVNode("div",{ref:d,class:"".concat(r.value,"-wrapper"),style:b.value,tabindex:"0","show-tooltip":c.value,disabled:u.disabled,onmouseenter:w,onmouseleave:k,onmousedown:O,onTouchstart:O,onfocus:w,onblur:k,onKeydown:E},[t.createVNode(Mv,t.mergeProps({ref:a,hideEmptyPopup:!0,disabled:!c.value},l.value),{default:function(){return[t.createVNode("div",{class:[r.value,m({},"".concat(r.value,"--dragging"),f.dragging)]},null)]}})])}}}),Sk=t.defineComponent({name:"TSliderMark",props:{mark:{type:[Object,Array,String,Number]},point:{type:Number},onClickMarkPoint:{type:Function,default:function(){}}},setup:function(e){var n=rc("slider__mark"),r=function(t){var n;t.stopPropagation(),null==e||null===(n=e.onClickMarkPoint)||void 0===n||n.call(e,e.point)};return function(){return t.createVNode("div",{class:"".concat(n.value,"-text"),onClick:r},[e.mark])}}});function Ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ek(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ek(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Mk,Ak=t.defineComponent({name:"TSlider",model:{prop:"value",event:"change"},props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_k(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},vk),setup:function(e){var n=tg(),r=rc("slider"),o=oc().STATUS,i=t.toRefs(e),a=ll(Bm(i.value,i.modelValue,e.defaultValue,e.onChange),2),l=a[0],s=a[1],c=t.ref(),u=t.ref(),d=t.ref(),f=t.ref(),h=t.ref(bk(l.value,"first")),v=t.ref(bk(l.value,"second")),g=t.ref(!1),b=t.ref(1),y=t.computed((function(){return"vertical"===e.layout})),w=t.computed((function(){return["".concat(r.value,"__container"),{"is-vertical":y.value}]})),k=t.computed((function(){return["".concat(r.value),m(m(m({"is-vertical":y.value},"".concat(r.value,"--with-input"),e.inputNumberProps),"".concat(r.value,"--vertical"),y.value),o.value.disabled,n.value)]})),x=t.computed((function(){return["".concat(r.value,"__rail"),{"show-input":e.inputNumberProps,disabled:n.value}]})),C=t.computed((function(){return y.value?{height:"100%"}:{}})),O=t.computed((function(){var t=e.range?"".concat(100*(E.value-e.min)/S.value,"%"):"0%",n=e.range?N.value-E.value:h.value-e.min,r="".concat(100*n/S.value,"%");return y.value?{height:r,bottom:t}:{width:r,left:t}})),S=t.computed((function(){return e.max-e.min})),E=t.computed((function(){return Math.min(h.value,v.value)})),N=t.computed((function(){return Math.max(h.value,v.value)})),_=t.computed((function(){if(!e.showStep||e.min>e.max)return[];if(0===e.step)return console.warn("[Element Warn][Slider]step should not be 0."),[];for(var t=S.value/e.step,n=100*e.step/S.value,r=[],o=1;o<t;o++)r.push(o*n);return e.range?r.filter((function(t){return t<100*(E.value-e.min)/S.value||e.step>100*(N.value-e.max)/S.value})):r.filter((function(t){return t>100*(h.value-e.min)/S.value}))})),M=t.computed((function(){var t=[e.min,e.max,e.step].map((function(e){var t="".concat(e).split(".");return t[1]?t[1].length:0}));return Math.max.apply(null,t)})),A=function(t){var n=[e.min,e.max],r=n[0],o=n[1];if(!(r>o)){if(e.range&&xe(t)){var i=[Math.min.apply(Math,p(t)),Math.max.apply(Math,p(t))],a=i[0],l=i[1];a>o&&(a=h.value),a<r&&(a=r),l<r&&(l=v.value),l>o&&(l=o);var s=[a,l];return h.value=s[0],v.value=s[1],[a,l]}var c=t;return c<r&&(c=r),c>o&&(c=o),c}console.warn("[Slider] max should be greater than min.")},T=function(t){var n=t;void 0===n&&(n=e.range?[h.value,v.value]:h.value);var r=A(n);s(r)},V=function(){u.value&&(b.value=u.value["client".concat(y.value?"Height":"Width")])},j=t.ref(!1),B=function(){var t;e.range?(xe(l.value)?(h.value=Math.max(e.min||0,l.value[0]),v.value=Math.min(e.max||100,l.value[1])):(h.value=e.min||0,v.value=e.max||100),t="".concat(h.value,"-").concat(v.value)):(bl(l.value)?h.value=Math.min(e.max,Math.max(e.min,l.value)):h.value=e.min,t=String(h.value)),c.value&&c.value.setAttribute("aria-valuetext",t),V(),window.addEventListener("resize",V)},P=function(t){var n,r=t*S.value/100;(r=e.min+r,e.range||!d.value)?("button1"===(n=Math.abs(E.value-r)<Math.abs(N.value-r)?h.value<v.value?"button1":"button2":h.value>v.value?"button1":"button2")&&d.value&&d.value.setPosition(t),"button2"===n&&f.value&&f.value.setPosition(t)):d.value.setPosition(t)},I=function(){var t=e.range?[h.value,v.value]:h.value;return A(t)},D=function(t){var r;if(!n.value&&!g.value&&u.value){V();var o=0;if(y.value){o=(u.value.getBoundingClientRect().bottom-t.clientY)/b.value*100,P(o)}else{var i=u.value.getBoundingClientRect().left;o=(t.clientX-i)/b.value*100,P(o)}var a=I();null===(r=e.onChangeEnd)||void 0===r||r.call(e,a)}},L=function(t){var r;if(!n.value&&!g.value){V();var o=Number(t/S.value*100);P(o),T(t);var i=I();null===(r=e.onChangeEnd)||void 0===r||r.call(e,i)}};t.watch((function(){return l.value}),(function(t){if(!0!==g.value)if(xe(t)&&e.range){var n=ll(t,2);h.value=n[0],v.value=n[1]}else h.value=t})),t.watch([h,v,g],(function(t,n){t[0]!==n[0]&&(e.range?T([E.value,N.value]):T(h.value)),t[1]!==n[1]&&e.range&&T([E.value,N.value]),t[2]!==n[2]&&!1===t[2]&&B()})),t.onMounted((function(){B(),j.value=!0})),t.onBeforeUnmount((function(){window.removeEventListener("resize",V)}));var R,z,F,$=t.computed((function(){return{max:e.max,min:e.min,marks:e.marks,vertical:y.value,prefixName:r.value}})),H=(z=(R=$).value.prefixName,F=t.computed((function(){var e=R.value;if(!e.marks)return[];var t=[];if(xe(e.marks)){var n=qs(e.marks).sort((function(e,t){return e-t})),r=Math.max.apply(Math,p(n).concat([e.max])),o=Math.min.apply(Math,p(n).concat([e.min]));o<e.min&&Im.errorOnce("TSlider","marks min value should >= props min"),r>e.max&&Im.errorOnce("TSlider","marks max value should <= props max"),n.forEach((function(e){t.push({point:e,position:(e-o)/(r-o)*100,mark:e})}))}else Object.keys(e.marks).map(parseFloat).sort((function(e,t){return e-t})).filter((function(t){return t<=e.max&&t>=e.min})).forEach((function(n){var r={point:n,position:100*(n-e.min)/(e.max-e.min),mark:e.marks[n]};t.push(r)}));return t})),function(e){return F.value.length?t.createVNode("div",null,[t.createVNode("div",{class:"".concat(z,"__stops")},[F.value.map((function(e,n){return 0===e.position||100===e.position?null:t.createVNode("div",{class:"".concat(z,"__stop ").concat(z,"__mark-stop"),style:gk(e.position,R.value.vertical),key:n},null)}))]),t.createVNode("div",{class:"".concat(z,"__mark")},[F.value.map((function(n,r){return t.createVNode(Sk,{mark:n.mark,point:n.point,key:r,style:gk(n.position,R.value.vertical),onClickMarkPoint:e},null)}))])]):null}),U=function(e){var n=e.value.prefixName,r=t.computed((function(){var t,n={format:void 0,placeholder:"",theme:"column",decimalPlaces:(null===(t=e.value.step.toString().split(".")[1])||void 0===t?void 0:t.length)||0},r=e.value;if(!Dd(r.inputNumberProps)){var o,i=null===(o=r.inputNumberProps)||void 0===o?void 0:o.theme;n=Nk(Nk({},n),Sv(r.inputNumberProps,"onChange")),["column","row","normal"].includes(i)&&(n.theme=i)}return n})),o=t.computed((function(){return["".concat(n,"__input"),{"is-vertical":e.value.vertical}]}));return function(n,i){return t.createVNode($g,t.mergeProps(r.value,{class:o.value,value:n,step:e.value.step,onChange:function(t,n){var r,o;void 0===t||isNaN(t)||i(t),null===(r=e.value)||void 0===r||null===(r=r.inputNumberProps)||void 0===r||null===(o=r.onChange)||void 0===o||o.call(r,t,n)},disabled:e.value.disabled,min:e.value.min,max:e.value.max}),null)}}(t.computed((function(){return{max:e.max,min:e.min,inputNumberProps:e.inputNumberProps,step:e.step,prefixName:r.value,vertical:y.value,disabled:n.value}}))),W=t.toRefs(e),q=W.min,K=W.max,G=W.step;return t.provide(Ck,t.reactive({min:q,max:K,step:G,dragging:g,toggleDragging:function(e){g.value=e},precision:M,disabled:n,resetSize:V,sliderSize:b})),function(){return t.createVNode("div",{class:w.value,ref:c},[t.createVNode("div",{class:k.value,role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-orientation":e.layout,"aria-disabled":n.value,"tooltip-props":e.tooltipProps},[t.createVNode("div",{class:x.value,style:C.value,onClick:D,ref:u},[t.createVNode("div",{class:"".concat(r.value,"__track"),style:O.value},null),t.createVNode(Ok,{vertical:y.value,value:h.value,ref:d,disabled:n.value,range:e.range,position:"start","tooltip-props":e.tooltipProps,label:e.label,onInput:function(e){h.value=e},onMouseup:function(){var t,n=I();null===(t=e.onChangeEnd)||void 0===t||t.call(e,n)}},null),e.range&&t.createVNode(Ok,{vertical:y.value,value:v.value,ref:f,disabled:n.value,label:e.label,range:e.range,position:"end","tooltip-props":e.tooltipProps,onInput:function(e){v.value=e},onMouseup:function(){var t,n=I();null===(t=e.onChangeEnd)||void 0===t||t.call(e,n)}},null),e.showStep&&t.createVNode("div",{class:"".concat(r.value,"__stops")},[_.value.map((function(e,n){return 0===e.position||100===e.position?null:t.createVNode("div",{class:"".concat(r.value,"__stop"),key:n,style:gk(e,y.value)},null)}))]),H(L)])]),j.value&&e.inputNumberProps&&(o=A(h.value),i=A(v.value),t.createVNode("div",{class:["".concat(r.value,"__input-container"),{"is-vertical":y.value}]},[U(o,(function(e){h.value=A(e)})),e.range&&t.createVNode("div",{class:"".concat(r.value,"__center-line")},null),e.range&&U(i,(function(e){v.value=A(e)}))]))]);var o,i}}}),Tk=xd(Ak);xd(Ok);var Vk=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function jk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Mk||(Mk=document.createElement("textarea"),document.body.appendChild(Mk));var r=function(e){if("undefined"!=typeof window){var t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing")||t.getPropertyValue("-moz-box-sizing")||t.getPropertyValue("-webkit-box-sizing"),r=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),o=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width"));return{sizingStyle:Vk.map((function(e){return"".concat(e,":").concat(t.getPropertyValue(e))})).join(";"),paddingSize:r,borderSize:o,boxSizing:n}}}(e),o=r.paddingSize,i=r.borderSize,a=r.boxSizing,l=r.sizingStyle;Mk.setAttribute("style","".concat(l,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow-y:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n")),Mk.value=e.value||e.placeholder||"";var s=Mk.scrollHeight,c={};"border-box"===a?s+=i:"content-box"===a&&(s-=o),Mk.value="";var u=Mk.scrollHeight-o;if(null!==t){var d=u*t;"border-box"===a&&(d=d+o+i),s=Math.max(d,s),c.minHeight="".concat(d,"px")}if(null!==n){var p=u*n;"border-box"===a&&(p=p+o+i),s=Math.min(p,s)}return c.height="".concat(s,"px"),Mk.parentNode&&Mk.parentNode.removeChild(Mk),Mk=null,c}var Bk={allowInputOverMax:{type:Boolean,default:!1},autofocus:Boolean,autosize:{type:[Boolean,Object],default:!1},disabled:Boolean,maxcharacter:{type:Number},maxlength:{type:[Number,String]},name:{type:String,default:""},placeholder:{type:String,default:void 0},readonly:Boolean,status:{type:String,validator:function(e){return["default","success","warning","error"].includes(e)}},tips:{type:[String,Function]},value:{type:[String,Number]},modelValue:{type:[String,Number]},defaultValue:{type:[String,Number]},onBlur:Function,onChange:Function,onFocus:Function,onKeydown:Function,onKeypress:Function,onKeyup:Function,onValidate:Function};function Pk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ik(e){var t={};return Object.keys(e).forEach((function(n){ml(e[n])||(t[n]=e[n])})),t}var Dk=t.defineComponent({name:"TTextarea",inheritAttrs:!1,props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pk(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Bk),setup:function(e,n){var r=n.attrs,o=n.expose,i=rc(),a=rc("textarea"),l=t.computed((function(){return"".concat(a.value,"__tips")})),s=t.computed((function(){return"".concat(a.value,"__limit")})),c=t.toRefs(e),u=ll(Bm(c.value,c.modelValue,e.defaultValue,e.onChange),2),d=u[0],p=u[1],h=tg(),v=t.ref({}),g=t.ref(),b=t.ref(!1),y=t.ref(!1),w=function(){var t;if(!0===e.autosize)v.value=jk(g.value);else if(e.autosize&&"object"===f(e.autosize)){var n=e.autosize,o=n.minRows,i=n.maxRows;v.value=jk(g.value,o,i)}else r.rows?v.value={height:"auto",minHeight:"auto"}:r.style&&null!==(t=g.value)&&void 0!==t&&null!==(t=t.style)&&void 0!==t&&t.height&&(v.value={height:g.value.style.height})},k=function(n){var r=n.target.value;if(e.maxcharacter&&e.maxcharacter>=0){var o=wl(r,e.maxcharacter);r="object"===f(o)&&o.characters}!y.value&&p(r,{e:n}),t.nextTick((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=g.value,n=String(e);t&&t.value!==n&&(t.value=n,d.value=n)}(r)})),w()},x=function(e){k(e)},C=function(){y.value=!0},O=function(e){y.value=!1,k(e)},S=function(t,n){var r;if(!h.value){var o="on".concat(t[0].toUpperCase()).concat(t.slice(1));null===(r=e[o])||void 0===r||r.call(e,d.value,{e:n})}},E=function(e){S("keydown",e)},N=function(e){S("keyup",e)},_=function(e){S("keypress",e)},M=function(t){var n;w(),h.value||(b.value=!0,null===(n=e.onFocus)||void 0===n||n.call(e,d.value,{e:t}))},A=t.inject(ig,void 0),T=function(t){var n;w(),b.value=!1,null===(n=e.onBlur)||void 0===n||n.call(e,d.value,{e:t}),null==A||A.handleBlur()},V=t.computed((function(){return[a.value,m(m({},"".concat(i.value,"-is-disabled"),h.value),"".concat(i.value,"-is-readonly"),e.readonly)]})),j=t.computed((function(){return Ik({autofocus:e.autofocus,disabled:h.value,readonly:e.readonly,placeholder:e.placeholder,maxlength:!e.allowInputOverMax&&e.maxlength||void 0,name:e.name||void 0})})),B=t.computed((function(){var e=wl(String(d.value||""));return"object"===f(e)?e.length:e})),P=ag(t.computed((function(){return{value:[void 0,null].includes(d.value)?void 0:String(d.value),status:e.status,maxlength:Number(e.maxlength),maxcharacter:e.maxcharacter,allowInputOverMax:e.allowInputOverMax,onValidate:e.onValidate}}))).tStatus;t.watch((function(){return d.value}),(function(){return w()})),t.watch(g,(function(e){e&&w()})),t.watch((function(){return e.autofocus}),(function(e){e&&g.value.focus()})),t.watch(v,(function(e){var t=r.style;sl(g.value,al(t,e))})),t.watch(d,(function(){t.nextTick((function(){return w()}))})),t.watch((function(){return e.autosize}),w,{deep:!0}),o({focus:function(){var e;return null===(e=g.value)||void 0===e?void 0:e.focus()},blur:function(){var e;return null===(e=g.value)||void 0===e?void 0:e.blur()}}),t.onMounted((function(){w()}));var I=Vd();return function(){var n,o=Ik({onFocus:M,onBlur:T,onKeydown:E,onKeyup:N,onKeypress:_}),c=oc().STATUS,u=t.computed((function(){return["".concat(a.value,"__inner"),m(m(m(m({},"".concat(i.value,"-is-").concat(P.value),P.value),c.value.disabled,h.value),c.value.focused,b.value),"".concat(i.value,"-resize-none"),"object"===f(e.autosize)),"narrow-scrollbar"]})),p=I("tips"),v=p&&t.createVNode("div",{class:"".concat(l.value," ").concat(a.value,"__tips--").concat(e.status||"normal")},[p]),y=e.maxcharacter&&t.createVNode("span",{class:s.value},["".concat(B.value,"/").concat(e.maxcharacter)])||!e.maxcharacter&&e.maxlength&&t.createVNode("span",{class:s.value},["".concat(d.value?null===(n=String(d.value))||void 0===n?void 0:n.length:0,"/").concat(e.maxlength)]);return t.createVNode("div",t.mergeProps({class:V.value},Vv(r,["style"])),[t.createVNode("textarea",t.mergeProps({onInput:x,onCompositionstart:C,onCompositionend:O,ref:g,value:d.value,class:u.value},o,j.value),null),v||y?t.createVNode("div",{class:["".concat(a.value,"__info_wrapper"),m({},"".concat(a.value,"__info_wrapper_align"),!v)]},[v,y]):null])}}}),Lk=xd(Dk),Rk={clearable:Boolean,closeBtn:{type:[String,Boolean,Function],default:!0},colorModes:{type:Array,default:function(){return["monochrome","linear-gradient"]}},disabled:Boolean,enableAlpha:Boolean,enableMultipleGradient:{type:Boolean,default:!0},format:{type:String,default:"RGB",validator:function(e){return!e||["RGB","RGBA","HSL","HSLA","HSB","HSV","HSVA","HEX","CMYK","CSS"].includes(e)}},inputProps:{type:Object},multiple:Boolean,popupProps:{type:Object},recentColors:{type:Array,default:void 0},defaultRecentColors:{type:Array,default:function(){return[]}},selectInputProps:{type:Object},showPrimaryColorPreview:{type:Boolean,default:!0},size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},swatchColors:{type:Array},value:{type:String,default:void 0},modelValue:{type:String,default:void 0},defaultValue:{type:String,default:""},onChange:Function,onPaletteBarChange:Function,onRecentColorsChange:Function},zk={monochrome:"单色","linear-gradient":"渐变"},Fk="linear-gradient(90deg, rgba(241,29,0,1) 0%, rgba(73,106,220,1) 100%);",$k=["#ECF2FE","#D4E3FC","#BBD3FB","#96BBF8","#699EF5","#4787F0","#266FE8","#0052D9","#0034B5","#001F97","#FDECEE","#F9D7D9","#F8B9BE","#F78D94","#F36D78","#E34D59","#C9353F","#B11F26","#951114","#680506","#FEF3E6","#F9E0C7","#F7C797","#F2995F","#ED7B2F","#D35A21","#BA431B","#9E3610","#842B0B","#5A1907","#E8F8F2","#BCEBDC","#85DBBE","#48C79C","#00A870","#078D5C","#067945","#056334","#044F2A","#033017"],Hk=["HEX","RGB","HSL","HSV","CMYK","CSS"],Uk=function(e){var n=rc("color-picker");return t.computed((function(){return e?"".concat(n.value,"-").concat(e):n.value}))};function Wk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wk(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kk,Gk,Yk,Xk,Zk,Jk,Qk,ex=t.defineComponent({name:"PanelHeader",props:qk(qk({},Rk),{},{mode:{type:String,default:"color"},togglePopup:{type:Function},onModeChange:{type:Function,default:function(){return function(){}}}}),setup:function(e){var n=Uk(),r=t.ref(e.mode);return t.watch((function(){return e.mode}),(function(e){return r.value=e})),{baseClassName:n,modeValue:r,handleModeChange:function(t){return e.onModeChange(t)}}},render:function(){var e,n,r,o=this;if(1===(null===(n=this.colorModes)||void 0===n?void 0:n.length))return null;var i,a=this.baseClassName;return t.createVNode("div",{class:"".concat(a,"__head")},[t.createVNode("div",{class:"".concat(a,"__mode")},[1===(null===(r=this.colorModes)||void 0===r?void 0:r.length)?zk[this.colorModes[0]]:t.createVNode(hk,{variant:"default-filled",size:"small",modelValue:o.modeValue,"onUpdate:modelValue":function(e){return o.modeValue=e},onChange:this.handleModeChange},(i=e=Object.keys(zk).map((function(e){return t.createVNode(mk,{key:e,value:e},{default:function(){return[zk[e]]}})})),"function"==typeof i||"[object Object]"===Object.prototype.toString.call(i)&&!t.isVNode(i)?e:{default:function(){return[e]}}))])])}}),tx=/cmyk\((\d+%?),(\d+%?),(\d+%?),(\d+%?)\)/,nx=function(e){return Math.max(0,Math.min(255,parseInt(e,10)))},rx=function(e){if(/cmyk/i.test(e)){var t=e.replace(/\s/g,"").match(tx),n=function(e,t,n,r){var o=e/100,i=t/100,a=n/100,l=r/100,s=1-(o=o*(1-l)+l),c=1-(i=i*(1-l)+l),u=1-(a=a*(1-l)+l);return{r:s=Math.round(255*s),g:c=Math.round(255*c),b:u=Math.round(255*u)}}(nx(t[1]),nx(t[2]),nx(t[3]),nx(t[4])),r=n.r,o=n.g,i=n.b;return"rgb(".concat(r,", ").concat(o,", ").concat(i,")")}return e},ox=function(e,t){for(var n="",r=0;r<e.length;r++)fl(e[r])?n+=e[r]:n+=e[r].source;return new RegExp(n,t)},ix=(Kk=/\s*,\s*/,Gk=/(?:[+-]?\d*\.?\d+)(?:%|[a-z]+)?/,Yk=ox(["(?:",/#(?:[a-f0-9]{6}|[a-f0-9]{3})/,"|","(?:rgb|hsl)",/\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)/,"|","(?:rgba|hsla)",/\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*,\s*\d*\.?\d+\)/,"|",/[_a-z-][_a-z0-9-]*/,")"],""),Xk=ox([Yk,"(?:\\s+",Gk,"(?:\\s+",Gk,")?)?"],""),Zk=ox(["(?:",Xk,Kk,")*",Xk],""),Jk=ox(["(?:(",/(?:[+-]?\d*\.?\d+)(?:deg|grad|rad|turn)/,")|",/to\s+((?:(?:left|right|top|bottom)(?:\s+(?:top|bottom|left|right))?))/,")"],""),{gradientSearch:ox(["(?:(",Jk,")",Kk,")?(",Zk,")"],"gi"),colorStopSearch:ox(["\\s*(",Yk,")","(?:\\s+","(",Gk,"))?","(?:",Kk,"\\s*)?"],"gi")}),ax=/.*gradient\s*\(((?:\([^)]*\)|[^)(]*)*)\)/gim,lx=function(e){return ax.lastIndex=0,ax.exec(e)},sx={top:0,right:90,bottom:180,left:270,"top left":225,"left top":225,"top right":135,"right top":135,"bottom left":315,"left bottom":315,"bottom right":45,"right bottom":45},cx=function(e){var t=lx(e);if(!t)return!1;var n={points:[],degree:0},r=function(e,t){var n,r,o;e.gradientSearch.lastIndex=0;var i=e.gradientSearch.exec(t);if(!hl(i))for(n={original:i[0],colorStopList:[]},i[1]&&(n.line=i[1]),i[2]&&(n.angle=i[2]),i[3]&&(n.sideCorner=i[3]),e.colorStopSearch.lastIndex=0,r=e.colorStopSearch.exec(i[4]);!hl(r);)o={color:r[1]},r[2]&&(o.position=r[2]),n.colorStopList.push(o),r=e.colorStopSearch.exec(i[4]);return n}(ix,t[1]);if(r.original.trim()!==t[1].trim())return!1;var o=r.colorStopList.map((function(e){var t=e.color,n=e.position,r=Object.create(null);return r.color=Ab(t).toRgbString(),r.left=parseFloat(n),r}));n.points=o;var i=parseInt(r.angle,10);return Number.isNaN(i)&&(i=sx[r.sideCorner]||90),n.degree=i,n};function ux(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ux(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ux(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var px=Math.round,fx=function(e){return Ab(e).toRgb()},hx=function(e){var t=e.points,n=e.degree,r=t.sort((function(e,t){return e.left-t.left})).map((function(e){return"".concat(e.color," ").concat(Math.round(100*e.left)/100,"%")}));return"linear-gradient(".concat(n,"deg,").concat(r.join(","),")")},mx=function(e,t){return{id:(1+4294967295*Math.random()).toString(16),left:e,color:t}},vx=function(){return Jv((function e(t){Xv(this,e),m(this,"states",{s:100,v:100,h:100,a:1}),m(this,"originColor",void 0),m(this,"isGradient",void 0),m(this,"gradientStates",{colors:[],degree:0,selectedId:null,css:""}),this.update(t)}),[{key:"update",value:function(e){if(e!==this.originColor){if(this.isGradient){var t=Ab(e).toHsv();return this.states=t,void this.updateCurrentGradientColor()}this.originColor=e,this.isGradient=!1;var n=cx(e),r=e;if(n){var o,i;this.isGradient=!0;var a=n,l=a.points.map((function(e){return mx(e.left,e.color)}));this.gradientStates={colors:l,degree:a.degree,selectedId:(null===(o=l[0])||void 0===o?void 0:o.id)||null},this.gradientStates.css=this.linearGradient,r=null===(i=this.gradientSelectedPoint)||void 0===i?void 0:i.color}this.updateStates(r)}}},{key:"saturation",get:function(){return this.states.s},set:function(e){this.states.s=Math.max(0,Math.min(100,e)),this.updateCurrentGradientColor()}},{key:"value",get:function(){return this.states.v},set:function(e){this.states.v=Math.max(0,Math.min(100,e)),this.updateCurrentGradientColor()}},{key:"hue",get:function(){return this.states.h},set:function(e){this.states.h=Math.max(0,Math.min(360,e)),this.updateCurrentGradientColor()}},{key:"alpha",get:function(){return this.states.a},set:function(e){this.states.a=Math.max(0,Math.min(1,Math.round(100*e)/100)),this.updateCurrentGradientColor()}},{key:"rgb",get:function(){var e=fx(this.states),t=e.r,n=e.g,r=e.b;return"rgb(".concat(px(t),", ").concat(px(n),", ").concat(px(r),")")}},{key:"rgba",get:function(){var e=fx(this.states),t=e.r,n=e.g,r=e.b,o=e.a;return"rgba(".concat(px(t),", ").concat(px(n),", ").concat(px(r),", ").concat(o,")")}},{key:"hsv",get:function(){var e=this.getHsva(),t=e.h,n=e.s,r=e.v;return"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)")}},{key:"hsva",get:function(){var e=this.getHsva(),t=e.h,n=e.s,r=e.v,o=e.a;return"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(o,")")}},{key:"hsl",get:function(){var e=this.getHsla(),t=e.h,n=e.s,r=e.l;return"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)")}},{key:"hsla",get:function(){var e=this.getHsla(),t=e.h,n=e.s,r=e.l,o=e.a;return"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(o,")")}},{key:"hex",get:function(){return Ab(this.states).toHexString()}},{key:"hex8",get:function(){return Ab(this.states).toHex8String()}},{key:"cmyk",get:function(){var e=this.getCmyk(),t=e.c,n=e.m,r=e.y,o=e.k;return"cmyk(".concat(t,", ").concat(n,", ").concat(r,", ").concat(o,")")}},{key:"css",get:function(){return this.isGradient?this.linearGradient:this.rgba}},{key:"linearGradient",get:function(){var e=this.gradientColors,t=this.gradientDegree;return hx({points:e,degree:t})}},{key:"gradientColors",get:function(){return this.gradientStates.colors},set:function(e){this.gradientStates.colors=e,this.gradientStates.css=this.linearGradient}},{key:"gradientSelectedId",get:function(){return this.gradientStates.selectedId},set:function(e){var t;e!==this.gradientSelectedId&&(this.gradientStates.selectedId=e,this.updateStates(null===(t=this.gradientSelectedPoint)||void 0===t?void 0:t.color))}},{key:"gradientDegree",get:function(){return this.gradientStates.degree},set:function(e){this.gradientStates.degree=Math.max(0,Math.min(360,e)),this.gradientStates.css=this.linearGradient}},{key:"gradientSelectedPoint",get:function(){var e=this.gradientColors,t=this.gradientSelectedId;return e.find((function(e){return e.id===t}))}},{key:"getFormatsColorMap",value:function(){return{HEX:this.hex,CMYK:this.cmyk,RGB:this.rgb,RGBA:this.rgba,HSL:this.hsl,HSLA:this.hsla,HSV:this.hsv,HSVA:this.hsva,CSS:this.css,HEX8:this.hex8}}},{key:"updateCurrentGradientColor",value:function(){var e=this.isGradient,t=this.gradientColors,n=this.gradientSelectedId,r=t.length,o=this.gradientSelectedPoint;if(!e||0===r||!o)return!1;var i=t.findIndex((function(e){return e.id===n})),a=dx(dx({},o),{},{color:this.rgba});return t.splice(i,1,a),this.gradientColors=t,this}},{key:"updateStates",value:function(e){var t=Ab(rx(e)).toHsv();this.states=t}},{key:"getRgba",value:function(){var e=fx(this.states),t=e.r,n=e.g,r=e.b,o=e.a;return{r:px(t),g:px(n),b:px(r),a:o}}},{key:"getCmyk",value:function(){var e=this.getRgba(),t=function(e,t,n){var r=0,o=0,i=0,a=parseInt("".concat(e).replace(/\s/g,""),10),l=parseInt("".concat(t).replace(/\s/g,""),10),s=parseInt("".concat(n).replace(/\s/g,""),10);if(0===a&&0===l&&0===s)return[0,0,0,1];r=1-a/255,o=1-l/255,i=1-s/255;var c=Math.min(r,Math.min(o,i));return[r=(r-c)/(1-c),o=(o-c)/(1-c),i=(i-c)/(1-c),c]}(e.r,e.g,e.b),n=ll(t,4),r=n[0],o=n[1],i=n[2],a=n[3];return{c:px(100*r),m:px(100*o),y:px(100*i),k:px(100*a)}}},{key:"getHsva",value:function(){var e=Ab(this.states).toHsv(),t=e.h,n=e.s,r=e.v,o=e.a;return{h:t=px(t),s:n=px(100*n),v:r=px(100*r),a:o*=1}}},{key:"getHsla",value:function(){var e=Ab(this.states).toHsl(),t=e.h,n=e.s,r=e.l,o=e.a;return{h:t=px(t),s:n=px(100*n),l:r=px(100*r),a:o*=1}}},{key:"equals",value:function(e){return Ab.equals(this.rgba,e)}}],[{key:"isValid",value:function(e){return!!cx(e)||Ab(e).isValid()}},{key:"hsva2color",value:function(e,t,n,r){return Ab({h:e,s:t,v:n,a:r}).toHsvString()}},{key:"hsla2color",value:function(e,t,n,r){return Ab({h:e,s:t,l:n,a:r}).toHslString()}},{key:"rgba2color",value:function(e,t,n,r){return Ab({r:e,g:t,b:n,a:r}).toHsvString()}},{key:"hex2color",value:function(e,t){var n=Ab(e);return n.setAlpha(t),n.toHexString()}},{key:"object2color",value:function(e,t){if("CMYK"===t){var n=e.c,r=e.m,o=e.y,i=e.k;return"cmyk(".concat(n,", ").concat(r,", ").concat(o,", ").concat(i,")")}return Ab(e,{format:t}).toRgbString()}}])}();Qk=vx,m(vx,"isGradientColor",(function(e){return!!lx(e)})),m(vx,"compare",(function(e,t){var n=Qk.isGradientColor(e),r=Qk.isGradientColor(t);return n&&r?hx(cx(e))===hx(cx(t)):!n&&!r&&Ab.equals(e,t)}));var gx=["alpha","css","hex","hex8","hsl","hsla","hsv","hsva","rgb","rgba","saturation","value","isGradient"],bx=function(e){if(!e)return null;var t=Object.create(null);return gx.forEach((function(n){return t[n]=e[n]})),e.isGradient&&(t.linearGradient=e.linearGradient),t};function yx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yx(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kx(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function xx(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Cx={start:function(e,t){},drag:function(e,t){},end:function(e,t){}},Ox=new WeakSet,Sx=function(){return Jv((function e(t,n){Xv(this,e),kx(this,Ox),m(this,"dragging",!1),m(this,"$el",void 0),m(this,"props",void 0),m(this,"handles",void 0),this.$el=t,this.props=wx(wx({},Cx),n),this.handles={start:xx(Ox,this,Ex).bind(this),drag:xx(Ox,this,Nx).bind(this),end:xx(Ox,this,_x).bind(this)},this.$el.addEventListener("mousedown",this.handles.start,!1)}),[{key:"destroy",value:function(){this.$el.removeEventListener("mousedown",this.handles.start,!1),window.removeEventListener("mousemove",this.handles.drag,!1),window.removeEventListener("mouseup",this.handles.end,!1),window.removeEventListener("contextmenu",this.handles.end,!1)}}])}();function Ex(e){this.dragging||(window.addEventListener("mousemove",this.handles.drag,!1),window.addEventListener("mouseup",this.handles.end,!1),window.addEventListener("contextmenu",this.handles.end,!1),this.dragging=!0,this.props.start(xx(Ox,this,Mx).call(this,e),e))}function Nx(e){this.dragging&&this.props.drag(xx(Ox,this,Mx).call(this,e),e)}function _x(e){var t=this;setTimeout((function(){t.dragging=!1,t.props.end(xx(Ox,t,Mx).call(t,e),e)}),0),window.removeEventListener("mousemove",this.handles.drag,!1),window.removeEventListener("mouseup",this.handles.end,!1),window.removeEventListener("contextmenu",this.handles.end,!1)}function Mx(e){var t=this.$el.getBoundingClientRect(),n=e,r=n.clientX-t.left,o=n.clientY-t.top;return{y:Math.min(Math.max(0,o),t.height),x:Math.min(Math.max(0,r),t.width)}}var Ax={disabled:Boolean,color:{type:Object},onChange:{type:Function,default:function(){return function(){}}}};function Tx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tx(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var jx=["delete","backspace"],Bx=t.defineComponent({name:"LinearGradient",inheritAttrs:!1,props:Vx(Vx({},Ax),{},{enableMultipleGradient:{type:Boolean,default:!0}}),setup:function(e){var n=Uk(),r=oc().STATUS.value,o=t.ref(null),i=t.reactive({left:0,width:176}),a=t.ref(!1),l=t.ref(!1),s=t.ref(e.color.gradientDegree),c=t.ref(e.color.gradientSelectedId),u=t.ref(qs(e.color.gradientColors));t.watch((function(){return e.color.gradientDegree}),(function(e){return s.value=e})),t.watch((function(){return e.color.gradientSelectedId}),(function(e){return c.value=e})),t.watch((function(){return e.color.gradientColors}),(function(e){u.value=qs(e)}),{deep:!0});var d=function(t,n,r){e.disabled||e.onChange({key:t,payload:n,addUsedColor:r})},p=function(t){e.disabled||(c.value=t,d("selectedId",t))},f=function(t,n){e.disabled||(u.value=t,d("colors",t,n))},h=function(t){if(a.value&&!e.disabled){var n=t.clientX-i.left;l.value=!0,function(e){var t=u.value.findIndex((function(e){return e.id===c.value}));if(-1!==t){var n=u.value[t],r=(e=Math.max(0,Math.min(i.width,e)))/i.width*100;u.value.splice(t,1,{color:n.color,left:r,id:n.id}),f(u.value)}}(n)}},m=function e(){a.value&&(setTimeout((function(){a.value=!1}),0),l.value&&(f(u.value,!0),l.value=!1),window.removeEventListener("mousemove",h,!1),window.removeEventListener("mouseup",e,!1),window.removeEventListener("contextmenu",e,!1))};return t.onMounted((function(){var e=o.value.getBoundingClientRect();i.left=e.left,i.width=e.width||176})),t.onBeforeUnmount((function(){window.removeEventListener("mousemove",h,!1),window.removeEventListener("mouseup",m,!1),window.removeEventListener("contextmenu",m,!1)})),{baseClassName:n,statusClassNames:r,refSlider:o,degree:s,selectedId:c,colors:u,handleDegreeChange:function(t){e.disabled||t===e.color.gradientDegree||(s.value=t,d("degree",t,!0))},handleStart:function(t){var n=o.value.getBoundingClientRect();i.left=n.left,i.width=n.width||176,a.value||e.disabled||(l.value=!1,a.value=!0,p(t),o.value.focus(),window.addEventListener("mousemove",h,!1),window.addEventListener("mouseup",m,!1),window.addEventListener("contextmenu",m,!1))},handleMove:h,handleEnd:m,handleKeyup:function(t){if(!e.disabled){var n=u.value,r=n.findIndex((function(e){return e.id===c.value})),o=n.length;if(jx.includes(t.key.toLocaleLowerCase())&&o>2&&r>=0&&r<=o-1){n.splice(r,1),n[r]||(r=n[r+1]?r+1:n[r-1]?r-1:0);var i=n[r];f(n,!0),p(null==i?void 0:i.id)}}},handleThumbBarClick:function(t){if(!e.disabled&&e.enableMultipleGradient){var n=t.clientX-i.left,r=(n=Math.max(0,Math.min(i.width,n)))/i.width*100,o=mx(r,e.color.rgba);u.value.push(o),f(u.value,!0),p(o.id)}}}},render:function(){var e=this,n=this.color,r=n.linearGradient,o=n.gradientColors,i=this.colors,a=this.selectedId,l=this.degree,s=this.disabled,c=this.baseClassName,u=this.statusClassNames,d=hx({points:o,degree:90});return t.createVNode("div",{class:"".concat(c,"__gradient")},[t.createVNode("div",{class:"".concat(c,"__gradient-slider")},[t.createVNode("div",{class:["".concat(c,"__slider"),"".concat(c,"--bg-alpha")],onKeyup:this.handleKeyup,tabindex:0,ref:"refSlider"},[t.createVNode("ul",{class:"gradient-thumbs",onClick:this.handleThumbBarClick,style:{background:d}},[i.map((function(n){var r="".concat(Math.round(100*n.left)/100,"%");return t.createVNode("li",{class:["".concat(c,"__thumb"),"gradient-thumbs__item",a===n.id?u.active:""],key:n.id,title:"".concat(n.color," ").concat(r),style:{color:n.color,left:r},onClick:function(e){return e.stopPropagation()},onMousedown:function(){return e.handleStart(n.id)}},[t.createVNode("span",{class:["gradient-thumbs__item-inner","".concat(c,"--bg-alpha")]},null)])}))])])]),t.createVNode("div",{class:"".concat(c,"__gradient-degree"),title:"".concat(l,"deg")},[t.createVNode($g,{size:"small",theme:"normal",min:0,max:360,step:1,format:function(e){return"".concat(e,"°")},modelValue:e.degree,"onUpdate:modelValue":function(t){return e.degree=t},onBlur:this.handleDegreeChange,onEnter:this.handleDegreeChange,disabled:s},null)]),t.createVNode("div",{class:["".concat(c,"__gradient-preview"),"".concat(c,"--bg-alpha")]},[t.createVNode("span",{class:"preview-inner",style:{background:r}},null)])])}});function Px(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ix=t.defineComponent({name:"SaturationPanel",props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Px(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Px(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Ax),setup:function(e){var n=Uk(),r=t.ref(null),o=t.ref(null),i=t.ref(null),a=t.reactive({width:230,height:168}),l=t.computed((function(){var t=e.color,n=t.saturation,r=t.value,o=a.width,i=a.height,l=Math.round((1-r)*i),s=Math.round(n*o);return{color:e.color.rgb,left:"".concat(s,"px"),top:"".concat(l,"px")}})),s=function(t,n){if(!e.disabled){var r=function(e){var t=a.width,n=a.height,r=e.x,o=e.y;return{saturation:Math.round(r/t*100),value:Math.round(100*(1-o/n))}}(t),o=r.saturation,i=r.value;e.onChange({saturation:o/100,value:i/100,addUsedColor:n})}},c=function(n){e.disabled||t.nextTick((function(){s(n,!0)}))},u=t.computed((function(){return"hsl(".concat(e.color.hue,", 100%, 50%)")}));return t.onMounted((function(){a.width=r.value.offsetWidth||230,a.height=r.value.offsetHeight||168,i.value=new Sx(r.value,{start:function(){a.width=r.value.offsetWidth,a.height=r.value.offsetHeight},drag:function(e){s(e)},end:c})})),t.onBeforeUnmount((function(){i.value.destroy()})),{baseClassName:n,refThumb:o,refPanel:r,styles:l,panelBackground:u}},render:function(){var e=this.baseClassName,n=this.styles,r=this.panelBackground;return t.createVNode("div",{class:["".concat(e,"__saturation")],ref:"refPanel",style:{background:r}},[t.createVNode("span",{class:["".concat(e,"__thumb")],role:"slider",tabindex:0,ref:"refThumb",style:n},null)])}});function Dx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dx(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Rx=t.defineComponent({name:"ColorSlider",props:Lx(Lx({},Ax),{},{className:{type:String,default:""},value:{type:Number,default:0},maxValue:{type:Number,default:360},railStyle:{type:Object},type:{type:String,default:"hue"}}),setup:function(e){var n=Uk(),r=t.ref(null),o=t.ref(null),i=t.ref(null),a=t.reactive({width:186}),l=t.computed((function(){var t=a.width;if(t){var n=Math.round(e.value/e.maxValue*t);return{left:"".concat(n,"px"),color:e.color.rgb}}})),s=function(t,n){if(!e.disabled){var r=a.width,o=t.x,i=Math.round(o/r*e.maxValue*100)/100;e.onChange(i,n)}},c=function(t){e.disabled||s(t,!0)};return t.onMounted((function(){a.width=r.value.offsetWidth||186,i.value=new Sx(r.value,{start:function(){a.width=r.value.offsetWidth},drag:function(e){s(e)},end:c})})),t.onBeforeUnmount((function(){i.value.destroy()})),{baseClassName:n,refThumb:o,refPanel:r,styles:l}},render:function(){var e=this.baseClassName,n=this.className,r=this.railStyle,o=this.styles,i=this.type,a=this.color,l={background:"linear-gradient(90deg, rgba(0,0,0,.0) 0%, rgba(0,0,0,.0) 93%, ".concat(a.rgb," 93%, ").concat(a.rgb," 100%)")};return t.createVNode("div",{class:["".concat(e,"__slider-wrapper"),"".concat(e,"__slider-wrapper--").concat(i,"-type")]},["alpha"===i&&t.createVNode("div",{className:"".concat(e,"__slider-padding"),style:l},null),t.createVNode("div",{class:["".concat(e,"__slider"),n],ref:"refPanel"},[t.createVNode("div",{class:"".concat(e,"__rail"),style:r},null),t.createVNode("span",{class:["".concat(e,"__thumb")],role:"slider",tabindex:0,ref:"refThumb",style:o},null)])])}});function zx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Fx=t.defineComponent({name:"HueSlider",inheritAttrs:!1,props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zx(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Ax),setup:function(){return{baseClassName:Uk()}},render:function(){return t.createVNode(Rx,{class:"".concat(this.baseClassName,"__hue"),color:this.color,value:this.color.hue,onChange:this.onChange,disabled:this.disabled,type:"hue"},null)}}),$x=t.defineComponent({name:"AlphaSlider",inheritAttrs:!1,props:{color:{type:Object},disabled:{type:Boolean,default:!1},onChange:{type:Function,default:function(){return function(){}}}},setup:function(e){return{baseClassName:Uk(),railStyle:t.computed((function(){return{background:"linear-gradient(to right, rgba(0, 0, 0, 0), ".concat(e.color.rgb,")")}})),handleChange:function(t,n){e.onChange(t/100,n)}}},render:function(){var e=this.baseClassName;return t.createVNode(Rx,{class:["".concat(e,"__alpha"),"".concat(e,"--bg-alpha")],color:this.color,value:100*this.color.alpha,onChange:this.handleChange,"rail-style":this.railStyle,"max-value":100,disabled:this.disabled,type:"alpha"},null)}});const Hx=g(rd((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})));var Ux={RGB:[{key:"r",min:0,max:255,type:"inputNumber"},{key:"g",min:0,max:255,type:"inputNumber"},{key:"b",min:0,max:255,type:"inputNumber"}],HSV:[{key:"h",min:0,max:360,type:"inputNumber"},{key:"s",min:0,max:100,type:"inputNumber"},{key:"v",min:0,max:100,type:"inputNumber"}],HSL:[{key:"h",min:0,max:360,type:"inputNumber"},{key:"s",min:0,max:100,type:"inputNumber"},{key:"l",min:0,max:100,type:"inputNumber"}],CMYK:[{key:"c",min:0,max:255,type:"inputNumber"},{key:"m",min:0,max:255,type:"inputNumber"},{key:"y",min:0,max:255,type:"inputNumber"},{key:"k",min:0,max:255,type:"inputNumber"}],CSS:[{key:"css",type:"input",flex:3}],HEX:[{key:"hex",type:"input",flex:3}]};function Wx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wx(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kx=t.defineComponent({name:"FormatInputs",inheritAttrs:!1,props:qx(qx({},Rk),{},{color:{type:Object},onInputChange:{type:Function,default:function(){return function(){}}}}),setup:function(e){var n=t.computed((function(){var t=p(Ux[e.format]);return e.enableAlpha&&t.push({type:"inputNumber",key:"a",min:0,max:100,format:function(e){return"".concat(e,"%")},flex:1.15}),t})),r=t.reactive({}),o=t.reactive({}),i=function(t){var n=e.color;return"encode"===t?{HSV:n.getHsva(),HSL:n.getHsla(),RGB:n.getRgba(),CMYK:n.getCmyk(),CSS:{css:n.css},HEX:{hex:n.hex}}:{HSV:vx.object2color(r,"HSV"),HSL:vx.object2color(r,"HSL"),RGB:vx.object2color(r,"RGB"),CMYK:vx.object2color(r,"CMYK"),CSS:r.css,HEX:r.hex}},a=function(){var t=e.format,n=e.color,a=i("encode")[t];a.a=Math.round(100*n.alpha),Object.keys(a).forEach((function(e){r[e]=a[e],o[e]=a[e]}))};a();var l=rk(a,100);t.watch((function(){var t=e.color;return[t.saturation,t.hue,t.value,t.alpha,t.css,e.format]}),l);return{modelValue:r,inputConfigs:n,handleChange:function(t,n){if(n!==o[t]){var a=i("decode")[e.format];e.onInputChange(a,r.a/100,t,n)}}}},render:function(){var e=this,n=qx({},this.inputProps||{});return t.createVNode("div",{class:"input-group"},[this.inputConfigs.map((function(r){return t.createVNode("div",{class:"input-group__item",key:r.key,style:{flex:r.flex||1}},["input"===r.type?t.createVNode(gg,t.mergeProps(n,{align:"center",size:"small",disabled:e.disabled,modelValue:e.modelValue[r.key],"onUpdate:modelValue":function(t){return e.modelValue[r.key]=t},maxlength:"HEX"===e.format?9:void 0,title:e.modelValue[r.key],onBlur:function(t){return e.handleChange(r.key,t)},onEnter:function(t){return e.handleChange(r.key,t)}}),null):t.createVNode($g,t.mergeProps(n,{align:"center",size:"small",disabled:e.disabled,modelValue:e.modelValue[r.key],"onUpdate:modelValue":function(t){return e.modelValue[r.key]=t},title:e.modelValue[r.key],min:r.min,max:r.max,step:1,format:r.format,theme:"normal",onBlur:function(t){return e.handleChange(r.key,t)},onEnter:function(t){return e.handleChange(r.key,t)}}),null)])}))])}});function Gx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gx(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Xx=t.defineComponent({name:"FormatPanel",inheritAttrs:!1,props:Yx(Yx({},Rk),{},{color:{type:Object},onModeChange:{type:Function,default:function(){return function(){}}},onInputChange:{type:Function,default:function(){return function(){}}}}),setup:function(e){var n=Uk(),r=t.ref(e.format);t.watch((function(){return[e.format]}),(function(){return r.value=e.format}));return{formatModel:r,baseClassName:n,handleModeChange:function(t){r.value=t,e.onModeChange(t)}}},render:function(){var e,n,r=this,o=p(Hk),i=this.baseClassName,a=this.handleModeChange,l=Yx(Yx({},this.$props),{},{format:this.formatModel}),s=Yx({},this.selectInputProps||{});return t.createVNode("div",{class:"".concat(i,"__format")},[t.createVNode("div",{class:"".concat(i,"__format--item")},[t.createVNode(mw,t.mergeProps({size:"small",class:"".concat(i,"__format-mode-select")},s,{popupProps:Yx({overlayClassName:"".concat(i,"__select-options")},s.popupProps),modelValue:r.formatModel,"onUpdate:modelValue":function(e){return r.formatModel=e},onChange:a}),(n=e=o.map((function(e){return t.createVNode(vw,{key:e,value:e,label:Hx(e),style:{fontSize:"12px"}},null)})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!t.isVNode(n)?e:{default:function(){return[e]}}))]),t.createVNode("div",{class:"".concat(i,"__format--item")},[t.createVNode(Kx,l,null)])])}});function Zx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zx(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qx=t.defineComponent({name:"SwatchesPanel",props:Jx(Jx({},Ax),{},{colors:{type:Array,default:function(){return[]}},title:{type:String,default:"系统色彩"},editable:{type:Boolean,default:!1},onSetColor:{type:Function,default:function(){return function(){}}},handleAddColor:{type:Function,default:function(){return function(){}}}}),setup:function(e){var n=Uk(),r=eh({DeleteIcon:Fp,AddIcon:Zd}),o=r.DeleteIcon,i=r.AddIcon,a=oc().STATUS.value,l=t.ref(!1),s=function(e){l.value=e},c=function(t){return vx.compare(t,e.color.css)},u=t.computed((function(){return e.colors.findIndex((function(e){return c(e)}))}));return{baseClassName:n,DeleteIcon:o,AddIcon:i,statusClassNames:a,selectedColorIndex:u,visiblePopConfirm:l,setVisiblePopConfirm:s,handleClick:function(t){return e.onSetColor(t)},isEqualCurrentColor:c,handleRemoveColor:function(){var t=p(e.colors),n=u.value;n>-1?t.splice(n,1):t.length=0,e.onChange(t),s(!1)}}},render:function(){var e=this,n=this.baseClassName,r=this.DeleteIcon,o=this.AddIcon,i=this.statusClassNames,a=this.title,l=this.editable,s="".concat(n,"__swatches");return t.createVNode("div",{class:s},[t.createVNode("h3",{class:"".concat(s,"--title")},[t.createVNode("span",null,[a]),l?t.createVNode("div",{class:"".concat(s,"--actions")},[t.createVNode("span",{role:"button",class:"".concat(n,"__icon"),onClick:function(){return e.handleAddColor()}},[t.createVNode(o,null,null)]),e.colors.length>0?t.createVNode("span",{role:"button",class:"".concat(n,"__icon"),onClick:function(){return e.handleRemoveColor()}},[t.createVNode(r,null,null)]):null]):null]),t.createVNode("ul",{class:["".concat(s,"--items"),"narrow-scrollbar"]},[this.colors.map((function(r){return t.createVNode("li",{class:["".concat(s,"--item"),e.isEqualCurrentColor(r)&&l?i.active:""],title:r,key:r,onClick:function(){e.disabled||e.handleClick(r)}},[t.createVNode("div",{class:["".concat(s,"--color"),"".concat(n,"--bg-alpha")]},[t.createVNode("span",{class:"".concat(s,"--inner"),style:{background:r}},null)])])}))])])}});function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nC=t.defineComponent({name:"ColorPanel",props:tC(tC({},Rk),{},{togglePopup:{type:Function}}),setup:function(e){var n,r=Uk(),o=oc().STATUS,i=tc("colorPicker"),a=i.t,l=i.globalConfig,s=o.value,c=t.toRefs(e),u=c.value,d=c.modelValue,p=c.recentColors,f=ll(Bm(u,d,e.defaultValue,e.onChange),2),h=f[0],m=f[1],v=t.computed((function(){return b.value?Fk:"#001F97"})),g=t.ref(1===(null===(n=e.colorModes)||void 0===n?void 0:n.length)?e.colorModes[0]:"monochrome"),b=t.computed((function(){return"linear-gradient"===g.value})),y=t.ref(new vx(h.value||v.value)),w=function(){return y.value.update(h.value||v.value)},k=t.ref(y.value.isGradient?"CSS":"RGB"),x=ll(Tm(p,e.defaultRecentColors,e.onRecentColorsChange,"recentColors"),2),C=x[0],O=x[1],S=function(){return"linear-gradient"===g.value?y.value.linearGradient:y.value.getFormatsColorMap()[e.format]||y.value.css},E=function(e){O(e)},N=function(e){m(S(),{color:bx(y.value),trigger:e||"palette-saturation-brightness"})};t.watch((function(){return[e.defaultValue,e.enableAlpha]}),w),t.watch((function(){return h.value}),(function(e){e!==S()&&(w(),g.value=y.value.isGradient?"linear-gradient":"monochrome")}));return{baseClassName:r,statusClassNames:s,t:a,globalConfig:l,color:y,mode:g,formatModel:k,recentlyUsedColors:C,isGradient:b,addRecentlyUsedColor:function(){if(null!==C.value&&!1!==C.value){var e=qs(C.value)||[],t=y.value.isGradient?y.value.linearGradient:y.value.rgba,n=e.indexOf(t);n>-1&&e.splice(n,1),e.unshift(t),e.length>100&&(e.length=100),E(e)}},handleModeChange:function(e){g.value=e,"linear-gradient"===e?y.value.update(y.value.gradientColors.length>0?y.value.linearGradient:Fk):y.value.update(y.value.rgba),N()},handleSatAndValueChange:function(e){var t=e.saturation,n=e.value,r=y.value,o=r.saturation,i=r.value,a="palette-saturation-brightness";if(n!==i&&t!==o)y.value.saturation=t,y.value.value=n,a="palette-saturation-brightness";else if(t!==o)y.value.saturation=t,a="palette-saturation";else{if(n===i)return;y.value.value=n,a="palette-brightness"}y.value.update(y.value.rgba),N(a)},handleHueChange:function(t){var n;y.value.hue=t,N("palette-hue-bar"),null===(n=e.onPaletteBarChange)||void 0===n||n.call(e,{color:bx(y.value)})},handleAlphaChange:function(e){y.value.alpha=e,N("palette-alpha-bar")},handleGradientChange:function(e){var t=e.key,n=e.payload,r="palette-saturation-brightness";switch(t){case"degree":y.value.gradientDegree=n,r="input";break;case"selectedId":y.value.gradientSelectedId=n;break;case"colors":y.value.gradientColors=n}N(r)},handleSetColor:function(t,n){vx.isGradientColor(n)?e.colorModes.includes("linear-gradient")?(g.value="linear-gradient",y.value.update(n),y.value.updateCurrentGradientColor()):console.warn("该模式不支持渐变色"):"linear-gradient"===g.value?(y.value.updateStates(n),y.value.updateCurrentGradientColor()):y.value.update(n),N()},handleFormatModeChange:function(e){return k.value=e},handleInputChange:function(e,t){y.value.update(e),y.value.alpha=t,N("input")},handleRecentlyUsedColorsChange:E}},render:function(){var e,n=this,r=this.t,o=this.baseClassName,i=this.statusClassNames,a=this.globalConfig,l=this.recentColors,s=this.swatchColors,c=this.showPrimaryColorPreview,u=this.isGradient,d={color:this.color,disabled:this.disabled},f=null!==l&&!1!==l,h=s;void 0===h&&(h=p($k));var m=(null===(e=h)||void 0===e?void 0:e.length)>0;return t.createVNode("div",{class:["".concat(o,"__panel"),!!this.disabled&&i.disabled]},[t.createVNode(ex,t.mergeProps(this.$props,{mode:this.mode,onModeChange:this.handleModeChange}),null),t.createVNode("div",{class:["".concat(o,"__body")]},[u?t.createVNode(Bx,t.mergeProps(d,{onChange:this.handleGradientChange,enableMultipleGradient:this.enableMultipleGradient}),null):null,t.createVNode(Ix,t.mergeProps(d,{onChange:this.handleSatAndValueChange}),null),t.createVNode("div",{class:["".concat(o,"__sliders-wrapper")]},[t.createVNode("div",{class:["".concat(o,"__sliders")]},[t.createVNode(Fx,t.mergeProps(d,{onChange:this.handleHueChange}),null),this.enableAlpha?t.createVNode($x,t.mergeProps(d,{onChange:this.handleAlphaChange}),null):null]),c?t.createVNode("div",{class:["".concat(o,"__sliders-preview"),"".concat(o,"--bg-alpha")]},[t.createVNode("span",{class:"".concat(o,"__sliders-preview-inner"),style:{background:u?this.color.linearGradient:this.color.rgba}},null)]):null]),t.createVNode(Xx,t.mergeProps(this.$props,{color:this.color,format:this.formatModel,onModeChange:this.handleFormatModeChange,onInputChange:this.handleInputChange}),null),m||f?t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"".concat(o,"__swatches-wrap")},[f?t.createVNode(Qx,t.mergeProps(d,{title:r(a.recentColorTitle),editable:!0,colors:n.recentlyUsedColors,handleAddColor:n.addRecentlyUsedColor,onSetColor:function(e){return n.handleSetColor("used",e)},onChange:n.handleRecentlyUsedColorsChange}),null):null,m?t.createVNode(Qx,t.mergeProps(d,{title:r(a.swatchColorTitle),colors:h,onSetColor:function(e){return n.handleSetColor("system",e)}}),null):null])]):null])])}}),rC=wo,oC=mi,iC=Jg,aC=Ul;const lC=g((function(e,t){if(null==e)return{};var n=rC(aC(e),(function(e){return[e]}));return t=oC(t),iC(e,n,(function(e,n){return t(e,n[0])}))}));function sC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uC=t.defineComponent({name:"TColorPickerPanel",inheritAttrs:!1,props:cC({},Rk),setup:function(e,n){var r=n.attrs,o=t.computed((function(){return lC(cC(cC({},e),r),(function(e){return void 0!==e}))})),i=rc();return function(){return t.createVNode(nC,t.mergeProps(o.value,{popupProps:null,"close-btn":!1,class:"".concat(i.value,"-is-inline")}),null)}}}),dC=t.defineComponent({name:"DefaultTrigger",inheritAttrs:!1,props:{color:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},inputProps:{type:Object,default:function(){return{autoWidth:!0}}},onTriggerChange:{type:Function,default:function(){return function(){}}},size:{type:String,default:"medium"}},setup:function(e){var n=Uk(),r=t.ref(e.color),o=oc().SIZE;t.watch((function(){return[e.color]}),(function(){return r.value=e.color}));return{baseClassName:n,value:r,handleChange:function(t){t!==e.color&&(t&&!vx.isValid(t)?r.value=e.color:r.value=t,e.onTriggerChange(r.value))},sizeClassNames:o}},render:function(){var e=this,n=this.baseClassName,r=this.sizeClassNames,o={label:function(){return t.createVNode("div",{class:["".concat(n,"__trigger--default__color"),"".concat(n,"--bg-alpha")]},[t.createVNode("span",{class:["color-inner",m({},r[e.size],"medium"!==e.size)],style:{background:e.value}},null)])}};return t.createVNode(gg,t.mergeProps({clearable:this.clearable,size:this.size,modelValue:e.value,"onUpdate:modelValue":function(t){return e.value=t},disabled:this.disabled,onBlur:this.handleChange},this.inputProps),o)}});function pC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hC=t.defineComponent({name:"TColorPicker",props:fC({},Rk),setup:function(e){var n=Uk(),r=t.ref(!1),o=function(e){return r.value=e},i=t.toRefs(e),a=ll(Bm(i.value,i.modelValue,e.defaultValue,e.onChange),2),l=a[0],s=a[1],c=t.ref();return{baseClassName:n,innerValue:l,visible:r,refTrigger:c,renderPopupContent:function(){if(e.disabled)return null;var n=fC({},e);return delete n.onChange,t.createVNode(nC,t.mergeProps(n,{disabled:e.disabled,value:l.value,togglePopup:o,onChange:function(e,t){return s(e,t)}}),null)},setVisible:o,setInnerValue:s}},render:function(){var e=this,n=this.popupProps,r=this.baseClassName,o=fC(fC({placement:"bottom-left"},n||{}),{},{trigger:"click",attach:"body",overlayClassName:[r],visible:this.visible,overlayInnerStyle:{padding:0},onVisibleChange:function(t,n){"document"===n.trigger&&e.setVisible(!1)}});return t.createVNode(Zm,t.mergeProps(o,{content:this.renderPopupContent}),{default:function(){return[t.createVNode("div",{class:"".concat(r,"__trigger"),onClick:function(){return e.setVisible(!e.visible)},ref:"refTrigger"},[(n=e,o="default",i=t.createVNode(dC,{color:e.innerValue,disabled:e.disabled,clearable:e.clearable,"input-props":e.inputProps,onTriggerChange:e.setInnerValue,size:e.size},null),a=ld(i),ud(n,o,i)||a)])];var n,o,i,a}})}}),mC=xd(uC);xd(hC);var vC={alt:{type:String,default:""},error:{type:[String,Function]},fallback:{type:String,default:""},fit:{type:String,default:"fill",validator:function(e){return!e||["contain","cover","fill","none","scale-down"].includes(e)}},gallery:Boolean,lazy:Boolean,loading:{type:[String,Function]},overlayContent:{type:[String,Function]},overlayTrigger:{type:String,default:"always",validator:function(e){return!e||["always","hover"].includes(e)}},placeholder:{type:[String,Function]},position:{type:String,default:"center"},referrerpolicy:{type:String,default:"strict-origin-when-cross-origin",validator:function(e){return!e||["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"].includes(e)}},shape:{type:String,default:"square",validator:function(e){return!e||["circle","round","square"].includes(e)}},src:{type:[String,Object]},srcset:{type:Object},onError:Function,onLoad:Function},gC=xd(t.defineComponent({name:"TImage",props:vC,setup:function(e){var n=t.ref(null),r=t.ref(null),o=null,i=t.toRefs(e).src,a=Vd();t.onMounted((function(){var t;if(null!==(t=r.value)&&void 0!==t&&t.complete&&!e.lazy&&v(),e.lazy&&n.value){var i=Ly(n.value,null,f,0);o=i}})),t.onUnmounted((function(){n.value&&o&&o.unobserve(n.value)}));var l=tc("image"),s=l.classPrefix,c=l.globalConfig,u=t.ref(i.value);t.watch([i,c],(function(t){var n=ll(t,2),r=n[0],o=(n[1]||{}).replaceImageSrc,i=R(o)?o(e):r;i===u.value&&u.value||(u.value=i)}),{immediate:!0});var d=Dm(u).previewUrl;t.watch([d],(function(){g.value=!1,h.value=!1}));var p=t.ref(!e.lazy),f=function(){p.value=!0},h=t.ref(!1),m=function(t){var n;h.value=!0,null===(n=e.onLoad)||void 0===n||n.call(e,{e:t})},v=function(){var e=new Event("load");Object.defineProperty(e,"target",{value:r.value,enumerable:!0}),m(e)},g=t.ref(!1),b=function(t){var n;g.value=!0,null===(n=e.onError)||void 0===n||n.call(e,{e:t}),e.fallback&&(u.value=e.fallback,g.value=!1)},y=t.computed((function(){return"hover"===e.overlayTrigger})),w=t.computed((function(){return["".concat(s.value,"-image"),"".concat(s.value,"-image--fit-").concat(e.fit),"".concat(s.value,"-image--position-").concat(e.position)]})),k=t.ref(!y.value),x=function(){y.value&&(k.value=!k.value)};function C(){var n="string"==typeof u.value?u.value:d.value;return t.createVNode("img",{ref:r,src:n,onError:b,onLoad:m,class:w.value,alt:e.alt,referrerpolicy:e.referrerpolicy},null)}var O=jd();return function(){return t.createVNode("div",t.mergeProps({ref:n,class:["".concat(s.value,"-image__wrapper"),"".concat(s.value,"-image__wrapper--shape-").concat(e.shape),e.gallery&&"".concat(s.value,"-image__wrapper--gallery"),y.value&&"".concat(s.value,"-image__wrapper--need-hover")],onMouseenter:x,onMouseleave:x},Sv(e,["src","alt","fit","position","shape","placeholder","loading","error","overlayTrigger","overlayContent","lazy","gallery","onLoad","onError"])),[(o=a("placeholder"),o?t.createVNode("div",{class:"".concat(s.value,"-image__placeholder")},[o]):null),e.gallery?t.createVNode("div",{class:"".concat(s.value,"-image__gallery-shadow")},null):null,(g.value||!p.value)&&t.createVNode("div",{class:"".concat(s.value,"-image")},null),!(g.value||!p.value)&&(e.srcset&&Object.keys(e.srcset).length?t.createVNode("picture",null,[Object.entries(e.srcset).map((function(e){var n=ll(e,2),r=n[0],o=n[1];return t.createVNode("source",{type:r,srcset:o},null)})),C()]):C()),!(g.value||!p.value)&&!h.value&&t.createVNode("div",{class:"".concat(s.value,"-image__loading")},[a("loading")||t.createVNode(Uf,{direction:"vertical",size:8,align:"center"},{default:function(){return[t.createVNode(sf,{size:"24px"},null),"string"==typeof e.loading?e.loading:c.value.loadingText]}})]),g.value&&t.createVNode("div",{class:"".concat(s.value,"-image__error")},[O("error",{defaultNode:t.createVNode(Uf,{direction:"vertical",size:8,align:"center"},{default:function(){return[t.createVNode(rf,{size:"24px"},null),"string"==typeof e.error?e.error:c.value.errorText]}})})]),(r=O("overlayContent"),r?t.createVNode("div",{class:["".concat(s.value,"-image__overlay-content"),!k.value&&"".concat(s.value,"-image__overlay-content--hidden")]},[r]):null)]);var r,o}}})),bC={closeBtn:{type:[Boolean,Function],default:!0},closeOnEscKeydown:{type:Boolean,default:!0},closeOnOverlay:Boolean,draggable:{type:Boolean,default:void 0},imageScale:{type:Object},images:{type:Array,default:function(){return[]}},index:{type:Number,default:void 0},defaultIndex:{type:Number,default:0},mode:{type:String,default:"modal",validator:function(e){return!e||["modal","modeless"].includes(e)}},navigationArrow:{type:[Boolean,Function],default:!0},showOverlay:{type:Boolean,default:void 0},title:{type:[String,Function]},trigger:{type:[String,Function]},viewerScale:{type:Object},visible:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultVisible:Boolean,zIndex:{type:Number},onClose:Function,onIndexChange:Function},yC=t.defineComponent({name:"TImageModalIcon",props:{disabled:Boolean,onClick:Function,label:String,icon:Function},setup:function(e){var n=rc(),r=Vd(),o=t.computed((function(){return["".concat(n.value,"-image-viewer__modal-icon"),m({},"".concat(n.value,"-is-disabled"),e.disabled)]}));return function(){return t.createVNode("div",{class:o.value,onClick:e.onClick},[r("icon"),e.label&&t.createVNode("span",{class:"".concat(n.value,"-image-viewer__modal-icon-label")},[e.label])])}}});function wC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var kC=function(e){return xe(e)?e.map((function(e){return!(t=e)||fl(t)||t instanceof File?{mainImage:e,thumbnail:e,download:!0}:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({download:!0,thumbnail:e.mainImage},e);var t})):[]},xC=t.defineComponent({name:"TImageViewerUtils",props:{scale:Number,onRotate:Function,onZoomIn:Function,onZoomOut:Function,onMirror:Function,onReset:Function,currentImage:{type:Object,default:function(){return{}}}},setup:function(e){var n=rc(),r=Dm(t.computed((function(){return e.currentImage.mainImage}))).previewUrl,o=tc("imageViewer").globalConfig;return function(){return t.createVNode("div",{class:"".concat(n.value,"-image-viewer__utils")},[t.createVNode("div",{class:"".concat(n.value,"-image-viewer__utils-content")},[t.createVNode(Mv,{overlayClassName:"".concat(n.value,"-image-viewer__utils--tip"),content:o.value.mirrorTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[t.createVNode(yC,{onClick:e.onMirror,icon:function(){return t.createVNode(vf,{size:"medium"},null)}},null)]}}),t.createVNode(Mv,{overlayClassName:"".concat(n.value,"-image-viewer__utils--tip"),content:o.value.rotateTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[t.createVNode(yC,{onClick:e.onRotate,icon:function(){return t.createVNode(Of,{size:"medium"},null)}},null)]}}),t.createVNode(yC,{icon:function(){return t.createVNode(Vf,{size:"medium"},null)},onClick:e.onZoomOut},null),t.createVNode(yC,{class:"".concat(n.value,"-image-viewer__utils-scale"),size:"medium",label:"".concat(Vg(String(100*e.scale)),"%")},null),t.createVNode(yC,{icon:function(){return t.createVNode(_f,{size:"medium"},null)},onClick:e.onZoomIn},null),t.createVNode(Mv,{overlayClassName:"".concat(n.value,"-image-viewer__utils--tip"),content:o.value.originalSizeTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[t.createVNode("div",{class:"".concat(n.value,"-image-viewer__modal-icon")},[t.createVNode(yC,{icon:function(){return t.createVNode(sf,{size:"medium"},null)},onClick:e.onReset},null)])]}}),e.currentImage.download&&t.createVNode(yC,{icon:function(){return t.createVNode(Wp,{size:"medium"},null)},onClick:function(){var e,t,n,o,i,a;e=r.value,i=new Image,a=(null==e||null===(t=e.split)||void 0===t||null===(t=t.call(e,"?"))||void 0===t||null===(t=t[0])||void 0===t||null===(n=t.split)||void 0===n||null===(n=n.call(t,"#"))||void 0===n||null===(n=n[0])||void 0===n||null===(o=n.split)||void 0===o?void 0:o.call(n,"/").pop())||Math.random().toString(32).slice(2),i.setAttribute("crossOrigin","anonymous"),i.onload=function(){var e=document.createElement("canvas");e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0,i.width,i.height),e.toBlob((function(e){var t=URL.createObjectURL(e),n=document.createElement("a");n.download=a,n.href=t,n.click(),n.remove(),URL.revokeObjectURL(t)}))},i.src=e}},null)])])}}});function CC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function OC(e){var n=t.ref(e);return{transform:n,mouseDownHandler:function(e){var t=e.pageX,r=e.pageY,o=n.value,i=o.translateX,a=o.translateY,l=function(e){var o=e.pageX,l=e.pageY;n.value={translateX:i+o-t,translateY:a+l-r}};document.addEventListener("mousemove",l),document.addEventListener("mouseup",(function e(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",e)}))},resetTransform:function(){n.value=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e)}}}var SC=t.defineComponent({name:"TImageItem",props:{rotate:Number,scale:Number,mirror:Number,src:[String,Object],placementSrc:[String,Object]},setup:function(e){var n=t.toRefs(e),r=n.src,o=n.placementSrc,i=rc(),a=t.ref(!1),l=t.ref(!1),s=OC({translateX:0,translateY:0}),c=s.transform,u=s.mouseDownHandler,d=tc("imageViewer").globalConfig.value.errorText,p=t.computed((function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:!e.placementSrc||l.value?"block":"none"}})),f=t.computed((function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:l.value?"none":"block"}})),h=t.computed((function(){var t=c.value,n=t.translateX,r=t.translateY;return{transform:"translate(".concat(n,"px, ").concat(r,"px) scale(").concat(e.mirror,", 1)")}})),m=Dm(r).previewUrl,v=Dm(o).previewUrl;return t.watch([m,v],(function(){a.value=!1,l.value=!1})),function(){return t.createVNode("div",{class:"".concat(i.value,"-image-viewer__modal-pic")},[t.createVNode("div",{class:"".concat(i.value,"-image-viewer__modal-box"),style:h.value},[a.value&&t.createVNode("div",{class:"".concat(i.value,"-image-viewer__img-error")},[t.createVNode("div",{class:"".concat(i.value,"-image-viewer__img-error-content")},[t.createVNode(rf,{size:"4em"},null),t.createVNode("div",{class:"".concat(i.value,"-image-viewer__img-error-text")},[d])])]),!a.value&&!!e.placementSrc&&v.value&&t.createVNode("img",{class:"".concat(i.value,"-image-viewer__modal-image"),onMousedown:function(e){e.stopPropagation(),u(e)},src:v.value,style:f.value,alt:"image",draggable:"false"},null),!a.value&&m.value&&t.createVNode("img",{class:"".concat(i.value,"-image-viewer__modal-image"),onMousedown:function(e){e.stopPropagation(),u(e)},src:m.value,onLoad:function(){return l.value=!0},onError:function(){return a.value=!0},style:p.value,alt:"image",draggable:"false"},null)])])}}}),EC={attach:{type:[String,Function]},body:{type:[String,Function]},cancelBtn:{type:[String,Object,Function]},closeBtn:{type:[String,Boolean,Function],default:!0},closeOnEscKeydown:{type:Boolean,default:void 0},closeOnOverlayClick:{type:Boolean,default:void 0},confirmBtn:{type:[String,Object,Function]},confirmLoading:{type:Boolean,default:void 0},confirmOnEnter:Boolean,default:{type:[String,Function]},destroyOnClose:Boolean,draggable:Boolean,footer:{type:[Boolean,Function],default:!0},header:{type:[String,Boolean,Function],default:!0},mode:{type:String,default:"modal",validator:function(e){return!e||["modal","modeless","normal","full-screen"].includes(e)}},placement:{type:String,default:"top",validator:function(e){return!e||["top","center"].includes(e)}},preventScrollThrough:{type:Boolean,default:!0},showInAttachedElement:Boolean,showOverlay:{type:Boolean,default:!0},theme:{type:String,default:"default",validator:function(e){return!e||["default","info","warning","danger","success"].includes(e)}},top:{type:[String,Number]},visible:Boolean,width:{type:[String,Number]},zIndex:{type:Number},onCancel:Function,onClose:Function,onCloseBtnClick:Function,onClosed:Function,onConfirm:Function,onEscKeydown:Function,onOpened:Function,onOverlayClick:Function};function NC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function MC(e){var n=t.getCurrentInstance(),r=Vd(),o=function(e,n){var r=n.defaultButtonProps,o=n.className,i=n.confirmLoading,a=r;return fl(e)?a.content=e:y(e)&&(a=_C(_C({},a),e)),void 0!==i&&(a.loading=i),t.createVNode(Fd,t.mergeProps({class:o},a),null)};return{getConfirmBtn:function(i){var a=i.confirmBtn,l=i.className,s=i.confirmLoading;if(null===a)return null;a&&n.slots.confirmBtn&&console.warn("Both $props.confirmBtn and $scopedSlots.confirmBtn exist, $props.confirmBtn is preferred.");var c=function(t){var n,r=t.globalConfirm,o=t.theme,i=t.globalConfirmBtnTheme,a={theme:(null===(n=Sv(i,["info"]))||void 0===n?void 0:n[o])||"primary",size:t.size,onClick:function(t){e.confirmBtnAction(t)}};return fl(r)?a.content=r:y(r)&&(a=_C(_C({},a),r)),a}(i);return a||n.slots.confirmBtn?a&&["string","object"].includes(f(a))?o(a,{defaultButtonProps:c,className:l,confirmLoading:s}):r("confirmBtn"):t.createVNode(Fd,t.mergeProps({class:l,loading:s},c),null)},getCancelBtn:function(i){var a=i.cancelBtn,l=i.className;if(null===a)return null;a&&n.slots.cancelBtn&&console.warn("Both $props.cancelBtn and $scopedSlots.cancelBtn exist, $props.cancelBtn is preferred.");var s=function(t){var n=t.globalCancel,r={theme:"default",size:t.size,onClick:function(t){e.cancelBtnAction(t)}};return fl(n)?r.content=n:y(n)&&(r=_C(_C({},r),n)),r}(i);return a||n.slots.cancelBtn?a&&["string","object"].includes(f(a))?o(a,{defaultButtonProps:s}):r("cancelBtn"):t.createVNode(Fd,t.mergeProps({class:l},s),null)}}}function AC(){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}var TC,VC=new(Jv((function e(){var t=this;Xv(this,e),m(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set}),m(this,"getNextZIndex",(function(e){return("message"===e?Array.from(t.popupStack.message).pop()||5e3:Array.from(t.popupStack.popup).pop()||1e3)+1})),m(this,"add",(function(e){var n=t.getNextZIndex(e);return t.popupStack[e].add(n),"dialog"===e&&t.popupStack.popup.add(n),n})),m(this,"delete",(function(e,n){t.popupStack[n].delete(e),"dialog"===n&&t.popupStack.popup.delete(e)})),m(this,"isLastDialog",(function(e){return!(t.popupStack.dialog.size>1)||e===Array.from(t.popupStack.dialog).pop()}))})));function jC(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.visible,o=n.runOnMounted,i=t.ref(0),a=function(){i.value=VC.add(e)},l=function(){VC.delete(i.value,e)};return t.watch((function(){return null==r?void 0:r.value}),(function(e){e?a():l()}),{immediate:!0}),o&&(t.onMounted((function(){a()})),t.onBeforeUnmount((function(){l()}))),{zIndex:t.readonly(i),open:a,close:l,isLastDialog:function(){return"dialog"===e&&VC.isLastDialog(i.value)}}}function BC(e){return Number.isNaN(Number(e))?e:"".concat(Number(e),"px")}"undefined"!=typeof window&&window.document&&window.document.documentElement&&document.documentElement.addEventListener("click",(function(e){TC={x:e.clientX,y:e.clientY},setTimeout((function(){TC=null}),100)}),!0);var PC=1,IC=xd(t.defineComponent({name:"TDialog",directives:{draggable:function(e,t){var n,r,o;e&&t&&t.value&&(n=e,r=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight,n.addEventListener("mousedown",(function(e){var t=e.clientX-n.offsetLeft,i=e.clientY-n.offsetTop,a=n.offsetWidth,l=n.offsetHeight;function s(e){var a=e.clientX-t,l=e.clientY-i;a<0&&(a=0),l<0&&(l=0),r-n.offsetWidth-a<0&&(a=r-n.offsetWidth),o-n.offsetHeight-l<0&&(l=o-n.offsetHeight),n.style.position="absolute",n.style.left="".concat(a,"px"),n.style.top="".concat(l,"px")}function c(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c)}a>r||l>o||(document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),document.addEventListener("dragend",c))})))}},inheritAttrs:!1,props:EC,emits:["update:visible"],setup:function(e,n){var r,o=this,i=rc("dialog"),a=rc(),l=Bd(),s=Vd(),c=t.ref(null),u=tc("dialog").globalConfig,d=eh({CloseIcon:Dp,InfoCircleFilledIcon:pf,CheckCircleFilledIcon:fp,ErrorCircleFilledIcon:Yp}),p=d.CloseIcon,f=d.InfoCircleFilledIcon,h=d.CheckCircleFilledIcon,m=d.ErrorCircleFilledIcon,v=MC({confirmBtnAction:function(t){var n;null===(n=e.onConfirm)||void 0===n||n.call(e,{e:t})},cancelBtnAction:function(t){var n;null===(n=e.onCancel)||void 0===n||n.call(e,{e:t}),q({e:t,trigger:"cancel"})}}),g=v.getConfirmBtn,b=v.getCancelBtn,y=pd((function(){return e.attach}));r=t.ref(0),t.provide("t-display-none-element-refresh",r),t.onUpdated((function(){r.value+=1}));var w=t.ref(),k=t.ref(),x=t.computed((function(){return"modal"===e.mode})),C=t.computed((function(){return"modeless"===e.mode})),O=t.computed((function(){return"normal"===e.mode})),S=t.computed((function(){return"full-screen"===e.mode})),E=t.computed((function(){return e.visible})),N=t.computed((function(){return["".concat(i.value,"__mask"),!e.showOverlay&&"".concat(a.value,"-is-hidden")]})),_=t.computed((function(){return O.value?[]:S.value?["".concat(i.value,"__position_fullscreen")]:["".concat(i.value,"__position"),!!e.top&&"".concat(i.value,"--top"),"".concat(e.placement&&!e.top?"".concat(i.value,"--").concat(e.placement):"")]})),M=t.computed((function(){return[!O.value&&"".concat(i.value,"__wrap")]})),A=t.computed((function(){if(S.value)return{};var t=e.top,n={};void 0!==t&&(n={paddingTop:BC(t)});return n})),T=t.computed((function(){var t=["".concat(i.value),"".concat(i.value,"__modal-").concat(e.theme),C.value&&e.draggable&&"".concat(i.value,"--draggable")];return S.value?t.push("".concat(i.value,"__fullscreen")):t.push.apply(t,["".concat(i.value,"--default"),"".concat(i.value,"--").concat(e.placement)]),t})),V=t.computed((function(){return S.value?{}:{width:BC(e.width)}})),j=jC("dialog",{visible:E}).isLastDialog;function B(){var e,t;null===(e=k.value.parentNode)||void 0===e||null===(t=e.removeChild)||void 0===t||t.call(e,k.value)}t.watch((function(){return e.visible}),(function(n){var r;n?((x.value&&!e.showInAttachedElement||S.value)&&(e.preventScrollThrough&&document.body.appendChild(k.value),t.nextTick((function(){TC&&c.value&&(c.value.style.transformOrigin="".concat(TC.x-c.value.offsetLeft,"px ").concat(TC.y-c.value.offsetTop,"px"))}))),null===(r=document.activeElement)||void 0===r||r.blur()):(clearTimeout(w.value),w.value=setTimeout((function(){B()}),150));L(n)}));var P,I,D,L=function(t){t?(document.addEventListener("keydown",z),e.confirmOnEnter&&document.addEventListener("keydown",R)):(document.removeEventListener("keydown",z),e.confirmOnEnter&&document.removeEventListener("keydown",R))},R=function(t){if("input"!==t.target.tagName.toLowerCase()){var n,r=t.code;if(("Enter"===r||"NumpadEnter"===r)&&j())null===(n=e.onConfirm)||void 0===n||n.call(e,{e:t})}},z=function(t){var n,r;"Escape"===t.code&&j()&&(null===(n=e.onEscKeydown)||void 0===n||n.call(e,{e:t}),(null!==(r=e.closeOnEscKeydown)&&void 0!==r?r:u.value.closeOnEscKeydown)&&q({e:t,trigger:"esc"}))},F=(P=function(t){var n,r;e.showOverlay&&(null!==(n=e.closeOnOverlayClick)&&void 0!==n?n:u.value.closeOnOverlayClick)&&(null===(r=e.onOverlayClick)||void 0===r||r.call(e,{e:t}),q({e:t,trigger:"overlay"}))},I=!1,D=!1,{onClick:function(e){I&&D&&P(e),I=!1,D=!1},onMousedown:function(e){I=e.target===e.currentTarget},onMouseup:function(e){D=e.target===e.currentTarget}}),$=F.onClick,H=F.onMousedown,U=F.onMouseup,W=function(t){var n;null===(n=e.onCloseBtnClick)||void 0===n||n.call(e,{e:t}),q({trigger:"close-btn",e:t})},q=function(t){var r;null===(r=e.onClose)||void 0===r||r.call(e,t),n.emit("update:visible",!1)};return t.onMounted((function(){var e=document.documentElement.scrollHeight>document.documentElement.clientHeight?AC():0;k.value=document.createElement("style"),k.value.dataset.id="td_dialog_".concat(+new Date,"_").concat(PC+=1),k.value.innerHTML="\n html body {\n overflow-y: hidden;\n width: calc(100% - ".concat(e,"px);\n }\n ")})),t.onBeforeUnmount((function(){L(!1),B()})),{COMPONENT_NAME:i,isModal:x,isModeLess:C,isFullScreen:S,maskClass:N,dialogClass:T,dialogStyle:V,dialogEle:c,afterEnter:function(){var t;null===(t=e.onOpened)||void 0===t||t.call(e)},afterLeave:function(){var t;C.value&&e.draggable&&c.value&&(c.value.style.position="relative",c.value.style.left="unset",c.value.style.top="unset"),null===(t=e.onClosed)||void 0===t||t.call(e)},hasEventOn:function(e){var t,n=null===(t=o._events)||void 0===t?void 0:t[e];return!(null==n||!n.length)},renderDialog:function(){var n=t.createVNode("h5",{class:"title"},null),r=t.createVNode(p,null,null),o=l("default","body"),d=t.createVNode("div",null,[b({cancelBtn:e.cancelBtn,globalCancel:u.value.cancel,className:"".concat(i.value,"__cancel")}),g({theme:e.theme,confirmBtn:e.confirmBtn,globalConfirm:u.value.confirm,globalConfirmBtnTheme:u.value.confirmBtnTheme,className:"".concat(i.value,"__confirm"),confirmLoading:e.confirmLoading})]),v=S.value?["".concat(i.value,"__header"),"".concat(i.value,"__header--fullscreen")]:"".concat(i.value,"__header"),y=S.value?["".concat(i.value,"__close"),"".concat(i.value,"__close--fullscreen")]:"".concat(i.value,"__close"),w="default"===e.theme?["".concat(i.value,"__body")]:["".concat(i.value,"__body__icon")],k=s("footer",d);S.value&&k?w.push("".concat(i.value,"__body--fullscreen")):S.value&&w.push("".concat(i.value,"__body--fullscreen--without-footer"));var x=S.value?["".concat(i.value,"__footer"),"".concat(i.value,"__footer--fullscreen")]:"".concat(i.value,"__footer"),O=function(t){C.value&&e.draggable&&t.stopPropagation()};return t.createVNode("div",{class:M.value},[t.createVNode("div",{class:_.value,style:A.value,onClick:$,onMousedown:H,onMouseup:U},[t.withDirectives(t.createVNode("div",{key:"dialog",class:T.value,style:V.value,ref:c},[t.createVNode("div",{class:v,onMousedown:O},[t.createVNode("div",{class:"".concat(i.value,"__header-content")},[{info:t.createVNode(f,{class:"".concat(a.value,"-is-info")},null),warning:t.createVNode(m,{class:"".concat(a.value,"-is-warning")},null),danger:t.createVNode(m,{class:"".concat(a.value,"-is-error")},null),success:t.createVNode(h,{class:"".concat(a.value,"-is-success")},null)}[e.theme],s("header",n)]),e.closeBtn?t.createVNode("span",{class:y,onClick:W},[s("closeBtn",r)]):null]),t.createVNode("div",{class:w,onMousedown:O},[o]),k&&t.createVNode("div",{class:x,onMousedown:O},[k])]),[[t.resolveDirective("draggable"),C.value&&e.draggable]])])])},teleportElement:y}},render:function(){var e=this,n=this.COMPONENT_NAME,r=[(this.isModal||this.isFullScreen)&&t.createVNode("div",{key:"mask",class:this.maskClass},null),this.renderDialog()],o={zIndex:this.zIndex},i=["".concat(n,"__ctx"),m(m(m({},"".concat(n,"__ctx--fixed"),this.isModal||this.isFullScreen),"".concat(n,"__ctx--absolute"),this.isModal&&this.showInAttachedElement),"".concat(n,"__ctx--modeless"),this.isModeLess)];return t.createVNode(t.Teleport,{disabled:!this.attach||!this.teleportElement,to:this.teleportElement},{default:function(){return[t.createVNode(t.Transition,{duration:300,name:"".concat(n,"-zoom__vue"),onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:function(){return[(!e.destroyOnClose||e.visible)&&t.withDirectives(t.createVNode("div",t.mergeProps({class:i,style:o},e.$attrs),[r]),[[t.vShow,e.visible]])]}})]}})}})),DC=t.defineComponent({name:"TImageViewerModal",props:{zIndex:Number,visible:Boolean,index:Number,images:bC.images,scale:Number,rotate:Number,mirror:Number,title:bC.title,currentImage:{type:Object,default:function(){return{}}},onRotate:Function,onZoomIn:Function,onZoomOut:Function,onMirror:Function,onReset:Function,onClose:bC.onClose,draggable:{type:Boolean,default:!0},viewerScale:{type:Object,default:function(){return{}}},showOverlay:Boolean,closeBtn:bC.closeBtn},setup:function(e){var n=rc(),r=Vd(),o=t.computed((function(){return{minWidth:e.viewerScale.minWidth,minHeight:e.viewerScale.minHeight}}));return function(){return t.createVNode(IC,{destroyOnClose:!0,attach:"body",onClose:e.onClose,visible:e.visible,placement:"center",mode:"modeless",width:1e3,cancelBtn:null,confirmBtn:null,draggable:e.draggable,zIndex:e.zIndex,showOverlay:e.showOverlay,class:"".concat(n.value,"-image-viewer__dialog"),header:r("title",""),footer:function(){return t.createVNode("div",{class:"".concat(n.value,"-image-viewer-mini__footer")},[t.createVNode(xC,{onZoomIn:e.onZoomIn,onZoomOut:e.onZoomOut,scale:e.scale,currentImage:e.currentImage,onRotate:e.onRotate,onMirror:e.onMirror,onReset:e.onReset},null)])}},{default:function(){return[t.createVNode("div",{class:"".concat(n.value,"-image-viewer-mini__content"),style:o.value},[t.createVNode(SC,{rotate:e.rotate,scale:e.scale,mirror:e.mirror,src:e.currentImage.mainImage,placementSrc:e.currentImage.thumbnail},null)])]}})}}}),LC=function(e){return e.left="ArrowLeft",e.up="ArrowUp",e.right="ArrowRight",e.down="ArrowDown",e.esc="Escape",e}(LC||{});function RC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var zC=t.defineComponent({name:"TImageViewer",props:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},bC),setup:function(e){var n,r=rc(),o=rc("image-viewer"),i=Vd(),a=t.ref(!0),l=t.computed((function(){return function(e){return void 0!==e.showOverlay?e.showOverlay:"modal"===e.mode}(e)})),s=t.toRefs(e),c=s.index,u=s.visible,d=s.modelValue,p=ll(Tm(c,null!==(n=e.defaultIndex)&&void 0!==n?n:0,e.onIndexChange,"index"),2),f=p[0],h=p[1],v=ll(Bm(u,d,e.defaultVisible,(function(){}),"visible"),2),g=v[0],b=v[1],y=t.ref(!0),w=t.ref(),k=t.computed((function(){return[o.value,"".concat(o.value,"-preview-image"),m({},"".concat(r.value,"-is-hide"),!g.value)]})),x=t.computed((function(){return["".concat(r.value,"-image-viewer__modal-header"),m({},"".concat(r.value,"-is-show"),a.value)]})),C=t.computed((function(){var t;return null!==(t=e.zIndex)&&void 0!==t?t:2600})),O=function(){a.value=!a.value},S=function(){var e=t.ref(1);return{mirror:e,onMirror:function(){e.value*=-1},resetMirror:function(){e.value=1}}}(),E=S.mirror,N=S.onMirror,_=S.resetMirror,M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{max:2,min:.5,step:.5},n=e.max,r=e.min,o=e.step,i=e.defaultScale,a=t.ref(null!=i?i:1),l=function(){a.value=null!=i?i:1},s=function(e){var t=e;e<r&&(t=r),e>n&&(t=n),a.value=t};return t.watch((function(){return e}),(function(){return l()})),{scale:a,onZoomIn:function(){var e=jg(a.value,o);s(e)},onZoomOut:function(){var e=Bg(a.value,o);s(e)},resetScale:l}}(e.imageScale),A=M.scale,T=M.onZoomIn,V=M.onZoomOut,j=M.resetScale,B=function(){var e=t.ref(0);return{rotate:e,onRotate:function(){e.value+=90},resetRotate:function(){e.value=0}}}(),P=B.rotate,I=B.onRotate,D=B.resetRotate,L=function(){_(),j(),D()},R=t.computed((function(){return kC(e.images)})),z=t.computed((function(){var e;return null!==(e=R.value[f.value])&&void 0!==e?e:{mainImage:""}})),F=jC("dialog",{visible:g}).isLastDialog,$=function(){var e=f.value-1;L(),h(e<0?0:e,{trigger:"prev"})},H=function(){var e=f.value+1;L(),h(e>=R.value.length?f.value:e,{trigger:"next"})},U=function(){b(!0)},W=function(t){var n;b(!1),null===(n=e.onClose)||void 0===n||n.call(e,t)},q=function(e){W({e:e,trigger:"close-btn"})},K=function(t){e.closeOnOverlay&&W({e:t,trigger:"overlay"})},G=function(t){switch(t.stopPropagation(),t.code){case LC.left:$();break;case LC.right:H();break;case LC.up:T();break;case LC.down:V();break;case LC.esc:e.closeOnEscKeydown&&F()&&W({e:t,trigger:"esc"})}},Y=t.ref();t.watch((function(){return g.value}),(function(e){clearTimeout(w.value),e?(y.value=!1,t.nextTick().then((function(){var e,t;null===(e=Y.value)||void 0===e||null===(t=e.focus)||void 0===t||t.call(e)})),L()):w.value=setTimeout((function(){y.value=!0}),200)}));var X=function(e){e.preventDefault(),e.deltaY>0?V():T()},Z=t.computed((function(){return{transform:"translateX(calc(-".concat(f.value," * (40px / 9 * 16 + 4px)))")}})),J=function(){return t.createVNode("div",{class:x.value},[t.createVNode(yC,{icon:function(){return t.createVNode(gp,null,null)},class:"".concat(o.value,"__header-pre-bt"),onClick:O},null),t.createVNode("div",{class:"".concat(o.value,"__header-prev")},[t.createVNode("div",{class:"".concat(o.value,"__header-trans"),style:Z.value},[R.value.map((function(e,n){return t.createVNode("div",{key:n,class:["".concat(o.value,"__header-box"),m({},"".concat(r.value,"-is-active"),n===f.value)]},[t.createVNode(gC,{src:e.thumbnail||e.mainImage,error:"",className:"".concat(o.value,"__header-img"),onClick:function(){h(n,{trigger:"current"})}},null)])}))])])])},Q=function(e){var n="prev"===e?0:180,r=i("navigationArrow",t.createVNode(kp,{style:{transform:"rotate(".concat(n,"deg)")},size:"24px"},null));return t.createVNode(yC,{class:"".concat(o.value,"__modal-").concat(e,"-bt"),onClick:"prev"===e?$:H,icon:function(){return r}},null)},ee=function(){if(!1!==e.closeBtn)return t.createVNode("div",{class:["".concat(o.value,"__modal-icon"),"".concat(o.value,"__modal-close-bt")],onClick:q},[i("closeBtn",t.createVNode(Dp,{size:"24px"},null))])};return function(){return"modeless"===e.mode?t.createVNode(t.Fragment,null,[i("trigger",{params:{open:U}}),t.createVNode(DC,{zIndex:C.value,visible:g.value,index:f.value,images:R.value,scale:A.value,rotate:P.value,mirror:E.value,currentImage:z.value,onRotate:I,onZoomIn:T,onZoomOut:V,onMirror:N,onReset:L,onClose:W,draggable:e.draggable,showOverlay:l.value,title:e.title},null)]):t.createVNode(t.Fragment,null,[i("trigger",{params:{open:U}}),t.createVNode(t.Teleport,{to:"body"},{default:function(){return[t.createVNode(t.Transition,null,{default:function(){return[(g.value||!y.value)&&t.withDirectives(t.createVNode("div",{ref:Y,class:k.value,style:{zIndex:C.value},onWheel:X,tabindex:-1,onKeydown:G},[!!l.value&&t.createVNode("div",{class:"".concat(o.value,"__modal-mask"),onClick:K},null),R.value.length>1&&t.createVNode(t.Fragment,null,[J(),t.createVNode("div",{class:"".concat(o.value,"__modal-index")},[e.title&&i("title"),"".concat(f.value+1,"/").concat(R.value.length)]),Q("prev"),Q("next")]),ee(),t.createVNode(xC,{onZoomIn:T,onZoomOut:V,onMirror:N,onReset:L,onRotate:I,scale:A.value,currentImage:z.value},null),t.createVNode(SC,{scale:A.value,rotate:P.value,mirror:E.value,src:z.value.mainImage,placementSrc:z.value.thumbnail},null)]),[[t.vShow,g.value]])]}})]}})])}}}),FC=xd(zC),$C={alpha:{type:Number,default:1},content:{type:[String,Function]},default:{type:[String,Function]},height:{type:Number},isRepeat:{type:Boolean,default:!0},lineSpace:{type:Number,default:16},movable:Boolean,moveInterval:{type:Number,default:3e3},offset:{type:Array},removable:{type:Boolean,default:!0},rotate:{type:Number,default:-22},watermarkContent:{type:[Object,Array]},width:{type:Number},x:{type:Number},y:{type:Number},zIndex:{type:Number}};function HC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function UC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HC(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var WC=xd(t.defineComponent({name:"TWatermark",props:$C,setup:function(e){var n=t.ref(""),r=t.ref(),o=t.ref(),i=t.ref(),a=t.reactive(e.offset||[]),l=t.computed((function(){return e.movable?0:e.x})),s=t.computed((function(){return e.movable?0:e.y})),c=t.computed((function(){return e.movable?0:e.rotate})),u=t.computed((function(){return e.movable?"no-repeat":e.isRepeat?"repeat":"no-repeat"})),d=t.computed((function(){return a[0]||l.value/2})),p=t.computed((function(){return a[1]||s.value/2})),f=t.computed((function(){return{width:e.width,height:e.height,rotate:c.value,lineSpace:e.lineSpace,alpha:e.alpha,gapX:l.value,gapY:s.value,watermarkContent:e.watermarkContent,offsetLeft:d.value,offsetTop:p.value}})),h=function(){!function(e,t){var n=e.width,r=e.height,o=e.gapX,i=e.gapY,a=e.offsetLeft,l=e.offsetTop,s=e.rotate,c=e.alpha,u=e.watermarkContent,d=e.lineSpace,p=document.createElement("canvas"),f=p.getContext("2d");if(!f)return console.warn("当前环境不支持Canvas, 无法绘制水印"),void t("");var h=window.devicePixelRatio||1,m=(o+n)*h,v=(i+r)*h;p.width=m,p.height=v,p.style.width="".concat(o+n,"px"),p.style.height="".concat(i+r,"px"),f.translate(a*h,l*h),f.rotate(Math.PI/180*Number(s)),f.globalAlpha=c;var g=n*h,b=r*h;f.fillStyle="transparent",f.fillRect(0,0,g,b);var y=Array.isArray(u)?u:[UC({},u)],w=0;y.forEach((function(e){if(e.url){var o=e.url,i=e.isGrayscale,a=void 0!==i&&i;e.top=w,w+=r;var l=new Image;l.crossOrigin="anonymous",l.referrerPolicy="no-referrer",l.src=o,l.onload=function(){if(f.drawImage(l,0,e.top*h,n*h,r*h),a){for(var o=f.getImageData(0,0,f.canvas.width,f.canvas.height),i=o.data,s=0;s<i.length;s+=4){var c=(i[s]+i[s+1]+i[s+2])/3;i[s]=c,i[s+1]=c,i[s+2]=c}f.putImageData(o,0,0)}t(p.toDataURL())}}else if(e.text){var s=e.text,c=e.fontColor,u=void 0===c?"rgba(0, 0, 0, 0.1)":c,m=e.fontSize,v=void 0===m?16:m,g=e.fontFamily,y=void 0===g?void 0:g,k=e.fontWeight,x=void 0===k?"normal":k;e.top=w,w+=d;var C=Number(v)*h;f.font="normal normal ".concat(x," ").concat(C,"px/").concat(b,"px ").concat(y),f.textAlign="start",f.textBaseline="top",f.fillStyle=u,f.fillText(s,0,e.top*h)}})),t(p.toDataURL())}(f.value,(function(e){n.value=e}));var e,t,r,o,i,a=(e=Math.floor(4*Math.random()),t=Math.floor(70*Math.random())+30,"\n @keyframes watermark {\n 0% {left: ".concat(1===e?90:3===e?0:t,"%; top: ").concat(0===e?0:2===e?95:t,"%;}\n 25% {left: ").concat(0===e?90:2===e?0:100-t,"%; top: ").concat(1===e?95:3===e?0:t,"%;}\n 50% {left: ").concat(1===e?0:3===e?90:100-t,"%; top: ").concat(0===e?95:2===e?0:100-t,"%; transform: translateX(-100%);}\n 75% {left: ").concat(0===e?0:2===e?90:t,"%; top: ").concat(1===e?0:3===e?95:100-t,"%;}\n 100% {left: ").concat(1===e?90:3===e?0:t,"%; top: ").concat(0===e?0:2===e?95:t,"%;}\n }\n "));r=a,o=document.createElement("style"),i=null,document.head.appendChild(o),(i=o.sheet).insertRule(r,i.cssRules.length)};return t.onMounted((function(){h(),i.value=r.value.parentElement,lk(i.value,(function(t){e.removable||t.forEach((function(e){"childList"===e.type&&e.removedNodes.forEach((function(e){var t=e;t===r.value&&i.value.appendChild(t),t===o.value&&r.value.appendChild(t)}))}))}),{attributes:!0,childList:!0,characterData:!0,subtree:!0})})),t.watch((function(){return e.watermarkContent}),h,{deep:!0}),{gapX:l,gapY:s,backgroundRepeat:u,backgroundImage:n,watermarkRef:r,watermarkContentRef:o,bgImageOptions:f}},render:function(){var e=rc("watermark"),n=Bd();return t.createVNode("div",{style:{position:"relative",overflow:"hidden",width:"100%"},class:e.value,ref:"watermarkRef"},[n("default","content"),t.createVNode("div",{ref:"watermarkContentRef",style:{zIndex:this.zIndex,position:"absolute",left:0,right:0,top:0,bottom:0,width:"100%",height:"100%",backgroundSize:"".concat(this.gapX+this.width,"px"),pointerEvents:"none",backgroundRepeat:this.backgroundRepeat,backgroundImage:"url('".concat(this.backgroundImage,"')"),animation:this.movable?"watermark infinite ".concat(4*this.moveInterval/60,"s"):"none"}},null)])}})),qC={attach:{type:[String,Function],default:""},body:{type:[String,Function]},cancelBtn:{type:[String,Object,Function],default:""},closeBtn:{type:[Boolean,String,Function]},closeOnEscKeydown:{type:Boolean,default:void 0},closeOnOverlayClick:{type:Boolean,default:void 0},confirmBtn:{type:[String,Object,Function],default:""},default:{type:[String,Function]},destroyOnClose:Boolean,footer:{type:[Boolean,Function],default:!0},header:{type:[String,Boolean,Function],default:!0},mode:{type:String,default:"overlay",validator:function(e){return!e||["overlay","push"].includes(e)}},placement:{type:String,default:"right",validator:function(e){return!e||["left","right","top","bottom"].includes(e)}},preventScrollThrough:{type:Boolean,default:!0},showInAttachedElement:Boolean,showOverlay:{type:Boolean,default:!0},size:{type:String,default:void 0},sizeDraggable:Boolean,visible:Boolean,zIndex:{type:Number},onCancel:Function,onClose:Function,onCloseBtnClick:Function,onConfirm:Function,onEscKeydown:Function,onOverlayClick:Function},KC=1,GC=xd(t.defineComponent({name:"TDrawer",inheritAttrs:!1,props:qC,emits:["update:visible"],setup:function(e,n){var r=t.ref(!1),o=t.ref(!1),i=t.ref(),a=t.ref(),l=tc("drawer").globalConfig,s=eh({CloseIcon:Dp}).CloseIcon,c=Vd(),u=Bd(),d=rc("drawer"),p=function(e){var n=t.ref(!1),r=t.ref(null),o=function e(){document.removeEventListener("mouseup",e,!0),document.removeEventListener("mousemove",i,!0),n.value=!1},i=function(t){var o=t.x,i=t.y,a=document.documentElement.clientHeight,l=document.documentElement.clientWidth;if(n.value&&e.sizeDraggable){if("right"===e.placement){var s=Math.min(Math.max(l-o+8,8),l);r.value="".concat(s,"px")}if("left"===e.placement){var c=Math.min(Math.max(o+8,8),l);r.value="".concat(c,"px")}if("top"===e.placement){var u=Math.min(Math.max(i+8,8),a);r.value="".concat(u,"px")}if("bottom"===e.placement){var d=Math.min(Math.max(a-i+8,8),a);r.value="".concat(d,"px")}}},a=t.computed((function(){var t=["right","left"].includes(e.placement);return m(m(m(m({zIndex:1,position:"absolute",background:"transparent"},{left:"right",right:"left",top:"bottom",bottom:"top"}[e.placement],0),"width",t?"16px":"100%"),"height",t?"100%":"16px"),"cursor",t?"col-resize":"row-resize")}));return{draggedSizeValue:r,enableDrag:function(){document.addEventListener("mouseup",o,!0),document.addEventListener("mousemove",i,!0),n.value=!0},draggableLineStyles:a}}(e),f=p.draggedSizeValue,h=p.enableDrag,v=p.draggableLineStyles,g=pd((function(){return e.attach})),b=MC({confirmBtnAction:function(t){var n;null===(n=e.onConfirm)||void 0===n||n.call(e,{e:t})},cancelBtnAction:function(t){var n;null===(n=e.onCancel)||void 0===n||n.call(e,{e:t}),j({trigger:"cancel",e:t})}}),y=b.getConfirmBtn,w=b.getCancelBtn,k=t.ref(null),x=t.computed((function(){return[d.value,"".concat(d.value,"--").concat(e.placement),m(m(m({},"".concat(d.value,"--open"),o.value),"".concat(d.value,"--attach"),e.showInAttachedElement),"".concat(d.value,"--without-mask"),!e.showOverlay)]})),C=t.computed((function(){var t;if(f.value)return f.value;var n=null!==(t=e.size)&&void 0!==t?t:l.value.size,r=isNaN(Number(n))?n:"".concat(n,"px");return{small:"300px",medium:"500px",large:"760px"}[n]||r})),O=t.computed((function(){return{transform:o.value?"translateX(0)":void 0,width:["left","right"].includes(e.placement)?C.value:"",height:["top","bottom"].includes(e.placement)?C.value:""}})),S=t.computed((function(){return["".concat(d.value,"__content-wrapper"),"".concat(d.value,"__content-wrapper--").concat(e.placement)]})),E=t.computed((function(){return k.value&&k.value.parentNode})),N=t.computed((function(){return[e.mode,e.placement].join()})),_=t.computed((function(){return{display:"flex",justifyContent:"right"===e.placement?"flex-start":"flex-end"}})),M=function(t){var n,r;(null!==(n=e.closeOnEscKeydown)&&void 0!==n?n:l.value.closeOnEscKeydown)&&"Escape"===t.key&&o.value&&(null===(r=e.onEscKeydown)||void 0===r||r.call(e,{e:t}),j({trigger:"esc",e:t}))},A=function(){clearTimeout(a.value),a.value=setTimeout((function(){var e,t;null===(e=i.value)||void 0===e||null===(e=e.parentNode)||void 0===e||null===(t=e.removeChild)||void 0===t||t.call(e,i.value)}),150)};t.watch(N,(function(){"push"===e.mode&&t.nextTick((function(){E.value&&(E.value.style.cssText="transition: margin 300ms cubic-bezier(0.7, 0.3, 0.1, 1) 0s;")}))}),{immediate:!0}),t.watch((function(){return e.visible}),(function(t){kc||(t?!e.showInAttachedElement&&e.preventScrollThrough&&i.value&&document.head.appendChild(i.value):A(),e.destroyOnClose?t?(r.value=!1,setTimeout((function(){o.value=!0}))):(o.value=!1,setTimeout((function(){r.value=!0}),200)):!0===r.value&&t?(r.value=!1,setTimeout((function(){o.value=!0}))):o.value=t)}),{immediate:!0});var T=function(t){var n;null===(n=e.onCloseBtnClick)||void 0===n||n.call(e,{e:t}),j({trigger:"close-btn",e:t})},V=function(t){var n,r;null===(n=e.onOverlayClick)||void 0===n||n.call(e,{e:t}),(null!==(r=e.closeOnOverlayClick)&&void 0!==r?r:l.value.closeOnOverlayClick)&&j({trigger:"overlay",e:t})},j=function(t){var r;null===(r=e.onClose)||void 0===r||r.call(e,t),n.emit("update:visible",!1)};return t.onUpdated((function(){!function(){if(E.value&&"push"===e.mode&&E.value){var t={left:"margin: 0 0 0 ".concat(C.value),right:"margin: 0 0 0 -".concat(C.value),top:"margin: ".concat(C.value," 0 0 0"),bottom:"margin: -".concat(C.value," 0 0 0")}[e.placement];o.value?E.value.style.cssText+=t:E.value.style.cssText=E.value.style.cssText.replace(/margin:.+;/,"")}}()})),t.onMounted((function(){var t=document.documentElement.scrollHeight>document.documentElement.clientHeight?AC():0;i.value=document.createElement("style"),i.value.dataset.id="td_drawer_".concat(+new Date,"_").concat(KC+=1),i.value.innerHTML="\n html body {\n overflow-y: hidden;\n transition: margin 300ms cubic-bezier(0.7, 0.3, 0.1, 1) 0s;\n ".concat("push"===e.mode?"":"width: calc(100% - ".concat(t,"px);"),"\n }\n "),o.value&&!e.showInAttachedElement&&e.preventScrollThrough&&document.head.appendChild(i.value),window.addEventListener("keydown",M)})),t.onBeforeUnmount((function(){A(),window.removeEventListener("keydown",M)})),function(){if(!r.value){var o,i,a=u("body","default"),p=c("header"),f=(o=y({confirmBtn:e.confirmBtn,globalConfirm:l.value.confirm,className:"".concat(d.value,"__confirm")}),i=w({cancelBtn:e.cancelBtn,globalCancel:l.value.cancel,className:"".concat(d.value,"__cancel")}),t.createVNode("div",{style:_.value},["right"===e.placement?o:null,i,"right"!==e.placement?o:null]));return t.createVNode(t.Teleport,{disabled:!e.attach||!g.value,to:g.value},{default:function(){return[t.createVNode("div",t.mergeProps({ref:k,class:x.value,style:{zIndex:e.zIndex},onKeydown:M,tabindex:0},n.attrs),[e.showOverlay&&t.createVNode("div",{class:"".concat(d.value,"__mask"),onClick:V},null),t.createVNode("div",{class:S.value,style:O.value},[p&&t.createVNode("div",{class:"".concat(d.value,"__header")},[p]),e.closeBtn&&t.createVNode("div",{class:"".concat(d.value,"__close-btn"),onClick:T},[c("closeBtn",t.createVNode(s,null,null))]),t.createVNode("div",{class:["".concat(d.value,"__body"),"narrow-scrollbar"]},[a]),e.footer&&t.createVNode("div",{class:"".concat(d.value,"__footer")},[c("footer",f)]),e.sizeDraggable&&t.createVNode("div",{style:v.value,onMousedown:h},null)])])]}})}}}})),YC={globalConfig:Object},XC=xd(t.defineComponent({name:"TConfigProvider",props:YC,setup:function(e){nc(e);var n=Vd();return function(){return t.createVNode(t.Fragment,null,[n("default")])}}}));const ZC=["width","height"],JC=["xlink:href","fill"],QC={__name:"icon",props:{name:{type:String,required:!0},size:{type:String,default:"1em"},color:{type:String,default:"currentcolor"}},setup(e){const n=e;return(r,o)=>(t.openBlock(),t.createElementBlock("svg",{class:"icon","aria-hidden":"true",width:e.size,height:e.size},[t.createElementVNode("use",{"xlink:href":`#icon-${n.name}`,fill:e.color},null,8,JC)],8,ZC))}},eO=e=>{if(!e)return"";let t=e;return/macintosh|mac os x/gi.test(navigator.userAgent)&&(t=t.replace(/ctrl/gi,"⌘").replace(/shift/gi,"⇧").replace(/alt/gi,"⌥").replace(/Enter/gi,"Return").replace(/Backspace/gi,"Delete")),t};var tO={},nO={};nO.MergeStrategy=class{static overwrite(e,t){return t}static replace(e,t){return void 0!==t?t:e}static assign(e,t){return Object.assign({},e,t)}};var rO={};rO.ValidationStrategy=class{static array(e){if(!Array.isArray(e))throw new TypeError("Expected an array.")}static boolean(e){if("boolean"!=typeof e)throw new TypeError("Expected a Boolean.")}static number(e){if("number"!=typeof e)throw new TypeError("Expected a number.")}static object(e){if(!e||"object"!=typeof e)throw new TypeError("Expected an object.")}static"object?"(e){if("object"!=typeof e)throw new TypeError("Expected an object or null.")}static string(e){if("string"!=typeof e)throw new TypeError("Expected a string.")}static"string!"(e){if("string"!=typeof e||0===e.length)throw new TypeError("Expected a non-empty string.")}};const{MergeStrategy:oO}=nO,{ValidationStrategy:iO}=rO,aO=Symbol("strategies"),lO=Symbol("requiredKeys");function sO(e,t){let n=!1;if(t.schema){if("object"!=typeof t.schema)throw new TypeError("Schema must be an object.");n=!0}if("string"==typeof t.merge){if(!(t.merge in oO))throw new TypeError(`Definition for key "${e}" missing valid merge strategy.`)}else if(!n&&"function"!=typeof t.merge)throw new TypeError(`Definition for key "${e}" must have a merge property.`);if("string"==typeof t.validate){if(!(t.validate in iO))throw new TypeError(`Definition for key "${e}" missing valid validation strategy.`)}else if(!n&&"function"!=typeof t.validate)throw new TypeError(`Definition for key "${e}" must have a validate() method.`)}class cO extends Error{constructor(e){super(`Unexpected key "${e}" found.`)}}class uO extends Error{constructor(e){super(`Missing required key "${e}".`)}}class dO extends Error{constructor(e,t){super(`Key "${e}" requires keys "${t.join('", "')}".`)}}class pO extends Error{constructor(e,t){super(`Key "${e}": ${t.message}`,{cause:t});for(const n of Object.keys(t))n in this||(this[n]=t[n])}}tO.ObjectSchema=class e{constructor(t){if(!t)throw new Error("Schema definitions missing.");this[aO]=new Map,this[lO]=new Map;for(const n of Object.keys(t)){if(sO(n,t[n]),"object"==typeof t[n].schema){const r=new e(t[n].schema);t[n]={...t[n],merge:(e={},t={})=>r.merge(e,t),validate(e){iO.object(e),r.validate(e)}}}"string"==typeof t[n].merge&&(t[n]={...t[n],merge:oO[t[n].merge]}),"string"==typeof t[n].validate&&(t[n]={...t[n],validate:iO[t[n].validate]}),this[aO].set(n,t[n]),t[n].required&&this[lO].set(n,t[n])}}hasKey(e){return this[aO].has(e)}merge(...e){if(e.length<2)throw new TypeError("merge() requires at least two arguments.");if(e.some((e=>null==e||"object"!=typeof e)))throw new TypeError("All arguments must be objects.");return e.reduce(((e,t)=>{this.validate(t);for(const[r,o]of this[aO])try{if(r in e||r in t){const n=o.merge.call(this,e[r],t[r]);void 0!==n&&(e[r]=n)}}catch(n){throw new pO(r,n)}return e}),{})}validate(e){for(const n of Object.keys(e)){if(!this.hasKey(n))throw new cO(n);const r=this[aO].get(n);if(Array.isArray(r.requires)&&!r.requires.every((t=>t in e)))throw new dO(n,r.requires);try{r.validate.call(r,e[n])}catch(t){throw new pO(n,t)}}for(const[n]of this[lO])if(!(n in e))throw new uO(n)}};var fO=tO.ObjectSchema;const hO={editorKey:"default",height:"100%",dicts:{fonts:[{label:"默认字体",value:null},{label:"宋体",value:"SimSun"},{label:"黑体",value:"SimHei"},{label:"楷体",value:"KaiTi"},{label:"楷体_GB2312",value:"KaiTi_GB2312"},{label:"仿宋",value:"FangSong"},{label:"仿宋_GB2312",value:"FangSong_GB2312"},{label:"华文宋体",value:"STSong"},{label:"华文仿宋",value:"STFangsong"},{label:"方正仿宋简体",value:"FZFangSong-Z02S"},{label:"方正小标宋",value:"FZXiaoBiaoSong-B05S"},{label:"微软雅黑",value:"Microsoft Yahei"},{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Helvetica",value:"Helvetica"},{label:"Calibri",value:"Calibri"},{label:"Cambria",value:"Cambria"},{label:"Tahoma",value:"Tahoma"},{label:"Georgia",value:"Georgia"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Impact",value:"Impact"}],colors:["#FFF","#000","#4A5366","#3B74EC","#45A2EF","#529867","#CD4A3F","#EA8D40","#EEC543","#8E45D0","#F2F2F2","#7F7F7F","#F4F5F7","#CBDCFC","#E8F6FE","#EDFAF2","#FCEAE9","#FDF3EC","#FEF9E5","#FAECFE","#EEE","#595959","#C6CAD2","#CEEBFD","#CBDCFC","#CBE9D7","#F7CBC9","#FADDC7","#FDEEB5","#EBCAFC","#BFBFBF","#3F3F3F","#828B9D","#A0BEFA","#A7DCFC","#A6D5B8","#F2A19C","#F5BC8C","#FBE281","#CB94F9","#A5A5A5","#262626","#363B44","#2452B2","#3473A1","#417A53","#922B22","#AD642A","#9E8329","#57297D","#939393","#0D0D0D","#25272E","#15316A","#1C415A","#284D34","#511712","#573213","#635217","#36194E"],lineHeights:[{label:"单倍行距",value:1},{label:"1.5 倍行距",value:1.5,default:!0},{label:"2 倍行距",value:2},{label:"2.5 倍行距",value:2.5},{label:"3 倍行距",value:3}],specialCharacters:[{label:"普通文本",items:"‹›«»‘’“”‚„¡¿‥…‡‰‱‼⁈⁉⁇©®™§¶⁋"},{label:"货币符号",items:"$€¥£¢₠₡₢₣₤¤₿₥₦₧₨₩₪₫₭₮₯₰₱₲₳₴₵₶₷₸₹₺₻₼₽"},{label:"数学符号",items:"<>≤≥–—¯‾°−±÷⁄׃∫∑∞√∼≅≈≠≡∈∉∋∏∧∨¬∩∪∂∀∃∅∇∗∝∠¼½¾"},{label:"箭头",items:"←→↑↓⇐⇒⇑⇓⇠⇢⇡⇣⇤⇥⤒⤓↨"},{label:"拉丁语",items:"ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ"}],emojis:[{label:"表情与角色",items:"😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 🫠 😉 😊 😇 🥰 😍 🤩 😘 😗 ☺️ 😚 😙 🥲 😋 😛 😜 🤪 😝 🤑 🤗 🤭 🫢 🫣 🤫 🤔 🫡 🤐 🤨 😐 😑 😶 🫥 😶‍🌫️ 😏 😒 🙄 😬 😮‍💨 🤥 😌 😔 😪 🤤 😴 😷 🤒 🤕 🤢 🤮 🤧 🥵 🥶 🥴 😵 😵‍💫 🤯 🤠 🥳 🥸 😎 🤓 🧐 😕 🫤 😟 🙁 ☹️ 😮 😯 😲 😳 🥺 🥹 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 🥱 😤 😡 😠 🤬 😈 👿 💀 ☠️ 💩 🤡 👹 👺 👻 👽 👾 🤖 👋 🤚 🖐️ ✋ 🖖 🫱 🫲 🫳 🫴 👌 🤌 🤏 ✌️ 🤞 🫰 🤟 🤘 🤙 👈 👉 👆 🖕 👇 ☝️ 🫵 👍 👎 ✊ 👊 🤛 🤜 👏 🙌 🫶 👐 🤲 🤝 🙏 ✍️ 💅 🤳 💪 🦾 🦿 🦵 🦶 👂 🦻"},{label:"动物与自然",items:"🐵 🐒 🦍 🦧 🐶 🐕 🦮 🐕‍🦺 🐩 🐺 🦊 🦝 🐱 🐈 🐈‍⬛ 🦁 🐯 🐅 🐆 🐴 🐎 🦄 🦓 🦌 🦬 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🦙 🦒 🐘 🦣 🦏 🦛 🐭 🐁 🐀 🐹 🐰 🐇 🐿️ 🦫 🦔 🦇 🐻 🐻‍❄️ 🐨 🐼 🦥 🦦 🦨 🦘 🦡 🐾 🦃 🐔 🐓 🐣 🐤 🐥 🐦 🐧 🕊️ 🦅 🦆 🦢 🦉 🦤 🪶 🦩 🦚 🦜 🐸 🐊 🐢 🦎 🐍 🐲 🐉 🦕 🦖 🐳 🐋 🐬 🦭 🐟 🐠 🐡 🦈 🐙 🐚 🪸 🐌 🦋 🐛 🐜 🐝 🪲 🐞 🦗 🪳 🕷️ 🕸️ 🦂 🦟 🪰 🪱 🦠 💐 🌸 💮 🪷 🏵️ 🌹 🥀 🌺 🌻 🌼 🌷 🌱 🪴 🌲 🌳 🌴 🌵 🌾 🌿 ☘️ 🍀 🍁 🍂 🍃 🪹 🪺"},{label:"食物与食品",items:"🥬 🥦 🧄 🧅 🍄 🥜 🫘 🌰 🍞 🥐 🥖 🫓 🥨 🥯 🥞 🧇 🧀 🍖 🍗 🥩 🥓 🍔 🍟 🍕 🌭 🥪 🌮 🌯 🫔 🥙 🧆 🥚 🍳 🥘 🍲 🫕 🥣 🥗 🍿 🧈 🧂 🥫 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🥮 🍡 🥟 🥠 🥡 🦀 🦞 🦐 🦑 🦪 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🧁 🥧 🍫 🍬 🍭 🍮 🍯 🍼 🥛 ☕ 🫖 🍵 🍶 🍾 🍷 🍸 🍹 🍺 🍻 🥂 🥃 🫗 🥤 🧋 🧃 🧉 🧊 🥢 🍽️ 🍴 🥄 🔪 🫙 🏺"},{label:"活动",items:"🎗️ 🎟️ 🎫 🎖️ 🏆 🏅 🥇 🥈 🥉 ⚽ ⚾ 🥎 🏀 🏐 🏈 🏉 🎾 🥏 🎳 🏏 🏑 🏒 🥍 🏓 🏸 🥊 🥋 🥅 ⛳ ⛸️ 🎣 🤿 🎽 🎿 🛷 🥌 🎯 🪀 🪁 🎱 🔮 🪄 🧿 🪬 🎮 🕹️ 🎰 🎲 🧩 🧸 🪅 🪩 🪆 ♠️ ♥️ ♦️ ♣️ ♟️ 🃏 🀄 🎴 🎭 🖼️ 🎨 🧵 🪡 🧶 🪢"},{label:"旅行与景点",items:"🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚙 🛻 🚚 🚛 🚜 🏎️ 🏍️ 🛵 🦽 🦼 🛺 🚲 🛴 🛹 🛼 🚏 🛣️ 🛤️ 🛢️ ⛽ 🛞 🚨 🚥 🚦 🛑 🚧 ⚓ 🛟 ⛵ 🛶 🚤 🛳️ ⛴️ 🛥️ 🚢 ✈️ 🛩️ 🛫 🛬 🪂 💺 🚁 🚟 🚠 🚡 🛰️ 🚀 🛸 🛎️ 🧳 ⌛ ⏳ ⌚ ⏰ ⏱️ ⏲️ 🕰️ 🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 🌡️ ☀️ 🌝 🌞 🪐 ⭐ 🌟 🌠 🌌 ☁️ ⛅ ⛈️ 🌤️ 🌥️ 🌦️ 🌧️ 🌨️ 🌩️ 🌪️ 🌫️ 🌬️ 🌀 🌈 🌂 ☂️ ☔ ⛱️ ⚡ ❄️ ☃️ ⛄ ☄️ 🔥 💧 🌊"},{label:"物品",items:"📃 📜 📄 📰 🗞️ 📑 🔖 🏷️ 💰 🪙 💴 💵 💶 💷 💸 💳 🧾 💹 ✉️ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 🗳️ ✏️ ✒️ 🖋️ 🖊️ 🖌️ 🖍️ 📝 💼 📁 📂 🗂️ 📅 📆 🗒️ 🗓️ 📇 📈 📉 📊 📋 📌 📍 📎 🖇️ 📏 📐 ✂️ 🗃️ 🗄️ 🗑️ 🔒 🔓 🔏 🔐 🔑 🗝️ 🔨 🪓 ⛏️ ⚒️ 🛠️ 🗡️ ⚔️ 🔫 🪃 🏹 🛡️ 🪚 🔧 🪛 🔩 ⚙️ 🗜️ ⚖️ 🦯 🔗 ⛓️ 🪝 🧰 🧲 🪜 ⚗️ 🧪 🧫 🧬 🔬 🔭 📡 💉 🩸 💊 🩹 🩼 🩺 🩻 🚪 🛗 🪞 🪟 🛏️ 🛋️ 🪑 🚽 🪠 🚿 🛁 🪤 🪒 🧴 🧷 🧹 🧺 🧻 🪣 🧼 🫧 🪥 🧽 🧯 🛒 🚬 ⚰️ 🪦 ⚱️ 🗿 🪧 🪪"},{label:"符号",items:"➰ ➿ 〽️ ✳️ ✴️ ❇️ ©️ ®️ ™️ #️⃣ *️⃣ 0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ 🔟 🔠 🔡 🔢 🔣 🔤 🅰️ 🆎 🅱️ 🆑 🆒 🆓 ℹ️ 🆔 Ⓜ️ 🆕 🆖 🅾️ 🆗 🅿️ 🆘 🆙 🆚 🈁 🈂️ 🔴 🟠 🟡 🟢 🔵 🟣 🟤 ⚫ ⚪ 🟥 🟧 🟨 🟩 🟦 🟪 🟫 ⬛ ⬜ ◼️ ◻️ ◾ ◽ ▪️ ▫️ 🔶 🔷 🔸 🔹 🔺 🔻 💠 🔘 🔳 🔲"},{label:"旗帜",items:"🏁 🇨🇳 🎌 🇩🇪 🇪🇸 🇦🇨 🇦🇩 🇦🇪 🇦🇫 🇦🇬 🇦🇮 🇦🇱 🇦🇲 🇦🇴 🇦🇶 🇦🇷 🇦🇸 🇦🇹 🇦🇺 🇦🇼 🇦🇽 🇦🇿 🇧🇦 🇧🇧 🇧🇩 🇧🇪 🇧🇫 🇧🇬 🇧🇭 🇧🇮 🇧🇯 🇧🇱 🇧🇲 🇧🇳 🇧🇴 🇧🇶 🇧🇷 🇧🇸 🇧🇹 🇧🇻 🇧🇼 🇧🇾 🇧🇿 🇨🇦 🇨🇨 🇨🇩 🇨🇫 🇨🇬 🇨🇭 🇨🇮 🇨🇰 🇨🇱 🇨🇲 🇨🇴 🇨🇵 🇨🇷 🇨🇺 🇨🇻 🇨🇼 🇨🇽 🇨🇾 🇨🇿 🇩🇬 🇩🇯 🇩🇰 🇩🇲 🇩🇴 🇩🇿 🇪🇦 🇪🇨 🇪🇪 🇪🇬 🇪🇭 🏴󠁧󠁢󠁥󠁮󠁧󠁿 🇪🇷 🇪🇹 🇪🇺 🇫🇮 🇫🇯 🇫🇰 🇫🇲 🇫🇴 🇬🇦 🇬🇩 🇬🇪 🇬🇫 🇬🇬 🇬🇭 🇬🇮 🇬🇱 🇬🇲 🇬🇳 🇬🇵 🇬🇶 🇬🇷 🇬🇸 🇬🇹 🇬🇺 🇬🇼 🇬🇾 🇭🇰 🇭🇲 🇭🇳 🇭🇷 🇭🇹 🇭🇺 🇮🇨 🇮🇩 🇮🇪 🇮🇱 🇮🇲 🇮🇳 🇮🇴 🇮🇶 🇮🇷 🇮🇸 🇯🇪 🇯🇲 🇯🇴 🇰🇪 🇰🇬 🇰🇭 🇰🇮 🇰🇲 🇰🇳 🇰🇵 🇰🇼 🇰🇾 🇰🇿 🇱🇦 🇱🇧 🇱🇨 🇱🇮 🇱🇰 🇱🇷 🇱🇸 🇱🇹 🇱🇺 🇱🇻 🇱🇾 🇲🇦 🇲🇨 🇲🇩 🇲🇪 🇲🇫 🇲🇬 🇲🇭 🇲🇰 🇲🇱 🇲🇲 🇲🇳 🇲🇴 🇲🇵 🇲🇶 🇲🇷 🇲🇸 🇲🇹 🇲🇺 🇲🇻 🇲🇼 🇲🇽 🇲🇾 🇲🇿 🇳🇦 🇳🇨 🇳🇪 🇳🇫 🇳🇬 🇳🇮 🇳🇱 🇳🇴"}],pageSizes:[{label:"A4",width:21,height:29.4,default:!0},{label:"A3",width:29.7,height:42},{label:"A5",width:14.8,height:21},{label:"B5",width:17.6,height:25},{label:"5号信封",width:10.9,height:12.9},{label:"6号信封",width:11.9,height:22.9},{label:"7号信封",width:16.1,height:22.8},{label:"9号信封",width:22.8,height:32.3},{label:"法律用纸",width:21.5,height:33.5},{label:"信纸",width:21.5,height:27.9}]},toolbar:{defaultMode:"ribbon",enableSourceEditor:!1,menus:["base","insert","table","tools","page","export"],disableMenuItems:[]},page:{defaultMargin:{left:3.18,right:3.18,top:2.54,bottom:2.54},defaultOrientation:"horizontal",defaultBackground:"#fff",showBreakMarks:!0,watermark:{type:"compact",alpha:.2,fontColor:"#000",fontSize:16,fontFamily:"SimSun",fontWeight:"normal",text:""}},document:{title:"未命名文档",content:"",placeholder:"请输入文档内容...",enableSpellcheck:!0,enableMarkdown:!0,enableBubbleMenu:!0,readOnly:!1,autofocus:!0,characterLimit:0,typographyRules:{}},templates:[],cdnUrl:"https://unpkg.com/@umodoc/editor@latest/libs",shareUrl:(null==location?void 0:location.href)||"",diagrams:{domain:"https://embed.diagrams.net",params:{}},file:{allowedMimeTypes:[],maxSize:104857600},async onSave(e,t,n){throw new Error('Key "onSave": Please set the save method')},async onFileUpload(e){if(!e)throw new Error("File not found");throw new Error('Key "onFileUpload": Please set the upload method')},onFileDelete(e,t){console.error("The file has been deleted. Please configure the onFileDelete to completely delete the file from the server.")}},mO=Object.keys(hO),vO=e=>{if("number"==typeof e)return isFinite(e);if("string"==typeof e){const t=parseFloat(e);return!isNaN(t)&&isFinite(t)&&e===t.toString()}return!1},gO=new fO({editorKey:{merge:"replace",validate:"string!"},height:{merge:"replace",validate:"string!"},dicts:{schema:{fonts:{merge:"replace",validate(e){if(e&&!Array.isArray(e))throw new Error('Key "dicts": Key "fonts": must be a array.');e.forEach((e=>{if(!e.label||!e.value&&null!==e.value)throw new Error('Key "dicts": Key "fonts": must be a array of objects with "label" and "value" properties.')}))}},colors:{merge:"replace",validate:"array"},lineHeights:{merge:"replace",validate(e){if(e&&!Array.isArray(e))throw new Error('Key "dicts": Key "lineHeights": must be a array.');if(!e.find((e=>e.default)))throw new Error('Key "dicts": Key "lineHeights": please set a default value.');e.forEach((e=>{if(!e.label||!e.value&&null!==e.value)throw new Error('Key "dicts": Key "lineHeights": must be a array of objects with "label" and "value" properties.')}))}},specialCharacters:{merge:"replace",validate:"array"},emojis:{merge:"replace",validate:"array"},pageSizes:{merge:"replace",validate(e){if(e&&!Array.isArray(e))throw new Error('Key "dicts": Key "pageSizes": must be a array.');if(!e.find((e=>e.default)))throw new Error('Key "dicts": Key "pageSizes": please set a default value.');e.forEach(((e,t)=>{if(!e.label||""===e.label)throw new Error(`Key "dicts": Key "pageSizes[${t}]" Key: "label" cannot be empty.`);if(!vO(e.width))throw new Error(`Key "dicts": Key "pageSizes[${t}]" Key: "width" must be a number.`);if(!vO(e.height))throw new Error(`Key "dicts": Key "pageSizes[${t}]" Key: "height" must be a number.`)}))}}}},toolbar:{schema:{defaultMode:{merge:"replace",validate(e){if(e&&!["classic","ribbon"].includes(e))throw new Error('Key "toolbar": Key "defaultMode" must be one of "classic" or "ribbon".')}},enableSourceEditor:{merge:"replace",validate:"boolean"},menus:{merge:"replace",validate(e){const t=hO.toolbar.menus;if(e&&!Array.isArray(e))throw new Error('Key "toolbar": Key "menus" must be a array.');if(!e.includes("base"))throw new Error('Key "toolbar": Key "menus" should at least contain "base".');if(!e.every((e=>t.includes(e))))throw new Error(`Key "toolbar": Key "menus" the array items of toolbar.menus must contain only one or multiple of ${JSON.stringify(t)}.`)}},disableMenuItems:{merge:"replace",validate(e){if(e&&!Array.isArray(e))throw new Error('Key "toolbar": Key "disableMenuItems" must be a array.')}}}},page:{schema:{defaultMargin:{schema:{left:{merge:"replace",validate:"number"},right:{merge:"replace",validate:"number"},top:{merge:"replace",validate:"number"},bottom:{merge:"replace",validate:"number"}}},defaultOrientation:{merge:"replace",validate(e){if(e&&!["horizontal","vertical"].includes(e))throw new Error('Key "page": Key "defaultOrientation": defaultOrientation" must be one of "horizontal" or "vertical".')}},defaultBackground:{merge:"replace",validate:"string"},showBreakMarks:{merge:"replace",validate:"boolean"},watermark:{schema:{type:{merge:"replace",validate(e){if(e&&!["compact","spacious"].includes(e))throw new Error('Key "watermark": Key "type" must be one of "compact" or "spacious".')}},alpha:{merge:"replace",validate:"number"},fontColor:{merge:"replace",validate:"string"},fontFamily:{merge:"replace",validate(e){if(null!==e&&"string"!=typeof e)throw new Error('Key "watermark": Key "fontFamily" must be a string.')}},fontSize:{merge:"replace",validate:"number"},fontWeight:{merge:"replace",validate:"string"},text:{merge:"replace",validate:"string"}}}}},document:{schema:{title:{merge:"replace",validate:"string"},content:{merge:"replace",validate(){}},placeholder:{merge:"replace",validate:"string"},enableSpellcheck:{merge:"replace",validate:"boolean"},enableMarkdown:{merge:"replace",validate:"boolean"},enableBubbleMenu:{merge:"replace",validate:"boolean"},readOnly:{merge:"replace",validate:"boolean"},autofocus:{merge:"replace",validate:"boolean"},characterLimit:{merge:"replace",validate:"number"},typographyRules:{merge:"replace",validate:"object"}}},shareUrl:{merge:"replace",validate:"string"},templates:{merge:"replace",validate(e){if(e&&!Array.isArray(e))throw new Error('Key "templates": Key "menus" must be a array.');e.forEach(((e,t)=>{if(!e.title||""===!e.title)throw new Error(`Key "templates[${t}]": Key "title" cannot be empty.`);if(!e.content||""===!e.content)throw new Error(`Key "templates[${t}]": Key "content" cannot be empty.`)}))}},cdnUrl:{merge:"replace",validate:"string"},diagrams:{merge:"assign",validate:"object"},file:{schema:{allowedMimeTypes:{merge:"replace",validate:"array"},maxSize:{merge:"replace",validate:"number"},onUpload:{merge:"replace",validate(e){if("AsyncFunction"!==e.constructor.name)throw new Error('Key "upload": Key "onUpload" must be a async function.')}},onDelete:{merge:"replace",validate(e){if("function"!=typeof e&&"AsyncFunction"!==e.constructor.name)throw new Error('Key "upload": Key "onDelete" must be a function.')}}}},onSave:{merge:"replace",validate(e){if("AsyncFunction"!==e.constructor.name&&e instanceof Promise)throw new Error('Key "document": Key "saveNethod" must be a async function.')}},onFileUpload:{merge:"replace",validate(e){if("AsyncFunction"!==e.constructor.name)throw new Error('Key "upload": Key "onUpload" must be a async function.')}},onFileDelete:{merge:"replace",validate(e){if("function"!=typeof e&&"AsyncFunction"!==e.constructor.name)throw new Error('Key "upload": Key "onDelete" must be a function.')}}}),bO=(e=8)=>Math.random().toString(36).substring(2,e+2);function yO(e){return!!t.getCurrentScope()&&(t.onScopeDispose(e),!0)}function wO(e){return"function"==typeof e?e():t.unref(e)}const kO="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const xO=Object.prototype.toString,CO=e=>"[object Object]"===xO.call(e),OO=()=>+Date.now(),SO=()=>{},EO=NO();function NO(){var e,t;return kO&&(null==(e=null==window?void 0:window.navigator)?void 0:e.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||(null==(t=null==window?void 0:window.navigator)?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(null==window?void 0:window.navigator.userAgent))}const _O=e=>e();function MO(e,t=!1,n="Timeout"){return new Promise(((r,o)=>{t?setTimeout((()=>o(n)),e):setTimeout(r,e)}))}function AO(e,n,r={}){const{eventFilter:o=_O,...i}=r;return t.watch(e,(a=o,l=n,function(...e){return new Promise(((t,n)=>{Promise.resolve(a((()=>l.apply(this,e)),{fn:l,thisArg:this,args:e})).then(t).catch(n)}))}),i);var a,l}function TO(e,n,r={}){const{eventFilter:o,...i}=r,{eventFilter:a,pause:l,resume:s,isActive:c}=function(e=_O){const n=t.ref(!0);return{isActive:t.readonly(n),pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...t)=>{n.value&&e(...t)}}}(o);return{stop:AO(e,n,{...i,eventFilter:a}),pause:l,resume:s,isActive:c}}function VO(e,n=!0,r){const o=function(e){return e||t.getCurrentInstance()}();o?t.onMounted(e,r):n?e():t.nextTick(e)}function jO(e,n=!1){function r(r,{flush:o="sync",deep:i=!1,timeout:a,throwOnTimeout:l}={}){let s=null;const c=[new Promise((a=>{s=t.watch(e,(e=>{r(e)!==n&&(null==s||s(),a(e))}),{flush:o,deep:i,immediate:!0})}))];return null!=a&&c.push(MO(a,l).then((()=>wO(e))).finally((()=>null==s?void 0:s()))),Promise.race(c)}function o(o,i){if(!t.isRef(o))return r((e=>e===o),i);const{flush:a="sync",deep:l=!1,timeout:s,throwOnTimeout:c}=null!=i?i:{};let u=null;const d=[new Promise((r=>{u=t.watch([e,o],(([e,t])=>{n!==(e===t)&&(null==u||u(),r(e))}),{flush:a,deep:l,immediate:!0})}))];return null!=s&&d.push(MO(s,c).then((()=>wO(e))).finally((()=>(null==u||u(),wO(e))))),Promise.race(d)}function i(e){return a(1,e)}function a(e=1,t){let n=-1;return r((()=>(n+=1,n>=e)),t)}if(Array.isArray(wO(e))){return{toMatch:r,toContains:function(e,t){return r((t=>{const n=Array.from(t);return n.includes(e)||n.includes(wO(e))}),t)},changed:i,changedTimes:a,get not(){return jO(e,!n)}}}return{toMatch:r,toBe:o,toBeTruthy:function(e){return r((e=>Boolean(e)),e)},toBeNull:function(e){return o(null,e)},toBeNaN:function(e){return r(Number.isNaN,e)},toBeUndefined:function(e){return o(void 0,e)},changed:i,changedTimes:a,get not(){return jO(e,!n)}}}function BO(e){return jO(e)}const PO=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,IO=/[YMDHhms]o|\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function DO(e,t,n,r){let o=e<12?"AM":"PM";return r&&(o=o.split("").reduce(((e,t)=>e+`${t}.`),"")),n?o.toLowerCase():o}function LO(e){const t=["th","st","nd","rd"],n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}function RO(e,n="HH:mm:ss",r={}){return t.computed((()=>function(e,t,n={}){var r;const o=e.getFullYear(),i=e.getMonth(),a=e.getDate(),l=e.getHours(),s=e.getMinutes(),c=e.getSeconds(),u=e.getMilliseconds(),d=e.getDay(),p=null!=(r=n.customMeridiem)?r:DO,f={Yo:()=>LO(o),YY:()=>String(o).slice(-2),YYYY:()=>o,M:()=>i+1,Mo:()=>LO(i+1),MM:()=>`${i+1}`.padStart(2,"0"),MMM:()=>e.toLocaleDateString(n.locales,{month:"short"}),MMMM:()=>e.toLocaleDateString(n.locales,{month:"long"}),D:()=>String(a),Do:()=>LO(a),DD:()=>`${a}`.padStart(2,"0"),H:()=>String(l),Ho:()=>LO(l),HH:()=>`${l}`.padStart(2,"0"),h:()=>`${l%12||12}`.padStart(1,"0"),ho:()=>LO(l%12||12),hh:()=>`${l%12||12}`.padStart(2,"0"),m:()=>String(s),mo:()=>LO(s),mm:()=>`${s}`.padStart(2,"0"),s:()=>String(c),so:()=>LO(c),ss:()=>`${c}`.padStart(2,"0"),SSS:()=>`${u}`.padStart(3,"0"),d:()=>d,dd:()=>e.toLocaleDateString(n.locales,{weekday:"narrow"}),ddd:()=>e.toLocaleDateString(n.locales,{weekday:"short"}),dddd:()=>e.toLocaleDateString(n.locales,{weekday:"long"}),A:()=>p(l,s),AA:()=>p(l,s,!1,!0),a:()=>p(l,s,!0),aa:()=>p(l,s,!0,!0)};return t.replace(IO,((e,t)=>{var n,r;return null!=(r=null!=t?t:null==(n=f[e])?void 0:n.call(f))?r:e}))}(function(e){if(null===e)return new Date(Number.NaN);if(void 0===e)return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){const t=e.match(PO);if(t){const e=t[2]-1||0,n=(t[7]||"0").substring(0,3);return new Date(t[1],e,t[3]||1,t[4]||0,t[5]||0,t[6]||0,n)}}return new Date(e)}(wO(e)),wO(n),r)))}function zO(e,n=1e3,r={}){const{immediate:o=!0,immediateCallback:i=!1}=r;let a=null;const l=t.ref(!1);function s(){a&&(clearInterval(a),a=null)}function c(){l.value=!1,s()}function u(){const t=wO(n);t<=0||(l.value=!0,i&&e(),s(),a=setInterval(e,t))}if(o&&kO&&u(),t.isRef(n)||"function"==typeof n){yO(t.watch(n,(()=>{l.value&&kO&&u()})))}return yO(c),{isActive:l,pause:c,resume:u}}function FO(e){var t;const n=wO(e);return null!=(t=null==n?void 0:n.$el)?t:n}const $O=kO?window:void 0,HO=kO?window.document:void 0,UO=kO?window.navigator:void 0;function WO(...e){let n,r,o,i;if("string"==typeof e[0]||Array.isArray(e[0])?([r,o,i]=e,n=$O):[n,r,o,i]=e,!n)return SO;Array.isArray(r)||(r=[r]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach((e=>e())),a.length=0},s=t.watch((()=>[FO(n),wO(i)]),(([e,t])=>{if(l(),!e)return;const n=CO(t)?{...t}:t;a.push(...r.flatMap((t=>o.map((r=>((e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)))(e,t,r,n))))))}),{immediate:!0,flush:"post"}),c=()=>{s(),l()};return yO(c),c}let qO=!1;function KO(e,t,n={}){const{window:r=$O,ignore:o=[],capture:i=!0,detectIframe:a=!1}=n;if(!r)return SO;EO&&!qO&&(qO=!0,Array.from(r.document.body.children).forEach((e=>e.addEventListener("click",SO))),r.document.documentElement.addEventListener("click",SO));let l=!0;const s=e=>o.some((t=>{if("string"==typeof t)return Array.from(r.document.querySelectorAll(t)).some((t=>t===e.target||e.composedPath().includes(t)));{const n=FO(t);return n&&(e.target===n||e.composedPath().includes(n))}})),c=[WO(r,"click",(n=>{const r=FO(e);r&&r!==n.target&&!n.composedPath().includes(r)&&(0===n.detail&&(l=!s(n)),l?t(n):l=!0)}),{passive:!0,capture:i}),WO(r,"pointerdown",(t=>{const n=FO(e);l=!s(t)&&!(!n||t.composedPath().includes(n))}),{passive:!0}),a&&WO(r,"blur",(n=>{setTimeout((()=>{var o;const i=FO(e);"IFRAME"!==(null==(o=r.document.activeElement)?void 0:o.tagName)||(null==i?void 0:i.contains(r.document.activeElement))||t(n)}),0)}))].filter(Boolean);return()=>c.forEach((e=>e()))}function GO(e){const n=function(){const e=t.ref(!1),n=t.getCurrentInstance();return n&&t.onMounted((()=>{e.value=!0}),n),e}();return t.computed((()=>(n.value,Boolean(e()))))}function YO(e,n={}){const{immediate:r=!0,fpsLimit:o,window:i=$O}=n,a=t.ref(!1),l=o?1e3/o:null;let s=0,c=null;function u(t){if(!a.value||!i)return;s||(s=t);const n=t-s;l&&n<l||(s=t,e({delta:n,timestamp:t})),c=i.requestAnimationFrame(u)}function d(){!a.value&&i&&(a.value=!0,s=0,c=i.requestAnimationFrame(u))}function p(){a.value=!1,null!=c&&i&&(i.cancelAnimationFrame(c),c=null)}return r&&d(),yO(p),{isActive:t.readonly(a),pause:p,resume:d}}function XO(e,n,r){const{immediate:o=!0,delay:i=0,onError:a=SO,onSuccess:l=SO,resetOnExecute:s=!0,shallow:c=!0,throwError:u}=null!=r?r:{},d=c?t.shallowRef(n):t.ref(n),p=t.ref(!1),f=t.ref(!1),h=t.shallowRef(void 0);async function m(t=0,...r){s&&(d.value=n),h.value=void 0,p.value=!1,f.value=!0,t>0&&await MO(t);const o="function"==typeof e?e(...r):e;try{const e=await o;d.value=e,p.value=!0,l(e)}catch(i){if(h.value=i,a(i),u)throw i}finally{f.value=!1}return d.value}o&&m(i);const v={state:d,isReady:p,isLoading:f,error:h,execute:m};return{...v,then:(e,t)=>new Promise(((e,t)=>{BO(f).toBe(!1).then((()=>e(v))).catch(t)})).then(e,t)}}function ZO(e,n={}){const{controls:r=!1,navigator:o=UO}=n,i=GO((()=>o&&"permissions"in o));let a;const l="string"==typeof e?{name:e}:e,s=t.ref(),c=()=>{a&&(s.value=a.state)},u=function(e){let t;function n(){return t||(t=e()),t}return n.reset=async()=>{const e=t;t=void 0,e&&await e},n}((async()=>{if(i.value){if(!a)try{a=await o.permissions.query(l),WO(a,"change",c),c()}catch(e){s.value="prompt"}return a}}));return u(),r?{state:s,isSupported:i,query:u}:s}function JO(e={}){const{navigator:n=UO,read:r=!1,source:o,copiedDuring:i=1500,legacy:a=!1}=e,l=GO((()=>n&&"clipboard"in n)),s=ZO("clipboard-read"),c=ZO("clipboard-write"),u=t.computed((()=>l.value||a)),d=t.ref(""),p=t.ref(!1),f=function(e,n,r={}){const{immediate:o=!0}=r,i=t.ref(!1);let a=null;function l(){a&&(clearTimeout(a),a=null)}function s(){i.value=!1,l()}function c(...t){l(),i.value=!0,a=setTimeout((()=>{i.value=!1,a=null,e(...t)}),wO(n))}return o&&(i.value=!0,kO&&c()),yO(s),{isPending:t.readonly(i),start:c,stop:s}}((()=>p.value=!1),i);function h(e){return"granted"===e||"prompt"===e}return u.value&&r&&WO(["copy","cut"],(function(){var e,t,r;l.value&&h(s.value)?n.clipboard.readText().then((e=>{d.value=e})):d.value=null!=(r=null==(t=null==(e=null==document?void 0:document.getSelection)?void 0:e.call(document))?void 0:t.toString())?r:""})),{isSupported:u,text:d,copied:p,copy:async function(e=wO(o)){u.value&&null!=e&&(l.value&&h(c.value)?await n.clipboard.writeText(e):function(e){const t=document.createElement("textarea");t.value=null!=e?e:"",t.style.position="absolute",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}(e),d.value=e,p.value=!0,f.start())}}}const QO="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},eS="__vueuse_ssr_handlers__",tS=nS();function nS(){return eS in QO||(QO[eS]=QO[eS]||{}),QO[eS]}const rS={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},oS="vueuse-storage";function iS(e,n,r,o={}){var i;const{flush:a="pre",deep:l=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:u=!1,shallow:d,window:p=$O,eventFilter:f,onError:h=(e=>{console.error(e)}),initOnMounted:m}=o,v=(d?t.shallowRef:t.ref)("function"==typeof n?n():n);if(!r)try{r=function(e,t){return tS[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=$O)?void 0:e.localStorage}))()}catch(S){h(S)}if(!r)return v;const g=wO(n),b=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(g),y=null!=(i=o.serializer)?i:rS[b],{pause:w,resume:k}=TO(v,(()=>function(t){try{const n=r.getItem(e);if(null==t)x(n,null),r.removeItem(e);else{const o=y.write(t);n!==o&&(r.setItem(e,o),x(n,o))}}catch(S){h(S)}}(v.value)),{flush:a,deep:l,eventFilter:f});function x(t,n){p&&p.dispatchEvent(new CustomEvent(oS,{detail:{key:e,oldValue:t,newValue:n,storageArea:r}}))}function C(n){if(!n||n.storageArea===r)if(n&&null==n.key)v.value=g;else if(!n||n.key===e){w();try{(null==n?void 0:n.newValue)!==y.write(v.value)&&(v.value=function(t){const n=t?t.newValue:r.getItem(e);if(null==n)return c&&null!=g&&r.setItem(e,y.write(g)),g;if(!t&&u){const e=y.read(n);return"function"==typeof u?u(e,g):"object"!==b||Array.isArray(e)?e:{...g,...e}}return"string"!=typeof n?n:y.read(n)}(n))}catch(S){h(S)}finally{n?t.nextTick(k):k()}}}function O(e){C(e.detail)}return p&&s&&VO((()=>{WO(p,"storage",C),WO(p,oS,O),m&&C()})),m||C(),v}const aS={multiple:!0,accept:"*",reset:!1,directory:!1};function lS(e={}){const{document:n=HO}=e,r=t.ref(null),{on:o,trigger:i}=function(){const e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);const r=()=>t(n);return yO(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map((e=>e(...t))))}}();let a;n&&(a=n.createElement("input"),a.type="file",a.onchange=e=>{const t=e.target;r.value=t.files,i(r.value)});const l=()=>{r.value=null,a&&(a.value="",i(null))};return{files:t.readonly(r),open:t=>{if(!a)return;const n={...aS,...e,...t};var r,o;a.multiple=n.multiple,a.accept=n.accept,a.webkitdirectory=n.directory,r=n,o="capture",Object.prototype.hasOwnProperty.call(r,o)&&(a.capture=n.capture),n.reset&&l(),a.click()},reset:l,onChange:o}}const sS=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function cS(e,n={}){const{document:r=HO,autoExit:o=!1}=n,i=t.computed((()=>{var t;return null!=(t=FO(e))?t:null==r?void 0:r.querySelector("html")})),a=t.ref(!1),l=t.computed((()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find((e=>r&&e in r||i.value&&e in i.value)))),s=t.computed((()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find((e=>r&&e in r||i.value&&e in i.value)))),c=t.computed((()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find((e=>r&&e in r||i.value&&e in i.value)))),u=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find((e=>r&&e in r)),d=GO((()=>i.value&&r&&void 0!==l.value&&void 0!==s.value&&void 0!==c.value)),p=()=>{if(c.value){if(r&&null!=r[c.value])return r[c.value];{const e=i.value;if(null!=(null==e?void 0:e[c.value]))return Boolean(e[c.value])}}return!1};async function f(){if(d.value&&a.value){if(s.value)if(null!=(null==r?void 0:r[s.value]))await r[s.value]();else{const e=i.value;null!=(null==e?void 0:e[s.value])&&await e[s.value]()}a.value=!1}}async function h(){if(!d.value||a.value)return;p()&&await f();const e=i.value;l.value&&null!=(null==e?void 0:e[l.value])&&(await e[l.value](),a.value=!0)}const m=()=>{const e=p();(!e||e&&u&&(null==r?void 0:r[u])===i.value)&&(a.value=e)};return WO(r,sS,m,!1),WO((()=>FO(i)),sS,m,!1),o&&yO(f),{isSupported:d,isFullscreen:a,enter:h,exit:f,toggle:async function(){await(a.value?f():h())}}}function uS(e,n={}){const r=XO((()=>async function(e){return new Promise(((t,n)=>{const r=new Image,{src:o,srcset:i,sizes:a,class:l,loading:s,crossorigin:c,referrerPolicy:u}=e;r.src=o,i&&(r.srcset=i),a&&(r.sizes=a),l&&(r.className=l),s&&(r.loading=s),c&&(r.crossOrigin=c),u&&(r.referrerPolicy=u),r.onload=()=>t(r),r.onerror=n}))}(wO(e))),void 0,{resetOnExecute:!0,...n});return t.watch((()=>wO(e)),(()=>r.execute(n.delay)),{deep:!0}),r}function dS(e={}){const{controls:n=!1,interval:r="requestAnimationFrame"}=e,o=t.ref(new Date),i=()=>o.value=new Date,a="requestAnimationFrame"===r?YO(i,{immediate:!0}):zO(i,r,{immediate:!0});return n?{now:o,...a}:o}function pS(e={}){const{isOnline:n}=function(e={}){const{window:n=$O}=e,r=null==n?void 0:n.navigator,o=GO((()=>r&&"connection"in r)),i=t.ref(!0),a=t.ref(!1),l=t.ref(void 0),s=t.ref(void 0),c=t.ref(void 0),u=t.ref(void 0),d=t.ref(void 0),p=t.ref(void 0),f=t.ref("unknown"),h=o.value&&r.connection;function m(){r&&(i.value=r.onLine,l.value=i.value?void 0:Date.now(),s.value=i.value?Date.now():void 0,h&&(c.value=h.downlink,u.value=h.downlinkMax,p.value=h.effectiveType,d.value=h.rtt,a.value=h.saveData,f.value=h.type))}return n&&(WO(n,"offline",(()=>{i.value=!1,l.value=Date.now()})),WO(n,"online",(()=>{i.value=!0,s.value=Date.now()}))),h&&WO(h,"change",m,!1),m(),{isSupported:o,isOnline:i,saveData:a,offlineAt:l,onlineAt:s,downlink:c,downlinkMax:u,effectiveType:p,rtt:d,type:f}}(e);return n}const fS=[{max:6e4,value:1e3,name:"second"},{max:276e4,value:6e4,name:"minute"},{max:72e6,value:36e5,name:"hour"},{max:5184e5,value:864e5,name:"day"},{max:24192e5,value:6048e5,name:"week"},{max:28512e6,value:2592e6,name:"month"},{max:Number.POSITIVE_INFINITY,value:31536e6,name:"year"}],hS={justNow:"just now",past:e=>e.match(/\d/)?`${e} ago`:e,future:e=>e.match(/\d/)?`in ${e}`:e,month:(e,t)=>1===e?t?"last month":"next month":`${e} month${e>1?"s":""}`,year:(e,t)=>1===e?t?"last year":"next year":`${e} year${e>1?"s":""}`,day:(e,t)=>1===e?t?"yesterday":"tomorrow":`${e} day${e>1?"s":""}`,week:(e,t)=>1===e?t?"last week":"next week":`${e} week${e>1?"s":""}`,hour:e=>`${e} hour${e>1?"s":""}`,minute:e=>`${e} minute${e>1?"s":""}`,second:e=>`${e} second${e>1?"s":""}`,invalid:""};function mS(e){return e.toISOString().slice(0,10)}function vS(e,n={}){const{controls:r=!1,updateInterval:o=3e4}=n,{now:i,...a}=dS({interval:o,controls:!0}),l=t.computed((()=>function(e,t={},n=Date.now()){var r;const{max:o,messages:i=hS,fullDateFormatter:a=mS,units:l=fS,showSecond:s=!1,rounding:c="round"}=t,u="number"==typeof c?e=>+e.toFixed(c):Math[c],d=+n-+e,p=Math.abs(d);function f(e,t){return u(Math.abs(e)/t.value)}function h(e,t){const n=f(e,t),r=e>0,o=m(t.name,n,r);return m(r?"past":"future",o,r)}function m(e,t,n){const r=i[e];return"function"==typeof r?r(t,n):r.replace("{0}",t.toString())}if(p<6e4&&!s)return i.justNow;if("number"==typeof o&&p>o)return a(new Date(e));if("string"==typeof o){const t=null==(r=l.find((e=>e.name===o)))?void 0:r.max;if(t&&p>t)return a(new Date(e))}for(const[v,g]of l.entries()){if(f(d,g)<=0&&l[v-1])return h(d,l[v-1]);if(p<g.max)return h(d,g)}return i.invalid}(new Date(wO(e)),n,wO(i))));return r?{timeAgo:l,...a}:l}const gS=function(e){let n,r=!1;const o=t.effectScope(!0);return(...t)=>(r||(n=o.run((()=>e(...t))),r=!0),n)}((()=>{const e=t.ref(bO()),n=t.ref(hO),r=t.ref({}),o=t.ref(null),i=t.ref([]),a=t.ref(!1),l=t.ref(!1),s=t.ref(null),c=t.ref(!1);t.watch((()=>n.value.page),(({defaultBackground:e,defaultMargin:t,defaultOrientation:o,watermark:i,showBreakMarks:a})=>{r.value={size:n.value.dicts.pageSizes.find((e=>e.default)),margin:t,background:e,orientation:o,watermark:i,showBreakMarks:a,showLineNumber:!1,showToc:!1,zoomLevel:100,autoWidth:!1,preview:{enabled:!1,laserPointer:!0}}}),{immediate:!0,once:!0});return t.watch((()=>n.value.document.readOnly),(async t=>{o.value.setEditable(!t),e.value=bO()})),{toolbarKey:e,container:`#umo-editor-${bO(4)}`,options:n,page:r,editor:o,tableOfContents:i,imagePreview:a,searchReplace:l,savedAt:s,editorDestroyed:c,setOptions:e=>{const t=(null==e?void 0:e.value)||e;return n.value=gO.merge(n.value,Object.keys(t).reduce(((e,n)=>(void 0!==t[n]&&(e[n]=t[n]),e)),{})),n.value},setEditor:e=>o.value=e,resetStore:()=>{o.value=null,i.value=[],l.value=!1,s.value=null,c.value=!0}}})),bS=(e,t)=>{const{options:n}=gS();let r=null;switch(e){case"toolbar":r={mode:n.value.toolbar.defaultMode,show:!0};break;case"document":const{id:e,title:t,content:o,enableMarkdown:i,enableSpellcheck:a,enableBubbleMenu:l}=n.value.document;r={id:e,title:t,content:o,markdown:i,spellcheck:a,bubbleMenu:l};break;case"recent":r={fonts:[],colors:[]};break;default:console.error("[useStorage]","Key is not valid")}return iS(`umo-editor:${t||n.value.editorKey}:${e}`,r)},yS=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},wS={class:"keyboard-shortcuts"},kS={class:"keyboard-shortcuts-title"},xS={class:"keyboard-shortcuts"},CS=["innerHTML"],OS={class:"keyboard-shortcut"},SS={key:0},ES={key:1},NS=yS({__name:"shortcuts",setup(e){const n=bS("document"),r=t.ref([{title:"常用快捷键",items:[{label:"复制",keys:["Ctrl","C"]},{label:"粘贴",keys:["Ctrl","V"]},{label:"粘贴纯文本",keys:["Ctrl","Shift","V"]},{label:"撤销",keys:["Ctrl","Z"]},{label:"重做",keys:["Ctrl","Y"]},{label:"全选",keys:["Ctrl","A"]},{label:"查找/替换",keys:["Ctrl","F"]},{label:"插入新段落",keys:["Enter"]},{label:"换行",keys:["Shift","Enter"]},{label:"保存",keys:["Ctrl","S"]}]},{title:"文字格式",items:[{icon:"bold",tag:"b",label:"粗体",keys:["Ctrl","B"]},{icon:"italic",tag:"i",label:"斜体",keys:["Ctrl","I"]},{icon:"underline",tag:"u",label:"下划线",keys:["Ctrl","U"]},{icon:"strike",tag:"s",label:"删除线",keys:["Ctrl","Shift","X"]},{icon:"indent",label:"减少缩进",keys:["Shift","Tab"]},{icon:"outdent",label:"增加缩进",keys:["Tab"]}]},{title:"页面显示",items:[{label:"插入分页",keys:["Ctrl","Enter"]},{label:"页面放大",keys:["Ctrl","+"]},{label:"页面缩小",keys:["Ctrl","-"]},{label:"缩放到初始比例",keys:["Ctrl","1"]},{label:"缩放到最佳比例",keys:["Ctrl","0"]},{label:"演示模式",keys:["F5"]},{label:"全屏模式",keys:["F11"]}]}]);return n.value.markdown&&r.value.push({title:"Markdown 格式",items:[{html:"H<sub>1</sub>",tag:"b",className:"heading1",label:"标题1",keys:["#","⎵"]},{html:"H<sub>2</sub>",tag:"b",className:"heading2",label:"标题2",keys:["##","⎵"]},{html:"H<sub>3</sub>",tag:"b",className:"heading3",label:"标题3",keys:["###","⎵"]},{html:"H<sub>4</sub>",tag:"b",className:"heading4",label:"标题4",keys:["####","⎵"]},{html:"H<sub>5</sub>",tag:"b",className:"heading5",label:"标题5",keys:["#####","⎵"]},{html:"H<sub>6</sub>",tag:"b",className:"heading6",label:"标题6",keys:["######","⎵"]},{icon:"bold",tag:"b",label:"粗体",keys:["**","TEXT","**"]},{icon:"italic",tag:"i",label:"斜体",keys:["*","TEXT","*"]},{icon:"strike",tag:"s",label:"删除线",keys:["~~","TEXT","~~"]},{icon:"subscript",tag:"sub",label:"下标",keys:["~","TEXT","~"]},{icon:"superscript",tag:"sup",label:"上标",keys:["^","TEXT","^"]},{icon:"bullet-list",label:"· 无序列表",keys:["*","⎵"]},{icon:"ordered-list",label:"1. 有序列表",keys:["1.","⎵"]},{icon:"task",label:"待办事项",keys:["[ ]","⎵"]},{icon:"quote",tag:"blockquote",label:"引用",keys:[">","⎵"]},{icon:"code",tag:"code",label:"代码",keys:["`","TEXT","`"]},{icon:"mathematics",label:"数学公式",keys:["$","TEXT","$"]},{icon:"highlight",tag:"mark",label:"文本高亮",keys:["==","TEXT","=="]},{icon:"horizontal-line",label:"分割线",keys:["---","Enter"]}]}),(e,n)=>{const o=QC;return t.openBlock(),t.createElementBlock("div",wS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,((e,n)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:n},[t.createElementVNode("div",kS,t.toDisplayString(e.title),1),t.createElementVNode("ul",xS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,((e,n)=>(t.openBlock(),t.createElementBlock("li",{key:n},[t.createElementVNode("span",{class:t.normalizeClass(e.className?"keyboard-shortcut-"+e.className:"")},[e.icon?(t.openBlock(),t.createBlock(o,{key:0,name:e.icon},null,8,["name"])):e.html?(t.openBlock(),t.createElementBlock("span",{key:1,class:"icon",innerHTML:e.html},null,8,CS)):t.createCommentVNode("",!0),e.tag?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),{key:2},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.label),1)])),_:2},1024)):(t.openBlock(),t.createElementBlock("span",{key:3,class:t.normalizeClass(e.className||"")},t.toDisplayString(e.label),3))],2),t.createElementVNode("div",OS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.keys,(e=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:e},["TEXT"!==e?(t.openBlock(),t.createElementBlock("kbd",SS,t.toDisplayString(t.unref(eO)(e)),1)):(t.openBlock(),t.createElementBlock("span",ES,"文字"))],64)))),128))])])))),128))])],64)))),128))])}}},[["__scopeId","data-v-4d7c8d54"]]),_S={__name:"tooltip",props:{content:{}},setup(e){const{container:n}=gS();return(r,o)=>{const i=Mv;return t.openBlock(),t.createBlock(i,{content:e.content,theme:"light",placement:"top",attach:t.unref(n),"show-arrow":!1,"destroy-on-close":""},{default:t.withCtx((()=>[t.renderSlot(r.$slots,"default")])),_:3},8,["content","attach"])}}},MS="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function AS(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function TS(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on".concat(t),n)}function VS(e,t){const n=t.slice(0,t.length-1);for(let r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function jS(e){"string"!=typeof e&&(e="");const t=(e=e.replace(/\s/g,"")).split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}const BS={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":MS?173:189,"=":MS?61:187,";":MS?59:186,"'":222,"[":219,"]":221,"\\":220},PS={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},IS={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},DS={16:!1,18:!1,17:!1,91:!1},LS={};for(let os=1;os<20;os++)BS["f".concat(os)]=111+os;let RS=[],zS=null,FS="all";const $S=new Map,HS=e=>BS[e.toLowerCase()]||PS[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function US(e){FS=e||"all"}function WS(){return FS||"all"}function qS(e){if(void 0===e)Object.keys(LS).forEach((e=>{Array.isArray(LS[e])&&LS[e].forEach((e=>KS(e))),delete LS[e]})),ZS(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&KS(e)}));else if("object"==typeof e)e.key&&KS(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let[o,i]=n;"function"==typeof o&&(i=o,o=""),KS({key:e,scope:o,method:i,splitKey:"+"})}}const KS=e=>{let{key:t,scope:n,method:r,splitKey:o="+"}=e;jS(t).forEach((e=>{const t=e.split(o),i=t.length,a=t[i-1],l="*"===a?"*":HS(a);if(!LS[l])return;n||(n=WS());const s=i>1?VS(PS,t):[],c=[];LS[l]=LS[l].filter((e=>{const t=(!r||e.method===r)&&e.scope===n&&function(e,t){const n=e.length>=t.length?e:t,r=e.length>=t.length?t:e;let o=!0;for(let i=0;i<n.length;i++)-1===r.indexOf(n[i])&&(o=!1);return o}(e.mods,s);return t&&c.push(e.element),!t})),c.forEach((e=>ZS(e)))}))};function GS(e,t,n,r){if(t.element!==r)return;let o;if(t.scope===n||"all"===t.scope){o=t.mods.length>0;for(const e in DS)Object.prototype.hasOwnProperty.call(DS,e)&&(!DS[e]&&t.mods.indexOf(+e)>-1||DS[e]&&-1===t.mods.indexOf(+e))&&(o=!1);(0!==t.mods.length||DS[16]||DS[18]||DS[17]||DS[91])&&!o&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(RS),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function YS(e,t){const n=LS["*"];let r=e.keyCode||e.which||e.charCode;if(!XS.filter.call(this,e))return;if(93!==r&&224!==r||(r=91),-1===RS.indexOf(r)&&229!==r&&RS.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const n=IS[t];e[t]&&-1===RS.indexOf(n)?RS.push(n):!e[t]&&RS.indexOf(n)>-1?RS.splice(RS.indexOf(n),1):"metaKey"===t&&e[t]&&3===RS.length&&(e.ctrlKey||e.shiftKey||e.altKey||(RS=RS.slice(RS.indexOf(n))))})),r in DS){DS[r]=!0;for(const e in PS)PS[e]===r&&(XS[e]=!0);if(!n)return}for(const l in DS)Object.prototype.hasOwnProperty.call(DS,l)&&(DS[l]=e[IS[l]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===RS.indexOf(17)&&RS.push(17),-1===RS.indexOf(18)&&RS.push(18),DS[17]=!0,DS[18]=!0);const o=WS();if(n)for(let l=0;l<n.length;l++)n[l].scope===o&&("keydown"===e.type&&n[l].keydown||"keyup"===e.type&&n[l].keyup)&&GS(e,n[l],o,t);if(!(r in LS))return;const i=LS[r],a=i.length;for(let l=0;l<a;l++)if(("keydown"===e.type&&i[l].keydown||"keyup"===e.type&&i[l].keyup)&&i[l].key){const n=i[l],{splitKey:r}=n,a=n.key.split(r),s=[];for(let e=0;e<a.length;e++)s.push(HS(a[e]));s.sort().join("")===RS.sort().join("")&&GS(e,n,o,t)}}function XS(e,t,n){RS=[];const r=jS(e);let o=[],i="all",a=document,l=0,s=!1,c=!0,u="+",d=!1,p=!1;for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(i=t.scope),t.element&&(a=t.element),t.keyup&&(s=t.keyup),void 0!==t.keydown&&(c=t.keydown),void 0!==t.capture&&(d=t.capture),"string"==typeof t.splitKey&&(u=t.splitKey),!0===t.single&&(p=!0)),"string"==typeof t&&(i=t),p&&qS(e,i);l<r.length;l++)o=[],(e=r[l].split(u)).length>1&&(o=VS(PS,e)),(e="*"===(e=e[e.length-1])?"*":HS(e))in LS||(LS[e]=[]),LS[e].push({keyup:s,keydown:c,scope:i,mods:o,shortcut:r[l],method:n,key:r[l],splitKey:u,element:a});if(void 0!==a&&window){if(!$S.has(a)){const e=function(){return YS(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,a)},t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;YS(e,a),function(e){let t=e.keyCode||e.which||e.charCode;const n=RS.indexOf(t);if(n>=0&&RS.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&RS.splice(0,RS.length),93!==t&&224!==t||(t=91),t in DS){DS[t]=!1;for(const e in PS)PS[e]===t&&(XS[e]=!1)}}(e)};$S.set(a,{keydownListener:e,keyupListenr:t,capture:d}),AS(a,"keydown",e,d),AS(a,"keyup",t,d)}if(!zS){const e=()=>{RS=[]};zS={listener:e,capture:d},AS(window,"focus",e,d)}}}function ZS(e){const t=Object.values(LS).flat();if(t.findIndex((t=>{let{element:n}=t;return n===e}))<0){const{keydownListener:t,keyupListenr:n,capture:r}=$S.get(e)||{};t&&n&&(TS(e,"keyup",n,r),TS(e,"keydown",t,r),$S.delete(e))}if(t.length<=0||$S.size<=0){if(Object.keys($S).forEach((e=>{const{keydownListener:t,keyupListenr:n,capture:r}=$S.get(e)||{};t&&n&&(TS(e,"keyup",n,r),TS(e,"keydown",t,r),$S.delete(e))})),$S.clear(),Object.keys(LS).forEach((e=>delete LS[e])),zS){const{listener:e,capture:t}=zS;TS(window,"focus",e,t),zS=null}}}const JS={getPressedKeyString:function(){return RS.map((e=>{return t=e,Object.keys(BS).find((e=>BS[e]===t))||(e=>Object.keys(PS).find((t=>PS[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:US,getScope:WS,deleteScope:function(e,t){let n,r;e||(e=WS());for(const o in LS)if(Object.prototype.hasOwnProperty.call(LS,o))for(n=LS[o],r=0;r<n.length;)if(n[r].scope===e){n.splice(r,1).forEach((e=>{let{element:t}=e;return ZS(t)}))}else r++;WS()===e&&US(t||"all")},getPressedKeyCodes:function(){return RS.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(LS).forEach((t=>{LS[t].forEach((t=>{let{key:n,scope:r,mods:o,shortcut:i}=t;e.push({scope:r,shortcut:i,mods:o,keys:n.split("+").map((e=>HS(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=HS(e)),-1!==RS.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:n}=t;let r=!0;const o="INPUT"===n&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||"TEXTAREA"===n||"SELECT"===n)&&!t.readOnly)&&(r=!1),r},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(LS).forEach((n=>{LS[n].filter((n=>n.scope===t&&n.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:qS,keyMap:BS,modifier:PS,modifierMap:IS};for(const os in JS)Object.prototype.hasOwnProperty.call(JS,os)&&(XS[os]=JS[os]);if("undefined"!=typeof window){const e=window.hotkeys;XS.noConflict=t=>(t&&window.hotkeys===XS&&(window.hotkeys=e),XS),window.hotkeys=XS}const QS=(e,t)=>{XS.filter=()=>!0,XS(e,(e=>(e.preventDefault(),t(),!1)))};function eE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tE(e,t){if(e){if("string"==typeof e)return eE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eE(e,t):void 0}}function nE(e){return function(e){if(Array.isArray(e))return eE(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tE(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rE(e){return(rE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oE(e){var t=function(e,t){if("object"!=rE(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=rE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rE(t)?t:t+""}function iE(e,t,n){return(t=oE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var aE="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var lE=function(e){var t=rE(e);return null!=e&&("object"==t||"function"==t)},sE="object"==rE(aE)&&aE&&aE.Object===Object&&aE,cE=sE,uE="object"==("undefined"==typeof self?"undefined":rE(self))&&self&&self.Object===Object&&self,dE=cE||uE||Function("return this")(),pE=dE.Symbol,fE=pE,hE=Object.prototype,mE=hE.hasOwnProperty,vE=hE.toString,gE=fE?fE.toStringTag:void 0;var bE=function(e){var t=mE.call(e,gE),n=e[gE];try{e[gE]=void 0;var r=!0}catch(i){}var o=vE.call(e);return r&&(t?e[gE]=n:delete e[gE]),o},yE=Object.prototype.toString;var wE=bE,kE=function(e){return yE.call(e)},xE=pE?pE.toStringTag:void 0;var CE=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":xE&&xE in Object(e)?wE(e):kE(e)},OE=CE,SE=lE;var EE=function(e){if(!SE(e))return!1;var t=OE(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},NE=dE["__core-js_shared__"],_E=function(){var e=/[^.]+$/.exec(NE&&NE.keys&&NE.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var ME=function(e){return!!_E&&_E in e},AE=Function.prototype.toString;var TE=function(e){if(null!=e){try{return AE.call(e)}catch(t){}try{return e+""}catch(t){}}return""},VE=EE,jE=ME,BE=lE,PE=TE,IE=/^\[object .+?Constructor\]$/,DE=Function.prototype,LE=Object.prototype,RE=DE.toString,zE=LE.hasOwnProperty,FE=RegExp("^"+RE.call(zE).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $E=function(e){return!(!BE(e)||jE(e))&&(VE(e)?FE:IE).test(PE(e))},HE=function(e,t){return null==e?void 0:e[t]};var UE=function(e,t){var n=HE(e,t);return $E(n)?n:void 0},WE=UE(dE,"Map"),qE=UE,KE=function(){try{var e=qE(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();var GE=function(e,t){return e===t||e!=e&&t!=t},YE=KE;var XE=function(e,t,n){"__proto__"==t&&YE?YE(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ZE=XE,JE=GE,QE=Object.prototype.hasOwnProperty;var eN=function(e,t,n){var r=e[t];QE.call(e,t)&&JE(r,n)&&(void 0!==n||t in e)||ZE(e,t,n)};var tN=function(){this.__data__=[],this.size=0},nN=GE;var rN=function(e,t){for(var n=e.length;n--;)if(nN(e[n][0],t))return n;return-1},oN=rN,iN=Array.prototype.splice;var aN=rN;var lN=rN;var sN=rN;var cN=tN,uN=function(e){var t=this.__data__,n=oN(t,e);return!(n<0)&&(n==t.length-1?t.pop():iN.call(t,n,1),--this.size,!0)},dN=function(e){var t=this.__data__,n=aN(t,e);return n<0?void 0:t[n][1]},pN=function(e){return lN(this.__data__,e)>-1},fN=function(e,t){var n=this.__data__,r=sN(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function hN(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hN.prototype.clear=cN,hN.prototype.delete=uN,hN.prototype.get=dN,hN.prototype.has=pN,hN.prototype.set=fN;var mN=hN,vN=UE(Object,"create"),gN=vN;var bN=function(){this.__data__=gN?gN(null):{},this.size=0};var yN=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wN=vN,kN=Object.prototype.hasOwnProperty;var xN=function(e){var t=this.__data__;if(wN){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return kN.call(t,e)?t[e]:void 0},CN=vN,ON=Object.prototype.hasOwnProperty;var SN=vN;var EN=bN,NN=yN,_N=xN,MN=function(e){var t=this.__data__;return CN?void 0!==t[e]:ON.call(t,e)},AN=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=SN&&void 0===t?"__lodash_hash_undefined__":t,this};function TN(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}TN.prototype.clear=EN,TN.prototype.delete=NN,TN.prototype.get=_N,TN.prototype.has=MN,TN.prototype.set=AN;var VN=TN,jN=mN,BN=WE;var PN=function(e){var t=rE(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var IN=function(e,t){var n=e.__data__;return PN(t)?n["string"==typeof t?"string":"hash"]:n.map},DN=IN;var LN=IN;var RN=IN;var zN=IN;var FN=function(){this.size=0,this.__data__={hash:new VN,map:new(BN||jN),string:new VN}},$N=function(e){var t=DN(this,e).delete(e);return this.size-=t?1:0,t},HN=function(e){return LN(this,e).get(e)},UN=function(e){return RN(this,e).has(e)},WN=function(e,t){var n=zN(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function qN(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}qN.prototype.clear=FN,qN.prototype.delete=$N,qN.prototype.get=HN,qN.prototype.has=UN,qN.prototype.set=WN;var KN=qN;var GN=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},YN=EE,XN=GN;var ZN=function(e){return null!=e&&XN(e.length)&&!YN(e)};var JN=function(e){return null!=e&&"object"==rE(e)};var QN=function(e){return function(t){return e(t)}},e_={exports:{}};var t_=function(){return!1};!function(e,t){var n=dE,r=t_,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||r;e.exports=l}(e_,e_.exports);var n_=CE,r_=GN,o_=JN,i_={};i_["[object Float32Array]"]=i_["[object Float64Array]"]=i_["[object Int8Array]"]=i_["[object Int16Array]"]=i_["[object Int32Array]"]=i_["[object Uint8Array]"]=i_["[object Uint8ClampedArray]"]=i_["[object Uint16Array]"]=i_["[object Uint32Array]"]=!0,i_["[object Arguments]"]=i_["[object Array]"]=i_["[object ArrayBuffer]"]=i_["[object Boolean]"]=i_["[object DataView]"]=i_["[object Date]"]=i_["[object Error]"]=i_["[object Function]"]=i_["[object Map]"]=i_["[object Number]"]=i_["[object Object]"]=i_["[object RegExp]"]=i_["[object Set]"]=i_["[object String]"]=i_["[object WeakMap]"]=!1;var a_=function(e){return o_(e)&&r_(e.length)&&!!i_[n_(e)]},l_={exports:{}};!function(e,t){var n=sE,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(t){}}();e.exports=a}(l_,l_.exports);var s_=a_,c_=QN,u_=l_.exports,d_=u_&&u_.isTypedArray,p_=d_?c_(d_):s_,f_=Object.prototype;var h_=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||f_)};var m_=function(e,t){return function(n){return e(t(n))}},v_=CE,g_=JN;var b_=function(e){return g_(e)&&"[object Arguments]"==v_(e)},y_=JN,w_=Object.prototype,k_=w_.hasOwnProperty,x_=w_.propertyIsEnumerable,C_=b_(function(){return arguments}())?b_:function(e){return y_(e)&&k_.call(e,"callee")&&!x_.call(e,"callee")},O_=C_,S_=Array.isArray,E_=/^(?:0|[1-9]\d*)$/;var N_=function(e,t){var n=rE(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&E_.test(e))&&e>-1&&e%1==0&&e<t};var __=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},M_=O_,A_=S_,T_=e_.exports,V_=N_,j_=p_,B_=Object.prototype.hasOwnProperty;var P_=function(e,t){var n=A_(e),r=!n&&M_(e),o=!n&&!r&&T_(e),i=!n&&!r&&!o&&j_(e),a=n||r||o||i,l=a?__(e.length,String):[],s=l.length;for(var c in e)!t&&!B_.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||V_(c,s))||l.push(c);return l},I_=mN;var D_=mN,L_=WE,R_=KN;var z_=mN,F_=function(){this.__data__=new I_,this.size=0},$_=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},H_=function(e){return this.__data__.get(e)},U_=function(e){return this.__data__.has(e)},W_=function(e,t){var n=this.__data__;if(n instanceof D_){var r=n.__data__;if(!L_||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new R_(r)}return n.set(e,t),this.size=n.size,this};function q_(e){var t=this.__data__=new z_(e);this.size=t.size}q_.prototype.clear=F_,q_.prototype.delete=$_,q_.prototype.get=H_,q_.prototype.has=U_,q_.prototype.set=W_;var K_=q_,G_=dE.Uint8Array,Y_={exports:{}};!function(e,t){var n=dE,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(Y_,Y_.exports);var X_=G_;var Z_=function(e){var t=new e.constructor(e.byteLength);return new X_(t).set(new X_(e)),t},J_=Z_;var Q_=function(e,t){var n=t?J_(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var eM=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},tM=lE,nM=Object.create,rM=function(){function e(){}return function(t){if(!tM(t))return{};if(nM)return nM(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),oM=m_(Object.getPrototypeOf,Object),iM=rM,aM=oM,lM=h_;var sM=function(e){return"function"!=typeof e.constructor||lM(e)?{}:iM(aM(e))},cM=eN,uM=XE;var dM=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var l=t[i],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),o?uM(n,l,s):cM(n,l,s)}return n};var pM=lE,fM=h_,hM=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},mM=Object.prototype.hasOwnProperty;var vM=P_,gM=function(e){if(!pM(e))return hM(e);var t=fM(e),n=[];for(var r in e)("constructor"!=r||!t&&mM.call(e,r))&&n.push(r);return n},bM=ZN;var yM=function(e){return bM(e)?vM(e,!0):gM(e)};var wM=function(e){return e};var kM=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},xM=Math.max;var CM=function(e,t,n){return t=xM(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=xM(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),kM(e,this,l)}};var OM=function(e){return function(){return e}},SM=KE,EM=SM?function(e,t){return SM(e,"toString",{configurable:!0,enumerable:!1,value:OM(t),writable:!0})}:wM,NM=Date.now;var _M=function(e){var t=0,n=0;return function(){var r=NM(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},MM=_M(EM),AM=ZN,TM=JN;var VM=function(e){return TM(e)&&AM(e)},jM=wM,BM=CM,PM=MM;var IM=function(e,t){return PM(BM(e,t,jM),e+"")},DM=CE,LM=oM,RM=JN,zM=Function.prototype,FM=Object.prototype,$M=zM.toString,HM=FM.hasOwnProperty,UM=$M.call(Object);var WM=function(e){if(!RM(e)||"[object Object]"!=DM(e))return!1;var t=LM(e);if(null===t)return!0;var n=HM.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&$M.call(n)==UM},qM=GE,KM=ZN,GM=N_,YM=lE;var XM=function(e,t,n){if(!YM(n))return!1;var r=rE(t);return!!("number"==r?KM(n)&&GM(t,n.length):"string"==r&&t in n)&&qM(n[t],e)};var ZM=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}(),JM=XE,QM=GE;var eA=function(e,t,n){(void 0!==n&&!QM(e[t],n)||void 0===n&&!(t in e))&&JM(e,t,n)};var tA=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},nA=dM,rA=yM;var oA=eA,iA=Y_.exports,aA=Q_,lA=eM,sA=sM,cA=O_,uA=S_,dA=VM,pA=e_.exports,fA=EE,hA=lE,mA=WM,vA=p_,gA=tA,bA=function(e){return nA(e,rA(e))};var yA=K_,wA=eA,kA=ZM,xA=function(e,t,n,r,o,i,a){var l=gA(e,n),s=gA(t,n),c=a.get(s);if(c)oA(e,n,c);else{var u=i?i(l,s,n+"",e,t,a):void 0,d=void 0===u;if(d){var p=uA(s),f=!p&&pA(s),h=!p&&!f&&vA(s);u=s,p||f||h?uA(l)?u=l:dA(l)?u=lA(l):f?(d=!1,u=iA(s,!0)):h?(d=!1,u=aA(s,!0)):u=[]:mA(s)||cA(s)?(u=l,cA(l)?u=bA(l):hA(l)&&!fA(l)||(u=sA(s))):d=!1}d&&(a.set(s,u),o(u,s,r,i,a),a.delete(s)),oA(e,n,u)}},CA=lE,OA=yM,SA=tA;var EA=function e(t,n,r,o,i){t!==n&&kA(n,(function(a,l){if(i||(i=new yA),CA(a))xA(t,n,l,r,e,o,i);else{var s=o?o(SA(t,l),a,l+"",t,n,i):void 0;void 0===s&&(s=a),wA(t,l,s)}}),OA)},NA=IM,_A=XM;var MA=function(e){return NA((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&_A(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,i)}return t}))},AA=EA,TA=MA((function(e,t,n){AA(e,t,n)})),VA=EA;MA((function(e,t,n,r){VA(e,t,n,r)}));var jA=function(e){return e.ripple="ripple",e.expand="expand",e.fade="fade",e}(jA||{}),BA=TA({classPrefix:"t",animation:{include:["ripple","expand","fade"],exclude:[]},calendar:{firstDayOfWeek:1,fillWithZero:!0,controllerConfig:void 0},icon:{},input:{autocomplete:""},dialog:{closeOnEscKeydown:!0,closeOnOverlayClick:!0,confirmBtnTheme:{default:"primary",info:"primary",warning:"primary",danger:"primary",success:"primary"}},message:{},popconfirm:{confirmBtnTheme:{default:"primary",warning:"primary",danger:"primary"}},table:{expandIcon:void 0,sortIcon:void 0,filterIcon:void 0,treeExpandAndFoldIcon:void 0,hideSortTips:!1,size:"medium"},select:{clearIcon:void 0,filterable:!1},drawer:{closeOnEscKeydown:!0,closeOnOverlayClick:!0,size:"small"},tree:{folderIcon:void 0},datePicker:{firstDayOfWeek:1},steps:{checkIcon:void 0,errorIcon:void 0},tag:{closeIcon:void 0},form:{requiredMark:void 0}},{pagination:{itemsPerPage:"{size} 条/页",jumpTo:"跳至",page:"页",total:"共 {total} 条数据"},cascader:{empty:"暂无数据",loadingText:"加载中",placeholder:"请选择"},calendar:{yearSelection:"{year} 年",monthSelection:"{month} 月",yearRadio:"年",monthRadio:"月",hideWeekend:"隐藏周末",showWeekend:"显示周末",today:"今天",thisMonth:"本月",week:"一,二,三,四,五,六,日",cellMonth:"1 月,2 月,3 月,4 月,5 月,6 月,7 月,8 月,9 月,10 月,11 月,12 月"},transfer:{title:"{checked} / {total} 项",empty:"暂无数据",placeholder:"请输入关键词搜索"},timePicker:{dayjsLocale:"zh-cn",now:"此刻",confirm:"确定",anteMeridiem:"上午",postMeridiem:"下午",placeholder:"选择时间"},dialog:{confirm:"确认",cancel:"取消"},drawer:{confirm:"确认",cancel:"取消"},popconfirm:{confirm:{content:"确定"},cancel:{content:"取消"}},table:{empty:"暂无数据",loadingText:"正在加载中,请稍后",loadingMoreText:"点击加载更多",filterInputPlaceholder:"请输入内容(无默认值)",sortAscendingOperationText:"点击升序",sortCancelOperationText:"点击取消排序",sortDescendingOperationText:"点击降序",clearFilterResultButtonText:"清空筛选",columnConfigButtonText:"列配置",columnConfigTitleText:"表格列配置",columnConfigDescriptionText:"请选择需要在表格中显示的数据列",confirmText:"确认",cancelText:"取消",resetText:"重置",selectAllText:"全选",searchResultText:"搜索“{result}”,找到 {count} 条结果"},select:{empty:"暂无数据",loadingText:"加载中",placeholder:"请选择"},tree:{empty:"暂无数据"},treeSelect:{empty:"暂无数据",loadingText:"加载中",placeholder:"请选择"},datePicker:{dayjsLocale:"zh-cn",placeholder:{date:"请选择日期",month:"请选择月份",year:"请选择年份",quarter:"请选择季度",week:"请选择周"},weekdays:["一","二","三","四","五","六","日"],months:["1 月","2 月","3 月","4 月","5 月","6 月","7 月","8 月","9 月","10 月","11 月","12 月"],quarters:["一季度","二季度","三季度","四季度"],rangeSeparator:" - ",direction:"ltr",format:"YYYY-MM-DD",dayAriaLabel:"日",weekAbbreviation:"周",yearAriaLabel:"年",monthAriaLabel:"月",confirm:"确定",selectTime:"选择时间",selectDate:"选择日期",nextYear:"下一年",preYear:"上一年",nextMonth:"下个月",preMonth:"上个月",preDecade:"上个十年",nextDecade:"下个十年",now:"当前"},upload:{sizeLimitMessage:"文件大小不能超过 {sizeLimit}",cancelUploadText:"取消上传",triggerUploadText:{fileInput:"选择文件",image:"点击上传图片",normal:"点击上传",reupload:"重新选择",continueUpload:"继续选择",delete:"删除",uploading:"上传中"},dragger:{dragDropText:"释放鼠标",draggingText:"拖拽到此区域",clickAndDragText:"点击上方“选择文件”或将文件拖拽到此区域"},file:{fileNameText:"文件名",fileSizeText:"文件大小",fileStatusText:"状态",fileOperationText:"操作",fileOperationDateText:"上传日期"},progress:{uploadingText:"上传中",waitingText:"待上传",failText:"上传失败",successText:"上传成功"}},form:{errorMessage:{date:"请输入正确的${name}",url:"请输入正确的${name}",required:"${name}必填",max:"${name}字符长度不能超过 ${validate} 个字符,一个中文等于两个字符",min:"${name}字符长度不能少于 ${validate} 个字符,一个中文等于两个字符",len:"${name}字符长度必须是 ${validate}",enum:"${name}只能是${validate}等",idcard:"请输入正确的${name}",telnumber:"请输入正确的${name}",pattern:"请输入正确的${name}",validator:"${name}不符合要求",boolean:"${name}数据类型必须是布尔类型",number:"${name}必须是数字"}},input:{placeholder:"请输入"},list:{loadingText:"正在加载中,请稍等",loadingMoreText:"点击加载更多"},alert:{expandText:"展开更多",collapseText:"收起"},anchor:{copySuccessText:"链接复制成功",copyText:"复制链接"},colorPicker:{swatchColorTitle:"系统预设颜色",recentColorTitle:"最近使用颜色",clearConfirmText:"确定清空最近使用的颜色吗?"},guide:{finishButtonProps:{content:"完成",theme:"primary"},nextButtonProps:{content:"下一步",theme:"primary"},skipButtonProps:{content:"跳过",theme:"default"},prevButtonProps:{content:"上一步",theme:"default"}},image:{errorText:"图片无法显示",loadingText:"图片加载中"},imageViewer:{errorText:"图片加载失败,可尝试重新加载",mirrorTipText:"镜像",rotateTipText:"旋转",originalSizeTipText:"原始大小"},typography:{expand:"展开",collapse:"收起",copied:"复制成功"}}),PA=Symbol("configProvide"),IA=UE(dE,"Set"),DA=m_(Object.keys,Object),LA=h_,RA=DA,zA=Object.prototype.hasOwnProperty;var FA=function(e){if(!LA(e))return RA(e);var t=[];for(var n in Object(e))zA.call(e,n)&&"constructor"!=n&&t.push(n);return t},$A=UE(dE,"DataView"),HA=WE,UA=UE(dE,"Promise"),WA=IA,qA=UE(dE,"WeakMap"),KA=CE,GA=TE,YA="[object Map]",XA="[object Promise]",ZA="[object Set]",JA="[object WeakMap]",QA="[object DataView]",eT=GA($A),tT=GA(HA),nT=GA(UA),rT=GA(WA),oT=GA(qA),iT=KA;($A&&iT(new $A(new ArrayBuffer(1)))!=QA||HA&&iT(new HA)!=YA||UA&&iT(UA.resolve())!=XA||WA&&iT(new WA)!=ZA||qA&&iT(new qA)!=JA)&&(iT=function(e){var t=KA(e),n="[object Object]"==t?e.constructor:void 0,r=n?GA(n):"";if(r)switch(r){case eT:return QA;case tT:return YA;case nT:return XA;case rT:return ZA;case oT:return JA}return t});var aT=iT;var lT=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e};var sT=P_,cT=FA,uT=ZN;var dT=function(e){return uT(e)?sT(e):cT(e)},pT=lT,fT=S_;var hT=function(e,t,n){var r=t(e);return fT(e)?r:pT(r,n(e))};var mT=function(){return[]},vT=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i},gT=mT,bT=Object.prototype.propertyIsEnumerable,yT=Object.getOwnPropertySymbols,wT=yT?function(e){return null==e?[]:(e=Object(e),vT(yT(e),(function(t){return bT.call(e,t)})))}:gT,kT=hT,xT=wT,CT=dT;var OT=function(e){return kT(e,CT,xT)};var ST=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},ET=dM,NT=dT;var _T=function(e,t){return e&&ET(t,NT(t),e)},MT=dM,AT=yM;var TT=function(e,t){return e&&MT(t,AT(t),e)},VT=dM,jT=wT;var BT=function(e,t){return VT(e,jT(e),t)},PT=lT,IT=oM,DT=wT,LT=mT,RT=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)PT(t,DT(e)),e=IT(e);return t}:LT,zT=dM,FT=RT;var $T=function(e,t){return zT(e,FT(e),t)},HT=hT,UT=RT,WT=yM;var qT=function(e){return HT(e,WT,UT)},KT=Object.prototype.hasOwnProperty;var GT=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&KT.call(e,"index")&&(n.index=e.index,n.input=e.input),n},YT=Z_;var XT=function(e,t){var n=t?YT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},ZT=/\w*$/;var JT=function(e){var t=new e.constructor(e.source,ZT.exec(e));return t.lastIndex=e.lastIndex,t},QT=pE?pE.prototype:void 0,eV=QT?QT.valueOf:void 0;var tV=Z_,nV=XT,rV=JT,oV=function(e){return eV?Object(eV.call(e)):{}},iV=Q_;var aV=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return tV(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return nV(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return iV(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return rV(e);case"[object Symbol]":return oV(e)}},lV=aT,sV=JN;var cV=function(e){return sV(e)&&"[object Map]"==lV(e)},uV=QN,dV=l_.exports,pV=dV&&dV.isMap,fV=pV?uV(pV):cV,hV=aT,mV=JN;var vV=function(e){return mV(e)&&"[object Set]"==hV(e)},gV=QN,bV=l_.exports,yV=bV&&bV.isSet,wV=yV?gV(yV):vV,kV=K_,xV=ST,CV=eN,OV=_T,SV=TT,EV=Y_.exports,NV=eM,_V=BT,MV=$T,AV=OT,TV=qT,VV=aT,jV=GT,BV=aV,PV=sM,IV=S_,DV=e_.exports,LV=fV,RV=lE,zV=wV,FV=dT,$V=yM,HV="[object Arguments]",UV="[object Function]",WV="[object Object]",qV={};qV[HV]=qV["[object Array]"]=qV["[object ArrayBuffer]"]=qV["[object DataView]"]=qV["[object Boolean]"]=qV["[object Date]"]=qV["[object Float32Array]"]=qV["[object Float64Array]"]=qV["[object Int8Array]"]=qV["[object Int16Array]"]=qV["[object Int32Array]"]=qV["[object Map]"]=qV["[object Number]"]=qV[WV]=qV["[object RegExp]"]=qV["[object Set]"]=qV["[object String]"]=qV["[object Symbol]"]=qV["[object Uint8Array]"]=qV["[object Uint8ClampedArray]"]=qV["[object Uint16Array]"]=qV["[object Uint32Array]"]=!0,qV["[object Error]"]=qV[UV]=qV["[object WeakMap]"]=!1;var KV=function e(t,n,r,o,i,a){var l,s=1&n,c=2&n,u=4&n;if(r&&(l=i?r(t,o,i,a):r(t)),void 0!==l)return l;if(!RV(t))return t;var d=IV(t);if(d){if(l=jV(t),!s)return NV(t,l)}else{var p=VV(t),f=p==UV||"[object GeneratorFunction]"==p;if(DV(t))return EV(t,s);if(p==WV||p==HV||f&&!i){if(l=c||f?{}:PV(t),!s)return c?MV(t,SV(l,t)):_V(t,OV(l,t))}else{if(!qV[p])return i?t:{};l=BV(t,p,s)}}a||(a=new kV);var h=a.get(t);if(h)return h;a.set(t,l),zV(t)?t.forEach((function(o){l.add(e(o,n,r,o,t,a))})):LV(t)&&t.forEach((function(o,i){l.set(i,e(o,n,r,i,t,a))}));var m=d?void 0:(u?c?TV:AV:c?$V:FV)(t);return xV(m||t,(function(o,i){m&&(o=t[i=o]),CV(l,i,e(o,n,r,i,t,a))})),l};var GV=KN,YV=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},XV=function(e){return this.__data__.has(e)};function ZV(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new GV;++t<n;)this.add(e[t])}ZV.prototype.add=ZV.prototype.push=YV,ZV.prototype.has=XV;var JV=ZV,QV=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},ej=function(e,t){return e.has(t)};var tj=function(e,t,n,r,o,i){var a=1&n,l=e.length,s=t.length;if(l!=s&&!(a&&s>l))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,f=2&n?new JV:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var h=e[d],m=t[d];if(r)var v=a?r(m,h,d,t,e,i):r(h,m,d,e,t,i);if(void 0!==v){if(v)continue;p=!1;break}if(f){if(!QV(t,(function(e,t){if(!ej(f,t)&&(h===e||o(h,e,n,r,i)))return f.push(t)}))){p=!1;break}}else if(h!==m&&!o(h,m,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p};var nj=G_,rj=GE,oj=tj,ij=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},aj=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},lj=pE?pE.prototype:void 0,sj=lj?lj.valueOf:void 0;var cj=function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new nj(e),new nj(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return rj(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=ij;case"[object Set]":var s=1&r;if(l||(l=aj),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=oj(l(e),l(t),r,o,i,a);return a.delete(e),u;case"[object Symbol]":if(sj)return sj.call(e)==sj.call(t)}return!1},uj=OT,dj=Object.prototype.hasOwnProperty;var pj=K_,fj=tj,hj=cj,mj=function(e,t,n,r,o,i){var a=1&n,l=uj(e),s=l.length;if(s!=uj(t).length&&!a)return!1;for(var c=s;c--;){var u=l[c];if(!(a?u in t:dj.call(t,u)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var h=a;++c<s;){var m=e[u=l[c]],v=t[u];if(r)var g=a?r(v,m,u,t,e,i):r(m,v,u,e,t,i);if(!(void 0===g?m===v||o(m,v,n,r,i):g)){f=!1;break}h||(h="constructor"==u)}if(f&&!h){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(f=!1)}return i.delete(e),i.delete(t),f},vj=aT,gj=S_,bj=e_.exports,yj=p_,wj="[object Arguments]",kj="[object Array]",xj="[object Object]",Cj=Object.prototype.hasOwnProperty;var Oj=function(e,t,n,r,o,i){var a=gj(e),l=gj(t),s=a?kj:vj(e),c=l?kj:vj(t),u=(s=s==wj?xj:s)==xj,d=(c=c==wj?xj:c)==xj,p=s==c;if(p&&bj(e)){if(!bj(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new pj),a||yj(e)?fj(e,t,n,r,o,i):hj(e,t,s,n,r,o,i);if(!(1&n)){var f=u&&Cj.call(e,"__wrapped__"),h=d&&Cj.call(t,"__wrapped__");if(f||h){var m=f?e.value():e,v=h?t.value():t;return i||(i=new pj),o(m,v,n,r,i)}}return!!p&&(i||(i=new pj),mj(e,t,n,r,o,i))},Sj=JN;var Ej=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Sj(t)&&!Sj(n)?t!=t&&n!=n:Oj(t,n,r,o,e,i))},Nj=Ej;var _j=function(e,t){return Nj(e,t)},Mj=CE,Aj=JN;var Tj=function(e){return"symbol"==rE(e)||Aj(e)&&"[object Symbol]"==Mj(e)};var Vj=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},jj=Vj,Bj=S_,Pj=Tj,Ij=pE?pE.prototype:void 0,Dj=Ij?Ij.toString:void 0;var Lj=function e(t){if("string"==typeof t)return t;if(Bj(t))return jj(t,e)+"";if(Pj(t))return Dj?Dj.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},Rj=Lj;var zj=function(e){return null==e?"":Rj(e)},Fj=S_,$j=Tj,Hj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uj=/^\w*$/;var Wj=function(e,t){if(Fj(e))return!1;var n=rE(e);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$j(e))||(Uj.test(e)||!Hj.test(e)||null!=t&&e in Object(t))},qj=KN;function Kj(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Kj.Cache||qj),n}Kj.Cache=qj;var Gj=Kj;var Yj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xj=/\\(\\)?/g,Zj=function(e){var t=Gj(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Yj,(function(e,n,r,o){t.push(r?o.replace(Xj,"$1"):n||e)})),t})),Jj=S_,Qj=Wj,eB=Zj,tB=zj;var nB=function(e,t){return Jj(e)?e:Qj(e,t)?[e]:eB(tB(e))},rB=Tj;var oB=function(e){if("string"==typeof e||rB(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},iB=nB,aB=oB;var lB=function(e,t){for(var n=0,r=(t=iB(t,e)).length;null!=e&&n<r;)e=e[aB(t[n++])];return n&&n==r?e:void 0},sB=lB;var cB=function(e,t,n){var r=null==e?void 0:sB(e,t);return void 0===r?n:r};var uB=nB,dB=O_,pB=S_,fB=N_,hB=GN,mB=oB;var vB=function(e,t){return null!=e&&t in Object(e)},gB=function(e,t,n){for(var r=-1,o=(t=uB(t,e)).length,i=!1;++r<o;){var a=mB(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&hB(o)&&fB(a,o)&&(pB(e)||dB(e))};var bB=function(e,t){return null!=e&&gB(e,t,vB)};var yB=function(e){return function(t){return null==t?void 0:t[e]}};function wB(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(u){c=!0,o=u}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||tE(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kB(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}var xB=CE,CB=S_,OB=JN;var SB=function(e){return"string"==typeof e||!CB(e)&&OB(e)&&"[object String]"==xB(e)};function EB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function NB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EB(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EB(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _B(e){var t,n,r,o={};if(e&&"undefined"!=typeof window){var i=null===(t=window)||void 0===t||null===(n=t.getComputedStyle)||void 0===n?void 0:n.call(t,e),a=i.color,l=i.fontSize,s=null===(r=window)||void 0===r||null===(r=r.navigator)||void 0===r?void 0:r.userAgent,c=/Safari/.test(s)&&!/Chrome/.test(s),u=/(?=.*iPhone)[?=.*MicroMessenger]/.test(s)&&!/Chrome/.test(s);if((c||u)&&(o={transformOrigin:"0px 0px",transform:"scale(".concat(parseInt(l,10)/12,")")}),a&&function(){if("undefined"==typeof navigator||!navigator)return Number.MAX_SAFE_INTEGER;var e=navigator.userAgent,t=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1,n=e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1;if(t){var r=new RegExp("MSIE (\\d+\\.\\d+);"),o=e.match(r);if(!o)return-1;var i=parseFloat(o[1]);return i<7?6:i}return n?11:Number.MAX_SAFE_INTEGER}()>11){var d=a.match(/[\d.]+/g),p=d?"rgba(".concat(d[0],", ").concat(d[1],", ").concat(d[2],", 0)"):"";kB(e,NB(NB({},o),{},{background:"conic-gradient(from 90deg at 50% 50%,".concat(p," 0deg, ").concat(a," 360deg)")}))}else kB(e,NB(NB({},o),{},{background:""}))}}var MB=t.ref();function AB(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1?arguments[1]:void 0,r=t.getCurrentInstance()?t.inject(PA,null):MB,o=t.computed((function(){return(null==r?void 0:r.value)||BA})),i=t.computed((function(){return Object.assign({},o.value[e],n)}));return{t:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=r[0];if(SB(e)){if(!i)return e;return e.replace(/\{\s*([\w-]+)\s*\}/g,(function(e,t){return i?String(i[t]):""}))}return EE(e)?r.length?e.apply(void 0,r):e(t.h):""},global:i,globalConfig:i,classPrefix:t.computed((function(){return o.value.classPrefix}))}}function TB(e){var n=AB("classPrefix").classPrefix;return t.computed((function(){return e?"".concat(n.value,"-").concat(e):n.value}))}function VB(){var e=AB("classPrefix").classPrefix;return{SIZE:t.computed((function(){return{small:"".concat(e.value,"-size-s"),medium:"".concat(e.value,"-size-m"),large:"".concat(e.value,"-size-l"),default:"",xs:"".concat(e.value,"-size-xs"),xl:"".concat(e.value,"-size-xl"),block:"".concat(e.value,"-size-full-width")}})),STATUS:t.computed((function(){return{loading:"".concat(e.value,"-is-loading"),loadMore:"".concat(e.value,"-is-load-more"),disabled:"".concat(e.value,"-is-disabled"),focused:"".concat(e.value,"-is-focused"),success:"".concat(e.value,"-is-success"),error:"".concat(e.value,"-is-error"),warning:"".concat(e.value,"-is-warning"),selected:"".concat(e.value,"-is-selected"),active:"".concat(e.value,"-is-active"),checked:"".concat(e.value,"-is-checked"),current:"".concat(e.value,"-is-current"),hidden:"".concat(e.value,"-is-hidden"),visible:"".concat(e.value,"-is-visible"),expanded:"".concat(e.value,"-is-expanded"),indeterminate:"".concat(e.value,"-is-indeterminate")}}))}}var jB=t.defineComponent({name:"TLoadingGradient",setup:function(){var e=TB();return t.onMounted((function(){var e=t.getCurrentInstance().refs.circle;t.nextTick((function(){_B(e)}))})),{classPrefix:e}},render:function(){var e=this.classPrefix,n="".concat(e,"-loading__gradient"),r=[n,"".concat(e,"-icon-loading")];return t.createVNode("svg",{class:r,viewBox:"0 0 12 12",version:"1.1",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("foreignObject",{x:"0",y:"0",width:"12",height:"12"},[t.createVNode("div",{class:"".concat(n,"-conic"),ref:"circle"},null)])])}}),BB={exports:{}},PB={exports:{}};(function(){var e,t,n,r,o,i;"undefined"!=typeof performance&&null!==performance&&performance.now?PB.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(PB.exports=function(){return(e()-o)/1e6},t=process.hrtime,r=(e=function(){var e;return 1e9*(e=t())[0]+e[1]})(),i=1e9*process.uptime(),o=r-i):Date.now?(PB.exports=function(){return Date.now()-n},n=Date.now()):(PB.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(aE);for(var IB=PB.exports,DB="undefined"==typeof window?aE:window,LB=["moz","webkit"],RB="AnimationFrame",zB=DB["request"+RB],FB=DB["cancel"+RB]||DB["cancelRequest"+RB],$B=0;!zB&&$B<LB.length;$B++)zB=DB[LB[$B]+"Request"+RB],FB=DB[LB[$B]+"Cancel"+RB]||DB[LB[$B]+"CancelRequest"+RB];if(!zB||!FB){var HB=0,UB=0,WB=[],qB=1e3/60;zB=function(e){if(0===WB.length){var t=IB(),n=Math.max(0,qB-(t-HB));HB=n+t,setTimeout((function(){var e=WB.slice(0);WB.length=0;for(var t=function(){if(!e[n].cancelled)try{e[n].callback(HB)}catch(t){setTimeout((function(){throw t}),0)}},n=0;n<e.length;n++)t()}),Math.round(n))}return WB.push({handle:++UB,callback:e,cancelled:!1}),UB},FB=function(e){for(var t=0;t<WB.length;t++)WB[t].handle===e&&(WB[t].cancelled=!0)}}BB.exports=function(e){return zB.call(DB,e)},BB.exports.cancel=function(){FB.apply(DB,arguments)},BB.exports.polyfill=function(e){e||(e=DB),e.requestAnimationFrame=zB,e.cancelAnimationFrame=FB};var KB=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")};function GB(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):" ".concat(e.className," ").indexOf(" ".concat(t," "))>-1}function YB(e,t){if(e){for(var n=e.className,r=(t||"").split(" "),o=0,i=r.length;o<i;o++){var a=r[o];a&&(e.classList?e.classList.add(a):GB(e,a)||(n+=" ".concat(a)))}e.classList||(e.className=n)}}function XB(e,t){if(e&&t){for(var n=t.split(" "),r=" ".concat(e.className," "),o=0,i=n.length;o<i;o++){var a=n[o];a&&(e.classList?e.classList.remove(a):GB(e,a)&&(r=r.replace(" ".concat(a," ")," ")))}e.classList||(e.className=KB(r))}}var ZB=function(e,t){var n=EE(e)?e(t):e;return n?SB(n)?document.querySelector(n):n instanceof HTMLElement?n:document.body:document.body},JB=FA,QB=aT,eP=O_,tP=S_,nP=ZN,rP=e_.exports,oP=h_,iP=p_,aP=Object.prototype.hasOwnProperty;var lP=function(e){if(null==e)return!0;if(nP(e)&&(tP(e)||"string"==typeof e||"function"==typeof e.splice||rP(e)||iP(e)||eP(e)))return!e.length;var t=QB(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(oP(e))return!JB(e).length;for(var n in e)if(aP.call(e,n))return!1;return!0};var sP=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i},cP=sP;var uP=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:cP(e,t,n)},dP=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var pP=function(e){return dP.test(e)};var fP=function(e){return e.split("")},hP="\\ud800-\\udfff",mP="["+hP+"]",vP="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",gP="\\ud83c[\\udffb-\\udfff]",bP="[^"+hP+"]",yP="(?:\\ud83c[\\udde6-\\uddff]){2}",wP="[\\ud800-\\udbff][\\udc00-\\udfff]",kP="(?:"+vP+"|"+gP+")"+"?",xP="[\\ufe0e\\ufe0f]?",CP=xP+kP+("(?:\\u200d(?:"+[bP,yP,wP].join("|")+")"+xP+kP+")*"),OP="(?:"+[bP+vP+"?",vP,yP,wP,mP].join("|")+")",SP=RegExp(gP+"(?="+gP+")|"+OP+CP,"g");var EP=fP,NP=pP,_P=function(e){return e.match(SP)||[]};var MP=function(e){return NP(e)?_P(e):EP(e)};var AP=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n};var TP=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),VP=zj,jP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,BP=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var PP=function(e){return(e=VP(e))&&e.replace(jP,TP).replace(BP,"")},IP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var DP=function(e){return e.match(IP)||[]},LP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var RP=function(e){return LP.test(e)},zP="\\ud800-\\udfff",FP="\\u2700-\\u27bf",$P="a-z\\xdf-\\xf6\\xf8-\\xff",HP="A-Z\\xc0-\\xd6\\xd8-\\xde",UP="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",WP="["+UP+"]",qP="\\d+",KP="["+FP+"]",GP="["+$P+"]",YP="[^"+zP+UP+qP+FP+$P+HP+"]",XP="(?:\\ud83c[\\udde6-\\uddff]){2}",ZP="[\\ud800-\\udbff][\\udc00-\\udfff]",JP="["+HP+"]",QP="(?:"+GP+"|"+YP+")",eI="(?:"+JP+"|"+YP+")",tI="(?:['’](?:d|ll|m|re|s|t|ve))?",nI="(?:['’](?:D|LL|M|RE|S|T|VE))?",rI="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",oI="[\\ufe0e\\ufe0f]?",iI=oI+rI+("(?:\\u200d(?:"+["[^"+zP+"]",XP,ZP].join("|")+")"+oI+rI+")*"),aI="(?:"+[KP,XP,ZP].join("|")+")"+iI,lI=RegExp([JP+"?"+GP+"+"+tI+"(?="+[WP,JP,"$"].join("|")+")",eI+"+"+nI+"(?="+[WP,JP+QP,"$"].join("|")+")",JP+"?"+QP+"+"+tI,JP+"+"+nI,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qP,aI].join("|"),"g");var sI=DP,cI=RP,uI=zj,dI=function(e){return e.match(lI)||[]};var pI=AP,fI=PP,hI=function(e,t,n){return e=uI(e),void 0===(t=n?void 0:t)?cI(e)?dI(e):sI(e):e.match(t)||[]},mI=RegExp("['’]","g");var vI=function(e){return function(t){return pI(hI(fI(t).replace(mI,"")),e,"")}},gI=uP,bI=pP,yI=MP,wI=zj;var kI=function(e){return function(t){t=wI(t);var n=bI(t)?yI(t):void 0,r=n?n[0]:t.charAt(0),o=n?gI(n,1).join(""):t.slice(1);return r[e]()+o}}("toUpperCase"),xI=zj,CI=kI;var OI=function(e){return CI(xI(e).toLowerCase())},SI=vI((function(e,t,n){return t=t.toLowerCase(),e+(n?OI(t):t)})),EI=vI((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}));function NI(e){var n;return lE(e)&&"defaultNode"in e?n=e.defaultNode:(t.isVNode(e)||SB(e))&&(n=e),n}function _I(e){return lE(e)&&"params"in e?e.params:{}}function MI(e,t,n){var r,o,i,a,l=null===(r=(o=e.$slots)[SI(n)])||void 0===r?void 0:r.call(o,t);return l||((l=null===(i=(a=e.$slots)[EI(n)])||void 0===i?void 0:i.call(a,t))||null)}var AI=function(e,n,r){var o,i=_I(r),a=NI(r);if(n in e&&(o=e[n]),!1!==o&&null!==o)return!0===o&&a?MI(e,i,n)||a:EE(o)?o(t.h,i):[void 0,i,""].includes(o)&&(e.$slots[SI(n)]||e.$slots[EI(n)])?MI(e,i,n):o},TI={attach:{type:[String,Function],default:""},content:{type:[String,Function]},default:{type:[String,Function]},delay:{type:Number,default:0},fullscreen:Boolean,indicator:{type:[Boolean,Function],default:!0},inheritColor:Boolean,loading:{type:Boolean,default:!0},preventScrollThrough:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},size:{type:String,default:"medium"},text:{type:[String,Function]},zIndex:{type:Number}},VI=function(e,n){var r=EE(e)?t.computed(e):t.ref(e),o=EE(n)?t.computed(n):t.ref(n),i=t.ref(),a=function(){i.value=ZB(r.value,o.value)};return t.onMounted((function(){return a()})),t.watch([r,o],(function(){return a()})),i},jI=t.defineComponent({name:"TLoading",inheritAttrs:!1,props:TI,setup:function(e,n){var r=n.slots,o=t.ref(!1),i={name:TB("loading"),centerClass:TB("loading--center"),fullscreenClass:TB("loading__fullscreen"),lockClass:TB("loading--lock"),overlayClass:TB("loading__overlay"),relativeClass:TB("loading__parent"),fullClass:TB("loading--full"),inheritColorClass:TB("loading--inherit-color")},a=i.name,l=i.centerClass,s=i.fullscreenClass,c=i.lockClass,u=i.overlayClass,d=i.relativeClass,p=i.fullClass,f=i.inheritColorClass,h=TB(),m=VB().SIZE,v=function(){o.value=!1;var t=setTimeout((function(){o.value=!0,clearTimeout(t)}),e.delay)},g=VI((function(){return e.attach})),b=t.computed((function(){return Boolean(!e.delay||e.delay&&o.value)})),y=t.computed((function(){var t={};return void 0!==e.zIndex&&(t.zIndex=e.zIndex),["small","medium","large"].includes(e.size)||(t["font-size"]=e.size),t})),w=t.computed((function(){return Boolean(e.default||r.default||e.content||r.content)})),k=t.computed((function(){return e.preventScrollThrough&&e.fullscreen})),x=t.computed((function(){return Boolean(e.text||r.text)})),C=t.computed((function(){return w.value&&e.loading&&b.value})),O=t.computed((function(){return e.fullscreen&&e.loading&&b.value})),S=t.computed((function(){return e.attach&&e.loading&&b.value})),E=t.computed((function(){return e.attach&&e.loading&&b.value})),N=t.computed((function(){var t=[l.value,m.value[e.size],iE({},f.value,e.inheritColor)],n=[a.value,s.value,l.value,u.value];return{baseClasses:t,attachClasses:t.concat([a.value,p.value,iE({},u.value,e.showOverlay)]),withContentClasses:t.concat([a.value,p.value,iE({},u.value,e.showOverlay)]),fullScreenClasses:n,normalClasses:t.concat([a.value])}})),_=t.toRefs(e).loading;return t.watch([_],(function(e){wB(e,1)[0]?(v(),k.value&&YB(document.body,c.value)):k.value&&XB(document.body,c.value)})),t.onMounted((function(){e.delay&&v()})),{classPrefix:h,relativeClass:d,delayShowLoading:o,styles:y,showText:x,hasContent:w,classes:N,lockFullscreen:k,showWrapLoading:C,showNormalLoading:S,showFullScreenLoading:O,showAttachedLoading:E,teleportElement:g}},render:function(){var e,n,r,o,i,a,l,s,c,u,d=this,p=this.classes,f=p.fullScreenClasses,h=p.baseClasses,m=p.withContentClasses,v=p.attachClasses,g=p.normalClasses,b=t.createVNode(jB,{size:this.size},null),y=this.loading&&AI(this,"indicator",b),w=this.showText&&t.createVNode("div",{class:"".concat(this.classPrefix,"-loading__text")},[AI(this,"text")]);return this.fullscreen?this.showFullScreenLoading&&this.loading?t.createVNode(t.Teleport,{disabled:!this.attach||!this.teleportElement,to:this.teleportElement},{default:function(){return[t.createVNode("div",t.mergeProps({class:f,style:d.styles},d.$attrs),[t.createVNode("div",{class:h},[y,w])])]}}):null:this.hasContent?t.createVNode("div",t.mergeProps({class:this.relativeClass},this.$attrs),[(e=this,n="default",r="content",i=_I(o),a=NI(o),l=i?{params:i}:void 0,s=AI(e,n,l),c=AI(e,r,l),u=lP(s)?c:s,lP(u)?a:u),this.showWrapLoading&&t.createVNode("div",{class:m,style:this.styles},[y,w])]):this.attach?this.showAttachedLoading&&this.loading?t.createVNode(t.Teleport,{disabled:!this.attach||!this.teleportElement,to:this.teleportElement},{default:function(){return[t.createVNode("div",t.mergeProps({class:v,style:d.styles},d.$attrs),[y,w])]}}):null:this.loading?t.createVNode("div",t.mergeProps({class:g,style:this.styles},this.$attrs),[y,w]):null}});function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var PI=null;function II(e){var n=function(e){return TA({fullscreen:!1,attach:"body",loading:!0,preventScrollThrough:!0},e)}(e);if(n.fullscreen&&PI)return PI;var r=t.defineComponent({setup:function(){return{loadingOptions:t.reactive(n)}},render:function(){return t.h(jI,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BI(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},this.loadingOptions))}}),o=ZB(n.fullscreen?"body":n.attach),i=t.createApp(r),a=i.mount(document.createElement("div")),l=TB("loading__parent--relative").value,s=TB("loading--lock");return n.preventScrollThrough&&n.fullscreen&&YB(document.body,s.value),o?YB(o,l):console.error("attach is not exist"),{hide:function(){a.loading=!1,XB(o,l),XB(document.body,s.value),i.unmount()}}}function DI(e){return!0===e?PI=II({fullscreen:!0,loading:!0,attach:"body",preventScrollThrough:!0}):!1===e?(null===(t=PI)||void 0===t||t.hide(),void(PI=null)):II(e);var t}var LI=DI;LI.install=function(e){e.config.globalProperties.$loading=DI};var RI=ZM,zI=dT;var FI=K_,$I=Ej;var HI=lE;var UI=function(e){return e==e&&!HI(e)},WI=UI,qI=dT;var KI=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},GI=function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<i;){var s=(l=n[o])[0],c=e[s],u=l[1];if(a&&l[2]){if(void 0===c&&!(s in e))return!1}else{var d=new FI;if(r)var p=r(c,u,s,e,t,d);if(!(void 0===p?$I(u,c,3,r,d):p))return!1}}return!0},YI=function(e){for(var t=qI(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,WI(o)]}return t},XI=KI;var ZI=Ej,JI=cB,QI=bB,eD=Wj,tD=UI,nD=KI,rD=oB;var oD=lB;var iD=yB,aD=function(e){return function(t){return oD(t,e)}},lD=Wj,sD=oB;var cD=function(e){var t=YI(e);return 1==t.length&&t[0][2]?XI(t[0][0],t[0][1]):function(n){return n===e||GI(n,e,t)}},uD=function(e,t){return eD(e)&&tD(t)?nD(rD(e),t):function(n){var r=JI(n,e);return void 0===r&&r===t?QI(n,e):ZI(t,r,3)}},dD=wM,pD=S_,fD=function(e){return lD(e)?iD(sD(e)):aD(e)};var hD=XE,mD=function(e,t){return e&&RI(e,t,zI)},vD=function(e){return"function"==typeof e?e:null==e?dD:"object"==rE(e)?pD(e)?uD(e[0],e[1]):cD(e):fD(e)};var gD=function(e,t){var n={};return t=vD(t),mD(e,(function(e,r,o){hD(n,t(e,r,o),e)})),n},bD=Symbol("TdLoading"),yD=function(e,t){var n=t.modifiers,r=n.fullscreen,o=n.inheritColor,i={attach:function(){return e},fullscreen:null!=r&&r,inheritColor:null!=o&&o,loading:t.value};lE(t.value)&&gD(t.value,(function(e,t){i[t]=e})),e[bD]={options:i,instance:LI(i)}},wD={mounted:function(e,t){t.value&&yD(e,t)},updated:function(e,t){var n,r=e[bD],o=t.value,i=t.oldValue;_j(o,i)||((null!==(n=null==o?void 0:o.loading)&&void 0!==n?n:o)?yD(e,t):null==r||r.instance.hide())},unmounted:function(e){var t;null===(t=e[bD])||void 0===t||t.instance.hide()}};function kD(e,t,n){var r=e;return r.install=function(o,i){o.component(t||i||r.name,e),n&&o.directive(n.name,n.comp)},r}var xD=kD(jI,jI.name,{name:"loading",comp:wD}),CD={block:Boolean,content:{type:[String,Function]},default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},ghost:Boolean,href:{type:String,default:""},icon:{type:Function},loading:Boolean,shape:{type:String,default:"rectangle",validator:function(e){return!e||["rectangle","square","round","circle"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return!e||["extra-small","small","medium","large"].includes(e)}},suffix:{type:Function},tag:{type:String,validator:function(e){return!e||["button","a","div"].includes(e)}},theme:{type:String,validator:function(e){return!e||["default","primary","danger","warning","success"].includes(e)}},type:{type:String,default:"button",validator:function(e){return!e||["submit","reset","button"].includes(e)}},variant:{type:String,default:"base",validator:function(e){return!e||["base","outline","dashed","text"].includes(e)}},onClick:Function},OD=jA.expand,SD=jA.ripple,ED=jA.fade;function ND(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function _D(e,n){var r,o,i=t.ref(null),a=TB(),l=(r=AB("animation").globalConfig,{keepExpand:(o=function(e){var t,n,o=r.value;return o&&!(null!==(t=o.exclude)&&void 0!==t&&t.includes(e))&&(null===(n=o.include)||void 0===n?void 0:n.includes(e))})(OD),keepRipple:o(SD),keepFade:o(ED)}).keepRipple,s=function(t){var r=e.value,o=function(e,t){var n;if(t)return t;if(null!=e&&null!==(n=e.dataset)&&void 0!==n&&n.ripple)return e.dataset.ripple;var r=getComputedStyle(e).getPropertyValue("--ripple-color");return r||"rgba(0, 0, 0, 0.35)"}(r,null==n?void 0:n.value);if(0===t.button&&e&&l&&!(r.classList.contains("".concat(a.value,"-is-active"))||r.classList.contains("".concat(a.value,"-is-disabled"))||r.classList.contains("".concat(a.value,"-is-checked"))||r.classList.contains("".concat(a.value,"-is-loading")))){var s=getComputedStyle(r),c=parseInt(s.borderWidth,10),u=c>0?c:0,d=r.offsetWidth,p=r.offsetHeight;null===i.value.parentNode&&(ND(i.value,{position:"absolute",left:"".concat(0-u,"px"),top:"".concat(0-u,"px"),width:"".concat(d,"px"),height:"".concat(p,"px"),borderRadius:s.borderRadius,pointerEvents:"none",overflow:"hidden"}),r.appendChild(i.value));var f=document.createElement("div");ND(f,{marginTop:"0",marginLeft:"0",right:"".concat(d,"px"),width:"".concat(d+20,"px"),height:"100%",transition:"transform ".concat(200,"ms cubic-bezier(.38, 0, .24, 1), background ").concat(400,"ms linear"),transform:"skewX(-8deg)",pointerEvents:"none",position:"absolute",zIndex:0,backgroundColor:o,opacity:"0.9"});for(var h=new WeakMap,m=r.children.length,v=0;v<m;++v){var g=r.children[v];""===g.style.zIndex&&g!==i.value&&(g.style.zIndex="1",h.set(g,!0))}var b=r.style.position?r.style.position:getComputedStyle(r).position;""!==b&&"static"!==b||(r.style.position="relative"),i.value.insertBefore(f,i.value.firstChild),setTimeout((function(){f.style.transform="translateX(".concat(d,"px)")}),0);var y=function t(){f.style.backgroundColor="rgba(0, 0, 0, 0)",e.value&&(e.value.removeEventListener("pointerup",t,!1),e.value.removeEventListener("pointerleave",t,!1),setTimeout((function(){f.remove(),0===i.value.children.length&&i.value.remove()}),500))};e.value.addEventListener("pointerup",y,!1),e.value.addEventListener("pointerleave",y,!1)}};t.onMounted((function(){var t=null==e?void 0:e.value;t&&(i.value=document.createElement("div"),t.addEventListener("pointerdown",s,!1))})),t.onUnmounted((function(){var t;null==e||null===(t=e.value)||void 0===t||t.removeEventListener("pointerdown",s,!1)}))}function MD(e,t,n){var r,o,i,a,l=null===(r=(o=e.slots)[SI(t)])||void 0===r?void 0:r.call(o,n);return l&&l.filter((function(e){return"Symbol(v-cmt)"!==e.type.toString()})).length||(l=null===(i=(a=e.slots)[EI(t)])||void 0===i?void 0:i.call(a,n))&&l.filter((function(e){return"Symbol(v-cmt)"!==e.type.toString()})).length?l:null}function AD(e){return!![void 0,null,""].includes(e)||!(e instanceof Array?e:[e]).filter((function(e){var t;return"Symbol(Comment)"!==(null==e||null===(t=e.type)||void 0===t?void 0:t.toString())})).length}var TD=function(){var e=t.getCurrentInstance();return function(n,r){var o,i=_I(r),a=NI(r),l=function(e){return lE(e)&&"slotFirst"in e?e.slotFirst:{}}(r);if(Object.keys(e.props).includes(n)&&(o=e.props[n]),!1!==o&&null!==o)return!0===o?MD(e,n,i)||a:EE(o)?o(t.h,i):([void 0,i,""].includes(o)||l)&&(e.slots[SI(n)]||e.slots[EI(n)])?MD(e,n,i):o}},VD=function(){var e=TD();return function(t,n,r){var o=_I(r),i=NI(r),a=o?{params:o}:void 0,l=e(t,a),s=e(n,a),c=AD(l)?s:l;return AD(c)?i:c}},jD=CE,BD=JN;var PD=function(e){return!0===e||!1===e||BD(e)&&"[object Boolean]"==jD(e)};function ID(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function DD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ID(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ID(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var LD=kD(t.defineComponent({name:"TButton",props:CD,setup:function(e,n){var r=n.attrs,o=n.slots,i=TD(),a=VD(),l=TB("button"),s=VB(),c=s.STATUS,u=s.SIZE,d=t.ref();_D(d);var p,f,h,m,v=(f=t.getCurrentInstance(),h=t.computed((function(){return f.props.disabled})),m=t.inject("formDisabled",Object.create(null)),t.computed((function(){var e;return PD(null==p?void 0:p.beforeDisabled.value)?p.beforeDisabled.value:PD(h.value)?h.value:PD(null==p?void 0:p.afterDisabled.value)?p.afterDisabled.value:!!PD(null===(e=m.disabled)||void 0===e?void 0:e.value)&&m.disabled.value}))),g=t.computed((function(){var t=e.theme,n=e.variant;return t||("base"===n?"primary":"default")})),b=t.computed((function(){return["".concat(l.value),"".concat(l.value,"--variant-").concat(e.variant),"".concat(l.value,"--theme-").concat(g.value),iE(iE(iE(iE(iE(iE({},u.value[e.size],"medium"!==e.size),c.value.disabled,v.value),c.value.loading,e.loading),"".concat(l.value,"--shape-").concat(e.shape),"rectangle"!==e.shape),"".concat(l.value,"--ghost"),e.ghost),u.value.block,e.block)]}));return function(){var n=a("default","content"),s=e.loading?t.createVNode(xD,{inheritColor:!0},null):i("icon"),c=s&&!n,u=e.suffix||o.suffix?t.createVNode("span",{className:"".concat(l.value,"__suffix")},[i("suffix")]):null;n=n?t.createVNode("span",{class:"".concat(l.value,"__text")},[n]):"",s&&(n=[s,n]),u&&(n=[n].concat(u));var p={class:[].concat(nE(b.value),[iE({},"".concat(l.value,"--icon-only"),c)]),type:e.type,disabled:v.value||e.loading,href:e.href,tabindex:v.value?void 0:"0"};return t.h(!e.tag&&e.href?"a":e.tag||"button",DD(DD(DD({ref:d},r),p),{},{onClick:e.onClick}),[n])}}})),RD=["info","success","warning","error","question","loading"],zD="32px",FD={top:{top:zD,left:"50%",transform:"translateX(-50%)"},center:{left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)"},left:{left:zD,top:"50%",transform:"translateY(-50%)"},bottom:{bottom:zD,left:"50%",transform:"translateX(-50%)"},right:{right:zD,top:"50%",transform:"translateY(-50%)",display:"flex",flexDirection:"column",alignItems:"flex-end"},"top-left":{left:zD,top:zD},"top-right":{right:zD,top:zD,display:"flex",flexDirection:"column",alignItems:"flex-end"},"bottom-right":{right:zD,bottom:zD,display:"flex",flexDirection:"column",alignItems:"flex-end"},"bottom-left":{left:zD,bottom:zD}},$D=Object.keys(FD),HD={closeBtn:{type:[String,Boolean,Function],default:void 0},content:{type:[String,Function]},duration:{type:Number,default:3e3},icon:{type:[Boolean,Function],default:!0},theme:{type:String,default:"info",validator:function(e){return!e||["info","success","warning","error","question","loading"].includes(e)}},onClose:Function,onCloseBtnClick:Function,onDurationEnd:Function};function UD(e){var t=AB("icon").globalConfig,n={};return Object.keys(e).forEach((function(r){var o;n[r]=(null===(o=t.value)||void 0===o?void 0:o[r])||e[r]})),n}var WD={duration:200,easing:"linear"};function qD(e,t){if(e){var n=function(e,t,n){if(!$D.includes(e))return null;if(["top-left","left","bottom-left"].includes(e))return[{opacity:0,marginLeft:"-".concat(t,"px")},{opacity:1,marginLeft:"0"}];if(["top-right","right","bottom-right"].includes(e))return[{opacity:0,marginRight:"-".concat(t,"px")},{opacity:1,marginRight:"0"}];if(["top","center"].includes(e))return[{opacity:0,marginTop:"-".concat(n,"px")},{opacity:1,marginTop:"0"}];if(["bottom"].includes(e))return[{opacity:0,transform:"translate3d(0, ".concat(n,"px, 0)")},{opacity:1,transform:"translate3d(0, 0, 0)"}]}(t,(null==e?void 0:e.offsetWidth)||0,(null==e?void 0:e.offsetHeight)||0);if(n)GD(e,n[n.length-1]),e.animate&&e.animate(n,WD)}}function KD(e,t,n){if(e){var r=function(e,t){if(!$D.includes(e))return null;if(["bottom-left","bottom","bottom-right"].includes(e)){return[{opacity:1,marginTop:"0px"},{opacity:0,marginTop:"".concat(t,"px")}]}var n="-".concat(t,"px");return[{opacity:1,marginTop:"0px"},{opacity:0,marginTop:n}]}(t,(null==e?void 0:e.offsetHeight)||0);if(!r)return n();var o=r[r.length-1];GD(e,o);var i=e.animate&&e.animate(r,WD);i?i.onfinish=function(){e.style.display="none",n()}:(e.style.display="none",n())}}function GD(e,t){for(var n=Object.keys(t),r=0;r<n.length;r+=1){var o=n[r];e.style[o]=t[o]}}function YD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function XD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?YD(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YD(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ZD=t.defineComponent({name:"TMessage",props:XD(XD({},HD),{},{placement:String}),setup:function(e,n){var r=n.slots,o=n.expose,i=TB("message"),a=UD({InfoCircleFilledIcon:pf,CheckCircleFilledIcon:fp,ErrorCircleFilledIcon:Yp,HelpCircleFilledIcon:Qp,CloseIcon:Dp}),l=a.InfoCircleFilledIcon,s=a.CheckCircleFilledIcon,c=a.ErrorCircleFilledIcon,u=a.HelpCircleFilledIcon,d=a.CloseIcon,p=TB(),f=TD(),h=VD(),m=t.ref(null),v=t.ref(null),g=t.computed((function(){var t={};return RD.forEach((function(n){return t["".concat(p.value,"-is-").concat(n)]=e.theme===n})),[i.value,t,iE({},"".concat(p.value,"-is-closable"),e.closeBtn||r.closeBtn)]})),b=function(t){var n,r;null===(n=e.onClose)||void 0===n||n.call(e,{trigger:"close-click",e:t}),null===(r=e.onCloseBtnClick)||void 0===r||r.call(e,{e:t})},y=function(){e.duration&&clearTimeout(v.value)},w=function(){e.duration&&(v.value=Number(setTimeout((function(){y(),KD(m.value,e.placement,(function(){var t,n;null===(t=e.onClose)||void 0===t||t.call(e,{trigger:"duration-end"}),null===(n=e.onDurationEnd)||void 0===n||n.call(e)}))}),e.duration)))},k=function(){if(!1!==e.icon){if(EE(e.icon))return e.icon(t.h);if(r.icon)return r.icon(null);var n={info:l,success:s,warning:c,error:c,question:u,loading:xD}[e.theme];return t.createVNode(n,null,null)}};return t.onBeforeMount((function(){e.duration&&w()})),t.onMounted((function(){qD(m.value,e.placement)})),o({close:b}),function(){return t.createVNode("div",{ref:m,class:g.value,onMouseenter:y,onMouseleave:w},[k(),h("content","default"),(e=t.createVNode(d,null,null),t.createVNode("span",{class:"".concat(i.value,"__close"),onClick:b},[f("closeBtn",e)]))]);var e}}});function JD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function QD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JD(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JD(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var eL=6e3,tL=function(){var e=0;return function(){return e+=1}}(),nL=t.defineComponent({name:"TMessageList",props:{zIndex:{type:Number,default:0},placement:{type:String,default:""}},setup:function(e,n){var r=n.expose,o=TB("message__list"),i=t.ref([]),a=t.ref([]),l=t.computed((function(){return QD(QD({},FD[e.placement]),{},{zIndex:e.zIndex!==eL?e.zIndex:eL})})),s=function(e){i.value.splice(e,1)},c=function(e){if(e)return isNaN(Number(e))?e:"".concat(e,"px")},u=function(e){return e.offset&&{position:"relative",left:c(e.offset[0]),top:c(e.offset[1])}},d=function(e){e&&a.value.push(e)};return r({add:function(e){var t=QD(QD({},e),{},{key:tL()});return i.value.push(t),t.key},removeAll:function(){i.value=[]},list:i,messageList:a}),function(){if(i.value.length)return t.createVNode("div",{class:o.value,style:l.value},[i.value.map((function(e,n){return t.createVNode(ZD,t.mergeProps({key:e.key,style:u(e),ref:d},function(e,t){return QD(QD({},t),{},{onCloseBtnClick:function(n){return t.onCloseBtnClick&&t.onCloseBtnClick(n),s(e)},onDurationEnd:function(){return t.onDurationEnd&&t.onDurationEnd(),s(e)}})}(n,e)),null)}))])}}});function rL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rL(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var iL=new Map;var aL=function(e){var n=function(e){var t=oL({duration:3e3,attach:"body",zIndex:eL,placement:"top"},e);return t.content=e.content,t}(e),r=n.attach,o=n.placement,i=ZB(r);iL.get(i)||iL.set(i,{});var a,l=iL.get(i)[o];if(l)a=l.add(n);else{var s=document.createElement("div"),c=t.createApp(nL,{zIndex:n.zIndex,placement:n.placement}).mount(s);a=c.add(n),iL.get(i)[o]=c,i.appendChild(s)}return new Promise((function(e){var n=iL.get(i)[o];t.nextTick((function(){var t=n.messageList;e(null==t?void 0:t.find((function(e){var t;return(null===(t=e.$)||void 0===t||null===(t=t.vnode)||void 0===t?void 0:t.key)===a})))}))}))},lL=function(e,t,n){var r={theme:e};return SB(t)?r.content=t:!lE(t)||t instanceof Array||(r=oL(oL({},r),t)),(n||0===n)&&(r.duration=n),aL(r)},sL={info:function(e,t){return lL("info",e,t)},success:function(e,t){return lL("success",e,t)},warning:function(e,t){return lL("warning",e,t)},error:function(e,t){return lL("error",e,t)},question:function(e,t){return lL("question",e,t)},loading:function(e,t){return lL("loading",e,t)},close:function(e){e.then((function(e){return null==e?void 0:e.close()}))},closeAll:function(){iL instanceof Map&&iL.forEach((function(e){Object.keys(e).forEach((function(t){e[t].list=[]}))}))}},cL=lL;cL.install=function(e){e.config.globalProperties.$message=lL,Object.keys(sL).forEach((function(t){e.config.globalProperties.$message[t]=sL[t]}))},Object.keys(sL).forEach((function(e){cL[e]=sL[e]}));var uL=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},dL=O_,pL=S_,fL=pE?pE.isConcatSpreadable:void 0;var hL=lT,mL=function(e){return pL(e)||dL(e)||!!(fL&&e&&e[fL])};var vL=function e(t,n,r,o,i){var a=-1,l=t.length;for(r||(r=mL),i||(i=[]);++a<l;){var s=t[a];n>0&&r(s)?n>1?e(s,n-1,r,o,i):hL(i,s):o||(i[i.length]=s)}return i},gL=vL;var bL=function(e){return(null==e?0:e.length)?gL(e,1):[]},yL=CM,wL=MM;var kL=lB,xL=sP;var CL=nB,OL=uL,SL=function(e,t){return t.length<2?e:kL(e,xL(t,0,-1))},EL=oB;var NL=WM;var _L=Vj,ML=KV,AL=function(e,t){return t=CL(t,e),null==(e=SL(e,t))||delete e[EL(OL(t))]},TL=nB,VL=dM,jL=function(e){return NL(e)?void 0:e},BL=qT,PL=function(e){return wL(yL(e,void 0,bL),e+"")}((function(e,t){var n={};if(null==e)return n;var r=!1;t=_L(t,(function(t){return t=TL(t,e),r||(r=t.length>1),t})),VL(e,BL(e),n),r&&(n=ML(n,7,jL));for(var o=t.length;o--;)AL(n,t[o]);return n}));function IL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oE(r.key),r)}}function DL(e,t,n){return t&&IL(e.prototype,t),n&&IL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var LL={attach:{type:[String,Function]},body:{type:[String,Function]},cancelBtn:{type:[String,Object,Function]},closeBtn:{type:[String,Boolean,Function],default:!0},closeOnEscKeydown:{type:Boolean,default:void 0},closeOnOverlayClick:{type:Boolean,default:void 0},confirmBtn:{type:[String,Object,Function]},confirmLoading:{type:Boolean,default:void 0},confirmOnEnter:Boolean,default:{type:[String,Function]},destroyOnClose:Boolean,draggable:Boolean,footer:{type:[Boolean,Function],default:!0},header:{type:[String,Boolean,Function],default:!0},mode:{type:String,default:"modal",validator:function(e){return!e||["modal","modeless","normal","full-screen"].includes(e)}},placement:{type:String,default:"top",validator:function(e){return!e||["top","center"].includes(e)}},preventScrollThrough:{type:Boolean,default:!0},showInAttachedElement:Boolean,showOverlay:{type:Boolean,default:!0},theme:{type:String,default:"default",validator:function(e){return!e||["default","info","warning","danger","success"].includes(e)}},top:{type:[String,Number]},visible:Boolean,width:{type:[String,Number]},zIndex:{type:Number},onCancel:Function,onClose:Function,onCloseBtnClick:Function,onClosed:Function,onConfirm:Function,onEscKeydown:Function,onOpened:Function,onOverlayClick:Function};function RL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RL(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function FL(e){var n=t.getCurrentInstance(),r=TD(),o=function(e,n){var r=n.defaultButtonProps,o=n.className,i=n.confirmLoading,a=r;return SB(e)?a.content=e:lE(e)&&(a=zL(zL({},a),e)),void 0!==i&&(a.loading=i),t.createVNode(LD,t.mergeProps({class:o},a),null)};return{getConfirmBtn:function(i){var a=i.confirmBtn,l=i.className,s=i.confirmLoading;if(null===a)return null;a&&n.slots.confirmBtn&&console.warn("Both $props.confirmBtn and $scopedSlots.confirmBtn exist, $props.confirmBtn is preferred.");var c=function(t){var n,r=t.globalConfirm,o=t.theme,i=t.globalConfirmBtnTheme,a={theme:(null===(n=PL(i,["info"]))||void 0===n?void 0:n[o])||"primary",size:t.size,onClick:function(t){e.confirmBtnAction(t)}};return SB(r)?a.content=r:lE(r)&&(a=zL(zL({},a),r)),a}(i);return a||n.slots.confirmBtn?a&&["string","object"].includes(rE(a))?o(a,{defaultButtonProps:c,className:l,confirmLoading:s}):r("confirmBtn"):t.createVNode(LD,t.mergeProps({class:l,loading:s},c),null)},getCancelBtn:function(i){var a=i.cancelBtn,l=i.className;if(null===a)return null;a&&n.slots.cancelBtn&&console.warn("Both $props.cancelBtn and $scopedSlots.cancelBtn exist, $props.cancelBtn is preferred.");var s=function(t){var n=t.globalCancel,r={theme:"default",size:t.size,onClick:function(t){e.cancelBtnAction(t)}};return SB(n)?r.content=n:lE(n)&&(r=zL(zL({},r),n)),r}(i);return a||n.slots.cancelBtn?a&&["string","object"].includes(rE(a))?o(a,{defaultButtonProps:s}):r("cancelBtn"):t.createVNode(LD,t.mergeProps({class:l},s),null)}}}var $L,HL=new(DL((function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),iE(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set}),iE(this,"getNextZIndex",(function(e){return("message"===e?Array.from(t.popupStack.message).pop()||5e3:Array.from(t.popupStack.popup).pop()||1e3)+1})),iE(this,"add",(function(e){var n=t.getNextZIndex(e);return t.popupStack[e].add(n),"dialog"===e&&t.popupStack.popup.add(n),n})),iE(this,"delete",(function(e,n){t.popupStack[n].delete(e),"dialog"===n&&t.popupStack.popup.delete(e)})),iE(this,"isLastDialog",(function(e){return!(t.popupStack.dialog.size>1)||e===Array.from(t.popupStack.dialog).pop()}))})));function UL(e){return Number.isNaN(Number(e))?e:"".concat(Number(e),"px")}"undefined"!=typeof window&&window.document&&window.document.documentElement&&document.documentElement.addEventListener("click",(function(e){$L={x:e.clientX,y:e.clientY},setTimeout((function(){$L=null}),100)}),!0);var WL=1,qL=t.defineComponent({name:"TDialog",directives:{draggable:function(e,t){var n,r,o;e&&t&&t.value&&(n=e,r=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight,n.addEventListener("mousedown",(function(e){var t=e.clientX-n.offsetLeft,i=e.clientY-n.offsetTop,a=n.offsetWidth,l=n.offsetHeight;function s(e){var a=e.clientX-t,l=e.clientY-i;a<0&&(a=0),l<0&&(l=0),r-n.offsetWidth-a<0&&(a=r-n.offsetWidth),o-n.offsetHeight-l<0&&(l=o-n.offsetHeight),n.style.position="absolute",n.style.left="".concat(a,"px"),n.style.top="".concat(l,"px")}function c(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c)}a>r||l>o||(document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),document.addEventListener("dragend",c))})))}},inheritAttrs:!1,props:LL,emits:["update:visible"],setup:function(e,n){var r,o=this,i=TB("dialog"),a=TB(),l=VD(),s=TD(),c=t.ref(null),u=AB("dialog").globalConfig,d=UD({CloseIcon:Dp,InfoCircleFilledIcon:pf,CheckCircleFilledIcon:fp,ErrorCircleFilledIcon:Yp}),p=d.CloseIcon,f=d.InfoCircleFilledIcon,h=d.CheckCircleFilledIcon,m=d.ErrorCircleFilledIcon,v=FL({confirmBtnAction:function(t){var n;null===(n=e.onConfirm)||void 0===n||n.call(e,{e:t})},cancelBtnAction:function(t){var n;null===(n=e.onCancel)||void 0===n||n.call(e,{e:t}),K({e:t,trigger:"cancel"})}}),g=v.getConfirmBtn,b=v.getCancelBtn,y=VI((function(){return e.attach}));r=t.ref(0),t.provide("t-display-none-element-refresh",r),t.onUpdated((function(){r.value+=1}));var w=t.ref(),k=t.ref(),x=t.computed((function(){return"modal"===e.mode})),C=t.computed((function(){return"modeless"===e.mode})),O=t.computed((function(){return"normal"===e.mode})),S=t.computed((function(){return"full-screen"===e.mode})),E=t.computed((function(){return e.visible})),N=t.computed((function(){return["".concat(i.value,"__mask"),!e.showOverlay&&"".concat(a.value,"-is-hidden")]})),_=t.computed((function(){return O.value?[]:S.value?["".concat(i.value,"__position_fullscreen")]:["".concat(i.value,"__position"),!!e.top&&"".concat(i.value,"--top"),"".concat(e.placement&&!e.top?"".concat(i.value,"--").concat(e.placement):"")]})),M=t.computed((function(){return[!O.value&&"".concat(i.value,"__wrap")]})),A=t.computed((function(){if(S.value)return{};var t=e.top,n={};void 0!==t&&(n={paddingTop:UL(t)});return n})),T=t.computed((function(){var t=["".concat(i.value),"".concat(i.value,"__modal-").concat(e.theme),C.value&&e.draggable&&"".concat(i.value,"--draggable")];return S.value?t.push("".concat(i.value,"__fullscreen")):t.push.apply(t,["".concat(i.value,"--default"),"".concat(i.value,"--").concat(e.placement)]),t})),V=t.computed((function(){return S.value?{}:{width:UL(e.width)}})),j=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.visible,o=n.runOnMounted,i=t.ref(0),a=function(){i.value=HL.add(e)},l=function(){HL.delete(i.value,e)};return t.watch((function(){return null==r?void 0:r.value}),(function(e){e?a():l()}),{immediate:!0}),o&&(t.onMounted((function(){a()})),t.onBeforeUnmount((function(){l()}))),{zIndex:t.readonly(i),open:a,close:l,isLastDialog:function(){return"dialog"===e&&HL.isLastDialog(i.value)}}}("dialog",{visible:E}),B=j.isLastDialog;function P(){var e,t;null===(e=k.value.parentNode)||void 0===e||null===(t=e.removeChild)||void 0===t||t.call(e,k.value)}t.watch((function(){return e.visible}),(function(n){var r;n?((x.value&&!e.showInAttachedElement||S.value)&&(e.preventScrollThrough&&document.body.appendChild(k.value),t.nextTick((function(){$L&&c.value&&(c.value.style.transformOrigin="".concat($L.x-c.value.offsetLeft,"px ").concat($L.y-c.value.offsetTop,"px"))}))),null===(r=document.activeElement)||void 0===r||r.blur()):(clearTimeout(w.value),w.value=setTimeout((function(){P()}),150));R(n)}));var I,D,L,R=function(t){t?(document.addEventListener("keydown",F),e.confirmOnEnter&&document.addEventListener("keydown",z)):(document.removeEventListener("keydown",F),e.confirmOnEnter&&document.removeEventListener("keydown",z))},z=function(t){if("input"!==t.target.tagName.toLowerCase()){var n,r=t.code;if(("Enter"===r||"NumpadEnter"===r)&&B())null===(n=e.onConfirm)||void 0===n||n.call(e,{e:t})}},F=function(t){var n,r;"Escape"===t.code&&B()&&(null===(n=e.onEscKeydown)||void 0===n||n.call(e,{e:t}),(null!==(r=e.closeOnEscKeydown)&&void 0!==r?r:u.value.closeOnEscKeydown)&&K({e:t,trigger:"esc"}))},$=(I=function(t){var n,r;e.showOverlay&&(null!==(n=e.closeOnOverlayClick)&&void 0!==n?n:u.value.closeOnOverlayClick)&&(null===(r=e.onOverlayClick)||void 0===r||r.call(e,{e:t}),K({e:t,trigger:"overlay"}))},D=!1,L=!1,{onClick:function(e){D&&L&&I(e),D=!1,L=!1},onMousedown:function(e){D=e.target===e.currentTarget},onMouseup:function(e){L=e.target===e.currentTarget}}),H=$.onClick,U=$.onMousedown,W=$.onMouseup,q=function(t){var n;null===(n=e.onCloseBtnClick)||void 0===n||n.call(e,{e:t}),K({trigger:"close-btn",e:t})},K=function(t){var r;null===(r=e.onClose)||void 0===r||r.call(e,t),n.emit("update:visible",!1)};return t.onMounted((function(){var e=document.documentElement.scrollHeight>document.documentElement.clientHeight?function(){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}():0;k.value=document.createElement("style"),k.value.dataset.id="td_dialog_".concat(+new Date,"_").concat(WL+=1),k.value.innerHTML="\n html body {\n overflow-y: hidden;\n width: calc(100% - ".concat(e,"px);\n }\n ")})),t.onBeforeUnmount((function(){R(!1),P()})),{COMPONENT_NAME:i,isModal:x,isModeLess:C,isFullScreen:S,maskClass:N,dialogClass:T,dialogStyle:V,dialogEle:c,afterEnter:function(){var t;null===(t=e.onOpened)||void 0===t||t.call(e)},afterLeave:function(){var t;C.value&&e.draggable&&c.value&&(c.value.style.position="relative",c.value.style.left="unset",c.value.style.top="unset"),null===(t=e.onClosed)||void 0===t||t.call(e)},hasEventOn:function(e){var t,n=null===(t=o._events)||void 0===t?void 0:t[e];return!(null==n||!n.length)},renderDialog:function(){var n=t.createVNode("h5",{class:"title"},null),r=t.createVNode(p,null,null),o=l("default","body"),d=t.createVNode("div",null,[b({cancelBtn:e.cancelBtn,globalCancel:u.value.cancel,className:"".concat(i.value,"__cancel")}),g({theme:e.theme,confirmBtn:e.confirmBtn,globalConfirm:u.value.confirm,globalConfirmBtnTheme:u.value.confirmBtnTheme,className:"".concat(i.value,"__confirm"),confirmLoading:e.confirmLoading})]),v=S.value?["".concat(i.value,"__header"),"".concat(i.value,"__header--fullscreen")]:"".concat(i.value,"__header"),y=S.value?["".concat(i.value,"__close"),"".concat(i.value,"__close--fullscreen")]:"".concat(i.value,"__close"),w="default"===e.theme?["".concat(i.value,"__body")]:["".concat(i.value,"__body__icon")],k=s("footer",d);S.value&&k?w.push("".concat(i.value,"__body--fullscreen")):S.value&&w.push("".concat(i.value,"__body--fullscreen--without-footer"));var x=S.value?["".concat(i.value,"__footer"),"".concat(i.value,"__footer--fullscreen")]:"".concat(i.value,"__footer"),O=function(t){C.value&&e.draggable&&t.stopPropagation()};return t.createVNode("div",{class:M.value},[t.createVNode("div",{class:_.value,style:A.value,onClick:H,onMousedown:U,onMouseup:W},[t.withDirectives(t.createVNode("div",{key:"dialog",class:T.value,style:V.value,ref:c},[t.createVNode("div",{class:v,onMousedown:O},[t.createVNode("div",{class:"".concat(i.value,"__header-content")},[{info:t.createVNode(f,{class:"".concat(a.value,"-is-info")},null),warning:t.createVNode(m,{class:"".concat(a.value,"-is-warning")},null),danger:t.createVNode(m,{class:"".concat(a.value,"-is-error")},null),success:t.createVNode(h,{class:"".concat(a.value,"-is-success")},null)}[e.theme],s("header",n)]),e.closeBtn?t.createVNode("span",{class:y,onClick:q},[s("closeBtn",r)]):null]),t.createVNode("div",{class:w,onMousedown:O},[o]),k&&t.createVNode("div",{class:x,onMousedown:O},[k])]),[[t.resolveDirective("draggable"),C.value&&e.draggable]])])])},teleportElement:y}},render:function(){var e=this,n=this.COMPONENT_NAME,r=[(this.isModal||this.isFullScreen)&&t.createVNode("div",{key:"mask",class:this.maskClass},null),this.renderDialog()],o={zIndex:this.zIndex},i=["".concat(n,"__ctx"),iE(iE(iE({},"".concat(n,"__ctx--fixed"),this.isModal||this.isFullScreen),"".concat(n,"__ctx--absolute"),this.isModal&&this.showInAttachedElement),"".concat(n,"__ctx--modeless"),this.isModeLess)];return t.createVNode(t.Teleport,{disabled:!this.attach||!this.teleportElement,to:this.teleportElement},{default:function(){return[t.createVNode(t.Transition,{duration:300,name:"".concat(n,"-zoom__vue"),onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:function(){return[(!e.destroyOnClose||e.visible)&&t.withDirectives(t.createVNode("div",t.mergeProps({class:i,style:o},e.$attrs),[r]),[[t.vShow,e.visible]])]}})]}})}});function KL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?KL(Object(n),!0).forEach((function(t){iE(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var YL=function(e){var n=GL({},e),r=document.createElement("div"),o=t.ref(!1),i=n.className,a=n.style,l=i,s=function(e,t){if(e){var n;if(l&&l!==e)(n=r.firstElementChild.classList).remove.apply(n,nE(l.split(" ").map((function(e){return e.trim()}))));e.split(" ").forEach((function(e){r.firstElementChild.classList.add(e.trim())}))}t&&(r.firstElementChild.style.cssText+=t),l=e},c=t.defineComponent({setup:function(e,r){var l=r.expose,c=t.ref(n);t.onMounted((function(){o.value=!0,document.activeElement.blur(),t.nextTick((function(){s(i,a)}))}));return l({update:function(e){c.value=GL(GL({},n),e)}}),function(){var e=n.onClose||function(){o.value=!1};return delete n.className,delete n.style,t.h(qL,GL({onClose:e,visible:o.value},c.value))}}}),u=t.createApp(c),d=u.mount(r),p=ZB(n.attach);return p?p.appendChild(r):console.error("attach is not exist"),{show:function(){o.value=!0},hide:function(){o.value=!1},update:function(e){d.update(PL(e,["className","style"])),s(e.className,e.style)},destroy:function(){o.value=!1,setTimeout((function(){u.unmount(),r.remove()}),300)},setConfirmLoading:function(e){d.update({confirmLoading:e})}}},XL={confirm:function(e){return YL(e)},alert:function(e){var t=GL({},e);return t.cancelBtn=null,YL(t)}},ZL=YL;ZL.install=function(e){e.config.globalProperties.$dialog=YL,Object.keys(XL).forEach((function(t){e.config.globalProperties.$dialog[t]=XL[t]}))},Object.keys(XL).forEach((function(e){ZL[e]=XL[e]}));const{container:JL}=gS(),QL=e=>ZL.alert({attach:JL,placement:"center",...e}),eR=e=>ZL.confirm({attach:JL,placement:"center",preventScrollThrough:!1,...e}),tR=(e,t)=>{const n="string"==typeof t?{content:t}:t;return cL[e]({attach:JL,...n})},nR=e=>(t.pushScopeId("data-v-959fb03a"),e=e(),t.popScopeId(),e),rR={key:0,class:"status-bar"},oR={class:"bar-left"},iR=nR((()=>t.createElementVNode("div",{class:"bar-split"},null,-1))),aR=nR((()=>t.createElementVNode("div",{class:"bar-split"},null,-1))),lR={key:1,class:"simple-text word-count"},sR={class:"bar-right"},cR=nR((()=>t.createElementVNode("div",{class:"bar-split"},null,-1))),uR={class:"zoom-level-bar"},dR={key:1,class:"preview-bar"},pR={class:"shortcut-drawer-header"},fR=yS({__name:"index",setup(e){const{container:n,options:r,page:o,editor:i}=gS(),a=bS("document"),l=t.ref(!1),s=t.inject("reset"),c=t.computed((()=>{const{state:e}=i.value;if(e){const{selection:t}=e;return e.doc.textBetween(t.from,t.to,"").length}return 0}));let u=t.ref({});t.onMounted((()=>{u.value=cS(document.querySelector(n)),QS("f11, command+f11",u.value.toggle)}));const d=async()=>{o.value.showToc=!1,o.value.preview.enabled=!o.value.preview.enabled,o.value.preview.enabled&&(document.querySelector(`${n} .zoomable-container`).scrollTop=0)};t.onMounted((()=>QS("f5",d))),t.watch((()=>o.value.preview.enabled),(e=>{e?(u.value.enter(),m(!1,10)):(u.value.exit(),h())})),t.watch((()=>u.value.isFullscreen),(e=>{e||(o.value.preview.enabled=!1)}),{deep:!0});const p=()=>{o.value.zoomLevel<500&&(o.value.zoomLevel=o.value.zoomLevel+10,o.value.autoWidth=!1)},f=()=>{o.value.zoomLevel>20&&(o.value.zoomLevel=o.value.zoomLevel-10,o.value.autoWidth=!1)},h=()=>{o.value.zoomLevel=100,o.value.autoWidth=!1};QS("ctrl+-,command+-",f),QS("ctrl+=,command+=",p),QS("ctrl+1,command+1",h);const m=(e,t=50)=>{if(e&&o.value.autoWidth)h();else try{const e=document.querySelector(`${n} .zoomable-container`),r=e.querySelector(".page-content"),i=e.clientWidth,a=r.clientWidth;o.value.zoomLevel=parseInt((i-2*t)/a*100),o.value.autoWidth=!0}catch(r){o.value.autoWidth=!1,tR("error","页面自动宽度计算出错"),console.warn("Page auto width calculation error",r)}};return QS("ctrl+0,command+0",m),t.watch((()=>o.value.showToc),(()=>{o.value.autoWidth&&m()})),(e,v)=>{const g=QC,b=Fd,y=_S,w=Tk,k=NS,x=GC;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.unref(o).preview.enabled?(t.openBlock(),t.createElementBlock("div",dR,[t.createElementVNode("div",{class:t.normalizeClass(["item",{active:t.unref(o).preview.laserPointer}]),onClick:v[5]||(v[5]=e=>t.unref(o).preview.laserPointer=!t.unref(o).preview.laserPointer)},[t.createVNode(g,{name:"laser-pointer"}),t.createTextVNode(" 激光笔 ")],2),t.createElementVNode("div",{class:"item",onClick:d},[t.createVNode(g,{name:"exit"}),t.createTextVNode(" 退出 ")])])):(t.openBlock(),t.createElementBlock("div",rR,[t.createElementVNode("div",oR,[t.createVNode(y,{content:t.unref(o).showToc?"隐藏大纲":"显示大纲"},{default:t.withCtx((()=>[t.createVNode(b,{class:t.normalizeClass(["bar-button",{active:t.unref(o).showToc}]),variant:"text",size:"small",onClick:v[0]||(v[0]=e=>t.unref(o).showToc=!t.unref(o).showToc)},{default:t.withCtx((()=>[t.createVNode(g,{name:"toc",color:"red"})])),_:1},8,["class"])])),_:1},8,["content"]),t.unref(r).document.enableSpellcheck?(t.openBlock(),t.createBlock(y,{key:0,content:t.unref(a).spellcheck?"关闭拼写检查":"开启拼写检查"},{default:t.withCtx((()=>[t.createVNode(b,{class:t.normalizeClass(["bar-button",{active:t.unref(a).spellcheck}]),variant:"text",size:"small",onClick:v[1]||(v[1]=e=>t.unref(a).spellcheck=!t.unref(a).spellcheck)},{default:t.withCtx((()=>[t.createVNode(g,{name:"spellcheck",color:"red"})])),_:1},8,["class"])])),_:1},8,["content"])):t.createCommentVNode("",!0),t.createVNode(y,{content:"快捷键"},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button",variant:"text",size:"small",onClick:v[2]||(v[2]=e=>l.value=!0)},{default:t.withCtx((()=>[t.createVNode(g,{name:"shortcut"})])),_:1})])),_:1}),t.createVNode(y,{content:"重置编辑器"},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button",variant:"text",size:"small",onClick:t.unref(s)},{default:t.withCtx((()=>[t.createVNode(g,{name:"clear-cache"})])),_:1},8,["onClick"])])),_:1}),iR,t.createVNode(y,{content:"由「有墨文档」提供技术支持"},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button",variant:"text",size:"small",href:"https://umodoc.com",target:"_blank"},{default:t.withCtx((()=>[t.createVNode(g,{name:"home-page"})])),_:1})])),_:1}),t.createVNode(y,{content:"使用感受和建议反馈"},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button",variant:"text",size:"small",href:"https://github.com/umodoc/editor/issues",target:"_blank"},{default:t.withCtx((()=>[t.createVNode(g,{name:"message"})])),_:1})])),_:1}),aR,t.unref(i)?(t.openBlock(),t.createElementBlock("div",lR," 已输入 "+t.toDisplayString(t.unref(i).storage.characterCount.characters())+" 字符,"+t.toDisplayString(t.unref(r).document.characterLimit>0?`总计不能超过 ${t.unref(r).document.characterLimit} 字符,`:"")+"已选中 "+t.toDisplayString(t.unref(c))+" 字符 ",1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",sR,[t.createVNode(y,{content:(t.unref(o).preview.enabled?"退出演示":"演示模式 ")+" (F5)"},{default:t.withCtx((()=>[t.createVNode(b,{class:t.normalizeClass(["bar-button",{active:t.unref(o).preview.enabled}]),variant:"text",size:"small",onClick:d},{default:t.withCtx((()=>[t.createVNode(g,{name:"preview"})])),_:1},8,["class"])])),_:1},8,["content"]),t.createVNode(y,{content:(t.unref(u).isFullscreen?"退出全屏":"全屏模式")+" (F11 / ⌘+F11)"},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button",variant:"text",size:"small",onClick:t.unref(u).toggle},{default:t.withCtx((()=>[t.createVNode(g,{name:t.unref(u).isFullscreen?"full-screen-exit":"full-screen"},null,8,["name"])])),_:1},8,["onClick"])])),_:1},8,["content"]),cR,t.createElementVNode("div",uR,[t.createVNode(y,{content:`减小缩放 (${t.unref(eO)("Ctrl-")})`},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button",variant:"text",size:"small",disabled:t.unref(o).zoomLevel<=20,onClick:f},{default:t.withCtx((()=>[t.createVNode(g,{name:"minus"})])),_:1},8,["disabled"])])),_:1},8,["content"]),t.createVNode(w,{modelValue:t.unref(o).zoomLevel,"onUpdate:modelValue":v[3]||(v[3]=e=>t.unref(o).zoomLevel=e),min:20,max:500,step:10,"tooltip-props":{showArrow:!1,theme:"light",popperOptions:{modifiers:[{name:"offset",options:{offset:[0,2]}}]}},label:"当前缩放比例: ${value}%%"},null,8,["modelValue"]),t.createVNode(y,{content:`增加缩放 (${t.unref(eO)("Ctrl+")})`},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button",variant:"text",size:"small",disabled:t.unref(o).zoomLevel>=500,onClick:p},{default:t.withCtx((()=>[t.createVNode(g,{name:"plus"})])),_:1},8,["disabled"])])),_:1},8,["content"]),t.createVNode(y,{content:`最佳宽度 (${t.unref(eO)("Ctrl0")})`},{default:t.withCtx((()=>[t.createVNode(b,{class:t.normalizeClass(["bar-button",{active:t.unref(o).autoWidth}]),variant:"text",size:"small",onClick:v[4]||(v[4]=e=>m(!0))},{default:t.withCtx((()=>[t.createVNode(g,{name:"auto-width"})])),_:1},8,["class"])])),_:1},8,["content"]),t.createVNode(y,{content:`点击快速设置为 100% (${t.unref(eO)("Ctrl1")})`},{default:t.withCtx((()=>[t.createVNode(b,{class:"bar-button zoom-button",variant:"text",size:"small",onClick:h},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(t.unref(o).zoomLevel)+"% ",1)])),_:1})])),_:1},8,["content"])])])])),t.createVNode(x,{visible:l.value,"onUpdate:visible":v[6]||(v[6]=e=>l.value=e),attach:t.unref(n),size:"320px",footer:!1,"close-btn":"","destroy-on-close":"","show-in-attached-element":""},{header:t.withCtx((()=>[t.createElementVNode("div",pR,[t.createVNode(g,{name:"shortcut"}),t.createTextVNode(" 快捷键列表 ")])])),default:t.withCtx((()=>[t.createVNode(k)])),_:1},8,["visible","attach"])],64)}}},[["__scopeId","data-v-959fb03a"]]);var hR=Object.defineProperty,mR=Object.getOwnPropertySymbols,vR=Object.prototype.hasOwnProperty,gR=Object.prototype.propertyIsEnumerable,bR=(e,t,n)=>t in e?hR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yR=(e,t)=>{for(var n in t||(t={}))vR.call(t,n)&&bR(e,n,t[n]);if(mR)for(var n of mR(t))gR.call(t,n)&&bR(e,n,t[n]);return e};function wR(...e){return t=>e.reduceRight(((e,t)=>t(e)),t)}function kR(e){return function t(...n){return n.length>=e.length?e.apply(this,n):(...e)=>t.apply(this,[...n,...e])}}function xR(e,t){return Object.keys(t).forEach((n=>{t[n]instanceof Object&&e[n]&&Object.assign(t[n],xR(e[n],t[n]))})),yR(yR({},e),t)}function CR(e){return Object.prototype.toString.call(e).includes("Object")}function OR(e){return"function"==typeof e}const SR={type:"cancelation",msg:"operation is manually canceled"};function ER(e){let t=!1;const n=new Promise(((n,r)=>{e.then((e=>t?r(SR):n(e))),e.catch(r)}));return Object.assign(n,{cancel(){t=!0}}),n}const NR={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"An unknown error occurred",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n "};const _R=kR((function(e,t){throw new Error(e[t]||NR.default)}))(NR);const MR={config:function(e){return e||_R("configIsRequired"),CR(e)||_R("configType"),e.urls?(console.warn(NR.deprecation),{paths:{vs:e.urls.monacoBase}}):e},changes:function(e,t){return CR(t)||_R("changeType"),Object.keys(t).some((t=>{return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r}))&&_R("changeField"),t},selector:function(e){OR(e)||_R("selectorType")},handler:function(e){OR(e)||CR(e)||_R("handlerType"),CR(e)&&Object.values(e).some((e=>!OR(e)))&&_R("handlersType")},initial:function(e){var t;e||_R("initialIsRequired"),CR(e)||_R("initialType"),t=e,0===Reflect.ownKeys(t).length&&_R("initialContent")}};var AR=Object.defineProperty,TR=Object.getOwnPropertySymbols,VR=Object.prototype.hasOwnProperty,jR=Object.prototype.propertyIsEnumerable,BR=(e,t,n)=>t in e?AR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PR=(e,t)=>{for(var n in t||(t={}))VR.call(t,n)&&BR(e,n,t[n]);if(TR)for(var n of TR(t))jR.call(t,n)&&BR(e,n,t[n]);return e};function IR(e,t){return OR(t)?t(e.current):t}function DR(e,t){return e.current=PR(PR({},e.current),t),t}function LR(e,t,n){return OR(t)?t(e.current):Object.keys(n).forEach((n=>{var r;return null==(r=t[n])?void 0:r.call(t,e.current[n])})),n}var RR=Object.getOwnPropertySymbols,zR=Object.prototype.hasOwnProperty,FR=Object.prototype.propertyIsEnumerable;const[$R,HR]=function(e,t={}){MR.initial(e),MR.handler(t);const n={current:e},r=kR(LR)(n,t),o=kR(DR)(n),i=kR(MR.changes)(e),a=kR(IR)(n);return[function(e=(e=>e)){return MR.selector(e),e(n.current)},function(e){wR(r,o,i,a)(e)}]}({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),UR=new Promise(((e,t)=>HR({resolve:e,reject:t})));function WR(e){return document.body.appendChild(e)}function qR(e){const t=$R((({config:e,reject:t})=>({config:e,reject:t}))),n=function(e){const t=document.createElement("script");return e&&(t.src=e),t}(`${t.config.paths.vs}/loader.js`);return n.onload=()=>e(),n.onerror=t.reject,n}function KR(){const e=$R((({config:e,resolve:t,reject:n})=>({config:e,resolve:t,reject:n}))),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],(t=>{GR(t),e.resolve(t)}),(t=>{e.reject(t)}))}function GR(e){$R().monaco||HR({monaco:e})}var YR={config:function(e){const t=MR.config(e),{monaco:n}=t,r=((e,t)=>{var n={};for(var r in e)zR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&RR)for(var r of RR(e))t.indexOf(r)<0&&FR.call(e,r)&&(n[r]=e[r]);return n})(t,["monaco"]);HR((e=>({config:xR(e.config,r),monaco:n})))},init:function(){const e=$R((({monaco:e,isInitialized:t,resolve:n})=>({monaco:e,isInitialized:t,resolve:n})));if(!e.isInitialized){if(HR({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),ER(UR);if(window.monaco&&window.monaco.editor)return GR(window.monaco),e.resolve(window.monaco),ER(UR);wR(WR,qR)(KR)}return ER(UR)},getMonacoInstance:function(){return $R((({monaco:e})=>e))}};function XR(){}function ZR(e){return/^\d+$/.test(e)?`${e}px`:e}function JR(e,t,n,r){return function(e,t){return e.editor.getModel(QR(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?QR(e,r):void 0)}(e,t,n,r)}function QR(e,t){return e.Uri.parse(t)}function ez(e){return"function"==typeof e?e():e}function tz(e,n,r){const{monacoRef:o,unload:i,isLoadFailed:a}=function(){const e=t.shallowRef(YR.getMonacoInstance()),n=t.ref(!1);let r;return t.onMounted((async()=>{try{if(e.value)return;r=YR.init(),e.value=await r}catch(t){"cancelation"!==(null==t?void 0:t.type)?(n.value=!0,console.error("Monaco initialization error:",t)):n.value=!1}})),{monacoRef:e,unload:()=>null==r?void 0:r.cancel(),isLoadFailed:n}}(),l=t.shallowRef(null),s=t.shallowRef(null),c=t.computed((()=>!!o.value&&!!l.value)),{getWrapperStyle:u,getContainerStyle:d,getLoadingStyle:p}=function(e,n){return{getWrapperStyle:t.computed((()=>({display:"flex",position:"relative",textAlign:"initial",width:ZR(e.width),height:ZR(e.height)}))),getContainerStyle:t.computed((()=>{const e={width:"100%"};return n.value||(e.display="none"),e})),getLoadingStyle:t.computed((()=>({display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"})))}}({width:e.width,height:e.height},c);function f(e){return function(...t){c.value&&e.apply(this,t)}}t.watch((()=>e.theme),f((e=>{var t;return null==(t=o.value)?void 0:t.editor.setTheme(e)}))),t.watch((()=>e.options),(e=>{var t;return null==(t=l.value)?void 0:t.updateOptions(e)}),{deep:!0});return{render:()=>{var o,i,l;return t.h("section",{style:u.value},[!c.value&&t.h("div",{style:p.value},a.value?n.slots.failure?ez(null==(o=n.slots)?void 0:o.failure):"load failed":(null==(i=n.slots)?void 0:i.loading)?ez(null==(l=n.slots)?void 0:l.loading):"loading..."),t.h("div",{ref:s,key:r,style:d.value,class:e.className})])},monacoRef:o,containerRef:s,editorRef:l,unload:i,whenMonacoIsReady:f}}const nz={original:{type:String,default:""},modified:{type:String,default:""},language:{type:String},originalLanguage:{type:String},modifiedLanguage:{type:String},originalModelPath:{type:String},modifiedModelPath:{type:String},keepCurrentOriginalModel:{type:Boolean},keepCurrentModifiedModel:{type:Boolean,default:!1},theme:{type:String,default:"light"},options:{type:Object,default:()=>({})},width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},className:{type:String}};var rz=Object.defineProperty,oz=Object.getOwnPropertySymbols,iz=Object.prototype.hasOwnProperty,az=Object.prototype.propertyIsEnumerable,lz=(e,t,n)=>t in e?rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;t.defineComponent({name:"MonacoDiffEditor",props:nz,slots:Object,setup(e,n){const{emit:r}=n,{render:o,monacoRef:i,containerRef:a,editorRef:l,unload:s,whenMonacoIsReady:c}=tz(e,n,"vue-monaco-diff-editor");t.watch((()=>e.originalModelPath),c((()=>{var t;const n=null==(t=l.value)?void 0:t.getOriginalEditor(),r=JR(i.value,e.original||"",e.originalLanguage||e.language||"text",e.originalModelPath||"");r!==(null==n?void 0:n.getModel())&&(null==n||n.setModel(r))}))),t.watch((()=>e.modifiedModelPath),c((()=>{const t=l.value.getModifiedEditor(),n=JR(i.value,e.modified||"",e.modifiedLanguage||e.language||"text",e.modifiedModelPath||"");n!==t.getModel()&&t.setModel(n)}))),t.watch((()=>e.modified),c((()=>{const t=l.value.getModifiedEditor();t.getOption(i.value.editor.EditorOption.readOnly)?t.setValue(e.modified||""):e.modified!==t.getValue()&&(t.executeEdits("",[{range:t.getModel().getFullModelRange(),text:e.modified||"",forceMoveMarkers:!0}]),t.pushUndoStop())}))),t.watch((()=>e.original),c((()=>{var t,n;null==(n=null==(t=l.value)?void 0:t.getModel())||n.original.setValue((null==e?void 0:e.original)||"")}))),t.watch((()=>[e.language,e.originalLanguage,e.modifiedLanguage]),c((()=>{const{original:t,modified:n}=l.value.getModel();i.value.editor.setModelLanguage(t,e.originalLanguage||e.language||"text"),i.value.editor.setModelLanguage(n,e.originalLanguage||e.language||"text")})));const u=()=>{var t;if(!a.value||!i.value||l.value)return;r("beforeMount",i.value),l.value=i.value.editor.createDiffEditor(a.value,((e,t)=>{for(var n in t||(t={}))iz.call(t,n)&&lz(e,n,t[n]);if(oz)for(var n of oz(t))az.call(t,n)&&lz(e,n,t[n]);return e})({automaticLayout:!0,autoIndent:"brackets",theme:e.theme,formatOnPaste:!0,formatOnType:!0},e.options));const n=JR(i.value,e.original||"",e.originalLanguage||e.language||"text",e.originalModelPath||""),o=JR(i.value,e.modified||"",e.modifiedLanguage||e.language||"text",e.modifiedModelPath||"");null==(t=l.value)||t.setModel({original:n,modified:o}),r("mount",l.value,i.value)};return t.onMounted((()=>{const e=t.watch(i,(()=>{a.value&&i.value&&(t.nextTick((()=>e())),u())}),{immediate:!0})})),t.onUnmounted((()=>{l.value?function(){var t,n,r,o;const i=null==(t=l.value)?void 0:t.getModel();e.keepCurrentOriginalModel||null==(n=null==i?void 0:i.original)||n.dispose();e.keepCurrentModifiedModel||null==(r=null==i?void 0:i.modified)||r.dispose();null==(o=l.value)||o.dispose()}():s()})),o}});const sz={defaultValue:{type:String},defaultLanguage:{type:String},defaultPath:{type:String},value:{type:String,value:""},language:{type:String,default:"javascript"},path:{type:String,default:""},theme:{type:String,default:"light"},line:{type:Number},options:{type:Object,default:()=>({})},overrideServices:{type:Object},saveViewState:{type:Boolean,default:!0},keepCurrentModel:{type:Boolean,default:!1},width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},className:{type:String}};var cz=Object.defineProperty,uz=Object.getOwnPropertySymbols,dz=Object.prototype.hasOwnProperty,pz=Object.prototype.propertyIsEnumerable,fz=(e,t,n)=>t in e?cz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const hz=new Map;var mz=t.defineComponent({name:"MonacoEditor",props:sz,emits:["update:value","beforeMount","mount","change","validate"],slots:Object,setup(e,n){const{emit:r}=n,{render:o,containerRef:i,editorRef:a,monacoRef:l,unload:s,whenMonacoIsReady:c}=tz(e,n,"vue-monaco-editor"),{disposeValidator:u}=function(e,n,r){const o=t.ref(XR),i=t.watch((()=>[n,r]),(()=>{if(n.value&&r.value){t.nextTick((()=>i()));const a=n.value.editor.onDidChangeMarkers((t=>{var o,i;const a=null==(i=null==(o=r.value)?void 0:o.getModel())?void 0:i.uri;if(a&&t.find((e=>e.path===a.path))){const t=n.value.editor.getModelMarkers({resource:a});e("validate",t)}}));o.value=()=>null==a?void 0:a.dispose()}}));return{disposeValidator:o}}(r,l,a),d=t.ref(!1);t.watch((()=>e.path),c(((t,n)=>{var r,o,i;const s=JR(l.value,e.defaultValue||e.value||"",e.defaultLanguage||e.language||"",e.path||e.defaultPath||"");s!==(null==(r=a.value)?void 0:r.getModel())&&(e.saveViewState&&hz.set(n,a.value.saveViewState()),null==(o=a.value)||o.setModel(s),e.saveViewState&&(null==(i=a.value)||i.restoreViewState(hz.get(t))))}))),t.watch((()=>e.value),c((e=>{a.value&&void 0!==e&&(a.value.getOption(l.value.editor.EditorOption.readOnly)?a.value.setValue(e):e!==a.value.getValue()&&(d.value=!0,a.value.executeEdits("",[{range:a.value.getModel().getFullModelRange(),text:e,forceMoveMarkers:!0}]),a.value.pushUndoStop(),d.value=!1))}))),t.watch((()=>e.language),c((e=>{var t,n;const r=null==(t=a.value)?void 0:t.getModel();r&&e&&(null==(n=l.value)||n.editor.setModelLanguage(r,e))}))),t.watch((()=>e.line),c((e=>{var t;void 0!==e&&(null==(t=a.value)||t.revealLine(e))})));const p=()=>{var t,n,o;if(!i.value||!l.value||a.value)return;r("beforeMount",l.value);const s=e.path||e.defaultPath,c=JR(l.value,e.value||e.defaultValue||"",e.language||e.defaultLanguage||"",s||"");if(a.value=null==(t=l.value)?void 0:t.editor.create(i.value,((e,t)=>{for(var n in t||(t={}))dz.call(t,n)&&fz(e,n,t[n]);if(uz)for(var n of uz(t))pz.call(t,n)&&fz(e,n,t[n]);return e})({model:c,theme:e.theme,automaticLayout:!0,autoIndent:"brackets",formatOnPaste:!0,formatOnType:!0},e.options),e.overrideServices),null==(n=a.value)||n.onDidChangeModelContent((e=>{if(!d.value){const t=a.value.getValue();r("update:value",t),r("change",t,e)}})),e.saveViewState){const e=hz.get(s);e&&a.value.restoreViewState(e)}void 0!==e.line&&(null==(o=a.value)||o.revealLine(e.line)),r("mount",a.value,l.value)};return t.onMounted((()=>{const e=t.watch((()=>l.value),(n=>{i.value&&n&&(t.nextTick((()=>e())),p())}),{immediate:!0})})),t.onUnmounted((()=>{var t;null==(t=u.value)||t.call(u),a.value?function(){var t,n;e.keepCurrentModel&&(e.saveViewState?hz.set(e.path,a.value.saveViewState()):null==(t=a.value.getModel())||t.dispose());null==(n=a.value)||n.dispose()}():s()})),o}});const vz={class:"source-editor"},gz=(e=>(t.pushScopeId("data-v-7c20fc6b"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",null,"加载中...",-1))),bz=yS({__name:"source",setup(e){var n;const{options:r,editor:o}=gS(),i=bS("document");YR.config({paths:{vs:`${r.value.cdnUrl}/libs/monaco-editor/min/vs`},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const a={fontSize:14,formatOnType:!0,formatOnPaste:!0,lineNumbersMinChars:3,minimap:{enabled:!1},scrollbar:{verticalScrollbarSize:5,horizontalScrollbarSize:5,scrollbarVisibility:"auto"}},l=t.ref((null==(n=o.value)?void 0:n.getHTML())||i.value.content),s=async e=>{setTimeout((()=>{e.getAction("editor.action.formatDocument").run()}),200)},c=()=>{i.value.content=l.value};return(e,n)=>(t.openBlock(),t.createElementBlock("div",vz,[t.createVNode(t.unref(mz),{value:l.value,"onUpdate:value":n[0]||(n[0]=e=>l.value=e),options:a,language:"html",onMount:s,onChange:c},{loading:t.withCtx((()=>[gz])),_:1},8,["value"])]))}},[["__scopeId","data-v-7c20fc6b"]]),yz={__name:"modal",props:{visible:{type:Boolean,default:!1}},setup(e){const{container:n}=gS();return(r,o)=>{const i=QC,a=IC;return t.openBlock(),t.createBlock(a,t.mergeProps({visible:e.visible,attach:t.unref(n),"prevent-scroll-through":!1,placement:"center",draggable:"","destroy-on-close":""},r.$attrs),{header:t.withCtx((()=>[r.$attrs.icon?(t.openBlock(),t.createBlock(i,{key:0,name:r.$attrs.icon},null,8,["name"])):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString(r.$attrs.title),1)])),default:t.withCtx((()=>[t.renderSlot(r.$slots,"default")])),_:3},16,["visible","attach"])}}},wz={class:"search-replace-container"},kz={class:"search-text"},xz={class:"replace-text"},Cz={class:"advanced-options"},Oz={class:"button-actions"},Sz=yS({__name:"search-replace",setup(e){const{editor:n,searchReplace:r}=gS();let o=t.ref(""),i=t.ref(""),a=t.ref(!1);QS("ctrl+f, command+f",(()=>r.value=!0));const l=t.computed((()=>{var e,t,r;return(null==(r=null==(t=null==(e=n.value)?void 0:e.storage)?void 0:t.searchAndReplace)?void 0:r.results.length)||0})),s=()=>{o.value="",i.value="",n.value.commands.resetIndex()},c=(e=!1)=>{n.value&&(e&&n.value.commands.resetIndex(),n.value.commands.setSearchTerm(o.value),n.value.commands.setReplaceTerm(i.value),n.value.commands.setCaseSensitive(a.value))},u=()=>{if(!n.value)return;const{results:e,resultIndex:t}=n.value.storage.searchAndReplace,r=e[t];if(!r)return;n.value.commands.setTextSelection(r);const{node:o}=n.value.view.domAtPos(n.value.state.selection.anchor);o&&o.scrollIntoView({behavior:"smooth",block:"center"})};t.watch((()=>o.value.trim()),((e,t)=>{e||s(),e!==t&&c(!0)})),t.watch((()=>i.value.trim()),((e,t)=>e===t?null:c())),t.watch((()=>a.value),((e,t)=>e===t?null:c(!0)));const d=()=>{var e;null==(e=n.value)||e.commands.nextSearchResult(),u()},p=()=>{var e;null==(e=n.value)||e.commands.previousSearchResult(),u()},f=()=>{var e;null==(e=n.value)||e.commands.replace(),u()},h=()=>{var e;return null==(e=n.value)?void 0:e.commands.replaceAll()};return t.watch((()=>r.value),(()=>s())),(e,s)=>{const c=gg,u=QC,m=Fd,v=Uy,g=yz;return t.openBlock(),t.createBlock(g,{visible:t.unref(r),icon:"search-replace",title:"查找替换",footer:!1,class:"search-replace-dialog",width:"420px",mode:"modeless","z-index":200,onClose:s[3]||(s[3]=e=>r.value=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",wz,[t.createElementVNode("div",kz,[t.createVNode(c,{modelValue:t.unref(o),"onUpdate:modelValue":s[0]||(s[0]=e=>t.isRef(o)?o.value=e:o=e),placeholder:"要查找的字符",clearable:"",autofocus:"",onEnter:d},{suffix:t.withCtx((()=>{var e,r,i;return[t.createTextVNode(t.toDisplayString(""!==t.unref(o)&&0!==t.unref(l)?(null==(i=null==(r=null==(e=t.unref(n))?void 0:e.storage)?void 0:r.searchAndReplace)?void 0:i.resultIndex)+1:0)+" / "+t.toDisplayString(t.unref(l)),1)]})),_:1},8,["modelValue"]),t.createVNode(m,{disabled:0===t.unref(l),shape:"square",variant:"text",onClick:d},{default:t.withCtx((()=>[t.createVNode(u,{name:"arrow-down",class:"icon-next"})])),_:1},8,["disabled"]),t.createVNode(m,{disabled:0===t.unref(l),shape:"square",variant:"text",onClick:p},{default:t.withCtx((()=>[t.createVNode(u,{name:"arrow-down",class:"icon-prev"})])),_:1},8,["disabled"])]),t.createElementVNode("div",xz,[t.createVNode(c,{modelValue:t.unref(i),"onUpdate:modelValue":s[1]||(s[1]=e=>t.isRef(i)?i.value=e:i=e),placeholder:"要替换的字符",clearable:""},null,8,["modelValue"])]),t.createElementVNode("div",Cz,[t.createVNode(v,{modelValue:t.unref(a),"onUpdate:modelValue":s[2]||(s[2]=e=>t.isRef(a)?a.value=e:a=e)},{default:t.withCtx((()=>[t.createTextVNode("区分大小写(英文)")])),_:1},8,["modelValue"])]),t.createElementVNode("div",Oz,[t.createVNode(m,{disabled:0===t.unref(l),theme:"default",variant:"text",onClick:f},{default:t.withCtx((()=>[t.createTextVNode(" 替换 ")])),_:1},8,["disabled"]),t.createVNode(m,{disabled:0===t.unref(l),theme:"default",variant:"text",onClick:h},{default:t.withCtx((()=>[t.createTextVNode(" 全部替换 ")])),_:1},8,["disabled"]),t.createVNode(m,{disabled:0===t.unref(l),theme:"primary",onClick:d},{default:t.withCtx((()=>[t.createTextVNode("查找")])),_:1},8,["disabled"])])])])),_:1},8,["visible"])}}},[["__scopeId","data-v-00a60991"]]),Ez={class:"button-content"},Nz={class:"button-content"},_z={class:"icon-arrow handle"},Mz={key:0,class:"icon-arrow"},Az={key:1,class:"icon-arrow"},Tz={class:"button-content"},Vz={key:0,class:"icon-arrow"},jz={key:1,class:"icon-arrow"},Bz=yS({__name:"button",props:{value:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:void 0},shortcut:{type:String,default:void 0},buttonType:{type:String,default:"button"},buttonActive:{type:Boolean,default:!1},hugeButton:{type:Boolean,default:!1},selectOptions:{type:Array},popupVisible:{type:Boolean,default:!1},popupHandle:{type:String}},emits:["toggle-popup"],setup(e,{emit:n}){const r=e,o=n,i=t.useAttrs(),{container:a,editor:l}=gS(),s=bS("toolbar"),c=(...e)=>{i.onButtonClickThrough?i.onButtonClickThrough(...e):i.onButtonClick&&i.onButtonClick(...e)};let u=t.ref(!1),d=t.ref(!1);const p=e=>{d.value=e};t.watch((()=>r.popupVisible),(e=>{d.value=e}));const f=t.ref(null),h=t.ref(null),m=e=>{o("toggle-popup",e)};return KO(h,(()=>{o("toggle-popup",!1)}),{ignore:[f,".umo-popup"]}),(n,r)=>{const o=Fd,v=QC,g=Kv,b=mw,y=Zm,w=Mv;return t.openBlock(),t.createBlock(w,{content:`${e.tooltip||""}${e.shortcut?" ("+t.unref(eO)(e.shortcut)+")":""}`,visible:t.unref(u)&&!t.unref(d),theme:"light",placement:"top",attach:t.unref(a),"show-arrow":!1,"destroy-on-close":""},{default:t.withCtx((()=>{var w,k,x,C,O;return[t.createElementVNode("div",{class:"menu-button-wrap",onClick:r[3]||(r[3]=e=>t.isRef(u)?u.value=!1:u=!1),onMouseover:r[4]||(r[4]=e=>t.isRef(u)?u.value=!0:u=!0),onMouseleave:r[5]||(r[5]=e=>t.isRef(u)?u.value=!1:u=!1)},["button"===e.buttonType?(t.openBlock(),t.createBlock(o,t.mergeProps({key:0,class:["menu-button",{"toolbar-classic":"classic"===t.unref(s).mode,"huge-button":e.hugeButton,active:e.buttonActive&&(null==(w=t.unref(l))?void 0:w.isEditable)}],shape:"square",variant:"text",size:"small",disabled:e.disabled||!(null==(k=t.unref(l))?void 0:k.isEditable),onClick:c},t.unref(i)),{default:t.withCtx((()=>[t.createElementVNode("div",Ez,[t.renderSlot(n.$slots,"default",{},void 0,!0)]),e.hugeButton?t.renderSlot(n.$slots,"text",{key:0},void 0,!0):t.createCommentVNode("",!0)])),_:3},16,["class","disabled"])):"dropdown"===e.buttonType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},["arrow"===e.popupHandle?(t.openBlock(),t.createBlock(o,t.mergeProps({key:0,class:["menu-button has-arrow",{"toolbar-classic":"classic"===t.unref(s).mode,"huge-button":e.hugeButton,active:t.unref(d)}],variant:"text",size:"small"},t.unref(i),{disabled:e.disabled||!(null==(x=t.unref(l))?void 0:x.isEditable)}),{default:t.withCtx((()=>[t.createElementVNode("div",Nz,[t.createElementVNode("div",{onClick:c},[t.renderSlot(n.$slots,"default",{},void 0,!0)])]),e.hugeButton?t.renderSlot(n.$slots,"text",{key:0},void 0,!0):t.createCommentVNode("",!0),t.createVNode(g,t.mergeProps(t.unref(i),{trigger:"click",size:"small",options:e.selectOptions,"popup-props":{overlayClassName:t.unref(i)["overlay-class-name"],popperOptions:{modifiers:[{name:"offset",options:{offset:[-22,0]}}]},onVisibleChange:p,destroyOnClose:!0,attach:t.unref(a)},onClick:t.unref(i).onChange}),{default:t.withCtx((()=>[t.createElementVNode("span",_z,[t.createVNode(v,{name:"arrow-down"})]),e.selectOptions?t.createCommentVNode("",!0):t.renderSlot(n.$slots,"dropmenu",{key:0},void 0,!0)])),_:3},16,["options","popup-props","onClick"])])),_:3},16,["class","disabled"])):(t.openBlock(),t.createBlock(g,t.mergeProps({key:1},t.unref(i),{trigger:"click",size:"small",options:e.selectOptions,"popup-props":{overlayClassName:t.unref(i)["overlay-class-name"],onVisibleChange:p,destroyOnClose:!0,attach:t.unref(a)},onClick:t.unref(i).onChange}),{default:t.withCtx((()=>{var r;return[t.createVNode(o,t.mergeProps({class:["menu-button has-arrow",{"toolbar-classic":"classic"===t.unref(s).mode,"huge-button":e.hugeButton,active:t.unref(d)}],variant:"text",size:"small"},t.unref(i),{disabled:e.disabled||!(null==(r=t.unref(l))?void 0:r.isEditable)}),{default:t.withCtx((()=>[t.createElementVNode("div",{class:"button-content",onClick:c},[t.renderSlot(n.$slots,"default",{},void 0,!0),"ribbon"===t.unref(s).mode?(t.openBlock(),t.createElementBlock("span",Mz,[t.createVNode(v,{name:"arrow-down"})])):t.createCommentVNode("",!0)]),e.hugeButton?t.renderSlot(n.$slots,"text",{key:0},void 0,!0):t.createCommentVNode("",!0),"classic"===t.unref(s).mode?(t.openBlock(),t.createElementBlock("span",Az,[t.createVNode(v,{name:"arrow-down"})])):t.createCommentVNode("",!0)])),_:3},16,["class","disabled"]),e.selectOptions?t.createCommentVNode("",!0):t.renderSlot(n.$slots,"dropmenu",{key:0},void 0,!0)]})),_:3},16,["options","popup-props","onClick"]))],64)):"select"===e.buttonType?(t.openBlock(),t.createBlock(b,t.mergeProps({key:2,size:"small",placement:"bottom-left","on-popup-visible-change":p,value:e.value,"popup-props":{destroyOnClose:!0,attach:t.unref(a)}},t.unref(i),{options:e.selectOptions,disabled:e.disabled||!(null==(C=t.unref(l))?void 0:C.isEditable),onChange:c}),{default:t.withCtx((()=>[t.renderSlot(n.$slots,"default",{},void 0,!0)])),_:3},16,["value","popup-props","options","disabled"])):"popup"===e.buttonType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},["arrow"===e.popupHandle?(t.openBlock(),t.createBlock(o,t.mergeProps({key:0,class:["menu-button has-arrow",{active:e.popupVisible}],variant:"text",size:"small"},t.unref(i),{disabled:e.disabled||!(null==(O=t.unref(l))?void 0:O.isEditable)}),{default:t.withCtx((()=>[t.createElementVNode("div",{onClick:c},[t.renderSlot(n.$slots,"default",{},void 0,!0)]),t.createVNode(y,t.mergeProps({attach:t.unref(a),trigger:"click",placement:"bottom-left"},t.unref(i),{visible:e.popupVisible,"popper-options":{modifiers:[{name:"offset",options:{offset:[-22,0]}}]}}),{content:t.withCtx((()=>[t.createElementVNode("div",{class:"umo-popup-content",ref_key:"popupContentRef",ref:h},[t.renderSlot(n.$slots,"content",{},void 0,!0)],512)])),default:t.withCtx((()=>["ribbon"===t.unref(s).mode?(t.openBlock(),t.createElementBlock("span",{key:0,ref_key:"popupHandleRef",ref:f,class:"icon-arrow handle",onClick:r[0]||(r[0]=e=>m())},[t.createVNode(v,{name:"arrow-down"})],512)):t.createCommentVNode("",!0),"classic"===t.unref(s).mode?(t.openBlock(),t.createElementBlock("span",{key:1,ref_key:"popupHandleRef",ref:f,class:"icon-arrow handle",onClick:r[1]||(r[1]=e=>m())},[t.createVNode(v,{name:"arrow-down"})],512)):t.createCommentVNode("",!0)])),_:3},16,["attach","visible"])])),_:3},16,["class","disabled"])):(t.openBlock(),t.createBlock(y,{key:1,attach:t.unref(a),trigger:"click",placement:"bottom-left",visible:e.popupVisible},{content:t.withCtx((()=>[t.createElementVNode("div",{class:"umo-popup-content",ref_key:"popupContentRef",ref:h},[t.renderSlot(n.$slots,"content",{},void 0,!0)],512)])),default:t.withCtx((()=>{var a;return[t.createVNode(o,t.mergeProps({ref_key:"popupHandleRef",ref:f,class:["menu-button has-arrow",{"toolbar-classic":"classic"===t.unref(s).mode,"huge-button":e.hugeButton,active:e.popupVisible}],variant:"text",size:"small"},t.unref(i),{disabled:e.disabled||!(null==(a=t.unref(l))?void 0:a.isEditable),onClick:r[2]||(r[2]=e=>m())}),{default:t.withCtx((()=>[t.createElementVNode("div",Tz,[t.renderSlot(n.$slots,"default",{},void 0,!0),"ribbon"===t.unref(s).mode?(t.openBlock(),t.createElementBlock("span",Vz,[t.createVNode(v,{name:"arrow-down"})])):t.createCommentVNode("",!0)]),e.hugeButton?t.renderSlot(n.$slots,"text",{key:0},void 0,!0):t.createCommentVNode("",!0),"classic"===t.unref(s).mode?(t.openBlock(),t.createElementBlock("span",jz,[t.createVNode(v,{name:"arrow-down"})])):t.createCommentVNode("",!0)])),_:3},16,["class","disabled"])]})),_:3},8,["attach","visible"]))],64)):t.renderSlot(n.$slots,"default",{key:4},void 0,!0)],32)]})),_:3},8,["content","visible","attach"])}}},[["__scopeId","data-v-40ef9935"]]),Pz=(e=>(t.pushScopeId("data-v-f90228db"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",null,"清除高亮",-1))),Iz=yS({__name:"highlight",setup(e){const{editor:n}=gS(),r=[{label:"黄色背景",value:1,bgcolor:"#ffff8a"},{label:"绿色背景",value:2,bgcolor:"#a7ffa7"},{label:"紫色背景",value:3,bgcolor:"#e6afff"},{label:"蓝色背景",value:4,bgcolor:"#83d3ff",divider:!0},{label:"红色字体",value:5,color:"#e71313"},{label:"绿色字体",value:6,color:"#128a00",divider:!0}];let o=t.ref({});const i=e=>{var t,r;e.bgcolor&&(null==(t=n.value)||t.chain().focus().setHighlight({color:e.bgcolor}).run()),e.color&&(null==(r=n.value)||r.chain().focus().setColor(e.color).run()),o.value=e};return(e,a)=>{const l=QC,s=Gv,c=Yv,u=Bz;return t.openBlock(),t.createBlock(u,{tooltip:"高亮显示",shortcut:"Ctrl+Shift+H","button-type":"dropdown","popup-handle":"arrow","overlay-class-name":"hightlight-dropdown",onButtonClick:a[1]||(a[1]=e=>i(t.unref(o)))},{dropmenu:t.withCtx((()=>[t.createVNode(c,null,{default:t.withCtx((()=>[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,(e=>t.createVNode(s,{class:"text-highlight-menu",key:e.value,value:e.value,style:t.normalizeStyle({backgroundColor:e.bgcolor,color:e.color}),divider:e.divider,onClick:t=>i(e)},{default:t.withCtx((()=>[t.createVNode(l,{name:"highlight"}),t.createElementVNode("span",null,t.toDisplayString(e.label),1)])),_:2},1032,["value","style","divider","onClick"]))),64)),t.createVNode(s,{class:"text-highlight-menu clear-format-menu",onClick:a[0]||(a[0]=e=>{return null==(t=n.value)||t.chain().focus().unsetHighlight().run(),null==(r=n.value)||r.chain().focus().unsetColor().run(),void(o.value={});var t,r})},{default:t.withCtx((()=>[t.createVNode(l,{name:"clear-format"}),Pz])),_:1})])),_:1})])),default:t.withCtx((()=>[t.createVNode(l,{name:"highlight",class:"icon-highlight",style:t.normalizeStyle({backgroundColor:t.unref(o).bgcolor,color:t.unref(o).color})},null,8,["style"])])),_:1})}}},[["__scopeId","data-v-f90228db"]]),Dz=e=>(t.pushScopeId("data-v-3bb5a7e3"),e=e(),t.popScopeId(),e),Lz={class:"color-picker-container"},Rz={class:"color-picker-default-button"},zz={class:"color-picker-group"},Fz=["onClick"],$z=Dz((()=>t.createElementVNode("div",{class:"color-picker-group-title"},"标准色",-1))),Hz={class:"color-picker-group"},Uz=["onClick"],Wz={key:0,class:"color-picker-group-title"},qz={key:1,class:"color-picker-group"},Kz=["onClick"],Gz=Dz((()=>t.createElementVNode("div",{class:"color-picker-divider"},null,-1))),Yz={class:"color-picker-more-menu"},Xz=Dz((()=>t.createElementVNode("span",null,"更多颜色",-1))),Zz={class:"color-picker-more-arrow"},Jz=yS({__name:"color-picker",props:{defaultColor:{type:String,default:"#000"}},emits:["change"],setup(e,{emit:n}){const r=e,o=n,{container:i,options:a}=gS(),l=bS("recent"),s=["#B12318","#EB3323","#F6C143","#FFFE55","#A0CD63","#4FAD5B","#4CAFEA","#2D70BA","#06215C","#68389B"],c=t.ref(r.defaultColor),u=t.ref(!1),d=(e,t)=>{t&&"palette-saturation-brightness"!==t.trigger||(l.value.colors.forEach(((t,n)=>{t===e&&l.value.colors.splice(n,1)})),l.value.colors.unshift(e),l.value.colors.length>10&&l.value.colors.splice(10,1),o("change",e))},p=e=>{d(e),o("change",e)};return(e,n)=>{const r=Fd,o=QC,f=mC,h=Zm;return t.openBlock(),t.createElementBlock("div",Lz,[t.createElementVNode("div",Rz,[t.createVNode(r,{theme:"default",variant:"outline",size:"small",block:"",onClick:n[0]||(n[0]=e=>p(c.value))},{default:t.withCtx((()=>[t.createTextVNode(" 默认颜色 ")])),_:1})]),t.createElementVNode("div",zz,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).dicts.colors,((e,n)=>(t.openBlock(),t.createElementBlock("div",{class:"color-picker-item",key:n,style:t.normalizeStyle({backgroundColor:e}),onClick:t=>p(e)},null,12,Fz)))),128))]),$z,t.createElementVNode("div",Hz,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(s,((e,n)=>t.createElementVNode("div",{class:"color-picker-item",key:n,style:t.normalizeStyle({backgroundColor:e}),onClick:t=>p(e)},null,12,Uz))),64))]),t.unref(l).colors.length>0?(t.openBlock(),t.createElementBlock("div",Wz," 最近使用 ")):t.createCommentVNode("",!0),t.unref(l).colors.length>0?(t.openBlock(),t.createElementBlock("div",qz,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(l).colors,((e,n)=>(t.openBlock(),t.createElementBlock("div",{class:"color-picker-item",key:n,style:t.normalizeStyle({backgroundColor:e}),onClick:t=>p(e)},null,12,Kz)))),128))])):t.createCommentVNode("",!0),Gz,t.createVNode(h,{attach:t.unref(i),trigger:"click",placement:"right-bottom",onVisibleChange:n[2]||(n[2]=e=>u.value=e)},{content:t.withCtx((()=>[t.createVNode(f,{modelValue:c.value,"onUpdate:modelValue":n[1]||(n[1]=e=>c.value=e),size:"small","color-modes":["monochrome"],"swatch-colors":[],"enable-alpha":"",onChange:d},null,8,["modelValue"])])),default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["color-picker-more",{active:u.value}])},[t.createElementVNode("div",Yz,[t.createVNode(o,{style:t.normalizeStyle({color:c.value}),name:"palette-color"},null,8,["style"]),Xz]),t.createElementVNode("div",Zz,[t.createVNode(o,{name:"arrow-down"})])],2)])),_:1},8,["attach"])])}}},[["__scopeId","data-v-3bb5a7e3"]]);function Qz(){const e=t.ref(!1);return{popupVisible:e,togglePopup:t=>{e.value=void 0!==t?t:!e.value}}}const eF=yS({__name:"background-color",props:{tooltip:{type:String,default:"字体背景颜色"},modeless:{type:Boolean,default:!1},defaultColor:{type:String,default:""}},emits:["change"],setup(e,{emit:n}){const r=e,o=n;let{popupVisible:i,togglePopup:a}=Qz();const{editor:l}=gS();let s=t.ref();const c=e=>{var t,n;s.value=e,i.value=!1,r.modeless?o("change",s.value):""!==e?null==(t=l.value)||t.chain().focus().setHighlight({color:e}).run():null==(n=l.value)||n.chain().focus().unsetHighlight().run()};return(n,r)=>{const o=QC,u=Jz,d=Bz;return t.openBlock(),t.createBlock(d,{tooltip:e.tooltip,"button-type":"popup","popup-handle":"arrow","popup-visible":t.unref(i),onTogglePopup:t.unref(a)},{content:t.withCtx((()=>[t.createVNode(u,{"default-color":e.defaultColor,onChange:c},null,8,["default-color"])])),default:t.withCtx((()=>{var e,n;return[t.createVNode(o,{name:"background-color",class:"icon-background-color",style:t.normalizeStyle({background:(null==(n=null==(e=t.unref(l))?void 0:e.getAttributes("highlight"))?void 0:n.color)||t.unref(s)})},null,8,["style"])]})),_:1},8,["tooltip","popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-4b752ecb"]]),tF=yS({__name:"color",props:{tooltip:{type:String,default:"字体颜色"},modeless:{type:Boolean,default:!1},defaultColor:{type:String,default:"#000"}},emits:["change"],setup(e,{emit:n}){const r=e,o=n;let{popupVisible:i,togglePopup:a}=Qz();const{editor:l}=gS();let s=t.ref();const c=e=>{var t,n;s.value=e,i.value=!1,r.modeless?o("change",s.value):""!==e?null==(t=l.value)||t.chain().focus().setColor(e).run():null==(n=l.value)||n.chain().focus().unsetColor().run()};return(n,r)=>{const o=QC,u=Jz,d=Bz;return t.openBlock(),t.createBlock(d,{tooltip:e.tooltip,"button-type":"popup","popup-handle":"arrow","popup-visible":t.unref(i),onTogglePopup:t.unref(a),onButtonClick:r[0]||(r[0]=e=>c(t.unref(s)))},{content:t.withCtx((()=>[t.createVNode(u,{"default-color":e.defaultColor,onChange:c},null,8,["default-color"])])),default:t.withCtx((()=>{var e,n;return[t.createVNode(o,{name:"color"}),t.createElementVNode("div",{class:"current-color",style:t.normalizeStyle({background:(null==(n=null==(e=t.unref(l))?void 0:e.getAttributes("textStyle"))?void 0:n.color)||t.unref(s)})},null,4)]})),_:1},8,["tooltip","popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-a8eaf99e"]]),nF={__name:"align-distributed",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive({textAlign:"distributed"}),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().setTextAlign("distributed").run()),tooltip:"分散对齐",shortcut:"Ctrl+Shift+D",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().setTextAlign("distributed").run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"align-distributed"})])),_:1},8,["button-active","disabled"])}}},rF={__name:"align-justify",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive({textAlign:"justify"}),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().setTextAlign("justify").run()),tooltip:"两端对齐",shortcut:"Ctrl+Shift+J",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().setTextAlign("justify").run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"align-justify"})])),_:1},8,["button-active","disabled"])}}},oF={__name:"align-right",setup(e){const{editor:n}=gS(),r=()=>{var e,t,r,o;(null==(e=n.value)?void 0:e.can().chain().focus().setTextAlign("right").run())&&(null==(t=n.value)||t.chain().focus().setTextAlign("right").run()),(null==(r=n.value)?void 0:r.can().chain().focus().setNodeAlign("flex-end").run())&&(null==(o=n.value)||o.chain().focus().setNodeAlign("flex-end").run())};return(e,o)=>{var i,a,l,s;const c=QC,u=Bz;return t.openBlock(),t.createBlock(u,{"button-active":(null==(i=t.unref(n))?void 0:i.isActive({textAlign:"right"}))||(null==(a=t.unref(n))?void 0:a.isActive({nodeAlign:"flex-end"})),disabled:!(null==(l=t.unref(n))?void 0:l.can().chain().focus().setTextAlign("right").run())&&!(null==(s=t.unref(n))?void 0:s.can().chain().focus().setNodeAlign("flex-end").run()),tooltip:"右对齐",shortcut:"Ctrl+Shift+R",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(c,{name:"align-right"})])),_:1},8,["button-active","disabled"])}}},iF={__name:"align-center",setup(e){const{editor:n}=gS(),r=()=>{var e,t,r,o;(null==(e=n.value)?void 0:e.can().chain().focus().setTextAlign("center").run())&&(null==(t=n.value)||t.chain().focus().setTextAlign("center").run()),(null==(r=n.value)?void 0:r.can().chain().focus().setNodeAlign("center").run())&&(null==(o=n.value)||o.chain().focus().setNodeAlign("center").run())};return(e,o)=>{var i,a,l,s;const c=QC,u=Bz;return t.openBlock(),t.createBlock(u,{"button-active":(null==(i=t.unref(n))?void 0:i.isActive({textAlign:"center"}))||(null==(a=t.unref(n))?void 0:a.isActive({nodeAlign:"center"})),disabled:!(null==(l=t.unref(n))?void 0:l.can().chain().focus().setTextAlign("center").run())&&!(null==(s=t.unref(n))?void 0:s.can().chain().focus().setNodeAlign("center").run()),tooltip:"居中对齐",shortcut:"Ctrl+Shift+E",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(c,{name:"align-center"})])),_:1},8,["button-active","disabled"])}}},aF={__name:"align-left",setup(e){const{editor:n}=gS(),r=()=>{var e,t,r,o;(null==(e=n.value)?void 0:e.can().chain().focus().setTextAlign("left").run())&&(null==(t=n.value)||t.chain().focus().setTextAlign("left").run()),(null==(r=n.value)?void 0:r.can().chain().focus().setNodeAlign("flex-start").run())&&(null==(o=n.value)||o.chain().focus().setNodeAlign("flex-start").run())};return(e,o)=>{var i,a,l,s;const c=QC,u=Bz;return t.openBlock(),t.createBlock(u,{"button-active":(null==(i=t.unref(n))?void 0:i.isActive({textAlign:"left"}))||(null==(a=t.unref(n))?void 0:a.isActive({nodeAlign:"flex-start"})),disabled:!(null==(l=t.unref(n))?void 0:l.can().chain().focus().setTextAlign("left").run())&&!(null==(s=t.unref(n))?void 0:s.can().chain().focus().setNodeAlign("left").run()),tooltip:"左对齐",shortcut:"Ctrl+Shift+L",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(c,{name:"align-left"})])),_:1},8,["button-active","disabled"])}}},lF={class:"text-align-group"},sF=yS({__name:"align-dropdown",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{editor:o}=gS(),i=t.computed((()=>o.value?o.value.isActive({textAlign:"justify"})?"left":o.value.isActive({textAlign:"center"})?"center":o.value.isActive({textAlign:"right"})?"right":o.value.isActive({textAlign:"justify"})?"justify":"left":"left"));return(e,a)=>{var l;const s=QC,c=aF,u=iF,d=oF,p=rF,f=nF,h=Bz;return t.openBlock(),t.createBlock(h,{tooltip:"文字对齐方式","button-type":"popup",disabled:!(null==(l=t.unref(o))?void 0:l.can().chain().focus().setTextAlign("center").run()),"popup-visible":t.unref(n),onTogglePopup:t.unref(r)},{content:t.withCtx((()=>[t.createElementVNode("div",lF,[t.createVNode(c),t.createVNode(u),t.createVNode(d),t.createVNode(p),t.createVNode(f)])])),default:t.withCtx((()=>[t.createVNode(s,{name:`align-${t.unref(i)}`,class:"text-align"},null,8,["name"])])),_:1},8,["disabled","popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-267bcaa0"]]),cF={__name:"strike",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("strike"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleStrike().run()),tooltip:"删除线",shortcut:"Ctrl+Shift+X",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleStrike().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"strike"})])),_:1},8,["button-active","disabled"])}}},uF={__name:"underline",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("underline"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleUnderline().run()),tooltip:"下划线",shortcut:"Ctrl+U",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleUnderline().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"underline"})])),_:1},8,["button-active","disabled"])}}},dF={__name:"italic",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("italic"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleItalic().run()),tooltip:"斜体",shortcut:"Ctrl+I",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleItalic().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"italic"})])),_:1},8,["button-active","disabled"])}}},pF={__name:"bold",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("bold"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleBold().run()),tooltip:"加粗",shortcut:"Ctrl+B",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleBold().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"bold"})])),_:1},8,["button-active","disabled"])}}},fF={__name:"font-size",props:{select:{type:Boolean,default:!0}},setup(e){const{editor:n}=gS(),r=bS("toolbar"),o=[{label:"默认",value:"14px",order:4},{label:"初号",value:"42pt",order:20},{label:"小初",value:"36pt",order:19},{label:"一号",value:"26pt",order:16},{label:"小一",value:"24pt",order:15},{label:"二号",value:"22pt",order:14},{label:"小二",value:"18pt",order:11},{label:"三号",value:"16pt",order:10},{label:"小三",value:"15pt",order:9},{label:"四号",value:"14pt",order:7},{label:"小四",value:"12pt",order:4},{label:"五号",value:"10.5pt",order:1},{label:"小五",value:"9pt",order:3},{label:"六号",value:"7.5pt",order:1},{label:"小六",value:"6.5pt",order:0},{label:"10",value:"10px",order:1},{label:"11",value:"11px",order:2},{label:"12",value:"12px",order:3},{label:"16",value:"16px",order:5},{label:"18",value:"18px",order:6},{label:"20",value:"20px",order:8},{label:"22",value:"22px",order:10},{label:"24",value:"24px",order:11},{label:"26",value:"26px",order:12},{label:"28",value:"28px",order:13},{label:"32",value:"32px",order:15},{label:"36",value:"36px",order:17},{label:"42",value:"42px",order:18},{label:"48",value:"48px",order:19},{label:"72",value:"72px",order:21},{label:"96",value:"96px",order:22}],i=e=>{n.value.chain().focus().setFontSize(e).run()},a=()=>{const{fontSize:e}=n.value.getAttributes("textStyle");if(e){const t=o.find((({value:t})=>t===e));if(!t)return;const n=o.find((({order:e})=>e===t.order+1));n&&i(n.value)}else i("16px")},l=()=>{const{fontSize:e}=n.value.getAttributes("textStyle");if(e){const t=o.find((({value:t})=>t===e));if(!t)return;const n=o.find((({order:e})=>e===t.order-1));n&&i(n.value)}else i("14px")};return(s,c)=>{var u;const d=Bz,p=QC;return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.select?(t.openBlock(),t.createBlock(d,t.mergeProps({key:0,tooltip:"字体大小","button-type":"select",style:{width:"classic"!==t.unref(r).mode?"80px":"58px"},"select-options":o,value:(null==(u=t.unref(n))?void 0:u.getAttributes("textStyle").fontSize)||"14px"},s.$attrs,{placeholder:"字号",filterable:"",onButtonClick:i}),null,16,["style","value"])):t.createCommentVNode("",!0),t.createVNode(d,{tooltip:"增大字号",onButtonClick:a},{default:t.withCtx((()=>[t.createVNode(p,{name:"font-size-increase"})])),_:1}),t.createVNode(d,{tooltip:"减小字号",onButtonClick:l},{default:t.withCtx((()=>[t.createVNode(p,{name:"font-size-decrease"})])),_:1})],64)}}},hF={__name:"copy",setup(e){const{editor:n}=gS(),r=()=>{const e=n.value.commands.getSelectionNode(),{copy:r}=JO({source:t.ref(e.props.node.attrs.code)});r(),tR("success","代码已复制到剪切板")};return(e,n)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"复制代码",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(o,{name:"copy"})])),_:1})}}},mF={__name:"word-wrap",setup(e){const{editor:n}=gS(),r=()=>{var e;const t=n.value.commands.getSelectionNode(),{wordWrap:r}=null==(e=n.value)?void 0:e.getAttributes("codeBlock");t.props.updateAttributes({wordWrap:!r})};return(e,o)=>{var i,a;const l=QC,s=Bz;return t.openBlock(),t.createBlock(s,{"button-active":null==(a=null==(i=t.unref(n))?void 0:i.getAttributes("codeBlock"))?void 0:a.wordWrap,tooltip:"自动换行",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(l,{name:"code-word-wrap"})])),_:1},8,["button-active"])}}},vF={__name:"line-numbers",setup(e){const{editor:n}=gS(),r=()=>{var e;const t=n.value.commands.getSelectionNode(),{lineNumbers:r}=null==(e=n.value)?void 0:e.getAttributes("codeBlock");t.props.updateAttributes({lineNumbers:!r})};return(e,o)=>{var i,a;const l=QC,s=Bz;return t.openBlock(),t.createBlock(s,{"button-active":null==(a=null==(i=t.unref(n))?void 0:i.getAttributes("codeBlock"))?void 0:a.lineNumbers,tooltip:"显示行号",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(l,{name:"code-line-number"})])),_:1},8,["button-active"])}}},gF={__name:"themes",setup(e){const{editor:n}=gS(),r=[{label:"暗色主题",value:"dark"},{label:"浅色主题",value:"light"}],o=e=>{n.value.commands.getSelectionNode().props.updateAttributes({theme:e})};return(e,i)=>{var a,l;const s=Bz;return t.openBlock(),t.createBlock(s,{tooltip:"主题","button-type":"select",style:{width:"100px"},"select-options":r,value:null==(l=null==(a=t.unref(n))?void 0:a.getAttributes("codeBlock"))?void 0:l.theme,placeholder:"清选择",onButtonClick:o},null,8,["value"])}}};var bF={},yF=Symbol(),wF=Symbol(),kF=e=>"string"==typeof e?xF[e]:e,xF={plain:bF,plaintext:bF,text:bF,txt:bF},CF=(e,t)=>(t[wF]||OF)(e,t),OF=(e,t)=>{for(var n,r=[e],o=[],i=0;n=kF(t[yF]);)delete t[yF],Object.assign(t,n);for(AF(e,t,r,0);o[i++]=r[0],r=r[1];);return o},SF="</span>",EF="",NF="",_F=e=>{for(var t="",n=e.length,r=0;r<n;)t+=MF(e[r++]);return t},MF=e=>{if(e instanceof TF){var{type:t,alias:n,content:r}=e,o=EF,i=NF,a=`<span class="token ${t+(n?" "+n:"")+("keyword"==t&&"string"==typeof r?" keyword-"+r:"")}">`;NF+=SF,EF+=a;var l=MF(r);return EF=o,NF=i,a+l+SF}return"string"!=typeof e?_F(e):(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;"),NF&&e.includes("\n")?e.replace(/\n/g,NF+"\n"+EF):e)},AF=(e,t,n,r,o)=>{for(var i in t)if(t[i])for(var a=0,l=t[i],s=Array.isArray(l)?l:[l];a<s.length;++a){if(o&&o[0]==i&&o[1]==a)return;for(var c=s[a],u=c.pattern||c,d=kF(c.inside),p=c.lookbehind,f=c.greedy&&u.global,h=c.alias,m=n,v=r;m&&(!o||v<o[2]);v+=m[0].length,m=m[1]){var g,b,y=m[0],w=0;if(!(y instanceof TF)){if(u.lastIndex=f?v:0,(g=u.exec(f?e:y))&&p&&g[1]&&(b=g[1].length,g.index+=b,g[0]=g[0].slice(b)),f){if(!g)break;if(g[0]){for(var k,x=(S=g.index)+g[0].length;S>=v+(k=m[0].length);m=m[1],v+=k);if(m[0]instanceof TF)continue;var C=m;for(l=v;(l+=C[0].length)<x;C=C[1],w++);y=e.slice(v,l),g.index-=v}}if(g&&g[0]){for(var O,S=g.index,E=g[0],N=y.slice(S+E.length),_=v+y.length,M=new TF(i,d?CF(E,d):E,E,h),A=m,T=0;A=A[1],T++<w;);N&&(!A||A[0]instanceof TF?A=[N,A]:A[0]=N+A[0]),v+=S,m[0]=S?y.slice(0,S):M,S?m=m[1]=[M,A]:m[1]=A,w&&(AF(e,t,m,v,O=[i,a,_]),_=O[2]),o&&_>o[2]&&(o[2]=_)}}}}};function TF(e,t,n,r){this.type=e,this.content=t,this.alias=r,this.length=n.length}const VF={__name:"languages",setup(e){const{editor:n}=gS(),r=Object.keys(xF).map((e=>({label:e,value:e}))),o=e=>{n.value.commands.getSelectionNode().props.updateAttributes({language:e})};return(e,i)=>{var a,l;const s=Bz;return t.openBlock(),t.createBlock(s,{tooltip:"语言列表","button-type":"select",style:{width:"120px"},"select-options":t.unref(r),value:null==(l=null==(a=t.unref(n))?void 0:a.getAttributes("codeBlock"))?void 0:l.language,placeholder:"清选择",filterable:"",onButtonClick:o},null,8,["select-options","value"])}}},jF={key:0,class:"button-text"},BF={__name:"split-cell",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"拆分单元格",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().splitCell()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().splitCell().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-split-cell"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",jF,"拆分单元格")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},PF={key:0,class:"button-text"},IF={__name:"merge-cells",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"合并单元格",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().mergeCells()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().mergeCells().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-merge-cell"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",PF,"合并单元格")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},DF={key:0,class:"button-text"},LF={__name:"delete-column",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"删除列",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().deleteColumn()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().deleteColumn().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-delete-column"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",DF,"删除列")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},RF={key:0,class:"button-text"},zF={__name:"delete-row",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"删除行",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().deleteRow()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().deleteRow().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-delete-row"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",RF,"删除行")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},FF={key:0,class:"button-text"},$F={__name:"add-column-after",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"插入列(右)",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().addColumnAfter()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().addColumnAfter().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-add-column-after"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",FF,"插入列(右)")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},HF={key:0,class:"button-text"},UF={__name:"add-column-before",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"插入列(左)",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().addColumnBefore()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().addColumnBefore().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-add-column-before"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",HF,"插入列(左)")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},WF={key:0,class:"button-text"},qF={__name:"add-row-after",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"插入行(后)",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().addRowAfter()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().addRowAfter().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-add-row-after"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",WF,"插入行(后)")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},KF={key:0,class:"button-text"},GF={__name:"add-row-before",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"插入行(前)",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().addRowBefore()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().addRowBefore().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-add-row-before"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",KF,"插入行(前)")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},YF=t.createElementVNode("p",{class:"button-text"},"背景颜色",-1),XF={__name:"cells-background",props:{hugeButton:{type:Boolean,default:!0}},emits:["change"],setup(e,{emit:n}){let{popupVisible:r,togglePopup:o}=Qz();const{editor:i}=gS(),a=e=>{var t;r.value=!1;const n=""===e?null:e;null==(t=i.value)||t.chain().focus().setCellAttribute("backgroundColor",n).run()};return(n,l)=>{var s;const c=QC,u=Jz,d=Bz;return t.openBlock(),t.createBlock(d,{"button-type":"popup",tooltip:"单元格背景颜色","huge-button":e.hugeButton,disabled:!(null==(s=t.unref(i))?void 0:s.can().setCellAttribute("backgroundColor")),"popup-visible":t.unref(r),onTogglePopup:t.unref(o)},{text:t.withCtx((()=>[YF])),content:t.withCtx((()=>[t.createVNode(u,{"default-color":"",onChange:a})])),default:t.withCtx((()=>[t.createVNode(c,{name:"table-cells-background",size:e.hugeButton?"1em":"18px"},null,8,["size"])])),_:1},8,["huge-button","disabled","popup-visible","onTogglePopup"])}}},ZF=t.createElementVNode("p",{class:"button-text"},"对齐方式",-1),JF={__name:"cells-align",props:{hugeButton:{type:Boolean,default:!0}},setup(e){const{editor:n}=gS(),r=[{content:"靠上左对齐",value:"left-top"},{content:"靠上居中对齐",value:"center-top"},{content:"靠上右对齐",value:"right-top"},{content:"靠上两端对齐",value:"justify-top",divider:!0},{content:"中间左对齐",value:"left-middle"},{content:"中间对齐",value:"center-middle"},{content:"中间右对齐",value:"right-middle"},{content:"中间两端对齐",value:"justify-middle",divider:!0},{content:"靠下左对齐",value:"left-bottom"},{content:"靠下居中对齐",value:"center-bottom"},{content:"靠下右对齐",value:"right-bottom"},{content:"靠下两端对齐",value:"justify-bottom"}],o=({value:e})=>{var t;null==(t=n.value)||t.chain().focus().setCellAttribute("align",e).run()};return(i,a)=>{var l;const s=QC,c=Bz;return t.openBlock(),t.createBlock(c,{"button-type":"dropdown",tooltip:"单元格对齐方式","huge-button":e.hugeButton,"select-options":r,disabled:!(null==(l=t.unref(n))?void 0:l.can().setCellAttribute("align")),onChange:o},{text:t.withCtx((()=>[ZF])),default:t.withCtx((()=>[t.createVNode(s,{name:"table-cells-align",size:e.hugeButton?"1em":"18px"},null,8,["size"])])),_:1},8,["huge-button","disabled"])}}},QF={__name:"download",setup(e){const{editor:n}=gS(),r=()=>{var e;const t=document.createElement("a");t.href=null==(e=n.value)?void 0:e.getAttributes("file").url,t.target="_blank",t.click()};return(e,n)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"下载文件",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(o,{name:"download"})])),_:1})}}},e$={__name:"node-delete",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"删除",shortcut:"Backspace",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().deleteSelectionNode().run()})},{default:t.withCtx((()=>[t.createVNode(o,{name:"node-delete"})])),_:1})}}},t$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n$=e=>{let t,n,r,o,i,a,l,s=0,c="";for(e=(e=>{e=e.replace(/\r\n/g,"\n");let t=0,n="";for(;t<e.length;t++){const r=e.charCodeAt(t);r<128?n+=String.fromCharCode(r):r>127&&r<2048?(n+=String.fromCharCode(r>>6|192),n+=String.fromCharCode(63&r|128)):(n+=String.fromCharCode(r>>12|224),n+=String.fromCharCode(r>>6&63|128),n+=String.fromCharCode(63&r|128))}return n})(e);s<e.length;)t=e.charCodeAt(s++),n=e.charCodeAt(s++),r=e.charCodeAt(s++),o=t>>2,i=(3&t)<<4|n>>4,a=(15&n)<<2|r>>6,l=63&r,isNaN(n)?a=l=64:isNaN(r)&&(l=64),c=c+t$.charAt(o)+t$.charAt(i)+t$.charAt(a)+t$.charAt(l);return c},r$=e=>"data:image/svg+xml;base64,"+n$(e),o$=e=>{switch((e=>"string"==typeof e?"string":"undefined"!=typeof SVGElement&&e instanceof SVGElement?"element":void 0)(e)){case"string":return r$(e);case"element":return(e=>r$((new XMLSerializer).serializeToString(e)))(e);default:return e}},i$=e=>(t.pushScopeId("data-v-6a26bb64"),e=e(),t.popScopeId(),e),a$=i$((()=>t.createElementVNode("p",{class:"button-text"},"Mermaid",-1))),l$={class:"mermaid-container"},s$={class:"mermaid-render"},c$=i$((()=>t.createElementVNode("div",{class:"mermaid-title"},"预览",-1))),u$=["innerHTML"],d$=yS({__name:"mermaid",props:{content:{type:String}},setup(e){const r=e;let o=t.ref(!1);const{editor:i}=gS(),a=()=>{o.value=!0,n.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"})};let l=t.ref(""),s=t.ref("");const c=t.ref();t.watch((()=>o.value),(e=>{e&&(l.value=r.content||"graph TB\na--\x3eb")}),{immediate:!0}),t.watch((()=>l.value),(async()=>{o.value&&(await t.nextTick(),(async()=>{try{const{svg:e}=await n.render("mermaid-svg",l.value);s.value=e}catch(e){s.value=""}})())}),{immediate:!0});const u=()=>{var e;if(""===l.value)return void tR("error","Mermaid 代码不能为空");const t=c.value.querySelector("svg"),n=t.width.animVal.value,a=t.height.animVal.value,u=o$(s.value);(!r.content||r.content&&r.content!==l.value)&&(null==(e=i.value)||e.chain().focus().setImage({type:"mermaid",src:u,content:l.value,width:n,height:a},!!r.content).run()),o.value=!1};return(n,r)=>{const i=QC,d=Bz,p=Lk,f=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(d,{"huge-button":"",onButtonClick:a},{text:t.withCtx((()=>[a$])),default:t.withCtx((()=>[t.createVNode(i,{name:e.content?"edit":"mermaid"},null,8,["name"])])),_:1}),t.createVNode(f,{visible:t.unref(o),icon:"mermaid",title:e.content?"编辑 Mermaid 图表":"添加 Mermaid 图表",width:"960px",onConfirm:u,onClose:r[1]||(r[1]=e=>t.isRef(o)?o.value=n.flase:o=n.flase)},{default:t.withCtx((()=>[t.createElementVNode("div",l$,[t.createVNode(p,{class:"mermaid-code",modelValue:t.unref(l),"onUpdate:modelValue":r[0]||(r[0]=e=>t.isRef(l)?l.value=e:l=e),autofocus:"",placeholder:"请输入 Mermaid 代码"},null,8,["modelValue"]),t.createElementVNode("div",s$,[c$,t.createElementVNode("div",{class:"mermaid-svg narrow-scrollbar",ref_key:"mermaidRef",ref:c,innerHTML:t.unref(s)},null,8,u$)])])])),_:1},8,["visible","title"])],64)}}},[["__scopeId","data-v-6a26bb64"]]);class p${constructor({domain:e,params:t,container:n}){c(this,"domain","https://embed.diagrams.net"),c(this,"params",{ui:"atlas",proto:"json",libraries:1,configure:1,noSaveBtn:1,dark:1,lang:"zh"}),c(this,"xml",null),c(this,"format","xmlsvg"),this.domain=e??this.domain,this.params=Object.assign(t||{},this.params),this.container=n,this.handleuseMessageEvent=e=>{if(void 0!==this.frame&&e.source===this.frame.contentWindow&&e.data.length>0)try{const t=JSON.parse(e.data);t&&this.handleuseMessage(t)}catch(t){console.error(t)}}}edit(e){let t=this.format;return"data:image/png;"===e.substring(0,15)?t="xmlpng":"data:image/svg+xml;"===e.substring(0,19)&&(t="xmlsvg"),this.startEditing(e,t),this}createFrame(){const e=Object.keys(this.params).map((e=>e+"="+this.params[e])).join("&"),t=document.createElement("iframe");return t.setAttribute("class","diagrams-iframe"),t.setAttribute("src",`${this.domain}?${e}`),t}postMessage(e){this.frame&&this.frame.contentWindow.postMessage(JSON.stringify(e),"*")}handleuseMessage(e){"configure"===e.event?this.configureEditor():"init"===e.event?this.initializeEditor():"save"===e.event&&(this.export(e.data),this.xml=e.xml,e.exit?e.event="exit":this.postMessage({action:"status",messageKey:"allChangesSaved",modified:!1})),"exit"===e.event&&("xml"!==this.format&&this.xml&&this.postMessage({action:"export",format:this.format,xml:this.xml,spinKey:"export"}),this.stopEditing(e))}startEditing(e,t){if(!this.frame){window.addEventListener("message",this.handleuseMessageEvent),this.format=t??this.format,this.data=e,this.frame=this.createFrame();document.querySelector(this.container).appendChild(this.frame)}}stopEditing(){window.removeEventListener("message",this.handleuseMessageEvent),this.frame=void 0}initializeEditor(){this.postMessage({action:"load",autosave:0,saveAndExit:"1",modified:"unsavedChanges",xml:this.data})}configureEditor(){this.postMessage({action:"configure",config:this.params.configure})}export(e){return e}}const f$=t.createElementVNode("p",{class:"button-text"},"流程图",-1),h$={key:0,class:"diagrams-loading"},m$=t.createElementVNode("div",{class:"diagrams-container"},null,-1),v$={__name:"diagrams",props:{content:{type:String}},setup(e){const n=e,{container:r,options:o,editor:i}=gS();let a=t.ref(!1),l=t.ref(!1);const s=new p$({domain:o.value.diagrams.domain,params:o.value.diagrams.params,container:`${r} .diagrams-container`}),c=()=>{s.edit(n.content||"")},u=e=>{var t;if("message"!==(null==e?void 0:e.type)&&(null==e?void 0:e.origin)!==o.value.diagrams.domain)return;const{event:r,bounds:s,data:c}=JSON.parse(e.data);if("load"===r&&(l.value=!1),"export"===r){const{width:e,height:r}=s;return(!n.content||n.content&&n.content!==c)&&(null==(t=i.value)||t.chain().focus().setImage({type:"diagrams",src:c,width:e,height:r,content:c},!!n.content).run()),void(a.value=!1)}"exit"===r&&(a.value=!1)};return t.watch((()=>a.value),(e=>{if(!e)return window.removeEventListener("message",u),void s.stopEditing();l.value=!0,window.addEventListener("message",u)})),t.onBeforeMount((()=>{window.addEventListener("message",u)})),(n,r)=>{const o=QC,i=Bz,s=Cd,u=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.isRef(a)?a.value=!0:a=!0)},{text:t.withCtx((()=>[f$])),default:t.withCtx((()=>[t.createVNode(o,{name:e.content?"edit":"diagrams"},null,8,["name"])])),_:1}),t.createVNode(u,{visible:t.unref(a),icon:"diagrams",title:e.content?"编辑流程图":"新建流程图",footer:!1,class:"diagrams-dialog",mode:"full-screen",onOpened:c,onClose:r[1]||(r[1]=e=>t.isRef(a)?a.value=!1:a=!1)},{default:t.withCtx((()=>[t.unref(l)?(t.openBlock(),t.createElementBlock("div",h$,[t.createVNode(s,{text:"正在加载编辑器...",size:"small"})])):t.createCommentVNode("",!0),m$])),_:1},8,["visible","title"])],64)}}},g$=e=>(t.pushScopeId("data-v-b521aa83"),e=e(),t.popScopeId(),e),b$=g$((()=>t.createElementVNode("p",{class:"button-text"},"条形码",-1))),y$={class:"barcode-container"},w$={class:"barcode-toolbar"},k$={class:"barcode-toolbar-more"},x$={class:"barcode-code"},C$={key:0,class:"t-input__tips t-tips t-is-error"},O$={class:"barcode-render"},S$=g$((()=>t.createElementVNode("div",{class:"barcode-title"},"预览",-1))),E$={class:"barcode-svg narrow-scrollbar"},N$={key:0,class:"barcode-empty"},_$=yS({__name:"barcode",props:{content:{type:String}},setup(e){let{popupVisible:n,togglePopup:o}=Qz(),i=t.ref(!1);const{container:a,options:l,editor:s}=gS(),c=[{label:"CODE128",value:"CODE128"},{label:"CODE128 A",value:"CODE128A"},{label:"CODE128 B",value:"CODE128B"},{label:"CODE128 C",value:"CODE128C"},{label:"EAN13",value:"EAN13"},{label:"UPC",value:"UPC"},{label:"CODE39",value:"CODE39"},{label:"ITF14",value:"ITF14"},{label:"ITF",value:"ITF"},{label:"MSI",value:"MSI"},{label:"MSI10",value:"MSI10"},{label:"MSI11",value:"MSI11"},{label:"MSI1010",value:"MSI1010"},{label:"MSI1110",value:"MSI1110"},{label:"Pharmacode",value:"Pharmacode"}],u=[{label:"底部",value:"bottom"},{label:"顶部",value:"top"}],d={content:"",width:2,height:100,font:null,format:"CODE128",lineColor:"#000",background:"",fontOptions:"",displayValue:!0,textAlign:"center",textPosition:"bottom",fontSize:20,textMargin:2,margin:10,text:void 0};let p=t.ref({...d}),f=t.ref(!1);const h=e=>{let t=p.value.fontOptions.split(" ");t.includes(e)?t=t.filter((t=>t!==e)):t.push(e),p.value.fontOptions=t.join(" ").trim()};let m=t.ref(!1);const v=t.ref(null);t.watch((()=>i.value),(t=>{t&&(p.value=e.content?JSON.parse(e.content):{...d},setTimeout((()=>f.value=!1),200))}),{immediate:!0}),t.watch((()=>p.value),(()=>{i.value&&(f.value=!0,(async()=>{try{await t.nextTick(),r(`${a} #barcode`,p.value.content,p.value),m.value=!1}catch{m.value=!0}})())}),{immediate:!0,deep:!0});const g=()=>{var t;if(m.value)return void tR("error","条形码生成失败");if(""===p.value.content)return void tR("error","条形码内容不能为空");const n=v.value.width.animVal.value,r=v.value.height.animVal.value;f.value&&(null==(t=s.value)||t.chain().focus().setImage({type:"barcode",src:o$(v.value.outerHTML),content:JSON.stringify(p.value),width:n,height:r},!!e.content).run()),i.value=!1};return(r,s)=>{const d=QC,f=Bz,b=If,y=tF,w=eF,k=pF,x=dF,C=aF,O=iF,S=oF,E=Tk,N=Yw,_=Uy,M=Lk,A=mw,T=Gw,V=gg,j=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(f,{"huge-button":"",onButtonClick:s[0]||(s[0]=e=>t.isRef(i)?i.value=!0:i=!0)},{text:t.withCtx((()=>[b$])),default:t.withCtx((()=>[t.createVNode(d,{name:e.content?"edit":"barcode"},null,8,["name"])])),_:1}),t.createVNode(j,{visible:t.unref(i),icon:"barcode",title:"条形码生成",width:"695px",onConfirm:g,onClose:s[19]||(s[19]=e=>t.isRef(i)?i.value=!1:i=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",y$,[t.createElementVNode("div",w$,[t.createVNode(f,{style:{width:"126px"},tooltip:"条形码标准","select-options":c,"button-type":"select",value:t.unref(p).format,onButtonClick:s[1]||(s[1]=e=>t.unref(p).format=e)},null,8,["value"]),t.createVNode(b,{layout:"vertical"}),t.createVNode(f,{style:{width:"114px"},tooltip:"文字字体","select-options":t.unref(l).dicts.fonts,"button-type":"select",value:t.unref(p).font,onButtonClick:s[2]||(s[2]=e=>t.unref(p).font=e)},null,8,["select-options","value"]),t.createVNode(b,{layout:"vertical"}),t.createVNode(y,{tooltip:"条形码及文字颜色","default-color":t.unref(p).lineColor,modeless:"",onChange:s[3]||(s[3]=e=>t.unref(p).lineColor=e)},null,8,["default-color"]),t.createVNode(w,{tooltip:"条形码背景颜色","default-color":t.unref(p).background,modeless:"",onChange:s[4]||(s[4]=e=>t.unref(p).background=e)},null,8,["default-color"]),t.createVNode(b,{layout:"vertical"}),t.createVNode(k,{"button-active":t.unref(p).fontOptions.includes("bold"),onButtonClickThrough:s[5]||(s[5]=e=>h("bold"))},null,8,["button-active"]),t.createVNode(x,{"button-active":t.unref(p).fontOptions.includes("italic"),onButtonClickThrough:s[6]||(s[6]=e=>h("italic"))},null,8,["button-active"]),t.createVNode(b,{layout:"vertical"}),t.createVNode(C,{"button-active":"left"===t.unref(p).textAlign,onButtonClickThrough:s[7]||(s[7]=e=>t.unref(p).textAlign="left")},null,8,["button-active"]),t.createVNode(O,{"button-active":"center"===t.unref(p).textAlign,onButtonClickThrough:s[8]||(s[8]=e=>t.unref(p).textAlign="center")},null,8,["button-active"]),t.createVNode(S,{"button-active":"right"===t.unref(p).textAlign,onButtonClickThrough:s[9]||(s[9]=e=>t.unref(p).textAlign="right")},null,8,["button-active"]),t.createVNode(b,{layout:"vertical"}),t.createVNode(f,{tooltip:"更多","button-type":"popup","popup-visible":t.unref(n),onTogglePopup:t.unref(o)},{content:t.withCtx((()=>[t.createElementVNode("div",k$,[t.createVNode(T,{size:"small","label-align":"left"},{default:t.withCtx((()=>[t.createVNode(N,{label:"单个条形的宽度:"},{default:t.withCtx((()=>[t.createVNode(E,{modelValue:t.unref(p).width,"onUpdate:modelValue":s[10]||(s[10]=e=>t.unref(p).width=e),min:1,max:4,step:1,"tooltip-props":{showArrow:!1,theme:"light"}},null,8,["modelValue"])])),_:1}),t.createVNode(N,{label:"条形码的高度:"},{default:t.withCtx((()=>[t.createVNode(E,{modelValue:t.unref(p).height,"onUpdate:modelValue":s[11]||(s[11]=e=>t.unref(p).height=e),min:10,max:200,step:1,"tooltip-props":{showArrow:!1,theme:"light"}},null,8,["modelValue"])])),_:1}),t.createVNode(N,{label:"条形码四周留白:"},{default:t.withCtx((()=>[t.createVNode(E,{modelValue:t.unref(p).margin,"onUpdate:modelValue":s[12]||(s[12]=e=>t.unref(p).margin=e),min:0,max:25,step:1,"tooltip-props":{showArrow:!1,theme:"light"}},null,8,["modelValue"])])),_:1}),t.createVNode(b),t.createVNode(N,{label:"是否显示文字:"},{default:t.withCtx((()=>[t.createVNode(_,{modelValue:t.unref(p).displayValue,"onUpdate:modelValue":s[13]||(s[13]=e=>t.unref(p).displayValue=e)},{default:t.withCtx((()=>[t.createTextVNode("显示文字")])),_:1},8,["modelValue"])])),_:1}),t.createVNode(N,{label:"文字内容:",help:"填写后会覆盖条形码内容文本"},{default:t.withCtx((()=>[t.createVNode(M,{modelValue:t.unref(p).text,"onUpdate:modelValue":s[14]||(s[14]=e=>t.unref(p).text=e),autosize:"",maxlength:"100"},null,8,["modelValue"])])),_:1}),t.createVNode(N,{label:"文字所在位置:"},{default:t.withCtx((()=>[t.createVNode(A,{modelValue:t.unref(p).textPosition,"onUpdate:modelValue":s[15]||(s[15]=e=>t.unref(p).textPosition=e),options:u,"popup-props":{destroyOnClose:!0,attach:t.unref(a)}},null,8,["modelValue","popup-props"])])),_:1}),t.createVNode(N,{label:"文字上下距离:"},{default:t.withCtx((()=>[t.createVNode(E,{modelValue:t.unref(p).textMargin,"onUpdate:modelValue":s[16]||(s[16]=e=>t.unref(p).textMargin=e),min:-15,max:40,step:1,"tooltip-props":{showArrow:!1,theme:"light"}},null,8,["modelValue"])])),_:1}),t.createVNode(N,{label:"文字字体大小:"},{default:t.withCtx((()=>[t.createVNode(E,{modelValue:t.unref(p).fontSize,"onUpdate:modelValue":s[17]||(s[17]=e=>t.unref(p).fontSize=e),min:8,max:36,step:1,"tooltip-props":{showArrow:!1,theme:"light"}},null,8,["modelValue"])])),_:1})])),_:1})])])),default:t.withCtx((()=>[t.createVNode(d,{name:"setting"})])),_:1},8,["popup-visible","onTogglePopup"])]),t.createElementVNode("div",x$,[t.createVNode(V,{modelValue:t.unref(p).content,"onUpdate:modelValue":s[18]||(s[18]=e=>t.unref(p).content=e),maxlength:"44","show-limit-number":"",autofocus:"",clearable:"",placeholder:"请输入要转化成条形码的内容",status:t.unref(m)&&""!==t.unref(p).content?"error":""},{prefixIcon:t.withCtx((()=>[t.createVNode(d,{name:"barcode"})])),_:1},8,["modelValue","status"]),t.unref(m)&&t.unref(p).content?(t.openBlock(),t.createElementBlock("div",C$," 您输入的内容可能不符合当前选择的条形码规范约束,请检查。 ")):t.createCommentVNode("",!0)]),t.createElementVNode("div",O$,[S$,t.createElementVNode("div",E$,[t.unref(m)?(t.openBlock(),t.createElementBlock("div",N$,"当前无预览内容")):t.createCommentVNode("",!0),t.withDirectives((t.openBlock(),t.createElementBlock("svg",{ref_key:"barcodeSvgRef",ref:v,id:"barcode"},null,512)),[[t.vShow,!t.unref(m)]])])])])])),_:1},8,["visible"])],64)}}},[["__scopeId","data-v-b521aa83"]]),M$=e=>(t.pushScopeId("data-v-bb4250ab"),e=e(),t.popScopeId(),e),A$=M$((()=>t.createElementVNode("p",{class:"button-text"},"二维码",-1))),T$={class:"qrcode-container"},V$={class:"qrcode-toolbar"},j$=M$((()=>t.createElementVNode("span",null,"四周留白:",-1))),B$=M$((()=>t.createElementVNode("span",null,"宽高度:",-1))),P$={class:"qrcode-code"},I$={key:0,class:"t-input__tips t-tips t-is-error"},D$={class:"qrcode-render"},L$=M$((()=>t.createElementVNode("div",{class:"qrcode-title"},"预览",-1))),R$={class:"qrcode-svg narrow-scrollbar"},z$={key:0,class:"qrcode-empty"},F$=["innerHTML"],$$=yS({__name:"qrcode",props:{content:{type:String}},setup(e){let n=t.ref(!1);const{editor:r}=gS(),i=async()=>{p(),n.value=!0},a=[{label:"低",value:"L"},{label:"中",value:"M"},{label:"高",value:"Q"},{label:"最高",value:"H"}],l={ecl:"M",padding:1,width:256,height:256,color:"#000000",background:"#ffffff",content:"",xmlDeclaration:!1,join:!0,pretty:!1,container:"svg-viewbox"};let s=t.ref({...l}),c=t.ref(!1),u=t.ref(null),d=t.ref(!1);const p=()=>{try{u.value=null,s.value.height=s.value.width;const e=new o(s.value);u.value=e.svg(),d.value=!1}catch{u.value=null,d.value=!0}};t.watch((()=>n.value),(t=>{t&&(s.value=e.content?JSON.parse(e.content):{...l},setTimeout((()=>c.value=!1),200))}),{immediate:!0}),t.watch((()=>s.value),(()=>{n.value&&(c.value=!0,p())}),{immediate:!0,deep:!0});const f=()=>{var t;if(d.value||!u.value)return void tR("error","条形码生成失败");if(""===s.value.content)return void tR("error","条形码内容不能为空");const{width:o,height:i}=s.value,a=o$(u.value);c.value&&(null==(t=r.value)||t.chain().focus().setImage({type:"qrcode",src:a,content:JSON.stringify(s.value),width:o,height:i},!!e.content).run()),n.value=!1};return(r,o)=>{const l=QC,c=Bz,p=$g,h=If,m=tF,v=eF,g=Lk,b=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(c,{"huge-button":"",onButtonClick:i},{text:t.withCtx((()=>[A$])),default:t.withCtx((()=>[t.createVNode(l,{name:e.content?"edit":"qrcode"},null,8,["name"])])),_:1}),t.createVNode(b,{visible:t.unref(n),icon:"qrcode",title:e.content?"编辑二维码":"插入二维码",width:"695px",onConfirm:f,onClose:o[6]||(o[6]=e=>t.isRef(n)?n.value=!1:n=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",T$,[t.createElementVNode("div",V$,[t.createVNode(c,{style:{width:"126px"},tooltip:"二维码容错能力","select-options":a,"button-type":"select",value:t.unref(s).ecl,onButtonClick:o[0]||(o[0]=e=>t.unref(s).ecl=e)},null,8,["value"]),t.createVNode(c,{"button-type":"input",tooltip:"二维码四周留白大小"},{default:t.withCtx((()=>[t.createVNode(p,{modelValue:t.unref(s).padding,"onUpdate:modelValue":o[1]||(o[1]=e=>t.unref(s).padding=e),size:"small",theme:"normal",max:10,min:0,"allow-input-over-limit":!1,placeholder:""},{label:t.withCtx((()=>[j$])),_:1},8,["modelValue"])])),_:1}),t.createVNode(c,{"button-type":"input",tooltip:"二维码的宽度和高度"},{default:t.withCtx((()=>[t.createVNode(p,{modelValue:t.unref(s).width,"onUpdate:modelValue":o[2]||(o[2]=e=>t.unref(s).width=e),size:"small",theme:"normal",max:1024,min:64,"allow-input-over-limit":!1,placeholder:""},{label:t.withCtx((()=>[B$])),_:1},8,["modelValue"])])),_:1}),t.createVNode(h,{layout:"vertical"}),t.createVNode(m,{tooltip:"二维码颜色","default-color":t.unref(s).color,modeless:"",onChange:o[3]||(o[3]=e=>t.unref(s).color=e)},null,8,["default-color"]),t.createVNode(v,{tooltip:"二维码背景颜色","default-color":t.unref(s).background,modeless:"",onChange:o[4]||(o[4]=e=>t.unref(s).background=e)},null,8,["default-color"])]),t.createElementVNode("div",P$,[t.createVNode(g,{modelValue:t.unref(s).content,"onUpdate:modelValue":o[5]||(o[5]=e=>t.unref(s).content=e),maxlength:"200","show-limit-number":"",autofocus:"",autosize:"",placeholder:"请输入要转化成二维码的内容"},null,8,["modelValue"]),t.unref(d)&&""!==t.unref(s).content?(t.openBlock(),t.createElementBlock("div",I$," 二维码生成错误。 ")):t.createCommentVNode("",!0)]),t.createElementVNode("div",D$,[L$,t.createElementVNode("div",R$,[t.unref(u)?(t.openBlock(),t.createElementBlock("div",{key:1,class:"svg",innerHTML:t.unref(u)},null,8,F$)):(t.openBlock(),t.createElementBlock("div",z$,"当前无预览内容"))])])])])),_:1},8,["visible","title"])],64)}}},[["__scopeId","data-v-bb4250ab"]]),H$={__name:"edit",setup(e){const{editor:n}=gS(),r=t.computed((()=>{var e,t;return null==(t=null==(e=n.value)?void 0:e.getAttributes("image"))?void 0:t.type})),o=t.computed((()=>{var e,t;return null==(t=null==(e=n.value)?void 0:e.getAttributes("image"))?void 0:t.content}));return(e,n)=>{const i=$$,a=_$,l=v$,s=d$;return t.openBlock(),t.createElementBlock(t.Fragment,null,["qrcode"===t.unref(r)?(t.openBlock(),t.createBlock(i,{key:0,content:t.unref(o),"huge-button":!1},null,8,["content"])):t.createCommentVNode("",!0),"barcode"===t.unref(r)?(t.openBlock(),t.createBlock(a,{key:1,content:t.unref(o),"huge-button":!1},null,8,["content"])):t.createCommentVNode("",!0),"diagrams"===t.unref(r)?(t.openBlock(),t.createBlock(l,{key:2,content:t.unref(o),"huge-button":!1},null,8,["content"])):t.createCommentVNode("",!0),"mermaid"===t.unref(r)?(t.openBlock(),t.createBlock(s,{key:3,content:t.unref(o),"huge-button":!1},null,8,["content"])):t.createCommentVNode("",!0)],64)}}},U$={__name:"download",setup(e){const{editor:n}=gS(),r=()=>{var e;const t=document.createElement("a");t.href=null==(e=n.value)?void 0:e.getAttributes("image").src,t.target="_blank",t.click()};return(e,n)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"下载图片",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(o,{name:"image-download"})])),_:1})}}},W$={__name:"preview",setup(e){const{editor:n}=gS(),r=t.ref(!1);return(e,o)=>{var i;const a=QC,l=Bz,s=FC;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(l,{tooltip:"图片预览",onButtonClick:o[0]||(o[0]=e=>r.value=!r.value)},{default:t.withCtx((()=>[t.createVNode(a,{name:"image-preview"})])),_:1}),t.createVNode(s,{visible:r.value,"onUpdate:visible":o[1]||(o[1]=e=>r.value=e),images:[null==(i=t.unref(n))?void 0:i.getAttributes("image").src]},null,8,["visible","images"])],64)}}},q$=yS({__name:"remove-background",setup(e){const{options:n,editor:r}=gS();let o=t.ref(!1);const a=async()=>{var e;const t=r.value.commands.getSelectionNode(),{src:a}=null==(e=r.value)?void 0:e.getAttributes("image"),l=await i(a,{publicPath:`${n.value.cdnUrl}/libs/imgly/`,progress(){o.value=!0}}),s=new File([l],`${bO(10)}.png`,{type:"image/png"});t.props.updateAttributes({src:URL.createObjectURL(l),uploaded:!1,file:s}),o.value=!1};return(e,n)=>{const r=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:t.unref(o)?"正在去除图片背景...":"去除图片背景",disabled:t.unref(o),onButtonClick:a},{default:t.withCtx((()=>[t.unref(o)?(t.openBlock(),t.createBlock(r,{key:1,class:"loading",name:"loading"})):(t.openBlock(),t.createBlock(r,{key:0,name:"image-remove-background"}))])),_:1},8,["tooltip","disabled"])}}},[["__scopeId","data-v-2f281e76"]]),K$={__name:"reset",setup(e){const{editor:n}=gS(),r=()=>{n.value.commands.getSelectionNode().props.updateAttributes({top:0,left:0,angle:0,flipX:!1,flipy:!1})};return(e,n)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"重置图片位置",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(o,{name:"image-reset"})])),_:1})}}},G$={__name:"draggable",setup(e){const{editor:n}=gS(),r=()=>{var e;const t=n.value.commands.getSelectionNode(),{draggable:r}=null==(e=n.value)?void 0:e.getAttributes("image");t.props.updateAttributes({draggable:!r})};return(e,o)=>{var i,a;const l=QC,s=Bz;return t.openBlock(),t.createBlock(s,{"button-active":null==(a=null==(i=t.unref(n))?void 0:i.getAttributes("image"))?void 0:a.draggable,tooltip:"图片浮动",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(l,{name:"image-draggable"})])),_:1},8,["button-active"])}}},Y$={__name:"proportion",setup(e){const{editor:n}=gS(),r=()=>{var e;const t=n.value.commands.getSelectionNode(),{equalProportion:r}=null==(e=n.value)?void 0:e.getAttributes("image");t.props.updateAttributes({equalProportion:!r})};return(e,o)=>{var i,a;const l=QC,s=Bz;return t.openBlock(),t.createBlock(s,{"button-active":null==(a=null==(i=t.unref(n))?void 0:i.getAttributes("image"))?void 0:a.equalProportion,tooltip:"锁定长宽比",onButtonClick:r},{default:t.withCtx((()=>[t.createVNode(l,{name:"equal-proportion"})])),_:1},8,["button-active"])}}},X$={__name:"flip",setup(e){const{editor:n}=gS(),r=e=>{var t;const r=n.value.commands.getSelectionNode(),{flipX:o,flipY:i}=null==(t=n.value)?void 0:t.getAttributes("image");"flipX"===e&&r.props.updateAttributes({flipX:!o}),"flipY"===e&&r.props.updateAttributes({flipY:!i})};return(e,o)=>{var i,a,l,s;const c=QC,u=Bz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(u,{"button-active":null==(a=null==(i=t.unref(n))?void 0:i.getAttributes("image"))?void 0:a.flipY,tooltip:"水平翻转",onButtonClick:o[0]||(o[0]=e=>r("flipY"))},{default:t.withCtx((()=>[t.createVNode(c,{name:"image-flip"})])),_:1},8,["button-active"]),t.createVNode(u,{"button-active":null==(s=null==(l=t.unref(n))?void 0:l.getAttributes("image"))?void 0:s.flipX,tooltip:"垂直翻转",onButtonClick:o[1]||(o[1]=e=>r("flipX"))},{default:t.withCtx((()=>[t.createVNode(c,{name:"image-flip",style:{transform:"rotate(90deg)"}})])),_:1},8,["button-active"])],64)}}},Z$=e=>(t.pushScopeId("data-v-436e67b0"),e=e(),t.popScopeId(),e),J$=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),Q$=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),eH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),tH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),nH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),rH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),oH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),iH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),aH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),lH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),sH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),cH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),uH=Z$((()=>t.createElementVNode("div",{class:"divider"},null,-1))),dH=yS({__name:"index",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i,a,l,s,c,u,d,p,f,h,m,v,g,b,y,w,k,x;const C=aF,O=iF,S=oF,E=X$,N=Y$,_=G$,M=K$,A=q$,T=W$,V=U$,j=H$,B=e$,P=QF,I=JF,D=XF,L=GF,R=qF,z=UF,F=$F,$=zF,H=LF,U=IF,W=BF,q=VF,K=gF,G=vF,Y=mF,X=hF,Z=fF,J=pF,Q=dF,ee=uF,te=cF,ne=sF,re=tF,oe=eF,ie=Iz;return(null==(o=t.unref(n))?void 0:o.isActive("image"))?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(null==(i=t.unref(n))?void 0:i.getAttributes("image").error)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createVNode(C),t.createVNode(O),t.createVNode(S),J$,t.createVNode(E),t.createVNode(N),t.createVNode(_),t.createVNode(M),Q$,"image"===(null==(l=null==(a=t.unref(n))?void 0:a.getAttributes("image"))?void 0:l.type)||["image/png","image/jpeg"].includes(null==(c=null==(s=t.unref(n))?void 0:s.getAttributes("image"))?void 0:c.type)?(t.openBlock(),t.createBlock(A,{key:0})):t.createCommentVNode("",!0),"image"===(null==(d=null==(u=t.unref(n))?void 0:u.getAttributes("image"))?void 0:d.type)?(t.openBlock(),t.createBlock(T,{key:1})):t.createCommentVNode("",!0),t.createVNode(V),eH,t.createVNode(j)],64)),t.createVNode(B)],64)):(null==(p=t.unref(n))?void 0:p.isActive("video"))||(null==(f=t.unref(n))?void 0:f.isActive("audio"))||(null==(h=t.unref(n))?void 0:h.isActive("file"))||(null==(m=t.unref(n))?void 0:m.isActive("iframe"))?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(C),t.createVNode(O),t.createVNode(S),tH,(null==(v=t.unref(n))?void 0:v.isActive("file"))||(null==(g=t.unref(n))?void 0:g.isActive("video"))||(null==(b=t.unref(n))?void 0:b.isActive("audio"))?(t.openBlock(),t.createBlock(P,{key:0})):t.createCommentVNode("",!0),t.createVNode(B)],64)):(null==(y=t.unref(n))?void 0:y.isActive("table"))?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(I,{"huge-button":!1}),t.createVNode(D,{"huge-button":!1}),nH,t.createVNode(L),t.createVNode(R),t.createVNode(z),t.createVNode(F),rH,t.createVNode($),t.createVNode(H),oH,t.createVNode(U),t.createVNode(W),iH,t.createVNode(B)],64)):(null==(w=t.unref(n))?void 0:w.isActive("codeBlock"))?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createVNode(q),t.createVNode(K),aH,t.createVNode(G),t.createVNode(Y),lH,t.createVNode(X),t.createVNode(B)],64)):(null==(k=t.unref(n))?void 0:k.isActive("toc"))||(null==(x=t.unref(n))?void 0:x.isActive("pageBreak"))?(t.openBlock(),t.createBlock(B,{key:4})):(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.createVNode(Z,{select:!1}),sH,t.createVNode(J),t.createVNode(Q),t.createVNode(ee),t.createVNode(te),cH,t.createVNode(ne),uH,t.createVNode(re),t.createVNode(oe),t.createVNode(ie)],64))}}},[["__scopeId","data-v-436e67b0"]]);function pH(e){this.content=e}function fH(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=fH(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function hH(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let a=e.child(--o),l=t.child(--i),s=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let e=hH(a.content,l.content,n-1,r-1);if(e)return e}n-=s,r-=s}else n-=s,r-=s}}pH.prototype={constructor:pH,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new pH(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new pH(n)},addToStart:function(e,t){return new pH([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new pH(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new pH(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=pH.from(e)).size?new pH(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=pH.from(e)).size?new pH(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=pH.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},pH.from=function(e){if(e instanceof pH)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new pH(t)};class mH{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,a=0;a<t;i++){let l=this.content[i],s=a+l.nodeSize;if(s>e&&!1!==n(l,r+a,o||null,i)&&l.content.size){let o=a+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}a=s}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((a,l)=>{let s=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?r?"function"==typeof r?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&s||a.isTextblock)&&n&&(i?i=!1:o+=n),o+=s}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new mH(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>t)&&(a=a.isText?a.cut(Math.max(0,e-i),Math.min(a.text.length,t-i)):a.cut(Math.max(0,e-i-1),Math.min(a.content.size,t-i-1))),n.push(a),r+=a.nodeSize),i=l}return new mH(n,r)}cutByIndex(e,t){return e==t?mH.empty:0==e&&t==this.content.length?this:new mH(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new mH(r,o)}addToStart(e){return new mH([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new mH(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return fH(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return hH(this,e,t,n)}findIndex(e,t=-1){if(0==e)return gH(0,e);if(e==this.size)return gH(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?gH(n+1,o):gH(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return mH.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new mH(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return mH.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new mH(t||e,n)}static from(e){if(!e)return mH.empty;if(e instanceof mH)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new mH([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}mH.empty=new mH([],0);const vH={index:0,offset:0};function gH(e,t){return vH.index=e,vH.offset=t,vH}function bH(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!bH(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!bH(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}let yH=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&bH(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort(((e,t)=>e.type.rank-t.type.rank)),n}};yH.none=[];class wH extends Error{}class kH{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=CH(this.content,e+this.openStart,t);return n&&new kH(n,this.openStart,this.openEnd)}removeBetween(e,t){return new kH(xH(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return kH.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new kH(mH.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)r++;return new kH(e,n,r)}}function xH(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:a,offset:l}=e.findIndex(n);if(o==t||i.isText){if(l!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(xH(i.content,t-o-1,n-o-1)))}function CH(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),a=e.maybeChild(o);if(i==t||a.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=CH(a.content,t-i-1,n);return l&&e.replaceChild(o,a.copy(l))}function OH(e,t,n){if(n.openStart>e.depth)throw new wH("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new wH("Inconsistent open depths");return SH(e,t,n,0)}function SH(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let a=SH(e,t,n,r+1);return i.copy(i.content.replaceChild(o,a))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:a}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)r=t.node(o).copy(mH.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return AH(i,TH(e,o,a,t,r))}{let r=e.parent,o=r.content;return AH(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return AH(i,VH(e,t,r))}function EH(e,t){if(!t.type.compatibleContent(e.type))throw new wH("Cannot join "+t.type.name+" onto "+e.type.name)}function NH(e,t,n){let r=e.node(n);return EH(r,t.node(n)),r}function _H(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function MH(e,t,n,r){let o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(_H(e.nodeAfter,r),i++));for(let l=i;l<a;l++)_H(o.child(l),r);t&&t.depth==n&&t.textOffset&&_H(t.nodeBefore,r)}function AH(e,t){return e.type.checkContent(t),e.copy(t)}function TH(e,t,n,r,o){let i=e.depth>o&&NH(e,t,o+1),a=r.depth>o&&NH(n,r,o+1),l=[];return MH(null,e,o,l),i&&a&&t.index(o)==n.index(o)?(EH(i,a),_H(AH(i,TH(e,t,n,r,o+1)),l)):(i&&_H(AH(i,VH(e,t,o+1)),l),MH(t,n,o,l),a&&_H(AH(a,VH(n,r,o+1)),l)),MH(r,null,o,l),new mH(l)}function VH(e,t,n){let r=[];if(MH(null,e,n,r),e.depth>n){_H(AH(NH(e,t,n+1),VH(e,t,n+1)),r)}return MH(t,null,n,r),new mH(r)}kH.empty=new kH(mH.empty,0,0);class jH{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let o=0;o<e;o++)r+=n.child(o).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return yH.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new DH(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let i=e;;){let{index:e,offset:t}=i.content.findIndex(o),a=o-t;if(n.push(i,e,r+t),!a)break;if(i=i.child(e),i.isText)break;o=a-1,r+=t+1}return new jH(t,n,o)}static resolveCached(e,t){for(let r=0;r<BH.length;r++){let n=BH[r];if(n.pos==t&&n.doc==e)return n}let n=BH[PH]=jH.resolve(e,t);return PH=(PH+1)%IH,n}}let BH=[],PH=0,IH=12;class DH{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const LH=Object.create(null);let RH=class e{constructor(e,t,n,r=yH.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||mH.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&bH(this.attrs,t||e.defaultAttrs||LH)&&yH.sameSet(this.marks,n||yH.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return kH.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),l=r.node(i).content.cut(r.pos-a,o.pos-a);return new kH(l,r.depth-i,o.depth-i)}replace(e,t,n){return OH(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return jH.resolveCached(this,e)}resolveNoCache(e){return jH.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),FH(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=mH.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=r;l<o;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=yH.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!yH.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=mH.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};RH.prototype.text=void 0;class zH extends RH{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):FH(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new zH(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new zH(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function FH(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class $H{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new HH(e,t);if(null==n.next)return $H.empty;let r=UH(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(XH(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);XH(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new $H(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(YH);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}}(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let a=n();return r(t,a),o(i(e.expr,a),a),[r(a)]}if("plus"==e.type){let a=n();return o(i(e.expr,t),a),o(i(e.expr,a),a),[r(a)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let a=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,a),t),a=t}if(-1==e.max)o(i(e.expr,a),a);else for(let t=e.min;t<e.max;t++){let t=n();r(a,t),o(i(e.expr,a),t),a=t}return[r(a)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let a=i(e.exprs[r],t);if(r==e.exprs.length-1)return a;o(a,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:a}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(a)&&r.push(a)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,a){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return mH.from(a.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,a.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:a}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!a.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)r+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return r})).join("\n")}}$H.empty=new $H(!0);class HH{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function UH(e){let t=[];do{t.push(WH(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function WH(e){let t=[];do{t.push(qH(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function qH(e){let t=function(e){if(e.eat("(")){let t=UH(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let e=n[i];e.groups.indexOf(t)>-1&&o.push(e)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=GH(e,t)}return t}function KH(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function GH(e,t){let n=KH(e),r=n;return e.eat(",")&&(r="}"!=e.next?KH(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function YH(e,t){return t-e}function XH(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(YH)}function ZH(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function JH(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function QH(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new tU(e[n]);return t}let eU=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=QH(n.attrs),this.defaultAttrs=ZH(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==$H.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:JH(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new RH(this,this.computeAttrs(e),mH.from(t),yH.setFrom(n))}createChecked(e=null,t,n){return t=mH.from(t),this.checkContent(t),new RH(this,this.computeAttrs(e),t,yH.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=mH.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(mH.empty,!0);return o?new RH(this,e,t.append(o),yH.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:yH.none:e}static compile(t,n){let r=Object.create(null);t.forEach(((t,o)=>r[t]=new e(t,n,o)));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class tU{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class nU{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=QH(r.attrs),this.excluded=null;let o=ZH(this.attrs);this.instance=o?new yH(this,o):null}create(e=null){return!e&&this.instance?this.instance:new yH(this,JH(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new nU(e,r++,t,o))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class rU{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=pH.from(e.nodes),t.marks=pH.from(e.marks||{}),this.nodes=eU.compile(this.spec.nodes,this),this.marks=nU.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",o=e.spec.marks;e.contentMatch=n[t]||(n[t]=$H.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==o?null:o?oU(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:oU(this,t.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof eU))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new zH(n,n.defaultAttrs,e,yH.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return RH.fromJSON(this,e)}markFromJSON(e){return yH.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function oU(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=r)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class iU{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{!function(e){return null!=e.tag}(e)?function(e){return null!=e.style}(e)&&this.styles.push(e):this.tags.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new dU(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new dU(this,t,!0);return n.addAll(e,t.from,t.to),kH.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(pU(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach((e=>{n(e=fU(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=fU(e)),e.node||e.ignore||e.mark||(e.node=r)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new iU(e,iU.schemaRules(e)))}}const aU={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},lU={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},sU={ol:!0,ul:!0};function cU(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class uU{constructor(e,t,n,r,o,i,a){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=yH.none,this.stashMarks=[],this.match=i||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(mH.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=mH.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(mH.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):hU(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!aU.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class dU{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=cU(null,t.preserveWhitespace,0)|(n?4:0);r=o?new uU(o.type,o.attrs,yH.none,yH.none,!0,t.topMatch||o.type.contentMatch,i):new uU(n?null:e.schema.topNodeType,null,yH.none,yH.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){3==e.nodeType?this.addTextNode(e):1==e.nodeType&&this.addElement(e)}withStyleRules(e,t){let n=e.getAttribute("style");if(!n)return t();let r=this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(n));if(!r)return;let[o,i]=r,a=this.top;for(let l=0;l<i.length;l++)this.removePendingMark(i[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l]);t();for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<i.length;l++)this.addPendingMark(i[l])}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();sU.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&sU.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:lU.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let t,n=this.top,i=this.needsBlock;if(aU.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);o&&o.skip?this.addAll(e):this.withStyleRules(e,(()=>this.addAll(e))),t&&this.sync(n),this.needsBlock=i}else this.withStyleRules(e,(()=>{this.addElementByRule(e,o,!1===o.consuming?n:void 0)}))}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=yH.none,n=yH.none;for(let r=0;r<e.length;r+=2)for(let o;;){let i=this.parser.matchStyle(e[r],e[r+1],this,o);if(!i)break;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{i.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;o=i}return[t,n]}addElementByRule(e,t,n){let r,o,i;if(t.node)o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace);else{i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i)}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(a)&&this.open--,i&&this.removePendingMark(i,a)}addAll(e,t,n){let r=t||0;for(let o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(let r=0;r<t.length;r++)this.enterInner(t[r],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let i=cU(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new uU(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,a)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;a>=o;a--)if(i(e-1,a))return!0;return!1}{let e=a>0||0==a&&r?this.nodes[a].type:n&&a>=o?n.node(a-o).type:null;if(!e||e.name!=l&&-1==e.groups.indexOf(l))return!1;a--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function pU(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function fU(e){let t={};for(let n in e)t[n]=e[n];return t}function hU(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],a=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&a(o))return!0}};if(a(o.contentMatch))return!0}}class mU{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=gU(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],a=this.serializeMark(n,e.isInline,t);a&&(o.push([n,r]),r.appendChild(a.dom),r=a.contentDOM||a.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=mU.renderSpec(gU(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&mU.renderSpec(gU(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,o=t[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let a=n?e.createElementNS(n,o):e.createElement(o),l=t[1],s=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l)){s=2;for(let e in l)if(null!=l[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):a.setAttribute(e,l[e])}}for(let c=s;c<t.length;c++){let o=t[c];if(0===o){if(c<t.length-1||c>s)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:t,contentDOM:i}=mU.renderSpec(e,o,n);if(a.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:a,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new mU(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=vU(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return vU(e.marks)}}function vU(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function gU(e){return e.document||window.document}const bU=Math.pow(2,16);function yU(e){return 65535&e}class wU{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class kU{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&kU.empty)return kU.empty}recover(e){let t=0,n=yU(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/bU}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let s=this.ranges[a+o],c=this.ranges[a+i],u=l+s;if(e<=u){let o=l+r+((s?e==l?-1:e==u?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?l:u)?null:a/3+(e-l)*bU,d=e==l?2:e==u?1:4;return(t<0?e!=l:e!=u)&&(d|=8),new wU(o,d,i)}r+=c-s}return n?e+r:new wU(e+r,0,null)}touches(e,t){let n=0,r=yU(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let t=this.ranges[a]-(this.inverted?n:0);if(t>e)break;let l=this.ranges[a+o];if(e<=t+l&&a==3*r)return!0;n+=this.ranges[a+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],a=i-(this.inverted?o:0),l=i+(this.inverted?0:o),s=this.ranges[r+t],c=this.ranges[r+n];e(a,a+s,l,l+c),o+=c-s}}invert(){return new kU(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?kU.empty:new kU(e<0?[0,-e,0]:[0,0,e])}}kU.empty=new kU([]);class xU{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new xU(this.maps,this.mirror,e,t)}copy(){return new xU(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new xU;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let o=this.from;o<this.to;o++){let n=this.maps[o].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(o);if(null!=t&&t>o&&t<this.to){o=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new wU(e,r,null)}}const CU=Object.create(null);class OU{getMap(){return kU.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=CU[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in CU)throw new RangeError("Duplicate use of step JSON ID "+e);return CU[e]=t,t.prototype.jsonID=e,t}}class SU{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new SU(e,null)}static fail(e){return new SU(null,e)}static fromReplace(e,t,n,r){try{return SU.ok(e.replace(t,n,r))}catch(o){if(o instanceof wH)return SU.fail(o.message);throw o}}}function EU(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(EU(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return mH.fromArray(r)}class NU extends OU{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new kH(EU(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return SU.fromReplace(e,this.from,this.to,o)}invert(){return new _U(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new NU(t.pos,n.pos,this.mark)}merge(e){return e instanceof NU&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new NU(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new NU(t.from,t.to,e.markFromJSON(t.mark))}}OU.jsonID("addMark",NU);class _U extends OU{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new kH(EU(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return SU.fromReplace(e,this.from,this.to,n)}invert(){return new NU(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new _U(t.pos,n.pos,this.mark)}merge(e){return e instanceof _U&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new _U(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new _U(t.from,t.to,e.markFromJSON(t.mark))}}OU.jsonID("removeMark",_U);class MU extends OU{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return SU.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return SU.fromReplace(e,this.pos,this.pos+1,new kH(mH.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new MU(this.pos,t.marks[n]);return new MU(this.pos,this.mark)}}return new AU(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new MU(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new MU(t.pos,e.markFromJSON(t.mark))}}OU.jsonID("addNodeMark",MU);class AU extends OU{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return SU.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return SU.fromReplace(e,this.pos,this.pos+1,new kH(mH.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new MU(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new AU(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new AU(t.pos,e.markFromJSON(t.mark))}}OU.jsonID("removeNodeMark",AU);class TU extends OU{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&jU(e,this.from,this.to)?SU.fail("Structure replace would overwrite content"):SU.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new kU([this.from,this.to-this.from,this.slice.size])}invert(e){return new TU(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new TU(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof TU)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?kH.empty:new kH(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new TU(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?kH.empty:new kH(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new TU(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new TU(t.from,t.to,kH.fromJSON(e,t.slice),!!t.structure)}}OU.jsonID("replace",TU);class VU extends OU{constructor(e,t,n,r,o,i,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=a}apply(e){if(this.structure&&(jU(e,this.from,this.gapFrom)||jU(e,this.gapTo,this.to)))return SU.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return SU.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?SU.fromReplace(e,this.from,this.to,n):SU.fail("Content does not fit in gap")}getMap(){return new kU([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new VU(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new VU(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new VU(t.from,t.to,t.gapFrom,t.gapTo,kH.fromJSON(e,t.slice),t.insert,!!t.structure)}}function jU(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function BU(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function PU(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!BU(r,o,i))break}return null}function IU(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;let l=(a.length?a[a.length-1]:t).contentMatch;for(let s=r;l&&s<o;s++)l=l.matchType(n.child(s).type);return l&&l.validEnd?a:null}(r,t);return i?o.map(DU).concat({type:t,attrs:n}).concat(i.map(DU)):null}function DU(e){return{type:e,attrs:null}}function LU(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let e=o.node(c),t=o.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),i=r&&r[u+1];i&&(n=n.replaceChild(0,i.type.create(i.attrs)));let a=r&&r[u]||e;if(!e.canReplace(t+1,e.childCount)||!a.type.validContent(n))return!1}let l=o.indexAfter(i),s=r&&r[0];return o.node(i).canReplaceWith(l,l,s?s.type:o.node(i+1).type)}function RU(e,t){let n=e.resolve(t),r=n.index();return zU(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zU(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function FU(e,t,n=-1){let r=e.resolve(t);for(let o=r.depth;;o--){let e,i,a=r.index(o);if(o==r.depth?(e=r.nodeBefore,i=r.nodeAfter):n>0?(e=r.node(o+1),a++,i=r.node(o).maybeChild(a)):(e=r.node(o).maybeChild(a-1),i=r.node(o+1)),e&&!e.isTextblock&&zU(e,i)&&r.node(o).canReplace(a,a+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function $U(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(0==n.openStart&&n.size?2:1);i++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),a=r.node(e),l=!1;if(1==i)l=a.canReplace(n,n,o);else{let e=a.contentMatchAt(n).findWrapping(o.firstChild.type);l=e&&a.canReplaceWith(n,n,e[0])}if(l)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}function HU(e,t,n=t,r=kH.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return UU(o,i,r)?new TU(t,n,r):new WU(o,i,r).fit()}function UU(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}OU.jsonID("replaceAround",VU);class WU{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=mH.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=mH.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,a=r.depth;for(;i&&a&&1==o.childCount;)o=o.firstChild.content,i--,a--;let l=new kH(o,i,a);return e>-1?new VU(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new TU(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=GU(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let i=this.depth;i>=0;i--){let e,{type:a,match:l}=this.frontier[i],s=null;if(1==t&&(o?l.matchType(o.type)||(s=l.fillBefore(mH.from(o),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:i,parent:r,inject:s};if(2==t&&o&&(e=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:i,parent:r,wrap:e};if(r&&l.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=GU(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new kH(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=GU(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new kH(qU(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new kH(qU(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let h=0;h<o.length;h++)this.openFrontierNode(o[h]);let i=this.unplaced,a=n?n.content:i.content,l=i.openStart-e,s=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=a.size+e-(i.content.size-i.openEnd);for(;s<a.childCount;){let e=a.child(s),t=u.matchType(e.type);if(!t)break;s++,(s>1||0==l||e.content.size)&&(u=t,c.push(YU(e.mark(d.allowedMarks(e.marks)),1==s?l:0,s==a.childCount?p:-1)))}let f=s==a.childCount;f||(p=-1),this.placed=KU(this.placed,t,mH.from(c)),this.frontier[t].match=u,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let h=0,m=a;h<p;h++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=f?0==e?kH.empty:new kH(qU(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new kH(qU(i.content,e,s),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!XU(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=XU(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=XU(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=KU(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=KU(this.placed,this.depth,mH.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(mH.empty,!0);e.childCount&&(this.placed=KU(this.placed,this.frontier.length,e))}}function qU(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(qU(e.firstChild.content,t-1,n)))}function KU(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(KU(e.lastChild.content,t-1,n)))}function GU(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function YU(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,YU(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(mH.empty,!0)))),e.copy(r)}function XU(e,t,n,r,o){let i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,a);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,a)?l:null}function ZU(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(ZU(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(mH.empty,!0))}return e}function JU(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class QU extends OU{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return SU.fail("No node at attribute step's position");let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return SU.fromReplace(e,this.pos,this.pos+1,new kH(mH.from(r),0,t.isLeaf?0:1))}getMap(){return kU.empty}invert(e){return new QU(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new QU(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new QU(t.pos,t.attr,t.value)}}OU.jsonID("attr",QU);class eW extends OU{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return SU.ok(n)}getMap(){return kU.empty}invert(e){return new eW(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new eW(t.attr,t.value)}}OU.jsonID("docAttr",eW);let tW=class extends Error{};tW=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(tW.prototype=Object.create(Error.prototype)).constructor=tW,tW.prototype.name="TransformError";class nW{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new xU}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new tW(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=kH.empty){let r=HU(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new kH(mH.from(n),0,0))}delete(e,t){return this.replace(e,t,kH.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(UU(o,i,r))return e.step(new TU(t,n,r));let a=JU(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let e=o.node(f).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;a.indexOf(f)>-1?l=f:o.before(f)==h&&a.splice(1,0,-f)}let s=a.indexOf(l),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let e=f.firstChild;if(c.push(e),h==r.openStart)break;f=e.content}for(let f=u-1;f>=0;f--){let e=c[f],t=(d=e.type).spec.defining||d.spec.definingForContent;if(t&&!e.sameMarkup(o.node(Math.abs(l)-1)))u=f;else if(t||!e.type.isTextblock)break}var d;for(let f=r.openStart;f>=0;f--){let t=(f+u+1)%(r.openStart+1),l=c[t];if(l)for(let c=0;c<a.length;c++){let u=a[(c+s)%a.length],d=!0;u<0&&(d=!1,u=-u);let p=o.node(u-1),f=o.index(u-1);if(p.canReplaceWith(f,f,l.type,l.marks))return e.replace(o.before(u),d?i.after(u):n,new kH(ZU(r.content,0,r.openStart,t),t,r.openEnd))}}let p=e.steps.length;for(let f=a.length-1;f>=0&&(e.replace(t,n,r),!(e.steps.length>p));f--){let e=a[f];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let o=r.depth-1;o>=0;o--){let e=r.index(o);if(r.node(o).canReplaceWith(e,e,n))return r.before(o+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let e=r.indexAfter(o);if(r.node(o).canReplaceWith(e,e,n))return r.after(o+1);if(e<r.node(o).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new kH(mH.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=JU(r,o);for(let a=0;a<i.length;a++){let t=i[a],n=a==i.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),o.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),o.indexAfter(t-1))))return e.delete(r.before(t),o.after(t))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a)return e.delete(r.before(a),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,a=r.before(i+1),l=o.after(i+1),s=a,c=l,u=mH.empty,d=0;for(let h=i,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,u=mH.from(r.node(h).copy(u)),d++):s--;let p=mH.empty,f=0;for(let h=i,m=!1;h>n;h--)m||o.after(h+1)<o.end(h)?(m=!0,p=mH.from(o.node(h).copy(p)),f++):c++;e.step(new VU(s,c,a,l,new kH(u.append(p),d,f),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new TU(t-n,t+n,kH.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=mH.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let e=n[a].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=mH.from(n[a].type.create(n[a].attrs,r))}let o=t.start,i=t.end;e.step(new VU(o,i,o,i,new kH(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);let a=e.mapping.slice(i),l=a.map(n,1),s=a.map(n+t.nodeSize,1);return e.step(new VU(l,s,l+1,s-1,new kH(mH.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let a=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,a);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new VU(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new kH(mH.from(a),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new QU(e,t,n)),this}setDocAttribute(e,t){return this.step(new eW(e,t)),this}addNodeMark(e,t){return this.step(new MU(e,t)),this}removeNodeMark(e,t){if(!(t instanceof yH)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new AU(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=mH.empty,a=mH.empty;for(let l=o.depth,s=o.depth-n,c=n-1;l>s;l--,c--){i=mH.from(o.node(l).copy(i));let e=r&&r[c];a=mH.from(e?e.type.create(e.attrs,a):o.node(l).copy(a))}e.step(new TU(t,t,new kH(i.append(a),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,a=[],l=[];e.doc.nodesBetween(t,n,((e,s,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(s,t),d=Math.min(s+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:a.push(o=new _U(c,d,u[e])));i&&i.to==c?i.to=d:l.push(i=new NU(c,d,r))}})),a.forEach((t=>e.step(t))),l.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,((e,a)=>{if(!e.isInline)return;i++;let l=null;if(r instanceof nU){let t,n=e.marks;for(;t=r.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(l=[r]):l=e.marks;if(l&&l.length){let r=Math.min(a+e.nodeSize,n);for(let e=0;e<l.length;e++){let n,s=l[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&s.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:s,from:Math.max(a,t),to:r,step:i})}}})),o.forEach((t=>e.step(new _U(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],a=t+1;for(let l=0;l<o.childCount;l++){let t=o.child(l),s=a+t.nodeSize,c=r.matchType(t.type);if(c){r=c;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new _U(a,s,t.marks[r]));if(t.isText&&!n.spec.code){let e,r,o=/\r?\n|\r/g;for(;e=o.exec(t.text);)r||(r=new kH(mH.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),i.push(new TU(a+e.index,a+e.index+e[0].length,r))}}else i.push(new TU(a,s,kH.empty));a=s}if(!r.validEnd){let t=r.fillBefore(mH.empty,!0);e.replace(a,a,new kH(t,0,0))}for(let l=i.length-1;l>=0;l--)e.step(i[l])}(this,e,t,n),this}}const rW=Object.create(null);let oW=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new iW(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=kH.empty){let n=t.content.lastChild,r=null;for(let a=0;a<t.openEnd;a++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:s}=i[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(s.pos),a?kH.empty:t),0==a&&mW(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:a}=r[o],l=e.mapping.slice(n),s=l.map(i.pos),c=l.map(a.pos);o?e.deleteRange(s,c):(e.replaceRangeWith(s,c,t),mW(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new sW(e):hW(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let o=e.depth-1;o>=0;o--){let r=t<0?hW(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):hW(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new pW(e.node(0))}static atStart(e){return hW(e,e,0,0,1)||new pW(e)}static atEnd(e){return hW(e,e,e.content.size,e.childCount,-1)||new pW(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=rW[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in rW)throw new RangeError("Duplicate use of selection JSON ID "+e);return rW[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sW.between(this.$anchor,this.$head).getBookmark()}};oW.prototype.visible=!0;class iW{constructor(e,t){this.$from=e,this.$to=t}}let aW=!1;function lW(e){aW||e.parent.inlineContent||(aW=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sW extends oW{constructor(e,t=e){lW(e),lW(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return oW.near(n);let r=e.resolve(t.map(this.anchor));return new sW(r.parent.inlineContent?r:n,n)}replace(e,t=kH.empty){if(super.replace(e,t),t==kH.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sW&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new cW(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new sW(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=oW.findFrom(t,n,!0)||oW.findFrom(t,-n,!0);if(!e)return oW.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(oW.findFrom(e,-n,!0)||oW.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new sW(e,t)}}oW.jsonID("text",sW);class cW{constructor(e,t){this.anchor=e,this.head=t}map(e){return new cW(e.map(this.anchor),e.map(this.head))}resolve(e){return sW.between(e.resolve(this.anchor),e.resolve(this.head))}}class uW extends oW{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?oW.near(o):new uW(o)}content(){return new kH(mH.from(this.node),0,0)}eq(e){return e instanceof uW&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new dW(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new uW(e.resolve(t.anchor))}static create(e,t){return new uW(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}uW.prototype.visible=!1,oW.jsonID("node",uW);class dW{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new cW(n,n):new dW(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&uW.isSelectable(n)?new uW(t):oW.near(t)}}class pW extends oW{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=kH.empty){if(t==kH.empty){e.delete(0,e.doc.content.size);let t=oW.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new pW(e)}map(e){return new pW(e)}eq(e){return e instanceof pW}getBookmark(){return fW}}oW.jsonID("all",pW);const fW={map(){return this},resolve:e=>new pW(e)};function hW(e,t,n,r,o,i=!1){if(t.inlineContent)return sW.create(e,n);for(let a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){let r=t.child(a);if(r.isAtom){if(!i&&uW.isSelectable(r))return uW.create(e,n-(o<0?r.nodeSize:0))}else{let t=hW(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function mW(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof TU||i instanceof VU)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(oW.near(e.doc.resolve(o),n)))}class vW extends nW{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return yH.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||yH.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(oW.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function gW(e,t){return t&&e?e.bind(t):e}class bW{constructor(e,t,n){this.name=e,this.init=gW(t.init,n),this.apply=gW(t.apply,n)}}const yW=[new bW("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new bW("selection",{init:(e,t)=>e.selection||oW.atStart(t.doc),apply:e=>e.selection}),new bW("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new bW("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class wW{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yW.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new bW(e.key,e.spec.state,e))}))}}class kW{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let l=r?r[i].n:0,s=r?r[i].state:this,c=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,s,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new kW(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new vW(this)}static create(e){let t=new wW(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new kW(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new wW(this.schema,e.plugins),n=t.fields,r=new kW(t);for(let o=0;o<n.length;o++){let t=n[o].name;r[t]=this.hasOwnProperty(t)?this[t]:n[o].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new wW(e.schema,e.plugins),o=new kW(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=RH.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=oW.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let a=n[i],l=a.spec.state;if(a.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=l.fromJSON.call(a,e,t[i],o))}o[r.name]=r.init(e,o)}})),o}}function xW(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=xW(o,t,{})),n[r]=o}return n}class CW{constructor(e){this.spec=e,this.props={},e.props&&xW(e.props,this,this.props),this.key=e.key?e.key.key:SW("plugin")}getState(e){return e[this.key]}}const OW=Object.create(null);function SW(e){return e in OW?e+"$"+ ++OW[e]:(OW[e]=0,e+"$")}class EW{constructor(e="key"){this.key=SW(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const NW=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},_W=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let MW=null;const AW=function(e,t,n){let r=MW||(MW=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},TW=function(e,t,n,r){return n&&(jW(e,t,n,r,-1)||jW(e,t,n,r,1))},VW=/^(img|br|input|textarea|hr)$/i;function jW(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:BW(e))){let n=e.parentNode;if(!n||1!=n.nodeType||PW(e)||VW.test(e.nodeName)||"false"==e.contentEditable)return!1;t=NW(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?BW(e):0}}}function BW(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function PW(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const IW=function(e){return e.focusNode&&TW(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function DW(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const LW="undefined"!=typeof navigator?navigator:null,RW="undefined"!=typeof document?document:null,zW=LW&&LW.userAgent||"",FW=/Edge\/(\d+)/.exec(zW),$W=/MSIE \d/.exec(zW),HW=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zW),UW=!!($W||HW||FW),WW=$W?document.documentMode:HW?+HW[1]:FW?+FW[1]:0,qW=!UW&&/gecko\/(\d+)/i.test(zW);qW&&(/Firefox\/(\d+)/.exec(zW)||[0,0])[1];const KW=!UW&&/Chrome\/(\d+)/.exec(zW),GW=!!KW,YW=KW?+KW[1]:0,XW=!UW&&!!LW&&/Apple Computer/.test(LW.vendor),ZW=XW&&(/Mobile\/\w+/.test(zW)||!!LW&&LW.maxTouchPoints>2),JW=ZW||!!LW&&/Mac/.test(LW.platform),QW=!!LW&&/Win/.test(LW.platform),eq=/Android \d/.test(zW),tq=!!RW&&"webkitFontSmoothing"in RW.documentElement.style,nq=tq?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function rq(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function oq(e,t){return"number"==typeof e?e:e[t]}function iq(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function aq(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let a=n||e.dom;a;a=_W(a)){if(1!=a.nodeType)continue;let e=a,n=e==i.body,l=n?rq(i):iq(e),s=0,c=0;if(t.top<l.top+oq(r,"top")?c=-(l.top-t.top+oq(o,"top")):t.bottom>l.bottom-oq(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+oq(o,"top")-l.top:t.bottom-l.bottom+oq(o,"bottom")),t.left<l.left+oq(r,"left")?s=-(l.left-t.left+oq(o,"left")):t.right>l.right-oq(r,"right")&&(s=t.right-l.right+oq(o,"right")),s||c)if(n)i.defaultView.scrollBy(s,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),s&&(e.scrollLeft+=s);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function lq(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=_W(r));return t}function sq(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let cq=null;function uq(e,t){let n,r,o,i,a=2e8,l=0,s=t.top,c=t.top;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(1==u.nodeType)e=u.getClientRects();else{if(3!=u.nodeType)continue;e=AW(u).getClientRects()}for(let p=0;p<e.length;p++){let f=e[p];if(f.top<=s&&f.bottom>=c){s=Math.max(f.bottom,s),c=Math.min(f.top,c);let e=f.left>t.left?f.left-t.left:f.right<t.left?t.left-f.right:0;if(e<a){n=u,a=e,r=e&&3==n.nodeType?{left:f.right<t.left?f.right:f.left,top:t.top}:t,1==u.nodeType&&e&&(l=d+(t.left>=(f.left+f.right)/2?1:0));continue}}else f.top>t.top&&!o&&f.left<=t.left&&f.right>=t.left&&(o=u,i={left:Math.max(f.left,Math.min(f.right,t.left)),top:f.top});!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(l=d+1)}}return!n&&o&&(n=o,r=i,a=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=mq(r,1);if(n.top!=n.bottom&&dq(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||a&&1==n.nodeType?{node:e,offset:l}:uq(n,r)}function dq(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function pq(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(dq(t,o))return pq(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function fq(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(r){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let a,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!dq(t,n))return null;if(l=pq(e.dom,t,n),!l)return null}if(XW)for(let c=l;n&&c;c=_W(c))c.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(qW&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}let r;tq&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(a=function(e,t,n,r){let o=-1;for(let i=t,a=!1;i!=e.dom;){let t=e.docView.nearestDesc(i,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent&&!a||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!a&&(a=!0,e.left>r.left||e.top>r.top?o=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(o=t.posAfter)),!t.contentDOM&&o<0&&!t.node.isText)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}i=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==a&&(a=function(e,t,n){let{node:r,offset:o}=uq(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,l,t));let s=e.docView.nearestDesc(l,!0);return{pos:a,inside:s?s.posAtStart-s.border:-1}}function hq(e){return e.top<e.bottom||e.left<e.right}function mq(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(hq(e))return e}return Array.prototype.find.call(n,hq)||e.getBoundingClientRect()}const vq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function gq(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),a=tq||qW;if(3==r.nodeType){if(!a||!vq.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,bq(mq(AW(r,e,t),i),i<0)}{let e=mq(AW(r,o,o),n);if(qW&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=mq(AW(r,o-1,o-1),-1);if(t.top==e.top){let n=mq(AW(r,o,o+1),-1);if(n.top!=e.top)return bq(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==BW(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return yq(e.getBoundingClientRect(),!1)}if(null==i&&o<BW(r)){let e=r.childNodes[o];if(1==e.nodeType)return yq(e.getBoundingClientRect(),!0)}return yq(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==BW(r))){let e=r.childNodes[o-1],t=3==e.nodeType?AW(e,BW(e)-(a?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return bq(mq(t,1),!1)}if(null==i&&o<BW(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?AW(e,0,a?0:1):1==e.nodeType?e:null:null;if(t)return bq(mq(t,-1),!0)}return bq(mq(3==r.nodeType?AW(r):r,-n),n>=0)}function bq(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function yq(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function wq(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const kq=/[\u0590-\u08ac]/;let xq=null,Cq=null,Oq=!1;function Sq(e,t,n){return xq==t&&Cq==n?Oq:(xq=t,Cq=n,Oq="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return wq(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=gq(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=AW(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,a=o==r.parent.content.size,l=e.domSelection();return kq.test(r.parent.textContent)&&l.modify?wq(e,t,(()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:a}=e.domSelectionRange(),s=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),p=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&o==d;try{l.collapse(i,a),t&&(t!=i||o!=a)&&l.extend&&l.extend(t,o)}catch(f){}return null!=s&&(l.caretBidiLevel=s),p})):"left"==n||"backward"==n?i:a}(e,t,n))}class Eq{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>NW(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let o=0;n<this.children.length;n++){let t=this.children[n],i=o+t.size;if(i>e||t instanceof jq){r=e-o;break}o=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof Nq&&o.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?NW(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?NW(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,a=0;;a++){let n=this.children[a],l=i+n.size;if(-1==r&&e<=l){let o=i+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=a;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=NW(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(let e=a+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=NW(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let p=0,f=0;p<this.children.length;p++){let a=this.children[p],l=f+a.size;if(o>f&&i<l)return a.setSelection(e-f-a.border,t-f-a.border,n,r);f=l}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),s=n.getSelection(),c=!1;if((qW||XW)&&e==t){let{node:e,offset:t}=a;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(a=l={node:n.parentNode,offset:NW(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(qW&&s.focusNode&&s.focusNode!=l.node&&1==s.focusNode.nodeType){let e=s.focusNode.childNodes[s.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&XW)&&TW(a.node,a.offset,s.anchorNode,s.anchorOffset)&&TW(l.node,l.offset,s.focusNode,s.focusOffset))return;let u=!1;if((s.extend||e==t)&&!c){s.collapse(a.node,a.offset);try{e!=t&&s.extend(l.node,l.offset),u=!0}catch(d){}}if(!u){if(e>t){let e=a;a=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(a.node,a.offset),s.removeAllRanges(),s.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,a=i-o.border;if(e>=r&&t<=a)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Nq extends Eq{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class _q extends Eq{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Mq extends Eq{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=mU.renderSpec(document,t.type.spec.toDOM(t,n))),new Mq(e,t,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=Mq.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=qq(o,t,i,n)),e>0&&(o=qq(o,0,e,n));for(let a=0;a<o.length;a++)o[a].parent=r;return r.children=o,r}}class Aq extends Eq{constructor(e,t,n,r,o,i,a,l,s){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=a}static create(e,t,n,r,o,i){let a,l=o.nodeViews[t.type.name],s=l&&l(t,o,(()=>a?a.parent?a.parent.posBeforeChild(a):void 0:i),n,r),c=s&&s.dom,u=s&&s.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=mU.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=Fq(c,n,t),s?a=new Bq(e,t,n,r,c,u||null,d,s,o,i+1):t.isText?new Vq(e,t,n,r,c,d,o):new Aq(e,t,n,r,c,u||null,d,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>mH.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&$q(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Uq(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let a=e.child(n);r(a,o,t.forChild(i,a),n),i+=a.nodeSize}return}let a=0,l=[],s=null;for(let c=0;;){let u,d,p,f;for(;a<o.length&&o[a].to==i;){let e=o[a++];e.widget&&(u?(d||(d=[u])).push(e):u=e)}if(u)if(d){d.sort(Wq);for(let e=0;e<d.length;e++)n(d[e],c,!!s)}else n(u,c,!!s);if(s)f=-1,p=s,s=null;else{if(!(c<e.childCount))break;f=c,p=e.child(c++)}for(let e=0;e<l.length;e++)l[e].to<=i&&l.splice(e--,1);for(;a<o.length&&o[a].from<=i&&o[a].to>i;)l.push(o[a++]);let h=i+p.nodeSize;if(p.isText){let e=h;a<o.length&&o[a].from<e&&(e=o[a].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<h&&(s=p.cut(e-i),p=p.cut(0,e-i),h=e,f=-1)}else for(;a<o.length&&o[a].to<h;)a++;r(p,p.isInline&&!p.isLeaf?l.filter((e=>!e.inline)):l.slice(),t.forChild(i,p),f),i=h}}(this.node,this.innerDeco,((t,o,i)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!i&&l.syncToMarks(o==this.node.childCount?yH.none:this.node.child(o).marks,n,e),l.placeWidget(t,e,r)}),((t,i,s,c)=>{let u;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,i,s,c)||a&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,i,s,u,e)||l.updateNextNode(t,i,s,e,c,r)||l.addNode(t,i,s,e,r),r+=t.nodeSize})),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),Pq(this.contentDOM,this.children,e),ZW&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof sW)||n<t||r>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let a=e.child(o++),l=i;if(i+=a.nodeSize,!a.isText)continue;let s=a.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;s+=t.text}if(i>=n){if(i>=r&&s.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?s.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&s.length>=r+t.length-l&&s.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new _q(this,o,t,r);e.input.compositionNodes.push(i),this.children=qq(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if($q(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Rq(this.dom,this.nodeDOM,Lq(this.outerDeco,this.node,t),Lq(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Tq(e,t,n,r,o){Fq(r,t,e);let i=new Aq(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Vq extends Aq{constructor(e,t,n,r,o,i,a){super(e,t,n,r,o,null,i,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new Vq(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class jq extends Eq{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Bq extends Aq{constructor(e,t,n,r,o,i,a,l,s,c){super(e,t,n,r,o,i,a,s,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Pq(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let a=t[i],l=a.dom;if(l.parentNode==e){for(;l!=r;)r=Hq(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(l,r);if(a instanceof Mq){let t=r?r.previousSibling:e.lastChild;Pq(a.contentDOM,a.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Hq(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Iq=function(e){e&&(this.nodeName=e)};Iq.prototype=Object.create(null);const Dq=[new Iq];function Lq(e,t,n){if(0==e.length)return Dq;let r=n?Dq[0]:new Iq,o=[r];for(let i=0;i<e.length;i++){let a=e[i].type.attrs;if(a){a.nodeName&&o.push(r=new Iq(a.nodeName));for(let e in a){let i=a[e];null!=i&&(n&&1==o.length&&o.push(r=new Iq(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Rq(e,t,n,r){if(n==Dq&&r==Dq)return t;let o=t;for(let i=0;i<r.length;i++){let t=r[i],a=n[i];if(i){let n;a&&a.nodeName==t.nodeName&&o!=e&&(n=o.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(o),a=Dq[0]),o=n}zq(o,a||Dq[0],t)}return o}function zq(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Fq(e,t,n){return Rq(e,e,Dq,Lq(t,n,1!=e.nodeType))}function $q(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Hq(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Uq{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,a=[];e:for(;o>0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Mq)){l=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=l.node;if(s){if(s!=e.child(o-1))break;--o,i.set(l,o),a.push(l)}}return{index:o,matched:i,matches:a.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Mq.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let r=this.top.children[a];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Aq){let s=this.preMatch.matched.get(l);if(null!=s&&s!=o)return!1;let c,u=l.dom,d=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&$q(t,l.outerDeco));if(!d&&l.update(e,t,n,r))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(c=this.recreateWrapper(l,e,t,n,r,i)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let a=Aq.create(this.top,t,n,r,o,i);if(a.contentDOM){a.children=e.children,e.children=[];for(let e of a.children)e.parent=a}return e.destroy(),a}addNode(e,t,n,r,o){let i=Aq.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Nq(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Mq;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Vq)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((XW||GW)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new jq(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function Wq(e,t){return e.type.side-t.type.side}function qq(e,t,n,r,o){let i=[];for(let a=0,l=0;a<e.length;a++){let s=e[a],c=l,u=l+=s.size;c>=n||u<=t?i.push(s):(c<t&&i.push(s.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(s.slice(n-c,s.size,r)))}return i}function Kq(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l,s,c=r.resolve(a);if(IW(n)){for(l=c;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&uW.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==BW(e);r||o;){if(e==n)return!0;let t=NW(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==BW(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;s=new uW(a==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;l=r.resolve(t)}if(!s){s=nK(e,l,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)}return s}function Gq(e){return e.editable?e.hasFocus():oK(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Yq(e,t=!1){let n=e.state.selection;if(eK(e,n),Gq(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&GW){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&TW(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,NW(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&UW&&WW<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,o,{anchor:i,head:a}=n;!Xq||n instanceof sW||(n.$from.parent.inlineContent||(r=Zq(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Zq(e,n.to))),e.docView.setSelection(i,a,e.root,t),Xq&&(r&&Qq(r),o&&Qq(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Gq(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Xq=XW||GW&&YW<63;function Zq(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(XW&&o&&"false"==o.contentEditable)return Jq(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Jq(o);if(i)return Jq(i)}}function Jq(e){return e.contentEditable="true",XW&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Qq(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function eK(e,t){if(t instanceof uW){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(tK(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else tK(e)}function tK(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nK(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||sW.between(t,n,r)}function rK(e){return!(e.editable&&!e.hasFocus())&&oK(e)}function oK(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function iK(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&oW.findFrom(i,t)}function aK(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function lK(e,t,n){let r=e.state.selection;if(!(r instanceof sW)){if(r instanceof uW&&r.node.isInline)return aK(e,new sW(t>0?r.$to:r.$from));{let n=iK(e.state,t);return!!n&&aK(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return aK(e,new sW(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=iK(e.state,t);return!!(n&&n instanceof uW)&&aK(e,n)}if(!(JW&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(a))&&!n.contentDOM)&&(uW.isSelectable(i)?aK(e,new uW(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!tq&&aK(e,new sW(e.state.doc.resolve(t<0?a:a+i.nodeSize))))}}function sK(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function cK(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function uK(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=!1;qW&&1==n.nodeType&&r<sK(n)&&cK(n.childNodes[r],-1)&&(a=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(cK(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(dK(n))break;{let t=n.previousSibling;for(;t&&cK(t,-1);)o=n.parentNode,i=NW(t),t=t.previousSibling;if(t)n=t,r=sK(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?pK(e,n,r):o&&pK(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,a=sK(n);for(;;)if(r<a){if(1!=n.nodeType)break;if(!cK(n.childNodes[r],1))break;o=n,i=++r}else{if(dK(n))break;{let t=n.nextSibling;for(;t&&cK(t,1);)o=t.parentNode,i=NW(t)+1,t=t.nextSibling;if(t)n=t,r=0,a=sK(n);else{if(n=n.parentNode,n==e.dom)break;r=a=0}}}o&&pK(e,o,i)}(e)}function dK(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function pK(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!PW(e);)t=NW(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!PW(e);)t=NW(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(IW(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&Yq(e)}),50)}function fK(e,t){let n=e.state.doc.resolve(t);if(!GW&&!QW&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function hK(e,t,n){let r=e.state.selection;if(r instanceof sW&&!r.empty||n.indexOf("s")>-1)return!1;if(JW&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=iK(e.state,t);if(n&&n instanceof uW)return aK(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,a=r instanceof pW?oW.near(n,t):oW.findFrom(n,t);return!!a&&aK(e,a)}return!1}function mK(e,t){if(!(e.state.selection instanceof sW))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function vK(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function gK(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||JW&&72==n&&"c"==r)return mK(e,-1)||uK(e,-1);if(46==n&&!t.shiftKey||JW&&68==n&&"c"==r)return mK(e,1)||uK(e,1);if(13==n||27==n)return!0;if(37==n||JW&&66==n&&"c"==r){let t=37==n?"ltr"==fK(e,e.state.selection.from)?-1:1:-1;return lK(e,t,r)||uK(e,t)}if(39==n||JW&&70==n&&"c"==r){let t=39==n?"ltr"==fK(e,e.state.selection.from)?1:-1:1;return lK(e,t,r)||uK(e,t)}return 38==n||JW&&80==n&&"c"==r?hK(e,-1,r)||uK(e,-1):40==n||JW&&78==n&&"c"==r?function(e){if(!XW||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;vK(e,n,"true"),setTimeout((()=>vK(e,n,"false")),20)}return!1}(e)||hK(e,1,r)||uK(e,1):r==(JW?"m":"c")&&(66==n||73==n||89==n||90==n)}function bK(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let a=e.someProp("clipboardSerializer")||mU.fromSchema(e.state.schema),l=_K(),s=l.createElement("div");s.appendChild(a.serializeFragment(r,{document:l}));let c,u=s.firstChild,d=0;for(;u&&1==u.nodeType&&(c=EK[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;s.firstChild;)t.appendChild(s.firstChild);s.appendChild(t),d++}u=s.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:s,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n")}}function yK(e,t,n,r,o){let i,a,l=o.parent.type.spec.code;if(!n&&!t)return null;let s=t&&(r||l||!n);if(s){if(e.someProp("transformPastedText",(n=>{t=n(t,l||r,e)})),l)return t?new kH(mH.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):kH.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,o,r,e)));if(n)a=n;else{let n=o.marks(),{schema:r}=e.state,a=mU.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(a.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=_K().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&EK[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),tq&&function(e){let t=e.querySelectorAll(GW?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!a){let t=e.someProp("clipboardParser")||e.someProp("domParser")||iU.fromSchema(e.state.schema);a=t.parseSlice(i,{preserveWhitespace:!(!s&&!u),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||wK.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)a=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(l){return e}let{content:o,openStart:i,openEnd:a}=e;for(let s=n.length-2;s>=0;s-=2){let e=r.nodes[n[s]];if(!e||e.hasRequiredAttrs())break;o=mH.from(e.create(n[s+1],o)),i++,a++}return new kH(o,i,a)}(SK(a,+u[1],+u[2]),u[4]);else if(a=kH.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&xK(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=CK(i[i.length-1],r.length));let t=kK(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return mH.from(i)}return e}(a.content,o),!0),a.openStart||a.openEnd){let e=0,t=0;for(let n=a.content.firstChild;e<a.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=a.content.lastChild;t<a.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);a=SK(a,e,t)}return e.someProp("transformPasted",(t=>{a=t(a,e)})),a}const wK=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function kK(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,mH.from(e));return e}function xK(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=xK(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(mH.from(kK(n,e,o+1))))}}function CK(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,CK(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(mH.empty,!0);return e.copy(n.append(r))}function OK(e,t,n,r,o,i){let a=t<0?e.firstChild:e.lastChild,l=a.content;return e.childCount>1&&(i=0),o<r-1&&(l=OK(l,t,n,r,o+1,i)),o>=n&&(l=t<0?a.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(mH.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(l))}function SK(e,t,n){return t<e.openStart&&(e=new kH(OK(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new kH(OK(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const EK={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let NK=null;function _K(){return NK||(NK=document.implementation.createHTMLDocument("title"))}const MK={},AK={},TK={touchstart:!0,touchmove:!0};class VK{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function jK(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function BK(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>PK(e,t))}))}function PK(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function IK(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function DK(e){return{left:e.clientX,top:e.clientY}}function LK(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let a=i.depth+1;a>0;a--)if(e.someProp(t,(t=>a>i.depth?t(e,n,i.nodeAfter,i.before(a),o,!0):t(e,n,i.node(a),i.before(a),o,!1))))return!0;return!1}function RK(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function zK(e,t,n,r,o){return LK(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof uW&&(n=o.node);let i=e.state.doc.resolve(t);for(let a=i.depth+1;a>0;a--){let e=a>i.depth?i.nodeAfter:i.node(a);if(uW.isSelectable(e)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(RK(e,uW.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&uW.isSelectable(r))&&(RK(e,new uW(n),"pointer"),!0)}(e,n))}function FK(e,t,n,r){return LK(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function $K(e,t,n,r){return LK(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(RK(e,sW.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let t=i>o.depth?o.nodeAfter:o.node(i),n=o.before(i);if(t.inlineContent)RK(e,sW.create(r,n+1,n+1+t.content.size),"pointer");else{if(!uW.isSelectable(t))continue;RK(e,uW.create(r,n),"pointer")}return!0}}(e,n,r)}function HK(e){return ZK(e)}AK.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!qK(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!eq||!GW||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!ZW||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||gK(e,n)?n.preventDefault():jK(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,DW(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},AK.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},AK.keypress=(e,t)=>{let n=t;if(qK(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||JW&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sW&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const UK=JW?"metaKey":"ctrlKey";MK.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=HK(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[UK]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let a=e.posAtCoords(DK(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new WK(e,a,n,!!r)):("doubleClick"==i?FK:$K)(e,a.pos,a.inside,n)?n.preventDefault():jK(e,"pointer"))};class WK{constructor(e,t,n,r){let o,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[UK],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const a=r?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:s}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||s instanceof uW&&s.from<=i&&s.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!qW||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),jK(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Yq(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(DK(e))),this.updateAllowDefault(e),this.allowDefault||!t?jK(this.view,"pointer"):zK(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||XW&&this.mightDrag&&!this.mightDrag.node.isAtom||GW&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(RK(this.view,oW.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):jK(this.view,"pointer")}move(e){this.updateAllowDefault(e),jK(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function qK(e,t){return!!e.composing||!!(XW&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}MK.touchstart=e=>{e.input.lastTouch=Date.now(),HK(e),jK(e,"pointer")},MK.touchmove=e=>{e.input.lastTouch=Date.now(),jK(e,"pointer")},MK.contextmenu=e=>HK(e);const KK=eq?5e3:-1;function GK(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>ZK(e)),t))}function YK(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function XK(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=BW(e=e.childNodes[t-1])}else{if(!e.parentNode||PW(e))return null;t=NW(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||PW(e))return null;t=NW(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n}function ZK(e,t=!1){if(!(eq&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),YK(e),t||e.docView&&e.docView.dirty){let t=Kq(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}AK.compositionstart=AK.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),ZK(e,!0),e.markCursor=null;else if(ZK(e),qW&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}GK(e,KK)},AK.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,GK(e,20))};const JK=UW&&WW<15||ZW&&nq<604;function QK(e,t,n,r,o){let i=yK(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,o,i||kH.empty))))return!0;if(!i)return!1;let a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),l=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(i);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function eG(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}MK.copy=AK.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=JK?null:n.clipboardData,a=r.content(),{dom:l,text:s}=bK(e,a);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},AK.paste=(e,t)=>{let n=t;if(e.composing&&!eq)return;let r=JK?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&QK(e,eG(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?QK(e,r.value,null,o,t):QK(e,r.textContent,r.innerHTML,o,t)}),50)}(e,n)};class tG{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const nG=JW?"altKey":"ctrlKey";MK.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,a=i.empty?null:e.posAtCoords(DK(n));if(a&&a.pos>=i.from&&a.pos<=(i instanceof uW?i.to-1:i.to));else if(r&&r.mightDrag)o=uW.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=uW.create(e.state.doc,t.posBefore))}let l=(o||e.state.selection).content(),{dom:s,text:c}=bK(e,l);n.dataTransfer.clearData(),n.dataTransfer.setData(JK?"Text":"text/html",s.innerHTML),n.dataTransfer.effectAllowed="copyMove",JK||n.dataTransfer.setData("text/plain",c),e.dragging=new tG(l,!n[nG],o)},MK.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},AK.dragover=AK.dragenter=(e,t)=>t.preventDefault(),AK.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(DK(n));if(!o)return;let i=e.state.doc.resolve(o.pos),a=r&&r.slice;a?e.someProp("transformPasted",(t=>{a=t(a,e)})):a=yK(e,eG(n.dataTransfer),JK?null:n.dataTransfer.getData("text/html"),!1,i);let l=!(!r||n[nG]);if(e.someProp("handleDrop",(t=>t(e,n,a||kH.empty,l))))return void n.preventDefault();if(!a)return;n.preventDefault();let s=a?$U(e.state.doc,i.pos,a):i.pos;null==s&&(s=i.pos);let c=e.state.tr;if(l){let{node:e}=r;e?e.replace(c):c.deleteSelection()}let u=c.mapping.map(s),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(p))return;let f=c.doc.resolve(u);if(d&&uW.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new uW(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),c.setSelection(nK(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},MK.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Yq(e)}),20))},MK.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},MK.beforeinput=(e,t)=>{if(GW&&eq&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,DW(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in AK)MK[os]=AK[os];function rG(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class oG{constructor(e,t){this.toDOM=e,this.spec=t||cG,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new lG(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof oG&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rG(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class iG{constructor(e,t){this.attrs=e,this.spec=t||cG}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new lG(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof iG&&rG(this.attrs,e.attrs)&&rG(this.spec,e.spec)}static is(e){return e.type instanceof iG}destroy(){}}class aG{constructor(e,t){this.attrs=e,this.spec=t||cG}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new lG(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof aG&&rG(this.attrs,e.attrs)&&rG(this.spec,e.spec)}destroy(){}}class lG{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new lG(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new lG(e,e,new oG(t,n))}static inline(e,t,n,r){return new lG(e,t,new iG(n,r))}static node(e,t,n,r){return new lG(e,t,new aG(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof iG}get widget(){return this.type instanceof oG}}const sG=[],cG={};class uG{constructor(e,t){this.local=e.length?e:sG,this.children=t.length?t:sG}static create(e,t){return t.length?vG(t,e,0,cG):dG}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,t-a,n,r+a,o)}}map(e,t,n){return this==dG||0==e.maps.length?this:this.mapInner(e,t,0,0,n||cG)}mapInner(e,t,n,r,o){let i;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,r);l&&l.type.valid(t,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(e,t,n,r,o,i,a){let l=e.slice();for(let c=0,u=i;c<n.maps.length;c++){let e=0;n.maps[c].forEach(((t,n,r,o)=>{let i=o-r-(n-t);for(let a=0;a<l.length;a+=3){let r=l[a+1];if(r<0||t>r+u-e)continue;let o=l[a]+u-e;n>=o?l[a+1]=t<=o?-2:-1:t>=u&&i&&(l[a]+=i,l[a+1]+=i)}e+=i})),u=n.maps[c].map(u,-1)}let s=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(-2==l[c+1]){s=!0,l[c+1]=-1;continue}let t=n.map(e[c]+i),u=t-o;if(u<0||u>=r.content.size){s=!0;continue}let d=n.map(e[c+1]+i,-1)-o,{index:p,offset:f}=r.content.findIndex(u),h=r.maybeChild(p);if(h&&f==u&&f+h.nodeSize==d){let r=l[c+2].mapInner(n,h,t+1,e[c]+i+1,a);r!=dG?(l[c]=u,l[c+1]=d,l[c+2]=r):(l[c+1]=-2,s=!0)}else s=!0}if(s){let s=function(e,t,n,r,o,i,a){function l(e,t){for(let i=0;i<e.local.length;i++){let l=e.local[i].map(r,o,t);l?n.push(l):a.onRemove&&a.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let s=0;s<e.length;s+=3)-1==e[s+1]&&l(e[s+2],t[s]+i+1);return n}(l,e,t,n,o,i,a),c=vG(s,r,0,a);t=c.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new uG(t.sort(gG),l)}(this.children,i||[],e,t,n,r,o):i?new uG(i.sort(gG),sG):dG}add(e,t){return t.length?this==dG?uG.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let a,l=i+n;if(a=hG(t,e,l)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,a,l+1):r.splice(o,0,i,i+e.nodeSize,vG(a,e,l+1,cG)),o+=3}}));let i=fG(o?mG(t):t,-n);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new uG(i.length?this.local.concat(i).sort(gG):this.local,r||this.children)}remove(e){return 0==e.length||this==dG?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let o=0;o<n.length;o+=3){let r,i=n[o]+t,a=n[o+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<a&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let l=n[o+2].removeInner(r,i+1);l!=dG?n[o+2]=l:(n.splice(o,3),o-=3)}if(r.length)for(let o,i=0;i<e.length;i++)if(o=e[i])for(let e=0;e<r.length;e++)r[e].eq(o,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new uG(r,n):dG}forChild(e,t){if(this==dG)return this;if(t.isLeaf)return uG.empty;let n,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let o=e+1,i=o+t.content.size;for(let a=0;a<this.local.length;a++){let e=this.local[a];if(e.from<i&&e.to>o&&e.type instanceof iG){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new uG(r.sort(gG),sG);return n?new pG([e,n]):e}return n||dG}eq(e){if(this==e)return!0;if(!(e instanceof uG)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return bG(this.localsInner(e))}localsInner(e){if(this==dG)return sG;if(e.inlineContent||!this.local.some(iG.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof iG||t.push(this.local[n]);return t}}uG.empty=new uG([],[]),uG.removeOverlap=bG;const dG=uG.empty;class pG{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,cG)));return pG.from(n)}forChild(e,t){if(t.isLeaf)return uG.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=dG&&(o instanceof pG?n=n.concat(o.members):n.push(o))}return pG.from(n)}eq(e){if(!(e instanceof pG)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?bG(n?t:t.sort(gG)):sG}static from(e){switch(e.length){case 0:return dG;case 1:return e[0];default:return new pG(e.every((e=>e instanceof uG))?e:e.reduce(((e,t)=>e.concat(t instanceof uG?t:t.members)),[]))}}}function fG(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new lG(o.from+t,o.to+t,o.type))}return n}function hG(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let i,a=0;a<e.length;a++)(i=e[a])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),e[a]=null);return o}function mG(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function vG(e,t,n,r){let o=[],i=!1;t.forEach(((t,a)=>{let l=hG(e,t,a+n);if(l){i=!0;let e=vG(l,t,n+a+1,r);e!=dG&&o.push(a,a+t.nodeSize,e)}}));let a=fG(i?mG(e):e,-n).sort(gG);for(let l=0;l<a.length;l++)a[l].type.valid(t,a[l])||(r.onRemove&&r.onRemove(a[l].spec),a.splice(l--,1));return a.length||o.length?new uG(a,o):dG}function gG(e,t){return e.from-t.from||e.to-t.to}function bG(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),yG(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),yG(t,o+1,i.copy(r.to,i.to)))}}return t}function yG(e,t,n){for(;t<e.length&&gG(n,e[t])>0;)t++;e.splice(t,0,n)}function wG(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=dG&&t.push(r)})),e.cursorWrapper&&t.push(uG.create(e.state.doc,[e.cursorWrapper.deco])),pG.from(t)}const kG={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xG=UW&&WW<=11;class CG{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class OG{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new CG,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);UW&&WW<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),xG&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,kG)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(rK(this.view)){if(this.suppressingSelectionUpdates)return Yq(this.view);if(UW&&WW<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&TW(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let o=e.focusNode;o;o=_W(o))n.add(o);for(let o=e.anchorNode;o;o=_W(o))if(n.has(o)){t=o;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&rK(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,a=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let e=this.registerMutation(t[c],l);e&&(o=o<0?e.from:Math.min(e.from,o),i=i<0?e.to:Math.max(e.to,i),e.typeOver&&(a=!0))}if(qW&&l.length>1){let e=l.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let s=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&IW(n)&&(s=Kq(e))&&s.eq(oW.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Yq(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(SG.has(e))return;if(SG.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=qW,EG)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),EG=!0}}(e)),this.handleDOMChange(o,i,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Yq(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(UW&&WW<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?NW(r)+1:0,a=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?NW(o):e.target.childNodes.length;return{from:a,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let SG=new WeakMap,EG=!1;function NG(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return TW(a.node,a.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function _G(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(XW&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||XW&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const MG=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function AG(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Kq(e,t);if(n&&!e.state.selection.eq(n)){if(GW&&eq&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,DW(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let a=e.state.doc.resolve(t),l=a.sharedDepth(n);t=a.before(l+1),n=e.state.doc.resolve(n).after(l+1);let s,c,u=e.state.selection,d=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:a,from:l,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],IW(c)||r.push({node:c.focusNode,offset:c.focusOffset})),GW&&8===e.input.lastKeyCode)for(let v=a;v>i;v--){let e=o.childNodes[v-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){a=v;break}if(!t||t.size)break}let d=e.state.doc,p=e.someProp("domParser")||iU.fromSchema(e.state.schema),f=d.resolve(l),h=null,m=p.parse(o,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:_G,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),h={anchor:e+l,head:t+l}}return{doc:m,sel:h,from:l,to:s}}(e,t,n),p=e.state.doc,f=p.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(s=e.state.selection.to,c="end"):(s=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:a,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){r-=a+Math.max(0,i-Math.min(a,l))-i}if(a<i&&e.size<t.size){let e=r<=i&&r>=a?i-r:0;i-=e,i&&i<t.size&&jG(t.textBetween(i-1,i+1))&&(i+=e?1:-1),l=i+(l-a),a=i}else if(l<i){let t=r<=i&&r>=l?i-r:0;i-=t,i&&i<e.size&&jG(e.textBetween(i-1,i+1))&&(i+=t?1:-1),a=i+(a-l),l=i}return{start:i,endA:a,endB:l}}(f.content,d.doc.content,d.from,s,c);if((ZW&&e.input.lastIOSEnter>Date.now()-225||eq)&&o.some((e=>1==e.nodeType&&!MG.test(e.nodeName)))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,DW(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&u instanceof sW&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let t=TG(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}h={start:u.from,endA:u.to,endB:u.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof sW&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),UW&&WW<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>d.from&&"  "==d.doc.textBetween(h.start-d.from-1,h.start-d.from+1)&&(h.start--,h.endA--,h.endB--);let m,v=d.doc.resolveNoCache(h.start-d.from),g=d.doc.resolveNoCache(h.endB-d.from),b=p.resolve(h.start),y=v.sameParent(g)&&v.parent.inlineContent&&b.end()>=h.endA;if((ZW&&e.input.lastIOSEnter>Date.now()-225&&(!y||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!y&&v.pos<d.doc.content.size&&!v.sameParent(g)&&(m=oW.findFrom(d.doc.resolve(v.pos+1),1,!0))&&m.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,DW(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||VG(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let a=e.resolve(VG(i,!0,!0));return!(!a.parent.isTextblock||a.pos>n||VG(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(p,h.start,h.endA,v,g)&&e.someProp("handleKeyDown",(t=>t(e,DW(8,"Backspace")))))return void(eq&&GW&&e.domObserver.suppressSelectionUpdates());GW&&eq&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),eq&&!y&&v.start()!=g.start()&&0==g.parentOffset&&v.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==h.endA&&(h.endB-=2,g=d.doc.resolveNoCache(h.endB-d.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,DW(13,"Enter"))}))}),20));let w,k,x,C=h.start,O=h.endA;if(y)if(v.pos==g.pos)UW&&WW<=11&&0==v.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Yq(e)),20)),w=e.state.tr.delete(C,O),k=p.resolve(h.start).marksAcross(p.resolve(h.endA));else if(h.endA==h.endB&&(x=function(e,t){let n,r,o,i=e.firstChild.marks,a=t.firstChild.marks,l=i,s=a;for(let u=0;u<a.length;u++)l=a[u].removeFromSet(l);for(let u=0;u<i.length;u++)s=i[u].removeFromSet(s);if(1==l.length&&0==s.length)r=l[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=s.length)return null;r=s[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let u=0;u<t.childCount;u++)c.push(o(t.child(u)));if(mH.from(c).eq(e))return{mark:r,type:n}}(v.parent.content.cut(v.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))w=e.state.tr,"add"==x.type?w.addMark(C,O,x.mark):w.removeMark(C,O,x.mark);else if(v.parent.child(v.index()).isText&&v.index()==g.index()-(g.textOffset?0:1)){let t=v.parent.textBetween(v.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,C,O,t))))return;w=e.state.tr.insertText(t,C,O)}if(w||(w=e.state.tr.replace(C,O,d.doc.slice(h.start-d.from,h.endB-d.from))),d.sel){let t=TG(e,w.doc,d.sel);t&&!(GW&&eq&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==C||t.head==w.mapping.map(O)-1)||UW&&t.empty&&t.head==C)&&w.setSelection(t)}k&&w.ensureMarks(k),i&&w.setMeta("composition",i),e.dispatch(w.scrollIntoView())}function TG(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:nK(e,t.resolve(n.anchor),t.resolve(n.head))}function VG(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function jG(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class BG{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new VK,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(RG),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=DG(this),IG(this),this.nodeViews=LG(this),this.docView=Tq(this.state.doc,PG(this),wG(this),this.dom,this),this.domObserver=new OG(this,((e,t,n,r)=>AG(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in MK){let n=MK[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!IK(e,t)||PK(e,t)||!e.editable&&t.type in AK||n(e,t)},TK[t]?{passive:!0}:void 0)}XW&&e.dom.addEventListener("input",(()=>null)),BK(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&BK(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(RG),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(YK(this),i=!0),this.state=e;let a=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=LG(this);(function(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&BK(this),this.editable=DG(this),IG(this);let l=wG(this),s=PG(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=o||!this.docView.matchesNode(e.doc,s,l);!u&&e.selection.eq(r.selection)||(i=!0);let d="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,a=o+1;a<Math.min(innerHeight,r.bottom);a+=5){let r=e.root.elementFromPoint(i,a);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:lq(e.dom)}}(this);if(i){this.domObserver.stop();let t=u&&(UW||GW)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(u){let n=GW?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=XK(this)),!o&&this.docView.update(e.doc,s,l,this)||(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Tq(e.doc,s,l,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return TW(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Yq(this,t):(eK(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;sq(n,0==r?0:r-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof uW){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&aq(this,t.getBoundingClientRect(),e)}else aq(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new tG(e.slice,e.move,r<0?void 0:uW.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let i=0;i<this.directPlugins.length;i++){let r=this.directPlugins[i].props[e];if(null!=r&&(n=t?t(r):r))return n}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let r=o[i].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(UW){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(cq)return e.focus(cq);let t=lq(e);e.focus(null==cq?{get preventScroll(){return cq={preventScroll:!0},!0}}:void 0),cq||(cq=!1,sq(t,0))}(this.dom),Yq(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return fq(this,e)}coordsAtPos(e,t=1){return gq(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Sq(this,t||this.state,e)}pasteHTML(e,t){return QK(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return QK(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],wG(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,MW=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){PK(e,t)||!MK[t.type]||!e.editable&&t.type in AK||MK[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return XW&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return NG(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?NG(e,n):null}(this,e)||e}domSelection(){return this.root.getSelection()}}function PG(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[lG.node(0,e.state.doc.content.size,t)]}function IG(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:lG.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function DG(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function LG(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function RG(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var zG={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},FG={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},$G="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),HG="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),UG=0;UG<10;UG++)zG[48+UG]=zG[96+UG]=String(UG);for(UG=1;UG<=24;UG++)zG[UG+111]="F"+UG;for(UG=65;UG<=90;UG++)zG[UG]=String.fromCharCode(UG+32),FG[UG]=String.fromCharCode(UG);for(var WG in zG)FG.hasOwnProperty(WG)||(FG[WG]=zG[WG]);const qG="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function KG(e){let t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(let l=0;l<i.length-1;l++){let e=i[l];if(/^(cmd|meta|m)$/i.test(e))o=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);qG?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function GG(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function YG(e){let t=function(e){let t=Object.create(null);for(let n in e)t[KG(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!($G&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||HG&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?FG:zG)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=t[GG(o,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[GG(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=zG[n.keyCode])&&r!=o){let o=t[GG(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}function XG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}function ZG(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,a=t.pos+1;for(;!i.isTextblock;a++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let l=HU(e.doc,o,a,kH.empty);if(!l||l.from!=o||l instanceof TU&&l.slice.size>=a-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(sW.create(t.doc,o)),n(t.scrollIntoView())}return!0}function JG(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function QG(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function eY(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}function tY(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function nY(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function rY(e,t,n){let r,o,i=t.nodeBefore,a=t.nodeAfter;if(i.type.spec.isolating||a.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!RU(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let l=t.parent.canReplace(t.index(),t.index()+1);if(l&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){let o=t.pos+a.nodeSize,l=mH.empty;for(let e=r.length-1;e>=0;e--)l=mH.from(r[e].create(null,l));l=mH.from(i.copy(l));let s=e.tr.step(new VU(t.pos-1,o,t.pos,o,new kH(l,1,0),r.length,!0)),c=o+2*r.length;RU(s.doc,c)&&s.join(c),n(s.scrollIntoView())}return!0}let s=oW.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),u=c&&PU(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(l&&JG(a,"start",!0)&&JG(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let l=a,s=1;for(;!l.isTextblock;l=l.firstChild)s++;if(r.canReplace(r.childCount,r.childCount,l.content)){if(n){let r=mH.empty;for(let e=o.length-1;e>=0;e--)r=mH.from(o[e].copy(r));n(e.tr.step(new VU(t.pos-o.length,t.pos+a.nodeSize,t.pos+s,t.pos+a.nodeSize-s,new kH(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function oY(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(sW.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const iY=oY(-1),aY=oY(1);function lY(e,t=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:r},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(r,a,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:a}}=n.selection.ranges[r];o.setBlockType(i,a,e,t)}r(o.scrollIntoView())}return!0}}function sY(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,a=o.blockRange(i),l=!1,s=a;if(!a)return!1;if(a.depth>=2&&o.node(a.depth-1).type.compatibleContent(e)&&0==a.startIndex){if(0==o.index(a.depth-1))return!1;let e=n.doc.resolve(a.start-2);s=new DH(e,e,a.depth),a.endIndex<a.parent.childCount&&(a=new DH(o,n.doc.resolve(i.end(a.depth)),a.depth)),l=!0}let c=IU(s,e,t,a);return!!c&&(r&&r(function(e,t,n,r,o){let i=mH.empty;for(let u=n.length-1;u>=0;u--)i=mH.from(n[u].type.create(n[u].attrs,i));e.step(new VU(t.start-(r?2:0),t.end,t.start,t.end,new kH(i,0,0),n.length,!0));let a=0;for(let u=0;u<n.length;u++)n[u].type==o&&(a=u+1);let l=n.length-a,s=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,d=t.endIndex,p=!0;u<d;u++,p=!1)!p&&LU(e.doc,s,l)&&(e.split(s,l),s+=2*l),s+=c.child(u).nodeSize;return e}(n.tr,a,c,l,e).scrollIntoView()),!0)}}function cY(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new VU(i-1,a,i,a,new kH(mH.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new DH(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const l=PU(r);if(null==l)return!1;o.lift(r,l);let s=o.mapping.map(i,-1)-1;RU(o.doc,s)&&o.join(s);return t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let f=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)f-=o.child(h).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),a=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,s=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,a.content.append(s?mH.empty:mH.from(o))))return!1;let d=i.pos,p=d+a.nodeSize;return r.step(new VU(d-(l?1:0),p+(s?1:0),d+1,p-1,new kH((l?mH.empty:mH.from(o.copy(mH.empty))).append(s?mH.empty:mH.from(o.copy(mH.empty))),l?0:1,s?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}function uY(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class dY{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,a=[],l=!!e,s=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(s,t),o=n(...e)(r);return a.push(o),c}]))),run:()=>(l||!t||s.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(s),a.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})]))),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,a={tr:e,editor:r,view:i,state:uY({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(a)])))}};return a}}class pY{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function fY(e,t,n){if(void 0===e.config[t]&&e.parent)return fY(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?fY(e.parent,t,n):null})}return e.config[t]}function hY(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function mY(e){const t=[],{nodeExtensions:n,markExtensions:r}=hY(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=fY(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=fY(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function vY(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function gY(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?t.split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter((e=>!o.includes(e)));n[e]=[...o,...i].join(" ")}else n[e]="style"===e?[n[e],t].join("; "):t;else n[e]=t})),n}),{})}function bY(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>gY(e,t)),{})}function yY(e){return"function"==typeof e}function wY(e,t=void 0,...n){return yY(e)?t?e.bind(t)(...n):e(...n):e}function kY(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...o}}}}function xY(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function CY(e,t){return t.nodes[e]||t.marks[e]||null}function OY(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}const SY=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,o,i)=>{var a,l;const s=(null===(l=(a=e.type.spec).toText)||void 0===l?void 0:l.call(a,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=s.slice(0,Math.max(0,r-t))})),n};function EY(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class NY{constructor(e){this.find=e.find,this.handler=e.handler}}const _Y=(e,t)=>{if(EY(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function MY(e){var t;const{editor:n,from:r,to:o,text:i,rules:a,plugin:l}=e,{view:s}=n;if(s.composing)return!1;const c=s.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let u=!1;const d=SY(c)+i;return a.forEach((e=>{if(u)return;const t=_Y(d,e.find);if(!t)return;const a=s.state.tr,c=uY({state:s.state,transaction:a}),p={from:r-(t[0].length-i.length),to:o},{commands:f,chain:h,can:m}=new dY({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:f,chain:h,can:m})&&a.steps.length&&(a.setMeta(l,{transform:a,from:r,to:o,text:i}),s.dispatch(a),u=!0)})),u}function AY(e){const{editor:t,rules:n}=e,r=new CW({state:{init:()=>null,apply(e,o){const i=e.getMeta(r);if(i)return i;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{const{from:e,text:o}=a,i=e+o.length;MY({editor:t,from:e,to:i,text:o,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,a)=>MY({editor:t,from:o,to:i,text:a,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&MY({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&MY({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class TY{constructor(e){this.find=e.find,this.handler=e.handler}}const VY=(e,t,n)=>{if(EY(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]};function jY(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l="undefined"!=typeof DragEvent?new DragEvent("drop"):null;const s=({state:e,from:n,to:r,rule:o,pasteEvt:i})=>{const s=e.tr,c=uY({state:e,transaction:s}),u=function(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:a,dropEvent:l}=e,{commands:s,chain:c,can:u}=new dY({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,o,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const p=Math.max(r,t),f=Math.min(o,t+e.content.size),h=e.textBetween(p-t,f-t,void 0,"");VY(h,i.find,a).forEach((e=>{if(void 0===e.index)return;const t=p+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=i.handler({state:n,range:o,match:e,commands:s,chain:c,can:u,pasteEvent:a,dropEvent:l});d.push(f)}))})),d.every((e=>null!==e))}({editor:t,state:c,from:Math.max(n-1,0),to:r.b-1,rule:o,pasteEvent:i,dropEvent:l});if(u&&s.steps.length)return l="undefined"!=typeof DragEvent?new DragEvent("drop"):null,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,s};return n.map((e=>new CW({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:(e,t)=>(i=r===e.dom.parentElement,l=t,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return a=t,o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const l=t[0],c="paste"===l.getMeta("uiEvent")&&!o,u="drop"===l.getMeta("uiEvent")&&!i,d=l.getMeta("applyPasteRules"),p=!!d;if(!c&&!u&&!p)return;if(p){const{from:t,text:n}=d,o=t+n.length,i=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(t=n.clipboardData)||void 0===t||t.setData("text/html",e),n})(n);return s({rule:e,state:r,from:t,to:{b:o},pasteEvt:i})}const f=n.doc.content.findDiffStart(r.doc.content),h=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof f&&h&&f!==h.b?s({rule:e,state:r,from:f,to:h,pasteEvt:a}):void 0}})))}class BY{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=BY.resolve(e),this.schema=function(e,t){var n;const r=mY(e),{nodeExtensions:o,markExtensions:i}=hY(e),a=null===(n=o.find((e=>fY(e,"topNode"))))||void 0===n?void 0:n.name,l=Object.fromEntries(o.map((n=>{const o=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=xY({...e.reduce(((e,t)=>{const r=fY(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}}),{}),content:wY(fY(n,"content",i)),marks:wY(fY(n,"marks",i)),group:wY(fY(n,"group",i)),inline:wY(fY(n,"inline",i)),atom:wY(fY(n,"atom",i)),selectable:wY(fY(n,"selectable",i)),draggable:wY(fY(n,"draggable",i)),code:wY(fY(n,"code",i)),defining:wY(fY(n,"defining",i)),isolating:wY(fY(n,"isolating",i)),attrs:Object.fromEntries(o.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),l=wY(fY(n,"parseHTML",i));l&&(a.parseDOM=l.map((e=>kY(e,o))));const s=fY(n,"renderHTML",i);s&&(a.toDOM=e=>s({node:e,HTMLAttributes:bY(e,o)}));const c=fY(n,"renderText",i);return c&&(a.toText=c),[n.name,a]}))),s=Object.fromEntries(i.map((n=>{const o=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=xY({...e.reduce(((e,t)=>{const r=fY(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}}),{}),inclusive:wY(fY(n,"inclusive",i)),excludes:wY(fY(n,"excludes",i)),group:wY(fY(n,"group",i)),spanning:wY(fY(n,"spanning",i)),code:wY(fY(n,"code",i)),attrs:Object.fromEntries(o.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),l=wY(fY(n,"parseHTML",i));l&&(a.parseDOM=l.map((e=>kY(e,o))));const s=fY(n,"renderHTML",i);return s&&(a.toDOM=e=>s({mark:e,HTMLAttributes:bY(e,o)})),[n.name,a]})));return new rU({topNode:a,nodes:l,marks:s})}(this.extensions,t),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:CY(e.name,this.schema)};if("mark"===e.type){(null===(t=wY(fY(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=fY(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=fY(e,"onCreate",n);o&&this.editor.on("create",o);const i=fY(e,"onUpdate",n);i&&this.editor.on("update",i);const a=fY(e,"onSelectionUpdate",n);a&&this.editor.on("selectionUpdate",a);const l=fY(e,"onTransaction",n);l&&this.editor.on("transaction",l);const s=fY(e,"onFocus",n);s&&this.editor.on("focus",s);const c=fY(e,"onBlur",n);c&&this.editor.on("blur",c);const u=fY(e,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(e){const t=BY.sort(BY.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=fY(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){return e.sort(((e,t)=>{const n=fY(e,"priority")||100,r=fY(t,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=fY(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:CY(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=BY.sort([...this.extensions].reverse()),n=[],r=[],o=t.map((t=>{const o={name:t.name,options:t.options,storage:t.storage,editor:e,type:CY(t.name,this.schema)},i=[],a=fY(t,"addKeyboardShortcuts",o);let l={};if("mark"===t.type&&t.config.exitable&&(l.ArrowRight=()=>AX.handleExit({editor:e,mark:t})),a){const t=Object.fromEntries(Object.entries(a()).map((([t,n])=>[t,()=>n({editor:e})])));l={...l,...t}}const s=new CW({props:{handleKeyDown:YG(l)}});i.push(s);const c=fY(t,"addInputRules",o);OY(t,e.options.enableInputRules)&&c&&n.push(...c());const u=fY(t,"addPasteRules",o);OY(t,e.options.enablePasteRules)&&u&&r.push(...u());const d=fY(t,"addProseMirrorPlugins",o);if(d){const e=d();i.push(...e)}return i})).flat();return[AY({editor:e,rules:n}),...jY({editor:e,rules:r}),...o]}get attributes(){return mY(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=hY(this.extensions);return Object.fromEntries(t.filter((e=>!!fY(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:vY(t.name,this.schema)},o=fY(t,"addNodeView",r);if(!o)return[];return[t.name,(r,i,a,l)=>{const s=bY(r,n);return o()({editor:e,node:r,getPos:a,decorations:l,HTMLAttributes:s,extension:t})}]})))}}function PY(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function IY(e,t){const n={...e};return PY(e)&&PY(t)&&Object.keys(t).forEach((r=>{PY(t[r])?r in e?n[r]=IY(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class DY{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wY(fY(this,"addOptions",{name:this.name}))),this.storage=wY(fY(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new DY(e)}configure(e={}){const t=this.extend();return t.options=IY(this.options,e),t.storage=wY(fY(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new DY({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=wY(fY(t,"addOptions",{name:t.name})),t.storage=wY(fY(t,"addStorage",{name:t.name,options:t.options})),t}}function LY(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:a={}}=n||{};let l="",s=!0;return e.nodesBetween(r,o,((e,n,c,u)=>{var d;const p=null==a?void 0:a[e.type.name];if(p)return e.isBlock&&!s&&(l+=i,s=!0),c&&(l+=p({node:e,pos:n,parent:c,index:u,range:t})),!1;e.isText?(l+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,o-n),s=!1):e.isBlock&&!s&&(l+=i,s=!0)})),l}function RY(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const zY=DY.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new CW({key:new EW("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,a=Math.min(...i.map((e=>e.$from.pos))),l=Math.max(...i.map((e=>e.$to.pos))),s=RY(n);return LY(r,{from:a,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:s})}}})]}});function FY(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:EY(t[r])?t[r].test(e[r]):t[r]===e[r]))}function $Y(e,t,n={}){return e.find((e=>e.type===t&&FY(e.attrs,n)))}function HY(e,t,n={}){return!!$Y(e,t,n)}function UY(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const o=$Y([...r.node.marks],t,n);if(!o)return;let i=r.index,a=e.start()+r.offset,l=i+1,s=a+r.node.nodeSize;for($Y([...r.node.marks],t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,a-=e.parent.child(i).nodeSize;for(;l<e.parent.childCount&&HY([...e.parent.child(l).marks],t,n);)s+=e.parent.child(l).nodeSize,l+=1;return{from:a,to:s}}function WY(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function qY(e){return e instanceof sW}function KY(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function GY(e,t=null){if(!t)return null;const n=oW.atStart(e),r=oW.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?sW.create(e,KY(0,o,i),KY(e.content.size,o,i)):sW.create(e,KY(t,o,i),KY(t,o,i))}function YY(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const XY=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&XY(r)}return e};function ZY(e){const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return XY(n)}function JY(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)&&e.length>0?mH.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),JY("",t,n)}if("string"==typeof e){const r=iU.fromSchema(t);return n.slice?r.parseSlice(ZY(e),n.parseOptions).content:r.parse(ZY(e),n.parseOptions)}return JY("",t,n)}function QY(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function eX(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,a=t?vY(t,e.schema):null,l=[];e.doc.nodesBetween(r,o,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);l.push({node:e,from:n,to:i})}));const s=o-r,c=l.filter((e=>!a||a.name===e.node.type.name)).filter((e=>FY(e.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=s}function tX(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function nX(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function rX(e,t,n={}){return JY(e,t,{slice:!1,parseOptions:n})}function oX(e,t){const n=WY(t,e.schema),{from:r,to:o,empty:i}=e.selection,a=[];i?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,(e=>{a.push(...e.marks)}));const l=a.find((e=>e.type.name===n.name));return l?{...l.attrs}:{}}function iX(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function aX(e){return t=>iX(t.$from,e)}function lX(e,t){const n=tX("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=vY(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,(e=>{i.push(e)}));const a=i.reverse().find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}(e,t):"mark"===n?oX(e,t):{}}function sX(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>!t.filter(((e,t)=>t!==n)).some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))))}function cX(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=UY(n.resolve(e-1),t.type);o&&r.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function uX(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function dX(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?WY(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!i||i.name===e.type.name)).find((e=>FY(e.attrs,n,{strict:!1})));let a=0;const l=[];if(o.forEach((({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a+=i-n,l.push(...e.marks.map((e=>({mark:e,from:n,to:i}))))}))})),0===a)return!1;const s=l.filter((e=>!i||i.name===e.mark.type.name)).filter((e=>FY(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=l.filter((e=>!i||e.mark.type!==i&&e.mark.type.excludes(i))).reduce(((e,t)=>e+t.to-t.from),0);return(s>0?s+c:s)>=a}function pX(e,t){const{nodeExtensions:n}=hY(t),r=n.find((t=>t.name===e));if(!r)return!1;const o=wY(fY(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function fX(e,t,n){const r=e.state.doc.content.size,o=KY(t,0,r),i=KY(n,0,r),a=e.coordsAtPos(o),l=e.coordsAtPos(i,-1),s=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),u=Math.min(a.left,l.left),d=Math.max(a.right,l.right),p={top:s,bottom:c,left:u,right:d,width:d-u,height:c-s,x:u,y:s};return{...p,toJSON:()=>p}}function hX(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}const mX=(e,t)=>{const n=aX((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!RU(e.doc,n.pos)||(e.join(n.pos),!0)},vX=(e,t)=>{const n=aX((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!RU(e.doc,r)||(e.join(r),!0)};var gX=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),a=r.resolve(o.map(n+e.nodeSize)),l=i.blockRange(a);if(!l)return;const s=PU(l);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(l.start,e)}(s||0===s)&&t.lift(l,s)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof pW||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=nY(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=e.tr.insert(n,i.createAndFill());a.setSelection(sW.create(a.doc,n+1)),t(a.scrollIntoView())}return!0})(e,t),cut:(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,i.content),r.setSelection(new sW(r.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1){if(o.node(i).type===r.type){if(t){const t=o.before(i),n=o.after(i);e.delete(t,n).scrollIntoView()}return!0}}return!1},deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const o=vY(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1){if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),a=nY(o.contentMatchAt(i));if(!a||!o.canReplaceWith(i,i,a))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,a.createAndFill());o.setSelection(oW.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const i=WY(e,r.schema),{doc:a,selection:l}=n,{$from:s,from:c,to:u}=l;if(o){const e=UY(s,i,t);if(e&&e.from<=c&&e.to>=u){const t=sW.create(a,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const a=()=>{YY()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(i&&null===e&&!qY(n.state.selection))return a(),!0;const l=GY(o.doc,e)||n.state.selection,s=n.state.selection.eq(l);return i&&(s||o.setSelection(l),s&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const o=JY(t,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:a,to:l}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},s=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((e=>{e.check(),s=!!s&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),a===l&&c){const{parent:e}=r.doc.resolve(a);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(a-=1,l+=1)}let u;s?(u=Array.isArray(t)?t.map((e=>e.text||"")).join(""):"object"==typeof t&&t&&t.text?t.text:t,r.insertText(u,a,l)):(u=o,r.replaceWith(a,l,u)),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof TU||o instanceof VU))return;const i=e.mapping.maps[r];let a=0;i.forEach(((e,t,n,r)=>{0===a&&(a=r)})),e.setSelection(oW.near(e.doc.resolve(a),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:u}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:u})}return!0},joinUp:()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof uW;if(o){if(r.node.isTextblock||!RU(e.doc,r.from))return!1;n=r.from}else if(n=FU(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(uW.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),joinDown:()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof uW){if(r.node.isTextblock||!RU(e.doc,r.to))return!1;n=r.to}else if(n=FU(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=XG(e,n);if(!r)return!1;let o=QG(r);if(!o){let n=r.blockRange(),o=n&&PU(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&rY(e,o,t))return!0;if(0==r.parent.content.size&&(JG(i,"end")||uW.isSelectable(i))){let n=HU(e.doc,r.before(),r.after(),kH.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(JG(i,"end")?oW.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):uW.create(r.doc,o.pos-i.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=eY(e,n);if(!r)return!1;let o=tY(r);if(!o)return!1;let i=o.nodeAfter;if(rY(e,o,t))return!0;if(0==r.parent.content.size&&(JG(i,"start")||uW.isSelectable(i))){let n=HU(e.doc,r.before(),r.after(),kH.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(JG(i,"start")?oW.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):uW.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(e,t),joinItemBackward:()=>({tr:e,state:t,dispatch:n})=>{try{const r=FU(t.doc,t.selection.$from.pos,-1);return null!=r&&(e.join(r,2),n&&n(e),!0)}catch{return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:n})=>{try{const r=FU(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch(r){return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=XG(e,n);if(!r)return!1;let o=QG(r);return!!o&&ZG(e,o,t)})(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=eY(e,n);if(!r)return!1;let o=tY(r);return!!o&&ZG(e,o,t)})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,a=t[t.length-1];"Space"===a&&(a=" ");for(let l=0;l<t.length-1;l+=1){const e=t[l];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))n=!0;else if(/^(c|ctrl|control)$/i.test(e))r=!0;else if(/^s(hift)?$/i.test(e))o=!0;else{if(!/^mod$/i.test(e))throw new Error(`Unrecognized modifier name: ${e}`);YY()||QY()?i=!0:r=!0}}return n&&(a=`Alt-${a}`),r&&(a=`Ctrl-${a}`),i&&(a=`Meta-${a}`),o&&(a=`Shift-${a}`),a}(e).split(/-(?!$)/),a=i.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),l=new KeyboardEvent("keydown",{key:"Space"===a?" ":a,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,l)))}));return null==s||s.steps.forEach((e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!eX(n,vY(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&PU(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(LU(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&PU(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>cY(vY(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,a=null;const l=tX("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(i=vY(e,r.schema)),"mark"===l&&(a=WY(e,r.schema)),o&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,nX(e.attrs,t)),a&&e.marks.length&&e.marks.forEach((o=>{a===o.type&&n.addMark(r,r+e.nodeSize,a.create(nX(o.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=QG(r)}let a=i&&i.nodeBefore;return!(!a||!uW.isSelectable(a)||(t&&t(e.tr.setSelection(uW.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=tY(r)}let a=i&&i.nodeAfter;return!(!a||!uW.isSelectable(a)||(t&&t(e.tr.setSelection(uW.create(e.doc,i.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(uW.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>aY(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>iY(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:a}=r,l=rX(e,o.schema,n);return i&&r.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:a,ranges:l}=i,s=WY(e,r.schema);if(o)if(a){const e=oX(r,s);n.addStoredMark(s.create({...e,...t}))}else l.forEach((e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,((e,r)=>{const a=Math.max(r,o),l=Math.min(r+e.nodeSize,i);e.marks.find((e=>e.type===s))?e.marks.forEach((e=>{s===e.type&&n.addMark(a,l,s.create({...e.attrs,...t}))})):n.addMark(a,l,s.create(t))}))}));return function(e,t,n){var r;const{selection:o}=t;let i=null;if(qY(o)&&(i=o.$cursor),i){const t=null!==(r=e.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(t)||!t.some((e=>e.type.excludes(n)))}const{ranges:a}=o;return a.some((({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(o)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));o=t&&i}return!o})),o}))}(r,n,s)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=vY(e,n.schema);return i.isTextblock?o().command((({commands:e})=>!!lY(i,t)(n)||e.clearNodes())).command((({state:e})=>lY(i,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=KY(e,0,n.content.size),o=uW.create(n,r);t.setSelection(o)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=sW.atStart(n).from,a=sW.atEnd(n).to,l=KY(r,i,a),s=KY(o,i,a),c=sW.create(n,l,s);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=vY(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==o));if(!i)return!1;let a=i.startIndex;if(0==a)return!1;let l=i.parent,s=l.child(a-1);if(s.type!=o)return!1;if(t){let n=s.lastChild&&s.lastChild.type==l.type,r=mH.from(n?o.create():null),a=new kH(mH.from(o.create(null,mH.from(l.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;t(e.tr.step(new VU(c-(n?3:1),u,c,u,a,1,!0)).scrollIntoView())}return!0})(t,n);var o},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:a}=t,{$from:l,$to:s}=i,c=uX(o.extensionManager.attributes,l.node().type.name,l.node().attrs);if(i instanceof uW&&i.node.isBlock)return!(!l.parentOffset||!LU(a,l.pos))&&(r&&(e&&hX(n,o.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const r=s.parentOffset===s.parent.content.size;i instanceof sW&&t.deleteSelection();const a=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let u=r&&a?[{type:a,attrs:c}]:void 0,d=LU(t.doc,t.mapping.map(l.pos),1,u);if(u||d||!LU(t.doc,t.mapping.map(l.pos),1,a?[{type:a}]:void 0)||(d=!0,u=a?[{type:a,attrs:c}]:void 0),d&&(t.split(t.mapping.map(l.pos),1,u),a&&!r&&!l.parentOffset&&l.parent.type!==a)){const e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,a)&&t.setNodeMarkup(t.mapping.map(l.before()),a)}e&&hX(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const a=vY(e,n.schema),{$from:l,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(s))return!1;const u=l.node(-1);if(u.type!==a)return!1;const d=o.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let e=mH.empty;const n=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-n;t>=l.depth-3;t-=1)e=mH.from(l.node(t).copy(e));const r=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,o=uX(d,l.node().type.name,l.node().attrs),s=(null===(i=a.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;e=e.append(mH.from(a.createAndFill(null,s)||void 0));const c=l.before(l.depth-(n-1));t.replace(c,l.after(-r),new kH(e,4-n,0));let u=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&t.setSelection(sW.near(t.doc.resolve(u))),t.scrollIntoView()}return!0}const p=s.pos===l.end()?u.contentMatchAt(0).defaultType:null,f=uX(d,u.type.name,u.attrs),h=uX(d,l.node().type.name,l.node().attrs);t.delete(l.pos,s.pos);const m=p?[{type:a,attrs:f},{type:p,attrs:h}]:[{type:a,attrs:f}];if(!LU(t.doc,l.pos,2))return!1;if(r){const{selection:e,storedMarks:i}=n,{splittableMarks:a}=o.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();if(t.split(l.pos,2,m).scrollIntoView(),!s||!r)return!0;const c=s.filter((e=>a.includes(e.type.name)));t.ensureMarks(c)}return!0},toggleList:(e,t,n,r={})=>({editor:o,tr:i,state:a,dispatch:l,chain:s,commands:c,can:u})=>{const{extensions:d,splittableMarks:p}=o.extensionManager,f=vY(e,a.schema),h=vY(t,a.schema),{selection:m,storedMarks:v}=a,{$from:g,$to:b}=m,y=g.blockRange(b),w=v||m.$to.parentOffset&&m.$from.marks();if(!y)return!1;const k=aX((e=>pX(e.type.name,d)))(m);if(y.depth>=1&&k&&y.depth-k.depth<=1){if(k.node.type===f)return c.liftListItem(h);if(pX(k.node.type.name,d)&&f.validContent(k.node.content)&&l)return s().command((()=>(i.setNodeMarkup(k.pos,f),!0))).command((()=>mX(i,f))).command((()=>vX(i,f))).run()}return n&&w&&l?s().command((()=>{const e=u().wrapInList(f,r),t=w.filter((e=>p.includes(e.type.name)));return i.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(f,r).command((()=>mX(i,f))).command((()=>vX(i,f))).run():s().command((()=>!!u().wrapInList(f,r)||c.clearNodes())).wrapInList(f,r).command((()=>mX(i,f))).command((()=>vX(i,f))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,a=WY(e,r.schema);return dX(r,a,t)?o.unsetMark(a,{extendEmptyMarkRange:i}):o.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:o})=>{const i=vY(e,r.schema),a=vY(t,r.schema);return eX(r,i,n)?o.setNode(a):o.setNode(i,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const o=vY(e,n.schema);return eX(n,o,t)?r.lift(o):r.wrapIn(o,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:a=!1}=t,{selection:l}=n,s=WY(e,r.schema),{$from:c,empty:u,ranges:d}=l;if(!o)return!0;if(u&&a){let{from:e,to:t}=l;const r=null===(i=c.marks().find((e=>e.type===s)))||void 0===i?void 0:i.attrs,o=UY(c,s,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,s)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,s)}));return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,a=null;const l=tX("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(i=vY(e,r.schema)),"mark"===l&&(a=WY(e,r.schema)),o&&n.selection.ranges.forEach((e=>{const o=e.$from.pos,l=e.$to.pos;r.doc.nodesBetween(o,l,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),a&&e.marks.length&&e.marks.forEach((i=>{if(a===i.type){const s=Math.max(r,o),c=Math.min(r+e.nodeSize,l);n.addMark(s,c,a.create({...i.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,a=o.blockRange(i),l=a&&IU(a,e,t);return!!l&&(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0)}}(vY(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>sY(vY(e,n.schema),t)(n,r)});const bX=DY.create({name:"commands",addCommands:()=>({...gX})}),yX=DY.create({name:"editable",addProseMirrorPlugins(){return[new CW({key:new EW("editable"),props:{editable:()=>this.editor.options.editable}})]}}),wX=DY.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new CW({key:new EW("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),kX=DY.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:a,parent:l}=i,s=i.parent.isTextblock&&a>0?t.doc.resolve(a-1):i,c=s.parent.type.spec.isolating,u=i.pos-i.parentOffset,d=c&&1===s.parent.childCount?u===i.pos:oW.atStart(r).from===a;return!(!(o&&d&&l.type.isTextblock)||l.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return YY()||QY()?o:r},addProseMirrorPlugins(){return[new CW({key:new EW("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=t.selection,a=oW.atStart(t.doc).from,l=oW.atEnd(t.doc).to;if(r||!(o===a&&i===l))return;if(!(0===n.doc.textBetween(0,n.doc.content.size," "," ").length))return;const s=n.tr,c=uY({state:n,transaction:s}),{commands:u}=new dY({editor:this.editor,state:c});return u.clearNodes(),s.steps.length?s:void 0}})]}}),xX=DY.create({name:"tabindex",addProseMirrorPlugins(){return[new CW({key:new EW("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class CX{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!==(e=this.actualDepth)&&void 0!==e?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new CX(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new CX(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new CX(e,this.editor)}get children(){const e=[];return this.node.content.forEach(((t,n)=>{const r=t.isBlock&&!t.isTextblock,o=this.pos+n+1,i=this.resolvedPos.doc.resolve(o);if(!r&&i.depth<=this.depth)return;const a=new CX(i,this.editor,r,r?t:null);r&&(a.actualDepth=this.depth+1),e.push(new CX(i,this.editor,r,r?t:null))})),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(t);return this.children.forEach((i=>{if(!(n&&r.length>0)){if(i.node.type.name===e){o.every((e=>t[e]===i.node.attrs[e]))&&r.push(i)}n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n)))}})),r}setAttribute(e){const t=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(t.from).run()}}let OX=class extends pY{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==r)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=yY(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[yX,zY.configure({blockSeparator:null===(t=null===(e=this.options.coreExtensionOptions)||void 0===e?void 0:e.clipboardTextSerializer)||void 0===t?void 0:t.blockSeparator}),bX,wX,kX,xX]:[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new BY(n,this)}createCommandManager(){this.commandManager=new dY({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=rX(this.options.content,this.schema,this.options.parseOptions),t=GY(e,this.options.autofocus);this.view=new BG(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:kW.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),o=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return lX(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return eX(e,null,n)||dX(e,null,n);const r=tX(t,e.schema);return"node"===r?eX(e,t,n):"mark"===r&&dX(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=mU.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return LY(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...RY(this.schema),...n}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}$node(e,t){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new CX(t,this)}get $doc(){return this.$pos(0)}};function SX(e){return new NY({find:e.find,handler:({state:t,range:n,match:r})=>{const o=wY(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,a=r[r.length-1],l=r[0];if(a){const r=l.search(/\S/),s=n.from+l.indexOf(a),c=s+a.length;if(cX(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>s)).length)return null;c<n.to&&i.delete(c,n.to),s>n.from&&i.delete(n.from+r,s);const u=n.from+r+a.length;i.addMark(n.from+r,u,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function EX(e){return new NY({find:e.find,handler:({state:t,range:n,match:r})=>{const o=wY(e.getAttributes,void 0,r)||{},{tr:i}=t,a=n.from;let l=n.to;const s=e.type.create(o);if(r[1]){let e=a+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,a+r[0].length-1),i.replaceWith(e,l,s)}else r[0]&&i.insert(a-1,e.type.create(o)).delete(i.mapping.map(a),i.mapping.map(l));i.scrollIntoView()}})}function NX(e){return new NY({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=wY(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}function _X(e){return new NY({find:e.find,handler:({state:t,range:n,match:r})=>{let o=e.replace,i=n.from;const a=n.to;if(r[1]){const e=r[0].lastIndexOf(r[1]);o+=r[0].slice(e+r[1].length),i+=e;const t=i-a;t>0&&(o=r[0].slice(e-t,e)+o,i=a)}t.tr.insertText(o,i,a)}})}function MX(e){return new NY({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const i=wY(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),s=l&&IU(l,e.type,i);if(!s)return null;if(a.wrap(l,s),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){const e=i.filter((e=>o.includes(e.type.name)));a.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,i).run()}const c=a.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&RU(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&a.join(n.from-1)}})}class AX{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wY(fY(this,"addOptions",{name:this.name}))),this.storage=wY(fY(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new AX(e)}configure(e={}){const t=this.extend();return t.options=IY(this.options,e),t.storage=wY(fY(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new AX({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=wY(fY(t,"addOptions",{name:t.name})),t.storage=wY(fY(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const i=o.find((e=>(null==e?void 0:e.type.name)===t.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}let TX=class e{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wY(fY(this,"addOptions",{name:this.name}))),this.storage=wY(fY(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new e(t)}configure(e={}){const t=this.extend();return t.options=IY(this.options,e),t.storage=wY(fY(t,"addStorage",{name:t.name,options:t.options})),t}extend(t={}){const n=new e({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=wY(fY(n,"addOptions",{name:n.name})),n.storage=wY(fY(n,"addStorage",{name:n.name,options:n.options})),n}};let VX=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,o,i,a,l;const{view:s}=this.editor,c=e.target,u=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!u)return;let d=0,p=0;if(this.dom!==u){const t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),l=null!==(r=e.offsetX)&&void 0!==r?r:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,s=null!==(i=e.offsetY)&&void 0!==i?i:null===(a=e.nativeEvent)||void 0===a?void 0:a.offsetY;d=n.x-t.x+l,p=n.y-t.y+s}null===(l=e.dataTransfer)||void 0===l||l.setDragImage(this.dom,d,p);const f=uW.create(s.state.doc,this.getPos()),h=s.state.tr.setSelection(f);s.dispatch(h)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r=e.type.startsWith("drag"),o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,s=uW.isSelectable(this.node),c="copy"===e.type,u="paste"===e.type,d="cut"===e.type,p="mousedown"===e.type;if(!l&&s&&r&&e.preventDefault(),l&&r&&!a)return e.preventDefault(),!1;if(l&&i&&!a&&p){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("drop",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(a||o||c||u||d||p&&s)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&(YY()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function jX(e){return new TY({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=wY(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;const{tr:a}=t,l=r[r.length-1],s=r[0];let c=n.to;if(l){const r=s.search(/\S/),o=n.from+s.indexOf(l),u=o+l.length;if(cX(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>o)).length)return null;u<n.to&&a.delete(u,n.to),o>n.from&&a.delete(n.from+r,o),c=n.from+r+l.length,a.addMark(n.from+r,c,e.type.create(i||{})),a.removeStoredMark(e.type)}}})}var BX="tippy-content",PX="tippy-backdrop",IX="tippy-arrow",DX="tippy-svg-arrow",LX={passive:!0,capture:!0},RX=function(){return document.body};function zX(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function FX(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function $X(e,t){return"function"==typeof e?e.apply(void 0,t):e}function HX(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function UX(e){return[].concat(e)}function WX(e,t){-1===e.indexOf(t)&&e.push(t)}function qX(e){return[].slice.call(e)}function KX(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function GX(){return document.createElement("div")}function YX(e){return["Element","Fragment"].some((function(t){return FX(e,t)}))}function XX(e){return YX(e)?[e]:function(e){return FX(e,"NodeList")}(e)?qX(e):Array.isArray(e)?e:qX(document.querySelectorAll(e))}function ZX(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function JX(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function QX(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function eZ(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var tZ={isTouch:!1},nZ=0;function rZ(){tZ.isTouch||(tZ.isTouch=!0,window.performance&&document.addEventListener("mousemove",oZ))}function oZ(){var e=performance.now();e-nZ<20&&(tZ.isTouch=!1,document.removeEventListener("mousemove",oZ)),nZ=e}function iZ(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var aZ=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,lZ=Object.assign({appendTo:RX,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),sZ=Object.keys(lZ);function cZ(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=lZ[o])?r:i);return t}),{});return Object.assign({},e,t)}function uZ(e,t){var n=Object.assign({},t,{content:$X(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(cZ(Object.assign({},lZ,{plugins:t}))):sZ).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(o){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},lZ.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var dZ=function(){return"innerHTML"};function pZ(e,t){e[dZ()]=t}function fZ(e){var t=GX();return!0===e?t.className=IX:(t.className=DX,YX(e)?t.appendChild(e):pZ(t,e)),t}function hZ(e,t){YX(t.content)?(pZ(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?pZ(e,t.content):e.textContent=t.content)}function mZ(e){var t=e.firstElementChild,n=qX(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(BX)})),arrow:n.find((function(e){return e.classList.contains(IX)||e.classList.contains(DX)})),backdrop:n.find((function(e){return e.classList.contains(PX)}))}}function vZ(e){var t=GX(),n=GX();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=GX();function o(n,r){var o=mZ(t),i=o.box,a=o.content,l=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||hZ(a,e.props),r.arrow?l?n.arrow!==r.arrow&&(i.removeChild(l),i.appendChild(fZ(r.arrow))):i.appendChild(fZ(r.arrow)):l&&i.removeChild(l)}return r.className=BX,r.setAttribute("data-state","hidden"),hZ(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}vZ.$$tippy=!0;var gZ=1,bZ=[],yZ=[];function wZ(e,t){var n,r,o,i,a,l,s,c,u=uZ(e,Object.assign({},lZ,cZ(KX(t)))),d=!1,p=!1,f=!1,h=!1,m=[],v=HX(K,u.interactiveDebounce),g=gZ++,b=(c=u.plugins).filter((function(e,t){return c.indexOf(e)===t})),y={id:g,reference:e,popper:GX(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){if(y.state.isDestroyed)return;j("onBeforeUpdate",[y,t]),W();var n=y.props,r=uZ(e,Object.assign({},n,KX(t),{ignoreAttributes:!0}));y.props=r,U(),n.interactiveDebounce!==r.interactiveDebounce&&(I(),v=HX(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?UX(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");P(),V(),x&&x(n,r);y.popperInstance&&(Z(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));j("onAfterUpdate",[y,t])},setContent:function(e){y.setProps({content:e})},show:function(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=tZ.isTouch&&!y.props.touch,o=zX(y.props.duration,0,lZ.duration);if(e||t||n||r)return;if(_().hasAttribute("disabled"))return;if(j("onShow",[y],!1),!1===y.props.onShow(y))return;y.state.isVisible=!0,N()&&(k.style.visibility="visible");V(),z(),y.state.isMounted||(k.style.transition="none");if(N()){var i=A();ZX([i.box,i.content],0)}l=function(){var e;if(y.state.isVisible&&!h){if(h=!0,k.offsetHeight,k.style.transition=y.props.moveTransition,N()&&y.props.animation){var t=A(),n=t.box,r=t.content;ZX([n,r],o),JX([n,r],"visible")}B(),P(),WX(yZ,y),null==(e=y.popperInstance)||e.forceUpdate(),j("onMount",[y]),y.props.animation&&N()&&function(e,t){$(e,t)}(o,(function(){y.state.isShown=!0,j("onShown",[y])}))}},function(){var e,t=y.props.appendTo,n=_();e=y.props.interactive&&t===RX||"parent"===t?n.parentNode:$X(t,[n]);e.contains(k)||e.appendChild(k);y.state.isMounted=!0,Z()}()},hide:function(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=zX(y.props.duration,1,lZ.duration);if(e||t||n)return;if(j("onHide",[y],!1),!1===y.props.onHide(y))return;y.state.isVisible=!1,y.state.isShown=!1,h=!1,d=!1,N()&&(k.style.visibility="hidden");if(I(),F(),V(!0),N()){var o=A(),i=o.box,a=o.content;y.props.animation&&(ZX([i,a],r),JX([i,a],"hidden"))}B(),P(),y.props.animation?N()&&function(e,t){$(e,(function(){!y.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&t()}))}(r,y.unmount):y.unmount()},hideWithInteractivity:function(e){M().addEventListener("mousemove",v),WX(bZ,v),v(e)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){y.state.isVisible&&y.hide();if(!y.state.isMounted)return;J(),Q().forEach((function(e){e._tippy.unmount()})),k.parentNode&&k.parentNode.removeChild(k);yZ=yZ.filter((function(e){return e!==y})),y.state.isMounted=!1,j("onHidden",[y])},destroy:function(){if(y.state.isDestroyed)return;y.clearDelayTimeouts(),y.unmount(),W(),delete e._tippy,y.state.isDestroyed=!0,j("onDestroy",[y])}};if(!u.render)return y;var w=u.render(y),k=w.popper,x=w.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+y.id,y.popper=k,e._tippy=y,k._tippy=y;var C=b.map((function(e){return e.fn(y)})),O=e.hasAttribute("aria-expanded");return U(),P(),V(),j("onCreate",[y]),u.showOnCreate&&ee(),k.addEventListener("mouseenter",(function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()})),k.addEventListener("mouseleave",(function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&M().addEventListener("mousemove",v)})),y;function S(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return"hold"===S()[0]}function N(){var e;return!(null==(e=y.props.render)||!e.$$tippy)}function _(){return s||e}function M(){var e,t,n=_().parentNode;return n?null!=(t=UX(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function A(){return mZ(k)}function T(e){return y.state.isMounted&&!y.state.isVisible||tZ.isTouch||i&&"focus"===i.type?0:zX(y.props.delay,e?0:1,lZ.delay)}function V(e){void 0===e&&(e=!1),k.style.pointerEvents=y.props.interactive&&!e?"":"none",k.style.zIndex=""+y.props.zIndex}function j(e,t,n){var r;(void 0===n&&(n=!0),C.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=y.props)[e].apply(r,t)}function B(){var t=y.props.aria;if(t.content){var n="aria-"+t.content,r=k.id;UX(y.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function P(){!O&&y.props.aria.expanded&&UX(y.props.triggerTarget||e).forEach((function(e){y.props.interactive?e.setAttribute("aria-expanded",y.state.isVisible&&e===_()?"true":"false"):e.removeAttribute("aria-expanded")}))}function I(){M().removeEventListener("mousemove",v),bZ=bZ.filter((function(e){return e!==v}))}function D(t){if(!tZ.isTouch||!f&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!y.props.interactive||!eZ(k,n)){if(UX(y.props.triggerTarget||e).some((function(e){return eZ(e,n)}))){if(tZ.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[y,t]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),p=!0,setTimeout((function(){p=!1})),y.state.isMounted||F())}}}function L(){f=!0}function R(){f=!1}function z(){var e=M();e.addEventListener("mousedown",D,!0),e.addEventListener("touchend",D,LX),e.addEventListener("touchstart",R,LX),e.addEventListener("touchmove",L,LX)}function F(){var e=M();e.removeEventListener("mousedown",D,!0),e.removeEventListener("touchend",D,LX),e.removeEventListener("touchstart",R,LX),e.removeEventListener("touchmove",L,LX)}function $(e,t){var n=A().box;function r(e){e.target===n&&(QX(n,"remove",r),t())}if(0===e)return t();QX(n,"remove",a),QX(n,"add",r),a=r}function H(t,n,r){void 0===r&&(r=!1),UX(y.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function U(){var e;E()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=y.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(aZ?"focusout":"blur",Y);break;case"focusin":H("focusout",Y)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),m=[]}function q(e){var t,n=!1;if(y.state.isEnabled&&!X(e)&&!p){var r="focus"===(null==(t=i)?void 0:t.type);i=e,s=e.currentTarget,P(),!y.state.isVisible&&FX(e,"MouseEvent")&&bZ.forEach((function(t){return t(e)})),"click"===e.type&&(y.props.trigger.indexOf("mouseenter")<0||d)&&!1!==y.props.hideOnClick&&y.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function K(e){var t=e.target,n=_().contains(t)||k.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=o.placement.split("-")[0],l=o.modifiersData.offset;if(!l)return!0;var s="bottom"===a?l.top.y:0,c="top"===a?l.bottom.y:0,u="right"===a?l.left.x:0,d="left"===a?l.right.x:0,p=t.top-r+s>i,f=r-t.bottom-c>i,h=t.left-n+u>i,m=n-t.right-d>i;return p||f||h||m}))}(Q().concat(k).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean),e)&&(I(),te(e))}function G(e){X(e)||y.props.trigger.indexOf("click")>=0&&d||(y.props.interactive?y.hideWithInteractivity(e):te(e))}function Y(e){y.props.trigger.indexOf("focusin")<0&&e.target!==_()||y.props.interactive&&e.relatedTarget&&k.contains(e.relatedTarget)||te(e)}function X(e){return!!tZ.isTouch&&E()!==e.type.indexOf("touch")>=0}function Z(){J();var t=y.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,s=N()?mZ(k).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||_()}:e,u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(N()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];N()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),y.popperInstance=pm(c,k,Object.assign({},n,{placement:r,onFirstUpdate:l,modifiers:u}))}function J(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Q(){return qX(k.querySelectorAll("[data-tippy-root]"))}function ee(e){y.clearDelayTimeouts(),e&&j("onTrigger",[y,e]),z();var t=T(!0),r=S(),o=r[0],i=r[1];tZ.isTouch&&"hold"===o&&i&&(t=i),t?n=setTimeout((function(){y.show()}),t):y.show()}function te(e){if(y.clearDelayTimeouts(),j("onUntrigger",[y,e]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=T(!1);t?r=setTimeout((function(){y.state.isVisible&&y.hide()}),t):o=requestAnimationFrame((function(){y.hide()}))}}else F()}}function kZ(e,t){void 0===t&&(t={});var n=lZ.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",rZ,LX),window.addEventListener("blur",iZ);var r=Object.assign({},t,{plugins:n}),o=XX(e).reduce((function(e,t){var n=t&&wZ(t,r);return n&&e.push(n),e}),[]);return YX(e)?o[0]:o}kZ.defaultProps=lZ,kZ.setDefaultProps=function(e){Object.keys(e).forEach((function(t){lZ[t]=e[t]}))},kZ.currentInput=tZ,Object.assign({},kh,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),kZ.setDefaultProps({render:vZ});class xZ{constructor({editor:e,element:t,view:n,tippyOptions:r={},updateDelay:o=250,shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:o,selection:i}=t,{empty:a}=i,l=!o.textBetween(n,r).length&&qY(t.selection),s=this.element.contains(document.activeElement);return!(!e.hasFocus()&&!s||a||l||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.handleDebouncedUpdate=(e,t)=>{const n=!(null==t?void 0:t.selection.eq(e.state.selection)),r=!(null==t?void 0:t.doc.eq(e.state.doc));(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout((()=>{this.updateHandler(e,n,r,t)}),this.updateDelay))},this.updateHandler=(e,t,n,r)=>{var o,i,a;const{state:l,composing:s}=e,{selection:c}=l;if(s||!t&&!n)return;this.createTooltip();const{ranges:u}=c,d=Math.min(...u.map((e=>e.$from.pos))),p=Math.max(...u.map((e=>e.$to.pos)));(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:e,state:l,oldState:r,from:d,to:p}))?(null===(i=this.tippy)||void 0===i||i.setProps({getReferenceClientRect:(null===(a=this.tippyOptions)||void 0===a?void 0:a.getReferenceClientRect)||(()=>{if(l.selection instanceof uW){let t=e.nodeDOM(d);const n=t.dataset.nodeViewWrapper?t:t.querySelector("[data-node-view-wrapper]");if(n&&(t=n.firstChild),t)return t.getBoundingClientRect()}return fX(e,d,p)})}),this.show()):this.hide()},this.editor=e,this.element=t,this.view=n,this.updateDelay=o,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=kZ(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:n}=e,r=n.selection.$from.pos!==n.selection.$to.pos;if(this.updateDelay>0&&r)return void this.handleDebouncedUpdate(e,t);const o=!(null==t?void 0:t.selection.eq(e.state.selection)),i=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,o,i,t)}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e,t;(null===(e=this.tippy)||void 0===e?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const CZ=e=>new CW({key:"string"==typeof e.pluginKey?new EW(e.pluginKey):e.pluginKey,view:t=>new xZ({view:t,...e})});DY.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[CZ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class OZ{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:o}=n,i=1===r.depth,a=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&o&&i&&a&&this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.editor=e,this.element=t,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=kZ(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){var n,r,o;const{state:i}=e,{doc:a,selection:l}=i,{from:s,to:c}=l;if(t&&t.doc.eq(a)&&t.selection.eq(l))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>fX(e,s,c))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e,t;(null===(e=this.tippy)||void 0===e?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const SZ=e=>new CW({key:"string"==typeof e.pluginKey?new EW(e.pluginKey):e.pluginKey,view:t=>new OZ({view:t,...e})});DY.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[SZ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const EZ=t.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:n}){const r=t.ref(null);return t.onMounted((()=>{const{updateDelay:t,editor:n,pluginKey:o,shouldShow:i,tippyOptions:a}=e;n.registerPlugin(CZ({updateDelay:t,editor:n,element:r.value,pluginKey:o,shouldShow:i,tippyOptions:a}))})),t.onBeforeUnmount((()=>{const{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)})),()=>{var e;return t.h("div",{ref:r},null===(e=n.default)||void 0===e?void 0:e.call(n))}}});function NZ(e){return t.customRef(((t,n)=>({get:()=>(t(),e),set(t){e=t,requestAnimationFrame((()=>{requestAnimationFrame((()=>{n()}))}))}})))}class _Z extends OX{constructor(e={}){return super(e),this.vueRenderers=t.reactive(new Map),this.contentComponent=null,this.reactiveState=NZ(this.view.state),this.reactiveExtensionStorage=NZ(this.extensionStorage),this.on("transaction",(()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage})),t.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const MZ=t.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const n=t.ref(),r=t.getCurrentInstance();return t.watchEffect((()=>{const o=e.editor;o&&o.options.element&&n.value&&t.nextTick((()=>{if(!n.value||!o.options.element.firstChild)return;const e=t.unref(n.value);n.value.append(...o.options.element.childNodes),o.contentComponent=r.ctx._,o.setOptions({element:e}),o.createNodeViews()}))})),t.onBeforeUnmount((()=>{const t=e.editor;if(!t)return;if(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild)return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})})),{rootEl:n}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach((n=>{const r=t.h(t.Teleport,{to:n.teleportElement,key:n.id},t.h(n.component,{ref:n.id,...n.props}));e.push(r)})),t.h("div",{ref:e=>{this.rootEl=e}},...e)}});t.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:n}){const r=t.ref(null);return t.onMounted((()=>{const{pluginKey:t,editor:n,tippyOptions:o,shouldShow:i}=e;n.registerPlugin(SZ({pluginKey:t,editor:n,element:r.value,tippyOptions:o,shouldShow:i}))})),t.onBeforeUnmount((()=>{const{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)})),()=>{var e;return t.h("div",{ref:r},null===(e=n.default)||void 0===e?void 0:e.call(n))}}});const AZ=t.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return t.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),TZ=t.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,n;return t.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},null===(n=(e=this.$slots).default)||void 0===n?void 0:n.call(e))}});class VZ{constructor(e,{props:n={},editor:r}){if(this.id=Math.floor(4294967295*Math.random()).toString(),this.editor=r,this.component=t.markRaw(e),this.teleportElement=document.createElement("div"),this.element=this.teleportElement,this.props=t.reactive(n),this.editor.vueRenderers.set(this.id,this),this.editor.contentComponent){if(this.editor.contentComponent.update(),1!==this.teleportElement.children.length)throw Error("VueRenderer doesn’t support multiple child elements.");this.element=this.teleportElement.firstElementChild}}get ref(){var e;return null===(e=this.editor.contentComponent)||void 0===e?void 0:e.refs[this.id]}updateProps(e={}){Object.entries(e).forEach((([e,t])=>{this.props[e]=t}))}destroy(){this.editor.vueRenderers.delete(this.id)}}const jZ={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}};class BZ extends VX{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=t.ref(this.getDecorationClasses());const r=t.defineComponent({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:e=>{var r,o;return t.provide("onDragStart",n),t.provide("decorationClasses",this.decorationClasses),null===(o=(r=this.component).setup)||void 0===o?void 0:o.call(r,e,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.renderer=new VZ(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){if(this.node.isLeaf)return null;return this.dom.querySelector("[data-node-view-content]")||this.dom}update(e,t){const n=e=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(e)};if("function"==typeof this.options.update){const r=this.node,o=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:o,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map((e=>e.type.attrs.class)).flat().join(" ")}destroy(){this.renderer.destroy()}}function PZ(e,t){return n=>n.editor.contentComponent?new BZ(e,n,t):{}}const IZ=/^\s*>\s$/,DZ=TX.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[MX({find:IZ,type:this.type})]}}),LZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,RZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,zZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,FZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,$Z=AX.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[SX({find:LZ,type:this.type}),SX({find:zZ,type:this.type})]},addPasteRules(){return[jX({find:RZ,type:this.type}),jX({find:FZ,type:this.type})]}}),HZ=TX.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",gY(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),UZ=AX.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=oX(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),WZ=/^\s*([-+*])\s$/,qZ=TX.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(HZ.name,this.editor.getAttributes(UZ.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=MX({find:WZ,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=MX({find:WZ,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(UZ.name),editor:this.editor})),[e]}}),KZ=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,GZ=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,YZ=AX.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[SX({find:KZ,type:this.type})]},addPasteRules(){return[jX({find:GZ,type:this.type})]}}),XZ=/^```([a-z]+)?[\s\n]$/,ZZ=/^~~~([a-z]+)?[\s\n]$/,JZ=TX.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",gY(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith("\n\n");return!(!i||!a)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();if(void 0===a)return!1;return!r.nodeAt(a)&&e.commands.exitCode()}}},addInputRules(){return[NX({find:XZ,type:this.type,getAttributes:e=>({language:e[1]})}),NX({find:ZZ,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new CW({key:new EW("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:a}=e.state;return e.state.selection.from===e.state.doc.nodeSize-(1+2*e.state.selection.$to.depth)?a.insert(e.state.selection.from-1,this.type.create({language:i})):a.replaceSelectionWith(this.type.create({language:i})),a.setSelection(sW.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,"\n")),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),QZ=TX.create({name:"doc",topNode:!0,content:"block+"});function eJ(e={}){return new CW({view:t=>new tJ(t,e)})}class tJ{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let r,o,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!i||i==document.body&&"static"==getComputedStyle(i).position)r=-pageXOffset,o=-pageYOffset;else{let e=i.getBoundingClientRect();r=e.left-i.scrollLeft,o=e.top-i.scrollTop}this.element.style.left=e.left-r+"px",this.element.style.top=e.top-o+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=$U(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const nJ=DY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[eJ(this.options)]}});class rJ extends oW{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return rJ.valid(n)?new rJ(n):oW.near(n)}content(){return kH.empty}eq(e){return e instanceof rJ&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new rJ(e.resolve(t.pos))}getBookmark(){return new oJ(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&rJ.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let a=e.doc.resolve(r);if(rJ.valid(a))return a}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!uW.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let a=e.doc.resolve(r);if(rJ.valid(a))return a}return null}}}rJ.prototype.visible=!1,rJ.findFrom=rJ.findGapCursorFrom,oW.jsonID("gapcursor",rJ);class oJ{constructor(e){this.pos=e}map(e){return new oJ(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return rJ.valid(t)?new rJ(t):oW.near(t)}}const iJ=YG({ArrowLeft:aJ("horiz",-1),ArrowRight:aJ("horiz",1),ArrowUp:aJ("vert",-1),ArrowDown:aJ("vert",1)});function aJ(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,a=t>0?i.$to:i.$from,l=i.empty;if(i instanceof sW){if(!o.endOfTextblock(n)||0==a.depth)return!1;l=!1,a=e.doc.resolve(t>0?a.after():a.before())}let s=rJ.findGapCursorFrom(a,t,l);return!!s&&(r&&r(e.tr.setSelection(new rJ(s))),!0)}}function lJ(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!rJ.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&uW.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new rJ(r))),!0)}function sJ(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof rJ))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=mH.empty;for(let a=r.length-1;a>=0;a--)o=mH.from(r[a].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new kH(o,0,0));return i.setSelection(sW.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function cJ(e){if(!(e.selection instanceof rJ))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",uG.create(e.doc,[lG.widget(e.selection.head,t,{key:"gapcursor"})])}const uJ=DY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new CW({props:{decorations:cJ,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&rJ.valid(n)?new rJ(n):null,handleClick:lJ,handleKeyDown:iJ,handleDOMEvents:{beforeinput:sJ}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=wY(fY(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),dJ=TX.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",gY(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=r.extensionManager,l=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&l&&i){const t=l.filter((e=>a.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),pJ=TX.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,gY(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>NX({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var fJ=200,hJ=function(){};hJ.prototype.append=function(e){return e.length?(e=hJ.from(e),!this.length&&e||e.length<fJ&&this.leafAppend(e)||this.length<fJ&&e.leafPrepend(this)||this.appendInner(e)):this},hJ.prototype.prepend=function(e){return e.length?hJ.from(e).append(this):this},hJ.prototype.appendInner=function(e){return new vJ(this,e)},hJ.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?hJ.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},hJ.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},hJ.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},hJ.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},hJ.from=function(e){return e instanceof hJ?e:e&&e.length?new mJ(e):hJ.empty};var mJ=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=fJ)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=fJ)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(hJ);hJ.empty=new mJ([]);var vJ=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(hJ);class gJ{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,a,l=e.tr,s=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new bJ(e.map));let t,o=e.step.map(n.slice(r));o&&l.maybeStep(o).doc&&(t=l.mapping.maps[l.mapping.maps.length-1],s.push(new bJ(t,void 0,void 0,s.length+c.length))),r--,t&&n.appendMap(t,r)}else l.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,a=new gJ(this.items.slice(0,o).append(c.reverse().concat(s)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:l,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let n,s=e.steps[c].invert(e.docs[c]),u=new bJ(e.mapping.maps[c],s,t);(n=l&&l.merge(u))&&(u=n,c?o.pop():a=a.slice(0,a.length-1)),o.push(u),t&&(i++,t=void 0),r||(l=u)}let s=i-n.depth;return s>wJ&&(a=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(a,s),i-=s),new gJ(a.append(o),i)}remapping(e,t){let n=new xU;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new gJ(this.items.append(e.map((e=>new bJ(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach((e=>{e.selection&&a--}),r);let l=t;this.items.forEach((t=>{let r=o.getMirror(--l);if(null==r)return;i=Math.min(i,r);let s=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(l+1,r));c&&a++,n.push(new bJ(s,i,c))}else n.push(new bJ(s))}),r);let s=[];for(let d=t;d<i;d++)s.push(new bJ(o.maps[d]));let c=this.items.slice(0,r).append(s).append(n),u=new gJ(c,a);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,a)=>{if(a>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),a=e&&e.getMap();if(n--,a&&t.appendMap(a,n),e){let l=i.selection&&i.selection.map(t.slice(n));l&&o++;let s,c=new bJ(a.invert(),e,l),u=r.length-1;(s=r.length&&r[u].merge(c))?r[u]=s:r.push(c)}}else i.map&&n--}),this.items.length,0),new gJ(hJ.from(r.reverse()),o)}}gJ.empty=new gJ(hJ.empty,0);class bJ{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new bJ(t.getMap().invert(),t,this.selection)}}}class yJ{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const wJ=20;function kJ(e){let t=[];return e.forEach(((e,n,r,o)=>t.push(r,o))),t}function xJ(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let CJ=!1,OJ=null;function SJ(e){let t=e.plugins;if(OJ!=t){CJ=!1,OJ=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){CJ=!0;break}}return CJ}const EJ=new EW("history"),NJ=new EW("closeHistory");function _J(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new CW({key:EJ,state:{init:()=>new yJ(gJ.empty,gJ.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(EJ);if(i)return i.historyState;n.getMeta(NJ)&&(e=new yJ(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(EJ))return a.getMeta(EJ).redo?new yJ(e.done.addTransform(n,void 0,r,SJ(t)),e.undone,kJ(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new yJ(e.done,e.undone.addTransform(n,void 0,r,SJ(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new yJ(e.done.rebased(n,o),e.undone.rebased(n,o),xJ(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new yJ(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),xJ(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!a&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=a?xJ(e.prevRanges,n.mapping):kJ(n.mapping.maps[n.steps.length-1]);return new yJ(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,SJ(t)),gJ.empty,l,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?AJ:"historyRedo"==n?TJ:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function MJ(e,t){return(n,r)=>{let o=EJ.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=SJ(t),o=EJ.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let a=i.selection.resolve(i.transform.doc),l=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),s=new yJ(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(a).setMeta(EJ,{redo:n,historyState:s})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const AJ=MJ(!1,!0),TJ=MJ(!0,!0),VJ=DY.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>AJ(e,t),redo:()=>({state:e,dispatch:t})=>TJ(e,t)}),addProseMirrorPlugins(){return[_J(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),jJ=TX.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",gY(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{$to:n}=t.selection,r=e();return 0===n.parentOffset?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(sW.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(uW.create(e.doc,t.pos)):e.setSelection(sW.create(e.doc,t.pos));else{const o=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();o&&(e.insert(r,o),e.setSelection(sW.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[EX({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),BJ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,PJ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,IJ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,DJ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,LJ=AX.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[SX({find:BJ,type:this.type}),SX({find:IJ,type:this.type})]},addPasteRules(){return[jX({find:PJ,type:this.type}),jX({find:DJ,type:this.type})]}}),RJ=TX.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",gY(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),zJ=TX.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",gY(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),FJ=AX.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=oX(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),$J=/^(\d+)\.\s$/,HJ=TX.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",gY(this.options.HTMLAttributes,n),0]:["ol",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zJ.name,this.editor.getAttributes(FJ.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=MX({find:$J,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=MX({find:$J,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(FJ.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),UJ=TX.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),WJ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,qJ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,KJ=AX.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){const e={};return QY()?e["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():e["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),e},addInputRules(){return[SX({find:WJ,type:this.type})]},addPasteRules(){return[jX({find:qJ,type:this.type})]}}),GJ=TX.create({name:"text",group:"inline"}),YJ=DY.create({name:"starterKit",addExtensions(){var e,t,n,r,o,i,a,l,s,c,u,d,p,f,h,m,v,g;const b=[];return!1!==this.options.blockquote&&b.push(DZ.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&b.push($Z.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&b.push(qZ.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&b.push(YZ.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&b.push(JZ.configure(null===(o=this.options)||void 0===o?void 0:o.codeBlock)),!1!==this.options.document&&b.push(QZ.configure(null===(i=this.options)||void 0===i?void 0:i.document)),!1!==this.options.dropcursor&&b.push(nJ.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&b.push(uJ.configure(null===(l=this.options)||void 0===l?void 0:l.gapcursor)),!1!==this.options.hardBreak&&b.push(dJ.configure(null===(s=this.options)||void 0===s?void 0:s.hardBreak)),!1!==this.options.heading&&b.push(pJ.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&b.push(VJ.configure(null===(u=this.options)||void 0===u?void 0:u.history)),!1!==this.options.horizontalRule&&b.push(jJ.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&b.push(LJ.configure(null===(p=this.options)||void 0===p?void 0:p.italic)),!1!==this.options.listItem&&b.push(RJ.configure(null===(f=this.options)||void 0===f?void 0:f.listItem)),!1!==this.options.orderedList&&b.push(HJ.configure(null===(h=this.options)||void 0===h?void 0:h.orderedList)),!1!==this.options.paragraph&&b.push(UJ.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&b.push(KJ.configure(null===(v=this.options)||void 0===v?void 0:v.strike)),!1!==this.options.text&&b.push(GJ.configure(null===(g=this.options)||void 0===g?void 0:g.text)),b}}),XJ=DY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new CW({key:new EW("placeholder"),props:{decorations:({doc:e,selection:t})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=t,i=[];if(!r)return null;const{firstChild:a}=e.content,l=a&&a.type.isLeaf,s=a&&a.isAtom,c=!!this.options.considerAnyAsEmpty||a&&a.type.name===(null===(n=e.type.contentMatch.defaultType)||void 0===n?void 0:n.name),u=e.content.childCount<=1&&a&&c&&a.nodeSize<=2&&(!l||!s);return e.descendants(((e,t)=>{const n=o>=t&&o<=t+e.nodeSize,r=!e.isLeaf&&!e.childCount;if((n||!this.options.showOnlyCurrent)&&r){const r=[this.options.emptyNodeClass];u&&r.push(this.options.emptyEditorClass);const o=lG.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(o)}return this.options.includeChildren})),uG.create(e,i)}}})]}}),ZJ=AX.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=oX(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),JJ=DY.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>{var t;return null===(t=e.style.fontFamily)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily.split(",").map((e=>CSS.escape(e.trim()))).join(", ")}`}:{}}}}]},addCommands:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),QJ=DY.create({name:"fontSize",addOptions:()=>({types:["textStyle"],defaultFontSize:"14px"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:this.options.defaultFontSize,parseHTML:e=>e.style.fontSize||this.options.defaultFontSize,renderHTML:e=>e.fontSize===this.options.defaultFontSize?{}:{style:`font-size: ${e.fontSize}`}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),eQ=AX.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),tQ=AX.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:e=>"sub"===e&&null}],renderHTML({HTMLAttributes:e}){return["sub",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),nQ=AX.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),rQ=DY.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),oQ=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,iQ=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,aQ=AX.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[SX({find:oQ,type:this.type})]},addPasteRules(){return[jX({find:iQ,type:this.type})]}}),lQ=qZ.extend({addAttributes(){var e;return{...null==(e=this.parent)?void 0:e.call(this),listStyleType:{default:"disc",parseHTML:e=>({listStyleType:e.style["list-style-type"]||"disc"}),renderHTML:({listStyleType:e})=>({style:`list-style-type: ${(null==e?void 0:e.listStyleType)||e}`})}}}}),sQ=HJ.extend({addAttributes(){var e;return{...null==(e=this.parent)?void 0:e.call(this),listStyleType:{default:"decimal",parseHTML:e=>({listStyleType:e.style["list-style-type"]||"decimal"}),renderHTML:({listStyleType:e})=>({style:`list-style-type: ${(null==e?void 0:e.listStyleType)||e}`})}}}}),cQ="indent-",uQ=DY.create({name:"indent",addOptions:()=>({types:["heading","listItem","taskItem","paragraph"],minLevel:0,maxLevel:8}),addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:null,renderHTML:e=>e.indent&&e.indent>this.options.minLevel?{class:`${cQ}${e.indent}`}:{},parseHTML:e=>{let t="";if(e.classList.forEach((e=>{0===e.indexOf(cQ)&&(t=e)})),t){const e=parseInt(t.slice(7),7);return e&&e>this.options.minLevel?e:null}return null}}}}]},addCommands(){const e=(e,t,n)=>{var r;const o=(null==(r=null==e?void 0:e.doc)?void 0:r.nodeAt(t))||null;if(o){const r=(o.attrs.indent||0)+n,{minLevel:i,maxLevel:a}=this.options;let l=r;if(r<i?l=i:r>a&&(l=a),l!==o.attrs.indent){const{indent:n,...r}=o.attrs,a=l>i?{...r,indent:l}:r;return e.setNodeMarkup(t,o.type,a,o.marks)}}return e},t=(t,n)=>{const{doc:r,selection:o}=t;if(r&&o&&(o instanceof sW||o instanceof pW)){const{from:i,to:a}=o;r.nodesBetween(i,a,((r,o)=>!this.options.types.includes(r.type.name)||(t=e(t,o,n),!1)))}return t},n=e=>()=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=r;return n=n.setSelection(i),!!(n=t(n,e)).docChanged&&(null==o||o(n),!0)};return{indent:n(1),outdent:n(-1)}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}}),dQ=DY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.every((n=>t.updateAttributes(n,{textAlign:e}))),unsetTextAlign:()=>({commands:e})=>this.options.types.every((t=>e.resetAttributes(t,"textAlign")))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}).extend({addOptions(){var e;return{...null==(e=this.parent)?void 0:e.call(this),types:["heading","paragraph"],alignments:["left","center","right","justify","distributed"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlignLast?"distributed":e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:"distributed"===e.textAlign?{style:"text-align-last: justify"}:{style:`text-align: ${e.textAlign}`}}}}]},addKeyboardShortcuts(){var e;return{...null==(e=this.parent)?void 0:e.call(this),"Mod-Shift-d":()=>this.editor.commands.setTextAlign("distributed")}}}),pQ=DY.create({name:"nodeAlign",addOptions:()=>({defaultAlignment:"center",alignments:["flex-start","center","flex-end"],types:["image","video","audio","iframe","file"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{nodeAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.justifyContent||this.options.defaultAlignment,renderHTML:e=>e.nodeAlign===this.options.defaultAlignment?{}:{style:`justify-content: ${e.nodeAlign}`}}}}]},addCommands(){return{setNodeAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.every((n=>t.updateAttributes(n,{nodeAlign:e}))),unsetNodeAlign:()=>({commands:e})=>this.options.types.every((t=>e.resetAttributes(t,"nodeAlign")))}}}),fQ=/^\s*(\[([( |x])?\])\s$/,hQ=TX.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>"true"===e.getAttribute("data-checked"),renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",gY(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),s=document.createElement("div");return i.contentEditable="false",l.type="checkbox",l.addEventListener("change",(t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked)return void(l.checked=!l.checked);const{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command((({tr:e})=>{const t=n(),r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0})).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,o)||(l.checked=!l.checked))})),Object.entries(this.options.HTMLAttributes).forEach((([e,t])=>{o.setAttribute(e,t)})),o.dataset.checked=e.attrs.checked,e.attrs.checked&&l.setAttribute("checked","checked"),i.append(l,a),o.append(i,s),Object.entries(t).forEach((([e,t])=>{o.setAttribute(e,t)})),{dom:o,contentDOM:s,update:e=>e.type===this.type&&(o.dataset.checked=e.attrs.checked,e.attrs.checked?l.setAttribute("checked","checked"):l.removeAttribute("checked"),!0)}}},addInputRules(){return[MX({find:fQ,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),mQ=TX.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",gY(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),vQ=DY.create({name:"lineHeight",addOptions:()=>({types:[],defaultLineHeight:1.5}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.options.defaultLineHeight,parseHTML:e=>e.style.lineHeight||this.options.defaultLineHeight,renderHTML:e=>e.lineHeight===this.options.defaultLineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>({commands:t})=>this.options.types.every((n=>t.updateAttributes(n,{lineHeight:e}))),unsetLineHeight:()=>({commands:e})=>this.options.types.every((t=>e.resetAttributes(t,"lineHeight")))}}});const gQ=(e,t,n,r)=>{const o=t+1;if(!r[o])return null;const{from:i,to:a}=r[t],l=a-i-e.length+n,{from:s,to:c}=r[o];return r[o]={to:c-l,from:s-l},[l,r]},bQ=new EW("searchAndReplacePlugin"),yQ=DY.create({name:"searchAndReplace",addOptions:()=>({searchResultClass:"search-result",disableRegex:!0}),addStorage:()=>({searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}),addCommands:()=>({setSearchTerm:e=>({editor:t})=>(t.storage.searchAndReplace.searchTerm=e,!1),setReplaceTerm:e=>({editor:t})=>(t.storage.searchAndReplace.replaceTerm=e,!1),setCaseSensitive:e=>({editor:t})=>(t.storage.searchAndReplace.caseSensitive=e,!1),resetIndex:()=>({editor:e})=>(e.storage.searchAndReplace.resultIndex=0,!1),nextSearchResult:()=>({editor:e})=>{const{results:t,resultIndex:n}=e.storage.searchAndReplace,r=n+1;return t[r]?e.storage.searchAndReplace.resultIndex=r:e.storage.searchAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:e})=>{const{results:t,resultIndex:n}=e.storage.searchAndReplace,r=n-1;return t[r]?e.storage.searchAndReplace.resultIndex=r:e.storage.searchAndReplace.resultIndex=t.length-1,!1},replace:()=>({editor:e,state:t,dispatch:n})=>{const{replaceTerm:r,results:o}=e.storage.searchAndReplace;return((e,t,{state:n,dispatch:r})=>{if(!t[0])return;const{from:o,to:i}=t[0];r&&r(n.tr.insertText(e,o,i))})(r,o,{state:t,dispatch:n}),!1},replaceAll:()=>({editor:e,tr:t,dispatch:n})=>{const{replaceTerm:r,results:o}=e.storage.searchAndReplace;return((e,t,{tr:n,dispatch:r})=>{let o=0,i=t.slice();if(i.length){for(let t=0;t<i.length;t+=1){const{from:r,to:a}=i[t];n.insertText(e,r,a);const l=gQ(e,t,o,i);l&&(o=l[0],i=l[1])}r(n)}})(r,o,{tr:t,dispatch:n}),!1}}),addProseMirrorPlugins(){const e=this.editor,{searchResultClass:t,disableRegex:n}=this.options;return[new CW({key:bQ,state:{init:()=>uG.empty,apply({doc:r,docChanged:o},i){const{searchTerm:a,lastSearchTerm:l,caseSensitive:s,lastCaseSensitive:c,resultIndex:u,lastResultIndex:d}=e.storage.searchAndReplace;if(!o&&l===a&&c===s&&d===u)return i;var p;if(p=a,e.storage.searchAndReplace.lastSearchTerm=p,(t=>{e.storage.searchAndReplace.lastCaseSensitive=t})(s),(t=>{e.storage.searchAndReplace.lastResultIndex=t})(u),!a)return e.storage.searchAndReplace.results=[],uG.empty;const{decorationsToReturn:f,results:h}=function(e,t,n,r){const o=[],i=[];let a=[],l=0;if(!t)return{decorationsToReturn:uG.empty,results:[]};null==e||e.descendants(((e,t)=>{e.isText?a[l]?a[l]={text:a[l].text+e.text,pos:a[l].pos}:a[l]={text:`${e.text}`,pos:t}:l+=1})),a=a.filter(Boolean);for(const s of a){const{text:e,pos:n}=s,r=Array.from(e.matchAll(t)).filter((([e])=>e.trim()));for(const t of r){if(""===t[0])break;void 0!==t.index&&i.push({from:n+t.index,to:n+t.index+t[0].length})}}for(let s=0;s<i.length;s+=1){const e=i[s],t=s===r?`${n} ${n}-current`:n,a=lG.inline(e.from,e.to,{class:t});o.push(a)}return{decorationsToReturn:uG.create(e,o),results:i}}(r,((e,t,n)=>RegExp(t?e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):e,n?"gu":"gui"))(a,n,s),t,u);return e.storage.searchAndReplace.results=h,f}},props:{decorations(e){return this.getState(e)}}})]}}),wQ="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",kQ="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",xQ=(e,t)=>{for(const n in t)e[n]=t[n];return e},CQ="numeric",OQ="ascii",SQ="alpha",EQ="asciinumeric",NQ="alphanumeric",_Q="domain",MQ="emoji",AQ="scheme",TQ="slashscheme",VQ="whitespace";function jQ(e,t){return e in t||(t[e]=[]),t[e]}function BQ(e,t,n){t[CQ]&&(t[EQ]=!0,t[NQ]=!0),t[OQ]&&(t[EQ]=!0,t[SQ]=!0),t[EQ]&&(t[NQ]=!0),t[SQ]&&(t[NQ]=!0),t[NQ]&&(t[_Q]=!0),t[MQ]&&(t[_Q]=!0);for(const r in t){const t=jQ(r,n);t.indexOf(e)<0&&t.push(e)}}function PQ(e){void 0===e&&(e=null),this.j={},this.jr=[],this.jd=null,this.t=e}PQ.groups={},PQ.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const n=t.jr[r][0],o=t.jr[r][1];if(o&&n.test(e))return o}return t.jd},has(e,t){return void 0===t&&(t=!1),t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||PQ.groups,t&&t.j?o=t:(o=new PQ(t),n&&r&&BQ(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let a=0;a<i-1;a++)o=o.tt(e[a]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||PQ.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let a,l=o.go(e);if(l?(a=new PQ,xQ(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new PQ,i){if(r)if(a.t&&"string"==typeof a.t){const e=xQ(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(a.t,r),n);BQ(i,e,r)}else n&&BQ(i,n,r);a.t=i}return o.j[e]=a,a}};const IQ=(e,t,n,r,o)=>e.ta(t,n,r,o),DQ=(e,t,n,r,o)=>e.tr(t,n,r,o),LQ=(e,t,n,r,o)=>e.ts(t,n,r,o),RQ=(e,t,n,r,o)=>e.tt(t,n,r,o),zQ="WORD",FQ="UWORD",$Q="LOCALHOST",HQ="TLD",UQ="UTLD",WQ="SCHEME",qQ="SLASH_SCHEME",KQ="NUM",GQ="WS",YQ="NL",XQ="OPENBRACE",ZQ="CLOSEBRACE",JQ="OPENBRACKET",QQ="CLOSEBRACKET",e0="OPENPAREN",t0="CLOSEPAREN",n0="OPENANGLEBRACKET",r0="CLOSEANGLEBRACKET",o0="FULLWIDTHLEFTPAREN",i0="FULLWIDTHRIGHTPAREN",a0="LEFTCORNERBRACKET",l0="RIGHTCORNERBRACKET",s0="LEFTWHITECORNERBRACKET",c0="RIGHTWHITECORNERBRACKET",u0="FULLWIDTHLESSTHAN",d0="FULLWIDTHGREATERTHAN",p0="AMPERSAND",f0="APOSTROPHE",h0="ASTERISK",m0="AT",v0="BACKSLASH",g0="BACKTICK",b0="CARET",y0="COLON",w0="COMMA",k0="DOLLAR",x0="DOT",C0="EQUALS",O0="EXCLAMATION",S0="HYPHEN",E0="PERCENT",N0="PIPE",_0="PLUS",M0="POUND",A0="QUERY",T0="QUOTE",V0="SEMI",j0="SLASH",B0="TILDE",P0="UNDERSCORE",I0="EMOJI",D0="SYM";var L0=Object.freeze({__proto__:null,WORD:zQ,UWORD:FQ,LOCALHOST:$Q,TLD:HQ,UTLD:UQ,SCHEME:WQ,SLASH_SCHEME:qQ,NUM:KQ,WS:GQ,NL:YQ,OPENBRACE:XQ,CLOSEBRACE:ZQ,OPENBRACKET:JQ,CLOSEBRACKET:QQ,OPENPAREN:e0,CLOSEPAREN:t0,OPENANGLEBRACKET:n0,CLOSEANGLEBRACKET:r0,FULLWIDTHLEFTPAREN:o0,FULLWIDTHRIGHTPAREN:i0,LEFTCORNERBRACKET:a0,RIGHTCORNERBRACKET:l0,LEFTWHITECORNERBRACKET:s0,RIGHTWHITECORNERBRACKET:c0,FULLWIDTHLESSTHAN:u0,FULLWIDTHGREATERTHAN:d0,AMPERSAND:p0,APOSTROPHE:f0,ASTERISK:h0,AT:m0,BACKSLASH:v0,BACKTICK:g0,CARET:b0,COLON:y0,COMMA:w0,DOLLAR:k0,DOT:x0,EQUALS:C0,EXCLAMATION:O0,HYPHEN:S0,PERCENT:E0,PIPE:N0,PLUS:_0,POUND:M0,QUERY:A0,QUOTE:T0,SEMI:V0,SLASH:j0,TILDE:B0,UNDERSCORE:P0,EMOJI:I0,SYM:D0});const R0=/[a-z]/,z0=new RegExp("\\p{L}","u"),F0=new RegExp("\\p{Emoji}","u"),$0=/\d/,H0=/\s/,U0="\n",W0="️",q0="‍";let K0=null,G0=null;function Y0(e,t,n,r,o){let i;const a=t.length;for(let l=0;l<a-1;l++){const n=t[l];e.j[n]?i=e.j[n]:(i=new PQ(r),i.jr=o.slice(),e.j[n]=i),e=i}return i=new PQ(n),i.jr=o.slice(),e.j[t[a-1]]=i,i}function X0(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Z0={defaultProtocol:"http",events:null,format:Q0,formatHref:Q0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function J0(e,t){void 0===t&&(t=null);let n=xQ({},Z0);e&&(n=xQ(n,e instanceof J0?e.o:e));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Q0(e){return e}function e1(e,t){this.t="token",this.v=e,this.tk=t}function t1(e,t){class n extends e1{constructor(t,n){super(t,n),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}J0.prototype={o:Z0,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:Z0[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},e1.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e){return void 0===e&&(e=Z0.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),a={},l=e.get("className",n,t),s=e.get("target",n,t),c=e.get("rel",n,t),u=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return a.href=r,l&&(a.class=l),s&&(a.target=s),c&&(a.rel=c),u&&xQ(a,u),{tagName:o,attributes:a,content:i,eventListeners:d}}};const n1=t1("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),r1=t1("text"),o1=t1("nl"),i1=t1("url",{isLink:!0,toHref(e){return void 0===e&&(e=Z0.defaultProtocol),this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==$Q&&e[1].t===y0}}),a1=e=>new PQ(e);function l1(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const s1="undefined"!=typeof console&&console&&console.warn||(()=>{}),c1={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function u1(e,t){if(void 0===t&&(t=!1),c1.initialized&&s1(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');c1.customSchemes.push([e,t])}function d1(){c1.scanner=function(e){void 0===e&&(e=[]);const t={};PQ.groups=t;const n=new PQ;null==K0&&(K0=X0(wQ)),null==G0&&(G0=X0(kQ)),RQ(n,"'",f0),RQ(n,"{",XQ),RQ(n,"}",ZQ),RQ(n,"[",JQ),RQ(n,"]",QQ),RQ(n,"(",e0),RQ(n,")",t0),RQ(n,"<",n0),RQ(n,">",r0),RQ(n,"(",o0),RQ(n,")",i0),RQ(n,"「",a0),RQ(n,"」",l0),RQ(n,"『",s0),RQ(n,"』",c0),RQ(n,"<",u0),RQ(n,">",d0),RQ(n,"&",p0),RQ(n,"*",h0),RQ(n,"@",m0),RQ(n,"`",g0),RQ(n,"^",b0),RQ(n,":",y0),RQ(n,",",w0),RQ(n,"$",k0),RQ(n,".",x0),RQ(n,"=",C0),RQ(n,"!",O0),RQ(n,"-",S0),RQ(n,"%",E0),RQ(n,"|",N0),RQ(n,"+",_0),RQ(n,"#",M0),RQ(n,"?",A0),RQ(n,'"',T0),RQ(n,"/",j0),RQ(n,";",V0),RQ(n,"~",B0),RQ(n,"_",P0),RQ(n,"\\",v0);const r=DQ(n,$0,KQ,{[CQ]:!0});DQ(r,$0,r);const o=DQ(n,R0,zQ,{[OQ]:!0});DQ(o,R0,o);const i=DQ(n,z0,FQ,{[SQ]:!0});DQ(i,R0),DQ(i,z0,i);const a=DQ(n,H0,GQ,{[VQ]:!0});RQ(n,U0,YQ,{[VQ]:!0}),RQ(a,U0),DQ(a,H0,a);const l=DQ(n,F0,I0,{[MQ]:!0});DQ(l,F0,l),RQ(l,W0,l);const s=RQ(l,q0);DQ(s,F0,l);const c=[[R0,o]],u=[[R0,null],[z0,i]];for(let d=0;d<K0.length;d++)Y0(n,K0[d],HQ,zQ,c);for(let d=0;d<G0.length;d++)Y0(n,G0[d],UQ,FQ,u);BQ(HQ,{tld:!0,ascii:!0},t),BQ(UQ,{utld:!0,alpha:!0},t),Y0(n,"file",WQ,zQ,c),Y0(n,"mailto",WQ,zQ,c),Y0(n,"http",qQ,zQ,c),Y0(n,"https",qQ,zQ,c),Y0(n,"ftp",qQ,zQ,c),Y0(n,"ftps",qQ,zQ,c),BQ(WQ,{scheme:!0,ascii:!0},t),BQ(qQ,{slashscheme:!0,ascii:!0},t),e=e.sort(((e,t)=>e[0]>t[0]?1:-1));for(let d=0;d<e.length;d++){const t=e[d][0],r=e[d][1]?{[AQ]:!0}:{[TQ]:!0};t.indexOf("-")>=0?r[_Q]=!0:R0.test(t)?$0.test(t)?r[EQ]=!0:r[OQ]=!0:r[CQ]=!0,LQ(n,t,t,r)}return LQ(n,"localhost",$Q,{ascii:!0}),n.jd=new PQ(D0),{start:n,tokens:xQ({groups:t},L0)}}(c1.customSchemes);for(let e=0;e<c1.tokenQueue.length;e++)c1.tokenQueue[e][1]({scanner:c1.scanner});c1.parser=function(e){let{groups:t}=e;const n=t.domain.concat([p0,h0,m0,v0,g0,b0,k0,C0,S0,KQ,E0,N0,_0,M0,j0,D0,B0,P0]),r=[f0,y0,w0,x0,O0,A0,T0,V0,n0,r0,XQ,ZQ,QQ,JQ,e0,t0,o0,i0,a0,l0,s0,c0,u0,d0],o=[p0,f0,h0,v0,g0,b0,k0,C0,S0,XQ,ZQ,E0,N0,_0,M0,A0,j0,D0,B0,P0],i=a1(),a=RQ(i,B0);IQ(a,o,a),IQ(a,t.domain,a);const l=a1(),s=a1(),c=a1();IQ(i,t.domain,l),IQ(i,t.scheme,s),IQ(i,t.slashscheme,c),IQ(l,o,a),IQ(l,t.domain,l);const u=RQ(l,m0);RQ(a,m0,u),RQ(s,m0,u),RQ(c,m0,u);const d=RQ(a,x0);IQ(d,o,a),IQ(d,t.domain,a);const p=a1();IQ(u,t.domain,p),IQ(p,t.domain,p);const f=RQ(p,x0);IQ(f,t.domain,p);const h=a1(n1);IQ(f,t.tld,h),IQ(f,t.utld,h),RQ(u,$Q,h);const m=RQ(p,S0);IQ(m,t.domain,p),IQ(h,t.domain,p),RQ(h,x0,f),RQ(h,S0,m);const v=RQ(h,y0);IQ(v,t.numeric,n1);const g=RQ(l,S0),b=RQ(l,x0);IQ(g,t.domain,l),IQ(b,o,a),IQ(b,t.domain,l);const y=a1(i1);IQ(b,t.tld,y),IQ(b,t.utld,y),IQ(y,t.domain,l),IQ(y,o,a),RQ(y,x0,b),RQ(y,S0,g),RQ(y,m0,u);const w=RQ(y,y0),k=a1(i1);IQ(w,t.numeric,k);const x=a1(i1),C=a1();IQ(x,n,x),IQ(x,r,C),IQ(C,n,x),IQ(C,r,C),RQ(y,j0,x),RQ(k,j0,x);const O=RQ(s,y0),S=RQ(c,y0),E=RQ(S,j0),N=RQ(E,j0);IQ(s,t.domain,l),RQ(s,x0,b),RQ(s,S0,g),IQ(c,t.domain,l),RQ(c,x0,b),RQ(c,S0,g),IQ(O,t.domain,x),RQ(O,j0,x),IQ(N,t.domain,x),IQ(N,n,x),RQ(N,j0,x);const _=[[XQ,ZQ],[JQ,QQ],[e0,t0],[n0,r0],[o0,i0],[a0,l0],[s0,c0],[u0,d0]];for(let M=0;M<_.length;M++){const[e,t]=_[M],o=RQ(x,e);RQ(C,e,o),RQ(o,t,x);const i=a1(i1);IQ(o,n,i);const a=a1();IQ(o,r),IQ(i,n,i),IQ(i,r,a),IQ(a,n,i),IQ(a,r,a),RQ(i,t,x),RQ(a,t,x)}return RQ(i,$Q,y),RQ(i,YQ,o1),{start:i,tokens:L0}}(c1.scanner.tokens);for(let e=0;e<c1.pluginQueue.length;e++)c1.pluginQueue[e][1]({scanner:c1.scanner,parser:c1.parser});c1.initialized=!0}function p1(e){return c1.initialized||d1(),function(e,t,n){let r=n.length,o=0,i=[],a=[];for(;o<r;){let l=e,s=null,c=null,u=0,d=null,p=-1;for(;o<r&&!(s=l.go(n[o].t));)a.push(n[o++]);for(;o<r&&(c=s||l.go(n[o].t));)s=null,l=c,l.accepts()?(p=0,d=l):p>=0&&p++,o++,u++;if(p<0)o-=u,o<r&&(a.push(n[o]),o++);else{a.length>0&&(i.push(l1(r1,t,a)),a=[]),o-=p,u-=p;const e=d.t,r=n.slice(o-u,o);i.push(l1(e,t,r))}}return a.length>0&&i.push(l1(r1,t,a)),i}(c1.parser.start,e,function(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),a=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}(t.replace(/[A-Z]/g,(e=>e.toLowerCase()))),r=n.length,o=[];let i=0,a=0;for(;a<r;){let l=e,s=null,c=0,u=null,d=-1,p=-1;for(;a<r&&(s=l.go(n[a]));)l=s,l.accepts()?(d=0,p=0,u=l):d>=0&&(d+=n[a].length,p++),c+=n[a].length,i+=n[a].length,a++;i-=d,a-=p,c-=d,o.push({t:u.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}(c1.scanner.start,e))}function f1(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n=null),t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new J0(n),o=p1(e),i=[];for(let a=0;a<o.length;a++){const e=o[a];!e.isLink||t&&e.t!==t||!r.check(e)||i.push(e.toFormattedObject(r))}return i}function h1(e){return new CW({key:new EW("autolink"),appendTransaction:(t,n,r)=>{const o=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),i=t.some((e=>e.getMeta("preventAutolink")));if(!o||i)return;const{tr:a}=r,l=function(e,t){const n=new nW(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),s=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,o)=>{const i=[];if(e.ranges.length)e.forEach(((e,t)=>{i.push({from:e,to:t})}));else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach((({from:e,to:n})=>{const i=t.slice(o).map(e,-1),a=t.slice(o).map(n),l=t.invert().map(i,-1),s=t.invert().map(a);r.push({oldRange:{from:l,to:s},newRange:{from:i,to:a}})}))})),sX(r)}(l);return s.forEach((({newRange:t})=>{const n=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,t,(e=>e.isTextblock));let o,i;if(n.length>1?(o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(t.from,t.to," "," ").endsWith(" ")&&(o=n[0],i=r.doc.textBetween(o.pos,t.to,void 0," ")),o&&i){const t=i.split(" ").filter((e=>""!==e));if(t.length<=0)return!1;const n=t[t.length-1],s=o.pos+i.lastIndexOf(n);if(!n)return!1;const c=p1(n).map((e=>e.toObject()));if(!(1===(l=c).length?l[0].isLink:3===l.length&&l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;c.filter((e=>e.isLink)).map((e=>({...e,from:s+e.start+1,to:s+e.end+1}))).filter((e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code))).filter((t=>!e.validate||e.validate(t.value))).forEach((t=>{cX(t.from,t.to,r.doc).some((t=>t.mark.type===e.type))||a.addMark(t.from,t.to,e.type.create({href:t.href}))}))}var l})),a.steps.length?a:void 0}})}const m1=AX.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach((e=>{"string"!=typeof e?u1(e.scheme,e.optionalSlashes):u1(e)}))},onDestroy(){PQ.groups={},c1.scanner=null,c1.parser=null,c1.tokenQueue=[],c1.pluginQueue=[],c1.customSchemes=[],c1.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){var t;return(null===(t=e.href)||void 0===t?void 0:t.startsWith("javascript:"))?["a",gY(this.options.HTMLAttributes,{...e,href:""}),0]:["a",gY(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[jX({find:e=>{const t=[];if(e){const n=f1(e).filter((e=>e.isLink));n.length&&n.forEach((e=>t.push({text:e.value,data:{href:e.href},index:e.start})))}return t},type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];var t;return this.options.autolink&&e.push(h1({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push((t={type:this.type,whenNotEditable:"whenNotEditable"===this.options.openOnClick},new CW({key:new EW("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(t.whenNotEditable&&e.editable)return!1;if(0!==r.button)return!1;let a=r.target;const l=[];for(;"DIV"!==a.nodeName;)l.push(a),a=a.parentNode;if(!l.find((e=>"A"===e.nodeName)))return!1;const s=lX(e.state,t.type.name),c=r.target,u=null!==(o=null==c?void 0:c.href)&&void 0!==o?o:s.href,d=null!==(i=null==c?void 0:c.target)&&void 0!==i?i:s.target;return!(!c||!u||(window.open(u,d),0))}}}))),this.options.linkOnPaste&&e.push(function(e){return new CW({key:new EW("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:o}=t,{selection:i}=o,{empty:a}=i;if(a)return!1;let l="";r.content.forEach((e=>{l+=e.textContent}));const s=f1(l).find((e=>e.isLink&&e.value===l));return!(!l||!s||(e.editor.commands.setMark(e.type,{href:s.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),v1=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,g1=TX.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",gY(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[EX({find:v1,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),b1={tag:{type:[String,Object],default:"div"},resizable:{type:Boolean,default:!0},rotatable:{type:Boolean,default:!1},boundary:{type:Boolean},disabled:Boolean,width:{type:Number,default:0},height:{type:Number,default:0},left:{type:Number,default:0},top:{type:Number,default:0},zIndex:{type:Number,default:0},angle:{type:Number,default:0},color:{type:String,default:"#3a7afe"},minWidth:{type:Number,default:-1/0},minHeight:{type:Number,default:-1/0},maxWidth:{type:Number,default:0},maxHeight:{type:Number,default:0},aspectRatio:{type:Number},selected:Boolean,snapToGrid:Boolean,gridX:{type:Number,default:50},gridY:{type:Number,default:50},scaleRatio:{type:Number,default:1},disabledKeyEvent:Boolean,border:{type:Boolean,default:!0},resizeList:{type:Array},equalProportion:{type:Boolean},checkCollision:{type:Boolean},snap:Boolean,snapThreshold:{type:Number,default:10},markline:[Boolean,Function]};function y1(e,t){const n=r=>{t&&t(r),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),document.removeEventListener("mouseleave",n),document.removeEventListener("touchmove",e),document.removeEventListener("touchend",n)};document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),document.addEventListener("mouseleave",n),document.addEventListener("touchmove",e),document.addEventListener("touchend",n)}function w1(e){let t=0,n=0;if(function(e){const t=Object.prototype.toString.call(e);return"TouchEvent"===t.substring(8,t.length-1)}(e)){const r=e.targetTouches[0];t=r.pageX,n=r.pageY}else t=e.clientX,n=e.clientY;return{clientX:t,clientY:n}}const k1=(e=0)=>parseInt(e+"")+"px",x1={n:"top",s:"bottom",e:"right",w:"left",ne:"top-right",nw:"top-left",se:"bottom-right",sw:"bottom-left"},C1=["n","ne","e","se","s","sw","w","nw"],O1={n:0,ne:1,e:2,se:3,s:4,sw:5,w:6,nw:7},S1={0:0,1:1,2:2,3:2,4:3,5:4,6:4,7:5,8:6,9:6,10:7,11:8},E1=(e,t)=>{const n=S1[Math.floor(e/30)];return C1[(O1[t]+n)%8]},N1=(e=0,t)=>{let n=[];for(let r=0;r<C1.length;r++){const o=C1[r],[i,a]=x1[o].split("-"),l=E1(e,o),s={[i]:"0%",cursor:l+"-resize",side:x1[o]};if(a)s[a]="0%";else{s[["top","bottom"].includes(i)?"left":"top"]="50%"}t?t.includes(x1[o])&&n.push(s):n.push(s)}return n},_1=e=>e*Math.PI/180,M1=e=>Math.cos(_1(e)),A1=e=>Math.sin(_1(e)),T1=(e,t,n)=>{const r=e+t;return r>n?e=r:(t=n-e,e=n),{height:e,deltaH:t}},V1=(e,t,n)=>{const r=e+t;return r>n?e=r:(t=n-e,e=n),{width:e,deltaW:t}},j1=(e,t,n)=>{const{width:r,height:o}=e;return{width:Math.abs(r),height:Math.abs(o),left:t-Math.abs(r)/2,top:n-Math.abs(o)/2}};function B1(e,t){const n=e>0?t:-t;let r=0;return r=Math.abs(e)%t>t/2?n*Math.ceil(Math.abs(e)/t):n*Math.floor(Math.abs(e)/t),r}function P1(e,t,n){if(!e||!t)return!1;const r=I1(e,n),o=I1(t,n);return r.left<o.left+o.width&&r.left+r.width>o.left&&r.top<o.top+o.height&&r.top+r.height>o.top}const I1=(e,t)=>{var n=e.getBoundingClientRect();return{...n,left:n.left/t,top:n.top/t,right:n.right/t,bottom:n.bottom/t,width:n.width/t,height:n.height/t}},D1=e=>"function"==typeof e;function L1(e,n){let r=null,o=null;const i=t.computed((()=>e.value.offsetParent||document.body)),a=t.computed((()=>I1(i.value,n.scaleRatio))),l=t.ref({x:[],y:[]}),s=(e={})=>{if(n.markline){if(D1(n.markline))return n.markline(e);null===e.left?r.style.display="none":(r.style.left=e.left+"px",r.style.backgroundColor=n.color,r.style.display="block"),null===e.top?o.style.display="none":(o.style.top=e.top+"px",o.style.backgroundColor=n.color,o.style.display="block")}};return t.onMounted((()=>{n.markline&&!D1(n.markline)&&(r||(r=document.querySelector(".es-drager-markline-x")||R1("x",i.value,n.color)),o||(o=document.querySelector(".es-drager-markline-y")||R1("y",i.value,n.color)))})),{marklineEmit:t=>{if(n.snap||n.markline)switch(t){case"drag-start":(()=>{const t=I1(e.value,n.scaleRatio),r=document.querySelectorAll(".es-drager"),o=[];for(let i=0;i<r.length;i++){const t=r[i];t!==e.value&&o.push(I1(t,n.scaleRatio))}l.value=function(e,t){const n={x:[],y:[]},{width:r=0,height:o=0}=t;return e.forEach((e=>{const{top:t,left:i,width:a,height:l}=e;n.y.push({showTop:t,top:t}),n.y.push({showTop:t,top:t-o}),n.y.push({showTop:t+l/2,top:t+l/2-o/2}),n.y.push({showTop:t+l,top:t+l}),n.y.push({showTop:t+l,top:t+l-o}),n.x.push({showLeft:i,left:i}),n.x.push({showLeft:i+a,left:i+a}),n.x.push({showLeft:i+a/2,left:i+a/2-r/2}),n.x.push({showLeft:i+a,left:i+a-r}),n.x.push({showLeft:i,left:i-r})})),n}(o,t)})();break;case"drag":return(()=>{const t={top:null,left:null,diffX:0,diffY:0},r=I1(e.value,n.scaleRatio);for(let e=0;e<l.value.y.length;e++){const{top:o,showTop:i}=l.value.y[e];if(Math.abs(o-r.top)<n.snapThreshold){t.diffY=o-r.top,t.top=i-a.value.top;break}}for(let e=0;e<l.value.x.length;e++){const{left:o,showLeft:i}=l.value.x[e];if(Math.abs(o-r.left)<n.snapThreshold){t.diffX=o-r.left,t.left=i-a.value.left;break}}return s(t),t})();case"drag-end":s({left:null,top:null})}}}}function R1(e="x",t,n=""){const r=document.createElement("div");return r.classList.add(`es-drager-markline-${e}`),r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.zIndex="9999",r.style.backgroundColor=n,r.style.display="none","x"===e?(r.style.height="100%",r.style.width="1px"):(r.style.height="1px",r.style.width="100%"),t.appendChild(r),r}const z1=t.createElementVNode("div",{class:"es-drager-rotate-handle"},[t.createElementVNode("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"})])],-1),F1=t.defineComponent({__name:"rotate",props:{modelValue:{type:Number,default:0},element:{type:Object}},emits:["update:modelValue","rotate","rotate-start","rotate-end"],setup(e,{emit:n}){const r=e,o=n,i=t.ref(null),a=t.computed({get:()=>r.modelValue,set:e=>{o("update:modelValue",e)}});function l(e){if(!r.element)return console.warn("[es-drager] rotate component need drag element property");e.stopPropagation();const{width:t,height:n,left:i,top:l}=r.element.getBoundingClientRect(),s=i+t/2,c=l+n/2;o("rotate-start",a.value),y1((e=>{const{clientX:t,clientY:n}=w1(e),r=s-t,i=c-n,l=180*Math.atan2(i,r)/Math.PI-90;a.value=(l+360)%360,o("rotate",a.value)}),(()=>{o("rotate-end",a.value)}))}return(e,n)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"rotateRef",ref:i,class:"es-drager-rotate",onMousedown:l,onTouchstartPassive:l},[t.renderSlot(e.$slots,"default",{},(()=>[z1]))],544))}}),$1=["data-side","onMousedown","onTouchstartPassive"],H1=t.createElementVNode("div",{class:"es-drager-dot-handle"},null,-1),U1=t.defineComponent({__name:"drager",props:b1,emits:["change","drag","drag-start","drag-end","resize","resize-start","resize-end","rotate","rotate-start","rotate-end","focus","blur"],setup(e,{emit:n}){const r=e,o=n,i=(e,...t)=>{o(e,...t)},a=t.ref(null),{selected:l,dragData:s,isMousedown:c,getBoundary:u,checkDragerCollision:d}=function(e,n,r){const o=t.ref(!1),i=t.ref(!1),a=t.ref({width:n.width,height:n.height,left:n.left,top:n.top,angle:n.angle}),{marklineEmit:l}=L1(e,n),s=new Set;function c(e){if(s.add(e.button),n.disabled)return;o.value=!0,i.value=!0;let{clientX:c,clientY:f}=w1(e);const{left:h,top:m}=a.value;let v=0,g=0,b=0,y=0;n.boundary&&([v,g,b,y]=u()),l("drag-start"),r&&r("drag-start",a.value),y1((e=>{if(s.size>1)return;const{clientX:o,clientY:i}=w1(e);let u=(o-c)/n.scaleRatio+h,p=(i-f)/n.scaleRatio+m;if(n.snapToGrid){let{left:e,top:t}=a.value;const r=p-t;u=e+B1(u-e,n.gridX),p=t+B1(r,n.gridY)}n.boundary&&([u,p]=d(u,p,v,g,b,y)),a.value.left=u,a.value.top=p,r&&r("drag",a.value),t.nextTick((()=>{const e=l("drag");n.snap&&(e.diffX&&(a.value.left+=e.diffX),e.diffY&&(a.value.top+=e.diffY))}))}),(e=>{n.checkCollision&&p()&&(a.value.top=m,a.value.left=h),s.clear(),o.value=!1,l("drag-end"),r&&r("drag-end",a.value)}))}const u=()=>{let t=0,r=0;const{left:o,top:i,height:l,width:s,angle:c}=a.value,u=e.value.offsetParent||document.body,d=I1(u,n.scaleRatio);if(c){const a=I1(e.value,n.scaleRatio);t=a.left-Math.floor(o-(a.width-s)+d.left),r=a.top-Math.floor(i-(a.height-l)+d.top)}return[t,d.width-s-t,r,d.height-l-r,d.width,d.height]},d=(e,t,n,r,o,i)=>[e=(e=e<n?n:e)>r?r:e,t=(t=t<o?o:t)>i?i:t],p=()=>{const t=e.value.offsetParent||document.body,r=Array.from(t.children).filter((t=>t!==e.value&&t.classList.contains("es-drager")));for(let o=0;o<r.length;o++){const t=r[o];if(P1(e.value,t,n.scaleRatio))return!0}},f=()=>{i.value=!1},{onKeydown:h,onKeyup:m}=function(e,t,n,{getBoundary:r,fixBoundary:o,checkDragerCollision:i,emit:a}){let l=0,s=0;return{onKeydown:n=>{let{left:i,top:a}=t.value;if(l||(l=i),s||(s=a),["ArrowRight","ArrowLeft"].includes(n.key)){const t="ArrowRight"===n.key;let r=t?1:-1;e.snapToGrid&&(r=t?e.gridX:-e.gridX),i+=r}else if(["ArrowUp","ArrowDown"].includes(n.key)){const t="ArrowDown"===n.key;let r=t?1:-1;e.snapToGrid&&(r=t?e.gridY:-e.gridY),a+=r}if(e.boundary){const[e,t,n,l]=r();[i,a]=o(i,a,e,t,n,l)}t.value.left=i,t.value.top=a},onKeyup:n=>{["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"].includes(n.key)&&e.checkCollision&&i()&&(t.value.left=l,t.value.top=s),l=0,s=0}}}(n,a,0,{getBoundary:u,fixBoundary:d,checkDragerCollision:p,emit:r});return t.watch(i,(e=>{e?(r("focus",e),document.addEventListener("click",f,{once:!0})):r("blur",e),!n.disabledKeyEvent&&(e?(document.addEventListener("keydown",h),document.addEventListener("keyup",m)):(document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)))})),t.onMounted((()=>{if(e.value){if(!a.value.width&&!a.value.height){const{width:t,height:r}=I1(e.value,n.scaleRatio);a.value={...a.value,width:t||100,height:r||100}}e.value.addEventListener("mousedown",c),e.value.addEventListener("touchstart",c,{passive:!0})}})),t.onBeforeUnmount((()=>{document.removeEventListener("click",f),document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)})),{isMousedown:o,selected:i,dragData:a,getBoundary:u,checkDragerCollision:p}}(a,r,i),p=t.ref(N1(0,r.resizeList)),f=t.computed((()=>r.resizable&&!r.disabled)),h=t.computed((()=>r.rotatable&&!r.disabled&&l.value)),m=t.computed((()=>{const{width:e,height:t,left:n,top:o,angle:i}=s.value,a={};return e&&(a.width=k1(e)),t&&(a.height=k1(t)),{...a,left:k1(n),top:k1(o),zIndex:r.zIndex,transform:`rotate(${i}deg)`,"--es-drager-color":r.color}}));function v(e){a.value||(a.value=e.$el||e)}function g(e){p.value=N1(e,r.resizeList),i("rotate-end",s.value)}function b(e,t){if(r.disabled)return;t.stopPropagation();const{clientX:n,clientY:o}=w1(t),a=n,l=o,{width:c,height:p,left:f,top:h}=s.value,m={width:c,height:p,centerX:f+c/2,centerY:h+p/2,rotateAngle:s.value.angle},v=e.side,{minWidth:g,minHeight:b,aspectRatio:y,equalProportion:w}=r;i("resize-start",s.value);let k=[];r.boundary&&(k=u()),y1((e=>{const{clientX:t,clientY:n}=w1(e);let o=(t-a)/r.scaleRatio,c=(n-l)/r.scaleRatio;r.snapToGrid&&(o=B1(o,r.gridX),c=B1(c,r.gridY));const u=Math.atan2(c,o),d=((e,t)=>Math.sqrt(e*e+t*t))(o,c),p=e.shiftKey,f=u-_1(m.rotateAngle),h=d*Math.cos(f),x=d*Math.sin(f),C=!w&&!p||y?y:m.width/m.height,{position:{centerX:O,centerY:S},size:{width:E,height:N}}=((e,t,n,r,o,i,a)=>{let{width:l,height:s,centerX:c,centerY:u,rotateAngle:d}=t;const p=l<0?-1:1,f=s<0?-1:1;switch(l=Math.abs(l),s=Math.abs(s),e){case"right":{const e=V1(l,n,i);l=e.width,n=e.deltaW,o?(r=n/o,s=l/o,c+=n/2*M1(d)-r/2*A1(d),u+=n/2*A1(d)+r/2*M1(d)):(c+=n/2*M1(d),u+=n/2*A1(d));break}case"top-right":{r=-r;const e=V1(l,n,i);l=e.width,n=e.deltaW;const t=T1(s,r,a);s=t.height,r=t.deltaH,o&&(n=r*o,l=s*o),c+=n/2*M1(d)+r/2*A1(d),u+=n/2*A1(d)-r/2*M1(d);break}case"bottom-right":{const e=V1(l,n,i);l=e.width,n=e.deltaW;const t=T1(s,r,a);s=t.height,r=t.deltaH,o&&(n=r*o,l=s*o),c+=n/2*M1(d)-r/2*A1(d),u+=n/2*A1(d)+r/2*M1(d);break}case"bottom":{const e=T1(s,r,a);s=e.height,r=e.deltaH,o?(l=s*o,c+=(n=r*o)/2*M1(d)-r/2*A1(d),u+=n/2*A1(d)+r/2*M1(d)):(c-=r/2*A1(d),u+=r/2*M1(d));break}case"bottom-left":{const e=V1(l,n=-n,i);l=e.width,n=e.deltaW;const t=T1(s,r,a);s=t.height,r=t.deltaH,o&&(s=l/o,r=n/o),c-=n/2*M1(d)+r/2*A1(d),u-=n/2*A1(d)-r/2*M1(d);break}case"left":{const e=V1(l,n=-n,i);l=e.width,n=e.deltaW,o?(s=l/o,r=n/o,c-=n/2*M1(d)+r/2*A1(d),u-=n/2*A1(d)-r/2*M1(d)):(c-=n/2*M1(d),u-=n/2*A1(d));break}case"top-left":{r=-r;const e=V1(l,n=-n,i);l=e.width,n=e.deltaW;const t=T1(s,r,a);s=t.height,r=t.deltaH,o&&(l=s*o,n=r*o),c-=n/2*M1(d)-r/2*A1(d),u-=n/2*A1(d)+r/2*M1(d);break}case"top":{const e=T1(s,r=-r,a);s=e.height,r=e.deltaH,o?(l=s*o,c+=(n=r*o)/2*M1(d)+r/2*A1(d),u+=n/2*A1(d)-r/2*M1(d)):(c+=r/2*A1(d),u-=r/2*M1(d));break}}return{position:{centerX:c,centerY:u},size:{width:l*p,height:s*f}}})(v,{...m,rotateAngle:m.rotateAngle},h,x,C,g,b),_=(({centerX:e,centerY:t,width:n,height:r,angle:o})=>({top:t-r/2,left:e-n/2,width:n,height:r,angle:o}))({centerX:O,centerY:S,width:E,height:N,angle:s.value.angle});let M={...s.value,...j1(_,O,S)};r.maxWidth>0&&(M.width=Math.min(M.width,r.maxWidth)),r.maxHeight>0&&(M.height=Math.min(M.height,r.maxHeight)),r.boundary&&(M=function(e,t,n){const[r,o,i,a,l,c]=t;return e.left<r&&(e.left=r,e.width=s.value.width,n&&(e.height=s.value.height)),e.left+e.width>l&&(e.left=s.value.left,e.width=l-e.left,n&&(e.height=s.value.height)),e.top<i&&(e.top=i,e.height=s.value.height,n&&(e.width=s.value.width)),e.top+e.height>c&&(e.top=s.value.top,e.height=c-e.top,n&&(e.width=s.value.width)),e}(M,k,C)),s.value=M,i("resize",s.value)}),(()=>{r.checkCollision&&d()&&(s.value={...s.value,width:c,height:p,left:f,top:h}),i("resize-end",s.value)}))}return t.watch((()=>[r.width,r.height,r.left,r.top,r.angle]),(([e,t,n,r,o],[i,a,l,c,u])=>{e!==i&&(s.value.width=e),t!==a&&(s.value.height=t),n!==l&&(s.value.left=n),r!==c&&(s.value.top=r),o!==u&&(s.value.angle=o)})),t.watch((()=>s.value),(e=>{o("change",{...e})}),{deep:!0}),t.watch((()=>r.selected),(e=>{l.value=e}),{immediate:!0}),(e,n)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),{ref:v,class:t.normalizeClass(["es-drager",{disabled:e.disabled,dragging:t.unref(c),selected:t.unref(l),border:e.border}]),style:t.normalizeStyle(m.value),onClick:n[3]||(n[3]=t.withModifiers((()=>{}),["stop"]))},{default:t.withCtx((()=>[t.renderSlot(e.$slots,"default"),f.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(p.value,((n,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:"es-drager-dot","data-side":n.side,style:t.normalizeStyle({...n}),onMousedown:e=>b(n,e),onTouchstartPassive:e=>b(n,e)},[t.renderSlot(e.$slots,"resize",t.normalizeProps(t.guardReactiveProps({side:n.side})),(()=>[H1]))],44,$1)))),128)):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createBlock(F1,{key:1,modelValue:t.unref(s).angle,"onUpdate:modelValue":n[0]||(n[0]=e=>t.unref(s).angle=e),element:a.value,onRotate:n[1]||(n[1]=e=>i("rotate",t.unref(s))),onRotateStart:n[2]||(n[2]=e=>i("rotate-start",t.unref(s))),onRotateEnd:g},{default:t.withCtx((()=>[t.renderSlot(e.$slots,"rotate")])),_:3},8,["modelValue","element"])):t.createCommentVNode("",!0)])),_:3},8,["class","style"]))}});U1.install=e=>{e.component("es-drager",U1)};var W1={},q1={},K1=v&&v.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(t){i(t)}}function l(e){try{s(r.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},G1=v&&v.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(s){l=[6,s],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}};Object.defineProperty(q1,"__esModule",{value:!0}),q1.base64ToBlob=void 0,q1.base64ToBlob=function(e){return K1(this,void 0,void 0,(function(){var t,n;return G1(this,(function(r){switch(r.label){case 0:return[4,fetch(e)];case 1:return[4,r.sent().blob()];case 2:return t=r.sent(),n=function(e){var t;return null===(t=e.match(Y1))||void 0===t?void 0:t.slice(1,2).pop()}(e),n&&(t=t.slice(0,t.size,n)),[2,t]}}))}))};var Y1=/^data:(.+);base64,/;var X1={},Z1=v&&v.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(t){i(t)}}function l(e){try{s(r.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},J1=v&&v.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(s){l=[6,s],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}};Object.defineProperty(X1,"__esModule",{value:!0}),X1.base64ToFile=void 0,X1.base64ToFile=function(e,t,n){return Z1(this,void 0,void 0,(function(){var r;return J1(this,(function(o){switch(o.label){case 0:return[4,fetch(e)];case 1:return[4,o.sent().blob()];case 2:return r=o.sent(),[2,new File([r],t,n)]}}))}))};var Q1,e2,t2={},n2=v&&v.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(t){i(t)}}function l(e){try{s(r.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},r2=v&&v.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(s){l=[6,s],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}};function o2(e){return n2(this,void 0,void 0,(function(){return r2(this,(function(t){return[2,new Promise((function(t,n){try{var r=new FileReader,o=function(){t(r.result),r.removeEventListener(Q1.loadend,o)};r.addEventListener(Q1.loadend,o);var i=function(){n(r.error),r.removeEventListener(Q1.error,i)};r.addEventListener(Q1.error,i),r.readAsDataURL(e)}catch(a){n(a)}}))]}))}))}Object.defineProperty(t2,"__esModule",{value:!0}),t2.blobToBase64=void 0,t2.blobToBase64=function(e){return n2(this,void 0,void 0,(function(){return r2(this,(function(t){return[2,"function"==typeof FileReader?o2(e):a2(e)]}))}))},(e2=Q1||(Q1={})).error="error",e2.loadend="loadend";var i2="application/octet-stream";function a2(e){return n2(this,void 0,void 0,(function(){var t,n,r,o;return r2(this,(function(i){switch(i.label){case 0:return r=(n=Buffer).from,[4,e.text()];case 1:return t=r.apply(n,[i.sent()]),o=e.type||i2,[2,"data:".concat(o,";base64,").concat(t.toString("base64"))]}}))}))}var l2={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fileToBase64=void 0;var t=t2;Object.defineProperty(e,"fileToBase64",{enumerable:!0,get:function(){return t.blobToBase64}})}(l2),function(e){var t=v&&v.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=v&&v.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(q1,e),n(X1,e),n(t2,e),n(l2,e)}(W1);const s2={class:"node-container hover-shadow select-outline image"},c2={key:0,class:"loading"},u2={key:1,class:"error"},d2=["src"],p2={key:0,class:"uploading"},f2=[(e=>(t.pushScopeId("data-v-9d8e775a"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",null,null,-1)))],h2=yS({__name:"node-view",props:jZ,setup(e){const{options:n}=gS(),{imagePreview:r}=gS(),{isLoading:o,error:i}=uS({src:e.node.attrs.src}),a=t.ref(null),l=t.ref(null);let s=t.ref(!1),c=t.ref(0);t.onMounted((async()=>{const t=a.value.$el.clientWidth;c.value=t,null===e.node.attrs.width&&e.updateAttributes({width:t})}));const u=()=>{var t;const n=null==(t=l.value)?void 0:t.offsetHeight;a.value&&n&&e.updateAttributes({height:n})},d=({angle:t})=>{e.updateAttributes({angle:t})},p=({width:t,height:n})=>{e.updateAttributes({width:t,height:n})},f=({left:t,top:n})=>{e.updateAttributes({left:t,top:n})};return KO(a,(()=>s.value=!1)),t.watch((()=>e.node.attrs.equalProportion),(async()=>{await t.nextTick();const n=l.value.offsetWidth,r=l.value.offsetHeight;e.updateAttributes({width:n,height:r})})),t.watch((()=>e.node.attrs.src),(async r=>{if(!1===e.node.attrs.uploaded&&!i.value){if(r.startsWith("data:image")){const t=r.split(";")[0].split(":")[1];let n=t.split("/")[1];"jpeg"===n&&(n="jpg"),"svg+xml"===n&&(n="svg");const o=bO(10),i=await W1.base64ToFile(r,`${o}.${n}`,{type:t});e.updateAttributes({file:i})}await t.nextTick(),(async()=>{if(!e.node.attrs.uploaded&&e.node.attrs.file)try{const{id:t,url:r}=await n.value.onFileUpload(e.node.attrs.file);a.value&&e.updateAttributes({id:t,src:r,file:null,uploaded:!0})}catch(t){tR("error",t.message)}})()}}),{immediate:!0}),t.watch((()=>i.value),(({type:t})=>{e.updateAttributes({error:"error"===t})})),(e,h)=>{const m=QC;return t.openBlock(),t.createBlock(t.unref(TZ),{ref_key:"containerRef",ref:a,class:"node-view",style:t.normalizeStyle({"justify-content":e.node.attrs.nodeAlign}),onDblclick:h[1]||(h[1]=t=>r.value=e.node.attrs.src)},{default:t.withCtx((()=>[t.createElementVNode("div",s2,[e.node.attrs.src&&t.unref(o)?(t.openBlock(),t.createElementBlock("div",c2,[t.createVNode(m,{name:"loading",class:"loading-icon"}),t.createTextVNode(" 加载中... ")])):e.node.attrs.src&&t.unref(i)?(t.openBlock(),t.createElementBlock("div",u2,[t.createVNode(m,{name:"image-failed",class:"error-icon"}),t.createTextVNode(" 图片加载错误 ")])):(t.openBlock(),t.createBlock(t.unref(U1),{key:2,selected:t.unref(s),rotatable:!0,boundary:!1,draggable:Boolean(e.node.attrs.draggable)&&!t.unref(n).document.readOnly,angle:e.node.attrs.angle,width:Number(e.node.attrs.width),height:Number(e.node.attrs.height),left:Number(e.node.attrs.left),top:Number(e.node.attrs.top),"min-width":14,"min-height":14,"max-width":t.unref(c),"z-index":10,"equal-proportion":e.node.attrs.equalProportion,onRotate:d,onResize:p,onDrag:f,onClick:h[0]||(h[0]=e=>t.isRef(s)?s.value=!0:s=!0)},{default:t.withCtx((()=>[t.createElementVNode("img",{ref_key:"imageRef",ref:l,src:e.node.attrs.src,style:t.normalizeStyle({height:e.node.attrs.equalProportion?"auto":"100%",transform:e.node.attrs.flipX||e.node.attrs.flipX?`rotateX(${e.node.attrs.flipX?"180":"0"}deg) rotateY(${e.node.attrs.flipY?"180":"0"}deg)`:"none"}),onLoad:u},null,44,d2),e.node.attrs.uploaded||null===e.node.attrs.file?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",p2,f2))])),_:1},8,["selected","draggable","angle","width","height","left","top","max-width","equal-proportion"]))])])),_:1},8,["style"])}}},[["__scopeId","data-v-9d8e775a"]]),m2=g1.extend({atom:!0,addAttributes:()=>({id:{default:null},type:{default:"image"},file:{default:null},src:{default:null},content:{default:null},width:{default:null},height:{default:null},left:{default:0},top:{default:0},angle:{default:null},draggable:{default:!1},rotatable:{default:!1},equalProportion:{default:!0},flipX:{default:!1},flipY:{default:!1},uploaded:{default:!1},error:{default:!1}}),parseHTML:()=>[{tag:"img"}],addNodeView:()=>PZ(h2),addCommands(){return{setImage:(e,t)=>({commands:n,editor:r})=>t?n.insertContent({type:this.name,attrs:e}):n.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:e})}}}),v2={restart:"重新播放",rewind:"倒退 {seektime} 秒",play:"播放",pause:"暂停",fastForward:"快进 {seektime} 秒",seek:"搜索",seekLabel:"{currentTime} / {duration}",played:"已播放",buffered:"已缓冲",currentTime:"当前时间",duration:"持续时间",volume:"音量",mute:"静音",unmute:"取消静音",enableCaptions:"启用字幕",disableCaptions:"禁用字幕",download:"下载",enterFullscreen:"进入全屏",exitFullscreen:"退出全屏",captions:"字幕",settings:"设置",pip:"画中画",menuBack:"返回",seek:"播放位置",speed:"速度",normal:"正常",quality:"质量",loop:"循环",start:"开始",end:"结束",all:"全部",reset:"重置",disabled:"已禁用",enabled:"已启用"},g2=e=>{if(a)return new a(e,{i18n:v2,settings:[],tooltips:{controls:!0},storage:{key:"umo-editor:player"},disableContextMenu:!1})},b2={class:"node-container hover-shadow video"},y2=["src"],w2={key:0,class:"uploading"},k2=yS({__name:"node-view",props:jZ,setup(e){const{options:n}=gS(),r=t.ref(null);let o=t.ref(!1);const i=t.ref(null);let a=t.ref(null),l=t.ref(0);t.onMounted((async()=>{const t=r.value.$el.clientWidth;if(l.value=t,null===e.node.attrs.width&&e.updateAttributes({width:t}),a.value=g2(i.value),!1===e.node.attrs.uploaded&&e.node.attrs.file)try{const{url:t}=await n.value.onFileUpload(e.node.attrs.file);r.value&&e.updateAttributes({src:t,file:null,uploaded:!0})}catch(o){tR("error",o.message)}}));const s=()=>{var t;const n=null==(t=i.value)?void 0:t.offsetHeight;r.value&&n&&e.updateAttributes({height:n})},c=({width:t,height:n})=>{e.updateAttributes({width:t,height:n})};return t.onBeforeUnmount((()=>{var e;a.value&&(null==(e=a.value)||e.destroy())})),KO(r,(()=>o.value=!1)),(e,n)=>(t.openBlock(),t.createBlock(t.unref(TZ),{ref_key:"containerRef",ref:r,class:"node-view",style:t.normalizeStyle({"justify-content":e.node.attrs.nodeAlign})},{default:t.withCtx((()=>[t.createElementVNode("div",b2,[t.createVNode(t.unref(U1),{selected:t.unref(o),rotatable:!1,boundary:!1,width:e.node.attrs.width,height:e.node.attrs.height,"min-width":200,"min-height":200,"max-width":t.unref(l),"equal-proportion":"",onResize:c,onClick:n[0]||(n[0]=e=>t.isRef(o)?o.value=!0:o=!0)},{default:t.withCtx((()=>[t.createElementVNode("video",{ref_key:"videoRef",ref:i,src:e.node.attrs.src,controls:"",crossorigin:"",onCanplay:s},null,40,y2),e.node.attrs.uploaded||null===e.node.attrs.file?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",w2))])),_:1},8,["selected","width","height","max-width"])])])),_:1},8,["style"]))}},[["__scopeId","data-v-3c434ba8"]]),x2=TX.create({name:"video",group:"block",atom:!0,addAttributes:()=>({id:{default:null},file:{default:null},src:{default:null},width:{default:null},height:{default:null},draggable:{default:!1},uploaded:{default:!1}}),parseHTML:()=>[{tag:"video"}],renderHTML:({HTMLAttributes:e})=>["video",gY(e)],addNodeView:()=>PZ(k2),addCommands(){return{setVideo:e=>({commands:t,editor:n})=>t.insertContentAt(n.state.selection.anchor,{type:this.name,attrs:e})}}}),C2={class:"node-container hover-shadow select-outline audio"},O2=["src"],S2={key:0,class:"uploading"},E2=yS({__name:"node-view",props:jZ,setup(e){const{options:n}=gS(),r=t.ref(null),o=t.ref(null);let i=t.ref(null),a=t.ref(!1);return t.onMounted((async()=>{if(i.value=g2(o.value),!1===e.node.attrs.uploaded&&e.node.attrs.file)try{const{url:t}=await n.value.onFileUpload(e.node.attrs.file);r.value&&e.updateAttributes({src:t,file:null,uploaded:!0})}catch(t){tR("error",t.message)}})),t.onBeforeUnmount((()=>{var e;i.value&&(null==(e=i.value)||e.destroy())})),KO(r,(()=>a.value=!1)),(e,n)=>(t.openBlock(),t.createBlock(t.unref(TZ),{ref_key:"containerRef",ref:r,class:"node-view",style:t.normalizeStyle({"justify-content":e.node.attrs.nodeAlign})},{default:t.withCtx((()=>[t.createElementVNode("div",C2,[t.createElementVNode("audio",{ref_key:"audiorRef",ref:o,src:e.node.attrs.src,controls:"",crossorigin:""},null,8,O2),e.node.attrs.uploaded||null===e.node.attrs.file?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",S2))])])),_:1},8,["style"]))}},[["__scopeId","data-v-3ad0b67a"]]),N2=TX.create({name:"audio",group:"block",atom:!0,addAttributes:()=>({id:{default:null},file:{default:null},src:{default:null},uploaded:{default:!1}}),parseHTML:()=>[{tag:"audio"}],renderHTML:({HTMLAttributes:e})=>["audio",gY(e)],addNodeView:()=>PZ(E2),addCommands(){return{setVideo:e=>({commands:t,editor:n})=>t.insertContentAt(n.state.selection.anchor,{type:this.name,attrs:e})}}}),_2={ai:["ai","eps"],app:["app"],axure:["rp"],book:["mobi","oeb","lit","xeb","ebx","rb","pdb","epub","azw3","hlp","chm","wdl","ceb","abm","pdg","caj"],css:["css","less","sass"],dmg:["dmg"],excel:["csv","fods","ods","ots","xls","xlsm","xlsx","xlt","xltm","xltx","et","ett"],exe:["exe"],html:["htm","html","mht"],img:["png","bmp","jpg","jpeg","gif","webp","tga","exif","fpx","svg","hdri","raw","ico","jfif","dib","pbm","pgm","ppm","rgb"],java:["jar","java"],js:["js","jsx","ts","tsx"],json:["json"],keynote:["key"],md:["md","markdown"],music:["au","aif","aiff","aifc","rmi","mp3","mid","cda","wav","wma","ra","ram","snd","mida","ogg","ape","flac","aac"],numbers:["numbers"],pages:["pages"],pdf:["pdf"],php:["php"],pkg:["pkg"],ppt:["fodp","odp","otp","pot","potm","potx","pps","ppsm","ppsx","ppt","pptm","pptx","dps","dpt","wpp"],psd:["psd"],python:["python"],sh:["sh"],sketch:["sketch"],sql:["sql"],text:["text","txt"],video:["mp4","avi","mov","rmvb","rm","flv","mpeg","wmv","mkv"],vue:["vue"],word:["doc","docm","docx","dot","dotm","dotx","epub","fodt","odt","ott","rtf","wps","wpt"],xmind:["xmind"],zip:["zip","rar","tar","gz","gzip","uue","bz2","iso","7z","z","ace","lzh","arj","cab"],font:["eot","otf","fon","font","ttf","ttc","woff","woff2"]},M2=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],A2=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],T2=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],V2=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],j2=(e,t,n)=>{let r=e;return"string"==typeof t||Array.isArray(t)?r=e.toLocaleString(t,n):!0!==t&&void 0===n||(r=e.toLocaleString(void 0,n)),r};function B2(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const n=(t={bits:!1,binary:!1,space:!0,...t}).bits?t.binary?V2:T2:t.binary?A2:M2,r=t.space?" ":"";if(t.signed&&0===e)return` 0${r}${n[0]}`;const o=e<0,i=o?"-":t.signed?"+":"";let a;if(o&&(e=-e),void 0!==t.minimumFractionDigits&&(a={minimumFractionDigits:t.minimumFractionDigits}),void 0!==t.maximumFractionDigits&&(a={maximumFractionDigits:t.maximumFractionDigits,...a}),e<1){return i+j2(e,t.locale,a)+r+n[0]}const l=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**l,a||(e=e.toPrecision(3));return i+j2(Number(e),t.locale,a)+r+n[l]}const P2={class:"node-container hover-shadow select-outline file"},I2={class:"file-icon"},D2=["src"],L2={class:"file-info"},R2=["title"],z2={class:"file-meta"},F2={class:"file-action"},$2={key:0,class:"action-item",title:"文件上传中..."},H2=["href","download"],U2=yS({__name:"node-view",props:jZ,setup(e){const{options:n}=gS(),r=t.ref(null);let o=t.ref();return t.onMounted((async()=>{let t=(e=>{const t=(e=>{const t=e.split(".");return t[t.length-1]})(e);for(const n of Object.keys(_2))if(_2[n].includes(t))return n;return"common"})(e.node.attrs.name);if(o.value=`${n.value.cdnUrl}/icons/file/${t}.svg`,!1===e.node.attrs.uploaded&&e.node.attrs.file)try{const{id:t,url:o}=await n.value.onFileUpload(e.node.attrs.file);r.value&&e.updateAttributes({id:t,url:o,file:null,uploaded:!0})}catch(i){tR("error",i.message)}})),(e,n)=>{const i=QC;return t.openBlock(),t.createBlock(t.unref(TZ),{ref_key:"containerRef",ref:r,class:"node-view",style:t.normalizeStyle({"justify-content":e.node.attrs.nodeAlign})},{default:t.withCtx((()=>[t.createElementVNode("div",P2,[t.createElementVNode("div",I2,[t.createElementVNode("img",{src:t.unref(o),class:"icon"},null,8,D2)]),t.createElementVNode("div",L2,[t.createElementVNode("div",{class:"file-name",title:e.node.attrs.name},t.toDisplayString(e.node.attrs.name),9,R2),t.createElementVNode("div",z2,t.toDisplayString(t.unref(B2)(e.node.attrs.size)),1)]),t.createElementVNode("div",F2,[e.node.attrs.uploaded||null===e.node.attrs.file?(t.openBlock(),t.createElementBlock("a",{key:1,href:e.node.attrs.url,download:e.node.attrs.name,target:"_blank",class:"action-item"},[t.createVNode(i,{name:"download"})],8,H2)):(t.openBlock(),t.createElementBlock("div",$2,[t.createVNode(i,{class:"loading",name:"loading"})]))])])])),_:1},8,["style"])}}},[["__scopeId","data-v-76dc78a0"]]),{options:W2}=gS(),q2={image:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/apng"],video:["video/mp4","video/webm","video/ogg"],audio:["audio/mp3","audio/wav","audio/ogg","audio/aac","audio/flac"]},K2=TX.create({name:"file",group:"block",atom:!0,addAttributes:()=>({id:{default:null},file:{default:null},url:{default:null},name:{default:null},type:{default:null},size:{default:null},uploaded:{default:!1}}),parseHTML:()=>[{tag:"file"}],renderHTML({HTMLAttributes:e}){return["file",gY(this.options.HTMLAttributes,e)]},addNodeView:()=>PZ(U2),addCommands(){return{setFile:e=>({commands:t,editor:n})=>t.insertContentAt(n.state.selection.anchor,{type:this.name,attrs:e}),insertFile:({file:e,pos:t})=>({editor:n,commands:r})=>{const{type:o,name:i,size:a}=e,{maxSize:l}=W2.value.file;if(0!==l&&a>l)return void tR("error",`文件”${e.name}“大小超过 ${l/1024/1024}MB 的限制`);const s=t||n.state.selection.anchor;let c="file";o.startsWith("image/")&&q2.image.includes(o)&&(c="image"),o.startsWith("video/")&&q2.video.includes(o)&&(c="video"),o.startsWith("audio/")&&q2.audio.includes(o)&&(c="audio"),r.insertContentAt(s,{type:c,attrs:{["file"===c?"url":"src"]:URL.createObjectURL(e),name:i,type:o,size:a,file:e}})},selectFiles:e=>({editor:t})=>{const n=(e=>{const t=W2.value.file.allowedMimeTypes;if(!e||!["image","video","audio"].includes(e))return t.toString();let n=[...t];return n=n.includes(`${e}/*`)||0===t.length?q2[e]:t.filter((t=>q2[e].includes(t))),0===n.length?"":n.toString()})(e);if(!n){const e=QL({theme:"danger",header:"错误提示",body:"当前文档不允许插入该类型的文件。",placement:"center",onConfirm(){e.destroy()}});return}const{open:r,onChange:o}=lS({accept:n,reset:!0});r(),o((e=>{const n=Array.from(e);n&&n.forEach((e=>{t.chain().focus().insertFile({file:e}).run()}))}))}}}}),G2=document.createElement("div"),Y2=e=>{G2.innerHTML=e;const t=G2.firstChild;return()=>t.cloneNode(!0)},X2=(e,t,n,r)=>e.textarea.addEventListener(t,n,r),Z2=e=>"string"==typeof e?document.querySelector(e):e,J2=navigator.userAgent,Q2=/Mac|iPhone|iPod|iPad/i.test(navigator.platform),e4=/Chrome\//.test(J2),t4=!e4&&/AppleWebKit\//.test(J2),n4=(e,t=0,n=1/0)=>{let r=1;for(;(t=e.indexOf("\n",t)+1)&&t<=n;r++);return r},r4={},o4=Y2("<div><div class=pce-wrapper><div class=pce-overlays><textarea spellcheck=false autocapitalize=off autocomplete=off>"),i4=e=>{e.preventDefault(),e.stopImmediatePropagation()};let a4;document.addEventListener("selectionchange",(()=>null==a4?void 0:a4()));const l4=(e,t,n)=>t.indexOf(e[0])+1||n&&t.indexOf(e[n])+1,s4=(e,t)=>t?e.lastIndexOf("\n",t-1)+1:0,c4=(e,t)=>(t=e.indexOf("\n",t))+1?t:e.length;let u4;const d4=e=>e.replace(/[$+?|.^*()[\]{}\\]/g,"\\$&"),p4=(e,t)=>e.slice(s4(e,t),t),f4=(e,t,n=t)=>[e.slice(t=s4(e,t),n=c4(e,n)).split("\n"),t,n],h4=(e,t,n=0,r=n,o=e.getSelection()[0])=>{var i;const a=e.value,l=e.wrapper.children[n4(a,0,o)],s=document.createTreeWalker(l,5);let c=s.lastChild(),u=c4(a,o)+1-o-c.length;for(;-u<=r&&(c=s.previousNode());)if(!c.lastChild&&(u-=c.length||0,u<=n))for(;c!=l;c=c.parentNode)if(null==(i=c.matches)?void 0:i.call(c,t))return c},m4=(e,t)=>{var n;return(null==(n=h4(e,'[class*="language-"]',0,0,t))?void 0:n.className.match(/language-(\S*)/)[1])||e.options.language},v4=(e,t,n,r,o,i)=>{if(e.options.readOnly)return;u4=e.getSelection(),r??(r=n);let a,l=e.textarea,s=e.value,c=e4&&!s[r??u4[1]]&&/\n$/.test(t)&&/^$|\n$/.test(s);e.focused||l.focus(),null!=n&&l.setSelectionRange(n,r),null!=o&&(a=((e,t,n)=>(e.addListener(t,n),()=>e.removeListener(t,n)))(e,"update",(()=>{l.setSelectionRange(o,i??o,u4[2]),a()}))),t4||l.dispatchEvent(new InputEvent("beforeinput",{data:t})),e4||t4?(c&&(l.selectionEnd--,t=t.slice(0,-1)),t4&&(t+="\n"),document.execCommand(t?"insertHTML":"delete",!1,t.replace(/&/g,"&amp;").replace(/</g,"&lt;")),c&&l.selectionStart++):document.execCommand(t?"insertText":"delete",!1,t),u4=0},g4=e=>e.altKey+2*e.ctrlKey+4*e.metaKey+8*e.shiftKey,b4="xml,rss,atom,jsx,tsx,xquery,actionscript".split(","),y4=/^(?:area|base|w?br|col|embed|hr|img|input|link|meta|source|track)$/i,w4=()=>e=>{var t;let n,r;const{tags:o,pairs:i}=(t=e.extensions).matchTags||(t.matchTags=(e=>{let t,n,r=[],o=[],i=(e,i,l)=>{t=l,o.length=r.length=n=0,a(e,i,0)},a=(e,i,l)=>{let s=b4.includes(i),c=[],u=0;for(let d=0,p=e.length;d<p;){const p=e[d++],f=p.content,h=p.length;if(Array.isArray(f))if("tag"==p.type&&"<"==t[l]){const e=f[0].length,d=f[2]?t.substr(l+e,f[1].length):"",m=f[f.length-1].length<2&&(s||!y4.test(d));if(f[2]&&s&&a(f,i,l),m)if(e>1)for(let t=u;t;)d==c[--t][1]&&(r[r[n]=c[u=t][0]]=n,t=0);else c[u++]=[n,d];o[n++]=[p,l,l+h,d,e>1,m]}else{let e=p.alias||p.type;a(f,"language-"==e.slice(0,9)?e.slice(9):i,l)}l+=h}};return e.addListener("tokenize",i),i(e.tokens,e.options.language,e.value),{tags:o,pairs:r}})(e)),a=e=>[n,r].forEach((t=>{t&&t.classList.toggle("active-tagname",!e)}));e.addListener("selectionChange",(([t,l])=>{let s,c,u;t==l&&e.focused&&(u=((e,t)=>{for(let n=0,r=t.length;n<r;n++)if(t[n][1]<=e&&t[n][2]>=e)return n})(t,o),u+1&&(u=i[u],u+1&&(s=h4(e,".tag>.tag"))&&(c=h4(e,".tag>.tag",2,0,o[u][1])))),n!=s&&(a(!0),n=s,r=c,a())}))},k4=Y2("<div class=guide-indents style=left:var(--padding-left)><div style=position:relative;display:inline-block> "),x4=Y2("<div style=width:1px;position:absolute;background:var(--bg-guide-indent)>"),C4=()=>{let e,t,n,r=0,o=-1;const i=[],a=[],l=k4(),s=l.lastChild,c=[],u=e=>{t=[];const n=p(e.split("\n")),o=n.length;for(let r=0,l=[],s=n[0];s;r++){const e=(i[r]||(i[r]=x4())).style,[o,c,u]=s,d=a[r];s=n[r+1],o!=(null==d?void 0:d[0])&&(e.top=o+"00%"),c!=(null==d?void 0:d[1])&&(e.height=c+"00%"),u!=(null==d?void 0:d[2])&&(e.left=100*u+"%");for(let n=-(l[0]!=o&&(null==s?void 0:s[0])!=o),i=c+(l[0]+l[1]!=o+c&&(null==s?void 0:s[0])+(null==s?void 0:s[1])!=o+c);n<i;n++)t[n+o]=r;l=a[r]=n[r]}for(let t=r;t>o;)i[--t].remove();s.append(...i.slice(r,r=o))},d=()=>{const e=t[n.activeLineNumber-1]??-1;e!=o&&(o>-1&&(i[o].className=""),e>-1&&(i[e].className="active")),o=e},p=t=>{const n=t.length,r=[],o=[];for(let i=0,a=-1,l=0,s=0;;l++){const u=l==n,d=u?0:c[l]=f(t[l]);if(d<0)a<0&&(a=l);else{for(let e=d;e<i;e++)r[e][1]=(a<0||e==d&&!u?l:a)-r[e][0];for(let t=i;t<d;)o[s++]=r[t]=[a<0||t>i?l:a,0,t++*e];a=-1,i=d}if(u)break}return c.length=n,o},f=t=>{let n=t.search(/\S/),r=0;if(n<0)return n;for(let o=0;o<n;)r+="\t"==t[o++]?e-r%e:1;return Math.ceil(r/e)};return{lines:s.children,indentLevels:c,update(t,r){n||(n=t,t.extensions.indentGuides=this,t.overlays.append(l),t.addListener("update",u),t.addListener("selectionChange",d)),l.style.display=r.wordWrap?"none":"",e!=(e=r.tabSize||2)&&(u(t.value),d())}}},O4=Y2("<div style=position:absolute;top:0;opacity:0;padding:inherit> <span></span> "),S4=()=>{let e,t=" ",n=" ";const r=O4(),[o,i,a]=r.childNodes,l=([i,l,s])=>{let{value:c,activeLine:u}=e,d="backward"==s?i:l,p=p4(c,d),f=c.slice(d,c4(c,d));p||f||(f=" "),t!=p&&(o.data=t=p),n!=f&&(a.data=n=f),r.parentNode!=u&&u.prepend(r)},s=()=>((e,t,n=0)=>{const r=e.scrollContainer.style,o=document.documentElement.style;r.scrollPaddingBlock=o.scrollPaddingBlock=`${n}px ${e4&&!t.textContent?t.offsetHeight:0}px`,t.scrollIntoView({block:"nearest"}),r.scrollPaddingBlock=o.scrollPaddingBlock=""})(e,i),c=t=>{t.addListener("selectionChange",l),e=t,t.extensions.cursor=c,X2(t,"input",(e=>{/history/.test(e.inputType)&&s()})),t.activeLine&&l(t.getSelection())};return c.getPosition=()=>{const t=i.getBoundingClientRect(),n=e.overlays.getBoundingClientRect();return{top:t.y-n.y,bottom:n.bottom-t.bottom,left:t.x-n.x,right:n.right-t.x,height:t.height}},c.scrollIntoView=s,c.element=i,c};let E4=!1;const N4=navigator.clipboard,_4=Q2?4:2,M4=e=>e.search(/\S|$/),A4=(e=['""',"''","``","()","[]","{}"],t=/([^$\w'"`]["'`]|.[[({])[.,:;\])}>\s]|.[[({]`/s)=>(n,r)=>{let o;const{keyCommandMap:i,inputCommandMap:a,getSelection:l}=n,s=({insertSpaces:e=!0,tabSize:t})=>[e?" ":"\t",e?t||2:1],c=()=>{var e;return!(null==(e=n.extensions.cursor)?void 0:e.scrollIntoView())},u=([e,r],[o,i],a,l)=>(e<r||!l&&t.test((a[r-1]||" ")+o+(a[r]||" ")))&&!v4(n,o+a.slice(e,r)+i,null,null,e+1,r+1),d=([e,t],r,o)=>e==t&&o[t]==r&&!n.setSelection(e+1),p=(e,t,r,o,i,a)=>{let l=t.join("\n");if(l!=e.join("\n")){const s=e.length-1,c=t[s],u=e[s],d=u.length-c.length,p=t[0].length-e[0].length,f=r+M4((p<0?t:e)[0]),h=o-u.length+M4(d>0?c:u),m=r-o+l.length+d,v=f>i?i:Math.max(f,i+p),g=a+r-o+l.length;v4(n,l,r,o,v,a<h?g+d:Math.max(h+m,g))}},f=(e,t,n,r,o,i,a,l)=>{p(t,t.map(e?e=>e.slice(M4(e)?l-M4(e)%l:0):e=>e&&a.repeat(l-M4(e)%l)+e),n,r,o,i)};a["<"]=(e,t,n)=>u(t,"<>",n,!0),e.forEach((([e,t])=>{const n=e==t;a[e]=(r,o,i)=>(n&&d(o,t,i)||u(o,e+t,i))&&c(),n||(a[t]=(e,n,r)=>d(n,t,r)&&c())})),a[">"]=(e,t,r)=>{var o,i;const a=null==(i=null==(o=r4[m4(n)])?void 0:o.autoCloseTags)?void 0:i.call(o,t,r,n);a&&(v4(n,">"+a,null,null,t[0]+1),i4(e))},i.Tab=(e,[t,o],i)=>{if(E4||r.readOnly||6&g4(e))return;const[a,l]=s(r),u=e.shiftKey,[d,p,h]=f4(i,t,o);return t<o||u?f(u,d,p,h,t,o,a,l):v4(n,a.repeat(l-(t-p)%l)),c()},i.Enter=(e,t,o)=>{var i,a,l;const u=7&g4(e);if(!u||u==_4){u&&(t[0]=t[1]=f4(o,t[1])[2]);const[e,d]=s(r),[p,f]=t,h=null==(i=r4[m4(n)])?void 0:i.autoIndent,m=Math.floor(M4(p4(o,p))/d)*d,v=(null==(a=null==h?void 0:h[0])?void 0:a.call(h,t,o,n))?d:0,g=null==(l=null==h?void 0:h[1])?void 0:l.call(h,t,o,n),b="\n"+e.repeat(m+v)+(g?"\n"+e.repeat(m):"");if(b[1]||o[f])return v4(n,b,p,f,p+m+v+1),c()}},i.Backspace=(t,[o,i],a)=>{if(o==i){const t=p4(a,o),[,i]=s(r),l=e.includes(a.slice(o-1,o+1)),u=t.length%i||i;if(l||1!=u&&!/\S|^$/.test(t))return v4(n,"",o-(l?1:u),o+ +l),c()}};for(let e=0;e<2;e++)i[e?"ArrowDown":"ArrowUp"]=(t,[r,o],i)=>{const a=g4(t);if(1==(7&a)){if(1==a){const t=e?r:s4(i,r)-1,a=e?i.indexOf("\n",o)+1:o;if(t>-1&&a>0){const[l,s,c]=f4(i,t,a),u=l[e?"pop":"shift"](),d=(u.length+1)*(e?1:-1);l[e?"unshift":"push"](u),v4(n,l.join("\n"),s,c,r+d,o+d)}}else{const[t,a,l]=f4(i,r,o),s=t.join("\n"),c=e?s.length+1:0;v4(n,s+"\n"+s,a,l,r+c,o+c)}return c()}};X2(n,"keydown",(e=>{var t;const o=g4(e),i=e.keyCode,[a,u,d]=l();if(o==_4&&(221==i||219==i))return f(219==i,...f4(n.value,a,u),a,u,...s(r)),c();if(o==(Q2?10:2)&&77==i)E4=!E4,i4(e);else if(191==i&&o==_4||65==i&&9==o){const e=n.value,r=9==o,i=r?a:s4(e,a),l=r4[m4(n,i)]||{},{line:s,block:d}=(null==(t=l.getComments)?void 0:t.call(l,n,i,e))||l.comments||{},[f,h,m]=f4(e,a,u),v=f.length-1;if(r){if(d){const[t,r]=d,o=e.slice(a,u),i=e.slice(0,a).search(d4(t)+" ?$"),l=RegExp("^ ?"+d4(r)).test(e.slice(u));i+1&&l?v4(n,o,i,u+ +(" "==e[u])+r.length,i,i+u-a):v4(n,`${t} ${o} ${r}`,a,u,a+t.length+1,u+t.length+1),c()}}else if(s){const t=d4(s),n=RegExp(`^\\s*(${t} ?|$)`),r=RegExp(t+" ?"),o=!/\S/.test(e.slice(h,m)),i=f.map(f.every((e=>n.test(e)))&&!o?e=>e.replace(r,""):e=>o||/\S/.test(e)?e.replace(/^\s*/,`$&${s} `):e);p(f,i,h,m,a,u),c()}else if(d){const[e,t]=d,r=M4(f[0]),o=f[0].startsWith(e,r)&&f[v].endsWith(t),i=f.slice();i[0]=f[0].replace(o?RegExp(d4(e)+" ?"):/(?=\S)|$/,o?"":e+" ");let l=i[0].length-f[0].length;i[v]=o?i[v].replace(RegExp(`( ?${d4(t)})?$`),""):i[v]+" "+t;let s=i.join("\n"),p=r+h,g=p>a?a:Math.max(a+l,p),b=p>u-(a!=u)?u:Math.min(Math.max(p,u+l),h+s.length);v4(n,s,h,m,g,Math.max(g,b)),c()}}else if(o==8+_4&&75==i){const e=n.value,[t,r,o]=f4(e,a,u),i="forward"==d?u-o+t.pop().length:a-r,l=f4(e,o+1)[0][0].length;return v4(n,"",r-!!r,o+!r,r+Math.min(i,l)),c()}})),["copy","cut","paste"].forEach((e=>X2(n,e,(t=>{const[r,i]=l();if(r==i&&N4){const[[a],l,s]=f4(n.value,r,i);"paste"==e?t.clipboardData.getData("text/plain")==o&&(v4(n,o+"\n",l,l,r+o.length+1),c(),i4(t)):(N4.writeText(o=a),"cut"==e&&(v4(n,"",l,s+1),c()),i4(t))}}))))};var T4="\\b(?:BASH(?:OPTS|_ALIASES|_ARG[CV]|_CMDS|_COMPLETION_COMPAT_DIR|_LINENO|_REMATCH|_SOURCE|_VERSINFO|_VERSION)?|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|E?UID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_(?:ADDRESS|ALL|IDENTIFICATION|MEASUREMENT|MONETARY|NAME|NUMERIC|PAPER|TELEPHONE|TIME)|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS[1-4]|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_(?:CONFIG_DIRS|CURRENT_DESKTOP|DATA_DIRS|GREETER_DATA_DIR|MENU_PREFIX|RUNTIME_DIR|SEAT|SEAT_PATH|SESSION_DESKTOP|SESSION_ID|SESSION_PATH|SESSION_TYPE|VTNR)|XMODIFIERS)\\b",V4={pattern:/(^(["']?)\w+\2)[ ]+\S.*/,lookbehind:!0,alias:"punctuation"},j4={variable:/^\$\(|^`|\)$|`$/},B4={bash:V4,environment:{pattern:RegExp("\\$"+T4),alias:"constant"},variable:[{pattern:/\$?\(\([^]*?\)\)/g,greedy:!0,inside:{variable:[{pattern:/(^\$[^]+)../,lookbehind:!0},/^\$\(\(/],number:/\b0x[a-fA-F\d]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|&&|\|\||(?:\*\*|<<|>>|[%&|^!=<>/*+-])=?|[?:~]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:[^()]|\([^)]*\))*\)|`[^`]+`/g,greedy:!0,inside:j4},{pattern:/\$\{[^}]*\}/g,greedy:!0,inside:{operator:/:[?=+-]?|[!/]|##?|%%?|\^\^?|,,?/,punctuation:/[[\]]/,environment:{pattern:RegExp("(\\{)"+T4),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[a-fA-F\d]{8}|u[a-fA-F\d]{4}|x[a-fA-F\d]{1,2})/},P4=V4.inside=xF.sh=xF.shell=xF.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,lookbehind:!0,alias:"variable"},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,lookbehind:!0,alias:"variable",inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+T4),lookbehind:!0,alias:"constant"}}},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?![^\s=])/,lookbehind:!0,alias:"variable"},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[^]*?\n\2/g,lookbehind:!0,greedy:!0,inside:B4},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[^]*?\n\3/g,lookbehind:!0,greedy:!0,inside:{bash:V4}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[^]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^\\"`$])*"/g,lookbehind:!0,greedy:!0,inside:B4},{pattern:/(^|[^$\\])'[^']*'/g,lookbehind:!0,greedy:!0},{pattern:/\$'(?:\\[^]|[^\\'])*'/g,greedy:!0,inside:{entity:B4.entity}}],environment:{pattern:RegExp("\\$?"+T4),alias:"constant"},variable:B4.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|c?fdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cron|crontab|c?split|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff3?|dig|dircolors|dirname|dirs?|dmesg|docker|docker-compose|du|[ef]?grep|eject|env|ethtool|expand|expect|expr|fdformat|fg|file|find|fmt|fold|format|free|fsck|fuser|g?awk|git|g?parted|groupadd|groupdel|groupmod|groups|grub-mkconfig|halt|head|hg|history|host|hostname|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|killall|less|link|ln|logname|logrotate|look|lpc|lprint[dq]?|lprm?|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mm?v|more|most|mtools|m?tr|mutt|nano|nc|netstat|nice|nl|node|nohup|notify-send|nslookup|op|open|passwd|paste|pathchk|ping|p?kill|p?npm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ra[mr]|reboot|remsync|rename|renice|rev|rmdir|rp?m|r?sync|[sr]?cp|screen|sdiff|se[dq]|sendmail|service|s?ftp|shellcheck|shuf|shutdown|sleep|s?locate|[sz]?sh|stat|strace|sudo|sum?|suspend|swapon|sysctl|tac|tail|tar|tee|time|timeout|h?top|touch|traceroute|t?sort|tty|u?mount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vim?|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|g?zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|[ls]et|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[[\]{};\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}};["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"].forEach((e=>j4[e]=P4[e]));var I4=/(?:"(?:\\[^]|[^\\\n"])*"|'(?:\\[^]|[^\\\n'])*')/g,D4=I4.source,L4={rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^)]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}};L4[yF]=xF.css={comment:/\/\*[^]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|${D4})*?(?:;|(?=\\s*\\{))`),inside:L4},url:{pattern:RegExp(`\\burl\\((?:${D4}|(?:[^\\\\\n"')=]|\\\\[^])*)\\)`,"gi"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+D4+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|${D4})*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:I4,greedy:!0},property:{pattern:/(^|[^-\w\xa0-\uffff])(?!\d)(?:(?!\s)[-\w\xa0-\uffff])+(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z\d])[-a-z\d]+(?=\()/i,lookbehind:!0},punctuation:/[(){},:;]/};var R4=(e,t)=>{if(t.has(e))return t.get(e);var n=e,r=H4.call(e).slice(8,-1);if("Object"==r){for(var o in t.set(e,n={}),e)n[o]=R4(e[o],t);e[yF]&&(n[yF]=R4(e[yF],t)),e[wF]&&(n[wF]=e[wF])}else if("Array"==r){t.set(e,n=[]);for(var i=0,a=e.length;i<a;i++)n[i]=R4(e[i],t)}return n},z4=e=>R4(e,new Map),F4=(e,t)=>Object.assign(z4(xF[e]),t),$4=(e,t,n)=>{var r={};for(var o in e)r[o]=e[o],delete e[o];for(var o in r)o==t&&Object.assign(e,n),n.hasOwnProperty(o)||(e[o]=r[o])},H4={}.toString,U4=xF.css,W4={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},q4={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};U4.selector.inside=U4.atrule.inside["selector-function-argument"].inside={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:/\[(?:[^[\]"']|(["'])(?:\\[^]|(?!\1)[^\\\n])*\1)*\]/g,greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xa0-\uffff])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xa0-\uffff])+/,lookbehind:!0},"attr-value":{pattern:/(=\s*)(?:(?!\s)[-\w\xa0-\uffff])+(?=\s*$)|(["'])(?:\\[^]|(?!\2)[^\\\n])*\2/,lookbehind:!0},operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/},$4(U4,"property",{variable:{pattern:/(^|[^-\w\xa0-\uffff])--(?!\d)(?:(?!\s)[-\w\xa0-\uffff])*/i,lookbehind:!0}}),$4(U4,"function",{operator:{pattern:/(\s)[/*+-](?!\S)/,lookbehind:!0},hexcode:{pattern:/\B#[a-f\d]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:(?:alice|cadet|cornflower|deepsky|dodger|midnight|powder|royal|sky|steel)blue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blueviolet|brown|burlywood|chartreuse|chocolate|coral|cornsilk|crimson|(?:dark)?(?:blue|cyan|goldenrod|gr[ae]y|green|khaki|magenta|olivegreen|orange|orchid|red|salmon|seagreen|slateblue|slategr[ae]y|turquoise|violet)|deeppink|dimgr[ae]y|firebrick|floralwhite|(?:forest|lawn|lime|pale|spring)green|fuchsia|gainsboro|ghostwhite|gold|greenyellow|honeydew|hotpink|indianred|indigo|ivory|lavender|lavenderblush|lemonchiffon|light(?:blue|coral|cyan|goldenrodyellow|gr[ae]y|green|pink|salmon|seagreen|skyblue|slategr[ae]y|steelblue|yellow)|lime|linen|maroon|medium(?:aquamarine|blue|orchid|purple|seagreen|slateblue|springgreen|turquoise|violetred)|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orangered|palegoldenrod|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|purple|rebeccapurple|rosybrown|saddlebrown|sandybrown|seashell|sienna|silver|snow|tan|teal|thistle|tomato|transparent|wheat|white|whitesmoke|yellow|yellowgreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{function:/^[^(]+/,unit:W4,number:q4,punctuation:/[(),]/}}],entity:/\\[a-f\d]{1,8}/i,unit:W4,number:q4}),xF.ini={comment:{pattern:/(^[ \f \v]*)[#;].*/m,lookbehind:!0},section:{pattern:/(^[ \f \v]*)\[[^\n\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f \v]*)[^ \f \v\]]+(?:[ \f \v]+[^ \f \v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/[[\]]/}},key:{pattern:/(^[ \f \v]*)[^ \f\n \v=]+(?:[ \f \v]+[^ \f\n \v=]+)*(?=[ \f \v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f \v]*)[^ \f\n \v]+(?:[ \f \v]+[^ \f\n \v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^(["']).+(?=\1$)/,lookbehind:!0}}},punctuation:/=/};var K4=/\b0x[a-f\d]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,G4=/[()[\]{}.,:;]/,Y4=/\b(?:false|true)\b/,X4={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[^]+/}};X4.expression.inside=xF.kts=xF.kt=xF.kotlin={"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:X4},string:/[^]+/}},{pattern:/"(?:\\.|[^\\\n"$]|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\\\)*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:X4},string:/[^]+/}}],char:{pattern:/'(?:[^\\\n']|\\(?:.|u[a-fA-F\d]{0,4}))'/g,greedy:!0},comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"},keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},boolean:Y4,label:{pattern:/\b\w+@|@\w+/,alias:"symbol"},function:{pattern:/(?:`[^\n`]+`|\b\w+)(?=\s*\()|(\.)(?:`[^\n`]+`|\w+)(?=\s*\{)/g,lookbehind:!0,greedy:!0},number:/\b(?:0[xX][a-fA-F\d]+(?:_[a-fA-F\d]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/--|\+\+|&&|\|\||->|[!=]==|!!|[%!=<>/*+-]=?|[?:]:?|\.\.|\b(?:and|inv|shl|u?shr|x?or)\b/,punctuation:G4};var Z4=[{pattern:/&[a-z\d]{1,8};/i,alias:"named-entity"},/&#x?[a-f\d]{1,8};/i],J4={pattern:/<\/?(?!\d)[^\s/=>$<%]+(?:\s(?:\s*[^\s/=>]+(?:\s*=\s*(?!\s)(?:"[^"]*"|'[^']*'|[^\s"'=>]+(?=[\s>]))?|(?=[\s/>])))+)?\s*\/?>/g,greedy:!0,inside:{punctuation:/^<\/?|\/?>$/,tag:{pattern:/^\S+/,inside:{namespace:/^[^:]+:/}},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s"'=>]+)/g,lookbehind:!0,greedy:!0,inside:{punctuation:/^["']|["']$/,entity:Z4}}],"attr-equals":/=/,"attr-name":{pattern:/\S+/,inside:{namespace:/^[^:]+:/}}}};xF.rss=xF.atom=xF.ssml=xF.xml={comment:{pattern:/<!--(?:(?!<!--)[^])*?-->/g,greedy:!0},prolog:{pattern:/<\?[^]+?\?>/g,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/gi,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[^]+(?=\]\s*>$)/,lookbehind:!0,inside:"xml"},string:/"[^"]*"|'[^']*'/,punctuation:/^<!|[>[\]]/,"doctype-tag":/^DOCTYPE/i,name:/\S+/}},cdata:{pattern:/<!\[CDATA\[[^]*?\]\]>/gi,greedy:!0},tag:J4,entity:Z4,"markup-bracket":{pattern:/[()[\]{}]/,alias:"punctuation"}};var Q4=(e,t)=>(e["language-"+t]={pattern:/[^]+/,inside:t},e),e3=(e,t)=>({pattern:RegExp(`(<${e}[^>]*>)(?!</${e}>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])+?(?=</${e}>)`,"gi"),lookbehind:!0,greedy:!0,inside:Q4({"included-cdata":{pattern:/<!\[CDATA\[[^]*?\]\]>/i,inside:Q4({cdata:/^<!\[CDATA\[|\]\]>$/i},t)}},t)}),t3=(e,t)=>({pattern:RegExp(`((?:^|["'\\s])(?:${e})\\s*=\\s*)(?:"[^"]*"|'[^']*'|[^\\s"'=>]+)`,"gi"),lookbehind:!0,greedy:!0,inside:Q4({punctuation:/^["']|["']$/},t)}),n3=xF.svg=xF.mathml=xF.html=xF.markup=z4(xF.xml);n3.tag.inside["attr-value"].unshift(t3("style","css"),t3("on[a-z]+","javascript")),$4(n3,"cdata",{style:e3("style","css"),script:e3("script","javascript")});var r3=e=>(t,n)=>{for(var r=kF(e),o="",i=[],a=0,l=OF(t,n),s=0,c=l.length,u=0;s<c;){var d=l[s++],p=d.length,f=d.type;f&&"ignore"!=f.slice(0,6)?(i[a++]=[u,d],o+=" ".repeat(p)):o+=t.slice(u,u+p),u+=p}var h=0,m=(u=0,e=>{for(var t=0;h<a&&t<e.length;t++){var n=e[t],r=n.content;if(Array.isArray(r))m(r);else{for(var l,s,c=n.length,d=[],p=0,f=u;[l,s]=i[h],l>=u&&l<u+c&&(f<l&&(d[p++]=o.slice(f,l)),f=l+s.length,d[p++]=s,++h!=a););u+=c,p&&(f<u&&(d[p++]=o.slice(f,u)),r?n.content=d:(e.splice(t,1,...d),t+=p-1))}}}),v=r?CF(o,r):[o];return m(v),v},o3=/\/\*[^]*?\*\/|\/\/.*|#(?!\[).*/,i3=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/gi,lookbehind:!0,greedy:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/gi,lookbehind:!0,greedy:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z\d_]*\b(?!\s*\()/],a3=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[a-f\d]+(?:_[a-f\d]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,l3=/<?=>|\?\?=?|\.{3}|\??->|[!=]==|::|--|\+\+|&&|\*\*=?|\|\||>>|<<|[?~]|[.%&|^!=<>/*+-]=?/,s3={pattern:/\{\$(?:[^{}]|\{(?:[^{}]|\{[^}]+\})*\})*\}|(^|[^\\{])\$+(?:\w+(?:\[[^\n[\]]*\]|->\w+)?)/,lookbehind:!0},c3=[{pattern:/<<<'([^']+)'\n(?:.*\n)*?\1;/g,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"\n(?:.*\n)*?\1;|([a-z_]\w*)\n(?:.*\n)*?\2;)/gi,greedy:!0,alias:"heredoc-string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s3}},{pattern:/`(?:\\[^]|[^\\`])*`/g,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[^]|[^\\'])*'/g,greedy:!0,alias:"single-quoted-string"},{pattern:/"(?:\\[^]|[^\\"])*"/g,greedy:!0,alias:"double-quoted-string",inside:{interpolation:s3}}],u3=s3.inside={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},"doc-comment":{pattern:/\/\*\*(?!\/)[^]*?\*\//g,greedy:!0,alias:"comment",inside:"phpdoc"},comment:o3,string:c3,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[^]|[^\\"])*"|'(?:\\[^]|[^\\'])*')+\](?=\s*[a-z$#])/gim,greedy:!0,inside:{"attribute-content":{pattern:/^(..)[^]+(?=.)/,lookbehind:!0,inside:{comment:o3,string:c3,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/gi,lookbehind:!0,greedy:!0,alias:"class-name"},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/gi,lookbehind:!0,greedy:!0,alias:"class-name class-name-fully-qualified",inside:{punctuation:/\\/}}],constant:i3,number:a3,operator:l3,punctuation:G4}},delimiter:{pattern:/.+/,alias:"punctuation"}}},variable:/\$+(?:\w+|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/gi,lookbehind:!0,greedy:!0,alias:"type-casting"},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/gi,lookbehind:!0,greedy:!0,alias:"type-hint"},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/gi,lookbehind:!0,greedy:!0,alias:"return-type"},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/gi,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/gi,lookbehind:!0,greedy:!0,alias:"type-declaration"},{pattern:/\b(?:parent|self|static)(?=\s*::)/gi,greedy:!0,alias:"static-context"},{pattern:/(\byield\s+)from\b/gi,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|[fx]?or|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/gi,lookbehind:!0,greedy:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/gi,lookbehind:!0,greedy:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/gi,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/gi,lookbehind:!0,greedy:!0,alias:"class-name-fully-qualified",inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/gi,greedy:!0,alias:"class-name-fully-qualified",inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/gi,lookbehind:!0,greedy:!0,alias:"class-name-fully-qualified",inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/gi,greedy:!0,alias:"type-declaration"},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/gi,greedy:!0,alias:"class-name-fully-qualified type-declaration",inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/gi,greedy:!0,alias:"static-context"},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/gi,greedy:!0,alias:"class-name-fully-qualified static-context",inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/gi,lookbehind:!0,greedy:!0,alias:"type-hint"},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/gi,lookbehind:!0,greedy:!0,alias:"class-name-fully-qualified type-hint",inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/gi,alias:"return-type",lookbehind:!0,greedy:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/gi,lookbehind:!0,greedy:!0,alias:"class-name-fully-qualified return-type",inside:{punctuation:/\\/}}],constant:i3,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a3,operator:l3,punctuation:G4},d3=r3("html");xF.php={php:{pattern:/<\?(?:[^"'/#]|\/(?![*/])|(["'])(?:\\[^]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^\n?]|\?(?!>))*(?=$|\?>|\n)|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/,alias:"language-php",inside:u3},[wF]:(e,t)=>e.includes("<?")?d3(e,t):CF(e,u3)},$4(xF.php.php.inside,"variable",{this:{pattern:/\$this\b/,alias:"keyword"},global:/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_COOKIE|_ENV|_FILES|_GET|_POST|_REQUEST|_SERVER|_SESSION|arg[cv]|http_response_header|php_errormsg)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/\b(?:parent|self|static)\b/,punctuation:/::|\\/}}}),xF.r={comment:/#.*/,string:{pattern:/(["'])(?:\\.|(?!\1)[^\\\n])*\1/g,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[a-fA-F\d]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->>?|<=|<<?-|[!=<>]=?|::?|&&?|\|\|?|[~^$@/*+-]/,punctuation:/[()[\]{},;]/},xF.basic={comment:{pattern:/(?:!|rem\b).+/i,inside:{keyword:/^rem/i}},string:{pattern:/"(?:""|[#$%&'().,:;\w ?^!=<>/*+-])*"/g,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,keyword:/\b(?:as|beep|bload|bsave|call absolute|call|case|chain|chdir|clear|close|cls|com|common|const|data|declare|def(?: fn| seg|dbl|int|[ls]ng|str)|dim|do|double|else|elseif|environ|erase|error|exit|field|files|for|function|get|gosub|goto|if|input|integer|ioctl|key|kill|line input|locate|lock|long|loop|[lr]set|mkdir|name|next|off|on(?: com| error| key| timer)?|open|option base|[op]ut|poke|read|redim|rem|restore|resume|return|rmdir|run|select case|shared|shell|single|sleep|static|step|stop|string|sub|swap|system|then|timer|to|troff|tron|type|unlock|until|using|view print|wait|w?end|while|write)(?:\$|\b)/i,function:/\b(?:abs|access|a?cos|angle|area|arithmetic|array|a?sin|ask|atn?|base|begin|break|cause|ceil|chr|clip|collate|color|co[nst]|cosh|csc|date|datum|debug|decimal|de[fgt]|degrees|delete|device|display|dot|elapsed|eps|erasable|exline|exp|external|extype|filetype|fixed|fp|go|graph|handler|idn|image|int?|internal|ip|is|keyed|[lu]bound|[lu]case|left|le[nt]|length|lines?|log2?|log10|[lr]trim|margin|ma[tx]|maxnum|mi[dn]|missing|mod|native|nul|numeric|of|option|ord|organization|outin|output|pi|pointer|points?|pos|print|program|prompt|rad|radians|randomize|record|recsize|rectype|relative|remainder|repeat|rest|retry|rewrite|right|rnd|round|same|se[ct]|select|sequential|setter|sgn|sinh|size|skip|s[qt]r|standard|status|stream|style|tab|tanh?|template|text|there|time|timeout|trace|transform|truncate|use|val|variable|viewport|when|window|with|zer|zonewidth)(?:\$|\b)/i,operator:/<=|<>|>=|[&^=<>/*+-]|\b(?:and|eqv|imp|not|x?or)\b/i,punctuation:/[(),:;]/},xF.vbnet=F4("basic",{comment:{pattern:/(?:!|'|rem\b).*/i,inside:{keyword:/^rem/i}},string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/g,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:addhandler|addressof|alias|and|andalso|as|beep|bload|boolean|bsave|byref|byval|call absolute|call|case|catch|cbool|c?byte|cc?har|c?date|cdbl|cdec|chain|chdir|cu?int|class|clear|close|cls|cobj|com|common|const|continue|c?sbyte|c?u?short|c?sng|cstr|c?type|cu?lng|data|decimal|declare|def(?: fn| seg|dbl|int|lng|sng|str)|default|delegate|dim|directcast|do|double|else|elseif|enum|environ|erase|error|event|exit|false|true|field|files|finally|for each|for|friend|function|[gls]et|gettype|getxmlnamespace|global|gosub|goto|handles|i[fns]|implements|imports|inherits|input|interface|ioctl|isnot|key|kill|lib|like|line input|locate|lock|loop|[lr]set|me|mkdir|mod|module|mustinherit|mustoverride|mybase|myclass|name|namespace|narrowing|new|next|not|nothing|notinheritable|notoverridable|object|off?|on (?:com|error|key|timer)|on|open|operator|option base|option|optional|orelse|out|overloads|overridable|overrides|paramarray|partial|poke|private|property|protected|public|put|raiseevent|read|readonly|redim|removehandler|restore|resume|return|rmdir|run|select case|select|shadows|shared|shell|single|sleep|static|step|stop|string|structure|sub|swap|synclock|system|[tw]hen|throw|timer|to|troff|tron|try|trycast|typeof|u?integer|u?long|unlock|until|using|view print|wait|w?end|while|widening|with|withevents|write|writeonly|x?or)|\B#(?:const|else|elseif|end|if))(?:\$|\b)/i,punctuation:/[(){},:;]/});var p3={pattern:/'(?:\\[^]|[^\\\n']){0,32}'/g,greedy:!0},f3={pattern:/\/\/(?:[^\\\n]|\\\n?)*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},h3={pattern:/"(?:\\[^]|[^\\\n"])*"/g,greedy:!0},m3={pattern:/\S[^]*/};m3.inside=xF.c={comment:f3,char:p3,macro:{pattern:/(^[ ]*)#\s*[a-z](?:[^\\\n/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\[^])*/gim,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},h3],char:p3,comment:f3,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=\n)/,expression:m3}},string:h3,"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([^]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[a-f\d]+(?:\.[a-f\d]*)?|\.[a-f\d]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/->|([&|:+-])\1|[?:~]|>>=?|<<=?|[%&|^!=<>/*+-]=?/,punctuation:G4},$4(xF.opencl=F4("c",{keyword:/\b(?:(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|__attribute__|auto|(?:bool|u?(?:char|int|long|short)|half|quad)(?:2|3|4|8|16)?|break|case|complex|const|continue|(?:double|float)(?:16(?:x(?:1|2|4|8|16))?|1x(?:1|2|4|8|16)|2(?:x(?:1|2|4|8|16))?|3|4(?:x(?:1|2|4|8|16))?|8(?:x(?:1|2|4|8|16))?)?|default|do|else|enum|extern|for|goto|if|imaginary|inline|packed|pipe|register|restrict|return|signed|sizeof|static|struct|switch|typedef|uniform|union|unsigned|void|volatile|while)\b/,number:/(?:\b0x(?:[a-f\d]+(?:\.[a-f\d]*)?|\.[a-f\d]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]{0,4}/i,boolean:Y4,"constant-opencl-kernel":{pattern:/\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:GLOBAL|LOCAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|(?:MAX|MIN)(?:(?:_10)?_EXP)?|MANT_DIG)|FLT_RADIX|HUGE_VALF?|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|INFINITY|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN2|LN10|LOG2E?|LOG10E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN|(?:UCHAR|UINT|ULONG|USHRT)_MAX)\b/,alias:"constant"}}),"class-name",{"builtin-type":{pattern:/\b(?:_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|cl_(?:image_format|mem_fence_flags)|clk_event_t|event_t|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|ndrange_t|ptrdiff_t|queue_t|reserve_id_t|sampler_t|size_t|u?intptr_t)\b/,alias:"keyword"}});var v3={"type-opencl-host":{pattern:/\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|int|long|short)|double|float)(?:[2348]|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/,alias:"keyword"},"boolean-opencl-host":{pattern:/\bCL_(?:FALSE|TRUE)\b/,alias:"boolean"},"constant-opencl-host":{pattern:/\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|RA?|READ_(?:ONLY|WRITE)_CACHE|RG|RGB[Ax]?|RG?x|RUNNING|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:8|16|24|_101010|_101010_2)|UNORM_SHORT_5[56]5|VERSION_(?:1_[012]|2_[01])|s?BGRA|sRGB[Ax]?)\b/,alias:"constant"},"function-opencl-host":{pattern:/\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image[23]D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/,alias:"function"}};$4(xF.c,"keyword",v3),xF.cpp&&(v3["type-opencl-host-cpp"]={pattern:/\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image(?:[123]D|[12]DArray|1DBuffer|[23]DGL|Format|GL)?|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|SVMAllocator|SVMTrait(?:Atomic|Coarse|Fine|ReadOnly|ReadWrite|WriteOnly)|Sampler|UserEvent)\b/,alias:"keyword"},$4(xF.cpp,"keyword",v3));var g3=xF.diff={coord:/^(?:\*{3}|-{3}|\+{3}|\d).*$|^@@.*@@$/m},b3={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};for(var y3 in b3){var w3=y3.split("-")[0];g3[y3]={pattern:RegExp("^(?:["+b3[y3]+"].*$\n?)+","m"),alias:w3!=y3?w3:"diff"==y3?"bold":void 0,inside:{prefix:{pattern:RegExp("^["+b3[y3]+"]","mg"),greedy:!0,alias:w3}}}}var k3=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|opens?|package|permits|private|protected|provides|public|record(?!\s*[()[\]{}%~.,:;?%&|^=<>/*+-])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throws?|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,x3="(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",C3={pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},O3={namespace:C3,punctuation:/\./},S3={pattern:RegExp(`(^|[^\\w.])${x3}[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:O3};xF.java={"doc-comment":{pattern:/\/\*\*(?!\/)[^]*?(?:\*\/|$)/g,greedy:!0,alias:"comment",inside:"javadoc"},comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},"triple-quoted-string":{pattern:/"""[ ]*\n(?:\\.|[^\\])*?"""/g,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^\\\n']){1,6}'/g,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\\n"])*"/g,lookbehind:!0,greedy:!0},annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":S3,keyword:k3,punctuation:/[().,:<>]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)${x3}(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:C3,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)${x3}(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:"static",inside:{namespace:C3,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|opens?|package|provides|requires|to|transitive|uses|with)\\s+)(?!${k3.source})[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`),lookbehind:!0,inside:{punctuation:/\./}},"class-name":[S3,{pattern:RegExp(`(^|[^\\w.])${x3}[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:O3},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)${x3}[A-Z]\\w*\\b`),lookbehind:!0,inside:O3}],keyword:k3,boolean:Y4,function:{pattern:/\b\w+(?=\()|(::\s*)[a-z_]\w*/,lookbehind:!0},number:/\b0b[01][01_]*l?\b|\b0x(?:\.[a-f\d_p+-]+|[a-f\d_]+(?:\.[a-f\d_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,constant:/\b[A-Z][A-Z_\d]+\b/,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[%&|^!=<>/*+-]=?)/m,lookbehind:!0},punctuation:G4},$4(xF.less=F4("css",{comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[():]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[/*+-]/}),"property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),xF.objc=xF.objectivec=F4("c",{string:{pattern:/@?"(?:\\[^]|[^\\\n"])*"/g,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int?|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|==?|>>?=?|<<?=?|&&?|\|\|?|[~^@%?/*]/}),delete xF.objc["class-name"];var E3={pattern:/^(..)[^]+(?=.)/,lookbehind:!0},N3="(?:([^a-zA-Z\\d\\s{(\\[<=])(?:\\\\[\\s\\S]|(?!\\1)[^\\\\])*\\1|\\((?:\\\\[\\s\\S]|[^\\\\()]|\\((?:\\\\[\\s\\S]|[^\\\\()])*\\))*\\)|\\{(?:\\\\[\\s\\S]|[^\\\\{}]|\\{(?:\\\\[\\s\\S]|[^\\\\{}])*\\})*\\}|\\[(?:\\\\[\\s\\S]|[^\\\\[\\]]|\\[(?:\\\\[\\s\\S]|[^\\\\[\\]])*\\])*\\]|<(?:\\\\[\\s\\S]|[^\\\\<>]|<(?:\\\\[\\s\\S]|[^\\\\<>])*>)*>)",_3='(?:"(?:\\\\.|[^\\\\\n"])*"|(?:\\b(?!\\d)\\w+|[^\\s\0-\\x7f]+)[?!]?|\\$.)',M3={pattern:/((?:^|[^\\])(?:\\\\)*)#\{(?:[^{}]|\{[^}]*\})*\}/,lookbehind:!0,inside:{content:E3,delimiter:{pattern:/.+/,alias:"punctuation"}}};E3.inside=xF.rb=xF.ruby={comment:{pattern:/#.*|^=begin\s[^]*?^=end/gm,greedy:!0},"string-literal":[{pattern:RegExp("%[qQiIwWs]?"+N3,"g"),greedy:!0,inside:{interpolation:M3,string:/[^]+/}},{pattern:/(["'])(?:#\{[^}]+\}|#(?!\{)|\\[^]|(?!\1)[^\\#\n])*\1/g,greedy:!0,inside:{interpolation:M3,string:/[^]+/}},{pattern:/<<[-~]?([a-z_]\w*)\n(?:.*\n)*?[ ]*\1/gi,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\w+/,punctuation:/^<<[-~]?/}},interpolation:M3,string:/[^]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'\n(?:.*\n)*?[ ]*\1/gi,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[^]+/}}],"command-literal":[{pattern:RegExp("%x"+N3,"g"),greedy:!0,inside:{interpolation:M3,command:{pattern:/[^]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\[^]|[^\\`#\n])*`/g,greedy:!0,inside:{interpolation:M3,command:{pattern:/[^]+/,alias:"string"}}}],"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},"regex-literal":[{pattern:RegExp(`%r${N3}[egimnosux]{0,6}`,"g"),greedy:!0,inside:{interpolation:M3,regex:/[^]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\n\]]+\]|\\.|[^\\\n/[])+\/[egimnosux]{0,6}(?=\s*(?:$|[\n,.;})#]))/g,lookbehind:!0,greedy:!0,inside:{interpolation:M3,regex:/[^]+/}}],variable:/[@$]+(?!\d)\w+(?:[?!]|\b)/,symbol:[{pattern:RegExp("(^|[^:]):"+_3,"g"),lookbehind:!0,greedy:!0},{pattern:RegExp("([\n{(,][ \t]*)"+_3+"(?=:(?!:))","g"),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|f?or|if|in|include|module|new|next|nil|not|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|[tw]hen|throw|undef|unless|until|while|yield)\b/,boolean:Y4,builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z\d_]*(?:[?!]|\b)/,number:K4,"double-colon":{pattern:/::/,alias:"punctuation"},operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[%&|^!=<>/*+-])=?|[?:]/,punctuation:/[()[\]{}.,;]/},xF.sql={comment:/\/\*[^]*?\*\/|(?:--|\/\/|#).*/,variable:[{pattern:/@(["'`])(?:\\[^]|(?!\1)[^\\])+\1/g,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])(["'])(?:\\[^]|(?!\2)[^\\]|\2\2)*\2/g,lookbehind:!0,greedy:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[^]|[^\\`]|``)*`/g,lookbehind:!0,greedy:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:avg|count|first|format|last|[lu]case|len|max|mi[dn]|mod|now|round|sum)(?=\s*\()/i,keyword:/\b(?:action|add|after|algorithm|alter|analyze|any|apply|asc?|authorization|auto_increment|backup|bdb|begin|berkeleydb|bigint|binary|bit|blob|bool|boolean|break|browse|[br]tree|bulk|by|c?all|cascaded?|case|chain|character|charset|check(?:point)?|close|clustered|coalesce|collate|columns?|comment|commit(?:ted)?|compute|connect|consistent|constraint|contains(?:table)?|continue|convert|create|cross|current(?:_date|_time|_timestamp|_user)?|cursor|cycle|data(?:bases?)?|date(?:time)?|day|dbcc|deallocate|dec|decimal|declare|default|definer|delayed|delete|delimiters?|deny|desc|describe|deterministic|disable|discard|disk|distinct|distinctrow|distributed|do|double|drop|dummy|dump(?:file)?|duplicate|else(?:if)?|enable|enclosed|end|engine|enum|errlvl|errors|escaped?|except|exec(?:ute)?|exists|exit|explain|extended|fetch|fields|file|fillfactor|first|fixed|float|following|for each row|for|force|foreign|freetexttable|freetext|from|full|function|geometry(?:collection)?|global|goto|grant|group|handler|hash|having|holdlock|hour|identity(?:col|_insert)?|if|ignore|import|index|infile|inner|innodb|inout|insert|integer|intersect|interval|into?|invoker|isolation|iterate|join|keys?|kill|language|last|leave|left|level|limit|lineno|lines|linestring|load|local|lock|long(?:blob|text)|loop|matched|match|(?:medium|tiny)(?:blob|int|text)|merge|middleint|minute|mode|modifies|modify|month|multi(?:linestring|point|polygon)|national|natural|n?char|next|no|nonclustered|nullif|numeric|off?|offsets?|on|open(?:datasource|query|rowset)?|optimize|option(?:ally)?|order|out(?:er|file)?|over|partial|partition|percent|pivot|plan|point|polygon|preceding|precision|prepare|prev|primary|print|privileges|proc(?:edure)?|public|purge|quick|raiserror|reads?|real|reconfigure|references|release|rename|repeat(?:able)?|replace|replication|require|resignal|restore|restrict|returning|returns?|revoke|right|rollback|routine|row(?:count|guidcol|s)?|rule|savepoint|save|schema|second|select|serializable|serial|session_user|session|setuser|set|share|show|shutdown|simple|smallint|snapshot|some|soname|sql|start(?:ing)?|statistics|status|striped|system_user|tables?|tablespace|temp(?:orary|table)?|terminated|textsize|text|[tw]hen|timestamp|time|top?|transactions?|tran|trigger|truncate|tsequal|types?|unbounded|uncommitted|undefined|union|unique|unlock|unpivot|unsigned|updatetext|update|usage|user?|using|values?|var(?:binary|char|character|ying)|view|waitfor|warnings|where|while|with(?: rollup|in)?|work|writetext|write|year)\b/i,boolean:/\b(?:false|true|null)\b/i,number:/\b0x[a-f\d]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[=%~^/*+-]|&&?|\|\|?|!=?|<<|<=?>?|>[>=]?|\b(?:and|between|div|[ir]?like|in|is|not|x?or|regexp|sounds like)\b/i,punctuation:/[()[\].,;`]/},xF.wasm={comment:/\(;[^]*?;\)|;;.*/,string:{pattern:/"(?:\\[^]|[^\\"])*"/g,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:[fi]32|[fi]64)(?:\.(?:abs|a[dn]d|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|x?or))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*./:<=>?@\\^`|~+-]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[a-fA-F\d](?:_?[a-fA-F\d])*(?:\.[a-fA-F\d](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[a-fA-F\d](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};var A3=(e,t)=>{for(var n=0;n<t;n++)e=e.replace(/<self>/g,`(?:${e})`);return e.replace(/<self>/g,"[]")},T3=(e,t)=>e.replace(/<(\d+)>/g,((e,n)=>`(?:${t[+n]})`)),V3=(e,t,n)=>RegExp(T3(e,t),n),j3=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,B3=xF.cpp=F4("c",{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!${j3.source})\\w+`),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[a-z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:j3,number:{pattern:/(?:\b0b[01']+|\b0x(?:[a-f\d']+(?:\.[a-f\d']*)?|\.[a-f\d']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/gi,greedy:!0},operator:/->|--|\+\+|&&|\|\||[?:~]|<=>|>>=?|<<=?|[%&|^!=<>/*+-]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|x?or|x?or_eq)\b/,boolean:Y4});$4(B3,"string",{module:{pattern:V3('(\\b(?:import|module)\\s+)(?:"(?:\\\\[\\s\\S]|[^\\\\\n"])*"|<[^<>\n]*>|<0>(?:\\s*:\\s*<0>)?|:\\s*<0>)',[`\\b(?!${j3.source})\\w+(?:\\s*\\.\\s*\\w+)*\\b`],"g"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][^]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([^]*?\)\1"/g,greedy:!0,alias:"string"}}),$4(B3,"keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[^]+/,alias:"class-name",inside:B3}}}}),$4(B3,"operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var P3=Object.assign({},B3);$4(B3,"class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/g,lookbehind:!0,greedy:!0,inside:P3}}),$4(P3,"double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i}),xF.go={comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},char:{pattern:/'(?:\\.|[^\\\n']){0,10}'/g,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\\n"])*"|`[^`]*`/g,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|true|iota|nil)\b/,function:/\b\w+(?=\()/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/--|\+\+|&&|\|\||&\^=?|<-|<<=?|>>=?|[%&|^!=<>/*+-]=?|:=|\.{3}/,punctuation:G4,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/};var I3={};xF.js=xF.javascript=Object.assign(I3,{"doc-comment":{pattern:/\/\*\*(?!\/)[^]*?(?:\*\/|$)/g,greedy:!0,alias:"comment",inside:"jsdoc"},comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},hashbang:{pattern:/^#!.*/g,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[^]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})*\}|(?!\$\{)[^\\`])*`/g,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\\\)*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})*\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},[yF]:I3}},string:/[^]+/}},"string-property":{pattern:/((?:^|[,{])[ ]*)(["'])(?:\\[^]|(?!\2)[^\\\n])*\2(?=\s*:)/gm,lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/(["'])(?:\\[^]|(?!\1)[^\\\n])*\1/g,greedy:!0},regex:{pattern:/((?:^|[^$\w\xa0-\uffff"'`.)\]\s]|\b(?:return|yield))\s*)\/(?:(?:\[(?:\\.|[^\\\n\]])*\]|\\.|[^\\\n/[])+\/[dgimyus]{0,7}|(?:\[(?:\\.|[^\\\n[\]]|\[(?:\\.|[^\\\n[\]]|\[(?:\\.|[^\\\n[\]])*\])*\])*\]|\\.|[^\\\n/[])+\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?!\/\*|[^()[\]{}.,:;?`\n%&|^!=<>/*+-]))/g,lookbehind:!0,greedy:!0,inside:{"regex-flags":/\w+$/,"regex-delimiter":/^\/|\/$/,"regex-source":{pattern:/.+/,alias:"language-regex",inside:"regex"}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)(?!\d)(?:(?!\s)[$\w.\xa0-\uffff])+/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/(^|[^$\w\xa0-\uffff]|\s)(?![a-z\d])(?:(?!\s)[$\w\xa0-\uffff])+(?=\.(?:constructor|prototype)\b)/,lookbehind:!0}],"function-variable":{pattern:/#?(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^)]*\))*\)|(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+)\s*=>))/,alias:"function",inside:{"maybe-class-name":/^[A-Z].*/}},parameter:[/(function(?:\s+(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,/(^|[^$\w\xa0-\uffff]|\s)(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+(?=\s*=>)/,/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while|yield|class|const|debugger|delete|enum|extends|function|[gs]et|export|from|import|implements|in|instanceof|interface|let|new|null|of|package|private|protected|public|static|super|this|typeof|undefined|var|void|with)(?![$\w\xa0-\uffff]))(?:(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/].map((e=>({pattern:e,lookbehind:!0,inside:I3}))),constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/,keyword:[{pattern:/(^|[^.]|\.{3}\s*)\b(?:as|assert(?=\s*\{)|export|from(?!\s*[^\s"'])|import)\b/,alias:"module",lookbehind:!0},{pattern:/(^|[^.]|\.{3}\s*)\b(?:await|break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow",lookbehind:!0},{pattern:/(^|[^.]|\.{3}\s*)\b(?:async(?!\s*[^\s($\w\xa0-\uffff])|class|const|debugger|delete|enum|extends|function|[gs]et(?!\s*[^\s#[$\w\xa0-\uffff])|implements|in|instanceof|interface|let|new|null|of|package|private|protected|public|static|super|this|typeof|undefined|var|void|with)\b/,lookbehind:!0}],boolean:Y4,function:{pattern:/#?(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,inside:{"maybe-class-name":/^[A-Z].*/}},number:{pattern:/(^|[^$\w])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][a-fA-F\d]+(?:_[a-fA-F\d]+)*n?|\d+(?:_\d+)*n|(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?)(?![$\w])/,lookbehind:!0},"literal-property":{pattern:/([\n,{][ ]*)(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+(?=\s*:)/,lookbehind:!0,alias:"property"},operator:[{pattern:/=>/,alias:"arrow"},/--|\+\+|(?:\*\*|&&|\|\||[!=]=|>>>?|<<|[%&|^!=<>/*+-]|\?\?)=?|\.{3}|\?(?!\.)|~|:/],"property-access":{pattern:/(\.\s*)#?(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+/,lookbehind:!0,inside:{"maybe-class-name":/^[A-Z].*/}},"maybe-class-name":{pattern:/(^|[^$\w\xa0-\uffff])[A-Z][$\w\xa0-\uffff]+/,lookbehind:!0},punctuation:/\?\.|[()[\]{}.,:;]/});var D3=xF.js,L3=D3["template-string"],R3=L3.pattern.source,z3=L3.inside.interpolation.pattern,F3=(e,t)=>({pattern:RegExp("((?:"+t+")\\s*)"+R3,"g"),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},["language-"+e]:{pattern:/[^]+/,inside:{interpolation:{pattern:z3,lookbehind:!0,alias:"language-javascript",inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},[yF]:"js"}},[wF]:r3(e)}}}});D3["template-string"]=[F3("css","\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)"),F3("html","\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?="),F3("svg","\\bsvg"),F3("markdown","\\b(?:markdown|md)"),F3("graphql","\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)"),F3("sql","\\bsql"),L3];var $3="\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))*\\*/",H3="\\{(?:[^{}]|\\{(?:[^{}]|\\{[^}]*\\})*\\})*\\}",U3=T3("\\{<0>*\\.{3}(?:[^{}]|<1>)*\\}",[$3,H3]),W3=e=>e&&(!e.type||"plain-text"==e.type),q3=(e,t)=>{$4(xF[t]=e=z4(e),"regex",{tag:{pattern:V3("</?(?:(?!\\d)[^\\s/=><%]+(?:<0>(?:<0>*(?:[^\\s<>/={*]+(?:<0>*=<0>*(?!\\s)(?:\"[^\"]*\"|'[^']*'|<1>)?|(?=[\\s/>]))|<2>))+)?<0>*/?)?>",[$3,H3,U3],"g"),greedy:!0,inside:{punctuation:/^<\/?|\/?>$/,tag:{pattern:/^[^\s/]+/,inside:{namespace:/^[^:]+:/,"class-name":/^[A-Z]\w*(?:\.[A-Z]\w*)*$/}},script:{pattern:V3("(=<0>*)<1>",[$3,H3]),lookbehind:!0,alias:t="language-"+t,inside:e},spread:{pattern:RegExp(U3),alias:t,inside:e},"attr-value":{pattern:V3("(=<0>*)(?:\"[^\"]*\"|'[^']*')",[$3]),lookbehind:!0,inside:{punctuation:/^["']|["']$/}},comment:e.comment,"attr-equals":/=/,"attr-name":{pattern:/\S+/,inside:{namespace:/^[^:]+:/}}}}}),e[wF]=(e,t)=>((e,t,n)=>{for(var r=0,o=[],i=0;r<e.length;r++){var a,l,s,c,u,d=e[r],p=d.length,f=d.type,h=!f;f&&(u=d.content,"tag"==f?(s=u[0].length,l=u[2]?t.substr(n+s,u[1].length):"",s>1?i&&o[i-1][0]==l&&i--:u[u.length-1].length<2&&(o[i++]=[l,0])):i&&"punctuation"==f?(a=o[i-1],"{"==u?a[1]++:a[1]&&"}"==u?a[1]--:h=!"}()[]".includes(u)):h=!0),h&&i&&!o[i-1][1]&&(s=n,W3(e[r+1])&&(p+=e[r+1].length,e.splice(r+1,1)),W3(e[r-1])&&(s-=e[--r].length,e.splice(r,1)),c=t.slice(s,n+p),e[r]=new TF("plain-text",c,c)),n+=p}return e})(OF(e,t),e,0)};q3(xF.js,"jsx"),xF.lua={comment:/^#!.+|--(?:\[(=*)\[[^]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\n]|\\z\s|\\[^z])*\1|\[(=*)\[[^]*?\]\2\]/g,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|true|f?or|function|goto|if|in|local|nil|not|repeat|return|then|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:{pattern:/[%&|^#*+-]|\/\/?|<[<=]?|>[>=]?|[=~]=?|(^|[^.])\.\.(?!\.)/,lookbehind:!0},punctuation:/[()[\]{},;]|\.+|:+/};var K3="(?:\\((?:\\\\[\\s\\S]|[^\\\\()])*\\)|\\{(?:\\\\[\\s\\S]|[^\\\\{}])*\\}|\\[(?:\\\\[\\s\\S]|[^\\\\[\\]])*\\]|<(?:\\\\[\\s\\S]|[^\\\\<>])*>)",G3="(?![a-zA-Zd])\\s*(?:([^a-zA-Zd\\s{([<])(?:\\\\[^]|(?!\\1)[^\\\\])*\\1|([a-zA-Zd])(?:\\\\[^]|(?!\\2)[^\\\\])*\\2";xF.perl={comment:[{pattern:/(^\s*)=\w[^]*?=cut.*/gm,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/g,lookbehind:!0,greedy:!0}],string:{pattern:RegExp(`\\bq[qwx]?${G3}|${K3})|("|\`)(?:\\\\[^]|(?!\\3)[^\\\\])*\\3|'(?:\\\\.|[^\\\\\n'])*'`,"g"),greedy:!0},regex:[{pattern:RegExp(`\\b(?:m|qr)${G3}|${K3})[msixpodualngc]*`,"g"),greedy:!0},{pattern:RegExp(`(^|[^-])\\b(?:s|tr|y)(?![a-zA-Zd])\\s*(?:([^a-zA-Zd\\s{([<])(?:\\\\[^]|(?!\\2)[^\\\\])*\\2(?:\\\\[^]|(?!\\2)[^\\\\])*\\2|([a-zA-Zd])(?:\\\\[^]|(?!\\3)[^\\\\])*\\3(?:\\\\[^]|(?!\\3)[^\\\\])*\\3|${K3}\\s*${K3})[msixpodualngcer]*`,"g"),lookbehind:!0,greedy:!0},{pattern:/\/(?:\\.|[^\\\n/])*\/[msixpodualngc]*(?=\s*(?:$|[\n,.;})&|*~<>!?^+-]|(?:and|cmp|eq|[gl][et]|ne|not|x|x?or)\b))/g,greedy:!0}],variable:/[&*$@%](?:\{\^[A-Z]+\}|\^[A-Z_]|#?(?=\{)|#?(?:(?:::)*'?(?!\d)[$\w]+(?![$\w]))+(?:::)*|\d+)|(?!%=)[$@%][!"#$%&'*,./:;<=>?@()[\]{}||^_`|~+-]/,filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ ]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[a-fA-F\d](?:_?[a-fA-F\d])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|->|=>|=~|~~|<=>?|!~|--|\+\+|(?:\*\*|\/\/|&&|\|\||<<|>>|[~%&|^!=<>/*+-])=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|[gl][et]|ne|not|x?or)\b/,punctuation:/[()[\]{},:;]/};var Y3={"format-spec":{pattern:/(:)[^(){}:]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"}};Y3[yF]=xF.py=xF.python={comment:{pattern:/#.*/g,greedy:!0},"string-interpolation":{pattern:/(?:fr?|rf)(?:("""|''')[^]*?\1|(["'])(?:\\[^]|(?!\2)[^\\\n])*\2)/gi,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})*\}/,lookbehind:!0,inside:Y3},string:/[^]+/}},"triple-quoted-string":{pattern:/(?:br?|rb?|u)?("""|''')[^]*?\1/gi,greedy:!0,alias:"string"},string:{pattern:/(?:br?|rb?|u)?(["'])(?:\\[^]|(?!\1)[^\\\n])*\1/gi,greedy:!0},function:{pattern:/((?:^|\s)def[ ]+)(?!\d)\w+(?=\s*\()/,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[ ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:"annotation punctuation",inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|de[fl]|elif|else|except|exec|finally|f?or|from|global|i[fns]|import|lambda|match|nonlocal|not|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|ma[px]|memoryview|min|next|object|oct|open|ord|pow|property|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|x?range|zip)\b/,boolean:/\b(?:False|True|None)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f\d])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/!=|:=|\*\*=?|\/\/=?|<>|>>|<<|[%=<>/*+-]=?|[&|^~]/,punctuation:G4};var X3=A3("/\\*(?:[^*/]|\\*(?!/)|/(?!\\*)|<self>)*\\*/",2),Z3={pattern:/b?"(?:\\[^]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/g,greedy:!0},J3={"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"}};J3[yF]=xF.rust={comment:{pattern:RegExp("//.*|"+X3,"g"),greedy:!0},string:Z3,char:{pattern:/b?'(?:\\(?:x[0-7][a-fA-F\d]|u\{(?:[a-fA-F\d]_*){1,6}\}|.)|[^\\\n '])'/g,greedy:!0},attribute:{pattern:/#!?\[(?:[^[\]"]|"(?:\\[^]|[^\\"])*")*\]/g,greedy:!0,alias:"attr-name",inside:{string:Z3}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/g,lookbehind:!0,greedy:!0,inside:J3},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield|bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/,function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[a-fA-F\d](?:_?[a-fA-F\d])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:Y4,punctuation:/->|\.\.=|\.{1,3}|::|[()[\]{},:;]/,operator:/&&|\|\||=>|>>=?|<<=?|[%&|^!=<>/*+-]=?|[@?]/};var Q3=xF.swift={comment:{pattern:/\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//g,greedy:!0},"string-literal":[{pattern:/(^|[^"#])(?:"(?:\\(?:\((?:[^()]|\([^)]*\))*\)|[^(])|[^\\\n"])*"|"""(?:\\(?:\((?:[^()]|\([^)]*\))*\)|[^(])|[^\\"]|"(?!""))*""")(?!["#])/g,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))+(?=\))/,lookbehind:!0},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=\n)/,string:/[^]+/}},{pattern:/(^|[^"#])(#+)(?:"(?:\\(?:#+\((?:[^()]|\([^)]*\))*\)|[^#])|[^\\\n])*?"|"""(?:\\(?:#+\((?:[^()]|\([^)]*\))*\)|[^#])|[^\\])*?""")\2/g,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))+(?=\))/,lookbehind:!0},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[^]+/}}],directive:{pattern:/#(?:(?:elseif|if)\b(?:[ ]*(?:![ ]*)?(?:\b\w+\b(?:[ ]*\((?:[^()]|\([^)]*\))*\))?|\((?:[^()]|\([^)]*\))*\))(?:[ ]*(?:&&|\|\|))?)+|(?:else|endif)\b)/,alias:"property",inside:{"directive-name":/^#\w+/,boolean:Y4,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b(?!\d)\w+(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|[Pp]rotocol|[Ss]elf|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|[gs]et|guard|higherThan|i[fns]|import|indirect|infix|init|inout|internal|isolated|lazy|lef?t|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|public|repeat|required|rethrows|return|right|safe|some|static|struct|subscript|super|switch|throws?|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:Y4,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f\d_]+(?:\.[a-f\dp_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[~?%&|^!=<>/*+-]+|\.[.~?%&|^!=<>/*+-]+/,punctuation:/[()[\]{}.,:;\\]/};Q3["string-literal"].forEach((e=>{e.inside.interpolation.inside=Q3})),xF.clike={comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},string:{pattern:/(["'])(?:\\[^]|(?!\1)[^\\\n])*\1/g,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:Y4,function:/\b\w+(?=\()/,number:K4,operator:/[!=]==|[!=<>]=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:G4};var e5=e=>`\\b(?:${e})\\b`,t5="bool|char|decimal|double|dynamic|float|object|s?byte|string|u?int|u?long|u?short|var|void",n5="class|enum|interface|record|struct",r5="add|alias|and|ascending|async|await|by|descending|from(?!\\s*[^\\s\\w])|[gls]et|global|group|into|init(?=\\s*;)|join|nameof|not|notnull|on|or|orderby|partial|remove|select|unmanaged|value|when|where|with(?=\\s*{)",o5="abstract|as|[bc]ase|break|catch|checked|const|continue|default|delegate|do|else|event|explicit|extern|finally|fixed|for|foreach|goto|i[fns]|implicit|internal|lock|namespace|new|null|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|yield",i5=e5(n5),a5=RegExp(e5(t5+"|"+n5+"|"+r5+"|"+o5)),l5=e5(n5+"|"+r5+"|"+o5),s5=e5(t5+"|"+n5+"|"+o5),c5=A3("<(?:[^<>;=*/%&|^+-]|<self>)*>",2),u5=A3("\\((?:[^()]|<self>)*\\)",2),d5="@?\\b(?!\\d)\\w+\\b",p5=T3("<0>(?:\\s*<1>)?",[d5,c5]),f5=T3("(?!<0>)<1>(?:\\s*\\.\\s*<1>)*",[l5,p5]),h5="\\[\\s*(?:,\\s*)*\\]",m5=T3("<0>(?:\\s*(?:\\?\\s*)?<1>)*(?:\\s*\\?)?",[f5,h5]),v5=T3("[^()[\\],;%&|^=<>/*+-]|<0>|<1>|<2>",[c5,u5,h5]),g5=T3("\\(<0>+(?:,<0>+)+\\)",[v5]),b5=T3("(?:<0>|<1>)(?:\\s*(?:\\?\\s*)?<2>)*(?:\\s*\\?)?",[g5,f5,h5]),y5={keyword:a5,punctuation:/[()[\].,:<>?]/},w5="'(?:\\\\.|[^\n'\\\\]|\\\\[Uux][a-fA-F\\d]{1,8})'",k5='"(?:\\\\.|[^\\\\\n"])*"',x5=xF.dotnet=xF.cs=xF.csharp=F4("clike",{string:[{pattern:V3("(^|[^$\\\\])<0>",['@"(?:""|\\\\[\\s\\S]|[^\\\\"])*"(?!")'],"g"),lookbehind:!0,greedy:!0},{pattern:V3("(^|[^@$\\\\])<0>",[k5],"g"),lookbehind:!0,greedy:!0}],"class-name":[{pattern:V3("(\\busing\\s+static\\s+)<0>(?=\\s*;)",[f5]),lookbehind:!0,inside:y5},{pattern:V3("(\\busing\\s+<0>\\s*=\\s*)<1>(?=\\s*;)",[d5,b5]),lookbehind:!0,inside:y5},{pattern:V3("(\\busing\\s+)<0>(?=\\s*=)",[d5]),lookbehind:!0},{pattern:V3("(\\b<0>\\s+)<1>",[i5,p5]),lookbehind:!0,inside:y5},{pattern:V3("(\\bcatch\\s*\\(\\s*)<0>",[f5]),lookbehind:!0,inside:y5},{pattern:V3("(\\bwhere\\s+)<0>",[d5]),lookbehind:!0},{pattern:V3("(\\b(?:is(?:\\s+not)?|as)\\s+)<0>",[m5]),lookbehind:!0,inside:y5},{pattern:V3("\\b<0>(?=\\s+(?!<1>|with\\s*\\{)<2>(?:\\s*[=,:;{)\\]]|\\s+(?:in|when)\\b))",[b5,s5,d5]),inside:y5}],keyword:a5,number:/(?:\b0(?:x[a-f\d_]*[a-f\d]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[+-]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/[=-]>|([&|+-])\1|~|\?\?=?|>>=?|<<=?|[%&|^!=<>/*+-]=?/,punctuation:/\?\.?|::|[()[\]{}.,:;]/});$4(x5,"number",{range:{pattern:/\.\./,alias:"operator"}}),$4(x5,"punctuation",{"named-parameter":{pattern:V3("([(,]\\s*)<0>(?=\\s*:)",[d5]),lookbehind:!0,alias:"punctuation"}}),$4(x5,"class-name",{namespace:{pattern:V3("(\\b(?:namespace|using)\\s+)<0>(?:\\s*\\.\\s*<0>)*(?=\\s*[;{])",[d5]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:V3("(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<0>)+(?=\\s*\\))",[u5]),lookbehind:!0,alias:"class-name",inside:y5},"return-type":{pattern:V3("<0>(?=\\s+(?:<1>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))",[b5,f5]),alias:"class-name",inside:y5},"constructor-invocation":{pattern:V3("(\\bnew\\s+)<0>(?=\\s*[[({])",[b5]),lookbehind:!0,alias:"class-name",inside:y5},"generic-method":{pattern:V3("<0>\\s*<1>(?=\\s*\\()",[d5,c5]),inside:{function:V3("^<0>",[d5]),generic:{pattern:RegExp(c5),alias:"class-name",inside:y5}}},"type-list":{pattern:V3("\\b((?:<0>\\s+<1>|record\\s+<1>\\s*<5>|where\\s+<2>)\\s*:\\s*)(?:<3>|<4>|<1>\\s*<5>|<6>)(?:\\s*,\\s*(?:<3>|<4>|<6>))*(?=\\s*(?:where|[{;]|=>|$))",[i5,p5,d5,b5,a5.source,u5,"\\bnew\\s*\\(\\s*\\)"]),lookbehind:!0,inside:{"record-arguments":{pattern:V3("(^(?!new\\s*\\()<0>\\s*)<1>",[p5,u5],"g"),lookbehind:!0,greedy:!0,inside:x5},keyword:a5,"class-name":{pattern:RegExp(b5,"g"),greedy:!0,inside:y5},punctuation:/[(),]/}},preprocessor:{pattern:/(^[ ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var C5=k5+"|"+w5,O5=T3("/(?![*/])|//[^\n]*\n|/\\*(?:[^*]|\\*(?!/))*\\*/|<0>",[C5]),S5=A3(T3("[^()\"'/]|<0>|\\(<self>*\\)",[O5]),2),E5="\\b(?:assembly|event|field|method|module|param|property|return|type)\\b",N5=T3("<0>(?:\\s*\\(<1>*\\))?",[f5,S5]),_5=":[^\n}]+",M5=A3(T3("[^()\"'/]|<0>|\\(<self>*\\)",[O5]),2),A5=T3("\\{(?!\\{)(?:(?![}:])<0>)*<1>?\\}",[M5,_5]),T5=A3(T3("[^()\"'/]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<0>|\\(<self>*\\)",[C5]),2),V5=T3("\\{(?!\\{)(?:(?![}:])<0>)*<1>?\\}",[T5,_5]),j5=(e,t)=>({interpolation:{pattern:V3("((?:^|[^{])(?:\\{\\{)*)<0>",[e]),lookbehind:!0,inside:{"format-string":{pattern:V3("(^\\{(?:(?![}:])<0>)*)<1>(?=\\}$)",[t,_5]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[^]+/,alias:"language-csharp",inside:x5}}},string:/[^]+/});$4(x5,"class-name",{attribute:{pattern:V3("((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<0>\\s*:\\s*)?<1>(?:\\s*,\\s*<1>)*(?=\\s*\\])",[E5,N5],"g"),lookbehind:!0,greedy:!0,inside:{target:{pattern:V3("^<0>(?=\\s*:)",[E5]),alias:"keyword"},"attribute-arguments":{pattern:V3("\\(<0>*\\)",[S5]),inside:x5},"class-name":{pattern:RegExp(f5),inside:{punctuation:/\./}},punctuation:/[,:]/}}}),$4(x5,"string",{"interpolation-string":[{pattern:V3('(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[\\s\\S]|\\{\\{|<0>|[^\\\\{"])*"',[A5],"g"),lookbehind:!0,greedy:!0,inside:j5(A5,M5)},{pattern:V3('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<0>|[^\\\\"{])*"',[V5],"g"),lookbehind:!0,greedy:!0,inside:j5(V5,T5)}],char:{pattern:RegExp(w5,"g"),greedy:!0}}),xF.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|"(?!""))*"""|"(?:\\.|[^\\\n"])*")(?=\s*[a-z_])/gi,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/("(?!")|""")[^]+(?=\1)/,lookbehind:!0,inside:"md"}}},string:{pattern:/"""[^]*?"""|"(?:\\.|[^\\\n"])*"/g,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:Y4,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\\n"])*")*\))?:)/gi,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))(?!\d)\w+/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)(?!\d)\w+/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)(?!\d)\w+/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[&|!=]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[()[\]{},:!=]/,property:/\w+/,[wF](e,t){for(var n=OF(e,t),r=n.filter((({type:e})=>e&&"comment"!=e&&"scalar"!=e)),o=r.length,i=0,a=e=>{for(var t=0;t<e.length;t++)if(i+t==o||r[i+t].type!=e[t])return!0},l=(e,t)=>{for(var n=1,a=i;a<o;a++){var l=r[a],s=l.content;if("punctuation"==l.type)if(e==s)n++;else if(t==s&&! --n)return a}};i<o;){var s=r[i++];if("keyword"==s.type&&"mutation"==s.content){var c=[];if(!a(["definition-mutation","punctuation"])&&"("==r[i+1].content){i+=2;var u=l("(",")");if(!u)continue;for(;i<u;i++){var d=r[i];"variable"==d.type&&(d.alias="variable-input",c.push(d.content))}i=u+1}if(!a(["punctuation","property-query"])&&"{"==r[i].content&&(r[++i].alias="property-mutation",c[0])){var p=l("{","}");if(p)for(var f=i;f<p;f++){var h=r[f];"variable"==h.type&&c.indexOf(h.content)>=0&&(h.alias="variable-input")}}}}return n}},xF.webmanifest=xF.json={property:{pattern:/"(?:\\.|[^\\\n"])*"(?=\s*:)/g,greedy:!0},string:{pattern:/"(?:\\.|[^\\\n"])*"/g,greedy:!0},comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,operator:/:/,punctuation:/[[\]{},]/,boolean:Y4,null:{pattern:/\bnull\b/,alias:"keyword"}},xF.makefile={comment:/#(?:\\[^]|[^\\\n])*/,string:{pattern:/(["'])(?:\\[^]|(?!\1)[^\\\n])*\1/g,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ ]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|override|private|s?include|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ ])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/};var B5=xF.scss=F4("css",{comment:{pattern:/\/\/.*|\/\*[^]*?(?:\*\/|$)/g,greedy:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/,[yF]:"scss"}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?!\s)[^@;(){}]?(?:[^@;(){}\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}});$4(B5,"atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),$4(B5,"important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),$4(B5,"function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:Y4,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[%/*+-]|[!=]=|[<>]=?|and|not|or)(?!\S)/,lookbehind:!0}});var P5={pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/g,lookbehind:!0,greedy:!0},I5=xF.ts=xF.typescript=F4("js",{"class-name":P5});$4(I5,"operator",{builtin:/\b(?:Array|Function|Promise|any|boolean|never|number|string|symbol|unknown)\b/}),I5.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b|\b(?:asserts|infer|interface|module|namespace|type)\b(?!\s*[^\s{_$a-zA-Z\xa0-\uffff])|\btype(?=\s*\*)/),delete I5.parameter,delete I5["literal-property"];var D5=P5.inside=Object.assign({},I5);delete D5["class-name"],delete D5["maybe-class-name"],$4(I5,"function",{decorator:{pattern:/@[$\w\xa0-\uffff]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/.+/}},"generic-function":{pattern:/#?(?!\d)(?:(?!\s)[$\w\xa0-\uffff])+\s*<(?:[^<>=]|=[^<]|=?<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/g,greedy:!0,inside:{generic:{pattern:/<[^]+/,alias:"class-name",inside:D5},function:/\S+/}}}),q3(xF.ts,"tsx");var L5=xF.tsx.tag,R5="(?:^|(";try{RegExp("(?<=)"),R5+="?<="}catch{L5.lookbehind=!0}L5.pattern=RegExp(R5+`[^\\w$])|(?=</))${L5.pattern.source}`,"g");var z5=/[*&][^\s[\]{},]+/,F5=/!(?:<[\w%#;/?:@&=$,.!~*'()[\]+-]+>|(?:[a-zA-Z\d-]*!)?[\w%#;/?:@&=$.~*'()+-]+)?/,$5=`(?:${F5.source}(?:[ \t]+${z5.source})?|${z5.source}(?:[ \t]+${F5.source})?)`,H5=T3("(?:[^\\s\0-\\x08\\x0e-\\x1f!\"#%&'*,:>?@[\\]{}`|\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff-]|[?:-]<0>)(?:[ \t]*(?:(?![#:])<0>|:<0>))*",["[^\\s\0-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"]),U5="\"(?:\\\\.|[^\\\\\n\"])*\"|'(?:\\\\.|[^\\\\\n'])*'",W5=(e,t)=>V3("([:,[{-]\\s*(?:\\s<0>[ \t]+)?)<1>(?=[ \t]*(?:$|,|\\]|\\}|(?:\n\\s*)?#))",[$5,e],t);xF.yml=xF.yaml={scalar:{pattern:V3("([:-]\\s*(?:\\s<0>[ \t]+)?[|>])[ \t]*(?:(\n[ \t]+)\\S.*(?:\\2.+)*)",[$5]),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:V3("((?:^|[:,[{\n?-])[ \t]*(?:<0>[ \t]+)?)<1>(?=\\s*:\\s)",[$5,"(?:"+H5+"|"+U5+")"],"g"),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ ]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:W5("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d\\d:\\d\\d(?:\\.\\d*)?(?:[ \t]*(?:Z|[+-]\\d\\d?(?::\\d\\d)?))?|\\d{4}-\\d\\d-\\d\\d|\\d\\d?:\\d\\d(?::\\d\\d(?:\\.\\d*)?)?","m"),lookbehind:!0,alias:"number"},boolean:{pattern:W5("false|true","im"),lookbehind:!0,alias:"important"},null:{pattern:W5("null|~","im"),lookbehind:!0,alias:"important"},string:{pattern:W5(U5,"mg"),lookbehind:!0,greedy:!0},number:{pattern:W5("[+-]?(?:0x[a-f\\d]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","im"),lookbehind:!0},tag:F5,important:z5,punctuation:/---|[:[\]{},|>?-]|\.{3}/};var q5={pattern:/\\[\\()[\]{}^$+*?|.]/,alias:"escape"},K5=/\\(?:x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|u\{[a-fA-F\d]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,G5="(?:[^\\\\-]|"+K5.source+")",Y5=RegExp(G5+"-"+G5),X5={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};xF.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:\\[^]|[^\\\]])*\]/,lookbehind:!0,inside:{"char-class-punctuation":{pattern:/^.|.$/g,greedy:!0,alias:"punctuation"},"char-class-negation":{pattern:/^\^/,alias:"operator"},range:{pattern:Y5,inside:{escape:K5,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":q5,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:K5}},"special-escape":q5,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":X5}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:K5,group:[{pattern:/(\()\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[!=]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?)/,lookbehind:!0,inside:{"group-name":X5}},{pattern:/[()]/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}};const Z5={key:0,class:"show-toolbar"},J5=yS({__name:"node-view",props:jZ,setup(e){const{options:n}=gS(),r=t.ref(null),o=t.ref(e.node.attrs.code);let i=t.ref(null);return t.onMounted((()=>{i.value=((e,t,...n)=>{let r,o,i,a,l,s=Z2(e),c=[],u="",d=!1,p=!1,f=!0,h=[],m=0;const v=o4(),g=v.firstChild,b=g.children,y=b[0],w=y.firstChild,k={language:"text",value:u},x=new Set(n),C={},O=e=>{if(Object.assign(k,e),u=e.value??u,r=k.language,!xF[r])throw Error(`Language '${r}' has no grammar.`);l=!!k.readOnly,v.style.tabSize=k.tabSize||2,w.inputMode=l?"none":"",w.setAttribute("aria-readonly",l),N(),E(),o==(o=xF[r])&&u==w.value||(T(),w.value=u,w.selectionEnd=0,S())},S=()=>{h=CF(u=w.value,o),V("tokenize",h,r,u);let e=_F(h).split("\n"),t=0,n=m,i=m=e.length;for(;e[t]==c[t]&&t<i;)++t;for(;i&&e[--i]==c[--n];);if(t==i&&t==n)b[t+1].innerHTML=e[t]+"\n";else{let r=n<t?n:t-1,o=r,a="";for(;o<i;)a+=`<div class=pce-line aria-hidden=true>${e[++o]}\n</div>`;for(o=i<t?i:t-1;o<n;o++)b[t+1].remove();for(a&&b[r+1].insertAdjacentHTML("afterend",a),o=r+1;o<m;)b[++o].setAttribute("data-line",o);v.style.setProperty("--number-width",Math.ceil(Math.log10(m+1))+".001ch")}V("update",u),j(!0),f&&setTimeout(setTimeout,0,(()=>f=!0)),c=e,f=!1},E=e=>{(e||x).forEach((t=>{"object"==typeof t?(t.update(B,k),e&&x.add(t)):(t(B,k),e||x.delete(t))}))},N=([e,t]=_())=>{v.className=`prism-code-editor language-${r}${0==k.lineNumbers?"":" show-line-numbers"} pce-${k.wordWrap?"":"no"}wrap${k.rtl?" pce-rtl":""} pce-${e==t?"no":"has"}-selection${p?" pce-focus":""}${l?" pce-readonly":""}`},_=()=>[w.selectionStart,w.selectionEnd,w.selectionDirection],M={Escape(){w.blur()}},A={},T=()=>t4&&!p&&X2(B,"focus",(e=>{let t=e.relatedTarget;t?t.focus():w.blur()}),{once:!0}),V=(e,...t)=>{var n;for(const r of C[e]||[])r.apply(B,t);null==(n=k[`on${e[0].toUpperCase()}${e.slice(1)}`])||n.apply(B,t)},j=e=>{if(e||f){const e=_(),t=b[a=n4(u,0,e["backward"==e[2]?0:1])];t!=i&&(null==i||i.classList.remove("active-line"),t.classList.add("active-line"),i=t),N(e),V("selectionChange",e,u)}},B={scrollContainer:v,wrapper:g,overlays:y,textarea:w,get activeLine(){return i},get activeLineNumber(){return a},get value(){return u},options:k,get focused(){return p},get removed(){return d},get tokens(){return h},inputCommandMap:A,keyCommandMap:M,extensions:{},setOptions:O,update:S,getSelection:_,setSelection(e,t=e,n){T(),w.setSelectionRange(e,t,n),j(!0)},addExtensions(...e){E(e)},addListener(e,t){(C[e]||(C[e]=new Set)).add(t)},removeListener(e,t){var n;null==(n=C[e])||n.delete(t)},remove(){v.remove(),d=!0}};return X2(B,"keydown",(e=>{var t;(null==(t=M[e.key])?void 0:t.call(M,e,_(),u))&&i4(e)})),X2(B,"beforeinput",(e=>{var t;(l||"insertText"==e.inputType&&(null==(t=A[e.data])?void 0:t.call(A,e,_(),u)))&&i4(e)})),X2(B,"input",S),X2(B,"blur",(()=>{a4=null,p=!1,N()})),X2(B,"focus",(()=>{a4=j,p=!0,N()})),X2(B,"selectionchange",(e=>{j(),i4(e)})),null==s||s.append(v),t&&O(t),B})(r.value,{readOnly:n.value.document.readOnly,language:e.node.attrs.language,tabSize:2,lineNumbers:e.node.attrs.lineNumbers,wordWrap:e.node.attrs.wordWrap,value:o.value,onUpdate(t){e.updateAttributes({code:t})}}),i.value.addExtensions(((e=!0,t="([{",n=")]}")=>{let r;const o=t=>{t.extensions.matchBrackets=o,t.addListener("tokenize",l),e&&t.tokens[0]?t.update():l(t.tokens)},i=o.brackets=[],a=o.pairs=[],l=t=>{if(a.length=i.length=r=0,s(t,0,0),e)for(let e,n=0;e=i[n];){let t=e[0].alias;e[0].alias=(t?t+" ":"")+"bracket-"+(null==a[n++]?"error":"level-"+e[2]%12)}},s=(e,o,l)=>{let c,u=[],d=0;for(let p=0;c=e[p++];){let e=c.length;if("string"!=typeof c){let p=c.content;if(Array.isArray(p))s(p,o,d+l);else if("punctuation"==(c.alias||c.type)){let s=l4(p,t,e-1),f=s||l4(p,n,e-1);if(f){if(i[r]=[c,o,0,p,!!s,o+e],s)u[d++]=[r,s];else for(let e=d;e;){let[t,n]=u[--e];f==n&&(a[a[r]=t]=r,i[r][2]=i[t][2]=e+l,d=e,e=0)}r++}}}o+=e}};return o})(),w4(),C4(),(e=>{let t,n,r,o=-1,i=[],a=()=>{n||(n=e.extensions.matchBrackets);let[a,c]=e.getSelection(),u=a==c&&e.focused&&n&&l(c)||-1;if(u!=o){if(s(),u+1){let n=t[r[u]],o=t[u];i=[n,o].map((t=>h4(e,".punctuation",0,-1,t[1]))),i[0]!=i[1]&&n[1]+n[3].length==o[1]&&(i[0].textContent+=i[1].textContent,i[1].textContent="",i[1]=i[0]),s(!0)}else i=[];o=u}},l=e=>{var o;({brackets:t,pairs:r}=n);for(let n,i=0;n=t[++i];)if(!n[4]&&n[5]>=e&&(null==(o=t[r[i]])?void 0:o[1])<=e)return i},s=e=>i.forEach((t=>t.classList.toggle("active-bracket",!!e)));X2(e,"focus",a),X2(e,"blur",a),e.addListener("selectionChange",a),e.addListener("update",(()=>{s(),o=-1}))}),S4(),A4(),((e=999)=>{let t,n,r,o,i,a,l,s=0,c=!1;const u=[],d=n=>{n>=e&&(n--,u.shift()),u.splice(s=n,e,[t.value,l(),l()])},p=e=>{var r;u[e]&&(a.value=u[e][0],a.setSelectionRange(...u[e][e<s?2:1]),t.update(),null==(r=t.extensions.cursor)||r.scrollIntoView(),s=e,n=!1)},f=(e,h)=>{e.extensions.history=f,t=e,l=e.getSelection,a||d(0),a=e.textarea,e.addListener("selectionChange",(()=>{n=c,c=!1})),X2(e,"beforeinput",(e=>{let t=e.data,a=e.inputType;/history/.test(a)?(p(s+("U"==a[7]?-1:1)),i4(e)):(i=n&&r==a&&e.isTrusted&&!(null==t?void 0:t.includes("\n"))&&(" "!=t||o==t))||(u[s][2]=u4||l()),c=!0,o=t,r=a})),X2(e,"input",(()=>d(s+!i))),X2(e,"keydown",(e=>{if(!h.readOnly){const t=g4(e),n=e.keyCode,r=t==_4+8&&90==n||!Q2&&t==_4&&89==n;t==_4&&90==n?(p(s-1),i4(e)):r&&(p(s+1),i4(e))}}))};return f.clear=()=>{d(0),n=!1},f.has=e=>s+e in u,f.go=e=>p(s+e),f})())})),t.onBeforeUnmount((()=>{i.value.remove()})),t.watch((()=>n.value.document.readOnly),(e=>{i.value.setOptions({readOnly:e})})),t.watch((()=>[e.node.attrs.language,e.node.attrs.lineNumbers,e.node.attrs.wordWrap]),(()=>{i.value.setOptions(e.node.attrs)})),(e,o)=>(t.openBlock(),t.createBlock(t.unref(TZ),{class:"node-view"},{default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["node-container hover-shadow select-outline code-block",e.node.attrs.theme]),ref_key:"containerRef",ref:r},[t.unref(n).document.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Z5,"工具栏"))],2)])),_:1}))}},[["__scopeId","data-v-6dc74778"]]),Q5=TX.create({name:"codeBlock",group:"block",atom:!0,addAttributes:()=>({code:{default:""},language:{default:"plaintext"},theme:{default:"light"},lineNumbers:{default:!0},wordWrap:{default:!1}}),parseHTML:()=>[{tag:"pre"}],renderHTML({HTMLAttributes:e}){return["pre",gY(this.options.HTMLAttributes,e)]},addNodeView:()=>PZ(J5),addCommands(){return{setCodeBlock:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.setCodeBlock()}}}),e8={class:"node-container text-box"},t8=yS({__name:"node-view",props:jZ,setup(e){const{options:n}=gS(),r=t.ref(null);let o=t.ref(!1);const i=t.ref(!1),a=({angle:t})=>{e.updateAttributes({angle:t})},l=({width:t,height:n})=>{e.updateAttributes({width:t,height:n})},s=({left:t,top:n})=>{e.updateAttributes({left:t,top:n})};return KO(r,(()=>o.value=!1)),(e,c)=>(t.openBlock(),t.createBlock(t.unref(TZ),{ref_key:"containerRef",ref:r,class:"node-view",onDblclickCapture:c[2]||(c[2]=e=>i.value=!0)},{default:t.withCtx((()=>[t.createElementVNode("div",e8,[t.createVNode(t.unref(U1),{selected:t.unref(o),disabled:i.value,draggable:!t.unref(n).document.readOnly,rotatable:!0,boundary:!1,angle:e.node.attrs.angle,width:e.node.attrs.width,height:e.node.attrs.height,left:e.node.attrs.left,top:e.node.attrs.top,"min-width":14,"min-height":14,title:"双击进行编辑",onRotate:a,onResize:l,onDrag:s,onBlur:c[0]||(c[0]=e=>i.value=!1),onClick:c[1]||(c[1]=e=>t.isRef(o)?o.value=!0:o=!0)},{default:t.withCtx((()=>[t.createVNode(t.unref(AZ),{class:"content"})])),_:1},8,["selected","disabled","draggable","angle","width","height","left","top"])])])),_:1},512))}},[["__scopeId","data-v-23bbd710"]]),n8=TX.create({name:"textBox",group:"block",content:"inline*",addAttributes:()=>({width:{default:200},height:{default:40},angle:{default:null},left:{default:0},top:{default:0},draggable:{default:!0},rotatable:{default:!0}}),parseHTML:()=>[{tag:"text-box"}],renderHTML:({HTMLAttributes:e})=>["text-box",gY(e),0],addNodeView:()=>PZ(t8),addCommands(){return{setTextBox:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}}),r8=jJ.extend({addOptions:()=>({HTMLAttributes:{class:"page-divider","data-line-number":!1}}),parseHTML:()=>[{tag:"hr",getAttrs:e=>{e.getAttribute("data-type"),e.style.color}}],addAttributes:()=>({"data-type":{parseHTML:e=>e.getAttribute("data-type")||"signle"},color:{parseHTML:e=>e.getAttribute("data-color"),renderHTML:e=>({"data-color":e.color,style:`color: ${e.color||"inherit"}`})}}),addCommands(){return{setHorizontalRule:({type:e,color:t})=>({chain:n,state:r})=>{const{$to:o}=r.selection,i=n();return 0===o.parentOffset?i.insertContentAt(Math.max(o.pos-2,0),{type:this.name,attrs:{"data-type":e,color:t}}):i.insertContent({type:this.name,attrs:{"data-type":e,color:t}}),i.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(sW.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(uW.create(e.doc,t.pos)):e.setSelection(sW.create(e.doc,t.pos));else{const o=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();o&&(e.insert(r,o),e.setSelection(sW.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[EX({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),o8={class:"node-container hover-shadow select-outline iframe"},i8=["src"],a8=yS({__name:"node-view",props:jZ,setup(e){const n=t.ref(null);let r=t.ref(!1),o=t.ref(0);t.onMounted((()=>{const t=n.value.$el.offsetWidth;o.value=t,null===e.node.attrs.width&&e.updateAttributes({width:t})}));const i=({width:t,height:n})=>{e.updateAttributes({width:t,height:n})};return KO(n,(()=>r.value=!1)),(e,a)=>(t.openBlock(),t.createBlock(t.unref(TZ),{ref_key:"containerRef",ref:n,class:"node-view",style:t.normalizeStyle({"justify-content":e.node.attrs.nodeAlign})},{default:t.withCtx((()=>[t.createElementVNode("div",o8,[t.createVNode(t.unref(U1),{selected:t.unref(r),rotatable:!1,width:e.node.attrs.width,height:e.node.attrs.height,"min-width":400,"min-height":100,"max-width":t.unref(o),onResize:i,onClick:a[0]||(a[0]=e=>t.isRef(r)?r.value=!0:r=!0)},{default:t.withCtx((()=>[t.createElementVNode("iframe",{src:e.node.attrs.src},null,8,i8)])),_:1},8,["selected","width","height","max-width"])])])),_:1},8,["style"]))}},[["__scopeId","data-v-e7fc2b61"]]),l8=TX.create({name:"iframe",inline:!1,group:"block",atom:!0,addAttributes:()=>({src:{default:null},width:{default:null},height:{default:300}}),parseHTML:()=>[{tag:"iframe"}],renderHTML({HTMLAttributes:e}){return["iframe",gY(this.options.HTMLAttributes,e)]},addNodeView:()=>PZ(a8),addCommands(){return{setIframe:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}}),s8=e=>{const{regex:t,katexOptions:n={},editor:r,shouldRender:o}=e;return new CW({key:new EW("mathematics"),state:{init:()=>uG.empty,apply(e,i,a,s){const{selection:c}=s,u=[];return s.doc.descendants(((e,i)=>{const a=o(s,i,e);if(e.isText&&e.text&&a){let o;for(;o=t.exec(e.text);){const e=i+o.index,t=e+o[0].length,a=o[1];if(a){const o=c.$from.pos-c.$to.pos,i=c.$anchor.pos>=e&&c.$anchor.pos<=t,s=c.$from.pos>=e&&c.$to.pos<=t,d=0===o&&i||s;d&&r.isEditable||u.push(lG.widget(e,(()=>{const e=document.createElement("span");e.classList.add("Tiptap-mathematics-render"),r.isEditable&&e.classList.add("Tiptap-mathematics-render--editable");try{l.render(a,e,n)}catch(t){e.innerHTML=a}return e}))),u.push(lG.inline(e,t,{class:d&&r.isEditable?"Tiptap-mathematics-editor":"Tiptap-mathematics-editor Tiptap-mathematics-editor--hidden",style:d&&r.isEditable?void 0:"display: inline-block; height: 0; opacity: 0; overflow: hidden; position: absolute; width: 0;"}))}}}})),u.length>0?uG.create(s.doc,u):uG.empty}},props:{decorations(e){return this.getState(e)}}})},c8=(e,t)=>!("codeBlock"===e.doc.resolve(t).parent.type.name),u8=DY.create({name:"Mathematics",addOptions:()=>({regex:/\$([^\$]*)\$/gi,katexOptions:void 0,shouldRender:c8}),addProseMirrorPlugins(){return[s8({...this.options,editor:this.editor})]}});var d8,p8;if("undefined"!=typeof WeakMap){let e=new WeakMap;d8=t=>e.get(t),p8=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;d8=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},p8=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}var f8=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,o=t/this.width|0;let i=r+1,a=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;a<this.height&&this.map[t+this.width*e]==n;e++)a++;return{left:r,top:o,right:i,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:o,top:i,bottom:a}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:a==this.height)?null:this.map[r+this.width*(n<0?i-1:a)]}rectBetween(e,t){const{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:a,right:l,top:s,bottom:c}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(o,s),right:Math.max(r,l),bottom:Math.max(i,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){const i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width;const r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return d8(e)||p8(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const o=e.child(r);let i=0;if(n)for(let t=0;t<r;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){const t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[];let o=0,i=null;const a=[];for(let c=0,u=t*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const l=e.child(c);u++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==l.childCount)break;const s=l.child(e),{colspan:d,rowspan:p,colwidth:f}=s.attrs;for(let e=0;e<p;e++){if(e+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:p-e});break}const l=o+e*t;for(let e=0;e<d;e++){0==r[l+e]?r[l+e]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:d-e});const n=f&&f[e];if(n){const r=(l+e)%t*2,o=a[r];null==o||o!=n&&1==a[r+1]?(a[r]=n,a[r+1]=1):o==n&&a[r+1]++}}}o+=d,u+=s.nodeSize}const s=(c+1)*t;let d=0;for(;o<s;)0==r[o++]&&d++;d&&(i||(i=[])).push({type:"missing",row:c,n:d}),u++}const l=new f8(t,n,r,i);let s=!1;for(let c=0;!s&&c<a.length;c+=2)null!=a[c]&&a[c+1]<n&&(s=!0);s&&function(e,t,n){e.problems||(e.problems=[]);const r={};for(let o=0;o<e.map.length;o++){const i=e.map[o];if(r[i])continue;r[i]=!0;const a=n.nodeAt(i);if(!a)throw new RangeError(`No cell with offset ${i} found`);let l=null;const s=a.attrs;for(let n=0;n<s.colspan;n++){const r=t[2*((o+n)%e.width)];null==r||s.colwidth&&s.colwidth[n]==r||((l||(l=h8(s)))[n]=r)}l&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}(l,a,e);return l}(e))}};function h8(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function m8(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}var v8=new EW("selectingCells");function g8(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function b8(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function y8(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=g8(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function w8(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function k8(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function x8(e,t,n){const r=e.node(-1),o=f8.get(r),i=e.start(-1),a=o.nextCell(e.pos-i,t,n);return null==a?null:e.node(0).resolve(i+a)}function C8(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((e=>e>0))||(r.colwidth=null)),r}function O8(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}var S8=class e extends oW{constructor(e,t=e){const n=e.node(-1),r=f8.get(n),o=e.start(-1),i=r.rectBetween(e.pos-o,t.pos-o),a=e.node(0),l=r.cellsInRect(i).filter((e=>e!=t.pos-o));l.unshift(t.pos-o);const s=l.map((e=>{const t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);const r=o+e+1;return new iW(a.resolve(r),a.resolve(r+t.content.size))}));super(s[0].$from,s[0].$to,s),this.$anchorCell=e,this.$headCell=t}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(w8(r)&&w8(o)&&k8(r,o)){const t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,o):t&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return sW.between(r,o)}content(){const e=this.$anchorCell.node(-1),t=f8.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let l=r.top;l<r.bottom;l++){const n=[];for(let i=l*t.width+r.left,a=r.left;a<r.right;a++,i++){const a=t.map[i];if(o[a])continue;o[a]=!0;const l=t.findCell(a);let s=e.nodeAt(a);if(!s)throw RangeError(`No cell with offset ${a} found`);const c=r.left-l.left,u=l.right-r.right;if(c>0||u>0){let e=s.attrs;if(c>0&&(e=C8(e,0,c)),u>0&&(e=C8(e,e.colspan-u,u)),l.left<r.left){if(s=s.type.createAndFill(e),!s)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else s=s.type.create(e,s.content)}if(l.top<r.top||l.bottom>r.bottom){const e={...s.attrs,rowspan:Math.min(l.bottom,r.bottom)-Math.max(l.top,r.top)};s=l.top<r.top?s.type.createAndFill(e):s.type.create(e,s.content)}n.push(s)}i.push(e.child(l).copy(mH.from(n)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new kH(mH.from(a),1,1)}replace(e,t=kH.empty){const n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){const{$from:o,$to:a}=r[i],l=e.mapping.slice(n);e.replace(l.map(o.pos),l.map(a.pos),i?kH.empty:t)}const o=oW.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new kH(mH.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=f8.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),o=f8.get(r),i=t.start(-1),a=o.findCell(t.pos-i),l=o.findCell(n.pos-i),s=t.node(0);return a.top<=l.top?(a.top>0&&(t=s.resolve(i+o.map[a.left])),l.bottom<o.height&&(n=s.resolve(i+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=s.resolve(i+o.map[l.left])),a.bottom<o.height&&(t=s.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))),new e(t,n)}isRowSelection(){const e=this.$anchorCell.node(-1),t=f8.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,a)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),o=f8.get(r),i=t.start(-1),a=o.findCell(t.pos-i),l=o.findCell(n.pos-i),s=t.node(0);return a.left<=l.left?(a.left>0&&(t=s.resolve(i+o.map[a.top*o.width])),l.right<o.width&&(n=s.resolve(i+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=s.resolve(i+o.map[l.top*o.width])),a.right<o.width&&(t=s.resolve(i+o.map[o.width*(a.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new E8(this.$anchorCell.pos,this.$headCell.pos)}};S8.prototype.visible=!1,oW.jsonID("cell",S8);var E8=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&k8(t,n)?new S8(t,n):oW.near(n,1)}};function N8(e){if(!(e.selection instanceof S8))return null;const t=[];return e.selection.forEachCell(((e,n)=>{t.push(lG.node(n,n+e.nodeSize,{class:"selectedCell"}))})),uG.create(e.doc,t)}var _8=new EW("fix-tables");function M8(e,t,n,r){const o=e.childCount,i=t.childCount;e:for(let a=0,l=0;a<i;a++){const i=t.child(a);for(let t=l,r=Math.min(o,a+3);t<r;t++)if(e.child(t)==i){l=t+1,n+=i.nodeSize;continue e}r(i,n),l<o&&e.child(l).sameMarkup(i)?M8(e.child(l),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function A8(e,t){let n;const r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){const o=f8.get(t);if(!o.problems)return r;r||(r=e.tr);const i=[];for(let s=0;s<o.height;s++)i.push(0);for(let s=0;s<o.problems.length;s++){const e=o.problems[s];if("collision"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;const a=o.attrs;for(let t=0;t<a.rowspan;t++)i[e.row+t]+=e.n;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,C8(a,a.colspan-e.n,e.n))}else if("missing"==e.type)i[e.row]+=e.n;else if("overlong_rowspan"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,rowspan:o.attrs.rowspan-e.n})}else if("colwidth mismatch"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,colwidth:e.colwidth})}}let a,l;for(let s=0;s<i.length;s++)i[s]&&(null==a&&(a=s),l=s);for(let s=0,c=n+1;s<o.height;s++){const n=t.child(s),o=c+n.nodeSize,u=i[s];if(u>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);const i=[];for(let n=0;n<u;n++){const n=m8(e.schema)[t].createAndFill();n&&i.push(n)}const d=0!=s&&a!=s-1||l!=s?o-1:c+1;r.insert(r.mapping.map(d),i)}c=o}return r.setMeta(_8,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&M8(t.doc,e.doc,0,r):e.doc.descendants(r),n}function T8(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;const o=t.child(0),i=o.type.spec.tableRole,a=o.type.schema,l=[];if("row"==i)for(let s=0;s<t.childCount;s++){let e=t.child(s).content;const o=s?0:Math.max(0,n-1),i=s<t.childCount-1?0:Math.max(0,r-1);(o||i)&&(e=V8(m8(a).row,new kH(e,o,i)).content),l.push(e)}else{if("cell"!=i&&"header_cell"!=i)return null;l.push(n||r?V8(m8(a).row,new kH(t,n,r)).content:t)}return function(e,t){const n=[];for(let o=0;o<t.length;o++){const e=t[o];for(let t=e.childCount-1;t>=0;t--){const{rowspan:r,colspan:i}=e.child(t).attrs;for(let e=o;e<o+r;e++)n[e]=(n[e]||0)+i}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(mH.empty),n[o]<r){const i=m8(e).cell.createAndFill(),a=[];for(let e=n[o];e<r;e++)a.push(i);t[o]=t[o].append(mH.from(a))}return{height:t.length,width:r,rows:t}}(a,l)}function V8(e,t){const n=e.createAndFill();return new nW(n).replace(0,n.content.size,t).doc}function j8(e,t,n,r,o,i,a,l){if(0==a||a==t.height)return!1;let s=!1;for(let c=o;c<i;c++){const o=a*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){s=!0;const o=n.nodeAt(i),{top:u,left:d}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(l).map(i+r),null,{...o.attrs,rowspan:a-u}),e.insert(e.mapping.slice(l).map(t.positionAt(a,d,n)),o.type.createAndFill({...o.attrs,rowspan:u+o.attrs.rowspan-a})),c+=o.attrs.colspan-1}}return s}function B8(e,t,n,r,o,i,a,l){if(0==a||a==t.width)return!1;let s=!1;for(let c=o;c<i;c++){const o=c*t.width+a,i=t.map[o];if(t.map[o-1]==i){s=!0;const o=n.nodeAt(i),u=t.colCount(i),d=e.mapping.slice(l).map(i+r);e.setNodeMarkup(d,null,C8(o.attrs,a-u,o.attrs.colspan-(a-u))),e.insert(d+o.nodeSize,o.type.createAndFill(C8(o.attrs,0,a-u))),c+=o.attrs.rowspan-1}}return s}function P8(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let a=f8.get(i);const{top:l,left:s}=r,c=s+o.width,u=l+o.height,d=e.tr;let p=0;function f(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");a=f8.get(i),p=d.mapping.maps.length}(function(e,t,n,r,o,i,a){const l=m8(e.doc.type.schema);let s,c;if(o>t.width)for(let u=0,d=0;u<t.height;u++){const i=n.child(u);d+=i.nodeSize;const p=[];let f;f=null==i.lastChild||i.lastChild.type==l.cell?s||(s=l.cell.createAndFill()):c||(c=l.header_cell.createAndFill());for(let e=t.width;e<o;e++)p.push(f);e.insert(e.mapping.slice(a).map(d-1+r),p)}if(i>t.height){const u=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){const o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==l.header_cell;u.push(o?c||(c=l.header_cell.createAndFill()):s||(s=l.cell.createAndFill()))}const d=l.row.create(null,mH.from(u)),p=[];for(let e=t.height;e<i;e++)p.push(d);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),p)}return!(!s&&!c)})(d,a,i,n,c,u,p)&&f(),j8(d,a,i,n,s,c,l,p)&&f(),j8(d,a,i,n,s,c,u,p)&&f(),B8(d,a,i,n,l,u,s,p)&&f(),B8(d,a,i,n,l,u,c,p)&&f();for(let h=l;h<u;h++){const e=a.positionAt(h,s,i),t=a.positionAt(h,c,i);d.replace(d.mapping.slice(p).map(e+n),d.mapping.slice(p).map(t+n),new kH(o.rows[h-l],0,0))}f(),d.setSelection(new S8(d.doc.resolve(n+a.positionAt(l,s,i)),d.doc.resolve(n+a.positionAt(u-1,c-1,i)))),t(d)}var I8=YG({ArrowLeft:L8("horiz",-1),ArrowRight:L8("horiz",1),ArrowUp:L8("vert",-1),ArrowDown:L8("vert",1),"Shift-ArrowLeft":R8("horiz",-1),"Shift-ArrowRight":R8("horiz",1),"Shift-ArrowUp":R8("vert",-1),"Shift-ArrowDown":R8("vert",1),Backspace:z8,"Mod-Backspace":z8,Delete:z8,"Mod-Delete":z8});function D8(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function L8(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof S8)return D8(n,r,oW.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;const a=U8(o,e,t);if(null==a)return!1;if("horiz"==e)return D8(n,r,oW.near(n.doc.resolve(i.head+t),t));{const o=n.doc.resolve(a),i=x8(o,e,t);let l;return l=i?oW.near(i,1):t<0?oW.near(n.doc.resolve(o.before(-1)),-1):oW.near(n.doc.resolve(o.after(-1)),1),D8(n,r,l)}}}function R8(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let a;if(i instanceof S8)a=i;else{const r=U8(o,e,t);if(null==r)return!1;a=new S8(n.doc.resolve(r))}const l=x8(a.$headCell,e,t);return!!l&&D8(n,r,new S8(a.$anchorCell,l))}}function z8(e,t){const n=e.selection;if(!(n instanceof S8))return!1;if(t){const r=e.tr,o=m8(e.schema).cell.createAndFill().content;n.forEachCell(((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new kH(o,0,0))})),r.docChanged&&t(r)}return!0}function F8(e,t){const n=g8(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new S8(n))),!0)}function $8(e,t,n){if(!b8(e.state))return!1;let r=T8(n);const o=e.state.selection;if(o instanceof S8){r||(r={width:1,height:1,rows:[mH.from(V8(m8(e.state.schema).cell,n))]});const t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=f8.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){const t=[],o=[];for(let e=0;e<n.length;e++){const i=n[e],a=[];for(let n=t[e]||0,o=0;n<r;o++){let l=i.child(o%i.childCount);n+l.attrs.colspan>r&&(l=l.type.createChecked(C8(l.attrs,l.attrs.colspan,n+l.attrs.colspan-r),l.content)),a.push(l),n+=l.attrs.colspan;for(let n=1;n<l.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+l.attrs.colspan}o.push(mH.from(a))}n=o,e=r}if(t!=o){const e=[];for(let r=0,i=0;r<o;r++,i++){const a=[],l=n[i%t];for(let e=0;e<l.childCount;e++){let t=l.child(e);r+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),a.push(t)}e.push(mH.from(a))}n=e,t=o}return{width:e,height:t,rows:n}}(r,a.right-a.left,a.bottom-a.top),P8(e.state,e.dispatch,i,a,r),!0}if(r){const t=y8(e.state),n=t.start(-1);return P8(e.state,e.dispatch,n,f8.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function H8(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=W8(e,t.target);let o;if(t.shiftKey&&e.state.selection instanceof S8)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(o=g8(e.state.selection.$anchor))&&(null==(n=q8(e,t))?void 0:n.pos)!=o.pos)i(o,t),t.preventDefault();else if(!r)return;function i(t,n){let r=q8(e,n);const o=null==v8.getState(e.state);if(!r||!k8(t,r)){if(!o)return;r=t}const i=new S8(t,r);if(o||!e.state.selection.eq(i)){const n=e.state.tr.setSelection(i);o&&n.setMeta(v8,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener("mouseup",a),e.root.removeEventListener("dragstart",a),e.root.removeEventListener("mousemove",l),null!=v8.getState(e.state)&&e.dispatch(e.state.tr.setMeta(v8,-1))}function l(n){const o=n,l=v8.getState(e.state);let s;if(null!=l)s=e.state.doc.resolve(l);else if(W8(e,o.target)!=r&&(s=q8(e,t),!s))return a();s&&i(s,o)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",l)}function U8(e,t,n){if(!(e.state.selection instanceof sW))return null;const{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),a="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?i:null}}return null}function W8(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function q8(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?g8(e.state.doc.resolve(n.pos)):null}var K8=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),G8(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,G8(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function G8(e,t,n,r,o,i){var a;let l=0,s=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let e=0,n=0;e<u.childCount;e++){const{colspan:a,colwidth:d}=u.child(e).attrs;for(let e=0;e<a;e++,n++){const a=o==n?i:d&&d[e],u=a?a+"px":"";l+=a||r,a||(s=!1),c?(c.style.width!=u&&(c.style.width=u),c=c.nextSibling):t.appendChild(document.createElement("col")).style.width=u}}for(;c;){const e=c.nextSibling;null==(a=c.parentNode)||a.removeChild(c),c=e}s?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var Y8=new EW("tableColumnResizing");function X8({handleWidth:e=5,cellMinWidth:t=25,View:n=K8,lastColumnResizable:r=!0}={}){const o=new CW({key:Y8,state:{init:(e,r)=>(o.spec.props.nodeViews[m8(r.schema).table.name]=(e,r)=>new n(e,t,r),new Z8(-1,!1)),apply:(e,t)=>t.apply(e)},props:{attributes:e=>{const t=Y8.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r,o){const i=Y8.getState(e.state);if(!i)return;if(!i.dragging){const r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target);let a=-1;if(r){const{left:o,right:i}=r.getBoundingClientRect();t.clientX-o<=n?a=J8(e,t,"left",n):i-t.clientX<=n&&(a=J8(e,t,"right",n))}if(a!=i.activeHandle){if(!o&&-1!==a){const t=e.state.doc.resolve(a),n=t.node(-1),r=f8.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}e6(e,a)}}}(t,n,e,0,r)},mouseleave:e=>{!function(e){const t=Y8.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&e6(e,-1)}(e)},mousedown:(e,n)=>{!function(e,t,n){var r;const o=null!=(r=e.dom.ownerDocument.defaultView)?r:window,i=Y8.getState(e.state);if(!i||-1==i.activeHandle||i.dragging)return!1;const a=e.state.doc.nodeAt(i.activeHandle),l=function(e,t,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=e.domAtPos(t);let a=i.node.childNodes[i.offset].offsetWidth,l=n;if(r)for(let s=0;s<n;s++)r[s]&&(a-=r[s],l--);return a/l}(e,i.activeHandle,a.attrs);function s(t){o.removeEventListener("mouseup",s),o.removeEventListener("mousemove",c);const r=Y8.getState(e.state);(null==r?void 0:r.dragging)&&(!function(e,t,n){const r=e.state.doc.resolve(t),o=r.node(-1),i=f8.get(o),a=r.start(-1),l=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,s=e.state.tr;for(let c=0;c<i.height;c++){const e=c*i.width+l;if(c&&i.map[e]==i.map[e-i.width])continue;const t=i.map[e],r=o.nodeAt(t).attrs,u=1==r.colspan?0:l-i.colCount(t);if(r.colwidth&&r.colwidth[u]==n)continue;const d=r.colwidth?r.colwidth.slice():t6(r.colspan);d[u]=n,s.setNodeMarkup(a+t,null,{...r,colwidth:d})}s.docChanged&&e.dispatch(s)}(e,r.activeHandle,Q8(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Y8,{setDragging:null})))}function c(t){if(!t.which)return s(t);const r=Y8.getState(e.state);if(r&&r.dragging){const o=Q8(r.dragging,t,n);!function(e,t,n,r){const o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),l=f8.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let s=e.domAtPos(o.start(-1)).node;for(;s&&"TABLE"!=s.nodeName;)s=s.parentNode;if(!s)return;G8(i,s.firstChild,s,r,l,n)}(e,r.activeHandle,o,n)}}e.dispatch(e.state.tr.setMeta(Y8,{setDragging:{startX:t.clientX,startWidth:l}})),o.addEventListener("mouseup",s),o.addEventListener("mousemove",c),t.preventDefault()}(e,n,t)}},decorations:e=>{const t=Y8.getState(e);if(t&&t.activeHandle>-1)return function(e,t){const n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return uG.empty;const i=f8.get(o),a=r.start(-1),l=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan;for(let s=0;s<i.height;s++){const e=l+s*i.width-1;if(!(l!=i.width&&i.map[e]==i.map[e+1]||0!=s&&i.map[e]==i.map[e-i.width])){const t=i.map[e],r=a+t+o.nodeAt(t).nodeSize-1,l=document.createElement("div");l.className="column-resize-handle",n.push(lG.widget(r,l))}}return uG.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return o}var Z8=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){const n=this,r=t.getMeta(Y8);if(r&&null!=r.setHandle)return new e(r.setHandle,!1);if(r&&void 0!==r.setDragging)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return w8(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function J8(e,t,n,r){const o="right"==n?-r:r,i=e.posAtCoords({left:t.clientX+o,top:t.clientY});if(!i)return-1;const{pos:a}=i,l=g8(e.state.doc.resolve(a));if(!l)return-1;if("right"==n)return l.pos;const s=f8.get(l.node(-1)),c=l.start(-1),u=s.map.indexOf(l.pos-c);return u%s.width==0?-1:c+s.map[u-1]}function Q8(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function e6(e,t){e.dispatch(e.state.tr.setMeta(Y8,{setHandle:t}))}function t6(e){return Array(e).fill(0)}function n6(e){const t=e.selection,n=y8(e),r=n.node(-1),o=n.start(-1),i=f8.get(r);return{...t instanceof S8?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function r6(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){const r=m8(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let a=0;a<t.height;a++){const l=a*t.width+o;if(o>0&&o<t.width&&t.map[l-1]==t.map[l]){const i=t.map[l],s=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,O8(s.attrs,o-t.colCount(i))),a+=s.attrs.rowspan-1}else{const s=null==i?m8(r.type.schema).cell:r.nodeAt(t.map[l+i]).type,c=t.positionAt(a,o,r);e.insert(e.mapping.map(n+c),s.createAndFill())}}return e}function o6(e,{map:t,table:n,tableStart:r},o){const i=e.mapping.maps.length;for(let a=0;a<t.height;){const l=a*t.width+o,s=t.map[l],c=n.nodeAt(s),u=c.attrs;if(o>0&&t.map[l-1]==s||o<t.width-1&&t.map[l+1]==s)e.setNodeMarkup(e.mapping.slice(i).map(r+s),null,C8(u,o-t.colCount(s)));else{const t=e.mapping.slice(i).map(r+s);e.delete(t,t+c.nodeSize)}a+=u.rowspan}}function i6(e,{map:t,tableStart:n,table:r},o){var i;let a=n;for(let c=0;c<o;c++)a+=r.child(c).nodeSize;const l=[];let s=o>0?-1:0;(function(e,t,n){var r;const o=m8(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if((null==(r=t.nodeAt(e.map[i+n*e.width]))?void 0:r.type)!=o)return!1;return!0})(t,r,o+s)&&(s=0==o||o==t.height?null:0);for(let c=0,u=t.width*o;c<t.width;c++,u++)if(o>0&&o<t.height&&t.map[u]==t.map[u-t.width]){const o=t.map[u],i=r.nodeAt(o).attrs;e.setNodeMarkup(n+o,null,{...i,rowspan:i.rowspan+1}),c+=i.colspan-1}else{const e=null==s?m8(r.type.schema).cell:null==(i=r.nodeAt(t.map[u+s*t.width]))?void 0:i.type,n=null==e?void 0:e.createAndFill();n&&l.push(n)}return e.insert(a,m8(r.type.schema).row.create(null,l)),e}function a6(e,{map:t,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const a=i+n.child(o).nodeSize,l=e.mapping.maps.length;e.delete(i+r,a+r);const s=new Set;for(let c=0,u=o*t.width;c<t.width;c++,u++){const i=t.map[u];if(!s.has(i))if(s.add(i),o>0&&i==t.map[u-t.width]){const t=n.nodeAt(i).attrs;e.setNodeMarkup(e.mapping.slice(l).map(i+r),null,{...t,rowspan:t.rowspan-1}),c+=t.colspan-1}else if(o<t.height&&i==t.map[u+t.width]){const a=n.nodeAt(i),s=a.attrs,u=a.type.create({...s,rowspan:a.attrs.rowspan-1},a.content),d=t.positionAt(o+1,c,n);e.insert(e.mapping.slice(l).map(r+d),u),c+=s.colspan-1}}}function l6(e){const t=e.content;return 1==t.childCount&&t.child(0).isTextblock&&0==t.child(0).childCount}function s6(e,t){const n=e.selection;if(!(n instanceof S8)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=n6(e),{map:o}=r;if(function({width:e,height:t,map:n},r){let o=r.top*e+r.left,i=o,a=(r.bottom-1)*e+r.left,l=o+(r.right-r.left-1);for(let s=r.top;s<r.bottom;s++){if(r.left>0&&n[i]==n[i-1]||r.right<e&&n[l]==n[l+1])return!0;i+=e,l+=e}for(let s=r.left;s<r.right;s++){if(r.top>0&&n[o]==n[o-e]||r.bottom<t&&n[a]==n[a+e])return!0;o++,a++}return!1}(o,r))return!1;if(t){const n=e.tr,i={};let a,l,s=mH.empty;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){const c=o.map[e*o.width+t],u=r.table.nodeAt(c);if(!i[c]&&u)if(i[c]=!0,null==a)a=c,l=u;else{l6(u)||(s=s.append(u.content));const e=n.mapping.map(c+r.tableStart);n.delete(e,e+u.nodeSize)}}if(null==a||null==l)return!0;if(n.setNodeMarkup(a+r.tableStart,null,{...O8(l.attrs,l.attrs.colspan,r.right-r.left-l.attrs.colspan),rowspan:r.bottom-r.top}),s.size){const e=a+1+l.content.size,t=l6(l)?a+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,s)}n.setSelection(new S8(n.doc.resolve(a+r.tableStart))),t(n)}return!0}function c6(e,t){const n=m8(e.schema);return(r=({node:e})=>n[e.type.spec.tableRole],(e,t)=>{var n;const o=e.selection;let i,a;if(o instanceof S8){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,a=o.$anchorCell.pos}else{if(i=function(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(o.$from),!i)return!1;a=null==(n=g8(o.$from))?void 0:n.pos}if(null==i||null==a)return!1;if(1==i.attrs.colspan&&1==i.attrs.rowspan)return!1;if(t){let n=i.attrs;const l=[],s=n.colwidth;n.rowspan>1&&(n={...n,rowspan:1}),n.colspan>1&&(n={...n,colspan:1});const c=n6(e),u=e.tr;for(let e=0;e<c.right-c.left;e++)l.push(s?{...n,colwidth:s&&s[e]?[s[e]]:null}:n);let d;for(let e=c.top;e<c.bottom;e++){let t=c.map.positionAt(e,c.left,c.table);e==c.top&&(t+=i.nodeSize);for(let n=c.left,o=0;n<c.right;n++,o++)n==c.left&&e==c.top||u.insert(d=u.mapping.map(t+c.tableStart,1),r({node:i,row:e,col:n}).createAndFill(l[o]))}u.setNodeMarkup(a,r({node:i,row:c.top,col:c.left}),l[0]),o instanceof S8&&u.setSelection(new S8(u.doc.resolve(o.$anchorCell.pos),d?u.doc.resolve(d):void 0)),t(u)}return!0})(e,t);var r}function u6(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let o=0;o<r.length;o++){const e=t.table.nodeAt(r[o]);if(e&&e.type!==n.header_cell)return!1}return!0}function d6(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!b8(t))return!1;if(n){const r=m8(t.schema),o=n6(t),i=t.tr,a=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=a.map((e=>o.table.nodeAt(e)));for(let e=0;e<a.length;e++)l[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[e],r.cell,l[e].attrs);if(0==i.steps.length)for(let e=0;e<a.length;e++)i.setNodeMarkup(o.tableStart+a[e],r.header_cell,l[e].attrs);n(i)}return!0}}(e):function(t,n){if(!b8(t))return!1;if(n){const r=m8(t.schema),o=n6(t),i=t.tr,a=u6("row",o,r),l=u6("column",o,r),s=("column"===e?a:"row"===e&&l)?1:0,c="column"==e?{left:0,top:s,right:1,bottom:o.map.height}:"row"==e?{left:s,top:0,right:o.map.width,bottom:1}:o,u="column"==e?l?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)})),n(i)}return!0}}d6("row",{useDeprecatedLogic:!0}),d6("column",{useDeprecatedLogic:!0});var p6=d6("cell",{useDeprecatedLogic:!0});function f6(e){return function(t,n){if(!b8(t))return!1;const r=function(e,t){if(t<0){const t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let n=e.index(-1)-1,r=e.before();n>=0;n--){const t=e.node(-1).child(n),o=t.lastChild;if(o)return r-1-o.nodeSize;r-=t.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){const e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(y8(t),e);if(null==r)return!1;if(n){const e=t.doc.resolve(r);n(t.tr.setSelection(sW.between(e,(o=e,o.node(0).resolve(o.pos+o.nodeAfter.nodeSize)))).scrollIntoView())}var o;return!0}}function h6({allowTableNodeSelection:e=!1}={}){return new CW({key:v8,state:{init:()=>null,apply(e,t){const n=e.getMeta(v8);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;const{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:N8,handleDOMEvents:{mousedown:H8},createSelectionBetween:e=>null!=v8.getState(e.state)?e.state.selection:null,handleTripleClick:F8,handleKeyDown:I8,handlePaste:$8},appendTransaction:(t,n,r)=>function(e,t,n){const r=(t||e).selection,o=(t||e).doc;let i,a;if(r instanceof uW&&(a=r.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)i=S8.create(o,r.from);else if("row"==a){const e=o.resolve(r.from+1);i=S8.rowSelection(e,e)}else if(!n){const e=f8.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];i=S8.create(o,t+1,n)}}else r instanceof sW&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<e.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let i=t.depth;i>=0&&!(t.before(i+1)>t.start(i));i--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(r)?i=sW.create(o,r.from):r instanceof sW&&function({$from:e,$to:t}){let n,r;for(let o=e.depth;o>0;o--){const t=e.node(o);if("cell"===t.type.spec.tableRole||"header_cell"===t.type.spec.tableRole){n=t;break}}for(let o=t.depth;o>0;o--){const e=t.node(o);if("cell"===e.type.spec.tableRole||"header_cell"===e.type.spec.tableRole){r=e;break}}return n!==r&&0===t.parentOffset}(r)&&(i=sW.create(o,r.$from.start(),r.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}(r,A8(r,n),e)})}function m6(e,t,n,r,o,i){let a=0,l=!0,s=t.firstChild;const c=e.firstChild;for(let u=0,d=0;u<c.childCount;u+=1){const{colspan:e,colwidth:n}=c.child(u).attrs;for(let c=0;c<e;c+=1,d+=1){const e=o===d?i:n&&n[c],u=e?`${e}px`:"";a+=e||r,e||(l=!1),s?(s.style.width!==u&&(s.style.width=u),s=s.nextSibling):t.appendChild(document.createElement("col")).style.width=u}}for(;s;){const e=s.nextSibling;s.parentNode.removeChild(s),s=e}l?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}class v6{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),m6(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,m6(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"===e.type&&(e.target===this.table||this.colgroup.contains(e.target))}}function g6(e,t){return t?e.createChecked(null,t):e.createAndFill()}function b6(e,t,n,r,o){const i=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)})),e.cached.tableNodeTypes=t,t}(e),a=[],l=[];for(let c=0;c<n;c+=1){const e=g6(i.cell,o);if(e&&l.push(e),r){const e=g6(i.header_cell,o);e&&a.push(e)}}const s=[];for(let c=0;c<t;c+=1)s.push(i.row.createChecked(null,r&&0===c?a:l));return i.table.createChecked(null,s)}const y6=({editor:e})=>{const{selection:t}=e.state;if(!(t instanceof S8))return!1;let n=0;const r=iX(t.ranges[0].$from,(e=>"table"===e.type.name));null==r||r.node.descendants((e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(n+=1)}));return n===t.ranges.length&&(e.commands.deleteTable(),!0)},w6=TX.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:v6,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=function(e,t,n,r){let o=0,i=!0;const a=[],l=e.firstChild;if(!l)return{};for(let u=0,d=0;u<l.childCount;u+=1){const{colspan:e,colwidth:s}=l.child(u).attrs;for(let l=0;l<e;l+=1,d+=1){const e=n===d?r:s&&s[l],c=e?`${e}px`:"";o+=e||t,e||(i=!1),a.push(["col",c?{style:`width: ${c}`}:{}])}}const s=i?`${o}px`:"",c=i?"":`${o}px`;return{colgroup:["colgroup",{},...a],tableWidth:s,tableMinWidth:c}}(e,this.options.cellMinWidth);return["table",gY(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`minWidth: ${o}`}),n,["tbody",0]]},addCommands:()=>({insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const a=b6(i.schema,e,t,n);if(o){const e=r.selection.anchor+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(sW.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>function(e,t){if(!b8(e))return!1;if(t){const n=n6(e);t(r6(e.tr,n,n.left))}return!0}(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>function(e,t){if(!b8(e))return!1;if(t){const n=n6(e);t(r6(e.tr,n,n.right))}return!0}(e,t),deleteColumn:()=>({state:e,dispatch:t})=>function(e,t){if(!b8(e))return!1;if(t){const n=n6(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;o6(r,n,e),e!=n.left;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=f8.get(e)}t(r)}return!0}(e,t),addRowBefore:()=>({state:e,dispatch:t})=>function(e,t){if(!b8(e))return!1;if(t){const n=n6(e);t(i6(e.tr,n,n.top))}return!0}(e,t),addRowAfter:()=>({state:e,dispatch:t})=>function(e,t){if(!b8(e))return!1;if(t){const n=n6(e);t(i6(e.tr,n,n.bottom))}return!0}(e,t),deleteRow:()=>({state:e,dispatch:t})=>function(e,t){if(!b8(e))return!1;if(t){const n=n6(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;a6(r,n,e),e!=n.top;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=f8.get(n.table)}t(r)}return!0}(e,t),deleteTable:()=>({state:e,dispatch:t})=>function(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e,t),mergeCells:()=>({state:e,dispatch:t})=>s6(e,t),splitCell:()=>({state:e,dispatch:t})=>c6(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>d6("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>d6("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>p6(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>!!s6(e,t)||c6(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>function(e,t){return function(n,r){if(!b8(n))return!1;const o=y8(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){const i=n.tr;n.selection instanceof S8?n.selection.forEachCell(((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,{...n.attrs,[e]:t})})):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),r(i)}return!0}}(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>f6(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>f6(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&A8(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const n=S8.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:y6,"Mod-Backspace":y6,Delete:y6,"Mod-Delete":y6}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[X8({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],h6({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema:e=>({tableRole:wY(fY(e,"tableRole",{name:e.name,options:e.options,storage:e.storage}))})}),k6=TX.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",gY(this.options.HTMLAttributes,e),0]}}).extend({addAttributes(){var e;return{...null==(e=this.parent)?void 0:e.call(this),align:{default:null,parseHTML:e=>e.getAttribute("data-align"),renderHTML:({align:e})=>({"data-align":e})},backgroundColor:{default:null,parseHTML:e=>e.getAttribute("data-bg-color"),renderHTML:({backgroundColor:e})=>{const t={"data-bg-color":e};return e&&(t.style=`background-color: ${e}`),t}}}}}),x6=TX.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",gY(this.options.HTMLAttributes,e),0]}}).extend({addAttributes(){var e;return{...null==(e=this.parent)?void 0:e.call(this),align:{default:null,parseHTML:e=>e.getAttribute("data-align"),renderHTML:({align:e})=>({"data-align":e})},backgroundColor:{default:null,parseHTML:e=>e.getAttribute("data-bg-color"),renderHTML:({backgroundColor:e})=>{const t={"data-bg-color":e};return e&&(t.style=`background-color: ${e}`),t}}}}}),C6=TX.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",gY(this.options.HTMLAttributes,e),0]}}),O6=TX.create({name:"pageBreak",group:"block",addOptions:()=>({HTMLAttributes:{class:"page-break","data-line-number":!1}}),parseHTML:()=>[{tag:'div[class*="page-break"]'}],renderHTML({HTMLAttributes:e}){return["div",gY(this.options.HTMLAttributes,e)]},addCommands(){return{setPageBreak:()=>({commands:e})=>e.insertContent({type:this.name})}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setPageBreak()}}}),S6={class:"node-container hover-shadow select-outline toc"},E6=t.createElementVNode("p",{class:"toc-head"},"页面大纲",-1),N6={class:"toc-body"},_6=["href"],M6={__name:"node-view",props:jZ,setup(e){const{tableOfContents:n}=gS();return(e,r)=>(t.openBlock(),t.createBlock(t.unref(TZ),{class:"node-view"},{default:t.withCtx((()=>[t.createElementVNode("div",S6,[E6,t.createElementVNode("ul",N6,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(n),(e=>(t.openBlock(),t.createElementBlock("li",{class:t.normalizeClass(["toc-item",`level-${e.originalLevel}`]),key:e.id},[t.createElementVNode("a",{href:`#${e.id}`,target:"_self"},t.toDisplayString(e.textContent),9,_6)],2)))),128))])])])),_:1}))}},A6=TX.create({name:"toc",group:"block",atom:!0,parseHTML:()=>[{tag:"toc"}],renderHTML({HTMLAttributes:e}){return["toc",gY(this.options.HTMLAttributes,e)]},addNodeView:()=>PZ(M6),addGlobalAttributes:()=>[{types:["heading"],attributes:{}}],addCommands(){return{addTableOfContents:()=>({editor:e})=>{e.chain().focus().insertContent({type:this.name}).run()}}}}),T6=new EW("invisibleCharacters"),V6=(e,t)=>{const n=T6,r=uG.create(e.doc,[]),o=(e,n,r,o)=>t.builders.sort(((e,t)=>e.priority>t.priority?1:-1)).reduce(((t,o)=>o.createDecoration(e,n,r.doc,t)),o);return new CW({key:n,state:{init:()=>{const{$from:n,$to:r}=new pW(e.doc);return t.injectCSS&&document&&((e,t)=>{const n=document.querySelector("style[data-tiptap-extension-invisible-characters-style]");if(null!==n)return n;const r=document.createElement("style");t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-extension-invisible-characters-style",""),r.innerHTML=".Tiptap-invisible-character {\n height: 0;\n padding: 0;\n pointer-events: none;\n user-select: none;\n width: 0;\n}\n\n.Tiptap-invisible-character::before {\n caret-color: inherit;\n color: #aaa;\n display: inline-block;\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n width: 0;\n}\n\n.Tiptap-invisible-character--space::before {\n content: '·'\n}\n\n.Tiptap-invisible-character--break::before {\n content: '¬'\n}\n\n.Tiptap-invisible-character--paragraph::before {\n content: '¶'\n}\n\n.Tiptap-invisible-character + img.ProseMirror-separator {\n height: 0 !important;\n pointer-events: none;\n user-select: none;\n width: 0 !important;\n}\n\n.is-empty[data-placeholder].has-focus > .Tiptap-invisible-character {\n display: none;\n}\n",document.getElementsByTagName("head")[0].appendChild(r)})(0,t.injectNonce),{visible:t.visible,decorations:o(n.pos,r.pos,e,uG.empty)}},apply:(e,t,n,r)=>{const i=(l=t,void 0===(s=e.getMeta("setInvisibleCharactersVisible"))?l:{...l,visible:s}),a=(({mapping:e})=>{const t=[];return e.maps.forEach(((n,r)=>{n.forEach(((n,o,i,a)=>{t.push([e.slice(r+1).map(i),e.slice(r+1).map(a)])}))})),t})(e).reduce(((e,[t,n])=>o(t,n,r,e)),i.decorations.map(e.mapping,e.doc));var l,s;return{...i,decorations:a}}},props:{decorations(e){const t=this.getState(e),n=null==t?void 0:t.visible,o=null==t?void 0:t.decorations;return n?o:r}}})},j6=(e,t,n)=>lG.widget(e,(()=>{const e=document.createElement("span");return e.classList.add("Tiptap-invisible-character"),e.classList.add(`Tiptap-invisible-character--${t}`),n&&(e.textContent=n),e}),{key:t,marks:[],side:1e3}),B6=(e,t)=>t+e.nodeSize-1;let P6=class{constructor(e){this.predicate=e.predicate,this.type=e.type,this.position=e.position||B6,this.content=e.content,this.priority=e.priority||100}createDecoration(e,t,n,r){let o=r;return n.nodesBetween(e,t,((e,t)=>{if(this.test(e)){const r=this.position(e,t),i=o.find(r,r,(e=>e.key===this.type));o=o.remove(i).add(n,[j6(r,this.type,this.content)])}})),o}test(e){return this.predicate(e)}},I6=class extends P6{constructor(){super({type:"break",predicate:e=>e.type===e.type.schema.nodes.hardBreak})}};class D6 extends P6{constructor(){super({type:"paragraph",predicate:e=>e.type===e.type.schema.nodes.paragraph})}}class L6{constructor(e){this.predicate=e.predicate,this.type=e.type,this.content=e.content,this.priority=e.priority||100}createDecoration(e,t,n,r){return((e,t,n)=>{const r=[];return n.nodesBetween(e,t,((n,o)=>{var i;if(n.isText){const a=Math.max(e,o)-o;r.push({pos:o+a,text:(null===(i=n.text)||void 0===i?void 0:i.slice(a,t-o))||""})}})),r})(e,t,n).reduce(((e,t)=>t.text.split("").reduce(((e,r,o)=>this.test(r)?e.add(n,[j6(t.pos+o,this.type,this.content)]):e),e)),r)}test(e){return this.predicate(e)}}class R6 extends L6{constructor(){super({type:"space",predicate:e=>" "===e})}}const z6=DY.create({name:"invisibleCharacters",addOptions:()=>({visible:!0,builders:[new R6,new D6,new I6],injectCSS:!0,injectNonce:void 0}),addProseMirrorPlugins(){return[V6(this.editor.state,this.options)]},addStorage(){return{visibility:()=>this.options.visible}},onBeforeCreate(){this.storage.visibility=()=>{var e;return null===(e=T6.getState(this.editor.state))||void 0===e?void 0:e.visible}},addCommands:()=>({showInvisibleCharacters:(e=!0)=>({dispatch:t,tr:n})=>(t&&n.setMeta("setInvisibleCharactersVisible",e),!0),hideInvisibleCharacters:()=>({dispatch:e,tr:t})=>(e&&t.setMeta("setInvisibleCharactersVisible",!1),!0),toggleInvisibleCharacters:()=>({dispatch:e,tr:t,state:n})=>{var r;const o=!(null===(r=T6.getState(n))||void 0===r?void 0:r.visible);return e&&t.setMeta("setInvisibleCharactersVisible",o),!0}})});class F6 extends P6{constructor(){super({type:"paragraph",predicate:e=>["heading"].includes(e.type.name)})}}const $6=DY.create({name:"selection",addCommands:()=>({getSelectionText:()=>({editor:e})=>{const{from:t,to:n,empty:r}=e.state.selection;return r?"":e.state.doc.textBetween(t,n,"")},getSelectionNode:()=>({editor:e})=>{for(const t of Array.from(e.vueRenderers))if(t[1].props.selected)return t[1]},deleteSelectionNode:()=>({editor:e,chain:t})=>{if(e.isActive("image")||e.isActive("video")||e.isActive("audio")||e.isActive("file")){const t=e.commands.getSelectionNode();if(!t)return;const{options:n}=gS(),{id:r,src:o}=t.props.node.attrs;n.value.onFileDelete(r,o)}return t().deleteSelection().run()}}),addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.deleteSelectionNode(),Delete:()=>this.editor.commands.deleteSelectionNode()}}});var H6,U6=new Uint8Array(16);function W6(){if(!H6&&!(H6="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return H6(U6)}const q6=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var K6=[],G6=0;G6<256;++G6)K6.push((G6+256).toString(16).substr(1));function Y6(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(K6[e[t+0]]+K6[e[t+1]]+K6[e[t+2]]+K6[e[t+3]]+"-"+K6[e[t+4]]+K6[e[t+5]]+"-"+K6[e[t+6]]+K6[e[t+7]]+"-"+K6[e[t+8]]+K6[e[t+9]]+"-"+K6[e[t+10]]+K6[e[t+11]]+K6[e[t+12]]+K6[e[t+13]]+K6[e[t+14]]+K6[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&q6.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n}function X6(e,t,n){var r=(e=e||{}).random||(e.rng||W6)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Y6(r)}const Z6=({getId:e,anchorTypes:t=["heading"]})=>new CW({key:new EW("tableOfContent"),appendTransaction(n,r,o){const i=o.tr;let a=!1;if(n.some((e=>e.docChanged))){const n=[];o.doc.descendants(((r,o)=>{const l=r.attrs["data-toc-id"];if(t.includes(r.type.name)&&0!==r.textContent.length){if(null==l||n.includes(l)){let t="";t=e?e(r.textContent):X6(),i.setNodeMarkup(o,void 0,{...r.attrs,"data-toc-id":t,id:t}),a=!0}n.push(l)}}))}return a?i:null}}),J6=(e,t)=>{let n=1;const r=t.at(-1),o=[...t].reverse().find((t=>t.originalLevel<=e.node.attrs.level)),i=(null==o?void 0:o.level)||1;return n=e.node.attrs.level>((null==r?void 0:r.originalLevel)||1)?((null==r?void 0:r.level)||1)+1:e.node.attrs.level<((null==r?void 0:r.originalLevel)||1)?i:(null==r?void 0:r.level)||1,n},Q6=(e,t)=>{const n=t.at(-1);return n?((null==n?void 0:n.itemIndex)||1)+1:1},e9=(e,t,n)=>{var r,o;const i=n||e.node.attrs.level||1;let a=1;const l=t.filter((e=>e.level<=i));return a=(null===(r=l.at(-1))||void 0===r?void 0:r.level)===i?((null===(o=l.at(-1))||void 0===o?void 0:o.itemIndex)||1)+1:1,a},t9=(e,t)=>{const{editor:n}=t,r=[],o=[];let i=null;if(n.state.doc.descendants(((e,n)=>{e.type.name===(t.anchorTypes||"heading")&&r.push({node:e,pos:n})})),r.forEach((e=>{const r=n.view.domAtPos(e.pos+1).node;t.storage.scrollPosition>=r.offsetTop&&(i=e.node.attrs["data-toc-id"],o.push(e.node.attrs["data-toc-id"]))})),e=e.map((e=>({...e,isActive:e.id===i,isScrolledOver:o.includes(e.id)}))),t.onUpdate){const n=0===t.storage.content.length;t.onUpdate(e,n)}return e},n9=e=>{const{editor:t,onUpdate:n}=e,r=[];let o=[];const i=[];if(t.state.doc.descendants(((t,n)=>{var o;(null===(o=e.anchorTypes)||void 0===o?void 0:o.includes(t.type.name))&&r.push({node:t,pos:n})})),r.forEach(((n,a)=>{if(0===n.node.textContent.length)return;const l=t.view.domAtPos(n.pos+1).node,s=e.storage.scrollPosition>=l.offsetTop;i.push(l);const c=n.node.attrs.level,u=r[a-1],d=e.getLevelFn(n,o),p=e.getIndexFn(n,o,d);o=u?[...o,{itemIndex:p,id:n.node.attrs["data-toc-id"],originalLevel:c,level:d,textContent:n.node.textContent,pos:n.pos,editor:t,isActive:!1,isScrolledOver:!1,node:n.node,dom:l}]:[...o,{itemIndex:p,id:n.node.attrs["data-toc-id"],originalLevel:c,level:d,textContent:n.node.textContent,pos:n.pos,editor:t,isActive:!1,isScrolledOver:s,node:n.node,dom:l}]})),o=t9(o,e),n){const t=0===e.storage.content.length;n(o,t)}e.storage.anchors=i,e.storage.content=o,t.state.tr.setMeta("toc",o),t.view.dispatch(t.state.tr)},r9=DY.create({name:"tableOfContents",addStorage:()=>({content:[],anchors:[],scrollHandler:()=>null,scrollPosition:0}),addGlobalAttributes(){return[{types:this.options.anchorTypes||["headline"],attributes:{id:{default:null,renderHTML:e=>({id:e.id}),parseHTML:e=>e.id||null},"data-toc-id":{default:null,renderHTML:e=>({"data-toc-id":e["data-toc-id"]}),parseHTML:e=>e.dataset.tocId||null}}}]},addOptions:()=>({onUpdate:()=>{},getId:e=>X6(),scrollParent:"undefined"!=typeof window&&window||void 0,anchorTypes:["heading"]}),onUpdate(){var e;n9({editor:this.editor,storage:this.storage,onUpdate:null===(e=this.options.onUpdate)||void 0===e?void 0:e.bind(this),getIndexFn:this.options.getIndex||Q6,getLevelFn:this.options.getLevel||J6,anchorTypes:this.options.anchorTypes})},onCreate(){var e;const{tr:t}=this.editor.state,n=[];this.editor.state.doc.descendants(((e,r)=>{var o;const i=e.attrs["data-toc-id"];if((null===(o=this.options.anchorTypes)||void 0===o?void 0:o.includes(e.type.name))&&0!==e.textContent.length){if(null==i||n.includes(i)){let n="";n=this.options.getId?this.options.getId(e.textContent):X6(),t.setNodeMarkup(r,void 0,{...e.attrs,"data-toc-id":n,id:n})}n.push(i)}})),this.editor.view.dispatch(t),n9({editor:this.editor,storage:this.storage,onUpdate:null===(e=this.options.onUpdate)||void 0===e?void 0:e.bind(this),getIndexFn:this.options.getIndex||Q6,getLevelFn:this.options.getLevel||J6,anchorTypes:this.options.anchorTypes}),this.storage.scrollHandler=()=>{var e,t;const n=this.options.scrollParent instanceof HTMLElement?this.options.scrollParent.scrollTop:null===(e=this.options.scrollParent)||void 0===e?void 0:e.scrollY;this.storage.scrollPosition=n||0;const r=t9(this.storage.content,{editor:this.editor,anchorTypes:this.options.anchorTypes,storage:this.storage,onUpdate:null===(t=this.options.onUpdate)||void 0===t?void 0:t.bind(this)});this.storage.content=r},this.options.scrollParent&&this.options.scrollParent.addEventListener("scroll",this.storage.scrollHandler)},onDestroy(){this.options.scrollParent&&this.options.scrollParent.removeEventListener("scroll",this.storage.scrollHandler)},addProseMirrorPlugins(){return[Z6({getId:this.options.getId,anchorTypes:this.options.anchorTypes})]}}),o9=DY.create({name:"typography",addInputRules(){const e=[];var t;return!1!==this.options.emDash&&e.push(_X({find:/--$/,replace:null!=(t=this.options.emDash)?t:"—"})),!1!==this.options.ellipsis&&e.push((e=>_X({find:/\.\.\.$/,replace:null!=e?e:"…"}))(this.options.ellipsis)),!1!==this.options.openDoubleQuote&&e.push((e=>_X({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:null!=e?e:"“"}))(this.options.openDoubleQuote)),!1!==this.options.closeDoubleQuote&&e.push((e=>_X({find:/"$/,replace:null!=e?e:"”"}))(this.options.closeDoubleQuote)),!1!==this.options.openSingleQuote&&e.push((e=>_X({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:null!=e?e:"‘"}))(this.options.openSingleQuote)),!1!==this.options.closeSingleQuote&&e.push((e=>_X({find:/'$/,replace:null!=e?e:"’"}))(this.options.closeSingleQuote)),!1!==this.options.leftArrow&&e.push((e=>_X({find:/<-$/,replace:null!=e?e:"←"}))(this.options.leftArrow)),!1!==this.options.rightArrow&&e.push((e=>_X({find:/->$/,replace:null!=e?e:"→"}))(this.options.rightArrow)),!1!==this.options.copyright&&e.push((e=>_X({find:/\(c\)$/,replace:null!=e?e:"©"}))(this.options.copyright)),!1!==this.options.trademark&&e.push((e=>_X({find:/\(tm\)$/,replace:null!=e?e:"™"}))(this.options.trademark)),!1!==this.options.servicemark&&e.push((e=>_X({find:/\(sm\)$/,replace:null!=e?e:"℠"}))(this.options.servicemark)),!1!==this.options.registeredTrademark&&e.push((e=>_X({find:/\(r\)$/,replace:null!=e?e:"®"}))(this.options.registeredTrademark)),!1!==this.options.oneHalf&&e.push((e=>_X({find:/(?:^|\s)(1\/2)\s$/,replace:null!=e?e:"½"}))(this.options.oneHalf)),!1!==this.options.plusMinus&&e.push((e=>_X({find:/\+\/-$/,replace:null!=e?e:"±"}))(this.options.plusMinus)),!1!==this.options.notEqual&&e.push((e=>_X({find:/!=$/,replace:null!=e?e:"≠"}))(this.options.notEqual)),!1!==this.options.laquo&&e.push((e=>_X({find:/<<$/,replace:null!=e?e:"«"}))(this.options.laquo)),!1!==this.options.raquo&&e.push((e=>_X({find:/>>$/,replace:null!=e?e:"»"}))(this.options.raquo)),!1!==this.options.multiplication&&e.push((e=>_X({find:/\d+\s?([*x])\s?\d+$/,replace:null!=e?e:"×"}))(this.options.multiplication)),!1!==this.options.superscriptTwo&&e.push((e=>_X({find:/\^2$/,replace:null!=e?e:"²"}))(this.options.superscriptTwo)),!1!==this.options.superscriptThree&&e.push((e=>_X({find:/\^3$/,replace:null!=e?e:"³"}))(this.options.superscriptThree)),!1!==this.options.oneQuarter&&e.push((e=>_X({find:/(?:^|\s)(1\/4)\s$/,replace:null!=e?e:"¼"}))(this.options.oneQuarter)),!1!==this.options.threeQuarters&&e.push((e=>_X({find:/(?:^|\s)(3\/4)\s$/,replace:null!=e?e:"¾"}))(this.options.threeQuarters)),e}}),i9=DY.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter((e=>""!==e)).length}},addProseMirrorPlugins(){return[new CW({key:new EW("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,a=i-(o-n),l=i;e.deleteRange(a,l);return!(this.storage.characters({node:e.doc})>n)}})]}}),a9=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:o})=>new CW({key:e||new EW("fileHandler"),props:{handleDrop(e,n){var i;const{dataTransfer:a}=n;if(!r)return;if(!(null==(i=null==a?void 0:a.files)?void 0:i.length))return;const l=e.posAtCoords({left:n.clientX,top:n.clientY});let s=Array.from(a.files);o.length>0&&(s=s.filter((e=>!!o.includes(e.type)||!!o.includes(`${e.type.split("/")[0]}/*`)))),0!==s.length&&r(t,s,(null===l?void 0:l.pos)||0),n.preventDefault(),n.stopPropagation()},handlePaste(e,r){var i;const{clipboardData:a}=r;if(!n)return;if(!(null==(i=null==a?void 0:a.files)?void 0:i.length))return;let l=Array.from(a.files);const s=a.getData("text/html");o.length>0&&(l=l.filter((e=>!!o.includes(e.type)||!!o.includes(`${e.type.split("/")[0]}/*`)))),0!==l.length&&n(t,l,s),r.preventDefault(),r.stopPropagation()}}}),l9=DY.create({name:"fileHandler",addOptions:()=>({onPaste:void 0,onDrop:void 0,allowedMimeTypes:[]}),addProseMirrorPlugins(){return[a9({key:new EW(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),s9={__name:"index",setup(e){const{container:n,options:r,page:o,editor:i,tableOfContents:a,setEditor:l,editorDestroyed:s}=gS(),c=bS("document");let u=!0;r.value.document.enableMarkdown&&c.value.markdown||(u=[m2,u8,o9]);const d=new _Z({editable:!r.value.document.readOnly,autofocus:r.value.document.autofocus,content:r.value.document.content,enableInputRules:u,enablePasteRules:u,editorProps:{attributes:{class:"umo-editor"}},extensions:[YJ.configure({bold:!1,bulletList:!1,orderedList:!1,codeBlock:!1,horizontalRule:!1,gapcursor:!0,dropcursor:!1}),XJ.configure({considerAnyAsEmpty:!0,placeholder:r.value.document.placeholder}),JJ,QJ,$Z.extend({renderHTML:({HTMLAttributes:e})=>["b",e,0]}),eQ,tQ,nQ,rQ,ZJ,aQ.configure({multicolor:!0}),lQ,sQ,uQ,dQ,pQ,hQ.configure({nested:!0}),mQ.configure({HTMLAttributes:{class:"task-list"}}),vQ.configure({types:["heading","paragraph"],defaultLineHeight:r.value.dicts.lineHeights.find((e=>e.default)).value}),yQ,m1,m2,x2,N2,K2,n8,Q5,r8,l8,u8,w6.configure({resizable:!0,allowTableNodeSelection:!0}),C6,x6,k6,A6,O6,z6.configure({visible:o.value.showBreakMarks,builders:[new I6,new D6,new F6]}),$6,r9.configure({getIndex:e9,onUpdate:e=>a.value=e,scrollParent:document.querySelector(`${n} .toc-content`),getId:()=>bO(6)}),o9.configure(r.value.document.typographyRules),i9.configure({limit:0!==r.value.document.characterLimit?r.value.document.characterLimit:void 0}),l9.configure({allowedMimeTypes:r.value.file.allowedMimeTypes,onPaste(e,t,n){t.forEach((t=>e.chain().focus().insertFile({file:t}).run()))},onDrop:(e,t,n)=>{t.forEach((t=>e.chain().focus().insertFile({file:t,pos:n}).run()))}}),nJ.configure({color:"var(--umo-primary-color)"})],onUpdate({editor:e}){c.value.content=e.getHTML()}});return l(d),t.onBeforeUnmount((()=>d.destroy())),(e,n)=>{const a=dH;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(t.unref(MZ),{spellcheck:t.unref(r).document.enableSpellcheck&&t.unref(c).spellcheck,class:t.normalizeClass(["editor-container",{"show-line-number":t.unref(o).showLineNumber}]),editor:t.unref(i)},null,8,["spellcheck","class","editor"]),t.unref(r).document.enableBubbleMenu&&t.unref(c).bubbleMenu&&t.unref(i)&&!t.unref(s)?(t.openBlock(),t.createBlock(t.unref(EZ),{key:0,class:"umo-editor-bubble-menu",editor:t.unref(i),"tippy-options":{appendTo:"parent",maxWidth:480,zIndex:99}},{default:t.withCtx((()=>[t.createVNode(a)])),_:1},8,["editor"])):t.createCommentVNode("",!0)],64)}}},c9={class:"toc-container"},u9={class:"toc-title"},d9={class:"toc-content umo-scrollbar"},p9={key:0,class:"toc-empty"},f9=["data-heading","onClick"],h9=yS({__name:"toc",setup(e){const{editor:n,tableOfContents:r}=gS();return(e,o)=>{const i=QC;return t.openBlock(),t.createElementBlock("div",c9,[t.createElementVNode("div",u9,[t.createVNode(i,{class:"icon-toc",name:"toc"}),t.createTextVNode("页面大纲 "),t.createElementVNode("div",{class:"umo-dialog__close",onClick:o[0]||(o[0]=t=>e.$emit("close"))},[t.createVNode(i,{name:"close"})])]),t.createElementVNode("div",d9,[0===t.unref(r).length?(t.openBlock(),t.createElementBlock("div",p9," 当前页面无大纲 ")):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(t.unref(r),(e=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["toc-item",{active:e.isActive,["level-"+e.originalLevel]:!0}]),key:e.id,"data-heading":"H"+e.originalLevel,onClick:t=>(e=>{if(!n.value)return;const t=n.value.view.dom.querySelector(`[data-toc-id="${e.id}"`),r=n.value.view.posAtDOM(t,0),o=n.value.view.state.tr;o.setSelection(new sW(o.doc.resolve(r))),n.value.view.dispatch(o),n.value.view.focus(),n.value.commands.scrollIntoView()})(e)},t.toDisplayString(e.textContent),11,f9)))),128))])])}}},[["__scopeId","data-v-20b47dcf"]]),m9={class:"page-container"},v9={class:"zoomable-container umo-scrollbar"},g9=yS({__name:"page",setup(e){const n=gS(),{container:r,page:o,imagePreview:i}=gS(),a=t.computed((()=>{const{width:e,height:t}=o.value.size;return{width:"horizontal"===o.value.orientation?e:t,height:"horizontal"===o.value.orientation?t:e}})),l=t.computed((()=>`calc(${a.value.width+"cm"} * ${o.value.zoomLevel/100})`)),s=t.computed((()=>`calc(${a.value.height+"cm"} * ${o.value.zoomLevel/100})`));let c=t.ref();const u=()=>{const e=document.querySelector(`${r} .page-content`);c.value=e.clientHeight*o.value.zoomLevel/100+"px"};t.watch((()=>[o.value.zoomLevel,o.value.size,o.value.orientation]),(async()=>{await t.nextTick(),setTimeout((()=>u()),10)}),{immediate:!0,deep:!0}),t.watch((()=>{var e;return null==(e=n.editor.value)?void 0:e.getHTML()}),(()=>u()));const d=t.ref({x:0,height:0});t.watch((()=>o.value.watermark),(({type:e})=>{"compact"===e?(d.value.width=320,d.value.y=240):(d.value.width=480,d.value.y=360)}),{deep:!0,immediate:!0});let p=t.ref([]),f=t.ref(0),h=t.ref(!1);return t.watch((()=>i.value),(e=>{e?(document.querySelectorAll(`${r} .page-content img:not(.icon)`).forEach((e=>{const t=e.getAttribute("src");t&&p.value.push(t)})),f.value=images.findIndex((t=>t===e)),h.value=!0):(p.value=[],f.value=0,h.value=!1)})),(e,n)=>{const u=h9,m=s9,v=WC,g=FC,b=yw,y=Sz;return t.openBlock(),t.createElementBlock("div",m9,[t.unref(o).showToc?(t.openBlock(),t.createBlock(u,{key:0,onClose:n[0]||(n[0]=e=>t.unref(o).showToc=!1)})):t.createCommentVNode("",!0),t.createElementVNode("div",v9,[t.createElementVNode("div",{class:"zoomable-content",style:t.normalizeStyle({width:l.value,height:t.unref(c),minHeight:s.value})},[t.createVNode(v,t.mergeProps({class:"page-content",alpha:t.unref(o).watermark.alpha},d.value,{"watermark-content":t.unref(o).watermark,style:{width:a.value.width+"cm",minHeight:a.value.height+"cm",transform:`scale(${t.unref(o).zoomLevel/100})`,padding:`${t.unref(o).margin.top+"cm"} ${t.unref(o).margin.right+"cm"} ${t.unref(o).margin.bottom+"cm"} ${t.unref(o).margin.left+"cm"}`,background:t.unref(o).background}}),{default:t.withCtx((()=>[t.createVNode(m)])),_:1},16,["alpha","watermark-content","style"])],4)]),t.createVNode(g,{modelValue:t.unref(h),"onUpdate:modelValue":n[1]||(n[1]=e=>t.isRef(h)?h.value=e:h=e),images:t.unref(p),index:t.unref(f),onClose:n[2]||(n[2]=e=>i.value=!1)},null,8,["modelValue","images","index"]),t.createVNode(b,{container:`${t.unref(r)} .zoomable-container`,"visible-height":800,size:"small",offset:["25px","30px"]},null,8,["container"]),t.createVNode(y)])}}},[["__scopeId","data-v-fa4c329f"]]),b9={class:"source-container"},y9={class:"title"};const w9=yS({},[["render",function(e,n){const r=QC;return t.openBlock(),t.createElementBlock("div",b9,[t.createElementVNode("h3",y9,[t.createVNode(r,{name:"code",class:"icon"}),t.createTextVNode(" 编辑源代码")])])}],["__scopeId","data-v-0270abbc"]]),k9=yS({__name:"scrollable",setup(e,{expose:n}){const r=t.ref(null),o=t.ref(null);let i=t.ref(!0),a=t.ref(!0);const l=()=>{const{scrollLeft:e,scrollWidth:t,clientWidth:n}=o.value;i.value=0===e,a.value=e+n+1>=t},s=()=>o.value.scrollLeft-=100,c=()=>o.value.scrollLeft+=100;!function(e,n,r={}){const{window:o=$O,...i}=r;let a;const l=GO((()=>o&&"ResizeObserver"in o)),s=()=>{a&&(a.disconnect(),a=void 0)},c=t.computed((()=>Array.isArray(e)?e.map((e=>FO(e))):[FO(e)])),u=t.watch(c,(e=>{if(s(),l.value&&o){a=new ResizeObserver(n);for(const t of e)t&&a.observe(t,i)}}),{immediate:!0,flush:"post"}),d=()=>{s(),u()};yO(d)}(r,(()=>{l()})),t.onMounted((()=>{o.value.addEventListener("scroll",l)}));return n({update:()=>{o.value.scrollLeft=0,a.value=!0,l()}}),(e,n)=>{const l=QC;return t.openBlock(),t.createElementBlock("div",{ref_key:"wraperRef",ref:r,class:"scrollable-container"},[t.unref(i)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"scrollable-control left",onClick:s},[t.createVNode(l,{name:"arrow-down"})])),t.createElementVNode("div",{ref_key:"contentRef",ref:o,class:"scrollable-content"},[t.renderSlot(e.$slots,"default",{},void 0,!0)],512),t.unref(a)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:1,class:"scrollable-control right",onClick:c},[t.createVNode(l,{name:"arrow-down"})]))],512)}}},[["__scopeId","data-v-50597cae"]]),x9=e=>(t.pushScopeId("data-v-530fed6f"),e=e(),t.popScopeId(),e),C9=x9((()=>t.createElementVNode("p",{class:"button-text"},"Embed",-1))),O9={class:"embed-container"},S9=x9((()=>t.createElementVNode("div",{class:"embed-tip"}," 复制后,请手动修改 <iframe> 的宽度和高度,以便获得更好的浏览效果。 ",-1))),E9=yS({__name:"embed",setup(e){const{options:n}=gS();let r=t.ref(!1);const o=t.computed((()=>`<iframe src="${n.value.shareUrl}" width="100%" height="720px" frameborder="0" allowfullscreen="true"></iframe>`)),i=()=>{const{copy:e}=JO({source:o});e(),tR("success","代码已复制到剪切板"),r.value=!1};return(e,n)=>{const a=QC,l=Bz,s=Lk,c=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(l,{"huge-button":"",onButtonClick:n[0]||(n[0]=e=>t.isRef(r)?r.value=!0:r=!0)},{text:t.withCtx((()=>[C9])),default:t.withCtx((()=>[t.createVNode(a,{name:"embed"})])),_:1}),t.createVNode(c,{visible:t.unref(r),icon:"embed",title:"Embed 嵌入",width:"420px",confirmBtn:"复制",onConfirm:i,onClose:n[1]||(n[1]=e=>t.isRef(r)?r.value=!1:r=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",O9,[S9,t.createVNode(s,{class:"embed-textarea",value:t.unref(o),readonly:"",autosize:""},null,8,["value"])])])),_:1},8,["visible"])],64)}}},[["__scopeId","data-v-530fed6f"]]),N9=e=>(t.pushScopeId("data-v-2ff71609"),e=e(),t.popScopeId(),e),_9=N9((()=>t.createElementVNode("p",{class:"button-text"},"文档分享",-1))),M9={class:"share-container"},A9=N9((()=>t.createElementVNode("div",{class:"share-tip"},"复制链接发给需要分享的人。",-1))),T9=yS({__name:"share",setup(e){const{options:n}=gS();let r=t.ref(!1);const o=()=>{const{copy:e}=JO({source:n.value.shareUrl});e(),tR("success","链接已复制到剪切板"),r.value=!1};return(e,i)=>{const a=QC,l=Bz,s=Lk,c=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(l,{"huge-button":"",onButtonClick:i[0]||(i[0]=e=>t.isRef(r)?r.value=!0:r=!0)},{text:t.withCtx((()=>[_9])),default:t.withCtx((()=>[t.createVNode(a,{name:"share"})])),_:1}),t.createVNode(c,{visible:t.unref(r),icon:"share",title:"文档分享",width:"420px",confirmBtn:"复制",onConfirm:o,onClose:i[1]||(i[1]=e=>t.isRef(r)?r.value=!1:r=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",M9,[A9,t.createVNode(s,{class:"share-textarea",value:t.unref(n).shareUrl,readonly:"",autosize:""},null,8,["value"])])])),_:1},8,["visible"])],64)}}},[["__scopeId","data-v-2ff71609"]]);var V9={exports:{}};!function(e,t){!function(){function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof v&&v.global===v?v:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,t,a){var l=i.URL||i.webkitURL,s=document.createElement("a");t=t||e.name||"download",s.download=t,s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?o(s):r(s.href)?n(e,t,a):o(s,s.target="_blank")):(s.href=l.createObjectURL(e),setTimeout((function(){l.revokeObjectURL(s.href)}),4e4),setTimeout((function(){o(s)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,i,a){if(i=i||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,a),i);else if(r(e))n(e,i,a);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout((function(){o(l)}))}}:function(e,t,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var l="application/octet-stream"===e.type,s=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||l&&s||a)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},u.readAsDataURL(e)}else{var d=i.URL||i.webkitURL,p=d.createObjectURL(e);o?o.location=p:location.href=p,o=null,setTimeout((function(){d.revokeObjectURL(p)}),4e4)}});i.saveAs=l.saveAs=l,e.exports=l}()}(V9);var j9=V9.exports;const B9=t.createElementVNode("p",{class:"button-text"},"文本文档",-1),P9={__name:"text",setup(e){const{options:n,editor:r}=gS(),o=()=>{var e;if(!r.value)return;const t=new Blob([null==(e=r.value)?void 0:e.getText()],{type:"text/plain;charset=utf-8"});j9.saveAs(t,`${n.value.document.title}.txt`)};return(e,n)=>{const r=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:o},{text:t.withCtx((()=>[B9])),default:t.withCtx((()=>[t.createVNode(r,{name:"text"})])),_:1})}}},I9=t.createElementVNode("p",{class:"button-text"},"HTML",-1),D9={__name:"html",setup(e){const{options:n,editor:r}=gS(),o=()=>{var e;if(!r.value)return;const t=new Blob([null==(e=r.value)?void 0:e.getHTML()],{type:"text/html;charset=utf-8"});j9.saveAs(t,`${n.value.document.title}.html`)};return(e,n)=>{const r=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:o},{text:t.withCtx((()=>[I9])),default:t.withCtx((()=>[t.createVNode(r,{name:"html5"})])),_:1})}}};var L9={exports:{}};!function(e,t){!function(t){const n=function(){let e=0;return{escape:function(e){return e.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):(t=e,new Promise((function(e){var n=p(t.toDataURL().split(",")[1]),r=n.length,o=new Uint8Array(r);for(let t=0;t<r;t++)o[t]=n.charCodeAt(t);e(new Blob([o],{type:"image/png"}))})));var t},resolveUrl:function(e,t){var n=document.implementation.createHTMLDocument(),r=n.createElement("base"),o=(n.head.appendChild(r),n.createElement("a"));return n.body.appendChild(o),r.href=t,o.href=e,o.href},getAndEncode:function(e){let t=c.impl.urlCache.find((function(t){return t.url===e}));return t||(t={url:e,promise:null},c.impl.urlCache.push(t)),null===t.promise&&(c.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),t.promise=new Promise((function(t){const n=c.impl.options.httpTimeout,r=new XMLHttpRequest;if(r.onreadystatechange=function(){if(4===r.readyState)if(300<=r.status)i?t(i):a(`cannot fetch resource: ${e}, status: `+r.status);else{const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(r.response)}},r.ontimeout=function(){i?t(i):a(`timeout of ${n}ms occured while fetching resource: `+e)},r.responseType="blob",r.timeout=n,0<c.impl.options.useCredentialsFilters.length&&(c.impl.options.useCredentials=0<c.impl.options.useCredentialsFilters.filter((t=>0<=e.search(t))).length),c.impl.options.useCredentials&&(r.withCredentials=!0),c.impl.options.corsImg&&0===e.indexOf("http")&&-1===e.indexOf(window.location.origin)){var o="POST"===(c.impl.options.corsImg.method||"GET").toUpperCase()?"POST":"GET";r.open(o,(c.impl.options.corsImg.url||"").replace("#{cors}",e),!0);let t=!1;const n=c.impl.options.corsImg.headers||{},i=(Object.keys(n).forEach((function(e){-1!==n[e].indexOf("application/json")&&(t=!0),r.setRequestHeader(e,n[e])})),function(e){try{return JSON.parse(JSON.stringify(e))}catch(t){a("corsImg.data is missing or invalid")}}(c.impl.options.corsImg.data||""));Object.keys(i).forEach((function(t){"string"==typeof i[t]&&(i[t]=i[t].replace("#{cors}",e))})),r.send(t?JSON.stringify(i):i)}else r.open("GET",e,!0),r.send();let i;function a(e){console.error(e),t("")}c.impl.options.imagePlaceholder&&(o=c.impl.options.imagePlaceholder.split(/,/))&&o[1]&&(i=o[1])}))),t.promise},uid:function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+e++},delay:function(e){return function(t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))}},asArray:function(e){var t=[],n=e.length;for(let r=0;r<n;r++)t.push(e[r]);return t},escapeXhtml:function(e){return e.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return"data:,"!==e?new Promise((function(t,n){const r=new Image;c.impl.options.useCredentials&&(r.crossOrigin="use-credentials"),r.onload=function(){window&&window.requestAnimationFrame?window.requestAnimationFrame((function(){t(r)})):t(r)},r.onerror=n,r.src=e})):Promise.resolve()},width:function(e){var t=a(e,"width");if(!isNaN(t))return t;t=a(e,"border-left-width");var n=a(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=a(e,"height");if(!isNaN(t))return t;t=a(e,"border-top-width");var n=a(e,"border-bottom-width");return e.scrollHeight+t+n},getWindow:n,isElement:i,isElementHostForOpenShadowRoot:function(e){return i(e)&&null!==e.shadowRoot},isShadowRoot:r,isInShadowRoot:o,isHTMLElement:function(e){return e instanceof n(e).HTMLElement},isHTMLCanvasElement:function(e){return e instanceof n(e).HTMLCanvasElement},isHTMLInputElement:function(e){return e instanceof n(e).HTMLInputElement},isHTMLImageElement:function(e){return e instanceof n(e).HTMLImageElement},isHTMLLinkElement:function(e){return e instanceof n(e).HTMLLinkElement},isHTMLScriptElement:function(e){return e instanceof n(e).HTMLScriptElement},isHTMLStyleElement:function(e){return e instanceof n(e).HTMLStyleElement},isHTMLTextAreaElement:function(e){return e instanceof n(e).HTMLTextAreaElement},isShadowSlotElement:function(e){return o(e)&&e instanceof n(e).HTMLSlotElement},isSVGElement:function(e){return e instanceof n(e).SVGElement},isSVGRectElement:function(e){return e instanceof n(e).SVGRectElement},isDimensionMissing:function(e){return isNaN(e)||e<=0}};function n(e){return((e=e?e.ownerDocument:void 0)?e.defaultView:void 0)||t||window}function r(e){return e instanceof n(e).ShadowRoot}function o(e){return null!==e&&Object.prototype.hasOwnProperty.call(e,"getRootNode")&&r(e.getRootNode())}function i(e){return e instanceof n(e).Element}function a(e,t){if(e.nodeType===u){let n=d(e).getPropertyValue(t);if("px"===n.slice(-2))return n=n.slice(0,-2),parseFloat(n)}return NaN}}(),r=function(){const e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,n,i){return t(e)?Promise.resolve(e).then(r).then((function(t){let r=Promise.resolve(e);return t.forEach((function(e){r=r.then((function(t){return o(t,e,n,i)}))})),r})):Promise.resolve(e)},shouldProcess:t,impl:{readUrls:r,inline:o}};function t(t){return-1!==t.search(e)}function r(t){for(var r,o=[];null!==(r=e.exec(t));)o.push(r[1]);return o.filter((function(e){return!n.isDataUrl(e)}))}function o(e,t,r,o){return Promise.resolve(t).then((function(e){return r?n.resolveUrl(e,r):e})).then(o||n.getAndEncode).then((function(r){return e.replace((o=t,new RegExp(`(url\\(['"]?)(${n.escape(o)})(['"]?\\))`,"g")),`$1${r}$3`);var o}))}}(),o={resolveAll:function(){return i().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:i}};function i(){return Promise.resolve(n.asArray(document.styleSheets)).then((function(e){const t=[];return e.forEach((function(e){if(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(e),"cssRules"))try{n.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(r){console.error("domtoimage: Error while reading CSS rules from "+e.href,r.toString())}})),t})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return r.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return r.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}const a={inlineAll:function e(t){return n.isElement(t)?function(e){const t=["background","background-image"].map((function(t){const n=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return n?r.inlineAll(n).then((function(n){e.style.setProperty(t,n,o)})):Promise.resolve()}));return Promise.all(t).then((function(){return e}))}(t).then((function(){return n.isHTMLImageElement(t)?l(t).inline():Promise.all(n.asArray(t.childNodes).map((function(t){return e(t)})))})):Promise.resolve(t)},impl:{newImage:l}};function l(e){return{inline:function(t){return n.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||n.getAndEncode).then((function(t){return new Promise((function(n){e.onload=n,e.onerror=n,e.src=t}))}))}}}const s={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0,adjustClonedNode:void 0},c={toSvg:f,toPng:function(e,t){return h(e,t).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return h(e,t).then((function(e){return e.toDataURL("image/jpeg",(t?t.quality:void 0)||1)}))},toBlob:function(e,t){return h(e,t).then(n.canvasToBlob)},toPixelData:function(e,t){return h(e,t).then((function(t){return t.getContext("2d").getImageData(0,0,n.width(e),n.height(e)).data}))},toCanvas:h,impl:{fontFaces:o,images:a,util:n,inliner:r,urlCache:[],options:{}}},u=(e.exports=c,("undefined"!=typeof Node?Node.ELEMENT_NODE:void 0)||1),d=(void 0!==t?t.getComputedStyle:void 0)||("undefined"!=typeof window?window.getComputedStyle:void 0)||globalThis.getComputedStyle,p=(void 0!==t?t.atob:void 0)||("undefined"!=typeof window?window.atob:void 0)||globalThis.atob;function f(e,t){c.impl.util.getWindow(e);var r=t=t||{};void 0===r.copyDefaultStyles?c.impl.options.copyDefaultStyles=s.copyDefaultStyles:c.impl.options.copyDefaultStyles=r.copyDefaultStyles,void 0===r.imagePlaceholder?c.impl.options.imagePlaceholder=s.imagePlaceholder:c.impl.options.imagePlaceholder=r.imagePlaceholder,void 0===r.cacheBust?c.impl.options.cacheBust=s.cacheBust:c.impl.options.cacheBust=r.cacheBust,void 0===r.corsImg?c.impl.options.corsImg=s.corsImg:c.impl.options.corsImg=r.corsImg,void 0===r.useCredentials?c.impl.options.useCredentials=s.useCredentials:c.impl.options.useCredentials=r.useCredentials,void 0===r.useCredentialsFilters?c.impl.options.useCredentialsFilters=s.useCredentialsFilters:c.impl.options.useCredentialsFilters=r.useCredentialsFilters,void 0===r.httpTimeout?c.impl.options.httpTimeout=s.httpTimeout:c.impl.options.httpTimeout=r.httpTimeout,void 0===r.styleCaching?c.impl.options.styleCaching=s.styleCaching:c.impl.options.styleCaching=r.styleCaching;let o=[];return Promise.resolve(e).then((function(e){if(e.nodeType===u)return e;var t=e,n=e.parentNode,r=document.createElement("span");return n.replaceChild(r,t),r.append(e),o.push({parent:n,child:t,wrapper:r}),r})).then((function(e){return function e(t,r,o,i){const a=r.filter;return t===m||n.isHTMLScriptElement(t)||n.isHTMLStyleElement(t)||n.isHTMLLinkElement(t)||null!==o&&a&&!a(t)?Promise.resolve():Promise.resolve(t).then((function(e){return n.isHTMLCanvasElement(e)?n.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(e){return r.adjustClonedNode&&r.adjustClonedNode(t,e,!1),Promise.resolve(e)})).then((function(o){return function(t,o){const i=s(o);let a=Promise.resolve();if(0!==i.length){const s=d(l(o));n.asArray(i).forEach((function(n){a=a.then((function(){return e(n,r,s).then((function(e){e&&t.appendChild(e)}))}))}))}return a.then((function(){return t}));function l(e){return n.isShadowRoot(e)?e.host:e}function s(e){return n.isShadowSlotElement(e)?e.assignedNodes():e.childNodes}}(o,function(e){return n.isElementHostForOpenShadowRoot(e)?e.shadowRoot:e}(t))})).then((function(e){return r.adjustClonedNode&&r.adjustClonedNode(t,e,!0),Promise.resolve(e)})).then((function(e){return function(e,t){return!n.isElement(e)||n.isShadowSlotElement(t)?Promise.resolve(e):Promise.resolve().then(i).then(a).then(l).then(s).then((function(){return e}));function i(){function i(e,t){t.font=e.font,t.fontFamily=e.fontFamily,t.fontFeatureSettings=e.fontFeatureSettings,t.fontKerning=e.fontKerning,t.fontSize=e.fontSize,t.fontStretch=e.fontStretch,t.fontStyle=e.fontStyle,t.fontVariant=e.fontVariant,t.fontVariantCaps=e.fontVariantCaps,t.fontVariantEastAsian=e.fontVariantEastAsian,t.fontVariantLigatures=e.fontVariantLigatures,t.fontVariantNumeric=e.fontVariantNumeric,t.fontVariationSettings=e.fontVariationSettings,t.fontWeight=e.fontWeight}function a(e,t){const l=d(e);l.cssText?(t.style.cssText=l.cssText,i(l,t.style)):(function(e,t,r,o,i){const l=c.impl.options.copyDefaultStyles?function(e,t){t=function(e){var t=[];do{if(e.nodeType===u){var n=e.tagName;if(t.push(n),w.includes(n))break}}while(e=e.parentNode);return t}(t);var r=function(t){return("relaxed"!==e.styleCaching?t:t.filter(((e,t,n)=>0===t||t===n.length-1))).join(">")}(t);if(y[r])return y[r];var o=function(){if(m)return m.contentWindow;var e=document.characterSet||"UTF-8",t=(t=document.doctype)?(`<!DOCTYPE ${r(t.name)} ${r(t.publicId)} `+r(t.systemId)).trim()+">":"";return(m=document.createElement("iframe")).id="domtoimage-sandbox-"+n.uid(),m.style.visibility="hidden",m.style.position="fixed",document.body.appendChild(m),function(e,t,n,r){try{return e.contentWindow.document.write(t+`<html><head><meta charset='${n}'><title>${r}</title></head><body></body></html>`),e.contentWindow}catch(a){}var o=document.createElement("meta");o.setAttribute("charset",n);try{var i=document.implementation.createHTMLDocument(r),l=(i.head.appendChild(o),t+i.documentElement.outerHTML);return e.setAttribute("srcdoc",l),e.contentWindow}catch(a){}return e.contentDocument.head.appendChild(o),e.contentDocument.title=r,e.contentWindow}(m,t,e,"domtoimage-sandbox");function r(e){var t;return e?((t=document.createElement("div")).innerText=e,t.innerHTML):""}}();t=function(e,t){let n=e.body;do{var r=t.pop();r=e.createElement(r);n.appendChild(r),n=r}while(0<t.length);return n.textContent="​",n}(o.document,t),o=function(e,t){const r={},o=e.getComputedStyle(t);return n.asArray(o).forEach((function(e){r[e]="width"===e||"height"===e?"auto":o.getPropertyValue(e)})),r}(o,t);return function(e){do{var t=e.parentElement;null!==t&&t.removeChild(e),e=t}while(e&&"BODY"!==e.tagName)}(t),y[r]=o}(e,t):{},s=i.style;n.asArray(r).forEach((function(e){var t,n=r.getPropertyValue(e),i=l[e],a=o?o.getPropertyValue(e):void 0;(n!==i||o&&n!==a)&&(i=r.getPropertyPriority(e),a=s,t=0<=["background-clip"].indexOf(e),i?(a.setProperty(e,n,i),t&&a.setProperty("-webkit-"+e,n,i)):(a.setProperty(e,n),t&&a.setProperty("-webkit-"+e,n)))}))}(r,e,l,o,t),null===o&&(["inset-block","inset-block-start","inset-block-end"].forEach((e=>t.style.removeProperty(e))),["left","right","top","bottom"].forEach((e=>{t.style.getPropertyValue(e)&&t.style.setProperty(e,"0px")}))))}a(t,e)}function a(){const r=n.uid();function o(o){const i=d(t,o),a=i.getPropertyValue("content");if(""!==a&&"none"!==a){let t=function(){const e=`.${r}:`+o,t=(i.cssText?l:s)();return document.createTextNode(e+`{${t}}`);function l(){return`${i.cssText} content: ${a};`}function s(){return n.asArray(i).map(e).join("; ")+";";function e(e){return e+": "+i.getPropertyValue(e)+(i.getPropertyPriority(e)?" !important":"")}}};const l=e.getAttribute("class")||"",s=(e.setAttribute("class",l+" "+r),document.createElement("style"));s.appendChild(t()),e.appendChild(s)}}[":before",":after"].forEach((function(e){o(e)}))}function l(){n.isHTMLTextAreaElement(t)&&(e.innerHTML=t.value),n.isHTMLInputElement(t)&&e.setAttribute("value",t.value)}function s(){n.isSVGElement(e)&&(e.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.isSVGRectElement(e))&&["width","height"].forEach((function(t){const n=e.getAttribute(t);n&&e.style.setProperty(t,n)}))}}(e,t)}))}(e,t,null)})).then(v).then(g).then((function(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor),t.width&&(e.style.width=t.width+"px"),t.height&&(e.style.height=t.height+"px"),t.style&&Object.keys(t.style).forEach((function(n){e.style[n]=t.style[n]}));let n=null;return"function"==typeof t.onclone&&(n=t.onclone(e)),Promise.resolve(n).then((function(){return e}))})).then((function(e){let r=t.width||n.width(e),o=t.height||n.height(e);return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(n.escapeXhtml).then((function(e){var t=(n.isDimensionMissing(r)?' width="100%"':` width="${r}"`)+(n.isDimensionMissing(o)?' height="100%"':` height="${o}"`);return`<svg xmlns="http://www.w3.org/2000/svg"${(n.isDimensionMissing(r)?"":` width="${r}"`)+(n.isDimensionMissing(o)?"":` height="${o}"`)}><foreignObject${t}>${e}</foreignObject></svg>`})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))})).then((function(e){for(;0<o.length;){var t=o.pop();t.parent.replaceChild(t.child,t.wrapper)}return e})).then((function(e){return c.impl.urlCache=[],m&&(document.body.removeChild(m),m=null),b&&clearTimeout(b),b=setTimeout((()=>{b=null,y={}}),2e4),e}))}function h(e,t){return f(e,t=t||{}).then(n.makeImage).then((function(r){var o="number"!=typeof t.scale?1:t.scale,i=function(e,r){let o=t.width||n.width(e),i=t.height||n.height(e);return n.isDimensionMissing(o)&&(o=n.isDimensionMissing(i)?300:2*i),n.isDimensionMissing(i)&&(i=o/2),(e=document.createElement("canvas")).width=o*r,e.height=i*r,t.bgcolor&&((r=e.getContext("2d")).fillStyle=t.bgcolor,r.fillRect(0,0,e.width,e.height)),e}(e,o),a=i.getContext("2d");return a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,r&&(a.scale(o,o),a.drawImage(r,0,0)),i}))}let m=null;function v(e){return o.resolveAll().then((function(t){var n;return""!==t&&(n=document.createElement("style"),e.appendChild(n),n.appendChild(document.createTextNode(t))),e}))}function g(e){return a.inlineAll(e).then((function(){return e}))}let b=null,y={};const w=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"]}(v)}(L9);var R9=L9.exports;const z9=t.createElementVNode("p",{class:"button-text"},"图片",-1),F9={__name:"image",setup(e){const{container:n,options:r,page:o}=gS(),i=[{content:"PNG 格式",value:"png"},{content:"JPG 格式",value:"jpg"}],a=async({content:e,value:t})=>{if(!e)return;const i=o.value.zoomLevel;try{o.value.zoomLevel=100;const e=document.querySelector(`${n} .page-content`),i=await R9.toBlob(e,{scale:devicePixelRatio});j9.saveAs(i,`${r.value.document.title}${devicePixelRatio>1?"@"+devicePixelRatio+"x":""}.${t}`)}catch{const e=QL({theme:"warning",header:"错误提示",body:"导出图片失败,请重试或尝试刷新页面。",onConfirm(){e.destroy()}})}finally{o.value.zoomLevel=i}};return(e,n)=>{const r=QC,o=Bz;return t.openBlock(),t.createBlock(o,{"button-type":"dropdown","huge-button":"","select-options":i,onClick:a},{text:t.withCtx((()=>[z9])),default:t.withCtx((()=>[t.createVNode(r,{name:"image"})])),_:1})}}},$9=t.createElementVNode("p",{class:"button-text"},"演示模式",-1),H9={__name:"preview",setup(e){const{page:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"","button-active":t.unref(n).preview.enabled,onButtonClick:r[0]||(r[0]=e=>t.unref(n).preview.enabled=!t.unref(n).preview.enabled)},{text:t.withCtx((()=>[$9])),default:t.withCtx((()=>[t.createVNode(o,{name:"preview"})])),_:1},8,["button-active"])}}},U9=e=>(t.pushScopeId("data-v-3a28a135"),e=e(),t.popScopeId(),e),W9=U9((()=>t.createElementVNode("p",{class:"button-text"},"页面背景",-1))),q9={class:"background-container"},K9=["onClick"],G9={class:"background-more-menu"},Y9=U9((()=>t.createElementVNode("span",null,"自定义页面背景",-1))),X9={class:"background-more-arrow"},Z9=yS({__name:"background",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{container:o,page:i}=gS(),a=[{label:"默认",value:i.value.defaultBackground},{label:"护眼绿",value:"rgb(233, 246, 227)"},{label:"淡雅黄",value:"rgb(252, 242, 224)"},{label:"云水蓝",value:"rgb(237, 244, 255)"},{label:"天空蓝",value:"rgb(153, 205, 250)"},{label:"暗夜黑",value:"rgb(145, 145, 145)"}],l=t.ref(!1),s=e=>{i.value.background=e};return(e,c)=>{const u=QC,d=mC,p=Zm,f=Bz;return t.openBlock(),t.createBlock(f,{"huge-button":"","button-type":"popup","popup-visible":t.unref(n),onTogglePopup:t.unref(r)},{text:t.withCtx((()=>[W9])),content:t.withCtx((()=>[t.createElementVNode("div",q9,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(a,((e,n)=>t.createElementVNode("div",{class:t.normalizeClass(["background-item",{active:t.unref(i).background===e.value}]),style:t.normalizeStyle({backgroundColor:e.value}),key:n,onClick:t=>s(e.value)},t.toDisplayString(e.label),15,K9))),64))]),t.createVNode(p,{attach:t.unref(o),trigger:"click",placement:"right-bottom",onVisibleChange:c[0]||(c[0]=e=>l.value=e)},{content:t.withCtx((()=>[t.createVNode(d,{size:"small","color-modes":["monochrome"],"swatch-colors":[],"enable-alpha":"",onChange:s})])),default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["background-more",{active:l.value}])},[t.createElementVNode("div",G9,[t.createVNode(u,{name:"palette-color"}),Y9]),t.createElementVNode("div",X9,[t.createVNode(u,{name:"arrow-down"})])],2)])),_:1},8,["attach"])])),default:t.withCtx((()=>[t.createVNode(u,{name:"page-background"})])),_:1},8,["popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-3a28a135"]]),J9=e=>(t.pushScopeId("data-v-63e89dda"),e=e(),t.popScopeId(),e),Q9=J9((()=>t.createElementVNode("p",{class:"button-text"},"页面水印",-1))),e7={class:"watermark-container"},t7={class:"watermark-toolbar"},n7=J9((()=>t.createElementVNode("div",{class:"watermark-type-title"},"水印类型",-1))),r7={class:"watermark-type"},o7=[J9((()=>t.createElementVNode("div",{class:"bg"},null,-1))),J9((()=>t.createElementVNode("span",null,"紧凑型",-1)))],i7=[J9((()=>t.createElementVNode("div",{class:"bg"},null,-1))),J9((()=>t.createElementVNode("span",null,"宽松型",-1)))],a7=yS({__name:"watermark",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{options:o,page:i}=gS(),a=()=>{i.value.watermark.text="",n.value=!1};return(e,l)=>{const s=QC,c=Bz,u=$g,d=pF,p=tF,f=gg,h=Fd;return t.openBlock(),t.createBlock(c,{"huge-button":"","button-type":"popup","popup-visible":t.unref(n),onTogglePopup:t.unref(r)},{text:t.withCtx((()=>[Q9])),content:t.withCtx((()=>[t.createElementVNode("div",e7,[t.createElementVNode("div",t7,[t.createVNode(c,{style:{width:"140px"},tooltip:"水印文字字体","button-type":"select","select-options":t.unref(o).dicts.fonts,value:t.unref(i).watermark.fontFamily,onButtonClick:l[0]||(l[0]=e=>t.unref(i).watermark.fontFamily=e)},null,8,["select-options","value"]),t.createVNode(c,{"button-type":"input",tooltip:"水印文字大小"},{default:t.withCtx((()=>[t.createVNode(u,{modelValue:t.unref(i).watermark.fontSize,"onUpdate:modelValue":l[1]||(l[1]=e=>t.unref(i).watermark.fontSize=e),style:{width:"60px"},size:"small",theme:"column",align:"center",max:96,min:12,"allow-input-over-limit":!1,placeholder:""},null,8,["modelValue"])])),_:1}),t.createVNode(d,{"button-active":"bold"===t.unref(i).watermark.fontWeight,onButtonClickThrough:l[2]||(l[2]=e=>"bold"===t.unref(i).watermark.fontWeight?t.unref(i).watermark.fontWeight="normal":t.unref(i).watermark.fontWeight="bold")},null,8,["button-active"]),t.createVNode(p,{tooltip:"水印文字颜色","default-color":t.unref(i).watermark.fontColor,modeless:"",onChange:l[3]||(l[3]=e=>t.unref(i).watermark.fontColor=e)},null,8,["default-color"])]),t.createVNode(f,{modelValue:t.unref(i).watermark.text,"onUpdate:modelValue":l[4]||(l[4]=e=>t.unref(i).watermark.text=e),modelModifiers:{trim:!0},maxlength:"30",clearable:"",placeholder:"水印文字内容"},null,8,["modelValue"]),n7,t.createElementVNode("div",r7,[t.createElementVNode("div",{class:t.normalizeClass(["item compact",{active:"compact"===t.unref(i).watermark.type}]),onClick:l[5]||(l[5]=e=>t.unref(i).watermark.type="compact")},o7,2),t.createElementVNode("div",{class:t.normalizeClass(["item spacious",{active:"spacious"===t.unref(i).watermark.type}]),onClick:l[6]||(l[6]=e=>t.unref(i).watermark.type="spacious")},i7,2)]),""!==t.unref(i).watermark.text?(t.openBlock(),t.createBlock(h,{key:0,class:"clear-button",block:"",variant:"outline",onClick:a},{default:t.withCtx((()=>[t.createTextVNode("清除水印")])),_:1})):t.createCommentVNode("",!0)])])),default:t.withCtx((()=>[t.createVNode(s,{name:"watermark"})])),_:1},8,["popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-63e89dda"]]),l7=t.createElementVNode("p",{class:"button-text"},"显示行号",-1),s7={__name:"line-number",setup(e){const{page:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"button-active":t.unref(n).showLineNumber,"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.unref(n).showLineNumber=!t.unref(n).showLineNumber)},{text:t.withCtx((()=>[l7])),default:t.withCtx((()=>[t.createVNode(o,{name:"line-number"})])),_:1},8,["button-active"])}}},c7=t.createElementVNode("p",{class:"button-text"},"显示换行",-1),u7={__name:"break-marks",setup(e){const{page:n,editor:r}=gS(),o=()=>{n.value.showBreakMarks=!n.value.showBreakMarks,n.value.showBreakMarks?r.value.commands.showInvisibleCharacters():r.value.commands.hideInvisibleCharacters()};return(e,r)=>{const i=QC,a=Bz;return t.openBlock(),t.createBlock(a,{"huge-button":"","button-active":t.unref(n).showBreakMarks,onButtonClick:o},{text:t.withCtx((()=>[c7])),default:t.withCtx((()=>[t.createVNode(i,{name:"break-marks"})])),_:1},8,["button-active"])}}},d7=t.createElementVNode("p",{class:"button-text"},"插入分页",-1),p7={__name:"break",setup(e){const{editor:n}=gS(),r=()=>{var e;null==(e=n.value)||e.chain().focus().setPageBreak().run()};return(e,n)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{shortcut:"Ctrl+Enter","huge-button":"",onButtonClick:r},{text:t.withCtx((()=>[d7])),default:t.withCtx((()=>[t.createVNode(o,{name:"page-break"})])),_:1})}}},f7=t.createElementVNode("span",{class:"button-text"},"页面方向",-1),h7={class:"label"},m7={__name:"orientation",setup(e){const{page:n}=gS(),r=[{label:"横向",value:"horizontal"},{label:"纵向",value:"vertical"}];return(e,o)=>{const i=QC,a=Gv,l=Yv,s=Bz;return t.openBlock(),t.createBlock(s,{"button-type":"dropdown","overlay-class-name":"page-orientation-dropdown"},{dropmenu:t.withCtx((()=>[t.createVNode(l,null,{default:t.withCtx((()=>[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,((e,r)=>t.createVNode(a,{key:r,value:e.value,active:t.unref(n).orientation===e.value,onClick:r=>t.unref(n).orientation=e.value},{default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["icon",{rotate:"vertical"===e.value}])},[t.createVNode(i,{name:"page"})],2),t.createElementVNode("div",h7,t.toDisplayString(e.label),1)])),_:2},1032,["value","active","onClick"]))),64))])),_:1})])),default:t.withCtx((()=>[t.createVNode(i,{name:"page-orientation",style:{"margin-left":"1px"}}),f7])),_:1})}}},v7={class:"page-options-container"},g7={class:"label"},b7={class:"desc"},y7={class:"page-setting"},w7={class:"item"},k7={class:"item"},x7={class:"page-margin-inbuilt"},C7={class:"page-setting"},O7={class:"item"},S7={class:"item"},E7={class:"item"},N7={class:"item"},_7=yS({__name:"page-options",props:{visible:{type:Boolean,required:!0}},emits:["close"],setup(e,{emit:n}){const r=n,{container:o,options:i,page:a}=gS(),l=e=>{a.value.size=i.value.dicts.pageSizes[e]},s=(e,t)=>{!e||e<10?a.value.size[t]=10:a.value.size.label="自定义"},c=e=>{a.value.margin=e},u=(e,t)=>{!e||e<0?a.value.margin[t]=0:(a.value.margin.layout="custom",c(a.value.margin))};return(n,d)=>{const p=QC,f=mk,h=hk,m=Yw,v=vw,g=mw,b=$g,y=Gw,w=yz;return t.openBlock(),t.createBlock(w,{visible:e.visible,footer:!1,header:"页面设置",width:"460px",onClose:d[17]||(d[17]=e=>r("close"))},{default:t.withCtx((()=>[t.createElementVNode("div",v7,[t.createVNode(y,{"label-align":"left"},{default:t.withCtx((()=>[t.createVNode(m,{label:"页面方向"},{default:t.withCtx((()=>[t.createVNode(h,{modelValue:t.unref(a).orientation,"onUpdate:modelValue":d[0]||(d[0]=e=>t.unref(a).orientation=e),variant:"default-filled"},{default:t.withCtx((()=>[t.createVNode(f,{value:"horizontal"},{default:t.withCtx((()=>[t.createVNode(p,{name:"page"}),t.createTextVNode(" 纵向 ")])),_:1}),t.createVNode(f,{value:"vertical"},{default:t.withCtx((()=>[t.createVNode(p,{class:"rotate",name:"page"}),t.createTextVNode(" 横向 ")])),_:1})])),_:1},8,["modelValue"])])),_:1}),t.createVNode(m,{label:"页面大小"},{default:t.withCtx((()=>[t.createVNode(g,{"popup-props":{overlayClassName:"page-size-select",destroyOnClose:!0,attach:t.unref(o)},placeholder:"",onChange:l},{valueDisplay:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(t.unref(a).size.label),1)])),default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(i).dicts.pageSizes,((e,n)=>(t.openBlock(),t.createBlock(v,{key:n,value:n},{default:t.withCtx((()=>[t.createElementVNode("div",g7,t.toDisplayString(e.label),1),t.createElementVNode("div",b7,t.toDisplayString(e.width)+"厘米 × "+t.toDisplayString(e.height)+"厘米 ",1)])),_:2},1032,["value"])))),128))])),_:1},8,["popup-props"])])),_:1}),t.createVNode(m,{label:"页面尺寸"},{default:t.withCtx((()=>[t.createElementVNode("div",y7,[t.createElementVNode("div",w7,[t.createVNode(b,{class:"page-setting-number",modelValue:t.unref(a).size.width,"onUpdate:modelValue":d[1]||(d[1]=e=>t.unref(a).size.width=e),theme:"normal",align:"center",min:10,label:"宽:",suffix:"厘米",placeholder:"","allow-input-overLimit":!1,onBlur:d[2]||(d[2]=e=>s(e,"width"))},null,8,["modelValue"])]),t.createElementVNode("div",k7,[t.createVNode(b,{class:"page-setting-number",modelValue:t.unref(a).size.height,"onUpdate:modelValue":d[3]||(d[3]=e=>t.unref(a).size.height=e),theme:"normal",align:"center",min:10,label:"高:",suffix:"厘米",placeholder:"","allow-input-overLimit":!1,onBlur:d[4]||(d[4]=e=>s(e,"height"))},null,8,["modelValue"])])])])),_:1}),t.createVNode(m,{label:"页边距",name:"name"},{default:t.withCtx((()=>[t.createElementVNode("div",null,[t.createElementVNode("div",x7,[t.createElementVNode("div",{class:t.normalizeClass(["item",{active:!t.unref(a).margin.layout}]),onClick:d[5]||(d[5]=e=>c(t.unref(a).defaultMargin))}," 默认 ",2),t.createElementVNode("div",{class:t.normalizeClass(["item narrow",{active:"narrow"===t.unref(a).margin.layout}]),onClick:d[6]||(d[6]=e=>c({left:1.27,right:1.27,top:1.27,bottom:1.27,layout:"narrow"}))}," 窄 ",2),t.createElementVNode("div",{class:t.normalizeClass(["item moderate",{active:"moderate"===t.unref(a).margin.layout}]),onClick:d[7]||(d[7]=e=>c({left:1.91,right:1.91,top:2.54,bottom:2.54,layout:"moderate"}))}," 适中 ",2),t.createElementVNode("div",{class:t.normalizeClass(["item wide",{active:"wide"===t.unref(a).margin.layout}]),onClick:d[8]||(d[8]=e=>c({top:2.54,bottom:2.54,left:5.08,right:5.08,layout:"wide"}))}," 宽 ",2)]),t.createElementVNode("div",C7,[t.createElementVNode("div",O7,[t.createVNode(b,{class:"page-setting-number",modelValue:t.unref(a).margin.top,"onUpdate:modelValue":d[9]||(d[9]=e=>t.unref(a).margin.top=e),theme:"normal",align:"center",min:0,step:.1,label:"上:",suffix:"厘米",placeholder:"","allow-input-overLimit":!1,onBlur:d[10]||(d[10]=e=>u(e,"top"))},null,8,["modelValue"])]),t.createElementVNode("div",S7,[t.createVNode(b,{class:"page-setting-number",modelValue:t.unref(a).margin.bottom,"onUpdate:modelValue":d[11]||(d[11]=e=>t.unref(a).margin.bottom=e),theme:"normal",align:"center",min:0,step:.1,label:"下:",suffix:"厘米",placeholder:"","allow-input-overLimit":!1,onBlur:d[12]||(d[12]=e=>u(e,"bottom"))},null,8,["modelValue"])]),t.createElementVNode("div",E7,[t.createVNode(b,{class:"page-setting-number",modelValue:t.unref(a).margin.left,"onUpdate:modelValue":d[13]||(d[13]=e=>t.unref(a).margin.left=e),theme:"normal",align:"center",min:0,step:.1,label:"左:",suffix:"厘米",placeholder:"","allow-input-overLimit":!1,onBlur:d[14]||(d[14]=e=>u(e,"left"))},null,8,["modelValue"])]),t.createElementVNode("div",N7,[t.createVNode(b,{class:"page-setting-number",modelValue:t.unref(a).margin.right,"onUpdate:modelValue":d[15]||(d[15]=e=>t.unref(a).margin.right=e),theme:"normal",align:"center",min:0,step:.1,label:"右:",suffix:"厘米",placeholder:"","allow-input-overLimit":!1,onBlur:d[16]||(d[16]=e=>u(e,"right"))},null,8,["modelValue"])])])])])),_:1})])),_:1})])])),_:1},8,["visible"])}}},[["__scopeId","data-v-d8e89415"]]),M7=t.createElementVNode("span",{class:"button-text"},"页面大小",-1),A7={class:"label"},T7={class:"desc"},V7=t.createElementVNode("div",{class:"label"},"自定义设置",-1),j7={__name:"size",setup(e){const{options:n,page:r}=gS();let o=t.ref(!1);return(e,i)=>{const a=QC,l=Gv,s=Yv,c=_7,u=Bz;return t.openBlock(),t.createBlock(u,{"button-type":"dropdown","overlay-class-name":"page-size-dropdown"},{dropmenu:t.withCtx((()=>[t.createVNode(s,null,{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(n).dicts.pageSizes,((e,o)=>(t.openBlock(),t.createBlock(l,{key:o,value:o,active:t.unref(r).size.width===e.width,divider:t.unref(n).dicts.pageSizes.length-1===o,"min-column-width":150,onClick:n=>t.unref(r).size=e},{default:t.withCtx((()=>[t.createElementVNode("div",A7,t.toDisplayString(e.label),1),t.createElementVNode("div",T7,t.toDisplayString(e.width)+"厘米 × "+t.toDisplayString(e.height)+"厘米",1)])),_:2},1032,["value","active","divider","onClick"])))),128)),t.createVNode(l,{onClick:i[0]||(i[0]=e=>t.isRef(o)?o.value=!0:o=!0)},{default:t.withCtx((()=>[V7])),_:1})])),_:1})])),default:t.withCtx((()=>[t.createVNode(a,{name:"page-size",style:{"margin-left":"1px"}}),M7,t.createVNode(c,{visible:t.unref(o),onClose:i[1]||(i[1]=e=>t.isRef(o)?o.value=!1:o=!1)},null,8,["visible"])])),_:1})}}},B7=t.createElementVNode("p",{class:"button-text"},"页边距",-1),P7={__name:"margin",setup(e){let n=t.ref(!1);return(e,r)=>{const o=QC,i=_7,a=Bz;return t.openBlock(),t.createBlock(a,{"huge-button":"",onButtonClick:r[1]||(r[1]=e=>t.isRef(n)?n.value=!0:n=!0)},{text:t.withCtx((()=>[B7])),default:t.withCtx((()=>[t.createVNode(o,{name:"page-margin"}),t.createVNode(i,{visible:t.unref(n),onClose:r[0]||(r[0]=e=>t.isRef(n)?n.value=!1:n=!1)},null,8,["visible"])])),_:1})}}},I7=t.createElementVNode("p",{class:"button-text"},"显示大纲",-1),D7={__name:"toggle-toc",setup(e){const{page:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"","button-active":t.unref(n).showToc,onButtonClick:r[0]||(r[0]=e=>t.unref(n).showToc=!t.unref(n).showToc)},{text:t.withCtx((()=>[I7])),default:t.withCtx((()=>[t.createVNode(o,{name:"toc"})])),_:1},8,["button-active"])}}};var L7={},R7=/^([+-])?0*(\d+)(\.(\d+))?$/,z7=/^([+-])?0*(\d+)(\.(\d+))?e(([+-])?(\d+))$/i,F7=L7.e2ten=function(e){var t=z7.exec(e.toString());if(!t)return e;var n=t[2],r=t[4]||"",o=t[5]?+t[5]:0;if(o>0){var i=r.substr(0,o);i=i.length<o?i+new Array(o-i.length+1).join("0"):i,r=r.substr(o),n+=i}else{o=-o;var a=n.length-o;a=a<0?0:a;var l=n.substr(a,o);l=l.length<o?new Array(o-l.length+1).join("0")+l:l,n=n.substring(0,a),r=l+r}return n=""==n?"0":n,("-"==t[1]?"-":"")+n+(r?"."+r:"")};L7.getNumbResult=function(e){var t=R7.exec(e.toString());if(!t&&z7.test(e.toString())&&(t=R7.exec(F7(e.toString()))),t)return{int:t[2],decimal:t[4],minus:"-"==t[1],num:t.slice(1,3).join("")}},L7.centerArray=function e(t,n){if(t.splice.apply(t,[0,n.length].concat(n.splice(0,n.length))),arguments.length>2){var r=[].slice.call(arguments,2);r.unshift(t),e.apply(null,r)}return t};var $7=L7.hasAttr=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};L7.extend=function(e){for(var t,n=arguments[0]||{},r=Array.prototype.slice.call(arguments,1),o=0;o<r.length;o++){var i=r[o];for(t in i)$7(i,t)&&(n[t]=i[t])}return n},L7.getDigit=function(e){return e>=5?4*(e-4)+4:e},L7.unshiftZero=function(e,t){if(null==t&&(t=1),!(t<=0))for(;t--;)e.unshift(0)},L7.clearZero=function(e,t,n){if(null==e)return"";var r=~"*.?+$^[](){}|\\/".indexOf(t)?"\\"+t:t,o=new RegExp("^"+r+"+"),i=new RegExp(r+"+$"),a=new RegExp(r+"{2}","g");return e=e.toString(),"^"==n&&(e=e.replace(o,"")),n&&"$"!=n||(e=e.replace(i,"")),n&&"nto1"!=n||(e=e.replace(a,t)),e};var H7=L7;function U7(e,t){var n=H7.getNumbResult(e);if(!n)return e;t=t||{};var r=this.ch,o=this.ch_u,i=this.ch_f||"",a=this.ch_d||".",l=r.charAt(0),s=n.int,c=n.decimal,u="",d="",p=n.minus?i:"";if(c){c=H7.clearZero(c,"0","$");for(var f=0;f<c.length;f++)d+=r.charAt(+c.charAt(f));d=d?a+d:""}if(u=function e(n,i,a){n=H7.getNumbResult(n).int;var s="",c=arguments.length>1?arguments[1]:t.tenMin,u=n.length;if(1==u)return r.charAt(+n);if(u<=4)for(var d=0,p=u;p--;){var f=+n.charAt(d);s+=c&&2==u&&0==d&&1==f?"":r.charAt(f),s+=f&&p?o.charAt(p):"",d++}else{for(var h=n.length/4|0,m=n.length%4;0==m||!o.charAt(3+h);)m+=4,h--;var v=n.substr(0,m),g=n.substr(m);s=e(v,c)+o.charAt(3+h)+("0"==g.charAt(0)?l:"")+e(g,g.length>4&&c)}return s=H7.clearZero(s,l)}(s),t.ww&&o.length>5){var h=o.charAt(4),m=o.charAt(5),v=u.lastIndexOf(m);~v&&(u=u.substring(0,v).replace(new RegExp(m,"g"),h+h)+u.substring(v))}return p+u+d}var W7={CL:U7,unCL:function(e){for(var t=(e=e.toString()).split(this.ch_d),n=t[0].replace(this.ch_f,""),r=t[1],o=!!~t[0].indexOf(this.ch_f),i=this.ch_u.charAt(1),a=this.ch_u.charAt(4),l=this.ch_u.charAt(5),s=(n=n.replace(new RegExp(a+"{2}","g"),l)).split(""),c=0,u=0,d=[],p=[],f=[],h=0;h<s.length;h++){var m,v=s[h],g=0;if(~(m=this.ch.indexOf(v)))m>0&&f.unshift(m);else if(~(g=this.ch_u.indexOf(v))){var b=H7.getDigit(g);c>g?(H7.unshiftZero(f,b),H7.centerArray(p,f)):g>=u?(0==h&&(f=[1]),H7.centerArray(d,p,f),d.length>0&&H7.unshiftZero(d,b),u=g):(0==f.length&&i==v&&(f=[1]),H7.centerArray(p,f),H7.unshiftZero(p,H7.getDigit(g)),c=g)}}H7.centerArray(d,p,f).reverse(),0==d.length&&d.push(0);var y=0;if(r){d.push("."),y="0.";for(h=0;h<r.length;h++)y+=this.ch.indexOf(r.charAt(h)),d.push(this.ch.indexOf(r.charAt(h)));y=+y}return o&&d.unshift("-"),parseFloat(d.join(""))},toMoney:function(e,t){var n=H7.getNumbResult(e),r=this.ch.charAt(0);if(t="object"==typeof t?t:{},!n)return e;t=H7.extend({ww:!0,complete:!1,outSymbol:!0,unOmitYuan:!1,forceZheng:!1},t);var o=n.int,i=n.decimal||"",a=t.outSymbol?this.m_t:"",l=n.minus?this.ch_f:"",s="";if(t.complete){for(var c=1;c<this.m_u.length;c++)s+=U7.call(this,i.charAt(c-1)||"0")+this.m_u.charAt(c);l+=U7.call(this,o,t)+this.m_u.charAt(0)}else{var u=t.unOmitYuan||"0"!==o;if(i=i.substr(0,this.m_u.length-1),i=H7.clearZero(i,"0","$")){var d;for(c=0;c<this.m_u.length-1;c++)i.charAt(c)&&"0"!=i.charAt(c)&&(s+=U7.call(this,i.charAt(c))+this.m_u.charAt(c+1),d=!1),"0"!==i.charAt(c)||d||(0==c&&"0"===o||(s+=r),d=!0)}!u&&s||(l+=U7.call(this,o,t)+this.m_u.charAt(0)),t.forceZheng?""!=s&&s.charAt(s.length-1)===this.m_u[2]||(s+=this.m_z):l+=n.decimal?"":this.m_z,t.forceZheng}return a+l+s}},q7=L7;var K7=function(e,t){return{encodeS:function(t,n){return n=q7.extend({ww:!0,tenMin:!0},n),W7.CL.call(e,t,n)},encodeB:function(e,n){return n=q7.extend({ww:!0},n),W7.CL.call(t,e,n)},decodeS:function(){return W7.unCL.apply(e,arguments)},decodeB:function(){return W7.unCL.apply(t,arguments)},toMoney:function(e,n){return n=q7.extend({ww:!0},n),W7.toMoney.call(t,e,n)}}};const G7=g(K7({ch:"零一二三四五六七八九",ch_u:"个十百千万亿",ch_f:"负",ch_d:"点"},{ch:"零壹贰叁肆伍陆柒捌玖",ch_u:"个拾佰仟万亿",ch_f:"负",ch_d:"点",m_t:"人民币",m_z:"整",m_u:"元角分"})),Y7=t.createElementVNode("p",{class:"button-text"},"中文大小写",-1),X7={class:"label"},Z7={class:"desc"},J7={__name:"chinese-case",setup(e){const{editor:n}=gS(),r=[{label:"数字小写金额 → 中文大写金额",desc:"人民币伍佰肆拾叁元贰角壹分",func(e){const t=e.toString().replaceAll(",","").replaceAll("¥","").replaceAll(" ","");return G7.toMoney(t,{unOmitYuan:!0,forceZheng:!0})}},{label:"阿拉伯数字 → 中文小写",desc:"十万零一百一十一",func:e=>G7.encodeS(e)},{label:"科学记数法 → 中文小写",desc:"1.23456789e+21",func:e=>G7.encodeS(e),divider:!0},{label:"中文大写金额 → 数字小写金额",desc:"¥54,321.00",func(e){const t=e.replaceAll("人民币","").replaceAll("元","").replaceAll("整",""),n=G7.decodeB(t).toString().split(".");n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),2===n.length?n[1]=n[1].padEnd(2,"0"):n.push("00");return"¥"+n.join(".")}},{label:"中文小写 → 阿拉伯数字",desc:"54321",func:e=>G7.decodeS(e)}];return(e,o)=>{const i=QC,a=Gv,l=Yv,s=Bz;return t.openBlock(),t.createBlock(s,{"button-type":"dropdown","huge-button":"","overlay-class-name":"chinese-case-dropdown"},{text:t.withCtx((()=>[Y7])),dropmenu:t.withCtx((()=>[t.createVNode(l,null,{default:t.withCtx((()=>[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(r,(e=>t.createVNode(a,{key:e.value,value:e.value,divider:e.divider,onClick:t=>(e=>{try{if(!n.value)return;const t=n.value.commands.getSelectionText();if(""===t)return;const r=e(t);if(""===r)throw new Error("转换失败");n.value.chain().focus().insertContent(r.toString()).run()}catch{tR("error","大小写转化失败,请检查当前选中的文本。")}})(e.func)},{default:t.withCtx((()=>[t.createElementVNode("div",X7,t.toDisplayString(e.label),1),t.createElementVNode("div",Z7,t.toDisplayString(e.desc),1)])),_:2},1032,["value","divider","onClick"]))),64))])),_:1})])),default:t.withCtx((()=>[t.createVNode(i,{name:"chinese-case"})])),_:1})}}},Q7=e=>(t.pushScopeId("data-v-512d25b1"),e=e(),t.popScopeId(),e),eee=Q7((()=>t.createElementVNode("p",{class:"button-text"},"电子签章",-1))),tee=Q7((()=>t.createElementVNode("div",{class:"tip"}," 选择纯色背景电子章的影印件或者照片,将自动扣取电子章,所有操作在本地完成,不会向服务器发送数据,请放心使用。 ",-1))),nee={class:"seal-uploader"},ree={key:0},oee=["src"],iee=yS({__name:"seal",setup(e){let n=t.ref(!1);const{options:r,editor:o}=gS();let a=t.ref(null),l=t.ref(null),s=t.ref(null);const c=async()=>{const{open:e,onChange:t}=lS({accept:"image/png,image/jpeg",multiple:!1,reset:!0});e(),t((async e=>{if(e&&(s.value=e[0],s.value))try{a.value=null;const e=await i(s.value,{publicPath:`${r.value.cdnUrl}/libs/imgly/`,progress:(e,t,n)=>{e.startsWith("fetch")?l.value=`正在加载组件: ${(t/n*100).toFixed(1)}%`:l.value="正在抠图中,请稍后..."}});a.value=URL.createObjectURL(e)}catch{tR("error","电子章抠取失败,请重试"),a.value=null}finally{l.value=null}}))},u=()=>{var e;a.value?(null==(e=o.value)||e.chain().focus().setImage({type:"seal",src:a.value,width:150,draggable:!0,rotatable:!0,file:s.value}).run(),n.value=!1,a.value=null,l.value=null):tR("error","请选择电子章")};return(e,r)=>{const o=QC,s=Bz,d=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.unref(i)?(t.openBlock(),t.createBlock(s,{key:0,"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.isRef(n)?n.value=!0:n=!0)},{text:t.withCtx((()=>[eee])),default:t.withCtx((()=>[t.createVNode(o,{name:"seal"})])),_:1})):t.createCommentVNode("",!0),t.createVNode(d,{visible:t.unref(n),icon:"seal",title:"插入电子签章",width:"480px","confirm-btn":"插入",onConfirm:u,onClose:r[1]||(r[1]=e=>t.isRef(n)?n.value=!1:n=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"seal-container",onClick:c},[tee,t.createElementVNode("div",nee,[t.unref(a)?(t.openBlock(),t.createElementBlock("img",{key:1,class:"seal-img",src:t.unref(a)},null,8,oee)):(t.openBlock(),t.createElementBlock("span",ree,t.toDisplayString(t.unref(l)?t.unref(l):"点击此处选择电子章图片"),1))])])])),_:1},8,["visible"])],64)}}},[["__scopeId","data-v-512d25b1"]]);const aee=yS({props:{width:{type:Number,default:800},height:{type:Number,default:300},lineWidth:{type:Number,default:4},lineColor:{type:String,default:"#000000"},bgColor:{type:String,default:""},isCrop:{type:Boolean,default:!1},isClearBgColor:{type:Boolean,default:!0},format:{type:String,default:"image/png"},quality:{type:Number,default:1}},data:()=>({hasDrew:!1,resultImg:"",points:[],canvasTxt:null,startX:0,startY:0,isDrawing:!1,sratio:1}),computed:{ratio(){return this.height/this.width},stageInfo(){return this.$refs.canvas.getBoundingClientRect()},myBg(){return this.bgColor?this.bgColor:"rgba(255, 255, 255, 0)"}},watch:{myBg:function(e){this.$refs.canvas.style.background=e}},beforeMount(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy(){window.removeEventListener("resize",this.$_resizeHandler)},mounted(){const e=this.$refs.canvas;e.height=this.height,e.width=this.width,e.style.background=this.myBg,this.$_resizeHandler(),document.onmouseup=()=>{this.isDrawing=!1}},methods:{$_resizeHandler(){const e=this.$refs.canvas;e.style.width=this.width+"px";const t=parseFloat(window.getComputedStyle(e).width);e.style.height=this.ratio*t+"px",this.canvasTxt=e.getContext("2d"),this.canvasTxt.scale(1*this.sratio,1*this.sratio),this.sratio=t/this.width,this.canvasTxt.scale(1/this.sratio,1/this.sratio)},mouseDown(e){(e=e||event).preventDefault(),this.isDrawing=!0,this.hasDrew=!0;let t={x:e.offsetX,y:e.offsetY};this.drawStart(t)},mouseMove(e){if((e=e||event).preventDefault(),this.isDrawing){let t={x:e.offsetX,y:e.offsetY};this.drawMove(t)}},mouseUp(e){(e=e||event).preventDefault();let t={x:e.offsetX,y:e.offsetY};this.drawEnd(t),this.isDrawing=!1},touchStart(e){if((e=e||event).preventDefault(),this.hasDrew=!0,1===e.touches.length){let t={x:e.targetTouches[0].clientX-this.$refs.canvas.getBoundingClientRect().left,y:e.targetTouches[0].clientY-this.$refs.canvas.getBoundingClientRect().top};this.drawStart(t)}},touchMove(e){if((e=e||event).preventDefault(),1===e.touches.length){let t={x:e.targetTouches[0].clientX-this.$refs.canvas.getBoundingClientRect().left,y:e.targetTouches[0].clientY-this.$refs.canvas.getBoundingClientRect().top};this.drawMove(t)}},touchEnd(e){if((e=e||event).preventDefault(),1===e.touches.length){let t={x:e.targetTouches[0].clientX-this.$refs.canvas.getBoundingClientRect().left,y:e.targetTouches[0].clientY-this.$refs.canvas.getBoundingClientRect().top};this.drawEnd(t)}},drawStart(e){this.startX=e.x,this.startY=e.y,this.canvasTxt.beginPath(),this.canvasTxt.moveTo(this.startX,this.startY),this.canvasTxt.lineTo(e.x,e.y),this.canvasTxt.lineCap="round",this.canvasTxt.lineJoin="round",this.canvasTxt.lineWidth=this.lineWidth*this.sratio,this.canvasTxt.stroke(),this.canvasTxt.closePath(),this.points.push(e)},drawMove(e){this.canvasTxt.beginPath(),this.canvasTxt.moveTo(this.startX,this.startY),this.canvasTxt.lineTo(e.x,e.y),this.canvasTxt.strokeStyle=this.lineColor,this.canvasTxt.lineWidth=this.lineWidth*this.sratio,this.canvasTxt.lineCap="round",this.canvasTxt.lineJoin="round",this.canvasTxt.stroke(),this.canvasTxt.closePath(),this.startY=e.y,this.startX=e.x,this.points.push(e)},drawEnd(e){this.canvasTxt.beginPath(),this.canvasTxt.moveTo(this.startX,this.startY),this.canvasTxt.lineTo(e.x,e.y),this.canvasTxt.lineCap="round",this.canvasTxt.lineJoin="round",this.canvasTxt.stroke(),this.canvasTxt.closePath(),this.points.push(e),this.points.push({x:-1,y:-1})},generate(e){let t=e&&e.format?e.format:this.format,n=e&&e.quality?e.quality:this.quality;return new Promise(((e,r)=>{if(this.hasDrew){var o=this.canvasTxt.getImageData(0,0,this.$refs.canvas.width,this.$refs.canvas.height);this.canvasTxt.globalCompositeOperation="destination-over",this.canvasTxt.fillStyle=this.myBg,this.canvasTxt.fillRect(0,0,this.$refs.canvas.width,this.$refs.canvas.height),this.resultImg=this.$refs.canvas.toDataURL(t,n);var i=this.resultImg;if(this.canvasTxt.clearRect(0,0,this.$refs.canvas.width,this.$refs.canvas.height),this.canvasTxt.putImageData(o,0,0),this.canvasTxt.globalCompositeOperation="source-over",this.isCrop){const e=this.getCropArea(o.data);var a=document.createElement("canvas");const r=a.getContext("2d");a.width=e[2]-e[0],a.height=e[3]-e[1];const l=this.canvasTxt.getImageData(...e);r.globalCompositeOperation="destination-over",r.putImageData(l,0,0),r.fillStyle=this.myBg,r.fillRect(0,0,a.width,a.height),i=a.toDataURL(t,n),a=null}e(i)}else r("Warning: Not Signned!")}))},reset(){this.canvasTxt.clearRect(0,0,this.$refs.canvas.width,this.$refs.canvas.height),this.isClearBgColor&&(this.$emit("update:bgColor",""),this.$refs.canvas.style.background="rgba(255, 255, 255, 0)"),this.points=[],this.hasDrew=!1,this.resultImg=""},getCropArea(e){for(var t=this.$refs.canvas.width,n=0,r=this.$refs.canvas.height,o=0,i=0;i<this.$refs.canvas.width;i++)for(var a=0;a<this.$refs.canvas.height;a++){var l=4*(i+this.$refs.canvas.width*a);(e[l]>0||e[l+1]>0||e[l+2]||e[l+3]>0)&&(o=Math.max(a,o),n=Math.max(i,n),r=Math.min(a,r),t=Math.min(i,t))}return[++t,++r,++n,++o]}}},[["render",function(e,n,r,o,i,a){return t.openBlock(),t.createElementBlock("canvas",{ref:"canvas",onMousedown:n[0]||(n[0]=(...e)=>a.mouseDown&&a.mouseDown(...e)),onMousemove:n[1]||(n[1]=(...e)=>a.mouseMove&&a.mouseMove(...e)),onMouseup:n[2]||(n[2]=(...e)=>a.mouseUp&&a.mouseUp(...e)),onTouchstart:n[3]||(n[3]=(...e)=>a.touchStart&&a.touchStart(...e)),onTouchmove:n[4]||(n[4]=(...e)=>a.touchMove&&a.touchMove(...e)),onTouchend:n[5]||(n[5]=(...e)=>a.touchEnd&&a.touchEnd(...e))},null,544)}],["__scopeId","data-v-5c7dd0c2"]]);aee.install=function(e){this.installed||(this.installed=!0,e.component("vueEsign",aee))};const lee=e=>(t.pushScopeId("data-v-4cf9fec2"),e=e(),t.popScopeId(),e),see=lee((()=>t.createElementVNode("p",{class:"button-text"},"电子签名",-1))),cee={class:"signature-toolbar"},uee={class:"signature-container","data-tip":"请在当前区域签名"},dee={__name:"signature",setup(e){const{editor:n}=gS();let r=t.ref(!1),o=t.ref("#000"),i=t.ref(5);const a=t.ref([{content:"2",value:2},{content:"3",value:3},{content:"4",value:4},{content:"5",value:5},{content:"6",value:6},{content:"7",value:7},{content:"8",value:8}]),l=t.ref(null),s=()=>{l.value.reset()},c=e=>{o.value=e},u=({value:e})=>{i.value=e},d=async()=>{var e;try{const t=await l.value.generate();null==(e=n.value)||e.chain().focus().setImage({type:"signature",src:t,width:80,draggable:!0}).run(),r.value=!1}catch{tR("error","没有检测到您的签名")}};return t.watch((()=>r.value),(e=>{e||s()})),(e,n)=>{const p=QC,f=Bz,h=tF,m=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(f,{"huge-button":"",onButtonClick:n[0]||(n[0]=e=>t.isRef(r)?r.value=!0:r=!0)},{text:t.withCtx((()=>[see])),default:t.withCtx((()=>[t.createVNode(p,{name:"signature"})])),_:1}),t.createVNode(m,{visible:t.unref(r),"onUpdate:visible":n[1]||(n[1]=e=>t.isRef(r)?r.value=e:r=e),icon:"signature",title:"插入电子签名",width:"642px",onConfirm:d,onClose:n[2]||(n[2]=e=>t.isRef(r)?r.value=!1:r=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",cee,[t.createVNode(f,{tooltip:"清空画布",onButtonClick:s},{default:t.withCtx((()=>[t.createVNode(p,{name:"clear-format"})])),_:1}),t.createVNode(h,{modeless:"","default-color":"#000",onChange:c}),t.createVNode(f,{tooltip:"画笔粗细","button-type":"dropdown","select-options":a.value,onChange:u},{default:t.withCtx((()=>[t.createVNode(p,{name:"highlight"})])),_:1},8,["select-options"])]),t.createElementVNode("div",uee,[t.createVNode(t.unref(aee),{ref_key:"signatureRef",ref:l,"line-color":t.unref(o),"line-width":t.unref(i),width:600,height:200,"is-crop":"",format:"image/png"},null,8,["line-color","line-width"])])])),_:1},8,["visible"])],64)}}},pee=yS(dee,[["__scopeId","data-v-4cf9fec2"]]),fee=t.createElementVNode("p",{class:"button-text"},"删除",-1),hee={__name:"delete",setup(e){const{editor:n}=gS();return(e,r)=>{var o;const i=QC,a=Bz;return t.openBlock(),t.createBlock(a,{tooltip:"删除当前表格",disabled:!(null==(o=t.unref(n))?void 0:o.can().deleteTable()),"huge-button":"",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().deleteTable().run()})},{text:t.withCtx((()=>[fee])),default:t.withCtx((()=>[t.createVNode(i,{name:"table-delete"})])),_:1},8,["disabled"])}}},mee={key:0,class:"button-text"},vee={__name:"previous-cell",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"上一个单元格",shortcut:"Shift+Tab",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().goToPreviousCell()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().goToPreviousCell().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-previous-cell"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",mee,"上一个单元格")):t.createCommentVNode("",!0)])),_:1},8,["class","disabled"])}}},gee={key:0,class:"button-text"},bee={__name:"next-cell",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"下一个单元格",shortcut:"Tab",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().goToNextCell()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().goToNextCell().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-next-cell"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",gee,"下一个单元格")):t.createCommentVNode("",!0)])),_:1},8,["class","disabled"])}}},yee={key:0,class:"button-text"},wee={__name:"toggle-header-cell",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"切换表头单元格",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().toggleHeaderCell()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleHeaderCell().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-header-cell"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",yee,"切换表头单元格")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},kee={key:0,class:"button-text"},xee={__name:"toggle-header-column",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"切换表头列",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().toggleHeaderColumn()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleHeaderColumn().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-header-column"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",kee,"切换表头列")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},Cee={key:0,class:"button-text"},Oee={__name:"toggle-header-row",setup(e){const{editor:n}=gS(),r=bS("toolbar");return(e,o)=>{var i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{tooltip:"ribbon"===t.unref(r).mode?"":"切换表头行",class:t.normalizeClass({"width-auto":"ribbon"===t.unref(r).mode}),disabled:!(null==(i=t.unref(n))?void 0:i.can().toggleHeaderRow()),onButtonClick:o[0]||(o[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleHeaderRow().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"table-header-row"}),"ribbon"===t.unref(r).mode?(t.openBlock(),t.createElementBlock("span",Cee,"切换表头行")):t.createCommentVNode("",!0)])),_:1},8,["tooltip","class","disabled"])}}},See=t.createElementVNode("p",{class:"button-text"},"修复",-1),Eee={__name:"fix",setup(e){const{editor:n}=gS();return(e,r)=>{var o;const i=QC,a=Bz;return t.openBlock(),t.createBlock(a,{tooltip:"当表格有错乱时,点击此按钮可自动修复表格",class:"width-auto","huge-button":"",disabled:!(null==(o=t.unref(n))?void 0:o.can().fixTables()),onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().fixTables().run()})},{text:t.withCtx((()=>[See])),default:t.withCtx((()=>[t.createVNode(i,{name:"table-fix"})])),_:1},8,["disabled"])}}},Nee=e=>(t.pushScopeId("data-v-a47859b3"),e=e(),t.popScopeId(),e),_ee=Nee((()=>t.createElementVNode("p",{class:"button-text"},"插入",-1))),Mee=["onMouseover"],Aee={class:"table-custom"},Tee=Nee((()=>t.createElementVNode("div",{class:"table-custom-title"},"表格属性",-1))),Vee={__name:"insert",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{editor:o}=gS(),i=Array.from({length:8},(()=>Array.from({length:10},(()=>""))));let a=t.ref({rows:0,cols:0}),l=t.ref(!0);const s=()=>{a.value.rows=0,a.value.cols=0},c=()=>{var e;const{rows:t,cols:r}=a.value;0===t||t>1e3||0===r||r>30||(null==(e=o.value)||e.chain().focus().insertTable({rows:t,cols:r,withHeaderRow:l.value}).run(),n.value=!1)};return(e,o)=>{const u=QC,d=$g,p=Uy,f=Fd,h=Bz;return t.openBlock(),t.createBlock(h,{"button-type":"popup",tooltip:"插入新表格","huge-button":"","popup-visible":t.unref(n),onTogglePopup:t.unref(r)},{text:t.withCtx((()=>[_ee])),content:t.withCtx((()=>[t.createElementVNode("div",{class:"table-grid",onMouseleave:s},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(i),((e,n)=>(t.openBlock(),t.createElementBlock("div",{key:n,class:"row"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e,((e,r)=>{return t.openBlock(),t.createElementBlock("div",{key:r,class:t.normalizeClass(["cell",{selected:(o=n,i=r,a.value.rows&&a.value.rows>o&&a.value.cols&&a.value.cols>i)}]),onMouseover:e=>((e,t)=>{a.value.rows=e+1,a.value.cols=t+1})(n,r),onClick:c},null,42,Mee);var o,i})),128))])))),128))],32),t.createElementVNode("div",Aee,[Tee,t.createVNode(d,{modelValue:t.unref(a).rows,"onUpdate:modelValue":o[0]||(o[0]=e=>t.unref(a).rows=e),theme:"column",max:1e3,min:0,label:"行数:"},null,8,["modelValue"]),t.createVNode(d,{modelValue:t.unref(a).cols,"onUpdate:modelValue":o[1]||(o[1]=e=>t.unref(a).cols=e),theme:"column",max:30,min:0,label:"列数:"},null,8,["modelValue"]),t.createVNode(p,{modelValue:t.unref(l),"onUpdate:modelValue":o[2]||(o[2]=e=>t.isRef(l)?l.value=e:l=e)},{default:t.withCtx((()=>[t.createTextVNode("包含表头")])),_:1},8,["modelValue"]),t.createVNode(f,{class:"insert-button",block:"",theme:"primary",variant:"base",onClick:c},{default:t.withCtx((()=>[t.createTextVNode(" 创建表格 ")])),_:1})])])),default:t.withCtx((()=>[t.createVNode(u,{name:"table"})])),_:1},8,["popup-visible","onTogglePopup"])}}},jee=yS(Vee,[["__scopeId","data-v-a47859b3"]]),Bee=e=>(t.pushScopeId("data-v-b9025cc1"),e=e(),t.popScopeId(),e),Pee=Bee((()=>t.createElementVNode("p",{class:"button-text"},"网页",-1))),Iee={class:"web-page-container"},Dee=Bee((()=>t.createElementVNode("div",{class:"web-page-tip"},"某些网页可能不支持嵌入。",-1))),Lee=yS({__name:"web-page",setup(e){const{editor:n}=gS();let r=t.ref(!1),o=t.ref(""),i=t.ref(!1);const a=()=>{var e;n.value&&(""!==o.value&&(o.value.startsWith("http://")||o.value.startsWith("https://"))?(null==(e=n.value)||e.chain().focus().setParagraph().setIframe({src:o.value}).run(),i.value=!1,r.value=!1):i.value=!0)};return t.watch((()=>r.value),(e=>{e||(o.value="",i.value=!1)})),(e,n)=>{const l=QC,s=Bz,c=gg,u=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(s,{"huge-button":"",onButtonClick:n[0]||(n[0]=e=>t.isRef(r)?r.value=!0:r=!0)},{text:t.withCtx((()=>[Pee])),default:t.withCtx((()=>[t.createVNode(l,{name:"web-page"})])),_:1}),t.createVNode(u,{visible:t.unref(r),icon:"web-page",title:"插入网页",width:"480px",confirmBtn:"插入",onConfirm:a,onClose:n[2]||(n[2]=e=>t.isRef(r)?r.value=!1:r=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",Iee,[Dee,t.createVNode(c,{modelValue:t.unref(o),"onUpdate:modelValue":n[1]||(n[1]=e=>t.isRef(o)?o.value=e:o=e),modelModifiers:{trim:!0},status:t.unref(i)?"error":"default",type:"url",clearable:"",placeholder:"请输入网页地址,以 http:// 或 https:// 开头"},null,8,["modelValue","status"])])])),_:1},8,["visible"])],64)}}},[["__scopeId","data-v-b9025cc1"]]),Ree=t.createElementVNode("p",{class:"button-text"},"模板",-1),zee={class:"title"},Fee={key:0,class:"description"},$ee={__name:"template",setup(e){const{options:n,editor:r}=gS();return(e,o)=>{const i=QC,a=Gv,l=Yv,s=Bz;return t.unref(n).templates&&t.unref(n).templates.length>0?(t.openBlock(),t.createBlock(s,{key:0,"button-type":"dropdown","huge-button":"","overlay-class-name":"templates-dropdown"},{text:t.withCtx((()=>[Ree])),dropmenu:t.withCtx((()=>[t.createVNode(l,null,{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(n).templates,(e=>(t.openBlock(),t.createBlock(a,{key:e.value,value:e.value,divider:e.divider,class:t.normalizeClass({"has-description":e.description&&""!==e.description}),onClick:t=>(({content:e})=>{e&&r.value&&r.value.commands.insertContent(e)})(e)},{default:t.withCtx((()=>[t.createElementVNode("div",zee,t.toDisplayString(e.title),1),e.description&&""!==e.description?(t.openBlock(),t.createElementBlock("div",Fee,t.toDisplayString(e.description),1)):t.createCommentVNode("",!0)])),_:2},1032,["value","divider","class","onClick"])))),128))])),_:1})])),default:t.withCtx((()=>[t.createVNode(i,{name:"template"})])),_:1})):t.createCommentVNode("",!0)}}},Hee=t.createElementVNode("p",{class:"button-text"},"文本框",-1),Uee={__name:"text-box",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().setTextBox().run()})},{text:t.withCtx((()=>[Hee])),default:t.withCtx((()=>[t.createVNode(o,{name:"text-box"})])),_:1})}}},Wee=t.createElementVNode("p",{class:"button-text"},"页面大纲",-1),qee={__name:"toc",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().addTableOfContents().run()})},{text:t.withCtx((()=>[Wee])),default:t.withCtx((()=>[t.createVNode(o,{name:"toc"})])),_:1})}}},Kee=e=>(t.pushScopeId("data-v-95299c73"),e=e(),t.popScopeId(),e),Gee=Kee((()=>t.createElementVNode("p",{class:"button-text"},"分割线",-1))),Yee={class:"page-divider-dropdown"},Xee=Kee((()=>t.createElementVNode("div",{class:"page-divider-item-title"},[t.createElementVNode("span",null,"分割线类型")],-1))),Zee=["value","onClick"],Jee=["data-type"],Qee=Kee((()=>t.createElementVNode("span",null,"分割线颜色",-1))),ete={class:"arrow"},tte={class:"page-divider-color-picker"},nte=yS({__name:"horizontal-line",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{container:o,editor:i}=gS(),a=[{label:"细线",value:"signle"},{label:"双细线",value:"double"},{label:"点线",value:"dotted"},{label:"虚线",value:"dashed"},{label:"双虚线",value:"dashed-double"},{label:"粗线",value:"signle-bold"},{label:"粗细线",value:"double-bold-top"},{label:"细粗线",value:"double-bold-bottom"},{label:"波浪线",value:"wavy"}];let l=t.ref("#000"),s=t.ref(!1);const c=e=>{l.value=e,s.value=!1};return(e,u)=>{const d=QC,p=Jz,f=Zm,h=Bz;return t.openBlock(),t.createBlock(h,{"button-type":"popup","huge-button":"","popup-visible":t.unref(n),onTogglePopup:t.unref(r)},{text:t.withCtx((()=>[Gee])),content:t.withCtx((()=>[t.createElementVNode("div",Yee,[Xee,(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(a,(e=>t.createElementVNode("div",{class:"page-divider-item",key:e.value,value:e.value,onClick:t=>(({value:e})=>{e&&i.value&&(i.value.chain().focus().setHorizontalRule({type:e,color:l.value}).run(),n.value=!1)})(e)},[t.createElementVNode("hr",{class:"umo-page-divider","data-type":e.value,style:t.normalizeStyle({color:t.unref(l)})},null,12,Jee)],8,Zee))),64)),t.createVNode(f,{modelValue:t.unref(s),"onUpdate:modelValue":u[0]||(u[0]=e=>t.isRef(s)?s.value=e:s=e),attach:t.unref(o),placement:"right-bottom",trigger:"click"},{content:t.withCtx((()=>[t.createElementVNode("div",tte,[t.createVNode(p,{"default-color":"#000",onChange:c})])])),default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["page-divider-item open-color-picker",{active:t.unref(s)}])},[Qee,t.createElementVNode("div",ete,[t.createVNode(d,{name:"arrow-down"})])],2)])),_:1},8,["modelValue","attach"])])])),default:t.withCtx((()=>[t.createVNode(d,{name:"horizontal-line"})])),_:1},8,["popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-95299c73"]]),rte=t.createElementVNode("p",{class:"button-text"},"换行",-1),ote={__name:"hard-break",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",shortcut:"Shift+Enter",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().setHardBreak().run()})},{text:t.withCtx((()=>[rte])),default:t.withCtx((()=>[t.createVNode(o,{name:"hard-break"})])),_:1})}}},ite=t.createElementVNode("p",{class:"button-text"},"数学公式",-1),ate={__name:"mathematics",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.unref(n).chain().focus().insertContent("$\\LaTeX$").run())},{text:t.withCtx((()=>[ite])),default:t.withCtx((()=>[t.createVNode(o,{name:"mathematics"})])),_:1})}}},lte=(e=>(t.pushScopeId("data-v-d9439f81"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("p",{class:"button-text"},"表情",-1))),ste={class:"emojis-container narrow-scrollbar"},cte={class:"emojis-group-title"},ute={class:"emojis-group-container"},dte=["onClick"],pte=yS({__name:"emoji",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{options:o,editor:i}=gS();return(e,a)=>{const l=QC,s=Bz;return t.openBlock(),t.createBlock(s,{"button-type":"popup","huge-button":"","popup-visible":t.unref(n),onTogglePopup:t.unref(r)},{text:t.withCtx((()=>[lte])),content:t.withCtx((()=>[t.createElementVNode("div",ste,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).dicts.emojis,((e,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:r},[t.createElementVNode("div",cte,t.toDisplayString(e.label),1),t.createElementVNode("div",ute,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items.split(" "),((e,r)=>(t.openBlock(),t.createElementBlock("div",{class:"emojis-group-item",key:r,onClick:t=>{return r=e,null==(o=i.value)||o.chain().focus().insertContent(r).run(),void(n.value=!1);var r,o}},t.toDisplayString(e),9,dte)))),128))])],64)))),128))])])),default:t.withCtx((()=>[t.createVNode(l,{name:"emoji"})])),_:1},8,["popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-d9439f81"]]),fte=t.createElementVNode("p",{class:"button-text"},"日期",-1),hte={__name:"date",setup(e){const n=e=>RO(dS(),e).value,r=e=>{const t=e=>{const t=["〇","一","二","三","四","五","六","七","八","九"];return e.toString().split("").map((e=>t[e])).join("")};return e.replace(/\d+/g,(e=>{if(4===e.length)return t(e);if(1===e.length)return t(e);if(2===e.length){const n=e.charAt(0),r=e.charAt(1);return"0"===n?t(n)+"十":"1"===n?"十"+t(r):"0"===r?t(n)+"十":t(n)+"十"+t(r)}return e}))},o=[{content:n("YYYY年M月D日")},{content:n("YYYY-M-D")},{content:n("YYYY/M/D")},{content:n("YYYY.M.D")},{content:n("YYYY年M月")},{content:n("YYYY年M月D日 dddd"),divider:!0},{content:r(n("YYYY年M月D日"))},{content:r(n("YYYY年M月"))},{content:r(n("YYYY年M月D日 dddd"))}],{editor:i}=gS(),a=({content:e})=>{var t;e&&(null==(t=i.value)||t.chain().focus().insertContent(e).run())};return(e,n)=>{const r=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"button-type":"dropdown","huge-button":"","select-options":o,onClick:a},{text:t.withCtx((()=>[fte])),default:t.withCtx((()=>[t.createVNode(r,{name:"date"})])),_:1})}}},mte=(e=>(t.pushScopeId("data-v-05fe3d68"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("p",{class:"button-text"},"特殊字符",-1))),vte={class:"characters-container narrow-scrollbar"},gte={class:"characters-group-title"},bte={class:"characters-group-container"},yte=["onClick"],wte=yS({__name:"special-characters",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{options:o,editor:i}=gS();return(e,a)=>{const l=QC,s=Bz;return t.openBlock(),t.createBlock(s,{"button-type":"popup","huge-button":"","popup-visible":t.unref(n),onTogglePopup:t.unref(r)},{text:t.withCtx((()=>[mte])),content:t.withCtx((()=>[t.createElementVNode("div",vte,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).dicts.specialCharacters,((e,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:r},[t.createElementVNode("div",gte,t.toDisplayString(e.label),1),t.createElementVNode("div",bte,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items.split(""),((e,r)=>(t.openBlock(),t.createElementBlock("div",{class:"characters-group-item",key:r,onClick:t=>{return r=e,null==(o=i.value)||o.chain().focus().insertContent(r).run(),void(n.value=!1);var r,o}},t.toDisplayString(e),9,yte)))),128))])],64)))),128))])])),default:t.withCtx((()=>[t.createVNode(l,{name:"special-characters"})])),_:1},8,["popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-05fe3d68"]]),kte=t.createElementVNode("p",{class:"button-text"},"代码块",-1),xte={__name:"code-block",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{shortcut:"Ctrl+Alt+C","huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.unref(n).chain().focus().setCodeBlock().run())},{text:t.withCtx((()=>[kte])),default:t.withCtx((()=>[t.createVNode(o,{name:"code-block"})])),_:1})}}},Cte=t.createElementVNode("p",{class:"button-text"},"文件",-1),Ote={__name:"file",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.unref(n).chain().focus().selectFiles().run())},{text:t.withCtx((()=>[Cte])),default:t.withCtx((()=>[t.createVNode(o,{name:"file"})])),_:1})}}},Ste=t.createElementVNode("p",{class:"button-text"},"音频",-1),Ete={__name:"audio",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.unref(n).chain().focus().selectFiles("audio").run())},{text:t.withCtx((()=>[Ste])),default:t.withCtx((()=>[t.createVNode(o,{name:"audio"})])),_:1})}}},Nte=t.createElementVNode("p",{class:"button-text"},"视频",-1),_te={__name:"video",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.unref(n).chain().focus().selectFiles("video").run())},{text:t.withCtx((()=>[Nte])),default:t.withCtx((()=>[t.createVNode(o,{name:"video"})])),_:1})}}},Mte=t.createElementVNode("p",{class:"button-text"},"图片",-1),Ate={__name:"image",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{"huge-button":"",onButtonClick:r[0]||(r[0]=e=>t.unref(n).chain().focus().selectFiles("image").run())},{text:t.withCtx((()=>[Mte])),default:t.withCtx((()=>[t.createVNode(o,{name:"image"})])),_:1})}}},Tte=(e=>(t.pushScopeId("data-v-37607038"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("p",{class:"button-text"},"链接",-1))),Vte={class:"link-container"},jte=yS({__name:"link",setup(e){const{editor:n}=gS();let r=t.ref(!1),o=t.ref(""),i=t.ref(""),a=t.ref({text:!1,href:!1});const l=()=>{var e,t;""!==o.value?i.value.startsWith("http://")||i.value.startsWith("https://")||i.value.startsWith("ftp://")||i.value.startsWith("ftps://")||i.value.startsWith("mailto://")?(a.value.text=!1,a.value.href=!1,null==(e=n.value)||e.commands.setLink({href:i.value,target:"_blank"}),null==(t=n.value)||t.chain().focus().insertContent(o.value).run(),r.value=!1):a.value.href=!0:a.value.text=!0};return t.watch((()=>r.value),(e=>{e?(o.value=n.value.commands.getSelectionText(),i.value=n.value.getAttributes("link").href||""):(o.value="",i.value="",a.value.text=!1,a.value.href=!1)})),(e,n)=>{const s=QC,c=Bz,u=gg,d=Yw,p=Gw,f=yz;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(c,{"huge-button":"",onButtonClick:n[0]||(n[0]=e=>t.isRef(r)?r.value=!0:r=!0)},{text:t.withCtx((()=>[Tte])),default:t.withCtx((()=>[t.createVNode(s,{name:"link"})])),_:1}),t.createVNode(f,{visible:t.unref(r),icon:"link",heatitleder:"插入链接",width:"420px",draggable:"","destroy-on-close":"",confirmBtn:"插入",onConfirm:l,onClose:n[3]||(n[3]=e=>t.isRef(r)?r.value=!1:r=!1)},{default:t.withCtx((()=>[t.createElementVNode("div",Vte,[t.createVNode(p,{"label-align":"top"},{default:t.withCtx((()=>[t.createVNode(d,{label:"链接文本:"},{default:t.withCtx((()=>[t.createVNode(u,{modelValue:t.unref(o),"onUpdate:modelValue":n[1]||(n[1]=e=>t.isRef(o)?o.value=e:o=e),modelModifiers:{trim:!0},status:t.unref(a).text?"error":"default",placeholder:"请输入链接文本",clearable:""},null,8,["modelValue","status"])])),_:1}),t.createVNode(d,{label:"链接地址:"},{default:t.withCtx((()=>[t.createVNode(u,{modelValue:t.unref(i),"onUpdate:modelValue":n[2]||(n[2]=e=>t.isRef(i)?i.value=e:i=e),status:t.unref(a).href?"error":"default",type:"url",clearable:"",placeholder:"请输入链接地址,一般以 http:// 或 https:// 开头"},null,8,["modelValue","status"])])),_:1})])),_:1})])])),_:1},8,["visible"])],64)}}},[["__scopeId","data-v-37607038"]]),Bte=t.createElementVNode("p",{class:"button-text"},"查找替换",-1),Pte={__name:"search-replace",setup(e){const{searchReplace:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{shortcut:"Ctrl+F","huge-button":"",onButtonClick:r[0]||(r[0]=e=>n.value=!0)},{text:t.withCtx((()=>[Bte])),default:t.withCtx((()=>[t.createVNode(o,{name:"search-replace"})])),_:1})}}},Ite=t.createElementVNode("p",{class:"button-text"},"Markdown",-1),Dte={__name:"markdown",setup(e){const{options:n,editorDestroyed:r}=gS(),o=bS("document"),i=()=>{const e=eR({theme:"warning",header:o.value.enableMarkdown?"关闭 Markdown 模式":"切换到 Markdown 模式",body:"此操作会重置编辑器,切换后当前历史记录会丢失,将无法进行“撤回”等操作,确定要现在切换吗?",confirmBtn:{theme:"warning",content:"立即切换"},async onConfirm(){o.value.markdown=!o.value.markdown,e.destroy(),await t.nextTick(),r.value=!0,await t.nextTick(),r.value=!1}})};return(e,r)=>{const a=QC,l=Bz;return t.unref(n).document.enableMarkdown?(t.openBlock(),t.createBlock(l,{key:0,tooltip:t.unref(n).document.enableMarkdown?"关闭 Markdown 模式":"切换到 Markdown 模式","button-active":t.unref(o).markdown,"huge-button":"",onButtonClick:i},{text:t.withCtx((()=>[Ite])),default:t.withCtx((()=>[t.createVNode(a,{name:"markdown"})])),_:1},8,["tooltip","button-active"])):t.createCommentVNode("",!0)}}},Lte={__name:"code",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("code"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleCode().run()),tooltip:"代码",shortcut:"Ctrl+E",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleCode().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"code"})])),_:1},8,["button-active","disabled"])}}},Rte={__name:"quote",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("blockquote"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleBlockquote().run()),tooltip:"引用",shortcut:"Ctrl+Shift+B",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleBlockquote().run()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"quote"})])),_:1},8,["button-active","disabled"])}}},zte={__name:"line-height",setup(e){const{options:n,editor:r}=gS(),o=t.computed((()=>n.value.dicts.lineHeights.map((e=>{var t;return{content:e.default?e.label+" (默认)":e.label,value:e.value,active:null==(t=r.value)?void 0:t.isActive({lineHeight:e.value})}})))),i=({content:e,value:t})=>{var n;e&&(null==(n=r.value)||n.chain().focus().setLineHeight(t).run())};return(e,n)=>{const r=QC,a=Bz;return t.openBlock(),t.createBlock(a,{tooltip:"行高","button-type":"dropdown","select-options":t.unref(o),onClick:i},{default:t.withCtx((()=>[t.createVNode(r,{name:"line-height"})])),_:1},8,["select-options"])}}},Fte={__name:"indent",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"增加缩进",shortcut:"Tab",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().indent().run()})},{default:t.withCtx((()=>[t.createVNode(o,{name:"indent"})])),_:1})}}},$te={__name:"outdent",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"减少缩进",shortcut:"Shift+Tab",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().outdent().run()})},{default:t.withCtx((()=>[t.createVNode(o,{name:"outdent"})])),_:1})}}},Hte={__name:"task",setup(e){const{editor:n}=gS();return(e,r)=>{var o;const i=QC,a=Gv,l=Yv,s=Bz;return t.openBlock(),t.createBlock(s,{"button-type":"dropdown","popup-handle":"arrow","button-active":null==(o=t.unref(n))?void 0:o.isActive("taskList"),tooltip:"待办事项",shortcut:"Ctrl+Shift+9",onButtonClick:r[3]||(r[3]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().toggleTaskList().run()})},{dropmenu:t.withCtx((()=>[t.createVNode(l,null,{default:t.withCtx((()=>{var e,o,i;return[t.createVNode(a,{disabled:!(null==(e=t.unref(n))?void 0:e.can().splitListItem("taskItem")),onClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().splitListItem("taskItem").run()})},{default:t.withCtx((()=>[t.createTextVNode(" 增加任务 ")])),_:1},8,["disabled"]),t.createVNode(a,{disabled:!(null==(o=t.unref(n))?void 0:o.can().sinkListItem("taskItem")),onClick:r[1]||(r[1]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().sinkListItem("taskItem").run()})},{default:t.withCtx((()=>[t.createTextVNode(" 设为子任务 ")])),_:1},8,["disabled"]),t.createVNode(a,{disabled:!(null==(i=t.unref(n))?void 0:i.can().liftListItem("taskItem")),onClick:r[2]||(r[2]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().liftListItem("taskItem").run()})},{default:t.withCtx((()=>[t.createTextVNode(" 移除任务 ")])),_:1},8,["disabled"])]})),_:1})])),default:t.withCtx((()=>[t.createVNode(i,{name:"task"})])),_:1},8,["button-active"])}}},Ute=e=>(t.pushScopeId("data-v-db89e31b"),e=e(),t.popScopeId(),e),Wte={class:"ordered-list-group"},qte=["onClick"],Kte=Ute((()=>t.createElementVNode("div",{class:"ordered-list-divider"},null,-1))),Gte=Ute((()=>t.createElementVNode("div",{class:"ordered-list-title"},"列表属性",-1))),Yte={class:"ordered-list-properties"},Xte=Ute((()=>t.createElementVNode("span",null,"起始编号:",-1))),Zte=yS({__name:"ordered-list",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{editor:o}=gS(),i=[{label:"数字",value:"decimal"},{label:"以0的开头的数字",value:"decimal-leading-zero"},{label:"小写罗马数字",value:"lower-roman"},{label:"大写罗马数字",value:"upper-roman"},{label:"小写英文编号",value:"lower-latin"},{label:"大写英文编号",value:"upper-latin"},{label:"中文编号",value:"trad-chinese-informal"},{label:"大写中文编号",value:"simp-chinese-formal"}];let a=t.ref("left");t.watch((()=>n.value),(e=>{if(e&&o.value){const{listStyleType:e}=o.value.getAttributes("orderedList");a.value=(null==e?void 0:e.listStyleType)||e||""}}));const l=e=>{var t,r;const i=null==(t=o.value)?void 0:t.chain().focus();(null==(r=o.value)?void 0:r.isActive("orderedList"))?o.value.getAttributes("orderedList").listStyleType!==e?i.updateAttributes("orderedList",{listStyleType:e}).run():i.toggleOrderedList().run():i.toggleOrderedList().updateAttributes("orderedList",{listStyleType:e}).run(),a.value=e,n.value=!1};let s=t.ref(1);const c=()=>{var e;o.value&&(null==(e=o.value)||e.chain().focus().updateAttributes("orderedList",{start:s.value}).run())};return t.watch((()=>n.value),(e=>{e&&o.value?s.value=o.value.getAttributes("orderedList").start:s.value=1})),(e,u)=>{var d;const p=QC,f=_S,h=$g,m=Bz;return t.openBlock(),t.createBlock(m,{"button-active":null==(d=t.unref(o))?void 0:d.isActive("orderedList"),tooltip:"数字编号",shortcut:"Ctrl+Shift+7","button-type":"popup","popup-handle":"arrow","popup-visible":t.unref(n),onTogglePopup:t.unref(r),onButtonClick:u[1]||(u[1]=e=>l(i[0].value))},{content:t.withCtx((()=>[t.createElementVNode("div",Wte,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,(e=>t.createVNode(f,{key:e.value,content:e.label},{default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["ordered-list-item",{active:t.unref(a)==e.value}]),onClick:t=>l(e.value)},[t.createVNode(p,{class:"icon-ordered-list",name:`ordered-list-${e.value}`},null,8,["name"])],10,qte)])),_:2},1032,["content"]))),64))]),Kte,Gte,t.createElementVNode("div",Yte,[t.createVNode(h,{modelValue:t.unref(s),"onUpdate:modelValue":u[0]||(u[0]=e=>t.isRef(s)?s.value=e:s=e),min:1,align:"left",theme:"column",onChange:c},{label:t.withCtx((()=>[Xte])),_:1},8,["modelValue"])])])),default:t.withCtx((()=>[t.createVNode(p,{name:"ordered-list"})])),_:1},8,["button-active","popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-db89e31b"]]),Jte={class:"bullet-list-group"},Qte=["onClick"],ene=yS({__name:"bullet-list",setup(e){let{popupVisible:n,togglePopup:r}=Qz();const{editor:o}=gS(),i=[{label:"圆点",value:"disc"},{label:"空心圆点",value:"circle"},{label:"方块",value:"square"}];let a=t.ref("");t.watch((()=>n.value),(e=>{if(e&&o.value){const{listStyleType:e}=o.value.getAttributes("bulletList");a.value=(null==e?void 0:e.listStyleType)||e||""}}));const l=e=>{var t,r;const i=null==(t=o.value)?void 0:t.chain().focus();(null==(r=o.value)?void 0:r.isActive("bulletList"))?o.value.getAttributes("bulletList").listStyleType!==e?i.updateAttributes("bulletList",{listStyleType:e}).run():i.toggleBulletList().run():i.toggleBulletList().updateAttributes("bulletList",{listStyleType:e}).run(),a.value=e,n.value=!1};return(e,s)=>{var c;const u=QC,d=_S,p=Bz;return t.openBlock(),t.createBlock(p,{"button-active":null==(c=t.unref(o))?void 0:c.isActive("bulletList"),tooltip:"项目符号",shortcut:"Ctrl+Shift+8","button-type":"popup","popup-handle":"arrow","popup-visible":t.unref(n),onTogglePopup:t.unref(r),onButtonClick:s[0]||(s[0]=e=>l(i[0].value))},{content:t.withCtx((()=>[t.createElementVNode("div",Jte,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(i,(e=>t.createVNode(d,{key:e.value,content:e.label},{default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["bullet-list-item",{active:t.unref(a)==e.value}]),onClick:t=>l(e.value)},[t.createVNode(u,{class:"icon-bullet-list",name:`bullet-list-${e.value}`},null,8,["name"])],10,Qte)])),_:2},1032,["content"]))),64))])])),default:t.withCtx((()=>[t.createVNode(u,{name:"bullet-list"})])),_:1},8,["button-active","popup-visible","onTogglePopup"])}}},[["__scopeId","data-v-dfeb305c"]]),tne={__name:"superscript",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("superscript"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleSuperscript().run()),tooltip:"上标",shortcut:"Ctrl+.",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.commands.toggleSuperscript()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"superscript"})])),_:1},8,["button-active","disabled"])}}},nne={__name:"subscript",setup(e){const{editor:n}=gS();return(e,r)=>{var o,i;const a=QC,l=Bz;return t.openBlock(),t.createBlock(l,{"button-active":null==(o=t.unref(n))?void 0:o.isActive("subscript"),disabled:!(null==(i=t.unref(n))?void 0:i.can().chain().focus().toggleSubscript().run()),tooltip:"下标",shortcut:"Ctrl+,",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.commands.toggleSubscript()})},{default:t.withCtx((()=>[t.createVNode(a,{name:"subscript"})])),_:1},8,["button-active","disabled"])}}},rne={key:0,class:"not-support",title:"可能无法正常显示该字体,可能是本机未安装该字体"},one={__name:"font-family",setup(e){const{options:n,editor:r}=gS(),o=bS("toolbar"),i=bS("recent");let a=t.ref([]);const l=e=>{if(!e)return!0;if("string"!=typeof e)return!1;const t="fontname",n=100,r=100,o=document.createElement("canvas"),i=o.getContext("2d",{willReadFrequently:!0});o.width=n,o.height=r,i.textAlign="center",i.fillStyle="black",i.textBaseline="middle";const a=e=>{i.clearRect(0,0,n,r),i.font=`100px ${e}, ${t}`,i.fillText("text",50,50);const{data:o}=i.getImageData(0,0,n,r);return Array.from(o).filter((e=>0!==e))};return a(t).join("")!==a(e).join("")},s=t.computed((()=>{const e=[{label:"常用字体",children:n.value.dicts.fonts}],t=e=>e.map((e=>n.value.dicts.fonts.find((({value:t})=>t===e))||{label:e,item:e}));return i.value.fonts.length>0&&e.unshift({label:"最近使用",children:t(i.value.fonts)}),a.value.length>0&&e.unshift({label:"已使用的字体",children:t(a.value)}),e})),c=()=>{const e=JSON.stringify(r.value.getJSON()).match(/"fontFamily":"([^"]+)"/g);e&&e.forEach((e=>{const t=e.replace('"fontFamily":"',"").replace('"',"");a.value.includes(t)||a.value.push(t)}))},u=e=>{e&&(i.value.fonts.forEach(((t,n)=>{t===e&&i.value.fonts.splice(n,1)})),i.value.fonts.unshift(e),i.value.fonts.length>10&&i.value.fonts.splice(10,1)),r.value.chain().focus().setFontFamily(e).run(),c()};return t.watch((()=>r.value),(e=>{e&&c()})),(e,n)=>{var i;const a=vw,c=gw,d=Bz;return t.openBlock(),t.createBlock(d,{tooltip:"选择字体","button-type":"select",value:(null==(i=t.unref(r))?void 0:i.getAttributes("textStyle").fontFamily)||null,style:t.normalizeStyle({width:"classic"!==t.unref(o).mode?"144px":"90px"}),placeholder:"字体",filterable:"",onButtonClick:u},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(s),((e,n)=>(t.openBlock(),t.createBlock(c,{key:n,label:e.label,divider:!1},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.children,(e=>(t.openBlock(),t.createBlock(a,{class:"font-family-item",value:e.value,key:e.value,label:e.label},{default:t.withCtx((()=>[t.createElementVNode("span",{style:t.normalizeStyle({fontFamily:e.value})},t.toDisplayString(e.label),5),l(e.value)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",rne,"!"))])),_:2},1032,["value","label"])))),128))])),_:2},1032,["label"])))),128))])),_:1},8,["value","style"])}}},ine=["disabled"],ane={class:"heading-container"},lne=["onClick"],sne={class:"subtitle"},cne=["onClick"],une={class:"subtitle"},dne=yS({__name:"heading",setup(e){let{popupVisible:n}=Qz();const{container:r,editor:o}=gS(),i=bS("toolbar"),a=t.ref(null),l=[{label:"正文",desc:"text",value:"paragraph"},{label:"标题 1",desc:"h1",value:1},{label:"标题 2",desc:"h2",value:2},{label:"标题 3",desc:"h3",value:3},{label:"标题 4",desc:"h4",value:4},{label:"标题 5",desc:"h5",value:5},{label:"标题 6",desc:"h6",value:6}],s=t.computed((()=>{var e;const t=e=>{var t;return null==(t=o.value)?void 0:t.isActive("heading",{level:e})};if(o.value){if(null==(e=o.value)?void 0:e.isActive("paragraph"))return"paragraph";if(t(1))return 1;if(t(2))return 2;if(t(3))return 3;if(t(4))return 4;if(t(5))return 5;if(t(6))return 6}return""})),c=e=>{var t,r;"paragraph"===e?null==(t=o.value)||t.chain().focus().setParagraph().run():null==(r=o.value)||r.chain().focus().toggleHeading({level:e}).run(),n.value=!1};return KO(a,(()=>{n.value=!1}),{ignore:[".umo-popup"]}),(e,u)=>{var d;const p=QC,f=Zm,h=vw,m=Bz;return"classic"!==t.unref(i).mode?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["toolbar-headding",{unfold:t.unref(n)}]),disabled:!(null==(d=t.unref(o))?void 0:d.isEditable)},[t.createElementVNode("div",ane,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,((e,n)=>{var r;return t.openBlock(),t.createElementBlock(t.Fragment,{key:e.value},[n<4?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["card",{active:e.value===t.unref(s)&&(null==(r=t.unref(o))?void 0:r.isEditable)}]),onClick:t=>c(e.value)},[t.createElementVNode("div",{class:t.normalizeClass(["title",e.desc])},t.toDisplayString(e.label),3),t.createElementVNode("div",sne,t.toDisplayString(e.desc),1)],10,lne)):t.createCommentVNode("",!0)],64)})),64)),t.createVNode(f,{attach:t.unref(r),trigger:"click",placement:"bottom-right","overlay-class-name":"heading-container-popup","destroy-on-close":"",visible:t.unref(n)},{content:t.withCtx((()=>[t.createElementVNode("div",{ref_key:"popupContentRef",ref:a,class:"heading-container"},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,((e,n)=>{var r;return t.openBlock(),t.createElementBlock(t.Fragment,{key:e.value},[n>=4?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["card",{active:e.value===t.unref(s)&&(null==(r=t.unref(o))?void 0:r.isEditable)}]),onClick:t=>c(e.value)},[t.createElementVNode("div",{class:t.normalizeClass(["title",e.desc])},t.toDisplayString(e.label),3),t.createElementVNode("div",une,t.toDisplayString(e.desc),1)],10,cne)):t.createCommentVNode("",!0)],64)})),64))],512)])),default:t.withCtx((()=>[t.createElementVNode("div",{class:"arrow",onClick:u[0]||(u[0]=e=>t.isRef(n)?n.value=!t.unref(n):n=!t.unref(n))},[t.createVNode(p,{name:"arrow-down"})])])),_:1},8,["attach","visible"])])],10,ine)):(t.openBlock(),t.createBlock(m,{key:1,tooltip:"设置标题,可依据标题生成大纲","button-type":"select",style:{width:"70px"},placeholder:"标题",borderless:"",value:t.unref(s),onButtonClick:c},{default:t.withCtx((()=>[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,(e=>t.createVNode(h,{class:"editor-heading-select-option",key:e.value,value:e.value,label:e.label},{default:t.withCtx((()=>[t.createElementVNode("div",{class:t.normalizeClass(["heading-size",e.desc])},t.toDisplayString(e.label),3)])),_:2},1032,["value","label"]))),64))])),_:1},8,["value"]))}}},[["__scopeId","data-v-15c8a668"]]),pne={__name:"clear-format",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"清除文本格式",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().unsetAllMarks().run()})},{default:t.withCtx((()=>[t.createVNode(o,{name:"clear-format"})])),_:1})}}},fne={__name:"select-all",setup(e){const{editor:n}=gS();return(e,r)=>{const o=QC,i=Bz;return t.openBlock(),t.createBlock(i,{tooltip:"全选",shortcut:"Ctrl+A",onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().selectAll().run()})},{default:t.withCtx((()=>[t.createVNode(o,{name:"select-all",style:{"font-size":"16px"}})])),_:1})}}},hne={__name:"redo",setup(e){const{editor:n}=gS();return(e,r)=>{var o;const i=QC,a=Bz;return t.openBlock(),t.createBlock(a,{tooltip:"撤销",shortcut:"Ctrl+Y / Ctrl+Shift+Z",disabled:!(null==(o=t.unref(n))?void 0:o.can().chain().focus().redo().run()),onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().redo().run()})},{default:t.withCtx((()=>[t.createVNode(i,{name:"redo"})])),_:1},8,["disabled"])}}},mne={__name:"undo",setup(e){const{editor:n}=gS();return(e,r)=>{var o;const i=QC,a=Bz;return t.openBlock(),t.createBlock(a,{tooltip:"撤销",shortcut:"Ctrl+Z",disabled:!(null==(o=t.unref(n))?void 0:o.can().chain().focus().undo().run()),onButtonClick:r[0]||(r[0]=e=>{var r;return null==(r=t.unref(n))?void 0:r.chain().focus().undo().run()})},{default:t.withCtx((()=>[t.createVNode(i,{name:"undo"})])),_:1},8,["disabled"])}}},vne={class:"classic-menu"},gne={key:0,class:"virtual-group"},bne={class:"virtual-group"},yne={class:"virtual-group"},wne={class:"virtual-group"},kne={class:"virtual-group"},xne={class:"virtual-group"},Cne={class:"virtual-group"},One={class:"virtual-group"},Sne={class:"virtual-group"},Ene={class:"virtual-group"},Nne={class:"virtual-group"},_ne={class:"virtual-group"},Mne={class:"virtual-group"},Ane={class:"virtual-group"},Tne={class:"virtual-group"},Vne={class:"virtual-group"},jne={class:"virtual-group"},Bne={class:"virtual-group"},Pne={class:"virtual-group"},Ine={class:"virtual-group"},Dne={class:"virtual-group"},Lne={class:"virtual-group"},Rne={class:"virtual-group-row"},zne={class:"virtual-group"},Fne={class:"virtual-group"},$ne={class:"virtual-group"},Hne={class:"virtual-group"},Une=yS({__name:"classic",props:{menus:{type:Array,required:!0},currentMenu:{type:String,required:!0}},emits:["menu-change"],setup(e,{emit:n}){const r=e,o=n,{container:i,options:a}=gS(),l=e=>a.value.toolbar.disableMenuItems.includes(e);let s=t.ref("");t.watch((()=>r.currentMenu),(async e=>{s.value=e,await t.nextTick();try{c.value.update()}catch{}}),{immediate:!0});const c=t.ref(),u=async e=>{o("menu-change",e),await t.nextTick(),c.value.update()};return(n,r)=>{const o=QC,a=vw,d=mw,p=mne,f=hne,h=fne,m=pne,v=dne,g=one,b=fF,y=pF,w=dF,k=uF,x=cF,C=nne,O=tne,S=tF,E=eF,N=Iz,_=ene,M=Zte,A=Hte,T=$te,V=Fte,j=zte,B=sF,P=Rte,I=Lte,D=Dte,L=Pte,R=jte,z=Ate,F=_te,$=Ete,H=Ote,U=xte,W=wte,q=hte,K=pte,G=ate,Y=ote,X=nte,Z=qee,J=Uee,Q=$ee,ee=Lee,te=jee,ne=Eee,re=JF,oe=XF,ie=GF,ae=qF,le=UF,se=$F,ce=zF,ue=LF,de=IF,pe=BF,fe=Oee,he=xee,me=wee,ve=bee,ge=vee,be=hee,ye=$$,we=_$,ke=pee,xe=iee,Ce=v$,Oe=d$,Se=J7,Ee=D7,Ne=P7,_e=j7,Me=m7,Ae=p7,Te=u7,Ve=s7,je=a7,Be=Z9,Pe=H9,Ie=F9,De=D9,Le=P9,Re=T9,ze=E9,Fe=k9;return t.openBlock(),t.createBlock(Fe,{ref_key:"scrollableRef",ref:c,class:"scrollable-container"},{default:t.withCtx((()=>[t.createElementVNode("div",vne,[e.menus.length>1?(t.openBlock(),t.createElementBlock("div",gne,[t.createVNode(d,{modelValue:t.unref(s),"onUpdate:modelValue":r[0]||(r[0]=e=>t.isRef(s)?s.value=e:s=e),"popup-props":{destroyOnClose:!0,attach:t.unref(i)},size:"small","auto-width":"",borderless:"",onChange:u},{prefixIcon:t.withCtx((()=>[t.createVNode(o,{name:"menu"})])),default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.menus,(e=>(t.openBlock(),t.createBlock(a,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue","popup-props"])])):t.createCommentVNode("",!0),"base"===t.unref(s)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",bne,[t.createVNode(p),t.createVNode(f),t.createVNode(h),t.createVNode(m)]),t.createElementVNode("div",yne,[t.createVNode(v),t.createVNode(g,{borderless:""}),t.createVNode(b,{borderless:""}),t.createVNode(y),t.createVNode(w),t.createVNode(k),t.createVNode(x),t.createVNode(C),t.createVNode(O),t.createVNode(S),t.createVNode(E),t.createVNode(N)]),t.createElementVNode("div",wne,[t.createVNode(_),t.createVNode(M),t.createVNode(A),t.createVNode(T),t.createVNode(V),t.createVNode(j),t.createVNode(B),t.createVNode(P),l("code")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0}))]),t.createElementVNode("div",kne,[t.createVNode(D),t.createVNode(L)])],64)):t.createCommentVNode("",!0),"insert"===t.unref(s)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",xne,[t.createVNode(R),t.createVNode(z),l("video")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(F,{key:0})),l("audio")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock($,{key:1})),l("file")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(H,{key:2})),l("code")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(U,{key:3})),t.createVNode(W),t.createVNode(q),l("emoji")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(K,{key:4})),l("mathematics")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(G,{key:5}))]),t.createElementVNode("div",Cne,[t.createVNode(Y),t.createVNode(X),t.createVNode(Z),t.createVNode(J)]),t.createElementVNode("div",One,[t.createVNode(Q),t.createVNode(ee)])],64)):t.createCommentVNode("",!0),"table"===t.unref(s)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("div",Sne,[t.createVNode(te),t.createVNode(ne)]),t.createElementVNode("div",Ene,[t.createVNode(re),t.createVNode(oe)]),t.createElementVNode("div",Nne,[t.createVNode(ie,{"huge-button":!1}),t.createVNode(ae,{"huge-button":!1}),t.createVNode(le,{"huge-button":!1}),t.createVNode(se,{"huge-button":!1})]),t.createElementVNode("div",_ne,[t.createVNode(ce,{"huge-button":!1}),t.createVNode(ue,{"huge-button":!1})]),t.createElementVNode("div",Mne,[t.createVNode(de,{"huge-button":!1}),t.createVNode(pe,{"huge-button":!1})]),t.createElementVNode("div",Ane,[t.createVNode(fe,{"huge-button":!1}),t.createVNode(he,{"huge-button":!1}),t.createVNode(me,{"huge-button":!1})]),t.createElementVNode("div",Tne,[t.createVNode(ve,{"huge-button":!1}),t.createVNode(ge,{"huge-button":!1})]),t.createElementVNode("div",Vne,[t.createVNode(be)])],64)):t.createCommentVNode("",!0),"tools"===t.unref(s)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createElementVNode("div",jne,[t.createVNode(ye),t.createVNode(we)]),t.createElementVNode("div",Bne,[l("signature")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(ke,{key:0})),l("seal")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(xe,{key:1}))]),t.createElementVNode("div",Pne,[l("diagrams")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Ce,{key:0})),l("mermaid")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Oe,{key:1}))]),t.createElementVNode("div",Ine,[t.createVNode(Se)])],64)):t.createCommentVNode("",!0),"page"===t.unref(s)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.createElementVNode("div",Dne,[t.createVNode(Ee)]),t.createElementVNode("div",Lne,[t.createElementVNode("div",Rne,[t.createVNode(Ne),t.createVNode(_e),t.createVNode(Me)])]),t.createElementVNode("div",zne,[t.createVNode(Ae),t.createVNode(Te),t.createVNode(Ve),t.createVNode(je),t.createVNode(Be)]),t.createElementVNode("div",Fne,[t.createVNode(Pe)])],64)):t.createCommentVNode("",!0),"export"===t.unref(s)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[t.createElementVNode("div",$ne,[t.createVNode(Ie),t.createVNode(De),t.createVNode(Le)]),t.createElementVNode("div",Hne,[l("share")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Re,{key:0})),l("embed")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(ze,{key:1}))])],64)):t.createCommentVNode("",!0)])])),_:1},512)}}},[["__scopeId","data-v-477404a9"]]),Wne={class:"ribbon-menu"},qne={key:0,class:"ribbon-tabs"},Kne=["onClick"],Gne={class:"ribbon-container"},Yne={class:"virtual-group"},Xne={class:"virtual-group-row"},Zne={class:"virtual-group-row"},Jne={class:"virtual-group"},Qne={class:"virtual-group-row"},ere={class:"virtual-group-row"},tre={class:"virtual-group"},nre={class:"virtual-group-row"},rre={class:"virtual-group-row"},ore={class:"virtual-group"},ire={class:"virtual-group"},are={class:"virtual-group"},lre={class:"virtual-group"},sre={class:"virtual-group"},cre={class:"virtual-group"},ure={class:"virtual-group"},dre={class:"virtual-group"},pre={class:"virtual-group-row"},fre={class:"virtual-group-row"},hre={class:"virtual-group"},mre={class:"virtual-group-row"},vre={class:"virtual-group-row"},gre={class:"virtual-group"},bre={class:"virtual-group-row"},yre={class:"virtual-group-row"},wre={class:"virtual-group"},kre={class:"virtual-group-row"},xre={class:"virtual-group-row"},Cre={class:"virtual-group"},Ore={class:"virtual-group"},Sre={class:"virtual-group"},Ere={class:"virtual-group"},Nre={class:"virtual-group"},_re={class:"virtual-group"},Mre={class:"virtual-group"},Are={class:"virtual-group-row"},Tre={class:"virtual-group-row"},Vre={class:"virtual-group-row"},jre={class:"virtual-group"},Bre={class:"virtual-group"},Pre={class:"virtual-group"},Ire={class:"virtual-group"},Dre=yS({__name:"ribbon",props:{menus:{type:Array,required:!0},currentMenu:{type:String,required:!0}},emits:["menu-change"],setup(e,{emit:n}){const r=n,o=e=>{const{options:t}=gS();return t.value.toolbar.disableMenuItems.includes(e)},i=t.ref();return(n,a)=>{const l=mne,s=hne,c=fne,u=pne,d=one,p=fF,f=pF,h=dF,m=uF,v=cF,g=nne,b=tne,y=tF,w=eF,k=Iz,x=ene,C=Zte,O=Hte,S=$te,E=Fte,N=zte,_=aF,M=iF,A=oF,T=rF,V=nF,j=Rte,B=Lte,P=dne,I=Dte,D=Pte,L=jte,R=Ate,z=_te,F=Ete,$=Ote,H=xte,U=wte,W=hte,q=pte,K=ate,G=ote,Y=nte,X=qee,Z=Uee,J=$ee,Q=Lee,ee=jee,te=Eee,ne=JF,re=XF,oe=GF,ie=qF,ae=zF,le=UF,se=$F,ce=LF,ue=IF,de=BF,pe=Oee,fe=xee,he=wee,me=bee,ve=vee,ge=hee,be=$$,ye=_$,we=pee,ke=iee,xe=v$,Ce=d$,Oe=J7,Se=D7,Ee=P7,Ne=j7,_e=m7,Me=p7,Ae=u7,Te=s7,Ve=a7,je=Z9,Be=H9,Pe=F9,Ie=D9,De=P9,Le=T9,Re=E9,ze=k9;return t.openBlock(),t.createElementBlock("div",Wne,[e.menus.length>1?(t.openBlock(),t.createElementBlock("div",qne,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.menus,(n=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["tabs-item",{active:e.currentMenu===n.value}]),key:n.value,onClick:e=>(async e=>{r("menu-change",e),await t.nextTick(),i.value.update()})(n.value)},t.toDisplayString(n.label),11,Kne)))),128))])):t.createCommentVNode("",!0),t.createVNode(ze,{ref_key:"scrollableRef",ref:i,class:"scrollable-container"},{default:t.withCtx((()=>[t.createElementVNode("div",Gne,["base"===e.currentMenu?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",Yne,[t.createElementVNode("div",Xne,[t.createVNode(l),t.createVNode(s)]),t.createElementVNode("div",Zne,[t.createVNode(c),t.createVNode(u)])]),t.createElementVNode("div",Jne,[t.createElementVNode("div",Qne,[t.createVNode(d),t.createVNode(p)]),t.createElementVNode("div",ere,[t.createVNode(f),t.createVNode(h),t.createVNode(m),t.createVNode(v),t.createVNode(g),t.createVNode(b),t.createVNode(y),t.createVNode(w),t.createVNode(k)])]),t.createElementVNode("div",tre,[t.createElementVNode("div",nre,[t.createVNode(x),t.createVNode(C),t.createVNode(O),t.createVNode(S),t.createVNode(E),t.createVNode(N)]),t.createElementVNode("div",rre,[t.createVNode(_),t.createVNode(M),t.createVNode(A),t.createVNode(T),t.createVNode(V),t.createVNode(j),o("code")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(B,{key:0}))])]),t.createElementVNode("div",ore,[t.createVNode(P)]),t.createElementVNode("div",ire,[t.createVNode(I),t.createVNode(D)])],64)):t.createCommentVNode("",!0),"insert"===e.currentMenu?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",are,[t.createVNode(L),t.createVNode(R),o("video")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(z,{key:0})),o("audio")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(F,{key:1})),o("file")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock($,{key:2})),o("code-block")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(H,{key:3})),t.createVNode(U),t.createVNode(W),o("emoji")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(q,{key:4})),o("mathematics")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(K,{key:5}))]),t.createElementVNode("div",lre,[t.createVNode(G),t.createVNode(Y),t.createVNode(X),t.createVNode(Z)]),t.createElementVNode("div",sre,[t.createVNode(J),t.createVNode(Q)])],64)):t.createCommentVNode("",!0),"table"===e.currentMenu?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",cre,[t.createVNode(ee),t.createVNode(te)]),t.createElementVNode("div",ure,[t.createVNode(ne),t.createVNode(re)]),t.createElementVNode("div",dre,[t.createElementVNode("div",pre,[t.createVNode(oe),t.createVNode(ie),t.createVNode(ae)]),t.createElementVNode("div",fre,[t.createVNode(le),t.createVNode(se),t.createVNode(ce)])]),t.createElementVNode("div",hre,[t.createElementVNode("div",mre,[t.createVNode(ue)]),t.createElementVNode("div",vre,[t.createVNode(de)])]),t.createElementVNode("div",gre,[t.createElementVNode("div",bre,[t.createVNode(pe),t.createVNode(fe)]),t.createElementVNode("div",yre,[t.createVNode(he)])]),t.createElementVNode("div",wre,[t.createElementVNode("div",kre,[t.createVNode(me)]),t.createElementVNode("div",xre,[t.createVNode(ve)])]),t.createElementVNode("div",Cre,[t.createVNode(ge)])],64)):t.createCommentVNode("",!0),"tools"===e.currentMenu?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("div",Ore,[t.createVNode(be),t.createVNode(ye)]),t.createElementVNode("div",Sre,[o("signature")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(we,{key:0})),o("seal")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(ke,{key:1}))]),t.createElementVNode("div",Ere,[o("diagrams")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(xe,{key:0})),o("mermaid")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Ce,{key:1}))]),t.createElementVNode("div",Nre,[t.createVNode(Oe)])],64)):t.createCommentVNode("",!0),"page"===e.currentMenu?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createElementVNode("div",_re,[t.createVNode(Se)]),t.createElementVNode("div",Mre,[t.createElementVNode("div",Are,[t.createVNode(Ee),t.createElementVNode("div",null,[t.createElementVNode("div",Tre,[t.createVNode(Ne)]),t.createElementVNode("div",Vre,[t.createVNode(_e)])])])]),t.createElementVNode("div",jre,[t.createVNode(Me),t.createVNode(Ae),t.createVNode(Te),t.createVNode(Ve),t.createVNode(je)]),t.createElementVNode("div",Bre,[t.createVNode(Be)])],64)):t.createCommentVNode("",!0),"export"===e.currentMenu?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.createElementVNode("div",Pre,[t.createVNode(Pe),t.createVNode(Ie),t.createVNode(De)]),t.createElementVNode("div",Ire,[o("share")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Le,{key:0})),o("embed")?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Re,{key:1}))])],64)):t.createCommentVNode("",!0)])])),_:1},512)])}}},[["__scopeId","data-v-7464259a"]]),Lre=e=>vS(new Date(e),{messages:{justNow:"刚刚",past:e=>e.match(/\d/)?`${e}前`:e,future:e=>e.match(/\d/)?`未来 ${e}`:e,month:(e,t)=>1===e?t?"上个月":"下个月":`${e}个月`,year:(e,t)=>1===e?t?"去年":"明年":`${e}年`,day:(e,t)=>1===e?t?"昨天":"明天":`${e}天`,week:(e,t)=>1===e?t?"上一周":"下一周":`${e}周`,hour:e=>`${e}小时`,minute:e=>`${e}分钟`,second:e=>`${e}秒`}}).value.replace(/"/gi,""),Rre={key:0,class:"toolbar-container"},zre={class:"status"},Fre={class:"status-saved button-text"},$re={key:0},Hre={key:1,class:"unsaved"},Ure={class:"document-status-container status"},Wre={key:0},qre={key:1},Kre={class:"document-button-container"},Gre=(e=>(t.pushScopeId("data-v-a5085372"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("span",{class:"button-text"},"切换工具栏",-1))),Yre=yS({__name:"index",emits:["menu-change"],setup(e,{emit:n}){const r=n,{container:o,options:i,editor:a,savedAt:l}=gS(),s=bS("toolbar"),c=t.ref(!1),u=pS(),d=[{label:"开始",value:"base"},{label:"插入",value:"insert"},{label:"表格",value:"table"},{label:"工具",value:"tools"},{label:"页面",value:"page"},{label:"导出",value:"export"}];let p=d;i.value.toolbar.menus&&(p=i.value.toolbar.menus.map((e=>d.filter((t=>t.value===e))[0])));let f=t.ref(p[0].value);const h=e=>{f.value=e,r("menu-change",e)};t.watch((()=>{var e;return null==(e=a.value)?void 0:e.isActive("table")}),((e,t)=>{e?f.value="table":!e&&t&&(f.value="base")}));const m=t.computed((()=>{const e=[{label:"专业工具栏",value:"ribbon",prefixIcon:"toolbar-ribbon"},{label:"经典工具栏",value:"classic",prefixIcon:"toolbar-classic"},{label:"隐藏工具栏",value:"hideToolbar",prefixIcon:"hide-toolbar"}];return i.value.toolbar.enableSourceEditor&&e.splice(2,0,{label:"编辑源代码",value:"source",prefixIcon:"toolbar-source",divider:!0}),e})),v=({value:e})=>{"hideToolbar"===e?s.value.show=!1:(s.value.show=!0,s.value.mode=e)},g=t.inject("saveContent"),b=()=>{var e;const t=bS("document"),{content:n}=t.value;if(n&&""!==n&&"<p></p>"!==n)null==(e=a.value)||e.chain().setContent(n,!0).focus().run();else{const e=QL({theme:"info",header:"错误提示",body:"当前缓存中没有内容。",placement:"center",onConfirm(){e.destroy()}})}};return(e,n)=>{var r;const d=Dre,y=Une,w=w9,k=Fd,x=Zm,C=QC,O=Yv,S=Kv,E=_S;return t.unref(s).show?(t.openBlock(),t.createElementBlock("div",Rre,["ribbon"===t.unref(s).mode?(t.openBlock(),t.createBlock(d,{key:0,menus:t.unref(p),"current-menu":t.unref(f),onMenuChange:h},null,8,["menus","current-menu"])):t.createCommentVNode("",!0),"classic"===t.unref(s).mode?(t.openBlock(),t.createBlock(y,{key:1,menus:t.unref(p),"current-menu":t.unref(f),onMenuChange:h},null,8,["menus","current-menu"])):t.createCommentVNode("",!0),"source"===t.unref(s).mode&&t.unref(i).toolbar.enableSourceEditor?(t.openBlock(),t.createBlock(w,{key:2})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["toolbar-actions",t.unref(s).mode])},["source"!==t.unref(s).mode&&(null==(r=t.unref(a))?void 0:r.isEditable)?(t.openBlock(),t.createBlock(x,{key:0,attach:t.unref(o),trigger:"click",placement:"bottom-right",onVisibleChange:n[0]||(n[0]=e=>c.value=e)},{content:t.withCtx((()=>[t.createElementVNode("div",Ure,[t.createElementVNode("div",null,"网络状态: "+t.toDisplayString(t.unref(u)?"在线":"离线"),1),t.createElementVNode("div",null,[t.createTextVNode(" 保存时间: "),t.unref(l)?(t.openBlock(),t.createElementBlock("span",Wre,t.toDisplayString(t.unref(Lre)(t.unref(l)))+"保存",1)):(t.openBlock(),t.createElementBlock("span",qre,"未保存"))]),t.createElementVNode("div",Kre,[t.createVNode(k,{size:"small",onClick:t.unref(g)},{default:t.withCtx((()=>[t.createTextVNode("保存文档")])),_:1},8,["onClick"]),t.createVNode(k,{size:"small",variant:"outline",onClick:b},{default:t.withCtx((()=>[t.createTextVNode(" 从缓存中恢复 ")])),_:1})])])])),default:t.withCtx((()=>[t.createVNode(k,{class:t.normalizeClass(["button",{active:c.value}]),variant:"text",size:"small"},{default:t.withCtx((()=>[t.createElementVNode("span",zre,[t.createElementVNode("span",{class:t.normalizeClass(["status-online",{offline:!t.unref(u)}])},null,2),t.createElementVNode("span",Fre,[t.unref(l)?(t.openBlock(),t.createElementBlock("span",$re,t.toDisplayString(t.unref(Lre)(t.unref(l)))+"保存",1)):(t.openBlock(),t.createElementBlock("span",Hre,"文档未保存"))])])])),_:1},8,["class"])])),_:1},8,["attach"])):t.createCommentVNode("",!0),t.createVNode(S,{trigger:"click",size:"small",placement:"bottom-right","popup-props":{destroyOnClose:!0,attach:t.unref(o)},onClick:v},{dropdown:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(m),(e=>(t.openBlock(),t.createBlock(O,{key:e.value,content:e.label,value:e.value,divider:e.divider,active:e.value===t.unref(s).mode},{prefixIcon:t.withCtx((()=>[t.createVNode(C,{name:e.prefixIcon},null,8,["name"])])),_:2},1032,["content","value","divider","active"])))),128))])),default:t.withCtx((()=>[t.createVNode(k,{class:"button",variant:"text",size:"small"},{default:t.withCtx((()=>[t.createVNode(C,{name:"expand-down"}),Gre])),_:1})])),_:1},8,["popup-props"])],2)])):(t.openBlock(),t.createBlock(E,{key:1,content:"显示工具栏",placement:"bottom-right"},{default:t.withCtx((()=>[t.createElementVNode("div",{class:"show-toolbar",onClick:n[1]||(n[1]=e=>t.unref(s).show=!0)},[t.createVNode(C,{name:"arrow-down"})])])),_:1}))}}},[["__scopeId","data-v-a5085372"]]),Xre=["id"],Zre={class:"umo-toolbar"},Jre={class:"umo-main"},Qre={key:0,class:"umo-footer"},eoe=yS(Object.assign({name:"UmoEditor"},{__name:"index",props:mO,emits:["beforeCreate","created","changed","changed:selection","changed:transaction","changed:menu","changed:toolbar","changed:pageSize","changed:pageOrientation","changed:pageMargin","changed:pageBackground","changed:pageShowToc","changed:pagePreview","changed:pageZoom","changed:pageWatermark","focus","blur","saved","destroy"],setup(e,{expose:n,emit:r}){const o=e,i=r;t.onBeforeMount((()=>f(o)));const{container:a,toolbarKey:l,options:s,page:c,savedAt:u,editorDestroyed:d,editor:p,setOptions:f,resetStore:h}=gS(),m=bS("toolbar",o.editorKey),v=bS("document",o.editorKey);t.watch((()=>o),(()=>f(o)),{deep:!0});const g={classPrefix:"umo"},b=(e="html")=>{if(!p.value)throw new Error("editor is not ready!");if("html"===e)return p.value.getHTML();if("text"===e)return p.value.getText();if("json"===e)return p.value.getJSON();throw new Error("format must be html, text or json")},y=async()=>{if("source"!==m.value.mode&&!s.value.document.readOnly)try{let e=await tR("loading",{content:"正在保存文档内容...",placement:"bottom",closeBtn:!0,offset:[0,-20]});if(!(await s.value.onSave({html:p.value.getHTML(),json:p.value.getJSON(),text:p.value.getHTML()},c.value,v.value)))return e.close(),void(e=tR("error",{content:"文档内容失败,请重试!",placement:"bottom",offset:[0,-20]}));i("saved"),e.close(),tR("success",{content:"文档内容保存成功!",placement:"bottom",offset:[0,-20]});const n=function(e={}){const{controls:n=!1,offset:r=0,immediate:o=!0,interval:i="requestAnimationFrame",callback:a}=e,l=t.ref(OO()+r),s=()=>l.value=OO()+r,c=a?()=>{s(),a(l.value)}:s,u="requestAnimationFrame"===i?YO(c,{immediate:o}):zO(c,i,{immediate:o});return n?{timestamp:l,...u}:l}({offset:0});u.value=n.value}catch(e){tR("error",{content:"文档内容保存出错!",placement:"bottom",offset:[0,-20]}),console.error(e.message)}},w=e=>{const t=()=>{localStorage.clear(),location.reload()};if(e)return void t();const n=eR({theme:"warning",header:"重置编辑器",body:"此操作会清空所有的编辑器设置数据,包括当前编辑的内容,并刷新页面,建议保存内容后再重置,确定要现在重置吗?",confirmBtn:{theme:"warning",content:"立即重置"},onConfirm(){n.destroy(),t()}})};n({getOptions:()=>s.value,setOptions:f,setToolbar:e=>{if(!e instanceof Object)throw new Error("parmas must be an object.");if(e.mode){if("string"!=typeof e.mode)throw new Error('"parmas.size" must be a string.');if(e.mode&&!["classic","ribbon"].includes(e.mode))throw new Error('"parmas.mode" must be one of "classic" or "ribbon".');m.value.mode=e.mode}if(void 0!==e.show){if("boolean"!=typeof e.show)throw new Error('"parmas.show" must be a boolean.');m.value.show=e.show}},setPage:e=>{if(!e instanceof Object)throw new Error("parmas must be an object.");if(e.size){if("string"!=typeof e.size)throw new Error('"parmas.size" must be a string.');const t=s.value.dicts.pageSizes.find((t=>t.label===e.size));if(!t)throw new Error(`"parmas.size" must be one of ${s.value.dicts.pageSizes.map((e=>e.label))}.`);c.value.size=t}if(e.orientation){if("string"!=typeof e.orientation)throw new Error('"parmas.orientation" must be a string.');if(!["horizontal","vertical"].includes(e.orientation))throw new Error('"parmas.mode" must be one of "classic" or "ribbon".');c.value.orientation=e.orientation}if(e.background){if("string"!=typeof e.background)throw new Error('"parmas.background" must be a string.');c.value.background=e.background}if(void 0!==e.showBreakMarks){if("boolean"!=typeof e.showBreakMarks)throw new Error('"parmas.showBreakMarks" must be a boolean.');c.value.showBreakMarks=e.showBreakMarks,e.showBreakMarks?p.value.commands.showInvisibleCharacters():p.value.commands.hideInvisibleCharacters()}},setWatermark:e=>{if(!e instanceof Object)throw new Error("parmas must be an object.");if(void 0!==e.alpha){if("number"!=typeof e.alpha)throw new Error('"parmas.alpha" must be a number.');c.value.watermark.alpha=e.alpha}if(e.text){if("string"!=typeof e.text)throw new Error('"parmas.text" must be a string.');if(e.text.length>30)throw new Error('"parmas.text" must be less than 30 characters.');c.value.watermark.text=e.text}if(e.type){if("string"!=typeof e.type)throw new Error('"parmas.type" must be a string.');if(!["compact","spacious"].includes(e.type))throw new Error('"parmas.type" must be one of "compact" or "spacious".');c.value.watermark.type=e.type}if(e.fontColor){if("string"!=typeof e.fontColor)throw new Error('"parmas.fontColor" must be a string.');c.value.watermark.fontColor=e.fontColor}if(e.fontSize){if("number"!=typeof e.fontSize)throw new Error('"parmas.fontSize" must be a number.');c.value.watermark.fontSize=e.fontSize}if(e.fontFamily||null===e.fontFamily){if(null!==e.fontFamily&&"string"!=typeof e.fontFamily)throw new Error('"parmas.fontFamily" must be a string.');c.value.watermark.fontFamily=e.fontFamily}if(e.fontWeight){if("string"!=typeof e.fontWeight)throw new Error('"parmas.fontWeight" must be a string.');if(!["normal","bold","bolder"].includes(e.fontWeight))throw new Error('"parmas.fontWeight" must be one of "normal", "bold" or "bolder".');c.value.watermark.fontWeight=e.fontWeight}},setDocument:e=>{if(!e instanceof Object)throw new Error("parmas must be an object.");if(e.title){if("string"!=typeof e.title)throw new Error('"parmas.title" must be a string.');const t=""!==e.title?e.title:"未命名文档";v.value.title=t,s.value.document.title=t}if(void 0!==e.bubbleMenu){if("boolean"!=typeof e.bubbleMenu)throw new Error('"parmas.bubbleMenu" must be a boolean.');v.value.bubbleMenu=e.bubbleMenu}if(void 0!==e.markdown){if("boolean"!=typeof e.markdown)throw new Error('"parmas.markdown" must be a boolean.');v.value.markdown=e.markdown}if(void 0!==e.spellcheck){if("boolean"!=typeof e.spellcheck)throw new Error('"parmas.spellcheck" must be a boolean.');v.value.spellcheck=e.spellcheck}},setContent:e=>{if(!p.value)throw new Error("editor is not ready!");p.value.chain().setContent(e).focus().run()},getContent:b,getImage:async(e="blob")=>{const t=c.value.zoomLevel;try{c.value.zoomLevel=100;const e=document.querySelector(`${a} .page-content`);if("blob"){return await R9.toBlob(e)}if("jpeg"){return await R9.toJpeg(e)}if("png"){return await R9.toPng(e)}}catch{throw new Error("导出图片失败,请重试或尝试刷新页面。")}finally{c.value.zoomLevel=t}},getText:()=>b("text"),getHTML:()=>b("html"),getJSON:()=>b("json"),saveContent:y,getContentExcerpt:(e=100,t=" ...")=>{const n=p.value.getText();return 0===n.length?"":n.substring(0,e)+t},getEditor:()=>p,setReadOnly(e=!0){s.value.document.readOnly=e},focus:(e="start")=>p.value.commands.focus(e),blur:()=>p.value.chain().blur().run(),reset:w,useAlert:QL,useConfirm:eR,useMessage:tR,destroy:()=>{h(),p.value.destroy()}}),i("beforeCreate"),t.watch((()=>p.value),(()=>{p.value&&(p.value.on("create",(({editor:e})=>i("created",{editor:e}))),p.value.on("update",(({editor:e})=>i("changed",{editor:e}))),p.value.on("selectionUpdate",(({editor:e})=>{i("changed:selection",{editor:e})})),p.value.on("transaction",(({editor:e,transaction:t})=>i("changed:transaction",{editor:e,transaction:t}))),p.value.on("focus",(({editor:e,event:t})=>i("focus",{editor:e,event:t}))),p.value.on("blur",(({editor:e,event:t})=>i("blur",{editor:e,event:t}))),p.value.on("destroy",(()=>{h(),i("destroy")})))}));const k=e=>i("changed:menu",e);return t.watch((()=>m.value),((e,t)=>{i("changed:toolbar",{toolbar:e,oldToolbar:t})}),{deep:!0}),t.watch((()=>c.value.size),((e,t)=>i("changed:pageSize",{pageSize:e,oldPageSize:t})),{deep:!0}),t.watch((()=>c.value.margin),((e,t)=>i("changed:pageMargin",{pageMargin:e,oldPageMargin:t})),{deep:!0}),t.watch((()=>c.value.background),((e,t)=>i("changed:pageBackground",{pageBackground:e,oldPageBackground:t}))),t.watch((()=>c.value.orientation),((e,t)=>i("changed:pageOrientation",{pageOrientation:e,oldPageOrientation:t}))),t.watch((()=>c.value.showToc),(e=>i("changed:pageShowToc",e))),t.watch((()=>c.value.zoomLevel),((e,t)=>i("changed:pageZoom",{zoomLevel:e,oldZoomLevel:t}))),t.watch((()=>c.value.preview.enabled),(e=>i("changed:pagePreview",e))),t.watch((()=>c.value.watermark),((e,t)=>i("changed:pageWatermark",{pageWatermark:e,oldPageWatermark:t})),{deep:!0}),t.provide("saveContent",y),t.provide("reset",w),QS("ctrl+s,command+s",y),t.watch((()=>m.value.mode),(e=>d.value="source"===e)),(e,n)=>{const r=Yre,o=g9,i=bz,u=fR,d=XC;return t.openBlock(),t.createBlock(d,{"global-config":g},{default:t.withCtx((()=>[t.createElementVNode("div",{id:t.unref(a).substr(1),class:t.normalizeClass(["umo-editor-container",{"toolbar-classic":"classic"===t.unref(m).mode,"toolbar-ribbon":"ribbon"===t.unref(m).mode,"toolbar-source":"source"===t.unref(m).mode,"preview-mode":t.unref(c).preview.enabled,"laser-pointer":t.unref(c).preview.enabled&&t.unref(c).preview.laserPointer}]),style:t.normalizeStyle({height:t.unref(s).height})},[t.createElementVNode("header",Zre,[(t.openBlock(),t.createBlock(r,{key:t.unref(l),onMenuChange:k}))]),t.createElementVNode("main",Jre,["source"!==t.unref(m).mode?(t.openBlock(),t.createBlock(o,{key:0})):(t.openBlock(),t.createBlock(i,{key:1}))]),"source"!==t.unref(m).mode?(t.openBlock(),t.createElementBlock("footer",Qre,[t.createVNode(u)])):t.createCommentVNode("",!0)],14,Xre)])),_:1})}}}),[["__scopeId","data-v-991be275"]]),toe={install:(e,t)=>{const{setOptions:n}=gS();n(t),e.component(eoe.name,eoe)}};e.UmoEditor=eoe,e.default=eoe,e.useUmoEditor=toe,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));