reactjs-tiptap-editor 1.0.16 → 1.0.18

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 (263) hide show
  1. package/lib/{ActionMenuButton-a8LhmHXe.js → ActionMenuButton-BOjCHFTA.js} +12 -16
  2. package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +47 -89
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +11 -14
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +13 -16
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +15 -18
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +113 -113
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +12 -14
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +8 -11
  17. package/lib/CodeBlock.cjs +37 -37
  18. package/lib/CodeBlock.js +1566 -1613
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +9 -11
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +62 -82
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +27 -15
  25. package/lib/Drawer-DwrlY_lY.cjs +1 -0
  26. package/lib/Drawer-DxOoRiGQ.js +1099 -0
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +6 -5
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +71 -97
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +265 -5
  33. package/lib/ExportPdf.cjs +4 -4
  34. package/lib/ExportPdf.js +20 -31
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +11 -11
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +16 -39
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +25 -41
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +51 -65
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +60 -76
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +322 -320
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +8 -11
  49. package/lib/{Iframe-CmjbQQcz.js → Iframe-AhNV5WH5.js} +52 -65
  50. package/lib/Iframe-C6pBw-AF.cjs +1 -0
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +5 -4
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +5 -5
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +148 -181
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +19 -26
  59. package/lib/{Indent-BoG-vpIE.js → Indent-DZ5PcJA4.js} +24 -30
  60. package/lib/Indent-Do-X0AsY.cjs +1 -0
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +2 -2
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +11 -14
  65. package/lib/Katex-CIC9ygbL.cjs +4 -0
  66. package/lib/{Katex-ByL9snce.js → Katex-bIgoenn_.js} +243 -262
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +5 -4
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +23 -34
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
  74. package/lib/{LinkEditBlock-Ckih17pU.js → LinkEditBlock-D_cF9fnc.js} +324 -381
  75. package/lib/MarkdownPaste.cjs +58 -0
  76. package/lib/MarkdownPaste.js +1656 -0
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +22 -17
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +125 -154
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +28 -40
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +13 -16
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +114 -186
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +15 -14
  89. package/lib/SlashCommandNodeView-Ba03hlVZ.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-B2g1MbgN.js → SlashCommandNodeView-cg0x3NRF.js} +72 -79
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +12 -15
  93. package/lib/{Table-BEwrZVup.js → Table-KqLiT5wG.js} +85 -125
  94. package/lib/Table-ddU2LSc6.cjs +9 -0
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +18 -21
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +65 -78
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +51 -77
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +7 -10
  105. package/lib/Twitter-BIiR78Jh.cjs +1 -0
  106. package/lib/{Twitter-4U_ZBhpv.js → Twitter-C1Lzqc7u.js} +567 -599
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +4 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +5 -270
  111. package/lib/bubble.cjs +6 -4
  112. package/lib/bubble.js +3719 -3039
  113. package/lib/clsx-BWE7vnna.cjs +33 -0
  114. package/lib/clsx-eGVyq7ot.js +1062 -0
  115. package/lib/components/ActionButton.d.ts +2 -2
  116. package/lib/components/ActionMenuButton.d.ts +1 -1
  117. package/lib/components/Bubble/formatBubble.d.ts +5 -5
  118. package/lib/components/ReactBus.d.ts +11 -0
  119. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
  120. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
  121. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
  122. package/lib/components/ui/checkbox.d.ts +1 -1
  123. package/lib/components/ui/dialog.d.ts +1 -1
  124. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  125. package/lib/components/ui/emoji-picker.d.ts +1 -1
  126. package/lib/components/ui/label.d.ts +1 -1
  127. package/lib/components/ui/popover.d.ts +1 -1
  128. package/lib/components/ui/select.d.ts +1 -1
  129. package/lib/components/ui/separator.d.ts +1 -1
  130. package/lib/components/ui/switch.d.ts +1 -1
  131. package/lib/components/ui/tabs.d.ts +1 -1
  132. package/lib/components/ui/toast.d.ts +1 -1
  133. package/lib/components/ui/toggle.d.ts +1 -1
  134. package/lib/components/ui/tooltip.d.ts +1 -1
  135. package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
  136. package/lib/{dropdown-menu-CW3Kthwy.js → dropdown-menu-CexIkt_V.js} +8 -8
  137. package/lib/{dropdown-menu-eUeBXQeA.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
  138. package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
  139. package/lib/extensions/Bold/Bold.d.ts +1 -1
  140. package/lib/extensions/Code/Code.d.ts +1 -1
  141. package/lib/extensions/CodeView/CodeView.d.ts +2 -2
  142. package/lib/extensions/Heading/Heading.d.ts +1 -1
  143. package/lib/extensions/Highlight/Highlight.d.ts +1 -1
  144. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
  145. package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
  146. package/lib/extensions/Italic/Italic.d.ts +1 -1
  147. package/lib/extensions/Link/Link.d.ts +1 -1
  148. package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
  149. package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
  150. package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
  151. package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
  152. package/lib/extensions/Strike/Strike.d.ts +1 -1
  153. package/lib/extensions/Table/Table.d.ts +1 -1
  154. package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
  155. package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
  156. package/lib/index-BUTn2LY6.cjs +1 -0
  157. package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
  158. package/lib/{index-CpTykZBR.js → index-BnW6t8z6.js} +23 -23
  159. package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
  160. package/lib/index-BtxvYLJ1.cjs +12 -0
  161. package/lib/{index-DR5tIdL7.js → index-C6xmkxrQ.js} +232 -217
  162. package/lib/index-CJ9pyCM4.cjs +1 -0
  163. package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
  164. package/lib/index-DHUN85fV.js +4855 -0
  165. package/lib/index-DUpSE1Gb.cjs +1 -0
  166. package/lib/index-D_8P0LE5.js +1362 -0
  167. package/lib/{index-4bHF5ovf.js → index-RIXs7STX.js} +1 -1
  168. package/lib/index-mfGK4pFo.js +6469 -0
  169. package/lib/index-zig3Dj7A.cjs +22 -0
  170. package/lib/index.cjs +3 -3
  171. package/lib/index.js +60 -72
  172. package/lib/locale-bundle.cjs +1 -1
  173. package/lib/locale-bundle.js +1 -1
  174. package/lib/plugins/image-upload.d.ts +1 -1
  175. package/lib/popover-BYSZ3zBi.js +24 -0
  176. package/lib/popover-BcHDZqBt.cjs +1 -0
  177. package/lib/{renderNodeView-CSazLrKF.js → renderNodeView-BrM5kUj_.js} +2 -2
  178. package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
  179. package/lib/{select-F0ZZ3VZB.js → select-C5SHDLFj.js} +8 -5
  180. package/lib/{select-Doa_-jkZ.cjs → select-DHjzKkcu.cjs} +1 -1
  181. package/lib/separator-BmixLrnJ.cjs +1 -0
  182. package/lib/separator-CFKVxAea.js +293 -0
  183. package/lib/store/editor.d.ts +1 -1
  184. package/lib/store/store.d.ts +2 -22
  185. package/lib/style.css +1 -1
  186. package/lib/{textarea-BAolHF_W.cjs → textarea-CasDcv3u.cjs} +1 -1
  187. package/lib/{textarea-tOsPnxHf.js → textarea-DNLrJoRl.js} +1 -1
  188. package/lib/theme.js +1 -1
  189. package/lib/types.d.ts +3 -3
  190. package/lib/updatePosition-CBRjbQMH.js +16 -0
  191. package/lib/updatePosition-CfmY5Trk.cjs +1 -0
  192. package/lib/utils/checkIsVideoUrl.d.ts +1 -0
  193. package/lib/utils/columns.d.ts +1 -1
  194. package/lib/utils/customEvents/events.constant.d.ts +1 -0
  195. package/lib/utils/mitt.d.ts +6 -3
  196. package/lib/utils/pdf.d.ts +1 -1
  197. package/lib/utils/utils.d.ts +1 -1
  198. package/package.json +262 -247
  199. package/lib/ActionMenuButton-BYu0NyVo.cjs +0 -1
  200. package/lib/Drawer-CbOJ1Igo.js +0 -1379
  201. package/lib/Drawer-DNaDMoAk.cjs +0 -1
  202. package/lib/Excalidraw-DnHTVOj8.js +0 -355
  203. package/lib/Excalidraw-DxfO1lQ_.cjs +0 -1
  204. package/lib/Icon-C0TJMAOm.js +0 -12
  205. package/lib/Icon-DzK0_ztP.cjs +0 -1
  206. package/lib/Iframe-BSNCsofW.cjs +0 -1
  207. package/lib/Image-BZEFuS0P.js +0 -925
  208. package/lib/Image-iKsGKjvg.cjs +0 -1
  209. package/lib/Indent-Bou16OcB.cjs +0 -1
  210. package/lib/Katex-BqDocr3a.cjs +0 -4
  211. package/lib/LinkEditBlock-B0I0EUrt.cjs +0 -5
  212. package/lib/SlashCommandNodeView-BEJhEzba.cjs +0 -1
  213. package/lib/Table-BclWwp6P.cjs +0 -9
  214. package/lib/Twitter-Dtq6PEMC.cjs +0 -1
  215. package/lib/button-Bwn6gUuS.js +0 -43
  216. package/lib/button-CqJztfH2.cjs +0 -1
  217. package/lib/checkbox-BAzbZY2Y.cjs +0 -1
  218. package/lib/checkbox-B_rpz5Xq.js +0 -27
  219. package/lib/clsx-CXbNJWDD.cjs +0 -54
  220. package/lib/clsx-DSzxBzvL.js +0 -7391
  221. package/lib/dialog-CJvpoeMm.js +0 -101
  222. package/lib/dialog-CWYTvz5J.cjs +0 -1
  223. package/lib/events.constant-Dq21NPdV.cjs +0 -1
  224. package/lib/events.constant-do95b767.js +0 -21
  225. package/lib/extensions/Image/store.d.ts +0 -4
  226. package/lib/extensions/Video/store.d.ts +0 -4
  227. package/lib/file-BLas99n7.js +0 -43
  228. package/lib/file-i7e4nQY2.cjs +0 -1
  229. package/lib/index-BCzvbrf5.cjs +0 -12
  230. package/lib/index-CL7JP-Xz.js +0 -426
  231. package/lib/index-CjhjjJsN.cjs +0 -1
  232. package/lib/index-Cn-t3Zxw.cjs +0 -1
  233. package/lib/index-Cs6cp0Y6.cjs +0 -1
  234. package/lib/index-D8li6EQ4.js +0 -1351
  235. package/lib/index-DoiuU6VA.js +0 -2315
  236. package/lib/index-VhKd73hZ.cjs +0 -1
  237. package/lib/input-B1egKb-t.js +0 -21
  238. package/lib/input-ZGRt7lWR.cjs +0 -1
  239. package/lib/isNumber-BTYSVlKo.cjs +0 -1
  240. package/lib/isNumber-ClwLypY2.js +0 -15
  241. package/lib/label-Cjrzc5H2.js +0 -19
  242. package/lib/label-tzSPdqui.cjs +0 -1
  243. package/lib/popover-C6Cya3Cz.cjs +0 -1
  244. package/lib/popover-CeY3RbI5.js +0 -24
  245. package/lib/separator-CUh5Y7Rh.cjs +0 -1
  246. package/lib/separator-Cjn4YH8a.js +0 -329
  247. package/lib/store/fast-context.d.ts +0 -7
  248. package/lib/store-BsJz5QRC.js +0 -10
  249. package/lib/store-DjkMIIEN.cjs +0 -1
  250. package/lib/tabs-BP8ypR_m.cjs +0 -1
  251. package/lib/tabs-CBDjOLl_.js +0 -46
  252. package/lib/throttle-D040PfWL.js +0 -249
  253. package/lib/throttle-gTTvqDTW.cjs +0 -1
  254. package/lib/toggle-C_SSvDRy.cjs +0 -1
  255. package/lib/toggle-DEerYRil.js +0 -99
  256. package/lib/tooltip-BJIvosho.js +0 -24
  257. package/lib/tooltip-FS1rsvd3.cjs +0 -1
  258. package/lib/updatePosition-CDK7OR0i.js +0 -16
  259. package/lib/updatePosition-Cjuj2E26.cjs +0 -1
  260. package/lib/useButtonProps-CtZCbMQu.js +0 -136
  261. package/lib/useButtonProps-Cz4W5dC8.cjs +0 -1
  262. package/lib/utils/_event.d.ts +0 -13
  263. package/lib/utils/customEvents/customEvents.d.ts +0 -3
@@ -1 +0,0 @@
1
- "use strict";const J=require("./clsx-CXbNJWDD.cjs"),K=require("./throttle-gTTvqDTW.cjs"),i=require("react/jsx-runtime"),c=require("react"),k=require("./index-BsFvo9PG.cjs"),V=require("./isNumber-BTYSVlKo.cjs"),ue=require("./toggle-C_SSvDRy.cjs");require("./index-Cn-t3Zxw.cjs");require("./theme.cjs");const O=require("./dialog-CWYTvz5J.cjs"),de=require("react-image-crop"),P=require("./button-CqJztfH2.cjs"),q=require("./useButtonProps-Cz4W5dC8.cjs"),ne=require("./file-i7e4nQY2.cjs"),X=require("./Icon-DzK0_ztP.cjs"),he=require("./store-DjkMIIEN.cjs"),ie=require("./events.constant-Dq21NPdV.cjs"),U=require("./tabs-BP8ypR_m.cjs"),ge=require("./checkbox-BAzbZY2Y.cjs"),ae=require("./label-tzSPdqui.cjs"),re=require("./input-ZGRt7lWR.cjs");function fe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const se=fe(c),me=1,pe=1e6;let Z=0;function xe(){return Z=(Z+1)%Number.MAX_SAFE_INTEGER,Z.toString()}const Q=new Map;function le(e){if(Q.has(e))return;const t=setTimeout(()=>{Q.delete(e),B({type:"REMOVE_TOAST",toastId:e})},pe);Q.set(e,t)}function be(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,me)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?le(n):e.toasts.forEach(r=>{le(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}}const $=[];let Y={toasts:[]};function B(e){Y=be(Y,e),$.forEach(t=>{t(Y)})}function Te({...e}){const t=xe(),n=u=>B({type:"UPDATE_TOAST",toast:{...u,id:t}}),r=()=>B({type:"DISMISS_TOAST",toastId:t});return B({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:u=>{u||r()}}}),{id:t,dismiss:r,update:n}}function ee(){const[e,t]=se.useState(Y);return se.useEffect(()=>($.push(t),()=>{const n=$.indexOf(t);n>-1&&$.splice(n,1)}),[e]),{...e,toast:Te,dismiss:n=>B({type:"DISMISS_TOAST",toastId:n})}}const H={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function Ie(e){var F,h,M;const[t,n]=c.useState({width:k.IMAGE_MAX_SIZE,height:k.IMAGE_MAX_SIZE}),[r,u]=c.useState({width:0,height:0}),[g]=c.useState([H.TOP_LEFT,H.TOP_RIGHT,H.BOTTOM_LEFT,H.BOTTOM_RIGHT]),[p,S]=c.useState(!1),[f,b]=c.useState({x:0,y:0,w:0,h:0,dir:""}),{align:j,inline:w}=(F=e==null?void 0:e.node)==null?void 0:F.attrs,C=w&&(j==="left"||j==="right"),_=c.useMemo(()=>{var te;const{src:s,alt:T,width:a,height:l,flipX:m,flipY:o}=(te=e==null?void 0:e.node)==null?void 0:te.attrs,I=V.isNumber(a)?`${a}px`:a,y=V.isNumber(l)?`${l}px`:l,W=[];m&&W.push("rotateX(180deg)"),o&&W.push("rotateY(180deg)");const ce=W.join(" ");return{src:s||void 0,alt:T||void 0,style:{width:I||void 0,height:y||void 0,transform:ce||"none",...C?{float:j}:{}}}},[(h=e==null?void 0:e.node)==null?void 0:h.attrs]),D=c.useMemo(()=>{const{style:{width:s}}=_;return{width:s==="100%"?s:void 0}},[_]);function L(s){u({width:s.target.width,height:s.target.height})}function v(){const{editor:s,getPos:T}=e;s.commands.setNodeSelection(T())}const E=c.useCallback(K.throttle(()=>{const{editor:s}=e,{width:T}=getComputedStyle(s.view.dom);n(a=>({...a,width:Number.parseInt(T,10)}))},k.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function N(s,T){s.preventDefault(),s.stopPropagation();const a=r.width,l=r.height,m=a/l;let o=Number(e.node.attrs.width),I=Number(e.node.attrs.height);const y=t.width;o&&!I?(o=o>y?y:o,I=Math.round(o/m)):I&&!o?(o=Math.round(I*m),o=o>y?y:o):!o&&!I?(o=a>y?y:a,I=Math.round(o/m)):o=o>y?y:o,S(!0),b({x:s.clientX,y:s.clientY,w:o,h:I,dir:T})}const A=c.useCallback(K.throttle(s=>{if(s.preventDefault(),s.stopPropagation(),!p)return;const{x:T,w:a,dir:l}=f,m=(s.clientX-T)*(/l/.test(l)?-1:1),o=V.clamp(a+m,k.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:o,height:null})},k.IMAGE_THROTTLE_WAIT_TIME),[p,f,t,e.updateAttributes]),x=c.useCallback(s=>{s.preventDefault(),s.stopPropagation(),p&&(b({x:0,y:0,w:0,h:0,dir:""}),S(!1),v())},[p,v]),d=c.useCallback(()=>{document==null||document.addEventListener("mousemove",A,!0),document==null||document.addEventListener("mouseup",x,!0)},[A,x]),R=c.useCallback(()=>{document==null||document.removeEventListener("mousemove",A,!0),document==null||document.removeEventListener("mouseup",x,!0)},[A,x]);c.useEffect(()=>(p?d():R(),()=>{R()}),[p,d,R]);const z=c.useMemo(()=>new ResizeObserver(()=>E()),[E]);return c.useEffect(()=>(z.observe(e.editor.view.dom),()=>{z.disconnect()}),[e.editor.view.dom,z]),i.jsx(J.NodeViewWrapper,{as:w?"span":"div",className:"image-view",style:{float:C?j:void 0,margin:C?j==="left"?"1em 1em 1em 0":"1em 0 1em 1em":void 0,display:w?"inline":"block",textAlign:C?void 0:j,width:((M=_.style)==null?void 0:M.width)??"auto",...C?{}:D},children:i.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:D,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${p?"image-view__body--resizing":""}`,children:[i.jsx("img",{alt:_.alt,className:"image-view__body__image block",height:"auto",onClick:v,onLoad:L,src:_.src,style:_.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||p)&&i.jsx("div",{className:"image-resizer",children:g==null?void 0:g.map(s=>i.jsx("span",{className:`image-resizer__handler image-resizer__handler--${s}`,onMouseDown:T=>N(T,s)},`image-dir-${s}`))})]})})}function ye(e,t){const n=e.type,r=e.name.toLowerCase(),u=r.split(".").pop();if(!u)return!1;const p=n||{heif:"image/heif",heic:"image/heic",dng:"image/x-adobe-dng",cr2:"image/x-canon-cr2",nef:"image/x-nikon-nef",arw:"image/x-sony-arw",raf:"image/x-fuji-raf",orf:"image/x-olympus-orf"}[u];return t.some(S=>{if(S.startsWith("."))return r.endsWith(S);if(S.endsWith("/*")){const f=S.split("/")[0];return p==null?void 0:p.startsWith(f+"/")}return p===S})}function oe(e,t){const{acceptMimes:n,maxSize:r,t:u,toast:g}=t,p=[];return(Array.isArray(e)?e:Object.values(e)).forEach(f=>{if(!ye(f,n)){t.onError?t.onError({type:"type",message:u("editor.upload.fileTypeNotSupported",{fileName:f.name}),file:f}):g({variant:"default",title:u("editor.upload.fileTypeNotSupported",{fileName:f.name})});return}if(f.size>r){const b=(r/1024/1024).toFixed(2);t.onError?t.onError({type:"size",message:u("editor.upload.fileSizeTooBig",{fileName:f.name,size:b}),file:f}):g({variant:"default",title:u("editor.upload.fileSizeTooBig",{fileName:f.name,size:b})});return}p.push(f)}),p}function Se({editor:e,imageInline:t,onClose:n,disabled:r,alt:u}){var s,T;const{t:g}=k.useLocale(),{toast:p}=ee(),[S,f]=c.useState(!1),[b,j]=c.useState(!1),w=c.useRef(null),[C,_]=c.useState(),[D,L]=c.useState(""),v=c.useRef(null),[E,N]=c.useState({src:"",file:null}),A=q.useExtension(G.name),x=c.useMemo(()=>(A==null?void 0:A.options)??{},[A]);function d(a){if(w.current&&a.width&&a.height){const l=R(w.current,a);L(l)}}function R(a,l){const m=document.createElement("canvas"),o=a.naturalWidth/a.width,I=a.naturalHeight/a.height;m.width=l.width*o,m.height=l.height*I;const y=m.getContext("2d");return y&&(y.imageSmoothingEnabled=!1,y.drawImage(a,l.x*o,l.y*I,l.width*o,l.height*I,0,0,l.width*o,l.height*I)),m.toDataURL("image/png",1)}const z=c.useCallback(async()=>{var a;if(!b){j(!0);try{const l=ne.dataURLtoFile(D,((a=E==null?void 0:E.file)==null?void 0:a.name)||"image.png");let m="";x.upload?m=await x.upload(l):m=URL.createObjectURL(l),e.chain().focus().setImageInline({src:m,inline:t,alt:u}).run(),f(!1),N({src:"",file:null}),M(),n()}catch(l){console.error("Error cropping image",l)}finally{j(!1)}}},[D,e,t,b,n,(s=E==null?void 0:E.file)==null?void 0:s.name,x]);function F(a){var l;a.preventDefault(),(l=v.current)==null||l.click()}const h=async a=>{var y;const l=(y=a==null?void 0:a.target)==null?void 0:y.files;if(!e||e.isDestroyed||l.length===0){a.target.value="";return}const m=oe(l,{acceptMimes:x==null?void 0:x.acceptMimes,maxSize:x==null?void 0:x.maxSize,t:g,toast:p,onError:x.onError});if(m.length<=0){a.target.value="";return}const o=m[0],I=await ne.readImageAsBase64(o);f(!0),N({src:I.src,file:o})},M=()=>{v.current&&(v.current.value="")};return i.jsxs(i.Fragment,{children:[i.jsx(P.Button,{className:"richtext-mt-1 richtext-w-full",disabled:r,onClick:F,size:"sm",children:g("editor.image.dialog.tab.uploadCrop")}),i.jsxs(O.Dialog,{open:S,onOpenChange:a=>{f(a),a||(N({src:"",file:null}),M())},children:[i.jsx(O.DialogTrigger,{}),i.jsxs(O.DialogContent,{children:[i.jsx(O.DialogTitle,{children:g("editor.image.dialog.tab.uploadCrop")}),i.jsx("div",{children:E.src&&i.jsx(de,{className:"richtext-w-full",crop:C,onChange:a=>_(a),onComplete:a=>d(a),children:i.jsx("img",{alt:"Crop me",ref:w,src:E.src})})}),i.jsxs(O.DialogFooter,{children:[i.jsxs(P.Button,{disabled:b,onClick:()=>{f(!1),N({src:"",file:null}),M()},children:[g("editor.imageUpload.cancel"),i.jsx(X.IconComponent,{className:"richtext-ml-1",name:"Trash2"})]}),i.jsx(P.Button,{className:"richtext-w-fit",disabled:b||!C,onClick:z,children:b?i.jsxs(i.Fragment,{children:[g("editor.imageUpload.uploading"),i.jsx(X.IconComponent,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):i.jsxs(i.Fragment,{children:[g("editor.imageUpload.crop"),i.jsx(X.IconComponent,{className:"richtext-ml-1",name:"Crop"})]})})]})]})]}),i.jsx("input",{accept:((T=x==null?void 0:x.acceptMimes)==null?void 0:T.join(","))||"image/*",multiple:!1,onChange:h,ref:v,style:{display:"none"},type:"file"})]})}function we(){const{t:e}=k.useLocale(),{toast:t}=ee(),n=q.useEditorInstance(),r=q.useButtonProps(G.name),{icon:u,tooltip:g}=(r==null?void 0:r.componentProps)??{},{editorDisabled:p}=q.useToggleActive(),[S,f]=c.useState(!1),[b,j]=c.useState(!1),w=q.useExtension(G.name),C=h=>{f(h.detail)},[_,D]=c.useState(""),[L,v]=c.useState(""),E=c.useRef(null),N=(w==null?void 0:w.options.defaultInline)||!1,[A,x]=c.useState(N),d=c.useMemo(()=>w==null?void 0:w.options,[w]);c.useEffect(()=>{const h=ie.listenEvent(ie.EVENTS.UPLOAD_IMAGE(n.id),C);return()=>{h()}},[]);async function R(h){var T;const M=(T=h==null?void 0:h.target)==null?void 0:T.files;if(!n||n.isDestroyed||M.length===0||b){h.target.value="";return}const s=oe(M,{acceptMimes:d==null?void 0:d.acceptMimes,maxSize:d==null?void 0:d.maxSize,t:e,toast:t,onError:d.onError});if(s.length<=0){h.target.value="";return}j(!0);try{if(d!=null&&d.multiple){const a=s.map(async m=>{let o="";return d.upload?o=await d.upload(m):o=URL.createObjectURL(m),o});(await Promise.all(a)).forEach(m=>{n.chain().focus().setImageInline({src:m,inline:A,alt:L}).run()})}else{const a=s[0];let l="";d.upload?l=await d.upload(a):l=URL.createObjectURL(a),n.chain().focus().setImageInline({src:l,inline:A,alt:L}).run()}f(!1),v(""),x(N)}catch(a){console.error("Error uploading image",a),d.onError?d.onError({type:"upload",message:e("editor.upload.error")}):t({variant:"destructive",title:e("editor.upload.error")})}finally{j(!1),h.target.value=""}}function z(h){h.preventDefault(),h.stopPropagation(),n.chain().focus().setImageInline({src:_,inline:A,alt:L}).run(),f(!1),x(N),D(""),v("")}function F(h){var M;h.preventDefault(),(M=E.current)==null||M.click()}return r?i.jsxs(O.Dialog,{onOpenChange:f,open:S,children:[i.jsx(O.DialogTrigger,{asChild:!0,children:i.jsx(ue.ActionButton,{disabled:p,icon:u,tooltip:g,action:()=>{p||f(!0)}})}),i.jsxs(O.DialogContent,{children:[i.jsx(O.DialogTitle,{children:e("editor.image.dialog.title")}),i.jsxs(U.Tabs,{activationMode:"manual",defaultValue:d.resourceImage==="both"||d.resourceImage==="upload"?"upload":"link",children:[d.resourceImage==="both"&&i.jsxs(U.TabsList,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[i.jsx(U.TabsTrigger,{value:"upload",children:e("editor.image.dialog.tab.upload")}),i.jsx(U.TabsTrigger,{value:"link",children:e("editor.image.dialog.tab.url")})]}),i.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[i.jsx(ge.Checkbox,{checked:A,onCheckedChange:h=>{x(h)}}),i.jsx(ae.Label,{children:e("editor.link.dialog.inline")})]}),d.enableAlt&&i.jsxs("div",{className:"richtext-my-[10px] ",children:[i.jsx(ae.Label,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),i.jsx(re.Input,{onChange:h=>v(h.target.value),required:!0,type:"text",value:L})]}),i.jsxs(U.TabsContent,{value:"upload",children:[i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(P.Button,{className:"richtext-mt-1 richtext-w-full",disabled:b,onClick:F,size:"sm",children:b?i.jsxs(i.Fragment,{children:[e("editor.imageUpload.uploading"),i.jsx(X.IconComponent,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):e("editor.image.dialog.tab.upload")}),i.jsx(Se,{alt:L,disabled:b,editor:n,imageInline:A,onClose:()=>{he.actionDialogImage.setOpen(n.id,!1),v("")}})]}),i.jsx("input",{accept:d.acceptMimes.join(",")||"image/*",multiple:d.multiple,onChange:R,ref:E,style:{display:"none"},type:"file"})]}),i.jsx(U.TabsContent,{value:"link",children:i.jsx("form",{onSubmit:z,children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(re.Input,{autoFocus:!0,onChange:h=>D(h.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:_}),i.jsx(P.Button,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})]}):i.jsx(i.Fragment,{})}const Ae={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,multiple:!0,resourceImage:"both",defaultInline:!1,enableAlt:!0},G=K.index_default.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...Ae,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:n,t:r})=>{var u,g;return{componentProps:{action:()=>!0,upload:n.options.upload,disabled:!((g=(u=t.can()).setImage)!=null&&g.call(u,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const n=t.style.width||t.getAttribute("width")||null;return n?Number.parseInt(n,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})},alt:{default:"",parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>({alt:t.alt})}}},addNodeView(){return J.ReactNodeViewRenderer(Ie)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:n})=>n.insertContent({type:this.name,attrs:{...t,inline:t.inline??this.options.defaultInline}}),updateImage:t=>({commands:n})=>n.updateAttributes(this.name,t),setAlignImage:t=>({commands:n})=>n.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:n,align:r,inline:u}=e,g=u&&(r==="left"||r==="right"),p=t||n?`transform: rotateX(${t?"180":"0"}deg) rotateY(${n?"180":"0"}deg);`:"",S=g?"":`text-align: ${r};`,j=`${g?`float: ${r};`:""}${g?r==="left"?"margin: 1em 1em 1em 0;":"margin: 1em 0 1em 1em;":""}${p}`;return[u?"span":"div",{style:S,class:"image"},["img",J.mergeAttributes({height:"auto",style:j},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var g;const t=e==null?void 0:e.parentElement,n=e==null?void 0:e.getAttribute("width"),r=(e==null?void 0:e.getAttribute("flipx"))||!1,u=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:n?Number.parseInt(n,10):null,align:(e==null?void 0:e.getAttribute("align"))||((g=t==null?void 0:t.style)==null?void 0:g.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:r==="true",flipY:u==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),n=t==null?void 0:t.getAttribute("width"),r=(t==null?void 0:t.getAttribute("flipx"))||!1,u=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:n?Number.parseInt(n,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:r==="true",flipY:u==="true"}}},{tag:'img[src]:not([src^="data:"])'}]}});exports.Image=G;exports.RichTextImage=we;exports.useToast=ee;
@@ -1 +0,0 @@
1
- "use strict";const h=require("./clsx-CXbNJWDD.cjs"),m=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),l=require("./toggle-C_SSvDRy.cjs");require("react");require("./index-Cn-t3Zxw.cjs");require("./theme.cjs");const p=require("./useButtonProps-Cz4W5dC8.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function T(t,e,n){return t<e?e:t>n?n:t}function g(t,e,n,o){const{doc:i,selection:r}=t;if(!i||!r||!(r instanceof m.TextSelection||r instanceof m.AllSelection))return t;const{from:s,to:u}=r;return i.nodesBetween(s,u,(d,I)=>{const b=d.type;return n.includes(b.name)?(t=y(t,I,e),!1):!h.isList(d.type.name,o.extensionManager.extensions)}),t}function y(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const s=T((o.attrs.indent||0)+n,0,7);if(s===o.attrs.indent)return t;const u={...o.attrs,indent:s};return t.setNodeMarkup(e,o.type,u,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:i})=>{const{selection:r}=n;let{tr:s}=n;return s=s.setSelection(r),s=g(s,t,e,i),s.docChanged?(o&&o(s),!0):!1}}function A(){const t=p.useButtonProps(x.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=p.useToggleActive(),i=()=>{o||e!=null&&e.action&&(e==null||e.action())},r=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(l.ActionButton,{action:i,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(l.ActionButton,{action:r,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const x=h.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var i,r;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((r=o.options.shortcutKeys)==null?void 0:r[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=x;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=y;
@@ -1,4 +0,0 @@
1
- "use strict";const Dr=require("./clsx-CXbNJWDD.cjs"),Y=require("react/jsx-runtime"),ur=require("react"),Za=require("katex"),Ro=require("./toggle-C_SSvDRy.cjs");require("./index-Cn-t3Zxw.cjs");require("./theme.cjs");const Tr=require("./dialog-CWYTvz5J.cjs"),ln=require("./textarea-BAolHF_W.cjs"),ae=require("./useButtonProps-Cz4W5dC8.cjs"),$o=require("./index-BsFvo9PG.cjs"),cn=require("./label-tzSPdqui.cjs"),xo=require("./button-CqJztfH2.cjs");var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Bo(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var n=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var t=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(n,a,t.get?t:{enumerable:!0,get:function(){return r[a]}})}),n}var oe,pn;function ro(){if(pn)return oe;pn=1;var r=Object.prototype.toString;return oe=function(n){var a=r.call(n),t=a==="[object Arguments]";return t||(t=a!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&r.call(n.callee)==="[object Function]"),t},oe}var ie,yn;function jo(){if(yn)return ie;yn=1;var r;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=ro(),t=Object.prototype.propertyIsEnumerable,f=!t.call({toString:null},"toString"),i=t.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(y){var h=y.constructor;return h&&h.prototype===y},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},v=(function(){if(typeof window>"u")return!1;for(var y in window)try{if(!c["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{u(window[y])}catch{return!0}}catch{return!0}return!1})(),p=function(y){if(typeof window>"u"||!v)return u(y);try{return u(y)}catch{return!1}};r=function(h){var S=h!==null&&typeof h=="object",R=n.call(h)==="[object Function]",w=a(h),q=S&&n.call(h)==="[object String]",O=[];if(!S&&!R&&!w)throw new TypeError("Object.keys called on a non-object");var m=i&&R;if(q&&h.length>0&&!e.call(h,0))for(var j=0;j<h.length;++j)O.push(String(j));if(w&&h.length>0)for(var Q=0;Q<h.length;++Q)O.push(String(Q));else for(var H in h)!(m&&H==="prototype")&&e.call(h,H)&&O.push(String(H));if(f)for(var F=p(h),D=0;D<o.length;++D)!(F&&o[D]==="constructor")&&e.call(h,o[D])&&O.push(o[D]);return O}}return ie=r,ie}var ue,vn;function Lt(){if(vn)return ue;vn=1;var r=Array.prototype.slice,e=ro(),n=Object.keys,a=n?function(i){return n(i)}:jo(),t=Object.keys;return a.shim=function(){if(Object.keys){var i=(function(){var o=Object.keys(arguments);return o&&o.length===arguments.length})(1,2);i||(Object.keys=function(u){return e(u)?t(r.call(u)):t(u)})}else Object.keys=a;return Object.keys||a},ue=a,ue}var fe,gn;function zr(){if(gn)return fe;gn=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return fe=r,fe}var se,hn;function Ut(){return hn||(hn=1,se=SyntaxError),se}var le,dn;function nr(){return dn||(dn=1,le=TypeError),le}var ce,mn;function Mo(){return mn||(mn=1,ce=Object.getOwnPropertyDescriptor),ce}var pe,Sn;function wr(){if(Sn)return pe;Sn=1;var r=Mo();if(r)try{r([],"length")}catch{r=null}return pe=r,pe}var ye,bn;function Ht(){if(bn)return ye;bn=1;var r=zr(),e=Ut(),n=nr(),a=wr();return ye=function(f,i,o){if(!f||typeof f!="object"&&typeof f!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,y=!!a&&a(f,i);if(r)r(f,i,{configurable:v===null&&y?y.configurable:!v,enumerable:u===null&&y?y.enumerable:!u,value:o,writable:c===null&&y?y.writable:!c});else if(p||!u&&!c&&!v)f[i]=o;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ye}var ve,An;function Gt(){if(An)return ve;An=1;var r=zr(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},ve=e,ve}var ge,On;function qr(){if(On)return ge;On=1;var r=Lt(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n=Object.prototype.toString,a=Array.prototype.concat,t=Ht(),f=function(c){return typeof c=="function"&&n.call(c)==="[object Function]"},i=Gt()(),o=function(c,v,p,y){if(v in c){if(y===!0){if(c[v]===p)return}else if(!f(y)||!y())return}i?t(c,v,p,!0):t(c,v,p)},u=function(c,v){var p=arguments.length>2?arguments[2]:{},y=r(v);e&&(y=a.call(y,Object.getOwnPropertySymbols(v)));for(var h=0;h<y.length;h+=1)o(c,y[h],v[y[h]],p[y[h]])};return u.supportsDescriptors=!!i,ge=u,ge}var he={exports:{}},de,wn;function zt(){return wn||(wn=1,de=Object),de}var me,qn;function eo(){return qn||(qn=1,me=Error),me}var Se,Pn;function To(){return Pn||(Pn=1,Se=EvalError),Se}var be,In;function Co(){return In||(In=1,be=RangeError),be}var Ae,Rn;function Do(){return Rn||(Rn=1,Ae=ReferenceError),Ae}var Oe,$n;function Fo(){return $n||($n=1,Oe=URIError),Oe}var we,xn;function _o(){return xn||(xn=1,we=Math.abs),we}var qe,En;function No(){return En||(En=1,qe=Math.floor),qe}var Pe,Bn;function Wo(){return Bn||(Bn=1,Pe=Math.max),Pe}var Ie,jn;function ko(){return jn||(jn=1,Ie=Math.min),Ie}var Re,Mn;function Lo(){return Mn||(Mn=1,Re=Math.pow),Re}var $e,Tn;function Uo(){return Tn||(Tn=1,$e=Math.round),$e}var xe,Cn;function Ho(){return Cn||(Cn=1,xe=Number.isNaN||function(e){return e!==e}),xe}var Ee,Dn;function Go(){if(Dn)return Ee;Dn=1;var r=Ho();return Ee=function(n){return r(n)||n===0?n:n<0?-1:1},Ee}var Be,Fn;function Vr(){return Fn||(Fn=1,Be=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),a=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var t=42;e[n]=t;for(var f in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,n);if(o.value!==t||o.enumerable!==!0)return!1}return!0}),Be}var je,_n;function Vt(){if(_n)return je;_n=1;var r=typeof Symbol<"u"&&Symbol,e=Vr();return je=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},je}var Me,Nn;function to(){return Nn||(Nn=1,Me=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Me}var Te,Wn;function no(){if(Wn)return Te;Wn=1;var r=zt();return Te=r.getPrototypeOf||null,Te}var Ce,kn;function zo(){if(kn)return Ce;kn=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,a="[object Function]",t=function(u,c){for(var v=[],p=0;p<u.length;p+=1)v[p]=u[p];for(var y=0;y<c.length;y+=1)v[y+u.length]=c[y];return v},f=function(u,c){for(var v=[],p=c,y=0;p<u.length;p+=1,y+=1)v[y]=u[p];return v},i=function(o,u){for(var c="",v=0;v<o.length;v+=1)c+=o[v],v+1<o.length&&(c+=u);return c};return Ce=function(u){var c=this;if(typeof c!="function"||e.apply(c)!==a)throw new TypeError(r+c);for(var v=f(arguments,1),p,y=function(){if(this instanceof p){var q=c.apply(this,t(v,arguments));return Object(q)===q?q:this}return c.apply(u,t(v,arguments))},h=n(0,c.length-v.length),S=[],R=0;R<h;R++)S[R]="$"+R;if(p=Function("binder","return function ("+i(S,",")+"){ return binder.apply(this,arguments); }")(y),c.prototype){var w=function(){};w.prototype=c.prototype,p.prototype=new w,w.prototype=null}return p},Ce}var De,Ln;function Fr(){if(Ln)return De;Ln=1;var r=zo();return De=Function.prototype.bind||r,De}var Fe,Un;function Kt(){return Un||(Un=1,Fe=Function.prototype.call),Fe}var _e,Hn;function Jt(){return Hn||(Hn=1,_e=Function.prototype.apply),_e}var Ne,Gn;function Vo(){return Gn||(Gn=1,Ne=typeof Reflect<"u"&&Reflect&&Reflect.apply),Ne}var We,zn;function ao(){if(zn)return We;zn=1;var r=Fr(),e=Jt(),n=Kt(),a=Vo();return We=a||r.call(n,e),We}var ke,Vn;function Yt(){if(Vn)return ke;Vn=1;var r=Fr(),e=nr(),n=Kt(),a=ao();return ke=function(f){if(f.length<1||typeof f[0]!="function")throw new e("a function is required");return a(r,n,f)},ke}var Le,Kn;function Ko(){if(Kn)return Le;Kn=1;var r=Yt(),e=wr(),n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var a=!!n&&e&&e(Object.prototype,"__proto__"),t=Object,f=t.getPrototypeOf;return Le=a&&typeof a.get=="function"?r([a.get]):typeof f=="function"?function(o){return f(o==null?o:t(o))}:!1,Le}var Ue,Jn;function Xt(){if(Jn)return Ue;Jn=1;var r=to(),e=no(),n=Ko();return Ue=r?function(t){return r(t)}:e?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return e(t)}:n?function(t){return n(t)}:null,Ue}var He,Yn;function Qt(){if(Yn)return He;Yn=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=Fr();return He=n.call(r,e),He}var Ge,Xn;function yr(){if(Xn)return Ge;Xn=1;var r,e=zt(),n=eo(),a=To(),t=Co(),f=Do(),i=Ut(),o=nr(),u=Fo(),c=_o(),v=No(),p=Wo(),y=ko(),h=Lo(),S=Uo(),R=Go(),w=Function,q=function(T){try{return w('"use strict"; return ('+T+").constructor;")()}catch{}},O=wr(),m=zr(),j=function(){throw new o},Q=O?(function(){try{return arguments.callee,j}catch{try{return O(arguments,"callee").get}catch{return j}}})():j,H=Vt()(),F=Xt(),D=no(),P=to(),_=Jt(),L=Kt(),N={},U=typeof Uint8Array>"u"||!F?r:F(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":H&&F?F([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H&&F?F(F([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H||!F?r:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":O,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":t,"%ReferenceError%":f,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H||!F?r:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H&&F?F(""[Symbol.iterator]()):r,"%Symbol%":H?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":Q,"%TypedArray%":U,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":_,"%Object.defineProperty%":m,"%Object.getPrototypeOf%":D,"%Math.abs%":c,"%Math.floor%":v,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":h,"%Math.round%":S,"%Math.sign%":R,"%Reflect.getPrototypeOf%":P};if(F)try{null.error}catch(T){var fr=F(F(T));V["%Error.prototype%"]=fr}var Ir=function T(A){var I;if(A==="%AsyncFunction%")I=q("async function () {}");else if(A==="%GeneratorFunction%")I=q("function* () {}");else if(A==="%AsyncGeneratorFunction%")I=q("async function* () {}");else if(A==="%AsyncGenerator%"){var b=T("%AsyncGeneratorFunction%");b&&(I=b.prototype)}else if(A==="%AsyncIteratorPrototype%"){var E=T("%AsyncGenerator%");E&&F&&(I=F(E.prototype))}return V[A]=I,I},Sr={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ar=Fr(),G=Qt(),br=ar.call(L,Array.prototype.concat),Rr=ar.call(_,Array.prototype.splice),Ar=ar.call(L,String.prototype.replace),vr=ar.call(L,String.prototype.slice),g=ar.call(L,RegExp.prototype.exec),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,$=function(A){var I=vr(A,0,1),b=vr(A,-1);if(I==="%"&&b!=="%")throw new i("invalid intrinsic syntax, expected closing `%`");if(b==="%"&&I!=="%")throw new i("invalid intrinsic syntax, expected opening `%`");var E=[];return Ar(A,d,function(z,K,J,X){E[E.length]=J?Ar(X,x,"$1"):K||z}),E},M=function(A,I){var b=A,E;if(G(Sr,b)&&(E=Sr[b],b="%"+E[0]+"%"),G(V,b)){var z=V[b];if(z===N&&(z=Ir(b)),typeof z>"u"&&!I)throw new o("intrinsic "+A+" exists, but is not available. Please file an issue!");return{alias:E,name:b,value:z}}throw new i("intrinsic "+A+" does not exist!")};return Ge=function(A,I){if(typeof A!="string"||A.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof I!="boolean")throw new o('"allowMissing" argument must be a boolean');if(g(/^%?[^%]*%?$/,A)===null)throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var b=$(A),E=b.length>0?b[0]:"",z=M("%"+E+"%",I),K=z.name,J=z.value,X=!1,rr=z.alias;rr&&(E=rr[0],Rr(b,br([0,1],rr)));for(var sr=1,or=!0;sr<b.length;sr+=1){var er=b[sr],lr=vr(er,0,1),cr=vr(er,-1);if((lr==='"'||lr==="'"||lr==="`"||cr==='"'||cr==="'"||cr==="`")&&lr!==cr)throw new i("property names with quotes must have matching quotes");if((er==="constructor"||!or)&&(X=!0),E+="."+er,K="%"+E+"%",G(V,K))J=V[K];else if(J!=null){if(!(er in J)){if(!I)throw new o("base intrinsic for "+A+" exists, but the property is not available.");return}if(O&&sr+1>=b.length){var pr=O(J,er);or=!!pr,or&&"get"in pr&&!("originalValue"in pr.get)?J=pr.get:J=J[er]}else or=G(J,er),J=J[er];or&&!X&&(V[K]=J)}}return J},Ge}var ze,Qn;function Jo(){if(Qn)return ze;Qn=1;var r=yr(),e=Ht(),n=Gt()(),a=wr(),t=nr(),f=r("%Math.floor%");return ze=function(o,u){if(typeof o!="function")throw new t("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||f(u)!==u)throw new t("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],v=!0,p=!0;if("length"in o&&a){var y=a(o,"length");y&&!y.configurable&&(v=!1),y&&!y.writable&&(p=!1)}return(v||p||!c)&&(n?e(o,"length",u,!0,!0):e(o,"length",u)),o},ze}var Ve,Zn;function Yo(){if(Zn)return Ve;Zn=1;var r=Fr(),e=Jt(),n=ao();return Ve=function(){return n(r,e,arguments)},Ve}var ra;function Br(){return ra||(ra=1,(function(r){var e=Jo(),n=zr(),a=Yt(),t=Yo();r.exports=function(i){var o=a(arguments),u=i.length-(arguments.length-1);return e(o,1+(u>0?u:0),!0)},n?n(r.exports,"apply",{value:t}):r.exports.apply=t})(he)),he.exports}var Ke,ea;function Z(){if(ea)return Ke;ea=1;var r=yr(),e=Yt(),n=e([r("%String.prototype.indexOf%")]);return Ke=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e([i]):i},Ke}var Je,ta;function oo(){if(ta)return Je;ta=1;var r=Lt(),e=Vr()(),n=Z(),a=zt(),t=n("Array.prototype.push"),f=n("Object.prototype.propertyIsEnumerable"),i=e?a.getOwnPropertySymbols:null;return Je=function(u,c){if(u==null)throw new TypeError("target must be an object");var v=a(u);if(arguments.length===1)return v;for(var p=1;p<arguments.length;++p){var y=a(arguments[p]),h=r(y),S=e&&(a.getOwnPropertySymbols||i);if(S)for(var R=S(y),w=0;w<R.length;++w){var q=R[w];f(y,q)&&t(h,q)}for(var O=0;O<h.length;++O){var m=h[O];if(f(y,m)){var j=y[m];v[m]=j}}}return v},Je}var Ye,na;function io(){if(na)return Ye;na=1;var r=oo(),e=function(){if(!Object.assign)return!1;for(var a="abcdefghijklmnopqrst",t=a.split(""),f={},i=0;i<t.length;++i)f[t[i]]=t[i];var o=Object.assign({},f),u="";for(var c in o)u+=c;return a!==u},n=function(){if(!Object.assign||!Object.preventExtensions)return!1;var a=Object.preventExtensions({1:2});try{Object.assign(a,"xy")}catch{return a[1]==="y"}return!1};return Ye=function(){return!Object.assign||e()||n()?r:Object.assign},Ye}var Xe,aa;function Xo(){if(aa)return Xe;aa=1;var r=qr(),e=io();return Xe=function(){var a=e();return r(Object,{assign:a},{assign:function(){return Object.assign!==a}}),a},Xe}var Qe,oa;function Qo(){if(oa)return Qe;oa=1;var r=qr(),e=Br(),n=oo(),a=io(),t=Xo(),f=e.apply(a()),i=function(u,c){return f(Object,arguments)};return r(i,{getPolyfill:a,implementation:n,shim:t}),Qe=i,Qe}var Ze,ia;function uo(){if(ia)return Ze;ia=1;var r=yr(),e=Br(),n=e(r("String.prototype.indexOf"));return Ze=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e(i):i},Ze}var rt,ua;function Zo(){if(ua)return rt;ua=1;var r=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}r.functionsHaveConfigurableNames=function(){if(!r()||!e)return!1;var t=e(function(){},"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;return r.boundFunctionsHaveNames=function(){return r()&&typeof n=="function"&&(function(){}).bind().name!==""},rt=r,rt}var et,fa;function ri(){if(fa)return et;fa=1;var r=Ht(),e=Gt()(),n=Zo().functionsHaveConfigurableNames(),a=nr();return et=function(f,i){if(typeof f!="function")throw new a("`fn` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||n)&&(e?r(f,"name",i,!0,!0):r(f,"name",i)),f},et}var tt,sa;function fo(){if(sa)return tt;sa=1;var r=ri(),e=nr(),n=Object;return tt=r(function(){if(this==null||this!==n(this))throw new e("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),tt}var nt,la;function so(){if(la)return nt;la=1;var r=fo(),e=qr().supportsDescriptors,n=Object.getOwnPropertyDescriptor;return nt=function(){if(e&&/a/mig.flags==="gim"){var t=n(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var f="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){f+="d"}}),Object.defineProperty(i,"sticky",{get:function(){f+="y"}}),t.get.call(i),f==="dy")return t.get}}return r},nt}var at,ca;function ei(){if(ca)return at;ca=1;var r=qr().supportsDescriptors,e=so(),n=wr(),a=Object.defineProperty,t=eo(),f=Xt(),i=/a/;return at=function(){if(!r||!f)throw new t("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=e(),c=f(i),v=n(c,"flags");return(!v||v.get!==u)&&a(c,"flags",{configurable:!0,enumerable:!1,get:u}),u},at}var ot,pa;function ti(){if(pa)return ot;pa=1;var r=qr(),e=Br(),n=fo(),a=so(),t=ei(),f=e(a());return r(f,{getPolyfill:a,implementation:n,shim:t}),ot=f,ot}var Cr={exports:{}},it,ya;function Pr(){if(ya)return it;ya=1;var r=Vr();return it=function(){return r()&&!!Symbol.toStringTag},it}var ut,va;function lo(){if(va)return ut;va=1;var r=Pr()(),e=Z(),n=e("Object.prototype.toString"),a=function(o){return r&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:n(o)==="[object Arguments]"},t=function(o){return a(o)?!0:o!==null&&typeof o=="object"&&"length"in o&&typeof o.length=="number"&&o.length>=0&&n(o)!=="[object Array]"&&"callee"in o&&n(o.callee)==="[object Function]"},f=(function(){return a(arguments)})();return a.isLegacyArguments=t,ut=f?a:t,ut}const ni={},ai=Object.freeze(Object.defineProperty({__proto__:null,default:ni},Symbol.toStringTag,{value:"Module"})),oi=Bo(ai);var ft,ga;function Kr(){if(ga)return ft;ga=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=r&&e&&typeof e.get=="function"?e.get:null,a=r&&Map.prototype.forEach,t=typeof Set=="function"&&Set.prototype,f=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,i=t&&f&&typeof f.get=="function"?f.get:null,o=t&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,p=v?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,h=y?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,R=Object.prototype.toString,w=Function.prototype.toString,q=String.prototype.match,O=String.prototype.slice,m=String.prototype.replace,j=String.prototype.toUpperCase,Q=String.prototype.toLowerCase,H=RegExp.prototype.test,F=Array.prototype.concat,D=Array.prototype.join,P=Array.prototype.slice,_=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,V=typeof Symbol=="function"&&typeof Symbol.iterator=="object",fr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===V||!0)?Symbol.toStringTag:null,Ir=Object.prototype.propertyIsEnumerable,Sr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function ar(s,l){if(s===1/0||s===-1/0||s!==s||s&&s>-1e3&&s<1e3||H.call(/e/,l))return l;var C=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var W=s<0?-_(-s):_(s);if(W!==s){var k=String(W),B=O.call(l,k.length+1);return m.call(k,C,"$&_")+"."+m.call(m.call(B,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(l,C,"$&_")}var G=oi,br=G.custom,Rr=z(br)?br:null,Ar={__proto__:null,double:'"',single:"'"},vr={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ft=function s(l,C,W,k){var B=C||{};if(X(B,"quoteStyle")&&!X(Ar,B.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(X(B,"maxStringLength")&&(typeof B.maxStringLength=="number"?B.maxStringLength<0&&B.maxStringLength!==1/0:B.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var dr=X(B,"customInspect")?B.customInspect:!0;if(typeof dr!="boolean"&&dr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(X(B,"indent")&&B.indent!==null&&B.indent!==" "&&!(parseInt(B.indent,10)===B.indent&&B.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(X(B,"numericSeparator")&&typeof B.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Or=B.numericSeparator;if(typeof l>"u")return"undefined";if(l===null)return"null";if(typeof l=="boolean")return l?"true":"false";if(typeof l=="string")return $r(l,B);if(typeof l=="number"){if(l===0)return 1/0/l>0?"0":"-0";var tr=String(l);return Or?ar(l,tr):tr}if(typeof l=="bigint"){var mr=String(l)+"n";return Or?ar(l,mr):mr}var Xr=typeof B.depth>"u"?5:B.depth;if(typeof W>"u"&&(W=0),W>=Xr&&Xr>0&&typeof l=="object")return $(l)?"[Array]":"[Object]";var xr=qo(B,W);if(typeof k>"u")k=[];else if(or(k,l)>=0)return"[Circular]";function ir(Er,kr,Io){if(kr&&(k=P.call(k),k.push(kr)),Io){var sn={depth:B.depth};return X(B,"quoteStyle")&&(sn.quoteStyle=B.quoteStyle),s(Er,sn,W+1,k)}return s(Er,B,W+1,k)}if(typeof l=="function"&&!T(l)){var en=sr(l),tn=Nr(l,ir);return"[Function"+(en?": "+en:" (anonymous)")+"]"+(tn.length>0?" { "+D.call(tn,", ")+" }":"")}if(z(l)){var nn=V?m.call(String(l),/^(Symbol\(.*\))_[^)]*$/,"$1"):U.call(l);return typeof l=="object"&&!V?hr(nn):nn}if(gr(l)){for(var Mr="<"+Q.call(String(l.nodeName)),Qr=l.attributes||[],Wr=0;Wr<Qr.length;Wr++)Mr+=" "+Qr[Wr].name+"="+g(d(Qr[Wr].value),"double",B);return Mr+=">",l.childNodes&&l.childNodes.length&&(Mr+="..."),Mr+="</"+Q.call(String(l.nodeName))+">",Mr}if($(l)){if(l.length===0)return"[]";var Zr=Nr(l,ir);return xr&&!wo(Zr)?"["+Yr(Zr,xr)+"]":"[ "+D.call(Zr,", ")+" ]"}if(A(l)){var re=Nr(l,ir);return!("cause"in Error.prototype)&&"cause"in l&&!Ir.call(l,"cause")?"{ ["+String(l)+"] "+D.call(F.call("[cause]: "+ir(l.cause),re),", ")+" }":re.length===0?"["+String(l)+"]":"{ ["+String(l)+"] "+D.call(re,", ")+" }"}if(typeof l=="object"&&dr){if(Rr&&typeof l[Rr]=="function"&&G)return G(l,{depth:Xr-W});if(dr!=="symbol"&&typeof l.inspect=="function")return l.inspect()}if(er(l)){var an=[];return a&&a.call(l,function(Er,kr){an.push(ir(kr,l,!0)+" => "+ir(Er,l))}),rn("Map",n.call(l),an,xr)}if(pr(l)){var on=[];return o&&o.call(l,function(Er){on.push(ir(Er,l))}),rn("Set",i.call(l),on,xr)}if(lr(l))return Jr("WeakMap");if(_r(l))return Jr("WeakSet");if(cr(l))return Jr("WeakRef");if(b(l))return hr(ir(Number(l)));if(K(l))return hr(ir(L.call(l)));if(E(l))return hr(S.call(l));if(I(l))return hr(ir(String(l)));if(typeof window<"u"&&l===window)return"{ [object Window] }";if(typeof globalThis<"u"&&l===globalThis||typeof Gr<"u"&&l===Gr)return"{ [object globalThis] }";if(!M(l)&&!T(l)){var ee=Nr(l,ir),un=Sr?Sr(l)===Object.prototype:l instanceof Object||l.constructor===Object,te=l instanceof Object?"":"null prototype",fn=!un&&fr&&Object(l)===l&&fr in l?O.call(rr(l),8,-1):te?"Object":"",Po=un||typeof l.constructor!="function"?"":l.constructor.name?l.constructor.name+" ":"",ne=Po+(fn||te?"["+D.call(F.call([],fn||[],te||[]),": ")+"] ":"");return ee.length===0?ne+"{}":xr?ne+"{"+Yr(ee,xr)+"}":ne+"{ "+D.call(ee,", ")+" }"}return String(l)};function g(s,l,C){var W=C.quoteStyle||l,k=Ar[W];return k+s+k}function d(s){return m.call(String(s),/"/g,"&quot;")}function x(s){return!fr||!(typeof s=="object"&&(fr in s||typeof s[fr]<"u"))}function $(s){return rr(s)==="[object Array]"&&x(s)}function M(s){return rr(s)==="[object Date]"&&x(s)}function T(s){return rr(s)==="[object RegExp]"&&x(s)}function A(s){return rr(s)==="[object Error]"&&x(s)}function I(s){return rr(s)==="[object String]"&&x(s)}function b(s){return rr(s)==="[object Number]"&&x(s)}function E(s){return rr(s)==="[object Boolean]"&&x(s)}function z(s){if(V)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!U)return!1;try{return U.call(s),!0}catch{}return!1}function K(s){if(!s||typeof s!="object"||!L)return!1;try{return L.call(s),!0}catch{}return!1}var J=Object.prototype.hasOwnProperty||function(s){return s in this};function X(s,l){return J.call(s,l)}function rr(s){return R.call(s)}function sr(s){if(s.name)return s.name;var l=q.call(w.call(s),/^function\s*([\w$]+)/);return l?l[1]:null}function or(s,l){if(s.indexOf)return s.indexOf(l);for(var C=0,W=s.length;C<W;C++)if(s[C]===l)return C;return-1}function er(s){if(!n||!s||typeof s!="object")return!1;try{n.call(s);try{i.call(s)}catch{return!0}return s instanceof Map}catch{}return!1}function lr(s){if(!c||!s||typeof s!="object")return!1;try{c.call(s,c);try{p.call(s,p)}catch{return!0}return s instanceof WeakMap}catch{}return!1}function cr(s){if(!h||!s||typeof s!="object")return!1;try{return h.call(s),!0}catch{}return!1}function pr(s){if(!i||!s||typeof s!="object")return!1;try{i.call(s);try{n.call(s)}catch{return!0}return s instanceof Set}catch{}return!1}function _r(s){if(!p||!s||typeof s!="object")return!1;try{p.call(s,p);try{c.call(s,c)}catch{return!0}return s instanceof WeakSet}catch{}return!1}function gr(s){return!s||typeof s!="object"?!1:typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.nodeName=="string"&&typeof s.getAttribute=="function"}function $r(s,l){if(s.length>l.maxStringLength){var C=s.length-l.maxStringLength,W="... "+C+" more character"+(C>1?"s":"");return $r(O.call(s,0,l.maxStringLength),l)+W}var k=vr[l.quoteStyle||"single"];k.lastIndex=0;var B=m.call(m.call(s,k,"\\$1"),/[\x00-\x1f]/g,jr);return g(B,"single",l)}function jr(s){var l=s.charCodeAt(0),C={8:"b",9:"t",10:"n",12:"f",13:"r"}[l];return C?"\\"+C:"\\x"+(l<16?"0":"")+j.call(l.toString(16))}function hr(s){return"Object("+s+")"}function Jr(s){return s+" { ? }"}function rn(s,l,C,W){var k=W?Yr(C,W):D.call(C,", ");return s+" ("+l+") {"+k+"}"}function wo(s){for(var l=0;l<s.length;l++)if(or(s[l],`
2
- `)>=0)return!1;return!0}function qo(s,l){var C;if(s.indent===" ")C=" ";else if(typeof s.indent=="number"&&s.indent>0)C=D.call(Array(s.indent+1)," ");else return null;return{base:C,prev:D.call(Array(l+1),C)}}function Yr(s,l){if(s.length===0)return"";var C=`
3
- `+l.prev+l.base;return C+D.call(s,","+C)+`
4
- `+l.prev}function Nr(s,l){var C=$(s),W=[];if(C){W.length=s.length;for(var k=0;k<s.length;k++)W[k]=X(s,k)?l(s[k],s):""}var B=typeof N=="function"?N(s):[],dr;if(V){dr={};for(var Or=0;Or<B.length;Or++)dr["$"+B[Or]]=B[Or]}for(var tr in s)X(s,tr)&&(C&&String(Number(tr))===tr&&tr<s.length||V&&dr["$"+tr]instanceof Symbol||(H.call(/[^\w$]/,tr)?W.push(l(tr,s)+": "+l(s[tr],s)):W.push(tr+": "+l(s[tr],s))));if(typeof N=="function")for(var mr=0;mr<B.length;mr++)Ir.call(s,B[mr])&&W.push("["+l(B[mr])+"]: "+l(s[B[mr]],s));return W}return ft}var st,ha;function ii(){if(ha)return st;ha=1;var r=Kr(),e=nr(),n=function(o,u,c){for(var v=o,p;(p=v.next)!=null;v=p)if(p.key===u)return v.next=p.next,c||(p.next=o.next,o.next=p),p},a=function(o,u){if(o){var c=n(o,u);return c&&c.value}},t=function(o,u,c){var v=n(o,u);v?v.value=c:o.next={key:u,next:o.next,value:c}},f=function(o,u){return o?!!n(o,u):!1},i=function(o,u){if(o)return n(o,u,!0)};return st=function(){var u,c={assert:function(v){if(!c.has(v))throw new e("Side channel does not contain "+r(v))},delete:function(v){var p=u&&u.next,y=i(u,v);return y&&p&&p===y&&(u=void 0),!!y},get:function(v){return a(u,v)},has:function(v){return f(u,v)},set:function(v,p){u||(u={next:void 0}),t(u,v,p)}};return c},st}var lt,da;function co(){if(da)return lt;da=1;var r=yr(),e=Z(),n=Kr(),a=nr(),t=r("%Map%",!0),f=e("Map.prototype.get",!0),i=e("Map.prototype.set",!0),o=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return lt=!!t&&function(){var p,y={assert:function(h){if(!y.has(h))throw new a("Side channel does not contain "+n(h))},delete:function(h){if(p){var S=u(p,h);return c(p)===0&&(p=void 0),S}return!1},get:function(h){if(p)return f(p,h)},has:function(h){return p?o(p,h):!1},set:function(h,S){p||(p=new t),i(p,h,S)}};return y},lt}var ct,ma;function ui(){if(ma)return ct;ma=1;var r=yr(),e=Z(),n=Kr(),a=co(),t=nr(),f=r("%WeakMap%",!0),i=e("WeakMap.prototype.get",!0),o=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return ct=f?function(){var p,y,h={assert:function(S){if(!h.has(S))throw new t("Side channel does not contain "+n(S))},delete:function(S){if(f&&S&&(typeof S=="object"||typeof S=="function")){if(p)return c(p,S)}else if(a&&y)return y.delete(S);return!1},get:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?i(p,S):y&&y.get(S)},has:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?u(p,S):!!y&&y.has(S)},set:function(S,R){f&&S&&(typeof S=="object"||typeof S=="function")?(p||(p=new f),o(p,S,R)):a&&(y||(y=a()),y.set(S,R))}};return h}:a,ct}var pt,Sa;function po(){if(Sa)return pt;Sa=1;var r=nr(),e=Kr(),n=ii(),a=co(),t=ui(),f=t||a||n;return pt=function(){var o,u={assert:function(c){if(!u.has(c))throw new r("Side channel does not contain "+e(c))},delete:function(c){return!!o&&o.delete(c)},get:function(c){return o&&o.get(c)},has:function(c){return!!o&&o.has(c)},set:function(c,v){o||(o=f()),o.set(c,v)}};return u},pt}var yt,ba;function fi(){if(ba)return yt;ba=1;var r=Qt(),e=po()(),n=nr(),a={assert:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");if(e.assert(t),!a.has(t,f))throw new n("`"+f+"` is not present on `O`")},get:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return i&&i["$"+f]},has:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return!!i&&r(i,"$"+f)},set:function(t,f,i){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var o=e.get(t);o||(o={},e.set(t,o)),o["$"+f]=i}};return Object.freeze&&Object.freeze(a),yt=a,yt}var vt,Aa;function si(){if(Aa)return vt;Aa=1;var r=fi(),e=Ut(),n=typeof StopIteration=="object"?StopIteration:null;return vt=function(t){if(!n)throw new e("this environment lacks StopIteration");r.set(t,"[[Done]]",!1);var f={next:function(){var o=r.get(this,"[[Iterator]]"),u=!!r.get(o,"[[Done]]");try{return{done:u,value:u?void 0:o.next()}}catch(c){if(r.set(o,"[[Done]]",!0),c!==n)throw c;return{done:!0,value:void 0}}}};return r.set(f,"[[Iterator]]",t),f},vt}var gt,Oa;function yo(){if(Oa)return gt;Oa=1;var r={}.toString;return gt=Array.isArray||function(e){return r.call(e)=="[object Array]"},gt}var ht,wa;function vo(){if(wa)return ht;wa=1;var r=Z(),e=r("String.prototype.valueOf"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object String]",f=Pr()();return ht=function(o){return typeof o=="string"?!0:!o||typeof o!="object"?!1:f?n(o):a(o)===t},ht}var dt,qa;function go(){if(qa)return dt;qa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;r||(n=function(i){return!1});var a=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!a&&(n=function(i){return!1}),dt=n||function(i){if(!i||typeof i!="object")return!1;try{if(a.call(i),t)try{t.call(i)}catch{return!0}return i instanceof r}catch{}return!1},dt}var mt,Pa;function ho(){if(Pa)return mt;Pa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;e||(n=function(i){return!1});var a=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!t&&(n=function(i){return!1}),mt=n||function(i){if(!i||typeof i!="object")return!1;try{if(t.call(i),a)try{a.call(i)}catch{return!0}return i instanceof e}catch{}return!1},mt}var Ia;function li(){if(Ia)return Cr.exports;Ia=1;var r=lo(),e=si();if(Vt()()||Vr()()){var n=Symbol.iterator;Cr.exports=function(P){if(P!=null&&typeof P[n]<"u")return P[n]();if(r(P))return Array.prototype[n].call(P)}}else{var a=yo(),t=vo(),f=yr(),i=f("%Map%",!0),o=f("%Set%",!0),u=uo(),c=u("Array.prototype.push"),v=u("String.prototype.charCodeAt"),p=u("String.prototype.slice"),y=function(P,_){var L=P.length;if(_+1>=L)return _+1;var N=v(P,_);if(N<55296||N>56319)return _+1;var U=v(P,_+1);return U<56320||U>57343?_+1:_+2},h=function(P){var _=0;return{next:function(){var N=_>=P.length,U;return N||(U=P[_],_+=1),{done:N,value:U}}}},S=function(P,_){if(a(P)||r(P))return h(P);if(t(P)){var L=0;return{next:function(){var U=y(P,L),V=p(P,L,U);return L=U,{done:U>P.length,value:V}}}}if(_&&typeof P["_es6-shim iterator_"]<"u")return P["_es6-shim iterator_"]()};if(!i&&!o)Cr.exports=function(P){if(P!=null)return S(P,!0)};else{var R=go(),w=ho(),q=u("Map.prototype.forEach",!0),O=u("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var m=u("Map.prototype.iterator",!0),j=u("Set.prototype.iterator",!0);var Q=u("Map.prototype.@@iterator",!0)||u("Map.prototype._es6-shim iterator_",!0),H=u("Set.prototype.@@iterator",!0)||u("Set.prototype._es6-shim iterator_",!0),F=function(P){if(R(P)){if(m)return e(m(P));if(Q)return Q(P);if(q){var _=[];return q(P,function(N,U){c(_,[U,N])}),h(_)}}if(w(P)){if(j)return e(j(P));if(H)return H(P);if(O){var L=[];return O(P,function(N){c(L,N)}),h(L)}}};Cr.exports=function(P){return F(P)||S(P)}}}return Cr.exports}var St,Ra;function mo(){if(Ra)return St;Ra=1;var r=function(e){return e!==e};return St=function(n,a){return n===0&&a===0?1/n===1/a:!!(n===a||r(n)&&r(a))},St}var bt,$a;function So(){if($a)return bt;$a=1;var r=mo();return bt=function(){return typeof Object.is=="function"?Object.is:r},bt}var At,xa;function ci(){if(xa)return At;xa=1;var r=So(),e=qr();return At=function(){var a=r();return e(Object,{is:a},{is:function(){return Object.is!==a}}),a},At}var Ot,Ea;function pi(){if(Ea)return Ot;Ea=1;var r=qr(),e=Br(),n=mo(),a=So(),t=ci(),f=e(a(),Object);return r(f,{getPolyfill:a,implementation:n,shim:t}),Ot=f,Ot}var wt,Ba;function bo(){if(Ba)return wt;Ba=1;var r=Br(),e=Z(),n=yr(),a=n("%ArrayBuffer%",!0),t=e("ArrayBuffer.prototype.byteLength",!0),f=e("Object.prototype.toString"),i=!!a&&!t&&new a(0).slice,o=!!i&&r(i);return wt=t||o?function(c){if(!c||typeof c!="object")return!1;try{return t?t(c):o(c,0),!0}catch{return!1}}:a?function(c){return f(c)==="[object ArrayBuffer]"}:function(c){return!1},wt}var qt,ja;function yi(){if(ja)return qt;ja=1;var r=Z(),e=r("Date.prototype.getDay"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object Date]",f=Pr()();return qt=function(o){return typeof o!="object"||o===null?!1:f?n(o):a(o)===t},qt}var Pt,Ma;function Ao(){if(Ma)return Pt;Ma=1;var r=Z(),e=Pr()(),n=Qt(),a=wr(),t;if(e){var f=r("RegExp.prototype.exec"),i={},o=function(){throw i},u={toString:o,valueOf:o};typeof Symbol.toPrimitive=="symbol"&&(u[Symbol.toPrimitive]=o),t=function(y){if(!y||typeof y!="object")return!1;var h=a(y,"lastIndex"),S=h&&n(h,"value");if(!S)return!1;try{f(y,u)}catch(R){return R===i}}}else{var c=r("Object.prototype.toString"),v="[object RegExp]";t=function(y){return!y||typeof y!="object"&&typeof y!="function"?!1:c(y)===v}}return Pt=t,Pt}var It,Ta;function vi(){if(Ta)return It;Ta=1;var r=Z(),e=r("SharedArrayBuffer.prototype.byteLength",!0);return It=e?function(a){if(!a||typeof a!="object")return!1;try{return e(a),!0}catch{return!1}}:function(a){return!1},It}var Rt,Ca;function gi(){if(Ca)return Rt;Ca=1;var r=Z(),e=r("Number.prototype.toString"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object Number]",f=Pr()();return Rt=function(o){return typeof o=="number"?!0:!o||typeof o!="object"?!1:f?n(o):a(o)===t},Rt}var $t,Da;function hi(){if(Da)return $t;Da=1;var r=Z(),e=r("Boolean.prototype.toString"),n=r("Object.prototype.toString"),a=function(o){try{return e(o),!0}catch{return!1}},t="[object Boolean]",f=Pr()();return $t=function(o){return typeof o=="boolean"?!0:o===null||typeof o!="object"?!1:f?a(o):n(o)===t},$t}var Lr={exports:{}},xt,Fa;function di(){if(Fa)return xt;Fa=1;var r=Z(),e=Ao(),n=r("RegExp.prototype.exec"),a=nr();return xt=function(f){if(!e(f))throw new a("`regex` must be a RegExp");return function(o){return n(f,o)!==null}},xt}var _a;function mi(){if(_a)return Lr.exports;_a=1;var r=Z(),e=r("Object.prototype.toString"),n=Vt()(),a=di();if(n){var t=r("Symbol.prototype.toString"),f=a(/^Symbol\(.*\)$/),i=function(u){return typeof u.valueOf()!="symbol"?!1:f(t(u))};Lr.exports=function(u){if(typeof u=="symbol")return!0;if(!u||typeof u!="object"||e(u)!=="[object Symbol]")return!1;try{return i(u)}catch{return!1}}}else Lr.exports=function(u){return!1};return Lr.exports}var Ur={exports:{}},Et,Na;function Si(){if(Na)return Et;Na=1;var r=typeof BigInt<"u"&&BigInt;return Et=function(){return typeof r=="function"&&typeof BigInt=="function"&&typeof r(42)=="bigint"&&typeof BigInt(42)=="bigint"},Et}var Wa;function bi(){if(Wa)return Ur.exports;Wa=1;var r=Si()();if(r){var e=BigInt.prototype.valueOf,n=function(t){try{return e.call(t),!0}catch{}return!1};Ur.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:n(t)}}else Ur.exports=function(t){return!1};return Ur.exports}var Bt,ka;function Ai(){if(ka)return Bt;ka=1;var r=vo(),e=gi(),n=hi(),a=mi(),t=bi();return Bt=function(i){if(i==null||typeof i!="object"&&typeof i!="function")return null;if(r(i))return"String";if(e(i))return"Number";if(n(i))return"Boolean";if(a(i))return"Symbol";if(t(i))return"BigInt"},Bt}var jt,La;function Oi(){if(La)return jt;La=1;var r=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,e=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,n;r||(n=function(i){return!1});var a=r?r.prototype.has:null,t=e?e.prototype.has:null;return!n&&!a&&(n=function(i){return!1}),jt=n||function(i){if(!i||typeof i!="object")return!1;try{if(a.call(i,a),t)try{t.call(i,t)}catch{return!0}return i instanceof r}catch{}return!1},jt}var Hr={exports:{}},Ua;function wi(){if(Ua)return Hr.exports;Ua=1;var r=yr(),e=Z(),n=r("%WeakSet%",!0),a=e("WeakSet.prototype.has",!0);if(a){var t=e("WeakMap.prototype.has",!0);Hr.exports=function(i){if(!i||typeof i!="object")return!1;try{if(a(i,a),t)try{t(i,t)}catch{return!0}return i instanceof n}catch{}return!1}}else Hr.exports=function(i){return!1};return Hr.exports}var Mt,Ha;function qi(){if(Ha)return Mt;Ha=1;var r=go(),e=ho(),n=Oi(),a=wi();return Mt=function(f){if(f&&typeof f=="object"){if(r(f))return"Map";if(e(f))return"Set";if(n(f))return"WeakMap";if(a(f))return"WeakSet"}return!1},Mt}var Tt,Ga;function Pi(){if(Ga)return Tt;Ga=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,a;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw a}}),a={},e(function(){throw 42},null,n)}catch(O){O!==a&&(e=null)}else e=null;var t=/^\s*class\b/,f=function(m){try{var j=r.call(m);return t.test(j)}catch{return!1}},i=function(m){try{return f(m)?!1:(r.call(m),!0)}catch{return!1}},o=Object.prototype.toString,u="[object Object]",c="[object Function]",v="[object GeneratorFunction]",p="[object HTMLAllCollection]",y="[object HTML document.all class]",h="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var q=document.all;o.call(q)===o.call(document.all)&&(w=function(m){if((R||!m)&&(typeof m>"u"||typeof m=="object"))try{var j=o.call(m);return(j===p||j===y||j===h||j===u)&&m("")==null}catch{}return!1})}return Tt=e?function(m){if(w(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;try{e(m,null,n)}catch(j){if(j!==a)return!1}return!f(m)&&i(m)}:function(m){if(w(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;if(S)return i(m);if(f(m))return!1;var j=o.call(m);return j!==c&&j!==v&&!/^\[object HTML/.test(j)?!1:i(m)},Tt}var Ct,za;function Ii(){if(za)return Ct;za=1;var r=Pi(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,a=function(u,c,v){for(var p=0,y=u.length;p<y;p++)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))},t=function(u,c,v){for(var p=0,y=u.length;p<y;p++)v==null?c(u.charAt(p),p,u):c.call(v,u.charAt(p),p,u)},f=function(u,c,v){for(var p in u)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))};function i(o){return e.call(o)==="[object Array]"}return Ct=function(u,c,v){if(!r(c))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=v),i(u)?a(u,c,p):typeof u=="string"?t(u,c,p):f(u,c,p)},Ct}var Dt,Va;function Ri(){return Va||(Va=1,Dt=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Dt}var Ft,Ka;function $i(){if(Ka)return Ft;Ka=1;var r=Ri(),e=typeof globalThis>"u"?Gr:globalThis;return Ft=function(){for(var a=[],t=0;t<r.length;t++)typeof e[r[t]]=="function"&&(a[a.length]=r[t]);return a},Ft}var _t,Ja;function xi(){if(Ja)return _t;Ja=1;var r=Ii(),e=$i(),n=Br(),a=Z(),t=wr(),f=Xt(),i=a("Object.prototype.toString"),o=Pr()(),u=typeof globalThis>"u"?Gr:globalThis,c=e(),v=a("String.prototype.slice"),p=a("Array.prototype.indexOf",!0)||function(w,q){for(var O=0;O<w.length;O+=1)if(w[O]===q)return O;return-1},y={__proto__:null};o&&t&&f?r(c,function(R){var w=new u[R];if(Symbol.toStringTag in w&&f){var q=f(w),O=t(q,Symbol.toStringTag);if(!O&&q){var m=f(q);O=t(m,Symbol.toStringTag)}y["$"+R]=n(O.get)}}):r(c,function(R){var w=new u[R],q=w.slice||w.set;q&&(y["$"+R]=n(q))});var h=function(w){var q=!1;return r(y,function(O,m){if(!q)try{"$"+O(w)===m&&(q=v(m,1))}catch{}}),q},S=function(w){var q=!1;return r(y,function(O,m){if(!q)try{O(w),q=v(m,1)}catch{}}),q};return _t=function(w){if(!w||typeof w!="object")return!1;if(!o){var q=v(i(w),8,-1);return p(c,q)>-1?q:q!=="Object"?!1:S(w)}return t?h(w):null},_t}var Nt,Ya;function Ei(){if(Ya)return Nt;Ya=1;var r=Z(),e=r("ArrayBuffer.prototype.byteLength",!0),n=bo();return Nt=function(t){return n(t)?e?e(t):t.byteLength:NaN},Nt}var Wt,Xa;function Bi(){if(Xa)return Wt;Xa=1;var r=Qo(),e=uo(),n=ti(),a=yr(),t=li(),f=po(),i=pi(),o=lo(),u=yo(),c=bo(),v=yi(),p=Ao(),y=vi(),h=Lt(),S=Ai(),R=qi(),w=xi(),q=Ei(),O=e("SharedArrayBuffer.prototype.byteLength",!0),m=e("Date.prototype.getTime"),j=Object.getPrototypeOf,Q=e("Object.prototype.toString"),H=a("%Set%",!0),F=e("Map.prototype.has",!0),D=e("Map.prototype.get",!0),P=e("Map.prototype.size",!0),_=e("Set.prototype.add",!0),L=e("Set.prototype.delete",!0),N=e("Set.prototype.has",!0),U=e("Set.prototype.size",!0);function V(g,d,x,$){for(var M=t(g),T;(T=M.next())&&!T.done;)if(G(d,T.value,x,$))return L(g,T.value),!0;return!1}function fr(g){if(typeof g>"u")return null;if(typeof g!="object")return typeof g=="symbol"?!1:typeof g=="string"||typeof g=="number"?+g==+g:!0}function Ir(g,d,x,$,M,T){var A=fr(x);if(A!=null)return A;var I=D(d,A),b=r({},M,{strict:!1});return typeof I>"u"&&!F(d,A)||!G($,I,b,T)?!1:!F(g,A)&&G($,I,b,T)}function Sr(g,d,x){var $=fr(x);return $??(N(d,$)&&!N(g,$))}function ar(g,d,x,$,M,T){for(var A=t(g),I,b;(I=A.next())&&!I.done;)if(b=I.value,G(x,b,M,T)&&G($,D(d,b),M,T))return L(g,b),!0;return!1}function G(g,d,x,$){var M=x||{};if(M.strict?i(g,d):g===d)return!0;var T=S(g),A=S(d);if(T!==A)return!1;if(!g||!d||typeof g!="object"&&typeof d!="object")return M.strict?i(g,d):g==d;var I=$.has(g),b=$.has(d),E;if(I&&b){if($.get(g)===$.get(d))return!0}else E={};return I||$.set(g,E),b||$.set(d,E),vr(g,d,M,$)}function br(g){return!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))}function Rr(g,d,x,$){if(U(g)!==U(d))return!1;for(var M=t(g),T=t(d),A,I,b;(A=M.next())&&!A.done;)if(A.value&&typeof A.value=="object")b||(b=new H),_(b,A.value);else if(!N(d,A.value)){if(x.strict||!Sr(g,d,A.value))return!1;b||(b=new H),_(b,A.value)}if(b){for(;(I=T.next())&&!I.done;)if(I.value&&typeof I.value=="object"){if(!V(b,I.value,x.strict,$))return!1}else if(!x.strict&&!N(g,I.value)&&!V(b,I.value,x.strict,$))return!1;return U(b)===0}return!0}function Ar(g,d,x,$){if(P(g)!==P(d))return!1;for(var M=t(g),T=t(d),A,I,b,E,z,K;(A=M.next())&&!A.done;)if(E=A.value[0],z=A.value[1],E&&typeof E=="object")b||(b=new H),_(b,E);else if(K=D(d,E),typeof K>"u"&&!F(d,E)||!G(z,K,x,$)){if(x.strict||!Ir(g,d,E,z,x,$))return!1;b||(b=new H),_(b,E)}if(b){for(;(I=T.next())&&!I.done;)if(E=I.value[0],K=I.value[1],E&&typeof E=="object"){if(!ar(b,g,E,K,x,$))return!1}else if(!x.strict&&(!g.has(E)||!G(D(g,E),K,x,$))&&!ar(b,g,E,K,r({},x,{strict:!1}),$))return!1;return U(b)===0}return!0}function vr(g,d,x,$){var M,T;if(typeof g!=typeof d||g==null||d==null||Q(g)!==Q(d)||o(g)!==o(d))return!1;var A=u(g),I=u(d);if(A!==I)return!1;var b=g instanceof Error,E=d instanceof Error;if(b!==E||(b||E)&&(g.name!==d.name||g.message!==d.message))return!1;var z=p(g),K=p(d);if(z!==K||(z||K)&&(g.source!==d.source||n(g)!==n(d)))return!1;var J=v(g),X=v(d);if(J!==X||(J||X)&&m(g)!==m(d)||x.strict&&j&&j(g)!==j(d))return!1;var rr=w(g),sr=w(d);if(rr!==sr)return!1;if(rr||sr){if(g.length!==d.length)return!1;for(M=0;M<g.length;M++)if(g[M]!==d[M])return!1;return!0}var or=br(g),er=br(d);if(or!==er)return!1;if(or||er){if(g.length!==d.length)return!1;for(M=0;M<g.length;M++)if(g[M]!==d[M])return!1;return!0}var lr=c(g),cr=c(d);if(lr!==cr)return!1;if(lr||cr)return q(g)!==q(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);var pr=y(g),_r=y(d);if(pr!==_r)return!1;if(pr||_r)return O(g)!==O(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);if(typeof g!=typeof d)return!1;var gr=h(g),$r=h(d);if(gr.length!==$r.length)return!1;for(gr.sort(),$r.sort(),M=gr.length-1;M>=0;M--)if(gr[M]!=$r[M])return!1;for(M=gr.length-1;M>=0;M--)if(T=gr[M],!G(g[T],d[T],x,$))return!1;var jr=R(g),hr=R(d);return jr!==hr?!1:jr==="Set"||hr==="Set"?Rr(g,d,x,$):jr==="Map"?Ar(g,d,x,$):!0}return Wt=function(d,x,$){return G(d,x,$,f())},Wt}var ji=Bi();const Mi=Eo(ji);function Ti(r){return r}function Oo(r,e,n,a){const t=Ti,[f,i]=ur.useState(t(n)),o=ur.useRef(f);return ur.useEffect(()=>{const u=()=>{const c={...n,...r.getAttributes(e)};Object.keys(c).forEach(p=>{(c[p]===null||c[p]===void 0)&&(c[p]=n?n[p]:null)});const v=t(c);Mi(o.current,v)||(i(v),o.current=v)};return r.on("selectionUpdate",u),r.on("transaction",u),()=>{r.off("selectionUpdate",u),r.off("transaction",u)}},[r,n,e,t]),f}function Zt(r,e={}){if(typeof r=="object")return r;try{return JSON.parse(r)}catch{return e}}function Ci({node:r}){const{text:e,macros:n}=r.attrs,a=ur.useMemo(()=>{try{return Za.renderToString(decodeURIComponent(e||""),{macros:Zt(decodeURIComponent(n||""))})}catch{return e}},[e,n]),t=ur.useMemo(()=>e.trim()?Y.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:a}}):Y.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[e,a]);return Y.jsx(Dr.NodeViewWrapper,{as:"span",style:{display:"inline-block"},children:t})}function Di(){const{t:r}=$o.useLocale(),[e,n]=ur.useState(!1),a=ae.useButtonProps(kt.name),{icon:t=void 0,tooltip:f=void 0,tooltipOptions:i={},isActive:o=void 0}=(a==null?void 0:a.componentProps)??{},{editorDisabled:u}=ae.useToggleActive(o),c=ae.useEditorInstance(),v=Oo(c,kt.name,{text:"",macros:""}),{text:p,macros:y}=v,[h,S]=ur.useState(decodeURIComponent(p||"")),[R,w]=ur.useState(decodeURIComponent(y||"")),q=ur.useCallback(()=>{c.chain().focus().setKatex({text:encodeURIComponent(h),macros:encodeURIComponent(R)}).run(),S(""),w(""),n(!1)},[c,h,R]),O=ur.useMemo(()=>{try{return Za.renderToString(h,{macros:Zt(R)})}catch{return h}},[R,h]),m=ur.useMemo(()=>`${h}`.trim()?O:null,[h,O]);return Y.jsxs(Tr.Dialog,{onOpenChange:n,open:e,children:[Y.jsx(Tr.DialogTrigger,{asChild:!0,disabled:u,children:Y.jsx(Ro.ActionButton,{disabled:u,icon:t,tooltip:f,tooltipOptions:i,action:()=>{u||n(!0)}})}),Y.jsxs(Tr.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[Y.jsx(Tr.DialogTitle,{children:r("editor.formula.dialog.text")}),Y.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:Y.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[Y.jsxs("div",{className:"richtext-flex-1",children:[Y.jsx(cn.Label,{className:"mb-[6px]",children:"Expression"}),Y.jsx(ln.Textarea,{autoFocus:!0,className:"richtext-mb-[10px]",onChange:j=>S(j.target.value),placeholder:"Text",required:!0,rows:10,value:h,style:{color:"hsl(var(--foreground))"}}),Y.jsx(cn.Label,{className:"mb-[6px]",children:"Macros"}),Y.jsx(ln.Textarea,{className:"richtext-flex-1",placeholder:"Macros",rows:10,value:R,onChange:j=>{w(j.target.value)},style:{color:"hsl(var(--foreground))"}})]}),Y.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:m||""},style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),Y.jsx(Tr.DialogFooter,{children:Y.jsx(xo.Button,{onClick:q,type:"button",children:"Save changes"})})]})]})}function Qa(r){return e=>e.getAttribute(r)}const kt=Dr.Node3.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({t:r})=>({componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:r("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:Qa("text")},macros:{default:"",parseHTML:Qa("macros")}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:r}){return["span",Dr.mergeAttributes(this.options&&this.options.HTMLAttributes||{},r)]},addCommands(){return{setKatex:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}},addInputRules(){return[Dr.nodeInputRule({find:/^\$katex\$$/,type:this.type})]},addNodeView(){return Dr.ReactNodeViewRenderer(Ci)}});exports.Katex=kt;exports.RichTextKatex=Di;exports.safeJSONParse=Zt;exports.useAttributes=Oo;
@@ -1,5 +0,0 @@
1
- "use strict";const k=require("react/jsx-runtime"),W=require("react");require("./index-Cn-t3Zxw.cjs");require("./theme.cjs");const v=require("./clsx-CXbNJWDD.cjs"),K=require("@tiptap/pm/state"),De=require("./toggle-C_SSvDRy.cjs"),lt=require("./useButtonProps-Cz4W5dC8.cjs"),Ue=require("./index-BsFvo9PG.cjs"),Be=require("./checkbox-BAzbZY2Y.cjs"),Wt=require("./label-tzSPdqui.cjs"),ge=require("./input-ZGRt7lWR.cjs"),be=require("./Icon-DzK0_ztP.cjs"),pe=require("./button-CqJztfH2.cjs"),Ft=require("./popover-C6Cya3Cz.cjs"),ze="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",We="ελ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",Jt="numeric",Vt="ascii",Yt="alpha",J="asciinumeric",Q="alphanumeric",Xt="domain",Re="emoji",Fe="scheme",Ke="slashscheme",Kt="whitespace";function _e(t,n){return t in n||(n[t]=[]),n[t]}function B(t,n,e){n[Jt]&&(n[J]=!0,n[Q]=!0),n[Vt]&&(n[J]=!0,n[Yt]=!0),n[J]&&(n[Q]=!0),n[Yt]&&(n[Q]=!0),n[Q]&&(n[Xt]=!0),n[Re]&&(n[Xt]=!0);for(const i in n){const s=_e(i,e);s.indexOf(t)<0&&s.push(t)}}function qe(t,n){const e={};for(const i in n)n[i].indexOf(t)>=0&&(e[i]=!0);return e}function R(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}R.groups={};R.prototype={accepts(){return!!this.t},go(t){const n=this,e=n.j[t];if(e)return e;for(let i=0;i<n.jr.length;i++){const s=n.jr[i][0],o=n.jr[i][1];if(o&&s.test(t))return o}return n.jd},has(t,n=!1){return n?t in this.j:!!this.go(t)},ta(t,n,e,i){for(let s=0;s<t.length;s++)this.tt(t[s],n,e,i)},tr(t,n,e,i){i=i||R.groups;let s;return n&&n.j?s=n:(s=new R(n),e&&i&&B(n,e,i)),this.jr.push([t,s]),s},ts(t,n,e,i){let s=this;const o=t.length;if(!o)return s;for(let a=0;a<o-1;a++)s=s.tt(t[a]);return s.tt(t[o-1],n,e,i)},tt(t,n,e,i){i=i||R.groups;const s=this;if(n&&n.j)return s.j[t]=n,n;const o=n;let a,l=s.go(t);if(l?(a=new R,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new R,o){if(i)if(a.t&&typeof a.t=="string"){const d=Object.assign(qe(a.t,i),e);B(o,d,i)}else e&&B(o,e,i);a.t=o}return s.j[t]=a,a}};const f=(t,n,e,i,s)=>t.ta(n,e,i,s),x=(t,n,e,i,s)=>t.tr(n,e,i,s),Ee=(t,n,e,i,s)=>t.ts(n,e,i,s),r=(t,n,e,i,s)=>t.tt(n,e,i,s),H="WORD",Zt="UWORD",ye="ASCIINUMERICAL",Oe="ALPHANUMERICAL",et="LOCALHOST",te="TLD",ee="UTLD",ct="SCHEME",F="SLASH_SCHEME",ie="NUM",ne="WS",se="NL",V="OPENBRACE",Y="CLOSEBRACE",ut="OPENBRACKET",dt="CLOSEBRACKET",ht="OPENPAREN",ft="CLOSEPAREN",mt="OPENANGLEBRACKET",gt="CLOSEANGLEBRACKET",pt="FULLWIDTHLEFTPAREN",Et="FULLWIDTHRIGHTPAREN",kt="LEFTCORNERBRACKET",At="RIGHTCORNERBRACKET",Lt="LEFTWHITECORNERBRACKET",xt="RIGHTWHITECORNERBRACKET",Tt="FULLWIDTHLESSTHAN",Ct="FULLWIDTHGREATERTHAN",bt="AMPERSAND",Rt="APOSTROPHE",yt="ASTERISK",M="AT",Ot="BACKSLASH",St="BACKTICK",Nt="CARET",D="COLON",oe="COMMA",vt="DOLLAR",S="DOT",It="EQUALS",re="EXCLAMATION",O="HYPHEN",X="PERCENT",Pt="PIPE",wt="PLUS",Ht="POUND",Z="QUERY",ae="QUOTE",Se="FULLWIDTHMIDDLEDOT",le="SEMI",N="SLASH",tt="TILDE",jt="UNDERSCORE",Ne="EMOJI",Mt="SYM";var ve=Object.freeze({__proto__:null,ALPHANUMERICAL:Oe,AMPERSAND:bt,APOSTROPHE:Rt,ASCIINUMERICAL:ye,ASTERISK:yt,AT:M,BACKSLASH:Ot,BACKTICK:St,CARET:Nt,CLOSEANGLEBRACKET:gt,CLOSEBRACE:Y,CLOSEBRACKET:dt,CLOSEPAREN:ft,COLON:D,COMMA:oe,DOLLAR:vt,DOT:S,EMOJI:Ne,EQUALS:It,EXCLAMATION:re,FULLWIDTHGREATERTHAN:Ct,FULLWIDTHLEFTPAREN:pt,FULLWIDTHLESSTHAN:Tt,FULLWIDTHMIDDLEDOT:Se,FULLWIDTHRIGHTPAREN:Et,HYPHEN:O,LEFTCORNERBRACKET:kt,LEFTWHITECORNERBRACKET:Lt,LOCALHOST:et,NL:se,NUM:ie,OPENANGLEBRACKET:mt,OPENBRACE:V,OPENBRACKET:ut,OPENPAREN:ht,PERCENT:X,PIPE:Pt,PLUS:wt,POUND:Ht,QUERY:Z,QUOTE:ae,RIGHTCORNERBRACKET:At,RIGHTWHITECORNERBRACKET:xt,SCHEME:ct,SEMI:le,SLASH:N,SLASH_SCHEME:F,SYM:Mt,TILDE:tt,TLD:te,UNDERSCORE:jt,UTLD:ee,UWORD:Zt,WORD:H,WS:ne});const P=/[a-z]/,$=new RegExp("\\p{L}","u"),_t=new RegExp("\\p{Emoji}","u"),w=/\d/,qt=/\s/,ke="\r",Gt=`
2
- `,Ge="️",$e="‍",$t="";let ot=null,rt=null;function Qe(t=[]){const n={};R.groups=n;const e=new R;ot==null&&(ot=Ae(ze)),rt==null&&(rt=Ae(We)),r(e,"'",Rt),r(e,"{",V),r(e,"}",Y),r(e,"[",ut),r(e,"]",dt),r(e,"(",ht),r(e,")",ft),r(e,"<",mt),r(e,">",gt),r(e,"(",pt),r(e,")",Et),r(e,"「",kt),r(e,"」",At),r(e,"『",Lt),r(e,"』",xt),r(e,"<",Tt),r(e,">",Ct),r(e,"&",bt),r(e,"*",yt),r(e,"@",M),r(e,"`",St),r(e,"^",Nt),r(e,":",D),r(e,",",oe),r(e,"$",vt),r(e,".",S),r(e,"=",It),r(e,"!",re),r(e,"-",O),r(e,"%",X),r(e,"|",Pt),r(e,"+",wt),r(e,"#",Ht),r(e,"?",Z),r(e,'"',ae),r(e,"/",N),r(e,";",le),r(e,"~",tt),r(e,"_",jt),r(e,"\\",Ot),r(e,"・",Se);const i=x(e,w,ie,{[Jt]:!0});x(i,w,i);const s=x(i,P,ye,{[J]:!0}),o=x(i,$,Oe,{[Q]:!0}),a=x(e,P,H,{[Vt]:!0});x(a,w,s),x(a,P,a),x(s,w,s),x(s,P,s);const l=x(e,$,Zt,{[Yt]:!0});x(l,P),x(l,w,o),x(l,$,l),x(o,w,o),x(o,P),x(o,$,o);const d=r(e,Gt,se,{[Kt]:!0}),h=r(e,ke,ne,{[Kt]:!0}),c=x(e,qt,ne,{[Kt]:!0});r(e,$t,c),r(h,Gt,d),r(h,$t,c),x(h,qt,c),r(c,ke),r(c,Gt),x(c,qt,c),r(c,$t,c);const u=x(e,_t,Ne,{[Re]:!0});r(u,"#"),x(u,_t,u),r(u,Ge,u);const m=r(u,$e);r(m,"#"),x(m,_t,u);const p=[[P,a],[w,s]],b=[[P,null],[$,l],[w,o]];for(let E=0;E<ot.length;E++)j(e,ot[E],te,H,p);for(let E=0;E<rt.length;E++)j(e,rt[E],ee,Zt,b);B(te,{tld:!0,ascii:!0},n),B(ee,{utld:!0,alpha:!0},n),j(e,"file",ct,H,p),j(e,"mailto",ct,H,p),j(e,"http",F,H,p),j(e,"https",F,H,p),j(e,"ftp",F,H,p),j(e,"ftps",F,H,p),B(ct,{scheme:!0,ascii:!0},n),B(F,{slashscheme:!0,ascii:!0},n),t=t.sort((E,T)=>E[0]>T[0]?1:-1);for(let E=0;E<t.length;E++){const T=t[E][0],L=t[E][1]?{[Fe]:!0}:{[Ke]:!0};T.indexOf("-")>=0?L[Xt]=!0:P.test(T)?w.test(T)?L[J]=!0:L[Vt]=!0:L[Jt]=!0,Ee(e,T,T,L)}return Ee(e,"localhost",et,{ascii:!0}),e.jd=new R(Mt),{start:e,tokens:Object.assign({groups:n},ve)}}function Ie(t,n){const e=Je(n.replace(/[A-Z]/g,l=>l.toLowerCase())),i=e.length,s=[];let o=0,a=0;for(;a<i;){let l=t,d=null,h=0,c=null,u=-1,m=-1;for(;a<i&&(d=l.go(e[a]));)l=d,l.accepts()?(u=0,m=0,c=l):u>=0&&(u+=e[a].length,m++),h+=e[a].length,o+=e[a].length,a++;o-=u,a-=m,h-=u,s.push({t:c.t,v:n.slice(o-h,o),s:o-h,e:o})}return s}function Je(t){const n=[],e=t.length;let i=0;for(;i<e;){let s=t.charCodeAt(i),o,a=s<55296||s>56319||i+1===e||(o=t.charCodeAt(i+1))<56320||o>57343?t[i]:t.slice(i,i+2);n.push(a),i+=a.length}return n}function j(t,n,e,i,s){let o;const a=n.length;for(let l=0;l<a-1;l++){const d=n[l];t.j[d]?o=t.j[d]:(o=new R(i),o.jr=s.slice(),t.j[d]=o),t=o}return o=new R(e),o.jr=s.slice(),t.j[n[a-1]]=o,o}function Ae(t){const n=[],e=[];let i=0,s="0123456789";for(;i<t.length;){let o=0;for(;s.indexOf(t[i+o])>=0;)o++;if(o>0){n.push(e.join(""));for(let a=parseInt(t.substring(i,i+o),10);a>0;a--)e.pop();i+=o}else e.push(t[i]),i++}return n}const nt={defaultProtocol:"http",events:null,format:Le,formatHref:Le,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ce(t,n=null){let e=Object.assign({},nt);t&&(e=Object.assign(e,t instanceof ce?t.o:t));const i=e.ignoreTags,s=[];for(let o=0;o<i.length;o++)s.push(i[o].toUpperCase());this.o=e,n&&(this.defaultRender=n),this.ignoreTags=s}ce.prototype={o:nt,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,n,e){const i=n!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=e.t in s?s[e.t]:nt[t],typeof s=="function"&&i&&(s=s(n,e))):typeof s=="function"&&i&&(s=s(n,e.t,e)),s)},getObj(t,n,e){let i=this.o[t];return typeof i=="function"&&n!=null&&(i=i(n,e.t,e)),i},render(t){const n=t.render(this);return(this.get("render",null,t)||this.defaultRender)(n,t.t,t)}};function Le(t){return t}function Pe(t,n){this.t="token",this.v=t,this.tk=n}Pe.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const n=this.toString(),e=t.get("truncate",n,this),i=t.get("format",n,this);return e&&i.length>e?i.substring(0,e)+"…":i},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=nt.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const n=this,e=this.toHref(t.get("defaultProtocol")),i=t.get("formatHref",e,this),s=t.get("tagName",e,n),o=this.toFormattedString(t),a={},l=t.get("className",e,n),d=t.get("target",e,n),h=t.get("rel",e,n),c=t.getObj("attributes",e,n),u=t.getObj("events",e,n);return a.href=i,l&&(a.class=l),d&&(a.target=d),h&&(a.rel=h),c&&Object.assign(a,c),{tagName:s,attributes:a,content:o,eventListeners:u}}};function Dt(t,n){class e extends Pe{constructor(s,o){super(s,o),this.t=t}}for(const i in n)e.prototype[i]=n[i];return e.t=t,e}const xe=Dt("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Te=Dt("text"),Ve=Dt("nl"),at=Dt("url",{isLink:!0,toHref(t=nt.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==et&&t[1].t===D}}),y=t=>new R(t);function Ye({groups:t}){const n=t.domain.concat([bt,yt,M,Ot,St,Nt,vt,It,O,ie,X,Pt,wt,Ht,N,Mt,tt,jt]),e=[Rt,D,oe,S,re,X,Z,ae,le,mt,gt,V,Y,dt,ut,ht,ft,pt,Et,kt,At,Lt,xt,Tt,Ct],i=[bt,Rt,yt,Ot,St,Nt,vt,It,O,V,Y,X,Pt,wt,Ht,Z,N,Mt,tt,jt],s=y(),o=r(s,tt);f(o,i,o),f(o,t.domain,o);const a=y(),l=y(),d=y();f(s,t.domain,a),f(s,t.scheme,l),f(s,t.slashscheme,d),f(a,i,o),f(a,t.domain,a);const h=r(a,M);r(o,M,h),r(l,M,h),r(d,M,h);const c=r(o,S);f(c,i,o),f(c,t.domain,o);const u=y();f(h,t.domain,u),f(u,t.domain,u);const m=r(u,S);f(m,t.domain,u);const p=y(xe);f(m,t.tld,p),f(m,t.utld,p),r(h,et,p);const b=r(u,O);r(b,O,b),f(b,t.domain,u),f(p,t.domain,u),r(p,S,m),r(p,O,b);const E=r(p,D);f(E,t.numeric,xe);const T=r(a,O),g=r(a,S);r(T,O,T),f(T,t.domain,a),f(g,i,o),f(g,t.domain,a);const L=y(at);f(g,t.tld,L),f(g,t.utld,L),f(L,t.domain,a),f(L,i,o),r(L,S,g),r(L,O,T),r(L,M,h);const it=r(L,D),_=y(at);f(it,t.numeric,_);const C=y(at),I=y();f(C,n,C),f(C,e,I),f(I,n,C),f(I,e,I),r(L,N,C),r(_,N,C);const q=r(l,D),je=r(d,D),Me=r(je,N),Ut=r(Me,N);f(l,t.domain,a),r(l,S,g),r(l,O,T),f(d,t.domain,a),r(d,S,g),r(d,O,T),f(q,t.domain,C),r(q,N,C),r(q,Z,C),f(Ut,t.domain,C),f(Ut,n,C),r(Ut,N,C);const fe=[[V,Y],[ut,dt],[ht,ft],[mt,gt],[pt,Et],[kt,At],[Lt,xt],[Tt,Ct]];for(let Bt=0;Bt<fe.length;Bt++){const[me,zt]=fe[Bt],st=r(C,me);r(I,me,st),r(st,zt,C);const z=y(at);f(st,n,z);const G=y();f(st,e),f(z,n,z),f(z,e,G),f(G,n,z),f(G,e,G),r(z,zt,C),r(G,zt,C)}return r(s,et,L),r(s,se,Ve),{start:s,tokens:ve}}function Xe(t,n,e){let i=e.length,s=0,o=[],a=[];for(;s<i;){let l=t,d=null,h=null,c=0,u=null,m=-1;for(;s<i&&!(d=l.go(e[s].t));)a.push(e[s++]);for(;s<i&&(h=d||l.go(e[s].t));)d=null,l=h,l.accepts()?(m=0,u=l):m>=0&&m++,s++,c++;if(m<0)s-=c,s<i&&(a.push(e[s]),s++);else{a.length>0&&(o.push(Qt(Te,n,a)),a=[]),s-=m,c-=m;const p=u.t,b=e.slice(s-c,s);o.push(Qt(p,n,b))}}return a.length>0&&o.push(Qt(Te,n,a)),o}function Qt(t,n,e){const i=e[0].s,s=e[e.length-1].e,o=n.slice(i,s);return new t(o,e)}const Ze=typeof console<"u"&&console&&console.warn||(()=>{}),tn="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",A={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function en(){return R.groups={},A.scanner=null,A.parser=null,A.tokenQueue=[],A.pluginQueue=[],A.customSchemes=[],A.initialized=!1,A}function Ce(t,n=!1){if(A.initialized&&Ze(`linkifyjs: already initialized - will not register custom scheme "${t}" ${tn}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
3
- 1. Must only contain digits, lowercase ASCII letters or "-"
4
- 2. Cannot start or end with "-"
5
- 3. "-" cannot repeat`);A.customSchemes.push([t,n])}function nn(){A.scanner=Qe(A.customSchemes);for(let t=0;t<A.tokenQueue.length;t++)A.tokenQueue[t][1]({scanner:A.scanner});A.parser=Ye(A.scanner.tokens);for(let t=0;t<A.pluginQueue.length;t++)A.pluginQueue[t][1]({scanner:A.scanner,parser:A.parser});return A.initialized=!0,A}function ue(t){return A.initialized||nn(),Xe(A.parser.start,t,Ie(A.scanner.start,t))}ue.scan=Ie;function we(t,n=null,e=null){if(n&&typeof n=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);e=n,n=null}const i=new ce(e),s=ue(t),o=[];for(let a=0;a<s.length;a++){const l=s[a];l.isLink&&(!n||l.t===n)&&i.check(l)&&o.push(l.toFormattedObject(i))}return o}var de="[\0-   ᠎ -\u2029  ]",sn=new RegExp(de),on=new RegExp(`${de}$`),rn=new RegExp(de,"g");function an(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function ln(t){return new K.Plugin({key:new K.PluginKey("autolink"),appendTransaction:(n,e,i)=>{const s=n.some(h=>h.docChanged)&&!e.doc.eq(i.doc),o=n.some(h=>h.getMeta("preventAutolink"));if(!s||o)return;const{tr:a}=i,l=v.combineTransactionSteps(e.doc,[...n]);if(v.getChangedRanges(l).forEach(({newRange:h})=>{const c=v.findChildrenInRange(i.doc,h,p=>p.isTextblock);let u,m;if(c.length>1)u=c[0],m=i.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const p=i.doc.textBetween(h.from,h.to," "," ");if(!on.test(p))return;u=c[0],m=i.doc.textBetween(u.pos,h.to,void 0," ")}if(u&&m){const p=m.split(sn).filter(Boolean);if(p.length<=0)return!1;const b=p[p.length-1],E=u.pos+m.lastIndexOf(b);if(!b)return!1;const T=ue(b).map(g=>g.toObject(t.defaultProtocol));if(!an(T))return!1;T.filter(g=>g.isLink).map(g=>({...g,from:E+g.start+1,to:E+g.end+1})).filter(g=>i.schema.marks.code?!i.doc.rangeHasMark(g.from,g.to,i.schema.marks.code):!0).filter(g=>t.validate(g.value)).filter(g=>t.shouldAutoLink(g.value)).forEach(g=>{v.getMarksBetween(g.from,g.to,i.doc).some(L=>L.mark.type===t.type)||a.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!a.steps.length)return a}})}function cn(t){return new K.Plugin({key:new K.PluginKey("handleClickLink"),props:{handleClick:(n,e,i)=>{var s,o;if(i.button!==0||!n.editable)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let l=null;if(i.target instanceof HTMLAnchorElement)l=i.target;else{let u=i.target;const m=[];for(;u.nodeName!=="DIV";)m.push(u),u=u.parentNode;l=m.find(p=>p.nodeName==="A")}if(!l)return a;const d=v.getAttributes(n.state,t.type.name),h=(s=l==null?void 0:l.href)!=null?s:d.href,c=(o=l==null?void 0:l.target)!=null?o:d.target;l&&h&&(window.open(h,c),a=!0)}return a}}})}function un(t){return new K.Plugin({key:new K.PluginKey("handlePasteLink"),props:{handlePaste:(n,e,i)=>{const{shouldAutoLink:s}=t,{state:o}=n,{selection:a}=o,{empty:l}=a;if(l)return!1;let d="";i.content.forEach(c=>{d+=c.textContent});const h=we(d,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===d);return!d||!h||s!==void 0&&!s(h.href)?!1:t.editor.commands.setMark(t.type,{href:h.href})}}})}function U(t,n){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return n&&n.forEach(i=>{const s=typeof i=="string"?i:i.scheme;s&&e.push(s)}),!t||t.replace(rn,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var dn=v.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Ce(t);return}Ce(t.scheme,t.optionalSlashes)})},onDestroy(){en()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,n)=>!!U(t,n.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const n=t.getAttribute("href");return!n||!this.options.isAllowedUri(n,{defaultValidate:e=>!!U(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:n=>!!U(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",v.mergeAttributes(this.options.HTMLAttributes,t),0]:["a",v.mergeAttributes(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,n)=>n.applyMark("link",n.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,n)=>{var e;const i=((e=t.attrs)==null?void 0:e.href)||"";return`[${n.renderChildren(t)}](${i})`},addCommands(){return{setLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:i=>!!U(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:n})=>{const{href:e}=t||{};return e&&!this.options.isAllowedUri(e,{defaultValidate:i=>!!U(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[v.markPasteRule({find:t=>{const n=[];if(t){const{protocols:e,defaultProtocol:i}=this.options,s=we(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!U(a,e),protocols:e,defaultProtocol:i}));s.length&&s.forEach(o=>{this.options.shouldAutoLink(o.value)&&n.push({text:o.value,data:{href:o.href},index:o.start})})}return n},type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)==null?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:n,defaultProtocol:e}=this.options;return this.options.autolink&&t.push(ln({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:s=>!!U(s,n),protocols:n,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),t.push(cn({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(un({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});function hn(){const[t,n]=W.useState(!1),e=lt.useEditorInstance(),i=lt.useButtonProps(he.name),{isActive:s,icon:o,tooltip:a,target:l,action:d}=(i==null?void 0:i.componentProps)??{},{dataState:h,editorDisabled:c,update:u}=lt.useToggleActive(s);function m(p,b,E){c||d&&(d({link:p,text:b,openInNewTab:E}),n(!1),u())}return i?k.jsxs(Ft.Popover,{modal:!0,onOpenChange:n,open:t,children:[k.jsx(Ft.PopoverTrigger,{asChild:!0,"data-state":h?"on":"off",disabled:c,children:k.jsx(De.ActionButton,{dataState:h,disabled:c,tooltip:a,children:k.jsx(be.IconComponent,{name:o})})}),k.jsx(Ft.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:k.jsx(He,{editor:e,onSetLink:m,open:t,target:l})})]}):k.jsx(k.Fragment,{})}const he=dn.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",v.mergeAttributes(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var e,i;const t=((e=this.parent)==null?void 0:e.call(this))||{},n=(i=t.HTMLAttributes)==null?void 0:i.target;return{...t,openOnClick:!1,button:({editor:s,t:o})=>({componentProps:{action:a=>{const{link:l,text:d,openInNewTab:h}=a;if(!l){s.chain().extendMarkRange("link").unsetLink().run();return}s.isActive("link")&&s.chain().extendMarkRange("link").run();const{from:c}=s.state.selection,u=d.length;s.chain().insertContent({type:"text",text:d,marks:[{type:"link",attrs:{href:/^https?:\/\//i.test(l)?l:`http://${l}`,target:n??(h?"_blank":"")}}]}).setLink({href:l}).setTextSelection({from:c,to:c+u}).focus().run()},isActive:()=>s.isActive("link"),disabled:!s.can().setLink({href:""}),icon:"Link",tooltip:o("editor.link.tooltip"),target:n}})}}});function He(t){const{t:n}=Ue.useLocale(),[e,i]=W.useState({text:"",link:""}),[s,o]=W.useState(!1),a=W.useRef(null),l=W.useRef(null),d=lt.useExtension(he.name);W.useEffect(()=>{const c=()=>{var it,_,C;const{from:u,to:m,empty:p}=t.editor.state.selection,b=d==null?void 0:d.options;let E="",T="",g=(it=b==null?void 0:b.HTMLAttributes)==null?void 0:it.target;const L=t.editor.state.doc.nodeAt(u);if(L){const I=L.marks.find(q=>q.type.name==="link");I?(T=I.attrs.href||"",g=I.attrs.target,p?E=L.text||"":E=t.editor.state.doc.textBetween(u,m," ")):E=t.editor.state.doc.textBetween(u,m," ")}L||(E=t.editor.state.doc.textBetween(u,m," ")),i({link:T,text:E}),o(t.target?t.target==="_blank":g==="_blank"),t.open&&(E===""?(_=a.current)==null||_.focus():(C=l.current)==null||C.focus())};return c(),t.editor.on("selectionUpdate",c),()=>{t.editor.off("selectionUpdate",c)}},[t.editor,d,t.open]);function h(c){c.preventDefault(),c.stopPropagation(),t==null||t.onSetLink(e.link,e.text,s),i({text:"",link:""})}return k.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-gap-2",children:[k.jsx(Wt.Label,{className:"mb-[6px]",children:n("editor.link.dialog.text")}),k.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:k.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:k.jsx(ge.Input,{className:"richtext-w-80",onChange:c=>i({...e,text:c.target.value}),placeholder:"Text",ref:a,required:!0,type:"text",value:e.text})})}),k.jsx(Wt.Label,{className:"mb-[6px]",children:n("editor.link.dialog.link")}),k.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:k.jsxs("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:[k.jsx(ge.Input,{className:"richtext-pl-10",onChange:c=>i({...e,link:c.target.value}),ref:l,required:!0,type:"url",value:e.link}),k.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2",children:k.jsx(be.IconComponent,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),!t.target&&k.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-1",children:[k.jsx(Be.Checkbox,{checked:s,onCheckedChange:c=>{o(c)}}),k.jsx(Wt.Label,{children:n("editor.link.dialog.openInNewTab")})]}),k.jsxs("div",{className:"richtext-mt-2 richtext-flex richtext-items-center richtext-justify-end richtext-gap-2",children:[(t==null?void 0:t.onClose)&&k.jsx(pe.Button,{onClick:t==null?void 0:t.onClose,type:"button",children:n("editor.link.dialog.button.cancel")}),k.jsx(pe.Button,{onClick:h,type:"button",children:n("editor.link.dialog.button.apply")})]})]})}exports.Link=he;exports.LinkEditBlock=He;exports.RichTextLink=hn;
@@ -1 +0,0 @@
1
- "use strict";const d=require("react/jsx-runtime"),m=require("react"),S=require("./index-Cn-t3Zxw.cjs");require("./theme.cjs");const b=require("./index-BsFvo9PG.cjs"),y=require("./store-DjkMIIEN.cjs"),w=require("./events.constant-Dq21NPdV.cjs"),C=require("./index-NsYff_Ni.cjs"),E=require("./label-tzSPdqui.cjs"),j=require("./Icon-DzK0_ztP.cjs"),D={setOpen:(i,s)=>{w.dispatchEvent(w.EVENTS.UPLOAD_VIDEO(i),s)}};function $({t:i}){const s=[{name:"format",title:i("editor.slash.format"),commands:[]},{name:"insert",title:i("editor.slash.insert"),commands:[]}];return b.HEADINGS.forEach(e=>{s[0].commands.push({name:`heading${e}`,label:i(e==="Paragraph"?"editor.paragraph.tooltip":`editor.heading.h${e}.tooltip`),aliases:[`h${e}`,"bt",`bt${e}`],iconName:`Heading${e}`,isActive:t=>e==="Paragraph"?!1:t.isActive("heading",{level:e})||!1,action:({editor:t,range:l})=>{const a=b.HEADINGS.find(u=>t.isActive("heading",{level:u}));if(e==="Paragraph"){a!==void 0&&a!=="Paragraph"&&t.commands.toggleHeading({level:a}),t.chain().focus().deleteRange(l).run();return}if(e){t.chain().focus().deleteRange(l).setHeading({level:e}).run();return}t.chain().focus().deleteRange(l).run()}})}),s[0].commands.push({name:"bulletList",label:i("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",isActive:e=>e.isActive("bulletList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}}),s[0].commands.push({name:"orderedlist",label:i("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",isActive:e=>e.isActive("orderedList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}}),s[0].commands.push({name:"taskList",label:i("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],isActive:e=>e.isActive("taskList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleTaskList().run()}}),s[0].commands.push({name:"blockquote",label:i("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",isActive:e=>e.isActive("blockquote"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setBlockquote().run()}}),s[0].commands.push({name:"codeBlock",label:i("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:e=>e.isActive("columns"),isActive:e=>e.isActive("codeBlock"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setCodeBlock().run()}}),s[1].commands.push({name:"image",label:i("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run(),y.actionDialogImage.setOpen(e.id,!0)}}),s[1].commands.push({name:"video",label:i("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run(),D.setOpen(e.id,!0)}}),s[1].commands.push({name:"table",label:i("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),s[1].commands.push({name:"horizontalRule",label:i("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setHorizontalRule().run()}}),s[1].commands.push({name:"columns",label:i("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:e})=>{e.chain().focus().insertColumns({cols:2}).run()}}),s}function N(i,s){return i.map(l=>({...l,commands:l.commands.filter(a=>{const u=a.label.toLowerCase().trim(),h=s.toLowerCase().trim();if(a.aliases){const p=a.aliases.map(x=>x.toLowerCase().trim()),r=u.match(h),f=p.some(x=>x.match(h));return r||f}return u.match(h)})})).filter(l=>l.commands.length>0)}const B=C.y([]);function L(){const[i,s]=C.V(B);return[i,s]}function V(i,s){const[e]=L(),[t,l]=m.useState(0),[a,u]=m.useState(0),h=m.useRef(null),{t:p}=b.useLocale(),r=N(e,i.query),f=m.useRef([]);m.useImperativeHandle(s,()=>({onKeyDown:x})),m.useEffect(()=>{if(!h.current)return;const o=a*1e3+t,n=f.current[o];n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})},[t,a]);function x({event:o}){return o.key==="ArrowUp"?(A(),!0):o.key==="ArrowDown"?(R(),!0):o.key==="Enter"?(I(),!0):!1}function A(){var c;if(r.length===0)return!1;let o=t-1,n=a;o<0&&(n=a-1,o=((c=r[n])==null?void 0:c.commands.length)-1||0),n<0&&(n=r.length-1,o=r[n].commands.length-1),l(o),u(n)}function R(){if(r.length===0)return!1;const o=r[a].commands;let n=t+1,c=a;o.length-1<n&&(n=0,c=a+1),r.length-1<c&&(c=0),l(n),u(c)}function I(){if(r.length===0||a===-1||t===-1)return!1;v(a,t)}function v(o,n){const c=r[o].commands[n];i==null||i.command(c)}function k(o,n){v(o,n)}function q(o,n,c){f.current[o*1e3+n]=c}return d.jsx("div",{className:"richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none","data-richtext-portal":!0,ref:h,children:r!=null&&r.length?d.jsx("div",{className:"richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5",children:r==null?void 0:r.map((o,n)=>d.jsxs(m.Fragment,{children:[d.jsx(E.Label,{className:"richtext-mx-[4px] richtext-mb-[4px] richtext-mt-[8px] !richtext-text-[0.65rem] richtext-uppercase ",children:o.title}),o.commands.map((c,g)=>d.jsxs("button",{onClick:()=>k(n,g),ref:H=>q(n,g,H),className:S.cn("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-text-foreground richtext-text-left richtext-w-full richtext-rounded-sm !richtext-outline-none !richtext-border-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ",{"bg-item-active":a===n&&t===g}),children:[c.iconUrl&&d.jsx("img",{alt:"",className:"richtext-size-6",src:c.iconUrl}),c.iconName&&d.jsx(j.IconComponent,{className:"!richtext-mr-1 !richtext-text-lg",name:c.iconName}),c.label]},`command-${g}`))]},`slash-${o.title}`))}):d.jsx("div",{className:"richtext-p-3",children:d.jsx("span",{className:"richtext-text-xs richtext-text-foreground",children:p("editor.slash.empty")})})})}const G=m.forwardRef(V);exports.SlashCommandNodeView=G;exports.renderCommandListDefault=$;exports.useFilterCommandList=N;exports.useSignalCommandList=L;
@@ -1,9 +0,0 @@
1
- "use strict";const g=require("./clsx-CXbNJWDD.cjs"),_e=require("@tiptap/pm/state"),D=require("./index-neeeY2o7.cjs"),A=require("react/jsx-runtime"),Ie=require("./toggle-C_SSvDRy.cjs"),W=require("react");require("./index-Cn-t3Zxw.cjs");require("./theme.cjs");const v=require("./index-BsFvo9PG.cjs"),X=require("./popover-C6Cya3Cz.cjs"),Z=require("./useButtonProps-Cz4W5dC8.cjs");let J,Y;if(typeof WeakMap<"u"){let t=new WeakMap;J=e=>t.get(e),Y=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;J=o=>{for(let l=0;l<t.length;l+=2)if(t[l]==o)return t[l+1]},Y=(o,l)=>(n==10&&(n=0),t[n++]=o,t[n++]=l)}var y=class{constructor(t,e,n,o){this.width=t,this.height=e,this.map=n,this.problems=o}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const o=e%this.width,l=e/this.width|0;let r=o+1,s=l+1;for(let i=1;r<this.width&&this.map[e+i]==n;i++)r++;for(let i=1;s<this.height&&this.map[e+this.width*i]==n;i++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(t,e){const{left:n,right:o,top:l,bottom:r}=this.findCell(t),{left:s,right:i,top:c,bottom:a}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(l,c),right:Math.max(o,i),bottom:Math.max(r,a)}}cellsInRect(t){const e=[],n={};for(let o=t.top;o<t.bottom;o++)for(let l=t.left;l<t.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==t.left&&l&&this.map[r-1]==s||o==t.top&&o&&this.map[r-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==t){let s=e+t*this.width;const i=(t+1)*this.width;for(;s<i&&this.map[s]<l;)s++;return s==i?r-1:this.map[s]}l=r}}static get(t){return J(t)||Y(t,Be(t))}};function Be(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=$e(t),n=t.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=e*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=t.child(a);d++;for(let p=0;;p++){for(;l<o.length&&o[l]!=0;)l++;if(p==u.childCount)break;const m=u.child(p),{colspan:b,rowspan:w,colwidth:x}=m.attrs;for(let R=0;R<w;R++){if(R+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-R});break}const L=l+R*e;for(let M=0;M<b;M++){o[L+M]==0?o[L+M]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:b-M});const $=x&&x[M];if($){const I=(L+M)%e*2,K=s[I];K==null||K!=$&&s[I+1]==1?(s[I]=$,s[I+1]=1):K==$&&s[I+1]++}}}l+=b,d+=m.nodeSize}const f=(a+1)*e;let h=0;for(;l<f;)o[l++]==0&&h++;h&&(r||(r=[])).push({type:"missing",row:a,n:h}),d++}(e===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const i=new y(e,n,o,r);let c=!1;for(let a=0;!c&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(c=!0);return c&&We(i,s,t),i}function $e(t){let e=-1,n=!1;for(let o=0;o<t.childCount;o++){const l=t.child(o);let r=0;if(n)for(let s=0;s<o;s++){const i=t.child(s);for(let c=0;c<i.childCount;c++){const a=i.child(c);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const i=l.child(s);r+=i.attrs.colspan,i.attrs.rowspan>1&&(n=!0)}e==-1?e=r:e!=r&&(e=Math.max(e,r))}return e}function We(t,e,n){t.problems||(t.problems=[]);const o={};for(let l=0;l<t.map.length;l++){const r=t.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let i=null;const c=s.attrs;for(let a=0;a<c.colspan;a++){const d=e[(l+a)%t.width*2];d!=null&&(!c.colwidth||c.colwidth[a]!=d)&&((i||(i=Fe(c)))[a]=d)}i&&t.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:i})}}function Fe(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function S(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const o=t.nodes[n],l=o.spec.tableRole;l&&(e[l]=o)}}return e}const z=new g.PluginKey("selectingCells");function _(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Pe(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function E(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function V(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=_(e.$head)||je(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function je(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const o=e.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const o=e.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Q(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Oe(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function oe(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Se(t,e,n){const o=t.node(-1),l=y.get(o),r=t.start(-1),s=l.nextCell(t.pos-r,e,n);return s==null?null:t.node(0).resolve(r+s)}function H(t,e,n=1){const o={...t,colspan:t.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(e,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(t,e,n=1){const o={...t,colspan:t.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(e,0,0)}return o}function qe(t,e,n){const o=S(e.type.schema).header_cell;for(let l=0;l<t.height;l++)if(e.nodeAt(t.map[n+l*t.width]).type!=o)return!1;return!0}var C=class k extends g.Selection{constructor(e,n=e){const o=e.node(-1),l=y.get(o),r=e.start(-1),s=l.rectBetween(e.pos-r,n.pos-r),i=e.node(0),c=l.cellsInRect(s).filter(d=>d!=n.pos-r);c.unshift(n.pos-r);const a=c.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new g.SelectionRange(i.resolve(f),i.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=e,this.$headCell=n}map(e,n){const o=e.resolve(n.map(this.$anchorCell.pos)),l=e.resolve(n.map(this.$headCell.pos));if(Q(o)&&Q(l)&&oe(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?k.rowSelection(o,l):r&&this.isColSelection()?k.colSelection(o,l):new k(o,l)}return g.TextSelection.between(o,l)}content(){const e=this.$anchorCell.node(-1),n=y.get(e),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let c=l.top;c<l.bottom;c++){const a=[];for(let d=c*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const h=n.findCell(f);let p=e.nodeAt(f);if(!p)throw new RangeError(`No cell with offset ${f} found`);const m=l.left-h.left,b=h.right-l.right;if(m>0||b>0){let w=p.attrs;if(m>0&&(w=H(w,0,m)),b>0&&(w=H(w,w.colspan-b,b)),h.left<l.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(h.top<l.top||h.bottom>l.bottom){const w={...p.attrs,rowspan:Math.min(h.bottom,l.bottom)-Math.max(h.top,l.top)};h.top<l.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}a.push(p)}s.push(e.child(c).copy(g.Fragment.from(a)))}const i=this.isColSelection()&&this.isRowSelection()?e:s;return new g.Slice(g.Fragment.from(i),1,1)}replace(e,n=g.Slice.empty){const o=e.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:i,$to:c}=l[s],a=e.mapping.slice(o);e.replace(a.map(i.pos),a.map(c.pos),s?g.Slice.empty:n)}const r=g.Selection.findFrom(e.doc.resolve(e.mapping.slice(o).map(this.to)),-1);r&&e.setSelection(r)}replaceWith(e,n){this.replace(e,new g.Slice(g.Fragment.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),o=y.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)e(n.nodeAt(r[s]),l+r[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const o=e+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const o=e.node(-1),l=y.get(o),r=e.start(-1),s=l.findCell(e.pos-r),i=l.findCell(n.pos-r),c=e.node(0);return s.top<=i.top?(s.top>0&&(e=c.resolve(r+l.map[s.left])),i.bottom<l.height&&(n=c.resolve(r+l.map[l.width*(l.height-1)+i.right-1]))):(i.top>0&&(n=c.resolve(r+l.map[i.left])),s.bottom<l.height&&(e=c.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new k(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=y.get(e),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,i)==n.width}eq(e){return e instanceof k&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const o=e.node(-1),l=y.get(o),r=e.start(-1),s=l.findCell(e.pos-r),i=l.findCell(n.pos-r),c=e.node(0);return s.left<=i.left?(s.left>0&&(e=c.resolve(r+l.map[s.top*l.width])),i.right<l.width&&(n=c.resolve(r+l.map[l.width*(i.top+1)-1]))):(i.left>0&&(n=c.resolve(r+l.map[i.top*l.width])),s.right<l.width&&(e=c.resolve(r+l.map[l.width*(s.top+1)-1]))),new k(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new k(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,o=n){return new k(e.resolve(n),e.resolve(o))}getBookmark(){return new Ge(this.$anchorCell.pos,this.$headCell.pos)}};C.prototype.visible=!1;g.Selection.jsonID("cell",C);var Ge=class Ae{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ae(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),o=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&oe(n,o)?new C(n,o):g.Selection.near(o,1)}};function Ve(t){if(!(t.selection instanceof C))return null;const e=[];return t.selection.forEachCell((n,o)=>{e.push(D.Decoration.node(o,o+n.nodeSize,{class:"selectedCell"}))}),D.DecorationSet.create(t.doc,e)}function Ke({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,o=e.pos,l=t.depth;for(;l>=0&&!(t.after(l+1)<t.end(l));l--,n++);for(let r=e.depth;r>=0&&!(e.before(r+1)>e.start(r));r--,o--);return n==o&&/row|table/.test(t.node(l).type.spec.tableRole)}function Xe({$from:t,$to:e}){let n,o;for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&e.parentOffset===0}function Ze(t,e,n){const o=(e||t).selection,l=(e||t).doc;let r,s;if(o instanceof g.NodeSelection&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=C.create(l,o.from);else if(s=="row"){const i=l.resolve(o.from+1);r=C.rowSelection(i,i)}else if(!n){const i=y.get(o.node),c=o.from+1,a=c+i.map[i.width*i.height-1];r=C.create(l,c+1,a)}}else o instanceof g.TextSelection&&Ke(o)?r=g.TextSelection.create(l,o.from):o instanceof g.TextSelection&&Xe(o)&&(r=g.TextSelection.create(l,o.$from.start(),o.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}const Ue=new g.PluginKey("fix-tables");function Te(t,e,n,o){const l=t.childCount,r=e.childCount;e:for(let s=0,i=0;s<r;s++){const c=e.child(s);for(let a=i,d=Math.min(l,s+3);a<d;a++)if(t.child(a)==c){i=a+1,n+=c.nodeSize;continue e}o(c,n),i<l&&t.child(i).sameMarkup(c)?Te(t.child(i),c,n+1,o):c.nodesBetween(0,c.content.size,o,n+1),n+=c.nodeSize}}function Re(t,e){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=Je(t,l,r,n))};return e?e.doc!=t.doc&&Te(e.doc,t.doc,0,o):t.doc.descendants(o),n}function Je(t,e,n,o){const l=y.get(e);if(!l.problems)return o;o||(o=t.tr);const r=[];for(let c=0;c<l.height;c++)r.push(0);for(let c=0;c<l.problems.length;c++){const a=l.problems[c];if(a.type=="collision"){const d=e.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,H(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=e.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=e.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+e.nodeSize)}}let s,i;for(let c=0;c<r.length;c++)r[c]&&(s==null&&(s=c),i=c);for(let c=0,a=n+1;c<l.height;c++){const d=e.child(c),u=a+d.nodeSize,f=r[c];if(f>0){let h="cell";d.firstChild&&(h=d.firstChild.type.spec.tableRole);const p=[];for(let b=0;b<f;b++){const w=S(t.schema)[h].createAndFill();w&&p.push(w)}const m=(c==0||s==c-1)&&i==c?a+1:u-1;o.insert(o.mapping.map(m),p)}a=u}return o.setMeta(Ue,{fixTables:!0})}function N(t){const e=t.selection,n=V(t),o=n.node(-1),l=n.start(-1),r=y.get(o);return{...e instanceof C?r.rectBetween(e.$anchorCell.pos-l,e.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function ve(t,{map:e,tableStart:n,table:o},l){let r=l>0?-1:0;qe(e,o,l+r)&&(r=l==0||l==e.width?null:0);for(let s=0;s<e.height;s++){const i=s*e.width+l;if(l>0&&l<e.width&&e.map[i-1]==e.map[i]){const c=e.map[i],a=o.nodeAt(c);t.setNodeMarkup(t.mapping.map(n+c),null,xe(a.attrs,l-e.colCount(c))),s+=a.attrs.rowspan-1}else{const c=r==null?S(o.type.schema).cell:o.nodeAt(e.map[i+r]).type,a=e.positionAt(s,l,o);t.insert(t.mapping.map(n+a),c.createAndFill())}}return t}function Ye(t,e){if(!E(t))return!1;if(e){const n=N(t);e(ve(t.tr,n,n.left))}return!0}function Qe(t,e){if(!E(t))return!1;if(e){const n=N(t);e(ve(t.tr,n,n.right))}return!0}function et(t,{map:e,table:n,tableStart:o},l){const r=t.mapping.maps.length;for(let s=0;s<e.height;){const i=s*e.width+l,c=e.map[i],a=n.nodeAt(c),d=a.attrs;if(l>0&&e.map[i-1]==c||l<e.width-1&&e.map[i+1]==c)t.setNodeMarkup(t.mapping.slice(r).map(o+c),null,H(d,l-e.colCount(c)));else{const u=t.mapping.slice(r).map(o+c);t.delete(u,u+a.nodeSize)}s+=d.rowspan}}function tt(t,e){if(!E(t))return!1;if(e){const n=N(t),o=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;et(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=y.get(r)}e(o)}return!0}function nt(t,e,n){var o;const l=S(e.type.schema).header_cell;for(let r=0;r<t.width;r++)if(((o=e.nodeAt(t.map[r+n*t.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Me(t,{map:e,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let i=l>0?-1:0;nt(e,o,l+i)&&(i=l==0||l==e.height?null:0);for(let a=0,d=e.width*l;a<e.width;a++,d++)if(l>0&&l<e.height&&e.map[d]==e.map[d-e.width]){const u=e.map[d],f=o.nodeAt(u).attrs;t.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var c;const u=i==null?S(o.type.schema).cell:(c=o.nodeAt(e.map[d+i*e.width]))===null||c===void 0?void 0:c.type,f=u==null?void 0:u.createAndFill();f&&s.push(f)}return t.insert(r,S(o.type.schema).row.create(null,s)),t}function ot(t,e){if(!E(t))return!1;if(e){const n=N(t);e(Me(t.tr,n,n.top))}return!0}function lt(t,e){if(!E(t))return!1;if(e){const n=N(t);e(Me(t.tr,n,n.bottom))}return!0}function rt(t,{map:e,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,i=t.mapping.maps.length;t.delete(r+o,s+o);const c=new Set;for(let a=0,d=l*e.width;a<e.width;a++,d++){const u=e.map[d];if(!c.has(u)){if(c.add(u),l>0&&u==e.map[d-e.width]){const f=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(i).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<e.height&&u==e.map[d+e.width]){const f=n.nodeAt(u),h=f.attrs,p=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(l+1,a,n);t.insert(t.mapping.slice(i).map(o+m),p),a+=h.colspan-1}}}}function st(t,e){if(!E(t))return!1;if(e){const n=N(t),o=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;rt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=y.get(n.table)}e(o)}return!0}function le(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function it({width:t,height:e,map:n},o){let l=o.top*t+o.left,r=l,s=(o.bottom-1)*t+o.left,i=l+(o.right-o.left-1);for(let c=o.top;c<o.bottom;c++){if(o.left>0&&n[r]==n[r-1]||o.right<t&&n[i]==n[i+1])return!0;r+=t,i+=t}for(let c=o.left;c<o.right;c++){if(o.top>0&&n[l]==n[l-t]||o.bottom<e&&n[s]==n[s+t])return!0;l++,s++}return!1}function re(t,e){const n=t.selection;if(!(n instanceof C)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=N(t),{map:l}=o;if(it(l,o))return!1;if(e){const r=t.tr,s={};let i=g.Fragment.empty,c,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],h=o.table.nodeAt(f);if(!(s[f]||!h))if(s[f]=!0,c==null)c=f,a=h;else{le(h)||(i=i.append(h.content));const p=r.mapping.map(f+o.tableStart);r.delete(p,p+h.nodeSize)}}if(c==null||a==null)return!0;if(r.setNodeMarkup(c+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),i.size>0){const d=c+1+a.content.size,u=le(a)?c+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,i)}r.setSelection(new C(r.doc.resolve(c+o.tableStart))),e(r)}return!0}function se(t,e){const n=S(t.schema);return ct(({node:o})=>n[o.type.spec.tableRole])(t,e)}function ct(t){return(e,n)=>{const o=e.selection;let l,r;if(o instanceof C){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Pe(o.$from),!l)return!1;r=(s=_(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let i=l.attrs;const c=[],a=i.colwidth;i.rowspan>1&&(i={...i,rowspan:1}),i.colspan>1&&(i={...i,colspan:1});const d=N(e),u=e.tr;for(let h=0;h<d.right-d.left;h++)c.push(a?{...i,colwidth:a&&a[h]?[a[h]]:null}:i);let f;for(let h=d.top;h<d.bottom;h++){let p=d.map.positionAt(h,d.left,d.table);h==d.top&&(p+=l.nodeSize);for(let m=d.left,b=0;m<d.right;m++,b++)m==d.left&&h==d.top||u.insert(f=u.mapping.map(p+d.tableStart,1),t({node:l,row:h,col:m}).createAndFill(c[b]))}u.setNodeMarkup(r,t({node:l,row:d.top,col:d.left}),c[0]),o instanceof C&&u.setSelection(new C(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function at(t,e){return function(n,o){if(!E(n))return!1;const l=V(n);if(l.nodeAfter.attrs[t]===e)return!1;if(o){const r=n.tr;n.selection instanceof C?n.selection.forEachCell((s,i)=>{s.attrs[t]!==e&&r.setNodeMarkup(i,null,{...s.attrs,[t]:e})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[t]:e}),o(r)}return!0}}function dt(t){return function(e,n){if(!E(e))return!1;if(n){const o=S(e.schema),l=N(e),r=e.tr,s=l.map.cellsInRect(t=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:t=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),i=s.map(c=>l.table.nodeAt(c));for(let c=0;c<s.length;c++)i[c].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[c],o.cell,i[c].attrs);if(r.steps.length===0)for(let c=0;c<s.length;c++)r.setNodeMarkup(l.tableStart+s[c],o.header_cell,i[c].attrs);n(r)}return!0}}function ie(t,e,n){const o=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let l=0;l<o.length;l++){const r=e.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function B(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?dt(t):function(n,o){if(!E(n))return!1;if(o){const l=S(n.schema),r=N(n),s=n.tr,i=ie("row",r,l),c=ie("column",r,l),a=(t==="column"?i:t==="row"&&c)?1:0,d=t=="column"?{left:0,top:a,right:1,bottom:r.map.height}:t=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=t=="column"?c?l.cell:l.header_cell:t=="row"?i?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const h=f+r.tableStart,p=s.doc.nodeAt(h);p&&s.setNodeMarkup(h,u,p.attrs)}),o(s)}return!0}}B("row",{useDeprecatedLogic:!0});B("column",{useDeprecatedLogic:!0});const ut=B("cell",{useDeprecatedLogic:!0});function ft(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let o=t.index(-1)-1,l=t.before();o>=0;o--){const r=t.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let o=t.indexAfter(-1),l=t.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function ce(t){return function(e,n){if(!E(e))return!1;const o=ft(V(e),t);if(o==null)return!1;if(n){const l=e.doc.resolve(o);n(e.tr.setSelection(g.TextSelection.between(l,Oe(l))).scrollIntoView())}return!0}}function ht(t,e){const n=t.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function F(t,e){const n=t.selection;if(!(n instanceof C))return!1;if(e){const o=t.tr,l=S(t.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new g.Slice(l,0,0))}),o.docChanged&&e(o)}return!0}function pt(t){if(t.size===0)return null;let{content:e,openStart:n,openEnd:o}=t;for(;e.childCount==1&&(n>0&&o>0||e.child(0).type.spec.tableRole=="table");)n--,o--,e=e.child(0).content;const l=e.child(0),r=l.type.spec.tableRole,s=l.type.schema,i=[];if(r=="row")for(let c=0;c<e.childCount;c++){let a=e.child(c).content;const d=c?0:Math.max(0,n-1),u=c<e.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=ee(S(s).row,new g.Slice(a,d,u)).content),i.push(a)}else if(r=="cell"||r=="header_cell")i.push(n||o?ee(S(s).row,new g.Slice(e,n,o)).content:e);else return null;return mt(s,i)}function mt(t,e){const n=[];for(let l=0;l<e.length;l++){const r=e[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:i,colspan:c}=r.child(s).attrs;for(let a=l;a<l+i;a++)n[a]=(n[a]||0)+c}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=e.length&&e.push(g.Fragment.empty),n[l]<o){const r=S(t).cell.createAndFill(),s=[];for(let i=n[l];i<o;i++)s.push(r);e[l]=e[l].append(g.Fragment.from(s))}return{height:e.length,width:o,rows:e}}function ee(t,e){const n=t.createAndFill();return new g.Transform(n).replace(0,n.content.size,e).doc}function gt({width:t,height:e,rows:n},o,l){if(t!=o){const r=[],s=[];for(let i=0;i<n.length;i++){const c=n[i],a=[];for(let d=r[i]||0,u=0;d<o;u++){let f=c.child(u%c.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(H(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)r[i+h]=(r[i+h]||0)+f.attrs.colspan}s.push(g.Fragment.from(a))}n=s,t=o}if(e!=l){const r=[];for(let s=0,i=0;s<l;s++,i++){const c=[],a=n[i%e];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),c.push(u)}r.push(g.Fragment.from(c))}n=r,e=l}return{width:t,height:e,rows:n}}function bt(t,e,n,o,l,r,s){const i=t.doc.type.schema,c=S(i);let a,d;if(l>e.width)for(let u=0,f=0;u<e.height;u++){const h=n.child(u);f+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==c.cell?m=a||(a=c.cell.createAndFill()):m=d||(d=c.header_cell.createAndFill());for(let b=e.width;b<l;b++)p.push(m);t.insert(t.mapping.slice(s).map(f-1+o),p)}if(r>e.height){const u=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,l);p++){const b=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==c.header_cell;u.push(b?d||(d=c.header_cell.createAndFill()):a||(a=c.cell.createAndFill()))}const f=c.row.create(null,g.Fragment.from(u)),h=[];for(let p=e.height;p<r;p++)h.push(f);t.insert(t.mapping.slice(s).map(o+n.nodeSize-2),h)}return!!(a||d)}function ae(t,e,n,o,l,r,s,i){if(s==0||s==e.height)return!1;let c=!1;for(let a=l;a<r;a++){const d=s*e.width+a,u=e.map[d];if(e.map[d-e.width]==u){c=!0;const f=n.nodeAt(u),{top:h,left:p}=e.findCell(u);t.setNodeMarkup(t.mapping.slice(i).map(u+o),null,{...f.attrs,rowspan:s-h}),t.insert(t.mapping.slice(i).map(e.positionAt(s,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return c}function de(t,e,n,o,l,r,s,i){if(s==0||s==e.width)return!1;let c=!1;for(let a=l;a<r;a++){const d=a*e.width+s,u=e.map[d];if(e.map[d-1]==u){c=!0;const f=n.nodeAt(u),h=e.colCount(u),p=t.mapping.slice(i).map(u+o);t.setNodeMarkup(p,null,H(f.attrs,s-h,f.attrs.colspan-(s-h))),t.insert(p+f.nodeSize,f.type.createAndFill(H(f.attrs,0,s-h))),a+=f.attrs.rowspan-1}}return c}function ue(t,e,n,o,l){let r=n?t.doc.nodeAt(n-1):t.doc;if(!r)throw new Error("No table found");let s=y.get(r);const{top:i,left:c}=o,a=c+l.width,d=i+l.height,u=t.tr;let f=0;function h(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=y.get(r),f=u.mapping.maps.length}bt(u,s,r,n,a,d,f)&&h(),ae(u,s,r,n,c,a,i,f)&&h(),ae(u,s,r,n,c,a,d,f)&&h(),de(u,s,r,n,i,d,c,f)&&h(),de(u,s,r,n,i,d,a,f)&&h();for(let p=i;p<d;p++){const m=s.positionAt(p,c,r),b=s.positionAt(p,a,r);u.replace(u.mapping.slice(f).map(m+n),u.mapping.slice(f).map(b+n),new g.Slice(l.rows[p-i],0,0))}h(),u.setSelection(new C(u.doc.resolve(n+s.positionAt(i,c,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),e(u)}const wt=D.keydownHandler({ArrowLeft:P("horiz",-1),ArrowRight:P("horiz",1),ArrowUp:P("vert",-1),ArrowDown:P("vert",1),"Shift-ArrowLeft":j("horiz",-1),"Shift-ArrowRight":j("horiz",1),"Shift-ArrowUp":j("vert",-1),"Shift-ArrowDown":j("vert",1),Backspace:F,"Mod-Backspace":F,Delete:F,"Mod-Delete":F});function q(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function P(t,e){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof C)return q(n,o,g.Selection.near(r.$headCell,e));if(t!="horiz"&&!r.empty)return!1;const s=Ee(l,t,e);if(s==null)return!1;if(t=="horiz")return q(n,o,g.Selection.near(n.doc.resolve(r.head+e),e));{const i=n.doc.resolve(s),c=Se(i,t,e);let a;return c?a=g.Selection.near(c,1):e<0?a=g.Selection.near(n.doc.resolve(i.before(-1)),-1):a=g.Selection.near(n.doc.resolve(i.after(-1)),1),q(n,o,a)}}}function j(t,e){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof C)s=r;else{const c=Ee(l,t,e);if(c==null)return!1;s=new C(n.doc.resolve(c))}const i=Se(s.$headCell,t,e);return i?q(n,o,new C(s.$anchorCell,i)):!1}}function Ct(t,e){const n=t.state.doc,o=_(n.resolve(e));return o?(t.dispatch(t.state.tr.setSelection(new C(o))),!0):!1}function yt(t,e,n){if(!E(t.state))return!1;let o=pt(n);const l=t.state.selection;if(l instanceof C){o||(o={width:1,height:1,rows:[g.Fragment.from(ee(S(t.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),i=y.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=gt(o,i.right-i.left,i.bottom-i.top),ue(t.state,t.dispatch,s,i,o),!0}else if(o){const r=V(t.state),s=r.start(-1);return ue(t.state,t.dispatch,s,y.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function St(t,e){var n;if(e.ctrlKey||e.metaKey)return;const o=fe(t,e.target);let l;if(e.shiftKey&&t.state.selection instanceof C)r(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&o&&(l=_(t.state.selection.$anchor))!=null&&((n=U(t,e))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,e),e.preventDefault();else if(!o)return;function r(c,a){let d=U(t,a);const u=z.getState(t.state)==null;if(!d||!oe(c,d))if(u)d=c;else return;const f=new C(c,d);if(u||!t.state.selection.eq(f)){const h=t.state.tr.setSelection(f);u&&h.setMeta(z,c.pos),t.dispatch(h)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",i),z.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(z,-1))}function i(c){const a=c,d=z.getState(t.state);let u;if(d!=null)u=t.state.doc.resolve(d);else if(fe(t,a.target)!=o&&(u=U(t,e),!u))return s();u&&r(u,a)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",i)}function Ee(t,e,n){if(!(t.state.selection instanceof g.TextSelection))return null;const{$head:o}=t.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),i=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(i)?s:null}}return null}function fe(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function U(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;const o=n.inside>=0?n.inside:n.pos;return _(t.state.doc.resolve(o))}var xt=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),te(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,te(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function te(t,e,n,o,l,r){let s=0,i=!0,c=e.firstChild;const a=t.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:h,colwidth:p}=a.child(u).attrs;for(let m=0;m<h;m++,f++){const b=l==f?r:p&&p[m],w=b?b+"px":"";if(s+=b||o,b||(i=!1),c)c.style.width!=w&&(c.style.width=w),c=c.nextSibling;else{const x=document.createElement("col");x.style.width=w,e.appendChild(x)}}}for(;c;){var d;const u=c.nextSibling;(d=c.parentNode)===null||d===void 0||d.removeChild(c),c=u}i?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const T=new g.PluginKey("tableColumnResizing");function At({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:o=xt,lastColumnResizable:l=!0}={}){const r=new g.Plugin({key:T,state:{init(s,i){var c;const a=(c=r.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,d=S(i.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Tt(-1,!1)},apply(s,i){return i.apply(s)}},props:{attributes:s=>{const i=T.getState(s);return i&&i.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,i)=>{Rt(s,i,t,l)},mouseleave:s=>{vt(s)},mousedown:(s,i)=>{Mt(s,i,e,n)}},decorations:s=>{const i=T.getState(s);if(i&&i.activeHandle>-1)return zt(s,i.activeHandle)},nodeViews:{}}});return r}var Tt=class G{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,o=e.getMeta(T);if(o&&o.setHandle!=null)return new G(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new G(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&e.docChanged){let l=e.mapping.map(n.activeHandle,-1);return Q(e.doc.resolve(l))||(l=-1),new G(l,n.dragging)}return n}};function Rt(t,e,n,o){if(!t.editable)return;const l=T.getState(t.state);if(l&&!l.dragging){const r=Nt(e.target);let s=-1;if(r){const{left:i,right:c}=r.getBoundingClientRect();e.clientX-i<=n?s=he(t,e,"left",n):c-e.clientX<=n&&(s=he(t,e,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const i=t.state.doc.resolve(s),c=i.node(-1),a=y.get(c),d=i.start(-1);if(a.colCount(i.pos-d)+i.nodeAfter.attrs.colspan-1==a.width-1)return}Ne(t,s)}}}function vt(t){if(!t.editable)return;const e=T.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Ne(t,-1)}function Mt(t,e,n,o){var l;if(!t.editable)return!1;const r=(l=t.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=T.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const i=t.state.doc.nodeAt(s.activeHandle),c=Et(t,s.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(T,{setDragging:{startX:e.clientX,startWidth:c}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=T.getState(t.state);f!=null&&f.dragging&&(kt(t,f.activeHandle,pe(f.dragging,u,n)),t.dispatch(t.state.tr.setMeta(T,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=T.getState(t.state);if(f&&f.dragging){const h=pe(f.dragging,u,n);me(t,f.activeHandle,h,o)}}return me(t,s.activeHandle,c,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),e.preventDefault(),!0}function Et(t,e,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=t.domAtPos(e);let s=r.node.childNodes[r.offset].offsetWidth,i=n;if(o)for(let c=0;c<n;c++)o[c]&&(s-=o[c],i--);return s/i}function Nt(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function he(t,e,n,o){const l=n=="right"?-o:o,r=t.posAtCoords({left:e.clientX+l,top:e.clientY});if(!r)return-1;const{pos:s}=r,i=_(t.state.doc.resolve(s));if(!i)return-1;if(n=="right")return i.pos;const c=y.get(i.node(-1)),a=i.start(-1),d=c.map.indexOf(i.pos-a);return d%c.width==0?-1:a+c.map[d-1]}function pe(t,e,n){const o=e.clientX-t.startX;return Math.max(n,t.startWidth+o)}function Ne(t,e){t.dispatch(t.state.tr.setMeta(T,{setHandle:e}))}function kt(t,e,n){const o=t.state.doc.resolve(e),l=o.node(-1),r=y.get(l),s=o.start(-1),i=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,c=t.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+i;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,h=f.colspan==1?0:i-r.colCount(u);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():Lt(f.colspan);p[h]=n,c.setNodeMarkup(s+u,null,{...f,colwidth:p})}c.docChanged&&t.dispatch(c)}function me(t,e,n,o){const l=t.state.doc.resolve(e),r=l.node(-1),s=l.start(-1),i=y.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let c=t.domAtPos(l.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&te(r,c.firstChild,c,o,i,n)}function Lt(t){return Array(t).fill(0)}function zt(t,e){const n=[],o=t.doc.resolve(e),l=o.node(-1);if(!l)return D.DecorationSet.empty;const r=y.get(l),s=o.start(-1),i=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=i+a*r.width;if((i==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var c;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((c=T.getState(t))===null||c===void 0)&&c.dragging&&n.push(D.Decoration.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(D.Decoration.widget(f,h))}}return D.DecorationSet.create(t.doc,n)}function Dt({allowTableNodeSelection:t=!1}={}){return new g.Plugin({key:z,state:{init(){return null},apply(e,n){const o=e.getMeta(z);if(o!=null)return o==-1?null:o;if(n==null||!e.docChanged)return n;const{deleted:l,pos:r}=e.mapping.mapResult(n);return l?null:r}},props:{decorations:Ve,handleDOMEvents:{mousedown:St},createSelectionBetween(e){return z.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Ct,handleKeyDown:wt,handlePaste:yt},appendTransaction(e,n,o){return Ze(o,Re(o,n),t)}})}var ke=g.Node3.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var e,n;const o=t.getAttribute("colwidth"),l=o?o.split(",").map(r=>parseInt(r,10)):null;if(!l){const r=(e=t.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),s=Array.from(((n=t.parentElement)==null?void 0:n.children)||[]).indexOf(t);if(s&&s>-1&&r&&r[s]){const i=r[s].getAttribute("width");return i?[parseInt(i,10)]:null}}return l}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",g.mergeAttributes(this.options.HTMLAttributes,t),0]}}),Le=g.Node3.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(o=>parseInt(o,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",g.mergeAttributes(this.options.HTMLAttributes,t),0]}}),ze=g.Node3.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",g.mergeAttributes(this.options.HTMLAttributes,t),0]}});function ne(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function ge(t,e,n,o,l,r){var s;let i=0,c=!0,a=e.firstChild;const d=t.firstChild;if(d!==null)for(let f=0,h=0;f<d.childCount;f+=1){const{colspan:p,colwidth:m}=d.child(f).attrs;for(let b=0;b<p;b+=1,h+=1){const w=l===h?r:m&&m[b],x=w?`${w}px`:"";if(i+=w||o,w||(c=!1),a){if(a.style.width!==x){const[R,L]=ne(o,w);a.style.setProperty(R,L)}a=a.nextSibling}else{const R=document.createElement("col"),[L,M]=ne(o,w);R.style.setProperty(L,M),e.appendChild(R)}}}for(;a;){const f=a.nextSibling;(s=a.parentNode)==null||s.removeChild(a),a=f}const u=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);c&&!u?(n.style.width=`${i}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${i}px`)}var Ht=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ge(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,ge(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),o=this.contentDOM.contains(e);return!!(n&&!o&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function _t(t,e,n,o){let l=0,r=!0;const s=[],i=t.firstChild;if(!i)return{};for(let u=0,f=0;u<i.childCount;u+=1){const{colspan:h,colwidth:p}=i.child(u).attrs;for(let m=0;m<h;m+=1,f+=1){const b=n===f?o:p&&p[m];l+=b||e,b||(r=!1);const[w,x]=ne(e,b);s.push(["col",{style:`${w}: ${x}`}])}}const c=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:c,tableMinWidth:a}}function be(t,e){return t.createAndFill()}function It(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const o=t.nodes[n];o.spec.tableRole&&(e[o.spec.tableRole]=o)}),t.cached.tableNodeTypes=e,e}function Bt(t,e,n,o,l){const r=It(t),s=[],i=[];for(let a=0;a<n;a+=1){const d=be(r.cell);if(d&&i.push(d),o){const u=be(r.header_cell);u&&s.push(u)}}const c=[];for(let a=0;a<e;a+=1)c.push(r.row.createChecked(null,o&&a===0?s:i));return r.table.createChecked(null,c)}function $t(t){return t instanceof C}var O=({editor:t})=>{const{selection:e}=t.state;if(!$t(e))return!1;let n=0;const o=g.findParentNodeClosestToPos(e.ranges[0].$from,r=>r.type.name==="table");return o==null||o.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Wt="";function Ft(t){return(t||"").replace(/\s+/g," ").trim()}function Pt(t,e,n={}){var o;const l=(o=n.cellLineSeparator)!=null?o:Wt;if(!t||!t.content||t.content.length===0)return"";const r=[];t.content.forEach(p=>{const m=[];p.content&&p.content.forEach(b=>{let w="";b.content&&Array.isArray(b.content)&&b.content.length>1?w=b.content.map(M=>e.renderChildren(M)).join(l):w=b.content?e.renderChildren(b.content):"";const x=Ft(w),R=b.type==="tableHeader";m.push({text:x,isHeader:R})}),r.push(m)});const s=r.reduce((p,m)=>Math.max(p,m.length),0);if(s===0)return"";const i=new Array(s).fill(0);r.forEach(p=>{var m;for(let b=0;b<s;b+=1){const x=(((m=p[b])==null?void 0:m.text)||"").length;x>i[b]&&(i[b]=x),i[b]<3&&(i[b]=3)}});const c=(p,m)=>p+" ".repeat(Math.max(0,m-p.length)),a=r[0],d=a.some(p=>p.isHeader);let u=`
2
- `;const f=new Array(s).fill(0).map((p,m)=>d&&a[m]&&a[m].text||"");return u+=`| ${f.map((p,m)=>c(p,i[m])).join(" | ")} |
3
- `,u+=`| ${i.map(p=>"-".repeat(Math.max(3,p))).join(" | ")} |
4
- `,(d?r.slice(1):r).forEach(p=>{u+=`| ${new Array(s).fill(0).map((m,b)=>c(p[b]&&p[b].text||"",i[b])).join(" | ")} |
5
- `}),u}var jt=Pt,De=g.Node3.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Ht,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:o,tableMinWidth:l}=_t(t,this.options.cellMinWidth),r=e.style;function s(){return r||(o?`width: ${o}`:`min-width: ${l}`)}const i=["table",g.mergeAttributes(this.options.HTMLAttributes,e,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},i]:i},parseMarkdown:(t,e)=>{const n=[];if(t.header){const o=[];t.header.forEach(l=>{o.push(e.createNode("tableHeader",{},[{type:"paragraph",content:e.parseInline(l.tokens)}]))}),n.push(e.createNode("tableRow",{},o))}return t.rows&&t.rows.forEach(o=>{const l=[];o.forEach(r=>{l.push(e.createNode("tableCell",{},[{type:"paragraph",content:e.parseInline(r.tokens)}]))}),n.push(e.createNode("tableRow",{},l))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>jt(t,e),addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:o,dispatch:l,editor:r})=>{const s=Bt(r.schema,t,e,n);if(l){const i=o.selection.from+1;o.replaceSelectionWith(s).scrollIntoView().setSelection(_e.TextSelection.near(o.doc.resolve(i)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Ye(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Qe(t,e),deleteColumn:()=>({state:t,dispatch:e})=>tt(t,e),addRowBefore:()=>({state:t,dispatch:e})=>ot(t,e),addRowAfter:()=>({state:t,dispatch:e})=>lt(t,e),deleteRow:()=>({state:t,dispatch:e})=>st(t,e),deleteTable:()=>({state:t,dispatch:e})=>ht(t,e),mergeCells:()=>({state:t,dispatch:e})=>re(t,e),splitCell:()=>({state:t,dispatch:e})=>se(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>B("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>B("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>ut(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>re(t,e)?!0:se(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:o})=>at(t,e)(n,o),goToNextCell:()=>({state:t,dispatch:e})=>ce(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>ce(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Re(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const o=C.create(e.doc,t.anchorCell,t.headCell);e.setSelection(o)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:O,"Mod-Backspace":O,Delete:O,"Mod-Delete":O}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[At({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Dt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:g.callOrReturn(g.getExtensionField(t,"tableRole",e))}}});g.Extension.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(De.configure(this.options.table)),this.options.tableCell!==!1&&t.push(ke.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(Le.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(ze.configure(this.options.tableRow)),t}});function Ot(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o||n===o.attrs.backgroundColor)return t;const l={...o.attrs,backgroundColor:n};return t.setNodeMarkup(e,o.type,l,o.marks)}function qt(t,e,n){const{doc:o,selection:l}=t;return!o||!l||!(l instanceof C)||l.forEachCell((r,s)=>{t=Ot(t,s,n)}),t}function we(t,e){return({tr:n,state:o,dispatch:l})=>{const{selection:r}=o;return n=n.setSelection(r),n=qt(n,e,t),n.docChanged?(l==null||l(n),!0):!1}}const Gt=g.Extension.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>we(t,this.options),unsetTableCellBackground:()=>we("",this.options)}}}),Vt=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,Kt=/CrOS/,Xt=/android|ipad|playbook|silk/i;function Ce(t={}){let e=t.ua||typeof navigator<"u"&&navigator.userAgent;return e&&typeof e=="object"&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string"?!1:!!(Vt.test(e)&&!Kt.test(e)||t.tablet&&Xt.test(e)||t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.includes("Macintosh")&&e.includes("Safari"))}const ye=t=>Array.from({length:t}).map((e,n)=>n+1);function Zt(t){var f;const[e,n]=W.useState(!1),[o,l]=W.useState(!0),[r,s]=W.useState({rows:Ce()?v.TABLE_MAX_GRID_SIZE:v.TABLE_INIT_GRID_SIZE,cols:Ce()?v.TABLE_MAX_GRID_SIZE:v.TABLE_INIT_GRID_SIZE}),[i,c]=W.useState({rows:v.TABLE_DEFAULT_SELECTED_GRID_SIZE,cols:v.TABLE_DEFAULT_SELECTED_GRID_SIZE});function a(h,p){h===r.rows&&s(m=>({...m,rows:Math.min(h+1,v.TABLE_MAX_GRID_SIZE)})),p===r.cols&&s(m=>({...m,cols:Math.min(p+1,v.TABLE_MAX_GRID_SIZE)})),c({rows:h,cols:p})}function d(h,p){t==null||t.createTable({rows:h,cols:p,withHeaderRow:o}),u(),n(!1)}function u(){l(!1),s({rows:v.TABLE_INIT_GRID_SIZE,cols:v.TABLE_INIT_GRID_SIZE}),c({rows:v.TABLE_DEFAULT_SELECTED_GRID_SIZE,cols:v.TABLE_DEFAULT_SELECTED_GRID_SIZE})}return A.jsxs(X.Popover,{modal:!0,onOpenChange:n,open:e,children:[A.jsx(X.PopoverTrigger,{asChild:!0,"data-state":t!=null&&t.dataState?"on":"off",children:t==null?void 0:t.children}),A.jsx(X.PopoverContent,{align:"start",className:"richtext-w-full !richtext-p-2",side:"bottom",children:A.jsxs("div",{className:"table-grid-size-editor richtext-p-0",children:[A.jsx("div",{className:"richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1",children:(f=ye(r==null?void 0:r.rows))==null?void 0:f.map(h=>{var p;return A.jsx("div",{className:"richtext-flex richtext-gap-1",children:(p=ye(r==null?void 0:r.cols))==null?void 0:p.map(m=>A.jsx("div",{onMouseDown:()=>d(h,m),onMouseOver:()=>a(h,m),className:`richtext-cursor-pointer richtext-border-border ${m<=i.cols&&h<=i.rows&&"tableCellActive !richtext-bg-foreground"}`,children:A.jsx("div",{className:"richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1"})},`richtext-table-col-${m}`))},`richtext-table-row-${h}`)})}),A.jsxs("div",{className:"richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-foreground",children:[i.rows,"x",i.cols]})]})})]})}function Ut(){const t=Z.useEditorInstance(),e=Z.useButtonProps(He.name),{icon:n=void 0,tooltip:o=void 0,action:l=void 0,isActive:r=void 0,color:s}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:c}=Z.useToggleActive(r);if(!e)return A.jsx(A.Fragment,{});function a(d){t.chain().focus().insertTable({...d,withHeaderRow:!1}).run()}return A.jsx(Zt,{createTable:a,dataState:i,children:A.jsx(Ie.ActionButton,{action:l,color:s,dataState:i,icon:n,isActive:r,tooltip:o,disabled:c})})}const He=De.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{style:`
6
- border: 1px solid #000;
7
- border-collapse: collapse;
8
- width: 100%;
9
- `},resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:n})=>({componentProps:{isActive:()=>e.isActive("table"),icon:"Table",tooltip:n("editor.table.tooltip")}})}},addExtensions(){return[ze.configure(this.options.tableRow),Le.configure(this.options.tableHeader),ke.configure(this.options.tableCell),Gt.configure(this.options.tableCellBackground)]}});exports.CellSelection=C;exports.RichTextTable=Ut;exports.Table=He;
@@ -1 +0,0 @@
1
- "use strict";const S=require("./clsx-CXbNJWDD.cjs"),t=require("react/jsx-runtime"),h=require("react"),qt=require("./toggle-C_SSvDRy.cjs");require("./index-Cn-t3Zxw.cjs");require("./theme.cjs");const $t=require("./index-BsFvo9PG.cjs"),Dt=require("./label-tzSPdqui.cjs"),At=require("./input-ZGRt7lWR.cjs"),Mt=require("./button-CqJztfH2.cjs"),je=require("./useButtonProps-Cz4W5dC8.cjs"),we=require("./popover-C6Cya3Cz.cjs"),Vt=require("./Icon-DzK0_ztP.cjs"),Wt="_verified_lvyh0_1",We={verified:Wt},Bt=()=>t.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:We.verified,children:t.jsx("g",{children:t.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Pt=()=>t.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:t.jsxs("g",{children:[t.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[t.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),t.jsx("stop",{offset:".539",stopColor:"#cd8105"}),t.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),t.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),t.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),t.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[t.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),t.jsx("stop",{offset:".406",stopColor:"#e2b719"}),t.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),t.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[t.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),t.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),t.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Ft=()=>t.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:t.jsx("g",{children:t.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),Ut="_root_98iqw_1",zt="_article_98iqw_21",et={root:Ut,article:zt},Be=({className:e,children:n})=>t.jsx("div",{className:S.clsx("react-tweet-theme",et.root,e),children:t.jsx("article",{className:et.article,children:n})}),ht=e=>t.jsx("img",{...e}),Ht="_verifiedOld_lcna5_1",Gt="_verifiedBlue_lcna5_4",Xt="_verifiedGovernment_lcna5_7",ye={verifiedOld:Ht,verifiedBlue:Gt,verifiedGovernment:Xt},_t=({user:e,className:n})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=t.jsx(Bt,{}),o=ye.verifiedBlue;if(r)switch(e.is_blue_verified||(o=ye.verifiedOld),e.verified_type){case"Government":s=t.jsx(Ft,{}),o=ye.verifiedGovernment;break;case"Business":s=t.jsx(Pt,{}),o=null;break}return r?t.jsx("div",{className:S.clsx(n,o),children:s}):null},Kt="_label_36ucz_1",Qt={label:Kt},mt=({user:e,className:n})=>{var r;const s=e.highlighted_label;if(!s)return null;const o=(r=s.badge)==null?void 0:r.url;return o?t.jsx("div",{className:S.clsx(Qt.label,n),children:t.jsx("img",{src:o,alt:s.description})}):null},Jt="_header_nqq4j_1",Yt="_avatar_nqq4j_11",Zt="_avatarOverflow_nqq4j_16",en="_avatarSquare_nqq4j_23",tn="_avatarShadow_nqq4j_26",nn="_author_nqq4j_37",rn="_authorLink_nqq4j_44",sn="_authorVerified_nqq4j_53",on="_authorLinkText_nqq4j_56",an="_authorMeta_nqq4j_63",cn="_authorFollow_nqq4j_66",ln="_username_nqq4j_69",dn="_follow_nqq4j_74",un="_separator_nqq4j_82",fn="_brand_nqq4j_86",hn="_twitterIcon_nqq4j_90",T={header:Jt,avatar:Yt,avatarOverflow:Zt,avatarSquare:en,avatarShadow:tn,author:nn,authorLink:rn,authorVerified:sn,authorLinkText:on,authorMeta:an,authorFollow:cn,username:ln,follow:dn,separator:un,brand:fn,twitterIcon:hn},_n=({tweet:e,components:n})=>{var r;const s=(r=n==null?void 0:n.AvatarImg)!=null?r:ht,{user:o}=e;return t.jsxs("div",{className:T.header,children:[t.jsxs("a",{href:e.url,className:T.avatar,target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:S.clsx(T.avatarOverflow,o.profile_image_shape==="Square"&&T.avatarSquare),children:t.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),t.jsx("div",{className:T.avatarOverflow,children:t.jsx("div",{className:T.avatarShadow})})]}),t.jsxs("div",{className:T.author,children:[t.jsxs("a",{href:e.url,className:T.authorLink,target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:T.authorLinkText,children:t.jsx("span",{title:o.name,children:o.name})}),t.jsx(_t,{user:o,className:T.authorVerified}),t.jsx(mt,{user:o})]}),t.jsxs("div",{className:T.authorMeta,children:[t.jsx("a",{href:e.url,className:T.username,target:"_blank",rel:"noopener noreferrer",children:t.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),t.jsxs("div",{className:T.authorFollow,children:[t.jsx("span",{className:T.separator,children:"·"}),t.jsx("a",{href:o.follow_url,className:T.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),t.jsx("a",{href:e.url,className:T.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:T.twitterIcon,children:t.jsx("g",{children:t.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},mn="_root_1ec15_1",pn={root:mn},xn=({tweet:e})=>t.jsxs("a",{href:e.in_reply_to_url,className:pn.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),vn="_root_eihfa_1",gn={root:vn},pt=({href:e,children:n})=>t.jsx("a",{href:e,className:gn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:n}),jn="_root_1xq52_1",wn={root:jn},yn=({tweet:e})=>t.jsxs("p",{className:wn.root,lang:e.lang,dir:"auto",children:[e.entities.map((n,r)=>{switch(n.type){case"hashtag":case"mention":case"url":case"symbol":return t.jsx(pt,{href:n.href,children:n.text},r);case"media":return;default:return t.jsx("span",{dangerouslySetInnerHTML:{__html:n.text}},r)}}),e.note_tweet?t.jsx(bn,{tweet:e}):null]});function bn({tweet:e}){return t.jsxs(pt,{href:e.url,children:[t.jsx("span",{children:" "}),"Show more"]})}const Tn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Nn=new Intl.DateTimeFormat("en-US",Tn),Rn=e=>{const n={};for(const r of e)n[r.type]=r.value;return n},Sn=e=>{const n=Rn(Nn.formatToParts(e)),r=`${n.hour}:${n.minute} ${n.dayPeriod}`,s=`${n.month} ${n.day}, ${n.year}`;return`${r} · ${s}`},tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,In=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,kn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,En=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,Cn=e=>`https://x.com/hashtag/${e.text}`,On=e=>`https://x.com/search?q=%24${e.text}`,Ln=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(e,n)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",n),r.toString()):e.media_url_https},qn=e=>{const{variants:n}=e.video_info;return n.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var a,i;return((a=o.bitrate)!=null?a:0)-((i=s.bitrate)!=null?i:0)})},$n=e=>{const n=qn(e);return n.length>1?n[1]:n[0]},Ce=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const n=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ce(r,"hashtag",e.entities.hashtags),ce(r,"mention",e.entities.user_mentions),ce(r,"url",e.entities.urls),ce(r,"symbol",e.entities.symbols),e.entities.media&&ce(r,"media",e.entities.media),Dn(e,r),r.map(s=>{const o=n.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:Cn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:On(s),text:o});default:return Object.assign(s,{text:o})}})}function ce(e,n,r){for(const s of r)for(const[o,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const i=[{...s,type:n}];a.indices[0]<s.indices[0]&&i.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&i.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(o,1,...i);break}}function Dn(e,n){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=n.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const An=e=>({...e,url:tt(e),user:{...e.user,url:xt(e),follow_url:En(e)},like_url:In(e),reply_url:kn(e),in_reply_to_url:e.in_reply_to_screen_name?Ln(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),Mn="_root_g9tkv_1",Vn="_rounded_g9tkv_6",Wn="_mediaWrapper_g9tkv_10",Bn="_grid2Columns_g9tkv_17",Pn="_grid3_g9tkv_20",Fn="_grid2x2_g9tkv_23",Un="_mediaContainer_g9tkv_26",zn="_mediaLink_g9tkv_34",Hn="_skeleton_g9tkv_38",Gn="_image_g9tkv_43",C={root:Mn,rounded:Vn,mediaWrapper:Wn,grid2Columns:Bn,grid3:Pn,grid2x2:Fn,mediaContainer:Un,mediaLink:zn,skeleton:Hn,image:Gn},Xn="_anchor_fp31d_1",Kn="_videoButton_fp31d_17",Qn="_videoButtonIcon_fp31d_35",Jn="_watchOnTwitter_fp31d_44",Yn="_viewReplies_fp31d_60",se={anchor:Xn,videoButton:Kn,videoButtonIcon:Qn,watchOnTwitter:Jn,viewReplies:Yn},Zn=({tweet:e,media:n})=>{const[r,s]=h.useState(!0),[o,a]=h.useState(!1),[i,c]=h.useState(!1),f=$n(n);let d=0;return t.jsxs(t.Fragment,{children:[t.jsx("video",{className:C.image,poster:vt(n,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{d&&window.clearTimeout(d),o||a(!0),i&&c(!1)},onPause:()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{o&&a(!1),d=0},100)},onEnded:()=>{c(!0)},children:t.jsx("source",{src:f.url,type:f.content_type})}),r&&t.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:v=>{const m=v.currentTarget.previousSibling;v.preventDefault(),s(!1),m.load(),m.play().then(()=>{a(!0),m.focus()}).catch(w=>{console.error("Error playing video:",w),s(!0),a(!1)})},children:t.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!i&&t.jsx("div",{className:se.watchOnTwitter,children:t.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),i&&t.jsx("a",{href:e.url,className:S.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},er=e=>t.jsx("img",{...e}),rt=(e,n)=>{let r=56.25;return n===1&&(r=100/e.original_info.width*e.original_info.height),n===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},gt=({tweet:e,components:n,quoted:r})=>{var s,o,a;const i=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var c;const f=(c=n==null?void 0:n.MediaImg)!=null?c:er;return t.jsx("div",{className:S.clsx(C.root,!r&&C.rounded),children:t.jsx("div",{className:S.clsx(C.mediaWrapper,i>1&&C.grid2Columns,i===3&&C.grid3,i>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(d=>t.jsx(h.Fragment,{children:d.type==="photo"?t.jsxs("a",{href:e.url,className:S.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:C.skeleton,style:rt(d,i)}),t.jsx(f,{src:vt(d,"small"),alt:d.ext_alt_text||"Image",className:C.image,draggable:!0})]},d.media_url_https):t.jsxs("div",{className:C.mediaContainer,children:[t.jsx("div",{className:C.skeleton,style:rt(d,i)}),t.jsx(Zn,{tweet:e,media:d})]},d.media_url_https)},d.media_url_https))})})},tr="_root_i24yn_1",nr={root:tr},rr=({tweet:e})=>{const n=new Date(e.created_at),r=Sn(n);return t.jsx("a",{className:nr.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:t.jsx("time",{dateTime:n.toISOString(),children:r})})},sr="_info_19qcj_1",or="_infoLink_19qcj_10",ir="_infoIcon_19qcj_30",be={info:sr,infoLink:or,infoIcon:ir},ar=({tweet:e})=>t.jsxs("div",{className:be.info,children:[t.jsx(rr,{tweet:e}),t.jsx("a",{className:be.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:be.infoIcon,children:t.jsx("g",{children:t.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),cr="_actions_n2anf_1",lr="_like_n2anf_13",dr="_reply_n2anf_14",ur="_copy_n2anf_15",fr="_likeIconWrapper_n2anf_27",hr="_likeCount_n2anf_30",_r="_replyIconWrapper_n2anf_35",mr="_copyIconWrapper_n2anf_36",pr="_likeIcon_n2anf_27",xr="_replyIcon_n2anf_35",vr="_copyIcon_n2anf_36",gr="_replyText_n2anf_56",jr="_copyText_n2anf_57",k={actions:cr,like:lr,reply:dr,copy:ur,likeIconWrapper:fr,likeCount:hr,replyIconWrapper:_r,copyIconWrapper:mr,likeIcon:pr,replyIcon:xr,copyIcon:vr,replyText:gr,copyText:jr},wr=({tweet:e})=>{const[n,r]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return h.useEffect(()=>{if(n){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[n]),t.jsxs("button",{type:"button",className:k.copy,"aria-label":"Copy link",onClick:s,children:[t.jsx("div",{className:k.copyIconWrapper,children:n?t.jsx("svg",{viewBox:"0 0 24 24",className:k.copyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):t.jsx("svg",{viewBox:"0 0 24 24",className:k.copyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),t.jsx("span",{className:k.copyText,children:n?"Copied!":"Copy link"})]})},yr=({tweet:e})=>{const n=Ce(e.favorite_count);return t.jsxs("div",{className:k.actions,children:[t.jsxs("a",{className:k.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${n} likes`,children:[t.jsx("div",{className:k.likeIconWrapper,children:t.jsx("svg",{viewBox:"0 0 24 24",className:k.likeIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),t.jsx("span",{className:k.likeCount,children:n})]}),t.jsxs("a",{className:k.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[t.jsx("div",{className:k.replyIconWrapper,children:t.jsx("svg",{viewBox:"0 0 24 24",className:k.replyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),t.jsx("span",{className:k.replyText,children:"Reply"})]}),t.jsx(wr,{tweet:e})]})},br="_replies_1cutb_1",Tr="_link_1cutb_4",Nr="_text_1cutb_23",Te={replies:br,link:Tr,text:Nr},Rr=({tweet:e})=>t.jsx("div",{className:Te.replies,children:t.jsx("a",{className:Te.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:t.jsx("span",{className:Te.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ce(e.conversation_count)} reply`:`Read ${Ce(e.conversation_count)} replies`})})}),Sr="_root_q5799_1",Ir="_article_q5799_16",st={root:Sr,article:Ir},kr=({tweet:e,children:n})=>t.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:t.jsx("article",{className:st.article,children:n})}),Er="_header_f00ab_1",Cr="_avatar_f00ab_11",Or="_avatarOverflow_f00ab_16",Lr="_avatarSquare_f00ab_23",qr="_author_f00ab_27",$r="_authorText_f00ab_33",Dr="_username_f00ab_40",K={header:Er,avatar:Cr,avatarOverflow:Or,avatarSquare:Lr,author:qr,authorText:$r,username:Dr},Ar=({tweet:e,components:n})=>{const{user:r}=e;var s;const o=(s=n==null?void 0:n.AvatarImg)!=null?s:ht;return t.jsxs("div",{className:K.header,children:[t.jsx("a",{href:e.url,className:K.avatar,target:"_blank",rel:"noopener noreferrer",children:t.jsx("div",{className:S.clsx(K.avatarOverflow,r.profile_image_shape==="Square"&&K.avatarSquare),children:t.jsx(o,{src:r.profile_image_url_https,alt:r.name,width:20,height:20})})}),t.jsxs("div",{className:K.author,children:[t.jsx("div",{className:K.authorText,children:t.jsx("span",{title:r.name,children:r.name})}),t.jsx(_t,{user:r}),t.jsx(mt,{user:r}),t.jsx("div",{className:K.username,children:t.jsxs("span",{title:`@${r.screen_name}`,children:["@",r.screen_name]})})]})]})},Mr="_root_175ot_1",Vr={root:Mr},Wr=({tweet:e})=>t.jsx("p",{className:Vr.root,lang:e.lang,dir:"auto",children:e.entities.map((n,r)=>t.jsx("span",{dangerouslySetInnerHTML:{__html:n.text}},r))}),Br=({tweet:e,components:n})=>{var r;return t.jsxs(kr,{tweet:e,children:[t.jsx(Ar,{tweet:e,components:n}),t.jsx(Wr,{tweet:e}),(r=e.mediaDetails)!=null&&r.length?t.jsx(gt,{quoted:!0,tweet:e}):null]})},Pr=({tweet:e,components:n})=>{var r;const s=h.useMemo(()=>An(e),[e]);return t.jsxs(Be,{children:[t.jsx(_n,{tweet:s,components:n}),s.in_reply_to_status_id_str&&t.jsx(xn,{tweet:s}),t.jsx(yn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?t.jsx(gt,{tweet:s,components:n}):null,s.quoted_tweet&&t.jsx(Br,{tweet:s.quoted_tweet,components:n}),t.jsx(ar,{tweet:s}),t.jsx(yr,{tweet:s}),t.jsx(Rr,{tweet:s})]})},Fr="_root_16yxa_1",Ur={root:Fr},zr=e=>t.jsx(Be,{children:t.jsxs("div",{className:Ur.root,children:[t.jsx("h3",{children:"Tweet not found"}),t.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Hr="_skeleton_oi7hr_1",Gr={skeleton:Hr},_e=({style:e})=>t.jsx("span",{className:Gr.skeleton,style:e}),Xr="_root_17qqv_1",Kr={root:Xr},Qr=()=>t.jsxs(Be,{className:Kr.root,children:[t.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),t.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),t.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),t.jsx(_e,{style:{height:"2rem"}}),t.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]}),jt=0,wt=1,yt=2,ot=3;var it=Object.prototype.hasOwnProperty;function Oe(e,n){var r,s;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((s=e.length)===n.length)for(;s--&&Oe(e[s],n[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(it.call(e,r)&&++s&&!it.call(n,r)||!(r in n)||!Oe(e[r],n[r]))return!1;return Object.keys(n).length===s}}return e!==e&&n!==n}const F=new WeakMap,U=()=>{},R=U(),Le=Object,u=e=>e===R,W=e=>typeof e=="function",z=(e,n)=>({...e,...n}),bt=e=>W(e.then),Ne={},me={},Pe="undefined",le=typeof window!=Pe,qe=typeof document!=Pe,Jr=le&&"Deno"in window,Yr=()=>le&&typeof window.requestAnimationFrame!=Pe,Tt=(e,n)=>{const r=F.get(e);return[()=>!u(n)&&e.get(n)||Ne,s=>{if(!u(n)){const o=e.get(n);n in me||(me[n]=o),r[5](n,z(o,s),o||Ne)}},r[6],()=>!u(n)&&n in me?me[n]:!u(n)&&e.get(n)||Ne]};let $e=!0;const Zr=()=>$e,[De,Ae]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[U,U],es=()=>{const e=qe&&document.visibilityState;return u(e)||e!=="hidden"},ts=e=>(qe&&document.addEventListener("visibilitychange",e),De("focus",e),()=>{qe&&document.removeEventListener("visibilitychange",e),Ae("focus",e)}),ns=e=>{const n=()=>{$e=!0,e()},r=()=>{$e=!1};return De("online",n),De("offline",r),()=>{Ae("online",n),Ae("offline",r)}},rs={isOnline:Zr,isVisible:es},ss={initFocus:ts,initReconnect:ns},at=!h.useId,oe=!le||Jr,os=e=>Yr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=oe?h.useEffect:h.useLayoutEffect,Se=typeof navigator<"u"&&navigator.connection,ct=!oe&&Se&&(["slow-2g","2g"].includes(Se.effectiveType)||Se.saveData),pe=new WeakMap,is=e=>Le.prototype.toString.call(e),Ie=(e,n)=>e===`[object ${n}]`;let as=0;const Me=e=>{const n=typeof e,r=is(e),s=Ie(r,"Date"),o=Ie(r,"RegExp"),a=Ie(r,"Object");let i,c;if(Le(e)===e&&!s&&!o){if(i=pe.get(e),i)return i;if(i=++as+"~",pe.set(e,i),Array.isArray(e)){for(i="@",c=0;c<e.length;c++)i+=Me(e[c])+",";pe.set(e,i)}if(a){i="#";const f=Le.keys(e).sort();for(;!u(c=f.pop());)u(e[c])||(i+=c+":"+Me(e[c])+",");pe.set(e,i)}}else i=s?e.toJSON():n=="symbol"?e.toString():n=="string"?JSON.stringify(e):""+e;return i},Fe=e=>{if(W(e))try{e=e()}catch{e=""}const n=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,n]};let cs=0;const Ve=()=>++cs;async function Nt(...e){const[n,r,s,o]=e,a=z({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=a.populateCache;const c=a.rollbackOnError;let f=a.optimisticData;const d=w=>typeof c=="function"?c(w):c!==!1,v=a.throwOnError;if(W(r)){const w=r,N=[],E=n.keys();for(const L of E)!/^\$(inf|sub)\$/.test(L)&&w(n.get(L)._k)&&N.push(L);return Promise.all(N.map(m))}return m(r);async function m(w){const[N]=Fe(w);if(!N)return;const[E,L]=Tt(n,N),[D,ie,l,de]=F.get(n),Q=()=>{const q=D[N];return(W(a.revalidate)?a.revalidate(E().data,w):a.revalidate!==!1)&&(delete l[N],delete de[N],q&&q[0])?q[0](yt).then(()=>E().data):E().data};if(e.length<3)return Q();let y=s,A,M=!1;const J=Ve();ie[N]=[J,0];const p=!u(f),Y=E(),V=Y.data,Z=Y._c,H=u(Z)?V:Z;if(p&&(f=W(f)?f(H,V):f,L({data:f,_c:H})),W(y))try{y=y(H)}catch(q){A=q,M=!0}if(y&&bt(y))if(y=await y.catch(q=>{A=q,M=!0}),J!==ie[N][0]){if(M)throw A;return y}else M&&p&&d(A)&&(i=!0,L({data:H,_c:R}));if(i&&!M)if(W(i)){const q=i(y,H);L({data:q,error:R,_c:R})}else L({data:y,error:R,_c:R});if(ie[N][1]=Ve(),Promise.resolve(Q()).then(()=>{L({_c:R})}),M){if(v)throw A;return}return y}}const lt=(e,n)=>{for(const r in e)e[r][0]&&e[r][0](n)},ls=(e,n)=>{if(!F.has(e)){const r=z(ss,n),s=Object.create(null),o=Nt.bind(R,e);let a=U;const i=Object.create(null),c=(v,m)=>{const w=i[v]||[];return i[v]=w,w.push(m),()=>w.splice(w.indexOf(m),1)},f=(v,m,w)=>{e.set(v,m);const N=i[v];if(N)for(const E of N)E(m,w)},d=()=>{if(!F.has(e)&&(F.set(e,[s,Object.create(null),Object.create(null),Object.create(null),o,f,c]),!oe)){const v=r.initFocus(setTimeout.bind(R,lt.bind(R,s,jt))),m=r.initReconnect(setTimeout.bind(R,lt.bind(R,s,wt)));a=()=>{v&&v(),m&&m(),F.delete(e)}}};return d(),[e,o,d,a]}return[e,F.get(e)[4]]},ds=(e,n,r,s,o)=>{const a=r.errorRetryCount,i=o.retryCount,c=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;!u(a)&&i>a||setTimeout(s,c,o)},us=Oe,[Rt,fs]=ls(new Map),hs=z({onLoadingSlow:U,onSuccess:U,onError:U,onErrorRetry:ds,onDiscarded:U,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ct?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ct?5e3:3e3,compare:us,isPaused:()=>!1,cache:Rt,mutate:fs,fallback:{}},rs),_s=(e,n)=>{const r=z(e,n);if(n){const{use:s,fallback:o}=e,{use:a,fallback:i}=n;s&&a&&(r.use=s.concat(a)),o&&i&&(r.fallback=z(o,i))}return r},ms=h.createContext({}),ps="$inf$",St=le&&window.__SWR_DEVTOOLS_USE__,xs=St?window.__SWR_DEVTOOLS_USE__:[],vs=()=>{St&&(window.__SWR_DEVTOOLS_REACT__=h)},gs=e=>W(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],js=()=>{const e=h.useContext(ms);return h.useMemo(()=>z(hs,e),[e])},ws=e=>(n,r,s)=>e(n,r&&((...a)=>{const[i]=Fe(n),[,,,c]=F.get(Rt);if(i.startsWith(ps))return r(...a);const f=c[i];return u(f)?r(...a):(delete c[i],f)}),s),ys=xs.concat(ws),bs=e=>function(...r){const s=js(),[o,a,i]=gs(r),c=_s(s,i);let f=e;const{use:d}=c,v=(d||[]).concat(ys);for(let m=v.length;m--;)f=v[m](f);return f(o,a||c.fetcher||null,c)},Ts=(e,n,r)=>{const s=n[e]||(n[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};vs();const ke=h.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e}}),Ee={dedupe:!0},dt=Promise.resolve(R),Ns=(e,n,r)=>{const{cache:s,compare:o,suspense:a,fallbackData:i,revalidateOnMount:c,revalidateIfStale:f,refreshInterval:d,refreshWhenHidden:v,refreshWhenOffline:m,keepPreviousData:w,strictServerPrefetchWarning:N}=r,[E,L,D,ie]=F.get(s),[l,de]=Fe(e),Q=h.useRef(!1),y=h.useRef(!1),A=h.useRef(l),M=h.useRef(n),J=h.useRef(r),p=()=>J.current,Y=()=>p().isVisible()&&p().isOnline(),[V,Z,H,q]=Tt(s,l),ee=h.useRef({}).current,ue=u(i)?u(r.fallback)?R:r.fallback[l]:i,ze=(_,x)=>{for(const j in ee){const g=j;if(g==="data"){if(!o(_[g],x[g])&&(!u(_[g])||!o(he,x[g])))return!1}else if(x[g]!==_[g])return!1}return!0},He=h.useMemo(()=>{const _=!l||!n?!1:u(c)?p().isPaused()||a?!1:f!==!1:c,x=I=>{const B=z(I);return delete B._k,_?{isValidating:!0,isLoading:!0,...B}:B},j=V(),g=q(),$=x(j),re=j===g?$:x(g);let b=$;return[()=>{const I=x(V());return ze(I,b)?(b.data=I.data,b.isLoading=I.isLoading,b.isValidating=I.isValidating,b.error=I.error,b):(b=I,I)},()=>re]},[s,l]),te=S.shimExports.useSyncExternalStore(h.useCallback(_=>H(l,(x,j)=>{ze(j,x)||_()}),[s,l]),He[0],He[1]),Ge=!Q.current,kt=E[l]&&E[l].length>0,ne=te.data,G=u(ne)?ue&&bt(ue)?ke(ue):ue:ne,fe=te.error,xe=h.useRef(G),he=w?u(ne)?u(xe.current)?G:xe.current:ne:G,X=l&&u(G),Et=!oe&&S.shimExports.useSyncExternalStore(()=>U,()=>!1,()=>!0);N&&Et&&!a&&X&&console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Xe=kt&&!u(fe)?!1:Ge&&!u(c)?c:p().isPaused()?!1:a?u(G)?!1:f:u(G)||f,Ke=!!(l&&n&&Ge&&Xe),Ct=u(te.isValidating)?Ke:te.isValidating,Ot=u(te.isLoading)?Ke:te.isLoading,ae=h.useCallback(async _=>{const x=M.current;if(!l||!x||y.current||p().isPaused())return!1;let j,g,$=!0;const re=_||{},b=!D[l]||!re.dedupe,I=()=>at?!y.current&&l===A.current&&Q.current:l===A.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const O=D[l];O&&O[1]===g&&delete D[l]},Ze={isValidating:!0};u(V().data)&&(Ze.isLoading=!0);try{if(b&&(Z(Ze),r.loadingTimeout&&u(V().data)&&setTimeout(()=>{$&&I()&&p().onLoadingSlow(l,r)},r.loadingTimeout),D[l]=[x(de),Ve()]),[j,g]=D[l],j=await j,b&&setTimeout(Ye,r.dedupingInterval),!D[l]||D[l][1]!==g)return b&&I()&&p().onDiscarded(l),!1;B.error=R;const O=L[l];if(!u(O)&&(g<=O[0]||g<=O[1]||O[1]===0))return Je(),b&&I()&&p().onDiscarded(l),!1;const P=V().data;B.data=o(P,j)?P:j,b&&I()&&p().onSuccess(j,l,r)}catch(O){Ye();const P=p(),{shouldRetryOnError:ve}=P;P.isPaused()||(B.error=O,b&&I()&&(P.onError(O,l,P),(ve===!0||W(ve)&&ve(O))&&(!p().revalidateOnFocus||!p().revalidateOnReconnect||Y())&&P.onErrorRetry(O,l,P,Lt=>{const ge=E[l];ge&&ge[0]&&ge[0](ot,Lt)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return $=!1,Je(),!0},[l,s]),Qe=h.useCallback((..._)=>Nt(s,A.current,..._),[]);if(Re(()=>{M.current=n,J.current=r,u(ne)||(xe.current=ne)}),Re(()=>{if(!l)return;const _=ae.bind(R,Ee);let x=0;p().revalidateOnFocus&&(x=Date.now()+p().focusThrottleInterval);const g=Ts(l,E,($,re={})=>{if($==jt){const b=Date.now();p().revalidateOnFocus&&b>x&&Y()&&(x=b+p().focusThrottleInterval,_())}else if($==wt)p().revalidateOnReconnect&&Y()&&_();else{if($==yt)return ae();if($==ot)return ae(re)}});return y.current=!1,A.current=l,Q.current=!0,Z({_k:de}),Xe&&(D[l]||(u(G)||oe?_():os(_))),()=>{y.current=!0,g()}},[l]),Re(()=>{let _;function x(){const g=W(d)?d(V().data):d;g&&_!==-1&&(_=setTimeout(j,g))}function j(){!V().error&&(v||p().isVisible())&&(m||p().isOnline())?ae(Ee).then(x):x()}return x(),()=>{_&&(clearTimeout(_),_=-1)}},[d,v,m,l]),h.useDebugValue(he),a){if(!at&&oe&&X)throw new Error("Fallback data is required when using Suspense in SSR.");X&&(M.current=n,J.current=r,y.current=!1);const _=ie[l],x=!u(_)&&X?Qe(_):dt;if(ke(x),!u(fe)&&X)throw fe;const j=X?ae(Ee):dt;!u(he)&&X&&(j.status="fulfilled",j.value=!0),ke(j)}return{mutate:Qe,get data(){return ee.data=!0,he},get error(){return ee.error=!0,fe},get isValidating(){return ee.isValidating=!0,Ct},get isLoading(){return ee.isLoading=!0,Ot}}},ut=bs(Ns);class Rs extends Error{constructor({message:n,status:r,data:s}){super(n),this.name="TwitterApiError",this.status=r,this.data=s}}const Ss=ut.default||ut,Is="https://react-tweet.vercel.app";async function ks([e,n]){const r=await fetch(e,n),s=await r.json();if(r.ok)return s.data||null;throw new Rs({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const Es=(e,n,r)=>{const{isLoading:s,data:o,error:a}=Ss(()=>n||e?[n||e&&`${Is}/api/tweet/${e}`,r]:null,ks,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!a),data:o,error:a}},Cs=({id:e,apiUrl:n,fallback:r=t.jsx(Qr,{}),components:s,fetchOptions:o,onError:a})=>{const{data:i,error:c,isLoading:f}=Es(e,n,o);if(f)return r;if(c||!i){const d=(s==null?void 0:s.TweetNotFound)||zr;return t.jsx(d,{error:a?a(c):c})}return t.jsx(Pr,{tweet:i,components:s})};function Os({node:e}){var s;const n=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=n==null?void 0:n.split("/").pop();return r?t.jsx(S.NodeViewWrapper,{children:t.jsx("div",{"data-twitter":"",children:t.jsx(Cs,{id:r})})}):null}function It(e){const{t:n}=$t.useLocale(),[r,s]=h.useState("");h.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:i}=(a=e.editor)==null?void 0:a.getAttributes(Ue.name);i&&s(i)}},[e==null?void 0:e.editor]);function o(a){a.preventDefault(),a.stopPropagation(),e==null||e.onSetLink(r)}return t.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:o,children:[t.jsx(Dt.Label,{className:"mb-[6px]",children:n("editor.link.dialog.text")}),t.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:t.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:t.jsx(At.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),t.jsx(Mt.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:n("editor.link.dialog.button.apply")})]})}function Ls(){const[e,n]=h.useState(!1),r=je.useEditorInstance(),s=je.useButtonProps(Ue.name),{icon:o=void 0,tooltip:a=void 0,tooltipOptions:i={},action:c=void 0,isActive:f=void 0}=(s==null?void 0:s.componentProps)??{},{editorDisabled:d}=je.useToggleActive(f);function v(m){d||c&&(c(m),n(!1))}return t.jsxs(we.Popover,{modal:!0,onOpenChange:n,open:e,children:[t.jsx(we.PopoverTrigger,{asChild:!0,children:t.jsx(qt.ActionButton,{disabled:d,isActive:f,tooltip:a,tooltipOptions:i,children:t.jsx(Vt.IconComponent,{name:o})})}),t.jsx(we.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:t.jsx(It,{editor:r,onSetLink:v})})]})}const qs=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,$s=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ft(e){return e.match($s)}const Ue=S.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t:n})=>({componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:n("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return S.ReactNodeViewRenderer(Os,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:n})=>ft(e.src)?n.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:n})=>ft(e.src)?n.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[S.nodePasteRule({find:qs,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",S.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=It;exports.RichTextTwitter=Ls;exports.Twitter=Ue;